66 Status = ZwCreateKey(&LinkKeyHandle,
75 DPRINT1(
"CM: CmpLinkKeyToHive: couldn't create %S, Status = 0x%lx\n",
83 DPRINT1(
"CM: CmpLinkKeyToHive: %S already exists!\n", LinkKeyName);
90 Status = ZwSetValueKey(LinkKeyHandle,
102 DPRINT1(
"CM: CmpLinkKeyToHive: couldn't create symbolic link for %S, Status = 0x%lx\n",
122 PostOperationInfo.
Object = KeyBody;
123 KeyHandleCloseInfo.
Object = KeyBody;
125 &KeyHandleCloseInfo);
172 if (SystemHandleCount > 1)
return;
261 ObjectNameInfo->Name.Buffer = (
PWCHAR)(ObjectNameInfo + 1);
262 ObjectNameInfo->Name.MaximumLength =
KeyName->Length;
263 ObjectNameInfo->Name.Length =
KeyName->Length;
295 ULONG HiveDisposition, LogDisposition;
412 L"\\REGISTRY\\MACHINE\\SYSTEM\\CurrentControlSet\\"
465 DPRINT(
"CmpCreateHardwareProfile()\n");
483 DPRINT1(
"Creating the Hardware Profile key failed\n");
506 DPRINT1(
"Creating the Hardware Profile\\0000 key failed\n");
520 DPRINT(
"CmpCreateHardwareProfile() done\n");
535 CHAR ValueInfoBuffer[128];
537 WCHAR UnicodeBuffer[128];
543 ULONG ControlSet, HwProfile;
550 if (LoaderBlock->RegistryBase ==
NULL)
554 L"\\Registry\\Machine\\System\\ControlSet001");
569 DPRINT1(
"Failed to create ControlSet001 key: 0x%lx\n",
Status);
577 DPRINT1(
"Failed to create Hardware profile keys: 0x%lx\n",
Status);
605 sizeof(ValueInfoBuffer),
609 DPRINT1(
"Failed to open the Current value: 0x%lx\n",
Status);
620 L"\\Registry\\Machine\\System\\CurrentControlSet");
641 L"\\Registry\\Machine\\System\\ControlSet%03ld",
675 if (LoaderBlock->RegistryBase ==
NULL)
687 sizeof(ValueInfoBuffer),
706 L"\\Registry\\Machine\\System\\CurrentControlSet"
707 L"\\Hardware Profiles");
723 L"%04ld", HwProfile);
743 LoaderExtension = LoaderBlock->Extension;
746 DPRINT(
"ReactOS doesn't support NTLDR Profiles yet!\n");
751 L"\\Registry\\Machine\\System\\CurrentControlSet\\"
752 L"Hardware Profiles\\Current");
772 L"\\Registry\\Machine\\System\\CurrentControlSet\\"
773 L"Hardware Profiles\\%04ld",
790 if (SelectHandle)
NtClose(SelectHandle);
792 if (ConfigHandle)
NtClose(ConfigHandle);
793 if (ProfileHandle)
NtClose(ProfileHandle);
794 if (ParentHandle)
NtClose(ParentHandle);
796 DPRINT(
"CmpCreateControlSet() done\n");
845 (
PVOID)&ParseContext,
850 RegistryHive->Hive.DirtyFlag =
FALSE;
909 HiveBase = LoaderBlock->RegistryBase;
991 RtlZeroMemory(&ObjectTypeInitializer,
sizeof(ObjectTypeInitializer));
993 ObjectTypeInitializer.
Length =
sizeof(ObjectTypeInitializer);
1032 Hive->BaseBlock->RootCell = *
Index;
1034 if (!KeyCell)
return FALSE;
1133 RootKey->KeyControlBlock = Kcb;
1179 ConfigPath =
L"\\SystemRoot\\System32\\Config\\";
1183 ConfigPath =
L"\\SystemRoot\\";
1186 DPRINT1(
"CmpGetRegistryPath: ConfigPath = '%S'\n", ConfigPath);
1219 PHHIVE Hive, AlternateHive;
1241 DPRINT1(
"Failed to initialize the alternate hive to check for diversion (Status 0x%lx)\n",
Status);
1250 Hive = &CmMainmHive->Hive;
1251 AlternateHive = &CmiAlternateHive->
Hive;
1264CmpLoadHiveThread(
IN PVOID StartContext)
1266 WCHAR FileBuffer[64], RegBuffer[64];
1275 PVOID ErrorParameters;
1287 RtlInitEmptyUnicodeString(&
FileName, FileBuffer,
sizeof(FileBuffer));
1288 RtlInitEmptyUnicodeString(&RegName, RegBuffer,
sizeof(RegBuffer));
1358 &PrimaryDisposition,
1359 &SecondaryDisposition,
1400 DPRINT1(
"FIXME: Support for CmHive->Hive.Cluster (%lu) != ClusterSize (%lu) is unimplemented!\n",
1415 DPRINT1(
"FreeLdr recovered the hive (hive 0x%p)\n", CmHive);
1437 DPRINT1(
"Failed to write to alternate hive\n");
1469 WCHAR FileBuffer[64], RegBuffer[64];
1484 RtlInitEmptyUnicodeString(&
FileName, FileBuffer,
sizeof(FileBuffer));
1485 RtlInitEmptyUnicodeString(&RegName, RegBuffer,
sizeof(RegBuffer));
1495 RegStart = RegName.
Length;
1564 RegName.
Length = RegStart;
1609 L"\\Registry\\Machine\\SAM\\SAM");
1614 L"\\Registry\\User\\.Default");
1695 KeBugCheckEx(CONFIG_INITIALIZATION_FAILED, 1, 3, 0, 0);
1754 KeBugCheckEx(CONFIG_INITIALIZATION_FAILED, 1, 7, 0, 0);
1906 for (
i = 0, NextEntry = DriverList.
Flink;
1907 NextEntry != &DriverList;
1908 i++, NextEntry = NextEntry->
Flink);
1912 if (!ServicePath)
KeBugCheckEx(CONFIG_INITIALIZATION_FAILED, 2, 1, 0, 0);
1915 for (
i = 0, NextEntry = DriverList.
Flink;
1916 NextEntry != &DriverList;
1917 i++, NextEntry = NextEntry->
Flink)
1924 if (!ServicePath[
i])
1926 KeBugCheckEx(CONFIG_INITIALIZATION_FAILED, 2, 1, 0, 0);
1935 KeBugCheckEx(CONFIG_INITIALIZATION_FAILED, 2, 1, 0, 0);
1940 ServicePath[
i] =
NULL;
2082 ULONG Index1, Index2;
2092 if (Index1 < Index2)
2111 ULONG Index1, Index2;
2123 if (Index1 < Index2)
2134 if (Index1 != Index2)
2166 ListEntry = ListEntry->
Flink;
2381 if (CurrentVersionKeyHandle !=
NULL)
2382 NtClose(CurrentVersionKeyHandle);
2384 if (WindowsNtKeyHandle !=
NULL)
2387 if (MicrosoftKeyHandle !=
NULL)
2390 if (SoftwareKeyHandle !=
NULL)
#define OBJ_NAME_PATH_SEPARATOR
NTSTATUS NTAPI CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
#define InterlockedIncrement
struct _CM_KEY_BODY * PCM_KEY_BODY
#define CM_NUMBER_OF_MACHINE_HIVES
struct _CM_KEY_BODY CM_KEY_BODY
#define CMP_ASSERT_EXCLUSIVE_REGISTRY_LOCK()
FORCEINLINE VOID CmpAcquireKcbLockExclusiveByKey(IN ULONG ConvKey)
#define CMP_ASSERT_FLUSH_LOCK(h)
#define GET_HASH_ENTRY(Table, ConvKey)
#define GET_HASH_INDEX(ConvKey)
#define CmpAcquireKcbLockShared(k)
#define CMP_ASSERT_REGISTRY_LOCK()
FORCEINLINE VOID CmpReleaseKcbLockByKey(ULONG ConvKey)
#define CMP_ASSERT_REGISTRY_LOCK_OR_LOADING(h)
FORCEINLINE VOID CmpReleaseKcbLock(PCM_KEY_CONTROL_BLOCK Kcb)
VOID NTAPI CmpInitCmPrivateAlloc(VOID)
VOID NTAPI CmpInitCmPrivateDelayAlloc(VOID)
BOOLEAN NTAPI CmpDoFlushAll(IN BOOLEAN ForceFlush)
BOOLEAN NTAPI CmpFindDrivers(_In_ PHHIVE Hive, _In_ HCELL_INDEX ControlSet, _In_ SERVICE_LOAD_TYPE LoadType, _In_opt_ PCWSTR BootFileSystem, _Inout_ PLIST_ENTRY DriverListHead)
Enumerates all drivers within the given control set and load type, present in the "Services" sub-key,...
BOOLEAN NTAPI CmpResolveDriverDependencies(_Inout_ PLIST_ENTRY DriverListHead)
Removes potential circular dependencies (cycles) and sorts the driver list.
HCELL_INDEX NTAPI CmpFindControlSet(_In_ PHHIVE SystemHive, _In_ HCELL_INDEX RootCell, _In_ PCUNICODE_STRING SelectKeyName, _Out_ PBOOLEAN AutoSelect)
Finds the corresponding "HKLM\SYSTEM\ControlSetXXX" system control set registry key,...
BOOLEAN NTAPI CmpSortDriverList(_In_ PHHIVE Hive, _In_ HCELL_INDEX ControlSet, _Inout_ PLIST_ENTRY DriverListHead)
Sorts the driver list, according to the drivers' group load ordering.
VOID NTAPI CmpFreeDriverList(_In_ PHHIVE Hive, _Inout_ PLIST_ENTRY DriverListHead)
Empties the driver list and frees all allocated driver nodes in it.
NTSTATUS NTAPI CmpInitializeHardwareConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
EX_PUSH_LOCK CmpHiveListHeadLock
EX_PUSH_LOCK CmpLoadHiveLock
HIVE_LIST_ENTRY CmpMachineHiveList[]
UNICODE_STRING CmSymbolicLinkValueName
HANDLE CmpRegistryRootHandle
BOOLEAN CmpShareSystemHives
UNICODE_STRING CmpLoadOptions
struct _CM_KEY_NODE * PCM_KEY_NODE
#define CM_KEY_NODE_SIGNATURE
VOID NTAPI CmpDelayDerefKeyControlBlock(IN PCM_KEY_CONTROL_BLOCK Kcb)
VOID NTAPI CmpInitDelayDerefKCBEngine(VOID)
VOID NTAPI CmpInitCallback(VOID)
NTSTATUS CmiCallRegisteredCallbacks(IN REG_NOTIFY_CLASS Argument1, IN PVOID Argument2)
NTSTATUS NTAPI CmpAddToHiveFileList(IN PCMHIVE Hive)
VOID NTAPI CmpInitializeCache(VOID)
VOID NTAPI DelistKeyBodyFromKCB(IN PCM_KEY_BODY KeyBody, IN BOOLEAN LockHeld)
PCM_KEY_HASH_TABLE_ENTRY CmpCacheTable
PCM_KEY_CONTROL_BLOCK NTAPI CmpCreateKeyControlBlock(IN PHHIVE Hive, IN HCELL_INDEX Index, IN PCM_KEY_NODE Node, IN PCM_KEY_CONTROL_BLOCK Parent, IN ULONG Flags, IN PUNICODE_STRING KeyName)
PUNICODE_STRING NTAPI CmpConstructName(IN PCM_KEY_CONTROL_BLOCK Kcb)
VOID NTAPI EnlistKeyBodyWithKCB(IN PCM_KEY_BODY KeyBody, IN ULONG Flags)
VOID NTAPI CmpShutdownWorkers(VOID)
#define HvReleaseCell(Hive, Cell)
USHORT NTAPI CmpCopyName(IN PHHIVE Hive, OUT PWCHAR Destination, IN PCUNICODE_STRING Source)
#define CM_CHECK_REGISTRY_DONT_PURGE_VOLATILES
#define CM_CHECK_REGISTRY_PURGE_VOLATILES
USHORT NTAPI CmpNameSize(IN PHHIVE Hive, IN PCUNICODE_STRING Name)
BOOLEAN CMAPI HvSyncHive(PHHIVE RegistryHive)
BOOLEAN CMAPI HvWriteAlternateHive(_In_ PHHIVE RegistryHive)
Writes data to an alternate registry hive. An alternate hive is usually backed up by a primary hive....
#define HvGetCell(Hive, Cell)
HCELL_INDEX CMAPI HvAllocateCell(PHHIVE RegistryHive, ULONG Size, HSTORAGE_TYPE Storage, IN HCELL_INDEX Vicinity)
NTSTATUS NTAPI CmpParseKey(IN PVOID ParseObject, IN PVOID ObjectType, IN OUT PACCESS_STATE AccessState, IN KPROCESSOR_MODE AccessMode, IN ULONG Attributes, IN OUT PUNICODE_STRING CompleteName, IN OUT PUNICODE_STRING RemainingName, IN OUT PVOID Context OPTIONAL, IN PSECURITY_QUALITY_OF_SERVICE SecurityQos OPTIONAL, OUT PVOID *Object)
VOID NTAPI CmpDeleteKeyObject(PVOID DeletedObject)
BOOLEAN NTAPI CmpLinkKeyToHive(_In_z_ PCWSTR LinkKeyName, _In_z_ PCWSTR TargetKeyName)
VOID NTAPI CmpSetVersionData(VOID)
BOOLEAN NTAPI CmpCreateRegistryRoot(VOID)
VOID NTAPI CmpLockRegistryExclusive(VOID)
BOOLEAN NTAPI CmpTestHiveFlusherLockShared(IN PCMHIVE Hive)
VOID NTAPI CmpUnlockRegistry(VOID)
ERESOURCE CmpRegistryLock
LONG CmpFlushStarveWriters
KEVENT CmpLoadWorkerEvent
NTSTATUS NTAPI CmpLinkHiveToMaster(IN PUNICODE_STRING LinkName, IN HANDLE RootDirectory, IN PCMHIVE RegistryHive, IN BOOLEAN Allocate, IN PSECURITY_DESCRIPTOR SecurityDescriptor)
POBJECT_TYPE CmpKeyObjectType
VOID NTAPI CmpLockHiveFlusherExclusive(IN PCMHIVE Hive)
BOOLEAN NTAPI CmpTestHiveFlusherLockExclusive(IN PCMHIVE Hive)
VOID NTAPI CmpAcquireTwoKcbLocksExclusiveByKey(IN ULONG ConvKey1, IN ULONG ConvKey2)
PEPROCESS CmpSystemProcess
static VOID CmpHasAlternateHiveDiverged(_In_ PCUNICODE_STRING FileName, _In_ PCMHIVE CmMainmHive, _In_ HANDLE AlternateHandle, _Out_ PBOOLEAN Diverged)
Checks if the primary and alternate backing hive are the same, by determining the time stamp of both ...
VOID NTAPI CmpReleaseTwoKcbLockByKey(IN ULONG ConvKey1, IN ULONG ConvKey2)
BOOLEAN NTAPI CmInitSystem1(VOID)
VOID NTAPI CmpLockRegistry(VOID)
VOID NTAPI CmpLockHiveFlusherShared(IN PCMHIVE Hive)
NTSTATUS NTAPI CmpCreateObjectTypes(VOID)
NTSTATUS NTAPI CmpCreateControlSet(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
VOID NTAPI CmpInitializeHiveList(VOID)
BOOLEAN CmpSpecialBootCondition
VOID NTAPI CmpCloseKeyObject(IN PEPROCESS Process OPTIONAL, IN PVOID Object, IN ACCESS_MASK GrantedAccess, IN ULONG ProcessHandleCount, IN ULONG SystemHandleCount)
BOOLEAN NTAPI CmpInitializeSystemHive(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
static PCWSTR CmpGetRegistryPath(VOID)
BOOLEAN HvShutdownComplete
BOOLEAN CmpNoVolatileCreates
BOOLEAN NTAPI CmpTestRegistryLockExclusive(VOID)
LIST_ENTRY CmpHiveListHead
NTSTATUS NTAPI CmpInitHiveFromFile(IN PCUNICODE_STRING HiveName, IN ULONG HiveFlags, OUT PCMHIVE *Hive, IN OUT PBOOLEAN New, IN ULONG CheckFlags)
BOOLEAN NTAPI CmpCreateRootNode(IN PHHIVE Hive, IN PCWSTR Name, OUT PHCELL_INDEX Index)
VOID NTAPI CmpUnlockHiveFlusher(IN PCMHIVE Hive)
PVOID CmpRegistryLockCallerCaller
BOOLEAN CmpFlushOnLockRelease
LIST_ENTRY CmpSelfHealQueueListHead
PVOID CmpRegistryLockCaller
NTSTATUS NTAPI CmpQueryKeyName(IN PVOID ObjectBody, IN BOOLEAN HasName, IN OUT POBJECT_NAME_INFORMATION ObjectNameInfo, IN ULONG Length, OUT PULONG ReturnLength, IN KPROCESSOR_MODE PreviousMode)
VOID NTAPI CmShutdownSystem(VOID)
PUNICODE_STRING *NTAPI CmGetSystemDriverList(VOID)
BOOLEAN NTAPI CmpTestRegistryLock(VOID)
LONG CmpLoadWorkerIncrement
KGUARDED_MUTEX CmpSelfHealQueueLock
static NTSTATUS CmpCreateHardwareProfile(HANDLE ControlSetHandle)
NTSTATUS NTAPI CmpSetSystemValues(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
#define NT_SUCCESS(StatCode)
static const WCHAR Cleanup[]
DRIVER_INITIALIZE DriverEntry
IN CINT OUT PVOID IN ULONG OUT PULONG ReturnLength
#define ExAllocatePoolWithTag(hernya, size, tag)
#define IsListEmpty(ListHead)
NTSTATUS ExInitializeResourceLite(PULONG res)
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
#define KeInitializeEvent(pEvt, foo, foo2)
#define KeSetEvent(pEvt, foo, foo2)
#define KeQuerySystemTime(t)
#define ExAcquireResourceExclusiveLite(res, wait)
#define InitializeListHead(ListHead)
#define ExAcquireResourceSharedLite(res, wait)
#define ExInitializePushLock
#define ExAllocatePool(type, size)
struct _FileName FileName
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE FileHandle
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
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 RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE
#define KeGetCurrentThread
NTSTATUS NTAPI NtRaiseHardError(IN NTSTATUS ErrorStatus, IN ULONG NumberOfParameters, IN ULONG UnicodeStringParameterMask, IN PULONG_PTR Parameters, IN ULONG ValidResponseOptions, OUT PULONG Response)
#define HFILE_TYPE_ALTERNATE
#define HFILE_TYPE_PRIMARY
#define HBOOT_BOOT_RECOVERED_BY_HIVE_LOG
#define HBOOT_TYPE_SELF_HEAL
_In_ GUID _In_ PVOID ValueData
#define OBJ_KERNEL_HANDLE
#define OBJ_CASE_INSENSITIVE
NTSYSAPI NTSTATUS WINAPI RtlDuplicateUnicodeString(int, const UNICODE_STRING *, UNICODE_STRING *)
#define EXCEPTION_EXECUTE_HANDLER
#define KeLeaveCriticalRegion()
#define KeEnterCriticalRegion()
PLOADER_PARAMETER_BLOCK KeLoaderBlock
#define ExFreePoolWithTag(_P, _T)
#define InitializeObjectAttributes(p, n, a, r, s)
_In_ UINT _Out_ PNDIS_HANDLE LogHandle
_In_ UINT _In_ UINT BytesToCopy
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
_In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Reserved_ ULONG _In_opt_ PUNICODE_STRING _In_ ULONG _Out_opt_ PULONG Disposition
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL _Inout_ PULONG _Out_writes_bytes_to_opt_ SaclSize PACL _Inout_ PULONG _Out_writes_bytes_to_opt_ OwnerSize PSID Owner
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz(_Out_ PUNICODE_STRING Destination, _In_ PCSZ Source)
#define _Function_class_(n)
#define THREAD_ALL_ACCESS
NTSYSAPI NTSTATUS NTAPI NtOpenKey(OUT PHANDLE KeyHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes)
NTSYSAPI NTSTATUS NTAPI NtSetValueKey(IN HANDLE KeyHandle, IN PUNICODE_STRING ValueName, IN ULONG TitleIndex OPTIONAL, IN ULONG Type, IN PVOID Data, IN ULONG DataSize)
@ KeyValueFullInformation
NTSYSAPI NTSTATUS NTAPI RtlAppendUnicodeStringToString(PUNICODE_STRING Destination, PUNICODE_STRING Source)
NTSYSAPI NTSTATUS NTAPI NtDeleteValueKey(IN HANDLE KeyHandle, IN PUNICODE_STRING ValueName)
#define REG_OPTION_CREATE_LINK
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define KEY_CREATE_SUB_KEY
NTSYSAPI NTSTATUS NTAPI NtQueryValueKey(IN HANDLE KeyHandle, IN PUNICODE_STRING ValueName, IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, IN PVOID KeyValueInformation, IN ULONG Length, IN PULONG ResultLength)
#define REG_CREATED_NEW_KEY
struct _OBJECT_NAME_INFORMATION OBJECT_NAME_INFORMATION
NTSYSAPI NTSTATUS NTAPI RtlIntegerToUnicodeString(ULONG Value, ULONG Base, PUNICODE_STRING String)
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define REG_OPTION_VOLATILE
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
struct _KEY_VALUE_FULL_INFORMATION * PKEY_VALUE_FULL_INFORMATION
NTSTATUS NTAPI NtCreateKey(OUT PHANDLE KeyHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, IN ULONG TitleIndex, IN PUNICODE_STRING Class OPTIONAL, IN ULONG CreateOptions, OUT PULONG Disposition OPTIONAL)
_In_ ULONG _In_ ULONG _In_ ULONG Length
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)
PSECURITY_DESCRIPTOR NTAPI CmpHiveRootSecurityDescriptor(VOID)
NTSTATUS NTAPI CmpSecurityMethod(IN PVOID ObjectBody, IN SECURITY_OPERATION_CODE OperationCode, IN PSECURITY_INFORMATION SecurityInformation, IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor, IN OUT PULONG BufferLength, IN OUT PSECURITY_DESCRIPTOR *OldSecurityDescriptor, IN POOL_TYPE PoolType, IN PGENERIC_MAPPING GenericMapping)
UNICODE_STRING NtSystemRoot
UNICODE_STRING CmVersionString
BOOLEAN ExpInTextModeSetup
UNICODE_STRING CmCSDVersionString
BOOLEAN NTAPI ExAcquireSharedStarveExclusive(IN PERESOURCE Resource, IN BOOLEAN Wait)
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
BOOLEAN NTAPI ExIsResourceAcquiredExclusiveLite(IN PERESOURCE Resource)
ULONG NTAPI ExIsResourceAcquiredSharedLite(IN PERESOURCE Resource)
NTSTATUS NTAPI PsTerminateSystemThread(IN NTSTATUS ExitStatus)
HANDLE NTAPI PsGetCurrentProcessId(VOID)
NTSTATUS NTAPI PsCreateSystemThread(OUT PHANDLE ThreadHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, IN HANDLE ProcessHandle, IN PCLIENT_ID ClientId, IN PKSTART_ROUTINE StartRoutine, IN PVOID StartContext)
#define STATUS_KEY_DELETED
#define STATUS_CANNOT_LOAD_REGISTRY_FILE
NTSTRSAFEVAPI RtlStringCbPrintfW(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cbDest, _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat,...)
NTSTATUS NTAPI ObCloseHandle(IN HANDLE Handle, IN KPROCESSOR_MODE AccessMode)
NTSTATUS NTAPI ObInsertObject(IN PVOID Object, IN PACCESS_STATE AccessState OPTIONAL, IN ACCESS_MASK DesiredAccess, IN ULONG ObjectPointerBias, OUT PVOID *NewObject OPTIONAL, OUT PHANDLE Handle)
NTSTATUS NTAPI ObOpenObjectByName(IN POBJECT_ATTRIBUTES ObjectAttributes, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, IN PACCESS_STATE PassedAccessState, IN ACCESS_MASK DesiredAccess, IN OUT PVOID ParseContext, OUT PHANDLE Handle)
NTSTATUS NTAPI ObCreateObject(IN KPROCESSOR_MODE ProbeMode OPTIONAL, IN POBJECT_TYPE Type, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN KPROCESSOR_MODE AccessMode, IN OUT PVOID ParseContext OPTIONAL, IN ULONG ObjectSize, IN ULONG PagedPoolCharge OPTIONAL, IN ULONG NonPagedPoolCharge OPTIONAL, OUT PVOID *Object)
NTSTATUS NTAPI ObCreateObjectType(IN PUNICODE_STRING TypeName, IN POBJECT_TYPE_INITIALIZER ObjectTypeInitializer, IN PVOID Reserved, OUT POBJECT_TYPE *ObjectType)
NTSTATUS NTAPI ObReferenceObjectByHandle(IN HANDLE Handle, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PVOID *Object, OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL)
#define _SEH2_GetExceptionCode()
#define _SEH2_EXCEPT(...)
VOID NTAPI KeBugCheckEx(_In_ ULONG BugCheckCode, _In_ ULONG_PTR BugCheckParameter1, _In_ ULONG_PTR BugCheckParameter2, _In_ ULONG_PTR BugCheckParameter3, _In_ ULONG_PTR BugCheckParameter4)
PULONG MinorVersion OPTIONAL
HANDLE FileHandles[HFILE_TYPE_MAX]
UNICODE_STRING FileFullPath
struct _CM_NOTIFY_BLOCK * NotifyBlock
struct _CM_KEY_CONTROL_BLOCK * KeyControlBlock
WCHAR Name[ANYSIZE_ARRAY]
HCELL_INDEX SubKeyLists[HTYPE_COUNT]
ULONG SubKeyCounts[HTYPE_COUNT]
LARGE_INTEGER LastWriteTime
CM_KEY_REFERENCE ChildHive
DUAL Storage[HTYPE_COUNT]
struct _LIST_ENTRY * Flink
OB_CLOSE_METHOD CloseProcedure
OB_SECURITY_METHOD SecurityProcedure
GENERIC_MAPPING GenericMapping
ULONG DefaultPagedPoolCharge
OB_DELETE_METHOD DeleteProcedure
OB_QUERYNAME_METHOD QueryNameProcedure
OB_PARSE_METHOD ParseProcedure
#define RTL_CONSTANT_STRING(s)
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_INFO_LENGTH_MISMATCH
#define STATUS_INSUFFICIENT_RESOURCES
static int Link(const char **args)
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG _Out_ PULONG ResultLength
_In_ WDFDEVICE _In_ WDF_SPECIAL_FILE_TYPE FileType
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
BOOL WINAPI EndPath(_In_ HDC)
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID _In_opt_ const WSK_CLIENT_CONNECTION_DISPATCH _In_opt_ PEPROCESS _In_opt_ PETHREAD _In_opt_ PSECURITY_DESCRIPTOR SecurityDescriptor
@ RegNtPostKeyHandleClose
#define ExIsResourceAcquiredShared
_In_opt_ PALLOCATE_FUNCTION Allocate
#define ObDereferenceObject
#define PsGetCurrentProcess
NTSYSAPI VOID NTAPI RtlGetCallersAddress(_Out_ PVOID *CallersAddress, _Out_ PVOID *CallersCaller)
_In_ KPROCESSOR_MODE PreviousMode
_In_ PSECURITY_SUBJECT_CONTEXT _In_ BOOLEAN _In_ ACCESS_MASK _In_ ACCESS_MASK _Outptr_opt_ PPRIVILEGE_SET _In_ PGENERIC_MAPPING _In_ KPROCESSOR_MODE _Out_ PACCESS_MASK GrantedAccess