Author: ion
Date: Mon Aug 14 15:35:48 2006
New Revision: 23572
URL:
http://svn.reactos.org/svn/reactos?rev=23572&view=rev
Log:
- Start using some NT structures (need to get rid of "Opaque").
Modified:
trunk/reactos/boot/bootdata/txtsetup.sif
trunk/reactos/boot/freeldr/freeldr/reactos/binhive.c
trunk/reactos/lib/cmlib/cmdata.h
trunk/reactos/lib/cmlib/cminit.c
trunk/reactos/lib/cmlib/cmlib.h
trunk/reactos/lib/cmlib/hivebin.c
trunk/reactos/lib/cmlib/hivecell.c
trunk/reactos/lib/cmlib/hivedata.h
trunk/reactos/lib/cmlib/hiveinit.c
trunk/reactos/lib/cmlib/hivesum.c
trunk/reactos/lib/cmlib/hivewrt.c
trunk/reactos/ntoskrnl/cm/cm.h
trunk/reactos/ntoskrnl/cm/regfile.c
Modified: trunk/reactos/boot/bootdata/txtsetup.sif
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/txtsetup.sif…
==============================================================================
--- trunk/reactos/boot/bootdata/txtsetup.sif (original)
+++ trunk/reactos/boot/bootdata/txtsetup.sif Mon Aug 14 15:35:48 2006
@@ -37,8 +37,8 @@
[SetupData]
DefaultPath = \ReactOS
-OsLoadOptions = "/NOGUIBOOT /NODEBUG"
-;OsLoadOptions = "/NOGUIBOOT /DEBUGPORT=COM1 /BAUDRATE=19200 /IRQ=4"
+;OsLoadOptions = "/NOGUIBOOT /NODEBUG"
+OsLoadOptions = "/NOGUIBOOT /DEBUGPORT=COM1 /BAUDRATE=19200 /IRQ=4"
;OsLoadOptions = "/NOGUIBOOT /DEBUGPORT=SCREEN"
;OsLoadOptions = "/NOGUIBOOT /DEBUGPORT=BOCHS"
Modified: trunk/reactos/boot/freeldr/freeldr/reactos/binhive.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/react…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/reactos/binhive.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/reactos/binhive.c Mon Aug 14 15:35:48 2006
@@ -42,7 +42,7 @@
static BOOLEAN
-CmiAllocateHashTableCell (PREGISTRY_HIVE Hive,
+CmiAllocateHashTableCell (PHHIVE Hive,
PHCELL_INDEX HBOffset,
ULONG SubKeyCount)
{
@@ -66,7 +66,7 @@
static BOOLEAN
-CmiAddKeyToParentHashTable (PREGISTRY_HIVE Hive,
+CmiAddKeyToParentHashTable (PHHIVE Hive,
HCELL_INDEX ParentKeyOffset,
PKEY_CELL NewKeyCell,
HCELL_INDEX NKBOffset)
@@ -96,7 +96,7 @@
static BOOLEAN
-CmiAllocateValueListCell (PREGISTRY_HIVE Hive,
+CmiAllocateValueListCell (PHHIVE Hive,
PHCELL_INDEX ValueListOffset,
ULONG ValueCount)
{
@@ -116,7 +116,7 @@
static BOOLEAN
-CmiAllocateValueCell(PREGISTRY_HIVE Hive,
+CmiAllocateValueCell(PHHIVE Hive,
PVALUE_CELL *ValueCell,
HCELL_INDEX *ValueCellOffset,
PWCHAR ValueName)
@@ -175,7 +175,7 @@
static BOOLEAN
-CmiAddValueToKeyValueList(PREGISTRY_HIVE Hive,
+CmiAddValueToKeyValueList(PHHIVE Hive,
HCELL_INDEX KeyCellOffset,
HCELL_INDEX ValueCellOffset)
{
@@ -203,7 +203,7 @@
}
static BOOLEAN
-CmiExportValue (PREGISTRY_HIVE Hive,
+CmiExportValue (PHHIVE Hive,
HCELL_INDEX KeyCellOffset,
FRLDRHKEY Key,
PVALUE Value)
@@ -277,7 +277,7 @@
static BOOLEAN
-CmiExportSubKey (PREGISTRY_HIVE Hive,
+CmiExportSubKey (PHHIVE Hive,
HCELL_INDEX ParentKeyOffset,
FRLDRHKEY ParentKey,
FRLDRHKEY Key)
@@ -427,7 +427,7 @@
static BOOLEAN
-CmiExportHive (PREGISTRY_HIVE Hive,
+CmiExportHive (PHHIVE Hive,
PCWSTR KeyName)
{
PKEY_CELL KeyCell;
@@ -520,7 +520,7 @@
static BOOLEAN
-RegImportValue (PREGISTRY_HIVE Hive,
+RegImportValue (PHHIVE Hive,
PVALUE_CELL ValueCell,
FRLDRHKEY Key)
{
@@ -599,7 +599,7 @@
static BOOLEAN
-RegImportSubKey(PREGISTRY_HIVE Hive,
+RegImportSubKey(PHHIVE Hive,
PKEY_CELL KeyCell,
FRLDRHKEY ParentKey)
{
@@ -707,7 +707,7 @@
FRLDRHKEY SystemKey;
ULONG i;
LONG Error;
- PREGISTRY_HIVE Hive;
+ PHHIVE Hive;
NTSTATUS Status;
DbgPrint((DPRINT_REGISTRY, "RegImportBinaryHive(%x, %u)
called\n",ChunkBase,ChunkSize));
@@ -769,7 +769,7 @@
static VOID
-CmiWriteHive(PREGISTRY_HIVE Hive,
+CmiWriteHive(PHHIVE Hive,
PCHAR ChunkBase,
ULONG* ChunkSize)
{
@@ -781,11 +781,11 @@
Size = HV_BLOCK_SIZE;
Bin = NULL;
- for (i = 0; i < Hive->Storage[HvStable].BlockListSize; i++)
- {
- if (Hive->Storage[HvStable].BlockList[i].Bin != Bin)
- {
- Bin = Hive->Storage[HvStable].BlockList[i].Bin;
+ for (i = 0; i < Hive->Storage[HvStable].Length; i++)
+ {
+ if (Hive->Storage[HvStable].BlockList[i].Bin != (ULONG_PTR)Bin)
+ {
+ Bin = (PHBIN)Hive->Storage[HvStable].BlockList[i].Bin;
memcpy (ChunkBase + (i + 1) * HV_BLOCK_SIZE,
Bin, Bin->BinSize);
Size += Bin->BinSize;
@@ -803,7 +803,7 @@
PCHAR ChunkBase,
ULONG* ChunkSize)
{
- PREGISTRY_HIVE Hive;
+ PHHIVE Hive;
NTSTATUS Status;
DbgPrint((DPRINT_REGISTRY, "Creating binary hardware hive\n"));
Modified: trunk/reactos/lib/cmlib/cmdata.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/cmdata.h?rev=235…
==============================================================================
--- trunk/reactos/lib/cmlib/cmdata.h (original)
+++ trunk/reactos/lib/cmlib/cmdata.h Mon Aug 14 15:35:48 2006
@@ -20,6 +20,17 @@
#include <pshpack1.h>
+typedef struct _CM_VIEW_OF_FILE
+{
+ LIST_ENTRY LRUViewList;
+ LIST_ENTRY PinViewList;
+ ULONG FileOffset;
+ ULONG Size;
+ PULONG ViewAddress;
+ PVOID Bcb;
+ ULONG UseCount;
+} CM_VIEW_OF_FILE, *PCM_VIEW_OF_FILE;
+
typedef struct _KEY_CELL
{
/* Key cell identifier "kn" (0x6b6e) */
@@ -34,25 +45,25 @@
/* ? */
ULONG UnUsed1;
- /* Block offset of parent key cell */
+ /* BlockAddress offset of parent key cell */
HCELL_INDEX ParentKeyOffset;
/* Count of sub keys for the key in this key cell (stable & volatile) */
ULONG NumberOfSubKeys[HvMaxStorageType];
- /* Block offset of has table for FIXME: subkeys/values? (stable & volatile) */
+ /* BlockAddress offset of has table for FIXME: subkeys/values? (stable & volatile)
*/
HCELL_INDEX HashTableOffset[HvMaxStorageType];
/* Count of values contained in this key cell */
ULONG NumberOfValues;
- /* Block offset of VALUE_LIST_CELL */
+ /* BlockAddress offset of VALUE_LIST_CELL */
HCELL_INDEX ValueListOffset;
- /* Block offset of security cell */
+ /* BlockAddress offset of security cell */
HCELL_INDEX SecurityKeyOffset;
- /* Block offset of registry key class */
+ /* BlockAddress offset of registry key class */
HCELL_INDEX ClassNameOffset;
/* ? */
Modified: trunk/reactos/lib/cmlib/cminit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/cminit.c?rev=235…
==============================================================================
--- trunk/reactos/lib/cmlib/cminit.c (original)
+++ trunk/reactos/lib/cmlib/cminit.c Mon Aug 14 15:35:48 2006
@@ -9,7 +9,7 @@
BOOLEAN CMAPI
CmCreateRootNode(
- PREGISTRY_HIVE Hive,
+ PHHIVE Hive,
PCWSTR Name)
{
PKEY_CELL KeyCell;
@@ -46,7 +46,7 @@
static VOID CMAPI
CmpPrepareKey(
- PREGISTRY_HIVE RegistryHive,
+ PHHIVE RegistryHive,
PKEY_CELL KeyCell)
{
PKEY_CELL SubKeyCell;
@@ -73,7 +73,7 @@
VOID CMAPI
CmPrepareHive(
- PREGISTRY_HIVE RegistryHive)
+ PHHIVE RegistryHive)
{
PKEY_CELL RootCell;
Modified: trunk/reactos/lib/cmlib/cmlib.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/cmlib.h?rev=2357…
==============================================================================
--- trunk/reactos/lib/cmlib/cmlib.h (original)
+++ trunk/reactos/lib/cmlib/cmlib.h Mon Aug 14 15:35:48 2006
@@ -19,65 +19,104 @@
#define CMAPI
-typedef struct _BLOCK_LIST_ENTRY
-{
- PHBIN Bin;
- PVOID Block;
-} BLOCK_LIST_ENTRY, *PBLOCK_LIST_ENTRY;
-
-struct _REGISTRY_HIVE;
-
-typedef PVOID (CMAPI *PHV_ALLOCATE)(
+struct _HHIVE;
+
+typedef PVOID (CMAPI *PGET_CELL_ROUTINE)(
+ struct _HHIVE *Hive,
+ HCELL_INDEX Cell);
+
+typedef VOID (CMAPI *PRELEASE_CELL_ROUTINE)(
+ struct _HHIVE *Hive,
+ HCELL_INDEX Cell);
+
+typedef PVOID (CMAPI *PALLOCATE_ROUTINE)(
ULONG Size,
BOOLEAN Paged);
-typedef VOID (CMAPI *PHV_FREE)(
+typedef VOID (CMAPI *PFREE_ROUTINE)(
PVOID Ptr);
-typedef BOOLEAN (CMAPI *PHV_FILE_READ)(
- struct _REGISTRY_HIVE *RegistryHive,
+typedef BOOLEAN (CMAPI *PFILE_READ_ROUTINE)(
+ struct _HHIVE *RegistryHive,
ULONG FileType,
ULONG FileOffset,
PVOID Buffer,
ULONG BufferLength);
-typedef BOOLEAN (CMAPI *PHV_FILE_WRITE)(
- struct _REGISTRY_HIVE *RegistryHive,
+typedef BOOLEAN (CMAPI *PFILE_WRITE_ROUTINE)(
+ struct _HHIVE *RegistryHive,
ULONG FileType,
ULONG FileOffset,
PVOID Buffer,
ULONG BufferLength);
-typedef BOOLEAN (CMAPI *PHV_FILE_SET_SIZE)(
- struct _REGISTRY_HIVE *RegistryHive,
+typedef BOOLEAN (CMAPI *PFILE_SET_SIZE_ROUTINE)(
+ struct _HHIVE *RegistryHive,
ULONG FileType,
ULONG FileSize);
-typedef BOOLEAN (CMAPI *PHV_FILE_FLUSH)(
- struct _REGISTRY_HIVE *RegistryHive,
+typedef BOOLEAN (CMAPI *PFILE_FLUSH_ROUTINE)(
+ struct _HHIVE *RegistryHive,
ULONG FileType);
-typedef struct _REGISTRY_HIVE
-{
- PHIVE_HEADER HiveHeader;
- BOOLEAN ReadOnly;
- BOOLEAN Flat;
- RTL_BITMAP DirtyBitmap;
- struct
- {
- ULONG BlockListSize;
- PBLOCK_LIST_ENTRY BlockList;
- HCELL_INDEX FreeListOffset[24];
- } Storage[HvMaxStorageType];
-
- PHV_ALLOCATE Allocate;
- PHV_FREE Free;
- PHV_FILE_READ FileRead;
- PHV_FILE_WRITE FileWrite;
- PHV_FILE_SET_SIZE FileSetSize;
- PHV_FILE_FLUSH FileFlush;
- PVOID Opaque;
-} REGISTRY_HIVE, *PREGISTRY_HIVE;
+typedef struct _HMAP_ENTRY
+{
+ ULONG_PTR Bin;
+ ULONG_PTR Block;
+ PCM_VIEW_OF_FILE CmHive;
+ ULONG MemAlloc;
+} HMAP_ENTRY, *PHMAP_ENTRY;
+
+typedef struct _HMAP_TABLE
+{
+ HMAP_ENTRY Table[512];
+} HMAP_TABLE, *PHMAP_TABLE;
+
+typedef struct _HMAP_DIRECTORY
+{
+ PHMAP_TABLE Directory[2048];
+} HMAP_DIRECTORY, *PHMAP_DIRECTORY;
+
+typedef struct _DUAL
+{
+ ULONG Length;
+ PHMAP_DIRECTORY Map;
+ PHMAP_ENTRY BlockList; // PHMAP_TABLE SmallDir;
+ ULONG Guard;
+ HCELL_INDEX FreeDisplay[24]; //FREE_DISPLAY FreeDisplay[24];
+ ULONG FreeSummary;
+ LIST_ENTRY FreeBins;
+} DUAL, *PDUAL;
+
+typedef struct _HHIVE
+{
+ ULONG Signature;
+ PGET_CELL_ROUTINE GetCellRoutine;
+ PRELEASE_CELL_ROUTINE ReleaseCellRoutine;
+ PALLOCATE_ROUTINE Allocate;
+ PFREE_ROUTINE Free;
+ PFILE_READ_ROUTINE FileRead;
+ PFILE_WRITE_ROUTINE FileWrite;
+ PFILE_SET_SIZE_ROUTINE FileSetSize;
+ PFILE_FLUSH_ROUTINE FileFlush;
+ PHBASE_BLOCK HiveHeader;
+ RTL_BITMAP DirtyVector;
+ ULONG DirtyCount;
+ ULONG DirtyAlloc;
+ ULONG BaseBlockAlloc;
+ ULONG Cluster;
+ BOOLEAN Flat;
+ BOOLEAN ReadOnly;
+ BOOLEAN Log;
+ BOOLEAN DirtyFlag;
+ ULONG HiveFlags;
+ ULONG LogSize;
+ ULONG RefreshCount;
+ ULONG StorageTypeCount;
+ ULONG Version;
+ DUAL Storage[HvMaxStorageType];
+ PVOID Opaque; // FIXME: KILL!
+} HHIVE, *PHHIVE;
/*
* Public functions.
@@ -89,70 +128,70 @@
NTSTATUS CMAPI
HvInitialize(
- PREGISTRY_HIVE *RegistryHive,
+ PHHIVE *RegistryHive,
ULONG Operation,
ULONG_PTR ChunkBase,
SIZE_T ChunkSize,
- PHV_ALLOCATE Allocate,
- PHV_FREE Free,
- PHV_FILE_READ FileRead,
- PHV_FILE_WRITE FileWrite,
- PHV_FILE_SET_SIZE FileSetSize,
- PHV_FILE_FLUSH FileFlush,
+ PALLOCATE_ROUTINE Allocate,
+ PFREE_ROUTINE Free,
+ PFILE_READ_ROUTINE FileRead,
+ PFILE_WRITE_ROUTINE FileWrite,
+ PFILE_SET_SIZE_ROUTINE FileSetSize,
+ PFILE_FLUSH_ROUTINE FileFlush,
PVOID Opaque);
VOID CMAPI
HvFree(
- PREGISTRY_HIVE RegistryHive);
+ PHHIVE RegistryHive);
PVOID CMAPI
HvGetCell(
- PREGISTRY_HIVE RegistryHive,
+ PHHIVE RegistryHive,
HCELL_INDEX CellOffset);
LONG CMAPI
HvGetCellSize(
- PREGISTRY_HIVE RegistryHive,
+ PHHIVE RegistryHive,
PVOID Cell);
HCELL_INDEX CMAPI
HvAllocateCell(
- PREGISTRY_HIVE RegistryHive,
+ PHHIVE RegistryHive,
ULONG Size,
HV_STORAGE_TYPE Storage);
HCELL_INDEX CMAPI
HvReallocateCell(
- PREGISTRY_HIVE RegistryHive,
+ PHHIVE RegistryHive,
HCELL_INDEX CellOffset,
ULONG Size);
VOID CMAPI
HvFreeCell(
- PREGISTRY_HIVE RegistryHive,
+ PHHIVE RegistryHive,
HCELL_INDEX CellOffset);
VOID CMAPI
HvMarkCellDirty(
- PREGISTRY_HIVE RegistryHive,
+ PHHIVE RegistryHive,
HCELL_INDEX CellOffset);
BOOLEAN CMAPI
HvSyncHive(
- PREGISTRY_HIVE RegistryHive);
+ PHHIVE RegistryHive);
BOOLEAN CMAPI
HvWriteHive(
- PREGISTRY_HIVE RegistryHive);
+ PHHIVE RegistryHive);
BOOLEAN CMAPI
CmCreateRootNode(
- PREGISTRY_HIVE Hive,
+ PHHIVE Hive,
PCWSTR Name);
VOID CMAPI
CmPrepareHive(
- PREGISTRY_HIVE RegistryHive);
+ PHHIVE RegistryHive);
/*
* Private functions.
@@ -160,16 +199,16 @@
PHBIN CMAPI
HvpAddBin(
- PREGISTRY_HIVE RegistryHive,
+ PHHIVE RegistryHive,
ULONG Size,
HV_STORAGE_TYPE Storage);
NTSTATUS CMAPI
HvpCreateHiveFreeCellList(
- PREGISTRY_HIVE Hive);
+ PHHIVE Hive);
ULONG CMAPI
HvpHiveHeaderChecksum(
- PHIVE_HEADER HiveHeader);
+ PHBASE_BLOCK HiveHeader);
#endif /* CMLIB_H */
Modified: trunk/reactos/lib/cmlib/hivebin.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/hivebin.c?rev=23…
==============================================================================
--- trunk/reactos/lib/cmlib/hivebin.c (original)
+++ trunk/reactos/lib/cmlib/hivebin.c Mon Aug 14 15:35:48 2006
@@ -10,11 +10,11 @@
PHBIN CMAPI
HvpAddBin(
- PREGISTRY_HIVE RegistryHive,
+ PHHIVE RegistryHive,
ULONG Size,
HV_STORAGE_TYPE Storage)
{
- PBLOCK_LIST_ENTRY BlockList;
+ PHMAP_ENTRY BlockList;
PHBIN Bin;
ULONG BinSize;
ULONG i;
@@ -32,13 +32,13 @@
RtlZeroMemory(Bin, sizeof(HBIN));
Bin->Signature = HV_BIN_SIGNATURE;
- Bin->BinOffset = RegistryHive->Storage[Storage].BlockListSize *
+ Bin->BinOffset = RegistryHive->Storage[Storage].Length *
HV_BLOCK_SIZE;
Bin->BinSize = BinSize;
/* Allocate new block list */
- OldBlockListSize = RegistryHive->Storage[Storage].BlockListSize;
- BlockList = RegistryHive->Allocate(sizeof(BLOCK_LIST_ENTRY) *
+ OldBlockListSize = RegistryHive->Storage[Storage].Length;
+ BlockList = RegistryHive->Allocate(sizeof(HMAP_ENTRY) *
(OldBlockListSize + BlockCount), TRUE);
if (BlockList == NULL)
{
@@ -49,18 +49,18 @@
if (OldBlockListSize > 0)
{
RtlCopyMemory(BlockList, RegistryHive->Storage[Storage].BlockList,
- OldBlockListSize * sizeof(BLOCK_LIST_ENTRY));
+ OldBlockListSize * sizeof(HMAP_ENTRY));
RegistryHive->Free(RegistryHive->Storage[Storage].BlockList);
}
RegistryHive->Storage[Storage].BlockList = BlockList;
- RegistryHive->Storage[Storage].BlockListSize += BlockCount;
+ RegistryHive->Storage[Storage].Length += BlockCount;
for (i = 0; i < BlockCount; i++)
{
RegistryHive->Storage[Storage].BlockList[OldBlockListSize + i].Block =
- (PVOID)((ULONG_PTR)Bin + (i * HV_BLOCK_SIZE));
- RegistryHive->Storage[Storage].BlockList[OldBlockListSize + i].Bin = Bin;
+ ((ULONG_PTR)Bin + (i * HV_BLOCK_SIZE));
+ RegistryHive->Storage[Storage].BlockList[OldBlockListSize + i].Bin =
(ULONG_PTR)Bin;
}
/* Initialize a free block in this heap. */
@@ -70,26 +70,26 @@
if (Storage == HvStable)
{
/* Calculate bitmap size in bytes (always a multiple of 32 bits). */
- BitmapSize = ROUND_UP(RegistryHive->Storage[HvStable].BlockListSize,
+ BitmapSize = ROUND_UP(RegistryHive->Storage[HvStable].Length,
sizeof(ULONG) * 8) / 8;
/* Grow bitmap if necessary. */
- if (BitmapSize > RegistryHive->DirtyBitmap.SizeOfBitMap / 8)
+ if (BitmapSize > RegistryHive->DirtyVector.SizeOfBitMap / 8)
{
PULONG BitmapBuffer;
BitmapBuffer = RegistryHive->Allocate(BitmapSize, TRUE);
RtlZeroMemory(BitmapBuffer, BitmapSize);
RtlCopyMemory(BitmapBuffer,
- RegistryHive->DirtyBitmap.Buffer,
- RegistryHive->DirtyBitmap.SizeOfBitMap / 8);
- RegistryHive->Free(RegistryHive->DirtyBitmap.Buffer);
- RtlInitializeBitMap(&RegistryHive->DirtyBitmap, BitmapBuffer,
+ RegistryHive->DirtyVector.Buffer,
+ RegistryHive->DirtyVector.SizeOfBitMap / 8);
+ RegistryHive->Free(RegistryHive->DirtyVector.Buffer);
+ RtlInitializeBitMap(&RegistryHive->DirtyVector, BitmapBuffer,
BitmapSize * 8);
}
/* Mark new bin dirty. */
- RtlSetBits(&RegistryHive->DirtyBitmap,
+ RtlSetBits(&RegistryHive->DirtyVector,
Bin->BinOffset / HV_BLOCK_SIZE,
BlockCount);
}
Modified: trunk/reactos/lib/cmlib/hivecell.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/hivecell.c?rev=2…
==============================================================================
--- trunk/reactos/lib/cmlib/hivecell.c (original)
+++ trunk/reactos/lib/cmlib/hivecell.c Mon Aug 14 15:35:48 2006
@@ -11,7 +11,7 @@
static PCELL_HEADER __inline CMAPI
HvpGetCellHeader(
- PREGISTRY_HIVE RegistryHive,
+ PHHIVE RegistryHive,
HCELL_INDEX CellIndex)
{
PVOID Block;
@@ -26,8 +26,8 @@
CellType = (CellIndex & HCELL_TYPE_MASK) >> HCELL_TYPE_SHIFT;
CellBlock = (CellIndex & HCELL_BLOCK_MASK) >> HCELL_BLOCK_SHIFT;
CellOffset = (CellIndex & HCELL_OFFSET_MASK) >> HCELL_OFFSET_SHIFT;
- ASSERT(CellBlock < RegistryHive->Storage[CellType].BlockListSize);
- Block = RegistryHive->Storage[CellType].BlockList[CellBlock].Block;
+ ASSERT(CellBlock < RegistryHive->Storage[CellType].Length);
+ Block = (PVOID)RegistryHive->Storage[CellType].BlockList[CellBlock].Block;
ASSERT(Block != NULL);
return (PVOID)((ULONG_PTR)Block + CellOffset);
}
@@ -41,7 +41,7 @@
PVOID CMAPI
HvGetCell(
- PREGISTRY_HIVE RegistryHive,
+ PHHIVE RegistryHive,
HCELL_INDEX CellIndex)
{
return (PVOID)(HvpGetCellHeader(RegistryHive, CellIndex) + 1);
@@ -49,7 +49,7 @@
static LONG __inline CMAPI
HvpGetCellFullSize(
- PREGISTRY_HIVE RegistryHive,
+ PHHIVE RegistryHive,
PVOID Cell)
{
return ((PCELL_HEADER)Cell - 1)->CellSize;
@@ -57,7 +57,7 @@
LONG CMAPI
HvGetCellSize(
- PREGISTRY_HIVE RegistryHive,
+ PHHIVE RegistryHive,
PVOID Cell)
{
PCELL_HEADER CellHeader;
@@ -71,7 +71,7 @@
VOID CMAPI
HvMarkCellDirty(
- PREGISTRY_HIVE RegistryHive,
+ PHHIVE RegistryHive,
HCELL_INDEX CellIndex)
{
LONG CellSize;
@@ -90,7 +90,7 @@
if (CellSize < 0)
CellSize = -CellSize;
- RtlSetBits(&RegistryHive->DirtyBitmap,
+ RtlSetBits(&RegistryHive->DirtyVector,
CellBlock, CellLastBlock - CellBlock);
}
@@ -131,7 +131,7 @@
static NTSTATUS CMAPI
HvpAddFree(
- PREGISTRY_HIVE RegistryHive,
+ PHHIVE RegistryHive,
PCELL_HEADER FreeBlock,
HCELL_INDEX FreeIndex)
{
@@ -146,8 +146,8 @@
Index = HvpComputeFreeListIndex(FreeBlock->CellSize);
FreeBlockData = (PHCELL_INDEX)(FreeBlock + 1);
- *FreeBlockData = RegistryHive->Storage[Storage].FreeListOffset[Index];
- RegistryHive->Storage[Storage].FreeListOffset[Index] = FreeIndex;
+ *FreeBlockData = RegistryHive->Storage[Storage].FreeDisplay[Index];
+ RegistryHive->Storage[Storage].FreeDisplay[Index] = FreeIndex;
/* FIXME: Eventually get rid of free bins. */
@@ -156,7 +156,7 @@
static VOID CMAPI
HvpRemoveFree(
- PREGISTRY_HIVE RegistryHive,
+ PHHIVE RegistryHive,
PCELL_HEADER CellBlock,
HCELL_INDEX CellIndex)
{
@@ -170,7 +170,7 @@
Storage = (CellIndex & HCELL_TYPE_MASK) >> HCELL_TYPE_SHIFT;
Index = HvpComputeFreeListIndex(CellBlock->CellSize);
- pFreeCellOffset = &RegistryHive->Storage[Storage].FreeListOffset[Index];
+ pFreeCellOffset = &RegistryHive->Storage[Storage].FreeDisplay[Index];
while (*pFreeCellOffset != HCELL_NULL)
{
FreeCellData = (PHCELL_INDEX)HvGetCell(RegistryHive, *pFreeCellOffset);
@@ -187,7 +187,7 @@
static HCELL_INDEX CMAPI
HvpFindFree(
- PREGISTRY_HIVE RegistryHive,
+ PHHIVE RegistryHive,
ULONG Size,
HV_STORAGE_TYPE Storage)
{
@@ -198,7 +198,7 @@
for (Index = HvpComputeFreeListIndex(Size); Index < 24; Index++)
{
- pFreeCellOffset = &RegistryHive->Storage[Storage].FreeListOffset[Index];
+ pFreeCellOffset = &RegistryHive->Storage[Storage].FreeDisplay[Index];
while (*pFreeCellOffset != HCELL_NULL)
{
FreeCellData = (PHCELL_INDEX)HvGetCell(RegistryHive, *pFreeCellOffset);
@@ -217,7 +217,7 @@
NTSTATUS CMAPI
HvpCreateHiveFreeCellList(
- PREGISTRY_HIVE Hive)
+ PHHIVE Hive)
{
HCELL_INDEX BlockOffset;
PCELL_HEADER FreeBlock;
@@ -230,15 +230,15 @@
/* Initialize the free cell list */
for (Index = 0; Index < 24; Index++)
{
- Hive->Storage[HvStable].FreeListOffset[Index] = HCELL_NULL;
- Hive->Storage[HvVolatile].FreeListOffset[Index] = HCELL_NULL;
+ Hive->Storage[HvStable].FreeDisplay[Index] = HCELL_NULL;
+ Hive->Storage[HvVolatile].FreeDisplay[Index] = HCELL_NULL;
}
BlockOffset = 0;
BlockIndex = 0;
- while (BlockIndex < Hive->Storage[HvStable].BlockListSize)
- {
- Bin = Hive->Storage[HvStable].BlockList[BlockIndex].Bin;
+ while (BlockIndex < Hive->Storage[HvStable].Length)
+ {
+ Bin = (PHBIN)Hive->Storage[HvStable].BlockList[BlockIndex].Bin;
/* Search free blocks and add to list */
FreeOffset = sizeof(HBIN);
@@ -268,7 +268,7 @@
HCELL_INDEX CMAPI
HvAllocateCell(
- PREGISTRY_HIVE RegistryHive,
+ PHHIVE RegistryHive,
ULONG Size,
HV_STORAGE_TYPE Storage)
{
@@ -319,7 +319,7 @@
HCELL_INDEX CMAPI
HvReallocateCell(
- PREGISTRY_HIVE RegistryHive,
+ PHHIVE RegistryHive,
HCELL_INDEX CellIndex,
ULONG Size)
{
@@ -363,7 +363,7 @@
VOID CMAPI
HvFreeCell(
- PREGISTRY_HIVE RegistryHive,
+ PHHIVE RegistryHive,
HCELL_INDEX CellIndex)
{
PCELL_HEADER Free;
@@ -384,7 +384,7 @@
CellBlock = (CellIndex & HCELL_BLOCK_MASK) >> HCELL_BLOCK_SHIFT;
/* FIXME: Merge free blocks */
- Bin = RegistryHive->Storage[CellType].BlockList[CellBlock].Bin;
+ Bin = (PHBIN)RegistryHive->Storage[CellType].BlockList[CellBlock].Bin;
if ((CellIndex & ~HCELL_TYPE_MASK) + Free->CellSize <
Bin->BinOffset + Bin->BinSize)
Modified: trunk/reactos/lib/cmlib/hivedata.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/hivedata.h?rev=2…
==============================================================================
--- trunk/reactos/lib/cmlib/hivedata.h (original)
+++ trunk/reactos/lib/cmlib/hivedata.h Mon Aug 14 15:35:48 2006
@@ -9,7 +9,7 @@
#define CMLIB_HIVEDATA_H
#define HV_BLOCK_SIZE 4096
-#define HV_LOG_HEADER_SIZE FIELD_OFFSET(HIVE_HEADER, Reserved2)
+#define HV_LOG_HEADER_SIZE FIELD_OFFSET(HBASE_BLOCK, Reserved2)
#define HV_SIGNATURE 0x66676572
#define HV_BIN_SIGNATURE 0x6e696268
@@ -44,12 +44,12 @@
#include <pshpack1.h>
/**
- * @name HIVE_HEADER
+ * @name HBASE_BLOCK
*
* On-disk header for registry hive file.
*/
-typedef struct _HIVE_HEADER
+typedef struct _HBASE_BLOCK
{
/* Hive identifier "regf" (0x66676572) */
ULONG Signature;
@@ -87,15 +87,17 @@
ULONG Cluster;
/* Name of hive file */
- WCHAR FileName[32];
+ CHAR FileName[64];
ULONG Reserved1[99];
/* Checksum of first 0x200 bytes */
ULONG Checksum;
- ULONG Reserved2[0x380];
-} HIVE_HEADER, *PHIVE_HEADER;
+ ULONG Reserved2[0x37E];
+ ULONG BootType;
+ ULONG BootRecover;
+} HBASE_BLOCK, *PHBASE_BLOCK;
typedef struct _BIN_HEADER
{
Modified: trunk/reactos/lib/cmlib/hiveinit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/hiveinit.c?rev=2…
==============================================================================
--- trunk/reactos/lib/cmlib/hiveinit.c (original)
+++ trunk/reactos/lib/cmlib/hiveinit.c Mon Aug 14 15:35:48 2006
@@ -17,7 +17,7 @@
BOOLEAN CMAPI
HvpVerifyHiveHeader(
- PHIVE_HEADER HiveHeader)
+ PHBASE_BLOCK HiveHeader)
{
if (HiveHeader->Signature != HV_SIGNATURE ||
HiveHeader->Major != HV_MAJOR_VER ||
@@ -53,7 +53,7 @@
VOID CMAPI
HvpFreeHiveBins(
- PREGISTRY_HIVE Hive)
+ PHHIVE Hive)
{
ULONG i;
PHBIN Bin;
@@ -62,20 +62,20 @@
for (Storage = HvStable; Storage < HvMaxStorageType; Storage++)
{
Bin = NULL;
- for (i = 0; i < Hive->Storage[Storage].BlockListSize; i++)
- {
- if (Hive->Storage[Storage].BlockList[i].Bin == NULL)
+ for (i = 0; i < Hive->Storage[Storage].Length; i++)
+ {
+ if (Hive->Storage[Storage].BlockList[i].Bin == (ULONG_PTR)NULL)
continue;
- if (Hive->Storage[Storage].BlockList[i].Bin != Bin)
+ if (Hive->Storage[Storage].BlockList[i].Bin != (ULONG_PTR)Bin)
{
- Bin = Hive->Storage[Storage].BlockList[i].Bin;
- Hive->Free(Hive->Storage[Storage].BlockList[i].Bin);
+ Bin = (PHBIN)Hive->Storage[Storage].BlockList[i].Bin;
+ Hive->Free((PHBIN)Hive->Storage[Storage].BlockList[i].Bin);
}
- Hive->Storage[Storage].BlockList[i].Bin = NULL;
- Hive->Storage[Storage].BlockList[i].Block = NULL;
- }
-
- if (Hive->Storage[Storage].BlockListSize)
+ Hive->Storage[Storage].BlockList[i].Bin = (ULONG_PTR)NULL;
+ Hive->Storage[Storage].BlockList[i].Block = (ULONG_PTR)NULL;
+ }
+
+ if (Hive->Storage[Storage].Length)
Hive->Free(Hive->Storage[Storage].BlockList);
}
}
@@ -91,15 +91,15 @@
NTSTATUS CMAPI
HvpCreateHive(
- PREGISTRY_HIVE RegistryHive)
-{
- PHIVE_HEADER HiveHeader;
+ PHHIVE RegistryHive)
+{
+ PHBASE_BLOCK HiveHeader;
ULONG Index;
- HiveHeader = RegistryHive->Allocate(sizeof(HIVE_HEADER), FALSE);
+ HiveHeader = RegistryHive->Allocate(sizeof(HBASE_BLOCK), FALSE);
if (HiveHeader == NULL)
return STATUS_NO_MEMORY;
- RtlZeroMemory(HiveHeader, sizeof(HIVE_HEADER));
+ RtlZeroMemory(HiveHeader, sizeof(HBASE_BLOCK));
HiveHeader->Signature = HV_SIGNATURE;
HiveHeader->Major = HV_MAJOR_VER;
HiveHeader->Minor = HV_MINOR_VER;
@@ -116,10 +116,10 @@
RegistryHive->HiveHeader = HiveHeader;
for (Index = 0; Index < 24; Index++)
{
- RegistryHive->Storage[HvStable].FreeListOffset[Index] = HCELL_NULL;
- RegistryHive->Storage[HvVolatile].FreeListOffset[Index] = HCELL_NULL;
- }
- RtlInitializeBitMap(&RegistryHive->DirtyBitmap, NULL, 0);
+ RegistryHive->Storage[HvStable].FreeDisplay[Index] = HCELL_NULL;
+ RegistryHive->Storage[HvVolatile].FreeDisplay[Index] = HCELL_NULL;
+ }
+ RtlInitializeBitMap(&RegistryHive->DirtyVector, NULL, 0);
return STATUS_SUCCESS;
}
@@ -136,7 +136,7 @@
NTSTATUS CMAPI
HvpInitializeMemoryHive(
- PREGISTRY_HIVE Hive,
+ PHHIVE Hive,
ULONG_PTR ChunkBase,
SIZE_T ChunkSize)
{
@@ -146,30 +146,30 @@
ULONG BitmapSize;
PULONG BitmapBuffer;
- if (ChunkSize < sizeof(HIVE_HEADER) ||
- !HvpVerifyHiveHeader((PHIVE_HEADER)ChunkBase))
- {
- DPRINT1("Registry is corrupt: ChunkSize %d < sizeof(HIVE_HEADER) %d,
"
- "or HvpVerifyHiveHeader() failed\n", ChunkSize,
sizeof(HIVE_HEADER));
+ if (ChunkSize < sizeof(HBASE_BLOCK) ||
+ !HvpVerifyHiveHeader((PHBASE_BLOCK)ChunkBase))
+ {
+ DPRINT1("Registry is corrupt: ChunkSize %d < sizeof(HBASE_BLOCK) %d,
"
+ "or HvpVerifyHiveHeader() failed\n", ChunkSize,
sizeof(HBASE_BLOCK));
return STATUS_REGISTRY_CORRUPT;
}
- Hive->HiveHeader = Hive->Allocate(sizeof(HIVE_HEADER), FALSE);
+ Hive->HiveHeader = Hive->Allocate(sizeof(HBASE_BLOCK), FALSE);
if (Hive->HiveHeader == NULL)
{
return STATUS_NO_MEMORY;
}
- RtlCopyMemory(Hive->HiveHeader, (PVOID)ChunkBase, sizeof(HIVE_HEADER));
+ RtlCopyMemory(Hive->HiveHeader, (PVOID)ChunkBase, sizeof(HBASE_BLOCK));
/*
* Build a block list from the in-memory chunk and copy the data as
* we go.
*/
- Hive->Storage[HvStable].BlockListSize = (ChunkSize / HV_BLOCK_SIZE) - 1;
+ Hive->Storage[HvStable].Length = (ChunkSize / HV_BLOCK_SIZE) - 1;
Hive->Storage[HvStable].BlockList =
- Hive->Allocate(Hive->Storage[HvStable].BlockListSize *
- sizeof(BLOCK_LIST_ENTRY), FALSE);
+ Hive->Allocate(Hive->Storage[HvStable].Length *
+ sizeof(HMAP_ENTRY), FALSE);
if (Hive->Storage[HvStable].BlockList == NULL)
{
DPRINT1("Allocating block list failed\n");
@@ -177,7 +177,7 @@
return STATUS_NO_MEMORY;
}
- for (BlockIndex = 0; BlockIndex < Hive->Storage[HvStable].BlockListSize; )
+ for (BlockIndex = 0; BlockIndex < Hive->Storage[HvStable].Length; )
{
Bin = (PHBIN)((ULONG_PTR)ChunkBase + (BlockIndex + 1) * HV_BLOCK_SIZE);
if (Bin->Signature != HV_BIN_SIGNATURE ||
@@ -196,8 +196,8 @@
return STATUS_NO_MEMORY;
}
- Hive->Storage[HvStable].BlockList[BlockIndex].Bin = NewBin;
- Hive->Storage[HvStable].BlockList[BlockIndex].Block = NewBin;
+ Hive->Storage[HvStable].BlockList[BlockIndex].Bin = (ULONG_PTR)NewBin;
+ Hive->Storage[HvStable].BlockList[BlockIndex].Block = (ULONG_PTR)NewBin;
RtlCopyMemory(NewBin, Bin, Bin->BinSize);
@@ -205,9 +205,9 @@
{
for (i = 1; i < Bin->BinSize / HV_BLOCK_SIZE; i++)
{
- Hive->Storage[HvStable].BlockList[BlockIndex + i].Bin = NewBin;
+ Hive->Storage[HvStable].BlockList[BlockIndex + i].Bin =
(ULONG_PTR)NewBin;
Hive->Storage[HvStable].BlockList[BlockIndex + i].Block =
- (PVOID)((ULONG_PTR)NewBin + (i * HV_BLOCK_SIZE));
+ ((ULONG_PTR)NewBin + (i * HV_BLOCK_SIZE));
}
}
@@ -221,7 +221,7 @@
return STATUS_NO_MEMORY;
}
- BitmapSize = ROUND_UP(Hive->Storage[HvStable].BlockListSize,
+ BitmapSize = ROUND_UP(Hive->Storage[HvStable].Length,
sizeof(ULONG) * 8) / 8;
BitmapBuffer = (PULONG)Hive->Allocate(BitmapSize, TRUE);
if (BitmapBuffer == NULL)
@@ -231,8 +231,8 @@
return STATUS_NO_MEMORY;
}
- RtlInitializeBitMap(&Hive->DirtyBitmap, BitmapBuffer, BitmapSize * 8);
- RtlClearAllBits(&Hive->DirtyBitmap);
+ RtlInitializeBitMap(&Hive->DirtyVector, BitmapBuffer, BitmapSize * 8);
+ RtlClearAllBits(&Hive->DirtyVector);
return STATUS_SUCCESS;
}
@@ -249,17 +249,17 @@
NTSTATUS CMAPI
HvpInitializeMemoryInplaceHive(
- PREGISTRY_HIVE Hive,
+ PHHIVE Hive,
ULONG_PTR ChunkBase,
SIZE_T ChunkSize)
{
- if (ChunkSize < sizeof(HIVE_HEADER) ||
- !HvpVerifyHiveHeader((PHIVE_HEADER)ChunkBase))
+ if (ChunkSize < sizeof(HBASE_BLOCK) ||
+ !HvpVerifyHiveHeader((PHBASE_BLOCK)ChunkBase))
{
return STATUS_REGISTRY_CORRUPT;
}
- Hive->HiveHeader = (PHIVE_HEADER)ChunkBase;
+ Hive->HiveHeader = (PHBASE_BLOCK)ChunkBase;
Hive->ReadOnly = TRUE;
Hive->Flat = TRUE;
@@ -299,29 +299,29 @@
NTSTATUS CMAPI
HvInitialize(
- PREGISTRY_HIVE *RegistryHive,
+ PHHIVE *RegistryHive,
ULONG Operation,
ULONG_PTR ChunkBase,
SIZE_T ChunkSize,
- PHV_ALLOCATE Allocate,
- PHV_FREE Free,
- PHV_FILE_READ FileRead,
- PHV_FILE_WRITE FileWrite,
- PHV_FILE_SET_SIZE FileSetSize,
- PHV_FILE_FLUSH FileFlush,
+ PALLOCATE_ROUTINE Allocate,
+ PFREE_ROUTINE Free,
+ PFILE_READ_ROUTINE FileRead,
+ PFILE_WRITE_ROUTINE FileWrite,
+ PFILE_SET_SIZE_ROUTINE FileSetSize,
+ PFILE_FLUSH_ROUTINE FileFlush,
PVOID Opaque)
{
NTSTATUS Status;
- PREGISTRY_HIVE Hive;
+ PHHIVE Hive;
/*
* Create a new hive structure that will hold all the maintenance data.
*/
- Hive = Allocate(sizeof(REGISTRY_HIVE), TRUE);
+ Hive = Allocate(sizeof(HHIVE), TRUE);
if (Hive == NULL)
return STATUS_NO_MEMORY;
- RtlZeroMemory(Hive, sizeof(REGISTRY_HIVE));
+ RtlZeroMemory(Hive, sizeof(HHIVE));
Hive->Allocate = Allocate;
Hive->Free = Free;
@@ -370,14 +370,14 @@
VOID CMAPI
HvFree(
- PREGISTRY_HIVE RegistryHive)
+ PHHIVE RegistryHive)
{
if (!RegistryHive->ReadOnly)
{
/* Release hive bitmap */
- if (RegistryHive->DirtyBitmap.Buffer)
- {
- RegistryHive->Free(RegistryHive->DirtyBitmap.Buffer);
+ if (RegistryHive->DirtyVector.Buffer)
+ {
+ RegistryHive->Free(RegistryHive->DirtyVector.Buffer);
}
HvpFreeHiveBins(RegistryHive);
Modified: trunk/reactos/lib/cmlib/hivesum.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/hivesum.c?rev=23…
==============================================================================
--- trunk/reactos/lib/cmlib/hivesum.c (original)
+++ trunk/reactos/lib/cmlib/hivesum.c Mon Aug 14 15:35:48 2006
@@ -15,7 +15,7 @@
ULONG CMAPI
HvpHiveHeaderChecksum(
- PHIVE_HEADER HiveHeader)
+ PHBASE_BLOCK HiveHeader)
{
PULONG Buffer = (PULONG)HiveHeader;
ULONG Sum = 0;
Modified: trunk/reactos/lib/cmlib/hivewrt.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/hivewrt.c?rev=23…
==============================================================================
--- trunk/reactos/lib/cmlib/hivewrt.c (original)
+++ trunk/reactos/lib/cmlib/hivewrt.c Mon Aug 14 15:35:48 2006
@@ -11,7 +11,7 @@
static BOOLEAN CMAPI
HvpWriteLog(
- PREGISTRY_HIVE RegistryHive)
+ PHHIVE RegistryHive)
{
ULONG FileOffset;
ULONG BufferSize;
@@ -33,7 +33,7 @@
return FALSE;
}
- BitmapSize = RegistryHive->DirtyBitmap.SizeOfBitMap;
+ BitmapSize = RegistryHive->DirtyVector.SizeOfBitMap;
BufferSize = HV_LOG_HEADER_SIZE + sizeof(ULONG) + BitmapSize;
BufferSize = ROUND_UP(BufferSize, HV_BLOCK_SIZE);
@@ -56,7 +56,7 @@
Ptr = Buffer + HV_LOG_HEADER_SIZE;
RtlCopyMemory(Ptr, "DIRT", 4);
Ptr += 4;
- RtlCopyMemory(Ptr, RegistryHive->DirtyBitmap.Buffer, BitmapSize);
+ RtlCopyMemory(Ptr, RegistryHive->DirtyVector.Buffer, BitmapSize);
/* Write hive block and block bitmap */
Success = RegistryHive->FileWrite(RegistryHive, HV_TYPE_LOG,
@@ -71,16 +71,16 @@
/* Write dirty blocks */
FileOffset = BufferSize;
BlockIndex = 0;
- while (BlockIndex < RegistryHive->Storage[HvStable].BlockListSize)
+ while (BlockIndex < RegistryHive->Storage[HvStable].Length)
{
LastIndex = BlockIndex;
- BlockIndex = RtlFindSetBits(&RegistryHive->DirtyBitmap, 1, BlockIndex);
+ BlockIndex = RtlFindSetBits(&RegistryHive->DirtyVector, 1, BlockIndex);
if (BlockIndex == ~0 || BlockIndex < LastIndex)
{
break;
}
- BlockPtr = RegistryHive->Storage[HvStable].BlockList[BlockIndex].Block;
+ BlockPtr = (PVOID)RegistryHive->Storage[HvStable].BlockList[BlockIndex].Block;
/* Write hive block */
Success = RegistryHive->FileWrite(RegistryHive, HV_TYPE_LOG,
@@ -135,7 +135,7 @@
static BOOLEAN CMAPI
HvpWriteHive(
- PREGISTRY_HIVE RegistryHive,
+ PHHIVE RegistryHive,
BOOLEAN OnlyDirty)
{
ULONG FileOffset;
@@ -163,26 +163,26 @@
/* Write hive block */
Success = RegistryHive->FileWrite(RegistryHive, HV_TYPE_PRIMARY,
0, RegistryHive->HiveHeader,
- sizeof(HIVE_HEADER));
+ sizeof(HBASE_BLOCK));
if (!Success)
{
return FALSE;
}
BlockIndex = 0;
- while (BlockIndex < RegistryHive->Storage[HvStable].BlockListSize)
+ while (BlockIndex < RegistryHive->Storage[HvStable].Length)
{
if (OnlyDirty)
{
LastIndex = BlockIndex;
- BlockIndex = RtlFindSetBits(&RegistryHive->DirtyBitmap, 1, BlockIndex);
+ BlockIndex = RtlFindSetBits(&RegistryHive->DirtyVector, 1, BlockIndex);
if (BlockIndex == ~0 || BlockIndex < LastIndex)
{
break;
}
}
- BlockPtr = RegistryHive->Storage[HvStable].BlockList[BlockIndex].Block;
+ BlockPtr = (PVOID)RegistryHive->Storage[HvStable].BlockList[BlockIndex].Block;
FileOffset = (ULONGLONG)(BlockIndex + 1) * (ULONGLONG)HV_BLOCK_SIZE;
/* Write hive block */
@@ -211,7 +211,7 @@
/* Write hive block */
Success = RegistryHive->FileWrite(RegistryHive, HV_TYPE_PRIMARY,
0, RegistryHive->HiveHeader,
- sizeof(HIVE_HEADER));
+ sizeof(HBASE_BLOCK));
if (!Success)
{
return FALSE;
@@ -228,11 +228,11 @@
BOOLEAN CMAPI
HvSyncHive(
- PREGISTRY_HIVE RegistryHive)
-{
- ASSERT(RegistryHive->ReadOnly == FALSE);
-
- if (RtlFindSetBits(&RegistryHive->DirtyBitmap, 1, 0) == ~0)
+ PHHIVE RegistryHive)
+{
+ ASSERT(RegistryHive->ReadOnly == FALSE);
+
+ if (RtlFindSetBits(&RegistryHive->DirtyVector, 1, 0) == ~0)
{
return TRUE;
}
@@ -253,14 +253,14 @@
}
/* Clear dirty bitmap. */
- RtlClearAllBits(&RegistryHive->DirtyBitmap);
+ RtlClearAllBits(&RegistryHive->DirtyVector);
return TRUE;
}
BOOLEAN CMAPI
HvWriteHive(
- PREGISTRY_HIVE RegistryHive)
+ PHHIVE RegistryHive)
{
ASSERT(RegistryHive->ReadOnly == FALSE);
Modified: trunk/reactos/ntoskrnl/cm/cm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cm/cm.h?rev=23572…
==============================================================================
--- trunk/reactos/ntoskrnl/cm/cm.h (original)
+++ trunk/reactos/ntoskrnl/cm/cm.h Mon Aug 14 15:35:48 2006
@@ -40,7 +40,7 @@
typedef struct _EREGISTRY_HIVE
{
LIST_ENTRY HiveList;
- PREGISTRY_HIVE Hive;
+ PHHIVE Hive;
UNICODE_STRING HiveFileName;
UNICODE_STRING LogFileName;
PSECURITY_CELL RootSecurityCell;
@@ -411,7 +411,7 @@
BOOLEAN CMAPI
CmpFileRead(
- PREGISTRY_HIVE RegistryHive,
+ PHHIVE RegistryHive,
ULONG FileType,
ULONG FileOffset,
PVOID Buffer,
@@ -419,7 +419,7 @@
BOOLEAN CMAPI
CmpFileWrite(
- PREGISTRY_HIVE RegistryHive,
+ PHHIVE RegistryHive,
ULONG FileType,
ULONG FileOffset,
PVOID Buffer,
@@ -427,29 +427,29 @@
BOOLEAN CMAPI
CmpFileSetSize(
- PREGISTRY_HIVE RegistryHive,
+ PHHIVE RegistryHive,
ULONG FileType,
ULONG FileSize);
BOOLEAN CMAPI
CmpFileFlush(
- PREGISTRY_HIVE RegistryHive,
+ PHHIVE RegistryHive,
ULONG FileType);
#if 0
-static __inline PVOID xHvGetCell(char *file, int line, PREGISTRY_HIVE Hive, HCELL_INDEX
Cell)
+static __inline PVOID xHvGetCell(char *file, int line, PHHIVE Hive, HCELL_INDEX Cell)
{
DPRINT1("xHvGetCell @ %s:%d %x @ %x\n", file, line, Cell, Hive);
return HvGetCell(Hive, Cell);
}
-static __inline VOID xHvFreeCell(char *file, int line, PREGISTRY_HIVE Hive, HCELL_INDEX
Cell)
+static __inline VOID xHvFreeCell(char *file, int line, PHHIVE Hive, HCELL_INDEX Cell)
{
DPRINT1("xHvFreeCell @ %s:%d %x @ %x\n", file, line, Cell, Hive);
HvFreeCell(Hive, Cell);
}
-static __inline HCELL_INDEX xHvAllocateCell(char *file, int line, PREGISTRY_HIVE Hive,
SIZE_T Size)
+static __inline HCELL_INDEX xHvAllocateCell(char *file, int line, PHHIVE Hive, SIZE_T
Size)
{
HCELL_INDEX Offset = HvAllocateCell(Hive, Size);
DPRINT1("xHvAllocateCell @ %s:%d (%x) %x @ %x\n", file, line, Size, Offset,
Hive);
Modified: trunk/reactos/ntoskrnl/cm/regfile.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cm/regfile.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/cm/regfile.c (original)
+++ trunk/reactos/ntoskrnl/cm/regfile.c Mon Aug 14 15:35:48 2006
@@ -44,7 +44,7 @@
BOOLEAN CMAPI
CmpFileRead(
- PREGISTRY_HIVE RegistryHive,
+ PHHIVE RegistryHive,
ULONG FileType,
ULONG FileOffset,
PVOID Buffer,
@@ -65,7 +65,7 @@
BOOLEAN CMAPI
CmpFileWrite(
- PREGISTRY_HIVE RegistryHive,
+ PHHIVE RegistryHive,
ULONG FileType,
ULONG FileOffset,
PVOID Buffer,
@@ -86,7 +86,7 @@
BOOLEAN CMAPI
CmpFileSetSize(
- PREGISTRY_HIVE RegistryHive,
+ PHHIVE RegistryHive,
ULONG FileType,
ULONG FileSize)
{
@@ -119,7 +119,7 @@
BOOLEAN CMAPI
CmpFileFlush(
- PREGISTRY_HIVE RegistryHive,
+ PHHIVE RegistryHive,
ULONG FileType)
{
PEREGISTRY_HIVE CmHive = RegistryHive->Opaque;
@@ -136,7 +136,7 @@
CmiCreateNewRegFile(HANDLE FileHandle)
{
EREGISTRY_HIVE CmHive;
- PREGISTRY_HIVE Hive;
+ PHHIVE Hive;
NTSTATUS Status;
CmHive.HiveHandle = FileHandle;
@@ -190,8 +190,8 @@
IO_STATUS_BLOCK IoStatusBlock;
HANDLE HiveHandle = INVALID_HANDLE_VALUE;
HANDLE LogHandle = INVALID_HANDLE_VALUE;
- PHIVE_HEADER HiveHeader = NULL;
- PHIVE_HEADER LogHeader = NULL;
+ PHBASE_BLOCK HiveHeader = NULL;
+ PHBASE_BLOCK LogHeader = NULL;
LARGE_INTEGER FileOffset;
ULONG FileSize;
ULONG BufferSize;
@@ -260,7 +260,7 @@
/* Allocate hive header */
HiveHeader = ExAllocatePool(PagedPool,
- sizeof(HIVE_HEADER));
+ sizeof(HBASE_BLOCK));
if (HiveHeader == NULL)
{
DPRINT("ExAllocatePool() failed\n");
@@ -276,7 +276,7 @@
0,
&IoStatusBlock,
HiveHeader,
- sizeof(HIVE_HEADER),
+ sizeof(HBASE_BLOCK),
&FileOffset,
0);
if (!NT_SUCCESS(Status))
@@ -810,7 +810,7 @@
ASSERT(!IsNoFileHive(RegistryHive));
- if (RtlFindSetBits(&RegistryHive->Hive->DirtyBitmap, 1, 0) == ~0)
+ if (RtlFindSetBits(&RegistryHive->Hive->DirtyVector, 1, 0) == ~0)
{
return(STATUS_SUCCESS);
}