Build ntoskrnl with NDK, and don't use rosrtl
authorAlex Ionescu <aionescu@gmail.com>
Sat, 25 Jun 2005 14:04:56 +0000 (14:04 +0000)
committerAlex Ionescu <aionescu@gmail.com>
Sat, 25 Jun 2005 14:04:56 +0000 (14:04 +0000)
svn path=/trunk/; revision=16266

34 files changed:
reactos/include/ntos/ps.h
reactos/include/ntos/security.h
reactos/ntoskrnl/ex/sysinfo.c
reactos/ntoskrnl/ex/win32k.c
reactos/ntoskrnl/inbv/inbv.c
reactos/ntoskrnl/include/internal/ke.h
reactos/ntoskrnl/include/internal/mm.h
reactos/ntoskrnl/include/internal/ntoskrnl.h
reactos/ntoskrnl/include/internal/port.h
reactos/ntoskrnl/include/internal/ps.h
reactos/ntoskrnl/include/ntoskrnl.h
reactos/ntoskrnl/io/arcname.c
reactos/ntoskrnl/io/driver.c
reactos/ntoskrnl/io/file.c
reactos/ntoskrnl/io/iomgr.c
reactos/ntoskrnl/io/pnpmgr.c
reactos/ntoskrnl/io/resource.c
reactos/ntoskrnl/kdbg/kdb_symbols.c
reactos/ntoskrnl/ke/i386/kernel.c
reactos/ntoskrnl/ldr/init.c
reactos/ntoskrnl/ldr/loader.c
reactos/ntoskrnl/ldr/sysdll.c
reactos/ntoskrnl/lpc/port.c
reactos/ntoskrnl/mm/pagefile.c
reactos/ntoskrnl/mm/section.c
reactos/ntoskrnl/ob/wait.c
reactos/ntoskrnl/ps/locale.c
reactos/ntoskrnl/ps/query.c
reactos/ntoskrnl/ps/thread.c
reactos/ntoskrnl/rtl/libsupp.c
reactos/ntoskrnl/rtl/rangelist.c
reactos/ntoskrnl/rtl/sprintf.c
reactos/ntoskrnl/rtl/stdlib.c
reactos/ntoskrnl/rtl/swprintf.c

index 57fa017..d2e93d0 100644 (file)
@@ -136,7 +136,7 @@ typedef NTSTATUS
 (STDCALL *PW32_THREAD_CALLBACK)(struct _ETHREAD *Thread,
                                BOOLEAN Create);
 
-typedef struct _EJOB *PEJOB;
+struct _EJOB;
 
 NTSTATUS STDCALL
 PsCreateSystemProcess (PHANDLE ProcessHandle,
@@ -189,19 +189,19 @@ STDCALL PsGetCurrentThreadStackLimit (
 
 PVOID
 STDCALL PsGetJobLock(
-    PEJOB      Job
+    struct _EJOB*      Job
        );
 
 
 PVOID
 STDCALL PsGetJobSessionId(
-    PEJOB      Job
+    struct _EJOB*      Job
        );
 
 
 ULONG
 STDCALL PsGetJobUIRestrictionsClass(
-       PEJOB   Job
+       struct _EJOB*   Job
        );
 
 
@@ -247,7 +247,7 @@ STDCALL PsGetProcessInheritedFromUniqueProcessId(
        );
 
 
-PEJOB
+struct _EJOB*
 STDCALL PsGetProcessJob(
        PEPROCESS Process
        );
@@ -378,7 +378,7 @@ PsRevertThreadToSelf(
 
 VOID
 STDCALL PsSetJobUIRestrictionsClass(
-    PEJOB      Job,
+    struct _EJOB*      Job,
     ULONG      UIRestrictionsClass     
        );
 
index 37a4cd0..f7ec107 100644 (file)
@@ -4,6 +4,7 @@
 #include <ntos/ntdef.h>
 #include <ntos/types.h>
 
+#ifndef __USE_W32API
 /* Privileges */
 #define SE_MIN_WELL_KNOWN_PRIVILEGE            (2L)
 #define SE_CREATE_TOKEN_PRIVILEGE              (2L)
@@ -31,7 +32,7 @@
 #define SE_CHANGE_NOTIFY_PRIVILEGE             (23L)
 #define SE_REMOTE_SHUTDOWN_PRIVILEGE           (24L)
 #define SE_MAX_WELL_KNOWN_PRIVILEGE            SE_REMOTE_SHUTDOWN_PRIVILEGE
-
+#endif
 /* TOKEN_GROUPS structure */
 #ifndef SE_GROUP_MANDATORY
 #define SE_GROUP_MANDATORY                (0x1L)
index 7a59fee..27c11f2 100644 (file)
@@ -97,7 +97,7 @@ ExIsProcessorFeaturePresent(IN ULONG ProcessorFeature)
 
 NTSTATUS STDCALL
 NtQuerySystemEnvironmentValue (IN      PUNICODE_STRING VariableName,
-                              OUT      PWCHAR          ValueBuffer,
+                              OUT      PWSTR           ValueBuffer,
                               IN       ULONG           ValueBufferLength,
                               IN OUT   PULONG          ReturnLength  OPTIONAL)
 {
@@ -353,17 +353,17 @@ QSI_DEF(SystemBasicInformation)
        {
                return (STATUS_INFO_LENGTH_MISMATCH);
        }
-       Sbi->Unknown = 0;
-       Sbi->MaximumIncrement = KeMaximumIncrement;
-       Sbi->PhysicalPageSize = PAGE_SIZE;
+       Sbi->Reserved = 0;
+       Sbi->TimerResolution = KeMaximumIncrement;
+       Sbi->PageSize = PAGE_SIZE;
        Sbi->NumberOfPhysicalPages = MmStats.NrTotalPages;
-       Sbi->LowestPhysicalPage = 0; /* FIXME */
-       Sbi->HighestPhysicalPage = MmStats.NrTotalPages; /* FIXME */
+       Sbi->LowestPhysicalPageNumber = 0; /* FIXME */
+       Sbi->HighestPhysicalPageNumber = MmStats.NrTotalPages; /* FIXME */
        Sbi->AllocationGranularity = MM_VIRTMEM_GRANULARITY; /* hard coded on Intel? */
-       Sbi->LowestUserAddress = 0x10000; /* Top of 64k */
-       Sbi->HighestUserAddress = (ULONG_PTR)MmHighestUserAddress;
-       Sbi->ActiveProcessors = KeActiveProcessors;
-       Sbi->NumberProcessors = KeNumberProcessors;
+       Sbi->MinimumUserModeAddress = 0x10000; /* Top of 64k */
+       Sbi->MaximumUserModeAddress = (ULONG_PTR)MmHighestUserAddress;
+       Sbi->ActiveProcessorsAffinityMask = KeActiveProcessors;
+       Sbi->NumberOfProcessors = KeNumberProcessors;
        return (STATUS_SUCCESS);
 }
 
@@ -385,8 +385,8 @@ QSI_DEF(SystemProcessorInformation)
        Spi->ProcessorArchitecture = 0; /* Intel Processor */
        Spi->ProcessorLevel        = Prcb->CpuType;
        Spi->ProcessorRevision     = Prcb->CpuStep;
-       Spi->Unknown               = 0;
-       Spi->FeatureBits           = Prcb->FeatureBits;
+       Spi->Reserved              = 0;
+       Spi->ProcessorFeatureBits          = Prcb->FeatureBits;
 
        DPRINT("Arch %d Level %d Rev 0x%x\n", Spi->ProcessorArchitecture,
                Spi->ProcessorLevel, Spi->ProcessorRevision);
@@ -413,21 +413,21 @@ QSI_DEF(SystemPerformanceInformation)
 
        TheIdleProcess = PsIdleProcess;
 
-       Spi->IdleTime.QuadPart = TheIdleProcess->Pcb.KernelTime * 100000LL;
+       Spi->IdleProcessTime.QuadPart = TheIdleProcess->Pcb.KernelTime * 100000LL;
 
-       Spi->ReadTransferCount = IoReadTransferCount;
-       Spi->WriteTransferCount = IoWriteTransferCount;
-       Spi->OtherTransferCount = IoOtherTransferCount;
-       Spi->ReadOperationCount = IoReadOperationCount;
-       Spi->WriteOperationCount = IoWriteOperationCount;
-       Spi->OtherOperationCount = IoOtherOperationCount;
+       Spi->IoReadTransferCount = IoReadTransferCount;
+       Spi->IoWriteTransferCount = IoWriteTransferCount;
+       Spi->IoOtherTransferCount = IoOtherTransferCount;
+       Spi->IoReadOperationCount = IoReadOperationCount;
+       Spi->IoWriteOperationCount = IoWriteOperationCount;
+       Spi->IoOtherOperationCount = IoOtherOperationCount;
 
        Spi->AvailablePages = MmStats.NrFreePages;
 /*
         Add up all the used "Commitied" memory + pagefile.
         Not sure this is right. 8^\
  */
-       Spi->TotalCommittedPages = MiMemoryConsumers[MC_PPOOL].PagesUsed +
+       Spi->CommittedPages = MiMemoryConsumers[MC_PPOOL].PagesUsed +
                                   MiMemoryConsumers[MC_NPPOOL].PagesUsed+
                                    MiMemoryConsumers[MC_CACHE].PagesUsed+
                                   MiMemoryConsumers[MC_USER].PagesUsed+
@@ -437,79 +437,79 @@ QSI_DEF(SystemPerformanceInformation)
        All this make Taskmgr happy but not sure it is the right numbers.
        This too, fixes some of GlobalMemoryStatusEx numbers.
 */
-        Spi->TotalCommitLimit = MmStats.NrTotalPages + MiFreeSwapPages +
+        Spi->CommitLimit = MmStats.NrTotalPages + MiFreeSwapPages +
                                 MiUsedSwapPages;
 
        Spi->PeakCommitment = 0; /* FIXME */
-       Spi->PageFaults = 0; /* FIXME */
-       Spi->WriteCopyFaults = 0; /* FIXME */
-       Spi->TransitionFaults = 0; /* FIXME */
-       Spi->CacheTransitionFaults = 0; /* FIXME */
-       Spi->DemandZeroFaults = 0; /* FIXME */
-       Spi->PagesRead = 0; /* FIXME */
-       Spi->PageReadIos = 0; /* FIXME */
-       Spi->CacheReads = 0; /* FIXME */
-       Spi->CacheIos = 0; /* FIXME */
-       Spi->PagefilePagesWritten = 0; /* FIXME */
-       Spi->PagefilePageWriteIos = 0; /* FIXME */
-       Spi->MappedFilePagesWritten = 0; /* FIXME */
-       Spi->MappedFilePageWriteIos = 0; /* FIXME */
-
-       Spi->PagedPoolUsage = MiMemoryConsumers[MC_PPOOL].PagesUsed;
+       Spi->PageFaultCount = 0; /* FIXME */
+       Spi->CopyOnWriteCount = 0; /* FIXME */
+       Spi->TransitionCount = 0; /* FIXME */
+       Spi->CacheTransitionCount = 0; /* FIXME */
+       Spi->DemandZeroCount = 0; /* FIXME */
+       Spi->PageReadCount = 0; /* FIXME */
+       Spi->PageReadIoCount = 0; /* FIXME */
+       Spi->CacheReadCount = 0; /* FIXME */
+       Spi->CacheIoCount = 0; /* FIXME */
+    Spi->DirtyPagesWriteCount = 0; /* FIXME */
+       Spi->DirtyWriteIoCount = 0; /* FIXME */
+       Spi->MappedPagesWriteCount = 0; /* FIXME */
+       Spi->MappedWriteIoCount = 0; /* FIXME */
+
+       Spi->PagedPoolPages = MiMemoryConsumers[MC_PPOOL].PagesUsed;
        Spi->PagedPoolAllocs = 0; /* FIXME */
        Spi->PagedPoolFrees = 0; /* FIXME */
-       Spi->NonPagedPoolUsage = MiMemoryConsumers[MC_NPPOOL].PagesUsed;
+       Spi->NonPagedPoolPages = MiMemoryConsumers[MC_NPPOOL].PagesUsed;
        Spi->NonPagedPoolAllocs = 0; /* FIXME */
        Spi->NonPagedPoolFrees = 0; /* FIXME */
 
-       Spi->TotalFreeSystemPtes = 0; /* FIXME */
+       Spi->FreeSystemPtes = 0; /* FIXME */
 
-       Spi->SystemCodePage = MmStats.NrSystemPages; /* FIXME */
+       Spi->ResidentSystemCodePage = MmStats.NrSystemPages; /* FIXME */
 
        Spi->TotalSystemDriverPages = 0; /* FIXME */
        Spi->TotalSystemCodePages = 0; /* FIXME */
-       Spi->SmallNonPagedLookasideListAllocateHits = 0; /* FIXME */
-       Spi->SmallPagedLookasideListAllocateHits = 0; /* FIXME */
-       Spi->Reserved3 = 0; /* FIXME */
-
-       Spi->MmSystemCachePage = MiMemoryConsumers[MC_CACHE].PagesUsed;
-       Spi->PagedPoolPage = MmPagedPoolSize; /* FIXME */
-
-       Spi->SystemDriverPage = 0; /* FIXME */
-       Spi->FastReadNoWait = 0; /* FIXME */
-       Spi->FastReadWait = 0; /* FIXME */
-       Spi->FastReadResourceMiss = 0; /* FIXME */
-       Spi->FastReadNotPossible = 0; /* FIXME */
-
-       Spi->FastMdlReadNoWait = 0; /* FIXME */
-       Spi->FastMdlReadWait = 0; /* FIXME */
-       Spi->FastMdlReadResourceMiss = 0; /* FIXME */
-       Spi->FastMdlReadNotPossible = 0; /* FIXME */
-
-       Spi->MapDataNoWait = 0; /* FIXME */
-       Spi->MapDataWait = 0; /* FIXME */
-       Spi->MapDataNoWaitMiss = 0; /* FIXME */
-       Spi->MapDataWaitMiss = 0; /* FIXME */
-
-       Spi->PinMappedDataCount = 0; /* FIXME */
-       Spi->PinReadNoWait = 0; /* FIXME */
-       Spi->PinReadWait = 0; /* FIXME */
-       Spi->PinReadNoWaitMiss = 0; /* FIXME */
-       Spi->PinReadWaitMiss = 0; /* FIXME */
-       Spi->CopyReadNoWait = 0; /* FIXME */
-       Spi->CopyReadWait = 0; /* FIXME */
-       Spi->CopyReadNoWaitMiss = 0; /* FIXME */
-       Spi->CopyReadWaitMiss = 0; /* FIXME */
-
-       Spi->MdlReadNoWait = 0; /* FIXME */
-       Spi->MdlReadWait = 0; /* FIXME */
-       Spi->MdlReadNoWaitMiss = 0; /* FIXME */
-       Spi->MdlReadWaitMiss = 0; /* FIXME */
-       Spi->ReadAheadIos = 0; /* FIXME */
-       Spi->LazyWriteIos = 0; /* FIXME */
-       Spi->LazyWritePages = 0; /* FIXME */
-       Spi->DataFlushes = 0; /* FIXME */
-       Spi->DataPages = 0; /* FIXME */
+       Spi->NonPagedPoolLookasideHits = 0; /* FIXME */
+       Spi->PagedPoolLookasideHits = 0; /* FIXME */
+       Spi->Spare3Count = 0; /* FIXME */
+
+       Spi->ResidentSystemCachePage = MiMemoryConsumers[MC_CACHE].PagesUsed;
+       Spi->ResidentPagedPoolPage = MmPagedPoolSize; /* FIXME */
+
+       Spi->ResidentSystemDriverPage = 0; /* FIXME */
+       Spi->CcFastReadNoWait = 0; /* FIXME */
+       Spi->CcFastReadWait = 0; /* FIXME */
+       Spi->CcFastReadResourceMiss = 0; /* FIXME */
+       Spi->CcFastReadNotPossible = 0; /* FIXME */
+
+       Spi->CcFastMdlReadNoWait = 0; /* FIXME */
+       Spi->CcFastMdlReadWait = 0; /* FIXME */
+       Spi->CcFastMdlReadResourceMiss = 0; /* FIXME */
+       Spi->CcFastMdlReadNotPossible = 0; /* FIXME */
+
+       Spi->CcMapDataNoWait = 0; /* FIXME */
+       Spi->CcMapDataWait = 0; /* FIXME */
+       Spi->CcMapDataNoWaitMiss = 0; /* FIXME */
+       Spi->CcMapDataWaitMiss = 0; /* FIXME */
+
+       Spi->CcPinMappedDataCount = 0; /* FIXME */
+       Spi->CcPinReadNoWait = 0; /* FIXME */
+       Spi->CcPinReadWait = 0; /* FIXME */
+       Spi->CcPinReadNoWaitMiss = 0; /* FIXME */
+       Spi->CcPinReadWaitMiss = 0; /* FIXME */
+       Spi->CcCopyReadNoWait = 0; /* FIXME */
+       Spi->CcCopyReadWait = 0; /* FIXME */
+       Spi->CcCopyReadNoWaitMiss = 0; /* FIXME */
+       Spi->CcCopyReadWaitMiss = 0; /* FIXME */
+
+       Spi->CcMdlReadNoWait = 0; /* FIXME */
+       Spi->CcMdlReadWait = 0; /* FIXME */
+       Spi->CcMdlReadNoWaitMiss = 0; /* FIXME */
+       Spi->CcMdlReadWaitMiss = 0; /* FIXME */
+       Spi->CcReadAheadIos = 0; /* FIXME */
+       Spi->CcLazyWriteIos = 0; /* FIXME */
+       Spi->CcLazyWritePages = 0; /* FIXME */
+       Spi->CcDataFlushes = 0; /* FIXME */
+       Spi->CcDataPages = 0; /* FIXME */
        Spi->ContextSwitches = 0; /* FIXME */
        Spi->FirstLevelTbFills = 0; /* FIXME */
        Spi->SecondLevelTbFills = 0; /* FIXME */
@@ -1100,39 +1100,39 @@ QSI_DEF(SystemFullMemoryInformation)
 /* Class 26 - Load Image */
 SSI_DEF(SystemLoadImage)
 {
-  PSYSTEM_LOAD_IMAGE Sli = (PSYSTEM_LOAD_IMAGE)Buffer;
+  PSYSTEM_GDI_DRIVER_INFORMATION Sli = (PSYSTEM_GDI_DRIVER_INFORMATION)Buffer;
 
-  if (sizeof(SYSTEM_LOAD_IMAGE) != Size)
+  if (sizeof(SYSTEM_GDI_DRIVER_INFORMATION) != Size)
     {
       return(STATUS_INFO_LENGTH_MISMATCH);
     }
 
-  return(LdrpLoadImage(&Sli->ModuleName,
-                      &Sli->ModuleBase,
+  return(LdrpLoadImage(&Sli->DriverName,
+                      &Sli->ImageAddress,
                       &Sli->SectionPointer,
                       &Sli->EntryPoint,
-                      &Sli->ExportDirectory));
+                      (PVOID)&Sli->ExportSectionPointer));
 }
 
 /* Class 27 - Unload Image */
 SSI_DEF(SystemUnloadImage)
 {
-  PSYSTEM_UNLOAD_IMAGE Sui = (PSYSTEM_UNLOAD_IMAGE)Buffer;
+  PVOID Sui = (PVOID)Buffer;
 
-  if (sizeof(SYSTEM_UNLOAD_IMAGE) != Size)
+  if (sizeof(PVOID) != Size)
     {
       return(STATUS_INFO_LENGTH_MISMATCH);
     }
 
-  return(LdrpUnloadImage(Sui->ModuleBase));
+  return(LdrpUnloadImage(Sui));
 }
 
 /* Class 28 - Time Adjustment Information */
 QSI_DEF(SystemTimeAdjustmentInformation)
 {
-       if (sizeof (SYSTEM_SET_TIME_ADJUSTMENT) > Size)
+       if (sizeof (SYSTEM_SET_TIME_ADJUST_INFORMATION) > Size)
        {
-               * ReqSize = sizeof (SYSTEM_SET_TIME_ADJUSTMENT);
+               * ReqSize = sizeof (SYSTEM_SET_TIME_ADJUST_INFORMATION);
                return (STATUS_INFO_LENGTH_MISMATCH);
        }
        /* FIXME: */
@@ -1142,7 +1142,7 @@ QSI_DEF(SystemTimeAdjustmentInformation)
 
 SSI_DEF(SystemTimeAdjustmentInformation)
 {
-       if (sizeof (SYSTEM_SET_TIME_ADJUSTMENT) > Size)
+       if (sizeof (SYSTEM_SET_TIME_ADJUST_INFORMATION) > Size)
        {
                return (STATUS_INFO_LENGTH_MISMATCH);
        }
@@ -1229,7 +1229,7 @@ QSI_DEF(SystemRegistryQuotaInformation)
   DPRINT1("Faking max registry size of 32 MB\n");
   srqi->RegistryQuotaAllowed = 0x2000000;
   srqi->RegistryQuotaUsed = 0x200000;
-  srqi->Reserved1 = (void*)0x200000;
+  srqi->PagedPoolSize = 0x200000;
 
   return STATUS_SUCCESS;
 }
@@ -1244,14 +1244,14 @@ SSI_DEF(SystemRegistryQuotaInformation)
 /* Class 38 - Load And Call Image */
 SSI_DEF(SystemLoadAndCallImage)
 {
-  PSYSTEM_LOAD_AND_CALL_IMAGE Slci = (PSYSTEM_LOAD_AND_CALL_IMAGE)Buffer;
+  PUNICODE_STRING Slci = (PUNICODE_STRING)Buffer;
 
-  if (sizeof(SYSTEM_LOAD_AND_CALL_IMAGE) != Size)
+  if (sizeof(UNICODE_STRING) != Size)
     {
       return(STATUS_INFO_LENGTH_MISMATCH);
     }
 
-  return(LdrpLoadAndCallImage(&Slci->ModuleName));
+  return(LdrpLoadAndCallImage(Slci));
 }
 
 /* Class 39 - Priority Separation */
@@ -1532,7 +1532,7 @@ NtQuerySystemInformation (IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
   /*
    * Check the request is valid.
    */
-  if ((SystemInformationClass >= SystemInformationClassMin) &&
+  if ((SystemInformationClass >= SystemBasicInformation) &&
       (SystemInformationClass < SystemInformationClassMax))
     {
       if (NULL != CallQS [SystemInformationClass].Query)
@@ -1609,7 +1609,7 @@ NtSetSystemInformation (
        /*
         * Check the request is valid.
         */
-       if (    (SystemInformationClass >= SystemInformationClassMin)
+       if (    (SystemInformationClass >= SystemBasicInformation)
                && (SystemInformationClass < SystemInformationClassMax)
                )
        {
index 04b56f6..a5dd22a 100644 (file)
 POBJECT_TYPE EXPORTED ExWindowStationObjectType = NULL;
 POBJECT_TYPE EXPORTED ExDesktopObjectType = NULL;
 
-static GENERIC_MAPPING ExpWindowStationMapping = {
-
-    STANDARD_RIGHTS_READ     | WINSTA_ENUMDESKTOPS      | WINSTA_ENUMERATE         | WINSTA_READATTRIBUTES | WINSTA_READSCREEN,
-    STANDARD_RIGHTS_WRITE    | WINSTA_ACCESSCLIPBOARD   | WINSTA_CREATEDESKTOP     | WINSTA_WRITEATTRIBUTES,
-    STANDARD_RIGHTS_EXECUTE  | WINSTA_ACCESSGLOBALATOMS | WINSTA_EXITWINDOWS,
-    STANDARD_RIGHTS_REQUIRED | WINSTA_ACCESSCLIPBOARD   | WINSTA_ACCESSGLOBALATOMS | WINSTA_CREATEDESKTOP  |
-                               WINSTA_ENUMDESKTOPS      | WINSTA_ENUMERATE         | WINSTA_EXITWINDOWS    |
-                               WINSTA_READATTRIBUTES    | WINSTA_READSCREEN        | WINSTA_WRITEATTRIBUTES
+static GENERIC_MAPPING ExpWindowStationMapping = 
+{
+    STANDARD_RIGHTS_READ,
+    STANDARD_RIGHTS_WRITE,
+    STANDARD_RIGHTS_EXECUTE,
+    STANDARD_RIGHTS_REQUIRED
 };
 
-static GENERIC_MAPPING ExpDesktopMapping = {
-
-    STANDARD_RIGHTS_READ     | DESKTOP_ENUMERATE       | DESKTOP_READOBJECTS,
-    STANDARD_RIGHTS_WRITE    | DESKTOP_CREATEMENU      | DESKTOP_CREATEWINDOW    | DESKTOP_HOOKCONTROL   |
-                               DESKTOP_JOURNALPLAYBACK | DESKTOP_JOURNALRECORD   | DESKTOP_WRITEOBJECTS,
-    STANDARD_RIGHTS_EXECUTE  | DESKTOP_SWITCHDESKTOP,
-    STANDARD_RIGHTS_REQUIRED | DESKTOP_CREATEMENU      | DESKTOP_CREATEWINDOW    | DESKTOP_ENUMERATE     |
-                               DESKTOP_HOOKCONTROL     | DESKTOP_JOURNALPLAYBACK | DESKTOP_JOURNALRECORD |
-                               DESKTOP_READOBJECTS     | DESKTOP_SWITCHDESKTOP   | DESKTOP_WRITEOBJECTS
+static GENERIC_MAPPING ExpDesktopMapping =
+{
+    STANDARD_RIGHTS_READ,
+    STANDARD_RIGHTS_WRITE,
+    STANDARD_RIGHTS_EXECUTE,
+    STANDARD_RIGHTS_REQUIRED
 };
 
 OB_OPEN_METHOD ExpWindowStationObjectOpen = NULL;
index a9ef354..9a35850 100755 (executable)
@@ -37,9 +37,8 @@ InbvCheckBootVid(VOID)
     {
       NTSTATUS Status;
       OBJECT_ATTRIBUTES ObjectAttributes;
-      UNICODE_STRING BootVidName;
+      UNICODE_STRING BootVidName = RTL_CONSTANT_STRING(L"\\Device\\BootVid");
 
-      RtlRosInitUnicodeStringFromLiteral(&BootVidName, L"\\Device\\BootVid");
       InitializeObjectAttributes(&ObjectAttributes,
                                 &BootVidName,
                                 0,
index df46642..9be2541 100644 (file)
@@ -576,6 +576,18 @@ VOID
 STDCALL
 KeFlushCurrentTb(VOID);
 
+/* REACTOS SPECIFIC */
+
+VOID STDCALL
+KeRosDumpStackFrames(
+  PULONG  Frame,
+  ULONG  FrameCount);
+
+ULONG STDCALL
+KeRosGetStackFrames(
+  PULONG  Frames,
+  ULONG  FrameCount);
+  
 VOID
 KiSetSystemTime(PLARGE_INTEGER NewSystemTime);
 
index 154c4ad..5c8a8f0 100644 (file)
@@ -85,6 +85,8 @@ typedef ULONG PFN_TYPE, *PPFN_TYPE;
 #define MM_LOWEST_USER_ADDRESS (PVOID)0x10000
 #endif
 
+#define TEB_BASE        (0x7FFDE000)
+
 #define MM_VIRTMEM_GRANULARITY (64 * 1024) /* Although Microsoft says this isn't hardcoded anymore,
                                               they won't be able to change it. Stuff depends on it */
 
index 74fb7d2..1033e9a 100644 (file)
 #define PAGE_LOCKED_FUNCTION   PLACE_IN_SECTION("pagelk")
 #define PAGE_UNLOCKED_FUNCTION PLACE_IN_SECTION("pagepo")
 
+#ifdef _NTOSKRNL_
+
+#include "ke.h"
+#include "i386/segment.h"
+#include "i386/mm.h"
+#include "i386/fpu.h"
+#include "module.h"
+#include "pool.h"
+#include "ob.h"
+#include "mm.h"
+#include "ps.h"
+#include "cc.h"
+#include "io.h"
+#include "po.h"
+#include "se.h"
+#include "ldr.h"
+#include "kd.h"
+#include "ex.h"
+#include "xhal.h"
+#include "v86m.h"
+#include "ifs.h"
+#include "port.h"
+#include "nls.h"
+#ifdef KDBG
+#include "kdb.h"
+#endif
+#include "dbgk.h"
+#include "trap.h"
+#include "safe.h"
+#include "tag.h"
+#include "test.h"
+#include "inbv.h"
+
+
 #include <pshpack1.h>
 /*
  * Defines a descriptor as it appears in the processor tables
@@ -62,6 +96,7 @@ RtlpCreateUnicodeString(
    IN PCWSTR  Source,
    IN POOL_TYPE PoolType);
    
+#endif
 #endif /* __ASM__ */
 
 /*
index 4c6f846..606f150 100644 (file)
@@ -95,6 +95,61 @@ typedef struct _QUEUEDMESSAGE
   UCHAR                MessageData [MAX_MESSAGE_DATA];
 } QUEUEDMESSAGE,  *PQUEUEDMESSAGE;
 
+typedef struct _LPC_DBG_MESSAGE
+{
+   LPC_MESSAGE Header;
+   ULONG Type;
+   ULONG Status;
+   union
+     {
+       struct
+         {
+            EXCEPTION_RECORD ExceptionRecord;
+            ULONG FirstChance;
+         } Exception;
+       struct
+         {
+            ULONG Reserved;
+            PVOID StartAddress;
+         } CreateThread;
+       struct
+         {
+            ULONG Reserved;
+            HANDLE FileHandle;
+            PVOID Base;
+            ULONG PointerToSymbolTable;
+            ULONG NumberOfSymbols;
+            ULONG Reserved2;
+            PVOID EntryPoint;
+         } CreateProcess;
+       struct
+         {
+            ULONG ExitCode;
+         } ExitThread;
+       struct
+         {
+            ULONG ExitCode;
+         } ExitProcess;
+       struct
+         {
+            HANDLE FileHandle;
+            PVOID Base;
+            ULONG PointerToSymbolTable;
+            ULONG NumberOfSymbols;
+         } LoadDll;
+       struct
+         {
+            PVOID Base;
+         } UnloadDll;
+     } Data;
+} LPC_DBG_MESSAGE, *PLPC_DBG_MESSAGE;
+
+typedef struct _LPC_TERMINATION_MESSAGE
+{
+   LPC_MESSAGE Header;
+   LARGE_INTEGER CreationTime;
+} LPC_TERMINATION_MESSAGE, *PLPC_TERMINATION_MESSAGE;
+
 /* Code in ntoskrnl/lpc/close.h */
 
 VOID STDCALL
index e0392dc..678d772 100644 (file)
@@ -542,7 +542,7 @@ typedef struct _EJOB
   UINT PeakJobMemoryUsed;
   UINT CurrentJobMemoryUsed;
   FAST_MUTEX MemoryLimitsLock;
-} EJOB;
+} EJOB, *PEJOB;
 #include <poppack.h>
 
 VOID INIT_FUNCTION PsInitJobManagment(VOID);
index 2e09ea5..fc41ac8 100755 (executable)
@@ -5,76 +5,37 @@
 
 /* include the ntoskrnl config.h file */
 #include "config.h"
-
-#include <roskrnl.h>
+#include <roscfg.h>
+  
+/* DDK/IFS/NDK Headers */
 #include <ddk/ntddk.h>
 #include <ddk/ntifs.h>
 #include <ddk/wdmguid.h>
-
+#include <ndk/ntndk.h>
 #undef IO_TYPE_FILE
 #define IO_TYPE_FILE                    0x0F5L /* Temp Hack */
+  
+/* FIXME: Add to ndk, or at least move somewhere else */
+#include <ntos/ntpnp.h>
+#include <napi/core.h>
 
-#include <roscfg.h>
+/* ReactOS Headers */
 #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>
+
+/* C Headers */
 #include <malloc.h>
 #include <wchar.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 <ntdll/ldr.h>
+
+/* SEH support with PSEH */
 #include <pseh.h>
-#include <internal/ctype.h>
-#include <internal/ntoskrnl.h>
-#include <internal/ke.h>
-#include <internal/i386/segment.h>
-#include <internal/i386/mm.h>
-#include <internal/i386/fpu.h>
-#include <internal/module.h>
-#include <internal/pool.h>
-#include <internal/ob.h>
-#include <internal/mm.h>
-#include <internal/ps.h>
-#include <internal/cc.h>
-#include <internal/io.h>
-#include <internal/po.h>
-#include <internal/se.h>
-#include <internal/ldr.h>
-#include <internal/kd.h>
-#include <internal/ex.h>
-#include "internal/xhal.h"
-#include <internal/v86m.h>
-#include <internal/ifs.h>
-#include <internal/port.h>
-#include <internal/nls.h>
-#ifdef KDBG
-#include <internal/kdb.h>
-#endif
-#include <internal/dbgk.h>
-#include <internal/trap.h>
-#include <internal/safe.h>
-#include <internal/tag.h>
-#include <internal/test.h>
-#include <internal/inbv.h>
-#include <napi/core.h>
-#include <napi/dbg.h>
-#include <napi/teb.h>
-#include <napi/win32.h>
 
-#ifndef TAG
-#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
-#endif
+/* Helper Header */
+#include <reactos/helper.h>
+
+/* Internal Headers */
+#include "internal/ntoskrnl.h"
 
 #endif /* INCLUDE_NTOSKRNL_H */
index a317cec..cff2b24 100644 (file)
@@ -311,7 +311,7 @@ IoCreateSystemRootLink(PCHAR ParameterLine)
 {
   OBJECT_ATTRIBUTES ObjectAttributes;
   IO_STATUS_BLOCK IoStatusBlock;
-  UNICODE_STRING LinkName;
+  UNICODE_STRING LinkName = RTL_CONSTANT_STRING(L"\\SystemRoot");
   UNICODE_STRING DeviceName;
   UNICODE_STRING ArcName;
   UNICODE_STRING BootPath;
@@ -445,9 +445,6 @@ IoCreateSystemRootLink(PCHAR ParameterLine)
   DPRINT("DeviceName: %wZ\n", &DeviceName);
 
   /* create the '\SystemRoot' link */
-  RtlRosInitUnicodeStringFromLiteral(&LinkName,
-                      L"\\SystemRoot");
-
   Status = IoCreateSymbolicLink(&LinkName,
                                &DeviceName);
   ExFreePool(DeviceName.Buffer);
index 73d0106..a859dbe 100644 (file)
@@ -72,7 +72,7 @@ static LIST_ENTRY GroupListHead = {NULL, NULL};
 static LIST_ENTRY ServiceListHead  = {NULL, NULL};
 
 static UNICODE_STRING IopHardwareDatabaseKey =
-   ROS_STRING_INITIALIZER(L"\\REGISTRY\\MACHINE\\HARDWARE\\DESCRIPTION\\SYSTEM");
+   RTL_CONSTANT_STRING(L"\\REGISTRY\\MACHINE\\HARDWARE\\DESCRIPTION\\SYSTEM");
 
 POBJECT_TYPE EXPORTED IoDriverObjectType = NULL;
 
@@ -1019,7 +1019,7 @@ IoCreateDriverList(VOID)
   RTL_QUERY_REGISTRY_TABLE QueryTable[2];
   PKEY_BASIC_INFORMATION KeyInfo = NULL;
   OBJECT_ATTRIBUTES ObjectAttributes;
-  UNICODE_STRING ServicesKeyName;
+  UNICODE_STRING ServicesKeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet\\Services");
   UNICODE_STRING SubKeyName;
   HANDLE KeyHandle;
   NTSTATUS Status;
@@ -1050,9 +1050,6 @@ IoCreateDriverList(VOID)
     return(Status);
 
   /* Enumerate services and create the service list */
-  RtlRosInitUnicodeStringFromLiteral(&ServicesKeyName,
-                      L"\\Registry\\Machine\\System\\CurrentControlSet\\Services");
-
   InitializeObjectAttributes(&ObjectAttributes,
                             &ServicesKeyName,
                             OBJ_CASE_INSENSITIVE,
index ea4dca5..f4b70f8 100644 (file)
@@ -14,9 +14,6 @@
 #define NDEBUG
 #include <internal/debug.h>
 
-/* FIXME: Header mess */
-#undef CreateMailslot
-
 /* GLOBALS *******************************************************************/
 
 extern GENERIC_MAPPING IopFileMapping;
@@ -3004,7 +3001,7 @@ NTSTATUS
 STDCALL
 NtSetQuotaInformationFile(HANDLE FileHandle,
                           PIO_STATUS_BLOCK IoStatusBlock,
-                          PFILE_USER_QUOTA_INFORMATION Buffer,
+                          PFILE_QUOTA_INFORMATION Buffer,
                           ULONG BufferLength)
 {
     UNIMPLEMENTED;
index b5615aa..4653c87 100644 (file)
@@ -182,7 +182,7 @@ IoInit (VOID)
     UNICODE_STRING Name;
     OBJECT_ATTRIBUTES ObjectAttributes;
     UNICODE_STRING DirName;
-    UNICODE_STRING LinkName;
+    UNICODE_STRING LinkName = RTL_CONSTANT_STRING(L"\\DosDevices");
     HANDLE Handle;
 
     IopInitDriverImplementation();
@@ -222,7 +222,7 @@ IoInit (VOID)
   /*
    * Create the '\Driver' object directory
    */
-  RtlRosInitUnicodeStringFromLiteral(&DirName, L"\\Driver");
+  RtlInitUnicodeString(&DirName, L"\\Driver");
   InitializeObjectAttributes(&ObjectAttributes,
                             &DirName,
                             0,
@@ -235,7 +235,7 @@ IoInit (VOID)
   /*
    * Create the '\FileSystem' object directory
    */
-  RtlRosInitUnicodeStringFromLiteral(&DirName,
+  RtlInitUnicodeString(&DirName,
                       L"\\FileSystem");
   InitializeObjectAttributes(&ObjectAttributes,
                             &DirName,
@@ -249,7 +249,7 @@ IoInit (VOID)
   /*
    * Create the '\Device' directory
    */
-  RtlRosInitUnicodeStringFromLiteral(&DirName,
+  RtlInitUnicodeString(&DirName,
                       L"\\Device");
   InitializeObjectAttributes(&ObjectAttributes,
                             &DirName,
@@ -263,7 +263,7 @@ IoInit (VOID)
   /*
    * Create the '\??' directory
    */
-  RtlRosInitUnicodeStringFromLiteral(&DirName,
+  RtlInitUnicodeString(&DirName,
                       L"\\??");
   InitializeObjectAttributes(&ObjectAttributes,
                             &DirName,
@@ -277,7 +277,7 @@ IoInit (VOID)
   /*
    * Create the '\ArcName' directory
    */
-  RtlRosInitUnicodeStringFromLiteral(&DirName,
+  RtlInitUnicodeString(&DirName,
                       L"\\ArcName");
   InitializeObjectAttributes(&ObjectAttributes,
                             &DirName,
@@ -304,9 +304,7 @@ IoInit (VOID)
   /*
    * Create link from '\DosDevices' to '\??' directory
    */
-  RtlRosInitUnicodeStringFromLiteral(&LinkName,
-                      L"\\DosDevices");
-  RtlRosInitUnicodeStringFromLiteral(&DirName,
+  RtlInitUnicodeString(&DirName,
                       L"\\??");
   IoCreateSymbolicLink(&LinkName,
                       &DirName);
index 3776cca..4a5a006 100644 (file)
 /* INCLUDES ******************************************************************/
 
 #include <ntoskrnl.h>
-#include <ddk/wdmguid.h>
 
 #define NDEBUG
 #include <internal/debug.h>
 
-/* FIXME: Header mess */
-#undef DeviceCapabilities
-
 /* GLOBALS *******************************************************************/
 
 PDEVICE_NODE IopRootDeviceNode;
index a87fa5a..e6e0dc0 100644 (file)
@@ -827,7 +827,7 @@ IoReportHalResourceUsage(PUNICODE_STRING HalDescription,
   HANDLE DescriptionKey;
 
   /* Open/Create 'RESOURCEMAP' key. */
-  RtlRosInitUnicodeStringFromLiteral(&Name,
+  RtlInitUnicodeString(&Name,
                       L"\\Registry\\Machine\\HARDWARE\\RESOURCEMAP");
   InitializeObjectAttributes(&ObjectAttributes,
                             &Name,
@@ -845,7 +845,7 @@ IoReportHalResourceUsage(PUNICODE_STRING HalDescription,
     return(Status);
 
   /* Open/Create 'Hardware Abstraction Layer' key */
-  RtlRosInitUnicodeStringFromLiteral(&Name,
+  RtlInitUnicodeString(&Name,
                       L"Hardware Abstraction Layer");
   InitializeObjectAttributes(&ObjectAttributes,
                             &Name,
@@ -881,7 +881,7 @@ IoReportHalResourceUsage(PUNICODE_STRING HalDescription,
     return(Status);
 
   /* Add '.Raw' value. */
-  RtlRosInitUnicodeStringFromLiteral(&Name,
+  RtlInitUnicodeString(&Name,
                       L".Raw");
   Status = ZwSetValueKey(DescriptionKey,
                         &Name,
@@ -896,7 +896,7 @@ IoReportHalResourceUsage(PUNICODE_STRING HalDescription,
     }
 
   /* Add '.Translated' value. */
-  RtlRosInitUnicodeStringFromLiteral(&Name,
+  RtlInitUnicodeString(&Name,
                       L".Translated");
   Status = ZwSetValueKey(DescriptionKey,
                         &Name,
index 617f106..4a465fd 100644 (file)
@@ -508,7 +508,7 @@ KdbSymLoadUserModuleSymbols(IN PLDR_DATA_TABLE_ENTRY LdrModule)
          LdrModule->FullDllName.Length);
   KernelName.Buffer[KernelName.Length / sizeof(WCHAR)] = L'\0';
 
-  KdbpSymLoadModuleSymbols(&KernelName, &LdrModule->RosSymInfo);
+  KdbpSymLoadModuleSymbols(&KernelName, (PROSSYM_INFO*)&LdrModule->RosSymInfo);
 
   ExFreePool(KernelName.Buffer);
 }
index 65e054f..17433c3 100644 (file)
@@ -456,8 +456,9 @@ Ki386SetProcessorFeatures(VOID)
 {
    PKIPCR Pcr = (PKIPCR)KeGetCurrentKPCR();
    OBJECT_ATTRIBUTES ObjectAttributes;
-   UNICODE_STRING KeyName;
-   UNICODE_STRING ValueName;
+   UNICODE_STRING KeyName =
+   RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Session Manager\\Kernel");
+   UNICODE_STRING ValueName = RTL_CONSTANT_STRING(L"FastSystemCallDisable");
    HANDLE KeyHandle;
    ULONG ResultLength;
    KEY_VALUE_PARTIAL_INFORMATION ValueData;
@@ -488,10 +489,6 @@ Ki386SetProcessorFeatures(VOID)
         /* FIXME: Check for Family == 6, Model < 3 and Stepping < 3 and disable */
 
         /* Make sure it's not disabled in registry */
-        RtlRosInitUnicodeStringFromLiteral(&KeyName,
-                                           L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Session Manager\\Kernel");
-        RtlRosInitUnicodeStringFromLiteral(&ValueName,
-                                           L"FastSystemCallDisable");
         InitializeObjectAttributes(&ObjectAttributes,
                                    &KeyName,
                                    OBJ_CASE_INSENSITIVE,
index ff9d849..dcbad0e 100644 (file)
 #define NDEBUG
 #include <internal/debug.h>
 
-
-/*
- * HACK! No matter what i did, i couldnt get it working when i put these into ntos\rtl.h
- * (got redefinition problems, since ntdll\rtl.h somehow include ntos\rtl.h).
- * We need to merge ntos\rtl.h and ntdll\rtl.h to get this working. -Gunnar
- */
-typedef struct _RTL_PROCESS_INFO
-{
-   ULONG Size;
-   HANDLE ProcessHandle;
-   HANDLE ThreadHandle;
-   CLIENT_ID ClientId;
-   SECTION_IMAGE_INFORMATION ImageInfo;
-} RTL_PROCESS_INFO, *PRTL_PROCESS_INFO;
-
-NTSTATUS
-STDCALL
-RtlCreateUserProcess (
-   IN PUNICODE_STRING         ImageFileName,
-   IN ULONG          Attributes,
-   IN PRTL_USER_PROCESS_PARAMETERS  ProcessParameters,
-   IN PSECURITY_DESCRIPTOR    ProcessSecutityDescriptor OPTIONAL,
-   IN PSECURITY_DESCRIPTOR    ThreadSecurityDescriptor OPTIONAL,
-   IN HANDLE            ParentProcess OPTIONAL,
-   IN BOOLEAN           CurrentDirectory,
-   IN HANDLE            DebugPort OPTIONAL,
-   IN HANDLE            ExceptionPort OPTIONAL,
-   OUT   PRTL_PROCESS_INFO    ProcessInfo
-   );
-
-NTSTATUS
-STDCALL
-RtlCreateProcessParameters (
-   OUT   PRTL_USER_PROCESS_PARAMETERS  *ProcessParameters,
-   IN PUNICODE_STRING   ImagePathName OPTIONAL,
-   IN PUNICODE_STRING   DllPath OPTIONAL,
-   IN PUNICODE_STRING   CurrentDirectory OPTIONAL,
-   IN PUNICODE_STRING   CommandLine OPTIONAL,
-   IN PWSTR    Environment OPTIONAL,
-   IN PUNICODE_STRING   WindowTitle OPTIONAL,
-   IN PUNICODE_STRING   DesktopInfo OPTIONAL,
-   IN PUNICODE_STRING   ShellInfo OPTIONAL,
-   IN PUNICODE_STRING   RuntimeInfo OPTIONAL
-   );
-NTSTATUS
-STDCALL
-RtlDestroyProcessParameters (
-   IN PRTL_USER_PROCESS_PARAMETERS  ProcessParameters
-   );
-
-
-
 /* FUNCTIONS *****************************************************************/
 
-
-
 INIT_FUNCTION
 NTSTATUS
 LdrLoadInitialProcess(PHANDLE ProcessHandle,
                      PHANDLE ThreadHandle)
 {
-   UNICODE_STRING ImagePath;
+   UNICODE_STRING ImagePath = RTL_CONSTANT_STRING(L"\\SystemRoot\\system32\\smss.exe");
    HANDLE SystemProcessHandle;
    NTSTATUS Status;
    PRTL_USER_PROCESS_PARAMETERS Params=NULL;
    RTL_PROCESS_INFO Info;
 
-   /* Get the absolute path to smss.exe. */
-   RtlRosInitUnicodeStringFromLiteral(&ImagePath,
-      L"\\SystemRoot\\system32\\smss.exe");
-
-
    Status = ObpCreateHandle(
       PsGetCurrentProcess(),
       PsInitialSystemProcess,
index 6a5d6b1..bfd49cf 100644 (file)
@@ -46,18 +46,6 @@ STATIC MODULE_TEXT_SECTION NtoskrnlTextSection;
 STATIC MODULE_TEXT_SECTION LdrHalTextSection;
 ULONG_PTR LdrHalBase;
 
-#define OPTHDROFFSET(a) ((LPVOID)((BYTE *)a                 + \
-                        ((PIMAGE_DOS_HEADER)a)->e_lfanew    + \
-                        IMAGE_SIZEOF_NT_OPTIONAL_HEADER     + \
-                        sizeof (IMAGE_FILE_HEADER)))
-
-#ifndef HIWORD
-#define HIWORD(X)   ((WORD) (((DWORD) (X) >> 16) & 0xFFFF))
-#endif
-#ifndef LOWORD
-#define LOWORD(X)   ((WORD) (X))
-#endif
-
 /* FORWARD DECLARATIONS ******************************************************/
 
 NTSTATUS
index d75db35..44e6989 100644 (file)
@@ -173,7 +173,7 @@ STDCALL
 INIT_FUNCTION
 LdrpInitializeSystemDll(VOID)
 {
-    UNICODE_STRING DllPathname = ROS_STRING_INITIALIZER(L"\\SystemRoot\\system32\\ntdll.dll");
+    UNICODE_STRING DllPathname = RTL_CONSTANT_STRING(L"\\SystemRoot\\system32\\ntdll.dll");
     OBJECT_ATTRIBUTES FileObjectAttributes;
     IO_STATUS_BLOCK Iosb;
     HANDLE FileHandle;
index a391752..51f5751 100644 (file)
@@ -90,7 +90,7 @@ LpcpInitializePort (IN OUT  PEPORT Port,
   }
   memset (Port, 0, sizeof(EPORT));
   KeInitializeSpinLock (& Port->Lock);
-  KeInitializeSemaphore( &Port->Semaphore, 0, LONG_MAX );
+  KeInitializeSemaphore( &Port->Semaphore, 0, MAXLONG );
   Port->RequestPort = Parent;
   Port->OtherPort = NULL;
   Port->QueueLength = 0;
index 1a5f69c..6544bf1 100644 (file)
@@ -648,7 +648,7 @@ MmInitializeCrashDump(HANDLE PageFileHandle, ULONG PageFileNum)
    PIRP Irp;
    KEVENT Event;
    IO_STATUS_BLOCK Iosb;
-   UNICODE_STRING DiskDumpName;
+   UNICODE_STRING DiskDumpName = RTL_CONSTANT_STRING(L"DiskDump");
    ANSI_STRING ProcName;
    PIO_STACK_LOCATION StackPtr;
    PMODULE_OBJECT ModuleObject;
@@ -724,7 +724,6 @@ MmInitializeCrashDump(HANDLE PageFileHandle, ULONG PageFileNum)
    }
 
    /* Load the diskdump driver. */
-   RtlRosInitUnicodeStringFromLiteral(&DiskDumpName, L"DiskDump");
    ModuleObject = LdrGetModuleObject(&DiskDumpName);
    if (ModuleObject == NULL)
    {
index fa26807..e8bab05 100644 (file)
@@ -2093,7 +2093,7 @@ MmCreatePhysicalMemorySection(VOID)
    PSECTION_OBJECT PhysSection;
    NTSTATUS Status;
    OBJECT_ATTRIBUTES Obj;
-   UNICODE_STRING Name = ROS_STRING_INITIALIZER(L"\\Device\\PhysicalMemory");
+   UNICODE_STRING Name = RTL_CONSTANT_STRING(L"\\Device\\PhysicalMemory");
    LARGE_INTEGER SectionSize;
 
    /*
index 470f928..3c8f740 100644 (file)
@@ -92,7 +92,7 @@ NtWaitForMultipleObjects(IN ULONG ObjectCount,
               {
                 DPRINT1("Waiting for object type '%wZ' is not supported\n",
                         &BODY_TO_HEADER(ObjectPtrArray[i])->Type->Name);
-                Status = STATUS_HANDLE_NOT_WAITABLE;
+                Status = STATUS_INVALID_HANDLE;
                 i++;
               }
              /* dereference all referenced objects */
@@ -179,7 +179,7 @@ NtWaitForSingleObject(IN HANDLE ObjectHandle,
      {
        DPRINT1("Waiting for object type '%wZ' is not supported\n",
               &BODY_TO_HEADER(ObjectPtr)->Type->Name);
-       Status = STATUS_HANDLE_NOT_WAITABLE;
+       Status = STATUS_INVALID_HANDLE;
      }
    else
      {
index 839bded..65e4183 100644 (file)
@@ -44,7 +44,7 @@ VOID INIT_FUNCTION
 PiInitDefaultLocale(VOID)
 {
    OBJECT_ATTRIBUTES ObjectAttributes;
-   UNICODE_STRING KeyName;
+   UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Nls\\Language");
    UNICODE_STRING ValueName;
    HANDLE KeyHandle;
    ULONG ValueLength;
@@ -56,9 +56,6 @@ PiInitDefaultLocale(VOID)
 
    ValueInfo = (PKEY_VALUE_PARTIAL_INFORMATION)ValueBuffer;
 
-   RtlRosInitUnicodeStringFromLiteral(&KeyName,
-                       L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Nls\\Language");
-
    InitializeObjectAttributes(&ObjectAttributes,
                              &KeyName,
                              OBJ_CASE_INSENSITIVE,
@@ -70,7 +67,7 @@ PiInitDefaultLocale(VOID)
    if (NT_SUCCESS(Status))
      {
        /* Read system locale */
-       RtlRosInitUnicodeStringFromLiteral(&ValueName,
+       RtlInitUnicodeString(&ValueName,
                                           L"Default");
        Status = ZwQueryValueKey(KeyHandle,
                                 &ValueName,
@@ -95,7 +92,7 @@ PiInitDefaultLocale(VOID)
          }
 
        /* Read install language id */
-       RtlRosInitUnicodeStringFromLiteral(&ValueName,
+       RtlInitUnicodeString(&ValueName,
                                           L"InstallLanguage");
        Status = ZwQueryValueKey(KeyHandle,
                                 &ValueName,
@@ -137,8 +134,8 @@ VOID STDCALL
 PiInitThreadLocale(VOID)
 {
    OBJECT_ATTRIBUTES ObjectAttributes;
-   UNICODE_STRING KeyName;
-   UNICODE_STRING ValueName;
+   UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry\\User\\.Default\\Control Panel\\International");
+   UNICODE_STRING ValueName = RTL_CONSTANT_STRING(L"Locale");
    HANDLE KeyHandle;
    ULONG ValueLength;
    UCHAR ValueBuffer[VALUE_BUFFER_SIZE];
@@ -150,11 +147,6 @@ PiInitThreadLocale(VOID)
    ValueInfo = (PKEY_VALUE_PARTIAL_INFORMATION)ValueBuffer;
 
    /* read default thread locale */
-   RtlRosInitUnicodeStringFromLiteral(&KeyName,
-                       L"\\Registry\\User\\.Default\\Control Panel\\International");
-   RtlRosInitUnicodeStringFromLiteral(&ValueName,
-                       L"Locale");
-
    InitializeObjectAttributes(&ObjectAttributes,
                              &KeyName,
                              OBJ_CASE_INSENSITIVE,
@@ -264,17 +256,17 @@ NtSetDefaultLocale(IN BOOLEAN UserProfile,
                                    &UserKey);
        if (!NT_SUCCESS(Status))
          return(Status);
-       RtlRosInitUnicodeStringFromLiteral(&KeyName,
+       RtlInitUnicodeString(&KeyName,
                             L"Control Panel\\International");
-       RtlRosInitUnicodeStringFromLiteral(&ValueName,
+       RtlInitUnicodeString(&ValueName,
                             L"Locale");
      }
    else
      {
        /* system locale */
-       RtlRosInitUnicodeStringFromLiteral(&KeyName,
+       RtlInitUnicodeString(&KeyName,
                             L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Nls\\Language");
-       RtlRosInitUnicodeStringFromLiteral(&ValueName,
+       RtlInitUnicodeString(&ValueName,
                             L"Default");
      }
 
@@ -354,8 +346,8 @@ NtQueryDefaultUILanguage(OUT PLANGID LanguageId)
   UCHAR ValueBuffer[VALUE_BUFFER_SIZE];
   PKEY_VALUE_PARTIAL_INFORMATION ValueInfo;
   OBJECT_ATTRIBUTES ObjectAttributes;
-  UNICODE_STRING KeyName;
-  UNICODE_STRING ValueName;
+  UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"Control Panel\\International");
+  UNICODE_STRING ValueName = RTL_CONSTANT_STRING(L"MultiUILanguageId");
   UNICODE_STRING ValueString;
   ULONG ValueLength;
   ULONG Value;
@@ -373,11 +365,6 @@ NtQueryDefaultUILanguage(OUT PLANGID LanguageId)
       return STATUS_SUCCESS;
     }
 
-  RtlRosInitUnicodeStringFromLiteral(&KeyName,
-                                    L"Control Panel\\International");
-  RtlRosInitUnicodeStringFromLiteral(&ValueName,
-                                    L"MultiUILanguageId");
-
   InitializeObjectAttributes(&ObjectAttributes,
                             &KeyName,
                             OBJ_CASE_INSENSITIVE,
@@ -452,8 +439,8 @@ NTSTATUS STDCALL
 NtSetDefaultUILanguage(IN LANGID LanguageId)
 {
   OBJECT_ATTRIBUTES ObjectAttributes;
-  UNICODE_STRING KeyName;
-  UNICODE_STRING ValueName;
+  UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"Control Panel\\Desktop");
+  UNICODE_STRING ValueName = RTL_CONSTANT_STRING(L"MultiUILanguageId");
   WCHAR ValueBuffer[8];
   ULONG ValueLength;
   HANDLE UserHandle;
@@ -469,11 +456,6 @@ NtSetDefaultUILanguage(IN LANGID LanguageId)
       return Status;
     }
 
-  RtlRosInitUnicodeStringFromLiteral(&KeyName,
-                                    L"Control Panel\\Desktop");
-  RtlRosInitUnicodeStringFromLiteral(&ValueName,
-                                    L"MultiUILanguageId");
-
   InitializeObjectAttributes(&ObjectAttributes,
                             &KeyName,
                             OBJ_CASE_INSENSITIVE,
index 58f52ba..cae8cae 100644 (file)
@@ -190,9 +190,9 @@ NtQueryInformationProcess(IN  HANDLE ProcessHandle,
          ProcessBasicInformationP->PebBaseAddress = Process->Peb;
          ProcessBasicInformationP->AffinityMask = Process->Pcb.Affinity;
          ProcessBasicInformationP->UniqueProcessId =
-           Process->UniqueProcessId;
+           (ULONG)Process->UniqueProcessId;
          ProcessBasicInformationP->InheritedFromUniqueProcessId =
-           Process->InheritedFromUniqueProcessId;
+           (ULONG)Process->InheritedFromUniqueProcessId;
          ProcessBasicInformationP->BasePriority =
            Process->Pcb.BasePriority;
 
index 6bfb29e..763ea5f 100644 (file)
@@ -196,7 +196,7 @@ PspCreateThread(OUT PHANDLE ThreadHandle,
 
     /* Initialize LPC */
     DPRINT("Initialliazing Thread Semaphore\n");
-    KeInitializeSemaphore(&Thread->LpcReplySemaphore, 0, LONG_MAX);
+    KeInitializeSemaphore(&Thread->LpcReplySemaphore, 0, MAXLONG);
 
     /* Allocate Stack for non-GUI Thread */
     DPRINT("Initialliazing Thread Stack\n");
index 944a1a5..acb7fa7 100644 (file)
 /* INCLUDES ******************************************************************/
 
 #include <ntoskrnl.h>
-#include <internal/ps.h>
 #define NDEBUG
 #include <internal/debug.h>
 
-//FIXME: sort this out somehow. IAI: Sorted in new header branch
-#define PRTL_CRITICAL_SECTION PVOID
-
 /* FUNCTIONS *****************************************************************/
 
 
index 788886c..9596548 100644 (file)
 #define NDEBUG
 #include <internal/debug.h>
 
-
-#define ROUND_DOWN(N, S) ((N) - ((N) % (S)))
-
 typedef struct _RTL_RANGE_ENTRY
 {
   LIST_ENTRY Entry;
   RTL_RANGE Range;
 } RTL_RANGE_ENTRY, *PRTL_RANGE_ENTRY;
 
-
 /* FUNCTIONS ***************************************************************/
 
 /**********************************************************************
index 504ef8f..d2c8c37 100644 (file)
@@ -558,7 +558,7 @@ int sprintf(char * buf, const char *fmt, ...)
   int i;
 
   va_start(args, fmt);
-  i=_vsnprintf(buf,INT_MAX,fmt,args);
+  i=_vsnprintf(buf,MAXLONG,fmt,args);
   va_end(args);
   return i;
 }
@@ -584,7 +584,7 @@ int _snprintf(char * buf, size_t cnt, const char *fmt, ...)
  */
 int vsprintf(char *buf, const char *fmt, va_list args)
 {
-  return _vsnprintf(buf,INT_MAX,fmt,args);
+  return _vsnprintf(buf,MAXLONG,fmt,args);
 }
 
 /* EOF */
index a27402a..92b0da7 100644 (file)
@@ -73,7 +73,7 @@ long atol(const char *str)
    * Set any if any `digits' consumed; make it negative to indicate
    * overflow.
    */
-  cutoff = neg ? -(unsigned long)LONG_MIN : LONG_MAX;
+  cutoff = neg ? -(unsigned long)MINLONG : MAXLONG;
   cutlim = cutoff % (unsigned long)10;
   cutoff /= (unsigned long)10;
   for (acc = 0, any = 0;; c = *s++)
@@ -95,7 +95,7 @@ long atol(const char *str)
   }
   if (any < 0)
   {
-    acc = neg ? LONG_MIN : LONG_MAX;
+    acc = neg ? MINLONG : MAXLONG;
   }
   else if (neg)
     acc = -acc;
index 9c9cc7d..7d23144 100644 (file)
@@ -546,7 +546,7 @@ int swprintf(wchar_t *buf, const wchar_t *fmt, ...)
        int i;
 
        va_start(args, fmt);
-       i=_vsnwprintf(buf,INT_MAX,fmt,args);
+       i=_vsnwprintf(buf,MAXLONG,fmt,args);
        va_end(args);
        return i;
 }
@@ -569,7 +569,7 @@ int _snwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, ...)
 
 int vswprintf(wchar_t *buf, const wchar_t *fmt, va_list args)
 {
-       return _vsnwprintf(buf,INT_MAX,fmt,args);
+       return _vsnwprintf(buf,MAXLONG,fmt,args);
 }
 
 /* EOF */