Author: pschweitzer
Date: Fri May 1 17:24:05 2009
New Revision: 40761
URL:
http://svn.reactos.org/svn/reactos?rev=40761&view=rev
Log:
- Added a macro to check whether a PDO is valid (for PNP manager)
- Started implementing IoReportTargetDeviceChange() using that macro and checking basic
stuff.
That's kind of test.
Modified:
branches/pierre-fsd/ntoskrnl/include/internal/io.h
branches/pierre-fsd/ntoskrnl/io/pnpmgr/pnpreport.c
Modified: branches/pierre-fsd/ntoskrnl/include/internal/io.h
URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/ntoskrnl/include/int…
==============================================================================
--- branches/pierre-fsd/ntoskrnl/include/internal/io.h [iso-8859-1] (original)
+++ branches/pierre-fsd/ntoskrnl/include/internal/io.h [iso-8859-1] Fri May 1 17:24:05
2009
@@ -204,6 +204,16 @@
(_DeviceNode); \
(_DeviceTreeTraverseContext)->Action = (_Action); \
(_DeviceTreeTraverseContext)->Context = (_Context); }
+
+/*
+ * B00LEAN
+ * IopIsValidPhysicalDeviceObject(
+ * IN PDEVICE_OBJECT PhysicalDeviceObject);
+ */
+#define IopIsValidPhysicalDeviceObject(PhysicalDeviceObject)
\
+ (((PEXTENDED_DEVOBJ_EXTENSION)PhysicalDeviceObject) &&
\
+
(((PEXTENDED_DEVOBJ_EXTENSION)PhysicalDeviceObject->DeviceObjectExtension)->DeviceNode)
&& \
+
(((PEXTENDED_DEVOBJ_EXTENSION)PhysicalDeviceObject->DeviceObjectExtension)->DeviceNode->Flags
& DNF_ENUMERATED))
//
// Device List Operations
@@ -450,6 +460,12 @@
PVOID Context;
} DEVICETREE_TRAVERSE_CONTEXT, *PDEVICETREE_TRAVERSE_CONTEXT;
+typedef struct _INT_FILE_OBJECT_FILTER_CONTEXT
+{
+ FAST_MUTEX FastMutex;
+ LIST_ENTRY FilterContexts;
+} INT_FILE_OBJECT_FILTER_CONTEXT, * PINT_FILE_OBJECT_FILTER_CONTEXT;
+
//
// PNP Routines
//
@@ -968,6 +984,23 @@
IN ULONG SystemHandleCount
);
+/* FIXME: Should be moved to NDK */
+#if 1
+BOOLEAN
+NTAPI
+IoChangeFileObjectFilterContext(
+ IN PFILE_OBJECT FileObject,
+ IN PINT_FILE_OBJECT_FILTER_CONTEXT FilterContext,
+ IN ULONG Unknown
+);
+
+PINT_FILE_OBJECT_FILTER_CONTEXT
+NTAPI
+IoGetFileObjectFilterContext(
+ IN PFILE_OBJECT FileObject
+);
+#endif
+
//
// I/O Timer Routines
//
Modified: branches/pierre-fsd/ntoskrnl/io/pnpmgr/pnpreport.c
URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/ntoskrnl/io/pnpmgr/p…
==============================================================================
--- branches/pierre-fsd/ntoskrnl/io/pnpmgr/pnpreport.c [iso-8859-1] (original)
+++ branches/pierre-fsd/ntoskrnl/io/pnpmgr/pnpreport.c [iso-8859-1] Fri May 1 17:24:05
2009
@@ -106,6 +106,23 @@
IN PDEVICE_OBJECT PhysicalDeviceObject,
IN PVOID NotificationStructure)
{
+ PTARGET_DEVICE_CUSTOM_NOTIFICATION IntNotificationStructure;
+
+ ASSERT(NotificationStructure);
+
+ if (!IopIsValidPhysicalDeviceObject(PhysicalDeviceObject))
+ {
+ KeBugCheckEx(PNP_DETECTED_FATAL_ERROR, 0x2, (ULONG)PhysicalDeviceObject, 0, 0);
+ }
+
+ IntNotificationStructure = (PTARGET_DEVICE_CUSTOM_NOTIFICATION)NotificationStructure;
+ if (RtlCompareMemory(&(IntNotificationStructure->Event),
&(GUID_TARGET_DEVICE_QUERY_REMOVE), sizeof(GUID)) ||
+ RtlCompareMemory(&(IntNotificationStructure->Event),
&(GUID_TARGET_DEVICE_REMOVE_CANCELLED), sizeof(GUID)) ||
+ RtlCompareMemory(&(IntNotificationStructure->Event),
&(GUID_TARGET_DEVICE_REMOVE_COMPLETE), sizeof(GUID)))
+ {
+ return STATUS_INVALID_DEVICE_REQUEST;
+ }
+
DPRINT1("IoReportTargetDeviceChange called (UNIMPLEMENTED)\n");
return STATUS_NOT_IMPLEMENTED;
}