Author: akhaldi
Date: Wed Mar 3 19:01:23 2010
New Revision: 45794
URL:
http://svn.reactos.org/svn/reactos?rev=45794&view=rev
Log:
- Move more stuff to wdm.h
- Improve more Io* definitions
- Fix KeInitializeDpc
- IoCreateFile and everywhere related : ExtraCreateParameters -> InternalParameters
- IoQueueWorkItem and everywhere related : Routine -> WorkerRoutine and pIoWorkItem
-> IoWorkItem
Modified:
branches/header-work/include/ddk/wdm.h
branches/header-work/include/ddk/winddk.h
branches/header-work/ntoskrnl/io/iomgr/file.c
Modified: branches/header-work/include/ddk/wdm.h
URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/wdm.h?r…
==============================================================================
--- branches/header-work/include/ddk/wdm.h [iso-8859-1] (original)
+++ branches/header-work/include/ddk/wdm.h [iso-8859-1] Wed Mar 3 19:01:23 2010
@@ -6294,7 +6294,283 @@
IN BOOLEAN Exclusive,
OUT PDEVICE_OBJECT *DeviceObject);
+NTKERNELAPI
+NTSTATUS
+IoCreateFile(
+ OUT PHANDLE FileHandle,
+ IN ACCESS_MASK DesiredAccess,
+ IN POBJECT_ATTRIBUTES ObjectAttributes,
+ OUT PIO_STATUS_BLOCK IoStatusBlock,
+ IN PLARGE_INTEGER AllocationSize OPTIONAL,
+ IN ULONG FileAttributes,
+ IN ULONG ShareAccess,
+ IN ULONG Disposition,
+ IN ULONG CreateOptions,
+ IN PVOID EaBuffer OPTIONAL,
+ IN ULONG EaLength,
+ IN CREATE_FILE_TYPE CreateFileType,
+ IN PVOID InternalParameters OPTIONAL,
+ IN ULONG Options);
+
+NTKERNELAPI
+PKEVENT
+IoCreateNotificationEvent(
+ IN PUNICODE_STRING EventName,
+ OUT PHANDLE EventHandle);
+
+NTKERNELAPI
+NTSTATUS
+IoCreateSymbolicLink(
+ IN PUNICODE_STRING SymbolicLinkName,
+ IN PUNICODE_STRING DeviceName);
+
+NTKERNELAPI
+PKEVENT
+IoCreateSynchronizationEvent(
+ IN PUNICODE_STRING EventName,
+ OUT PHANDLE EventHandle);
+
+NTKERNELAPI
+NTSTATUS
+IoCreateUnprotectedSymbolicLink(
+ IN PUNICODE_STRING SymbolicLinkName,
+ IN PUNICODE_STRING DeviceName);
+
+NTKERNELAPI
+VOID
+IoDeleteDevice(
+ IN PDEVICE_OBJECT DeviceObject);
+
+NTKERNELAPI
+NTSTATUS
+IoDeleteSymbolicLink(
+ IN PUNICODE_STRING SymbolicLinkName);
+
+NTKERNELAPI
+VOID
+IoDetachDevice(
+ IN OUT PDEVICE_OBJECT TargetDevice);
+
+NTKERNELAPI
+VOID
+IoDisconnectInterrupt(
+ IN PKINTERRUPT InterruptObject);
+
+NTKERNELAPI
+VOID
+IoFreeIrp(
+ IN PIRP Irp);
+
+NTKERNELAPI
+VOID
+IoFreeMdl(
+ IN PMDL Mdl);
+
+NTKERNELAPI
+VOID
+IoFreeWorkItem(
+ IN PIO_WORKITEM IoWorkItem);
+
+NTKERNELAPI
+PDEVICE_OBJECT
+NTAPI
+IoGetAttachedDevice(
+ IN PDEVICE_OBJECT DeviceObject);
+
+NTKERNELAPI
+PDEVICE_OBJECT
+IoGetAttachedDeviceReference(
+ IN PDEVICE_OBJECT DeviceObject);
+
+NTKERNELAPI
+NTSTATUS
+IoGetBootDiskInformation(
+ IN OUT PBOOTDISK_INFORMATION BootDiskInformation,
+ IN ULONG Size);
+
+NTKERNELAPI
+NTSTATUS
+NTAPI
+IoGetDeviceInterfaceAlias(
+ IN PUNICODE_STRING SymbolicLinkName,
+ IN CONST GUID *AliasInterfaceClassGuid,
+ OUT PUNICODE_STRING AliasSymbolicLinkName);
+
+NTKERNELAPI
+PEPROCESS
+IoGetCurrentProcess(
+ VOID);
+
+NTKERNELAPI
+NTSTATUS
+NTAPI
+IoGetDeviceInterfaces(
+ IN CONST GUID *InterfaceClassGuid,
+ IN PDEVICE_OBJECT PhysicalDeviceObject OPTIONAL,
+ IN ULONG Flags,
+ OUT PWSTR *SymbolicLinkList);
+
+NTKERNELAPI
+NTSTATUS
+IoGetDeviceObjectPointer(
+ IN PUNICODE_STRING ObjectName,
+ IN ACCESS_MASK DesiredAccess,
+ OUT PFILE_OBJECT *FileObject,
+ OUT PDEVICE_OBJECT *DeviceObject);
+
+NTKERNELAPI
+NTSTATUS
+IoGetDeviceProperty(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN DEVICE_REGISTRY_PROPERTY DeviceProperty,
+ IN ULONG BufferLength,
+ OUT PVOID PropertyBuffer,
+ OUT PULONG ResultLength);
+
+NTKERNELAPI
+PDMA_ADAPTER
+IoGetDmaAdapter(
+ IN PDEVICE_OBJECT PhysicalDeviceObject OPTIONAL,
+ IN PDEVICE_DESCRIPTION DeviceDescription,
+ IN OUT PULONG NumberOfMapRegisters);
+
+NTKERNELAPI
+PVOID
+IoGetDriverObjectExtension(
+ IN PDRIVER_OBJECT DriverObject,
+ IN PVOID ClientIdentificationAddress);
+
+NTKERNELAPI
+PVOID
+IoGetInitialStack(
+ VOID);
+
+NTKERNELAPI
+PDEVICE_OBJECT
+IoGetRelatedDeviceObject(
+ IN PFILE_OBJECT FileObject);
+
+NTKERNELAPI
+VOID
+IoQueueWorkItem(
+ IN PIO_WORKITEM IoWorkItem,
+ IN PIO_WORKITEM_ROUTINE WorkerRoutine,
+ IN WORK_QUEUE_TYPE QueueType,
+ IN PVOID Context OPTIONAL);
+
+NTKERNELAPI
+VOID
+KeInitializeDpc(
+ OUT PRKDPC Dpc,
+ IN PKDEFERRED_ROUTINE DeferredRoutine,
+ IN PVOID DeferredContext OPTIONAL);
+
+NTKERNELAPI
+VOID
+IoInitializeIrp(
+ IN OUT PIRP Irp,
+ IN USHORT PacketSize,
+ IN CCHAR StackSize);
+
+NTKERNELAPI
+VOID
+NTAPI
+IoInitializeRemoveLockEx(
+ IN PIO_REMOVE_LOCK Lock,
+ IN ULONG AllocateTag,
+ IN ULONG MaxLockedMinutes,
+ IN ULONG HighWatermark,
+ IN ULONG RemlockSize);
+
+NTKERNELAPI
+NTSTATUS
+NTAPI
+IoInitializeTimer(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PIO_TIMER_ROUTINE TimerRoutine,
+ IN PVOID Context OPTIONAL);
+
#endif
+
+#if (NTDDI_VERSION >= NTDDI_WINXP)
+
+NTKERNELAPI
+NTSTATUS
+IoCsqInitialize(
+ IN PIO_CSQ Csq,
+ IN PIO_CSQ_INSERT_IRP CsqInsertIrp,
+ IN PIO_CSQ_REMOVE_IRP CsqRemoveIrp,
+ IN PIO_CSQ_PEEK_NEXT_IRP CsqPeekNextIrp,
+ IN PIO_CSQ_ACQUIRE_LOCK CsqAcquireLock,
+ IN PIO_CSQ_RELEASE_LOCK CsqReleaseLock,
+ IN PIO_CSQ_COMPLETE_CANCELED_IRP CsqCompleteCanceledIrp);
+
+NTKERNELAPI
+VOID
+IoCsqInsertIrp(
+ IN PIO_CSQ Csq,
+ IN PIRP Irp,
+ IN PIO_CSQ_IRP_CONTEXT Context OPTIONAL);
+
+NTKERNELAPI
+PIRP
+IoCsqRemoveIrp(
+ IN PIO_CSQ Csq,
+ IN PIO_CSQ_IRP_CONTEXT Context);
+
+NTKERNELAPI
+PIRP
+IoCsqRemoveNextIrp(
+ IN PIO_CSQ Csq,
+ IN PVOID PeekContext);
+
+NTKERNELAPI
+BOOLEAN
+IoForwardIrpSynchronously(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PIRP Irp);
+
+#define IoForwardAndCatchIrp IoForwardIrpSynchronously
+
+NTKERNELAPI
+VOID
+IoFreeErrorLogEntry(
+ PVOID ElEntry);
+
+#endif
+
+/* VOID
+ * IoInitializeRemoveLock(
+ * IN PIO_REMOVE_LOCK Lock,
+ * IN ULONG AllocateTag,
+ * IN ULONG MaxLockedMinutes,
+ * IN ULONG HighWatermark)
+ */
+#define IoInitializeRemoveLock( \
+ Lock, AllocateTag, MaxLockedMinutes, HighWatermark) \
+ IoInitializeRemoveLockEx(Lock, AllocateTag, MaxLockedMinutes, \
+ HighWatermark, sizeof(IO_REMOVE_LOCK))
+
+VOID
+FORCEINLINE
+IoInitializeDpcRequest(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PIO_DPC_ROUTINE DpcRoutine)
+{
+ KeInitializeDpc( &DeviceObject->Dpc,
+ (PKDEFERRED_ROUTINE) DpcRoutine,
+ DeviceObject );
+}
+
+#define DEVICE_INTERFACE_INCLUDE_NONACTIVE 0x00000001
+
+/*
+ * ULONG
+ * IoGetFunctionCodeFromCtlCode(
+ * IN ULONG ControlCode)
+ */
+#define IoGetFunctionCodeFromCtlCode(_ControlCode) \
+ (((_ControlCode) >> 2) & 0x00000FFF)
/*
* NTSTATUS
@@ -6341,6 +6617,24 @@
nextIrpSp = IoGetNextIrpStackLocation(Irp);
RtlCopyMemory( nextIrpSp, irpSp, FIELD_OFFSET(IO_STACK_LOCATION, CompletionRoutine));
nextIrpSp->Control = 0;
+}
+
+NTKERNELAPI
+VOID
+IoGetStackLimits(
+ OUT PULONG_PTR LowLimit,
+ OUT PULONG_PTR HighLimit);
+
+FORCEINLINE
+ULONG_PTR
+IoGetRemainingStackSize(
+ VOID)
+{
+ ULONG_PTR End, Begin;
+ ULONG_PTR Result;
+
+ IoGetStackLimits(&Begin, &End);
+ return ((ULONG_PTR)(&End) - Begin);
}
/******************************************************************************
Modified: branches/header-work/include/ddk/winddk.h
URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/winddk.…
==============================================================================
--- branches/header-work/include/ddk/winddk.h [iso-8859-1] (original)
+++ branches/header-work/include/ddk/winddk.h [iso-8859-1] Wed Mar 3 19:01:23 2010
@@ -2595,103 +2595,10 @@
IN PCREATE_DISK Disk);
NTKERNELAPI
-NTSTATUS
-NTAPI
-IoCreateFile(
- OUT PHANDLE FileHandle,
- IN ACCESS_MASK DesiredAccess,
- IN POBJECT_ATTRIBUTES ObjectAttributes,
- OUT PIO_STATUS_BLOCK IoStatusBlock,
- IN PLARGE_INTEGER AllocationSize OPTIONAL,
- IN ULONG FileAttributes,
- IN ULONG ShareAccess,
- IN ULONG Disposition,
- IN ULONG CreateOptions,
- IN PVOID EaBuffer OPTIONAL,
- IN ULONG EaLength,
- IN CREATE_FILE_TYPE CreateFileType,
- IN PVOID ExtraCreateParameters OPTIONAL,
- IN ULONG Options);
-
-NTKERNELAPI
-PKEVENT
-NTAPI
-IoCreateNotificationEvent(
- IN PUNICODE_STRING EventName,
- OUT PHANDLE EventHandle);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoCreateSymbolicLink(
- IN PUNICODE_STRING SymbolicLinkName,
- IN PUNICODE_STRING DeviceName);
-
-NTKERNELAPI
-PKEVENT
-NTAPI
-IoCreateSynchronizationEvent(
- IN PUNICODE_STRING EventName,
- OUT PHANDLE EventHandle);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoCreateUnprotectedSymbolicLink(
- IN PUNICODE_STRING SymbolicLinkName,
- IN PUNICODE_STRING DeviceName);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoCsqInitialize(
- PIO_CSQ Csq,
- IN PIO_CSQ_INSERT_IRP CsqInsertIrp,
- IN PIO_CSQ_REMOVE_IRP CsqRemoveIrp,
- IN PIO_CSQ_PEEK_NEXT_IRP CsqPeekNextIrp,
- IN PIO_CSQ_ACQUIRE_LOCK CsqAcquireLock,
- IN PIO_CSQ_RELEASE_LOCK CsqReleaseLock,
- IN PIO_CSQ_COMPLETE_CANCELED_IRP CsqCompleteCanceledIrp);
-
-NTKERNELAPI
-VOID
-NTAPI
-IoCsqInsertIrp(
- IN PIO_CSQ Csq,
- IN PIRP Irp,
- IN PIO_CSQ_IRP_CONTEXT Context);
-
-NTKERNELAPI
-PIRP
-NTAPI
-IoCsqRemoveIrp(
- IN PIO_CSQ Csq,
- IN PIO_CSQ_IRP_CONTEXT Context);
-
-NTKERNELAPI
-PIRP
-NTAPI
-IoCsqRemoveNextIrp(
- IN PIO_CSQ Csq,
- IN PVOID PeekContext);
-
-NTKERNELAPI
VOID
NTAPI
IoDeleteController(
IN PCONTROLLER_OBJECT ControllerObject);
-
-NTKERNELAPI
-VOID
-NTAPI
-IoDeleteDevice(
- IN PDEVICE_OBJECT DeviceObject);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoDeleteSymbolicLink(
- IN PUNICODE_STRING SymbolicLinkName);
/*
* VOID
@@ -2703,248 +2610,26 @@
NTKERNELAPI
VOID
NTAPI
-IoDetachDevice(
- IN OUT PDEVICE_OBJECT TargetDevice);
-
-NTKERNELAPI
-VOID
-NTAPI
-IoDisconnectInterrupt(
- IN PKINTERRUPT InterruptObject);
-
-NTKERNELAPI
-BOOLEAN
-NTAPI
-IoForwardIrpSynchronously(
- IN PDEVICE_OBJECT DeviceObject,
- IN PIRP Irp);
-
-#define IoForwardAndCatchIrp IoForwardIrpSynchronously
-
-NTKERNELAPI
-VOID
-NTAPI
IoFreeController(
IN PCONTROLLER_OBJECT ControllerObject);
NTKERNELAPI
-VOID
-NTAPI
-IoFreeErrorLogEntry(
- PVOID ElEntry);
-
-NTKERNELAPI
-VOID
-NTAPI
-IoFreeIrp(
- IN PIRP Irp);
-
-NTKERNELAPI
-VOID
-NTAPI
-IoFreeMdl(
- IN PMDL Mdl);
-
-NTKERNELAPI
-VOID
-NTAPI
-IoFreeWorkItem(
- IN PIO_WORKITEM pIOWorkItem);
-
-NTKERNELAPI
-PDEVICE_OBJECT
-NTAPI
-IoGetAttachedDevice(
- IN PDEVICE_OBJECT DeviceObject);
-
-NTKERNELAPI
-PDEVICE_OBJECT
-NTAPI
-IoGetAttachedDeviceReference(
- IN PDEVICE_OBJECT DeviceObject);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoGetBootDiskInformation(
- IN OUT PBOOTDISK_INFORMATION BootDiskInformation,
- IN ULONG Size);
-
-NTKERNELAPI
PCONFIGURATION_INFORMATION
NTAPI
IoGetConfigurationInformation(
VOID);
NTKERNELAPI
-PEPROCESS
-NTAPI
-IoGetCurrentProcess(
- VOID);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoGetDeviceInterfaceAlias(
- IN PUNICODE_STRING SymbolicLinkName,
- IN CONST GUID *AliasInterfaceClassGuid,
- OUT PUNICODE_STRING AliasSymbolicLinkName);
-
-#define DEVICE_INTERFACE_INCLUDE_NONACTIVE 0x00000001
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoGetDeviceInterfaces(
- IN CONST GUID *InterfaceClassGuid,
- IN PDEVICE_OBJECT PhysicalDeviceObject OPTIONAL,
- IN ULONG Flags,
- OUT PWSTR *SymbolicLinkList);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoGetDeviceObjectPointer(
- IN PUNICODE_STRING ObjectName,
- IN ACCESS_MASK DesiredAccess,
- OUT PFILE_OBJECT *FileObject,
- OUT PDEVICE_OBJECT *DeviceObject);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoGetDeviceProperty(
- IN PDEVICE_OBJECT DeviceObject,
- IN DEVICE_REGISTRY_PROPERTY DeviceProperty,
- IN ULONG BufferLength,
- OUT PVOID PropertyBuffer,
- OUT PULONG ResultLength);
-
-NTKERNELAPI
PDEVICE_OBJECT
NTAPI
IoGetDeviceToVerify(
IN PETHREAD Thread);
NTKERNELAPI
-PDMA_ADAPTER
-NTAPI
-IoGetDmaAdapter(
- IN PDEVICE_OBJECT PhysicalDeviceObject,
- IN PDEVICE_DESCRIPTION DeviceDescription,
- IN OUT PULONG NumberOfMapRegisters);
-
-NTKERNELAPI
-PVOID
-NTAPI
-IoGetDriverObjectExtension(
- IN PDRIVER_OBJECT DriverObject,
- IN PVOID ClientIdentificationAddress);
-
-NTKERNELAPI
PGENERIC_MAPPING
NTAPI
IoGetFileObjectGenericMapping(
VOID);
-
-/*
- * ULONG
- * IoGetFunctionCodeFromCtlCode(
- * IN ULONG ControlCode)
- */
-#define IoGetFunctionCodeFromCtlCode(_ControlCode) \
- (((_ControlCode) >> 2) & 0x00000FFF)
-
-NTKERNELAPI
-PVOID
-NTAPI
-IoGetInitialStack(
- VOID);
-
-NTKERNELAPI
-PDEVICE_OBJECT
-NTAPI
-IoGetRelatedDeviceObject(
- IN PFILE_OBJECT FileObject);
-
-NTKERNELAPI
-VOID
-NTAPI
-IoGetStackLimits(
- OUT PULONG_PTR LowLimit,
- OUT PULONG_PTR HighLimit);
-
-FORCEINLINE
-ULONG_PTR
-IoGetRemainingStackSize(
- VOID
-)
-{
- ULONG_PTR End, Begin;
- ULONG_PTR Result;
-
- IoGetStackLimits(&Begin, &End);
- Result = (ULONG_PTR)(&End) - Begin;
- return Result;
-}
-
-NTKERNELAPI
-VOID
-NTAPI
-KeInitializeDpc(
- IN PRKDPC Dpc,
- IN PKDEFERRED_ROUTINE DeferredRoutine,
- IN PVOID DeferredContext);
-
-/*
- * VOID
- * IoInitializeDpcRequest(
- * IN PDEVICE_OBJECT DeviceObject,
- * IN PIO_DPC_ROUTINE DpcRoutine)
- */
-#define IoInitializeDpcRequest(_DeviceObject, \
- _DpcRoutine) \
- KeInitializeDpc(&(_DeviceObject)->Dpc, \
- (PKDEFERRED_ROUTINE) (_DpcRoutine), \
- _DeviceObject)
-
-NTKERNELAPI
-VOID
-NTAPI
-IoInitializeIrp(
- IN OUT PIRP Irp,
- IN USHORT PacketSize,
- IN CCHAR StackSize);
-
-NTKERNELAPI
-VOID
-NTAPI
-IoInitializeRemoveLockEx(
- IN PIO_REMOVE_LOCK Lock,
- IN ULONG AllocateTag,
- IN ULONG MaxLockedMinutes,
- IN ULONG HighWatermark,
- IN ULONG RemlockSize);
-
-/* VOID
- * IoInitializeRemoveLock(
- * IN PIO_REMOVE_LOCK Lock,
- * IN ULONG AllocateTag,
- * IN ULONG MaxLockedMinutes,
- * IN ULONG HighWatermark)
- */
-#define IoInitializeRemoveLock( \
- Lock, AllocateTag, MaxLockedMinutes, HighWatermark) \
- IoInitializeRemoveLockEx(Lock, AllocateTag, MaxLockedMinutes, \
- HighWatermark, sizeof(IO_REMOVE_LOCK))
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoInitializeTimer(
- IN PDEVICE_OBJECT DeviceObject,
- IN PIO_TIMER_ROUTINE TimerRoutine,
- IN PVOID Context);
NTKERNELAPI
VOID
@@ -3033,15 +2718,6 @@
IN PCONFIGURATION_TYPE PeripheralType OPTIONAL,
IN PULONG PeripheralNumber OPTIONAL,
IN PIO_QUERY_DEVICE_ROUTINE CalloutRoutine,
- IN PVOID Context);
-
-NTKERNELAPI
-VOID
-NTAPI
-IoQueueWorkItem(
- IN PIO_WORKITEM pIOWorkItem,
- IN PIO_WORKITEM_ROUTINE Routine,
- IN WORK_QUEUE_TYPE QueueType,
IN PVOID Context);
NTKERNELAPI
Modified: branches/header-work/ntoskrnl/io/iomgr/file.c
URL:
http://svn.reactos.org/svn/reactos/branches/header-work/ntoskrnl/io/iomgr/f…
==============================================================================
--- branches/header-work/ntoskrnl/io/iomgr/file.c [iso-8859-1] (original)
+++ branches/header-work/ntoskrnl/io/iomgr/file.c [iso-8859-1] Wed Mar 3 19:01:23 2010
@@ -1655,7 +1655,7 @@
IN PVOID EaBuffer OPTIONAL,
IN ULONG EaLength,
IN CREATE_FILE_TYPE CreateFileType,
- IN PVOID ExtraCreateParameters OPTIONAL,
+ IN PVOID InternalParameters OPTIONAL,
IN ULONG Options)
{
KPROCESSOR_MODE AccessMode;