reactos/boot/freeldr/freeldr/ntldr/registry.h
George Bișoc 7983b65e10
[FREELDR] Implement SYSTEM hive recovery at bootloader level & use CmCheckRegistry for registry validation
Validate the SYSTEM hive with CmCheckRegistry and purge volatile data with the same function when initializing a hive descriptor for SYSTEM.
Also implement SYSTEM recovery code that takes use of SYSTEM log in case something is fishy with the hive. If hive repair doesn't have fully recovered the SYSTEM hive, FreeLdr will load the alternate variant of the SYSTEM hive, aka SYSTEM.ALT.

If FreeLdr repairs the hive with a LOG, it will mark it with HBOOT_BOOT_RECOVERED_BY_HIVE_LOG on BootRecover field of the header. All the recovered data that is present as dirty in memory will have to be flushed by the kernel once it is in charge of the system.
Otherwise if the system boot occurred by loading SYSTEM.ALT instead, FreeLdr will mark HBOOT_BOOT_RECOVERED_BY_ALTERNATE_HIVE, the kernel will start recovering the main hive as soon as it does any I/O activity into it.
2023-11-19 20:44:28 +01:00

90 lines
2 KiB
C

/*
* FreeLoader - registry.h
*
* Copyright (C) 2001 Eric Kohl
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef __REGISTRY_H
#define __REGISTRY_H
#include <cmlib.h>
typedef HANDLE HKEY, *PHKEY;
#define HKEY_TO_HCI(hKey) ((HCELL_INDEX)(ULONG_PTR)(hKey))
BOOLEAN
RegImportBinaryHive(
_In_ PVOID ChunkBase,
_In_ ULONG ChunkSize,
_In_ PCSTR SearchPath,
_In_ BOOLEAN LoadAlternate);
BOOLEAN
RegInitCurrentControlSet(
_In_ BOOLEAN LastKnownGood);
extern PHHIVE SystemHive;
extern HKEY CurrentControlSetKey;
/*
* LONG
* RegCloseKey(
* _In_ HKEY hKey);
*/
#define RegCloseKey(hKey) (ERROR_SUCCESS)
#if 0
LONG
RegEnumKey(
_In_ HKEY Key,
_In_ ULONG Index,
_Out_ PWCHAR Name,
_Inout_ PULONG NameSize,
_Out_opt_ PHKEY SubKey);
#endif
LONG
RegOpenKey(
_In_ HKEY ParentKey,
_In_z_ PCWSTR KeyName,
_Out_ PHKEY Key);
LONG
RegQueryValue(
_In_ HKEY Key,
_In_z_ PCWSTR ValueName,
_Out_opt_ PULONG Type,
_Out_opt_ PUCHAR Data,
_Inout_opt_ PULONG DataSize);
#if 0
LONG
RegEnumValue(
_In_ HKEY Key,
_In_ ULONG Index,
_Out_ PWCHAR ValueName,
_Inout_ PULONG NameSize,
_Out_opt_ PULONG Type,
_Out_opt_ PUCHAR Data,
_Inout_opt_ PULONG DataSize)
#endif
#endif /* __REGISTRY_H */
/* EOF */