Updated registry key flags. 0x20 means packed key name.

svn path=/trunk/; revision=4766
This commit is contained in:
Eric Kohl 2003-05-27 13:58:26 +00:00
parent dfe58a3a5c
commit d5533a3ed7
4 changed files with 23 additions and 23 deletions

View file

@ -140,8 +140,8 @@ typedef struct _KEY_CELL
/* Key cell identifier "kn" (0x6b6e) */ /* Key cell identifier "kn" (0x6b6e) */
USHORT Id; USHORT Id;
/* ? */ /* Flags */
USHORT Type; USHORT Flags;
/* Time of last flush */ /* Time of last flush */
FILETIME LastWriteTime; FILETIME LastWriteTime;
@ -189,14 +189,19 @@ typedef struct _KEY_CELL
UCHAR Name[0]; UCHAR Name[0];
} __attribute__((packed)) KEY_CELL, *PKEY_CELL; } __attribute__((packed)) KEY_CELL, *PKEY_CELL;
/* KEY_CELL.Type constants */ /* KEY_CELL.Flags constants */
#define REG_LINK_KEY_CELL_TYPE 0x10 #define REG_KEY_ROOT_CELL 0x0C
#define REG_KEY_CELL_TYPE 0x20 #define REG_KEY_LINK_CELL 0x10
#define REG_ROOT_KEY_CELL_TYPE 0x2c #define REG_KEY_NAME_PACKED 0x20
// hash record : /*
// HashValue=four letters of value's name * Hash record
*
* HashValue :
* packed name: four letters of value's name
* otherwise: Zero!
*/
typedef struct _HASH_RECORD typedef struct _HASH_RECORD
{ {
BLOCK_OFFSET KeyOffset; BLOCK_OFFSET KeyOffset;
@ -211,6 +216,7 @@ typedef struct _HASH_TABLE_CELL
HASH_RECORD Table[0]; HASH_RECORD Table[0];
} __attribute__((packed)) HASH_TABLE_CELL, *PHASH_TABLE_CELL; } __attribute__((packed)) HASH_TABLE_CELL, *PHASH_TABLE_CELL;
typedef struct _VALUE_LIST_CELL typedef struct _VALUE_LIST_CELL
{ {
LONG CellSize; LONG CellSize;

View file

@ -1321,7 +1321,7 @@ NtSetValueKey(IN HANDLE KeyHandle,
if ((_wcsicmp(ValueName->Buffer, L"SymbolicLinkValue") == 0) && if ((_wcsicmp(ValueName->Buffer, L"SymbolicLinkValue") == 0) &&
(Type == REG_LINK)) (Type == REG_LINK))
{ {
KeyCell->Type = REG_LINK_KEY_CELL_TYPE; KeyCell->Flags |= REG_KEY_LINK_CELL;
CmiMarkBlockDirty(RegistryHive, KeyObject->BlockOffset); CmiMarkBlockDirty(RegistryHive, KeyObject->BlockOffset);
} }

View file

@ -80,7 +80,7 @@ CmiCreateDefaultRootKeyCell(PKEY_CELL RootKeyCell)
RtlZeroMemory(RootKeyCell, sizeof(KEY_CELL)); RtlZeroMemory(RootKeyCell, sizeof(KEY_CELL));
RootKeyCell->CellSize = -sizeof(KEY_CELL); RootKeyCell->CellSize = -sizeof(KEY_CELL);
RootKeyCell->Id = REG_KEY_CELL_ID; RootKeyCell->Id = REG_KEY_CELL_ID;
RootKeyCell->Type = REG_ROOT_KEY_CELL_TYPE; RootKeyCell->Flags = REG_KEY_ROOT_CELL | REG_KEY_NAME_PACKED;
NtQuerySystemTime((PTIME) &RootKeyCell->LastWriteTime); NtQuerySystemTime((PTIME) &RootKeyCell->LastWriteTime);
RootKeyCell->ParentKeyOffset = 0; RootKeyCell->ParentKeyOffset = 0;
RootKeyCell->NumberOfSubKeys = 0; RootKeyCell->NumberOfSubKeys = 0;
@ -147,13 +147,7 @@ CmiVerifyKeyCell(PKEY_CELL KeyCell)
assert(KeyCell->Id == REG_KEY_CELL_ID); assert(KeyCell->Id == REG_KEY_CELL_ID);
} }
if ((KeyCell->Type != REG_KEY_CELL_TYPE) //KeyCell->Flags;
&& (KeyCell->Type != REG_ROOT_KEY_CELL_TYPE))
{
DbgPrint("Type is %.08x (should be %.08x or %.08x)\n",
KeyCell->Type, REG_KEY_CELL_TYPE, REG_ROOT_KEY_CELL_TYPE);
assert(FALSE);
}
//KeyCell->LastWriteTime; //KeyCell->LastWriteTime;
@ -207,11 +201,11 @@ CmiVerifyRootKeyCell(PKEY_CELL RootKeyCell)
CmiVerifyKeyCell(RootKeyCell); CmiVerifyKeyCell(RootKeyCell);
if (RootKeyCell->Type != REG_ROOT_KEY_CELL_TYPE) if (!(RootKeyCell->Flags & REG_KEY_ROOT_CELL))
{ {
DbgPrint("Type is %.08x (should be %.08x)\n", DbgPrint("Type is %.08x (should be %.08x)\n",
RootKeyCell->Type, REG_ROOT_KEY_CELL_TYPE); RootKeyCell->Flags, REG_KEY_ROOT_CELL | REG_KEY_NAME_PACKED);
assert(RootKeyCell->Type == REG_ROOT_KEY_CELL_TYPE); assert(!(RootKeyCell->Type & REG_KEY_ROOT_CELL));
} }
} }
@ -2136,7 +2130,7 @@ CmiAddSubKey(PREGISTRY_HIVE RegistryHive,
else else
{ {
NewKeyCell->Id = REG_KEY_CELL_ID; NewKeyCell->Id = REG_KEY_CELL_ID;
NewKeyCell->Type = REG_KEY_CELL_TYPE; NewKeyCell->Flags = REG_KEY_NAME_PACKED;
ZwQuerySystemTime((PTIME) &NewKeyCell->LastWriteTime); ZwQuerySystemTime((PTIME) &NewKeyCell->LastWriteTime);
NewKeyCell->ParentKeyOffset = -1; NewKeyCell->ParentKeyOffset = -1;
NewKeyCell->NumberOfSubKeys = 0; NewKeyCell->NumberOfSubKeys = 0;

View file

@ -91,7 +91,7 @@ CmiObjectParse(PVOID ParsedObject,
return(STATUS_UNSUCCESSFUL); return(STATUS_UNSUCCESSFUL);
} }
if ((SubKeyCell->Type == REG_LINK_KEY_CELL_TYPE) && if ((SubKeyCell->Flags & REG_KEY_LINK_CELL) &&
!((Attributes & OBJ_OPENLINK) && (EndPtr == NULL) /*(end == NULL)*/)) !((Attributes & OBJ_OPENLINK) && (EndPtr == NULL) /*(end == NULL)*/))
{ {
RtlInitUnicodeString(&LinkPath, NULL); RtlInitUnicodeString(&LinkPath, NULL);
@ -156,7 +156,7 @@ CmiObjectParse(PVOID ParsedObject,
} }
else else
{ {
if ((FoundObject->KeyCell->Type == REG_LINK_KEY_CELL_TYPE) && if ((FoundObject->KeyCell->Flags & REG_KEY_LINK_CELL) &&
!((Attributes & OBJ_OPENLINK) && (EndPtr == NULL)/*(end == NULL)*/)) !((Attributes & OBJ_OPENLINK) && (EndPtr == NULL)/*(end == NULL)*/))
{ {
DPRINT("Found link\n"); DPRINT("Found link\n");