ReactOS 0.4.16-dev-306-g647d351
|
Go to the source code of this file.
Classes | |
struct | _CMP_REGISTRY_STACK_WORK_STATE |
Macros | |
#define | NDEBUG |
#define | GET_HHIVE(CmHive) (&((CmHive)->Hive)) |
#define | GET_HHIVE_ROOT_CELL(Hive) ((Hive)->BaseBlock->RootCell) |
#define | GET_HHIVE_BIN(Hive, StorageIndex, BlockIndex) ((PHBIN)Hive->Storage[StorageIndex].BlockList[BlockIndex].BinAddress) |
#define | GET_CELL_BIN(Bin) ((PHCELL)((PUCHAR)Bin + sizeof(HBIN))) |
#define | IS_CELL_VOLATILE(Cell) (HvGetCellType(Cell) == Volatile) |
#define | CMP_PRIOR_STACK 1 |
#define | CMP_REGISTRY_MAX_LEVELS_TREE_DEPTH 512 |
#define | CMP_KEY_SIZE_THRESHOLD 0x45C |
#define | CMP_VOLATILE_LIST_UNINTIALIZED 0xBAADF00D |
Typedefs | |
typedef struct _CMP_REGISTRY_STACK_WORK_STATE | CMP_REGISTRY_STACK_WORK_STATE |
typedef struct _CMP_REGISTRY_STACK_WORK_STATE * | PCMP_REGISTRY_STACK_WORK_STATE |
Functions | |
static BOOLEAN | CmpValidateLexicalOrder (_In_ PHHIVE Hive, _In_ HCELL_INDEX Child, _In_ HCELL_INDEX Sibling) |
Validates the lexicographical order between a child and prior sibling of the said child. | |
static CM_CHECK_REGISTRY_STATUS | CmpValidateClass (_In_ PHHIVE Hive, _In_ HCELL_INDEX CurrentCell, _Inout_ PCELL_DATA CellData) |
Validates the class of a given key cell. | |
static CM_CHECK_REGISTRY_STATUS | CmpValidateValueListByCount (_In_ PHHIVE Hive, _In_ HCELL_INDEX CurrentCell, _In_ ULONG ListCount, _In_ PCELL_DATA ValueListData, _Out_ PULONG ValuesRemoved, _In_ BOOLEAN FixHive) |
Validates each value in the list by count. A value that is damaged gets removed from the list. This routine performs self-healing process in this case. | |
static CM_CHECK_REGISTRY_STATUS | CmpValidateValueList (_In_ PHHIVE Hive, _In_ HCELL_INDEX CurrentCell, _Inout_ PCELL_DATA CellData, _In_ BOOLEAN FixHive) |
Validates the value list of a key. If the list is damaged due to corruption, the whole list is expunged. This function performs self-healing procedures in this case. | |
static CM_CHECK_REGISTRY_STATUS | CmpValidateSubKeyList (_In_ PHHIVE Hive, _In_ HCELL_INDEX CurrentCell, _Inout_ PCELL_DATA CellData, _In_ BOOLEAN FixHive, _Out_ PBOOLEAN DoRepair) |
Validates the subkeys list of a key. If the list is damaged from corruption, the function can either salvage this list or purge the whole of it. The function performs different validation steps for different storage types. | |
static VOID | CmpPurgeVolatiles (_In_ PHHIVE Hive, _In_ HCELL_INDEX CurrentCell, _Inout_ PCELL_DATA CellData, _In_ ULONG Flags) |
Purges the volatile storage of a registry hive. This operation is done mainly during the bootup of the system. | |
static CM_CHECK_REGISTRY_STATUS | CmpValidateKey (_In_ PHHIVE Hive, _In_ BOOLEAN SecurityDefaulted, _In_ HCELL_INDEX ParentCell, _In_ HCELL_INDEX CurrentCell, _In_ ULONG Flags, _In_ BOOLEAN FixHive) |
Validates the key cell, ensuring that the key in the registry is valid and not corrupted. | |
static CM_CHECK_REGISTRY_STATUS | CmpValidateRegistryInternal (_In_ PHHIVE Hive, _In_ ULONG Flags, _In_ BOOLEAN SecurityDefaulted, _In_ BOOLEAN FixHive) |
Performs deep checking of the registry by walking down the registry tree using a stack based pool. This function is the guts of CmCheckRegistry. | |
CM_CHECK_REGISTRY_STATUS NTAPI | HvValidateBin (_In_ PHHIVE Hive, _In_ PHBIN Bin) |
Validates a bin from a hive. It performs checks against the cells from this bin, ensuring the bin is not corrupt and that the cells are consistent with each other. | |
CM_CHECK_REGISTRY_STATUS NTAPI | HvValidateHive (_In_ PHHIVE Hive) |
Validates a registry hive. This function ensures that the storage of this hive has valid bins. | |
CM_CHECK_REGISTRY_STATUS NTAPI | CmCheckRegistry (_In_ PCMHIVE RegistryHive, _In_ ULONG Flags) |
Checks the registry that is consistent and its contents valid and not corrupted. More specifically this function performs a deep check of the registry for the following properties: | |
Variables | |
PCMHIVE | CmiVolatileHive |
#define GET_HHIVE_ROOT_CELL | ( | Hive | ) | ((Hive)->BaseBlock->RootCell) |
#define IS_CELL_VOLATILE | ( | Cell | ) | (HvGetCellType(Cell) == Volatile) |
Checks the registry that is consistent and its contents valid and not corrupted. More specifically this function performs a deep check of the registry for the following properties:
[in] | Hive | A pointer to a CM hive of the registry to be checked in question. |
[in] | Flags | A bit mask flag used to influence the process of volatile keys purging. See Remarks for further information. |
CM_CHECK_REGISTRY_DONT_PURGE_VOLATILES – Tells the function that volatile data purging must not be done.
CM_CHECK_REGISTRY_PURGE_VOLATILES - Tells the function to purge out volatile information data from a registry hive, on demand. Purging doesn't come into action if no volatile data has been found.
CM_CHECK_REGISTRY_BOOTLOADER_PURGE_VOLATILES - A special flag used by FreeLdr and Environ. When this flag is set the function will not clean up the volatile storage but it will unintialize the storage instead (this is the case if the given registry hive for validation is a XP Beta 1 hive or newer). Otherwise it will perform a normal cleanup of the volatile storage.
CM_CHECK_REGISTRY_VALIDATE_HIVE - Tells the function to perform a thorough analysation of the underlying hive's bins and cells before doing validation of the registry tree. HvValidateHive function is called in this case.
CM_CHECK_REGISTRY_FIX_HIVE - Tells the function to fix the target registry hive if it is damaged. Usually this flag comes from a registry repair tool where the user asked to for its damaged hive to be fixed. In this case a self-heal procedure against the hive is performed.
Definition at line 1634 of file cmcheck.c.
Referenced by BiInitializeAndValidateHive(), CmFlushKey(), CmpInitializeHive(), CmSaveKey(), CmSaveMergedKeys(), and RegInitializeHive().
|
static |
Purges the volatile storage of a registry hive. This operation is done mainly during the bootup of the system.
[in] | Hive | A pointer to a hive descriptor of which volatiles are to be purged. |
[in] | CurrentCell | The current key cell that the volatile storage of the hive points to. |
[in] | CellData | The cell data of the current cell of which the volatile subkeys storage comes from. |
[in] | Flags | A bit mask flag that is used to influence how is the purging operation to be done. See CmCheckRegistry documentation below for more information. |
Definition at line 849 of file cmcheck.c.
Referenced by CmpValidateKey().
|
static |
Validates the class of a given key cell.
[in] | Hive | A pointer to a hive descriptor of which the registry call is to be validated. |
[in] | CurrentCell | The current key cell that the class points to. |
[in] | CellData | A pointer to cell data of the current key cell that contains the class to be validated. |
Definition at line 190 of file cmcheck.c.
Referenced by CmpValidateKey().
|
static |
Validates the key cell, ensuring that the key in the registry is valid and not corrupted.
[in] | Hive | A pointer to a hive descriptor of the registry where the key is to be validated. |
[in] | SecurityDefaulted | If the caller sets this to TRUE, this indicates the hive has its security property defaulted due to heal recovery of the said security. If the caller sets this to FALSE, the hive comes with its own security details. This parameter is currently unused. |
[in] | ParentCell | The parent key cell that comes before the current cell. This parameter can be HCELL_NIL if the first cell is the root cell which is the parent of its own. |
[in] | CurrentCell | The current child key cell that is to be validated. |
[in] | Flags | A bit mask flag that is used to influence how is the purging operation of volatile keys in the volatile storage to be done. See CmCheckRegistry documentation below for more information. |
[in] | FixHive | If set to TRUE, the target hive will be fixed. |
Definition at line 939 of file cmcheck.c.
Referenced by CmpValidateRegistryInternal().
|
static |
Validates the lexicographical order between a child and prior sibling of the said child.
[in] | Hive | A pointer to a hive descriptor of which lexicographical order of keys are to be checked. |
[in] | Child | A child subkey cell used for lexicographical order validation checks. |
[in] | Sibling | A subkey cell which is the prior sibling of the child. This is used in conjuction with the child to perfrom lexical order checks. |
Definition at line 66 of file cmcheck.c.
Referenced by CmpValidateRegistryInternal().
|
static |
Performs deep checking of the registry by walking down the registry tree using a stack based pool. This function is the guts of CmCheckRegistry.
[in] | Hive | A pointer to a hive descriptor of the registry where the validation is to be performed. |
[in] | Flags | Bit mask flag used for volatiles purging. Such flags influence on how volatile purging is actually done. See CmCheckRegistry documentation for more information. |
[in] | SecurityDefaulted | If the caller sets this to FALSE, the registry hive uses its own unique security details. Otherwise registry hive has the security details defaulted. |
[in] | FixHive | If set to TRUE, the target hive will be fixed. |
Definition at line 1148 of file cmcheck.c.
Referenced by CmCheckRegistry().
|
static |
Validates the subkeys list of a key. If the list is damaged from corruption, the function can either salvage this list or purge the whole of it. The function performs different validation steps for different storage types.
[in] | Hive | A pointer to a hive descriptor of which a list of subkeys is to be validated. |
[in] | CurrentCell | The current key cell that the subkeys list points to. |
[in] | CellData | The cell data of the current cell of which the subkeys list comes from. |
[in] | FixHive | If set to TRUE, the target hive will be fixed. |
[out] | DoRepair | A pointer to a boolean value set up by the function itself. The function automatically sets this to FALSE indicating that repairs can't be done onto the list itself. If the list can be salvaged, then the function sets this to TRUE. See Remarks for further information. |
Definition at line 644 of file cmcheck.c.
Referenced by CmpValidateKey().
|
static |
Validates the value list of a key. If the list is damaged due to corruption, the whole list is expunged. This function performs self-healing procedures in this case.
[in] | Hive | A pointer to a hive descriptor of which a list of registry values is to be validated. |
[in] | CurrentCell | The current key cell that the value list points to. |
[in] | CellData | The cell data of the current cell of which the value list comes from. |
[in] | FixHive | If set to TRUE, the target hive will be fixed. |
Definition at line 508 of file cmcheck.c.
Referenced by CmpValidateKey().
|
static |
Validates each value in the list by count. A value that is damaged gets removed from the list. This routine performs self-healing process in this case.
[in] | Hive | A pointer to a hive descriptor of which a list of registry values is to be validated. |
[in] | CurrentCell | The current key cell that the value list points to. |
[in] | ListCount | The list count that describes the actual number of values in the list. |
[in] | ValueListData | A pointer to cell data of the current key cell that contains the value list to be validated. |
[out] | ValuesRemoved | When the function finishes doing its operations, this parameter contains the amount of removed values from the list. A value of 0 indicates no values have been removed (which that would imply a self-healing process of the value list has occurred). |
[in] | FixHive | If set to TRUE, the target hive will be fixed. |
Definition at line 281 of file cmcheck.c.
Referenced by CmpValidateValueList().
Validates a bin from a hive. It performs checks against the cells from this bin, ensuring the bin is not corrupt and that the cells are consistent with each other.
[in] | Hive | A pointer to a hive descriptor of which a hive bin is to be validated. |
[in] | Bin | A pointer to a bin where its cells are to be validated. |
Definition at line 1414 of file cmcheck.c.
Referenced by HvValidateHive().
CM_CHECK_REGISTRY_STATUS NTAPI HvValidateHive | ( | _In_ PHHIVE | Hive | ) |
Validates a registry hive. This function ensures that the storage of this hive has valid bins.
[in] | Hive | A pointer to a hive descriptor where validation on its hive bins is to be performed. |
Definition at line 1506 of file cmcheck.c.
Referenced by CmCheckRegistry().
|
extern |
Definition at line 16 of file cmsysini.c.
Referenced by CmCheckRegistry(), CmFlushKey(), CmInitSystem1(), CmpCreateLinkNode(), CmpCreateRegistryRoot(), CmpGetHiveName(), CmpParseKey(), CmpUnlinkHiveFromMaster(), CmSaveKey(), and CmUnloadKey().