- Move more stuff to wdm.h
authorAmine Khaldi <amine.khaldi@reactos.org>
Wed, 3 Mar 2010 18:30:50 +0000 (18:30 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Wed, 3 Mar 2010 18:30:50 +0000 (18:30 +0000)
- Improve IoIs32bitProcess and more Io* definitions
- Convert IoMarkIrpPending to an inline function- Move more stuff to wdm.h

svn path=/branches/header-work/; revision=45795

include/ddk/wdm.h
include/ddk/winddk.h

index bfedc8e..f7d53fd 100644 (file)
@@ -6490,6 +6490,90 @@ IoInitializeTimer(
   IN PIO_TIMER_ROUTINE  TimerRoutine,
   IN PVOID  Context OPTIONAL);
 
+NTKERNELAPI
+VOID
+IoInvalidateDeviceRelations(
+  IN PDEVICE_OBJECT  DeviceObject,
+  IN DEVICE_RELATION_TYPE  Type);
+
+NTKERNELAPI
+VOID
+IoInvalidateDeviceState(
+  IN PDEVICE_OBJECT  PhysicalDeviceObject);
+
+NTKERNELAPI
+BOOLEAN
+IoIsWdmVersionAvailable(
+  IN UCHAR  MajorVersion,
+  IN UCHAR  MinorVersion);
+
+NTKERNELAPI
+NTSTATUS
+IoOpenDeviceInterfaceRegistryKey(
+  IN PUNICODE_STRING  SymbolicLinkName,
+  IN ACCESS_MASK  DesiredAccess,
+  OUT PHANDLE  DeviceInterfaceKey);
+
+NTKERNELAPI
+NTSTATUS
+IoOpenDeviceRegistryKey(
+  IN PDEVICE_OBJECT  DeviceObject,
+  IN ULONG  DevInstKeyType,
+  IN ACCESS_MASK  DesiredAccess,
+  OUT PHANDLE  DevInstRegKey);
+
+NTKERNELAPI
+NTSTATUS
+NTAPI
+IoRegisterDeviceInterface(
+  IN PDEVICE_OBJECT  PhysicalDeviceObject,
+  IN CONST GUID  *InterfaceClassGuid,
+  IN PUNICODE_STRING  ReferenceString  OPTIONAL,
+  OUT PUNICODE_STRING  SymbolicLinkName);
+
+NTKERNELAPI
+NTSTATUS
+IoRegisterPlugPlayNotification(
+  IN IO_NOTIFICATION_EVENT_CATEGORY  EventCategory,
+  IN ULONG  EventCategoryFlags,
+  IN PVOID  EventCategoryData  OPTIONAL,
+  IN PDRIVER_OBJECT  DriverObject,
+  IN PDRIVER_NOTIFICATION_CALLBACK_ROUTINE  CallbackRoutine,
+  IN OUT PVOID  Context OPTIONAL,
+  OUT PVOID  *NotificationEntry);
+
+NTKERNELAPI
+NTSTATUS
+IoRegisterShutdownNotification(
+  IN PDEVICE_OBJECT  DeviceObject);
+
+NTKERNELAPI
+VOID
+IoReleaseCancelSpinLock(
+  IN KIRQL  Irql);
+
+NTKERNELAPI
+VOID
+NTAPI
+IoReleaseRemoveLockAndWaitEx(
+  IN PIO_REMOVE_LOCK  RemoveLock,
+  IN PVOID  Tag OPTIONAL,
+  IN ULONG  RemlockSize);
+
+NTKERNELAPI
+VOID
+NTAPI
+IoReleaseRemoveLockEx(
+  IN PIO_REMOVE_LOCK  RemoveLock,
+  IN PVOID  Tag OPTIONAL,
+  IN ULONG  RemlockSize);
+
+NTKERNELAPI
+VOID
+IoRemoveShareAccess(
+  IN PFILE_OBJECT  FileObject,
+  IN OUT PSHARE_ACCESS  ShareAccess);
+
 #endif
 
 #if (NTDDI_VERSION >= NTDDI_WINXP)
@@ -6539,6 +6623,61 @@ IoFreeErrorLogEntry(
 
 #endif
 
+/*
+ * VOID
+ * IoReleaseRemoveLock(
+ *   IN PIO_REMOVE_LOCK  RemoveLock,
+ *   IN PVOID  Tag)
+ */
+#define IoReleaseRemoveLock(_RemoveLock, \
+                            _Tag) \
+  IoReleaseRemoveLockEx(_RemoveLock, _Tag, sizeof(IO_REMOVE_LOCK))
+
+/*
+ * VOID
+ * IoReleaseRemoveLockAndWait(
+ *   IN PIO_REMOVE_LOCK  RemoveLock,
+ *   IN PVOID  Tag)
+ */
+#define IoReleaseRemoveLockAndWait(_RemoveLock, \
+                                   _Tag) \
+  IoReleaseRemoveLockAndWaitEx(_RemoveLock, _Tag, sizeof(IO_REMOVE_LOCK))
+
+#if defined(_WIN64)
+
+NTKERNELAPI
+BOOLEAN
+IoIs32bitProcess(
+  IN PIRP  Irp  OPTIONAL);
+
+#endif
+
+#define PLUGPLAY_REGKEY_DEVICE                            1
+#define PLUGPLAY_REGKEY_DRIVER                            2
+#define PLUGPLAY_REGKEY_CURRENT_HWPROFILE                 4
+
+FORCEINLINE
+VOID
+IoMarkIrpPending(
+  IN OUT PIRP Irp)
+{
+  IoGetCurrentIrpStackLocation( (Irp) )->Control |= SL_PENDING_RETURNED;
+}
+
+/*
+ * BOOLEAN
+ * IoIsErrorUserInduced(
+ *   IN NTSTATUS  Status);
+ */
+#define IoIsErrorUserInduced(Status) \
+   ((BOOLEAN)(((Status) == STATUS_DEVICE_NOT_READY) || \
+   ((Status) == STATUS_IO_TIMEOUT) || \
+   ((Status) == STATUS_MEDIA_WRITE_PROTECTED) || \
+   ((Status) == STATUS_NO_MEDIA_IN_DEVICE) || \
+   ((Status) == STATUS_VERIFY_REQUIRED) || \
+   ((Status) == STATUS_UNRECOGNIZED_MEDIA) || \
+   ((Status) == STATUS_WRONG_VOLUME)))
+
 /* VOID
  * IoInitializeRemoveLock(
  *   IN PIO_REMOVE_LOCK  Lock,
index 3792403..d235639 100644 (file)
@@ -2631,46 +2631,6 @@ NTAPI
 IoGetFileObjectGenericMapping(
   VOID);
 
-NTKERNELAPI
-VOID
-NTAPI
-IoInvalidateDeviceRelations(
-  IN PDEVICE_OBJECT  DeviceObject,
-  IN DEVICE_RELATION_TYPE  Type);
-
-NTKERNELAPI
-VOID
-NTAPI
-IoInvalidateDeviceState(
-  IN PDEVICE_OBJECT  PhysicalDeviceObject);
-
-NTKERNELAPI
-BOOLEAN
-NTAPI
-IoIs32bitProcess(
-  IN PIRP  Irp  OPTIONAL);
-
-/*
- * BOOLEAN
- * IoIsErrorUserInduced(
- *   IN NTSTATUS  Status);
- */
-#define IoIsErrorUserInduced(Status) \
-   ((BOOLEAN)(((Status) == STATUS_DEVICE_NOT_READY) || \
-   ((Status) == STATUS_IO_TIMEOUT) || \
-   ((Status) == STATUS_MEDIA_WRITE_PROTECTED) || \
-   ((Status) == STATUS_NO_MEDIA_IN_DEVICE) || \
-   ((Status) == STATUS_VERIFY_REQUIRED) || \
-   ((Status) == STATUS_UNRECOGNIZED_MEDIA) || \
-   ((Status) == STATUS_WRONG_VOLUME)))
-
-NTKERNELAPI
-BOOLEAN
-NTAPI
-IoIsWdmVersionAvailable(
-  IN UCHAR  MajorVersion,
-  IN UCHAR  MinorVersion);
-
 NTKERNELAPI
 PIRP
 NTAPI
@@ -2678,35 +2638,6 @@ IoMakeAssociatedIrp(
   IN PIRP  Irp,
   IN CCHAR  StackSize);
 
-/*
- * VOID
- * IoMarkIrpPending(
- *   IN OUT PIRP  Irp)
- */
-#define IoMarkIrpPending(_Irp) \
-  (IoGetCurrentIrpStackLocation(_Irp)->Control |= SL_PENDING_RETURNED)
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoOpenDeviceInterfaceRegistryKey(
-  IN PUNICODE_STRING  SymbolicLinkName,
-  IN ACCESS_MASK  DesiredAccess,
-  OUT PHANDLE  DeviceInterfaceKey);
-
-#define PLUGPLAY_REGKEY_DEVICE                            1
-#define PLUGPLAY_REGKEY_DRIVER                            2
-#define PLUGPLAY_REGKEY_CURRENT_HWPROFILE                 4
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoOpenDeviceRegistryKey(
-  IN PDEVICE_OBJECT  DeviceObject,
-  IN ULONG  DevInstKeyType,
-  IN ACCESS_MASK  DesiredAccess,
-  OUT PHANDLE  DevInstRegKey);
-
 NTKERNELAPI
 NTSTATUS
 NTAPI
@@ -2776,15 +2707,6 @@ IoRegisterBootDriverReinitialization(
   IN PDRIVER_REINITIALIZE  DriverReinitializationRoutine,
   IN PVOID  Context);
 
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoRegisterDeviceInterface(
-  IN PDEVICE_OBJECT  PhysicalDeviceObject,
-  IN CONST GUID  *InterfaceClassGuid,
-  IN PUNICODE_STRING  ReferenceString  OPTIONAL,
-  OUT PUNICODE_STRING  SymbolicLinkName);
-
 NTKERNELAPI
 VOID
 NTAPI
@@ -2793,73 +2715,6 @@ IoRegisterDriverReinitialization(
   IN PDRIVER_REINITIALIZE  DriverReinitializationRoutine,
   IN PVOID  Context);
 
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoRegisterPlugPlayNotification(
-  IN IO_NOTIFICATION_EVENT_CATEGORY  EventCategory,
-  IN ULONG  EventCategoryFlags,
-  IN PVOID  EventCategoryData  OPTIONAL,
-  IN PDRIVER_OBJECT  DriverObject,
-  IN PDRIVER_NOTIFICATION_CALLBACK_ROUTINE  CallbackRoutine,
-  IN PVOID  Context,
-  OUT PVOID  *NotificationEntry);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoRegisterShutdownNotification(
-  IN PDEVICE_OBJECT  DeviceObject);
-
-NTKERNELAPI
-VOID
-NTAPI
-IoReleaseCancelSpinLock(
-  IN KIRQL  Irql);
-
-NTKERNELAPI
-VOID
-NTAPI
-IoReleaseRemoveLockAndWaitEx(
-  IN PIO_REMOVE_LOCK  RemoveLock,
-  IN PVOID  Tag,
-  IN ULONG  RemlockSize);
-
-NTKERNELAPI
-VOID
-NTAPI
-IoReleaseRemoveLockEx(
-  IN PIO_REMOVE_LOCK  RemoveLock,
-  IN PVOID  Tag,
-  IN ULONG  RemlockSize);
-
-/*
- * VOID
- * IoReleaseRemoveLock(
- *   IN PIO_REMOVE_LOCK  RemoveLock,
- *   IN PVOID  Tag)
- */
-#define IoReleaseRemoveLock(_RemoveLock, \
-                            _Tag) \
-  IoReleaseRemoveLockEx(_RemoveLock, _Tag, sizeof(IO_REMOVE_LOCK))
-
-/*
- * VOID
- * IoReleaseRemoveLockAndWait(
- *   IN PIO_REMOVE_LOCK  RemoveLock,
- *   IN PVOID  Tag)
- */
-#define IoReleaseRemoveLockAndWait(_RemoveLock, \
-                                   _Tag) \
-  IoReleaseRemoveLockAndWaitEx(_RemoveLock, _Tag, sizeof(IO_REMOVE_LOCK))
-
-NTKERNELAPI
-VOID
-NTAPI
-IoRemoveShareAccess(
-  IN PFILE_OBJECT  FileObject,
-  IN OUT PSHARE_ACCESS  ShareAccess);
-
 NTKERNELAPI
 NTSTATUS
 NTAPI