mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 18:25:58 +00:00
Various small changes for registry work
svn path=/trunk/; revision=614
This commit is contained in:
parent
2a466eda80
commit
9957d94c20
5 changed files with 81 additions and 12 deletions
|
@ -3,9 +3,9 @@
|
||||||
:
|
:
|
||||||
: copy files to HD...
|
: copy files to HD...
|
||||||
:
|
:
|
||||||
COPY /Y A:\DRIVERS\*.SYS C:\reactos\system\drivers > NUL:
|
COPY /Y A:\DRIVERS\*.SYS C:\reactos\system32\drivers > NUL:
|
||||||
COPY /Y A:\DLLS\*.DLL C:\reactos\system > NUL:
|
COPY /Y A:\DLLS\*.DLL C:\reactos\system32 > NUL:
|
||||||
COPY /Y A:\APPS\*.EXE C:\reactos\system > NUL:
|
COPY /Y A:\APPS\*.EXE C:\reactos\system32 > NUL:
|
||||||
:
|
:
|
||||||
: present a menu to the booter...
|
: present a menu to the booter...
|
||||||
:
|
:
|
||||||
|
|
|
@ -92,6 +92,7 @@ VOID PsInit(VOID);
|
||||||
VOID TstBegin(VOID);
|
VOID TstBegin(VOID);
|
||||||
VOID KeInit(VOID);
|
VOID KeInit(VOID);
|
||||||
VOID HalInitConsole(boot_param* bp);
|
VOID HalInitConsole(boot_param* bp);
|
||||||
|
VOID CmInitializeRegistry(VOID);
|
||||||
|
|
||||||
extern WCHAR wtolower(WCHAR ch);
|
extern WCHAR wtolower(WCHAR ch);
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
//#define NDEBUG
|
//#define NDEBUG
|
||||||
#include <internal/debug.h>
|
#include <internal/debug.h>
|
||||||
|
|
||||||
#define PROTO_REG 1 /* Comment out to disable */
|
/* #define PROTO_REG 1 /* Comment out to disable */
|
||||||
|
|
||||||
/* ----------------------------------------------------- Typedefs */
|
/* ----------------------------------------------------- Typedefs */
|
||||||
|
|
||||||
|
@ -277,9 +277,11 @@ VOID
|
||||||
CmInitializeRegistry(VOID)
|
CmInitializeRegistry(VOID)
|
||||||
{
|
{
|
||||||
#if PROTO_REG
|
#if PROTO_REG
|
||||||
|
NTSTATUS Status;
|
||||||
HANDLE RootKeyHandle;
|
HANDLE RootKeyHandle;
|
||||||
UNICODE_STRING RootKeyName;
|
UNICODE_STRING RootKeyName;
|
||||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||||
|
PKEY_BLOCK KeyBlock;
|
||||||
|
|
||||||
/* Initialize the Key object type */
|
/* Initialize the Key object type */
|
||||||
CmiKeyType = ExAllocatePool(NonPagedPool, sizeof(OBJECT_TYPE));
|
CmiKeyType = ExAllocatePool(NonPagedPool, sizeof(OBJECT_TYPE));
|
||||||
|
@ -311,14 +313,49 @@ CmInitializeRegistry(VOID)
|
||||||
KeInitializeSpinLock(&CmiKeyListLock);
|
KeInitializeSpinLock(&CmiKeyListLock);
|
||||||
|
|
||||||
/* Build volitile registry store */
|
/* Build volitile registry store */
|
||||||
|
CHECKPOINT;
|
||||||
CmiVolatileFile = CmiCreateRegistry(NULL);
|
CmiVolatileFile = CmiCreateRegistry(NULL);
|
||||||
|
|
||||||
/* Build system registry store */
|
/* 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 */
|
/* 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 */
|
/* 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 */
|
/* FIXME: load volatile registry data from ROSDTECT */
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1653,11 +1690,13 @@ CmiCreateKey(IN PREGISTRY_FILE RegistryFile,
|
||||||
|
|
||||||
/* FIXME: Should handle search by Class/TitleIndex */
|
/* FIXME: Should handle search by Class/TitleIndex */
|
||||||
|
|
||||||
|
CHECKPOINT;
|
||||||
/* Loop through each key level and find or build the needed subkey */
|
/* Loop through each key level and find or build the needed subkey */
|
||||||
Status = STATUS_SUCCESS;
|
Status = STATUS_SUCCESS;
|
||||||
/* FIXME: this access of RootKeyBlock should be guarded by spinlock */
|
/* FIXME: this access of RootKeyBlock should be guarded by spinlock */
|
||||||
CurKeyBlock = CmiGetKeyBlock(RegistryFile,
|
CurKeyBlock = CmiGetKeyBlock(RegistryFile,
|
||||||
RegistryFile->HeaderBlock->RootKeyBlock);
|
RegistryFile->HeaderBlock->RootKeyBlock);
|
||||||
|
CHECKPOINT;
|
||||||
Remainder = KeyNameBuf;
|
Remainder = KeyNameBuf;
|
||||||
while (NT_SUCCESS(Status) &&
|
while (NT_SUCCESS(Status) &&
|
||||||
(NextSlash = wcschr(Remainder, L'\\')) != NULL)
|
(NextSlash = wcschr(Remainder, L'\\')) != NULL)
|
||||||
|
@ -1667,6 +1706,7 @@ CmiCreateKey(IN PREGISTRY_FILE RegistryFile,
|
||||||
CurKeyName[NextSlash - Remainder] = 0;
|
CurKeyName[NextSlash - Remainder] = 0;
|
||||||
|
|
||||||
/* Verify existance of/Create CurKeyName */
|
/* Verify existance of/Create CurKeyName */
|
||||||
|
CHECKPOINT;
|
||||||
Status = CmiScanForSubKey(RegistryFile,
|
Status = CmiScanForSubKey(RegistryFile,
|
||||||
CurKeyBlock,
|
CurKeyBlock,
|
||||||
&SubKeyBlock,
|
&SubKeyBlock,
|
||||||
|
@ -1695,8 +1735,10 @@ CmiCreateKey(IN PREGISTRY_FILE RegistryFile,
|
||||||
|
|
||||||
Remainder = NextSlash + 1;
|
Remainder = NextSlash + 1;
|
||||||
}
|
}
|
||||||
|
CHECKPOINT;
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
CHECKPOINT;
|
||||||
Status = CmiScanForSubKey(RegistryFile,
|
Status = CmiScanForSubKey(RegistryFile,
|
||||||
CurKeyBlock,
|
CurKeyBlock,
|
||||||
&SubKeyBlock,
|
&SubKeyBlock,
|
||||||
|
@ -1723,7 +1765,10 @@ CmiCreateKey(IN PREGISTRY_FILE RegistryFile,
|
||||||
TitleIndex,
|
TitleIndex,
|
||||||
ClassName,
|
ClassName,
|
||||||
CreateOptions);
|
CreateOptions);
|
||||||
ExFreePool(ClassName);
|
if (ClassName != NULL)
|
||||||
|
{
|
||||||
|
ExFreePool(ClassName);
|
||||||
|
}
|
||||||
if (NT_SUCCESS(Status) && Disposition != NULL)
|
if (NT_SUCCESS(Status) && Disposition != NULL)
|
||||||
{
|
{
|
||||||
*Disposition = REG_CREATED_NEW_KEY;
|
*Disposition = REG_CREATED_NEW_KEY;
|
||||||
|
@ -2222,8 +2267,9 @@ CmiAllocateKeyBlock(IN PREGISTRY_FILE RegistryFile,
|
||||||
/* Handle volatile files first */
|
/* Handle volatile files first */
|
||||||
if (RegistryFile->Filename == NULL)
|
if (RegistryFile->Filename == NULL)
|
||||||
{
|
{
|
||||||
NewKeySize = sizeof(KEY_BLOCK) + wcslen(KeyName) + 1 +
|
NewKeySize = sizeof(KEY_BLOCK) +
|
||||||
(Class != NULL ? wcslen(Class) + 1 : 0);
|
(wcslen(KeyName) + 1) * sizeof(WCHAR) +
|
||||||
|
(Class != NULL ? (wcslen(Class) + 1) * sizeof(WCHAR) : 0);
|
||||||
NewKeyBlock = ExAllocatePool(NonPagedPool, NewKeySize);
|
NewKeyBlock = ExAllocatePool(NonPagedPool, NewKeySize);
|
||||||
if (NewKeyBlock == NULL)
|
if (NewKeyBlock == NULL)
|
||||||
{
|
{
|
||||||
|
@ -2385,7 +2431,14 @@ CmiAddKeyToHashTable(PREGISTRY_FILE RegistryFile,
|
||||||
PHASH_TABLE_BLOCK HashBlock,
|
PHASH_TABLE_BLOCK HashBlock,
|
||||||
PKEY_BLOCK NewKeyBlock)
|
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
|
static NTSTATUS
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#include <internal/mmhal.h>
|
#include <internal/mmhal.h>
|
||||||
#include <internal/i386/segment.h>
|
#include <internal/i386/segment.h>
|
||||||
|
|
||||||
#define NDEBUG
|
//#define NDEBUG
|
||||||
#include <internal/debug.h>
|
#include <internal/debug.h>
|
||||||
|
|
||||||
/* FUNCTIONS ****************************************************************/
|
/* FUNCTIONS ****************************************************************/
|
||||||
|
@ -106,6 +106,20 @@ void set_breakpoint(unsigned int i, unsigned int addr, unsigned int type,
|
||||||
extern int edata;
|
extern int edata;
|
||||||
extern int end;
|
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)
|
asmlinkage void _main(boot_param* _bp)
|
||||||
/*
|
/*
|
||||||
|
@ -164,6 +178,7 @@ asmlinkage void _main(boot_param* _bp)
|
||||||
PsInit();
|
PsInit();
|
||||||
IoInit();
|
IoInit();
|
||||||
LdrInitModuleManagement();
|
LdrInitModuleManagement();
|
||||||
|
CmInitializeRegistry();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initalize services loaded at boot time
|
* Initalize services loaded at boot time
|
||||||
|
|
|
@ -290,7 +290,7 @@ NTSTATUS STDCALL NtAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
|
||||||
IN HANDLE ClientToken,
|
IN HANDLE ClientToken,
|
||||||
IN ACCESS_MASK DesiredAccess,
|
IN ACCESS_MASK DesiredAccess,
|
||||||
IN PGENERIC_MAPPING GenericMapping,
|
IN PGENERIC_MAPPING GenericMapping,
|
||||||
OUT PRIVILEGE_SET PrivilegeSet,
|
OUT PPRIVILEGE_SET PrivilegeSet,
|
||||||
OUT PULONG ReturnLength,
|
OUT PULONG ReturnLength,
|
||||||
OUT PULONG GrantedAccess,
|
OUT PULONG GrantedAccess,
|
||||||
OUT PBOOLEAN AccessStatus)
|
OUT PBOOLEAN AccessStatus)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue