diff --git a/reactos/bootflop.bat b/reactos/bootflop.bat index 06655de6172..2471d74c06c 100644 --- a/reactos/bootflop.bat +++ b/reactos/bootflop.bat @@ -3,9 +3,9 @@ : : copy files to HD... : -COPY /Y A:\DRIVERS\*.SYS C:\reactos\system\drivers > NUL: -COPY /Y A:\DLLS\*.DLL C:\reactos\system > NUL: -COPY /Y A:\APPS\*.EXE C:\reactos\system > NUL: +COPY /Y A:\DRIVERS\*.SYS C:\reactos\system32\drivers > NUL: +COPY /Y A:\DLLS\*.DLL C:\reactos\system32 > NUL: +COPY /Y A:\APPS\*.EXE C:\reactos\system32 > NUL: : : present a menu to the booter... : diff --git a/reactos/include/internal/ntoskrnl.h b/reactos/include/internal/ntoskrnl.h index 87d6ea66bfb..a549e47811a 100644 --- a/reactos/include/internal/ntoskrnl.h +++ b/reactos/include/internal/ntoskrnl.h @@ -92,6 +92,7 @@ VOID PsInit(VOID); VOID TstBegin(VOID); VOID KeInit(VOID); VOID HalInitConsole(boot_param* bp); +VOID CmInitializeRegistry(VOID); extern WCHAR wtolower(WCHAR ch); diff --git a/reactos/ntoskrnl/cm/registry.c b/reactos/ntoskrnl/cm/registry.c index 9a7e923201a..7f8f0f63f73 100644 --- a/reactos/ntoskrnl/cm/registry.c +++ b/reactos/ntoskrnl/cm/registry.c @@ -18,7 +18,7 @@ //#define NDEBUG #include -#define PROTO_REG 1 /* Comment out to disable */ +/* #define PROTO_REG 1 /* Comment out to disable */ /* ----------------------------------------------------- Typedefs */ @@ -277,9 +277,11 @@ VOID CmInitializeRegistry(VOID) { #if PROTO_REG + NTSTATUS Status; HANDLE RootKeyHandle; UNICODE_STRING RootKeyName; OBJECT_ATTRIBUTES ObjectAttributes; + PKEY_BLOCK KeyBlock; /* Initialize the Key object type */ CmiKeyType = ExAllocatePool(NonPagedPool, sizeof(OBJECT_TYPE)); @@ -311,14 +313,49 @@ CmInitializeRegistry(VOID) KeInitializeSpinLock(&CmiKeyListLock); /* Build volitile registry store */ +CHECKPOINT; CmiVolatileFile = CmiCreateRegistry(NULL); /* Build system registry store */ - CmiSystemFile = CmiCreateRegistry(SYSTEM_REG_FILE); +CHECKPOINT; + CmiSystemFile = NULL; // CmiCreateRegistry(SYSTEM_REG_FILE); - /* FIXME: Create initial predefined symbolic links */ + /* Create initial predefined symbolic links */ /* HKEY_LOCAL_MACHINE */ +CHECKPOINT; + Status = CmiCreateKey(CmiVolatileFile, + L"Machine", + &KeyBlock, + KEY_ALL_ACCESS, + 0, + NULL, + REG_OPTION_VOLATILE, + 0); + if (!NT_SUCCESS(Status)) + { + return; + } +CHECKPOINT; + CmiReleaseBlock(CmiVolatileFile, KeyBlock); + /* HKEY_USERS */ +CHECKPOINT; + Status = CmiCreateKey(CmiVolatileFile, + L"Users", + &KeyBlock, + KEY_ALL_ACCESS, + 0, + NULL, + REG_OPTION_VOLATILE, + 0); + if (!NT_SUCCESS(Status)) + { + return; + } +CHECKPOINT; + CmiReleaseBlock(CmiVolatileFile, KeyBlock); + + /* FIXME: create remaining structure needed for default handles */ /* FIXME: load volatile registry data from ROSDTECT */ #endif @@ -1653,11 +1690,13 @@ CmiCreateKey(IN PREGISTRY_FILE RegistryFile, /* FIXME: Should handle search by Class/TitleIndex */ +CHECKPOINT; /* Loop through each key level and find or build the needed subkey */ Status = STATUS_SUCCESS; /* FIXME: this access of RootKeyBlock should be guarded by spinlock */ CurKeyBlock = CmiGetKeyBlock(RegistryFile, RegistryFile->HeaderBlock->RootKeyBlock); +CHECKPOINT; Remainder = KeyNameBuf; while (NT_SUCCESS(Status) && (NextSlash = wcschr(Remainder, L'\\')) != NULL) @@ -1667,6 +1706,7 @@ CmiCreateKey(IN PREGISTRY_FILE RegistryFile, CurKeyName[NextSlash - Remainder] = 0; /* Verify existance of/Create CurKeyName */ +CHECKPOINT; Status = CmiScanForSubKey(RegistryFile, CurKeyBlock, &SubKeyBlock, @@ -1695,8 +1735,10 @@ CmiCreateKey(IN PREGISTRY_FILE RegistryFile, Remainder = NextSlash + 1; } +CHECKPOINT; if (NT_SUCCESS(Status)) { +CHECKPOINT; Status = CmiScanForSubKey(RegistryFile, CurKeyBlock, &SubKeyBlock, @@ -1723,7 +1765,10 @@ CmiCreateKey(IN PREGISTRY_FILE RegistryFile, TitleIndex, ClassName, CreateOptions); - ExFreePool(ClassName); + if (ClassName != NULL) + { + ExFreePool(ClassName); + } if (NT_SUCCESS(Status) && Disposition != NULL) { *Disposition = REG_CREATED_NEW_KEY; @@ -2222,8 +2267,9 @@ CmiAllocateKeyBlock(IN PREGISTRY_FILE RegistryFile, /* Handle volatile files first */ if (RegistryFile->Filename == NULL) { - NewKeySize = sizeof(KEY_BLOCK) + wcslen(KeyName) + 1 + - (Class != NULL ? wcslen(Class) + 1 : 0); + NewKeySize = sizeof(KEY_BLOCK) + + (wcslen(KeyName) + 1) * sizeof(WCHAR) + + (Class != NULL ? (wcslen(Class) + 1) * sizeof(WCHAR) : 0); NewKeyBlock = ExAllocatePool(NonPagedPool, NewKeySize); if (NewKeyBlock == NULL) { @@ -2385,7 +2431,14 @@ CmiAddKeyToHashTable(PREGISTRY_FILE RegistryFile, PHASH_TABLE_BLOCK HashBlock, PKEY_BLOCK NewKeyBlock) { - UNIMPLEMENTED; + HashBlock->Table[HashBlock->HashTableSize].KeyOffset = + CmiGetBlockOffset(RegistryFile, NewKeyBlock); + RtlCopyMemory(&HashBlock->Table[HashBlock->HashTableSize].HashValue, + NewKeyBlock->Name, + 4); + HashBlock->HashTableSize++; + + return STATUS_SUCCESS; } static NTSTATUS diff --git a/reactos/ntoskrnl/ke/main.c b/reactos/ntoskrnl/ke/main.c index 9b98d5885e3..e0816c96fbd 100644 --- a/reactos/ntoskrnl/ke/main.c +++ b/reactos/ntoskrnl/ke/main.c @@ -25,7 +25,7 @@ #include #include -#define NDEBUG +//#define NDEBUG #include /* FUNCTIONS ****************************************************************/ @@ -106,6 +106,20 @@ void set_breakpoint(unsigned int i, unsigned int addr, unsigned int type, extern int edata; extern int end; +static char * INIData = + "[HKEY_LOCAL_MACHINE\HARDWARE]\r\n" + "\r\n" + "[HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP]\r\n" + "\r\n" + "[HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\AtDisk]\r\n" + "\r\n" + "[HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\AtDisk\Controller 0]\r\n" + "Controller Address=dword:000001f0\r\n" + "Controller Interrupt=dword:0000000e\r\n" + "\r\n" + "\r\n" + "\r\n" + ""; asmlinkage void _main(boot_param* _bp) /* @@ -164,6 +178,7 @@ asmlinkage void _main(boot_param* _bp) PsInit(); IoInit(); LdrInitModuleManagement(); + CmInitializeRegistry(); /* * Initalize services loaded at boot time diff --git a/reactos/ntoskrnl/se/semgr.c b/reactos/ntoskrnl/se/semgr.c index 9f477c1edf3..5771bb2e86d 100644 --- a/reactos/ntoskrnl/se/semgr.c +++ b/reactos/ntoskrnl/se/semgr.c @@ -290,7 +290,7 @@ NTSTATUS STDCALL NtAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor, IN HANDLE ClientToken, IN ACCESS_MASK DesiredAccess, IN PGENERIC_MAPPING GenericMapping, - OUT PRIVILEGE_SET PrivilegeSet, + OUT PPRIVILEGE_SET PrivilegeSet, OUT PULONG ReturnLength, OUT PULONG GrantedAccess, OUT PBOOLEAN AccessStatus)