mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 00:55:48 +00:00
some changes to registry code
svn path=/trunk/; revision=532
This commit is contained in:
parent
46a0e6e16e
commit
c4ba9a330d
1 changed files with 22 additions and 40 deletions
|
@ -18,11 +18,11 @@
|
||||||
|
|
||||||
/* FILE STATICS *************************************************************/
|
/* FILE STATICS *************************************************************/
|
||||||
|
|
||||||
POBJECT_TYPE CmKeyType = NULL;
|
|
||||||
PKEY_OBJECT RootKey = NULL;
|
|
||||||
|
|
||||||
#if PROTO_REG
|
#if PROTO_REG
|
||||||
static PVOID CmpObjectParse(PVOID ParsedObject, PWSTR* Path);
|
POBJECT_TYPE CmKeyType = NULL;
|
||||||
|
PKEY_OBJECT RootKey = NULL;
|
||||||
|
|
||||||
|
static PVOID CmpObjectParse(PVOID ParsedObject, PWSTR *Path);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
@ -31,8 +31,10 @@ VOID
|
||||||
CmInitializeRegistry(VOID)
|
CmInitializeRegistry(VOID)
|
||||||
{
|
{
|
||||||
#if PROTO_REG
|
#if PROTO_REG
|
||||||
ANSI_STRING AnsiString;
|
UNICODE_STRING RootKeyName;
|
||||||
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||||
|
|
||||||
|
/* Initialize the Key object type */
|
||||||
CmKeyType = ExAllocatePool(NonPagedPool, sizeof(OBJECT_TYPE));
|
CmKeyType = ExAllocatePool(NonPagedPool, sizeof(OBJECT_TYPE));
|
||||||
CmKeyType->TotalObjects = 0;
|
CmKeyType->TotalObjects = 0;
|
||||||
CmKeyType->TotalHandles = 0;
|
CmKeyType->TotalHandles = 0;
|
||||||
|
@ -48,44 +50,22 @@ CmInitializeRegistry(VOID)
|
||||||
CmKeyType->Security = NULL;
|
CmKeyType->Security = NULL;
|
||||||
CmKeyType->QueryName = NULL;
|
CmKeyType->QueryName = NULL;
|
||||||
CmKeyType->OkayToClose = NULL;
|
CmKeyType->OkayToClose = NULL;
|
||||||
|
RtlInitUnicodeString(&CmKeyType->TypeName, L"Key");
|
||||||
RtlInitAnsiString(&AnsiString, "Key");
|
|
||||||
RtlAnsiStringToUnicodeString(&CmKeyType->TypeName, &AnsiString, TRUE);
|
|
||||||
|
|
||||||
RtlInitAnsiString(&AnsiString,"\\Registry");
|
/* Build the Root Key Object */
|
||||||
RtlAnsiStringToUnicodeString(&UnicodeString, &AnsiString, TRUE);
|
RtlInitUnicodeString(&RootKeyName, L"\\Registry");
|
||||||
InitializeObjectAttributes(&attr, &UnicodeString, 0, NULL, NULL);
|
InitializeObjectAttributes(&ObjectAttributes, &RootKeyName, 0, NULL, NULL);
|
||||||
ZwCreateDirectoryObject(&handle, 0, &attr);
|
Status = ObCreateObject(&RootKeyHandle,
|
||||||
RtlFreeUnicodeString(UnicodeString);
|
STANDARD_RIGHTS_REQUIRED,
|
||||||
|
&ObjectAttributes,
|
||||||
|
ObKeyType);
|
||||||
|
|
||||||
/* FIXME: build initial registry skeleton */
|
/* FIXME: map / build registry data */
|
||||||
RootKey = ObGenericCreateObject(NULL,
|
/* FIXME: Create initial predefined symbolic links */
|
||||||
KEY_ALL_ACCESS,
|
/* HKEY_LOCAL_MACHINE */
|
||||||
NULL,
|
/* HKEY_USERS */
|
||||||
CmKeyType);
|
/* FIXME: load volatile registry data from ROSDTECT */
|
||||||
if (NewKey == NULL)
|
|
||||||
{
|
|
||||||
return STATUS_UNSUCCESSFUL;
|
|
||||||
}
|
|
||||||
RootKey->Flags = 0;
|
|
||||||
KeQuerySystemTime(&RootKey->LastWriteTime);
|
|
||||||
RootKey->TitleIndex = 0;
|
|
||||||
RootKey->NumSubKeys = 0;
|
|
||||||
RootKey->MaxSubNameLength = 0;
|
|
||||||
RootKey->MaxSubClassLength = 0;
|
|
||||||
RootKey->SubKeys = NULL;
|
|
||||||
RootKey->NumValues = 0;
|
|
||||||
RootKey->MaxValueNameLength = 0;
|
|
||||||
RootKey->MaxValueDataLength = 0;
|
|
||||||
RootKey->Values = NULL;
|
|
||||||
RootKey->Name = ExAllocatePool(NonPagedPool, 2);
|
|
||||||
wstrcpy(RootKey->Name, "\\");
|
|
||||||
RootKey->Class = NULL;
|
|
||||||
RootKey->NextKey = NULL;
|
|
||||||
|
|
||||||
/* FIXME: Create initial predefined symbolic links */
|
|
||||||
/* HKEY_LOCAL_MACHINE */
|
|
||||||
/* HKEY_USERS */
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -697,6 +677,7 @@ NTSTATUS RtlWriteRegistryValue(ULONG RelativeTo,
|
||||||
UNIMPLEMENTED;
|
UNIMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ------------------------------------------ Private Implementation */
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
static PVOID
|
static PVOID
|
||||||
|
@ -710,6 +691,7 @@ CmpObjectParse(PVOID ParsedObject, PWSTR* Path)
|
||||||
/* If the path is an empty string, we're done */
|
/* If the path is an empty string, we're done */
|
||||||
if (Path == NULL || Path[0] == 0)
|
if (Path == NULL || Path[0] == 0)
|
||||||
{
|
{
|
||||||
|
/* FIXME: return the root key */
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue