Use W32API for NTOSKRNL.
authorFilip Navara <filip.navara@gmail.com>
Sat, 18 Jun 2005 18:32:29 +0000 (18:32 +0000)
committerFilip Navara <filip.navara@gmail.com>
Sat, 18 Jun 2005 18:32:29 +0000 (18:32 +0000)
svn path=/trunk/; revision=16053

60 files changed:
reactos/drivers/fs/vfat/vfat.h
reactos/hal/halx86/include/hal.h
reactos/include/ddk/halfuncs.h
reactos/include/ddk/ketypes.h
reactos/include/ddk/ntifs.h
reactos/include/ntos/halfuncs.h
reactos/include/ntos/krnltypes.h
reactos/ntoskrnl/cm/cm.h
reactos/ntoskrnl/cm/ntfunc.c
reactos/ntoskrnl/cm/regfile.c
reactos/ntoskrnl/ex/init.c
reactos/ntoskrnl/ex/mutant.c
reactos/ntoskrnl/ex/sysinfo.c
reactos/ntoskrnl/fs/fastio.c
reactos/ntoskrnl/fs/filelock.c
reactos/ntoskrnl/fs/notify.c
reactos/ntoskrnl/include/internal/cc.h
reactos/ntoskrnl/include/internal/debug.h
reactos/ntoskrnl/include/internal/ex.h
reactos/ntoskrnl/include/internal/ifs.h
reactos/ntoskrnl/include/internal/io.h
reactos/ntoskrnl/include/internal/kd.h
reactos/ntoskrnl/include/internal/kdb.h
reactos/ntoskrnl/include/internal/kdbochs.h
reactos/ntoskrnl/include/internal/kdgdb.h
reactos/ntoskrnl/include/internal/ke.h
reactos/ntoskrnl/include/internal/ldr.h
reactos/ntoskrnl/include/internal/mm.h
reactos/ntoskrnl/include/internal/module.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/internal/trap.h
reactos/ntoskrnl/include/ntoskrnl.h
reactos/ntoskrnl/io/disk.c
reactos/ntoskrnl/io/file.c
reactos/ntoskrnl/io/iomgr.c
reactos/ntoskrnl/io/irp.c
reactos/ntoskrnl/io/pnpmgr.c
reactos/ntoskrnl/io/resource.c
reactos/ntoskrnl/kdbg/kdb_cli.c
reactos/ntoskrnl/kdbg/kdb_symbols.c
reactos/ntoskrnl/ke/i386/kernel.c
reactos/ntoskrnl/ke/kthread.c
reactos/ntoskrnl/mm/elf.inc.h
reactos/ntoskrnl/mm/elf32.c
reactos/ntoskrnl/mm/mm.c
reactos/ntoskrnl/mm/pe.c
reactos/ntoskrnl/mm/section.c
reactos/ntoskrnl/ntoskrnl.xml
reactos/ntoskrnl/ob/handle.c
reactos/ntoskrnl/ps/query.c
reactos/ntoskrnl/ps/quota.c
reactos/ntoskrnl/ps/security.c
reactos/ntoskrnl/rtl/i386/exception.c
reactos/ntoskrnl/rtl/misc.c
reactos/ntoskrnl/se/access.c
reactos/subsys/win32k/w32k.h
reactos/w32api/include/ddk/ntifs.h

index c1aff51..a563129 100644 (file)
@@ -17,11 +17,13 @@ NTSTATUS NTAPI RtlUnicodeStringToOemString(POEM_STRING, PCUNICODE_STRING, BOOLEA
 #endif
 
 #ifdef USE_ROS_CC_AND_FS
+#ifndef __INCLUDE_DDK_NTIFS_H
 NTSTATUS STDCALL CcRosInitializeFileCache(PFILE_OBJECT, ULONG);
 NTSTATUS STDCALL CcRosReleaseFileCache(PFILE_OBJECT);
 #define FSCTL_ROS_QUERY_LCN_MAPPING CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 63, METHOD_BUFFERED, FILE_ANY_ACCESS)
 typedef struct _ROS_QUERY_LCN_MAPPING { LARGE_INTEGER LcnDiskOffset; } ROS_QUERY_LCN_MAPPING, *PROS_QUERY_LCN_MAPPING;
 #endif
+#endif
 
 #define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))
 #define ROUND_DOWN(N, S) ((N) - ((N) % (S)))
index f1082ee..f26cf61 100644 (file)
@@ -13,9 +13,7 @@
 #include <stdio.h>
 
 /* FIXME: NDK Headers */
-#include <ntos/types.h>
-#include <ntos/haltypes.h>
-#include <ntos/halfuncs.h>
+#include <roskrnl.h>
 
 /* Internal Kernel Headers */
 //#include <internal/mm.h>
index 25170e7..f2ba785 100644 (file)
@@ -136,10 +136,6 @@ HalSetRealTimeClock(PTIME_FIELDS Time);
 HalSetTimeIncrement
 */
 
-BOOLEAN STDCALL
-HalStartNextProcessor(ULONG Unknown1,
-                     ULONG Unknown2);
-
 /*
 HalStartProfileInterrupt
 */
index 5087f76..bf4759c 100644 (file)
@@ -128,14 +128,6 @@ typedef struct _KEVENT
     DISPATCHER_HEADER Header;
 } KEVENT, *PKEVENT, *RESTRICTED_POINTER PRKEVENT;
 
-typedef struct _KEVENT_PAIR
-{
-   CSHORT Type;
-   CSHORT Size;
-   KEVENT LowEvent;
-   KEVENT HighEvent;
-} KEVENT_PAIR, *PKEVENT_PAIR;
-
 typedef ULONG_PTR KSPIN_LOCK, *PKSPIN_LOCK;
 
 typedef struct _KDEVICE_QUEUE 
index ee28066..86afadc 100644 (file)
@@ -1,17 +1,19 @@
+#ifndef __INCLUDE_DDK_NTIFS_H
+#define __INCLUDE_DDK_NTIFS_H
+
 #ifdef __USE_W32API
 
 #include_next <ddk/ntifs.h>
 
-NTSTATUS STDCALL
-CcRosInitializeFileCache (PFILE_OBJECT FileObject,
-                         ULONG         CacheSegmentSize);
-NTSTATUS STDCALL
-CcRosReleaseFileCache (PFILE_OBJECT    FileObject);
-
 #else /* __USE_W32API */
 
-#ifndef __INCLUDE_DDK_NTIFS_H
-#define __INCLUDE_DDK_NTIFS_H
+#include <ddk/cctypes.h>
+#include <ddk/ccfuncs.h>
+
+#include <ddk/fstypes.h>
+#include <ddk/fsfuncs.h>
+
+#endif
 
 NTSTATUS STDCALL
 CcRosInitializeFileCache (PFILE_OBJECT FileObject,
@@ -27,13 +29,4 @@ typedef struct _ROS_QUERY_LCN_MAPPING
   LARGE_INTEGER LcnDiskOffset;
 } ROS_QUERY_LCN_MAPPING, *PROS_QUERY_LCN_MAPPING;
 
-#include <ddk/cctypes.h>
-
-#include <ddk/ccfuncs.h>
-
-#include <ddk/fstypes.h>
-#include <ddk/fsfuncs.h>
-
 #endif /* __INCLUDE_DDK_NTIFS_H */
-
-#endif /* __USE_W32API */
index 26068c8..889b73a 100755 (executable)
@@ -90,6 +90,10 @@ HalSystemVectorDispatchEntry(ULONG Unknown1,
                             ULONG Unknown2,
                             ULONG Unknown3);
 
+BOOLEAN STDCALL
+HalStartNextProcessor(ULONG Unknown1,
+                     ULONG Unknown2);
+
 VOID
 STDCALL
 IoAssignDriveLetters(IN struct _LOADER_PARAMETER_BLOCK *LoaderBlock,
index f5c2550..a2f3a84 100644 (file)
@@ -119,5 +119,18 @@ typedef struct _KEXCEPTION_FRAME {
     ULONG64 Return;\r
 } KEXCEPTION_FRAME, *PKEXCEPTION_FRAME;\r
 \r
+typedef struct _KEVENT_PAIR\r
+{\r
+    CSHORT Type;\r
+    CSHORT Size;\r
+    KEVENT LowEvent;\r
+    KEVENT HighEvent;\r
+} KEVENT_PAIR, *PKEVENT_PAIR;\r
+\r
+typedef struct _RUNDOWN_DESCRIPTOR {\r
+    ULONG_PTR References;\r
+    KEVENT RundownEvent;\r
+} RUNDOWN_DESCRIPTOR, *PRUNDOWN_DESCRIPTOR;\r
+\r
 #endif /* __INCLUDE_NTOS_KRNLTYPES_H */\r
 \r
index 4fe8c9f..e81fd14 100644 (file)
@@ -424,9 +424,9 @@ typedef enum _REG_NOTIFY_CLASS
 } REG_NOTIFY_CLASS, *PREG_NOTIFY_CLASS;
 
 /* Registry Callback Function */
-typedef NTSTATUS (*PEX_CALLBACK_FUNCTION ) (
+typedef NTSTATUS (STDCALL *PEX_CALLBACK_FUNCTION ) (
     IN PVOID CallbackContext,
-    IN REG_NOTIFY_CLASS Argument1,
+    IN PVOID Argument1,
     IN PVOID Argument2
     );
 
index e3933ae..1c3297d 100644 (file)
@@ -286,7 +286,7 @@ CmiCallRegisteredCallbacks(IN REG_NOTIFY_CLASS Argument1,
       ExReleaseFastMutex(&CmiCallbackLock);
 
       Status = CurrentCallback->Function(CurrentCallback->Context,
-                                         Argument1,
+                                         (PVOID)Argument1,
                                          Argument2);
       if(!NT_SUCCESS(Status))
       {
index 5a8c757..5396a77 100644 (file)
@@ -398,8 +398,6 @@ CmiCreateNewRegFile(HANDLE FileHandle)
 
   ExFreePool(Buffer);
 
-  ASSERTMSG(NT_SUCCESS(Status), ("Status: 0x%X\n", Status));
-
   if (!NT_SUCCESS(Status))
     {
       return(Status);
@@ -688,9 +686,8 @@ CmiImportHiveBins(PREGISTRY_HIVE Hive,
          return STATUS_REGISTRY_CORRUPT;
        }
 
-      ASSERTMSG((Bin->BinSize % REG_BLOCK_SIZE) == 0,
-               ("Bin size (0x%.08x) must be multiple of 4K\n",
-               Bin->BinSize));
+      ASSERTMSG("Bin size must be multiple of 4K\n",
+                (Bin->BinSize % REG_BLOCK_SIZE) == 0);
 
       /* Allocate the hive block */
       Hive->BlockList[BlockIndex].Bin = ExAllocatePool (PagedPool,
index 2d12232..765d0f8 100644 (file)
@@ -248,8 +248,8 @@ ExecuteRuntimeAsserts(VOID)
     ASSERT(FIELD_OFFSET(KV86M_TRAP_FRAME, orig_ebp) == TF_ORIG_EBP);
     ASSERT(FIELD_OFFSET(KPCR, Tib.ExceptionList) == KPCR_EXCEPTION_LIST);
     ASSERT(FIELD_OFFSET(KPCR, Self) == KPCR_SELF);
-    ASSERT(FIELD_OFFSET(KPCR, PrcbData) + FIELD_OFFSET(KPRCB, CurrentThread) == KPCR_CURRENT_THREAD);
-    ASSERT(FIELD_OFFSET(KPCR, PrcbData) + FIELD_OFFSET(KPRCB, NpxThread) == KPCR_NPX_THREAD);
+    ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, CurrentThread) == KPCR_CURRENT_THREAD);
+    ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, NpxThread) == KPCR_NPX_THREAD);
     ASSERT(FIELD_OFFSET(KTSS, Esp0) == KTSS_ESP0);
     ASSERT(FIELD_OFFSET(KTSS, Eflags) == KTSS_EFLAGS);
     ASSERT(FIELD_OFFSET(KTSS, IoMapBase) == KTSS_IOMAPBASE);
index 5e9ca89..c5d0728 100644 (file)
 #define NDEBUG
 #include <internal/debug.h>
 
+#ifndef MUTANT_INCREMENT
+#define MUTANT_INCREMENT                1
+#endif
+
 POBJECT_TYPE ExMutantObjectType = NULL;
 
 static GENERIC_MAPPING ExpMutantMapping = {
index 746abde..1288081 100644 (file)
@@ -415,9 +415,9 @@ QSI_DEF(SystemPerformanceInformation)
 
        Spi->IdleTime.QuadPart = TheIdleProcess->Pcb.KernelTime * 100000LL;
 
-       Spi->ReadTransferCount.QuadPart = IoReadTransferCount;
-       Spi->WriteTransferCount.QuadPart = IoWriteTransferCount;
-       Spi->OtherTransferCount.QuadPart = IoOtherTransferCount;
+       Spi->ReadTransferCount = IoReadTransferCount;
+       Spi->WriteTransferCount = IoWriteTransferCount;
+       Spi->OtherTransferCount = IoOtherTransferCount;
        Spi->ReadOperationCount = IoReadOperationCount;
        Spi->WriteOperationCount = IoWriteOperationCount;
        Spi->OtherOperationCount = IoOtherOperationCount;
@@ -984,6 +984,9 @@ QSI_DEF(SystemFileCacheInformation)
                * ReqSize = sizeof (SYSTEM_CACHE_INFORMATION);
                return (STATUS_INFO_LENGTH_MISMATCH);
        }
+
+       RtlZeroMemory(Sci, sizeof(SYSTEM_CACHE_INFORMATION));
+
        /* Return the Byte size not the page size. */
        Sci->CurrentSize =
                MiMemoryConsumers[MC_CACHE].PagesUsed * PAGE_SIZE;
@@ -993,8 +996,6 @@ QSI_DEF(SystemFileCacheInformation)
        Sci->PageFaultCount = 0; /* FIXME */
        Sci->MinimumWorkingSet = 0; /* FIXME */
        Sci->MaximumWorkingSet = 0; /* FIXME */
-       Sci->TransitionSharedPages = 0; /* FIXME */
-       Sci->TransitionSharedPagesPeak = 0; /* FIXME */
 
        return (STATUS_SUCCESS);
 }
index 71fe6d2..3ab0836 100644 (file)
@@ -15,7 +15,9 @@
 
 /* GLOBALS *******************************************************************/
 
+extern ULONG CcFastReadNotPossible;
 extern ULONG CcFastReadResourceMiss;
+extern ULONG CcFastReadWait;
 extern ULONG CcFastReadNoWait;
 
 /* FUNCTIONS *****************************************************************/
index 577f2f8..19516c4 100644 (file)
@@ -1372,7 +1372,7 @@ FsRtlReleaseFile(
     if ((FcbHeader = (PFSRTL_COMMON_FCB_HEADER)FileObject->FsContext)) {
 
         /* Use a Resource Release */
-        ExReleaseResource(FcbHeader->Resource);
+        ExReleaseResourceLite(FcbHeader->Resource);
 
         return;
     }
index 527fd8c..7b12ba4 100644 (file)
@@ -609,11 +609,11 @@ FsRtlpCopyName(
 
    if (Unicode)
    {
-      memcpy(CurrentEntry->Name, RelativeName->Buffer, RelativeName->Length);
+      memcpy(CurrentEntry->FileName, RelativeName->Buffer, RelativeName->Length);
       if (StreamName)
       {
-         CurrentEntry->Name[RelativeName->Length/sizeof(WCHAR)] = ':';
-         memcpy(&CurrentEntry ->Name[(RelativeName->Length/sizeof(WCHAR))+1],
+         CurrentEntry->FileName[RelativeName->Length/sizeof(WCHAR)] = ':';
+         memcpy(&CurrentEntry->FileName[(RelativeName->Length/sizeof(WCHAR))+1],
             StreamName->Buffer,
             StreamName->Length);
       }
@@ -741,7 +741,7 @@ FsRtlNotifyFullReportChange (
             (StreamName ? ((StreamName->Length * sizeof(WCHAR)) + sizeof(WCHAR)) : 0);
       }
 
-      RecordLen = FIELD_OFFSET(FILE_NOTIFY_INFORMATION, Name) + NameLenU;
+      RecordLen = FIELD_OFFSET(FILE_NOTIFY_INFORMATION, FileName) + NameLenU;
 
       if ((Irp = FsRtlpGetNextIrp(NotifyEntry)))
       {
@@ -770,7 +770,7 @@ FsRtlNotifyFullReportChange (
             if (CurrentEntry)
             {
                CurrentEntry->Action = Action;
-               CurrentEntry->NameLength = NameLenU;
+               CurrentEntry->FileNameLength = NameLenU;
                CurrentEntry->NextEntryOffset = 0;
 
                FsRtlpCopyName(
@@ -816,7 +816,7 @@ FsRtlNotifyFullReportChange (
          CurrentEntry = (PFILE_NOTIFY_INFORMATION)NotifyEntry->Buffer;
 
          CurrentEntry->Action = Action;
-         CurrentEntry->NameLength = NameLenU;
+         CurrentEntry->FileNameLength = NameLenU;
          CurrentEntry->NextEntryOffset = 0;
 
          FsRtlpCopyName(CurrentEntry,
@@ -937,10 +937,10 @@ FsRtlNotifyReportChange (
 VOID
 STDCALL
 FsRtlNotifyUninitializeSync (
-    IN PNOTIFY_SYNC NotifySync
+    IN PNOTIFY_SYNC *NotifySync
        )
 {
-   ExFreePool (NotifySync);
+   ExFreePool (*NotifySync);
 }
 
 /**********************************************************************
index c3e4073..072500c 100644 (file)
@@ -1,10 +1,6 @@
 #ifndef __INCLUDE_INTERNAL_CC_H
 #define __INCLUDE_INTERNAL_CC_H
 
-/* $Id$ */
-#include <ddk/ntifs.h>
-#include <reactos/bugcodes.h>
-
 typedef struct _BCB
 {
   LIST_ENTRY BcbSegmentListHead;
index 18a824c..985059b 100644 (file)
@@ -18,8 +18,6 @@
 #ifndef __INTERNAL_DEBUG
 #define __INTERNAL_DEBUG
 
-#include <internal/ntoskrnl.h>
-
 #if defined(_MSC_VER) && (_MSC_VER < 1300)
 /* TODO: Verify which version the MS compiler learned the __FUNCTION__ macro */
 #define __FUNCTION__ "<unknown>"
index fd77707..a555469 100644 (file)
@@ -5,9 +5,6 @@
 #ifndef __NTOSKRNL_INCLUDE_INTERNAL_EXECUTIVE_H
 #define __NTOSKRNL_INCLUDE_INTERNAL_EXECUTIVE_H
 
-#define NTOS_MODE_KERNEL
-#include <ntos.h>
-
 typedef enum
 {
   wmCenter = 0,
index 0d38543..e7527ee 100644 (file)
@@ -1,9 +1,5 @@
 #ifndef __INCLUDE_INTERNAL_IFS_H
 #define __INCLUDE_INTERNAL_IFS_H
-/* $Id$ */
-
-#include <ddk/ntifs.h>
-#include <ntos.h>
 
 /* Look for "FSrt" in mem view */
 #define IFS_POOL_TAG 0x74725346
index 119b938..f07bb26 100644 (file)
 #ifndef __NTOSKRNL_INCLUDE_INTERNAL_IO_H
 #define __NTOSKRNL_INCLUDE_INTERNAL_IO_H
 
-#include <ddk/ntddk.h>
-#include <internal/ob.h>
-#include <internal/module.h>
-
-
 #ifndef __USE_W32API
 #define DEVICE_TYPE_FROM_CTL_CODE(ctlCode) (((ULONG)(ctlCode&0xffff0000))>>16)
 #endif
@@ -333,8 +328,6 @@ typedef struct _DEVICETREE_TRAVERSE_CONTEXT
 
 
 extern PDEVICE_NODE IopRootDeviceNode;
-extern ULONG IoOtherOperationCount;
-extern ULONGLONG IoOtherTransferCount;
 
 VOID
 PnpInit(VOID);
index bba0115..3c1301e 100644 (file)
@@ -6,10 +6,6 @@
 #ifndef __INCLUDE_INTERNAL_KERNEL_DEBUGGER_H
 #define __INCLUDE_INTERNAL_KERNEL_DEBUGGER_H
 
-#include <internal/ke.h>
-#include <internal/ldr.h>
-#include <ntdll/ldr.h>
-
 struct _KD_DISPATCH_TABLE;
 #define KdPrintEx(_x_) DbgPrintEx _x_
 
index 6276011..4248c3b 100644 (file)
@@ -1,13 +1,6 @@
 #ifndef NTOSKRNL_KDB_H
 #define NTOSKRNL_KDB_H
 
-/* INCLUDES ******************************************************************/
-
-#define NTOS_MODE_KERNEL
-#include <ntos.h>
-
-#include <internal/ke.h>
-
 /* DEFINES *******************************************************************/
 
 #define TAG_KDBG        (('K' << 24) | ('D' << 16) | ('B' << 8) | 'G')
index 8dbd5f8..d0f9a23 100644 (file)
@@ -6,16 +6,12 @@
 #ifndef __INCLUDE_INTERNAL_KD_BOCHS_H
 #define __INCLUDE_INTERNAL_KD_BOCHS_H
 
-#include <internal/ke.h>
-#include <internal/ldr.h>
-#include <ntdll/ldr.h>
-
 VOID
 STDCALL
 KdpBochsInit(struct _KD_DISPATCH_TABLE *DispatchTable,
              ULONG BootPhase);
-VOID\r
-STDCALL\r
-KdpBochsDebugPrint(IN PCH Message);\r
-\r
+VOID
+STDCALL
+KdpBochsDebugPrint(IN PCH Message);
+
 #endif /* __INCLUDE_INTERNAL_KD_BOCHS_H */
index e0127cd..b8cf7ef 100644 (file)
@@ -6,10 +6,6 @@
 #ifndef __INCLUDE_INTERNAL_KD_GDB_H
 #define __INCLUDE_INTERNAL_KD_GDB_H
 
-#include <internal/ke.h>
-#include <internal/ldr.h>
-#include <ntdll/ldr.h>
-
 VOID
 STDCALL
 KdpGdbStubInit(struct _KD_DISPATCH_TABLE *DispatchTable,
index dc14a3a..4b2501a 100644 (file)
 
 /* INCLUDES *****************************************************************/
 
-#ifndef __ASM__
-#include <ddk/ntifs.h>
-#include <stdarg.h>
-#endif /* not __ASM__ */
-
 #include "arch/ke.h"
 
 /* INTERNAL KERNEL TYPES ****************************************************/
 typedef struct _KPROCESS *PKPROCESS;
 typedef struct _DISPATCHER_HEADER *PDISPATCHER_HEADER;
 
-#else
-
-typedef struct _KEVENT_PAIR *PKEVENT_PAIR;
-
 #endif /* __USE_W32API */
 
 typedef struct _HARDWARE_PTE_X86 {
@@ -222,7 +213,7 @@ typedef struct _KPROCESS
 /* INTERNAL KERNEL FUNCTIONS ************************************************/
 
 #ifdef __USE_W32API
-struct _KPROCESS* KeGetCurrentProcess(VOID);
+struct _KPROCESS* STDCALL KeGetCurrentProcess(VOID);
 VOID KeSetGdtSelector(ULONG Entry, ULONG Value1, ULONG Value2);
 #endif
 
index 0b4e2b6..b779a4f 100644 (file)
@@ -8,10 +8,6 @@
 #ifndef __INCLUDE_INTERNAL_LDR_H
 #define __INCLUDE_INTERNAL_LDR_H
 
-#include <pe.h>
-#include <internal/io.h>
-#include <internal/module.h>
-
 #define  KERNEL_MODULE_NAME  L"ntoskrnl.exe"
 #define  HAL_MODULE_NAME  L"hal.dll"
 #define  DRIVER_ROOT_NAME  L"\\Driver\\"
index 7f9b958..497ee4b 100644 (file)
@@ -40,7 +40,6 @@
 #ifndef __INCLUDE_INTERNAL_MM_H
 #define __INCLUDE_INTERNAL_MM_H
 
-#include <internal/ntoskrnl.h>
 #include <internal/arch/mm.h>
 
 /* TYPES *********************************************************************/
index c116db9..e36b713 100644 (file)
@@ -1,12 +1,6 @@
-
 #ifndef __MODULE_H
 #define __MODULE_H
 
-#include <ddk/ntddk.h>
-#include <roscfg.h>
-#include <pe.h>
-#include <reactos/rossym.h>
-
 typedef struct _MODULE_TEXT_SECTION
 {
   ULONG Base;
index a124c66..30fe52c 100644 (file)
@@ -7,12 +7,6 @@
 
 #ifndef __ASM__
 
-#include <stdarg.h>
-#define NTOS_MODE_KERNEL
-#include <ntos.h>
-
-#include "internal/ke.h"
-
 /*
  * Use these to place a function in a specific section of the executable
  */
index 2e4f8ac..43bb708 100644 (file)
@@ -9,9 +9,6 @@
 #ifndef __INCLUDE_INTERNAL_OBJMGR_H
 #define __INCLUDE_INTERNAL_OBJMGR_H
 
-#define NTOS_MODE_KERNEL
-#include <ntos.h>
-
 #define TAG_OBJECT_TYPE TAG('O', 'b', 'j', 'T')
 
 struct _EPROCESS;
index 19387eb..d6d5d0d 100644 (file)
@@ -12,9 +12,6 @@
 #ifndef __NTOSKRNL_INCLUDE_INTERNAL_PO_H
 #define __NTOSKRNL_INCLUDE_INTERNAL_PO_H
 
-#include <ddk/ntddk.h>
-#include <internal/io.h>
-
 extern PDEVICE_NODE PopSystemPowerDeviceNode;
 
 VOID
index 696bbe2..2ac82ab 100644 (file)
@@ -41,10 +41,6 @@ struct _EJOB;
 
 #ifndef __ASM__
 
-#include <internal/mm.h>
-#include <internal/ke.h>
-#include <napi/teb.h>
-
 extern LCID PsDefaultThreadLocaleId;
 extern LCID PsDefaultSystemLocaleId;
 
@@ -187,7 +183,7 @@ typedef struct _ETHREAD *PETHREAD;
  * KERNEL VERSION: 5.2
  * DOCUMENTATION:  http://reactos.com/wiki/index.php/EPROCESS
  */
-struct _EPROCESS
+typedef struct _EPROCESS
 {
     KPROCESS              Pcb;                          /* 000 */
     EX_PUSH_LOCK          ProcessLock;                  /* 078 */
@@ -317,7 +313,7 @@ struct _EPROCESS
 
     /* FIXME MOVE TO AVL TREES                                 */
     MADDRESS_SPACE        AddressSpace;                 /* 28C */
-};
+} EPROCESS;
 #include <poppack.h>
 
 #define PROCESS_STATE_TERMINATED (1)
index 8aaba64..96a772e 100644 (file)
@@ -33,8 +33,6 @@
 
 #ifndef __ASM__
 
-#include <internal/ke.h>
-
 typedef struct _KV86M_TRAP_FRAME
 {
   KTRAP_FRAME Tf;
index bb130fc..063783d 100755 (executable)
@@ -1,34 +1,39 @@
 #ifndef __INCLUDE_NTOSKRNL_H
 #define __INCLUDE_NTOSKRNL_H
 
-#define __NO_CTYPE_INLINES
+#define NTKERNELAPI
 
 /* include the ntoskrnl config.h file */
 #include "config.h"
 
+#include <roskrnl.h>
+#include <ddk/ntddk.h>
+#include <ddk/ntifs.h>
+#include <ddk/wdmguid.h>
+
+#undef IO_TYPE_FILE
+#define IO_TYPE_FILE                    0x0F5L /* Temp Hack */
+
 #include <roscfg.h>
 #include <reactos/version.h>
 #include <reactos/resource.h>
 #include <reactos/bugcodes.h>
+#include <reactos/rossym.h>
 #include <limits.h>
 #include <stdarg.h>
 #include <stdlib.h>
 #include <string.h>
 #include <malloc.h>
 #include <wchar.h>
-#include <roskrnl.h>
 #include <ntos/minmax.h>
 #include <ntos/synch.h>
 #include <ntos/keyboard.h>
 #include <ntos/ntdef.h>
+#include <ntos/ldrtypes.h>
 #include <ntos/ntpnp.h>
+#include <ddk/ldrfuncs.h>
 #include <rosrtl/minmax.h>
 #include <rosrtl/string.h>
-#include <ddk/halfuncs.h>
-#include <ddk/kefuncs.h>
-#include <ddk/pnptypes.h>
-#include <ddk/pnpfuncs.h>
-#include <ddk/wdmguid.h>
 #include <ntdll/ldr.h>
 #include <pseh.h>
 #include <internal/ctype.h>
 #include <internal/handle.h>
 #include <internal/pool.h>
 #include <internal/ob.h>
-#include <internal/ps.h>
 #include <internal/mm.h>
+#include <internal/ps.h>
 #include <internal/cc.h>
 #include <internal/io.h>
 #include <internal/po.h>
-#include <internal/ob.h>
 #include <internal/se.h>
 #include <internal/ldr.h>
 #include <internal/kd.h>
index a74d876..bad9aa6 100644 (file)
@@ -84,7 +84,6 @@ HAL_DISPATCH EXPORTED HalDispatchTable =
     (pHalMirrorVerify) NULL                //HalMirrorVerify;
 };
 
-
 HAL_PRIVATE_DISPATCH EXPORTED HalPrivateDispatchTable =
 {
     HAL_PRIVATE_DISPATCH_VERSION
index b497214..ea4dca5 100644 (file)
@@ -14,6 +14,9 @@
 #define NDEBUG
 #include <internal/debug.h>
 
+/* FIXME: Header mess */
+#undef CreateMailslot
+
 /* GLOBALS *******************************************************************/
 
 extern GENERIC_MAPPING IopFileMapping;
@@ -1351,7 +1354,7 @@ NtCancelIoFile(IN HANDLE FileHandle,
    BOOLEAN OurIrpsInList = FALSE;
    LARGE_INTEGER Interval;
 
-   if ((ULONG_PTR)IoStatusBlock >= MmUserProbeAddress &&
+   if ((ULONG_PTR)IoStatusBlock >= (ULONG_PTR)MmUserProbeAddress &&
        KeGetPreviousMode() == UserMode)
       return STATUS_ACCESS_VIOLATION;
 
@@ -2877,7 +2880,7 @@ NtSetInformationFile(HANDLE FileHandle,
         else
         {
             /* Reference the Port */
-            Status = ObReferenceObjectByHandle(CompletionInfo->IoCompletionHandle,
+            Status = ObReferenceObjectByHandle(CompletionInfo->Port,
                                                IO_COMPLETION_MODIFY_STATE,
                                                IoCompletionType,
                                                PreviousMode,
@@ -2891,7 +2894,7 @@ NtSetInformationFile(HANDLE FileHandle,
                                                 TAG('I', 'o', 'C', 'p'));
 
                 /* Set the Data */
-                Context->Key = CompletionInfo->CompletionKey;
+                Context->Key = CompletionInfo->Key;
                 Context->Port = Queue;
                 FileObject->CompletionContext = Context;
 
index 45f490d..995d792 100644 (file)
 POBJECT_TYPE EXPORTED IoDeviceObjectType = NULL;
 POBJECT_TYPE EXPORTED IoFileObjectType = NULL;
 extern POBJECT_TYPE IoControllerObjectType;
-ULONG        EXPORTED IoReadOperationCount = 0;
-ULONGLONG    EXPORTED IoReadTransferCount = 0;
-ULONG        EXPORTED IoWriteOperationCount = 0;
-ULONGLONG    EXPORTED IoWriteTransferCount = 0;
-ULONG                 IoOtherOperationCount = 0;
-ULONGLONG             IoOtherTransferCount = 0;
-KSPIN_LOCK   EXPORTED IoStatisticsLock = 0;
+ULONG         EXPORTED IoReadOperationCount = 0;
+LARGE_INTEGER EXPORTED IoReadTransferCount = {{0, 0}};
+ULONG         EXPORTED IoWriteOperationCount = 0;
+LARGE_INTEGER EXPORTED IoWriteTransferCount = {{0, 0}};
+ULONG                  IoOtherOperationCount = 0;
+LARGE_INTEGER          IoOtherTransferCount = {{0, 0}};
+KSPIN_LOCK    EXPORTED IoStatisticsLock = 0;
 
 GENERIC_MAPPING IopFileMapping = {
     FILE_GENERIC_READ,
@@ -36,6 +36,7 @@ static KSPIN_LOCK CancelSpinLock;
 extern LIST_ENTRY ShutdownListHead;
 extern KSPIN_LOCK ShutdownListLock;
 extern NPAGED_LOOKASIDE_LIST IoCompletionPacketLookaside;
+extern POBJECT_TYPE IoAdapterObjectType;
 NPAGED_LOOKASIDE_LIST IoLargeIrpLookaside;
 NPAGED_LOOKASIDE_LIST IoSmallIrpLookaside;
 
index e641ccc..2758e35 100644 (file)
@@ -1033,6 +1033,7 @@ IoCallDriver (PDEVICE_OBJECT DeviceObject, PIRP Irp)
 /*
  * @implemented
  */
+#undef IoCompleteRequest
 VOID
 STDCALL
 IoCompleteRequest(PIRP Irp,
index 391570d..3776cca 100644 (file)
@@ -15,6 +15,9 @@
 #define NDEBUG
 #include <internal/debug.h>
 
+/* FIXME: Header mess */
+#undef DeviceCapabilities
+
 /* GLOBALS *******************************************************************/
 
 PDEVICE_NODE IopRootDeviceNode;
index aea22ac..a87fa5a 100644 (file)
@@ -17,7 +17,7 @@
 /* GLOBALS *******************************************************************/
 
 static CONFIGURATION_INFORMATION
-SystemConfigurationInformation = {0, 0, 0, 0, 0, 0, 0, FALSE, FALSE};
+_SystemConfigurationInformation = {0, 0, 0, 0, 0, 0, 0, FALSE, FALSE};
 
 /* API Parameters to Pass in IopQueryBusDescription */
 typedef struct IO_QUERY {
@@ -659,7 +659,7 @@ IopQueryBusDescription(
 PCONFIGURATION_INFORMATION STDCALL
 IoGetConfigurationInformation(VOID)
 {
-  return(&SystemConfigurationInformation);
+  return(&_SystemConfigurationInformation);
 }
 
 /*
index 7b26455..4b83fc9 100644 (file)
@@ -1422,7 +1422,7 @@ KdbpCmdGdtLdtIdt(ULONG Argc, PCHAR Argv[])
 STATIC BOOLEAN
 KdbpCmdPcr(ULONG Argc, PCHAR Argv[])
 {
-   PKPCR Pcr = KeGetCurrentKPCR();
+   PKIPCR Pcr = (PKIPCR)KeGetCurrentKPCR();
 
    KdbpPrint("Current PCR is at 0x%08x.\n", (INT)Pcr);
    KdbpPrint("  Tib.ExceptionList:         0x%08x\n"
@@ -1446,7 +1446,6 @@ KdbpCmdPcr(ULONG Argc, PCHAR Argv[])
              "  MinorVersion:              0x%04x\n"
              "  SetMember:                 0x%08x\n"
              "  StallScaleFactor:          0x%08x\n"
-             "  DebugActive:               0x%02x\n"
              "  Number:                    0x%02x\n"
              "  L2CacheAssociativity:      0x%02x\n"
              "  VdmAlert:                  0x%08x\n"
@@ -1457,7 +1456,7 @@ KdbpCmdPcr(ULONG Argc, PCHAR Argv[])
              Pcr->Tib.Self, Pcr->Self, Pcr->Prcb, Pcr->Irql, Pcr->IRR, Pcr->IrrActive,
              Pcr->IDR, Pcr->KdVersionBlock, Pcr->IDT, Pcr->GDT, Pcr->TSS,
              Pcr->MajorVersion, Pcr->MinorVersion, Pcr->SetMember, Pcr->StallScaleFactor,
-             Pcr->DebugActive, Pcr->Number, Pcr->L2CacheAssociativity,
+             Pcr->Number, Pcr->L2CacheAssociativity,
              Pcr->VdmAlert, Pcr->L2CacheSize, Pcr->InterruptMode);
 
    return TRUE;
index b705204..e668e30 100644 (file)
@@ -9,10 +9,7 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
-#include <roscfg.h>
 #include <ntoskrnl.h>
-#include <reactos/rossym.h>
 
 #define NDEBUG
 #include <internal/debug.h>
index 3ac6e52..9894de1 100644 (file)
@@ -37,7 +37,7 @@ Ki386GetCpuId(VOID)
    ULONG OrigFlags, Flags, FinalFlags;
    ULONG MaxCpuidLevel;
    ULONG Dummy, Eax, Ecx, Edx;
-   PKPCR Pcr = KeGetCurrentKPCR();
+   PKIPCR Pcr = (PKIPCR)KeGetCurrentKPCR();
 
    Ke386CpuidFlags2 =  Ke386CpuidExFlags = 0;
    Ke386CacheAlignment = 32;
@@ -166,11 +166,11 @@ KePrepareForApplicationProcessorInit(ULONG Id)
 {
   DPRINT("KePrepareForApplicationProcessorInit(Id %d)\n", Id);
   PFN_TYPE PrcPfn;
-  PKPCR Pcr;
-  PKPCR BootPcr;
+  PKIPCR Pcr;
+  PKIPCR BootPcr;
 
-  BootPcr = (PKPCR)KPCR_BASE;
-  Pcr = (PKPCR)((ULONG_PTR)KPCR_BASE + Id * PAGE_SIZE);
+  BootPcr = (PKIPCR)KPCR_BASE;
+  Pcr = (PKIPCR)((ULONG_PTR)KPCR_BASE + Id * PAGE_SIZE);
 
   MmRequestPageMemoryConsumer(MC_NPPOOL, TRUE, &PrcPfn);
   MmCreateVirtualMappingForKernel((PVOID)Pcr,
@@ -183,7 +183,7 @@ KePrepareForApplicationProcessorInit(ULONG Id)
   memset(Pcr, 0, PAGE_SIZE);
   Pcr->Number = Id;
   Pcr->Tib.Self = &Pcr->Tib;
-  Pcr->Self = Pcr;
+  Pcr->Self = (PKPCR)Pcr;
   Pcr->Prcb = &Pcr->PrcbData;
   Pcr->Irql = SYNCH_LEVEL;
 
@@ -200,7 +200,7 @@ VOID
 KeApplicationProcessorInit(VOID)
 {
   ULONG Offset;
-  PKPCR Pcr;
+  PKIPCR Pcr;
 
   DPRINT("KeApplicationProcessorInit()\n");
 
@@ -212,12 +212,12 @@ KeApplicationProcessorInit(VOID)
 
 
   Offset = InterlockedIncrementUL(&PcrsAllocated) - 1;
-  Pcr = (PKPCR)((ULONG_PTR)KPCR_BASE + Offset * PAGE_SIZE);
+  Pcr = (PKIPCR)((ULONG_PTR)KPCR_BASE + Offset * PAGE_SIZE);
 
   /*
    * Initialize the GDT
    */
-  KiInitializeGdt(Pcr);
+  KiInitializeGdt((PKPCR)Pcr);
 
   /* Get processor information. */
   Ki386GetCpuId();
@@ -261,7 +261,7 @@ KeApplicationProcessorInit(VOID)
 VOID INIT_FUNCTION
 KeInit1(PCHAR CommandLine, PULONG LastKernelAddress)
 {
-   PKPCR KPCR;
+   PKIPCR KPCR;
    BOOLEAN Pae = FALSE;
    BOOLEAN NoExecute = FALSE;
    PCHAR p1, p2;
@@ -274,12 +274,12 @@ KeInit1(PCHAR CommandLine, PULONG LastKernelAddress)
     * called, so we use a predefined page in low memory
     */
 
-   KPCR = (PKPCR)KPCR_BASE;
+   KPCR = (PKIPCR)KPCR_BASE;
    memset(KPCR, 0, PAGE_SIZE);
-   KPCR->Self = KPCR;
+   KPCR->Self = (PKPCR)KPCR;
    KPCR->Prcb = &KPCR->PrcbData;
    KPCR->Irql = SYNCH_LEVEL;
-   KPCR->Tib.Self  = &KPCR->Tib;
+   KPCR->Tib.Self = &KPCR->Tib;
    KPCR->GDT = KiBootGdt;
    KPCR->IDT = (PUSHORT)KiIdt;
    KPCR->TSS = &KiBootTss;
@@ -391,7 +391,7 @@ KeInit1(PCHAR CommandLine, PULONG LastKernelAddress)
 VOID INIT_FUNCTION
 KeInit2(VOID)
 {
-   PKPCR Pcr = KeGetCurrentKPCR();
+   PKIPCR Pcr = (PKIPCR)KeGetCurrentKPCR();
 
    KiInitializeBugCheck();
    KeInitializeDispatcher();
@@ -454,7 +454,7 @@ KeInit2(VOID)
 VOID INIT_FUNCTION
 Ki386SetProcessorFeatures(VOID)
 {
-   PKPCR Pcr = KeGetCurrentKPCR();
+   PKIPCR Pcr = (PKIPCR)KeGetCurrentKPCR();
    OBJECT_ATTRIBUTES ObjectAttributes;
    UNICODE_STRING KeyName;
    UNICODE_STRING ValueName;
index d758350..42db43b 100644 (file)
 #define NDEBUG
 #include <internal/debug.h>
 
+#ifndef MUTANT_INCREMENT
+#define MUTANT_INCREMENT                1
+#endif
+
 #define THREAD_ALERT_INCREMENT 2
 
 extern EX_WORK_QUEUE ExWorkerQueue[MaximumWorkQueue];
index 03ef00c..a587dde 100644 (file)
 #error __ELF_WORD_SIZE must be defined
 #endif
 
+#ifndef MAXULONG
+#define MAXULONG ((ULONG)(~1))
+#endif
+
 #include <elf.h>
 
 /* TODO: Intsafe should be made into a library, as it's generally useful */
index b200804..bda4f57 100644 (file)
 #define __ELF_WORD_SIZE 32
 #include "elf.inc.h"
 
+#define IMAGE_FILE_MACHINE_ARM               0x01c0  // ARM little-endian
+#define IMAGE_FILE_MACHINE_AXP64             IMAGE_FILE_MACHINE_ALPHA64
+#define IMAGE_FILE_MACHINE_ALPHA64           0x0284  // Alpha AXP, full 64-bit support
+#define IMAGE_FILE_MACHINE_M32R              0x9041  // M32R little-endian
+
 extern NTSTATUS NTAPI Elf64FmtCreateSection
 (
  IN CONST VOID * FileHeader,
index 5a54dbc..2faefde 100644 (file)
@@ -482,7 +482,7 @@ MmSetAddressRangeModified (
  * @implemented
  */
 PVOID
-NTKERNELAPI
+STDCALL
 MmGetSystemRoutineAddress (
     IN PUNICODE_STRING SystemRoutineName
     )
index 27ff742..ac39079 100644 (file)
 
 #include <reactos/exeformat.h>
 
+#ifndef MAXULONG
+#define MAXULONG ((ULONG)(~1))
+#endif
+
 static ULONG SectionCharacteristicsToProtect[16] =
 {
  PAGE_NOACCESS,          /* 0 = NONE */
index 70ec3c6..82842f8 100644 (file)
@@ -2561,7 +2561,6 @@ ExeFmtpReadFile(IN PVOID File,
       KEBUGCHECK(STATUS_INVALID_PARAMETER_5);
    }
 
-   ASSERT(PAGE_SIZE <= MAXULONG);
    AdjustOffset = PAGE_ROUND_DOWN(FileOffset.u.LowPart);
    OffsetAdjustment = FileOffset.u.LowPart - AdjustOffset;
    FileOffset.u.LowPart = AdjustOffset;
index 1ce134a..e78bc57 100644 (file)
@@ -4,6 +4,9 @@
        <define name="_SEH_NO_NATIVE_NLG" />\r
        <define name="_DISABLE_TIDENTS" />\r
        <define name="__NTOSKRNL__" />\r
+       <define name="_NTOSKRNL_" />\r
+       <define name="__NO_CTYPE_INLINES" />\r
+       <define name="__USE_W32API" />\r
        <include base="kjs">include</include>\r
        <include base="ntoskrnl">include</include>\r
        <library>csq</library>\r
index bed1980..21e7bd7 100644 (file)
@@ -362,8 +362,8 @@ NtDuplicateObject (IN       HANDLE          SourceProcessHandle,
                   IN   HANDLE          TargetProcessHandle,
                   OUT  PHANDLE         TargetHandle  OPTIONAL,
                   IN   ACCESS_MASK     DesiredAccess,
-                  IN   BOOLEAN         InheritHandle,
-                  ULONG                Options)
+                  IN   ULONG           InheritHandle,
+                  IN   ULONG           Options)
 /*
  * FUNCTION: Copies a handle from one process space to another
  * ARGUMENTS:
index 5b4f855..58f52ba 100644 (file)
@@ -1272,7 +1272,7 @@ NtQueryInformationThread (IN      HANDLE          ThreadHandle,
           * 0. So do the conversion here:
           * -Gunnar     */
          u.TBI.ExitStatus = (Thread->ExitStatus == 0) ? STATUS_PENDING : Thread->ExitStatus;
-        u.TBI.TebBaseAddress = Thread->Tcb.Teb;
+        u.TBI.TebBaseAddress = (PVOID)Thread->Tcb.Teb;
         u.TBI.ClientId = Thread->Cid;
         u.TBI.AffinityMask = Thread->Tcb.Affinity;
         u.TBI.Priority = Thread->Tcb.Priority;
index 50a81f0..ed0b173 100644 (file)
@@ -22,7 +22,7 @@ VOID
 STDCALL
 PsChargePoolQuota(IN PEPROCESS Process,
                   IN POOL_TYPE PoolType,
-                  IN ULONG_PTR Amount)
+                  IN ULONG Amount)
 {
     NTSTATUS Status;
 
@@ -67,7 +67,7 @@ NTSTATUS
 STDCALL
 PsChargeProcessPoolQuota(IN PEPROCESS Process,
                          IN POOL_TYPE PoolType,
-                         IN ULONG_PTR Amount)
+                         IN ULONG Amount)
 {
     PEPROCESS_QUOTA_BLOCK QuotaBlock;
     ULONG NewUsageSize;
index 5429dee..8707afa 100644 (file)
@@ -346,7 +346,7 @@ PsRevertThreadToSelf(IN PETHREAD Thread)
 /*
  * @implemented
  */
-VOID
+NTSTATUS
 STDCALL
 PsImpersonateClient(IN PETHREAD Thread,
                     IN PACCESS_TOKEN Token,
@@ -367,7 +367,7 @@ PsImpersonateClient(IN PETHREAD Thread,
             }
         }
 
-        return;
+        return STATUS_UNSUCCESSFUL;
     }
 
     if (Thread->ImpersonationInfo == NULL) {
@@ -387,6 +387,8 @@ PsImpersonateClient(IN PETHREAD Thread,
                                KernelMode);
 
     Thread->ActiveImpersonationInfo = TRUE;
+
+    return STATUS_SUCCESS;
 }
 
 
index 5012e87..f066ac6 100755 (executable)
 
 /* INCLUDES *****************************************************************/
 
-#include <ntos.h>
-#include <internal/ke.h>
-#include <internal/ob.h>
-#include <internal/ps.h>
+#include <ntoskrnl.h>
 
 #define NDEBUG
 #include <debug.h>
index 72432f4..8f2d30a 100644 (file)
@@ -21,34 +21,6 @@ extern ULONG NtMajorVersion;
 extern ULONG NtMinorVersion;
 extern ULONG NtOSCSDVersion;
 
-/* header hell made me do this...sorry */
-typedef struct _OSVERSIONINFOW {
-  DWORD dwOSVersionInfoSize;
-  DWORD dwMajorVersion;
-  DWORD dwMinorVersion;
-  DWORD dwBuildNumber;
-  DWORD dwPlatformId;
-  WCHAR szCSDVersion[ 128 ];
-} OSVERSIONINFOW, *POSVERSIONINFOW, *LPOSVERSIONINFOW, RTL_OSVERSIONINFOW, *PRTL_OSVERSIONINFOW;
-
-typedef struct _OSVERSIONINFOEXW {
- DWORD dwOSVersionInfoSize;
- DWORD dwMajorVersion;
- DWORD dwMinorVersion;
- DWORD dwBuildNumber;
- DWORD dwPlatformId;
- WCHAR szCSDVersion[ 128 ];
- WORD wServicePackMajor;
- WORD wServicePackMinor;
- WORD wSuiteMask;
- BYTE wProductType;
- BYTE wReserved;
-} OSVERSIONINFOEXW, *POSVERSIONINFOEXW, *LPOSVERSIONINFOEXW, RTL_OSVERSIONINFOEXW, *PRTL_OSVERSIONINFOEXW;
-
-#ifndef VER_PLATFORM_WIN32_NT
-#define VER_PLATFORM_WIN32_NT  (2)
-#endif
-
 /* FUNCTIONS *****************************************************************/
 
 /*
index b9df485..714e0f7 100644 (file)
@@ -49,7 +49,7 @@ SeCreateAccessState(PACCESS_STATE AccessState,
     /* Set Access State Data */
     AccessState->AuxData = AuxData;
     AccessState->RemainingDesiredAccess  = AccessMask;
-    AccessState->OriginallyDesiredAccess = AccessMask;
+    AccessState->OriginalDesiredAccess = AccessMask;
     ExpAllocateLocallyUniqueId(&AccessState->OperationID);
 
     /* Get the Token to use */
index 892a206..a7ad9f1 100644 (file)
@@ -18,6 +18,9 @@
 #include <win32k/win32k.h>
 #include <csrss/csrss.h>
 
+#include <internal/ntoskrnl.h>
+#include <internal/mm.h>
+#include <internal/ke.h>
 #include <internal/ob.h>
 #include <internal/safe.h>
 #include <internal/ps.h>
index e49576c..d208663 100644 (file)
@@ -3529,6 +3529,14 @@ ObReferenceObjectByName (
     OUT PVOID           *Object
 );
 
+NTKERNELAPI
+NTSTATUS
+NTAPI
+PsAssignImpersonationToken (
+    IN PETHREAD     Thread,
+    IN HANDLE       Token
+);
+
 NTKERNELAPI
 VOID
 NTAPI
@@ -3538,6 +3546,15 @@ PsChargePoolQuota (
     IN ULONG        Amount
 );
 
+NTKERNELAPI
+NTSTATUS
+NTAPI
+PsChargeProcessPoolQuota (
+    IN PEPROCESS    Process,
+    IN POOL_TYPE    PoolType,
+    IN ULONG_PTR    Amount
+);
+
 #define PsDereferenceImpersonationToken(T)  \
             {if (ARGUMENT_PRESENT(T)) {     \
                 (ObDereferenceObject((T))); \
@@ -3548,6 +3565,14 @@ PsChargePoolQuota (
 
 #define PsDereferencePrimaryToken(T) (ObDereferenceObject((T)))
 
+NTKERNELAPI
+BOOLEAN
+NTAPI
+PsDisableImpersonation(
+    IN PETHREAD                 Thread,
+    IN PSE_IMPERSONATION_STATE  ImpersonationState
+);
+
 NTKERNELAPI
 LARGE_INTEGER
 NTAPI
@@ -3555,6 +3580,17 @@ PsGetProcessExitTime (
     VOID
 );
 
+NTKERNELAPI
+NTSTATUS
+NTAPI
+PsImpersonateClient(
+    IN PETHREAD                      Thread,
+    IN PACCESS_TOKEN                 Token,
+    IN BOOLEAN                       CopyOnOpen,
+    IN BOOLEAN                       EffectiveOnly,
+    IN SECURITY_IMPERSONATION_LEVEL  ImpersonationLevel
+);
+
 NTKERNELAPI
 BOOLEAN
 NTAPI
@@ -3611,6 +3647,14 @@ PsReferencePrimaryToken (
     IN PEPROCESS Process
 );
 
+NTKERNELAPI
+VOID
+NTAPI
+PsRestoreImpersonation(
+    IN PETHREAD                 Thread,
+    IN PSE_IMPERSONATION_STATE  ImpersonationState
+);
+
 NTKERNELAPI
 VOID
 NTAPI