- NDK 0.98, now with versionned headers. Too many changes to list, see the TinyKRNL...
authorAlex Ionescu <aionescu@gmail.com>
Wed, 10 May 2006 17:47:44 +0000 (17:47 +0000)
committerAlex Ionescu <aionescu@gmail.com>
Wed, 10 May 2006 17:47:44 +0000 (17:47 +0000)
svn path=/trunk/; revision=21880

194 files changed:
reactos/ReactOS.rbuild
reactos/base/applications/taskmgr/perfdata.c
reactos/base/services/umpnpmgr/umpnpmgr.c
reactos/boot/bootdata/txtsetup.sif
reactos/boot/freeldr/freeldr/arch/i386/loader.c
reactos/boot/freeldr/freeldr/include/freeldr.h
reactos/boot/freeldr/freeldr/include/reactos.h
reactos/boot/freeldr/freeldr/reactos/reactos.c
reactos/boot/freeldr/freeldr/reactos/setupldr.c
reactos/dll/ntdll/def/ntdll.def
reactos/dll/ntdll/ldr/startup.c
reactos/dll/ntdll/ldr/utils.c
reactos/dll/ntdll/ntdll.rbuild
reactos/dll/win32/advapi32/sec/ac.c
reactos/dll/win32/kernel32/file/create.c
reactos/dll/win32/kernel32/file/file.c
reactos/dll/win32/kernel32/kernel32.rbuild
reactos/dll/win32/kernel32/misc/console.c
reactos/dll/win32/kernel32/misc/ldr.c
reactos/dll/win32/kernel32/misc/profile.c
reactos/dll/win32/kernel32/misc/recovery.c
reactos/dll/win32/kernel32/misc/toolhelp.c
reactos/dll/win32/kernel32/misc/utils.c
reactos/dll/win32/kernel32/process/create.c
reactos/dll/win32/kernel32/thread/tls.c
reactos/dll/win32/psapi/psapi.c
reactos/drivers/base/blue/blue.c
reactos/drivers/filesystems/ms/msfs.h
reactos/drivers/filesystems/vfat/vfat.h
reactos/drivers/multimedia/audio/sound/wave.c
reactos/drivers/network/tcpip/include/precomp.h
reactos/drivers/storage/diskdump/diskdump.c
reactos/drivers/video/videoprt/int10.c
reactos/drivers/video/videoprt/videoprt.h
reactos/hal/hal/hal.c
reactos/hal/halx86/generic/display.c
reactos/hal/halx86/generic/halinit.c
reactos/hal/halx86/generic/irql.c
reactos/hal/halx86/generic/spinlock.c
reactos/hal/halx86/generic/timer.c
reactos/hal/halx86/include/hal.h
reactos/hal/halx86/include/halp.h
reactos/hal/halx86/include/mps.h
reactos/hal/halx86/mp/apic.c
reactos/hal/halx86/mp/halinit_mp.c
reactos/hal/halx86/mp/mpsirql.c
reactos/hal/halx86/up/halinit_up.c
reactos/hal/halx86/xbox/display_xbox.c
reactos/hal/halx86/xbox/halinit_xbox.c
reactos/include/ddk/winddk.h
reactos/include/ndk/asm.h
reactos/include/ndk/cctypes.h
reactos/include/ndk/cmfuncs.h
reactos/include/ndk/cmtypes.h
reactos/include/ndk/dbgkfuncs.h
reactos/include/ndk/dbgktypes.h
reactos/include/ndk/exfuncs.h
reactos/include/ndk/extypes.h
reactos/include/ndk/fixmes.txt
reactos/include/ndk/halfuncs.h
reactos/include/ndk/haltypes.h
reactos/include/ndk/i386/ketypes.h
reactos/include/ndk/i386/mmtypes.h
reactos/include/ndk/ifssupp.h
reactos/include/ndk/inbvfuncs.h
reactos/include/ndk/iofuncs.h
reactos/include/ndk/iotypes.h
reactos/include/ndk/kdfuncs.h
reactos/include/ndk/kdtypes.h
reactos/include/ndk/kefuncs.h
reactos/include/ndk/ketypes.h
reactos/include/ndk/ldrfuncs.h
reactos/include/ndk/ldrtypes.h
reactos/include/ndk/lpcfuncs.h
reactos/include/ndk/lpctypes.h
reactos/include/ndk/mmfuncs.h
reactos/include/ndk/mmtypes.h
reactos/include/ndk/ntndk.h
reactos/include/ndk/obfuncs.h
reactos/include/ndk/obtypes.h
reactos/include/ndk/pofuncs.h
reactos/include/ndk/potypes.h
reactos/include/ndk/psfuncs.h
reactos/include/ndk/pstypes.h
reactos/include/ndk/readme.txt
reactos/include/ndk/rtlfuncs.h
reactos/include/ndk/rtltypes.h
reactos/include/ndk/sefuncs.h
reactos/include/ndk/setypes.h
reactos/include/ndk/umfuncs.h
reactos/include/reactos/arc/arc.h
reactos/include/reactos/drivers/diskdump/diskdump.h
reactos/include/reactos/libs/epsapi/epsapi.h
reactos/include/reactos/win32k/callout.h [new file with mode: 0644]
reactos/include/winnt.h
reactos/include/winsock2.h
reactos/include/ws2tcpip.h
reactos/lib/epsapi/enum/drivers.c
reactos/lib/epsapi/enum/modules.c
reactos/lib/epsapi/enum/processes.c
reactos/lib/rtl/bootdata.c
reactos/lib/rtl/crc32.c
reactos/lib/rtl/dbgbuffer.c
reactos/lib/rtl/debug.c
reactos/lib/rtl/image.c
reactos/lib/rtl/network.c
reactos/lib/rtl/path.c
reactos/lib/rtl/process.c
reactos/lib/rtl/sd.c
reactos/lib/rtl/thread.c
reactos/lib/rtl/unicode.c
reactos/ntoskrnl/cm/cm.h
reactos/ntoskrnl/cm/registry.c
reactos/ntoskrnl/cm/regobj.c
reactos/ntoskrnl/ex/dbgctrl.c
reactos/ntoskrnl/ex/init.c
reactos/ntoskrnl/ex/power.c
reactos/ntoskrnl/ex/profile.c
reactos/ntoskrnl/ex/rundown.c
reactos/ntoskrnl/ex/sysinfo.c
reactos/ntoskrnl/ex/win32k.c
reactos/ntoskrnl/inbv/inbv.c
reactos/ntoskrnl/include/internal/ex.h
reactos/ntoskrnl/include/internal/i386/ke.h
reactos/ntoskrnl/include/internal/i386/v86m.h [new file with mode: 0644]
reactos/ntoskrnl/include/internal/io.h
reactos/ntoskrnl/include/internal/kd.h
reactos/ntoskrnl/include/internal/ke.h
reactos/ntoskrnl/include/internal/lpc.h
reactos/ntoskrnl/include/internal/mm.h
reactos/ntoskrnl/include/internal/ntoskrnl.h
reactos/ntoskrnl/include/internal/ob.h
reactos/ntoskrnl/include/internal/po.h
reactos/ntoskrnl/include/internal/ps.h
reactos/ntoskrnl/include/ntoskrnl.h
reactos/ntoskrnl/io/disk.c
reactos/ntoskrnl/io/driver.c
reactos/ntoskrnl/io/efi.c
reactos/ntoskrnl/io/file.c
reactos/ntoskrnl/io/iomgr.c
reactos/ntoskrnl/io/plugplay.c
reactos/ntoskrnl/kd/kdinit.c
reactos/ntoskrnl/kdbg/kdb.c
reactos/ntoskrnl/kdbg/kdb_cli.c
reactos/ntoskrnl/kdbg/kdb_symbols.c
reactos/ntoskrnl/ke/bug.c
reactos/ntoskrnl/ke/clock.c
reactos/ntoskrnl/ke/device.c
reactos/ntoskrnl/ke/dpc.c
reactos/ntoskrnl/ke/i386/bios.c
reactos/ntoskrnl/ke/i386/exp.c
reactos/ntoskrnl/ke/i386/irq.c
reactos/ntoskrnl/ke/i386/kernel.c
reactos/ntoskrnl/ke/i386/usertrap.c
reactos/ntoskrnl/ke/ipi.c
reactos/ntoskrnl/ke/kthread.c
reactos/ntoskrnl/ke/main.c
reactos/ntoskrnl/ke/process.c
reactos/ntoskrnl/ldr/loader.c
reactos/ntoskrnl/lpc/close.c
reactos/ntoskrnl/mm/anonmem.c
reactos/ntoskrnl/mm/aspace.c
reactos/ntoskrnl/mm/i386/page.c
reactos/ntoskrnl/mm/marea.c
reactos/ntoskrnl/mm/mdl.c
reactos/ntoskrnl/mm/mm.c
reactos/ntoskrnl/mm/process.c
reactos/ntoskrnl/mm/rmap.c
reactos/ntoskrnl/mm/section.c
reactos/ntoskrnl/mm/virtual.c
reactos/ntoskrnl/ntoskrnl.def
reactos/ntoskrnl/ntoskrnl.rbuild
reactos/ntoskrnl/ob/dirobj.c
reactos/ntoskrnl/ob/handle.c
reactos/ntoskrnl/ob/namespc.c
reactos/ntoskrnl/ob/ntobj.c
reactos/ntoskrnl/ob/object.c
reactos/ntoskrnl/ob/security.c
reactos/ntoskrnl/ob/symlink.c
reactos/ntoskrnl/ob/wait.c
reactos/ntoskrnl/po/power.c
reactos/ntoskrnl/ps/job.c
reactos/ntoskrnl/ps/kill.c
reactos/ntoskrnl/ps/process.c
reactos/ntoskrnl/ps/psmgr.c
reactos/ntoskrnl/ps/query.c
reactos/ntoskrnl/ps/thread.c
reactos/ntoskrnl/ps/win32.c
reactos/ntoskrnl/se/semgr.c
reactos/subsystems/win32/win32k/include/winsta.h
reactos/subsystems/win32/win32k/main/dllmain.c
reactos/subsystems/win32/win32k/ntuser/winsta.c
reactos/subsystems/win32/win32k/objects/dc.c
reactos/subsystems/win32/win32k/w32k.h

index d5ab7c4..d03f0f0 100644 (file)
     <define name="KDBG" value="1" />
     <property name="DBG_OR_KDBG" value="true" />
   </if>
-  
-  <if property="GDB" value="0">
-    <compilerflag>-Os</compilerflag>
-    <compilerflag>-Wno-strict-aliasing</compilerflag>
-    <compilerflag>-ftracer</compilerflag>
-    <compilerflag>-momit-leaf-frame-pointer</compilerflag>
-    <compilerflag>-mpreferred-stack-boundary=2</compilerflag>
-  </if>
+  <compilerflag>-O3</compilerflag>
+  <compilerflag>-fno-optimize-sibling-calls</compilerflag>
+  <compilerflag>-Wno-strict-aliasing</compilerflag>
+  <compilerflag>-ftracer</compilerflag>
+  <compilerflag>-momit-leaf-frame-pointer</compilerflag>
+  <compilerflag>-mpreferred-stack-boundary=2</compilerflag>
   <compilerflag>-Wpointer-arith</compilerflag>
 
   <include>.</include>
index 8a5b13d..9becdcf 100644 (file)
@@ -35,7 +35,7 @@ double                            OldKernelTime = 0;
 LARGE_INTEGER                    liOldSystemTime = {{0,0}};
 SYSTEM_PERFORMANCE_INFORMATION    SystemPerfInfo;
 SYSTEM_BASIC_INFORMATION        SystemBasicInfo;
-SYSTEM_CACHE_INFORMATION        SystemCacheInfo;
+SYSTEM_FILECACHE_INFORMATION        SystemCacheInfo;
 SYSTEM_HANDLE_INFORMATION        SystemHandleInfo;
 PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION SystemProcessorTimeInfo = NULL;
 PSID                             SystemUserSid = NULL;
@@ -95,7 +95,7 @@ void PerfDataRefresh(void)
     HANDLE                            hProcessToken;
     SYSTEM_PERFORMANCE_INFORMATION    SysPerfInfo;
     SYSTEM_TIMEOFDAY_INFORMATION      SysTimeInfo;
-    SYSTEM_CACHE_INFORMATION        SysCacheInfo;
+    SYSTEM_FILECACHE_INFORMATION        SysCacheInfo;
     LPBYTE                            SysHandleInfoData;
     PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION SysProcessorTimeInfo;
     double                            CurrentKernelTime;
@@ -170,7 +170,7 @@ void PerfDataRefresh(void)
     /*
      * Save system cache info
      */
-    memcpy(&SystemCacheInfo, &SysCacheInfo, sizeof(SYSTEM_CACHE_INFORMATION));
+    memcpy(&SystemCacheInfo, &SysCacheInfo, sizeof(SYSTEM_FILECACHE_INFORMATION));
 
     /*
      * Save system processor time info
index df68197..4cd0cb4 100644 (file)
@@ -298,9 +298,8 @@ PNP_GetRelatedDeviceInstance(handle_t BindingHandle,
 
     PlugPlayData.Relation = Relationship;
 
-    PlugPlayData.RelatedDeviceInstance.Length = 0;
-    PlugPlayData.RelatedDeviceInstance.MaximumLength = Length;
-    PlugPlayData.RelatedDeviceInstance.Buffer = RelatedDeviceId;
+    PlugPlayData.RelatedDeviceInstanceLength = Length;
+    PlugPlayData.RelatedDeviceInstance = RelatedDeviceId;
 
     Status = NtPlugPlayControl(PlugPlayControlGetRelatedDevice,
                                (PVOID)&PlugPlayData,
index 1144f6b..86f2ef9 100644 (file)
@@ -37,8 +37,8 @@ Cabinet=reactos.cab
 
 [SetupData]
 DefaultPath = \ReactOS
-OsLoadOptions = "/NOGUIBOOT /NODEBUG"
-;OsLoadOptions = "/NOGUIBOOT /DEBUGPORT=COM1 /BAUDRATE=19200 /IRQ=4"
+;OsLoadOptions = "/NOGUIBOOT /NODEBUG"
+OsLoadOptions = "/NOGUIBOOT /DEBUGPORT=COM1 /BREAK"
 ;OsLoadOptions = "/NOGUIBOOT /DEBUGPORT=SCREEN"
 ;OsLoadOptions = "/NOGUIBOOT /DEBUGPORT=BOCHS"
 
index cfefcf6..8324074 100644 (file)
@@ -101,7 +101,7 @@ typedef struct _HARDWARE_PTE_X64 {
 } HARDWARE_PTE_X64, *PHARDWARE_PTE_X64;
 
 typedef struct _PAGE_DIRECTORY_X86 {
-    HARDWARE_PTE_X86 Pde[1024];
+    HARDWARE_PTE Pde[1024];
 } PAGE_DIRECTORY_X86, *PPAGE_DIRECTORY_X86;
 
 typedef struct _PAGE_DIRECTORY_X64 {
index d91b5ec..d27d4ff 100644 (file)
 #include <stdio.h>
 #include <ctype.h>
 #include <ntddk.h>
-#include <ndk/ntndk.h>
+#include <arc/arc.h>
+#include <ketypes.h>
+#include <mmtypes.h>
+#include <rosldr.h>
 #include <arch.h>
 #include <rtl.h>
 #include <disk.h>
index 80de92b..ea3ad00 100644 (file)
@@ -49,8 +49,7 @@ ULONG ConvertArcNameToBiosDriveNumber(PCHAR ArcPath);
 // Loader Functions And Definitions
 //
 ///////////////////////////////////////////////////////////////////////////////////////
-extern LOADER_PARAMETER_BLOCK LoaderBlock; /* Multiboot info structure passed to kernel */
+extern ROS_LOADER_PARAMETER_BLOCK LoaderBlock; /* Multiboot info structure passed to kernel */
 extern char                                    reactos_kernel_cmdline[255];    // Command line passed to kernel
 extern LOADER_MODULE           reactos_modules[64];            // Array to hold boot module info loaded for the kernel
 extern char                                    reactos_module_strings[64][256];        // Array to hold module names
@@ -65,6 +64,6 @@ ULONG_PTR STDCALL FrLdrCreateModule(LPCSTR ModuleName);
 ULONG_PTR STDCALL FrLdrLoadModule(FILE *ModuleImage, LPCSTR ModuleName, PULONG ModuleSize);
 BOOL STDCALL FrLdrCloseModule(ULONG_PTR ModuleBase, ULONG dwModuleSize);
 VOID STDCALL FrLdrStartup(ULONG Magic);
-typedef VOID (FASTCALL *ASMCODE)(ULONG Magic, PLOADER_PARAMETER_BLOCK LoaderBlock);
+typedef VOID (FASTCALL *ASMCODE)(ULONG Magic, PROS_LOADER_PARAMETER_BLOCK LoaderBlock);
 
 #endif // defined __REACTOS_H
index e9d29ed..932c626 100644 (file)
@@ -24,7 +24,7 @@
 #define NDEBUG
 #include <debug.h>
 
-LOADER_PARAMETER_BLOCK LoaderBlock;
+ROS_LOADER_PARAMETER_BLOCK LoaderBlock;
 char                                   reactos_kernel_cmdline[255];    // Command line passed to kernel
 LOADER_MODULE                  reactos_modules[64];            // Array to hold boot module info loaded for the kernel
 char                                   reactos_module_strings[64][256];        // Array to hold module names
index 0da4ef1..105fa8b 100644 (file)
@@ -20,7 +20,7 @@
 
 #include <freeldr.h>
 
-LOADER_PARAMETER_BLOCK LoaderBlock;
+ROS_LOADER_PARAMETER_BLOCK LoaderBlock;
 char                                   reactos_kernel_cmdline[255];    // Command line passed to kernel
 LOADER_MODULE                  reactos_modules[64];            // Array to hold boot module info loaded for the kernel
 char                                   reactos_module_strings[64][256];        // Array to hold module names
index feca2d3..cba1d5d 100644 (file)
@@ -525,8 +525,8 @@ RtlIpv4StringToAddressExA@16
 RtlIpv4StringToAddressExW@16
 RtlIpv4StringToAddressW@16
 RtlIpv6AddressToStringA@8
-RtlIpv6AddressToStringExA@16
-RtlIpv6AddressToStringExW@16
+RtlIpv6AddressToStringExA@20
+RtlIpv6AddressToStringExW@20
 RtlIpv6AddressToStringW@8
 RtlIpv6StringToAddressA@12
 RtlIpv6StringToAddressExA@16
index 2030dba..599ac44 100644 (file)
@@ -415,7 +415,7 @@ LdrpInit(PCONTEXT Context,
        NtModule->TimeDateStamp = NTHeaders->FileHeader.TimeDateStamp;
 
        InsertTailList(&Peb->Ldr->InLoadOrderModuleList,
-                      &NtModule->InLoadOrderModuleList);
+                      &NtModule->InLoadOrderLinks);
        InsertTailList(&Peb->Ldr->InInitializationOrderModuleList,
                       &NtModule->InInitializationOrderModuleList);
 
@@ -463,7 +463,7 @@ LdrpInit(PCONTEXT Context,
        ExeModule->TimeDateStamp = NTHeaders->FileHeader.TimeDateStamp;
 
        InsertHeadList(&Peb->Ldr->InLoadOrderModuleList,
-                      &ExeModule->InLoadOrderModuleList);
+                      &ExeModule->InLoadOrderLinks);
 
        LdrpInitLoader();
 
index 7796968..44f62fe 100644 (file)
@@ -73,7 +73,7 @@ VOID
 LdrpLoadUserModuleSymbols(PLDR_DATA_TABLE_ENTRY LdrModule)
 {
   NtSystemDebugControl(
-    DebugDbgLoadSymbols,
+    SysDbgQueryVersion,
     (PVOID)LdrModule,
     0,
     NULL,
@@ -255,7 +255,7 @@ LdrpInitializeTlsForProccess(VOID)
        Entry = ModuleListHead->Flink;
        while (Entry != ModuleListHead)
          {
-           Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList);
+           Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks);
            if (Module->LoadCount == 0xFFFF &&
                Module->TlsIndex != 0xFFFF)
              {
@@ -498,7 +498,7 @@ LdrAddModuleEntry(PVOID ImageBase,
 
   RtlEnterCriticalSection (NtCurrentPeb()->LoaderLock);
   InsertTailList(&NtCurrentPeb()->Ldr->InLoadOrderModuleList,
-                 &Module->InLoadOrderModuleList);
+                 &Module->InLoadOrderLinks);
   RtlLeaveCriticalSection(NtCurrentPeb()->LoaderLock);
 
   return(Module);
@@ -727,7 +727,7 @@ LdrpMapDllImageFile(IN PWSTR SearchPath OPTIONAL,
  */
 NTSTATUS NTAPI
 LdrLoadDll (IN PWSTR SearchPath OPTIONAL,
-            IN ULONG LoadFlags,
+            IN PULONG LoadFlags,
             IN PUNICODE_STRING Name,
             OUT PVOID *BaseAddress OPTIONAL)
 {
@@ -747,8 +747,8 @@ LdrLoadDll (IN PWSTR SearchPath OPTIONAL,
 
   *BaseAddress = NULL;
 
-  Status = LdrpLoadModule(SearchPath, LoadFlags, Name, &Module, BaseAddress);
-  if (NT_SUCCESS(Status) && 0 == (LoadFlags & LOAD_LIBRARY_AS_DATAFILE))
+  Status = LdrpLoadModule(SearchPath, *LoadFlags, Name, &Module, BaseAddress);
+  if (NT_SUCCESS(Status) && 0 == (*LoadFlags & LOAD_LIBRARY_AS_DATAFILE))
     {
       RtlEnterCriticalSection(NtCurrentPeb()->LoaderLock);
       Status = LdrpAttachProcess();
@@ -802,7 +802,7 @@ LdrFindEntryForAddress(PVOID Address,
 
   while (Entry != ModuleListHead)
     {
-      ModulePtr = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList);
+      ModulePtr = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks);
 
       DPRINT("Scanning %wZ at %p\n", &ModulePtr->BaseDllName, ModulePtr->DllBase);
 
@@ -901,7 +901,7 @@ LdrFindEntryForName(PUNICODE_STRING Name,
     }
   while (Entry != ModuleListHead)
     {
-      ModulePtr = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList);
+      ModulePtr = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks);
 
       DPRINT("Scanning %wZ %wZ\n", &ModulePtr->BaseDllName, &AdjustedName);
 
@@ -970,8 +970,9 @@ LdrFixupForward(PCHAR ForwardName)
          */
         if (!NT_SUCCESS(Status))
           {
+             ULONG Flags = LDRP_PROCESS_CREATION_TIME;
              Status = LdrLoadDll(NULL,
-                                 LDRP_PROCESS_CREATION_TIME,
+                                 &Flags,
                                  &DllName,
                                  &BaseAddress);
              if (NT_SUCCESS(Status))
@@ -1289,7 +1290,7 @@ LdrPerformRelocations(PIMAGE_NT_HEADERS NTHeaders,
           ProtectPage2 = NULL;
         }
 
-      RelocationDir = LdrProcessRelocationBlock(Page,
+      RelocationDir = LdrProcessRelocationBlock((ULONG_PTR)Page,
                                                 Count,
                                                 TypeOffset,
                                                 Delta);
@@ -2269,7 +2270,7 @@ LdrDisableThreadCalloutsForDll(IN PVOID BaseAddress)
     Entry = ModuleListHead->Flink;
     while (Entry != ModuleListHead)
       {
-        Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList);
+        Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks);
 
         DPRINT("BaseDllName %wZ BaseAddress %p\n", &Module->BaseDllName, Module->DllBase);
 
@@ -2346,7 +2347,7 @@ LdrAddRefDll(IN ULONG Flags,
     Entry = ModuleListHead->Flink;
     while (Entry != ModuleListHead)
     {
-        Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList);
+        Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks);
 
         if (Module->DllBase == BaseAddress)
         {
@@ -2385,7 +2386,7 @@ RtlPcToFileHeader(IN PVOID PcValue,
     Entry = ModuleListHead->Flink;
     while (Entry != ModuleListHead)
       {
-        Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList);
+        Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks);
 
         if ((ULONG_PTR)PcValue >= (ULONG_PTR)Module->DllBase &&
             (ULONG_PTR)PcValue < (ULONG_PTR)Module->DllBase + Module->SizeOfImage)
@@ -2520,7 +2521,7 @@ LdrpDetachProcess(BOOLEAN UnloadAll)
                ((UnloadAll && Module->LoadCount != 0xFFFF) || Module->LoadCount == 0))
              {
                /* remove the module entry from the list */
-               RemoveEntryList (&Module->InLoadOrderModuleList);
+               RemoveEntryList (&Module->InLoadOrderLinks);
                RemoveEntryList (&Module->InInitializationOrderModuleList);
 
                NtUnmapViewOfSection (NtCurrentProcess (), Module->DllBase);
@@ -2653,7 +2654,7 @@ LdrpAttachThread (VOID)
         }
 
       Entry = NtCurrentPeb()->Ldr->InLoadOrderModuleList.Flink;
-      Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList);
+      Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks);
       LdrpTlsCallback(Module, DLL_THREAD_ATTACH);
     }
 
@@ -2741,7 +2742,7 @@ LdrQueryProcessModuleInformation(IN PRTL_PROCESS_MODULES ModuleInformation OPTIO
   PCHAR p;
 
   DPRINT("LdrQueryProcessModuleInformation() called\n");
-
+ // FIXME: This code is ultra-duplicated. see lib\rtl\dbgbuffer.c
   RtlEnterCriticalSection (NtCurrentPeb()->LoaderLock);
 
   if (ModuleInformation == NULL || Size == 0)
@@ -2750,8 +2751,8 @@ LdrQueryProcessModuleInformation(IN PRTL_PROCESS_MODULES ModuleInformation OPTIO
     }
   else
     {
-      ModuleInformation->ModuleCount = 0;
-      ModulePtr = &ModuleInformation->ModuleEntry[0];
+      ModuleInformation->NumberOfModules = 0;
+      ModulePtr = &ModuleInformation->Modules[0];
       Status = STATUS_SUCCESS;
     }
 
@@ -2760,7 +2761,7 @@ LdrQueryProcessModuleInformation(IN PRTL_PROCESS_MODULES ModuleInformation OPTIO
 
   while (Entry != ModuleListHead)
     {
-      Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList);
+      Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks);
 
       DPRINT("  Module %wZ\n",
              &Module->FullDllName);
@@ -2771,28 +2772,30 @@ LdrQueryProcessModuleInformation(IN PRTL_PROCESS_MODULES ModuleInformation OPTIO
         }
       else if (ModuleInformation != NULL)
         {
-          ModulePtr->Reserved[0] = ModulePtr->Reserved[1] = 0;      // FIXME: ??
-          ModulePtr->Base = Module->DllBase;
-          ModulePtr->Size = Module->SizeOfImage;
-          ModulePtr->Flags = Module->Flags;
-          ModulePtr->Index = 0;      // FIXME: index ??
-          ModulePtr->Unknown = 0;      // FIXME: ??
-          ModulePtr->LoadCount = Module->LoadCount;
-
-          AnsiString.Length = 0;
+          ModulePtr->Section = 0;
+          ModulePtr->MappedBase = NULL;      // FIXME: ??
+          ModulePtr->ImageBase        = Module->DllBase;
+          ModulePtr->ImageSize        = Module->SizeOfImage;
+          ModulePtr->Flags       = Module->Flags;
+          ModulePtr->LoadOrderIndex       = 0;      // FIXME:  ??
+          ModulePtr->InitOrderIndex     = 0;      // FIXME: ??
+          ModulePtr->LoadCount   = Module->LoadCount;
+
+          AnsiString.Length        = 0;
           AnsiString.MaximumLength = 256;
-          AnsiString.Buffer = ModulePtr->ImageName;
+          AnsiString.Buffer        = ModulePtr->FullPathName;
           RtlUnicodeStringToAnsiString(&AnsiString,
                                        &Module->FullDllName,
                                        FALSE);
-          p = strrchr(ModulePtr->ImageName, '\\');
+
+          p = strrchr(ModulePtr->FullPathName, '\\');
           if (p != NULL)
-            ModulePtr->ModuleNameOffset = p - ModulePtr->ImageName + 1;
+            ModulePtr->OffsetToFileName = p - ModulePtr->FullPathName + 1;
           else
-            ModulePtr->ModuleNameOffset = 0;
+            ModulePtr->OffsetToFileName = 0;
 
           ModulePtr++;
-          ModuleInformation->ModuleCount++;
+          ModuleInformation->NumberOfModules++;
         }
       UsedSize += sizeof(RTL_PROCESS_MODULE_INFORMATION);
 
@@ -3154,10 +3157,10 @@ LdrQueryImageFileExecutionOptions (IN PUNICODE_STRING SubKey,
 
 
 PIMAGE_BASE_RELOCATION NTAPI
-LdrProcessRelocationBlock(IN PVOID Address,
-                         IN USHORT Count,
+LdrProcessRelocationBlock(IN ULONG_PTR Address,
+                         IN ULONG Count,
                          IN PUSHORT TypeOffset,
-                         IN ULONG_PTR Delta)
+                         IN LONG_PTR Delta)
 {
   SHORT Offset;
   USHORT Type;
index e2b213a..41bd902 100644 (file)
@@ -6,7 +6,7 @@
        <define name="__NTDLL__" />
        <define name="_DISABLE_TIDENTS" />
        <define name="__USE_W32API" />
-       <define name="_WIN32_WINNT">0x0600</define>
+       <define name="_WIN32_WINNT">0x0502</define>
        <define name="_NTOSKRNL_" />
        <define name="__NO_CTYPE_INLINES" />
        <library>rtl</library>
index 0bee9e5..c0a01cf 100644 (file)
@@ -614,6 +614,8 @@ InternalTrusteeAToW(IN PTRUSTEE_A pTrusteeA,
     {
         case TRUSTEE_IS_NAME:
         {
+            /* directly copy the array, this works as the size of the EXPLICIT_ACCESS_A
+               structure matches the size of the EXPLICIT_ACCESS_W version */
             lpStr = GetTrusteeName(pTrusteeA);
             if (lpStr != NULL)
                 BufferSize = strlen(lpStr) + 1;
index dbf1c4f..ee3d8bb 100644 (file)
 
 /* INCLUDES *****************************************************************/
 
+/* File contains Vista Semantics */
+#undef _WIN32_WINNT
+#define _WIN32_WINNT 0x0600
+
 #include <k32.h>
 
 #define NDEBUG
@@ -399,14 +403,14 @@ CreateSymbolicLinkW(IN LPCWSTR lpSymlinkFileName,
 
     switch(RtlDetermineDosPathNameType_U(lpTargetFileName))
     {
-    case INVALID_PATH:
-    case ABSOLUTE_PATH:
-    case RELATIVE_PATH:
+    case RtlPathTypeUnknown:
+    case RtlPathTypeRooted:
+    case RtlPathTypeRelative:
         bRelativePath = TRUE;
         RtlInitUnicodeString(&TargetFileName, lpTargetFileName);
         break;
 
-    case RELATIVE_DRIVE_PATH:
+    case RtlPathTypeDriveRelative:
         {
             LPWSTR FilePart;
             SIZE_T cchTargetFullFileName;
@@ -438,10 +442,10 @@ CreateSymbolicLinkW(IN LPCWSTR lpSymlinkFileName,
 
         // fallthrough
 
-    case UNC_PATH:
-    case ABSOLUTE_DRIVE_PATH:
-    case DEVICE_PATH:
-    case UNC_DOT_PATH:
+    case RtlPathTypeUncAbsolute:
+    case RtlPathTypeDriveAbsolute:
+    case RtlPathTypeLocalDevice:
+    case RtlPathTypeRootLocalDevice:
     default:
         if(!RtlDosPathNameToNtPathName_U(lpTargetFileName, &TargetFileName, NULL, NULL))
         {
index 4292973..a5db894 100644 (file)
 
 /* INCLUDES *****************************************************************/
 
+/* File contains Vista Semantics */
+#undef _WIN32_WINNT
+#define _WIN32_WINNT 0x0600
+
 #include <k32.h>
 
 #define NDEBUG
index eac725b..f1d4195 100644 (file)
@@ -5,11 +5,10 @@
        <define name="_DISABLE_TIDENTS" />
        <define name="_SEH_NO_NATIVE_NLG" />
        <define name="__USE_W32API" />
-       <define name="_WIN32_WINNT">0x0600</define>
+       <define name="_WIN32_WINNT">0x0502</define>
        <define name="__NO_CTYPE_INLINES" />
-       <define name="WINVER">0x0600</define>
+       <define name="WINVER">0x502</define>
        <pch>k32.h</pch>
-       <compilationunit name="unit.c">
        <directory name="debug">
                <file>break.c</file>
                <file>debugger.c</file>
                <file>thread.c</file>
                <file>tls.c</file>
        </directory>
-       </compilationunit>
        <directory name="misc">
                <file>lcformat.c</file>
                <file>profile.c</file>
index 941716e..ed52f71 100644 (file)
 
 /* INCLUDES ******************************************************************/
 
+/* File contains Vista Semantics */
+#undef _WIN32_WINNT
+#define _WIN32_WINNT 0x0600
+
 #include <k32.h>
 
 #define NDEBUG
index c8dcf3e..21ed4de 100644 (file)
@@ -196,14 +196,14 @@ LoadLibraryExW (
     {
         /* Call the API Properly */
         Status = LdrLoadDll(SearchPath,
-                            (ULONG)&DllCharacteristics, // Silence compiler
+                            &DllCharacteristics,
                             &DllName,
                             (PVOID*)&hInst);
     }
     else
     {
         /* Call the ROS API. NOTE: Don't fix this, I have a patch to merge later. */
-        Status = LdrLoadDll(SearchPath, dwFlags, &DllName, (PVOID*)&hInst);
+        Status = LdrLoadDll(SearchPath, &dwFlags, &DllName, (PVOID*)&hInst);
     }
        RtlFreeHeap(RtlGetProcessHeap(), 0, SearchPath);
        if ( !NT_SUCCESS(Status))
@@ -305,7 +305,7 @@ GetModuleFileNameA (
 
        while (Entry != ModuleListHead)
        {
-               Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList);
+               Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks);
                if (Module->DllBase == (PVOID)hModule)
                {
                        if (nSize * sizeof(WCHAR) < Module->FullDllName.Length)
@@ -372,7 +372,7 @@ GetModuleFileNameW (
        Entry = ModuleListHead->Flink;
        while (Entry != ModuleListHead)
        {
-               Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList);
+               Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks);
 
                if (Module->DllBase == (PVOID)hModule)
                {
index f0d2fef..b8a06d2 100644 (file)
@@ -756,7 +756,7 @@ static BOOL PROFILE_Open( LPCWSTR filename )
 
     GetWindowsDirectoryW( windirW, MAX_PATH );
 
-    if ((RtlDetermineDosPathNameType_U(filename) == RELATIVE_PATH) &&
+    if ((RtlDetermineDosPathNameType_U(filename) == RtlPathTypeRelative) &&
         !wcschr(filename, '\\') && !wcschr(filename, '/'))
     {
         static const WCHAR wszSeparator[] = {'\\', 0};
index 510397a..9a0d818 100644 (file)
  *                  10/28/2005 Created stubs (w3)
  */
 
+/* File contains Vista Semantics */
+#undef _WIN32_WINNT
+#define _WIN32_WINNT 0x0600
+
 #include <k32.h>
 
 #define NDEBUG
index 9a064b2..a67e938 100644 (file)
@@ -92,8 +92,8 @@ typedef struct _TH32SNAPSHOT
 /* INTERNAL FUNCTIONS *********************************************************/
 
 static VOID
-TH32FreeAllocatedResources(PRTL_DEBUG_BUFFER HeapDebug,
-                           PRTL_DEBUG_BUFFER ModuleDebug,
+TH32FreeAllocatedResources(PRTL_DEBUG_INFORMATION HeapDebug,
+                           PRTL_DEBUG_INFORMATION ModuleDebug,
                            PVOID ProcThrdInfo,
                            SIZE_T ProcThrdInfoSize)
 {
@@ -118,8 +118,8 @@ TH32FreeAllocatedResources(PRTL_DEBUG_BUFFER HeapDebug,
 static NTSTATUS
 TH32CreateSnapshot(DWORD dwFlags,
                    DWORD th32ProcessID,
-                   PRTL_DEBUG_BUFFER *HeapDebug,
-                   PRTL_DEBUG_BUFFER *ModuleDebug,
+                   PRTL_DEBUG_INFORMATION *HeapDebug,
+                   PRTL_DEBUG_INFORMATION *ModuleDebug,
                    PVOID *ProcThrdInfo,
                    SIZE_T *ProcThrdInfoSize)
 {
@@ -221,8 +221,8 @@ TH32CreateSnapshot(DWORD dwFlags,
 static NTSTATUS
 TH32CreateSnapshotSectionInitialize(DWORD dwFlags,
                                     DWORD th32ProcessID,
-                                    PRTL_DEBUG_BUFFER HeapDebug,
-                                    PRTL_DEBUG_BUFFER ModuleDebug,
+                                    PRTL_DEBUG_INFORMATION HeapDebug,
+                                    PRTL_DEBUG_INFORMATION ModuleDebug,
                                     PVOID ProcThrdInfo,
                                     HANDLE *SectionHandle)
 {
@@ -248,8 +248,8 @@ TH32CreateSnapshotSectionInitialize(DWORD dwFlags,
    */
   if(dwFlags & TH32CS_SNAPHEAPLIST)
   {
-    hi = (PRTL_PROCESS_HEAPS)HeapDebug->HeapInformation;
-    nHeaps = hi->HeapCount;
+    hi = (PRTL_PROCESS_HEAPS)HeapDebug->Heaps;
+    nHeaps = hi->NumberOfHeaps;
     RequiredSnapshotSize += nHeaps * sizeof(HEAPLIST32);
   }
 
@@ -258,8 +258,8 @@ TH32CreateSnapshotSectionInitialize(DWORD dwFlags,
    */
   if(dwFlags & TH32CS_SNAPMODULE)
   {
-    mi = (PRTL_PROCESS_MODULES)ModuleDebug->ModuleInformation;
-    nModules = mi->ModuleCount;
+    mi = (PRTL_PROCESS_MODULES)ModuleDebug->Modules;
+    nModules = mi->NumberOfModules;
     RequiredSnapshotSize += nModules * sizeof(MODULEENTRY32W);
   }
 
@@ -350,13 +350,13 @@ TH32CreateSnapshotSectionInitialize(DWORD dwFlags,
     {
       HeapListEntry->dwSize = sizeof(HEAPLIST32);
       HeapListEntry->th32ProcessID = th32ProcessID;
-      HeapListEntry->th32HeapID = (ULONG_PTR)hi->HeapEntry[i].Base;
-      HeapListEntry->dwFlags = hi->HeapEntry[i].Flags;
+      HeapListEntry->th32HeapID = (ULONG_PTR)hi->Heaps[i].BaseAddress;
+      HeapListEntry->dwFlags = hi->Heaps[i].Flags;
 
       HeapListEntry++;
     }
 
-    DataOffset += hi->HeapCount * sizeof(HEAPLIST32);
+    DataOffset += hi->NumberOfHeaps * sizeof(HEAPLIST32);
   }
 
   /* initialize the module list */
@@ -370,22 +370,22 @@ TH32CreateSnapshotSectionInitialize(DWORD dwFlags,
       ModuleListEntry->dwSize = sizeof(MODULEENTRY32W);
       ModuleListEntry->th32ModuleID = 1; /* no longer used, always set to one! */
       ModuleListEntry->th32ProcessID = th32ProcessID;
-      ModuleListEntry->GlblcntUsage = mi->ModuleEntry[i].LoadCount;
-      ModuleListEntry->ProccntUsage = mi->ModuleEntry[i].LoadCount;
-      ModuleListEntry->modBaseAddr = (BYTE*)mi->ModuleEntry[i].Base;
-      ModuleListEntry->modBaseSize = mi->ModuleEntry[i].Size;
-      ModuleListEntry->hModule = (HMODULE)mi->ModuleEntry[i].Base;
+      ModuleListEntry->GlblcntUsage = mi->Modules[i].LoadCount;
+      ModuleListEntry->ProccntUsage = mi->Modules[i].LoadCount;
+      ModuleListEntry->modBaseAddr = (BYTE*)mi->Modules[i].ImageBase;
+      ModuleListEntry->modBaseSize = mi->Modules[i].ImageSize;
+      ModuleListEntry->hModule = (HMODULE)mi->Modules[i].ImageBase;
 
       MultiByteToWideChar(CP_ACP,
                           0,
-                          &mi->ModuleEntry[i].ImageName[mi->ModuleEntry[i].ModuleNameOffset],
+                          &mi->Modules[i].FullPathName[mi->Modules[i].OffsetToFileName],
                           -1,
                           ModuleListEntry->szModule,
                           sizeof(ModuleListEntry->szModule) / sizeof(ModuleListEntry->szModule[0]));
 
       MultiByteToWideChar(CP_ACP,
                           0,
-                          mi->ModuleEntry[i].ImageName,
+                          mi->Modules[i].FullPathName,
                           -1,
                           ModuleListEntry->szExePath,
                           sizeof(ModuleListEntry->szExePath) / sizeof(ModuleListEntry->szExePath[0]));
@@ -393,7 +393,7 @@ TH32CreateSnapshotSectionInitialize(DWORD dwFlags,
       ModuleListEntry++;
     }
 
-    DataOffset += mi->ModuleCount * sizeof(MODULEENTRY32W);
+    DataOffset += mi->NumberOfModules * sizeof(MODULEENTRY32W);
   }
 
   /* initialize the process list */
@@ -1113,7 +1113,7 @@ HANDLE
 STDCALL
 CreateToolhelp32Snapshot(DWORD dwFlags, DWORD th32ProcessID)
 {
-  PRTL_DEBUG_BUFFER HeapDebug, ModuleDebug;
+  PRTL_DEBUG_INFORMATION HeapDebug, ModuleDebug;
   PVOID ProcThrdInfo;
   SIZE_T ProcThrdInfoSize;
   NTSTATUS Status;
index e6410cc..119f077 100644 (file)
@@ -9,6 +9,7 @@
 /* INCLUDES ****************************************************************/
 
 #include <k32.h>
+#include "i386/ketypes.h"
 
 #define NDEBUG
 #include "../include/debug.h"
index b7c8e03..fa20595 100644 (file)
@@ -883,7 +883,7 @@ GetAppName:
             PathType = RtlDetermineDosPathNameType_U(lpApplicationName);
                     
             /* If it's not relative, try to get the error */
-            if (PathType != RELATIVE_PATH)
+            if (PathType != RtlPathTypeRelative)
             {
                 /* This should fail, and give us a detailed LastError */
                 hFile = CreateFileW(lpApplicationName,
index 357cae3..404af60 100644 (file)
@@ -17,8 +17,6 @@
 #define NDEBUG
 #include "../include/debug.h"
 
-#define TLS_EXPANSION_SLOTS (8 * sizeof(((PPEB)NULL)->TlsExpansionBitmapBits))
-
 /* FUNCTIONS *****************************************************************/
 
 /*
index 5b1f26a..d3fc597 100644 (file)
@@ -42,7 +42,7 @@ typedef struct _ENUM_DEVICE_DRIVERS_CONTEXT
 } ENUM_DEVICE_DRIVERS_CONTEXT, *PENUM_DEVICE_DRIVERS_CONTEXT;
 
 NTSTATUS STDCALL
-EnumDeviceDriversCallback(IN PSYSTEM_MODULE_INFORMATION_ENTRY CurrentModule,
+EnumDeviceDriversCallback(IN PRTL_PROCESS_MODULE_INFORMATION CurrentModule,
                           IN OUT PVOID CallbackContext)
 {
   PENUM_DEVICE_DRIVERS_CONTEXT Context = (PENUM_DEVICE_DRIVERS_CONTEXT)CallbackContext;
@@ -54,7 +54,7 @@ EnumDeviceDriversCallback(IN PSYSTEM_MODULE_INFORMATION_ENTRY CurrentModule,
   }
 
   /* return current module */
-  *Context->lpImageBase = CurrentModule->Base;
+  *Context->lpImageBase = CurrentModule->ImageBase;
 
   /* go to next array slot */
   Context->lpImageBase++;
@@ -141,22 +141,22 @@ typedef struct _GET_DEVICE_DRIVER_NAME_CONTEXT
 } GET_DEVICE_DRIVER_NAME_CONTEXT, *PGET_DEVICE_DRIVER_NAME_CONTEXT;
 
 NTSTATUS STDCALL
-GetDeviceDriverNameCallback(IN PSYSTEM_MODULE_INFORMATION_ENTRY CurrentModule,
+GetDeviceDriverNameCallback(IN PRTL_PROCESS_MODULE_INFORMATION CurrentModule,
                             IN OUT PVOID CallbackContext)
 {
   PGET_DEVICE_DRIVER_NAME_CONTEXT Context = (PGET_DEVICE_DRIVER_NAME_CONTEXT)CallbackContext;
 
   /* module found */
-  if(Context->ImageBase == CurrentModule->Base)
+  if(Context->ImageBase == CurrentModule->ImageBase)
   {
     PCHAR pcModuleName;
     ULONG l;
 
     /* get the full name or just the filename part */
     if(Context->bFullName)
-      pcModuleName = &CurrentModule->ImageName[0];
+      pcModuleName = &CurrentModule->FullPathName[0];
     else
-      pcModuleName = &CurrentModule->ImageName[CurrentModule->PathLength];
+      pcModuleName = &CurrentModule->FullPathName[CurrentModule->OffsetToFileName];
 
     /* get the length of the name */
     l = strlen(pcModuleName);
index 6d44f5f..5010d8e 100644 (file)
@@ -18,11 +18,18 @@ typedef struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES, *PSECURITY_ATTRIBUTES;
 
 #include <wincon.h>
 #include <blue/ntddblue.h>
-#include <ndk/halfuncs.h>
 
 #define NDEBUG
 #include <debug.h>
 
+// ROS Internal. Please deprecate.
+NTHALAPI
+BOOLEAN
+NTAPI
+HalQueryDisplayOwnership(
+    VOID
+);
+
 /* DEFINITIONS ***************************************************************/
 
 #define VIDMEM_BASE        0xb8000
index a9776f0..ea5c5f1 100644 (file)
@@ -10,7 +10,7 @@
 #define __DRIVERS_FS_MS_MSFS_H
 
 #include <ntifs.h>
-#include <ndk/ntndk.h>
+#include <iotypes.h>
 
 /*
  * FIXME: GCC doesn't have a working option for defaulting to a calling
index ec7a1df..a542ede 100644 (file)
@@ -4,7 +4,6 @@
 #include <reactos/helper.h>
 
 #ifdef __GNUC__
-#include <ndk/ntndk.h>
 #include <ccros.h>
 
 #define USE_ROS_CC_AND_FS
index 4377523..a2da64d 100644 (file)
@@ -13,7 +13,6 @@
 /* FUNCTIONS **************************************************************/
 
 #include <ntddk.h>
-#include <halfuncs.h>
 #include <string.h>
 #include <devices.h>
 
index 29e4338..680d9dd 100644 (file)
@@ -1,6 +1,7 @@
 #include <roscfg.h>
 #include <limits.h>
 #include <ntddk.h>
+#include <ntifs.h>
 #include <tdi.h>
 #include <tdistat.h>
 #include <../recmutex/recmutex.h>
@@ -37,5 +38,4 @@
 #include <interface.h>
 #include <ports.h>
 #include <ipifcons.h>
-#include <ndk/ntndk.h>
 #include <chew/chew.h>
index 732d41c..cc17160 100644 (file)
@@ -33,9 +33,8 @@
 #include <ntddscsi.h>
 #include <include/class2.h>
 #include <diskdump/diskdump.h>
-
-#include <ndk/extypes.h>
 #include <ndk/rtlfuncs.h>
+
 #include "../scsiport/scsiport_int.h"
 
 #define NDEBUG
index d3598da..d28e498 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 #include "videoprt.h"
-#include "internal/ke.h"
+#include "internal/i386/v86m.h"
 
 /* PRIVATE FUNCTIONS **********************************************************/
 
@@ -178,7 +178,7 @@ IntInt10CallBios(
    Regs.Ds = BiosArguments->SegDs;
    DPRINT("- Input register SegEs: %x\n", BiosArguments->SegEs);
    Regs.Es = BiosArguments->SegEs;
-   Status = Ke386CallBios(0x10, &Regs);
+   Status = Ke386CallBios(0x10, (PCONTEXT)&Regs);
    BiosArguments->Eax = Regs.Eax;
    BiosArguments->Ebx = Regs.Ebx;
    BiosArguments->Ecx = Regs.Ecx;
@@ -234,7 +234,7 @@ VideoPortInt10(
    Regs.Edi = BiosArguments->Edi;
    DPRINT("- Input register Ebp: %x\n", BiosArguments->Ebp);
    Regs.Ebp = BiosArguments->Ebp;
-   Status = Ke386CallBios(0x10, &Regs);
+   Status = Ke386CallBios(0x10, (PCONTEXT)&Regs);
    BiosArguments->Eax = Regs.Eax;
    BiosArguments->Ebx = Regs.Ebx;
    BiosArguments->Ecx = Regs.Ecx;
index e70e073..ca99ab1 100644 (file)
 
 #define DPFLTR_IHVVIDEO_ID 0 /* FIXME */
 
+/* ROS Internal. Please deprecate */
+NTHALAPI
+VOID
+NTAPI
+HalReleaseDisplayOwnership(
+    VOID
+);
+
 typedef struct _VIDEO_PORT_ADDRESS_MAPPING
 {
    LIST_ENTRY List;
index fd97737..8e58f47 100644 (file)
@@ -14,6 +14,8 @@
 #include <ntddk.h>
 #include <ndk/halfuncs.h>
 #include <ndk/kdfuncs.h>
+#include <rosldr.h>
+#include <internal/kd.h>
 
 #define NDEBUG
 #include <debug.h>
@@ -333,7 +335,7 @@ BOOLEAN
 NTAPI
 HalInitSystem(
   ULONG BootPhase,
-  PLOADER_PARAMETER_BLOCK LoaderBlock)
+  PROS_LOADER_PARAMETER_BLOCK LoaderBlock)
 {
   UNIMPLEMENTED;
 
@@ -344,7 +346,7 @@ HalInitSystem(
 VOID
 NTAPI
 HalInitializeProcessor(ULONG ProcessorNumber,
-                       PLOADER_PARAMETER_BLOCK LoaderBlock)
+                       PROS_LOADER_PARAMETER_BLOCK LoaderBlock)
 {
   UNIMPLEMENTED;
 }
@@ -558,7 +560,7 @@ HalTranslateBusAddress(
 VOID
 NTAPI
 IoAssignDriveLetters(
-  PLOADER_PARAMETER_BLOCK LoaderBlock,
+  PROS_LOADER_PARAMETER_BLOCK LoaderBlock,
   PSTRING NtDeviceName,
   PUCHAR NtSystemPath,
   PSTRING NtSystemPathString)
index 48e3f44..b4ed7c3 100644 (file)
@@ -571,7 +571,7 @@ HalRestorePalette(VOID)
 /* PRIVATE FUNCTIONS ********************************************************/
 
 VOID FASTCALL
-HalInitializeDisplay (PLOADER_PARAMETER_BLOCK LoaderBlock)
+HalInitializeDisplay (PROS_LOADER_PARAMETER_BLOCK LoaderBlock)
 /*
  * FUNCTION: Initalize the display
  * ARGUMENTS:
index 90c74fe..5a99876 100644 (file)
@@ -33,17 +33,17 @@ DriverEntry(
 
 BOOLEAN STDCALL
 HalInitSystem (ULONG BootPhase,
-               PLOADER_PARAMETER_BLOCK LoaderBlock)
+               PROS_LOADER_PARAMETER_BLOCK LoaderBlock)
 {
   if (BootPhase == 0)
     {
       RtlZeroMemory(&HalpHooks, sizeof(HALP_HOOKS));
-      HalpInitPhase0(LoaderBlock);      
+      HalpInitPhase0((PROS_LOADER_PARAMETER_BLOCK)LoaderBlock);      
     }
   else if (BootPhase == 1)
     {
       /* Initialize display and make the screen black */
-      HalInitializeDisplay (LoaderBlock);
+      HalInitializeDisplay ((PROS_LOADER_PARAMETER_BLOCK)LoaderBlock);
       HalpInitBusHandlers();
       HalpInitDma();
 
index dc66dc8..5ad9d07 100644 (file)
@@ -67,7 +67,7 @@ KIRQL STDCALL KeGetCurrentIrql (VOID)
  * RETURNS: The current irq level
  */
 {
-  return(KeGetCurrentKPCR()->Irql);
+  return(KeGetPcr()->Irql);
 }
 
 VOID HalpInitPICs(VOID)
@@ -136,7 +136,7 @@ HalpExecuteIrqs(KIRQL NewIrql)
     {
       if (HalpPendingInterruptCount[i] > 0)
        {
-          KeGetCurrentKPCR()->Irql = (KIRQL)IRQ_TO_DIRQL(i);
+          KeGetPcr()->Irql = (KIRQL)IRQ_TO_DIRQL(i);
 
            while (HalpPendingInterruptCount[i] > 0)
             {
@@ -146,8 +146,8 @@ HalpExecuteIrqs(KIRQL NewIrql)
               HalpPendingInterruptCount[i]--;
               KiInterruptDispatch2(i + IRQ_BASE, NewIrql);
             }
-          KeGetCurrentKPCR()->Irql--;
-          HalpEndSystemInterrupt(KeGetCurrentKPCR()->Irql);
+          KeGetPcr()->Irql--;
+          HalpEndSystemInterrupt(KeGetPcr()->Irql);
        }
     }
 
@@ -158,22 +158,22 @@ HalpLowerIrql(KIRQL NewIrql)
 {
   if (NewIrql >= PROFILE_LEVEL)
     {
-      KeGetCurrentKPCR()->Irql = NewIrql;
+      KeGetPcr()->Irql = NewIrql;
       return;
     }
   HalpExecuteIrqs(NewIrql);
   if (NewIrql >= DISPATCH_LEVEL)
     {
-      KeGetCurrentKPCR()->Irql = NewIrql;
+      KeGetPcr()->Irql = NewIrql;
       return;
     }
-  KeGetCurrentKPCR()->Irql = DISPATCH_LEVEL;
-  if (((PKIPCR)KeGetCurrentKPCR())->HalReserved[HAL_DPC_REQUEST])
+  KeGetPcr()->Irql = DISPATCH_LEVEL;
+  if (((PKIPCR)KeGetPcr())->HalReserved[HAL_DPC_REQUEST])
     {
-      ((PKIPCR)KeGetCurrentKPCR())->HalReserved[HAL_DPC_REQUEST] = FALSE;
+      ((PKIPCR)KeGetPcr())->HalReserved[HAL_DPC_REQUEST] = FALSE;
       KiDispatchInterrupt();
     }
-  KeGetCurrentKPCR()->Irql = APC_LEVEL;
+  KeGetPcr()->Irql = APC_LEVEL;
   if (NewIrql == APC_LEVEL)
     {
       return;
@@ -183,7 +183,7 @@ HalpLowerIrql(KIRQL NewIrql)
     {
       KiDeliverApc(KernelMode, NULL, NULL);
     }
-  KeGetCurrentKPCR()->Irql = PASSIVE_LEVEL;
+  KeGetPcr()->Irql = PASSIVE_LEVEL;
 }
 
 /**********************************************************************
@@ -207,10 +207,10 @@ KfLowerIrql (KIRQL        NewIrql)
 {
   DPRINT("KfLowerIrql(NewIrql %d)\n", NewIrql);
   
-  if (NewIrql > KeGetCurrentKPCR()->Irql)
+  if (NewIrql > KeGetPcr()->Irql)
     {
       DbgPrint ("(%s:%d) NewIrql %x CurrentIrql %x\n",
-               __FILE__, __LINE__, NewIrql, KeGetCurrentKPCR()->Irql);
+               __FILE__, __LINE__, NewIrql, KeGetPcr()->Irql);
       KEBUGCHECK(0);
       for(;;);
     }
@@ -266,16 +266,16 @@ KfRaiseIrql (KIRQL        NewIrql)
   
   DPRINT("KfRaiseIrql(NewIrql %d)\n", NewIrql);
   
-  if (NewIrql < KeGetCurrentKPCR()->Irql)
+  if (NewIrql < KeGetPcr()->Irql)
     {
       DbgPrint ("%s:%d CurrentIrql %x NewIrql %x\n",
-               __FILE__,__LINE__,KeGetCurrentKPCR()->Irql,NewIrql);
+               __FILE__,__LINE__,KeGetPcr()->Irql,NewIrql);
       KEBUGCHECK (0);
       for(;;);
     }
   
-  OldIrql = KeGetCurrentKPCR()->Irql;
-  KeGetCurrentKPCR()->Irql = NewIrql;
+  OldIrql = KeGetPcr()->Irql;
+  KeGetPcr()->Irql = NewIrql;
   return OldIrql;
 }
 
@@ -380,13 +380,13 @@ HalBeginSystemInterrupt (ULONG Vector,
      WRITE_PORT_UCHAR((PUCHAR)0xa0,0x20);
   }
   
-  if (KeGetCurrentKPCR()->Irql >= Irql)
+  if (KeGetPcr()->Irql >= Irql)
     {
       HalpPendingInterruptCount[irq]++;
       return(FALSE);
     }
-  *OldIrql = KeGetCurrentKPCR()->Irql;
-  KeGetCurrentKPCR()->Irql = Irql;
+  *OldIrql = KeGetPcr()->Irql;
+  KeGetPcr()->Irql = Irql;
 
   return(TRUE);
 }
@@ -461,11 +461,11 @@ HalRequestSoftwareInterrupt(
   switch (Request)
   {
     case APC_LEVEL:
-      ((PKIPCR)KeGetCurrentKPCR())->HalReserved[HAL_APC_REQUEST] = TRUE;
+      ((PKIPCR)KeGetPcr())->HalReserved[HAL_APC_REQUEST] = TRUE;
       break;
 
     case DISPATCH_LEVEL:
-      ((PKIPCR)KeGetCurrentKPCR())->HalReserved[HAL_DPC_REQUEST] = TRUE;
+      ((PKIPCR)KeGetPcr())->HalReserved[HAL_DPC_REQUEST] = TRUE;
       break;
       
     default:
index 4ff00d3..432ca1f 100644 (file)
@@ -91,7 +91,7 @@ KeAcquireQueuedSpinLock(IN PKLOCK_QUEUE_HANDLE LockHandle)
  */
 KIRQL
 FASTCALL
-KeAcquireQueuedSpinLockRaiseToSynch(IN PKLOCK_QUEUE_HANDLE LockHandle)
+KeAcquireQueuedSpinLockRaiseToSynch(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber)
 {
     /* Simply raise to dispatch */
     return KfRaiseIrql(DISPATCH_LEVEL);
index 2ec0310..3d29968 100644 (file)
@@ -125,9 +125,9 @@ VOID
 STDCALL
 KeStallExecutionProcessor(ULONG Microseconds)
 {
-   PKIPCR Pcr = (PKIPCR)KeGetCurrentKPCR();
+   PKIPCR Pcr = (PKIPCR)KeGetPcr();
 
-   if (Pcr->PrcbData.FeatureBits & X86_FEATURE_TSC)
+   if (Pcr->PrcbData.FeatureBits & KF_RDTSC)
    {
       LARGE_INTEGER EndCount, CurrentCount;
       Ki386RdTSC(EndCount);
@@ -201,14 +201,14 @@ VOID HalpCalibrateStallExecution(VOID)
     }
 
   UdelayCalibrated = TRUE;
-  Pcr = (PKIPCR)KeGetCurrentKPCR();
+  Pcr = (PKIPCR)KeGetPcr();
 
   /* Initialise timer interrupt with MILLISEC ms interval        */
   WRITE_PORT_UCHAR((PUCHAR) TMR_CTRL, TMR_SC0 | TMR_BOTH | TMR_MD2);  /* binary, mode 2, LSB/MSB, ch 0 */
   WRITE_PORT_UCHAR((PUCHAR) TMR_CNT0, LATCH & 0xff); /* LSB */
   WRITE_PORT_UCHAR((PUCHAR) TMR_CNT0, LATCH >> 8); /* MSB */
 
-  if (Pcr->PrcbData.FeatureBits & X86_FEATURE_TSC)
+  if (Pcr->PrcbData.FeatureBits & KF_RDTSC)
   {
       
      WaitFor8254Wraparound();
@@ -325,9 +325,9 @@ KeQueryPerformanceCounter(PLARGE_INTEGER PerformanceFreq)
   Ki386SaveFlags(Flags);
   Ki386DisableInterrupts();
 
-  Pcr = (PKIPCR)KeGetCurrentKPCR();
+  Pcr = (PKIPCR)KeGetPcr();
 
-  if (Pcr->PrcbData.FeatureBits & X86_FEATURE_TSC)
+  if (Pcr->PrcbData.FeatureBits & KF_RDTSC)
   {
      Ki386RestoreFlags(Flags);
      if (NULL != PerformanceFreq)
index e08a61b..a71920c 100644 (file)
 /* IFS/DDK/NDK Headers */
 #include <ntifs.h>
 #include <ntddk.h>
-#include <ndk/ntndk.h>
-
-/* Internal Kernel Headers */
-#include <internal/mm.h>
-#include <internal/ke.h>
+#include <arc/arc.h>
+#include <iotypes.h>
+#include <kefuncs.h>
+#include <rosldr.h>
 
 #define KPCR_BASE 0xFF000000 // HACK!
 
index c23f39d..2dded8e 100644 (file)
@@ -8,9 +8,18 @@
 #define HAL_APC_REQUEST            0
 #define HAL_DPC_REQUEST            1
 
+//
+// Kernel Debugger Port Definition
+//
+typedef struct _KD_PORT_INFORMATION
+{
+    ULONG ComPort;
+    ULONG BaudRate;
+    ULONG BaseAddress;
+} KD_PORT_INFORMATION, *PKD_PORT_INFORMATION;
+
 /* display.c */
-struct _LOADER_PARAMETER_BLOCK;
-VOID FASTCALL HalInitializeDisplay (struct _LOADER_PARAMETER_BLOCK *LoaderBlock);
+VOID FASTCALL HalInitializeDisplay (struct _ROS_LOADER_PARAMETER_BLOCK *LoaderBlock);
 VOID FASTCALL HalClearDisplay (UCHAR CharAttribute);
 
 /* adapter.c */
@@ -38,7 +47,7 @@ VOID HalpInitDma (VOID);
 PVOID HalpMapPhysMemory(ULONG PhysAddr, ULONG Size);
 
 /* Non-generic initialization */
-VOID HalpInitPhase0 (PLOADER_PARAMETER_BLOCK LoaderBlock);
+VOID HalpInitPhase0 (PROS_LOADER_PARAMETER_BLOCK LoaderBlock);
 
 /* sysinfo.c */
 NTSTATUS STDCALL
index c0c150d..83f9cfb 100644 (file)
@@ -9,6 +9,25 @@
 
 #define IRQL2TPR(irql)     ((irql) >= IPI_LEVEL ? IPI_VECTOR : ((irql) >= PROFILE_LEVEL ? LOCAL_TIMER_VECTOR : ((irql) > DISPATCH_LEVEL ? IRQL2VECTOR(irql) : 0)))
 
+typedef struct _KIRQ_TRAPFRAME
+{
+   ULONG Magic;
+   ULONG Gs;
+   ULONG Fs;
+   ULONG Es;
+   ULONG Ds;
+   ULONG Eax;
+   ULONG Ecx;
+   ULONG Edx;
+   ULONG Ebx;
+   ULONG Esp;
+   ULONG Ebp;
+   ULONG Esi;
+   ULONG Edi;
+   ULONG Eip;
+   ULONG Cs;
+   ULONG Eflags;
+} KIRQ_TRAPFRAME, *PKIRQ_TRAPFRAME;
 
 #if 0
 /* This values are defined in halirql.h */
index f90fc00..8323cf3 100644 (file)
 /* INCLUDE ***********************************************************************/
 
 #include <hal.h>
+#include <halfuncs.h> /* Not in PCH because only used for MP HAL */
+#include <rtlfuncs.h> /* Not in PCH because only used for MP HAL */
 #define NDEBUG
 #include <debug.h>
-#include <internal/ntoskrnl.h>
 
 /* GLOBALS ***********************************************************************/
 
@@ -809,7 +810,7 @@ MpsTimerHandler(ULONG Vector, PKIRQ_TRAPFRAME Trapframe)
    CPU = ThisCPU();
    if ((Count[CPU] % 100) == 0)
    {
-     DbgPrint("(%s:%d) MpsTimerHandler on CPU%d, irql = %d, epi = %x, KPCR = %x\n", __FILE__, __LINE__, CPU, oldIrql,Trapframe->Eip, KeGetCurrentKPCR());
+     DbgPrint("(%s:%d) MpsTimerHandler on CPU%d, irql = %d, epi = %x, KPCR = %x\n", __FILE__, __LINE__, CPU, oldIrql,Trapframe->Eip, KeGetPcr());
    }
    Count[CPU]++;
 #endif
@@ -862,7 +863,7 @@ APICCalibrateTimer(ULONG CPU)
 
    APICSetupLVTT(1000000000);
 
-   TSCPresent = ((PKIPCR)KeGetCurrentKPCR())->PrcbData.FeatureBits & X86_FEATURE_TSC ? TRUE : FALSE;
+   TSCPresent = ((PKIPCR)KeGetPcr())->PrcbData.FeatureBits & KF_RDTSC ? TRUE : FALSE;
 
    /*
     * The timer chip counts down to zero. Let's wait
@@ -891,7 +892,7 @@ APICCalibrateTimer(ULONG CPU)
       DPRINT("CPU clock speed is %ld.%04ld MHz.\n",
             CPUMap[CPU].CoreSpeed/1000000,
             CPUMap[CPU].CoreSpeed%1000000);
-      ((PKIPCR)KeGetCurrentKPCR())->PrcbData.MHz = CPUMap[CPU].CoreSpeed/1000000;
+      ((PKIPCR)KeGetPcr())->PrcbData.MHz = CPUMap[CPU].CoreSpeed/1000000;
    }
 
    CPUMap[CPU].BusSpeed = (HZ * (long)(tt1 - tt2) * APIC_DIVISOR);
@@ -919,7 +920,7 @@ SetInterruptGate(ULONG index, ULONG address)
   Access.SystemSegmentFlag = 0;
   Access.SegmentType = I386_INTERRUPT_GATE;
   
-  idt = (KIDTENTRY*)((ULONG)KeGetCurrentKPCR()->IDT + index * sizeof(KIDTENTRY));
+  idt = (KIDTENTRY*)((ULONG)KeGetPcr()->IDT + index * sizeof(KIDTENTRY));
   idt->Offset = address & 0xffff;
   idt->Selector = KGDT_R0_CODE;
   idt->Access = Access.Value;
@@ -1037,11 +1038,11 @@ HaliStartApplicationProcessor(ULONG Cpu, ULONG Stack)
    /* Write the location of the AP stack */
    Common->Stack = (ULONG)Stack;
    /* Write the page directory page */
-   Ke386GetPageTableDirectory(Common->PageDirectory);
+   Common->PageDirectory = __readcr3();
    /* Write the kernel entry point */
    Common->NtProcessStartup = (ULONG_PTR)RtlImageNtHeader((PVOID)KernelBase)->OptionalHeader.AddressOfEntryPoint + KernelBase;
    /* Write the state of the mae mode */
-   Common->PaeModeEnabled = Ke386GetCr4() & X86_CR4_PAE ? 1 : 0;
+   Common->PaeModeEnabled = __readcr4() & CR4_PAE ? 1 : 0;
 
    DPRINT1("%x %x %x %x\n", Common->Stack, Common->PageDirectory, Common->NtProcessStartup, Common->PaeModeEnabled);
 
index a7b6bbd..9cd0f65 100644 (file)
@@ -22,7 +22,7 @@ ULONG_PTR KernelBase;
 
 /***************************************************************************/
 VOID
-HalpInitPhase0(PLOADER_PARAMETER_BLOCK LoaderBlock)
+HalpInitPhase0(PROS_LOADER_PARAMETER_BLOCK LoaderBlock)
 
 {
    static BOOLEAN MPSInitialized = FALSE;
index c22dd31..47475c9 100644 (file)
@@ -39,7 +39,7 @@ KIRQL STDCALL KeGetCurrentIrql (VOID)
       DPRINT1 ("CurrentIrql %x\n", irql);
       KEBUGCHECK (0);
     }
-  if (Flags & X86_EFLAGS_IF)
+  if (Flags & EFLAGS_INTERRUPT_MASK)
     {
       Ki386EnableInterrupts();
     }
@@ -62,7 +62,7 @@ VOID KeSetCurrentIrql (KIRQL NewIrql)
   Ki386SaveFlags(Flags);
   Ki386DisableInterrupts();
   Ki386WriteFsByte(FIELD_OFFSET(KPCR, Irql), NewIrql);
-  if (Flags & X86_EFLAGS_IF)
+  if (Flags & EFLAGS_INTERRUPT_MASK)
     {
       Ki386EnableInterrupts();
     }
@@ -90,7 +90,7 @@ HalpLowerIrql(KIRQL NewIrql, BOOLEAN FromHalEndSystemInterrupt)
           Ki386WriteFsByte(FIELD_OFFSET(KIPCR, HalReserved[HAL_DPC_REQUEST]), 0);
           Ki386EnableInterrupts();
           KiDispatchInterrupt();
-          if (!(Flags & X86_EFLAGS_IF))
+          if (!(Flags & EFLAGS_INTERRUPT_MASK))
             {
               Ki386DisableInterrupts();
             }
@@ -106,7 +106,7 @@ HalpLowerIrql(KIRQL NewIrql, BOOLEAN FromHalEndSystemInterrupt)
     {
       Ki386EnableInterrupts();
       KiDeliverApc(KernelMode, NULL, NULL);
-      if (!(Flags & X86_EFLAGS_IF))
+      if (!(Flags & EFLAGS_INTERRUPT_MASK))
         {
           Ki386DisableInterrupts();
         }
@@ -207,7 +207,7 @@ KfRaiseIrql (KIRQL  NewIrql)
       APICWrite (APIC_TPR, IRQL2TPR(NewIrql) & APIC_TPR_PRI);
     }
   KeSetCurrentIrql (NewIrql);
-  if (Flags & X86_EFLAGS_IF)
+  if (Flags & EFLAGS_INTERRUPT_MASK)
     {
       Ki386EnableInterrupts();
     }
@@ -305,7 +305,7 @@ HalBeginSystemInterrupt (ULONG Vector,
   }
 
   Ki386SaveFlags(Flags);
-  if (Flags & X86_EFLAGS_IF)
+  if (Flags & EFLAGS_INTERRUPT_MASK)
   {
      DPRINT1("HalBeginSystemInterrupt was called with interrupt's enabled\n");
      KEBUGCHECK(0);
@@ -327,7 +327,7 @@ HalEndSystemInterrupt (KIRQL Irql,
   ULONG Flags;
   Ki386SaveFlags(Flags);
 
-  if (Flags & X86_EFLAGS_IF)
+  if (Flags & EFLAGS_INTERRUPT_MASK)
   {
      DPRINT1("HalEndSystemInterrupt was called with interrupt's enabled\n");
      KEBUGCHECK(0);
index f5dfc25..8b4824a 100644 (file)
@@ -18,7 +18,7 @@
 /* FUNCTIONS ***************************************************************/
 
 VOID
-HalpInitPhase0(PLOADER_PARAMETER_BLOCK LoaderBlock)
+HalpInitPhase0(PROS_LOADER_PARAMETER_BLOCK LoaderBlock)
 {
   HalpInitPICs();
 
index be52bd2..3d1a070 100644 (file)
@@ -284,7 +284,7 @@ I2CTransmitByteGetReturn(UCHAR bPicAddressI2cFormat, UCHAR bDataToWrite, ULONG *
 }
 
 VOID FASTCALL
-HalInitializeDisplay (PLOADER_PARAMETER_BLOCK LoaderBlock)
+HalInitializeDisplay (PROS_LOADER_PARAMETER_BLOCK LoaderBlock)
 /*
  * FUNCTION: Initalize the display
  * ARGUMENTS:
index 863e8c5..9824916 100644 (file)
@@ -19,7 +19,7 @@
 /* FUNCTIONS ***************************************************************/
 
 VOID
-HalpInitPhase0(PLOADER_PARAMETER_BLOCK LoaderBlock)
+HalpInitPhase0(PROS_LOADER_PARAMETER_BLOCK LoaderBlock)
 {
   HalpHooks.InitPciBus = HalpXboxInitPciBus;
 
index 537343a..270c0f5 100644 (file)
@@ -200,8 +200,12 @@ typedef struct _ADAPTER_OBJECT *PADAPTER_OBJECT;
 #define NtCurrentProcess() ( (HANDLE)(LONG_PTR) -1 )  
 #define ZwCurrentProcess() NtCurrentProcess()         
 #define NtCurrentThread() ( (HANDLE)(LONG_PTR) -2 )   
-#define ZwCurrentThread() NtCurrentThread()      
+#define ZwCurrentThread() NtCurrentThread()     
+#ifdef _REACTOS_ 
+#define KIP0PCRADDRESS                      0xff000000
+#else
 #define KIP0PCRADDRESS                      0xffdff000
+#endif
 
 #define KERNEL_STACK_SIZE                   12288
 #define KERNEL_LARGE_STACK_SIZE             61440
@@ -231,6 +235,8 @@ typedef struct _ADAPTER_OBJECT *PADAPTER_OBJECT;
 #define HIGH_PRIORITY                     31
 #define MAXIMUM_PRIORITY                  32
 
+#define MAXIMUM_SUSPEND_COUNT             MAXCHAR
+
 #define FILE_SUPERSEDED                   0x00000000
 #define FILE_OPENED                       0x00000001
 #define FILE_CREATED                      0x00000002
@@ -407,6 +413,8 @@ typedef struct _KSYSTEM_TIME
     LONG High2Time;
 } KSYSTEM_TIME, *PKSYSTEM_TIME;
 
+extern volatile KSYSTEM_TIME KeTickCount;
+
 typedef struct _KUSER_SHARED_DATA 
 {
     ULONG TickCountLowDeprecated;
@@ -1024,6 +1032,8 @@ typedef struct _KDEVICE_QUEUE_ENTRY {
 
 #define LOCK_QUEUE_WAIT                   1
 #define LOCK_QUEUE_OWNER                  2
+#define LOCK_QUEUE_TIMER_LOCK_SHIFT       4
+#define LOCK_QUEUE_TIMER_TABLE_LOCKS (1 << (8 - LOCK_QUEUE_TIMER_LOCK_SHIFT))
 
 typedef enum _KSPIN_LOCK_QUEUE_NUMBER {
   LockQueueDispatcherLock,
@@ -1041,7 +1051,10 @@ typedef enum _KSPIN_LOCK_QUEUE_NUMBER {
   LockQueueNtfsStructLock,
   LockQueueAfdWorkQueueLock,
   LockQueueBcbLock,
-  LockQueueMaximumLock
+  LockQueueMmNonPagedPoolLock,
+  LockQueueUnusedSpare16,
+  LockQueueTimerTableLock,
+  LockQueueMaximumLock = LockQueueTimerTableLock + LOCK_QUEUE_TIMER_TABLE_LOCKS
 } KSPIN_LOCK_QUEUE_NUMBER, *PKSPIN_LOCK_QUEUE_NUMBER;
 
 typedef struct _KSPIN_LOCK_QUEUE {
index cdd2c68..e870d5f 100644 (file)
@@ -26,9 +26,16 @@ Author:
 #define KernelMode                              0x0
 #define UserMode                                0x1
 
+//
+// CPU Types
+//
+#define CPU_INTEL                               0x1
+#define CPU_AMD                                 0x2
+
 //
 // Selector Names
 //
+#ifdef __ASM__
 #define RPL_MASK                                0x0003
 #define MODE_MASK                               0x0001
 #define KGDT_R0_CODE                            (0x8)
@@ -41,6 +48,7 @@ Author:
 #define KGDT_LDT                                (0x48)
 #define KGDT_DF_TSS                             (0x50)
 #define KGDT_NMI_TSS                            (0x58)
+#endif
 
 //
 // KV86M_REGISTERS Offsets
@@ -126,7 +134,7 @@ Author:
 #define KPCR_CURRENT_THREAD                     0x124
 #define KPCR_PROCESSOR_NUMBER                   0x130
 #define KPCR_PRCB_SET_MEMBER                    0x134
-#define KPCR_NPX_THREAD                         0x2F4
+#define KPCR_NPX_THREAD                         0x640
 #define KPCR_DR6                                0x428
 #define KPCR_DR7                                0x42C
 #define KPCR_SYSTEM_CALLS                       0x6B8
@@ -302,6 +310,7 @@ Author:
 //
 // EFLAGS
 //
+#ifdef __ASM__
 #define EFLAGS_TF                               0x100
 #define EFLAGS_INTERRUPT_MASK                   0x200
 #define EFLAGS_NESTED_TASK                      0x4000
@@ -311,7 +320,6 @@ Author:
 #define EFLAGS_VIP                              0x100000
 #define EFLAG_SIGN                              0x8000
 #define EFLAG_ZERO                              0x4000
-#ifndef EFLAG_SELECT
 #define EFLAG_SELECT                            (EFLAG_SIGN + EFLAG_ZERO)
 #endif
 
@@ -333,6 +341,7 @@ Author:
 //
 // CR4
 //
+#ifdef __ASM__
 #define CR4_VME                                 0x1
 #define CR4_PVI                                 0x2
 #define CR4_TSD                                 0x4
@@ -343,6 +352,7 @@ Author:
 #define CR4_PGE                                 0x80
 #define CR4_FXSR                                0x200
 #define CR4_XMMEXCPT                            0x400
+#endif
 
 //
 // Usermode callout frame definitions
@@ -379,6 +389,19 @@ Author:
 #define SERVICE_DESCRIPTOR_NUMBER               0x000C
 #define SERVICE_DESCRIPTOR_LENGTH               0x0010
 
+//
+// Machine types
+//
+#ifdef __ASM__
+#define MACHINE_TYPE_ISA                        0x0000
+#define MACHINE_TYPE_EISA                       0x0001
+#define MACHINE_TYPE_MCA                        0x0002
+
+//
+// Kernel Feature Bits
+//
+#define KF_RDTSC                                0x00000002
+#endif
 //
 // Generic Definitions
 //
index d2d75c2..2e04cdb 100644 (file)
@@ -1,4 +1,4 @@
-/*++ NDK Version: 0095
+/*++ NDK Version: 0098
 
 Copyright (c) Alex Ionescu.  All rights reserved.
 
@@ -12,7 +12,7 @@ Abstract:
 
 Author:
 
-    Alex Ionescu (alex.ionescu@reactos.com)   06-Oct-2004
+    Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
 
 --*/
 
index 4e5c8d6..9d5aec2 100644 (file)
@@ -1,4 +1,4 @@
-/*++ NDK Version: 0095
+/*++ NDK Version: 0098
 
 Copyright (c) Alex Ionescu.  All rights reserved.
 
@@ -12,7 +12,7 @@ Abstract:
 
 Author:
 
-    Alex Ionescu (alex.ionescu@reactos.com)   06-Oct-2004
+    Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
 
 --*/
 
index b83d4f5..2faef37 100644 (file)
@@ -1,4 +1,4 @@
-/*++ NDK Version: 0095
+/*++ NDK Version: 0098
 
 Copyright (c) Alex Ionescu.  All rights reserved.
 
@@ -12,7 +12,7 @@ Abstract:
 
 Author:
 
-    Alex Ionescu (alex.ionescu@reactos.com)   06-Oct-2004
+    Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
 
 --*/
 
@@ -42,6 +42,8 @@ Author:
 #define PNP_SET_DEVICE_STATUS           1
 #define PNP_CLEAR_DEVICE_STATUS         2
 
+#ifdef NTOS_MODE_USER
+
 //
 // Resource Type
 //
@@ -59,7 +61,6 @@ Author:
 #define CmResourceTypePcCardConfig              130
 #define CmResourceTypeMfCardConfig              131
 
-#ifdef NTOS_MODE_USER
 
 //
 // Resource Descriptor Share Dispositions
@@ -342,7 +343,8 @@ typedef struct _PLUGPLAY_CONTROL_RELATED_DEVICE_DATA
 {
     UNICODE_STRING TargetDeviceInstance;
     ULONG Relation;
-    UNICODE_STRING RelatedDeviceInstance;
+    PWCHAR RelatedDeviceInstance;
+    ULONG RelatedDeviceInstanceLength;
 } PLUGPLAY_CONTROL_RELATED_DEVICE_DATA, *PPLUGPLAY_CONTROL_RELATED_DEVICE_DATA;
 
 // Class 0x0E
@@ -473,6 +475,15 @@ typedef struct _CM_RESOURCE_LIST
     CM_FULL_RESOURCE_DESCRIPTOR List[1];
 } CM_RESOURCE_LIST, *PCM_RESOURCE_LIST;
 
+//
+// ROM Block Structure
+//
+typedef struct _CM_ROM_BLOCK
+{
+    ULONG Address;
+    ULONG Size;
+} CM_ROM_BLOCK, *PCM_ROM_BLOCK;
+
 //
 // Disk/INT13 Structures
 //
index 0600853..b53cdf7 100644 (file)
@@ -1,4 +1,4 @@
-/*++ NDK Version: 0095
+/*++ NDK Version: 0098
 
 Copyright (c) Alex Ionescu.  All rights reserved.
 
@@ -12,7 +12,7 @@ Abstract:
 
 Author:
 
-    Alex Ionescu (alex.ionescu@reactos.com)   06-Oct-2004
+    Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
 
 --*/
 
@@ -56,7 +56,7 @@ NtWaitForDebugEvent(
     OUT PDBGUI_WAIT_STATE_CHANGE StateChange
 );
 
-NTSYSCALLAPI
+NTSYSAPI
 NTSTATUS
 NTAPI
 ZwCreateDebugObject(
@@ -66,7 +66,7 @@ ZwCreateDebugObject(
     IN BOOLEAN KillProcessOnExit
 );
 
-NTSYSCALLAPI
+NTSYSAPI
 NTSTATUS
 NTAPI
 ZwDebugContinue(
@@ -75,7 +75,7 @@ ZwDebugContinue(
     IN NTSTATUS ContinueStatus
 );
 
-NTSYSCALLAPI
+NTSYSAPI
 NTSTATUS
 NTAPI
 ZwWaitForDebugEvent(
index e4c2f3b..9c4a4fd 100644 (file)
@@ -1,4 +1,4 @@
-/*++ NDK Version: 0095
+/*++ NDK Version: 0098
 
 Copyright (c) Alex Ionescu.  All rights reserved.
 
@@ -12,7 +12,7 @@ Abstract:
 
 Author:
 
-    Alex Ionescu (alex.ionescu@reactos.com)   06-Oct-2004
+    Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
 
 --*/
 
index f4c52a4..630aa5e 100644 (file)
@@ -1,4 +1,4 @@
-/*++ NDK Version: 0095
+/*++ NDK Version: 0098
 
 Copyright (c) Alex Ionescu.  All rights reserved.
 
@@ -12,7 +12,7 @@ Abstract:
 
 Author:
 
-    Alex Ionescu (alex.ionescu@reactos.com)   06-Oct-2004
+    Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
 
 --*/
 
@@ -205,6 +205,15 @@ NtOpenEvent(
     IN POBJECT_ATTRIBUTES ObjectAttributes
 );
 
+NTSYSCALLAPI
+NTSTATUS
+NTAPI
+NtOpenKeyedEvent(
+    OUT PHANDLE EventHandle,
+    IN ACCESS_MASK DesiredAccess,
+    IN POBJECT_ATTRIBUTES ObjectAttributes
+);
+
 NTSYSCALLAPI
 NTSTATUS
 NTAPI
@@ -366,6 +375,16 @@ NtReleaseMutant(
     IN PLONG ReleaseCount OPTIONAL
 );
 
+NTSYSCALLAPI
+NTSTATUS
+NTAPI
+NtReleaseKeyedEvent(
+    IN HANDLE EventHandle,
+    IN PVOID Key,
+    IN BOOLEAN Alertable,
+    IN PLARGE_INTEGER Timeout OPTIONAL
+);
+
 NTSYSCALLAPI
 NTSTATUS
 NTAPI
@@ -413,6 +432,13 @@ NtSetEvent(
     OUT PLONG PreviousState  OPTIONAL
 );
 
+NTSYSCALLAPI
+NTSTATUS
+NTAPI
+NtSetEventBoostPriority(
+    IN HANDLE EventHandle
+);
+
 NTSYSCALLAPI
 NTSTATUS
 NTAPI
@@ -485,6 +511,16 @@ NtShutdownSystem(
     IN SHUTDOWN_ACTION Action
 );
 
+NTSYSCALLAPI
+NTSTATUS
+NTAPI
+NtWaitForKeyedEvent(
+    IN HANDLE EventHandle,
+    IN PVOID Key,
+    IN BOOLEAN Alertable,
+    IN PLARGE_INTEGER Timeout OPTIONAL
+);
+
 NTSYSCALLAPI
 NTSTATUS
 NTAPI
@@ -535,7 +571,6 @@ ZwClearEvent(
     IN HANDLE EventHandle
 );
 
-NTSYSAPI
 NTSYSAPI
 NTSTATUS
 NTAPI
@@ -823,6 +858,7 @@ ZwSetDefaultHardErrorPort(
     IN HANDLE PortHandle
 );
 
+NTSYSAPI
 NTSYSAPI
 NTSTATUS
 NTAPI
index 6e1c7d1..47ddf86 100644 (file)
@@ -1,4 +1,4 @@
-/*++ NDK Version: 0095
+/*++ NDK Version: 0098
 
 Copyright (c) Alex Ionescu.  All rights reserved.
 
@@ -12,7 +12,7 @@ Abstract:
 
 Author:
 
-    Alex Ionescu (alex.ionescu@reactos.com)   06-Oct-2004
+    Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
 
 --*/
 
@@ -196,9 +196,9 @@ typedef enum _SYSTEM_INFORMATION_CLASS
     SystemUnloadGdiDriverInformation,
     SystemTimeAdjustmentInformation,
     SystemSummaryMemoryInformation,
-    SystemNextEventIdInformation,
-    SystemEventIdsInformation,
-    SystemCrashDumpInformation,
+    SystemMirrorMemoryInformation,
+    SystemPerformanceTraceInformation,
+    SystemObsolete0,
     SystemExceptionInformation,
     SystemCrashDumpStateInformation,
     SystemKernelDebuggerInformation,
@@ -220,7 +220,51 @@ typedef enum _SYSTEM_INFORMATION_CLASS
     SystemVerifierInformation,
     SystemAddVerifier,
     SystemSessionProcessesInformation,
-    SystemInformationClassMax
+    SystemLoadGdiDriverInSystemSpaceInformation,
+    SystemNumaProcessorMap,
+    SystemPrefetcherInformation,
+    SystemExtendedProcessInformation,
+    SystemRecommendedSharedDataAlignment,
+    SystemComPlusPackage,
+    SystemNumaAvailableMemory,
+    SystemProcessorPowerInformation,
+    SystemEmulationBasicInformation,
+    SystemEmulationProcessorInformation,
+    SystemExtendedHanfleInformation,
+    SystemLostDelayedWriteInformation,
+    SystemBigPoolInformation,
+    SystemSessionPoolTagInformation,
+    SystemSessionMappedViewInformation,
+    SystemHotpatchInformation,
+    SystemObjectSecurityMode,
+    SystemWatchDogTimerHandler,
+    SystemWatchDogTimerInformation,
+    SystemLogicalProcessorInformation,
+    SystemWo64SharedInformationObosolete,
+    SystemRegisterFirmwareTableInformationHandler,
+    SystemFirmwareTableInformation,
+    SystemModuleInformationEx,
+    SystemVerifierTriageInformation,
+    SystemSuperfetchInformation,
+    SystemMemoryListInformation,
+    SystemFileCacheInformationEx,
+    SystemThreadPriorityClientIdInformation,
+    SystemProcessorIdleCycleTimeInformation,
+    SystemVerifierCancellationInformation,
+    SystemProcessorPowerInformationEx,
+    SystemRefTraceInformation,
+    SystemSpecialPoolInformation,
+    SystemProcessIdInformation,
+    SystemErrorPortInformation,
+    SystemBootEnvironmentInformation,
+    SystemHypervisorInformation,
+    SystemVerifierInformationEx,
+    SystemTimeZoneInformation,
+    SystemImageFileExecutionOptionsInformation,
+    SystemCoverageInformation,
+    SystemPrefetchPathInformation,
+    SystemVerifierFaultsInformation,
+    MaxSystemInfoClass,
 } SYSTEM_INFORMATION_CLASS;
 
 //
@@ -228,7 +272,8 @@ typedef enum _SYSTEM_INFORMATION_CLASS
 //
 typedef enum _MUTANT_INFORMATION_CLASS
 {
-    MutantBasicInformation
+    MutantBasicInformation,
+    MutantOwnerInformation
 } MUTANT_INFORMATION_CLASS;
 
 //
@@ -264,7 +309,28 @@ typedef enum _EVENT_INFORMATION_CLASS
     EventBasicInformation
 } EVENT_INFORMATION_CLASS;
 
-#ifndef NTOS_MODE_USER
+#ifdef NTOS_MODE_USER
+
+//
+// Firmware Table Actions for SystemFirmwareTableInformation
+//
+typedef enum _SYSTEM_FIRMWARE_TABLE_ACTION
+{
+    SystemFirmwareTable_Enumerate = 0,
+    SystemFirmwareTable_Get = 1,
+} SYSTEM_FIRMWARE_TABLE_ACTION, *PSYSTEM_FIRMWARE_TABLE_ACTION;
+
+//
+// Firmware Handler Callback
+//
+struct _SYSTEM_FIRMWARE_TABLE_INFORMATION;
+typedef
+NTSTATUS
+(__cdecl *PFNFTH)(
+    IN struct _SYSTEM_FIRMWARE_TABLE_INFORMATION *FirmwareTableInformation
+);
+
+#else
 
 //
 // Executive Work Queue Structures
@@ -305,12 +371,10 @@ typedef struct _EX_FAST_REF
 //
 typedef struct _EX_RUNDOWN_REF_CACHE_AWARE
 {
-    union
-    {
-        ULONG_PTR Count;
-        PVOID Ptr;
-    };
+    PEX_RUNDOWN_REF RunRefs;
     PVOID PoolToFree;
+    ULONG RunRefSize;
+    ULONG Number;
 } EX_RUNDOWN_REF_CACHE_AWARE, *PEX_RUNDOWN_REF_CACHE_AWARE;
 
 //
@@ -319,7 +383,7 @@ typedef struct _EX_RUNDOWN_REF_CACHE_AWARE
 typedef struct _EX_RUNDOWN_WAIT_BLOCK
 {
     ULONG_PTR Count;
-    KEVENT RundownEvent;
+    KEVENT WakeEvent;
 } EX_RUNDOWN_WAIT_BLOCK, *PEX_RUNDOWN_WAIT_BLOCK;
 
 //
@@ -382,18 +446,18 @@ typedef struct _CALLBACK_OBJECT
 } CALLBACK_OBJECT , *PCALLBACK_OBJECT;
 
 //
-// Profile OBject
+// Profile Object
 //
 typedef struct _EPROFILE
 {
     PEPROCESS Process;
-    PVOID ImageBase;
-    SIZE_T ImageSize;
+    PVOID RangeBase;
+    SIZE_T RangeSize;
     PVOID Buffer;
     ULONG BufferSize;
     ULONG BucketSize;
-    PKPROFILE KeProfile;
-    PVOID LockedBuffer;
+    PKPROFILE ProfileObject;
+    PVOID LockedBufferAddress;
     PMDL Mdl;
     ULONG Segment;
     KPROFILE_SOURCE ProfileSource;
@@ -466,6 +530,11 @@ typedef struct _MUTANT_BASIC_INFORMATION
     BOOLEAN AbandonedState;
 } MUTANT_BASIC_INFORMATION, *PMUTANT_BASIC_INFORMATION;
 
+typedef struct _MUTANT_OWNER_INFORMATION
+{
+    CLIENT_ID ClientId;
+} MUTANT_OWNER_INFORMATION, *PMUTANT_OWNER_INFORMATION;
+
 //
 // Information Structures for NtQueryAtom
 //
@@ -662,7 +731,7 @@ typedef struct _SYSTEM_PROCESS_INFORMATION
     HANDLE InheritedFromUniqueProcessId;
     ULONG HandleCount;
     ULONG SessionId;
-    ULONG PageDirectoryFrame;
+    ULONG UniqueProcessKey;
 
     //
     // This part corresponds to VM_COUNTERS_EX.
@@ -679,7 +748,7 @@ typedef struct _SYSTEM_PROCESS_INFORMATION
     ULONG QuotaNonPagedPoolUsage;
     ULONG PagefileUsage;
     ULONG PeakPagefileUsage;
-    ULONG PrivateUsage;
+    ULONG PrivatePageCount;
 
     //
     // This part corresponds to IO_COUNTERS
@@ -691,7 +760,7 @@ typedef struct _SYSTEM_PROCESS_INFORMATION
     LARGE_INTEGER WriteTransferCount;
     LARGE_INTEGER OtherTransferCount;
 
-    SYSTEM_THREAD_INFORMATION TH[1];
+    //SYSTEM_THREAD_INFORMATION TH[1];
 } SYSTEM_PROCESS_INFORMATION, *PSYSTEM_PROCESS_INFORMATION;
 
 // Class 6
@@ -737,57 +806,11 @@ typedef struct _SYSTEM_CALL_TIME_INFORMATION
     LARGE_INTEGER TimeOfCalls[1];
 } SYSTEM_CALL_TIME_INFORMATION, *PSYSTEM_CALL_TIME_INFORMATION;
 
-// Class 11
-typedef struct _SYSTEM_MODULE_INFORMATION_ENTRY
-{
-    ULONG  Unknown1;
-    ULONG  Unknown2;
-    PVOID  Base;
-    ULONG  Size;
-    ULONG  Flags;
-    USHORT  Index;
-    USHORT  NameLength;
-    USHORT  LoadCount;
-    USHORT  PathLength;
-    CHAR  ImageName[256];
-} SYSTEM_MODULE_INFORMATION_ENTRY, *PSYSTEM_MODULE_INFORMATION_ENTRY;
-typedef struct _SYSTEM_MODULE_INFORMATION
-{
-    ULONG Count;
-    SYSTEM_MODULE_INFORMATION_ENTRY Module[1];
-} SYSTEM_MODULE_INFORMATION, *PSYSTEM_MODULE_INFORMATION;
-
-// Class 12
-typedef struct _SYSTEM_RESOURCE_LOCK_ENTRY
-{
-    ULONG  ResourceAddress;
-    ULONG  Always1;
-    ULONG  Unknown;
-    ULONG  ActiveCount;
-    ULONG  ContentionCount;
-    ULONG  Unused[2];
-    ULONG  NumberOfSharedWaiters;
-    ULONG  NumberOfExclusiveWaiters;
-} SYSTEM_RESOURCE_LOCK_ENTRY, *PSYSTEM_RESOURCE_LOCK_ENTRY;
+// Class 11 - See RTL_PROCESS_MODULES
 
-typedef struct _SYSTEM_RESOURCE_LOCK_INFO
-{
-    ULONG Count;
-    SYSTEM_RESOURCE_LOCK_ENTRY Lock[1];
-} SYSTEM_RESOURCE_LOCK_INFO, *PSYSTEM_RESOURCE_LOCK_INFO;
-
-// FIXME: Class 13
-typedef struct _SYSTEM_BACKTRACE_INFORMATION_ENTRY
-{
-    ULONG Dummy;
-} SYSTEM_BACKTRACE_INFORMATION_ENTRY, *PSYSTEM_BACKTRACE_INFORMATION_ENTRY;
+// Class 12 - See RTL_PROCESS_LOCKS
 
-typedef struct _SYSTEM_BACKTRACE_INFORMATION
-{
-    ULONG Unknown[4];
-    ULONG Count;
-    SYSTEM_BACKTRACE_INFORMATION_ENTRY Trace[1];
-} SYSTEM_BACKTRACE_INFORMATION, *PSYSTEM_BACKTRACE_INFORMATION;
+// Class 13 - See RTL_PROCESS_BACKTRACES
 
 // Class 14 - 15
 typedef struct _SYSTEM_POOL_ENTRY
@@ -914,14 +937,10 @@ typedef struct _SYSTEM_VDM_INSTEMUL_INFO
     ULONG BopCount;
 } SYSTEM_VDM_INSTEMUL_INFO, *PSYSTEM_VDM_INSTEMUL_INFO;
 
-// FIXME: Class 20
-typedef struct _SYSTEM_VDM_BOP_INFO
-{
-    PVOID Dummy;
-} SYSTEM_VDM_BOP_INFO, *PSYSTEM_VDM_BOP_INFO;
+// Class 20 - ULONG VDMBOPINFO
 
 // Class 21
-typedef struct _SYSTEM_CACHE_INFORMATION
+typedef struct _SYSTEM_FILECACHE_INFORMATION
 {
     ULONG CurrentSize;
     ULONG PeakSize;
@@ -930,8 +949,9 @@ typedef struct _SYSTEM_CACHE_INFORMATION
     ULONG MaximumWorkingSet;
     ULONG CurrentSizeIncludingTransitionInPages;
     ULONG PeakSizeIncludingTransitionInPages;
-    ULONG Unused[2];
-} SYSTEM_CACHE_INFORMATION, *PSYSTEM_CACHE_INFORMATION;
+    ULONG TransitionRePurposeCount;
+    ULONG Flags;
+} SYSTEM_FILECACHE_INFORMATION, *PSYSTEM_FILECACHE_INFORMATION;
 
 // Class 22
 typedef struct _SYSTEM_POOLTAG
@@ -984,6 +1004,7 @@ typedef struct _SYSTEM_MEMORY_INFO
     USHORT ModifiedCount;
     USHORT PageTableCount;
 } SYSTEM_MEMORY_INFO, *PSYSTEM_MEMORY_INFO;
+
 typedef struct _SYSTEM_MEMORY_INFORMATION
 {
     ULONG InfoSize;
@@ -999,6 +1020,7 @@ typedef struct _SYSTEM_GDI_DRIVER_INFORMATION
     PVOID SectionPointer;
     PVOID EntryPoint;
     PIMAGE_EXPORT_DIRECTORY ExportSectionPointer;
+    ULONG ImageLength;
 } SYSTEM_GDI_DRIVER_INFORMATION, *PSYSTEM_GDI_DRIVER_INFORMATION;
 
 // Class 27
@@ -1020,13 +1042,18 @@ typedef struct _SYSTEM_SET_TIME_ADJUST_INFORMATION
 
 // Class 29 - Same as 25
 
-// FIXME: Class 30 - 31
+// FIXME: Class 30
 
-// Class 32
-typedef struct _SYSTEM_CRASH_DUMP_INFORMATION
+// Class 31
+typedef struct _SYSTEM_REF_TRACE_INFORMATION
 {
-    HANDLE CrashDumpSection;
-} SYSTEM_CRASH_DUMP_INFORMATION, *PSYSTEM_CRASH_DUMP_INFORMATION;
+   UCHAR TraceEnable;
+   UCHAR TracePermanent;
+   UNICODE_STRING TraceProcessName;
+   UNICODE_STRING TracePoolTags;
+} SYSTEM_REF_TRACE_INFORMATION, *PSYSTEM_REF_TRACE_INFORMATION;
+
+// Class 32 - OBSOLETE
 
 // Class 33
 typedef struct _SYSTEM_EXCEPTION_INFORMATION
@@ -1151,16 +1178,135 @@ typedef struct _SYSTEM_LOOKASIDE_INFORMATION
 // Class 50
 // Not a structure. Only a ULONG_PTR for the SystemRangeStart
 
-// FIXME: Class 51 (Based on MM_DRIVER_VERIFIER_DATA)
+// Class 51
+typedef struct _SYSTEM_VERIFIER_INFORMATION
+{
+   ULONG NextEntryOffset;
+   ULONG Level;
+   UNICODE_STRING DriverName;
+   ULONG RaiseIrqls;
+   ULONG AcquireSpinLocks;
+   ULONG SynchronizeExecutions;
+   ULONG AllocationsAttempted;
+   ULONG AllocationsSucceeded;
+   ULONG AllocationsSucceededSpecialPool;
+   ULONG AllocationsWithNoTag;
+   ULONG TrimRequests;
+   ULONG Trims;
+   ULONG AllocationsFailed;
+   ULONG AllocationsFailedDeliberately;
+   ULONG Loads;
+   ULONG Unloads;
+   ULONG UnTrackedPool;
+   ULONG CurrentPagedPoolAllocations;
+   ULONG CurrentNonPagedPoolAllocations;
+   ULONG PeakPagedPoolAllocations;
+   ULONG PeakNonPagedPoolAllocations;
+   ULONG PagedPoolUsageInBytes;
+   ULONG NonPagedPoolUsageInBytes;
+   ULONG PeakPagedPoolUsageInBytes;
+   ULONG PeakNonPagedPoolUsageInBytes;
+} SYSTEM_VERIFIER_INFORMATION, *PSYSTEM_VERIFIER_INFORMATION;
 
 // FIXME: Class 52
 
 // Class 53 
-typedef struct _SYSTEM_SESSION_PROCESSES_INFORMATION
+typedef struct _SYSTEM_SESSION_PROCESS_INFORMATION
 {
     ULONG SessionId;
-    ULONG BufferSize;
+    ULONG SizeOfBuf;
     PVOID Buffer; // Same format as in SystemProcessInformation
-} SYSTEM_SESSION_PROCESSES_INFORMATION, *PSYSTEM_SESSION_PROCESSES_INFORMATION;
+} SYSTEM_SESSION_PROCESS_INFORMATION, *PSYSTEM_SESSION_PROCESS_INFORMATION;
+
+// FIXME: Class 54-97
 
+//
+// Hotpatch flags
+//
+#define RTL_HOTPATCH_SUPPORTED_FLAG         0x01
+#define RTL_HOTPATCH_SWAP_OBJECT_NAMES      0x08 << 24
+#define RTL_HOTPATCH_SYNC_RENAME_FILES      0x10 << 24
+#define RTL_HOTPATCH_PATCH_USER_MODE        0x20 << 24
+#define RTL_HOTPATCH_REMAP_SYSTEM_DLL       0x40 << 24
+#define RTL_HOTPATCH_PATCH_KERNEL_MODE      0x80 << 24
+
+
+// Class 69
+typedef struct _SYSTEM_HOTPATCH_CODE_INFORMATION
+{
+    ULONG Flags;
+    ULONG InfoSize;
+    union
+    {
+        struct
+        {
+            ULONG Foo;
+        } CodeInfo;
+        struct
+        {
+            USHORT NameOffset;
+            USHORT NameLength;
+        } KernelInfo;
+        struct
+        {
+            USHORT NameOffset;
+            USHORT NameLength;
+            USHORT TargetNameOffset;
+            USHORT TargetNameLength;
+            UCHAR PatchingFinished;
+        } UserModeInfo;
+        struct
+        {
+            USHORT NameOffset;
+            USHORT NameLength;
+            USHORT TargetNameOffset;
+            USHORT TargetNameLength;
+            UCHAR PatchingFinished;
+            NTSTATUS ReturnCode;
+            HANDLE TargetProcess;
+        } InjectionInfo;
+        struct
+        {
+            HANDLE FileHandle1;
+            PIO_STATUS_BLOCK IoStatusBlock1;
+            PVOID RenameInformation1;
+            PVOID RenameInformationLength1;
+            HANDLE FileHandle2;
+            PIO_STATUS_BLOCK IoStatusBlock2;
+            PVOID RenameInformation2;
+            PVOID RenameInformationLength2;
+        } RenameInfo;
+        struct
+        {
+            HANDLE ParentDirectory;
+            HANDLE ObjectHandle1;
+            HANDLE ObjectHandle2;
+        } AtomicSwap;
+    };
+} SYSTEM_HOTPATCH_CODE_INFORMATION, *PSYSTEM_HOTPATCH_CODE_INFORMATION;
+
+//
+// Class 75
+//
+#ifdef NTOS_MODE_USER
+typedef struct _SYSTEM_FIRMWARE_TABLE_HANDLER
+{
+    ULONG ProviderSignature;
+    BOOLEAN Register;
+    PFNFTH FirmwareTableHandler;
+    PVOID DriverObject;
+} SYSTEM_FIRMWARE_TABLE_HANDLER, *PSYSTEM_FIRMWARE_TABLE_HANDLER;
+
+//
+// Class 76
+//
+typedef struct _SYSTEM_FIRMWARE_TABLE_INFORMATION
+{
+    ULONG ProviderSignature;
+    SYSTEM_FIRMWARE_TABLE_ACTION Action;
+    ULONG TableID;
+    ULONG TableBufferLength;
+    UCHAR TableBuffer[1];
+} SYSTEM_FIRMWARE_TABLE_INFORMATION, *PSYSTEM_FIRMWARE_TABLE_INFORMATION;
+#endif
 #endif
index 3f5c0b8..e69de29 100644 (file)
@@ -1,88 +0,0 @@
-List of ReactOS Applications compiling with the NDK
-(verify, fix, and optimize their usage)
---------------------------------------------------------------
-
-apps\utils\ps\ps.c: #include <ndk/ntndk.h>
-drivers\dd\blue\blue.c: #include <ndk/halfuncs.h>
-drivers\dd\bootvid\bootvid.c: #include <ndk/ldrfuncs.h>
-drivers\storage\diskdump\diskdump.c: #include <ndk/extypes.h>
-drivers\storage\diskdump\diskdump.c: #include <ndk/rtlfuncs.h>
-hal\hal\hal.c: #include <ndk/halfuncs.h>
-hal\hal\hal.c: #include <ndk/kdfuncs.h>
-lib\crt\except\unwind.c: #include <ndk/umtypes.h>
-lib\crt\except\unwind.c: #include <ndk/extypes.h>
-lib\crt\except\unwind.c: #include <ndk/rtlfuncs.h>
-lib\dnsapi\dnsapi\stubs.c: #include <ndk/ntndk.h>
-lib\epsapi\enum\drivers.c: #include <ndk/ntndk.h>
-lib\epsapi\enum\modules.c: #include <ndk/ntndk.h>
-lib\epsapi\enum\processes.c: #include <ndk/ntndk.h>
-lib\lsasrv\lsaport.c: #include <ndk/ntndk.h>
-lib\lsasrv\lsasrv.c: #include <ndk/ntndk.h>
-lib\nt\entry_point.c: #include <ndk/ntndk.h>
-lib\samlib\samlib.c: #include <ndk/ntndk.h>
-lib\samsrv\samsrv.c: #include <ndk/ntndk.h>
-lib\smdll\query.c: #include <ndk/ntndk.h>
-lib\string\mbstowcs.c: #include <ndk/umtypes.h>
-lib\string\mbstowcs.c: #include <ndk/rtlfuncs.h>
-lib\string\sscanf.c: #include <ndk/umtypes.h>
-lib\string\sscanf.c: #include <ndk/rtlfuncs.h>
-lib\string\wcstombs.c: #include <ndk/umtypes.h>
-lib\string\wcstombs.c: #include <ndk/rtlfuncs.h>
-lib\syssetup\install.c: #include <ndk/ntndk.h>
-lib\syssetup\logfile.c: #include <ndk/ntndk.h>
-lib\wdmguid\wdmguid.c: #include <ndk/sysguid.h>
-regtests\shared\regtests.c: #include <ndk/ntndk.h>
-services\umpnpmgr\umpnpmgr.c: #include <ndk/ntndk.h>
-subsys\ntvdm\ntvdm.c: #include <ndk/ntndk.h>
-subsys\system\autochk\autochk.c: #include <ndk/ntndk.h>
-subsys\system\lsass\lsass.c: #include <ndk/ntndk.h>
-subsys\system\setup\setup.c: #include <ndk/ntndk.h>
-subsys\system\sm\sm.c: #include <ndk/ntndk.h>
-boot\freeldr\freeldr\include\freeldr.h: #include <ndk/ntndk.h>
-drivers\fs\ms\msfs.h: #include <ndk/ntndk.h>
-drivers\fs\np\npfs.h: #include <ndk/iotypes.h>
-drivers\fs\vfat\vfat.h: #include <ndk/ntndk.h>
-drivers\net\ndis\include\ndissys.h: #include <ndk/ntndk.h>
-drivers\net\tcpip\include\precomp.h: #include <ndk/ntndk.h>
-drivers\video\miniport\xboxvmp\xboxvmp.h: #include <ndk/ntndk.h>
-drivers\video\videoprt\videoprt.h: #include <ndk/ntndk.h>
-hal\halx86\include\hal.h: #include <ndk/ntndk.h>
-include\drivers\diskdump\diskdump.h: #include <ndk/ntndk.h>
-lib\advapi32\advapi32.h: #include <ndk/ntndk.h>
-lib\crt\precomp.h: #include <ndk/ntndk.h>
-lib\dbghelp\stackframe.h: #include <ndk/umtypes.h>
-lib\dbghelp\stackframe.h: #include <ndk/extypes.h>
-lib\dbghelp\stackframe.h: #include <ndk/rtlfuncs.h>
-lib\dnsapi\dnsapi\precomp.h: #include <ndk/ntndk.h>
-lib\fmifs\precomp.h: #include <ndk/ntndk.h>
-lib\fslib\vfatlib\vfatlib.h: #include <ndk/ntndk.h>
-lib\fslib\vfatxlib\vfatxlib.h: #include <ndk/ntndk.h>
-lib\gdi32\include\precomp.h: #include <ndk/ntndk.h>
-lib\imagehlp\precomp.h: #include <ndk/umtypes.h>
-lib\imagehlp\precomp.h: #include <ndk/rtlfuncs.h>
-lib\iphlpapi\iphlpapi_private.h: #include <ndk/ntndk.h>
-lib\kernel32\k32.h: #include <ndk/ntndk.h>
-lib\msafd\msafd.h: #include <ndk/ntndk.h>
-lib\ntdll\inc\ntdll.h: #include <ndk/ntndk.h>
-lib\opengl32\teb.h: #include <ndk/ntndk.h>
-lib\psapi\precomp.h: #include <ndk/ntndk.h>
-lib\rtl\rtl.h: #include <ndk/ntndk.h>
-lib\secur32\precomp.h: #include <ndk/ntndk.h>
-lib\setupapi\setupapi_private.h: #include <ndk/ntndk.h>
-lib\smlib\precomp.h: #include <ndk/ntndk.h>
-lib\user32\include\user32.h: #include <ndk/ntndk.h>
-lib\userenv\precomp.h: #include <ndk/ntndk.h>
-lib\wshirda\wshirda.h: #include <ndk/ntndk.h>
-ntoskrnl\include\ntoskrnl.h: #include <ndk/ntndk.h>
-ntoskrnl\include\internal\napi.h: #include <ndk/asm.h>
-services\dhcp\include\rosdhcp.h: #include <ndk/ntndk.h>
-services\eventlog\eventlog.h: #include <ndk/ntndk.h>
-services\rpcss\rpcss.h: #include <ndk/ntndk.h>
-subsys\csrss\csrss.h: #include <ndk/ntndk.h>
-subsys\csrss\include\api.h: #include <ndk/ntndk.h>
-subsys\csrss\win32csr\w32csr.h: #include <ndk/ntndk.h>
-subsys\smss\smss.h: #include <ndk/ntndk.h>
-subsys\system\cmd\precomp.h: #include <ndk/ntndk.h>
-subsys\system\services\services.h: #include <ndk/ntndk.h>
-subsys\system\taskmgr\precomp.h: #include <ndk/ntndk.h>
-subsys\system\usetup\usetup.h: #include <ndk/ntndk.h>
index 8c7bb50..c8e29b9 100644 (file)
@@ -1,4 +1,4 @@
-/*++ NDK Version: 0095
+/*++ NDK Version: 0098
 
 Copyright (c) Alex Ionescu.  All rights reserved.
 
@@ -12,7 +12,7 @@ Abstract:
 
 Author:
 
-    Alex Ionescu (alex.ionescu@reactos.com)   06-Oct-2004
+    Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
 
 --*/
 
@@ -30,14 +30,6 @@ Author:
 //
 // The DDK steals these away from you.
 //
-VOID
-_enable(
-    VOID
-);
-VOID
-_disable(
-    VOID
-);
 #ifdef _MSC_VER
 #pragma intrinsic(_enable)
 #pragma intrinsic(_disable)
@@ -46,13 +38,6 @@ _disable(
 //
 // Display Functions
 //
-NTHALAPI
-BOOLEAN
-NTAPI
-HalQueryDisplayOwnership(
-    VOID
-);
-
 NTHALAPI
 VOID
 NTAPI
@@ -60,20 +45,6 @@ HalDisplayString(
     IN PCHAR String
 );
 
-NTHALAPI
-BOOLEAN
-NTAPI
-HalQueryDisplayOwnership(
-    VOID
-);
-
-NTHALAPI
-VOID
-NTAPI
-HalReleaseDisplayOwnership(
-    VOID
-);
-
 //
 // Initialization Functions
 //
@@ -84,12 +55,13 @@ HalAllProcessorsStarted(
     VOID
 );
 
+#ifdef _ARC_
 NTHALAPI
 VOID
 NTAPI
 HalInitializeProcessor(
     ULONG ProcessorNumber,
-    PLOADER_PARAMETER_BLOCK LoaderBlock
+    struct _LOADER_PARAMETER_BLOCK *LoaderBlock
 );
 
 NTHALAPI
@@ -97,8 +69,9 @@ BOOLEAN
 NTAPI
 HalInitSystem(
     ULONG BootPhase,
-    PLOADER_PARAMETER_BLOCK LoaderBlock
+    struct _LOADER_PARAMETER_BLOCK *LoaderBlock
 );
+#endif
 
 NTHALAPI
 VOID
@@ -179,7 +152,7 @@ NTHALAPI
 VOID
 NTAPI
 HalRequestIpi(
-    ULONG Unknown
+    KAFFINITY TargetSet
 );
 
 NTHALAPI
@@ -192,6 +165,7 @@ HalHandleNMI(
 //
 // I/O Functions
 //
+#ifdef _ARC_
 NTHALAPI
 VOID
 NTAPI
@@ -201,6 +175,7 @@ IoAssignDriveLetters(
     PUCHAR NtSystemPath,
     PSTRING NtSystemPathString
 );
+#endif
 
 //
 // Environment Functions
@@ -213,5 +188,15 @@ HalSetEnvironmentVariable(
     IN PCH Value
 );
 
+//
+// Time Functions
+//
+NTHALAPI
+VOID
+NTAPI
+HalQueryRealTimeClock(
+    IN PTIME_FIELDS RtcTime
+);
+
 #endif
 #endif
index 177dfa2..9da8109 100644 (file)
@@ -1,4 +1,4 @@
-/*++ NDK Version: 0095
+/*++ NDK Version: 0098
 
 Copyright (c) Alex Ionescu.  All rights reserved.
 
@@ -12,7 +12,7 @@ Abstract:
 
 Author:
 
-    Alex Ionescu (alex.ionescu@reactos.com)   06-Oct-2004
+    Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
 
 --*/
 
@@ -26,29 +26,10 @@ Author:
 
 #ifndef NTOS_MODE_USER
 
-//
-// Multi-Boot Flags (REMOVE ME)
-//
-#ifdef _REACTOS_
-#define MB_FLAGS_MEM_INFO                   (0x1)
-#define MB_FLAGS_BOOT_DEVICE                (0x2)
-#define MB_FLAGS_COMMAND_LINE               (0x4)
-#define MB_FLAGS_MODULE_INFO                (0x8)
-#define MB_FLAGS_AOUT_SYMS                  (0x10)
-#define MB_FLAGS_ELF_SYMS                   (0x20)
-#define MB_FLAGS_MMAP_INFO                  (0x40)
-#define MB_FLAGS_DRIVES_INFO                (0x80)
-#define MB_FLAGS_CONFIG_TABLE               (0x100)
-#define MB_FLAGS_BOOT_LOADER_NAME           (0x200)
-#define MB_FLAGS_APM_TABLE                  (0x400)
-#define MB_FLAGS_GRAPHICS_TABLE             (0x800)
-#define MB_FLAGS_ACPI_TABLE                 (0x1000)
-#endif
-
 //
 // HalShutdownSystem Types
 //
-typedef enum _FIRMWARE_ENTRY
+typedef enum _FIRMWARE_REENTRY
 {
     HalHaltRoutine,
     HalPowerDownRoutine,
@@ -58,6 +39,64 @@ typedef enum _FIRMWARE_ENTRY
     HalMaximumRoutine
 } FIRMWARE_REENTRY, *PFIRMWARE_REENTRY;
 
+//
+// HAL Private function Types
+//
+typedef
+PBUS_HANDLER
+(*pHalHandlerForConfigSpace)(
+    IN BUS_DATA_TYPE  ConfigSpace,
+    IN ULONG BusNumber
+);
+
+typedef
+NTSTATUS
+(*PINSTALL_BUS_HANDLER)(
+    IN PBUS_HANDLER Bus
+);
+
+typedef
+NTSTATUS
+(*pHalRegisterBusHandler)(
+    IN INTERFACE_TYPE InterfaceType,
+    IN BUS_DATA_TYPE ConfigSpace,
+    IN ULONG BusNumber,
+    IN INTERFACE_TYPE ParentInterfaceType,
+    IN ULONG ParentBusNumber,
+    IN ULONG ContextSize,
+    IN PINSTALL_BUS_HANDLER InstallCallback,
+    OUT PBUS_HANDLER *BusHandler
+);
+
+typedef
+VOID
+(*pHalSetWakeEnable)(
+    IN BOOLEAN Enable
+);
+
+
+typedef
+VOID
+(*pHalSetWakeAlarm)(
+    IN ULONGLONG AlartTime,
+    IN PTIME_FIELDS TimeFields
+);
+
+typedef
+VOID
+(*pHalLocateHiberRanges)(
+    IN PVOID MemoryMap
+);
+
+typedef
+BOOLEAN
+(*pHalAllocateMapRegisters)(
+    IN PADAPTER_OBJECT AdapterObject,
+    IN ULONG Unknown,
+    IN ULONG Unknown2,
+    PMAP_REGISTER_ENTRY Registers
+);
+
 //
 // Hal Private dispatch Table
 //
@@ -65,184 +104,48 @@ typedef enum _FIRMWARE_ENTRY
 typedef struct _HAL_PRIVATE_DISPATCH
 {
     ULONG Version;
-    PVOID HalHandlerForBus;
-    PVOID HalHandlerForBus2;
-    PVOID HalLocateHiberRanges;
-    PVOID HalRegisterBusHandler;
-    PVOID HalSetWakeEnable;
-    PVOID HalSetWakeAlarm;
-    PVOID HalTranslateBusAddress;
-    PVOID HalTranslateBusAddress2;
-    PVOID HalHaltSystem;
-    PVOID Null;
-    PVOID Null2;
-    PVOID HalAllocateMapRegisters;
-    PVOID KdSetupPciDeviceForDebugging;
-    PVOID KdReleasePciDeviceforDebugging;
-    PVOID KdGetAcpiTablePhase0;
-    PVOID HalReferenceHandler;
-    PVOID HalVectorToIDTEntry;
-    PVOID MatchAll;
-    PVOID KdUnmapVirtualAddress;
+    pHalHandlerForBus HalHandlerForBus;
+    pHalHandlerForConfigSpace HalHandlerForConfigSpace;
+    pHalLocateHiberRanges HalLocateHiberRanges;
+    pHalRegisterBusHandler HalRegisterBusHandler;
+    pHalSetWakeEnable HalSetWakeEnable;
+    pHalSetWakeAlarm HalSetWakeAlarm;
+    pHalTranslateBusAddress HalPciTranslateBusAddress;
+    pHalAssignSlotResources HalPciAssignSlotResources;
+    pHalHaltSystem HalHaltSystem;
+    pHalFindBusAddressTranslation HalFindBusAddressTranslation;
+    pHalResetDisplay HalResetDisplay;
+    pHalAllocateMapRegisters HalAllocateMapRegisters;
+    pKdSetupPciDeviceForDebugging KdSetupPciDeviceForDebugging;
+    pKdReleasePciDeviceForDebugging KdReleasePciDeviceforDebugging;
+    pKdGetAcpiTablePhase0 KdGetAcpiTablePhase0;
+    pKdCheckPowerButton KdCheckPowerButton;
+    pHalVectorToIDTEntry HalVectorToIDTEntry;
+    pKdMapPhysicalMemory64 KdMapPhysicalMemory64;
+    pKdUnmapVirtualAddress KdUnmapVirtualAddress;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    pKdGetPciDataByOffset KdGetPciDataByOffset;
+    pKdSetPciDataByOffset KdSetPciDataByOffset;
+    PVOID HalGetInterruptVectorOverride;
+    PVOID HalGetVectorInputOverride;
+#endif
 } HAL_PRIVATE_DISPATCH, *PHAL_PRIVATE_DISPATCH;
 
-#ifndef _REACTOS_
-//
-// NLS Data Block
-//
-typedef struct _NLS_TABLE_DATA
-{
-    PVOID AnsiCodePageData;
-    PVOID OemCodePageData;
-    PVOID UnicodeCodePageData;
-} NLS_TABLE_DATA, *PNLS_TABLE_DATA;
-
-//
-// Subsystem Specific Loader Blocks
-//
-typedef struct _PROFILE_PARAMETER_BLOCK
-{
-    USHORT DockData0;
-    USHORT DockData1;
-    USHORT DockData2;
-    USHORT DockData3;
-    ULONG DockData4;
-    ULONG DockData5;
-} PROFILE_PARAMETER_BLOCK, *PPROFILE_PARAMETER_BLOCK;
-
-typedef struct _HEADLESS_LOADER_BLOCK
-{
-    UCHAR Unknown[0xC];
-} HEADLESS_LOADER_BLOCK, *PHEADLESS_LOADER_BLOCK;
-
-typedef struct _NETWORK_LOADER_BLOCK
-{
-    UCHAR Unknown[0xC];
-} NETWORK_LOADER_BLOCK, *PNETWORK_LOADER_BLOCK;
-
-//
-// Extended Loader Parameter Block
-//
-typedef struct _LOADER_PARAMETER_EXTENSION
-{
-    ULONG Size;
-    PROFILE_PARAMETER_BLOCK ProfileParameterBlock;
-    ULONG MajorVersion;
-    ULONG MinorVersion;
-    PVOID SpecialConfigInfFile;
-    ULONG SpecialConfigInfSize;
-    PVOID TriageDumpData;
-    //
-    // NT 5.1
-    //
-    ULONG NumberOfPages;
-    PHEADLESS_LOADER_BLOCK HeadlessLoaderBlock;
-    PVOID Unknown1;
-    PVOID PrefetchDatabaseBase;
-    ULONG PrefetchDatabaseSize;
-    PNETWORK_LOADER_BLOCK NetworkLoaderBlock;
-    //
-    // NT 5.2+
-    //
-    PVOID Reserved[2];
-    LIST_ENTRY FirmwareListEntry;
-    PVOID AcpiTableBase;
-    ULONG AcpiTableSize;
-} LOADER_PARAMETER_EXTENSION, *PLOADER_PARAMETER_EXTENSION;
-
 //
-// Architecture specific Loader Parameter Blocks
-//
-typedef struct _I386_LOADER_BLOCK
-{
-    PVOID CommonDataArea;
-    ULONG MachineType;
-    ULONG Reserved;
-} I386_LOADER_BLOCK, *PI386_LOADER_BLOCK;
-
-//
-// Setup Loader Parameter Block
-//
-typedef struct _SETUP_LOADER_BLOCK
-{
-    ULONG Unknown[139];
-    ULONG Flags;
-} SETUP_LOADER_BLOCK, *PSETUP_LOADER_BLOCK;
-
-//
-// Loader Parameter Block
+// Kernel Exports
 //
-typedef struct _LOADER_PARAMETER_BLOCK
-{
-    LIST_ENTRY LoadOrderListHead;
-    LIST_ENTRY MemoryDescriptorListHead;
-    LIST_ENTRY DriverList;
-    PVOID KernelStack;
-    PVOID Prcb;
-    PVOID Process;
-    PVOID Thread;
-    ULONG RegistryLength;
-    PVOID RegistryBase;
-    PCONFIGURATION_COMPONENT_DATA ConfigurationRoot;
-    LPSTR ArcBootDeviceName;
-    LPSTR ArcHalDeviceName;
-    LPSTR SystemRoot;
-    LPSTR BootRoot;
-    LPSTR CommandLine;
-    PNLS_TABLE_DATA NlsTables;
-    PARC_DISK_INFORMATION ArcDevices;
-    PVOID OEMFont;
-    PSETUP_LOADER_BLOCK SetupLdrBlock;
-    PLOADER_PARAMETER_EXTENSION LpbExtension;
-    union
-    {
-        I386_LOADER_BLOCK I386;
-    } u;
-} LOADER_PARAMETER_BLOCK, *PLOADER_PARAMETER_BLOCK;
-
+#ifndef _NTOSKRNL_
+extern PHAL_PRIVATE_DISPATCH HalPrivateDispatchTable;
 #else
-
-//
-// FIXME: ReactOS ONLY
-//
-typedef struct _LOADER_MODULE
-{
-    ULONG ModStart;
-    ULONG ModEnd;
-    ULONG String;
-    ULONG Reserved;
-} LOADER_MODULE, *PLOADER_MODULE;
-typedef struct _LOADER_PARAMETER_BLOCK
-{
-    ULONG Flags;
-    ULONG MemLower;
-    ULONG MemHigher;
-    ULONG BootDevice;
-    ULONG CommandLine;
-    ULONG ModsCount;
-    ULONG ModsAddr;
-    UCHAR Syms[12];
-    ULONG MmapLength;
-    ULONG MmapAddr;
-    ULONG DrivesCount;
-    ULONG DrivesAddr;
-    ULONG ConfigTable;
-    ULONG BootLoaderName;
-    ULONG PageDirectoryStart;
-    ULONG PageDirectoryEnd;
-    ULONG KernelBase;
-} LOADER_PARAMETER_BLOCK, *PLOADER_PARAMETER_BLOCK;
+extern HAL_PRIVATE_DISPATCH HalPrivateDispatchTable;
 #endif
 
 //
-// Kernel Exports
+// HAL Exports
 //
-#ifdef __NTOSKRNL__
-extern HAL_PRIVATE_DISPATCH HalPrivateDispatchTable;
-#else
-extern PHAL_PRIVATE_DISPATCH HalPrivateDispatchTable;
+#ifndef _NTHAL_
+extern PUCHAR *KdComPortInUse;
 #endif
-extern ULONG KdComPortInUse;
 
 #endif
 #endif
index 8cbdde7..30e7146 100644 (file)
@@ -1,4 +1,4 @@
-/*++ NDK Version: 0095
+/*++ NDK Version: 0098
 
 Copyright (c) Alex Ionescu.  All rights reserved.
 
@@ -12,7 +12,7 @@ Abstract:
 
 Author:
 
-    Alex Ionescu (alex.ionescu@reactos.com)   06-Oct-2004
+    Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
 
 --*/
 
@@ -33,14 +33,58 @@ Author:
 #define I386_INTERRUPT_GATE     0xE
 #define I386_TRAP_GATE          0xF
 
+//
+// Selector Names
+//
+#define RPL_MASK                0x0003
+#define MODE_MASK               0x0001
+#define KGDT_R0_CODE            (0x8)
+#define KGDT_R0_DATA            (0x10)
+#define KGDT_R3_CODE            (0x18)
+#define KGDT_R3_DATA            (0x20)
+#define KGDT_TSS                (0x28)
+#define KGDT_R0_PCR             (0x30)
+#define KGDT_R3_TEB             (0x38)
+#define KGDT_LDT                (0x48)
+#define KGDT_DF_TSS             (0x50)
+#define KGDT_NMI_TSS            (0x58)
+
+//
+// CR4
+//
+#define CR4_VME                 0x1
+#define CR4_PVI                 0x2
+#define CR4_TSD                 0x4
+#define CR4_DE                  0x8
+#define CR4_PSE                 0x10
+#define CR4_PAE                 0x20
+#define CR4_MCE                 0x40
+#define CR4_PGE                 0x80
+#define CR4_FXSR                0x200
+#define CR4_XMMEXCPT            0x400
+
+//
+// EFlags
+//
+#define EFLAGS_TF               0x100
+#define EFLAGS_INTERRUPT_MASK   0x200
+#define EFLAGS_NESTED_TASK      0x4000
+#define EFLAGS_V86_MASK         0x20000
+#define EFLAGS_ALIGN_CHECK      0x40000
+#define EFLAGS_VIF              0x80000
+#define EFLAGS_VIP              0x100000
+#define EFLAG_SIGN              0x8000
+#define EFLAG_ZERO              0x4000
+
+#ifndef NTOS_MODE_USER
 //
 // IPI Types
 //
 #define IPI_APC                 1
 #define IPI_DPC                 2
-#define IPI_FREEZE              3
-#define IPI_PACKET_READY        4
-#define IPI_SYNCH_REQUEST       10
+#define IPI_FREEZE              4
+#define IPI_PACKET_READY        8
+#define IPI_SYNCH_REQUEST       16
 
 //
 // FN/FX (FPU) Save Area Structures
@@ -146,16 +190,16 @@ typedef struct _LDT_ENTRY
         } Bytes;
         struct
         {
-            ULONG BaseMid : 8;
-            ULONG Type : 5;
-            ULONG Dpl : 2;
-            ULONG Pres : 1;
-            ULONG LimitHi : 4;
-            ULONG Sys : 1;
-            ULONG Reserved_0 : 1;
-            ULONG Default_Big : 1;
-            ULONG Granularity : 1;
-            ULONG BaseHi : 8;
+            ULONG BaseMid:8;
+            ULONG Type:5;
+            ULONG Dpl:2;
+            ULONG Pres:1;
+            ULONG LimitHi:4;
+            ULONG Sys:1;
+            ULONG Reserved_0:1;
+            ULONG Default_Big:1;
+            ULONG Granularity:1;
+            ULONG BaseHi:8;
         } Bits;
     } HighWord;
 } LDT_ENTRY, *PLDT_ENTRY, *LPLDT_ENTRY;
@@ -178,16 +222,16 @@ typedef struct _KGDTENTRY
         } Bytes;
         struct
         {
-            ULONG BaseMid       : 8;
-            ULONG Type          : 5;
-            ULONG Dpl           : 2;
-            ULONG Pres          : 1;
-            ULONG LimitHi       : 4;
-            ULONG Sys           : 1;
-            ULONG Reserved_0    : 1;
-            ULONG Default_Big   : 1;
-            ULONG Granularity   : 1;
-            ULONG BaseHi        : 8;
+            ULONG BaseMid:8;
+            ULONG Type:5;
+            ULONG Dpl:2;
+            ULONG Pres:1;
+            ULONG LimitHi:4;
+            ULONG Sys:1;
+            ULONG Reserved_0:1;
+            ULONG Default_Big:1;
+            ULONG Granularity:1;
+            ULONG BaseHi:8;
         } Bits;
     } HighWord;
 } KGDTENTRY, *PKGDTENTRY;
@@ -222,26 +266,6 @@ typedef struct _KIDTENTRY
     USHORT ExtendedOffset;
 } KIDTENTRY, *PKIDTENTRY;
 
-//
-// Page Table Entry Definition
-//
-typedef struct _HARDWARE_PTE_X86
-{
-    ULONG Valid             : 1;
-    ULONG Write             : 1;
-    ULONG Owner             : 1;
-    ULONG WriteThrough      : 1;
-    ULONG CacheDisable      : 1;
-    ULONG Accessed          : 1;
-    ULONG Dirty             : 1;
-    ULONG LargePage         : 1;
-    ULONG Global            : 1;
-    ULONG CopyOnWrite       : 1;
-    ULONG Prototype         : 1;
-    ULONG reserved          : 1;
-    ULONG PageFrameNumber   : 20;
-} HARDWARE_PTE_X86, *PHARDWARE_PTE_X86;
-
 typedef struct _DESCRIPTOR
 {
     USHORT Pad;
@@ -277,9 +301,9 @@ typedef struct _KSPECIAL_REGISTERS
 #pragma pack(push,4)
 typedef struct _KPROCESSOR_STATE
 {
-    PCONTEXT ContextFrame;
+    CONTEXT ContextFrame;
     KSPECIAL_REGISTERS SpecialRegisters;
-} KPROCESSOR_STATE;
+} KPROCESSOR_STATE, *PKPROCESSOR_STATE;
 
 //
 // Processor Region Control Block
@@ -301,8 +325,13 @@ typedef struct _KPRCB
     KPROCESSOR_STATE ProcessorState;
     ULONG KernelReserved[16];
     ULONG HalReserved[16];
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    ULONG CFlushSize;
+    UCHAR PrcbPad0[88];
+#else
     UCHAR PrcbPad0[92];
-    PVOID LockQueue[33]; // Used for Queued Spinlocks
+#endif
+    KSPIN_LOCK_QUEUE LockQueue[LockQueueMaximumLock];
     struct _KTHREAD *NpxThread;
     ULONG InterruptCount;
     ULONG KernelTime;
@@ -314,18 +343,41 @@ typedef struct _KPRCB
     ULONG PageColor;
     UCHAR SkipTick;
     UCHAR DebuggerSavedIRQL;
+#if (NTDDI_VERSION >= NTDDI_WS03)
+    UCHAR NodeColor;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    UCHAR PollSlot;
+#else
+    UCHAR Spare1;
+#endif
+    ULONG NodeShiftedColor;
+#else
     UCHAR Spare1[6];
+#endif
     struct _KNODE *ParentNode;
     ULONG MultiThreadProcessorSet;
     struct _KPRCB *MultiThreadSetMaster;
+#if (NTDDI_VERSION >= NTDDI_WS03)
+    ULONG SecondaryColorMask;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    ULONG DpcTimeLimit;
+#else
+    LONG Sleeping;
+#endif
+#else
     ULONG ThreadStartCount[2];
+#endif
     ULONG CcFastReadNoWait;
     ULONG CcFastReadWait;
     ULONG CcFastReadNotPossible;
     ULONG CcCopyReadNoWait;
     ULONG CcCopyReadWait;
     ULONG CcCopyReadNoWaitMiss;
+#if (NTDDI_VERSION < NTDDI_LONGHORN)
     ULONG KeAlignmentFixupCount;
+#endif
+    ULONG SpareCounter0;
+#if (NTDDI_VERSION < NTDDI_LONGHORN)
     ULONG KeContextSwitches;
     ULONG KeDcacheFlushCount;
     ULONG KeExceptionDispatchCount;
@@ -334,13 +386,47 @@ typedef struct _KPRCB
     ULONG KeIcacheFlushCount;
     ULONG KeSecondLevelTbFills;
     ULONG KeSystemCalls;
+#endif
     ULONG IoReadOperationCount;
     ULONG IoWriteOperationCount;
     ULONG IoOtherOperationCount;
     LARGE_INTEGER IoReadTransferCount;
     LARGE_INTEGER IoWriteTransferCount;
     LARGE_INTEGER IoOtherTransferCount;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    ULONG CcFastMdlReadNoWait;
+    ULONG CcFastMdlReadWait;
+    ULONG CcFastMdlReadNotPossible;
+    ULONG CcMapDataNoWait;
+    ULONG CcMapDataWait;
+    ULONG CcPinMappedDataCount;
+    ULONG CcPinReadNoWait;
+    ULONG CcPinReadWait;
+    ULONG CcMdlReadNoWait;
+    ULONG CcMdlReadWait;
+    ULONG CcLazyWriteHotSpots;
+    ULONG CcLazyWriteIos;
+    ULONG CcLazyWritePages;
+    ULONG CcDataFlushes;
+    ULONG CcDataPages;
+    ULONG CcLostDelayedWrites;
+    ULONG CcFastReadResourceMiss;
+    ULONG CcCopyReadWaitMiss;
+    ULONG CcFastMdlReadResourceMiss;
+    ULONG CcMapDataNoWaitMiss;
+    ULONG CcMapDataWaitMiss;
+    ULONG CcPinReadNoWaitMiss;
+    ULONG CcPinReadWaitMiss;
+    ULONG CcMdlReadNoWaitMiss;
+    ULONG CcMdlReadWaitMiss;
+    ULONG CcReadAheadIos;
+    ULONG KeAlignmentFixupCount;
+    ULONG KeExceptionDispatchCount;
+    ULONG KeSystemCalls;
+    ULONG PrcbPad1[3];
+#else
     ULONG SpareCounter1[8];
+#endif
     PP_LOOKASIDE_LIST PPLookasideList[16];
     PP_LOOKASIDE_LIST PPNPagedLookasideList[32];
     PP_LOOKASIDE_LIST PPPagedLookasideList[32];
@@ -350,7 +436,7 @@ typedef struct _KPRCB
     UCHAR PrcbPad2[52];
     PVOID CurrentPacket[3];
     ULONG TargetSet;
-    ULONG_PTR WorkerRoutine;
+    PKIPI_WORKER WorkerRoutine;
     ULONG IpiFrozen;
     UCHAR PrcbPad3[40];
     ULONG RequestSummary;
@@ -370,22 +456,49 @@ typedef struct _KPRCB
     ULONG TimerHand;
     ULONG TimerRequest;
     PVOID DpcThread;
-    struct _KEVENT *DpcEvent;
+    KEVENT DpcEvent;
     UCHAR ThreadDpcEnable;
     BOOLEAN QuantumEnd;
     UCHAR PrcbPad50;
     UCHAR IdleSchedule;
-    ULONG DpcSetEventRequest;
+    LONG DpcSetEventRequest;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    LONG Sleeping;
+    ULONG PeriodicCount;
+    ULONG PeriodicBias;
+    UCHAR PrcbPad5[6];
+#else
     UCHAR PrcbPad5[18];
+#endif
     LONG TickOffset;
-    struct _KDPC* CallDpc;
+    KDPC CallDpc;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    LONG ClockKeepAlive;
+    UCHAR ClockCheckSlot;
+    UCHAR ClockPollCycle;
+    UCHAR PrcbPad6[2];
+    LONG DpcWatchdogPeriod;
+    LONG DpcWatchDogCount;
+    LONG ThreadWatchdogPeriod;
+    LONG ThreadWatchDogCount;
+    ULONG PrcbPad70[2];
+#else
     ULONG PrcbPad7[8];
+#endif
     LIST_ENTRY WaitListHead;
     ULONG ReadySummary;
-    ULONG SelectNextLast;
+    ULONG QueueIndex;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    SINGLE_LIST_ENTRY DeferredReadyListHead;
+    ULONGLONG StartCycles;
+    ULONGLONG CycleTime;
+    ULONGLONG PrcbPad71[3];
+    LIST_ENTRY DispatcherReadyListHead[32];
+#else
     LIST_ENTRY DispatcherReadyListHead[32];
     SINGLE_LIST_ENTRY DeferredReadyListHead;
     ULONG PrcbPad72[11];
+#endif
     PVOID ChainedInterruptList;
     LONG LookasideIrpFloat;
     LONG MmPageFaultCount;
@@ -401,7 +514,15 @@ typedef struct _KPRCB
     LONG MmDirtyWriteIoCount;
     LONG MmMappedPagesWriteCount;
     LONG MmMappedWriteIoCount;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    ULONG CachedCommit;
+    ULONG CachedResidentAvailable;
+    PVOID HyperPte;
+    UCHAR CpuVendor;
+    UCHAR PrcbPad9[3];
+#else
     ULONG SpareFields0[1];
+#endif
     CHAR VendorString[13];
     UCHAR InitialApicId;
     UCHAR LogicalProcessorsPerPhysicalProcessor;
@@ -412,6 +533,23 @@ typedef struct _KPRCB
     LARGE_INTEGER SpareField1;
     FX_SAVE_AREA NpxSaveArea;
     PROCESSOR_POWER_STATE PowerState;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    KDPC DpcWatchdogDoc;
+    KTIMER DpcWatchdogTimer;
+    PVOID WheaInfo;
+    PVOID EtwSupport;
+    SLIST_HEADER InterruptObjectPool;
+    LARGE_INTEGER HyperCallPagePhysical;
+    LARGE_INTEGER HyperCallPageVirtual;
+    PVOID RateControl;
+    CACHE_DESCRIPTOR Cache[5];
+    ULONG CacheCount;
+    ULONG CacheProcessorMask[5];
+    UCHAR LogicalProcessorsPerCore;
+    UCHAR PrcbPad8[3];
+    ULONG PackageProcessorSet;
+    ULONG CoreProcessorSet;
+#endif
 } KPRCB, *PKPRCB;
 
 //
@@ -433,35 +571,36 @@ typedef struct _KIPCR
             PVOID Used_Self;
         };
     };
-    struct _KPCR *Self;          /* 1C */
-    struct _KPRCB *Prcb;         /* 20 */
-    KIRQL Irql;                  /* 24 */
-    ULONG IRR;                   /* 28 */
-    ULONG IrrActive;             /* 2C */
-    ULONG IDR;                   /* 30 */
-    PVOID KdVersionBlock;        /* 34 */
-    PKIDTENTRY IDT;              /* 38 */
+    struct _KPCR *Self;
+    struct _KPRCB *Prcb;
+    KIRQL Irql;
+    ULONG IRR;
+    ULONG IrrActive;
+    ULONG IDR;
+    PVOID KdVersionBlock;
+    PKIDTENTRY IDT;
 #ifdef _REACTOS_
-    PUSHORT GDT;                 /* 3C */
+    PUSHORT GDT;
 #else
-    PKGDTENTRY GDT;              /* 3C */
+    PKGDTENTRY GDT;
 #endif
-    struct _KTSS *TSS;           /* 40 */
-    USHORT MajorVersion;         /* 44 */
-    USHORT MinorVersion;         /* 46 */
-    KAFFINITY SetMember;         /* 48 */
-    ULONG StallScaleFactor;      /* 4C */
-    UCHAR SparedUnused;          /* 50 */
-    UCHAR Number;                /* 51 */
-    UCHAR Reserved;              /* 52 */
-    UCHAR L2CacheAssociativity;  /* 53 */
-    ULONG VdmAlert;              /* 54 */
-    ULONG KernelReserved[14];    /* 58 */
-    ULONG L2CacheSize;           /* 90 */
-    ULONG HalReserved[16];       /* 94 */
-    ULONG InterruptMode;         /* D4 */
-    UCHAR KernelReserved2[0x48]; /* D8 */
-    KPRCB PrcbData;              /* 120 */
+    struct _KTSS *TSS;
+    USHORT MajorVersion;
+    USHORT MinorVersion;
+    KAFFINITY SetMember;
+    ULONG StallScaleFactor;
+    UCHAR SparedUnused;
+    UCHAR Number;
+    UCHAR Reserved;
+    UCHAR L2CacheAssociativity;
+    ULONG VdmAlert;
+    ULONG KernelReserved[14];
+    ULONG SecondLevelCacheSize;
+    ULONG HalReserved[16];
+    ULONG InterruptMode;
+    UCHAR Spare1;
+    ULONG KernelReserved2[17];
+    KPRCB PrcbData;
 } KIPCR, *PKIPCR;
 #pragma pack(pop)
 
@@ -511,5 +650,5 @@ typedef struct _KTSS
 // i386 CPUs don't have exception frames
 //
 typedef struct _KEXCEPTION_FRAME KEXCEPTION_FRAME, *PKEXCEPTION_FRAME;
-
+#endif
 #endif
index 14194f7..549634f 100644 (file)
@@ -29,4 +29,121 @@ Author:
 #define PAGE_SIZE                         0x1000
 #define PAGE_SHIFT                        12L
 
+//
+// Page Table Entry Definitions
+//
+typedef struct _HARDWARE_PTE_X86
+{
+    ULONG Valid:1;
+    ULONG Write:1;
+    ULONG Owner:1;
+    ULONG WriteThrough:1;
+    ULONG CacheDisable:1;
+    ULONG Accessed:1;
+    ULONG Dirty:1;
+    ULONG LargePage:1;
+    ULONG Global:1;
+    ULONG CopyOnWrite:1;
+    ULONG Prototype: 1;
+    ULONG reserved: 1;
+    ULONG PageFrameNumber:20;
+} HARDWARE_PTE_X86, *PHARDWARE_PTE_X86;
+
+typedef struct _MMPTE_SOFTWARE
+{
+    ULONG Valid:1;
+    ULONG PageFileLow:4;
+    ULONG Protection:5;
+    ULONG Prototype:1;
+    ULONG Transition:1;
+    ULONG PageFileHigh:20;
+} MMPTE_SOFTWARE;
+
+typedef struct _MMPTE_TRANSITION
+{
+    ULONG Valid:1;
+    ULONG Write:1;
+    ULONG Owner:1;
+    ULONG WriteThrough:1;
+    ULONG CacheDisable:1;
+    ULONG Protection:5;
+    ULONG Prototype:1;
+    ULONG Transition:1;
+    ULONG PageFrameNumber:20;
+} MMPTE_TRANSITION;
+
+typedef struct _MMPTE_PROTOTYPE
+{
+    ULONG Valid:1;
+    ULONG ProtoAddressLow:7;
+    ULONG ReadOnly:1;
+    ULONG WhichPool:1;
+    ULONG Prototype:1;
+    ULONG ProtoAddressHigh:21;
+} MMPTE_PROTOTYPE;
+
+typedef struct _MMPTE_SUBSECTION
+{
+    ULONG Valid:1;
+    ULONG SubsectionAddressLow:4;
+    ULONG Protection:5;
+    ULONG Prototype:1;
+    ULONG SubsectionAddressHigh:20;
+    ULONG WhichPool:1;
+} MMPTE_SUBSECTION;
+
+typedef struct _MMPTE_LIST
+{
+    ULONG Valid:1;
+    ULONG OneEntry:1;
+    ULONG filler10:10;
+    ULONG NextEntry:20;
+} MMPTE_LIST;
+
+#ifndef CONFIG_SMP
+
+typedef struct _MMPTE_HARDWARE
+{
+    ULONG Valid:1;
+    ULONG Write:1;
+    ULONG Owner:1;
+    ULONG WriteThrough:1;
+    ULONG CacheDisable:1;
+    ULONG Accessed:1;
+    ULONG Dirty:1;
+    ULONG LargePage:1;
+    ULONG Global:1;
+    ULONG CopyOnWrite:1;
+    ULONG Prototype:1;
+    ULONG reserved:1;
+    ULONG PageFrameNumber:20;
+} MMPTE_HARDWARE, *PMMPTE_HARDWARE;
+
+#else
+
+typedef struct _MMPTE_HARDWARE
+{
+    ULONG Valid:1;
+    ULONG Writable:1;
+    ULONG Owner:1;
+    ULONG WriteThrough:1;
+    ULONG CacheDisable:1;
+    ULONG Accessed:1;
+    ULONG Dirty:1;
+    ULONG LargePage:1;
+    ULONG Global:1;
+    ULONG CopyOnWrite:1;
+    ULONG Prototype:1;
+    ULONG Write:1;
+    ULONG PageFrameNumber:20;
+} MMPTE_HARDWARE, *PMMPTE_HARDWARE;
+
+#endif
+
+//
+// Use the right PTE structure
+//
+#define HARDWARE_PTE        HARDWARE_PTE_X86
+#define PHARDWARE_PTE       PHARDWARE_PTE_X86
+
 #endif
index 3b4f910..c3feeac 100644 (file)
@@ -1,4 +1,4 @@
-/*++ NDK Version: 0095
+/*++ NDK Version: 0098
 
 Copyright (c) Alex Ionescu.  All rights reserved.
 
@@ -12,7 +12,7 @@ Abstract:
 
 Author:
 
-    Alex Ionescu (alex.ionescu@reactos.com)   06-Oct-2004
+    Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
 
 --*/
 #ifndef _NTIFS_
index 699cecc..142abef 100644 (file)
@@ -1,4 +1,4 @@
-/*++ NDK Version: 0095
+/*++ NDK Version: 0098
 
 Copyright (c) Alex Ionescu.  All rights reserved.
 
@@ -12,7 +12,7 @@ Abstract:
 
 Author:
 
-    Alex Ionescu (alex.ionescu@reactos.com)   06-Oct-2004
+    Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
 
 --*/
 
@@ -54,7 +54,7 @@ InbvEnableBootDriver(
 VOID
 NTAPI
 InbvInstallDisplayStringFilter(
-    IN PVOID Unknown
+    IN PVOID DisplayFilter
 );
 
 BOOLEAN
index ce022dc..ab8035e 100644 (file)
@@ -1,4 +1,4 @@
-/*++ NDK Version: 0095
+/*++ NDK Version: 0098
 
 Copyright (c) Alex Ionescu.  All rights reserved.
 
@@ -12,7 +12,7 @@ Abstract:
 
 Author:
 
-    Alex Ionescu (alex.ionescu@reactos.com)   06-Oct-2004
+    Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
 
 --*/
 
@@ -140,8 +140,8 @@ NTSYSCALLAPI
 NTSTATUS
 NTAPI
 NtEnumerateBootEntries(
-    IN ULONG Unknown1,
-    IN ULONG Unknown2
+    IN PVOID Buffer,
+    IN PULONG BufferLength
 );
 
 NTSYSCALLAPI
@@ -244,16 +244,16 @@ NTSYSCALLAPI
 NTSTATUS
 NTAPI
 NtQueryBootEntryOrder(
-    IN ULONG Unknown1,
-    IN ULONG Unknown2
+    IN PULONG Ids,
+    IN PULONG Count
 );
 
 NTSYSCALLAPI
 NTSTATUS
 NTAPI
 NtQueryBootOptions(
-    IN ULONG Unknown1,
-    IN ULONG Unknown2
+    IN PBOOT_OPTIONS BootOptions,
+    IN PULONG BootOptionsLength
 );
 
 NTSYSCALLAPI
@@ -389,16 +389,16 @@ NTSYSCALLAPI
 NTSTATUS
 NTAPI
 NtSetBootEntryOrder(
-    IN ULONG Unknown1,
-    IN ULONG Unknown2
+    IN PULONG Ids,
+    IN PULONG Count
 );
 
 NTSYSCALLAPI
 NTSTATUS
 NTAPI
 NtSetBootOptions(
-    ULONG Unknown1,
-    ULONG Unknown2
+    IN PBOOT_OPTIONS BootOptions,
+    IN ULONG FieldsToChange
 );
 
 NTSYSCALLAPI
@@ -458,9 +458,10 @@ NTSYSCALLAPI
 NTSTATUS
 NTAPI
 NtTranslateFilePath(
-    ULONG Unknown1,
-    ULONG Unknown2,
-    ULONG Unknown3
+    PFILE_PATH InputFilePath,
+    ULONG OutputType,
+    PFILE_PATH OutputFilePath,
+    ULONG OutputFilePathLength
 );
 
 NTSYSCALLAPI
@@ -619,14 +620,6 @@ ZwDeviceIoControlFile(
     IN ULONG OutputBufferSize
 );
 
-NTSYSAPI
-NTSTATUS
-NTAPI
-ZwEnumerateBootEntries(
-    IN ULONG Unknown1,
-    IN ULONG Unknown2
-);
-
 #ifdef NTOS_MODE_USER
 NTSYSAPI
 NTSTATUS
@@ -727,22 +720,6 @@ ZwQueryAttributesFile(
     OUT PFILE_BASIC_INFORMATION FileInformation
 );
 
-NTSYSAPI
-NTSTATUS
-NTAPI
-ZwQueryBootEntryOrder(
-    IN ULONG Unknown1,
-    IN ULONG Unknown2
-);
-
-NTSYSAPI
-NTSTATUS
-NTAPI
-ZwQueryBootOptions(
-    IN ULONG Unknown1,
-    IN ULONG Unknown2
-);
-
 NTSYSAPI
 NTSTATUS
 NTAPI
@@ -874,22 +851,6 @@ ZwRemoveIoCompletion(
     IN PLARGE_INTEGER Timeout OPTIONAL
 );
 
-NTSYSAPI
-NTSTATUS
-NTAPI
-ZwSetBootEntryOrder(
-    IN ULONG Unknown1,
-    IN ULONG Unknown2
-);
-
-NTSYSAPI
-NTSTATUS
-NTAPI
-ZwSetBootOptions(
-    ULONG Unknown1,
-    ULONG Unknown2
-);
-
 #ifdef NTOS_MODE_USER
 NTSYSAPI
 NTSTATUS
@@ -945,15 +906,6 @@ ZwSetVolumeInformationFile(
     IN FS_INFORMATION_CLASS FsInformationClass
 );
 
-NTSYSAPI
-NTSTATUS
-NTAPI
-ZwTranslateFilePath(
-    ULONG Unknown1,
-    ULONG Unknown2,
-    ULONG Unknown3
-);
-
 NTSYSAPI
 NTSTATUS
 NTAPI
index faf2fa6..4cbb19c 100644 (file)
@@ -1,4 +1,4 @@
-/*++ NDK Version: 0095
+/*++ NDK Version: 0098
 
 Copyright (c) Alex Ionescu.  All rights reserved.
 
@@ -12,7 +12,7 @@ Abstract:
 
 Author:
 
-    Alex Ionescu (alex.ionescu@reactos.com)   06-Oct-2004
+    Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
 
 --*/
 
@@ -166,6 +166,14 @@ extern POBJECT_TYPE NTSYSAPI IoDriverObjectType;
 #define DNUF_DONT_SHOW_IN_UI                    0x0002
 #define DNUF_NOT_DISABLEABLE                    0x0008
 
+//
+// Undocumented WMI Registration Flags
+//
+#define WMIREG_FLAG_TRACE_PROVIDER          0x00010000
+#define WMIREG_FLAG_TRACE_NOTIFY_MASK       0x00F00000
+#define WMIREG_NOTIFY_DISK_IO               0x00100000
+#define WMIREG_NOTIFY_TDI_IO                0x00200000
+
 //
 // I/O Completion Information Class for NtQueryIoCompletionInformation
 //
@@ -201,6 +209,24 @@ typedef enum _INTERFACE_TYPE
     MaximumInterfaceType
 }INTERFACE_TYPE, *PINTERFACE_TYPE;
 
+typedef enum _BUS_DATA_TYPE
+{
+    ConfigurationSpaceUndefined = -1,
+    Cmos,
+    EisaConfiguration,
+    Pos,
+    CbusConfiguration,
+    PCIConfiguration,
+    VMEConfiguration,
+    NuBusConfiguration,
+    PCMCIAConfiguration,
+    MPIConfiguration,
+    MPSAConfiguration,
+    PNPISAConfiguration,
+    SgiInternalConfiguration,
+    MaximumBusDataType
+} BUS_DATA_TYPE, *PBUS_DATA_TYPE;
+
 //
 // File Information Classes for NtQueryInformationFile
 //
@@ -491,6 +517,21 @@ typedef struct _FILE_VALID_DATA_LENGTH_INFORMATION
     LARGE_INTEGER ValidDataLength;
 } FILE_VALID_DATA_LENGTH_INFORMATION, *PFILE_VALID_DATA_LENGTH_INFORMATION;
 
+typedef struct _FILE_DIRECTORY_INFORMATION
+{
+    ULONG NextEntryOffset;
+    ULONG FileIndex;
+    LARGE_INTEGER CreationTime;
+    LARGE_INTEGER LastAccessTime;
+    LARGE_INTEGER LastWriteTime;
+    LARGE_INTEGER ChangeTime;
+    LARGE_INTEGER EndOfFile;
+    LARGE_INTEGER AllocationSize;
+    ULONG FileAttributes;
+    ULONG FileNameLength;
+    WCHAR FileName[1];
+} FILE_DIRECTORY_INFORMATION, *PFILE_DIRECTORY_INFORMATION;
+
 //
 // File System Information structures for NtQueryInformationFile
 //
@@ -996,6 +1037,30 @@ typedef struct _EXTENDED_IO_STACK_LOCATION
 #endif
 #endif
 
+//
+// Firmware Boot File Path
+//
+typedef struct _FILE_PATH
+{
+    ULONG Version;
+    ULONG Length;
+    ULONG Type;
+    CHAR FilePath[1];
+} FILE_PATH, *PFILE_PATH;
+
+//
+// Firmware Boot Options
+//
+typedef struct _BOOT_OPTIONS
+{
+    ULONG Version;
+    ULONG Length;
+    ULONG Timeout;
+    ULONG CurrentBootEntryId;
+    ULONG NextBootEntryId;
+    WCHAR HeadlessRedirection[1];
+} BOOT_OPTIONS, *PBOOT_OPTIONS;
+
 //
 // APC Callback for NtCreateFile
 //
index 646739d..7e7e458 100644 (file)
@@ -1,4 +1,4 @@
-/*++ NDK Version: 0095
+/*++ NDK Version: 0098
 
 Copyright (c) Alex Ionescu.  All rights reserved.
 
@@ -12,7 +12,7 @@ Abstract:
 
 Author:
 
-    Alex Ionescu (alex.ionescu@reactos.com)   06-Oct-2004
+    Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
 
 --*/
 
@@ -34,89 +34,35 @@ UCHAR
 NTAPI
 KdPollBreakIn(VOID);
 
-BOOLEAN
-NTAPI
-KdPortInitialize(
-    PKD_PORT_INFORMATION PortInformation,
-    ULONG Unknown1,
-    ULONG Unknown2
-);
-
-BOOLEAN
-NTAPI
-KdPortInitializeEx(
-    PKD_PORT_INFORMATION PortInformation,
-    ULONG Unknown1,
-    ULONG Unknown2
-);
-
-BOOLEAN
-NTAPI
-KdPortGetByte(
-    PUCHAR ByteRecieved
-);
-
-BOOLEAN
-NTAPI
-KdPortGetByteEx(
-    PKD_PORT_INFORMATION PortInformation,
-    PUCHAR ByteRecieved
-);
-
-BOOLEAN
-NTAPI
-KdPortPollByte(
-    PUCHAR ByteRecieved
-);
-
-BOOLEAN
+NTSTATUS
 NTAPI
-KdPortPollByteEx(
-    PKD_PORT_INFORMATION PortInformation,
-    PUCHAR ByteRecieved
-);
+KdRestore(IN BOOLEAN DisableDbgPorts);
 
-VOID
+NTSTATUS
 NTAPI
-KdPortPutByte(
-    UCHAR ByteToSend
-);
+KdSave(IN ULONG Unknown);
 
-VOID
+#ifdef _ARC_
+NTSTATUS
 NTAPI
-KdPortPutByteEx(
-    PKD_PORT_INFORMATION PortInformation,
-    UCHAR ByteToSend
+KdDebuggerInitialize0(
+    IN struct _LOADER_PARAMETER_BLOCK *LoaderBlock
 );
+#endif
 
-VOID
-NTAPI
-KdPortRestore(VOID);
-
-VOID
-NTAPI
-KdPortSave (VOID);
-
-VOID
-NTAPI
-KdRestore(VOID);
-
-VOID
-NTAPI
-KdSave (VOID);
-
-BOOLEAN
-NTAPI
-KdPortDisableInterrupts(VOID);
-
-BOOLEAN
-NTAPI
-KdPortEnableInterrupts(VOID);
-
-BOOLEAN
+//
+// Debugger API
+//
+NTSTATUS
 NTAPI
-KdDebuggerInitialize0(
-    IN PLOADER_PARAMETER_BLOCK LoaderBlock
+KdSystemDebugControl(
+    SYSDBG_COMMAND Command,
+    PVOID InputBuffer,
+    ULONG InputBufferLength,
+    PVOID OutputBuffer,
+    ULONG OutputBufferLength,
+    PULONG ReturnLength,
+    KPROCESSOR_MODE PreviousMode
 );
 
 #endif
@@ -145,7 +91,7 @@ NTSYSCALLAPI
 NTSTATUS
 NTAPI
 NtSystemDebugControl(
-    DEBUG_CONTROL_CODE ControlCode,
+    SYSDBG_COMMAND ControlCode,
     PVOID InputBuffer,
     ULONG InputBufferLength,
     PVOID OutputBuffer,
@@ -174,7 +120,7 @@ NTSYSAPI
 NTSTATUS
 NTAPI
 ZwSystemDebugControl(
-    DEBUG_CONTROL_CODE ControlCode,
+    SYSDBG_COMMAND ControlCode,
     PVOID InputBuffer,
     ULONG InputBufferLength,
     PVOID OutputBuffer,
index 5b8285f..3045cf9 100644 (file)
@@ -1,4 +1,4 @@
-/*++ NDK Version: 0095
+/*++ NDK Version: 0098
 
 Copyright (c) Alex Ionescu.  All rights reserved.
 
@@ -12,7 +12,7 @@ Abstract:
 
 Author:
 
-    Alex Ionescu (alex.ionescu@reactos.com)   06-Oct-2004
+    Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
 
 --*/
 
@@ -47,6 +47,7 @@ Author:
 //
 // DebugService Control Types
 //
+#define BREAKPOINT_BREAK                    0
 #define BREAKPOINT_PRINT                    1
 #define BREAKPOINT_PROMPT                   2
 #define BREAKPOINT_LOAD_SYMBOLS             3
@@ -55,25 +56,109 @@ Author:
 //
 // Debug Control Codes for NtSystemDebugcontrol
 //
-typedef enum _DEBUG_CONTROL_CODE
+typedef enum _SYSDBG_COMMAND
 {
-    DebugGetTraceInformation = 1,
-    DebugSetInternalBreakpoint,
-    DebugSetSpecialCall,
-    DebugClearSpecialCalls,
-    DebugQuerySpecialCalls,
-    DebugDbgBreakPoint,
-    DebugDbgLoadSymbols
-} DEBUG_CONTROL_CODE;
+    SysDbgQueryModuleInformation = 0,
+    SysDbgQueryTraceInformation = 1,
+    SysDbgSetTracepoint = 2,
+    SysDbgSetSpecialCall = 3,
+    SysDbgClearSpecialCalls = 4,
+    SysDbgQuerySpecialCalls = 5,
+    SysDbgBreakPoint = 6,
+    SysDbgQueryVersion = 7,
+    SysDbgReadVirtual = 8,
+    SysDbgWriteVirtual = 9,
+    SysDbgReadPhysical = 10,
+    SysDbgWritePhysical = 11,
+    SysDbgReadControlSpace = 12,
+    SysDbgWriteControlSpace = 13,
+    SysDbgReadIoSpace = 14,
+    SysDbgWriteIoSpace = 15,
+    SysDbgReadMsr = 16,
+    SysDbgWriteMsr = 17,
+    SysDbgReadBusData = 18,
+    SysDbgWriteBusData = 19,
+    SysDbgCheckLowMemory = 20,
+    SysDbgEnableKernelDebugger = 21,
+    SysDbgDisableKernelDebugger = 22,
+    SysDbgGetAutoKdEnable = 23,
+    SysDbgSetAutoKdEnable = 24,
+    SysDbgGetPrintBufferSize = 25,
+    SysDbgSetPrintBufferSize = 26,
+    SysDbgGetKdUmExceptionEnable = 27,
+    SysDbgSetKdUmExceptionEnable = 28,
+    SysDbgGetTriageDump = 29,
+    SysDbgGetKdBlockEnable = 30,
+    SysDbgSetKdBlockEnable = 31,
+    SysDbgRegisterForUmBreakInfo = 32,
+    SysDbgGetUmBreakPid = 33,
+    SysDbgClearUmBreakPid = 34,
+    SysDbgGetUmAttachPid = 35,
+    SysDbgClearUmAttachPid = 36,
+} SYSDBG_COMMAND;
 
 //
-// Kernel Debugger Port Definition
+// System Debugger Types
 //
-typedef struct _KD_PORT_INFORMATION
+typedef struct _SYSDBG_PHYSICAL
 {
-    ULONG ComPort;
-    ULONG BaudRate;
-    ULONG BaseAddress;
-} KD_PORT_INFORMATION, *PKD_PORT_INFORMATION;
+    PHYSICAL_ADDRESS Address;
+    PVOID Buffer;
+    ULONG Request;
+} SYSDBG_PHYSICAL, *PSYSDBG_PHYSICAL;
+
+typedef struct _SYSDBG_VIRTUAL
+{
+    PVOID Address;
+    PVOID Buffer;
+    ULONG Request;
+} SYSDBG_VIRTUAL, *PSYSDBG_VIRTUAL;
+
+typedef struct _SYSDBG_CONTROL_SPACE
+{
+    ULONGLONG Address;
+    PVOID Buffer;
+    ULONG Request;
+    ULONG Processor;
+} SYSDBG_CONTROL_SPACE, *PSYSDBG_CONTROL_SPACE;
+
+typedef struct _SYSDBG_IO_SPACE
+{
+    ULONGLONG Address;
+    PVOID Buffer;
+    ULONG Request;
+    INTERFACE_TYPE InterfaceType;
+    ULONG BusNumber;
+    ULONG AddressSpace;
+} SYSDBG_IO_SPACE, *PSYSDBG_IO_SPACE;
+
+typedef struct _SYSDBG_BUS_DATA
+{
+    ULONG Address;
+    PVOID Buffer;
+    ULONG Request;
+    BUS_DATA_TYPE BusDataType;
+    ULONG BusNumber;
+    ULONG SlotNumber;
+} SYSDBG_BUS_DATA, *PSYSDBG_BUS_DATA;
+
+typedef struct _SYSDBG_MSR
+{
+    ULONG Address;
+    ULONGLONG Data;
+} SYSDBG_MSR, *PSYSDBG_MSR;
+
+typedef struct _SYSDBG_TRIAGE_DUMP
+{
+    ULONG Flags;
+    ULONG BugCheckCode;
+    ULONG_PTR BugCheckParam1;
+    ULONG_PTR BugCheckParam2;
+    ULONG_PTR BugCheckParam3;
+    ULONG_PTR BugCheckParam4;
+    ULONG ProcessHandles;
+    ULONG ThreadHandles;
+    PHANDLE Handles;
+} SYSDBG_TRIAGE_DUMP, *PSYSDBG_TRIAGE_DUMP;
 
 #endif // _KDTYPES_H
index e17a090..4becfad 100644 (file)
@@ -1,4 +1,4 @@
-/*++ NDK Version: 0095
+/*++ NDK Version: 0098
 
 Copyright (c) Alex Ionescu.  All rights reserved.
 
@@ -12,7 +12,7 @@ Abstract:
 
 Author:
 
-    Alex Ionescu (alex.ionescu@reactos.com)   06-Oct-2004
+    Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
 
 --*/
 
@@ -111,6 +111,20 @@ KiReleaseSpinLock(
     PKSPIN_LOCK SpinLock
 );
 
+KIRQL
+FASTCALL
+KeAcquireQueuedSpinLockRaiseToSynch(
+    IN KSPIN_LOCK_QUEUE_NUMBER LockNumber
+);
+
+KIRQL
+FASTCALL
+KeAcquireInStackQueuedSpinLockRaiseToSynch(
+    IN PKSPIN_LOCK SpinLock,
+    IN PKLOCK_QUEUE_HANDLE LockHandle
+);
+
+
 //
 // Interrupt Functions
 //
@@ -172,9 +186,17 @@ KeIsExecutingDpc(
     VOID
 );
 
+BOOLEAN
+NTAPI
+KiIpiServiceRoutine(
+    IN PKTRAP_FRAME TrapFrame,
+    IN PVOID ExceptionFrame
+);
+
 //
-// ARC Configuration Functions
+// ARC Configuration Functions. Only enabled if you have ARC Support
 //
+#ifdef _ARC_
 PCONFIGURATION_COMPONENT_DATA
 NTAPI
 KeFindConfigurationNextEntry(
@@ -193,6 +215,7 @@ KeFindConfigurationEntry(
     IN CONFIGURATION_TYPE Type,
     IN PULONG ComponentKey OPTIONAL
 );
+#endif
 
 //
 // Low-level Hardware/CPU Control Functions
@@ -200,8 +223,22 @@ KeFindConfigurationEntry(
 VOID
 NTAPI
 KeFlushEntireTb(
-    IN BOOLEAN Unknown,
-    IN BOOLEAN CurrentCpuOnly
+    IN BOOLEAN Invalid,
+    IN BOOLEAN AllProcessors
+);
+
+VOID
+NTAPI
+KeUpdateSystemTime(
+    PKTRAP_FRAME TrapFrame,
+    KIRQL Irql
+);
+
+VOID
+NTAPI
+KeUpdateRunTime(
+    PKTRAP_FRAME TrapFrame,
+    KIRQL Irql
 );
 
 VOID
@@ -230,6 +267,13 @@ KeSetTimeIncrement(
     IN ULONG MinIncrement
 );
 
+NTSTATUS
+NTAPI
+Ke386CallBios(
+    IN ULONG BiosCommand,
+    IN OUT PCONTEXT BiosArguments
+);
+
 //
 // Misc. Functions
 //
@@ -449,8 +493,8 @@ NtW32Call(
     IN ULONG RoutineIndex,
     IN PVOID Argument,
     IN ULONG ArgumentLength,
-    OUT PVOID* Result,
-    OUT PULONG ResultLength
+    OUT PVOID* Result OPTIONAL,
+    OUT PULONG ResultLength OPTIONAL
 );
 
 NTSYSCALLAPI
index 3d1760b..ece810b 100644 (file)
@@ -1,4 +1,4 @@
-/*++ NDK Version: 0095
+/*++ NDK Version: 0098
 
 Copyright (c) Alex Ionescu.  All rights reserved.
 
@@ -12,7 +12,7 @@ Abstract:
 
 Author:
 
-    Alex Ionescu (alex.ionescu@reactos.com)   06-Oct-2004
+    Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
 
 --*/
 
@@ -24,7 +24,6 @@ Author:
 //
 #include <umtypes.h>
 #ifndef NTOS_MODE_USER
-#include <arc/arc.h>
 #include <haltypes.h>
 #include <potypes.h>
 #include <ifssupp.h>
@@ -38,17 +37,43 @@ Author:
 //
 // Maximum System Descriptor Table Entries
 //
-#define SSDT_MAX_ENTRIES                4
+#define SSDT_MAX_ENTRIES                2
 
 //
-// Maximum number of times a thread can be suspended
+// Dispatcher Priority increments
 //
-#define MAXIMUM_SUSPEND_COUNT           0x7F
+#define THREAD_ALERT_INCREMENT          2
 
 //
-// Dispatcher Priority increments
+// User Shared Data in Kernel-Mode
 //
-#define THREAD_ALERT_INCREMENT          2
+#define KI_USER_SHARED_DATA             0xffdf0000
+
+//
+// Physical memory offset of KUSER_SHARED_DATA
+//
+#define KI_USER_SHARED_DATA_PHYSICAL    0x41000
+
+//
+// Kernel Feature Bits
+//
+#define KF_RDTSC                        0x00000002
+
+//
+// KPCR Access for non-IA64 builds
+//
+#define K0IPCR                          ((ULONG_PTR)(KIP0PCRADDRESS))
+#define PCR                             ((volatile KPCR * const)K0IPCR)
+#define KeGetPcr()                      PCR
+
+//
+// Number of dispatch codes supported by KINTERRUPT
+//
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+#define KINTERRUPT_DISPATCH_CODES       135
+#else
+#define KINTERRUPT_DISPATCH_CODES       106
+#endif
 
 #ifdef NTOS_MODE_USER
 
@@ -215,6 +240,9 @@ typedef enum _KTHREAD_STATE
     Waiting,
     Transition,
     DeferredReady,
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    GateWait,
+#endif
 } KTHREAD_STATE, *PKTHREAD_STATE;
 
 //
@@ -225,8 +253,32 @@ typedef enum _KPROCESS_STATE
     ProcessInMemory,
     ProcessOutOfMemory,
     ProcessInTransition,
+    ProcessInSwap,
+    ProcessOutSwap,
 } KPROCESS_STATE, *PKPROCESS_STATE;
 
+//
+// NtVdmControl Classes
+//
+typedef enum _VDMSERVICECLASS
+{
+   VdmStartExecution = 0,
+   VdmQueueInterrupt = 1,
+   VdmDelayInterrupt = 2,
+   VdmInitialize = 3,
+   VdmFeatures = 4,
+   VdmSetInt21Handler = 5,
+   VdmQueryDir = 6,
+   VdmPrinterDirectIoOpen = 7,
+   VdmPrinterDirectIoClose = 8,
+   VdmPrinterInitialize = 9,
+   VdmSetLdtEntries = 10,
+   VdmSetProcessLdtInfo = 11,
+   VdmAdlibEmulation = 12,
+   VdmPMCliControl = 13,
+   VdmQueryVdmProcess = 14,
+} VDMSERVICECLASS;
+
 #ifdef NTOS_MODE_USER
 
 //
@@ -289,6 +341,9 @@ typedef struct _KUSER_SHARED_DATA
     LARGE_INTEGER SystemExpirationDate;
     ULONG SuiteMask;
     BOOLEAN KdDebuggerEnabled;
+#if (NTDDI_VERSION >= NTDDI_WINXPSP2)
+    UCHAR NXSupportPolicy;
+#endif
     volatile ULONG ActiveConsoleId;
     volatile ULONG DismountCount;
     ULONG ComPlusPackage;
@@ -306,13 +361,84 @@ typedef struct _KUSER_SHARED_DATA
         volatile ULONG64 TickCountQuad;
     };
     ULONG Cookie;
+#if (NTDDI_VERSION >= NTDDI_WS03)
     LONGLONG ConsoleSessionForegroundProcessId;
     ULONG Wow64SharedInformation[MAX_WOW64_SHARED_ENTRIES];
-    ULONG UserModeGlobalLogging;
+#endif
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    USHORT UserModeGlobalLogger[8];
+    ULONG HeapTracingPid[2];
+    ULONG CritSecTracingPid[2];
+    union
+    {
+        ULONG SharedDataFlags;
+        struct
+        {
+            ULONG DbgErrorPortPresent:1;
+            ULONG DbgElevationEnabled:1;
+            ULONG DbgVirtEnabled:1;
+            ULONG DbgInstallerDetectEnabled:1;
+            ULONG SpareBits:28;
+        };
+    };
+    ULONG ImageFileExecutionOptions;
+    KAFFINITY ActiveProcessorAffinity;
+#endif
 } KUSER_SHARED_DATA, *PKUSER_SHARED_DATA;
 
+//
+// VDM Structures
+//
+#include "pshpack1.h"
+typedef struct _VdmVirtualIca
+{
+    LONG ica_count[8];
+    LONG ica_int_line;
+    LONG ica_cpu_int;
+    USHORT ica_base;
+    USHORT ica_hipiri;
+    USHORT ica_mode;
+    UCHAR ica_master;
+    UCHAR ica_irr;
+    UCHAR ica_isr;
+    UCHAR ica_imr;
+    UCHAR ica_ssr;
+} VDMVIRTUALICA, *PVDMVIRTUALICA;
+#include "poppack.h"
+
+typedef struct _VdmIcaUserData
+{
+    PVOID pIcaLock;
+    PVDMVIRTUALICA pIcaMaster;
+    PVDMVIRTUALICA pIcaSlave;
+    PULONG pDelayIrq;
+    PULONG pUndelayIrq;
+    PULONG pDelayIret;
+    PULONG pIretHooked;
+    PULONG pAddrIretBopTable;
+    PHANDLE phWowIdleEvent;
+    PLARGE_INTEGER pIcaTimeout;
+    PHANDLE phMainThreadSuspended;
+} VDMICAUSERDATA, *PVDMICAUSERDATA;
+
+typedef struct _VDM_INITIALIZE_DATA
+{
+    PVOID TrapcHandler;
+    PVDMICAUSERDATA IcaUserData;
+} VDM_INITIALIZE_DATA, *PVDM_INITIALIZE_DATA;
+
 #else
 
+//
+// System Thread Start Routine
+//
+typedef
+VOID
+(NTAPI *PKSYSTEM_ROUTINE)(
+    PKSTART_ROUTINE StartRoutine,
+    PVOID StartContext
+);
+
 //
 // APC Environment Types
 //
@@ -323,6 +449,17 @@ typedef enum _KAPC_ENVIRONMENT
     CurrentApcEnvironment
 } KAPC_ENVIRONMENT;
 
+//
+// CPU Cache Types
+//
+typedef enum _PROCESSOR_CACHE_TYPE
+{
+    CacheUnified,
+    CacheInstruction,
+    CacheData,
+    CacheTrace,
+} PROCESSOR_CACHE_TYPE;
+
 //
 // PRCB DPC Data
 //
@@ -343,6 +480,18 @@ typedef struct _PP_LOOKASIDE_LIST
     struct _GENERAL_LOOKASIDE *L;
 } PP_LOOKASIDE_LIST, *PPP_LOOKASIDE_LIST;
 
+//
+// CPU Cache Descriptor
+//
+typedef struct _CACHE_DESCRIPTOR
+{
+    UCHAR Level;
+    UCHAR Associativity;
+    USHORT LineSize;
+    ULONG Size;
+    PROCESSOR_CACHE_TYPE Type;
+} CACHE_DESCRIPTOR, *PCACHE_DESCRIPTOR;
+
 //
 // Architectural Types
 //
@@ -351,11 +500,12 @@ typedef struct _PP_LOOKASIDE_LIST
 //
 // Kernel Memory Node
 //
+#include <pshpack1.h>
 typedef struct _KNODE
 {
     SLIST_HEADER DeadStackList;
     SLIST_HEADER PfnDereferenceSListHead;
-    ULONG ProcessorMask;
+    KAFFINITY ProcessorMask;
     ULONG Color;
     UCHAR Seed;
     UCHAR NodeNumber;
@@ -364,6 +514,7 @@ typedef struct _KNODE
     ULONG FreeCount[2];
     struct _SINGLE_LIST_ENTRY *PfnDeferredList;
 } KNODE, *PKNODE;
+#include <poppack.h>
 
 //
 // Kernel Profile Object
@@ -393,6 +544,10 @@ typedef struct _KINTERRUPT
     CSHORT Size;
     LIST_ENTRY InterruptListEntry;
     PKSERVICE_ROUTINE ServiceRoutine;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    PKSERVICE_ROUTINE MessageServiceRoutine;
+    ULONG MessageIndex;
+#endif
     PVOID ServiceContext;
     KSPIN_LOCK SpinLock;
     ULONG TickCount;
@@ -406,9 +561,15 @@ typedef struct _KINTERRUPT
     CHAR Number;
     UCHAR ShareVector;
     KINTERRUPT_MODE Mode;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    KINTERRUPT_POLARITY Polarity;
+#endif
     ULONG ServiceCount;
     ULONG DispatchCount;
-    ULONG DispatchCode[106];
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    ULONGLONG Rsvd1;
+#endif
+    ULONG DispatchCode[KINTERRUPT_DISPATCH_CODES];
 } KINTERRUPT, *PKINTERRUPT;
 
 //
@@ -475,179 +636,236 @@ typedef enum _KOBJECTS
 #include <pshpack1.h>
 typedef struct _KTHREAD
 {
-    DISPATCHER_HEADER DispatcherHeader;                 /* 00 */
-    LIST_ENTRY MutantListHead;                          /* 10 */
-    PVOID InitialStack;                                 /* 18 */
-    ULONG_PTR StackLimit;                               /* 1C */
-    PVOID KernelStack;                                  /* 20 */
-    KSPIN_LOCK ThreadLock;                              /* 24 */
-    union                                               /* 28 */
-    {                                                   /* 28 */
-        KAPC_STATE ApcState;                            /* 34 */
-        struct                                          /* 28 */
-        {                                               /* 28 */
-            UCHAR ApcStateFill[23];                     /* 34 */
-            UCHAR ApcQueueable;                         /* 3F */
-        };                                              /* 3F */
-    };                                                  /* 3F */
-    UCHAR NextProcessor;                                /* 40 */
-    UCHAR DeferredProcessor;                            /* 41 */
-    UCHAR AdjustReason;                                 /* 42 */
-    UCHAR AdjustIncrement;                              /* 43 */
-    KSPIN_LOCK ApcQueueLock;                            /* 44 */
-    ULONG ContextSwitches;                              /* 48 */
-    UCHAR State;                                        /* 4C */
-    UCHAR NpxState;                                     /* 4D */
-    UCHAR WaitIrql;                                     /* 4E */
-    UCHAR WaitMode;                                     /* 4F */
-    LONG WaitStatus;                                    /* 50 */
-    union                                               /* 54 */
-    {                                                   /* 54 */
-        PKWAIT_BLOCK WaitBlockList;                     /* 54 */
-        PKGATE GateObject;                              /* 54 */
-    };                                                  /* 54 */
-    UCHAR Alertable;                                    /* 58 */
-    UCHAR WaitNext;                                     /* 59 */
-    UCHAR WaitReason;                                   /* 5A */
-    UCHAR Priority;                                     /* 5B */
-    UCHAR EnableStackSwap;                              /* 5C */
-    UCHAR SwapBusy;                                     /* 5D */
-    UCHAR Alerted[2];                                   /* 5E */
-    union                                               /* 60 */
-    {                                                   /* 60 */
-        LIST_ENTRY WaitListEntry;                       /* 60 */
-        SINGLE_LIST_ENTRY SwapListEntry;                /* 60 */
-    };                                                  /* 68 */
-    PKQUEUE Queue;                                      /* 68 */
-    ULONG WaitTime;                                     /* 6C */
-    union                                               /* 70 */
-    {                                                   /* 70 */
-        struct                                          /* 70 */
-        {                                               /* 70 */
-            USHORT KernelApcDisable;                    /* 70 */
-            USHORT SpecialApcDisable;                   /* 72 */
-        };                                              /* 70 */
-        ULONG CombinedApcDisable;                       /* 70 */
-    };                                                  /* 74 */
-    struct _TEB *Teb;                                   /* 74 */
-    union                                               /* 78 */
-    {                                                   /* 78 */
-        KTIMER Timer;                                   /* 78 */
-        UCHAR TimerFill[40];                            /* 78 */
-    };                                                  /* 78 */
-    union                                               /* A0 */
-    {                                                   /* A0 */
-        struct                                          /* A0 */
-        {                                               /* A0 */
-            LONG AutoAlignment:1;                       /* A0 */
-            LONG DisableBoost:1;                        /* A0 */
-            LONG ReservedFlags:30;                      /* A0 */
-        };                                              /* A0 */
-        LONG ThreadFlags;                               /* A0 */
-    };                                                  /* A0 */
-    PVOID Padding;                                      /* A4 */
-    union                                               /* A8 */
-    {                                                   /* A8 */
-        KWAIT_BLOCK WaitBlock[4];                       /* A8 */
-        union                                           /* A8 */
-        {                                               /* A8 */
-            struct                                      /* A8 */
-            {                                           /* A8 */
-                UCHAR WaitBlockFill0[23];               /* A8 */
-                UCHAR SystemAffinityActive;             /* BF */
-            };                                          /* A8 */
-            struct                                      /* A8 */
-            {                                           /* A8 */
-                UCHAR WaitBlockFill1[47];               /* A8 */
-                UCHAR PreviousMode;                     /* D7 */
-            };                                          /* A8 */
-            struct                                      /* A8 */
-            {                                           /* A8 */
-                UCHAR WaitBlockFill2[71];               /* A8 */
-                UCHAR ResourceIndex;                    /* EF */
-            };                                          /* A8 */
-            struct                                      /* A8 */
-            {                                           /* A8 */
-                UCHAR WaitBlockFill3[95];               /* A8 */
-                UCHAR LargeStack;                       /* 107 */
-            };                                          /* A8 */
-        };                                              /* A8 */
-    };                                                  /* A8 */
-    LIST_ENTRY QueueListEntry;                          /* 108 */
-    PKTRAP_FRAME TrapFrame;                             /* 110 */
-    PVOID CallbackStack;                                /* 114 */
-    PVOID ServiceTable;                                 /* 118 */
-    UCHAR ApcStateIndex;                                /* 11C */
-    UCHAR IdealProcessor;                               /* 11D */
-    UCHAR Preempted;                                    /* 11E */
-    UCHAR ProcessReadyQueue;                            /* 11F */
-    UCHAR KernelStackResident;                          /* 120 */
-    CHAR BasePriority;                                  /* 121 */
-    CHAR PriorityDecrement;                             /* 122 */
-    CHAR Saturation;                                    /* 123 */
-    KAFFINITY UserAffinity;                             /* 124 */
-    struct _KPROCESS *Process;                          /* 128 */
-    KAFFINITY Affinity;                                 /* 12C */
-    PKAPC_STATE ApcStatePointer[2];                     /* 130 */
-    union                                               /* 138 */
-    {                                                   /* 138 */
-        KAPC_STATE SavedApcState;                       /* 138 */
-        union                                           /* 138 */
-        {                                               /* 138 */
-            UCHAR SavedApcStateFill[23];                /* 138 */
-            CHAR FreezeCount;                           /* 14F */
-        };                                              /* 138 */
-    };                                                  /* 138 */
-    CHAR SuspendCount;                                  /* 150 */
-    UCHAR UserIdealProcessor;                           /* 151 */
-    UCHAR CalloutActive;                                /* 152 */
-    UCHAR Iopl;                                         /* 153 */
-    PVOID Win32Thread;                                  /* 154 */
-    PVOID StackBase;                                    /* 158 */
-    union                                               /* 15C */
-    {                                                   /* 15C */
-        KAPC SuspendApc;                                /* 15C */
-        union                                           /* 15C */
-        {                                               /* 15C */
-            UCHAR SuspendApcFill0[1];                   /* 15C */
-            CHAR Quantum;                               /* 15D */
-        };                                              /* 15C */
-        union                                           /* 15C */
-        {                                               /* 15C */
-            UCHAR SuspendApcFill1[3];                   /* 15C */
-            UCHAR QuantumReset;                         /* 15F */
-        };                                              /* 15C */
-        union                                           /* 15C */
-        {                                               /* 15C */
-            UCHAR SuspendApcFill2[4];                   /* 15C */
-            ULONG KernelTime;                           /* 160 */
-        };                                              /* 15C */
-        union                                           /* 15C */
-        {                                               /* 15C */
-            UCHAR SuspendApcFill3[36];                  /* 15C */
-            PVOID TlsArray;                             /* 180 */
-        };                                              /* 15C */
-        union                                           /* 15C */
-        {                                               /* 15C */
-            UCHAR SuspendApcFill4[40];                  /* 15C */
-            PVOID LegoData;                             /* 184 */
-        };                                              /* 15C */
-        union                                           /* 15C */
-        {                                               /* 15C */
-            UCHAR SuspendApcFill5[47];                  /* 15C */
-            UCHAR PowerState;                           /* 18B */
-        };                                              /* 15C */
-    };                                                  /* 15C */
-    ULONG UserTime;                                     /* 18C */
-    union                                               /* 190 */
-    {                                                   /* 190 */
-        KSEMAPHORE SuspendSemaphore;                    /* 190 */
-        UCHAR SuspendSemaphorefill[20];                 /* 190 */
-    };                                                  /* 190 */
-    ULONG SListFaultCount;                              /* 1A4 */
-    LIST_ENTRY ThreadListEntry;                         /* 1A8 */
-    PVOID SListFaultAddress;                            /* 1B0 */
-} KTHREAD;                                              /* sizeof: 1B4 */
+    DISPATCHER_HEADER DispatcherHeader;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    ULONGLONG CycleTime;
+    ULONG HighCycleTime;
+#else
+    LIST_ENTRY MutantListHead;
+#endif
+    PVOID InitialStack;
+    ULONG_PTR StackLimit;
+    PVOID KernelStack;
+    KSPIN_LOCK ThreadLock;
+    union
+    {
+        KAPC_STATE ApcState;
+        struct
+        {
+            UCHAR ApcStateFill[23];
+            UCHAR ApcQueueable;
+        };
+    };
+    UCHAR NextProcessor;
+    UCHAR DeferredProcessor;
+    UCHAR AdjustReason;
+    UCHAR AdjustIncrement;
+    KSPIN_LOCK ApcQueueLock;
+    ULONG ContextSwitches;
+    UCHAR State;
+    UCHAR NpxState;
+    UCHAR WaitIrql;
+    UCHAR WaitMode;
+    LONG WaitStatus;
+    union
+    {
+        PKWAIT_BLOCK WaitBlockList;
+        PKGATE GateObject;
+    };
+    UCHAR Alertable;
+    UCHAR WaitNext;
+    UCHAR WaitReason;
+    UCHAR Priority;
+    UCHAR EnableStackSwap;
+    UCHAR SwapBusy;
+    UCHAR Alerted[2];
+    union
+    {
+        LIST_ENTRY WaitListEntry;
+        SINGLE_LIST_ENTRY SwapListEntry;
+    };
+    PKQUEUE Queue;
+    ULONG WaitTime;
+    union
+    {
+        struct
+        {
+            USHORT KernelApcDisable;
+            USHORT SpecialApcDisable;
+        };
+        ULONG CombinedApcDisable;
+    };
+    struct _TEB *Teb;
+    union
+    {
+        KTIMER Timer;
+        UCHAR TimerFill[40];
+    };
+    union
+    {
+        struct
+        {
+            LONG AutoAlignment:1;
+            LONG DisableBoost:1;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+            LONG EtwStackTrace1ApcInserted:1;
+            LONG EtwStackTrace2ApcInserted:1;
+            LONG CycleChargePending:1;
+            LONG ReservedFlags:27;
+#else
+            LONG ReservedFlags:30;
+#endif
+        };
+        LONG ThreadFlags;
+    };
+    PVOID Padding;
+    union
+    {
+        KWAIT_BLOCK WaitBlock[4];
+        union
+        {
+            struct
+            {
+                UCHAR WaitBlockFill0[23];
+                UCHAR SystemAffinityActive;
+            };
+            struct
+            {
+                UCHAR WaitBlockFill1[47];
+                UCHAR PreviousMode;
+            };
+            struct
+            {
+                UCHAR WaitBlockFill2[71];
+                UCHAR ResourceIndex;
+            };
+            struct
+            {
+                UCHAR WaitBlockFill3[95];
+                UCHAR LargeStack;
+            };
+        };
+    };
+    LIST_ENTRY QueueListEntry;
+    PKTRAP_FRAME TrapFrame;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    PVOID FirstArgument;
+#endif
+    PVOID CallbackStack;
+    PVOID ServiceTable;
+    UCHAR ApcStateIndex;
+    UCHAR IdealProcessor;
+    UCHAR Preempted;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    UCHAR CalloutActive;
+#else
+    UCHAR ProcessReadyQueue;
+#endif
+    UCHAR KernelStackResident;
+    CHAR BasePriority;
+    CHAR PriorityDecrement;
+    CHAR Saturation;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    ULONG SystemCallNumber;
+    union
+    {
+        struct
+        {
+            ULONG Reserved0:1;
+            ULONG ReadyTransition:1;
+            ULONG ProcessReadyQueue:1;
+            ULONG Reserved2:1;
+            ULONG Reserved3:28;
+        };
+        LONG MiscFlags;
+    };
+#endif
+    KAFFINITY UserAffinity;
+    struct _KPROCESS *Process;
+    KAFFINITY Affinity;
+    PKAPC_STATE ApcStatePointer[2];
+    union
+    {
+        KAPC_STATE SavedApcState;
+        union
+        {
+            UCHAR SavedApcStateFill[23];
+            CHAR FreezeCount;
+        };
+    };
+    CHAR SuspendCount;
+    UCHAR UserIdealProcessor;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    union
+    {
+        struct
+        {
+            UCHAR ReservedBits0:1;
+            UCHAR SegmentsPresent:1;
+            UCHAR Reservedbits1:1;
+        };
+        UCHAR NestedStateFlags;
+    };
+#else
+    UCHAR CalloutActive;
+#endif
+    UCHAR Iopl;
+    PVOID Win32Thread;
+    PVOID StackBase;
+    union
+    {
+        KAPC SuspendApc;
+        struct
+        {
+            UCHAR SuspendApcFill0[1];
+            CHAR Quantum;
+        };
+        struct
+        {
+            UCHAR SuspendApcFill1[3];
+            UCHAR QuantumReset;
+        };
+        struct
+        {
+            UCHAR SuspendApcFill2[4];
+            ULONG KernelTime;
+        };
+        struct
+        {
+            UCHAR SuspendApcFill3[36];
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+            PKPRCB WaitPrcb;
+#else
+            PVOID TlsArray;
+#endif
+        };
+        struct
+        {
+            UCHAR SuspendApcFill4[40];
+            PVOID LegoData;
+        };
+        struct
+        {
+            UCHAR SuspendApcFill5[47];
+            UCHAR PowerState;
+        };
+    };
+    ULONG UserTime;
+    union
+    {
+        KSEMAPHORE SuspendSemaphore;
+        UCHAR SuspendSemaphorefill[20];
+    };
+    ULONG SListFaultCount;
+    LIST_ENTRY ThreadListEntry;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    LIST_ENTRY MutantListHead;
+#endif
+    PVOID SListFaultAddress;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    PVOID MdlForLockedteb;
+#endif
+} KTHREAD;
 #include <poppack.h>
 
 //
@@ -655,46 +873,55 @@ typedef struct _KTHREAD
 //
 typedef struct _KPROCESS
 {
-    DISPATCHER_HEADER     Header;                    /* 000 */
-    LIST_ENTRY            ProfileListHead;           /* 010 */
-    PHYSICAL_ADDRESS      DirectoryTableBase;        /* 018 */
+    DISPATCHER_HEADER Header;
+    LIST_ENTRY ProfileListHead;
+    PHYSICAL_ADDRESS DirectoryTableBase;
 #if defined(_M_IX86)
-    KGDTENTRY             LdtDescriptor;             /* 020 */
-    KIDTENTRY             Int21Descriptor;           /* 028 */
-    USHORT                IopmOffset;                /* 030 */
-    UCHAR                 Iopl;                      /* 032 */
-    UCHAR                 Unused;                    /* 033 */
+    KGDTENTRY LdtDescriptor;
+    KIDTENTRY Int21Descriptor;
+    USHORT IopmOffset;
+    UCHAR Iopl;
+    UCHAR Unused;
 #endif
-    ULONG                 ActiveProcessors;          /* 034 */
-    ULONG                 KernelTime;                /* 038 */
-    ULONG                 UserTime;                  /* 03C */
-    LIST_ENTRY            ReadyListHead;             /* 040 */
-    LIST_ENTRY            SwapListEntry;             /* 048 */
-    PVOID                 VdmTrapcHandler;           /* 04C */
-    LIST_ENTRY            ThreadListHead;            /* 050 */
-    KSPIN_LOCK            ProcessLock;               /* 058 */
-    KAFFINITY             Affinity;                  /* 05C */
+    ULONG ActiveProcessors;
+    ULONG KernelTime;
+    ULONG UserTime;
+    LIST_ENTRY ReadyListHead;
+    SINGLE_LIST_ENTRY SwapListEntry;
+    PVOID VdmTrapcHandler;
+    LIST_ENTRY ThreadListHead;
+    KSPIN_LOCK ProcessLock;
+    KAFFINITY Affinity;
     union
     {
         struct
         {
-            ULONG         AutoAlignment:1;           /* 060.0 */
-            ULONG         DisableBoost:1;            /* 060.1 */
-            ULONG         DisableQuantum:1;          /* 060.2 */
-            ULONG         ReservedFlags:29;          /* 060.3 */
+            ULONG AutoAlignment:1;
+            ULONG DisableBoost:1;
+            ULONG DisableQuantum:1;
+            ULONG ReservedFlags:29;
         };
-        ULONG             ProcessFlags;              /* 060 */
+        ULONG ProcessFlags;
     };
-    CHAR                  BasePriority;              /* 064 */
-    CHAR                  QuantumReset;              /* 065 */
-    UCHAR                 State;                     /* 066 */
-    UCHAR                 ThreadSeed;                /* 067 */
-    UCHAR                 PowerState;                /* 068 */
-    UCHAR                 IdealNode;                 /* 069 */
-    UCHAR                 Visited;                   /* 06A */
-    KEXECUTE_OPTIONS      Flags;                     /* 06B */
-    ULONG                 StackCount;                /* 06C */
-    LIST_ENTRY            ProcessListEntry;          /* 070 */
+    CHAR BasePriority;
+    CHAR QuantumReset;
+    UCHAR State;
+    UCHAR ThreadSeed;
+    UCHAR PowerState;
+    UCHAR IdealNode;
+    UCHAR Visited;
+    union
+    {
+        KEXECUTE_OPTIONS Flags;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+        UCHAR ExecuteOptions;
+#endif
+    };
+    ULONG StackCount;
+    LIST_ENTRY ProcessListEntry;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    ULONGLONG CycleTime;
+#endif
 } KPROCESS, *PKPROCESS;
 
 //
@@ -714,10 +941,10 @@ typedef struct _KSERVICE_TABLE_DESCRIPTOR
 //
 // Exported Loader Parameter Block
 //
-#ifdef _REACTOS_
-extern LOADER_PARAMETER_BLOCK NTSYSAPI KeLoaderBlock;
+#ifndef _REACTOS_
+extern struct _LOADER_PARAMETER_BLOCK NTSYSAPI *KeLoaderBlock;
 #else
-extern PLOADER_PARAMETER_BLOCK NTSYSAPI KeLoaderBlock;
+extern struct _ROS_LOADER_PARAMETER_BLOCK NTSYSAPI KeLoaderBlock;
 #endif
 
 //
index a43ff6b..179bbfe 100644 (file)
@@ -1,4 +1,4 @@
-/*++ NDK Version: 0095
+/*++ NDK Version: 0098
 
 Copyright (c) Alex Ionescu.  All rights reserved.
 
@@ -12,7 +12,7 @@ Abstract:
 
 Author:
 
-    Alex Ionescu (alex.ionescu@reactos.com)   06-Oct-2004
+    Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
 
 --*/
 
@@ -58,6 +58,11 @@ LdrFindResourceDirectory_U(
     OUT PIMAGE_RESOURCE_DIRECTORY *ResourceDirectory
 );
 
+BOOLEAN
+LdrUnloadAlternateResourceModule(
+    IN PVOID BaseAddress
+);
+
 //
 // Misc. Functions
 //
@@ -70,4 +75,28 @@ LdrGetProcedureAddress(
     OUT PVOID *ProcedureAddress
 );
 
+ULONG
+NTAPI
+LdrRelocateImage(
+    IN PVOID NewBase,
+    IN PUCHAR LoaderName,
+    IN ULONG Success,
+    IN ULONG Conflict,
+    IN ULONG Invalid
+);
+
+NTSTATUS
+LdrLockLoaderLock(
+    IN ULONG Flags,
+    OUT PULONG Disposition OPTIONAL,
+    OUT PULONG Cookie OPTIONAL
+);
+
+NTSTATUS
+NTAPI
+LdrUnlockLoaderLock(
+    IN ULONG Flags,
+    IN ULONG Cookie OPTIONAL
+);
+
 #endif
index 9d60d20..9a751ab 100644 (file)
@@ -1,4 +1,4 @@
-/*++ NDK Version: 0095
+/*++ NDK Version: 0098
 
 Copyright (c) Alex Ionescu.  All rights reserved.
 
@@ -12,7 +12,7 @@ Abstract:
 
 Author:
 
-    Alex Ionescu (alex.ionescu@reactos.com)   06-Oct-2004
+    Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
 
 --*/
 
@@ -27,29 +27,45 @@ Author:
 //
 // Resource Type Levels
 //
-#define RESOURCE_TYPE_LEVEL             0
-#define RESOURCE_NAME_LEVEL             1
-#define RESOURCE_LANGUAGE_LEVEL         2
-#define RESOURCE_DATA_LEVEL             3
+#define RESOURCE_TYPE_LEVEL                     0
+#define RESOURCE_NAME_LEVEL                     1
+#define RESOURCE_LANGUAGE_LEVEL                 2
+#define RESOURCE_DATA_LEVEL                     3
 
 //
 // Loader Data Table Entry Flags
 //
-#define LDRP_STATIC_LINK                0x00000002
-#define LDRP_IMAGE_DLL                  0x00000004
-#define LDRP_LOAD_IN_PROGRESS           0x00001000
-#define LDRP_UNLOAD_IN_PROGRESS         0x00002000
-#define LDRP_ENTRY_PROCESSED            0x00004000
-#define LDRP_ENTRY_INSERTED             0x00008000
-#define LDRP_CURRENT_LOAD               0x00010000
-#define LDRP_FAILED_BUILTIN_LOAD        0x00020000
-#define LDRP_DONT_CALL_FOR_THREADS      0x00040000
-#define LDRP_PROCESS_ATTACH_CALLED      0x00080000
-#define LDRP_DEBUG_SYMBOLS_LOADED       0x00100000
-#define LDRP_IMAGE_NOT_AT_BASE          0x00200000
-#define LDRP_COR_IMAGE                  0x00400000
-#define LDR_COR_OWNS_UNMAP              0x00800000
-#define LDRP_REDIRECTED                 0x10000000
+#define LDRP_STATIC_LINK                        0x00000002
+#define LDRP_IMAGE_DLL                          0x00000004
+#define LDRP_LOAD_IN_PROGRESS                   0x00001000
+#define LDRP_UNLOAD_IN_PROGRESS                 0x00002000
+#define LDRP_ENTRY_PROCESSED                    0x00004000
+#define LDRP_ENTRY_INSERTED                     0x00008000
+#define LDRP_CURRENT_LOAD                       0x00010000
+#define LDRP_FAILED_BUILTIN_LOAD                0x00020000
+#define LDRP_DONT_CALL_FOR_THREADS              0x00040000
+#define LDRP_PROCESS_ATTACH_CALLED              0x00080000
+#define LDRP_DEBUG_SYMBOLS_LOADED               0x00100000
+#define LDRP_IMAGE_NOT_AT_BASE                  0x00200000
+#define LDRP_COR_IMAGE                          0x00400000
+#define LDR_COR_OWNS_UNMAP                      0x00800000
+#define LDRP_REDIRECTED                         0x10000000
+
+//
+// Dll Characteristics for LdrLoadDll
+//
+#define LDR_IGNORE_CODE_AUTHZ_LEVEL             0x00001000
+
+//
+// LdrAddRef Flags
+//
+#define LDR_PIN_MODULE                          0x00000001
+
+//
+// LdrLockLoaderLock Flags
+//
+#define LDR_LOCK_LOADER_LOCK_FLAG_RAISE_STATUS  0x00000001
+#define LDR_LOCK_LOADER_LOCK_FLAG_TRY_ONLY      0x00000002
 
 //
 // Loader Data stored in the PEB
@@ -70,7 +86,7 @@ typedef struct _PEB_LDR_DATA
 //
 typedef struct _LDR_DATA_TABLE_ENTRY
 {
-    LIST_ENTRY InLoadOrderModuleList;
+    LIST_ENTRY InLoadOrderLinks;
     LIST_ENTRY InMemoryOrderModuleList;
     LIST_ENTRY InInitializationOrderModuleList;
     PVOID DllBase;
@@ -107,8 +123,45 @@ typedef struct _LDR_RESOURCE_INFO
 } LDR_RESOURCE_INFO, *PLDR_RESOURCE_INFO;
 
 //
-// LdrAddRef Flags
+// DLL Notifications
 //
-#define LDR_PIN_MODULE                  0x00000001
+typedef struct _LDR_DLL_LOADED_NOTIFICATION_DATA
+{
+    ULONG Flags;
+    PUNICODE_STRING FullDllName;
+    PUNICODE_STRING BaseDllName;
+    PVOID DllBase;
+    ULONG SizeOfImage;
+} LDR_DLL_LOADED_NOTIFICATION_DATA, *PLDR_DLL_LOADED_NOTIFICATION_DATA;
+
+typedef VOID
+(*PLDR_DLL_LOADED_NOTIFICATION_CALLBACK)(
+    IN BOOLEAN Type,
+    IN struct _LDR_DLL_LOADED_NOTIFICATION_DATA *Data
+);
+
+typedef struct _LDR_DLL_LOADED_NOTIFICATION_ENTRY
+{
+    LIST_ENTRY NotificationListEntry;
+    PLDR_DLL_LOADED_NOTIFICATION_CALLBACK Callback;
+} LDR_DLL_LOADED_NOTIFICATION_ENTRY, *PLDR_DLL_LOADED_NOTIFICATION_ENTRY;
+
+//
+// Alternate Resources Support
+//
+typedef struct _ALT_RESOURCE_MODULE
+{
+    LANGID LangId;
+    PVOID ModuleBase;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    PVOID ModuleManifest;
+#endif
+    PVOID AlternateModule;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    HANDLE AlternateFileHandle;
+    ULONG ModuleCheckSum;
+    ULONG ErrorCode;
+#endif
+} ALT_RESOURCE_MODULE, *PALT_RESOURCE_MODULE;
 
 #endif
index d1a6373..055f8ba 100644 (file)
@@ -1,4 +1,4 @@
-/*++ NDK Version: 0095
+/*++ NDK Version: 0098
 
 Copyright (c) Alex Ionescu.  All rights reserved.
 
@@ -12,7 +12,7 @@ Abstract:
 
 Author:
 
-    Alex Ionescu (alex.ionescu@reactos.com)   06-Oct-2004
+    Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
 
 --*/
 
@@ -27,6 +27,7 @@ Author:
 //
 // Native calls
 //
+NTSYSCALLAPI
 NTSTATUS
 NTAPI
 NtAcceptConnectPort(
@@ -38,6 +39,7 @@ NtAcceptConnectPort(
     PREMOTE_PORT_VIEW ClientView OPTIONAL
 );
 
+NTSYSCALLAPI
 NTSTATUS
 NTAPI
 NtCompleteConnectPort(
@@ -58,6 +60,7 @@ NtConnectPort(
     PULONG ConnectionInformationLength OPTIONAL
 );
 
+NTSYSCALLAPI
 NTSTATUS
 NTAPI
 NtCreatePort(
@@ -68,6 +71,7 @@ NtCreatePort(
     ULONG MaxPoolUsage
 );
 
+NTSYSCALLAPI
 NTSTATUS
 NTAPI
 NtCreateWaitablePort(
@@ -78,6 +82,7 @@ NtCreateWaitablePort(
     ULONG NPMessageQueueSize OPTIONAL
 );
 
+NTSYSCALLAPI
 NTSTATUS
 NTAPI
 NtImpersonateClientOfPort(
@@ -85,6 +90,7 @@ NtImpersonateClientOfPort(
     PPORT_MESSAGE ClientMessage
 );
 
+NTSYSCALLAPI
 NTSTATUS
 NTAPI
 NtListenPort(
@@ -92,6 +98,7 @@ NtListenPort(
     PPORT_MESSAGE ConnectionRequest
 );
 
+NTSYSCALLAPI
 NTSTATUS
 NTAPI
 NtQueryInformationPort(
@@ -102,6 +109,7 @@ NtQueryInformationPort(
     PULONG ReturnLength
 );
 
+NTSYSCALLAPI
 NTSTATUS
 NTAPI
 NtReadRequestData(
@@ -113,6 +121,7 @@ NtReadRequestData(
     PULONG ReturnLength
 );
 
+NTSYSCALLAPI
 NTSTATUS
 NTAPI
 NtReplyPort(
@@ -120,6 +129,7 @@ NtReplyPort(
     IN PPORT_MESSAGE LpcReply
 );
 
+NTSYSCALLAPI
 NTSTATUS
 NTAPI
 NtReplyWaitReceivePort(
@@ -129,6 +139,7 @@ NtReplyWaitReceivePort(
     OUT PPORT_MESSAGE ReceiveMessage
 );
 
+NTSYSCALLAPI
 NTSTATUS
 NTAPI
 NtReplyWaitReceivePortEx(
@@ -139,6 +150,7 @@ NtReplyWaitReceivePortEx(
     IN PLARGE_INTEGER Timeout OPTIONAL
 );
 
+NTSYSCALLAPI
 NTSTATUS
 NTAPI
 NtReplyWaitReplyPort(
@@ -146,6 +158,7 @@ NtReplyWaitReplyPort(
     OUT PPORT_MESSAGE ReplyMessage
 );
 
+NTSYSCALLAPI
 NTSTATUS
 NTAPI
 NtRequestPort(
@@ -177,6 +190,7 @@ NtSecureConnectPort(
     PULONG ConnectionInformationLength OPTIONAL
 );
 
+NTSYSCALLAPI
 NTSTATUS
 NTAPI
 NtWriteRequestData(
@@ -188,6 +202,7 @@ NtWriteRequestData(
     PULONG ReturnLength
 );
 
+NTSYSAPI
 NTSTATUS
 NTAPI
 ZwAcceptConnectPort(
@@ -199,13 +214,14 @@ ZwAcceptConnectPort(
     PREMOTE_PORT_VIEW ClientView OPTIONAL
 );
 
+NTSYSAPI
 NTSTATUS
 NTAPI
 ZwCompleteConnectPort(
     HANDLE PortHandle
 );
 
-NTSYSCALLAPI
+NTSYSAPI
 NTSTATUS
 NTAPI
 ZwConnectPort(
@@ -219,6 +235,7 @@ ZwConnectPort(
     PULONG ConnectionInformationLength OPTIONAL
 );
 
+NTSYSAPI
 NTSTATUS
 NTAPI
 ZwCreatePort(
@@ -229,6 +246,7 @@ ZwCreatePort(
     ULONG MaxPoolUsage
 );
 
+NTSYSAPI
 NTSTATUS
 NTAPI
 ZwCreateWaitablePort(
@@ -239,6 +257,7 @@ ZwCreateWaitablePort(
     ULONG NPMessageQueueSize OPTIONAL
 );
 
+NTSYSAPI
 NTSTATUS
 NTAPI
 ZwImpersonateClientOfPort(
@@ -246,6 +265,7 @@ ZwImpersonateClientOfPort(
     PPORT_MESSAGE ClientMessage
 );
 
+NTSYSAPI
 NTSTATUS
 NTAPI
 ZwListenPort(
@@ -253,6 +273,7 @@ ZwListenPort(
     PPORT_MESSAGE ConnectionRequest
 );
 
+NTSYSAPI
 NTSTATUS
 NTAPI
 ZwQueryInformationPort(
@@ -263,6 +284,7 @@ ZwQueryInformationPort(
     PULONG ReturnLength
 );
 
+NTSYSAPI
 NTSTATUS
 NTAPI
 ZwReadRequestData(
@@ -274,6 +296,7 @@ ZwReadRequestData(
     PULONG ReturnLength
 );
 
+NTSYSAPI
 NTSTATUS
 NTAPI
 ZwReplyPort(
@@ -281,6 +304,7 @@ ZwReplyPort(
     IN PPORT_MESSAGE LpcReply
 );
 
+NTSYSAPI
 NTSTATUS
 NTAPI
 ZwReplyWaitReceivePort(
@@ -290,6 +314,7 @@ ZwReplyWaitReceivePort(
     OUT PPORT_MESSAGE ReceiveMessage
 );
 
+NTSYSAPI
 NTSTATUS
 NTAPI
 ZwReplyWaitReceivePortEx(
@@ -300,6 +325,7 @@ ZwReplyWaitReceivePortEx(
     IN PLARGE_INTEGER Timeout OPTIONAL
 );
 
+NTSYSAPI
 NTSTATUS
 NTAPI
 ZwReplyWaitReplyPort(
@@ -307,6 +333,7 @@ ZwReplyWaitReplyPort(
     OUT PPORT_MESSAGE ReplyMessage
 );
 
+NTSYSAPI
 NTSTATUS
 NTAPI
 ZwRequestPort(
@@ -314,7 +341,7 @@ ZwRequestPort(
     IN PPORT_MESSAGE LpcMessage
 );
 
-NTSYSCALLAPI
+NTSYSAPI
 NTSTATUS
 NTAPI
 ZwRequestWaitReplyPort(
@@ -323,7 +350,7 @@ ZwRequestWaitReplyPort(
     IN PPORT_MESSAGE LpcRequest
 );
 
-NTSYSCALLAPI
+NTSYSAPI
 NTSTATUS
 NTAPI
 ZwSecureConnectPort(
@@ -338,6 +365,7 @@ ZwSecureConnectPort(
     PULONG ConnectionInformationLength OPTIONAL
 );
 
+NTSYSAPI
 NTSTATUS
 NTAPI
 ZwWriteRequestData(
index c1fa1bb..63f5068 100644 (file)
@@ -1,4 +1,4 @@
-/*++ NDK Version: 0095
+/*++ NDK Version: 0098
 
 Copyright (c) Alex Ionescu.  All rights reserved.
 
@@ -12,7 +12,7 @@ Abstract:
 
 Author:
 
-    Alex Ionescu (alex.ionescu@reactos.com)   06-Oct-2004
+    Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
 
 --*/
 
@@ -228,7 +228,7 @@ typedef struct _LPCP_CONNECTION_MESSAGE
 #endif
 
 //
-// Client Died LPC Message (FIXME: should go in pstypes.h?)
+// Client Died LPC Message
 //
 typedef struct _CLIENT_DIED_MSG
 {
index 4b05911..75fa3c8 100644 (file)
@@ -1,4 +1,4 @@
-/*++ NDK Version: 0095
+/*++ NDK Version: 0098
 
 Copyright (c) Alex Ionescu.  All rights reserved.
 
@@ -12,7 +12,7 @@ Abstract:
 
 Author:
 
-    Alex Ionescu (alex.ionescu@reactos.com)   06-Oct-2004
+    Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
 
 --*/
 
@@ -29,6 +29,21 @@ Author:
 //
 // Section Functions
 //
+NTSTATUS
+NTAPI
+MmMapViewOfSection(
+    IN PVOID SectionObject,
+    IN PEPROCESS Process,
+    IN OUT PVOID *BaseAddress,
+    IN ULONG ZeroBits,
+    IN ULONG CommitSize,
+    IN OUT PLARGE_INTEGER SectionOffset OPTIONAL,
+    IN OUT PULONG ViewSize,
+    IN SECTION_INHERIT InheritDisposition,
+    IN ULONG AllocationType,
+    IN ULONG Protect
+);
+
 NTSTATUS
 NTAPI
 MmUnmapViewOfSection(
@@ -41,6 +56,14 @@ MmUnmapViewOfSection(
 //
 // Native calls
 //
+NTSYSCALLAPI
+NTSTATUS
+NTAPI
+NtAreMappedFilesTheSame(
+    IN PVOID File1MappedAsAnImage,
+    IN PVOID File2MappedAsFile
+);
+
 NTSYSCALLAPI
 NTSTATUS
 NTAPI
@@ -213,6 +236,14 @@ NtWriteVirtualMemory(
     OUT PULONG NumberOfBytesWritten
 );
 
+NTSYSAPI
+NTSTATUS
+NTAPI
+ZwAreMappedFilesTheSame(
+    IN PVOID File1MappedAsAnImage,
+    IN PVOID File2MappedAsFile
+);
+
 NTSYSAPI
 NTSTATUS
 NTAPI
index 19bc39b..b4a2341 100644 (file)
@@ -1,4 +1,4 @@
-/*++ NDK Version: 0095
+/*++ NDK Version: 0098
 
 Copyright (c) Alex Ionescu.  All rights reserved.
 
@@ -12,7 +12,7 @@ Abstract:
 
 Author:
 
-    Alex Ionescu (alex.ionescu@reactos.com)   06-Oct-2004
+    Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
 
 --*/
 
@@ -200,19 +200,240 @@ typedef struct _SECTION_IMAGE_INFORMATION
 #ifndef NTOS_MODE_USER
 
 //
-// FIXME: REACTOS SPECIFIC HACK IN EPROCESS
+// PTE Structures
 //
-#ifdef _REACTOS_
-typedef struct _MADDRESS_SPACE
+typedef struct _MMPTE
 {
-    struct _MEMORY_AREA *MemoryAreaRoot;
-    FAST_MUTEX Lock;
-    PVOID LowestAddress;
-    struct _EPROCESS* Process;
-    PUSHORT PageTableRefCountTable;
-    ULONG PageTableRefCountTableSize;
-} MADDRESS_SPACE, *PMADDRESS_SPACE;
-#endif
+    union
+    {
+        ULONG Long;
+        HARDWARE_PTE Flush;
+        MMPTE_HARDWARE Hard;
+        MMPTE_PROTOTYPE Proto;
+        MMPTE_SOFTWARE Soft;
+        MMPTE_TRANSITION Trans;
+        MMPTE_SUBSECTION Subsect;
+        MMPTE_LIST List;
+    };
+} MMPTE, *PMMPTE;
+
+//
+// Section Information structure
+//
+typedef struct _MI_EXTRA_IMAGE_INFORMATION
+{
+    ULONG SizeOfHeaders;
+} MI_EXTRA_IMAGE_INFORMATION, *PMI_EXTRA_IMAGE_INFORMATION;
+
+typedef struct _MI_SECTION_IMAGE_INFORMATION
+{
+    SECTION_IMAGE_INFORMATION ExportedImageInformation;
+    MI_EXTRA_IMAGE_INFORMATION InternalImageInformation;
+} MI_SECTION_IMAGE_INFORMATION, *PMI_SECTION_IMAGE_INFORMATION;
+
+//
+// Section Extension Information
+//
+typedef struct _MMEXTEND_INFO
+{
+    ULONGLONG CommittedSize;
+    ULONG ReferenceCount;
+} MMEXTEND_INFO, *PMMEXTEND_INFO;
+
+//
+// Segment and Segment Flags
+//
+typedef struct _SEGMENT_FLAGS
+{
+    ULONG TotalNumberOfPtes4132:10;
+    ULONG ExtraSharedWowSubsections:1;
+    ULONG LargePages:1;
+    ULONG Spare:20;
+} SEGMENT_FLAGS, *PSEGMENT_FLAGS;
+
+typedef struct _SEGMENT
+{
+    struct _CONTROL_AREA *ControlArea;
+    ULONG TotalNumberOfPtes;
+    ULONG NonExtendedPtes;
+    ULONG Spare0;
+    ULONGLONG SizeOfSegment;
+    MMPTE SegmentPteTemplate;
+    ULONG NumberOfCommittedPages;
+    PMMEXTEND_INFO ExtendInfo;
+    SEGMENT_FLAGS SegmentFlags;
+    PVOID BaseAddress;
+    union
+    {
+        ULONG ImageCommitment;
+        PEPROCESS CreatingProcess;
+    } u1;
+    union
+    {
+        PMI_SECTION_IMAGE_INFORMATION ImageInformation;
+        PVOID FirstMappedVa;
+    } u2;
+    PMMPTE PrototypePte;
+    MMPTE ThePtes[1];
+} SEGMENT, *PSEGMENT;
+
+//
+// Event Counter Structure
+//
+typedef struct _EVENT_COUNTER
+{
+    ULONG RefCount;
+    KEVENT Event;
+    LIST_ENTRY ListEntry;
+} EVENT_COUNTER, *PEVENT_COUNTER;
+
+//
+// Flags
+//
+typedef struct _MMSECTION_FLAGS
+{
+    ULONG BeingDeleted:1;
+    ULONG BeingCreated:1;
+    ULONG BeingPurged:1;
+    ULONG NoModifiedWriting:1;
+    ULONG FailAllIo:1;
+    ULONG Image:1;
+    ULONG Based:1;
+    ULONG File:1;
+    ULONG Networked:1;
+    ULONG NoCache:1;
+    ULONG PhysicalMemory:1;
+    ULONG CopyOnWrite:1;
+    ULONG Reserve:1;
+    ULONG Commit:1;
+    ULONG FloppyMedia:1;
+    ULONG WasPurged:1;
+    ULONG UserReference:1;
+    ULONG GlobalMemory:1;
+    ULONG DeleteOnClose:1;
+    ULONG FilePointerNull:1;
+    ULONG DebugSymbolsLoaded:1;
+    ULONG SetMappedFileIoComplete:1;
+    ULONG CollidedFlush:1;
+    ULONG NoChange:1;
+    ULONG filler0:1;
+    ULONG ImageMappedInSystemSpace:1;
+    ULONG UserWritable:1;
+    ULONG Accessed:1;
+    ULONG GlobalOnlyPerSession:1;
+    ULONG Rom:1;
+    ULONG WriteCombined:1;
+    ULONG filler:1;
+} MMSECTION_FLAGS, *PMMSECTION_FLAGS;
+
+typedef struct _MMSUBSECTION_FLAGS
+{
+    ULONG ReadOnly:1;
+    ULONG ReadWrite:1;
+    ULONG SubsectionStatic:1;
+    ULONG GlobalMemory:1;
+    ULONG Protection:5;
+    ULONG Spare:1;
+    ULONG StartingSector4132:10;
+    ULONG SectorEndOffset:12;
+} MMSUBSECTION_FLAGS, *PMMSUBSECTION_FLAGS;
+
+//
+// Control Area Structures
+//
+typedef struct _CONTROL_AREA
+{
+    PSEGMENT Segment;
+    LIST_ENTRY DereferenceList;
+    ULONG NumberOfSectionReferences;
+    ULONG NumberOfPfnReferences;
+    ULONG NumberOfMappedViews;
+    ULONG NumberOfSystemCacheViews;
+    ULONG NumberOfUserReferences;
+    union
+    {
+        ULONG LongFlags;
+        MMSECTION_FLAGS Flags;
+    } u;
+    PFILE_OBJECT FilePointer;
+    PEVENT_COUNTER WaitingForDeletion;
+    USHORT ModifiedWriteCount;
+    USHORT FlushInProgressCount;
+    ULONG WritableUserReferences;
+    ULONG QuadwordPad;
+} CONTROL_AREA, *PCONTROL_AREA;
+
+typedef struct _LARGE_CONTROL_AREA
+{
+    PSEGMENT Segment;
+    LIST_ENTRY DereferenceList;
+    ULONG NumberOfSectionReferences;
+    ULONG NumberOfPfnReferences;
+    ULONG NumberOfMappedViews;
+    ULONG NumberOfSystemCacheViews;
+    ULONG NumberOfUserReferences;
+    union
+    {
+        ULONG LongFlags;
+        MMSECTION_FLAGS Flags;
+    } u;
+    PFILE_OBJECT FilePointer;
+    PEVENT_COUNTER WaitingForDeletion;
+    USHORT ModifiedWriteCount;
+    USHORT FlushInProgressCount;
+    ULONG WritableUserReferences;
+    ULONG QuadwordPad;
+    ULONG StartingFrame;
+    LIST_ENTRY UserGlobalList;
+    ULONG SessionId;
+} LARGE_CONTROL_AREA, *PLARGE_CONTROL_AREA;
+
+//
+// Subsection
+//
+typedef struct _SUBSECTION
+{
+    PCONTROL_AREA ControlArea;
+    union
+    {
+        ULONG LongFlags;
+        MMSUBSECTION_FLAGS SubsectionFlags;
+    } u;
+    ULONG StartingSector;
+    PMMPTE SubsectionBase;
+    ULONG UnusedPtes;
+    ULONG PtesInSubsection;
+    struct _SUBSECTION *NextSubSection;
+} SUBSECTION, *PSUBSECTION;
+
+//
+// Segment Object
+//
+typedef struct _SEGMENT_OBJECT
+{
+    PVOID BaseAddress;
+    ULONG TotalNumberOfPtes;
+    LARGE_INTEGER SizeOfSegment;
+    ULONG NonExtendedPtes;
+    ULONG ImageCommitment;
+    PCONTROL_AREA ControlArea;
+    PSUBSECTION Subsection;
+    PLARGE_CONTROL_AREA LargeControlArea;
+    PMMSECTION_FLAGS MmSectionFlags;
+    PMMSUBSECTION_FLAGS MmSubSectionFlags;
+} SEGMENT_OBJECT, *PSEGMENT_OBJECT;
+
+//
+// Section Object
+//
+typedef struct _SECTION_OBJECT
+{
+    PVOID StartingVa;
+    PVOID EndingVa;
+    PVOID LeftChild;
+    PVOID RightChild;
+    PSEGMENT_OBJECT Segment;
+} SECTION_OBJECT, *PSECTION_OBJECT;
 
 //
 // Generic Address Range Structure
index 27e3c80..35f3d11 100644 (file)
@@ -1,4 +1,4 @@
-/*++ NDK Version: 0095
+/*++ NDK Version: 0098
 
 Copyright (c) Alex Ionescu.  All rights reserved.
 
@@ -12,16 +12,34 @@ Abstract:
 
 Author:
 
-    Alex Ionescu (alex.ionescu@reactos.com)   06-Oct-2004
+    Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
 
 --*/
 
 #ifndef _NTNDK_
 #define _NTNDK_
 
+//
+// Disable some warnings that we'd get on /W4.
+// Only active for compilers which support this feature.
+//
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4001)
+#pragma warning(disable:4201)
+#pragma warning(disable:4115)
+#pragma warning(disable:4214)
+#endif
+
+//
+// Headers needed for NDK
+//
 #include <stdarg.h>         // C Standard Header
 #include <umtypes.h>        // General Definitions
 
+//
+// Type Headers
+//
 #include <cctypes.h>        // Cache Manager Types
 #include <cmtypes.h>        // Configuration Manager Types
 #include <dbgktypes.h>      // User-Mode Kernel Debugging Types
@@ -40,6 +58,9 @@ Author:
 #include <rtltypes.h>       // Runtime Library Types
 #include <setypes.h>        // Security Subsystem Types
 
+//
+// Function Headers
+//
 #include <cmfuncs.h>        // Configuration Manager Functions
 #include <dbgkfuncs.h>      // User-Mode Kernel Debugging Functions
 #include <kdfuncs.h>        // Kernel Debugger Functions
@@ -60,4 +81,7 @@ Author:
 
 #include <asm.h>            // Assembly Offsets
 
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
 #endif // _NTNDK_
index 362fed9..17ef7ae 100644 (file)
@@ -1,4 +1,4 @@
-/*++ NDK Version: 0095
+/*++ NDK Version: 0098
 
 Copyright (c) Alex Ionescu.  All rights reserved.
 
@@ -12,7 +12,7 @@ Abstract:
 
 Author:
 
-    Alex Ionescu (alex.ionescu@reactos.com)   06-Oct-2004
+    Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
 
 --*/
 
index e7f1c6e..c420fab 100644 (file)
@@ -1,4 +1,4 @@
-/*++ NDK Version: 0095
+/*++ NDK Version: 0098
 
 Copyright (c) Alex Ionescu.  All rights reserved.
 
@@ -12,7 +12,7 @@ Abstract:
 
 Author:
 
-    Alex Ionescu (alex.ionescu@reactos.com)   06-Oct-2004
+    Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
 
 --*/
 
@@ -48,6 +48,11 @@ Author:
     (p)->SecurityQualityOfService = NULL;       \
 }
 
+//
+// Number of custom-defined bits that can be attached to a handle
+//
+#define OBJ_HANDLE_TAGBITS                      0x3
+
 //
 // Directory Object Access Rights
 //
@@ -132,7 +137,6 @@ typedef struct _OB_DUMP_CONTROL
 } OB_DUMP_CONTROL, *POB_DUMP_CONTROL;
 
 #ifndef NTOS_MODE_USER
-#ifndef _REACTOS_
 
 //
 // Object Type Callbacks
@@ -208,87 +212,6 @@ typedef NTSTATUS
 
 #else
 
-//
-// FIXME: ReactOS ONLY Object Callbacks
-//
-typedef NTSTATUS
-(NTAPI *OB_OPEN_METHOD)(
-    OB_OPEN_REASON Reason,
-    PVOID ObjectBody,
-    PEPROCESS Process,
-    ULONG HandleCount,
-    ACCESS_MASK GrantedAccess
-);
-
-typedef NTSTATUS
-(NTAPI *OB_PARSE_METHOD)(
-    PVOID Object,
-    PVOID *NextObject,
-    PUNICODE_STRING FullPath,
-    PWSTR *Path,
-    ULONG Attributes
-);
-
-typedef VOID
-(NTAPI *OB_DELETE_METHOD)(
-    PVOID DeletedObject
-);
-
-typedef VOID
-(NTAPI *OB_CLOSE_METHOD)(
-    PVOID ClosedObject,
-    ULONG HandleCount
-);
-
-typedef VOID
-(NTAPI *OB_DUMP_METHOD)(
-    VOID
-);
-
-typedef NTSTATUS
-(NTAPI *OB_OKAYTOCLOSE_METHOD)(
-    VOID
-);
-
-typedef NTSTATUS
-(NTAPI *OB_QUERYNAME_METHOD)(
-    PVOID ObjectBody,
-    POBJECT_NAME_INFORMATION ObjectNameInfo,
-    ULONG Length,
-    PULONG ReturnLength
-);
-
-typedef PVOID
-(NTAPI *OB_FIND_METHOD)(
-    PVOID  WinStaObject,
-    PWSTR  Name,
-    ULONG  Attributes
-);
-
-typedef NTSTATUS
-(NTAPI *OB_SECURITY_METHOD)(
-    PVOID Object,
-    SECURITY_OPERATION_CODE OperationType,
-    SECURITY_INFORMATION SecurityInformation,
-    PSECURITY_DESCRIPTOR NewSecurityDescriptor,
-    PULONG ReturnLength,
-    PSECURITY_DESCRIPTOR *OldSecurityDescriptor,
-    POOL_TYPE PoolType,
-    PGENERIC_MAPPING GenericMapping
-);
-
-typedef NTSTATUS
-(NTAPI *OB_CREATE_METHOD)(
-    PVOID ObjectBody,
-    PVOID Parent,
-    PWSTR RemainingPath,
-    struct _OBJECT_ATTRIBUTES* ObjectAttributes
-);
-
-#endif
-
-#else
-
 //
 // Object Information Types for NtQueryInformationObject
 //
@@ -434,9 +357,6 @@ typedef struct _OBJECT_HEADER_CREATOR_INFO
 //
 typedef struct _OBJECT_HEADER
 {
-#ifdef _REACTOS_
-    LIST_ENTRY Entry; // FIXME: REACTOS ONLY
-#endif
     LONG PointerCount;
     union
     {
index 33ae0d2..44bf815 100644 (file)
@@ -1,4 +1,4 @@
-/*++ NDK Version: 0095
+/*++ NDK Version: 0098
 
 Copyright (c) Alex Ionescu.  All rights reserved.
 
@@ -12,7 +12,7 @@ Abstract:
 
 Author:
 
-    Alex Ionescu (alex.ionescu@reactos.com)   06-Oct-2004
+    Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
 
 --*/
 
index 6b87610..6627aab 100644 (file)
@@ -1,4 +1,4 @@
-/*++ NDK Version: 0095
+/*++ NDK Version: 0098
 
 Copyright (c) Alex Ionescu.  All rights reserved.
 
@@ -12,7 +12,7 @@ Abstract:
 
 Author:
 
-    Alex Ionescu (alex.ionescu@reactos.com)   06-Oct-2004
+    Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
 
 --*/
 
index fdd0e40..a5fe084 100644 (file)
@@ -1,4 +1,4 @@
-/*++ NDK Version: 0095
+/*++ NDK Version: 0098
 
 Copyright (c) Alex Ionescu.  All rights reserved.
 
@@ -12,7 +12,7 @@ Abstract:
 
 Author:
 
-    Alex Ionescu (alex.ionescu@reactos.com)   06-Oct-2004
+    Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
 
 --*/
 
@@ -71,7 +71,7 @@ PsGetThreadWin32Thread(
 VOID 
 NTAPI
 PsEstablishWin32Callouts(
-    PW32_CALLOUT_DATA CalloutData
+    PWIN32_CALLOUTS_FPNS CalloutData
 );
 
 VOID
@@ -297,6 +297,7 @@ NtSetInformationProcess(
     IN ULONG ProcessInformationLength
 );
 
+NTSYSCALLAPI
 NTSYSCALLAPI
 NTSTATUS
 NTAPI
@@ -314,6 +315,7 @@ NtSuspendProcess(
     IN HANDLE ProcessHandle
 );
 
+NTSYSCALLAPI
 NTSTATUS
 NTAPI
 NtSuspendThread(
index c886c68..0d8d6d9 100644 (file)
@@ -1,4 +1,4 @@
-/*++ NDK Version: 0095
+/*++ NDK Version: 0098
 
 Copyright (c) Alex Ionescu.  All rights reserved.
 
@@ -12,7 +12,7 @@ Abstract:
 
 Author:
 
-    Alex Ionescu (alex.ionescu@reactos.com)   06-Oct-2004
+    Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
 
 --*/
 
@@ -76,6 +76,7 @@ extern NTSYSAPI POBJECT_TYPE PsProcessType;
 #define FLG_ENABLE_HANDLE_TYPE_TAGGING          0x01000000
 #define FLG_HEAP_PAGE_ALLOCS                    0x02000000
 #define FLG_DEBUG_INITIAL_COMMAND_EX            0x04000000
+#define FLG_VALID_BITS                          0x07FFFFFF
 
 //
 // Process priority classes
@@ -107,6 +108,11 @@ extern NTSYSAPI POBJECT_TYPE PsProcessType;
 #define PROCESS_PRIORITY_NORMAL                 8
 #define PROCESS_PRIORITY_NORMAL_FOREGROUND      9
 
+//
+// Number of TLS expansion slots
+//
+#define TLS_EXPANSION_SLOTS                     64
+
 //
 // Process Access Types
 //
@@ -123,7 +129,15 @@ extern NTSYSAPI POBJECT_TYPE PsProcessType;
 #define PROCESS_QUERY_INFORMATION               0x0400
 #define PROCESS_SUSPEND_RESUME                  0x0800
 #define PROCESS_QUERY_LIMITED_INFORMATION       0x1000
-#define PROCESS_ALL_ACCESS                      (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0xFFFF)
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+#define PROCESS_ALL_ACCESS                      (STANDARD_RIGHTS_REQUIRED | \
+                                                 SYNCHRONIZE | \
+                                                 0xFFFF)
+#else
+#define PROCESS_ALL_ACCESS                      (STANDARD_RIGHTS_REQUIRED | \
+                                                 SYNCHRONIZE | \
+                                                 0xFFF)
+#endif
 
 
 //
@@ -134,7 +148,9 @@ extern NTSYSAPI POBJECT_TYPE PsProcessType;
 #define JOB_OBJECT_QUERY                        0x4
 #define JOB_OBJECT_TERMINATE                    0x8
 #define JOB_OBJECT_SET_SECURITY_ATTRIBUTES      0x10
-#define JOB_OBJECT_ALL_ACCESS                   (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 31)
+#define JOB_OBJECT_ALL_ACCESS                   (STANDARD_RIGHTS_REQUIRED | \
+                                                 SYNCHRONIZE | \
+                                                 31)
 #endif
 
 #ifdef NTOS_MODE_USER
@@ -223,6 +239,8 @@ typedef enum _THREADINFOCLASS
     ThreadCycleTime,
     ThreadPagePriority,
     ThreadActualBasePriority,
+    ThreadTebInformation,
+    ThreadCSwitchMon,
     MaxThreadInfoClass
 } THREADINFOCLASS;
 
@@ -243,6 +261,68 @@ typedef enum _JOBOBJECTINFOCLASS
     MaxJobObjectInfoClass
 } JOBOBJECTINFOCLASS;
 
+//
+// Power Event Events for Win32K Power Event Callback
+//
+typedef enum _PSPOWEREVENTTYPE
+{
+    PsW32FullWake = 0,
+    PsW32EventCode = 1,
+    PsW32PowerPolicyChanged = 2,
+    PsW32SystemPowerState = 3,
+    PsW32SystemTime = 4,
+    PsW32DisplayState = 5,
+    PsW32CapabilitiesChanged = 6,
+    PsW32SetStateFailed = 7,
+    PsW32GdiOff = 8,
+    PsW32GdiOn = 9,
+    PsW32GdiPrepareResumeUI = 10,
+    PsW32GdiOffRequest = 11,
+    PsW32MonitorOff = 12,
+} PSPOWEREVENTTYPE;
+
+//
+// Power State Tasks for Win32K Power State Callback
+//
+typedef enum _POWERSTATETASK
+{
+    PowerState_BlockSessionSwitch = 0,
+    PowerState_Init = 1,
+    PowerState_QueryApps = 2,
+    PowerState_QueryServices = 3,
+    PowerState_QueryAppsFailed = 4,
+    PowerState_QueryServicesFailed = 5,
+    PowerState_SuspendApps = 6,
+    PowerState_SuspendServices = 7,
+    PowerState_ShowUI = 8,
+    PowerState_NotifyWL = 9,
+    PowerState_ResumeApps = 10,
+    PowerState_ResumeServices = 11,
+    PowerState_UnBlockSessionSwitch = 12,
+    PowerState_End = 13,
+    PowerState_BlockInput = 14,
+    PowerState_UnblockInput = 15,
+} POWERSTATETASK;
+
+//
+// Win32K Job Callback Types
+//
+typedef enum _PSW32JOBCALLOUTTYPE
+{
+   PsW32JobCalloutSetInformation = 0,
+   PsW32JobCalloutAddProcess = 1,
+   PsW32JobCalloutTerminate = 2,
+} PSW32JOBCALLOUTTYPE;
+
+//
+// Win32K Thread Callback Types
+//
+typedef enum _PSW32THREADCALLOUTTYPE
+{
+    PsW32ThreadCalloutInitialize,
+    PsW32ThreadCalloutExit,
+} PSW32THREADCALLOUTTYPE;
+
 //
 // Declare empty structure definitions so that they may be referenced by
 // routines before they are defined
@@ -250,24 +330,94 @@ typedef enum _JOBOBJECTINFOCLASS
 struct _W32THREAD;
 struct _W32PROCESS;
 struct _ETHREAD;
+struct _WIN32_POWEREVENT_PARAMETERS;
+struct _WIN32_POWERSTATE_PARAMETERS;
+struct _WIN32_JOBCALLOUT_PARAMETERS;
+struct _WIN32_OPENMETHOD_PARAMETERS;
+struct _WIN32_OKTOCLOSEMETHOD_PARAMETERS;
+struct _WIN32_CLOSEMETHOD_PARAMETERS;
+struct _WIN32_DELETEMETHOD_PARAMETERS;
+struct _WIN32_PARSEMETHOD_PARAMETERS;
 
 //
 // Win32K Process and Thread Callbacks
 //
 typedef NTSTATUS
-(NTAPI *PW32_PROCESS_CALLBACK)(
+(NTAPI *PKWIN32_PROCESS_CALLOUT)(
     struct _EPROCESS *Process,
     BOOLEAN Create
 );
 
 typedef NTSTATUS
-(NTAPI *PW32_THREAD_CALLBACK)(
+(NTAPI *PKWIN32_THREAD_CALLOUT)(
     struct _ETHREAD *Thread,
-    BOOLEAN Create
+    PSW32THREADCALLOUTTYPE Type
+);
+
+typedef NTSTATUS
+(NTAPI *PKWIN32_GLOBALATOMTABLE_CALLOUT)(
+    VOID
+);
+
+typedef NTSTATUS
+(NTAPI *PKWIN32_POWEREVENT_CALLOUT)(
+    struct _WIN32_POWEREVENT_PARAMETERS *Parameters
+);
+
+typedef NTSTATUS
+(NTAPI *PKWIN32_POWERSTATE_CALLOUT)(
+    struct _WIN32_POWERSTATE_PARAMETERS *Parameters
+);
+
+typedef NTSTATUS
+(NTAPI *PKWIN32_JOB_CALLOUT)(
+    struct _WIN32_JOBCALLOUT_PARAMETERS *Parameters
+);
+
+typedef NTSTATUS
+(NTAPI *PGDI_BATCHFLUSH_ROUTINE)(
+    VOID
+);
+
+typedef NTSTATUS
+(NTAPI *PKWIN32_OPENMETHOD_CALLOUT)(
+    struct _WIN32_OPENMETHOD_PARAMETERS *Parameters
+);
+
+typedef NTSTATUS
+(NTAPI *PKWIN32_OKTOCLOSEMETHOD_CALLOUT)(
+    struct _WIN32_OKTOCLOSEMETHOD_PARAMETERS *Parameters
+);
+
+typedef NTSTATUS
+(NTAPI *PKWIN32_CLOSEMETHOD_CALLOUT)(
+    struct _WIN32_CLOSEMETHOD_PARAMETERS *Parameters
+);
+
+typedef NTSTATUS
+(NTAPI *PKWIN32_DELETEMETHOD_CALLOUT)(
+    struct _WIN32_DELETEMETHOD_PARAMETERS *Parameters
+);
+
+typedef NTSTATUS
+(NTAPI *PKWIN32_PARSEMETHOD_CALLOUT)(
+    struct _WIN32_PARSEMETHOD_PARAMETERS *Parameters
+);
+
+typedef NTSTATUS
+(NTAPI *PKWIN32_WIN32DATACOLLECTION_CALLOUT)(
+    struct _EPROCESS *Process,
+    PVOID Callback,
+    PVOID Context
 );
 
 #endif
 
+typedef NTSTATUS
+(NTAPI *PPOST_PROCESS_INIT_ROUTINE)(
+    VOID
+);
+
 #ifdef NTOS_MODE_USER
 
 //
@@ -313,63 +463,112 @@ typedef struct _PEB_FREE_BLOCK
 //
 typedef struct _PEB
 {
-    UCHAR InheritedAddressSpace;                     /* 00h */
-    UCHAR ReadImageFileExecOptions;                  /* 01h */
-    UCHAR BeingDebugged;                             /* 02h */
-    BOOLEAN SpareBool;                               /* 03h */
-    HANDLE Mutant;                                   /* 04h */
-    PVOID ImageBaseAddress;                          /* 08h */
-    PPEB_LDR_DATA Ldr;                               /* 0Ch */
-    struct _RTL_USER_PROCESS_PARAMETERS *ProcessParameters;  /* 10h */
-    PVOID SubSystemData;                             /* 14h */
-    PVOID ProcessHeap;                               /* 18h */
-    PVOID FastPebLock;                               /* 1Ch */
-    PPEBLOCKROUTINE FastPebLockRoutine;              /* 20h */
-    PPEBLOCKROUTINE FastPebUnlockRoutine;            /* 24h */
-    ULONG EnvironmentUpdateCount;                    /* 28h */
-    PVOID* KernelCallbackTable;                      /* 2Ch */
-    PVOID EventLogSection;                           /* 30h */
-    PVOID EventLog;                                  /* 34h */
-    PPEB_FREE_BLOCK FreeList;                        /* 38h */
-    ULONG TlsExpansionCounter;                       /* 3Ch */
-    PVOID TlsBitmap;                                 /* 40h */
-    ULONG TlsBitmapBits[0x2];                        /* 44h */
-    PVOID ReadOnlySharedMemoryBase;                  /* 4Ch */
-    PVOID ReadOnlySharedMemoryHeap;                  /* 50h */
-    PVOID* ReadOnlyStaticServerData;                 /* 54h */
-    PVOID AnsiCodePageData;                          /* 58h */
-    PVOID OemCodePageData;                           /* 5Ch */
-    PVOID UnicodeCaseTableData;                      /* 60h */
-    ULONG NumberOfProcessors;                        /* 64h */
-    ULONG NtGlobalFlag;                              /* 68h */
-    LARGE_INTEGER CriticalSectionTimeout;            /* 70h */
-    ULONG HeapSegmentReserve;                        /* 78h */
-    ULONG HeapSegmentCommit;                         /* 7Ch */
-    ULONG HeapDeCommitTotalFreeThreshold;            /* 80h */
-    ULONG HeapDeCommitFreeBlockThreshold;            /* 84h */
-    ULONG NumberOfHeaps;                             /* 88h */
-    ULONG MaximumNumberOfHeaps;                      /* 8Ch */
-    PVOID* ProcessHeaps;                             /* 90h */
-    PVOID GdiSharedHandleTable;                      /* 94h */
-    PVOID ProcessStarterHelper;                      /* 98h */
-    PVOID GdiDCAttributeList;                        /* 9Ch */
-    PVOID LoaderLock;                                /* A0h */
-    ULONG OSMajorVersion;                            /* A4h */
-    ULONG OSMinorVersion;                            /* A8h */
-    USHORT OSBuildNumber;                            /* ACh */
-    USHORT OSCSDVersion;                             /* AEh */
-    ULONG OSPlatformId;                              /* B0h */
-    ULONG ImageSubSystem;                            /* B4h */
-    ULONG ImageSubSystemMajorVersion;                /* B8h */
-    ULONG ImageSubSystemMinorVersion;                /* BCh */
-    ULONG ImageProcessAffinityMask;                  /* C0h */
-    ULONG GdiHandleBuffer[0x22];                     /* C4h */
-    PVOID PostProcessInitRoutine;                    /* 14Ch */
-    struct _RTL_BITMAP *TlsExpansionBitmap;          /* 150h */
-    ULONG TlsExpansionBitmapBits[0x20];              /* 154h */
-    ULONG SessionId;                                 /* 1D4h */
-    PVOID AppCompatInfo;                             /* 1D8h */
-    UNICODE_STRING CSDVersion;                       /* 1DCh */
+    UCHAR InheritedAddressSpace;
+    UCHAR ReadImageFileExecOptions;
+    UCHAR BeingDebugged;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    struct
+    {
+        UCHAR ImageUsesLargePages:1;
+        UCHAR IsProtectedProcess:1;
+        UCHAR IsLegacyProcess:1;
+        UCHAR SpareBits:5;
+    };
+#else
+    BOOLEAN SpareBool;
+#endif
+    HANDLE Mutant;
+    PVOID ImageBaseAddress;
+    PPEB_LDR_DATA Ldr;
+    struct _RTL_USER_PROCESS_PARAMETERS *ProcessParameters;
+    PVOID SubSystemData;
+    PVOID ProcessHeap;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    struct _RTL_CRITICAL_SECTION *FastPebLock;
+    PVOID AltThunkSListPtr;
+    PVOID IFEOKey;
+    ULONG Spare;
+    union
+    {
+        PVOID* KernelCallbackTable;
+        PVOID UserSharedInfoPtr;
+    };
+    ULONG SystemReserved[1];
+    ULONG SpareUlong;
+#else
+    PVOID FastPebLock;
+    PPEBLOCKROUTINE FastPebLockRoutine;
+    PPEBLOCKROUTINE FastPebUnlockRoutine;
+    ULONG EnvironmentUpdateCount;
+    PVOID* KernelCallbackTable;
+    PVOID EventLogSection;
+    PVOID EventLog;
+#endif
+    PPEB_FREE_BLOCK FreeList;
+    ULONG TlsExpansionCounter;
+    PVOID TlsBitmap;
+    ULONG TlsBitmapBits[0x2];
+    PVOID ReadOnlySharedMemoryBase;
+    PVOID ReadOnlySharedMemoryHeap;
+    PVOID* ReadOnlyStaticServerData;
+    PVOID AnsiCodePageData;
+    PVOID OemCodePageData;
+    PVOID UnicodeCaseTableData;
+    ULONG NumberOfProcessors;
+    ULONG NtGlobalFlag;
+    LARGE_INTEGER CriticalSectionTimeout;
+    ULONG HeapSegmentReserve;
+    ULONG HeapSegmentCommit;
+    ULONG HeapDeCommitTotalFreeThreshold;
+    ULONG HeapDeCommitFreeBlockThreshold;
+    ULONG NumberOfHeaps;
+    ULONG MaximumNumberOfHeaps;
+    PVOID* ProcessHeaps;
+    PVOID GdiSharedHandleTable;
+    PVOID ProcessStarterHelper;
+    PVOID GdiDCAttributeList;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    struct _RTL_CRITICAL_SECTION *LoaderLock;
+#else
+    PVOID LoaderLock;
+#endif
+    ULONG OSMajorVersion;
+    ULONG OSMinorVersion;
+    USHORT OSBuildNumber;
+    USHORT OSCSDVersion;
+    ULONG OSPlatformId;
+    ULONG ImageSubSystem;
+    ULONG ImageSubSystemMajorVersion;
+    ULONG ImageSubSystemMinorVersion;
+    ULONG ImageProcessAffinityMask;
+    ULONG GdiHandleBuffer[0x22];
+    PPOST_PROCESS_INIT_ROUTINE PostProcessInitRoutine;
+    struct _RTL_BITMAP *TlsExpansionBitmap;
+    ULONG TlsExpansionBitmapBits[0x20];
+    ULONG SessionId;
+#if (NTDDI_VERSION >= NTDDI_WINXP)
+    ULARGE_INTEGER AppCompatFlags;
+    ULARGE_INTEGER AppCompatFlagsUser;
+    PVOID pShimData;
+    PVOID AppCompatInfo;
+    UNICODE_STRING CSDVersion;
+    struct _ACTIVATION_CONTEXT_DATA *ActivationContextData;
+    struct _ASSEMBLY_STORAGE_MAP *ProcessAssemblyStorageMap;
+    struct _ACTIVATION_CONTEXT_DATA *SystemDefaultActivationContextData;
+    struct _ASSEMBLY_STORAGE_MAP *SystemAssemblyStorageMap;
+    ULONG MinimumStackCommit;
+#endif
+#if (NTDDI_VERSION >= NTDDI_WS03)
+    PVOID *FlsCallback;
+    LIST_ENTRY FlsListHead;
+    struct _RTL_BITMAP *FlsBitmap;
+    ULONG FlsBitmapBits[4];
+    ULONG FlsHighIndex;
+#endif
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    PVOID WerRegistrationData;
+    PVOID WerShipAssertPtr;
+#endif
 } PEB, *PPEB;
 
 //
@@ -415,77 +614,129 @@ typedef struct _TEB_ACTIVE_FRAME
 //
 typedef struct _TEB
 {
-    NT_TIB Tib;                             /* 00h */
-    PVOID EnvironmentPointer;               /* 1Ch */
-    CLIENT_ID Cid;                          /* 20h */
-    PVOID ActiveRpcHandle;                  /* 28h */
-    PVOID ThreadLocalStoragePointer;        /* 2Ch */
-    struct _PEB *ProcessEnvironmentBlock;   /* 30h */
-    ULONG LastErrorValue;                   /* 34h */
-    ULONG CountOfOwnedCriticalSections;     /* 38h */
-    PVOID CsrClientThread;                  /* 3Ch */
-    PVOID Win32ThreadInfo;                  /* 40h */
-    ULONG User32Reserved[0x1A];             /* 44h */
-    ULONG UserReserved[5];                  /* ACh */
-    PVOID WOW32Reserved;                    /* C0h */
-    LCID CurrentLocale;                     /* C4h */
-    ULONG FpSoftwareStatusRegister;         /* C8h */
-    PVOID SystemReserved1[0x36];            /* CCh */
-    LONG ExceptionCode;                     /* 1A4h */
-    struct _ACTIVATION_CONTEXT_STACK *ActivationContextStackPointer; /* 1A8h */
-    UCHAR SpareBytes1[0x28];                /* 1ACh */
-    GDI_TEB_BATCH GdiTebBatch;              /* 1D4h */
-    CLIENT_ID RealClientId;                 /* 6B4h */
-    PVOID GdiCachedProcessHandle;           /* 6BCh */
-    ULONG GdiClientPID;                     /* 6C0h */
-    ULONG GdiClientTID;                     /* 6C4h */
-    PVOID GdiThreadLocalInfo;               /* 6C8h */
-    ULONG Win32ClientInfo[62];              /* 6CCh */
-    PVOID glDispatchTable[0xE9];            /* 7C4h */
-    ULONG glReserved1[0x1D];                /* B68h */
-    PVOID glReserved2;                      /* BDCh */
-    PVOID glSectionInfo;                    /* BE0h */
-    PVOID glSection;                        /* BE4h */
-    PVOID glTable;                          /* BE8h */
-    PVOID glCurrentRC;                      /* BECh */
-    PVOID glContext;                        /* BF0h */
-    NTSTATUS LastStatusValue;               /* BF4h */
-    UNICODE_STRING StaticUnicodeString;     /* BF8h */
-    WCHAR StaticUnicodeBuffer[0x105];       /* C00h */
-    PVOID DeallocationStack;                /* E0Ch */
-    PVOID TlsSlots[0x40];                   /* E10h */
-    LIST_ENTRY TlsLinks;                    /* F10h */
-    PVOID Vdm;                              /* F18h */
-    PVOID ReservedForNtRpc;                 /* F1Ch */
-    PVOID DbgSsReserved[0x2];               /* F20h */
-    ULONG HardErrorDisabled;                /* F28h */
-    PVOID Instrumentation[14];              /* F2Ch */
-    PVOID SubProcessTag;                    /* F64h */
-    PVOID EtwTraceData;                     /* F68h */
-    PVOID WinSockData;                      /* F6Ch */
-    ULONG GdiBatchCount;                    /* F70h */
-    BOOLEAN InDbgPrint;                     /* F74h */
-    BOOLEAN FreeStackOnTermination;         /* F75h */
-    BOOLEAN HasFiberData;                   /* F76h */
-    UCHAR IdealProcessor;                   /* F77h */
-    ULONG GuaranteedStackBytes;             /* F78h */
-    PVOID ReservedForPerf;                  /* F7Ch */
-    PVOID ReservedForOle;                   /* F80h */
-    ULONG WaitingOnLoaderLock;              /* F84h */
-    ULONG SparePointer1;                    /* F88h */
-    ULONG SoftPatchPtr1;                    /* F8Ch */
-    ULONG SoftPatchPtr2;                    /* F90h */
-    PVOID *TlsExpansionSlots;               /* F94h */
-    ULONG ImpersionationLocale;             /* F98h */
-    ULONG IsImpersonating;                  /* F9Ch */
-    PVOID NlsCache;                         /* FA0h */
-    PVOID pShimData;                        /* FA4h */
-    ULONG HeapVirualAffinity;               /* FA8h */
-    PVOID CurrentTransactionHandle;         /* FACh */
-    PTEB_ACTIVE_FRAME ActiveFrame;          /* FB0h */
-    PVOID FlsData;                          /* FB4h */
-    UCHAR SafeThunkCall;                    /* FB8h */
-    UCHAR BooleanSpare[3];                  /* FB9h */
+    NT_TIB Tib;
+    PVOID EnvironmentPointer;
+    CLIENT_ID Cid;
+    PVOID ActiveRpcHandle;
+    PVOID ThreadLocalStoragePointer;
+    struct _PEB *ProcessEnvironmentBlock;
+    ULONG LastErrorValue;
+    ULONG CountOfOwnedCriticalSections;
+    PVOID CsrClientThread;
+    struct _W32THREAD* Win32ThreadInfo;
+    ULONG User32Reserved[0x1A];
+    ULONG UserReserved[5];
+    PVOID WOW32Reserved;
+    LCID CurrentLocale;
+    ULONG FpSoftwareStatusRegister;
+    PVOID SystemReserved1[0x36];
+    LONG ExceptionCode;
+    struct _ACTIVATION_CONTEXT_STACK *ActivationContextStackPointer;
+    UCHAR SpareBytes1[0x24];
+    ULONG TxFsContext;
+    GDI_TEB_BATCH GdiTebBatch;
+    CLIENT_ID RealClientId;
+    PVOID GdiCachedProcessHandle;
+    ULONG GdiClientPID;
+    ULONG GdiClientTID;
+    PVOID GdiThreadLocalInfo;
+    ULONG Win32ClientInfo[62];
+    PVOID glDispatchTable[0xE9];
+    ULONG glReserved1[0x1D];
+    PVOID glReserved2;
+    PVOID glSectionInfo;
+    PVOID glSection;
+    PVOID glTable;
+    PVOID glCurrentRC;
+    PVOID glContext;
+    NTSTATUS LastStatusValue;
+    UNICODE_STRING StaticUnicodeString;
+    WCHAR StaticUnicodeBuffer[0x105];
+    PVOID DeallocationStack;
+    PVOID TlsSlots[0x40];
+    LIST_ENTRY TlsLinks;
+    PVOID Vdm;
+    PVOID ReservedForNtRpc;
+    PVOID DbgSsReserved[0x2];
+    ULONG HardErrorDisabled;
+    PVOID Instrumentation[9];
+    GUID ActivityId;
+    PVOID SubProcessTag;
+    PVOID EtwTraceData;
+    PVOID WinSockData;
+    ULONG GdiBatchCount;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    BOOLEAN SpareBool0;
+    BOOLEAN SpareBool1;
+    BOOLEAN SpareBool2;
+#else
+    BOOLEAN InDbgPrint;
+    BOOLEAN FreeStackOnTermination;
+    BOOLEAN HasFiberData;
+#endif
+    UCHAR IdealProcessor;
+    ULONG GuaranteedStackBytes;
+    PVOID ReservedForPerf;
+    PVOID ReservedForOle;
+    ULONG WaitingOnLoaderLock;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    PVOID SavedPriorityState;
+#else
+    ULONG SparePointer1;
+#endif
+    ULONG SoftPatchPtr1;
+    ULONG SoftPatchPtr2;
+    PVOID *TlsExpansionSlots;
+    ULONG ImpersionationLocale;
+    ULONG IsImpersonating;
+    PVOID NlsCache;
+    PVOID pShimData;
+    ULONG HeapVirualAffinity;
+    PVOID CurrentTransactionHandle;
+    PTEB_ACTIVE_FRAME ActiveFrame;
+#if (NTDDI_VERSION >= NTDDI_WS03)
+    PVOID FlsData;
+#endif
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    PVOID PreferredLangauges;
+    PVOID UserPrefLanguages;
+    PVOID MergedPrefLanguages;
+    ULONG MuiImpersonation;
+    union
+    {
+        struct
+        {
+            USHORT SpareCrossTebFlags:16;
+        };
+        USHORT CrossTebFlags;
+    };
+    union
+    {
+        struct
+        {
+            USHORT DbgSafeThunkCall:1;
+            USHORT DbgInDebugPrint:1;
+            USHORT DbgHasFiberData:1;
+            USHORT DbgSkipThreadAttach:1;
+            USHORT DbgWerInShipAssertCode:1;
+            USHORT DbgIssuedInitialBp:1;
+            USHORT DbgClonedThread:1;
+            USHORT SpareSameTebBits:9;
+        };
+        USHORT SameTebFlags;
+    };
+    PVOID TxnScopeEntercallback;
+    PVOID TxnScopeExitCAllback;
+    PVOID TxnScopeContext;
+    ULONG LockCount;
+    ULONG ProcessRundown;
+    ULONGLONG LastSwitchTime;
+    ULONGLONG TotalSwitchOutTime;
+    LARGE_INTEGER WaitReasonBitMap;
+#else
+    UCHAR SafeThunkCall;
+    UCHAR BooleanSpare[3];
+#endif
 } TEB, *PTEB;
 
 #ifdef NTOS_MODE_USER
@@ -543,7 +794,7 @@ typedef struct _PROCESS_SESSION_INFORMATION
 typedef struct _PROCESS_PRIORITY_CLASS
 {
     BOOLEAN Foreground;
-    UCHAR   PriorityClass;
+    UCHAR PriorityClass;
 } PROCESS_PRIORITY_CLASS, *PPROCESS_PRIORITY_CLASS;
 
 //
@@ -581,7 +832,7 @@ typedef struct _EPROCESS_QUOTA_BLOCK
 } EPROCESS_QUOTA_BLOCK, *PEPROCESS_QUOTA_BLOCK;
 
 //
-// FIXME: This really belongs in mmtypes.h
+// Process Pagefault History
 //
 typedef struct _PAGEFAULT_HISTORY
 {
@@ -612,253 +863,372 @@ typedef struct _TERMINATION_PORT
     PVOID Port;
 } TERMINATION_PORT, *PTERMINATION_PORT;
 
+//
+// Per-Process APC Rate Limiting
+//
+typedef struct _PSP_RATE_APC
+{
+    union
+    {
+        SINGLE_LIST_ENTRY NextApc;
+        ULONGLONG ExcessCycles;
+    };
+    ULONGLONG TargetGEneration;
+    KAPC RateApc;
+} PSP_RATE_APC, *PPSP_RATE_APC;
+
 //
 // Executive Thread (ETHREAD)
 //
 #include <pshpack4.h>
 typedef struct _ETHREAD
 {
-    KTHREAD                        Tcb;                         /* 000 */
-    PVOID                          Padding;                     /* 1B4 */
-    LARGE_INTEGER                  CreateTime;                  /* 1B8 */
+    KTHREAD Tcb;
+    PVOID Padding;
+    LARGE_INTEGER CreateTime;
     union
     {
-        LARGE_INTEGER              ExitTime;                    /* 1C0 */
-        LIST_ENTRY                 LpcReplyChain;               /* 1C0 */
-        LIST_ENTRY                 KeyedWaitChain;              /* 1C0 */
+        LARGE_INTEGER ExitTime;
+        LIST_ENTRY LpcReplyChain;
+        LIST_ENTRY KeyedWaitChain;
     };
     union
     {
-        NTSTATUS                   ExitStatus;                  /* 1C8 */
-        PVOID                      OfsChain;                    /* 1C8 */
+        NTSTATUS ExitStatus;
+        PVOID OfsChain;
     };
-    LIST_ENTRY                     PostBlockList;               /* 1CC */
+    LIST_ENTRY PostBlockList;
     union
     {
-        struct _TERMINATION_PORT   *TerminationPort;            /* 1D4 */
-        struct _ETHREAD            *ReaperLink;                 /* 1D4 */
-        PVOID                      KeyedWaitValue;              /* 1D4 */
+        struct _TERMINATION_PORT *TerminationPort;
+        struct _ETHREAD *ReaperLink;
+        PVOID KeyedWaitValue;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+        PVOID Win32StartParameter;
+#endif
     };
-    KSPIN_LOCK                     ActiveTimerListLock;         /* 1D8 */
-    LIST_ENTRY                     ActiveTimerListHead;         /* 1DC */
-    CLIENT_ID                      Cid;                         /* 1E4 */
+    KSPIN_LOCK ActiveTimerListLock;
+    LIST_ENTRY ActiveTimerListHead;
+    CLIENT_ID Cid;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    KSEMAPHORE KeyedWaitSemaphore;
+#else
     union
     {
-        KSEMAPHORE                 LpcReplySemaphore;           /* 1EC */
-        KSEMAPHORE                 KeyedReplySemaphore;         /* 1EC */
+        KSEMAPHORE LpcReplySemaphore;
+        KSEMAPHORE KeyedReplySemaphore;
     };
     union
     {
-        PVOID                      LpcReplyMessage;             /* 200 */
-        PVOID                      LpcWaitingOnPort;            /* 200 */
+        PVOID LpcReplyMessage;
+        PVOID LpcWaitingOnPort;
     };
-    PPS_IMPERSONATION_INFORMATION  ImpersonationInfo;           /* 204 */
-    LIST_ENTRY                     IrpList;                     /* 208 */
-    ULONG                          TopLevelIrp;                 /* 210 */
-    PDEVICE_OBJECT                 DeviceToVerify;              /* 214 */
-    struct _EPROCESS               *ThreadsProcess;             /* 218 */
-    PKSTART_ROUTINE                StartAddress;                /* 21C */
+#endif
+    PPS_IMPERSONATION_INFORMATION ImpersonationInfo;
+    LIST_ENTRY IrpList;
+    ULONG TopLevelIrp;
+    PDEVICE_OBJECT DeviceToVerify;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    PPSP_RATE_APC RateControlApc;
+#else
+    struct _EPROCESS *ThreadsProcess;
+#endif
+    PVOID Win32StartAddress;
     union
     {
-        PVOID                      Win32StartAddress;           /* 220 */
-        ULONG                      LpcReceivedMessageId;        /* 220 */
+        PKSTART_ROUTINE StartAddress;
+        ULONG LpcReceivedMessageId;
     };
-    LIST_ENTRY                     ThreadListEntry;             /* 224 */
-    EX_RUNDOWN_REF                 RundownProtect;              /* 22C */
-    EX_PUSH_LOCK                   ThreadLock;                  /* 230 */
-    ULONG                          LpcReplyMessageId;           /* 234 */
-    ULONG                          ReadClusterSize;             /* 238 */
-    ACCESS_MASK                    GrantedAccess;               /* 23C */
+    LIST_ENTRY ThreadListEntry;
+    EX_RUNDOWN_REF RundownProtect;
+    EX_PUSH_LOCK ThreadLock;
+#if (NTDDI_VERSION < NTDDI_LONGHORN)
+    ULONG LpcReplyMessageId;
+#endif
+    ULONG ReadClusterSize;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    ULONG SpareUlong0;
+#else
+    ACCESS_MASK GrantedAccess;
+#endif
     union
     {
         struct
         {
-           ULONG                   Terminated:1;
-           ULONG                   DeadThread:1;
-           ULONG                   HideFromDebugger:1;
-           ULONG                   ActiveImpersonationInfo:1;
-           ULONG                   SystemThread:1;
-           ULONG                   HardErrorsAreDisabled:1;
-           ULONG                   BreakOnTermination:1;
-           ULONG                   SkipCreationMsg:1;
-           ULONG                   SkipTerminationMsg:1;
+           ULONG Terminated:1;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+           ULONG ThreadInserted:1;
+#else
+           ULONG DeadThread:1;
+#endif
+           ULONG HideFromDebugger:1;
+           ULONG ActiveImpersonationInfo:1;
+           ULONG SystemThread:1;
+           ULONG HardErrorsAreDisabled:1;
+           ULONG BreakOnTermination:1;
+           ULONG SkipCreationMsg:1;
+           ULONG SkipTerminationMsg:1;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+           ULONG CreateMsgSent:1;
+           ULONG ThreadIoPriority:3;
+           ULONG ThreadPagePriority:3;
+           ULONG PendingRatecontrol:1;
+#endif
         };
-        ULONG                      CrossThreadFlags;            /* 240 */
+        ULONG CrossThreadFlags;
     };
     union
     {
         struct
         {
-           ULONG                   ActiveExWorker:1;
-           ULONG                   ExWorkerCanWaitUser:1;
-           ULONG                   MemoryMaker:1;
-           ULONG                   KeyedEventInUse:1;
+           ULONG ActiveExWorker:1;
+           ULONG ExWorkerCanWaitUser:1;
+           ULONG MemoryMaker:1;
+           ULONG KeyedEventInUse:1;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+           ULONG RateApcState:2;
+#endif
         };
-        ULONG                      SameThreadPassiveFlags;      /* 244 */
+        ULONG SameThreadPassiveFlags;
     };
     union
     {
         struct
         {
-           ULONG                   LpcReceivedMsgIdValid:1;
-           ULONG                   LpcExitThreadCalled:1;
-           ULONG                   AddressSpaceOwner:1;
-           ULONG                   OwnsProcessWorkingSetExclusive:1;
-           ULONG                   OwnsProcessWorkingSetShared:1;
-           ULONG                   OwnsSystemWorkingSetExclusive:1;
-           ULONG                   OwnsSystemWorkingSetShared:1;
-           ULONG                   OwnsSessionWorkingSetExclusive:1;
-           ULONG                   OwnsSessionWorkingSetShared:1;
-           ULONG                   ApcNeeded:1;
+           ULONG LpcReceivedMsgIdValid:1;
+           ULONG LpcExitThreadCalled:1;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+           ULONG Spare:1;
+#else
+           ULONG AddressSpaceOwner:1;
+#endif
+           ULONG OwnsProcessWorkingSetExclusive:1;
+           ULONG OwnsProcessWorkingSetShared:1;
+           ULONG OwnsSystemWorkingSetExclusive:1;
+           ULONG OwnsSystemWorkingSetShared:1;
+           ULONG OwnsSessionWorkingSetExclusive:1;
+           ULONG OwnsSessionWorkingSetShared:1;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+           ULONG SupressSymbolLoad:1;
+           ULONG Spare1:3;
+           ULONG PriorityRegionActive:4;
+#else
+           ULONG ApcNeeded:1;
+#endif
         };
-        ULONG                      SameThreadApcFlags;          /* 248 */
+        ULONG SameThreadApcFlags;
     };
-    UCHAR                          ForwardClusterOnly;          /* 24C */
-    UCHAR                          DisablePageFaultClustering;  /* 24D */
-    UCHAR                          ActiveFaultCount;            /* 24E */
-} ETHREAD;
-
-#if defined(_NTOSKRNL_)
-    #include <internal/mm.h>
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    UCHAR CacheManagerActive;
+#else
+    UCHAR ForwardClusterOnly;
 #endif
+    UCHAR DisablePageFaultClustering;
+    UCHAR ActiveFaultCount;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    ULONG AlpcMessageId;
+    union
+    {
+        PVOID AlpcMessage;
+        ULONG AlpcReceiveAttributeSet;
+    };
+    LIST_ENTRY AlpcWaitListEntry;
+    KSEMAPHORE AlpcWaitSemaphore;
+    ULONG CacheManagerCount;
+#endif
+} ETHREAD;
 
 //
 // Executive Process (EPROCESS)
 //
 typedef struct _EPROCESS
 {
-    KPROCESS              Pcb;                          /* 000 */
-    EX_PUSH_LOCK          ProcessLock;                  /* 078 */
-    LARGE_INTEGER         CreateTime;                   /* 080 */
-    LARGE_INTEGER         ExitTime;                     /* 088 */
-    EX_RUNDOWN_REF        RundownProtect;               /* 090 */
-    HANDLE                UniqueProcessId;              /* 094 */
-    LIST_ENTRY            ActiveProcessLinks;           /* 098 */
-    ULONG                 QuotaUsage[3];                /* 0A0 */
-    ULONG                 QuotaPeak[3];                 /* 0AC */
-    ULONG                 CommitCharge;                 /* 0B8 */
-    ULONG                 PeakVirtualSize;              /* 0BC */
-    ULONG                 VirtualSize;                  /* 0C0 */
-    LIST_ENTRY            SessionProcessLinks;          /* 0C4 */
-    PVOID                 DebugPort;                    /* 0CC */
-    PVOID                 ExceptionPort;                /* 0D0 */
-    PHANDLE_TABLE         ObjectTable;                  /* 0D4 */
-    EX_FAST_REF           Token;                        /* 0D8 */
-    ULONG                 WorkingSetPage;               /* 0DC */
-    KGUARDED_MUTEX        AddressCreationLock;          /* 0E0 */
-    KSPIN_LOCK            HyperSpaceLock;               /* 100 */
-    PETHREAD              ForkInProgress;               /* 104 */
-    ULONG                 HardwareTrigger;              /* 108 */
-    MM_AVL_TABLE          PhysicalVadroot;              /* 10C */
-    PVOID                 CloneRoot;                    /* 110 */
-    ULONG                 NumberOfPrivatePages;         /* 114 */
-    ULONG                 NumberOfLockedPages;          /* 118 */
-    PVOID                 *Win32Process;                /* 11C */
-    struct _EJOB          *Job;                         /* 120 */
-    PVOID                 SectionObject;                /* 124 */
-    PVOID                 SectionBaseAddress;           /* 128 */
-    PEPROCESS_QUOTA_BLOCK QuotaBlock;                   /* 12C */
-    PPAGEFAULT_HISTORY    WorkingSetWatch;              /* 130 */
-    PVOID                 Win32WindowStation;           /* 134 */
-    HANDLE                InheritedFromUniqueProcessId; /* 138 */
-    PVOID                 LdtInformation;               /* 13C */
-    PVOID                 VadFreeHint;                  /* 140 */
-    PVOID                 VdmObjects;                   /* 144 */
-    PVOID                 DeviceMap;                    /* 148 */
-    PVOID                 Spare0[3];                    /* 14C */
+    KPROCESS Pcb;
+    EX_PUSH_LOCK ProcessLock;
+    LARGE_INTEGER CreateTime;
+    LARGE_INTEGER ExitTime;
+    EX_RUNDOWN_REF RundownProtect;
+    HANDLE UniqueProcessId;
+    LIST_ENTRY ActiveProcessLinks;
+    ULONG QuotaUsage[3];
+    ULONG QuotaPeak[3];
+    ULONG CommitCharge;
+    ULONG PeakVirtualSize;
+    ULONG VirtualSize;
+    LIST_ENTRY SessionProcessLinks;
+    PVOID DebugPort;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
     union
     {
-        HARDWARE_PTE_X86  PagedirectoryPte;             /* 158 */
-        ULONGLONG         Filler;                       /* 158 */
+        PVOID ExceptionPortData;
+        ULONG ExceptionPortValue;
+        UCHAR ExceptionPortState:3;
     };
-    ULONG                 Session;                      /* 160 */
-    CHAR                  ImageFileName[16];            /* 164 */
-    LIST_ENTRY            JobLinks;                     /* 174 */
-    PVOID                 LockedPagesList;              /* 17C */
-    LIST_ENTRY            ThreadListHead;               /* 184 */
-    PVOID                 SecurityPort;                 /* 188 */
-    PVOID                 PaeTop;                       /* 18C */
-    ULONG                 ActiveThreads;                /* 190 */
-    ACCESS_MASK           GrantedAccess;                /* 194 */
-    ULONG                 DefaultHardErrorProcessing;   /* 198 */
-    NTSTATUS              LastThreadExitStatus;         /* 19C */
-    struct _PEB*          Peb;                          /* 1A0 */
-    EX_FAST_REF           PrefetchTrace;                /* 1A4 */
-    LARGE_INTEGER         ReadOperationCount;           /* 1A8 */
-    LARGE_INTEGER         WriteOperationCount;          /* 1B0 */
-    LARGE_INTEGER         OtherOperationCount;          /* 1B8 */
-    LARGE_INTEGER         ReadTransferCount;            /* 1C0 */
-    LARGE_INTEGER         WriteTransferCount;           /* 1C8 */
-    LARGE_INTEGER         OtherTransferCount;           /* 1D0 */
-    ULONG                 CommitChargeLimit;            /* 1D8 */
-    ULONG                 CommitChargePeak;             /* 1DC */
-    PVOID                 AweInfo;                      /* 1E0 */
-    SE_AUDIT_PROCESS_CREATION_INFO SeAuditProcessCreationInfo; /* 1E4 */
-    MMSUPPORT             Vm;                           /* 1E8 */
-    LIST_ENTRY            MmProcessLinks;               /* 230 */
-    ULONG                 ModifiedPageCount;            /* 238 */
-    ULONG                 JobStatus;                    /* 23C */
+#else
+    PVOID ExceptionPort;
+#endif
+    PHANDLE_TABLE ObjectTable;
+    EX_FAST_REF Token;
+    ULONG WorkingSetPage;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    EX_PUSH_LOCK AddressCreationLock;
+    PETHREAD RotateInProgress;
+#else
+    KGUARDED_MUTEX AddressCreationLock;
+    KSPIN_LOCK HyperSpaceLock;
+#endif
+    PETHREAD ForkInProgress;
+    ULONG HardwareTrigger;
+    MM_AVL_TABLE PhysicalVadroot;
+    PVOID CloneRoot;
+    ULONG NumberOfPrivatePages;
+    ULONG NumberOfLockedPages;
+    PVOID *Win32Process;
+    struct _EJOB *Job;
+    PVOID SectionObject;
+    PVOID SectionBaseAddress;
+    PEPROCESS_QUOTA_BLOCK QuotaBlock;
+    PPAGEFAULT_HISTORY WorkingSetWatch;
+    PVOID Win32WindowStation;
+    HANDLE InheritedFromUniqueProcessId;
+    PVOID LdtInformation;
+    PVOID VadFreeHint;
+    PVOID VdmObjects;
+    PVOID DeviceMap;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    ULONG AlpcPagedPoolQuotaCache;
+    PVOID EtwDataSource;
+    PVOID FreeTebHint;
+#else
+    PVOID Spare0[3];
+#endif
+    union
+    {
+        HARDWARE_PTE_X86 PagedirectoryPte;
+        ULONGLONG Filler;
+    };
+    ULONG Session;
+    CHAR ImageFileName[16];
+    LIST_ENTRY JobLinks;
+    PVOID LockedPagesList;
+    LIST_ENTRY ThreadListHead;
+    PVOID SecurityPort;
+    PVOID PaeTop;
+    ULONG ActiveThreads;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+    ULONG ImagePathHash;
+#else
+    ACCESS_MASK GrantedAccess;
+#endif
+    ULONG DefaultHardErrorProcessing;
+    NTSTATUS LastThreadExitStatus;
+    struct _PEB* Peb;
+    EX_FAST_REF PrefetchTrace;
+    LARGE_INTEGER ReadOperationCount;
+    LARGE_INTEGER WriteOperationCount;
+    LARGE_INTEGER OtherOperationCount;
+    LARGE_INTEGER ReadTransferCount;
+    LARGE_INTEGER WriteTransferCount;
+    LARGE_INTEGER OtherTransferCount;
+    ULONG CommitChargeLimit;
+    ULONG CommitChargePeak;
+    PVOID AweInfo;
+    SE_AUDIT_PROCESS_CREATION_INFO SeAuditProcessCreationInfo;
+    MMSUPPORT Vm;
+    LIST_ENTRY MmProcessLinks;
+    ULONG ModifiedPageCount;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
     union
     {
         struct
         {
-            ULONG         CreateReported:1;
-            ULONG         NoDebugInherit:1;
-            ULONG         ProcessExiting:1;
-            ULONG         ProcessDelete:1;
-            ULONG         Wow64SplitPages:1;
-            ULONG         VmDeleted:1;
-            ULONG         OutswapEnabled:1;
-            ULONG         Outswapped:1;
-            ULONG         ForkFailed:1;
-            ULONG         Wow64VaSpace4Gb:1;
-            ULONG         AddressSpaceInitialized:2;
-            ULONG         SetTimerResolution:1;
-            ULONG         BreakOnTermination:1;
-            ULONG         SessionCreationUnderway:1;
-            ULONG         WriteWatch:1;
-            ULONG         ProcessInSession:1;
-            ULONG         OverrideAddressSpace:1;
-            ULONG         HasAddressSpace:1;
-            ULONG         LaunchPrefetched:1;
-            ULONG         InjectInpageErrors:1;
-            ULONG         VmTopDown:1;
-            ULONG         ImageNotifyDone:1;
-            ULONG         PdeUpdateNeeded:1;
-            ULONG         VdmAllowed:1;
-            ULONG         SmapAllowed:1;
-            ULONG         CreateFailed:1;
-            ULONG         DefaultIoPriority:3;
-            ULONG         Spare1:1;
-            ULONG         Spare2:1;
+            ULONG JobNotReallyActive:1;
+            ULONG AccountingFolded:1;
+            ULONG NewProcessReported:1;
+            ULONG ExitProcessReported:1;
+            ULONG ReportCommitChanges:1;
+            ULONG LastReportMemory:1;
+            ULONG ReportPhysicalPageChanges:1;
+            ULONG HandleTableRundown:1;
+            ULONG NeedsHandleRundown:1;
+            ULONG RefTraceEnabled:1;
+            ULONG NumaAware:1;
+            ULONG ProtectedProcess:1;
+            ULONG DefaultPagePriority:3;
+            ULONG ProcessDeleteSelf:1;
+            ULONG ProcessVerifierTarget:1;
         };
-        ULONG             Flags;                        /* 240 */
+        ULONG Flags2;
     };
-
-    NTSTATUS              ExitStatus;                   /* 244 */
-    USHORT                NextPageColor;                /* 248 */
+#else
+    ULONG JobStatus;
+#endif
     union
     {
         struct
         {
-            UCHAR         SubSystemMinorVersion;        /* 24A */
-            UCHAR         SubSystemMajorVersion;        /* 24B */
+            ULONG CreateReported:1;
+            ULONG NoDebugInherit:1;
+            ULONG ProcessExiting:1;
+            ULONG ProcessDelete:1;
+            ULONG Wow64SplitPages:1;
+            ULONG VmDeleted:1;
+            ULONG OutswapEnabled:1;
+            ULONG Outswapped:1;
+            ULONG ForkFailed:1;
+            ULONG Wow64VaSpace4Gb:1;
+            ULONG AddressSpaceInitialized:2;
+            ULONG SetTimerResolution:1;
+            ULONG BreakOnTermination:1;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+            ULONG DeprioritizeViews:1;
+#else
+            ULONG SessionCreationUnderway:1;
+#endif
+            ULONG WriteWatch:1;
+            ULONG ProcessInSession:1;
+            ULONG OverrideAddressSpace:1;
+            ULONG HasAddressSpace:1;
+            ULONG LaunchPrefetched:1;
+            ULONG InjectInpageErrors:1;
+            ULONG VmTopDown:1;
+            ULONG ImageNotifyDone:1;
+            ULONG PdeUpdateNeeded:1;
+            ULONG VdmAllowed:1;
+            ULONG SmapAllowed:1;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+            ULONG ProcessInserted:1;
+#else
+            ULONG CreateFailed:1;
+#endif
+            ULONG DefaultIoPriority:3;