Build ntoskrnl with NDK, and don't use rosrtl

svn path=/trunk/; revision=16266
This commit is contained in:
Alex Ionescu 2005-06-25 14:04:56 +00:00
parent a9a36a579f
commit 95f0ca7fdb
34 changed files with 284 additions and 340 deletions

View file

@ -136,7 +136,7 @@ typedef NTSTATUS
(STDCALL *PW32_THREAD_CALLBACK)(struct _ETHREAD *Thread, (STDCALL *PW32_THREAD_CALLBACK)(struct _ETHREAD *Thread,
BOOLEAN Create); BOOLEAN Create);
typedef struct _EJOB *PEJOB; struct _EJOB;
NTSTATUS STDCALL NTSTATUS STDCALL
PsCreateSystemProcess (PHANDLE ProcessHandle, PsCreateSystemProcess (PHANDLE ProcessHandle,
@ -189,19 +189,19 @@ STDCALL PsGetCurrentThreadStackLimit (
PVOID PVOID
STDCALL PsGetJobLock( STDCALL PsGetJobLock(
PEJOB Job struct _EJOB* Job
); );
PVOID PVOID
STDCALL PsGetJobSessionId( STDCALL PsGetJobSessionId(
PEJOB Job struct _EJOB* Job
); );
ULONG ULONG
STDCALL PsGetJobUIRestrictionsClass( STDCALL PsGetJobUIRestrictionsClass(
PEJOB Job struct _EJOB* Job
); );
@ -247,7 +247,7 @@ STDCALL PsGetProcessInheritedFromUniqueProcessId(
); );
PEJOB struct _EJOB*
STDCALL PsGetProcessJob( STDCALL PsGetProcessJob(
PEPROCESS Process PEPROCESS Process
); );
@ -378,7 +378,7 @@ PsRevertThreadToSelf(
VOID VOID
STDCALL PsSetJobUIRestrictionsClass( STDCALL PsSetJobUIRestrictionsClass(
PEJOB Job, struct _EJOB* Job,
ULONG UIRestrictionsClass ULONG UIRestrictionsClass
); );

View file

@ -4,6 +4,7 @@
#include <ntos/ntdef.h> #include <ntos/ntdef.h>
#include <ntos/types.h> #include <ntos/types.h>
#ifndef __USE_W32API
/* Privileges */ /* Privileges */
#define SE_MIN_WELL_KNOWN_PRIVILEGE (2L) #define SE_MIN_WELL_KNOWN_PRIVILEGE (2L)
#define SE_CREATE_TOKEN_PRIVILEGE (2L) #define SE_CREATE_TOKEN_PRIVILEGE (2L)
@ -31,7 +32,7 @@
#define SE_CHANGE_NOTIFY_PRIVILEGE (23L) #define SE_CHANGE_NOTIFY_PRIVILEGE (23L)
#define SE_REMOTE_SHUTDOWN_PRIVILEGE (24L) #define SE_REMOTE_SHUTDOWN_PRIVILEGE (24L)
#define SE_MAX_WELL_KNOWN_PRIVILEGE SE_REMOTE_SHUTDOWN_PRIVILEGE #define SE_MAX_WELL_KNOWN_PRIVILEGE SE_REMOTE_SHUTDOWN_PRIVILEGE
#endif
/* TOKEN_GROUPS structure */ /* TOKEN_GROUPS structure */
#ifndef SE_GROUP_MANDATORY #ifndef SE_GROUP_MANDATORY
#define SE_GROUP_MANDATORY (0x1L) #define SE_GROUP_MANDATORY (0x1L)

View file

@ -97,7 +97,7 @@ ExIsProcessorFeaturePresent(IN ULONG ProcessorFeature)
NTSTATUS STDCALL NTSTATUS STDCALL
NtQuerySystemEnvironmentValue (IN PUNICODE_STRING VariableName, NtQuerySystemEnvironmentValue (IN PUNICODE_STRING VariableName,
OUT PWCHAR ValueBuffer, OUT PWSTR ValueBuffer,
IN ULONG ValueBufferLength, IN ULONG ValueBufferLength,
IN OUT PULONG ReturnLength OPTIONAL) IN OUT PULONG ReturnLength OPTIONAL)
{ {
@ -353,17 +353,17 @@ QSI_DEF(SystemBasicInformation)
{ {
return (STATUS_INFO_LENGTH_MISMATCH); return (STATUS_INFO_LENGTH_MISMATCH);
} }
Sbi->Unknown = 0; Sbi->Reserved = 0;
Sbi->MaximumIncrement = KeMaximumIncrement; Sbi->TimerResolution = KeMaximumIncrement;
Sbi->PhysicalPageSize = PAGE_SIZE; Sbi->PageSize = PAGE_SIZE;
Sbi->NumberOfPhysicalPages = MmStats.NrTotalPages; Sbi->NumberOfPhysicalPages = MmStats.NrTotalPages;
Sbi->LowestPhysicalPage = 0; /* FIXME */ Sbi->LowestPhysicalPageNumber = 0; /* FIXME */
Sbi->HighestPhysicalPage = MmStats.NrTotalPages; /* FIXME */ Sbi->HighestPhysicalPageNumber = MmStats.NrTotalPages; /* FIXME */
Sbi->AllocationGranularity = MM_VIRTMEM_GRANULARITY; /* hard coded on Intel? */ Sbi->AllocationGranularity = MM_VIRTMEM_GRANULARITY; /* hard coded on Intel? */
Sbi->LowestUserAddress = 0x10000; /* Top of 64k */ Sbi->MinimumUserModeAddress = 0x10000; /* Top of 64k */
Sbi->HighestUserAddress = (ULONG_PTR)MmHighestUserAddress; Sbi->MaximumUserModeAddress = (ULONG_PTR)MmHighestUserAddress;
Sbi->ActiveProcessors = KeActiveProcessors; Sbi->ActiveProcessorsAffinityMask = KeActiveProcessors;
Sbi->NumberProcessors = KeNumberProcessors; Sbi->NumberOfProcessors = KeNumberProcessors;
return (STATUS_SUCCESS); return (STATUS_SUCCESS);
} }
@ -385,8 +385,8 @@ QSI_DEF(SystemProcessorInformation)
Spi->ProcessorArchitecture = 0; /* Intel Processor */ Spi->ProcessorArchitecture = 0; /* Intel Processor */
Spi->ProcessorLevel = Prcb->CpuType; Spi->ProcessorLevel = Prcb->CpuType;
Spi->ProcessorRevision = Prcb->CpuStep; Spi->ProcessorRevision = Prcb->CpuStep;
Spi->Unknown = 0; Spi->Reserved = 0;
Spi->FeatureBits = Prcb->FeatureBits; Spi->ProcessorFeatureBits = Prcb->FeatureBits;
DPRINT("Arch %d Level %d Rev 0x%x\n", Spi->ProcessorArchitecture, DPRINT("Arch %d Level %d Rev 0x%x\n", Spi->ProcessorArchitecture,
Spi->ProcessorLevel, Spi->ProcessorRevision); Spi->ProcessorLevel, Spi->ProcessorRevision);
@ -413,21 +413,21 @@ QSI_DEF(SystemPerformanceInformation)
TheIdleProcess = PsIdleProcess; TheIdleProcess = PsIdleProcess;
Spi->IdleTime.QuadPart = TheIdleProcess->Pcb.KernelTime * 100000LL; Spi->IdleProcessTime.QuadPart = TheIdleProcess->Pcb.KernelTime * 100000LL;
Spi->ReadTransferCount = IoReadTransferCount; Spi->IoReadTransferCount = IoReadTransferCount;
Spi->WriteTransferCount = IoWriteTransferCount; Spi->IoWriteTransferCount = IoWriteTransferCount;
Spi->OtherTransferCount = IoOtherTransferCount; Spi->IoOtherTransferCount = IoOtherTransferCount;
Spi->ReadOperationCount = IoReadOperationCount; Spi->IoReadOperationCount = IoReadOperationCount;
Spi->WriteOperationCount = IoWriteOperationCount; Spi->IoWriteOperationCount = IoWriteOperationCount;
Spi->OtherOperationCount = IoOtherOperationCount; Spi->IoOtherOperationCount = IoOtherOperationCount;
Spi->AvailablePages = MmStats.NrFreePages; Spi->AvailablePages = MmStats.NrFreePages;
/* /*
Add up all the used "Commitied" memory + pagefile. Add up all the used "Commitied" memory + pagefile.
Not sure this is right. 8^\ Not sure this is right. 8^\
*/ */
Spi->TotalCommittedPages = MiMemoryConsumers[MC_PPOOL].PagesUsed + Spi->CommittedPages = MiMemoryConsumers[MC_PPOOL].PagesUsed +
MiMemoryConsumers[MC_NPPOOL].PagesUsed+ MiMemoryConsumers[MC_NPPOOL].PagesUsed+
MiMemoryConsumers[MC_CACHE].PagesUsed+ MiMemoryConsumers[MC_CACHE].PagesUsed+
MiMemoryConsumers[MC_USER].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. All this make Taskmgr happy but not sure it is the right numbers.
This too, fixes some of GlobalMemoryStatusEx numbers. This too, fixes some of GlobalMemoryStatusEx numbers.
*/ */
Spi->TotalCommitLimit = MmStats.NrTotalPages + MiFreeSwapPages + Spi->CommitLimit = MmStats.NrTotalPages + MiFreeSwapPages +
MiUsedSwapPages; MiUsedSwapPages;
Spi->PeakCommitment = 0; /* FIXME */ Spi->PeakCommitment = 0; /* FIXME */
Spi->PageFaults = 0; /* FIXME */ Spi->PageFaultCount = 0; /* FIXME */
Spi->WriteCopyFaults = 0; /* FIXME */ Spi->CopyOnWriteCount = 0; /* FIXME */
Spi->TransitionFaults = 0; /* FIXME */ Spi->TransitionCount = 0; /* FIXME */
Spi->CacheTransitionFaults = 0; /* FIXME */ Spi->CacheTransitionCount = 0; /* FIXME */
Spi->DemandZeroFaults = 0; /* FIXME */ Spi->DemandZeroCount = 0; /* FIXME */
Spi->PagesRead = 0; /* FIXME */ Spi->PageReadCount = 0; /* FIXME */
Spi->PageReadIos = 0; /* FIXME */ Spi->PageReadIoCount = 0; /* FIXME */
Spi->CacheReads = 0; /* FIXME */ Spi->CacheReadCount = 0; /* FIXME */
Spi->CacheIos = 0; /* FIXME */ Spi->CacheIoCount = 0; /* FIXME */
Spi->PagefilePagesWritten = 0; /* FIXME */ Spi->DirtyPagesWriteCount = 0; /* FIXME */
Spi->PagefilePageWriteIos = 0; /* FIXME */ Spi->DirtyWriteIoCount = 0; /* FIXME */
Spi->MappedFilePagesWritten = 0; /* FIXME */ Spi->MappedPagesWriteCount = 0; /* FIXME */
Spi->MappedFilePageWriteIos = 0; /* FIXME */ Spi->MappedWriteIoCount = 0; /* FIXME */
Spi->PagedPoolUsage = MiMemoryConsumers[MC_PPOOL].PagesUsed; Spi->PagedPoolPages = MiMemoryConsumers[MC_PPOOL].PagesUsed;
Spi->PagedPoolAllocs = 0; /* FIXME */ Spi->PagedPoolAllocs = 0; /* FIXME */
Spi->PagedPoolFrees = 0; /* FIXME */ Spi->PagedPoolFrees = 0; /* FIXME */
Spi->NonPagedPoolUsage = MiMemoryConsumers[MC_NPPOOL].PagesUsed; Spi->NonPagedPoolPages = MiMemoryConsumers[MC_NPPOOL].PagesUsed;
Spi->NonPagedPoolAllocs = 0; /* FIXME */ Spi->NonPagedPoolAllocs = 0; /* FIXME */
Spi->NonPagedPoolFrees = 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->TotalSystemDriverPages = 0; /* FIXME */
Spi->TotalSystemCodePages = 0; /* FIXME */ Spi->TotalSystemCodePages = 0; /* FIXME */
Spi->SmallNonPagedLookasideListAllocateHits = 0; /* FIXME */ Spi->NonPagedPoolLookasideHits = 0; /* FIXME */
Spi->SmallPagedLookasideListAllocateHits = 0; /* FIXME */ Spi->PagedPoolLookasideHits = 0; /* FIXME */
Spi->Reserved3 = 0; /* FIXME */ Spi->Spare3Count = 0; /* FIXME */
Spi->MmSystemCachePage = MiMemoryConsumers[MC_CACHE].PagesUsed; Spi->ResidentSystemCachePage = MiMemoryConsumers[MC_CACHE].PagesUsed;
Spi->PagedPoolPage = MmPagedPoolSize; /* FIXME */ Spi->ResidentPagedPoolPage = MmPagedPoolSize; /* FIXME */
Spi->SystemDriverPage = 0; /* FIXME */ Spi->ResidentSystemDriverPage = 0; /* FIXME */
Spi->FastReadNoWait = 0; /* FIXME */ Spi->CcFastReadNoWait = 0; /* FIXME */
Spi->FastReadWait = 0; /* FIXME */ Spi->CcFastReadWait = 0; /* FIXME */
Spi->FastReadResourceMiss = 0; /* FIXME */ Spi->CcFastReadResourceMiss = 0; /* FIXME */
Spi->FastReadNotPossible = 0; /* FIXME */ Spi->CcFastReadNotPossible = 0; /* FIXME */
Spi->FastMdlReadNoWait = 0; /* FIXME */ Spi->CcFastMdlReadNoWait = 0; /* FIXME */
Spi->FastMdlReadWait = 0; /* FIXME */ Spi->CcFastMdlReadWait = 0; /* FIXME */
Spi->FastMdlReadResourceMiss = 0; /* FIXME */ Spi->CcFastMdlReadResourceMiss = 0; /* FIXME */
Spi->FastMdlReadNotPossible = 0; /* FIXME */ Spi->CcFastMdlReadNotPossible = 0; /* FIXME */
Spi->MapDataNoWait = 0; /* FIXME */ Spi->CcMapDataNoWait = 0; /* FIXME */
Spi->MapDataWait = 0; /* FIXME */ Spi->CcMapDataWait = 0; /* FIXME */
Spi->MapDataNoWaitMiss = 0; /* FIXME */ Spi->CcMapDataNoWaitMiss = 0; /* FIXME */
Spi->MapDataWaitMiss = 0; /* FIXME */ Spi->CcMapDataWaitMiss = 0; /* FIXME */
Spi->PinMappedDataCount = 0; /* FIXME */ Spi->CcPinMappedDataCount = 0; /* FIXME */
Spi->PinReadNoWait = 0; /* FIXME */ Spi->CcPinReadNoWait = 0; /* FIXME */
Spi->PinReadWait = 0; /* FIXME */ Spi->CcPinReadWait = 0; /* FIXME */
Spi->PinReadNoWaitMiss = 0; /* FIXME */ Spi->CcPinReadNoWaitMiss = 0; /* FIXME */
Spi->PinReadWaitMiss = 0; /* FIXME */ Spi->CcPinReadWaitMiss = 0; /* FIXME */
Spi->CopyReadNoWait = 0; /* FIXME */ Spi->CcCopyReadNoWait = 0; /* FIXME */
Spi->CopyReadWait = 0; /* FIXME */ Spi->CcCopyReadWait = 0; /* FIXME */
Spi->CopyReadNoWaitMiss = 0; /* FIXME */ Spi->CcCopyReadNoWaitMiss = 0; /* FIXME */
Spi->CopyReadWaitMiss = 0; /* FIXME */ Spi->CcCopyReadWaitMiss = 0; /* FIXME */
Spi->MdlReadNoWait = 0; /* FIXME */ Spi->CcMdlReadNoWait = 0; /* FIXME */
Spi->MdlReadWait = 0; /* FIXME */ Spi->CcMdlReadWait = 0; /* FIXME */
Spi->MdlReadNoWaitMiss = 0; /* FIXME */ Spi->CcMdlReadNoWaitMiss = 0; /* FIXME */
Spi->MdlReadWaitMiss = 0; /* FIXME */ Spi->CcMdlReadWaitMiss = 0; /* FIXME */
Spi->ReadAheadIos = 0; /* FIXME */ Spi->CcReadAheadIos = 0; /* FIXME */
Spi->LazyWriteIos = 0; /* FIXME */ Spi->CcLazyWriteIos = 0; /* FIXME */
Spi->LazyWritePages = 0; /* FIXME */ Spi->CcLazyWritePages = 0; /* FIXME */
Spi->DataFlushes = 0; /* FIXME */ Spi->CcDataFlushes = 0; /* FIXME */
Spi->DataPages = 0; /* FIXME */ Spi->CcDataPages = 0; /* FIXME */
Spi->ContextSwitches = 0; /* FIXME */ Spi->ContextSwitches = 0; /* FIXME */
Spi->FirstLevelTbFills = 0; /* FIXME */ Spi->FirstLevelTbFills = 0; /* FIXME */
Spi->SecondLevelTbFills = 0; /* FIXME */ Spi->SecondLevelTbFills = 0; /* FIXME */
@ -1100,39 +1100,39 @@ QSI_DEF(SystemFullMemoryInformation)
/* Class 26 - Load Image */ /* Class 26 - Load Image */
SSI_DEF(SystemLoadImage) 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(STATUS_INFO_LENGTH_MISMATCH);
} }
return(LdrpLoadImage(&Sli->ModuleName, return(LdrpLoadImage(&Sli->DriverName,
&Sli->ModuleBase, &Sli->ImageAddress,
&Sli->SectionPointer, &Sli->SectionPointer,
&Sli->EntryPoint, &Sli->EntryPoint,
&Sli->ExportDirectory)); (PVOID)&Sli->ExportSectionPointer));
} }
/* Class 27 - Unload Image */ /* Class 27 - Unload Image */
SSI_DEF(SystemUnloadImage) 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(STATUS_INFO_LENGTH_MISMATCH);
} }
return(LdrpUnloadImage(Sui->ModuleBase)); return(LdrpUnloadImage(Sui));
} }
/* Class 28 - Time Adjustment Information */ /* Class 28 - Time Adjustment Information */
QSI_DEF(SystemTimeAdjustmentInformation) 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); return (STATUS_INFO_LENGTH_MISMATCH);
} }
/* FIXME: */ /* FIXME: */
@ -1142,7 +1142,7 @@ QSI_DEF(SystemTimeAdjustmentInformation)
SSI_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); return (STATUS_INFO_LENGTH_MISMATCH);
} }
@ -1229,7 +1229,7 @@ QSI_DEF(SystemRegistryQuotaInformation)
DPRINT1("Faking max registry size of 32 MB\n"); DPRINT1("Faking max registry size of 32 MB\n");
srqi->RegistryQuotaAllowed = 0x2000000; srqi->RegistryQuotaAllowed = 0x2000000;
srqi->RegistryQuotaUsed = 0x200000; srqi->RegistryQuotaUsed = 0x200000;
srqi->Reserved1 = (void*)0x200000; srqi->PagedPoolSize = 0x200000;
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
@ -1244,14 +1244,14 @@ SSI_DEF(SystemRegistryQuotaInformation)
/* Class 38 - Load And Call Image */ /* Class 38 - Load And Call Image */
SSI_DEF(SystemLoadAndCallImage) 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(STATUS_INFO_LENGTH_MISMATCH);
} }
return(LdrpLoadAndCallImage(&Slci->ModuleName)); return(LdrpLoadAndCallImage(Slci));
} }
/* Class 39 - Priority Separation */ /* Class 39 - Priority Separation */
@ -1532,7 +1532,7 @@ NtQuerySystemInformation (IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
/* /*
* Check the request is valid. * Check the request is valid.
*/ */
if ((SystemInformationClass >= SystemInformationClassMin) && if ((SystemInformationClass >= SystemBasicInformation) &&
(SystemInformationClass < SystemInformationClassMax)) (SystemInformationClass < SystemInformationClassMax))
{ {
if (NULL != CallQS [SystemInformationClass].Query) if (NULL != CallQS [SystemInformationClass].Query)
@ -1609,7 +1609,7 @@ NtSetSystemInformation (
/* /*
* Check the request is valid. * Check the request is valid.
*/ */
if ( (SystemInformationClass >= SystemInformationClassMin) if ( (SystemInformationClass >= SystemBasicInformation)
&& (SystemInformationClass < SystemInformationClassMax) && (SystemInformationClass < SystemInformationClassMax)
) )
{ {

View file

@ -18,25 +18,20 @@
POBJECT_TYPE EXPORTED ExWindowStationObjectType = NULL; POBJECT_TYPE EXPORTED ExWindowStationObjectType = NULL;
POBJECT_TYPE EXPORTED ExDesktopObjectType = NULL; POBJECT_TYPE EXPORTED ExDesktopObjectType = NULL;
static GENERIC_MAPPING ExpWindowStationMapping = { static GENERIC_MAPPING ExpWindowStationMapping =
{
STANDARD_RIGHTS_READ | WINSTA_ENUMDESKTOPS | WINSTA_ENUMERATE | WINSTA_READATTRIBUTES | WINSTA_READSCREEN, STANDARD_RIGHTS_READ,
STANDARD_RIGHTS_WRITE | WINSTA_ACCESSCLIPBOARD | WINSTA_CREATEDESKTOP | WINSTA_WRITEATTRIBUTES, STANDARD_RIGHTS_WRITE,
STANDARD_RIGHTS_EXECUTE | WINSTA_ACCESSGLOBALATOMS | WINSTA_EXITWINDOWS, STANDARD_RIGHTS_EXECUTE,
STANDARD_RIGHTS_REQUIRED | WINSTA_ACCESSCLIPBOARD | WINSTA_ACCESSGLOBALATOMS | WINSTA_CREATEDESKTOP | STANDARD_RIGHTS_REQUIRED
WINSTA_ENUMDESKTOPS | WINSTA_ENUMERATE | WINSTA_EXITWINDOWS |
WINSTA_READATTRIBUTES | WINSTA_READSCREEN | WINSTA_WRITEATTRIBUTES
}; };
static GENERIC_MAPPING ExpDesktopMapping = { static GENERIC_MAPPING ExpDesktopMapping =
{
STANDARD_RIGHTS_READ | DESKTOP_ENUMERATE | DESKTOP_READOBJECTS, STANDARD_RIGHTS_READ,
STANDARD_RIGHTS_WRITE | DESKTOP_CREATEMENU | DESKTOP_CREATEWINDOW | DESKTOP_HOOKCONTROL | STANDARD_RIGHTS_WRITE,
DESKTOP_JOURNALPLAYBACK | DESKTOP_JOURNALRECORD | DESKTOP_WRITEOBJECTS, STANDARD_RIGHTS_EXECUTE,
STANDARD_RIGHTS_EXECUTE | DESKTOP_SWITCHDESKTOP, STANDARD_RIGHTS_REQUIRED
STANDARD_RIGHTS_REQUIRED | DESKTOP_CREATEMENU | DESKTOP_CREATEWINDOW | DESKTOP_ENUMERATE |
DESKTOP_HOOKCONTROL | DESKTOP_JOURNALPLAYBACK | DESKTOP_JOURNALRECORD |
DESKTOP_READOBJECTS | DESKTOP_SWITCHDESKTOP | DESKTOP_WRITEOBJECTS
}; };
OB_OPEN_METHOD ExpWindowStationObjectOpen = NULL; OB_OPEN_METHOD ExpWindowStationObjectOpen = NULL;

View file

@ -37,9 +37,8 @@ InbvCheckBootVid(VOID)
{ {
NTSTATUS Status; NTSTATUS Status;
OBJECT_ATTRIBUTES ObjectAttributes; OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING BootVidName; UNICODE_STRING BootVidName = RTL_CONSTANT_STRING(L"\\Device\\BootVid");
RtlRosInitUnicodeStringFromLiteral(&BootVidName, L"\\Device\\BootVid");
InitializeObjectAttributes(&ObjectAttributes, InitializeObjectAttributes(&ObjectAttributes,
&BootVidName, &BootVidName,
0, 0,

View file

@ -576,6 +576,18 @@ VOID
STDCALL STDCALL
KeFlushCurrentTb(VOID); KeFlushCurrentTb(VOID);
/* REACTOS SPECIFIC */
VOID STDCALL
KeRosDumpStackFrames(
PULONG Frame,
ULONG FrameCount);
ULONG STDCALL
KeRosGetStackFrames(
PULONG Frames,
ULONG FrameCount);
VOID VOID
KiSetSystemTime(PLARGE_INTEGER NewSystemTime); KiSetSystemTime(PLARGE_INTEGER NewSystemTime);

View file

@ -85,6 +85,8 @@ typedef ULONG PFN_TYPE, *PPFN_TYPE;
#define MM_LOWEST_USER_ADDRESS (PVOID)0x10000 #define MM_LOWEST_USER_ADDRESS (PVOID)0x10000
#endif #endif
#define TEB_BASE (0x7FFDE000)
#define MM_VIRTMEM_GRANULARITY (64 * 1024) /* Although Microsoft says this isn't hardcoded anymore, #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 */ they won't be able to change it. Stuff depends on it */

View file

@ -15,6 +15,40 @@
#define PAGE_LOCKED_FUNCTION PLACE_IN_SECTION("pagelk") #define PAGE_LOCKED_FUNCTION PLACE_IN_SECTION("pagelk")
#define PAGE_UNLOCKED_FUNCTION PLACE_IN_SECTION("pagepo") #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> #include <pshpack1.h>
/* /*
* Defines a descriptor as it appears in the processor tables * Defines a descriptor as it appears in the processor tables
@ -62,6 +96,7 @@ RtlpCreateUnicodeString(
IN PCWSTR Source, IN PCWSTR Source,
IN POOL_TYPE PoolType); IN POOL_TYPE PoolType);
#endif
#endif /* __ASM__ */ #endif /* __ASM__ */
/* /*

View file

@ -95,6 +95,61 @@ typedef struct _QUEUEDMESSAGE
UCHAR MessageData [MAX_MESSAGE_DATA]; UCHAR MessageData [MAX_MESSAGE_DATA];
} QUEUEDMESSAGE, *PQUEUEDMESSAGE; } 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 */ /* Code in ntoskrnl/lpc/close.h */
VOID STDCALL VOID STDCALL

View file

@ -542,7 +542,7 @@ typedef struct _EJOB
UINT PeakJobMemoryUsed; UINT PeakJobMemoryUsed;
UINT CurrentJobMemoryUsed; UINT CurrentJobMemoryUsed;
FAST_MUTEX MemoryLimitsLock; FAST_MUTEX MemoryLimitsLock;
} EJOB; } EJOB, *PEJOB;
#include <poppack.h> #include <poppack.h>
VOID INIT_FUNCTION PsInitJobManagment(VOID); VOID INIT_FUNCTION PsInitJobManagment(VOID);

View file

@ -5,76 +5,37 @@
/* include the ntoskrnl config.h file */ /* include the ntoskrnl config.h file */
#include "config.h" #include "config.h"
#include <roscfg.h>
#include <roskrnl.h> /* DDK/IFS/NDK Headers */
#include <ddk/ntddk.h> #include <ddk/ntddk.h>
#include <ddk/ntifs.h> #include <ddk/ntifs.h>
#include <ddk/wdmguid.h> #include <ddk/wdmguid.h>
#include <ndk/ntndk.h>
#undef IO_TYPE_FILE #undef IO_TYPE_FILE
#define IO_TYPE_FILE 0x0F5L /* Temp Hack */ #define IO_TYPE_FILE 0x0F5L /* Temp Hack */
#include <roscfg.h> /* FIXME: Add to ndk, or at least move somewhere else */
#include <ntos/ntpnp.h>
#include <napi/core.h>
/* ReactOS Headers */
#include <reactos/version.h> #include <reactos/version.h>
#include <reactos/resource.h> #include <reactos/resource.h>
#include <reactos/bugcodes.h> #include <reactos/bugcodes.h>
#include <reactos/rossym.h> #include <reactos/rossym.h>
#include <limits.h>
#include <stdarg.h> /* C Headers */
#include <stdlib.h>
#include <string.h>
#include <malloc.h> #include <malloc.h>
#include <wchar.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>
#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 /* SEH support with PSEH */
#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24)) #include <pseh.h>
#endif
/* Helper Header */
#include <reactos/helper.h>
/* Internal Headers */
#include "internal/ntoskrnl.h"
#endif /* INCLUDE_NTOSKRNL_H */ #endif /* INCLUDE_NTOSKRNL_H */

View file

@ -311,7 +311,7 @@ IoCreateSystemRootLink(PCHAR ParameterLine)
{ {
OBJECT_ATTRIBUTES ObjectAttributes; OBJECT_ATTRIBUTES ObjectAttributes;
IO_STATUS_BLOCK IoStatusBlock; IO_STATUS_BLOCK IoStatusBlock;
UNICODE_STRING LinkName; UNICODE_STRING LinkName = RTL_CONSTANT_STRING(L"\\SystemRoot");
UNICODE_STRING DeviceName; UNICODE_STRING DeviceName;
UNICODE_STRING ArcName; UNICODE_STRING ArcName;
UNICODE_STRING BootPath; UNICODE_STRING BootPath;
@ -445,9 +445,6 @@ IoCreateSystemRootLink(PCHAR ParameterLine)
DPRINT("DeviceName: %wZ\n", &DeviceName); DPRINT("DeviceName: %wZ\n", &DeviceName);
/* create the '\SystemRoot' link */ /* create the '\SystemRoot' link */
RtlRosInitUnicodeStringFromLiteral(&LinkName,
L"\\SystemRoot");
Status = IoCreateSymbolicLink(&LinkName, Status = IoCreateSymbolicLink(&LinkName,
&DeviceName); &DeviceName);
ExFreePool(DeviceName.Buffer); ExFreePool(DeviceName.Buffer);

View file

@ -72,7 +72,7 @@ static LIST_ENTRY GroupListHead = {NULL, NULL};
static LIST_ENTRY ServiceListHead = {NULL, NULL}; static LIST_ENTRY ServiceListHead = {NULL, NULL};
static UNICODE_STRING IopHardwareDatabaseKey = 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; POBJECT_TYPE EXPORTED IoDriverObjectType = NULL;
@ -1019,7 +1019,7 @@ IoCreateDriverList(VOID)
RTL_QUERY_REGISTRY_TABLE QueryTable[2]; RTL_QUERY_REGISTRY_TABLE QueryTable[2];
PKEY_BASIC_INFORMATION KeyInfo = NULL; PKEY_BASIC_INFORMATION KeyInfo = NULL;
OBJECT_ATTRIBUTES ObjectAttributes; OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING ServicesKeyName; UNICODE_STRING ServicesKeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet\\Services");
UNICODE_STRING SubKeyName; UNICODE_STRING SubKeyName;
HANDLE KeyHandle; HANDLE KeyHandle;
NTSTATUS Status; NTSTATUS Status;
@ -1050,9 +1050,6 @@ IoCreateDriverList(VOID)
return(Status); return(Status);
/* Enumerate services and create the service list */ /* Enumerate services and create the service list */
RtlRosInitUnicodeStringFromLiteral(&ServicesKeyName,
L"\\Registry\\Machine\\System\\CurrentControlSet\\Services");
InitializeObjectAttributes(&ObjectAttributes, InitializeObjectAttributes(&ObjectAttributes,
&ServicesKeyName, &ServicesKeyName,
OBJ_CASE_INSENSITIVE, OBJ_CASE_INSENSITIVE,

View file

@ -14,9 +14,6 @@
#define NDEBUG #define NDEBUG
#include <internal/debug.h> #include <internal/debug.h>
/* FIXME: Header mess */
#undef CreateMailslot
/* GLOBALS *******************************************************************/ /* GLOBALS *******************************************************************/
extern GENERIC_MAPPING IopFileMapping; extern GENERIC_MAPPING IopFileMapping;
@ -3004,7 +3001,7 @@ NTSTATUS
STDCALL STDCALL
NtSetQuotaInformationFile(HANDLE FileHandle, NtSetQuotaInformationFile(HANDLE FileHandle,
PIO_STATUS_BLOCK IoStatusBlock, PIO_STATUS_BLOCK IoStatusBlock,
PFILE_USER_QUOTA_INFORMATION Buffer, PFILE_QUOTA_INFORMATION Buffer,
ULONG BufferLength) ULONG BufferLength)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;

View file

@ -182,7 +182,7 @@ IoInit (VOID)
UNICODE_STRING Name; UNICODE_STRING Name;
OBJECT_ATTRIBUTES ObjectAttributes; OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING DirName; UNICODE_STRING DirName;
UNICODE_STRING LinkName; UNICODE_STRING LinkName = RTL_CONSTANT_STRING(L"\\DosDevices");
HANDLE Handle; HANDLE Handle;
IopInitDriverImplementation(); IopInitDriverImplementation();
@ -222,7 +222,7 @@ IoInit (VOID)
/* /*
* Create the '\Driver' object directory * Create the '\Driver' object directory
*/ */
RtlRosInitUnicodeStringFromLiteral(&DirName, L"\\Driver"); RtlInitUnicodeString(&DirName, L"\\Driver");
InitializeObjectAttributes(&ObjectAttributes, InitializeObjectAttributes(&ObjectAttributes,
&DirName, &DirName,
0, 0,
@ -235,7 +235,7 @@ IoInit (VOID)
/* /*
* Create the '\FileSystem' object directory * Create the '\FileSystem' object directory
*/ */
RtlRosInitUnicodeStringFromLiteral(&DirName, RtlInitUnicodeString(&DirName,
L"\\FileSystem"); L"\\FileSystem");
InitializeObjectAttributes(&ObjectAttributes, InitializeObjectAttributes(&ObjectAttributes,
&DirName, &DirName,
@ -249,7 +249,7 @@ IoInit (VOID)
/* /*
* Create the '\Device' directory * Create the '\Device' directory
*/ */
RtlRosInitUnicodeStringFromLiteral(&DirName, RtlInitUnicodeString(&DirName,
L"\\Device"); L"\\Device");
InitializeObjectAttributes(&ObjectAttributes, InitializeObjectAttributes(&ObjectAttributes,
&DirName, &DirName,
@ -263,7 +263,7 @@ IoInit (VOID)
/* /*
* Create the '\??' directory * Create the '\??' directory
*/ */
RtlRosInitUnicodeStringFromLiteral(&DirName, RtlInitUnicodeString(&DirName,
L"\\??"); L"\\??");
InitializeObjectAttributes(&ObjectAttributes, InitializeObjectAttributes(&ObjectAttributes,
&DirName, &DirName,
@ -277,7 +277,7 @@ IoInit (VOID)
/* /*
* Create the '\ArcName' directory * Create the '\ArcName' directory
*/ */
RtlRosInitUnicodeStringFromLiteral(&DirName, RtlInitUnicodeString(&DirName,
L"\\ArcName"); L"\\ArcName");
InitializeObjectAttributes(&ObjectAttributes, InitializeObjectAttributes(&ObjectAttributes,
&DirName, &DirName,
@ -304,9 +304,7 @@ IoInit (VOID)
/* /*
* Create link from '\DosDevices' to '\??' directory * Create link from '\DosDevices' to '\??' directory
*/ */
RtlRosInitUnicodeStringFromLiteral(&LinkName, RtlInitUnicodeString(&DirName,
L"\\DosDevices");
RtlRosInitUnicodeStringFromLiteral(&DirName,
L"\\??"); L"\\??");
IoCreateSymbolicLink(&LinkName, IoCreateSymbolicLink(&LinkName,
&DirName); &DirName);

View file

@ -10,14 +10,10 @@
/* INCLUDES ******************************************************************/ /* INCLUDES ******************************************************************/
#include <ntoskrnl.h> #include <ntoskrnl.h>
#include <ddk/wdmguid.h>
#define NDEBUG #define NDEBUG
#include <internal/debug.h> #include <internal/debug.h>
/* FIXME: Header mess */
#undef DeviceCapabilities
/* GLOBALS *******************************************************************/ /* GLOBALS *******************************************************************/
PDEVICE_NODE IopRootDeviceNode; PDEVICE_NODE IopRootDeviceNode;

View file

@ -827,7 +827,7 @@ IoReportHalResourceUsage(PUNICODE_STRING HalDescription,
HANDLE DescriptionKey; HANDLE DescriptionKey;
/* Open/Create 'RESOURCEMAP' key. */ /* Open/Create 'RESOURCEMAP' key. */
RtlRosInitUnicodeStringFromLiteral(&Name, RtlInitUnicodeString(&Name,
L"\\Registry\\Machine\\HARDWARE\\RESOURCEMAP"); L"\\Registry\\Machine\\HARDWARE\\RESOURCEMAP");
InitializeObjectAttributes(&ObjectAttributes, InitializeObjectAttributes(&ObjectAttributes,
&Name, &Name,
@ -845,7 +845,7 @@ IoReportHalResourceUsage(PUNICODE_STRING HalDescription,
return(Status); return(Status);
/* Open/Create 'Hardware Abstraction Layer' key */ /* Open/Create 'Hardware Abstraction Layer' key */
RtlRosInitUnicodeStringFromLiteral(&Name, RtlInitUnicodeString(&Name,
L"Hardware Abstraction Layer"); L"Hardware Abstraction Layer");
InitializeObjectAttributes(&ObjectAttributes, InitializeObjectAttributes(&ObjectAttributes,
&Name, &Name,
@ -881,7 +881,7 @@ IoReportHalResourceUsage(PUNICODE_STRING HalDescription,
return(Status); return(Status);
/* Add '.Raw' value. */ /* Add '.Raw' value. */
RtlRosInitUnicodeStringFromLiteral(&Name, RtlInitUnicodeString(&Name,
L".Raw"); L".Raw");
Status = ZwSetValueKey(DescriptionKey, Status = ZwSetValueKey(DescriptionKey,
&Name, &Name,
@ -896,7 +896,7 @@ IoReportHalResourceUsage(PUNICODE_STRING HalDescription,
} }
/* Add '.Translated' value. */ /* Add '.Translated' value. */
RtlRosInitUnicodeStringFromLiteral(&Name, RtlInitUnicodeString(&Name,
L".Translated"); L".Translated");
Status = ZwSetValueKey(DescriptionKey, Status = ZwSetValueKey(DescriptionKey,
&Name, &Name,

View file

@ -508,7 +508,7 @@ KdbSymLoadUserModuleSymbols(IN PLDR_DATA_TABLE_ENTRY LdrModule)
LdrModule->FullDllName.Length); LdrModule->FullDllName.Length);
KernelName.Buffer[KernelName.Length / sizeof(WCHAR)] = L'\0'; KernelName.Buffer[KernelName.Length / sizeof(WCHAR)] = L'\0';
KdbpSymLoadModuleSymbols(&KernelName, &LdrModule->RosSymInfo); KdbpSymLoadModuleSymbols(&KernelName, (PROSSYM_INFO*)&LdrModule->RosSymInfo);
ExFreePool(KernelName.Buffer); ExFreePool(KernelName.Buffer);
} }

View file

@ -456,8 +456,9 @@ Ki386SetProcessorFeatures(VOID)
{ {
PKIPCR Pcr = (PKIPCR)KeGetCurrentKPCR(); PKIPCR Pcr = (PKIPCR)KeGetCurrentKPCR();
OBJECT_ATTRIBUTES ObjectAttributes; OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING KeyName; UNICODE_STRING KeyName =
UNICODE_STRING ValueName; RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Session Manager\\Kernel");
UNICODE_STRING ValueName = RTL_CONSTANT_STRING(L"FastSystemCallDisable");
HANDLE KeyHandle; HANDLE KeyHandle;
ULONG ResultLength; ULONG ResultLength;
KEY_VALUE_PARTIAL_INFORMATION ValueData; KEY_VALUE_PARTIAL_INFORMATION ValueData;
@ -488,10 +489,6 @@ Ki386SetProcessorFeatures(VOID)
/* FIXME: Check for Family == 6, Model < 3 and Stepping < 3 and disable */ /* FIXME: Check for Family == 6, Model < 3 and Stepping < 3 and disable */
/* Make sure it's not disabled in registry */ /* 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, InitializeObjectAttributes(&ObjectAttributes,
&KeyName, &KeyName,
OBJ_CASE_INSENSITIVE, OBJ_CASE_INSENSITIVE,

View file

@ -17,78 +17,19 @@
#define NDEBUG #define NDEBUG
#include <internal/debug.h> #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 *****************************************************************/ /* FUNCTIONS *****************************************************************/
INIT_FUNCTION INIT_FUNCTION
NTSTATUS NTSTATUS
LdrLoadInitialProcess(PHANDLE ProcessHandle, LdrLoadInitialProcess(PHANDLE ProcessHandle,
PHANDLE ThreadHandle) PHANDLE ThreadHandle)
{ {
UNICODE_STRING ImagePath; UNICODE_STRING ImagePath = RTL_CONSTANT_STRING(L"\\SystemRoot\\system32\\smss.exe");
HANDLE SystemProcessHandle; HANDLE SystemProcessHandle;
NTSTATUS Status; NTSTATUS Status;
PRTL_USER_PROCESS_PARAMETERS Params=NULL; PRTL_USER_PROCESS_PARAMETERS Params=NULL;
RTL_PROCESS_INFO Info; RTL_PROCESS_INFO Info;
/* Get the absolute path to smss.exe. */
RtlRosInitUnicodeStringFromLiteral(&ImagePath,
L"\\SystemRoot\\system32\\smss.exe");
Status = ObpCreateHandle( Status = ObpCreateHandle(
PsGetCurrentProcess(), PsGetCurrentProcess(),
PsInitialSystemProcess, PsInitialSystemProcess,

View file

@ -46,18 +46,6 @@ STATIC MODULE_TEXT_SECTION NtoskrnlTextSection;
STATIC MODULE_TEXT_SECTION LdrHalTextSection; STATIC MODULE_TEXT_SECTION LdrHalTextSection;
ULONG_PTR LdrHalBase; 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 ******************************************************/ /* FORWARD DECLARATIONS ******************************************************/
NTSTATUS NTSTATUS

View file

@ -173,7 +173,7 @@ STDCALL
INIT_FUNCTION INIT_FUNCTION
LdrpInitializeSystemDll(VOID) 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; OBJECT_ATTRIBUTES FileObjectAttributes;
IO_STATUS_BLOCK Iosb; IO_STATUS_BLOCK Iosb;
HANDLE FileHandle; HANDLE FileHandle;

View file

@ -90,7 +90,7 @@ LpcpInitializePort (IN OUT PEPORT Port,
} }
memset (Port, 0, sizeof(EPORT)); memset (Port, 0, sizeof(EPORT));
KeInitializeSpinLock (& Port->Lock); KeInitializeSpinLock (& Port->Lock);
KeInitializeSemaphore( &Port->Semaphore, 0, LONG_MAX ); KeInitializeSemaphore( &Port->Semaphore, 0, MAXLONG );
Port->RequestPort = Parent; Port->RequestPort = Parent;
Port->OtherPort = NULL; Port->OtherPort = NULL;
Port->QueueLength = 0; Port->QueueLength = 0;

View file

@ -648,7 +648,7 @@ MmInitializeCrashDump(HANDLE PageFileHandle, ULONG PageFileNum)
PIRP Irp; PIRP Irp;
KEVENT Event; KEVENT Event;
IO_STATUS_BLOCK Iosb; IO_STATUS_BLOCK Iosb;
UNICODE_STRING DiskDumpName; UNICODE_STRING DiskDumpName = RTL_CONSTANT_STRING(L"DiskDump");
ANSI_STRING ProcName; ANSI_STRING ProcName;
PIO_STACK_LOCATION StackPtr; PIO_STACK_LOCATION StackPtr;
PMODULE_OBJECT ModuleObject; PMODULE_OBJECT ModuleObject;
@ -724,7 +724,6 @@ MmInitializeCrashDump(HANDLE PageFileHandle, ULONG PageFileNum)
} }
/* Load the diskdump driver. */ /* Load the diskdump driver. */
RtlRosInitUnicodeStringFromLiteral(&DiskDumpName, L"DiskDump");
ModuleObject = LdrGetModuleObject(&DiskDumpName); ModuleObject = LdrGetModuleObject(&DiskDumpName);
if (ModuleObject == NULL) if (ModuleObject == NULL)
{ {

View file

@ -2093,7 +2093,7 @@ MmCreatePhysicalMemorySection(VOID)
PSECTION_OBJECT PhysSection; PSECTION_OBJECT PhysSection;
NTSTATUS Status; NTSTATUS Status;
OBJECT_ATTRIBUTES Obj; OBJECT_ATTRIBUTES Obj;
UNICODE_STRING Name = ROS_STRING_INITIALIZER(L"\\Device\\PhysicalMemory"); UNICODE_STRING Name = RTL_CONSTANT_STRING(L"\\Device\\PhysicalMemory");
LARGE_INTEGER SectionSize; LARGE_INTEGER SectionSize;
/* /*

View file

@ -92,7 +92,7 @@ NtWaitForMultipleObjects(IN ULONG ObjectCount,
{ {
DPRINT1("Waiting for object type '%wZ' is not supported\n", DPRINT1("Waiting for object type '%wZ' is not supported\n",
&BODY_TO_HEADER(ObjectPtrArray[i])->Type->Name); &BODY_TO_HEADER(ObjectPtrArray[i])->Type->Name);
Status = STATUS_HANDLE_NOT_WAITABLE; Status = STATUS_INVALID_HANDLE;
i++; i++;
} }
/* dereference all referenced objects */ /* dereference all referenced objects */
@ -179,7 +179,7 @@ NtWaitForSingleObject(IN HANDLE ObjectHandle,
{ {
DPRINT1("Waiting for object type '%wZ' is not supported\n", DPRINT1("Waiting for object type '%wZ' is not supported\n",
&BODY_TO_HEADER(ObjectPtr)->Type->Name); &BODY_TO_HEADER(ObjectPtr)->Type->Name);
Status = STATUS_HANDLE_NOT_WAITABLE; Status = STATUS_INVALID_HANDLE;
} }
else else
{ {

View file

@ -44,7 +44,7 @@ VOID INIT_FUNCTION
PiInitDefaultLocale(VOID) PiInitDefaultLocale(VOID)
{ {
OBJECT_ATTRIBUTES ObjectAttributes; OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING KeyName; UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Nls\\Language");
UNICODE_STRING ValueName; UNICODE_STRING ValueName;
HANDLE KeyHandle; HANDLE KeyHandle;
ULONG ValueLength; ULONG ValueLength;
@ -56,9 +56,6 @@ PiInitDefaultLocale(VOID)
ValueInfo = (PKEY_VALUE_PARTIAL_INFORMATION)ValueBuffer; ValueInfo = (PKEY_VALUE_PARTIAL_INFORMATION)ValueBuffer;
RtlRosInitUnicodeStringFromLiteral(&KeyName,
L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Nls\\Language");
InitializeObjectAttributes(&ObjectAttributes, InitializeObjectAttributes(&ObjectAttributes,
&KeyName, &KeyName,
OBJ_CASE_INSENSITIVE, OBJ_CASE_INSENSITIVE,
@ -70,7 +67,7 @@ PiInitDefaultLocale(VOID)
if (NT_SUCCESS(Status)) if (NT_SUCCESS(Status))
{ {
/* Read system locale */ /* Read system locale */
RtlRosInitUnicodeStringFromLiteral(&ValueName, RtlInitUnicodeString(&ValueName,
L"Default"); L"Default");
Status = ZwQueryValueKey(KeyHandle, Status = ZwQueryValueKey(KeyHandle,
&ValueName, &ValueName,
@ -95,7 +92,7 @@ PiInitDefaultLocale(VOID)
} }
/* Read install language id */ /* Read install language id */
RtlRosInitUnicodeStringFromLiteral(&ValueName, RtlInitUnicodeString(&ValueName,
L"InstallLanguage"); L"InstallLanguage");
Status = ZwQueryValueKey(KeyHandle, Status = ZwQueryValueKey(KeyHandle,
&ValueName, &ValueName,
@ -137,8 +134,8 @@ VOID STDCALL
PiInitThreadLocale(VOID) PiInitThreadLocale(VOID)
{ {
OBJECT_ATTRIBUTES ObjectAttributes; OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING KeyName; UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry\\User\\.Default\\Control Panel\\International");
UNICODE_STRING ValueName; UNICODE_STRING ValueName = RTL_CONSTANT_STRING(L"Locale");
HANDLE KeyHandle; HANDLE KeyHandle;
ULONG ValueLength; ULONG ValueLength;
UCHAR ValueBuffer[VALUE_BUFFER_SIZE]; UCHAR ValueBuffer[VALUE_BUFFER_SIZE];
@ -150,11 +147,6 @@ PiInitThreadLocale(VOID)
ValueInfo = (PKEY_VALUE_PARTIAL_INFORMATION)ValueBuffer; ValueInfo = (PKEY_VALUE_PARTIAL_INFORMATION)ValueBuffer;
/* read default thread locale */ /* read default thread locale */
RtlRosInitUnicodeStringFromLiteral(&KeyName,
L"\\Registry\\User\\.Default\\Control Panel\\International");
RtlRosInitUnicodeStringFromLiteral(&ValueName,
L"Locale");
InitializeObjectAttributes(&ObjectAttributes, InitializeObjectAttributes(&ObjectAttributes,
&KeyName, &KeyName,
OBJ_CASE_INSENSITIVE, OBJ_CASE_INSENSITIVE,
@ -264,17 +256,17 @@ NtSetDefaultLocale(IN BOOLEAN UserProfile,
&UserKey); &UserKey);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
return(Status); return(Status);
RtlRosInitUnicodeStringFromLiteral(&KeyName, RtlInitUnicodeString(&KeyName,
L"Control Panel\\International"); L"Control Panel\\International");
RtlRosInitUnicodeStringFromLiteral(&ValueName, RtlInitUnicodeString(&ValueName,
L"Locale"); L"Locale");
} }
else else
{ {
/* system locale */ /* system locale */
RtlRosInitUnicodeStringFromLiteral(&KeyName, RtlInitUnicodeString(&KeyName,
L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Nls\\Language"); L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Nls\\Language");
RtlRosInitUnicodeStringFromLiteral(&ValueName, RtlInitUnicodeString(&ValueName,
L"Default"); L"Default");
} }
@ -354,8 +346,8 @@ NtQueryDefaultUILanguage(OUT PLANGID LanguageId)
UCHAR ValueBuffer[VALUE_BUFFER_SIZE]; UCHAR ValueBuffer[VALUE_BUFFER_SIZE];
PKEY_VALUE_PARTIAL_INFORMATION ValueInfo; PKEY_VALUE_PARTIAL_INFORMATION ValueInfo;
OBJECT_ATTRIBUTES ObjectAttributes; OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING KeyName; UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"Control Panel\\International");
UNICODE_STRING ValueName; UNICODE_STRING ValueName = RTL_CONSTANT_STRING(L"MultiUILanguageId");
UNICODE_STRING ValueString; UNICODE_STRING ValueString;
ULONG ValueLength; ULONG ValueLength;
ULONG Value; ULONG Value;
@ -373,11 +365,6 @@ NtQueryDefaultUILanguage(OUT PLANGID LanguageId)
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
RtlRosInitUnicodeStringFromLiteral(&KeyName,
L"Control Panel\\International");
RtlRosInitUnicodeStringFromLiteral(&ValueName,
L"MultiUILanguageId");
InitializeObjectAttributes(&ObjectAttributes, InitializeObjectAttributes(&ObjectAttributes,
&KeyName, &KeyName,
OBJ_CASE_INSENSITIVE, OBJ_CASE_INSENSITIVE,
@ -452,8 +439,8 @@ NTSTATUS STDCALL
NtSetDefaultUILanguage(IN LANGID LanguageId) NtSetDefaultUILanguage(IN LANGID LanguageId)
{ {
OBJECT_ATTRIBUTES ObjectAttributes; OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING KeyName; UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"Control Panel\\Desktop");
UNICODE_STRING ValueName; UNICODE_STRING ValueName = RTL_CONSTANT_STRING(L"MultiUILanguageId");
WCHAR ValueBuffer[8]; WCHAR ValueBuffer[8];
ULONG ValueLength; ULONG ValueLength;
HANDLE UserHandle; HANDLE UserHandle;
@ -469,11 +456,6 @@ NtSetDefaultUILanguage(IN LANGID LanguageId)
return Status; return Status;
} }
RtlRosInitUnicodeStringFromLiteral(&KeyName,
L"Control Panel\\Desktop");
RtlRosInitUnicodeStringFromLiteral(&ValueName,
L"MultiUILanguageId");
InitializeObjectAttributes(&ObjectAttributes, InitializeObjectAttributes(&ObjectAttributes,
&KeyName, &KeyName,
OBJ_CASE_INSENSITIVE, OBJ_CASE_INSENSITIVE,

View file

@ -190,9 +190,9 @@ NtQueryInformationProcess(IN HANDLE ProcessHandle,
ProcessBasicInformationP->PebBaseAddress = Process->Peb; ProcessBasicInformationP->PebBaseAddress = Process->Peb;
ProcessBasicInformationP->AffinityMask = Process->Pcb.Affinity; ProcessBasicInformationP->AffinityMask = Process->Pcb.Affinity;
ProcessBasicInformationP->UniqueProcessId = ProcessBasicInformationP->UniqueProcessId =
Process->UniqueProcessId; (ULONG)Process->UniqueProcessId;
ProcessBasicInformationP->InheritedFromUniqueProcessId = ProcessBasicInformationP->InheritedFromUniqueProcessId =
Process->InheritedFromUniqueProcessId; (ULONG)Process->InheritedFromUniqueProcessId;
ProcessBasicInformationP->BasePriority = ProcessBasicInformationP->BasePriority =
Process->Pcb.BasePriority; Process->Pcb.BasePriority;

View file

@ -196,7 +196,7 @@ PspCreateThread(OUT PHANDLE ThreadHandle,
/* Initialize LPC */ /* Initialize LPC */
DPRINT("Initialliazing Thread Semaphore\n"); DPRINT("Initialliazing Thread Semaphore\n");
KeInitializeSemaphore(&Thread->LpcReplySemaphore, 0, LONG_MAX); KeInitializeSemaphore(&Thread->LpcReplySemaphore, 0, MAXLONG);
/* Allocate Stack for non-GUI Thread */ /* Allocate Stack for non-GUI Thread */
DPRINT("Initialliazing Thread Stack\n"); DPRINT("Initialliazing Thread Stack\n");

View file

@ -11,13 +11,9 @@
/* INCLUDES ******************************************************************/ /* INCLUDES ******************************************************************/
#include <ntoskrnl.h> #include <ntoskrnl.h>
#include <internal/ps.h>
#define NDEBUG #define NDEBUG
#include <internal/debug.h> #include <internal/debug.h>
//FIXME: sort this out somehow. IAI: Sorted in new header branch
#define PRTL_CRITICAL_SECTION PVOID
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/

View file

@ -14,16 +14,12 @@
#define NDEBUG #define NDEBUG
#include <internal/debug.h> #include <internal/debug.h>
#define ROUND_DOWN(N, S) ((N) - ((N) % (S)))
typedef struct _RTL_RANGE_ENTRY typedef struct _RTL_RANGE_ENTRY
{ {
LIST_ENTRY Entry; LIST_ENTRY Entry;
RTL_RANGE Range; RTL_RANGE Range;
} RTL_RANGE_ENTRY, *PRTL_RANGE_ENTRY; } RTL_RANGE_ENTRY, *PRTL_RANGE_ENTRY;
/* FUNCTIONS ***************************************************************/ /* FUNCTIONS ***************************************************************/
/********************************************************************** /**********************************************************************

View file

@ -558,7 +558,7 @@ int sprintf(char * buf, const char *fmt, ...)
int i; int i;
va_start(args, fmt); va_start(args, fmt);
i=_vsnprintf(buf,INT_MAX,fmt,args); i=_vsnprintf(buf,MAXLONG,fmt,args);
va_end(args); va_end(args);
return i; 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) int vsprintf(char *buf, const char *fmt, va_list args)
{ {
return _vsnprintf(buf,INT_MAX,fmt,args); return _vsnprintf(buf,MAXLONG,fmt,args);
} }
/* EOF */ /* EOF */

View file

@ -73,7 +73,7 @@ long atol(const char *str)
* Set any if any `digits' consumed; make it negative to indicate * Set any if any `digits' consumed; make it negative to indicate
* overflow. * overflow.
*/ */
cutoff = neg ? -(unsigned long)LONG_MIN : LONG_MAX; cutoff = neg ? -(unsigned long)MINLONG : MAXLONG;
cutlim = cutoff % (unsigned long)10; cutlim = cutoff % (unsigned long)10;
cutoff /= (unsigned long)10; cutoff /= (unsigned long)10;
for (acc = 0, any = 0;; c = *s++) for (acc = 0, any = 0;; c = *s++)
@ -95,7 +95,7 @@ long atol(const char *str)
} }
if (any < 0) if (any < 0)
{ {
acc = neg ? LONG_MIN : LONG_MAX; acc = neg ? MINLONG : MAXLONG;
} }
else if (neg) else if (neg)
acc = -acc; acc = -acc;

View file

@ -546,7 +546,7 @@ int swprintf(wchar_t *buf, const wchar_t *fmt, ...)
int i; int i;
va_start(args, fmt); va_start(args, fmt);
i=_vsnwprintf(buf,INT_MAX,fmt,args); i=_vsnwprintf(buf,MAXLONG,fmt,args);
va_end(args); va_end(args);
return i; 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) 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 */ /* EOF */