- Implement NtCreateKey using the new parse routine.

- NtOpenKey should only return the key handle if the operation was successful.
- Point to new parse routine, and rename it to CmParseKey instead of CmParseKey2 which was used during the test phase.
- Delete all of the "cm" directory, this code is now fully gone; the new Configuration Manager is in place.
- Move cm.h and cm_x.h to include/internal where they belong to and fix all their includers.

svn path=/trunk/; revision=31252
This commit is contained in:
Aleksey Bragin 2007-12-15 18:14:41 +00:00
parent ffa5f05eca
commit 0b6a2fda00
34 changed files with 11540 additions and 12666 deletions

View file

@ -1,18 +0,0 @@
#ifndef __INCLUDE_CM_H
#define __INCLUDE_CM_H
#include "ntoskrnl/config/cm.h"
extern POBJECT_TYPE CmpKeyObjectType;
extern ERESOURCE CmpRegistryLock;
extern EX_PUSH_LOCK CmpHiveListHeadLock;
#define VERIFY_BIN_HEADER(x) ASSERT(x->HeaderId == REG_BIN_ID)
#define VERIFY_KEY_CELL(x) ASSERT(x->Signature == CM_KEY_NODE_SIGNATURE)
#define VERIFY_ROOT_KEY_CELL(x) ASSERT(x->Signature == CM_KEY_NODE_SIGNATURE)
#define VERIFY_VALUE_CELL(x) ASSERT(x->Signature == CM_KEY_VALUE_SIGNATURE)
#define VERIFY_VALUE_LIST_CELL(x)
#define VERIFY_KEY_OBJECT(x)
#define VERIFY_REGISTRY_HIVE(x)
#endif /*__INCLUDE_CM_H*/

File diff suppressed because it is too large Load diff

View file

@ -11,7 +11,6 @@
#include <ntoskrnl.h>
#define NDEBUG
#include <debug.h>
#include "cm.h"
/* GLOBALS *******************************************************************/

View file

@ -9,7 +9,6 @@
/* INCLUDES ******************************************************************/
#include "ntoskrnl.h"
#include "cm.h"
#define NDEBUG
#include "debug.h"

View file

@ -9,7 +9,6 @@
/* INCLUDES ******************************************************************/
#include "ntoskrnl.h"
#include "cm.h"
#define NDEBUG
#include "debug.h"

View file

@ -9,7 +9,6 @@
/* INCLUDES ******************************************************************/
#include "ntoskrnl.h"
#include "cm.h"
#define NDEBUG
#include "debug.h"

View file

@ -9,7 +9,6 @@
/* INCLUDES ******************************************************************/
#include "ntoskrnl.h"
#include "cm.h"
#define NDEBUG
#include "debug.h"

View file

@ -9,7 +9,6 @@
/* INCLUDES ******************************************************************/
#include "ntoskrnl.h"
#include "cm.h"
#define NDEBUG
#include "debug.h"

View file

@ -9,7 +9,6 @@
/* INCLUDES ******************************************************************/
#include "ntoskrnl.h"
#include "cm.h"
#define NDEBUG
#include "debug.h"

View file

@ -11,7 +11,6 @@
#include <ntoskrnl.h>
#define NDEBUG
#include <debug.h>
#include "cm.h"
/* GLOBALS *******************************************************************/

View file

@ -9,7 +9,6 @@
/* INCLUDES ******************************************************************/
#include "ntoskrnl.h"
#include "cm.h"
#define NDEBUG
#include "debug.h"

View file

@ -9,7 +9,6 @@
/* INCLUDES ******************************************************************/
#include "ntoskrnl.h"
#include "cm.h"
#define NDEBUG
#include "debug.h"

View file

@ -9,7 +9,6 @@
/* INCLUDES ******************************************************************/
#include "ntoskrnl.h"
#include "cm.h"
#define NDEBUG
#include "debug.h"

View file

@ -11,7 +11,6 @@
#include <ntoskrnl.h>
#define NDEBUG
#include <debug.h>
#include "cm.h"
/* GLOBALS *******************************************************************/

View file

@ -9,7 +9,6 @@
/* INCLUDES ******************************************************************/
#include "ntoskrnl.h"
#include "cm.h"
#define NDEBUG
#include "debug.h"

View file

@ -9,7 +9,6 @@
/* INCLUDES *******************************************************************/
#include "ntoskrnl.h"
#include "cm.h"
#define NDEBUG
#include "debug.h"

View file

@ -9,7 +9,6 @@
/* INCLUDES ******************************************************************/
#include "ntoskrnl.h"
#include "cm.h"
#define NDEBUG
#include "debug.h"

View file

@ -9,7 +9,6 @@
/* INCLUDES ******************************************************************/
#include "ntoskrnl.h"
#include "cm.h"
#define NDEBUG
#include "debug.h"

View file

@ -9,7 +9,6 @@
/* INCLUDES ******************************************************************/
#include "ntoskrnl.h"
#include "cm.h"
#define NDEBUG
#include "debug.h"
@ -224,19 +223,8 @@ CmpDoCreateChild(IN PHHIVE Hive,
PCELL_DATA CellData;
ULONG StorageType;
LARGE_INTEGER SystemTime;
BOOLEAN Hack = FALSE;
PCM_KEY_CONTROL_BLOCK Kcb;
/* ReactOS Hack */
if (Name->Buffer[0] == OBJ_NAME_PATH_SEPARATOR)
{
/* Skip initial path separator */
Name->Buffer++;
Name->Length -= sizeof(OBJ_NAME_PATH_SEPARATOR);
Name->MaximumLength -= sizeof(OBJ_NAME_PATH_SEPARATOR);
Hack = TRUE;
}
/* Get the storage type */
StorageType = Stable;
if (Flags & REG_OPTION_VOLATILE) StorageType = Volatile;
@ -381,15 +369,6 @@ Quickie:
HvFreeCell(Hive, *KeyCell);
}
/* Check if we applied ReactOS hack */
if (Hack)
{
/* Restore name */
Name->Buffer--;
Name->Length += sizeof(OBJ_NAME_PATH_SEPARATOR);
Name->MaximumLength += sizeof(OBJ_NAME_PATH_SEPARATOR);
}
/* Return status */
return Status;
}
@ -996,16 +975,16 @@ CmpBuildHashStackAndLookupCache(IN PCM_KEY_BODY ParseObject,
NTSTATUS
NTAPI
CmpParseKey2(IN PVOID ParseObject,
IN PVOID ObjectType,
IN OUT PACCESS_STATE AccessState,
IN KPROCESSOR_MODE AccessMode,
IN ULONG Attributes,
IN OUT PUNICODE_STRING CompleteName,
IN OUT PUNICODE_STRING RemainingName,
IN OUT PVOID Context OPTIONAL,
IN PSECURITY_QUALITY_OF_SERVICE SecurityQos OPTIONAL,
OUT PVOID *Object)
CmpParseKey(IN PVOID ParseObject,
IN PVOID ObjectType,
IN OUT PACCESS_STATE AccessState,
IN KPROCESSOR_MODE AccessMode,
IN ULONG Attributes,
IN OUT PUNICODE_STRING CompleteName,
IN OUT PUNICODE_STRING RemainingName,
IN OUT PVOID Context OPTIONAL,
IN PSECURITY_QUALITY_OF_SERVICE SecurityQos OPTIONAL,
OUT PVOID *Object)
{
NTSTATUS Status;
PCM_KEY_CONTROL_BLOCK Kcb, ParentKcb;
@ -1209,8 +1188,6 @@ CmpParseKey2(IN PVOID ParseObject,
/* Check if this was the last key for a create */
if ((Last) && (ParseContext))
{
PCM_KEY_BODY KeyBody;
/* Check if we're doing a link node */
if (ParseContext->CreateLink)
{
@ -1241,11 +1218,6 @@ CmpParseKey2(IN PVOID ParseObject,
/* Check for reparse (in this case, someone beat us) */
if (Status == STATUS_REPARSE) break;
/* ReactOS Hack: Link this key to the parent */
KeyBody = (PCM_KEY_BODY)*Object;
InsertTailList(&ParentKcb->KeyBodyListHead,
&KeyBody->KeyBodyList);
/* Update disposition */
ParseContext->Disposition = REG_CREATED_NEW_KEY;
break;

View file

@ -9,7 +9,6 @@
/* INCLUDES ******************************************************************/
#include "ntoskrnl.h"
#include "cm.h"
#define NDEBUG
#include "debug.h"

View file

@ -9,7 +9,6 @@
/* INCLUDES ******************************************************************/
#include "ntoskrnl.h"
#include "cm.h"
#define NDEBUG
#include "debug.h"

View file

@ -9,7 +9,6 @@
/* INCLUDES ******************************************************************/
#include "ntoskrnl.h"
#include "cm.h"
#define NDEBUG
#include "debug.h"

View file

@ -9,7 +9,6 @@
/* INCLUDES ******************************************************************/
#include "ntoskrnl.h"
#include "cm.h"
#define NDEBUG
#include "debug.h"

View file

@ -9,7 +9,6 @@
/* INCLUDES ******************************************************************/
#include "ntoskrnl.h"
#include "cm.h"
#define NDEBUG
#include "debug.h"

View file

@ -9,7 +9,6 @@
/* INCLUDES ******************************************************************/
#include "ntoskrnl.h"
#include "cm.h"
#define NDEBUG
#include "debug.h"

View file

@ -9,7 +9,6 @@
/* INCLUDES ******************************************************************/
#include "ntoskrnl.h"
#include "../cm.h"
#define NDEBUG
#include "debug.h"

View file

@ -9,7 +9,6 @@
/* INCLUDES ******************************************************************/
#include "ntoskrnl.h"
#include "cm.h"
#define NDEBUG
#include "debug.h"
@ -18,7 +17,6 @@ BOOLEAN CmFirstTime = TRUE;
/* FUNCTIONS *****************************************************************/
#if 0
NTSTATUS
NTAPI
NtCreateKey(OUT PHANDLE KeyHandle,
@ -32,7 +30,9 @@ NtCreateKey(OUT PHANDLE KeyHandle,
NTSTATUS Status;
KPROCESSOR_MODE PreviousMode = ExGetPreviousMode();
CM_PARSE_CONTEXT ParseContext = {0};
HANDLE Handle;
PAGED_CODE();
DPRINT("NtCreateKey(OB 0x%wZ)\n", ObjectAttributes->ObjectName);
/* Setup the parse context */
ParseContext.CreateOperation = TRUE;
@ -46,13 +46,13 @@ NtCreateKey(OUT PHANDLE KeyHandle,
NULL,
DesiredAccess,
&ParseContext,
KeyHandle);
&Handle);
if (NT_SUCCESS(Status)) *KeyHandle = Handle;
/* Return data to user */
if (Disposition) *Disposition = ParseContext.Disposition;
return Status;
}
#endif
NTSTATUS
NTAPI
@ -61,18 +61,26 @@ NtOpenKey(OUT PHANDLE KeyHandle,
IN POBJECT_ATTRIBUTES ObjectAttributes)
{
CM_PARSE_CONTEXT ParseContext = {0};
HANDLE Handle;
NTSTATUS Status;
PAGED_CODE();
DPRINT("NtOpenKey(OB 0x%wZ)\n", ObjectAttributes->ObjectName);
/* Just let the object manager handle this */
return ObOpenObjectByName(ObjectAttributes,
CmpKeyObjectType,
ExGetPreviousMode(),
NULL,
DesiredAccess,
&ParseContext,
KeyHandle);
Status = ObOpenObjectByName(ObjectAttributes,
CmpKeyObjectType,
ExGetPreviousMode(),
NULL,
DesiredAccess,
&ParseContext,
&Handle);
if (NT_SUCCESS(Status)) *KeyHandle = Handle;
/* Return status */
return Status;
}
NTSTATUS
NTAPI
NtDeleteKey(IN HANDLE KeyHandle)

View file

@ -9,7 +9,6 @@
/* INCLUDES ******************************************************************/
#include "ntoskrnl.h"
#include "../cm.h"
#define NDEBUG
#include "debug.h"

View file

@ -12,7 +12,6 @@
#include <ntoskrnl.h>
#define NDEBUG
#include <debug.h>
#include "ntoskrnl/cm/cm.h"
#include "ntstrsafe.h"
typedef struct _INIT_BUFFER

View file

@ -30,6 +30,7 @@
#include "ob.h"
#include "mm.h"
#include "ex.h"
#include "cm.h"
#include "ps.h"
#include "cc.h"
#include "io.h"

View file

@ -142,12 +142,6 @@
<file>cmwraprs.c</file>
<file>ntapi.c</file>
</directory>
<directory name="cm">
<file>ntfunc.c</file>
<file>regfile.c</file>
<file>registry.c</file>
<file>regobj.c</file>
</directory>
<directory name="dbgk">
<file>dbgkutil.c</file>
<file>dbgkobj.c</file>

View file

@ -138,9 +138,6 @@
<file>cmwraprs.c</file>
<file>ntapi.c</file>
</directory>
<directory name="cm">
<file>regobj.c</file>
</directory>
<directory name="dbgk">
<file>dbgkutil.c</file>
<file>dbgkobj.c</file>