From c731ec2a5ae5b0bea2dfc746e4404a4e9c95062b Mon Sep 17 00:00:00 2001 From: Alex Ionescu Date: Thu, 15 Feb 2007 17:44:04 +0000 Subject: [PATCH] - Small placeholder change for future Cm code: - Added newcm.c which will contain some new Cm code part of the Cm Rewrite but not in the rewrite branch (used solely for supporting CmGetSystemControlValues). - Added System Control Vector which supports all the registry flags that Windows 2003 SP1 supports as well. - The most important part of this support, at least for us, is to get boot-time time zone support working properly. We can worry about the other options later. - Update KrnlFun for previous DPC/HAL fixes. svn path=/trunk/; revision=25806 --- reactos/ntoskrnl/KrnlFun.c | 2 - reactos/ntoskrnl/cm/cm.h | 20 + reactos/ntoskrnl/cm/cmdata.c | 710 +++++++++++++++++++++++++++++++ reactos/ntoskrnl/cm/newcm.c | 12 + reactos/ntoskrnl/ex/init.c | 6 +- reactos/ntoskrnl/ntoskrnl.rbuild | 2 + 6 files changed, 748 insertions(+), 4 deletions(-) create mode 100644 reactos/ntoskrnl/cm/cmdata.c create mode 100644 reactos/ntoskrnl/cm/newcm.c diff --git a/reactos/ntoskrnl/KrnlFun.c b/reactos/ntoskrnl/KrnlFun.c index 4e46c48e3d3..3f59d2d7a62 100644 --- a/reactos/ntoskrnl/KrnlFun.c +++ b/reactos/ntoskrnl/KrnlFun.c @@ -9,12 +9,10 @@ // Failure to respect this will *ACHIEVE NOTHING*. // // Hal: -// - Use APC and DPC Interrupt Dispatchers. // - CMOS Initialization and CMOS Spinlock. // // Global: // - TODO: Complete the list of bufxies -// - Fix DPCs interrupting code at DISPATCH_LEVEL // - Fix atapi.sys or serial.sys loading one more time at each boot. // /////////////////////////////////////////////////////////////////////////////// diff --git a/reactos/ntoskrnl/cm/cm.h b/reactos/ntoskrnl/cm/cm.h index 1cf510988cd..8c1e86742c2 100644 --- a/reactos/ntoskrnl/cm/cm.h +++ b/reactos/ntoskrnl/cm/cm.h @@ -447,4 +447,24 @@ static __inline HCELL_INDEX xHvAllocateCell(char *file, int line, PHHIVE Hive, S #define ObGetObjectPointerCount(x) OBJECT_TO_OBJECT_HEADER(x)->PointerCount #define ObGetObjectHandleCount(x) OBJECT_TO_OBJECT_HEADER(x)->HandleCount +// +// System Control Vector +// +typedef struct _CM_SYSTEM_CONTROL_VECTOR +{ + PWCHAR KeyPath; + PWCHAR ValueName; + PVOID Buffer; + PULONG BufferLength; + PULONG Type; +} CM_SYSTEM_CONTROL_VECTOR, *PCM_SYSTEM_CONTROL_VECTOR; + +VOID +NTAPI +CmGetSystemControlValues( + IN PVOID SystemHiveData, + IN PCM_SYSTEM_CONTROL_VECTOR ControlVector +); + +extern CM_SYSTEM_CONTROL_VECTOR CmControlVector[]; #endif /*__INCLUDE_CM_H*/ diff --git a/reactos/ntoskrnl/cm/cmdata.c b/reactos/ntoskrnl/cm/cmdata.c new file mode 100644 index 00000000000..02fa34083ef --- /dev/null +++ b/reactos/ntoskrnl/cm/cmdata.c @@ -0,0 +1,710 @@ +#include "ntoskrnl.h" +#include "cm.h" + +/* SYSTEM CONFIGURATION VECTOR ***********************************************/ + +ULONG DummyData; +ULONG CmNtGlobalFlag; +ULONG CmNtCSDVersion; + +WCHAR CmDefaultLanguageId[12]; +ULONG CmDefaultLanguageIdLength = sizeof(CmDefaultLanguageId); +ULONG CmDefaultLanguageIdType; + +WCHAR CmInstallUILanguageId[12]; +ULONG CmInstallUILanguageIdLength = sizeof(CmInstallUILanguageId); +ULONG CmInstallUILanguageIdType; + +WCHAR CmSuiteBuffer[128]; +ULONG CmSuiteBufferLength = sizeof(CmSuiteBuffer); +ULONG CmSuiteBufferType; + +extern LANGID PsInstallUILanguageId; +extern LANGID PsDefaultUILanguageId; + +//CMHIVE CmControlHive; + +CM_SYSTEM_CONTROL_VECTOR CmControlVector[] = +{ + { + L"Session Manager", + L"ProtectionMode", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager", + L"ObjectSecurityMode", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager", + L"LUIDDeviceMapsDisabled", + &DummyData, + NULL, + NULL + }, + + { + L"LSA", + L"AuditBaseDirectories", + &DummyData, + NULL, + NULL + }, + + { + L"LSA", + L"AuditBaseObjects", + &DummyData, + NULL, + NULL + }, + + { + L"LSA\\audit", + L"ProcessAccessesToAudit", + &DummyData, + NULL, + NULL + }, + + { + L"TimeZoneInformation", + L"ActiveTimeBias", + &DummyData, + NULL, + NULL + }, + + { + L"TimeZoneInformation", + L"Bias", + &DummyData, + NULL, + NULL + }, + + { + L"TimeZoneInformation", + L"RealTimeIsUniversal", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager", + L"GlobalFlag", + &CmNtGlobalFlag, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"PagedPoolQuota", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"NonPagedPoolQuota", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"PagingFileQuota", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"AllocationPreference", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"DynamicMemory", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"Mirroring", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"Mirroring", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"SystemViewSize", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"SessionViewSize", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"SessionImageSize", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"SessionPoolSize", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"PoolUsageMaximum", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"MapAllocationFragment", + &DummyData, + NULL, + NULL + }, + +{ + L"Session Manager\\Memory Management", + L"PagedPoolSize", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"NonPagedPoolSize", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"NonPagedPoolMaximumPercent", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"LargeSystemCache", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"LargeStackSize", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"SystemPages", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"LowMemoryThreshold", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"HighMemoryThreshold", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"DisablePagingExecutive", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"ModifiedPageLife", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"SecondLevelDataCache", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"ClearPageFileAtShutdown", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"PoolTagSmallTableSize", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"PoolTagBigTableSize", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"PoolTag", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"PoolTagOverruns", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"SnapUnloads", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"ProtectNonPagedPool", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"TrackLockedPages", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"TrackPtes", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"VerifyDrivers", + &DummyData, + &DummyData, + &DummyData + }, + + { + L"Session Manager\\Memory Management", + L"VerifyDriverLevel", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"VerifyMode", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"LargePageMinimum", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"EnforceWriteProtection", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"MakeLowMemory", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Memory Management", + L"WriteWatch", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Executive", + L"AdditionalCriticalWorkerThreads", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Executive", + L"AdditionalDelayedWorkerThreads", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Executive", + L"PriorityQuantumMatrix", + &DummyData, + &DummyData, + NULL + }, + + { + L"Session Manager\\Kernel", + L"DpcQueueDepth", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Kernel", + L"MinimumDpcRate", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Kernel", + L"AdjustDpcThreshold", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Kernel", + L"IdealDpcRate", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\I/O System", + L"CountOperations", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\I/O System", + L"LargeIrpStackLocations", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\I/O System", + L"IoVerifierLevel", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager", + L"ResourceTimeoutCount", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager", + L"CriticalSectionTimeout", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager", + L"HeapSegmentReserve", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager", + L"HeapSegmentCommit", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager", + L"HeapDeCommitTotalFreeThreshold", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager", + L"HeapDeCommitFreeBlockThreshold", + &DummyData, + NULL, + NULL + }, + + { + L"ProductOptions", + L"ProductType", + &DummyData, + NULL, + NULL + }, + + { + L"Terminal Server", + L"TSEnabled", + &DummyData, + NULL, + NULL + }, + + { + L"Terminal Server", + L"TSAppCompat", + &DummyData, + NULL, + NULL + }, + + + { + L"ProductOptions", + L"ProductSuite", + CmSuiteBuffer, + &CmSuiteBufferLength, + &CmSuiteBufferType + }, + + { + L"Windows", + L"CSDVersion", + &CmNtCSDVersion, + NULL, + NULL + }, + + { + L"Nls\\Language", + L"Default", + CmDefaultLanguageId, + &CmDefaultLanguageIdLength, + &CmDefaultLanguageIdType + }, + + { + L"Nls\\Language", + L"InstallLanguage", + CmInstallUILanguageId, + &CmInstallUILanguageIdLength, + &CmInstallUILanguageIdType + }, + + { + L"\0\0", + L"RegistrySizeLimit", + &DummyData, + &DummyData, + &DummyData + }, + + { + L"Session Manager", + L"ForceNpxEmulation", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager", + L"PowerPolicySimulate", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager\\Executive", + L"MaxTimeSeparationBeforeCorrect", + &DummyData, + NULL, + NULL + }, + + { + L"Windows", + L"ShutdownTime", + &DummyData, + &DummyData, + NULL + }, + + { + L"PriorityControl", + L"Win32PrioritySeparation", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager", + L"EnableTimerWatchdog", + &DummyData, + NULL, + NULL + }, + + { + L"Session Manager", + L"Debugger Retries", + &DummyData, + NULL, + NULL + }, + + { + L"WMI", + L"MaxEventSize", + &DummyData, + NULL, + NULL + }, + + { + L"WMI\\Trace", + L"UsePerformanceClock", + &DummyData, + NULL, + NULL + }, + + { + L"WMI\\Trace", + L"TraceAlignment", + &DummyData, + NULL, + NULL + }, + + { + NULL, + NULL, + NULL, + NULL, + NULL +} +}; + diff --git a/reactos/ntoskrnl/cm/newcm.c b/reactos/ntoskrnl/cm/newcm.c new file mode 100644 index 00000000000..76ea69df9fb --- /dev/null +++ b/reactos/ntoskrnl/cm/newcm.c @@ -0,0 +1,12 @@ +#include "ntoskrnl.h" +#include "cm.h" +#include "debug.h" + +VOID +NTAPI +CmGetSystemControlValues(IN PVOID SystemHiveData, + IN PCM_SYSTEM_CONTROL_VECTOR ControlVector) +{ + return; +} + diff --git a/reactos/ntoskrnl/ex/init.c b/reactos/ntoskrnl/ex/init.c index e6a180e5469..d65b5354dff 100644 --- a/reactos/ntoskrnl/ex/init.c +++ b/reactos/ntoskrnl/ex/init.c @@ -11,7 +11,9 @@ #include #define NDEBUG -#include +#include +//#include +#include "ntoskrnl/cm/cm.h" /* DATA **********************************************************************/ @@ -889,7 +891,7 @@ ExpInitializeExecutive(IN ULONG Cpu, KiInitializeBugCheck(); /* Setup initial system settings (FIXME: Needs Cm Rewrite) */ - //CmGetSystemControlValues(CommandLine, &CmControlVector); + CmGetSystemControlValues(LoaderBlock->RegistryBase, CmControlVector); /* Initialize the executive at phase 0 */ if (!ExInitSystem()) KEBUGCHECK(PHASE0_INITIALIZATION_FAILED); diff --git a/reactos/ntoskrnl/ntoskrnl.rbuild b/reactos/ntoskrnl/ntoskrnl.rbuild index 977ab822c25..591bac5a370 100644 --- a/reactos/ntoskrnl/ntoskrnl.rbuild +++ b/reactos/ntoskrnl/ntoskrnl.rbuild @@ -86,6 +86,8 @@ regfile.c registry.c regobj.c + newcm.c + cmdata.c