mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +00:00
- Fix small build brekage.
- Fix HBIN definition. svn path=/trunk/; revision=23575
This commit is contained in:
parent
da51ac07a6
commit
b2ff1d22b8
8 changed files with 36 additions and 35 deletions
|
@ -787,8 +787,8 @@ CmiWriteHive(PHHIVE Hive,
|
|||
{
|
||||
Bin = (PHBIN)Hive->Storage[HvStable].BlockList[i].Bin;
|
||||
memcpy (ChunkBase + (i + 1) * HV_BLOCK_SIZE,
|
||||
Bin, Bin->BinSize);
|
||||
Size += Bin->BinSize;
|
||||
Bin, Bin->Size);
|
||||
Size += Bin->Size;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -133,16 +133,17 @@ typedef struct _CM_KEY_VALUE
|
|||
#define REG_DATA_SIZE_MASK 0x7FFFFFFF
|
||||
#define REG_DATA_IN_OFFSET 0x80000000
|
||||
|
||||
typedef struct _SECURITY_CELL
|
||||
typedef struct _CM_KEY_SECURITY
|
||||
{
|
||||
USHORT Id; // "sk"
|
||||
USHORT Reserved;
|
||||
HCELL_INDEX PrevSecurityCell;
|
||||
HCELL_INDEX NextSecurityCell;
|
||||
ULONG RefCount;
|
||||
ULONG SdSize;
|
||||
UCHAR Data[0];
|
||||
} SECURITY_CELL, *PSECURITY_CELL;
|
||||
USHORT Signature; // "sk"
|
||||
USHORT Reserved;
|
||||
HCELL_INDEX Flink;
|
||||
HCELL_INDEX Blink;
|
||||
ULONG ReferenceCount;
|
||||
ULONG DescriptorLength;
|
||||
//SECURITY_DESCRIPTOR_RELATIVE Descriptor;
|
||||
UCHAR Data[0];
|
||||
} CM_KEY_SECURITY, *PCM_KEY_SECURITY;
|
||||
|
||||
#include <poppack.h>
|
||||
|
||||
|
|
|
@ -32,9 +32,9 @@ HvpAddBin(
|
|||
RtlZeroMemory(Bin, sizeof(HBIN));
|
||||
|
||||
Bin->Signature = HV_BIN_SIGNATURE;
|
||||
Bin->BinOffset = RegistryHive->Storage[Storage].Length *
|
||||
Bin->FileOffset = RegistryHive->Storage[Storage].Length *
|
||||
HV_BLOCK_SIZE;
|
||||
Bin->BinSize = BinSize;
|
||||
Bin->Size = BinSize;
|
||||
|
||||
/* Allocate new block list */
|
||||
OldBlockListSize = RegistryHive->Storage[Storage].Length;
|
||||
|
@ -90,7 +90,7 @@ HvpAddBin(
|
|||
|
||||
/* Mark new bin dirty. */
|
||||
RtlSetBits(&RegistryHive->DirtyVector,
|
||||
Bin->BinOffset / HV_BLOCK_SIZE,
|
||||
Bin->FileOffset / HV_BLOCK_SIZE,
|
||||
BlockCount);
|
||||
}
|
||||
|
||||
|
|
|
@ -242,12 +242,12 @@ HvpCreateHiveFreeCellList(
|
|||
|
||||
/* Search free blocks and add to list */
|
||||
FreeOffset = sizeof(HBIN);
|
||||
while (FreeOffset < Bin->BinSize)
|
||||
while (FreeOffset < Bin->Size)
|
||||
{
|
||||
FreeBlock = (PCELL_HEADER)((ULONG_PTR)Bin + FreeOffset);
|
||||
if (FreeBlock->CellSize > 0)
|
||||
{
|
||||
Status = HvpAddFree(Hive, FreeBlock, Bin->BinOffset + FreeOffset);
|
||||
Status = HvpAddFree(Hive, FreeBlock, Bin->FileOffset + FreeOffset);
|
||||
if (!NT_SUCCESS(Status))
|
||||
return Status;
|
||||
|
||||
|
@ -259,8 +259,8 @@ HvpCreateHiveFreeCellList(
|
|||
}
|
||||
}
|
||||
|
||||
BlockIndex += Bin->BinSize / HV_BLOCK_SIZE;
|
||||
BlockOffset += Bin->BinSize;
|
||||
BlockIndex += Bin->Size / HV_BLOCK_SIZE;
|
||||
BlockOffset += Bin->Size;
|
||||
}
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
|
@ -291,7 +291,7 @@ HvAllocateCell(
|
|||
Bin = HvpAddBin(RegistryHive, Size, Storage);
|
||||
if (Bin == NULL)
|
||||
return HCELL_NULL;
|
||||
FreeCellOffset = Bin->BinOffset + sizeof(HBIN);
|
||||
FreeCellOffset = Bin->FileOffset + sizeof(HBIN);
|
||||
FreeCellOffset |= Storage << HCELL_TYPE_SHIFT;
|
||||
}
|
||||
|
||||
|
@ -387,14 +387,14 @@ HvFreeCell(
|
|||
Bin = (PHBIN)RegistryHive->Storage[CellType].BlockList[CellBlock].Bin;
|
||||
|
||||
if ((CellIndex & ~HCELL_TYPE_MASK) + Free->CellSize <
|
||||
Bin->BinOffset + Bin->BinSize)
|
||||
Bin->FileOffset + Bin->Size)
|
||||
{
|
||||
Neighbor = (PCELL_HEADER)((ULONG_PTR)Free + Free->CellSize);
|
||||
if (Neighbor->CellSize > 0)
|
||||
{
|
||||
HvpRemoveFree(RegistryHive, Neighbor,
|
||||
((HCELL_INDEX)Neighbor - (HCELL_INDEX)Bin +
|
||||
Bin->BinOffset) | (CellIndex & HCELL_TYPE_MASK));
|
||||
Bin->FileOffset) | (CellIndex & HCELL_TYPE_MASK));
|
||||
Free->CellSize += Neighbor->CellSize;
|
||||
}
|
||||
}
|
||||
|
@ -410,7 +410,7 @@ HvFreeCell(
|
|||
if (CellType == HvStable)
|
||||
HvMarkCellDirty(RegistryHive,
|
||||
(HCELL_INDEX)Neighbor - (HCELL_INDEX)Bin +
|
||||
Bin->BinOffset);
|
||||
Bin->FileOffset);
|
||||
return;
|
||||
}
|
||||
Neighbor = (PCELL_HEADER)((ULONG_PTR)Neighbor + Neighbor->CellSize);
|
||||
|
|
|
@ -99,21 +99,21 @@ typedef struct _HBASE_BLOCK
|
|||
ULONG BootRecover;
|
||||
} HBASE_BLOCK, *PHBASE_BLOCK;
|
||||
|
||||
typedef struct _BIN_HEADER
|
||||
typedef struct _HBIN
|
||||
{
|
||||
/* Bin identifier "hbin" (0x6E696268) */
|
||||
ULONG Signature;
|
||||
|
||||
/* Block offset of this bin */
|
||||
HCELL_INDEX BinOffset;
|
||||
HCELL_INDEX FileOffset;
|
||||
|
||||
/* Size in bytes, multiple of the block size (4KB) */
|
||||
ULONG BinSize;
|
||||
ULONG Size;
|
||||
|
||||
ULONG Reserved[2];
|
||||
ULONG Reserved1[2];
|
||||
|
||||
/* When this bin was last modified */
|
||||
LARGE_INTEGER DateModified;
|
||||
LARGE_INTEGER TimeStamp;
|
||||
|
||||
/* ? (In-memory only) */
|
||||
ULONG MemAlloc;
|
||||
|
|
|
@ -181,14 +181,14 @@ HvpInitializeMemoryHive(
|
|||
{
|
||||
Bin = (PHBIN)((ULONG_PTR)ChunkBase + (BlockIndex + 1) * HV_BLOCK_SIZE);
|
||||
if (Bin->Signature != HV_BIN_SIGNATURE ||
|
||||
(Bin->BinSize % HV_BLOCK_SIZE) != 0)
|
||||
(Bin->Size % HV_BLOCK_SIZE) != 0)
|
||||
{
|
||||
Hive->Free(Hive->HiveHeader);
|
||||
Hive->Free(Hive->Storage[HvStable].BlockList);
|
||||
return STATUS_REGISTRY_CORRUPT;
|
||||
}
|
||||
|
||||
NewBin = Hive->Allocate(Bin->BinSize, TRUE);
|
||||
NewBin = Hive->Allocate(Bin->Size, TRUE);
|
||||
if (NewBin == NULL)
|
||||
{
|
||||
Hive->Free(Hive->HiveHeader);
|
||||
|
@ -199,11 +199,11 @@ HvpInitializeMemoryHive(
|
|||
Hive->Storage[HvStable].BlockList[BlockIndex].Bin = (ULONG_PTR)NewBin;
|
||||
Hive->Storage[HvStable].BlockList[BlockIndex].Block = (ULONG_PTR)NewBin;
|
||||
|
||||
RtlCopyMemory(NewBin, Bin, Bin->BinSize);
|
||||
RtlCopyMemory(NewBin, Bin, Bin->Size);
|
||||
|
||||
if (Bin->BinSize > HV_BLOCK_SIZE)
|
||||
if (Bin->Size > HV_BLOCK_SIZE)
|
||||
{
|
||||
for (i = 1; i < Bin->BinSize / HV_BLOCK_SIZE; i++)
|
||||
for (i = 1; i < Bin->Size / HV_BLOCK_SIZE; i++)
|
||||
{
|
||||
Hive->Storage[HvStable].BlockList[BlockIndex + i].Bin = (ULONG_PTR)NewBin;
|
||||
Hive->Storage[HvStable].BlockList[BlockIndex + i].Block =
|
||||
|
@ -211,7 +211,7 @@ HvpInitializeMemoryHive(
|
|||
}
|
||||
}
|
||||
|
||||
BlockIndex += Bin->BinSize / HV_BLOCK_SIZE;
|
||||
BlockIndex += Bin->Size / HV_BLOCK_SIZE;
|
||||
}
|
||||
|
||||
if (HvpCreateHiveFreeCellList(Hive))
|
||||
|
|
|
@ -43,7 +43,7 @@ typedef struct _EREGISTRY_HIVE
|
|||
PHHIVE Hive;
|
||||
UNICODE_STRING HiveFileName;
|
||||
UNICODE_STRING LogFileName;
|
||||
PSECURITY_CELL RootSecurityCell;
|
||||
PCM_KEY_SECURITY RootSecurityCell;
|
||||
ULONG Flags;
|
||||
HANDLE HiveHandle;
|
||||
HANDLE LogHandle;
|
||||
|
|
|
@ -164,7 +164,7 @@ CmInitializeRegistry(VOID)
|
|||
UNICODE_STRING KeyName;
|
||||
PKEY_OBJECT RootKey;
|
||||
#if 0
|
||||
PSECURITY_CELL RootSecurityCell;
|
||||
PCM_KEY_SECURITY RootSecurityCell;
|
||||
#endif
|
||||
HANDLE RootKeyHandle;
|
||||
HANDLE KeyHandle;
|
||||
|
|
Loading…
Reference in a new issue