- Fix the declarations of PDRIVER_CANCEL, KeGetCurrentProcessorNumber and KPCR in ROS headers.
- Fix the declarations of KeGetCurrentProcessorNumber, PIO_QUERY_DEVICE_ROUTINE, THREAD_STATE, KPCR and KeAttachProcess in W32API headers.
- Remove KeInitializeApc, KEVENT_PAIR and TERMINATION_PORT declarations from W32API, they don't belong there.
- Correct the STDCALL order in callback declarations in winddk.h.
Modified: trunk/reactos/drivers/video/videoprt/int10.c
Modified: trunk/reactos/drivers/video/videoprt/videoprt.c
Modified: trunk/reactos/drivers/video/videoprt/videoprt.h
Modified: trunk/reactos/include/ddk/iotypes.h
Modified: trunk/reactos/include/ddk/kefuncs.h
Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c
Modified: trunk/reactos/ntoskrnl/include/internal/debug.h
Modified: trunk/reactos/ntoskrnl/include/internal/i386/ps.h
Modified: trunk/reactos/ntoskrnl/include/internal/ke.h
Modified: trunk/reactos/ntoskrnl/ke/device.c
Modified: trunk/reactos/ntoskrnl/ke/gmutex.c
Modified: trunk/reactos/ntoskrnl/ke/i386/gdt.c
Modified: trunk/reactos/ntoskrnl/ke/i386/kernel.c
Modified: trunk/reactos/ntoskrnl/ke/kthread.c
Modified: trunk/reactos/w32api/include/ddk/ntapi.h
Modified: trunk/reactos/w32api/include/ddk/ntifs.h
Modified: trunk/reactos/w32api/include/ddk/winddk.h

Modified: trunk/reactos/drivers/video/videoprt/int10.c
--- trunk/reactos/drivers/video/videoprt/int10.c	2005-06-14 12:31:51 UTC (rev 15905)
+++ trunk/reactos/drivers/video/videoprt/int10.c	2005-06-14 13:10:40 UTC (rev 15906)
@@ -35,8 +35,8 @@
 {
    PVOID MemoryAddress;
    NTSTATUS Status;
-   PEPROCESS CallingProcess;
-   PEPROCESS PrevAttachedProcess;
+   PKPROCESS CallingProcess;
+   PKPROCESS PrevAttachedProcess;
 
    DPRINT("IntInt10AllocateBuffer\n");
 
@@ -82,8 +82,8 @@
 {
    PVOID MemoryAddress = (PVOID)((Seg << 4) | Off);
    NTSTATUS Status;
-   PEPROCESS CallingProcess;
-   PEPROCESS PrevAttachedProcess;
+   PKPROCESS CallingProcess;
+   PKPROCESS PrevAttachedProcess;
 
    DPRINT("IntInt10FreeBuffer\n");
    DPRINT("- Segment: %x\n", Seg);
@@ -105,8 +105,8 @@
    OUT PVOID Buffer,
    IN ULONG Length)
 {
-   PEPROCESS CallingProcess;
-   PEPROCESS PrevAttachedProcess;
+   PKPROCESS CallingProcess;
+   PKPROCESS PrevAttachedProcess;
 
    DPRINT("IntInt10ReadMemory\n");
    DPRINT("- Segment: %x\n", Seg);
@@ -129,8 +129,8 @@
    IN PVOID Buffer,
    IN ULONG Length)
 {
-   PEPROCESS CallingProcess;
-   PEPROCESS PrevAttachedProcess;
+   PKPROCESS CallingProcess;
+   PKPROCESS PrevAttachedProcess;
 
    DPRINT("IntInt10WriteMemory\n");
    DPRINT("- Segment: %x\n", Seg);
@@ -152,8 +152,8 @@
 {
    KV86M_REGISTERS Regs;
    NTSTATUS Status;
-   PEPROCESS CallingProcess;
-   PEPROCESS PrevAttachedProcess;
+   PKPROCESS CallingProcess;
+   PKPROCESS PrevAttachedProcess;
 
    DPRINT("IntInt10CallBios\n");
 
@@ -207,8 +207,8 @@
 {
    KV86M_REGISTERS Regs;
    NTSTATUS Status;
-   PEPROCESS CallingProcess;
-   PEPROCESS PrevAttachedProcess;
+   PKPROCESS CallingProcess;
+   PKPROCESS PrevAttachedProcess;
 
    DPRINT("VideoPortInt10\n");
 

Modified: trunk/reactos/drivers/video/videoprt/videoprt.c
--- trunk/reactos/drivers/video/videoprt/videoprt.c	2005-06-14 12:31:51 UTC (rev 15905)
+++ trunk/reactos/drivers/video/videoprt/videoprt.c	2005-06-14 13:10:40 UTC (rev 15906)
@@ -27,7 +27,7 @@
 /* GLOBAL VARIABLES ***********************************************************/
 
 ULONG CsrssInitialized = FALSE;
-PEPROCESS Csrss = NULL;
+PKPROCESS Csrss = NULL;
 
 /* PRIVATE FUNCTIONS **********************************************************/
 
@@ -495,12 +495,12 @@
 }
 
 VOID FASTCALL
-IntAttachToCSRSS(PEPROCESS *CallingProcess, PEPROCESS *PrevAttachedProcess)
+IntAttachToCSRSS(PKPROCESS *CallingProcess, PKPROCESS *PrevAttachedProcess)
 {
-   *CallingProcess = PsGetCurrentProcess();
+   *CallingProcess = &PsGetCurrentProcess()->Pcb;
    if (*CallingProcess != Csrss)
    {
-      if (PsGetCurrentThread()->ThreadsProcess != *CallingProcess)
+      if (&PsGetCurrentThread()->ThreadsProcess->Pcb != *CallingProcess)
       {
          *PrevAttachedProcess = *CallingProcess;
          KeDetachProcess();
@@ -514,7 +514,7 @@
 }
 
 VOID FASTCALL
-IntDetachFromCSRSS(PEPROCESS *CallingProcess, PEPROCESS *PrevAttachedProcess)
+IntDetachFromCSRSS(PKPROCESS *CallingProcess, PKPROCESS *PrevAttachedProcess)
 {
    if (*CallingProcess != Csrss)
    {
@@ -852,8 +852,8 @@
    IN ULONG Length)
 {
    static PVOID RomImageBuffer = NULL;
-   PEPROCESS CallingProcess;
-   PEPROCESS PrevAttachedProcess;
+   PKPROCESS CallingProcess;
+   PKPROCESS PrevAttachedProcess;
 
    DPRINT("VideoPortGetRomImage(HwDeviceExtension 0x%X Length 0x%X)\n",
           HwDeviceExtension, Length);

Modified: trunk/reactos/drivers/video/videoprt/videoprt.h
--- trunk/reactos/drivers/video/videoprt/videoprt.h	2005-06-14 12:31:51 UTC (rev 15905)
+++ trunk/reactos/drivers/video/videoprt/videoprt.h	2005-06-14 13:10:40 UTC (rev 15906)
@@ -188,7 +188,7 @@
 /* videoprt.c */
 
 extern ULONG CsrssInitialized;
-extern PEPROCESS Csrss;
+extern PKPROCESS Csrss;
 
 VP_STATUS STDCALL
 VideoPortEnumerateChildren(
@@ -201,10 +201,10 @@
    IN PUCHAR FunctionName);
 
 VOID FASTCALL
-IntAttachToCSRSS(PEPROCESS *CallingProcess, PEPROCESS *PrevAttachedProcess);
+IntAttachToCSRSS(PKPROCESS *CallingProcess, PKPROCESS *PrevAttachedProcess);
 
 VOID FASTCALL
-IntDetachFromCSRSS(PEPROCESS *CallingProcess, PEPROCESS *PrevAttachedProcess);
+IntDetachFromCSRSS(PKPROCESS *CallingProcess, PKPROCESS *PrevAttachedProcess);
 
 NTSTATUS STDCALL
 IntVideoPortCreateAdapterDeviceObject(

Modified: trunk/reactos/include/ddk/iotypes.h
--- trunk/reactos/include/ddk/iotypes.h	2005-06-14 12:31:51 UTC (rev 15905)
+++ trunk/reactos/include/ddk/iotypes.h	2005-06-14 13:10:40 UTC (rev 15906)
@@ -650,7 +650,7 @@
 /*
  * Driver cancel declaration
  */
-typedef NTSTATUS STDCALL_FUNC
+typedef VOID STDCALL_FUNC
 (*PDRIVER_CANCEL)(struct _DEVICE_OBJECT* DeviceObject,
 		  struct _IRP* RegistryPath);
 

Modified: trunk/reactos/include/ddk/kefuncs.h
--- trunk/reactos/include/ddk/kefuncs.h	2005-06-14 12:31:51 UTC (rev 15905)
+++ trunk/reactos/include/ddk/kefuncs.h	2005-06-14 13:10:40 UTC (rev 15906)
@@ -124,7 +124,7 @@
 KIRQL STDCALL KeGetCurrentIrql (VOID);
 
 #ifndef __USE_W32API
-#define KeGetCurrentProcessorNumber() (KeGetCurrentKPCR()->ProcessorNumber)
+#define KeGetCurrentProcessorNumber() (KeGetCurrentKPCR()->Number)
 ULONG KeGetDcacheFillSize(VOID);
 KPROCESSOR_MODE STDCALL KeGetPreviousMode (VOID);
 #endif

Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c
--- trunk/reactos/ntoskrnl/ex/sysinfo.c	2005-06-14 12:31:51 UTC (rev 15905)
+++ trunk/reactos/ntoskrnl/ex/sysinfo.c	2005-06-14 13:10:40 UTC (rev 15906)
@@ -78,7 +78,7 @@
 
 	*ThreadKernelTime = Prcb->KernelTime + Prcb->UserTime;
 	*TotalCpuTime = Prcb->CurrentThread->KernelTime;
-	*ProcessorNumber = KeGetCurrentKPCR()->ProcessorNumber;
+	*ProcessorNumber = KeGetCurrentKPCR()->Number;
 }
 
 /*

Modified: trunk/reactos/ntoskrnl/include/internal/debug.h
--- trunk/reactos/ntoskrnl/include/internal/debug.h	2005-06-14 12:31:51 UTC (rev 15905)
+++ trunk/reactos/ntoskrnl/include/internal/debug.h	2005-06-14 13:10:40 UTC (rev 15906)
@@ -31,6 +31,7 @@
 #undef assert
 #endif
 
+#ifndef __USE_W32API
 #ifdef DBG
 
 /* Assert only on "checked" version */
@@ -65,6 +66,7 @@
 #define ASSERTMSG(_c_, _m_)
 
 #endif
+#endif
 
 /* Print if using a "checked" version */
 #ifdef __GNUC__ /* using GNU C/C99 macro ellipsis */
@@ -83,10 +85,6 @@
 
 #define CPRINT(args...)
 #define DPRINT1(args...)
-#define assert(x)
-#define ASSERT(x)
-#define assertmsg(_c_, _m_)
-#define ASSERTMSG(_c_, _m_)
 
 #endif /* DBG */
 

Modified: trunk/reactos/ntoskrnl/include/internal/i386/ps.h
--- trunk/reactos/ntoskrnl/include/internal/i386/ps.h	2005-06-14 12:31:51 UTC (rev 15905)
+++ trunk/reactos/ntoskrnl/include/internal/i386/ps.h	2005-06-14 13:10:40 UTC (rev 15906)
@@ -238,7 +238,7 @@
   KAFFINITY  SetMember;         /* 48 */
   ULONG  StallScaleFactor;      /* 4C */
   UCHAR  DebugActive;           /* 50 */
-  UCHAR  ProcessorNumber;       /* 51 */
+  UCHAR  Number;                /* 51 */
   UCHAR  Reserved;              /* 52 */
   UCHAR  L2CacheAssociativity;  /* 53 */
   ULONG  VdmAlert;              /* 54 */

Modified: trunk/reactos/ntoskrnl/include/internal/ke.h
--- trunk/reactos/ntoskrnl/include/internal/ke.h	2005-06-14 12:31:51 UTC (rev 15905)
+++ trunk/reactos/ntoskrnl/include/internal/ke.h	2005-06-14 13:10:40 UTC (rev 15906)
@@ -266,7 +266,7 @@
 }
 
 #ifndef __USE_W32API
-#define KeGetCurrentProcessorNumber() (KeGetCurrentKPCR()->ProcessorNumber)
+#define KeGetCurrentProcessorNumber() (KeGetCurrentKPCR()->Number)
 #endif
 
 /* threadsch.c ********************************************************************/

Modified: trunk/reactos/ntoskrnl/ke/device.c
--- trunk/reactos/ntoskrnl/ke/device.c	2005-06-14 12:31:51 UTC (rev 15905)
+++ trunk/reactos/ntoskrnl/ke/device.c	2005-06-14 13:10:40 UTC (rev 15906)
@@ -13,36 +13,36 @@
 #include <internal/debug.h>
 
 /*
- * @implemented
+ * @unimplemented
  */
 STDCALL
 PVOID
-KeFindConfigurationEntry(
+KeFindConfigurationNextEntry(
     IN PVOID Unknown,
     IN ULONG Class,
     IN CONFIGURATION_TYPE Type,
-    IN PULONG RegKey
+    IN PULONG RegKey,
+    IN PVOID *NextLink
 )
 {
-	/* Start Search at Root */
-	return KeFindConfigurationNextEntry(Unknown, Class, Type, RegKey, NULL);
+	UNIMPLEMENTED;
+	return 0;
 }
 
 /*
- * @unimplemented
+ * @implemented
  */
 STDCALL
 PVOID
-KeFindConfigurationNextEntry(
+KeFindConfigurationEntry(
     IN PVOID Unknown,
     IN ULONG Class,
     IN CONFIGURATION_TYPE Type,
-    IN PULONG RegKey,
-    IN PVOID *NextLink
+    IN PULONG RegKey
 )
 {
-	UNIMPLEMENTED;
-	return 0;
+	/* Start Search at Root */
+	return KeFindConfigurationNextEntry(Unknown, Class, Type, RegKey, NULL);
 }
 
 /*

Modified: trunk/reactos/ntoskrnl/ke/gmutex.c
--- trunk/reactos/ntoskrnl/ke/gmutex.c	2005-06-14 12:31:51 UTC (rev 15905)
+++ trunk/reactos/ntoskrnl/ke/gmutex.c	2005-06-14 13:10:40 UTC (rev 15906)
@@ -132,17 +132,6 @@
 
 VOID
 FASTCALL
-KeAcquireGuardedMutex(PKGUARDED_MUTEX GuardedMutex)
-{
-    /* Disable Special APCs */
-    KeEnterGuardedRegion();
-
-    /* Do the Unsafe Acquire */
-    KeAcquireGuardedMutexUnsafe(GuardedMutex);
-}
-
-VOID
-FASTCALL
 KeAcquireGuardedMutexUnsafe(PKGUARDED_MUTEX GuardedMutex)
 {
     /* Remove the lock */
@@ -187,6 +176,17 @@
 
 VOID
 FASTCALL
+KeAcquireGuardedMutex(PKGUARDED_MUTEX GuardedMutex)
+{
+    /* Disable Special APCs */
+    KeEnterGuardedRegion();
+
+    /* Do the Unsafe Acquire */
+    KeAcquireGuardedMutexUnsafe(GuardedMutex);
+}
+
+VOID
+FASTCALL
 KeReleaseGuardedMutex(PKGUARDED_MUTEX GuardedMutex)
 {
     /* Do the actual release */

Modified: trunk/reactos/ntoskrnl/ke/i386/gdt.c
--- trunk/reactos/ntoskrnl/ke/i386/gdt.c	2005-06-14 12:31:51 UTC (rev 15905)
+++ trunk/reactos/ntoskrnl/ke/i386/gdt.c	2005-06-14 13:10:40 UTC (rev 15906)
@@ -72,10 +72,10 @@
   /*
    * Allocate a GDT
    */
-  Gdt = KiGdtArray[Pcr->ProcessorNumber];
+  Gdt = KiGdtArray[Pcr->Number];
   if (Gdt == NULL)
     {
-      DbgPrint("No GDT (%d)\n", Pcr->ProcessorNumber);
+      DbgPrint("No GDT (%d)\n", Pcr->Number);
       KEBUGCHECK(0);
     }
 

Modified: trunk/reactos/ntoskrnl/ke/i386/kernel.c
--- trunk/reactos/ntoskrnl/ke/i386/kernel.c	2005-06-14 12:31:51 UTC (rev 15905)
+++ trunk/reactos/ntoskrnl/ke/i386/kernel.c	2005-06-14 13:10:40 UTC (rev 15906)
@@ -181,7 +181,7 @@
    * Create a PCR for this processor
    */
   memset(Pcr, 0, PAGE_SIZE);
-  Pcr->ProcessorNumber = Id;
+  Pcr->Number = Id;
   Pcr->Tib.Self = &Pcr->Tib;
   Pcr->Self = Pcr;
   Pcr->Prcb = &Pcr->PrcbData;
@@ -283,7 +283,7 @@
    KPCR->GDT = KiBootGdt;
    KPCR->IDT = (PUSHORT)KiIdt;
    KPCR->TSS = &KiBootTss;
-   KPCR->ProcessorNumber = 0;
+   KPCR->Number = 0;
    KiPcrInitDone = 1;
    PcrsAllocated++;
 

Modified: trunk/reactos/ntoskrnl/ke/kthread.c
--- trunk/reactos/ntoskrnl/ke/kthread.c	2005-06-14 12:31:51 UTC (rev 15905)
+++ trunk/reactos/ntoskrnl/ke/kthread.c	2005-06-14 13:10:40 UTC (rev 15906)
@@ -1090,7 +1090,7 @@
 
         if (Thread->State == Running) {
 
-            ProcessorMask = 1 << KeGetCurrentKPCR()->ProcessorNumber;
+            ProcessorMask = 1 << KeGetCurrentKPCR()->Number;
             if (Thread == KeGetCurrentThread()) {
 
                 if (!(Affinity & ProcessorMask)) {

Modified: trunk/reactos/w32api/include/ddk/ntapi.h
--- trunk/reactos/w32api/include/ddk/ntapi.h	2005-06-14 12:31:51 UTC (rev 15905)
+++ trunk/reactos/w32api/include/ddk/ntapi.h	2005-06-14 13:10:40 UTC (rev 15906)
@@ -269,7 +269,7 @@
 	Running,
 	Standby,
 	Terminated,
-	Wait,
+	Waiting,
 	Transition,
 	DeferredReady
 } THREAD_STATE;

Modified: trunk/reactos/w32api/include/ddk/ntifs.h
--- trunk/reactos/w32api/include/ddk/ntifs.h	2005-06-14 12:31:51 UTC (rev 15905)
+++ trunk/reactos/w32api/include/ddk/ntifs.h	2005-06-14 13:10:40 UTC (rev 15906)
@@ -469,7 +469,6 @@
 typedef struct _EPROCESS_QUOTA_BLOCK            *PEPROCESS_QUOTA_BLOCK;
 typedef struct _FILE_GET_QUOTA_INFORMATION      *PFILE_GET_QUOTA_INFORMATION;
 typedef struct _HANDLE_TABLE                    *PHANDLE_TABLE;
-typedef struct _KEVENT_PAIR                     *PKEVENT_PAIR;
 typedef struct _KPROCESS                        *PKPROCESS;
 typedef struct _KQUEUE                          *PKQUEUE;
 typedef struct _KTRAP_FRAME                     *PKTRAP_FRAME;
@@ -481,7 +480,6 @@
 typedef struct _PS_IMPERSONATION_INFORMATION    *PPS_IMPERSONATION_INFORMATION;
 typedef struct _SECTION_OBJECT                  *PSECTION_OBJECT;
 typedef struct _SHARED_CACHE_MAP                *PSHARED_CACHE_MAP;
-typedef struct _TERMINATION_PORT                *PTERMINATION_PORT;
 typedef struct _VACB                            *PVACB;
 typedef struct _VAD_HEADER                      *PVAD_HEADER;
 
@@ -1208,13 +1206,6 @@
     LONG Depth;
 } IO_COMPLETION_BASIC_INFORMATION, *PIO_COMPLETION_BASIC_INFORMATION;
 
-typedef struct _KEVENT_PAIR {
-    USHORT Type;
-    USHORT Size;
-    KEVENT Event1;
-    KEVENT Event2;
-} KEVENT_PAIR, *PKEVENT_PAIR;
-
 typedef struct _KQUEUE {
     DISPATCHER_HEADER   Header;
     LIST_ENTRY          EntryListHead;
@@ -1527,11 +1518,6 @@
     ULONG Unused[4];
 } SYSTEM_CACHE_INFORMATION, *PSYSTEM_CACHE_INFORMATION;
 
-typedef struct _TERMINATION_PORT {
-    struct _TERMINATION_PORT*   Next;
-    PVOID                       Port;
-} TERMINATION_PORT, *PTERMINATION_PORT;
-
 typedef struct _SECURITY_CLIENT_CONTEXT {
     SECURITY_QUALITY_OF_SERVICE SecurityQos;
     PACCESS_TOKEN               ClientToken;
@@ -2977,7 +2963,7 @@
 VOID
 NTAPI
 KeAttachProcess (
-    IN PEPROCESS Process
+    IN PKPROCESS Process
 );
 
 NTKERNELAPI

Modified: trunk/reactos/w32api/include/ddk/winddk.h
--- trunk/reactos/w32api/include/ddk/winddk.h	2005-06-14 12:31:51 UTC (rev 15905)
+++ trunk/reactos/w32api/include/ddk/winddk.h	2005-06-14 13:10:40 UTC (rev 15906)
@@ -159,6 +159,7 @@
 
 /* Structures not exposed to drivers */
 typedef struct _IO_TIMER *PIO_TIMER;
+typedef struct _KPROCESS *PKPROCESS;
 typedef struct _EPROCESS *PEPROCESS;
 typedef struct _ETHREAD *PETHREAD;
 typedef struct _KINTERRUPT *PKINTERRUPT;
@@ -548,30 +549,30 @@
 ** Plug and Play structures
 */
 
-typedef VOID DDKAPI
-(*PINTERFACE_REFERENCE)(
+typedef VOID
+(DDKAPI *PINTERFACE_REFERENCE)(
   PVOID  Context);
 
-typedef VOID DDKAPI
-(*PINTERFACE_DEREFERENCE)(
+typedef VOID
+(DDKAPI *PINTERFACE_DEREFERENCE)(
   PVOID Context);
 
-typedef BOOLEAN DDKAPI
-(*PTRANSLATE_BUS_ADDRESS)(
+typedef BOOLEAN
+(DDKAPI *PTRANSLATE_BUS_ADDRESS)(
   IN PVOID  Context,
   IN PHYSICAL_ADDRESS  BusAddress,
   IN ULONG  Length,
   IN OUT PULONG  AddressSpace,
   OUT PPHYSICAL_ADDRESS  TranslatedAddress);
 
-typedef struct _DMA_ADAPTER* DDKAPI
-(*PGET_DMA_ADAPTER)(
+typedef struct _DMA_ADAPTER*
+(DDKAPI *PGET_DMA_ADAPTER)(
   IN PVOID  Context,
   IN struct _DEVICE_DESCRIPTION  *DeviceDescriptor,
   OUT PULONG  NumberOfMapRegisters);
 
-typedef ULONG DDKAPI
-(*PGET_SET_DEVICE_DATA)(
+typedef ULONG
+(DDKAPI *PGET_SET_DEVICE_DATA)(
   IN PVOID  Context,
   IN ULONG  DataType,
   IN PVOID  Buffer,
@@ -747,13 +748,13 @@
 
 #define PNPNOTIFY_DEVICE_INTERFACE_INCLUDE_EXISTING_INTERFACES    0x00000001
 
-typedef NTSTATUS DDKAPI
-(*PDRIVER_NOTIFICATION_CALLBACK_ROUTINE)(
+typedef NTSTATUS
+(DDKAPI *PDRIVER_NOTIFICATION_CALLBACK_ROUTINE)(
   IN PVOID NotificationStructure,
   IN PVOID Context);
 
-typedef VOID DDKAPI
-(*PDEVICE_CHANGE_COMPLETE_CALLBACK)(
+typedef VOID
+(DDKAPI *PDEVICE_CHANGE_COMPLETE_CALLBACK)(
   IN PVOID Context);
 
 
@@ -774,8 +775,8 @@
   UNICODE_STRING  Name;
 } OBJECT_NAME_INFORMATION, *POBJECT_NAME_INFORMATION;
 
-typedef VOID DDKAPI
-(*PIO_APC_ROUTINE)(
+typedef VOID
+(DDKAPI *PIO_APC_ROUTINE)(
   IN PVOID ApcContext,
   IN PIO_STATUS_BLOCK IoStatusBlock,
   IN ULONG Reserved);
@@ -788,26 +789,26 @@
   ULONG_PTR  Information;
 } IO_STATUS_BLOCK;
 
-typedef VOID DDKAPI
-(*PKNORMAL_ROUTINE)(
+typedef VOID
+(DDKAPI *PKNORMAL_ROUTINE)(
   IN PVOID  NormalContext,
   IN PVOID  SystemArgument1,
   IN PVOID  SystemArgument2);
 
-typedef VOID DDKAPI
-(*PKKERNEL_ROUTINE)(
+typedef VOID
+(DDKAPI *PKKERNEL_ROUTINE)(
   IN struct _KAPC  *Apc,
   IN OUT PKNORMAL_ROUTINE  *NormalRoutine,
   IN OUT PVOID  *NormalContext,
   IN OUT PVOID  *SystemArgument1,
   IN OUT PVOID  *SystemArgument2);
 
-typedef VOID DDKAPI
-(*PKRUNDOWN_ROUTINE)(
+typedef VOID
+(DDKAPI *PKRUNDOWN_ROUTINE)(
   IN struct _KAPC  *Apc);
 
-typedef BOOLEAN DDKAPI
-(*PKTRANSFER_ROUTINE)(
+typedef BOOLEAN
+(DDKAPI *PKTRANSFER_ROUTINE)(
   VOID);
 
 typedef struct _KAPC {
@@ -883,7 +884,7 @@
   PVOID  DeferredContext;
   PVOID  SystemArgument1;
   PVOID  SystemArgument2;
-  PULONG_PTR  Lock;
+  PVOID  DpcData;
 } KDPC, *PKDPC, *RESTRICTED_POINTER PRKDPC;
 
 typedef struct _KDPC_DATA {
@@ -1824,35 +1825,35 @@
   MDL_SYSTEM_VA               | \
   MDL_IO_SPACE)
 
-typedef VOID DDKAPI
-(*PPUT_DMA_ADAPTER)(
+typedef VOID
+(DDKAPI *PPUT_DMA_ADAPTER)(
   IN PDMA_ADAPTER  DmaAdapter);
 
-typedef PVOID DDKAPI
-(*PALLOCATE_COMMON_BUFFER)(
+typedef PVOID
+(DDKAPI *PALLOCATE_COMMON_BUFFER)(
   IN PDMA_ADAPTER  DmaAdapter,
   IN ULONG  Length,
   OUT PPHYSICAL_ADDRESS  LogicalAddress,
   IN BOOLEAN  CacheEnabled);
 
-typedef VOID DDKAPI
-(*PFREE_COMMON_BUFFER)(
+typedef VOID
+(DDKAPI *PFREE_COMMON_BUFFER)(
   IN PDMA_ADAPTER  DmaAdapter,
   IN ULONG  Length,
   IN PHYSICAL_ADDRESS  LogicalAddress,
   IN PVOID  VirtualAddress,
   IN BOOLEAN  CacheEnabled);
 
-typedef NTSTATUS DDKAPI
-(*PALLOCATE_ADAPTER_CHANNEL)(
+typedef NTSTATUS
+(DDKAPI *PALLOCATE_ADAPTER_CHANNEL)(
   IN PDMA_ADAPTER  DmaAdapter,
   IN PDEVICE_OBJECT  DeviceObject,
   IN ULONG  NumberOfMapRegisters,
   IN PDRIVER_CONTROL  ExecutionRoutine,
   IN PVOID  Context);
 
-typedef BOOLEAN DDKAPI
-(*PFLUSH_ADAPTER_BUFFERS)(
+typedef BOOLEAN
+(DDKAPI *PFLUSH_ADAPTER_BUFFERS)(
   IN PDMA_ADAPTER  DmaAdapter,
   IN PMDL  Mdl,
   IN PVOID  MapRegisterBase,
@@ -1860,18 +1861,18 @@
   IN ULONG  Length,
   IN BOOLEAN  WriteToDevice);
 
-typedef VOID DDKAPI
-(*PFREE_ADAPTER_CHANNEL)(
+typedef VOID
+(DDKAPI *PFREE_ADAPTER_CHANNEL)(
   IN PDMA_ADAPTER  DmaAdapter);
 
-typedef VOID DDKAPI
-(*PFREE_MAP_REGISTERS)(
+typedef VOID
+(DDKAPI *PFREE_MAP_REGISTERS)(
   IN PDMA_ADAPTER  DmaAdapter,
   PVOID  MapRegisterBase,
   ULONG  NumberOfMapRegisters);
 
-typedef PHYSICAL_ADDRESS DDKAPI
-(*PMAP_TRANSFER)(
+typedef PHYSICAL_ADDRESS
+(DDKAPI *PMAP_TRANSFER)(
   IN PDMA_ADAPTER  DmaAdapter,
   IN PMDL  Mdl,
   IN PVOID  MapRegisterBase,
@@ -1879,16 +1880,16 @@
   IN OUT PULONG  Length,
   IN BOOLEAN  WriteToDevice);
 
-typedef ULONG DDKAPI
-(*PGET_DMA_ALIGNMENT)(
+typedef ULONG
+(DDKAPI *PGET_DMA_ALIGNMENT)(
   IN PDMA_ADAPTER  DmaAdapter);
 
-typedef ULONG DDKAPI
-(*PREAD_DMA_COUNTER)(
+typedef ULONG
+(DDKAPI *PREAD_DMA_COUNTER)(
   IN PDMA_ADAPTER  DmaAdapter);
 
-typedef NTSTATUS DDKAPI
-(*PGET_SCATTER_GATHER_LIST)(
+typedef NTSTATUS
+(DDKAPI *PGET_SCATTER_GATHER_LIST)(
   IN PDMA_ADAPTER  DmaAdapter,
   IN PDEVICE_OBJECT  DeviceObject,
   IN PMDL  Mdl,
@@ -1898,14 +1899,14 @@
   IN PVOID  Context,
   IN BOOLEAN  WriteToDevice);
 
-typedef VOID DDKAPI
-(*PPUT_SCATTER_GATHER_LIST)(
+typedef VOID
+(DDKAPI *PPUT_SCATTER_GATHER_LIST)(
   IN PDMA_ADAPTER  DmaAdapter,
   IN PSCATTER_GATHER_LIST  ScatterGather,
   IN BOOLEAN  WriteToDevice);
 
-typedef NTSTATUS DDKAPI
-(*PCALCULATE_SCATTER_GATHER_LIST_SIZE)(
+typedef NTSTATUS
+(DDKAPI *PCALCULATE_SCATTER_GATHER_LIST_SIZE)(
   IN PDMA_ADAPTER  DmaAdapter,
   IN PMDL  Mdl  OPTIONAL,
   IN PVOID  CurrentVa,
@@ -1913,8 +1914,8 @@
   OUT PULONG  ScatterGatherListSize,
   OUT PULONG  pNumberOfMapRegisters  OPTIONAL);
 
-typedef NTSTATUS DDKAPI
-(*PBUILD_SCATTER_GATHER_LIST)(
+typedef NTSTATUS
+(DDKAPI *PBUILD_SCATTER_GATHER_LIST)(
   IN PDMA_ADAPTER  DmaAdapter,
   IN PDEVICE_OBJECT  DeviceObject,
   IN PMDL  Mdl,
@@ -1926,8 +1927,8 @@
   IN PVOID  ScatterGatherBuffer,
   IN ULONG  ScatterGatherLength);
 
-typedef NTSTATUS DDKAPI
-(*PBUILD_MDL_FROM_SCATTER_GATHER_LIST)(
+typedef NTSTATUS
+(DDKAPI *PBUILD_MDL_FROM_SCATTER_GATHER_LIST)(
   IN PDMA_ADAPTER  DmaAdapter,
   IN PSCATTER_GATHER_LIST  ScatterGather,
   IN PMDL  OriginalMdl,
@@ -2275,8 +2276,8 @@
   UNICODE_STRING  ServiceKeyName;
 } DRIVER_EXTENSION, *PDRIVER_EXTENSION;
 
-typedef BOOLEAN DDKAPI
-(*PFAST_IO_CHECK_IF_POSSIBLE)(
+typedef BOOLEAN
+(DDKAPI *PFAST_IO_CHECK_IF_POSSIBLE)(
   IN struct _FILE_OBJECT  *FileObject,
   IN PLARGE_INTEGER  FileOffset,
   IN ULONG  Length,
@@ -2286,8 +2287,8 @@
   OUT PIO_STATUS_BLOCK  IoStatus,
   IN struct _DEVICE_OBJECT  *DeviceObject);
 
-typedef BOOLEAN DDKAPI
-(*PFAST_IO_READ)(
+typedef BOOLEAN
+(DDKAPI *PFAST_IO_READ)(
   IN struct _FILE_OBJECT  *FileObject,
   IN PLARGE_INTEGER  FileOffset,
   IN ULONG  Length,
@@ -2297,8 +2298,8 @@
   OUT PIO_STATUS_BLOCK  IoStatus,
   IN struct _DEVICE_OBJECT  *DeviceObject);
 
-typedef BOOLEAN DDKAPI
-(*PFAST_IO_WRITE)(
+typedef BOOLEAN
+(DDKAPI *PFAST_IO_WRITE)(
   IN struct _FILE_OBJECT  *FileObject,
   IN PLARGE_INTEGER  FileOffset,
   IN ULONG  Length,
@@ -2308,24 +2309,24 @@
   OUT PIO_STATUS_BLOCK  IoStatus,
   IN struct _DEVICE_OBJECT  *DeviceObject);
 
-typedef BOOLEAN DDKAPI
-(*PFAST_IO_QUERY_BASIC_INFO)(
+typedef BOOLEAN
+(DDKAPI *PFAST_IO_QUERY_BASIC_INFO)(
   IN struct _FILE_OBJECT  *FileObject,
   IN BOOLEAN  Wait,
   OUT PFILE_BASIC_INFORMATION  Buffer,
   OUT PIO_STATUS_BLOCK  IoStatus,
   IN struct _DEVICE_OBJECT  *DeviceObject);
 
-typedef BOOLEAN DDKAPI
-(*PFAST_IO_QUERY_STANDARD_INFO)(
+typedef BOOLEAN
+(DDKAPI *PFAST_IO_QUERY_STANDARD_INFO)(
   IN struct _FILE_OBJECT  *FileObject,
   IN BOOLEAN  Wait,
   OUT PFILE_STANDARD_INFORMATION  Buffer,
   OUT PIO_STATUS_BLOCK  IoStatus,
   IN struct _DEVICE_OBJECT  *DeviceObject);
 
-typedef BOOLEAN DDKAPI
-(*PFAST_IO_LOCK)(
+typedef BOOLEAN
+(DDKAPI *PFAST_IO_LOCK)(
   IN struct _FILE_OBJECT  *FileObject,
   IN PLARGE_INTEGER  FileOffset,
   IN PLARGE_INTEGER  Length,
@@ -2336,8 +2337,8 @@
   OUT PIO_STATUS_BLOCK  IoStatus,
   IN struct _DEVICE_OBJECT  *DeviceObject);
 
-typedef BOOLEAN DDKAPI
-(*PFAST_IO_UNLOCK_SINGLE)(
+typedef BOOLEAN
+(DDKAPI *PFAST_IO_UNLOCK_SINGLE)(
   IN struct _FILE_OBJECT  *FileObject,
   IN PLARGE_INTEGER  FileOffset,
   IN PLARGE_INTEGER  Length,
@@ -2346,23 +2347,23 @@
   OUT PIO_STATUS_BLOCK  IoStatus,
   IN struct _DEVICE_OBJECT  *DeviceObject);
 
-typedef BOOLEAN DDKAPI
-(*PFAST_IO_UNLOCK_ALL)(
+typedef BOOLEAN
+(DDKAPI *PFAST_IO_UNLOCK_ALL)(
   IN struct _FILE_OBJECT  *FileObject,
   PEPROCESS  ProcessId,
   OUT PIO_STATUS_BLOCK  IoStatus,
   IN struct _DEVICE_OBJECT  *DeviceObject);
 
-typedef BOOLEAN DDKAPI
-(*PFAST_IO_UNLOCK_ALL_BY_KEY)(
+typedef BOOLEAN
+(DDKAPI *PFAST_IO_UNLOCK_ALL_BY_KEY)(
   IN struct _FILE_OBJECT  *FileObject,
   PEPROCESS  ProcessId,
   ULONG  Key,
   OUT PIO_STATUS_BLOCK  IoStatus,
   IN struct _DEVICE_OBJECT  *DeviceObject);
 
-typedef BOOLEAN DDKAPI
-(*PFAST_IO_DEVICE_CONTROL)(
+typedef BOOLEAN
+(DDKAPI *PFAST_IO_DEVICE_CONTROL)(
   IN struct _FILE_OBJECT  *FileObject,
   IN BOOLEAN  Wait,
   IN PVOID  InputBuffer  OPTIONAL,
@@ -2373,36 +2374,36 @@
   OUT PIO_STATUS_BLOCK  IoStatus,
   IN struct _DEVICE_OBJECT  *DeviceObject);
 
-typedef VOID DDKAPI
-(*PFAST_IO_ACQUIRE_FILE)(
+typedef VOID
+(DDKAPI *PFAST_IO_ACQUIRE_FILE)(
   IN struct _FILE_OBJECT  *FileObject);
 
-typedef VOID DDKAPI
-(*PFAST_IO_RELEASE_FILE)(
+typedef VOID
+(DDKAPI *PFAST_IO_RELEASE_FILE)(
   IN struct _FILE_OBJECT  *FileObject);
 
-typedef VOID DDKAPI
-(*PFAST_IO_DETACH_DEVICE)(
+typedef VOID
+(DDKAPI *PFAST_IO_DETACH_DEVICE)(
   IN struct _DEVICE_OBJECT  *SourceDevice,
   IN struct _DEVICE_OBJECT  *TargetDevice);
 
-typedef BOOLEAN DDKAPI
-(*PFAST_IO_QUERY_NETWORK_OPEN_INFO)(
+typedef BOOLEAN
+(DDKAPI *PFAST_IO_QUERY_NETWORK_OPEN_INFO)(
   IN struct _FILE_OBJECT  *FileObject,
   IN BOOLEAN  Wait,
   OUT struct _FILE_NETWORK_OPEN_INFORMATION  *Buffer,
   OUT struct _IO_STATUS_BLOCK  *IoStatus,
   IN struct _DEVICE_OBJECT  *DeviceObject);
 
-typedef NTSTATUS DDKAPI
-(*PFAST_IO_ACQUIRE_FOR_MOD_WRITE)(
+typedef NTSTATUS
+(DDKAPI *PFAST_IO_ACQUIRE_FOR_MOD_WRITE)(
   IN struct _FILE_OBJECT  *FileObject,
   IN PLARGE_INTEGER  EndingOffset,
   OUT struct _ERESOURCE  **ResourceToRelease,
   IN struct _DEVICE_OBJECT  *DeviceObject);
 
-typedef BOOLEAN DDKAPI
-(*PFAST_IO_MDL_READ)(
+typedef BOOLEAN
+(DDKAPI *PFAST_IO_MDL_READ)(
   IN struct _FILE_OBJECT  *FileObject,
   IN PLARGE_INTEGER  FileOffset,
   IN ULONG  Length,
@@ -2411,14 +2412,14 @@
   OUT PIO_STATUS_BLOCK  IoStatus,
   IN struct _DEVICE_OBJECT  *DeviceObject);
 
-typedef BOOLEAN DDKAPI
-(*PFAST_IO_MDL_READ_COMPLETE)(
+typedef BOOLEAN
+(DDKAPI *PFAST_IO_MDL_READ_COMPLETE)(
   IN struct _FILE_OBJECT *FileObject,
   IN PMDL MdlChain,
   IN struct _DEVICE_OBJECT *DeviceObject);
 
-typedef BOOLEAN DDKAPI
-(*PFAST_IO_PREPARE_MDL_WRITE)(
+typedef BOOLEAN
+(DDKAPI *PFAST_IO_PREPARE_MDL_WRITE)(
   IN struct _FILE_OBJECT  *FileObject,
   IN PLARGE_INTEGER  FileOffset,
   IN ULONG  Length,
@@ -2427,15 +2428,15 @@
   OUT PIO_STATUS_BLOCK  IoStatus,
   IN struct _DEVICE_OBJECT  *DeviceObject);
 
-typedef BOOLEAN DDKAPI
-(*PFAST_IO_MDL_WRITE_COMPLETE)(
+typedef BOOLEAN
+(DDKAPI *PFAST_IO_MDL_WRITE_COMPLETE)(
   IN struct _FILE_OBJECT  *FileObject,
   IN PLARGE_INTEGER  FileOffset,
   IN PMDL  MdlChain,
   IN struct _DEVICE_OBJECT  *DeviceObject);
 
-typedef BOOLEAN DDKAPI
-(*PFAST_IO_READ_COMPRESSED)(
+typedef BOOLEAN
+(DDKAPI *PFAST_IO_READ_COMPRESSED)(
   IN struct _FILE_OBJECT  *FileObject,
   IN PLARGE_INTEGER  FileOffset,
   IN ULONG  Length,
@@ -2447,8 +2448,8 @@
   IN ULONG  CompressedDataInfoLength,
   IN struct _DEVICE_OBJECT  *DeviceObject);
 
-typedef BOOLEAN DDKAPI
-(*PFAST_IO_WRITE_COMPRESSED)(
+typedef BOOLEAN
+(DDKAPI *PFAST_IO_WRITE_COMPRESSED)(
   IN struct _FILE_OBJECT  *FileObject,
   IN PLARGE_INTEGER  FileOffset,
   IN ULONG  Length,
@@ -2460,38 +2461,38 @@
   IN ULONG  CompressedDataInfoLength,
   IN struct _DEVICE_OBJECT  *DeviceObject);
 
-typedef BOOLEAN DDKAPI
-(*PFAST_IO_MDL_READ_COMPLETE_COMPRESSED)(
+typedef BOOLEAN
+(DDKAPI *PFAST_IO_MDL_READ_COMPLETE_COMPRESSED)(
   IN struct _FILE_OBJECT  *FileObject,
   IN PMDL  MdlChain,
   IN struct _DEVICE_OBJECT  *DeviceObject);
 
-typedef BOOLEAN DDKAPI
-(*PFAST_IO_MDL_WRITE_COMPLETE_COMPRESSED)(
+typedef BOOLEAN
+(DDKAPI *PFAST_IO_MDL_WRITE_COMPLETE_COMPRESSED)(
   IN struct _FILE_OBJECT  *FileObject,
   IN PLARGE_INTEGER  FileOffset,
   IN PMDL  MdlChain,
   IN struct _DEVICE_OBJECT  *DeviceObject);
 
-typedef BOOLEAN DDKAPI
-(*PFAST_IO_QUERY_OPEN)(
+typedef BOOLEAN
+(DDKAPI *PFAST_IO_QUERY_OPEN)(
   IN struct _IRP  *Irp,
   OUT PFILE_NETWORK_OPEN_INFORMATION  NetworkInformation,
   IN struct _DEVICE_OBJECT  *DeviceObject);
 
-typedef NTSTATUS DDKAPI
-(*PFAST_IO_RELEASE_FOR_MOD_WRITE)(
+typedef NTSTATUS
+(DDKAPI *PFAST_IO_RELEASE_FOR_MOD_WRITE)(
   IN struct _FILE_OBJECT  *FileObject,
   IN struct _ERESOURCE  *ResourceToRelease,
   IN struct _DEVICE_OBJECT  *DeviceObject);
 
-typedef NTSTATUS DDKAPI
-(*PFAST_IO_ACQUIRE_FOR_CCFLUSH)(
+typedef NTSTATUS
+(DDKAPI *PFAST_IO_ACQUIRE_FOR_CCFLUSH)(
   IN struct _FILE_OBJECT  *FileObject,
   IN struct _DEVICE_OBJECT  *DeviceObject);
 
-typedef NTSTATUS DDKAPI
-(*PFAST_IO_RELEASE_FOR_CCFLUSH) (
+typedef NTSTATUS
+(DDKAPI *PFAST_IO_RELEASE_FOR_CCFLUSH) (
   IN struct _FILE_OBJECT  *FileObject,
   IN struct _DEVICE_OBJECT  *DeviceObject);
 
@@ -2677,34 +2678,34 @@
   struct _IO_CSQ  *Csq;
 } IO_CSQ_IRP_CONTEXT, *PIO_CSQ_IRP_CONTEXT;
 
-typedef VOID DDKAPI
-(*PIO_CSQ_INSERT_IRP)(
+typedef VOID
+(DDKAPI *PIO_CSQ_INSERT_IRP)(
   IN struct _IO_CSQ  *Csq,
   IN PIRP  Irp);
 
-typedef VOID DDKAPI
-(*PIO_CSQ_REMOVE_IRP)(
+typedef VOID
+(DDKAPI *PIO_CSQ_REMOVE_IRP)(
   IN struct _IO_CSQ  *Csq,
   IN PIRP  Irp);
 
-typedef PIRP DDKAPI
-(*PIO_CSQ_PEEK_NEXT_IRP)(
+typedef PIRP
+(DDKAPI *PIO_CSQ_PEEK_NEXT_IRP)(
   IN struct _IO_CSQ  *Csq,
   IN PIRP  Irp,
   IN PVOID  PeekContext);
 
-typedef VOID DDKAPI
-(*PIO_CSQ_ACQUIRE_LOCK)(
+typedef VOID
+(DDKAPI *PIO_CSQ_ACQUIRE_LOCK)(
   IN  struct _IO_CSQ  *Csq,
[truncated at 1000 lines; 463 more skipped]