mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[SDK:CMLIB] HvGetCell is a macro calling the hive's GetCellRoutine callback.
In principle there should be different get-cell routines, depending on the type of the hive (given by the OperationType parameter of HvInitialize): for flat hives, memory-mapped hives, etc. For now in ReactOS we only support a restricted subset of these, therefore we are still happy with a single get-cell callback... This may change in the future.
This commit is contained in:
parent
a4cad7be6b
commit
8ccd435eb0
3 changed files with 24 additions and 17 deletions
|
@ -384,15 +384,13 @@ VOID CMAPI
|
||||||
HvFree(
|
HvFree(
|
||||||
PHHIVE RegistryHive);
|
PHHIVE RegistryHive);
|
||||||
|
|
||||||
PVOID CMAPI
|
#define HvGetCell(Hive, Cell) \
|
||||||
HvGetCell(
|
(Hive)->GetCellRoutine(Hive, Cell)
|
||||||
PHHIVE RegistryHive,
|
|
||||||
HCELL_INDEX CellOffset);
|
|
||||||
|
|
||||||
#define HvReleaseCell(h, c) \
|
#define HvReleaseCell(Hive, Cell) \
|
||||||
do { \
|
do { \
|
||||||
if ((h)->ReleaseCellRoutine) \
|
if ((Hive)->ReleaseCellRoutine) \
|
||||||
(h)->ReleaseCellRoutine(h, c); \
|
(Hive)->ReleaseCellRoutine(Hive, Cell); \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
LONG CMAPI
|
LONG CMAPI
|
||||||
|
@ -468,6 +466,11 @@ HvReleaseFreeCellRefArray(
|
||||||
* Private functions.
|
* Private functions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
PCELL_DATA CMAPI
|
||||||
|
HvpGetCellData(
|
||||||
|
_In_ PHHIVE Hive,
|
||||||
|
_In_ HCELL_INDEX CellIndex);
|
||||||
|
|
||||||
PHBIN CMAPI
|
PHBIN CMAPI
|
||||||
HvpAddBin(
|
HvpAddBin(
|
||||||
PHHIVE RegistryHive,
|
PHHIVE RegistryHive,
|
||||||
|
|
|
@ -29,13 +29,13 @@ HvpGetCellHeader(
|
||||||
ASSERT(CellBlock < RegistryHive->Storage[CellType].Length);
|
ASSERT(CellBlock < RegistryHive->Storage[CellType].Length);
|
||||||
Block = (PVOID)RegistryHive->Storage[CellType].BlockList[CellBlock].BlockAddress;
|
Block = (PVOID)RegistryHive->Storage[CellType].BlockList[CellBlock].BlockAddress;
|
||||||
ASSERT(Block != NULL);
|
ASSERT(Block != NULL);
|
||||||
return (PVOID)((ULONG_PTR)Block + CellOffset);
|
return (PHCELL)((ULONG_PTR)Block + CellOffset);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ASSERT(HvGetCellType(CellIndex) == Stable);
|
ASSERT(HvGetCellType(CellIndex) == Stable);
|
||||||
return (PVOID)((ULONG_PTR)RegistryHive->BaseBlock + HBLOCK_SIZE +
|
return (PHCELL)((ULONG_PTR)RegistryHive->BaseBlock + HBLOCK_SIZE +
|
||||||
CellIndex);
|
CellIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,13 +63,12 @@ HvIsCellAllocated(IN PHHIVE RegistryHive,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
PVOID CMAPI
|
PCELL_DATA CMAPI
|
||||||
HvGetCell(
|
HvpGetCellData(
|
||||||
PHHIVE RegistryHive,
|
_In_ PHHIVE Hive,
|
||||||
HCELL_INDEX CellIndex)
|
_In_ HCELL_INDEX CellIndex)
|
||||||
{
|
{
|
||||||
ASSERT(CellIndex != HCELL_NIL);
|
return (PCELL_DATA)(HvpGetCellHeader(Hive, CellIndex) + 1);
|
||||||
return (PVOID)(HvpGetCellHeader(RegistryHive, CellIndex) + 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static __inline LONG CMAPI
|
static __inline LONG CMAPI
|
||||||
|
|
|
@ -562,6 +562,11 @@ HvInitialize(
|
||||||
#endif
|
#endif
|
||||||
Hive->HiveFlags = HiveFlags & ~HIVE_NOLAZYFLUSH;
|
Hive->HiveFlags = HiveFlags & ~HIVE_NOLAZYFLUSH;
|
||||||
|
|
||||||
|
// TODO: The CellRoutines point to different callbacks
|
||||||
|
// depending on the OperationType.
|
||||||
|
Hive->GetCellRoutine = HvpGetCellData;
|
||||||
|
Hive->ReleaseCellRoutine = NULL;
|
||||||
|
|
||||||
switch (OperationType)
|
switch (OperationType)
|
||||||
{
|
{
|
||||||
case HINIT_CREATE:
|
case HINIT_CREATE:
|
||||||
|
|
Loading…
Reference in a new issue