52 if ((
External && (Primary || Log)) ||
59 (Alternate && !Primary))
85 Cluster =
max(1, Cluster);
303 Length = BaseName->Length;
380 Status = ZwCreateFile(Primary,
404 if (MarkAsSystemHive)
444 CompressionState = 0;
452 sizeof(CompressionState),
470 Status = ZwQueryInformationFile(*Primary,
493 sizeof(FsSizeInformation),
560 Status = ZwCreateFile(Log,
618 sizeof(CompressionState),
650 if (Hive->FileHandles[
i] !=
NULL)
653 Hive->FileHandles[
i] =
NULL;
PVOID NTAPI CmpAllocate(_In_ SIZE_T Size, _In_ BOOLEAN Paged, _In_ ULONG Tag)
VOID NTAPI CmpFree(_In_ PVOID Ptr, _In_ ULONG Quota)
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 th...
EX_PUSH_LOCK CmpHiveListHeadLock
BOOLEAN CmpShareSystemHives
NTSTATUS CMAPI HvInitialize(PHHIVE RegistryHive, ULONG OperationType, ULONG HiveFlags, ULONG FileType, PVOID HiveData OPTIONAL, PALLOCATE_ROUTINE Allocate, PFREE_ROUTINE Free, PFILE_SET_SIZE_ROUTINE FileSetSize, PFILE_WRITE_ROUTINE FileWrite, PFILE_READ_ROUTINE FileRead, PFILE_FLUSH_ROUTINE FileFlush, ULONG Cluster OPTIONAL, PCUNICODE_STRING FileName OPTIONAL)
#define CM_CHECK_REGISTRY_SUCCESS(StatusCode)
ULONG CM_CHECK_REGISTRY_STATUS
VOID CMAPI HvFree(PHHIVE RegistryHive)
VOID NTAPI CmpDestroyHiveViewList(IN PCMHIVE Hive)
VOID NTAPI CmpInitHiveViewList(IN PCMHIVE Hive)
VOID NTAPI CmpDestroySecurityCache(IN PCMHIVE Hive)
VOID NTAPI CmpInitSecurityCache(IN PCMHIVE Hive)
LIST_ENTRY CmpHiveListHead
BOOLEAN NTAPI CmpFileWrite(IN PHHIVE RegistryHive, IN ULONG FileType, IN PULONG FileOffset, IN PVOID Buffer, IN SIZE_T BufferLength)
BOOLEAN NTAPI CmpFileSetSize(_In_ PHHIVE RegistryHive, _In_ ULONG FileType, _In_ ULONG FileSize, _In_ ULONG OldFileSize)
BOOLEAN NTAPI CmpFileFlush(IN PHHIVE RegistryHive, IN ULONG FileType, IN OUT PLARGE_INTEGER FileOffset, IN ULONG Length)
NTSTATUS NTAPI CmpCreateEvent(IN EVENT_TYPE EventType, OUT PHANDLE EventHandle, OUT PKEVENT *Event)
BOOLEAN NTAPI CmpFileRead(IN PHHIVE RegistryHive, IN ULONG FileType, IN PULONG FileOffset, OUT PVOID Buffer, IN SIZE_T BufferLength)
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
#define NT_SUCCESS(StatCode)
#define FILE_ATTRIBUTE_NORMAL
#define RemoveEntryList(Entry)
#define InsertHeadList(ListHead, Entry)
#define ExAllocatePoolWithTag(hernya, size, tag)
NTSTATUS ExInitializeResourceLite(PULONG res)
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
#define ExDeleteResourceLite(res)
#define InitializeListHead(ListHead)
FORCEINLINE VOID ExReleasePushLock(PEX_PUSH_LOCK PushLock)
#define ExInitializePushLock
FORCEINLINE VOID ExAcquirePushLockExclusive(PEX_PUSH_LOCK PushLock)
_Inout_opt_ PUNICODE_STRING Extension
#define FILE_NO_COMPRESSION
#define FILE_SYNCHRONOUS_IO_NONALERT
#define FILE_NO_INTERMEDIATE_BUFFERING
#define FILE_RANDOM_ACCESS
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
VOID FASTCALL KeInitializeGuardedMutex(OUT PKGUARDED_MUTEX GuardedMutex)
#define KeGetCurrentThread
#define HFILE_TYPE_ALTERNATE
#define HFILE_TYPE_PRIMARY
#define HFILE_TYPE_EXTERNAL
#define HINIT_MEMORY_INPLACE
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define OBJ_KERNEL_HANDLE
#define OBJ_CASE_INSENSITIVE
#define ExFreePoolWithTag(_P, _T)
static IDispatch External
static OUT PIO_STATUS_BLOCK IoStatusBlock
static OUT PIO_STATUS_BLOCK OUT PVOID FileInformation
#define InitializeObjectAttributes(p, n, a, r, s)
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
NTSYSAPI VOID NTAPI RtlCopyUnicodeString(PUNICODE_STRING DestinationString, PUNICODE_STRING SourceString)
NTSYSAPI NTSTATUS NTAPI RtlAppendUnicodeStringToString(PUNICODE_STRING Destination, PUNICODE_STRING Source)
#define FILE_ATTRIBUTE_HIDDEN
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define FSCTL_MARK_AS_SYSTEM_HIVE
#define FSCTL_SET_COMPRESSION
_In_ ULONG _In_ ULONG _In_ ULONG Length
NTSYSAPI NTSTATUS NTAPI ZwFsControlFile(IN HANDLE DeviceHandle, IN HANDLE Event OPTIONAL, IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, IN PVOID ApcContext OPTIONAL, OUT PIO_STATUS_BLOCK IoStatusBlock, IN ULONG IoControlCode, IN PVOID InputBuffer, IN ULONG InputBufferSize, OUT PVOID OutputBuffer, IN ULONG OutputBufferSize)
NTSYSAPI NTSTATUS NTAPI ZwQueryVolumeInformationFile(IN HANDLE FileHandle, OUT PIO_STATUS_BLOCK IoStatusBlock, OUT PVOID FsInformation, IN ULONG Length, IN FS_INFORMATION_CLASS FsInformationClass)
VOID NTAPI CmpCloseHiveFiles(IN PCMHIVE Hive)
NTSTATUS NTAPI CmpInitializeHive(_Out_ PCMHIVE *CmHive, _In_ ULONG OperationType, _In_ ULONG HiveFlags, _In_ ULONG FileType, _In_opt_ PVOID HiveData, _In_ HANDLE Primary, _In_ HANDLE Log, _In_ HANDLE External, _In_ HANDLE Alternate, _In_opt_ PCUNICODE_STRING FileName, _In_ ULONG CheckFlags)
NTSTATUS NTAPI CmpOpenHiveFiles(IN PCUNICODE_STRING BaseName, IN PCWSTR Extension OPTIONAL, OUT PHANDLE Primary, OUT PHANDLE Log, OUT PULONG PrimaryDisposition, OUT PULONG LogDisposition, IN BOOLEAN CreateAllowed, IN BOOLEAN MarkAsSystemHive, IN BOOLEAN NoBuffering, OUT PULONG ClusterSize OPTIONAL)
NTSTATUS NTAPI CmpDestroyHive(IN PCMHIVE CmHive)
#define STATUS_CANNOT_LOAD_REGISTRY_FILE
#define STATUS_REGISTRY_CORRUPT
#define STATUS_REGISTRY_IO_FAILED
#define FileStandardInformation
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
PULONG MinorVersion OPTIONAL
PKTHREAD HiveSecurityLockOwner
LIST_ENTRY KnodeConvertListHead
EX_PUSH_LOCK SecurityLock
PWORK_QUEUE_ITEM UnloadWorkItem
LIST_ENTRY TrustClassEntry
CM_USE_COUNT_LOG UseCountLog
HANDLE FileHandles[HFILE_TYPE_MAX]
LIST_ENTRY KcbConvertListHead
UNICODE_STRING FileUserName
PCM_KEY_CONTROL_BLOCK RootKcb
PCM_CELL_REMAP_BLOCK CellRemapArray
CM_USE_COUNT_LOG LockHiveLog
UNICODE_STRING FileFullPath
struct _LIST_ENTRY * Blink
struct _LIST_ENTRY * Flink
unsigned short MaximumLength
#define STATUS_INVALID_DEVICE_REQUEST
#define STATUS_INVALID_PARAMETER
#define STATUS_INSUFFICIENT_RESOURCES
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
_In_ WDFDEVICE _In_ WDF_SPECIAL_FILE_TYPE FileType
_Must_inspect_result_ _In_opt_ WDFKEY _In_ PCUNICODE_STRING _In_ ACCESS_MASK _In_ ULONG _Out_opt_ PULONG CreateDisposition
_Out_ PHANDLE EventHandle
#define ObDereferenceObject