36 NextName->Buffer =
NULL;
65 if (NextName->Length > 512) NameValid =
FALSE;
66 NextName->MaximumLength = NextName->Length;
93 if (SymbolicKcb->Delete)
return FALSE;
106 if (!LinkValue)
goto Exit;
140 if (!NewBuffer)
goto Exit;
143 NewObjectName.
Buffer = NewBuffer;
256 if (ParseContext->Class.Length > 0)
260 ParseContext->Class.Length,
290 if (ParseContext->Class.Length > 0)
308 ParseContext->Class.Buffer,
309 ParseContext->Class.Length);
317 KeyNode->
Parent = ParentCell;
325 KeyNode->
Class = ClassCell;
361 Status = SeAssignSecurity(ParentDescriptor,
394 if (ParseContext->Class.Length > 0)
HvFreeCell(Hive, ClassCell);
434 if (ParentKcb->Delete)
462 ASSERT(Cell == ParentKcb->KeyCell);
560 if (KeyNode->
MaxClassLen < ParseContext->Class.Length)
680 DPRINT1(
"The real KCB is deleted, attempt a reparse\n");
702 DPRINT(
"The symlink is not found, attempt a reparse\n");
852 DPRINT1(
"Invalid link node attempt\n");
869 if (ParentKcb->Delete)
891 KeyCell =
Context->ChildHive.KeyCell;
908 KeyNode->
Parent = LinkCell;
954 Context->ChildHive.KeyHive->BaseBlock->RootCell = ChildCell;
978 KeyNode->
Parent = LinkCell;
1095 *Hive = (*KeyNode)->ChildHiveReference.KeyHive;
1096 *Cell = (*KeyNode)->ChildHiveReference.KeyCell;
1103 *ReleaseCell = *Cell;
1104 *ReleaseHive = *Hive;
1110 *ReleaseHive =
NULL;
1148 ULONG SubkeysInTotal;
1149 ULONG RemainingSubkeysInTotal;
1150 PWCHAR RemainingNameBuffer;
1151 USHORT RemainingNameLength;
1157 if (RemainingNameLength == 0)
1164 while (RemainingNameLength >=
sizeof(
WCHAR) &&
1167 RemainingNameBuffer++;
1168 RemainingNameLength -=
sizeof(
WCHAR);
1173 RemainingSubkeysInTotal = 0;
1175 CopyConvKey = ConvKey;
1176 HashCacheStack[RemainingSubkeysInTotal].NameOfKey.Buffer = RemainingNameBuffer;
1177 while (RemainingNameLength > 0)
1186 RemainingNameBuffer++;
1188 RemainingNameLength -=
sizeof(
WCHAR);
1195 if (RemainingNameLength == 0)
1199 HashCacheStack[RemainingSubkeysInTotal].NameOfKey.Length =
KeyNameLength;
1200 HashCacheStack[RemainingSubkeysInTotal].NameOfKey.MaximumLength =
KeyNameLength;
1201 HashCacheStack[RemainingSubkeysInTotal].ConvKey = CopyConvKey;
1202 RemainingSubkeysInTotal++;
1211 while (RemainingNameLength >=
sizeof(
WCHAR) &&
1214 RemainingNameBuffer++;
1215 RemainingNameLength -=
sizeof(
WCHAR);
1224 ASSERT(RemainingNameLength != 0);
1232 HashCacheStack[RemainingSubkeysInTotal].NameOfKey.Length =
KeyNameLength;
1233 HashCacheStack[RemainingSubkeysInTotal].NameOfKey.MaximumLength =
KeyNameLength;
1234 HashCacheStack[RemainingSubkeysInTotal].ConvKey = CopyConvKey;
1236 RemainingSubkeysInTotal++;
1247 HashCacheStack[RemainingSubkeysInTotal].NameOfKey.Buffer = RemainingNameBuffer;
1253 *TotalSubKeys = SubkeysInTotal;
1254 return RemainingSubkeysInTotal;
1290 LONG HashStackIndex;
1298 HashStackIndex = RemainingSubkeys;
1299 while (HashStackIndex >= 0)
1302 if (CurrentKcb->ConvKey != HashCacheStack[HashStackIndex].ConvKey)
1304 *ParentKcb = CurrentKcb;
1309 NameBlock = CurrentKcb->NameBlock;
1330 *ParentKcb = CurrentKcb;
1339 *ParentKcb = CurrentKcb->ParentKcb;
1366 ULONG HashStackIndex = 0;
1377 while (HashStackIndex <= RemainingSubkeys)
1379 RemainingName->Buffer += HashCacheStack[HashStackIndex].NameOfKey.Length /
sizeof(
WCHAR);
1380 RemainingName->Length -= HashCacheStack[HashStackIndex].NameOfKey.Length;
1471 LONG RemainingSubkeys;
1483 DPRINT1(
"Could not reference the KCB, too many references (KCB 0x%p)\n", Kcb);
1492 TotalRemainingSubkeys,
1497 RemainingSubkeys = TotalRemainingSubkeys - 1;
1498 TotalLevels = TotalRemainingSubkeys + (*Kcb)->TotalLevels + 1;
1499 while (RemainingSubkeys >= 0)
1527 if (*Kcb == ParentKcb)
1530 if (CurrentKcb->
Delete ||
1539 if (!LockKcbsExclusive)
1543 DPRINT1(
"The current KCB or its parent is deleted, retrying looking in the cache\n");
1554 DPRINT1(
"The current KCB is deleted (KCB 0x%p)\n", CurrentKcb);
1582 KeyFoundInCache =
TRUE;
1596 if (KeyFoundInCache)
1598 DPRINT(
"Key found in cache, stop looking\n");
1607 *MatchRemainSubkeyLevel = RemainingSubkeys + 1;
1610 if (KeyFoundInCache)
1623 DPRINT1(
"Could not reference the KCB, too many references (KCB 0x%p)\n", Kcb);
1710 ULONG SubkeysInTotal, RemainingSubkeysInTotal, MatchRemainingSubkeys;
1714 ASSERT((*Kcb)->RefCount > 0);
1720 ConvKey = (*Kcb)->ConvKey;
1729 DPRINT1(
"The key path has too many subkeys - %lu\n", SubkeysInTotal);
1735 *Hive = (*Kcb)->KeyHive;
1736 *Cell = (*Kcb)->KeyCell;
1739 if (!RemainingSubkeysInTotal && !SubkeysInTotal)
1748 DPRINT1(
"Could not reference the KCB, too many references (KCB 0x%p)\n", Kcb);
1755 OuterStackArray[0] = 1;
1757 *LockedKcbs = OuterStackArray;
1760 *TotalRemainingSubkeys = RemainingSubkeysInTotal;
1761 *MatchRemainSubkeyLevel = 0;
1762 *TotalSubkeys = SubkeysInTotal;
1769 RemainingSubkeysInTotal,
1775 &MatchRemainingSubkeys);
1781 DPRINT1(
"CmpLookInCache() failed (Status 0x%lx)\n",
Status);
1789 RemainingSubkeysInTotal,
1795 &MatchRemainingSubkeys);
1798 DPRINT1(
"CmpLookInCache() failed after retry (Status 0x%lx)\n",
Status);
1813 if (RemainingSubkeysInTotal == MatchRemainingSubkeys)
1820 OuterStackArray[0] = 1;
1822 *LockedKcbs = OuterStackArray;
1834 RemainingSubkeysInTotal,
1835 MatchRemainingSubkeys);
1840 *TotalRemainingSubkeys = RemainingSubkeysInTotal;
1841 *MatchRemainSubkeyLevel = MatchRemainingSubkeys;
1842 *TotalSubkeys = SubkeysInTotal;
1868 ULONG TotalRemainingSubkeys = 0, MatchRemainSubkeyLevel = 0, TotalSubkeys = 0;
1894 ParseContext =
NULL;
1913 &TotalRemainingSubkeys,
1914 &MatchRemainSubkeyLevel,
1921 DPRINT1(
"Failed to look in cache, stop parsing (Status 0x%lx)\n",
Status);
1940 if (!TotalRemainingSubkeys)
1947 DPRINT(
"No remaining subkeys, the KCB points to the actual key\n");
1949 goto KeyCachedOpenNow;
1953 if (MatchRemainSubkeyLevel)
1961 if (MatchRemainSubkeyLevel == TotalSubkeys)
1963 DPRINT(
"We have a full matching level, open the key now\n");
1965 goto KeyCachedOpenNow;
2153 if (Last && ParseContext)
2299 if (LockedKcbs !=
NULL)
#define OBJ_NAME_PATH_SEPARATOR
_Inout_ PFCB _Inout_ PUNICODE_STRING RemainingName
#define CMP_LOCK_KCB_ARRAY_SHARED
#define CM_KCB_KEY_NON_EXIST
#define CMP_KCBS_IN_ARRAY_LIMIT
#define CMP_ENLIST_KCB_LOCKED_SHARED
#define CMP_OPEN_KCB_NO_CREATE
struct _CM_KEY_BODY * PCM_KEY_BODY
#define CM_KCB_SYM_LINK_FOUND
#define CMP_LOCK_HASHES_FOR_KCB
#define CMP_CREATE_KCB_KCB_LOCKED
#define CMP_ENLIST_KCB_LOCKED_EXCLUSIVE
#define CMP_SUBKEY_LEVELS_DEPTH_LIMIT
#define CMP_LOCK_KCB_ARRAY_EXCLUSIVE
#define CM_KCB_READ_ONLY_KEY
#define ASSERT_VALID_HASH(h)
#define GET_HASH_ENTRY(Table, ConvKey)
FORCEINLINE VOID CmpAcquireKcbLockExclusiveByIndex(ULONG Index)
#define GET_HASH_INDEX(ConvKey)
#define CMP_ASSERT_REGISTRY_LOCK()
#define CmpIsKcbLockedExclusive(k)
#define CMP_ASSERT_KCB_LOCK(k)
#define COMPUTE_HASH_CHAR(ConvKey, Char)
#define CmpAcquireKcbLockSharedByIndex(i)
UNICODE_STRING CmSymbolicLinkValueName
struct _CM_KEY_NODE * PCM_KEY_NODE
struct _CM_KEY_VALUE * PCM_KEY_VALUE
#define CM_KEY_NODE_SIGNATURE
#define CM_LINK_NODE_SIGNATURE
VOID NTAPI CmpRemoveFromDelayedClose(IN PCM_KEY_CONTROL_BLOCK Kcb)
BOOLEAN NTAPI CmpAddSubKey(IN PHHIVE Hive, IN HCELL_INDEX Parent, IN HCELL_INDEX Child)
HCELL_INDEX NTAPI CmpFindSubKeyByName(IN PHHIVE Hive, IN PCM_KEY_NODE Parent, IN PCUNICODE_STRING SearchName)
VOID NTAPI CmpCleanUpKcbCacheWithLock(IN PCM_KEY_CONTROL_BLOCK Kcb, IN BOOLEAN LockHeldExclusively)
VOID CmpUnLockKcbArray(_In_ PULONG KcbArray)
Unlocks a number of KCBs provided by a KCB array.
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)
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 CmpCleanUpSubKeyInfo(IN PCM_KEY_CONTROL_BLOCK Kcb)
VOID NTAPI CmpRemoveKeyControlBlock(IN PCM_KEY_CONTROL_BLOCK Kcb)
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)
NTSTATUS NTAPI CmpFreeKeyByCell(IN PHHIVE Hive, IN HCELL_INDEX Cell, IN BOOLEAN Unlink)
#define HvReleaseCell(Hive, Cell)
USHORT NTAPI CmpCopyName(IN PHHIVE Hive, OUT PWCHAR Destination, IN PCUNICODE_STRING Source)
USHORT NTAPI CmpNameSize(IN PHHIVE Hive, IN PCUNICODE_STRING Name)
BOOLEAN NTAPI CmpGetValueData(IN PHHIVE Hive, IN PCM_KEY_VALUE Value, OUT PULONG Length, OUT PVOID *Buffer, OUT PBOOLEAN BufferAllocated, OUT PHCELL_INDEX CellToRelease)
HCELL_INDEX NTAPI CmpFindValueByName(IN PHHIVE Hive, IN PCM_KEY_NODE KeyNode, IN PCUNICODE_STRING Name)
VOID CMAPI HvFreeCell(PHHIVE RegistryHive, HCELL_INDEX CellOffset)
LONG NTAPI CmpCompareCompressedName(IN PCUNICODE_STRING SearchName, IN PWCHAR CompressedName, IN ULONG NameLength)
BOOLEAN CMAPI HvMarkCellDirty(PHHIVE RegistryHive, HCELL_INDEX CellOffset, BOOLEAN HoldingLock)
#define HvGetCell(Hive, Cell)
HCELL_INDEX CMAPI HvAllocateCell(PHHIVE RegistryHive, ULONG Size, HSTORAGE_TYPE Storage, IN HCELL_INDEX Vicinity)
VOID NTAPI CmpReportNotify(IN PCM_KEY_CONTROL_BLOCK Kcb, IN PHHIVE Hive, IN HCELL_INDEX Cell, IN ULONG Filter)
NTSTATUS NTAPI CmpBuildHashStackAndLookupCache(_In_ PCM_KEY_BODY ParseObject, _Inout_ PCM_KEY_CONTROL_BLOCK *Kcb, _In_ PUNICODE_STRING Current, _Out_ PHHIVE *Hive, _Out_ PHCELL_INDEX Cell, _Out_ PULONG TotalRemainingSubkeys, _Out_ PULONG MatchRemainSubkeyLevel, _Out_ PULONG TotalSubkeys, _Inout_ PULONG OuterStackArray, _Out_ PULONG *LockedKcbs)
Builds a hash stack cache and looks up in the pool cache for a matching key pathname.
BOOLEAN NTAPI CmpGetSymbolicLink(IN PHHIVE Hive, IN OUT PUNICODE_STRING ObjectName, IN OUT PCM_KEY_CONTROL_BLOCK SymbolicKcb, IN PUNICODE_STRING RemainingName OPTIONAL)
static NTSTATUS CmpLookInCache(_In_ PCM_HASH_CACHE_STACK HashCacheStack, _In_ BOOLEAN LockKcbsExclusive, _In_ ULONG TotalRemainingSubkeys, _Inout_ PUNICODE_STRING RemainingName, _Inout_ PULONG OuterStackArray, _Inout_ PCM_KEY_CONTROL_BLOCK *Kcb, _Out_ PHHIVE *Hive, _Out_ PHCELL_INDEX Cell, _Out_ PULONG MatchRemainSubkeyLevel)
Looks up in the pool cache for key pathname that matches with one in the said cache and returns a KCB...
static ULONG CmpComputeHashValue(_In_ PUNICODE_STRING RemainingName, _In_ ULONG ConvKey, _Inout_ PCM_HASH_CACHE_STACK HashCacheStack, _Out_ PULONG TotalSubKeys)
Computes the hashes of each subkey in key path name and stores them in a hash stack for cache lookup.
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)
static BOOLEAN CmpCompareSubkeys(_In_ PCM_HASH_CACHE_STACK HashCacheStack, _In_ PCM_KEY_CONTROL_BLOCK CurrentKcb, _In_ ULONG RemainingSubkeys, _Out_ PCM_KEY_CONTROL_BLOCK *ParentKcb)
Compares each subkey's hash and name with those captured in the hash cache stack.
NTSTATUS NTAPI CmpCreateLinkNode(IN PHHIVE Hive, IN HCELL_INDEX Cell, IN PACCESS_STATE AccessState, IN UNICODE_STRING Name, IN KPROCESSOR_MODE AccessMode, IN ULONG CreateOptions, IN PCM_PARSE_CONTEXT Context, IN PCM_KEY_CONTROL_BLOCK ParentKcb, IN PULONG KcbsLocked, OUT PVOID *Object)
static VOID CmpRemoveSubkeysInRemainingName(_In_ PCM_HASH_CACHE_STACK HashCacheStack, _In_ ULONG RemainingSubkeys, _Inout_ PUNICODE_STRING RemainingName)
Removes the subkeys on a remaining key pathname.
NTSTATUS NTAPI CmpDoOpen(IN PHHIVE Hive, IN HCELL_INDEX Cell, IN PCM_KEY_NODE Node, IN PACCESS_STATE AccessState, IN KPROCESSOR_MODE AccessMode, IN ULONG Attributes, IN PCM_PARSE_CONTEXT Context OPTIONAL, IN ULONG ControlFlags, IN OUT PCM_KEY_CONTROL_BLOCK *CachedKcb, IN PULONG KcbsLocked, IN PUNICODE_STRING KeyName, OUT PVOID *Object)
NTSTATUS NTAPI CmpDoCreateChild(IN PHHIVE Hive, IN HCELL_INDEX ParentCell, IN PSECURITY_DESCRIPTOR ParentDescriptor OPTIONAL, IN PACCESS_STATE AccessState, IN PUNICODE_STRING Name, IN KPROCESSOR_MODE AccessMode, IN PCM_PARSE_CONTEXT ParseContext, IN PCM_KEY_CONTROL_BLOCK ParentKcb, IN ULONG Flags, OUT PHCELL_INDEX KeyCell, OUT PVOID *Object)
VOID NTAPI CmpHandleExitNode(IN OUT PHHIVE *Hive, IN OUT HCELL_INDEX *Cell, IN OUT PCM_KEY_NODE *KeyNode, IN OUT PHHIVE *ReleaseHive, IN OUT HCELL_INDEX *ReleaseCell)
NTSTATUS NTAPI CmpDoCreate(IN PHHIVE Hive, IN HCELL_INDEX Cell, IN PACCESS_STATE AccessState, IN PUNICODE_STRING Name, IN KPROCESSOR_MODE AccessMode, IN PCM_PARSE_CONTEXT ParseContext, IN PCM_KEY_CONTROL_BLOCK ParentKcb, OUT PVOID *Object)
BOOLEAN NTAPI CmpGetNextName(IN OUT PUNICODE_STRING RemainingName, OUT PUNICODE_STRING NextName, OUT PBOOLEAN LastName)
VOID NTAPI CmpUnlockRegistry(VOID)
VOID NTAPI CmpLockRegistry(VOID)
VOID NTAPI CmpLockHiveFlusherShared(IN PCMHIVE Hive)
BOOLEAN CmpNoVolatileCreates
VOID NTAPI CmpUnlockHiveFlusher(IN PCMHIVE Hive)
#define NT_SUCCESS(StatCode)
#define ExAllocatePoolWithTag(hernya, size, tag)
ULONG RtlCompareUnicodeString(PUNICODE_STRING s1, PUNICODE_STRING s2, BOOLEAN UpCase)
#define KeQuerySystemTime(t)
#define KeGetCurrentThread
#define HIVE_IS_UNLOADING
#define HvGetCellType(Cell)
NTSYSAPI NTSTATUS NTAPI RtlAppendUnicodeStringToString(PUNICODE_STRING Destination, PUNICODE_STRING Source)
#define REG_OPTION_CREATE_LINK
#define REG_CREATED_NEW_KEY
#define REG_OPENED_EXISTING_KEY
#define REG_OPTION_VOLATILE
_In_ ULONG _In_ ULONG _In_ ULONG Length
NTSTATUS CmpAssignSecurityDescriptor(IN PCM_KEY_CONTROL_BLOCK Kcb, IN PSECURITY_DESCRIPTOR SecurityDescriptor)
HANDLE NTAPI PsGetCurrentProcessId(VOID)
#define STATUS_KEY_DELETED
#define STATUS_NOT_IMPLEMENTED
#define STATUS_CHILD_MUST_BE_VOLATILE
#define STATUS_NAME_TOO_LONG
#define STATUS_OBJECT_TYPE_MISMATCH
BOOLEAN NTAPI ObCheckObjectAccess(IN PVOID Object, IN OUT PACCESS_STATE AccessState, IN BOOLEAN LockHeld, IN KPROCESSOR_MODE AccessMode, OUT PNTSTATUS ReturnedStatus)
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)
VOID NTAPI ObDereferenceObjectDeferDelete(IN PVOID Object)
SECURITY_INTEGER TimeStamp
PULONG MinorVersion OPTIONAL
struct _CM_KEY_CONTROL_BLOCK * RealKcb
union _CELL_DATA::@4299 u
WCHAR KeyString[ANYSIZE_ARRAY]
struct _CM_NOTIFY_BLOCK * NotifyBlock
struct _CM_KEY_CONTROL_BLOCK * KeyControlBlock
struct _CM_KEY_CONTROL_BLOCK * ParentKcb
CACHED_CHILD_LIST ValueCache
CM_KEY_REFERENCE ChildHiveReference
WCHAR Name[ANYSIZE_ARRAY]
HCELL_INDEX SubKeyLists[HTYPE_COUNT]
ULONG SubKeyCounts[HTYPE_COUNT]
LARGE_INTEGER LastWriteTime
WCHAR Name[ANYSIZE_ARRAY]
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlMoveMemory(Destination, Source, Length)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_ACCESS_DENIED
#define STATUS_INVALID_PARAMETER
#define STATUS_UNSUCCESSFUL
#define STATUS_OBJECT_NAME_COLLISION
#define STATUS_INSUFFICIENT_RESOURCES
#define STATUS_OBJECT_NAME_NOT_FOUND
_In_ ULONG _In_ ULONG KeyNameLength
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
_Must_inspect_result_ _In_opt_ WDFKEY _In_ PCUNICODE_STRING _In_ ACCESS_MASK _In_ ULONG CreateOptions
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _In_ ULONG ValueLength
#define REG_NOTIFY_CHANGE_NAME
_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
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
_Must_inspect_result_ _In_ ULONG Flags
_In_ PVOID _Out_opt_ PULONG_PTR _Outptr_opt_ PCUNICODE_STRING * ObjectName
_In_ PEPROCESS _In_ KPROCESSOR_MODE AccessMode
#define ObDereferenceObject
_In_opt_ PVOID _In_opt_ PUNICODE_STRING _In_ PSECURITY_DESCRIPTOR _In_ PACCESS_STATE AccessState
_In_opt_ PSECURITY_DESCRIPTOR _Out_ PSECURITY_DESCRIPTOR * NewDescriptor