120 if (IsFake)
KeyHash->KeyCell++;
160 p = NodeName->Buffer;
161 for (
i = 0;
i < NodeName->Length;
i +=
sizeof(
WCHAR))
176 for (
i = 0;
i < (NodeName->Length /
sizeof(
WCHAR));
i++)
179 if (NodeName->Buffer[
i] > (
UCHAR)-1)
182 Length = NodeName->Length;
183 IsCompressed =
FALSE;
217 p = NodeName->Buffer;
269 for (
i = 0;
i < NodeName->Length /
sizeof(
WCHAR);
i++)
278 for (
i = 0;
i < NodeName->Length /
sizeof(
WCHAR);
i++)
326 ASSERT(Ncb->RefCount >= 1);
327 if (!(--Ncb->RefCount))
336 if (Current == &Ncb->NameHash)
363 if (Kcb->RefCount == 0)
372 Kcb->DelayedCloseIndex = 1;
384 if (Kcb->DelayedCloseIndex == 1)
387 Kcb->DelayedCloseIndex = 0;
393 (Kcb->DelayedCloseIndex == 0));
408 if (!Kcb->DelayedCloseIndex)
444 for (
i = 0;
i < Kcb->ValueCache.Count;
i++)
461 if ((Kcb->ValueCache.RealKcb->RefCount == 1) &&
462 !(Kcb->ValueCache.RealKcb->Delete))
470 Kcb->ExtFlags &= ~CM_KCB_SYM_LINK_FOUND;
484 ASSERT(Kcb->RefCount == 0);
509 LockHeldExclusively ?
560 Kcb->ExtFlags &= ~CM_KCB_INVALID_CACHED_INFO;
573 LONG OldRefCount, NewRefCount;
579 OldRefCount = *(
PLONG)&Kcb->RefCount;
580 NewRefCount = OldRefCount - 1;
583 if ((NewRefCount & 0xFFFF) > 0)
588 OldRefCount) == OldRefCount)
596 ConvKey = Kcb->ConvKey;
647 Kcb->KeyBodyArray[0] =
648 Kcb->KeyBodyArray[1] =
649 Kcb->KeyBodyArray[2] =
650 Kcb->KeyBodyArray[3] =
NULL;
713 if (!Kcb)
return NULL;
787 Kcb->
ExtFlags &= ~CM_KCB_INVALID_CACHED_INFO;
803 if (((
Parent->TotalLevels + 1) < 512) &&
905 PWCHAR TargetBuffer, CurrentNameW;
926 NameLength +=
sizeof(
WCHAR);
942 KeyName->MaximumLength = NameLength;
962 if (!DeletedKey && !MyKcb->
Delete)
997 CurrentNameW = KeyNode->
Name;
1003 TargetBuffer[
i+1] = *CurrentNameW;
1023 TargetBuffer[
i+1] = (
WCHAR)*CurrentName;
1054 for (
i = 0;
i < 4;
i++)
1087 &KeyBody->KeyBodyList);
1109 for (
i = 0;
i < 4;
i++)
1115 KeyBody) == KeyBody)
1151 for (
i = KcbArray[0];
i > 0;
i--)
1184 for (
i = 1;
i <= KcbArray[0];
i++)
1217 KcbCount = KcbArray[0];
1221 for (
i = 1;
i <= KcbCount;
i++)
1223 for (
j =
i + 1;
j <= KcbCount;
j++)
1225 if (KcbArray[
i] > KcbArray[
j])
1227 ULONG Temp = KcbArray[
i];
1228 KcbArray[
i] = KcbArray[
j];
1235 for (
i = 1;
i <= KcbCount;
i++)
1237 for (
j =
i + 1;
j <= KcbCount;
j++)
1239 if (KcbArray[
i] == KcbArray[
j])
1241 for (
k =
j;
k <= KcbCount;
k++)
1243 KcbArray[
k - 1] = KcbArray[
k];
1253 KcbArray[0] = KcbCount;
1310 ULONG KcbIndex = 1, HashStackIndex, TotalRemaining;
1325 TotalRemaining = (1 + TotalRemainingSubkeys) - MatchRemainSubkeyLevel;
1332 if (TotalRemainingSubkeys == MatchRemainSubkeyLevel)
1344 for (HashStackIndex = 0;
1345 HashStackIndex < TotalRemainingSubkeys;
1348 OuterStackArray[KcbIndex++] =
GET_HASH_INDEX(HashCacheStack[HashStackIndex].ConvKey);
1355 OuterStackArray[0] = KcbIndex - 1;
1362 LockedKcbs = OuterStackArray;
1379 ListHead = &Kcb->KeyBodyListHead;
1383 NextEntry = ListHead->
Flink;
1384 while (NextEntry != ListHead)
1416 NextEntry = NextEntry->
Flink;
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn UINT32 *TableIdx UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE Parent
#define OBJ_NAME_PATH_SEPARATOR
#define InterlockedIncrement
#define InterlockedDecrement
PVOID NTAPI CmpAllocate(_In_ SIZE_T Size, _In_ BOOLEAN Paged, _In_ ULONG Tag)
VOID NTAPI CmpFree(_In_ PVOID Ptr, _In_ ULONG Quota)
#define CM_KCB_SUBKEY_ONE
#define CM_KCB_NO_DELAY_CLOSE
#define CM_KCB_KEY_NON_EXIST
#define CMP_KCBS_IN_ARRAY_LIMIT
#define CM_KCB_SUBKEY_HINT
#define CMTRACE(x, fmt,...)
#define CMP_CREATE_FAKE_KCB
#define CM_KCB_INVALID_SIGNATURE
#define CMP_ENLIST_KCB_LOCKED_SHARED
#define CM_KCB_SYM_LINK_FOUND
#define CMP_LOCK_HASHES_FOR_KCB
#define CM_KCB_INVALID_CACHED_INFO
struct _CM_NAME_HASH_TABLE_ENTRY CM_NAME_HASH_TABLE_ENTRY
#define CMP_ENLIST_KCB_LOCKED_EXCLUSIVE
#define CM_REFERENCE_DEBUG
struct _CM_KEY_HASH_TABLE_ENTRY CM_KEY_HASH_TABLE_ENTRY
#define CMP_LOCK_KCB_ARRAY_EXCLUSIVE
FORCEINLINE VOID CmpAcquireKcbLockExclusive(PCM_KEY_CONTROL_BLOCK Kcb)
#define CMP_ASSERT_EXCLUSIVE_REGISTRY_LOCK()
#define CmpReleaseNcbLockByKey(k)
#define ASSERT_KCB_VALID(k)
#define ASSERT_VALID_HASH(h)
#define GET_HASH_ENTRY(Table, ConvKey)
#define CMP_GET_CACHED_DATA(c)
FORCEINLINE VOID CmpAcquireKcbLockExclusiveByIndex(ULONG Index)
#define CMP_GET_CACHED_CELL(c)
#define GET_HASH_INDEX(ConvKey)
FORCEINLINE VOID CmpReleaseKcbLockByKey(ULONG ConvKey)
#define CmpAcquireNcbLockExclusiveByKey(k)
#define CMP_IS_CELL_CACHED(c)
#define CmpIsKcbLockedExclusive(k)
#define CMP_ASSERT_KCB_LOCK(k)
FORCEINLINE VOID CmpConvertKcbSharedToExclusive(IN PCM_KEY_CONTROL_BLOCK k)
#define COMPUTE_HASH_CHAR(ConvKey, Char)
FORCEINLINE VOID CmpReleaseKcbLockByIndex(ULONG Index)
FORCEINLINE VOID CmpReleaseKcbLock(PCM_KEY_CONTROL_BLOCK Kcb)
FORCEINLINE BOOLEAN CmpTryToConvertKcbSharedToExclusive(IN PCM_KEY_CONTROL_BLOCK k)
#define CmpAcquireKcbLockSharedByIndex(i)
VOID NTAPI CmpFreeKeyControlBlock(IN PCM_KEY_CONTROL_BLOCK Kcb)
PCM_KEY_CONTROL_BLOCK NTAPI CmpAllocateKeyControlBlock(VOID)
struct _CM_KEY_NODE * PCM_KEY_NODE
VOID NTAPI CmpAddToDelayedClose(IN PCM_KEY_CONTROL_BLOCK Kcb, IN BOOLEAN LockHeldExclusively)
VOID NTAPI CmpDelayDerefKeyControlBlock(IN PCM_KEY_CONTROL_BLOCK Kcb)
ULONG CmpDelayedCloseSize
VOID NTAPI CmpRemoveFromDelayedClose(IN PCM_KEY_CONTROL_BLOCK Kcb)
VOID NTAPI CmpInitializeDelayedCloseTable(VOID)
PCM_KEY_CONTROL_BLOCK NTAPI CmpInsertKeyHash(IN PCM_KEY_HASH KeyHash, IN BOOLEAN IsFake)
VOID NTAPI CmpCleanUpKcbCacheWithLock(IN PCM_KEY_CONTROL_BLOCK Kcb, IN BOOLEAN LockHeldExclusively)
PCM_NAME_CONTROL_BLOCK NTAPI CmpGetNameControlBlock(IN PUNICODE_STRING NodeName)
VOID NTAPI CmpInitializeCache(VOID)
VOID CmpUnLockKcbArray(_In_ PULONG KcbArray)
Unlocks a number of KCBs provided by a KCB array.
VOID NTAPI DelistKeyBodyFromKCB(IN PCM_KEY_BODY KeyBody, IN BOOLEAN LockHeld)
PCM_KEY_HASH_TABLE_ENTRY CmpCacheTable
BOOLEAN NTAPI CmpReferenceKeyControlBlock(IN PCM_KEY_CONTROL_BLOCK Kcb)
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)
static VOID CmpSortKcbArray(_Inout_ PULONG KcbArray)
Sorts an array of KCB hashes in ascending order and removes any key indices that are duplicates....
VOID NTAPI CmpCleanUpKcbValueCache(IN PCM_KEY_CONTROL_BLOCK Kcb)
VOID NTAPI CmpDereferenceKeyControlBlockWithLock(IN PCM_KEY_CONTROL_BLOCK Kcb, IN BOOLEAN LockHeldExclusively)
VOID NTAPI CmpDereferenceKeyControlBlock(IN PCM_KEY_CONTROL_BLOCK Kcb)
VOID NTAPI InitializeKCBKeyBodyList(IN PCM_KEY_CONTROL_BLOCK Kcb)
PUNICODE_STRING NTAPI CmpConstructName(IN PCM_KEY_CONTROL_BLOCK Kcb)
VOID NTAPI CmpFlushNotifiesOnKeyBodyList(IN PCM_KEY_CONTROL_BLOCK Kcb, IN BOOLEAN LockHeld)
VOID NTAPI CmpDereferenceNameControlBlockWithLock(IN PCM_NAME_CONTROL_BLOCK Ncb)
PCM_NAME_HASH_TABLE_ENTRY CmpNameCacheTable
VOID NTAPI CmpCleanUpSubKeyInfo(IN PCM_KEY_CONTROL_BLOCK Kcb)
VOID NTAPI CmpRemoveKeyControlBlock(IN PCM_KEY_CONTROL_BLOCK Kcb)
static VOID CmpLockKcbArray(_In_ PULONG KcbArray, _In_ ULONG KcbLockFlags)
Locks a given number of KCBs.
PULONG NTAPI CmpBuildAndLockKcbArray(_In_ PCM_HASH_CACHE_STACK HashCacheStack, _In_ ULONG KcbLockFlags, _In_ PCM_KEY_CONTROL_BLOCK Kcb, _Inout_ PULONG OuterStackArray, _In_ ULONG TotalRemainingSubkeys, _In_ ULONG MatchRemainSubkeyLevel)
Builds an array of KCBs and locks them. Whether these KCBs are locked exclusively or in shared mode b...
VOID NTAPI EnlistKeyBodyWithKCB(IN PCM_KEY_BODY KeyBody, IN ULONG Flags)
VOID NTAPI CmpRemoveKeyHash(IN PCM_KEY_HASH KeyHash)
#define HvReleaseCell(Hive, Cell)
LONG NTAPI CmpCompareCompressedName(IN PCUNICODE_STRING SearchName, IN PWCHAR CompressedName, IN ULONG NameLength)
USHORT NTAPI CmpCompressedNameSize(IN PWCHAR Name, IN ULONG Length)
#define HvGetCell(Hive, Cell)
VOID NTAPI CmpFlushNotify(IN PCM_KEY_BODY KeyBody, IN BOOLEAN LockHeld)
VOID NTAPI CmpAcquireTwoKcbLocksExclusiveByKey(IN ULONG ConvKey1, IN ULONG ConvKey2)
VOID NTAPI CmpReleaseTwoKcbLockByKey(IN ULONG ConvKey1, IN ULONG ConvKey2)
#define RemoveEntryList(Entry)
#define InsertTailList(ListHead, Entry)
#define IsListEmpty(ListHead)
#define InitializeListHead(ListHead)
#define ExInitializePushLock
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
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 GLint GLint j
#define KeGetCurrentThread
#define HIVE_IS_UNLOADING
#define InterlockedCompareExchangePointer
#define InterlockedCompareExchange
WCHAR NTAPI RtlUpcaseUnicodeChar(_In_ WCHAR Source)
_In_ ULONG _In_ ULONG _In_ ULONG Length
BOOLEAN FASTCALL ObReferenceObjectSafe(IN PVOID Object)
VOID NTAPI ObDereferenceObjectDeferDelete(IN PVOID Object)
VOID NTAPI KeBugCheckEx(_In_ ULONG BugCheckCode, _In_ ULONG_PTR BugCheckParameter1, _In_ ULONG_PTR BugCheckParameter2, _In_ ULONG_PTR BugCheckParameter3, _In_ ULONG_PTR BugCheckParameter4)
base of all file and directory entries
struct _CM_NOTIFY_BLOCK * NotifyBlock
USHORT KcbMaxValueNameLen
PCM_NAME_CONTROL_BLOCK NameBlock
struct _CM_KEY_CONTROL_BLOCK * ParentKcb
LARGE_INTEGER KcbLastWriteTime
CACHED_CHILD_LIST ValueCache
struct _CM_KEY_HASH * NextHash
WCHAR Name[ANYSIZE_ARRAY]
ULONG SubKeyCounts[HTYPE_COUNT]
WCHAR Name[ANYSIZE_ARRAY]
struct _CM_NAME_HASH * NextHash
struct _LIST_ENTRY * Flink
#define FIELD_OFFSET(t, f)
#define RtlZeroMemory(Destination, Length)
#define CONTAINING_RECORD(address, type, field)
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
_Must_inspect_result_ _In_ ULONG Flags