7 _Out_ PLIST_ENTRY ListHead
10 ListHead->Flink = ListHead->Blink = ListHead;
14 _In_ PLIST_ENTRY ListHead
17 return ListHead->Flink == ListHead;
21 _In_ PLIST_ENTRY Entry
32 return Flink == Blink;
36 _Inout_ PLIST_ENTRY ListHead
42 Entry = ListHead->Flink;
44 ListHead->Flink = Flink;
45 Flink->Blink = ListHead;
51 _Inout_ PLIST_ENTRY ListHead
57 Entry = ListHead->Blink;
59 ListHead->Blink = Blink;
60 Blink->Flink = ListHead;
66 _Inout_ PLIST_ENTRY ListHead,
67 _Inout_ PLIST_ENTRY Entry
72 Blink = ListHead->Blink;
73 Entry->Flink = ListHead;
76 ListHead->Blink = Entry;
80 _Inout_ PLIST_ENTRY ListHead,
81 _Inout_ PLIST_ENTRY Entry
86 Flink = ListHead->Flink;
88 Entry->Blink = ListHead;
90 ListHead->Flink = Entry;
94 _Inout_ PLIST_ENTRY ListHead,
95 _Inout_ PLIST_ENTRY ListToAppend
98 PLIST_ENTRY ListEnd = ListHead->Blink;
100 ListHead->Blink->Flink = ListToAppend;
101 ListHead->Blink = ListToAppend->Blink;
102 ListToAppend->Blink->Flink = ListHead;
103 ListToAppend->Blink = ListEnd;
107 _Inout_ PSINGLE_LIST_ENTRY ListHead
110 PSINGLE_LIST_ENTRY FirstEntry;
112 FirstEntry = ListHead->Next;
115 ListHead->Next = FirstEntry->Next;
121 _Inout_ PSINGLE_LIST_ENTRY ListHead,
122 _Inout_ PSINGLE_LIST_ENTRY Entry
125 Entry->Next = ListHead->Next;
126 ListHead->Next = Entry;
159 _In_ _Post_invalid_ PVOID Buffer
196 _Out_ PRTL_AVL_TABLE Table,
200 _In_opt_ PVOID TableContext
207 _In_ PRTL_AVL_TABLE Table,
208 _In_reads_bytes_(BufferSize) PVOID Buffer,
209 _In_
CLONG BufferSize,
210 _Out_opt_ PBOOLEAN NewElement
217 _In_ PRTL_AVL_TABLE Table,
218 _In_reads_bytes_(BufferSize) PVOID Buffer,
219 _In_
CLONG BufferSize,
220 _Out_opt_ PBOOLEAN NewElement,
221 _In_ PVOID NodeOrParent,
229 _In_ PRTL_AVL_TABLE Table,
238 _In_ PRTL_AVL_TABLE Table,
246 _In_ PRTL_AVL_TABLE Table,
248 _Out_ PVOID *NodeOrParent,
257 _In_ PRTL_AVL_TABLE Table,
266 _In_ PRTL_AVL_TABLE Table,
267 _Inout_ PVOID *RestartKey
275 _In_ PRTL_AVL_TABLE Table,
277 _Out_ PVOID *RestartKey
285 _In_ PRTL_AVL_TABLE Table,
287 _In_opt_ PVOID MatchData,
289 _Inout_ PVOID *RestartKey,
290 _Inout_ PULONG DeleteCount,
299 _In_ PRTL_AVL_TABLE Table,
307 _In_ PRTL_AVL_TABLE Table
315 _In_ PRTL_AVL_TABLE Table
325 #define RtlInitializeSplayLinks(Links) \
327 PRTL_SPLAY_LINKS _SplayLinks; \
328 _SplayLinks = (PRTL_SPLAY_LINKS)(Links); \
329 _SplayLinks->Parent = _SplayLinks; \
330 _SplayLinks->LeftChild = NULL; \
331 _SplayLinks->RightChild = NULL; \
334 #define RtlParent(Links) ((PRTL_SPLAY_LINKS)(Links)->Parent)
335 #define RtlLeftChild(Links) ((PRTL_SPLAY_LINKS)(Links)->LeftChild)
336 #define RtlRightChild(Links) ((PRTL_SPLAY_LINKS)(Links)->RightChild)
337 #define RtlIsRoot(Links) ((RtlParent(Links) == (PRTL_SPLAY_LINKS)(Links)))
338 #define RtlIsLeftChild(Links) ((RtlLeftChild(RtlParent(Links)) == (PRTL_SPLAY_LINKS)(Links)))
339 #define RtlIsRightChild(Links) ((RtlRightChild(RtlParent(Links)) == (PRTL_SPLAY_LINKS)(Links)))
341 #define RtlInsertAsLeftChild(ParentLinks, ChildLinks) \
343 PRTL_SPLAY_LINKS _SplayParent; \
344 PRTL_SPLAY_LINKS _SplayChild; \
345 _SplayParent = (PRTL_SPLAY_LINKS)(ParentLinks); \
346 _SplayChild = (PRTL_SPLAY_LINKS)(ChildLinks); \
347 _SplayParent->LeftChild = _SplayChild; \
348 _SplayChild->Parent = _SplayParent; \
351 #define RtlInsertAsRightChild(ParentLinks, ChildLinks) \
353 PRTL_SPLAY_LINKS _SplayParent; \
354 PRTL_SPLAY_LINKS _SplayChild; \
355 _SplayParent = (PRTL_SPLAY_LINKS)(ParentLinks); \
356 _SplayChild = (PRTL_SPLAY_LINKS)(ChildLinks); \
357 _SplayParent->RightChild = _SplayChild; \
358 _SplayChild->Parent = _SplayParent; \
365 _Inout_ PRTL_SPLAY_LINKS Links
372 _In_ PRTL_SPLAY_LINKS Links
379 _In_ PRTL_SPLAY_LINKS Links,
380 _Inout_ PRTL_SPLAY_LINKS *Root
388 _In_ PRTL_SPLAY_LINKS Links
396 _In_ PRTL_SPLAY_LINKS Links
404 _In_ PRTL_SPLAY_LINKS Links
412 _In_ PRTL_SPLAY_LINKS Links
430 _In_ _Post_invalid_ PVOID Buffer
450 _Out_ PRTL_GENERIC_TABLE Table,
451 _In_ PRTL_GENERIC_COMPARE_ROUTINE CompareRoutine,
454 _In_opt_ PVOID TableContext
461 _In_ PRTL_GENERIC_TABLE Table,
462 _In_reads_bytes_(BufferSize) PVOID Buffer,
463 _In_
CLONG BufferSize,
464 _Out_opt_ PBOOLEAN NewElement
471 _In_ PRTL_GENERIC_TABLE Table,
472 _In_reads_bytes_(BufferSize) PVOID Buffer,
473 _In_
CLONG BufferSize,
474 _Out_opt_ PBOOLEAN NewElement,
475 _In_ PVOID NodeOrParent,
483 _In_ PRTL_GENERIC_TABLE Table,
492 _In_ PRTL_GENERIC_TABLE Table,
500 _In_ PRTL_GENERIC_TABLE Table,
502 _Out_ PVOID *NodeOrParent,
511 _In_ PRTL_GENERIC_TABLE Table,
520 _In_ PRTL_GENERIC_TABLE Table,
521 _Inout_ PVOID *RestartKey
529 _In_ PRTL_GENERIC_TABLE Table,
537 _In_ PRTL_GENERIC_TABLE Table
545 _In_ PRTL_GENERIC_TABLE Table
556 #if (PHNT_VERSION >= PHNT_WIN8)
563 _In_ PRTL_RB_TREE Tree,
574 _In_ PRTL_RB_TREE Tree,
584 #define RTL_HASH_ALLOCATED_HEADER 0x00000001
585 #define RTL_HASH_RESERVED_SIGNATURE 0
593 #define HASH_ENTRY_KEY(x) ((x)->Signature)
629 #if (PHNT_VERSION >= PHNT_WIN7)
634 _Inout_ PRTL_DYNAMIC_HASH_TABLE_CONTEXT Context
637 Context->ChainHead = NULL;
638 Context->PrevLinkage = NULL;
644 _Inout_ PRTL_DYNAMIC_HASH_TABLE_CONTEXT Context,
645 _In_ PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator
648 Context->ChainHead = Enumerator->ChainHead;
649 Context->PrevLinkage = Enumerator->HashEntry.Linkage.Blink;
655 _Inout_ PRTL_DYNAMIC_HASH_TABLE_CONTEXT Context
658 UNREFERENCED_PARAMETER(Context);
665 _In_ PRTL_DYNAMIC_HASH_TABLE HashTable
668 return HashTable->TableSize;
674 _In_ PRTL_DYNAMIC_HASH_TABLE HashTable
677 return HashTable->NonEmptyBuckets;
683 _In_ PRTL_DYNAMIC_HASH_TABLE HashTable
686 return HashTable->TableSize - HashTable->NonEmptyBuckets;
692 _In_ PRTL_DYNAMIC_HASH_TABLE HashTable
695 return HashTable->NumEntries;
701 _In_ PRTL_DYNAMIC_HASH_TABLE HashTable
704 return HashTable->NumEnumerators;
707 _Must_inspect_result_
712 _Inout_
_When_(*HashTable == NULL, __drv_allocatesMem(Mem)) PRTL_DYNAMIC_HASH_TABLE *HashTable,
714 _In_ _Reserved_ ULONG Flags
721 _In_ PRTL_DYNAMIC_HASH_TABLE HashTable
728 _In_ PRTL_DYNAMIC_HASH_TABLE HashTable,
729 _In_ PRTL_DYNAMIC_HASH_TABLE_ENTRY Entry,
730 _In_ ULONG_PTR Signature,
731 _Inout_opt_ PRTL_DYNAMIC_HASH_TABLE_CONTEXT Context
738 _In_ PRTL_DYNAMIC_HASH_TABLE HashTable,
739 _In_ PRTL_DYNAMIC_HASH_TABLE_ENTRY Entry,
740 _Inout_opt_ PRTL_DYNAMIC_HASH_TABLE_CONTEXT Context
743 _Must_inspect_result_
745 PRTL_DYNAMIC_HASH_TABLE_ENTRY
748 _In_ PRTL_DYNAMIC_HASH_TABLE HashTable,
749 _In_ ULONG_PTR Signature,
750 _Out_opt_ PRTL_DYNAMIC_HASH_TABLE_CONTEXT Context
753 _Must_inspect_result_
755 PRTL_DYNAMIC_HASH_TABLE_ENTRY
758 _In_ PRTL_DYNAMIC_HASH_TABLE HashTable,
759 _In_ PRTL_DYNAMIC_HASH_TABLE_CONTEXT Context
766 _In_ PRTL_DYNAMIC_HASH_TABLE HashTable,
767 _Out_ PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator
770 _Must_inspect_result_
772 PRTL_DYNAMIC_HASH_TABLE_ENTRY
775 _In_ PRTL_DYNAMIC_HASH_TABLE HashTable,
776 _Inout_ PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator
783 _In_ PRTL_DYNAMIC_HASH_TABLE HashTable,
784 _Inout_ PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator
791 _In_ PRTL_DYNAMIC_HASH_TABLE HashTable,
792 _Out_ PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator
795 _Must_inspect_result_
797 PRTL_DYNAMIC_HASH_TABLE_ENTRY
800 _In_ PRTL_DYNAMIC_HASH_TABLE HashTable,
801 _Inout_ PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator
808 _In_ PRTL_DYNAMIC_HASH_TABLE HashTable,
809 _Inout_ PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator
816 _In_ PRTL_DYNAMIC_HASH_TABLE HashTable
823 _In_ PRTL_DYNAMIC_HASH_TABLE HashTable
828 #if (PHNT_VERSION >= PHNT_THRESHOLD)
834 _In_ PRTL_DYNAMIC_HASH_TABLE HashTable,
835 _Out_ PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator
838 _Must_inspect_result_
840 PRTL_DYNAMIC_HASH_TABLE_ENTRY
843 _In_ PRTL_DYNAMIC_HASH_TABLE HashTable,
844 _Inout_ PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator
851 _In_ PRTL_DYNAMIC_HASH_TABLE HashTable,
852 _Inout_ PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator
933 #if (PHNT_VERSION >= PHNT_VISTA)
939 _In_ HANDLE EventHandle
969 #define RTL_RESOURCE_FLAG_LONG_TERM ((ULONG)0x00000001)
975 _Out_ PRTL_RESOURCE Resource
982 _Inout_ PRTL_RESOURCE Resource
989 _Inout_ PRTL_RESOURCE Resource,
997 _Inout_ PRTL_RESOURCE Resource,
1005 _Inout_ PRTL_RESOURCE Resource
1012 _Inout_ PRTL_RESOURCE Resource
1019 _Inout_ PRTL_RESOURCE Resource
1024 #if (PHNT_VERSION >= PHNT_VISTA)
1031 _Out_ PRTL_SRWLOCK SRWLock
1039 _Inout_ PRTL_SRWLOCK SRWLock
1047 _Inout_ PRTL_SRWLOCK SRWLock
1055 _Inout_ PRTL_SRWLOCK SRWLock
1063 _Inout_ PRTL_SRWLOCK SRWLock
1071 _Inout_ PRTL_SRWLOCK SRWLock
1079 _Inout_ PRTL_SRWLOCK SRWLock
1082 #if (PHNT_VERSION >= PHNT_WIN7)
1088 _Inout_ PRTL_SRWLOCK SRWLock
1094 #if (PHNT_VERSION >= PHNT_VISTA)
1101 _Out_ PRTL_CONDITION_VARIABLE ConditionVariable
1109 _Inout_ PRTL_CONDITION_VARIABLE ConditionVariable,
1111 _In_opt_ PLARGE_INTEGER Timeout
1119 _Inout_ PRTL_CONDITION_VARIABLE ConditionVariable,
1120 _Inout_ PRTL_SRWLOCK SRWLock,
1121 _In_opt_ PLARGE_INTEGER Timeout,
1130 _Inout_ PRTL_CONDITION_VARIABLE ConditionVariable
1138 _Inout_ PRTL_CONDITION_VARIABLE ConditionVariable
1144 #define RTL_BARRIER_FLAGS_SPIN_ONLY 0x00000001 // never block on event - always spin
1145 #define RTL_BARRIER_FLAGS_BLOCK_ONLY 0x00000002 // always block on event - never spin
1146 #define RTL_BARRIER_FLAGS_NO_DELETE 0x00000004 // use if barrier will never be deleted
1151 #if (PHNT_VERSION >= PHNT_VISTA)
1157 _Out_ PRTL_BARRIER Barrier,
1158 _In_ ULONG TotalThreads,
1159 _In_ ULONG SpinCount
1166 _In_ PRTL_BARRIER Barrier
1173 _Inout_ PRTL_BARRIER Barrier,
1181 _Inout_ PRTL_BARRIER Barrier,
1191 #ifndef PHNT_NO_INLINE_INIT_STRING
1193 _Out_
PSTRING DestinationString,
1194 _In_opt_ PSTR SourceString
1198 DestinationString->MaximumLength = (DestinationString->Length = (USHORT)strlen(SourceString)) + 1;
1200 DestinationString->MaximumLength = DestinationString->Length = 0;
1202 DestinationString->Buffer = SourceString;
1209 _Out_
PSTRING DestinationString,
1210 _In_opt_ PSTR SourceString
1214 #if (PHNT_VERSION >= PHNT_THRESHOLD)
1219 _Out_
PSTRING DestinationString,
1220 _In_opt_z_
PCSZ SourceString
1224 #ifndef PHNT_NO_INLINE_INIT_STRING
1227 _In_opt_ PSTR SourceString
1231 DestinationString->MaximumLength = (DestinationString->Length = (USHORT)strlen(SourceString)) + 1;
1233 DestinationString->MaximumLength = DestinationString->Length = 0;
1235 DestinationString->Buffer = SourceString;
1243 _In_opt_ PSTR SourceString
1247 #if (PHNT_VERSION >= PHNT_WS03)
1253 _In_opt_z_
PCSZ SourceString
1275 _In_
PSTRING DestinationString,
1286 _Must_inspect_result_
1293 _In_ BOOLEAN CaseInSensitive
1296 _Must_inspect_result_
1303 _In_ BOOLEAN CaseInSensitive
1306 _Must_inspect_result_
1313 _In_ BOOLEAN CaseInSensitive
1329 _In_opt_ PSTR Source
1336 _In_
PSTRING DestinationString,
1340 #ifndef PHNT_NO_INLINE_INIT_STRING
1343 _In_opt_ PWSTR SourceString
1347 DestinationString->MaximumLength = (DestinationString->Length = (USHORT)(wcslen(SourceString) *
sizeof(WCHAR))) +
sizeof(WCHAR);
1349 DestinationString->MaximumLength = DestinationString->Length = 0;
1351 DestinationString->Buffer = SourceString;
1359 _In_opt_ PWSTR SourceString
1368 _In_opt_ PWSTR SourceString
1376 _In_ PWSTR SourceString
1384 _In_ PSTR SourceString
1394 #define RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE (0x00000001)
1395 #define RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING (0x00000002)
1418 _In_ WCHAR SourceCharacter
1425 _In_ WCHAR SourceCharacter
1428 _Must_inspect_result_
1435 _In_ BOOLEAN CaseInSensitive
1438 #if (PHNT_VERSION >= PHNT_VISTA)
1439 _Must_inspect_result_
1444 _In_reads_(String1Length) PWCH String1,
1445 _In_ SIZE_T String1Length,
1446 _In_reads_(String2Length) PWCH String2,
1447 _In_ SIZE_T String2Length,
1448 _In_ BOOLEAN CaseInSensitive
1452 _Must_inspect_result_
1459 _In_ BOOLEAN CaseInSensitive
1462 #define HASH_STRING_ALGORITHM_DEFAULT 0
1463 #define HASH_STRING_ALGORITHM_X65599 1
1464 #define HASH_STRING_ALGORITHM_INVALID 0xffffffff
1471 _In_ BOOLEAN CaseInSensitive,
1472 _In_ ULONG HashAlgorithm,
1473 _Out_ PULONG HashValue
1484 _Must_inspect_result_
1491 _In_ BOOLEAN CaseInSensitive
1494 #if (PHNT_VERSION >= PHNT_THRESHOLD)
1495 _Must_inspect_result_
1502 _In_ BOOLEAN CaseInSensitive
1506 #define RTL_FIND_CHAR_IN_UNICODE_STRING_START_AT_END 0x00000001
1507 #define RTL_FIND_CHAR_IN_UNICODE_STRING_COMPLEMENT_CHAR_SET 0x00000002
1508 #define RTL_FIND_CHAR_IN_UNICODE_STRING_CASE_INSENSITIVE 0x00000004
1517 _Out_ PUSHORT NonInclusivePrefixLength
1533 _In_opt_ PWSTR Source
1542 _In_ BOOLEAN AllocateDestinationString
1551 _In_ BOOLEAN AllocateDestinationString
1567 _In_ BOOLEAN AllocateDestinationString
1576 _In_ BOOLEAN AllocateDestinationString
1583 _Inout_ PUCHAR *SourceCharacter
1592 _In_ BOOLEAN AllocateDestinationString
1601 _In_ BOOLEAN AllocateDestinationString
1610 _In_ BOOLEAN AllocateDestinationString
1619 _In_ BOOLEAN AllocateDestinationString
1628 _In_ BOOLEAN AllocateDestinationString
1637 _In_ BOOLEAN AllocateDestinationString
1644 _Out_writes_bytes_to_(MaxBytesInUnicodeString, *BytesInUnicodeString) PWCH UnicodeString,
1645 _In_ ULONG MaxBytesInUnicodeString,
1646 _Out_opt_ PULONG BytesInUnicodeString,
1647 _In_reads_bytes_(BytesInMultiByteString) PSTR MultiByteString,
1648 _In_ ULONG BytesInMultiByteString
1655 _Out_ PULONG BytesInUnicodeString,
1656 _In_reads_bytes_(BytesInMultiByteString) PSTR MultiByteString,
1657 _In_ ULONG BytesInMultiByteString
1664 _Out_writes_bytes_to_(MaxBytesInMultiByteString, *BytesInMultiByteString) PCHAR MultiByteString,
1665 _In_ ULONG MaxBytesInMultiByteString,
1666 _Out_opt_ PULONG BytesInMultiByteString,
1667 _In_reads_bytes_(BytesInUnicodeString) PWCH UnicodeString,
1668 _In_ ULONG BytesInUnicodeString
1675 _Out_ PULONG BytesInMultiByteString,
1676 _In_reads_bytes_(BytesInUnicodeString) PWCH UnicodeString,
1677 _In_ ULONG BytesInUnicodeString
1684 _Out_writes_bytes_to_(MaxBytesInMultiByteString, *BytesInMultiByteString) PCHAR MultiByteString,
1685 _In_ ULONG MaxBytesInMultiByteString,
1686 _Out_opt_ PULONG BytesInMultiByteString,
1687 _In_reads_bytes_(BytesInUnicodeString) PWCH UnicodeString,
1688 _In_ ULONG BytesInUnicodeString
1695 _Out_writes_bytes_to_(MaxBytesInUnicodeString, *BytesInUnicodeString) PWSTR UnicodeString,
1696 _In_ ULONG MaxBytesInUnicodeString,
1697 _Out_opt_ PULONG BytesInUnicodeString,
1698 _In_reads_bytes_(BytesInOemString) PCH OemString,
1699 _In_ ULONG BytesInOemString
1706 _Out_writes_bytes_to_(MaxBytesInOemString, *BytesInOemString) PCHAR OemString,
1707 _In_ ULONG MaxBytesInOemString,
1708 _Out_opt_ PULONG BytesInOemString,
1709 _In_reads_bytes_(BytesInUnicodeString) PWCH UnicodeString,
1710 _In_ ULONG BytesInUnicodeString
1717 _Out_writes_bytes_to_(MaxBytesInOemString, *BytesInOemString) PCHAR OemString,
1718 _In_ ULONG MaxBytesInOemString,
1719 _Out_opt_ PULONG BytesInOemString,
1720 _In_reads_bytes_(BytesInUnicodeString) PWCH UnicodeString,
1721 _In_ ULONG BytesInUnicodeString
1728 _Out_writes_bytes_to_(MaxBytesInUnicodeString, *BytesInUnicodeString) PWCH UnicodeString,
1729 _In_ ULONG MaxBytesInUnicodeString,
1730 _Out_opt_ PULONG BytesInUnicodeString,
1731 _In_reads_bytes_(BytesInMultiByteString) PCH MultiByteString,
1732 _In_ ULONG BytesInMultiByteString,
1733 _Out_ PULONG pdwSpecialChar
1736 #if (PHNT_VERSION >= PHNT_WIN7)
1741 _Out_writes_bytes_to_(UnicodeStringMaxByteCount, *UnicodeStringActualByteCount) PWSTR UnicodeStringDestination,
1742 _In_ ULONG UnicodeStringMaxByteCount,
1743 _Out_ PULONG UnicodeStringActualByteCount,
1744 _In_reads_bytes_(UTF8StringByteCount) PCH UTF8StringSource,
1745 _In_ ULONG UTF8StringByteCount
1749 #if (PHNT_VERSION >= PHNT_WIN7)
1754 _Out_writes_bytes_to_(UTF8StringMaxByteCount, *UTF8StringActualByteCount) PCHAR UTF8StringDestination,
1755 _In_ ULONG UTF8StringMaxByteCount,
1756 _Out_ PULONG UTF8StringActualByteCount,
1757 _In_reads_bytes_(UnicodeStringByteCount) PWCH UnicodeStringSource,
1758 _In_ ULONG UnicodeStringByteCount
1767 _Out_writes_bytes_to_(MaxBytesInUnicodeString, *BytesInUnicodeString) PWCH UnicodeString,
1768 _In_ ULONG MaxBytesInUnicodeString,
1769 _Out_opt_ PULONG BytesInUnicodeString,
1770 _In_reads_bytes_(BytesInCustomCPString) PCH CustomCPString,
1771 _In_ ULONG BytesInCustomCPString
1779 _Out_writes_bytes_to_(MaxBytesInCustomCPString, *BytesInCustomCPString) PCH CustomCPString,
1780 _In_ ULONG MaxBytesInCustomCPString,
1781 _Out_opt_ PULONG BytesInCustomCPString,
1782 _In_reads_bytes_(BytesInUnicodeString) PWCH UnicodeString,
1783 _In_ ULONG BytesInUnicodeString
1791 _Out_writes_bytes_to_(MaxBytesInCustomCPString, *BytesInCustomCPString) PCH CustomCPString,
1792 _In_ ULONG MaxBytesInCustomCPString,
1793 _Out_opt_ PULONG BytesInCustomCPString,
1794 _In_reads_bytes_(BytesInUnicodeString) PWCH UnicodeString,
1795 _In_ ULONG BytesInUnicodeString
1802 _In_ PUSHORT TableBase,
1810 _In_ PUSHORT AnsiNlsBase,
1811 _In_ PUSHORT OemNlsBase,
1812 _In_ PUSHORT LanguageNlsBase,
1829 _Inout_opt_ PULONG Result
1848 #if (PHNT_VERSION >= PHNT_VISTA)
1853 _In_ ULONG NormForm,
1854 _In_ PCWSTR SourceString,
1855 _In_
LONG SourceStringLength,
1856 _Out_writes_to_(*DestinationStringLength, *DestinationStringLength) PWSTR DestinationString,
1857 _Inout_ PLONG DestinationStringLength
1861 #if (PHNT_VERSION >= PHNT_VISTA)
1866 _In_ ULONG NormForm,
1867 _In_ PCWSTR SourceString,
1868 _In_
LONG SourceStringLength,
1869 _Out_ PBOOLEAN Normalized
1873 #if (PHNT_VERSION >= PHNT_WIN7)
1881 _In_ BOOLEAN IgnoreCase,
1882 _In_opt_ PWCH UpcaseTable
1908 _In_ BOOLEAN AllocateComputerNameString
1927 #if (PHNT_VERSION >= PHNT_VISTA)
1959 _Out_ PPREFIX_TABLE PrefixTable
1966 _In_ PPREFIX_TABLE PrefixTable,
1968 _Out_ PPREFIX_TABLE_ENTRY PrefixTableEntry
1975 _In_ PPREFIX_TABLE PrefixTable,
1976 _In_ PPREFIX_TABLE_ENTRY PrefixTableEntry
1983 _In_ PPREFIX_TABLE PrefixTable,
2009 _Out_ PUNICODE_PREFIX_TABLE PrefixTable
2016 _In_ PUNICODE_PREFIX_TABLE PrefixTable,
2018 _Out_ PUNICODE_PREFIX_TABLE_ENTRY PrefixTableEntry
2025 _In_ PUNICODE_PREFIX_TABLE PrefixTable,
2026 _In_ PUNICODE_PREFIX_TABLE_ENTRY PrefixTableEntry
2030 PUNICODE_PREFIX_TABLE_ENTRY
2033 _In_ PUNICODE_PREFIX_TABLE PrefixTable,
2035 _In_ ULONG CaseInsensitiveIndex
2039 PUNICODE_PREFIX_TABLE_ENTRY
2042 _In_ PUNICODE_PREFIX_TABLE PrefixTable,
2043 _In_ BOOLEAN Restart
2066 _In_ USHORT CompressionFormatAndEngine,
2067 _Out_ PULONG CompressBufferWorkSpaceSize,
2068 _Out_ PULONG CompressFragmentWorkSpaceSize
2075 _In_ USHORT CompressionFormatAndEngine,
2076 _In_reads_bytes_(UncompressedBufferSize) PUCHAR UncompressedBuffer,
2077 _In_ ULONG UncompressedBufferSize,
2078 _Out_writes_bytes_to_(CompressedBufferSize, *FinalCompressedSize) PUCHAR CompressedBuffer,
2079 _In_ ULONG CompressedBufferSize,
2080 _In_ ULONG UncompressedChunkSize,
2081 _Out_ PULONG FinalCompressedSize,
2082 _In_ PVOID WorkSpace
2089 _In_ USHORT CompressionFormat,
2090 _Out_writes_bytes_to_(UncompressedBufferSize, *FinalUncompressedSize) PUCHAR UncompressedBuffer,
2091 _In_ ULONG UncompressedBufferSize,
2092 _In_reads_bytes_(CompressedBufferSize) PUCHAR CompressedBuffer,
2093 _In_ ULONG CompressedBufferSize,
2094 _Out_ PULONG FinalUncompressedSize
2097 #if (PHNT_VERSION >= PHNT_WIN8)
2102 _In_ USHORT CompressionFormat,
2103 _Out_writes_bytes_to_(UncompressedBufferSize, *FinalUncompressedSize) PUCHAR UncompressedBuffer,
2104 _In_ ULONG UncompressedBufferSize,
2105 _In_reads_bytes_(CompressedBufferSize) PUCHAR CompressedBuffer,
2106 _In_ ULONG CompressedBufferSize,
2107 _Out_ PULONG FinalUncompressedSize,
2108 _In_ PVOID WorkSpace
2116 _In_ USHORT CompressionFormat,
2117 _Out_writes_bytes_to_(UncompressedFragmentSize, *FinalUncompressedSize) PUCHAR UncompressedFragment,
2118 _In_ ULONG UncompressedFragmentSize,
2119 _In_reads_bytes_(CompressedBufferSize) PUCHAR CompressedBuffer,
2120 _In_ ULONG CompressedBufferSize,
2121 _In_range_(<, CompressedBufferSize) ULONG FragmentOffset,
2122 _Out_ PULONG FinalUncompressedSize,
2123 _In_ PVOID WorkSpace
2130 _In_ USHORT CompressionFormat,
2131 _Inout_ PUCHAR *CompressedBuffer,
2132 _In_ PUCHAR EndOfCompressedBufferPlus1,
2133 _Out_ PUCHAR *ChunkBuffer,
2134 _Out_ PULONG ChunkSize
2141 _In_ USHORT CompressionFormat,
2142 _Inout_ PUCHAR *CompressedBuffer,
2143 _In_ PUCHAR EndOfCompressedBufferPlus1,
2144 _Out_ PUCHAR *ChunkBuffer,
2145 _In_ ULONG ChunkSize
2152 _Out_writes_bytes_(UncompressedBufferSize) PUCHAR UncompressedBuffer,
2153 _In_ ULONG UncompressedBufferSize,
2154 _In_reads_bytes_(CompressedBufferSize) PUCHAR CompressedBuffer,
2155 _In_ ULONG CompressedBufferSize,
2156 _In_reads_bytes_(CompressedTailSize) PUCHAR CompressedTail,
2157 _In_ ULONG CompressedTailSize,
2158 _In_ PCOMPRESSED_DATA_INFO CompressedDataInfo
2165 _In_reads_bytes_(UncompressedBufferSize) PUCHAR UncompressedBuffer,
2166 _In_ ULONG UncompressedBufferSize,
2167 _Out_writes_bytes_(CompressedBufferSize) PUCHAR CompressedBuffer,
2168 _In_range_(>=, (UncompressedBufferSize - (UncompressedBufferSize / 16))) ULONG CompressedBufferSize,
2169 _Inout_updates_bytes_(CompressedDataInfoLength) PCOMPRESSED_DATA_INFO CompressedDataInfo,
2171 _In_ PVOID WorkSpace
2176 #if (PHNT_VERSION >= PHNT_VISTA)
2183 _In_ LCID LcidValue,
2186 _Out_writes_(
Size) PWSTR pResultBuf,
2195 _In_ PWSTR LocaleName,
2204 _In_ PWSTR LocaleName,
2207 _In_ BOOLEAN AllocateDestinationString
2218 _In_ BOOLEAN AllocateDestinationString
2226 _In_ PWSTR LocaleName,
2259 #if (PHNT_VERSION >= PHNT_WIN7)
2266 _Out_ PVOID *BaseAddress,
2267 _Out_ PLCID DefaultLocaleId,
2268 _Out_ PLARGE_INTEGER DefaultCasingTableSize
2289 #if (PHNT_VERSION >= PHNT_VISTA)
2317 #define DOS_MAX_COMPONENT_LENGTH 255
2318 #define DOS_MAX_PATH_LENGTH (DOS_MAX_COMPONENT_LENGTH + 5)
2326 #define RTL_USER_PROC_CURDIR_CLOSE 0x00000002
2327 #define RTL_USER_PROC_CURDIR_INHERIT 0x00000003
2337 #define RTL_MAX_DRIVE_LETTERS 32
2338 #define RTL_DRIVE_LETTER_VALID (USHORT)0x0001
2383 #define RTL_USER_PROC_PARAMS_NORMALIZED 0x00000001
2384 #define RTL_USER_PROC_PROFILE_USER 0x00000002
2385 #define RTL_USER_PROC_PROFILE_KERNEL 0x00000004
2386 #define RTL_USER_PROC_PROFILE_SERVER 0x00000008
2387 #define RTL_USER_PROC_RESERVE_1MB 0x00000020
2388 #define RTL_USER_PROC_RESERVE_16MB 0x00000040
2389 #define RTL_USER_PROC_CASE_SENSITIVE 0x00000080
2390 #define RTL_USER_PROC_DISABLE_HEAP_DECOMMIT 0x00000100
2391 #define RTL_USER_PROC_DLL_REDIRECTION_LOCAL 0x00001000
2392 #define RTL_USER_PROC_APP_MANIFEST_PRESENT 0x00002000
2393 #define RTL_USER_PROC_IMAGE_KEY_MISSING 0x00004000
2394 #define RTL_USER_PROC_OPTIN_PROCESS 0x00020000
2400 _Out_ PRTL_USER_PROCESS_PARAMETERS *pProcessParameters,
2405 _In_opt_ PVOID Environment,
2412 #if (PHNT_VERSION >= PHNT_VISTA)
2418 _Out_ PRTL_USER_PROCESS_PARAMETERS *pProcessParameters,
2423 _In_opt_ PVOID Environment,
2436 _In_ _Post_invalid_ PRTL_USER_PROCESS_PARAMETERS ProcessParameters
2440 PRTL_USER_PROCESS_PARAMETERS
2443 _Inout_ PRTL_USER_PROCESS_PARAMETERS ProcessParameters
2447 PRTL_USER_PROCESS_PARAMETERS
2450 _Inout_ PRTL_USER_PROCESS_PARAMETERS ProcessParameters
2468 _In_ ULONG AttributesDeprecated,
2469 _In_ PRTL_USER_PROCESS_PARAMETERS ProcessParameters,
2470 _In_opt_ PSECURITY_DESCRIPTOR ProcessSecurityDescriptor,
2471 _In_opt_ PSECURITY_DESCRIPTOR ThreadSecurityDescriptor,
2472 _In_opt_ HANDLE ParentProcess,
2473 _In_ BOOLEAN InheritHandles,
2474 _In_opt_ HANDLE DebugPort,
2475 _In_opt_ HANDLE TokenHandle,
2476 _Out_ PRTL_USER_PROCESS_INFORMATION ProcessInformation
2479 #if (PHNT_VERSION >= PHNT_VISTA)
2485 _In_ NTSTATUS ExitStatus
2489 #define RtlExitUserProcess RtlExitUserProcess_R
2492 FORCEINLINE
VOID RtlExitUserProcess_R(
2493 _In_ NTSTATUS ExitStatus
2496 ExitProcess(ExitStatus);
2501 #if (PHNT_VERSION >= PHNT_VISTA)
2504 #define RTL_CLONE_PROCESS_FLAGS_CREATE_SUSPENDED 0x00000001
2505 #define RTL_CLONE_PROCESS_FLAGS_INHERIT_HANDLES 0x00000002
2506 #define RTL_CLONE_PROCESS_FLAGS_NO_SYNCHRONIZE 0x00000004 // don't update synchronization objects
2514 _In_ ULONG ProcessFlags,
2515 _In_opt_ PSECURITY_DESCRIPTOR ProcessSecurityDescriptor,
2516 _In_opt_ PSECURITY_DESCRIPTOR ThreadSecurityDescriptor,
2517 _In_opt_ HANDLE DebugPort,
2518 _Out_ PRTL_USER_PROCESS_INFORMATION ProcessInformation
2534 _Inout_ PRTL_SRWLOCK SRWLock,
2546 #if (PHNT_VERSION >= PHNT_WIN7)
2552 _In_ HANDLE ProcessHandle,
2554 _In_opt_ PVOID StartRoutine,
2555 _In_opt_ PVOID StartContext,
2556 _In_opt_ HANDLE EventHandle,
2557 _Out_opt_ PRTLP_PROCESS_REFLECTION_REFLECTION_INFORMATION ReflectionInformation
2567 _In_ BOOLEAN NewValue,
2568 _Out_opt_ PBOOLEAN OldValue,
2569 _In_ BOOLEAN CheckFlag
2576 _In_ BOOLEAN NewValue,
2577 _Out_opt_ PBOOLEAN OldValue,
2578 _In_ BOOLEAN CheckFlag
2584 _In_ PVOID ThreadParameter
2591 _In_ HANDLE Process,
2592 _In_opt_ PSECURITY_DESCRIPTOR ThreadSecurityDescriptor,
2593 _In_ BOOLEAN CreateSuspended,
2594 _In_opt_ ULONG ZeroBits,
2595 _In_opt_ SIZE_T MaximumStackSize,
2596 _In_opt_ SIZE_T CommittedStackSize,
2598 _In_opt_ PVOID Parameter,
2599 _Out_opt_ PHANDLE Thread,
2603 #if (PHNT_VERSION >= PHNT_VISTA) // should be PHNT_WINXP, but is PHNT_VISTA for consistency with RtlExitUserProcess
2609 _In_ NTSTATUS ExitStatus
2613 #define RtlExitUserThread RtlExitUserThread_R
2616 FORCEINLINE
VOID RtlExitUserThread_R(
2617 _In_ NTSTATUS ExitStatus
2620 ExitThread(ExitStatus);
2625 #if (PHNT_VERSION >= PHNT_VISTA)
2632 _In_opt_ SIZE_T CommittedStackSize,
2633 _In_opt_ SIZE_T MaximumStackSize,
2634 _In_opt_ ULONG_PTR ZeroBits,
2635 _In_ SIZE_T PageSize,
2636 _In_ ULONG_PTR ReserveAlignment,
2645 _In_ PVOID AllocationBase
2654 _In_ HANDLE Process,
2655 _Out_ PCONTEXT Context,
2656 _In_opt_ PVOID Parameter,
2657 _In_opt_ PVOID InitialPc,
2658 _In_opt_ PVOID InitialSp
2665 _In_ HANDLE Process,
2667 _In_ PVOID CallSite,
2668 _In_ ULONG ArgumentCount,
2669 _In_opt_ PULONG_PTR Arguments,
2670 _In_ BOOLEAN PassContext,
2671 _In_ BOOLEAN AlreadySuspended
2679 RtlWow64GetThreadContext(
2680 _In_ HANDLE ThreadHandle,
2681 _Inout_ PWOW64_CONTEXT ThreadContext
2690 RtlWow64SetThreadContext(
2691 _In_ HANDLE ThreadHandle,
2692 _In_ PWOW64_CONTEXT ThreadContext
2701 typedef enum _FUNCTION_TABLE_TYPE
2707 } FUNCTION_TABLE_TYPE;
2710 typedef struct _DYNAMIC_FUNCTION_TABLE
2712 LIST_ENTRY ListEntry;
2713 PRUNTIME_FUNCTION FunctionTable;
2714 LARGE_INTEGER TimeStamp;
2715 ULONG64 MinimumAddress;
2716 ULONG64 MaximumAddress;
2717 ULONG64 BaseAddress;
2718 PGET_RUNTIME_FUNCTION_CALLBACK Callback;
2720 PWSTR OutOfProcessCallbackDll;
2721 FUNCTION_TABLE_TYPE Type;
2723 } DYNAMIC_FUNCTION_TABLE, *PDYNAMIC_FUNCTION_TABLE;
2729 RtlGetFunctionTableListHead(
2742 _Out_ PVOID *BaseOfImage
2752 #define RTL_IMAGE_NT_HEADER_EX_FLAG_NO_RANGE_CHECK 0x00000001
2761 _Out_ PIMAGE_NT_HEADERS *OutHeaders
2768 _In_ PIMAGE_NT_HEADERS NtHeaders,
2769 _In_ PVOID BaseOfImage,
2770 _In_ ULONG VirtualAddress
2774 PIMAGE_SECTION_HEADER
2777 _In_ PIMAGE_NT_HEADERS NtHeaders,
2778 _In_ PVOID BaseOfImage,
2779 _In_ ULONG VirtualAddress
2786 _In_ PVOID BaseOfImage,
2787 _In_ BOOLEAN MappedAsImage,
2788 _In_ USHORT DirectoryEntry,
2793 PIMAGE_SECTION_HEADER
2796 _In_ PIMAGE_NT_HEADERS NtHeaders,
2805 _In_ PIMAGE_NT_HEADERS NtHeaders,
2808 _Inout_opt_ PIMAGE_SECTION_HEADER *LastRvaSection
2826 _Out_ PVOID Destination,
2835 _Out_ PVOID Destination,
2837 _In_ ULONGLONG Pattern
2846 _In_ BOOLEAN CloneCurrentEnvironment,
2847 _Out_ PVOID *Environment
2851 #define RTL_CREATE_ENVIRONMENT_TRANSLATE 0x1 // translate from multi-byte to Unicode
2852 #define RTL_CREATE_ENVIRONMENT_TRANSLATE_FROM_OEM 0x2 // translate from OEM to Unicode (Translate flag must also be set)
2853 #define RTL_CREATE_ENVIRONMENT_EMPTY 0x4 // create empty environment block
2856 #if (PHNT_VERSION >= PHNT_VISTA)
2862 _In_ PVOID SourceEnv,
2863 _Out_ PVOID *Environment,
2872 _In_ PVOID Environment
2879 _In_ PVOID Environment,
2880 _Out_opt_ PVOID *PreviousEnvironment
2883 #if (PHNT_VERSION >= PHNT_VISTA)
2889 _In_opt_ PWSTR *Environment,
2890 _In_reads_(NameLength) PWSTR Name,
2891 _In_ SIZE_T NameLength,
2892 _In_reads_(ValueLength) PWSTR Value,
2893 _In_ SIZE_T ValueLength
2901 _In_opt_ PVOID *Environment,
2906 #if (PHNT_VERSION >= PHNT_VISTA)
2912 _In_opt_ PVOID Environment,
2913 _In_reads_(NameLength) PWSTR Name,
2914 _In_ SIZE_T NameLength,
2915 _Out_writes_(ValueLength) PWSTR Value,
2916 _In_ SIZE_T ValueLength,
2917 _Out_ PSIZE_T ReturnLength
2925 _In_opt_ PVOID Environment,
2930 #if (PHNT_VERSION >= PHNT_VISTA)
2936 _In_opt_ PVOID Environment,
2937 _In_reads_(SrcLength) PWSTR Src,
2938 _In_ SIZE_T SrcLength,
2939 _Out_writes_(DstLength) PWSTR Dst,
2940 _In_ SIZE_T DstLength,
2941 _Out_opt_ PSIZE_T ReturnLength
2949 _In_opt_ PVOID Environment,
2952 _Out_opt_ PULONG ReturnedLength
2959 _In_ PWCHAR NewEnvironment,
2960 _In_ SIZE_T NewEnvironmentSize
2990 _In_ PWSTR DosFileName
2997 _In_ PWSTR DosFileName
3004 _In_ PWSTR FileName,
3005 _In_ ULONG BufferLength,
3006 _Out_writes_bytes_(BufferLength) PWSTR Buffer,
3007 _Out_opt_ PWSTR *FilePart
3010 #if (PHNT_VERSION >= PHNT_WIN7)
3016 _In_ PWSTR FileName,
3017 _In_ ULONG BufferLength,
3018 _Out_writes_bytes_(BufferLength) PWSTR Buffer,
3019 _Out_opt_ PWSTR *FilePart,
3024 #if (PHNT_VERSION >= PHNT_WS03)
3033 _Out_opt_ SIZE_T *FilePartPrefixCch,
3034 _Out_opt_ PBOOLEAN NameInvalid,
3036 _Out_opt_ SIZE_T *BytesRequired
3044 _In_ ULONG BufferLength,
3045 _Out_writes_bytes_(BufferLength) PWSTR Buffer
3066 _In_ PWSTR DosFileName,
3068 _Out_opt_ PWSTR *FilePart,
3069 _Out_opt_ PRTL_RELATIVE_NAME_U RelativeName
3072 #if (PHNT_VERSION >= PHNT_WS03)
3077 _In_ PWSTR DosFileName,
3079 _Out_opt_ PWSTR *FilePart,
3080 _Out_opt_ PRTL_RELATIVE_NAME_U RelativeName
3084 #if (PHNT_VERSION >= PHNT_WS03)
3089 _In_ PWSTR DosFileName,
3091 _Out_opt_ PWSTR *FilePart,
3092 _Out_opt_ PRTL_RELATIVE_NAME_U RelativeName
3096 #if (PHNT_VERSION >= PHNT_WS03)
3101 _In_ PWSTR DosFileName,
3103 _Out_opt_ PWSTR *FilePart,
3104 _Out_opt_ PRTL_RELATIVE_NAME_U RelativeName
3108 #if (PHNT_VERSION >= PHNT_WS03)
3113 _Inout_ PRTL_RELATIVE_NAME_U RelativeName
3122 _In_ PWSTR FileName,
3123 _In_opt_ PWSTR Extension,
3124 _In_ ULONG BufferLength,
3125 _Out_writes_bytes_(BufferLength) PWSTR Buffer,
3126 _Out_opt_ PWSTR *FilePart
3129 #define RTL_DOS_SEARCH_PATH_FLAG_APPLY_ISOLATION_REDIRECTION 0x00000001
3130 #define RTL_DOS_SEARCH_PATH_FLAG_DISALLOW_DOT_RELATIVE_PATH_SEARCH 0x00000002
3131 #define RTL_DOS_SEARCH_PATH_FLAG_APPLY_DEFAULT_EXTENSION_WHEN_NOT_RELATIVE_PATH_EVEN_IF_FILE_HAS_EXTENSION 0x00000004)
3144 _Out_opt_ SIZE_T *FilePartPrefixCch,
3145 _Out_opt_ SIZE_T *BytesRequired
3177 #define RTL_HEAP_BUSY (USHORT)0x0001
3178 #define RTL_HEAP_SEGMENT (USHORT)0x0002
3179 #define RTL_HEAP_SETTABLE_VALUE (USHORT)0x0010
3180 #define RTL_HEAP_SETTABLE_FLAG1 (USHORT)0x0020
3181 #define RTL_HEAP_SETTABLE_FLAG2 (USHORT)0x0040
3182 #define RTL_HEAP_SETTABLE_FLAG3 (USHORT)0x0080
3183 #define RTL_HEAP_SETTABLE_FLAGS (USHORT)0x00e0
3184 #define RTL_HEAP_UNCOMMITTED_RANGE (USHORT)0x0100
3185 #define RTL_HEAP_PROTECTED_ENTRY (USHORT)0x0200
3222 _Inout_ PVOID *CommitAddress,
3223 _Inout_ PSIZE_T CommitSize
3241 #define HEAP_SETTABLE_USER_VALUE 0x00000100
3242 #define HEAP_SETTABLE_USER_FLAG1 0x00000200
3243 #define HEAP_SETTABLE_USER_FLAG2 0x00000400
3244 #define HEAP_SETTABLE_USER_FLAG3 0x00000800
3245 #define HEAP_SETTABLE_USER_FLAGS 0x00000e00
3247 #define HEAP_CLASS_0 0x00000000 // Process heap
3248 #define HEAP_CLASS_1 0x00001000 // Private heap
3249 #define HEAP_CLASS_2 0x00002000 // Kernel heap
3250 #define HEAP_CLASS_3 0x00003000 // GDI heap
3251 #define HEAP_CLASS_4 0x00004000 // User heap
3252 #define HEAP_CLASS_5 0x00005000 // Console heap
3253 #define HEAP_CLASS_6 0x00006000 // User desktop heap
3254 #define HEAP_CLASS_7 0x00007000 // CSR shared heap
3255 #define HEAP_CLASS_8 0x00008000 // CSR port heap
3256 #define HEAP_CLASS_MASK 0x0000f000
3263 _In_opt_ PVOID HeapBase,
3264 _In_opt_ SIZE_T ReserveSize,
3265 _In_opt_ SIZE_T CommitSize,
3266 _In_opt_ PVOID Lock,
3267 _In_opt_ PRTL_HEAP_PARAMETERS Parameters
3274 _In_ _Post_invalid_ PVOID HeapHandle
3281 _In_ PVOID HeapHandle,
3282 _In_opt_ ULONG Flags,
3290 _In_ PVOID HeapHandle,
3291 _In_opt_ ULONG Flags,
3292 _In_ _Post_invalid_ PVOID BaseAddress
3299 _In_ PVOID HeapHandle,
3301 _In_ PVOID BaseAddress
3308 _In_ PVOID HeapHandle,
3316 _In_ PVOID HeapHandle,
3317 _In_ BOOLEAN MakeReadOnly
3320 #define RtlProcessHeap() (NtCurrentPeb()->ProcessHeap)
3326 _In_ PVOID HeapHandle
3333 _In_ PVOID HeapHandle
3340 _In_ PVOID HeapHandle,
3342 _In_ PVOID BaseAddress,
3350 _In_ PVOID HeapHandle,
3352 _In_ PVOID BaseAddress,
3353 _Out_opt_ PVOID *UserValue,
3354 _Out_opt_ PULONG UserFlags
3361 _In_ PVOID HeapHandle,
3363 _In_ PVOID BaseAddress,
3364 _In_ PVOID UserValue
3371 _In_ PVOID HeapHandle,
3373 _In_ PVOID BaseAddress,
3374 _In_ ULONG UserFlagsReset,
3375 _In_ ULONG UserFlagsSet
3385 #define RTL_HEAP_MAKE_TAG HEAP_MAKE_TAG_FLAGS
3391 _In_ PVOID HeapHandle,
3393 _In_opt_ PWSTR TagPrefix,
3401 _In_ PVOID HeapHandle,
3403 _In_ USHORT TagIndex,
3404 _In_ BOOLEAN ResetCounters,
3405 _Out_opt_ PRTL_HEAP_TAG_INFO TagInfo
3412 _In_ PVOID HeapHandle,
3422 _In_ PVOID HeapHandle,
3430 _In_ PVOID HeapHandle,
3432 _In_ PVOID BaseAddress
3446 _In_ ULONG NumberOfHeaps,
3447 _Out_ PVOID *ProcessHeaps
3451 _In_ PVOID HeapHandle,
3452 _In_ PVOID Parameter
3460 _In_ PVOID Parameter
3485 #define HEAP_USAGE_ALLOCATED_BLOCKS HEAP_REALLOC_IN_PLACE_ONLY
3486 #define HEAP_USAGE_FREE_BUFFER HEAP_ZERO_MEMORY
3492 _In_ PVOID HeapHandle,
3494 _Inout_ PRTL_HEAP_USAGE Usage
3527 _In_ PVOID HeapHandle,
3528 _Inout_ PRTL_HEAP_WALK_ENTRY Entry
3532 #define HeapDebuggingInformation 0x80000002
3537 _In_ PVOID HeapHandle,
3538 _In_ PVOID BaseAddress,
3539 _In_ SIZE_T BlockSize,
3540 _In_ ULONG StackTraceDepth,
3541 _In_ PVOID *StackTrace
3560 _In_ PVOID HeapHandle,
3561 _In_ HEAP_INFORMATION_CLASS HeapInformationClass,
3562 _Out_opt_ PVOID HeapInformation,
3563 _In_opt_ SIZE_T HeapInformationLength,
3564 _Out_opt_ PSIZE_T ReturnLength
3571 _In_ PVOID HeapHandle,
3572 _In_ HEAP_INFORMATION_CLASS HeapInformationClass,
3573 _In_opt_ PVOID HeapInformation,
3574 _In_opt_ SIZE_T HeapInformationLength
3581 _In_ PVOID HeapHandle,
3592 _In_ PVOID HeapHandle,
3598 #if (PHNT_VERSION >= PHNT_WIN7)
3627 #if (PHNT_VERSION >= PHNT_VISTA)
3633 _Out_ PVOID *MemoryZone,
3634 _In_ SIZE_T InitialSize,
3635 _Reserved_ ULONG Flags
3642 _In_ _Post_invalid_ PVOID MemoryZone
3649 _In_ PVOID MemoryZone,
3650 _In_ SIZE_T BlockSize,
3658 _In_ PVOID MemoryZone
3665 _In_ PVOID MemoryZone
3672 _In_ PVOID MemoryZone
3683 #if (PHNT_VERSION >= PHNT_VISTA)
3689 _Out_ PVOID *MemoryBlockLookaside,
3690 _Reserved_ ULONG Flags,
3691 _In_ ULONG InitialSize,
3692 _In_ ULONG MinimumBlockSize,
3693 _In_ ULONG MaximumBlockSize
3700 _In_ PVOID MemoryBlockLookaside
3707 _In_ PVOID MemoryBlockLookaside,
3708 _In_ ULONG BlockSize,
3716 _In_ PVOID MemoryBlockLookaside,
3724 _In_ PVOID MemoryBlockLookaside,
3725 _In_ ULONG Increment
3732 _In_ PVOID MemoryBlockLookaside
3739 _In_ PVOID MemoryBlockLookaside
3746 _In_ PVOID MemoryBlockLookaside
3755 #if (PHNT_VERSION >= PHNT_VISTA)
3765 #if (PHNT_VERSION >= PHNT_VISTA)
3771 _In_ HANDLE TransactionHandle
3782 return L1->LowPart == L2->LowPart &&
3783 L1->HighPart == L2->HighPart;
3790 return (L1->LowPart | L1->HighPart) == 0;
3798 LARGE_INTEGER tempLi;
3800 tempLi.QuadPart = Long;
3801 tempLuid.LowPart = tempLi.LowPart;
3802 tempLuid.HighPart = tempLi.HighPart;
3813 tempLuid.LowPart = Ulong;
3814 tempLuid.HighPart = 0;
3823 _Out_ PLUID DestinationLuid,
3824 _In_ PLUID SourceLuid
3870 PRTL_DEBUG_INFORMATION
3873 _In_opt_ ULONG MaximumCommit,
3874 _In_ BOOLEAN UseEventPair
3881 _In_ PRTL_DEBUG_INFORMATION Buffer
3884 #if (PHNT_VERSION >= PHNT_VISTA)
3891 _Inout_ PRTL_DEBUG_INFORMATION Buffer,
3900 _Inout_ PRTL_DEBUG_INFORMATION Buffer,
3907 #define RTL_QUERY_PROCESS_MODULES 0x00000001
3908 #define RTL_QUERY_PROCESS_BACKTRACES 0x00000002
3909 #define RTL_QUERY_PROCESS_HEAP_SUMMARY 0x00000004
3910 #define RTL_QUERY_PROCESS_HEAP_TAGS 0x00000008
3911 #define RTL_QUERY_PROCESS_HEAP_ENTRIES 0x00000010
3912 #define RTL_QUERY_PROCESS_LOCKS 0x00000020
3913 #define RTL_QUERY_PROCESS_MODULES32 0x00000040
3914 #define RTL_QUERY_PROCESS_VERIFIER_OPTIONS 0x00000080 // rev
3915 #define RTL_QUERY_PROCESS_MODULESEX 0x00000100 // rev
3916 #define RTL_QUERY_PROCESS_HEAP_ENTRIES_EX 0x00000200 // ?
3917 #define RTL_QUERY_PROCESS_CS_OWNER 0x00000400 // rev
3918 #define RTL_QUERY_PROCESS_NONINVASIVE 0x80000000
3924 _In_ HANDLE UniqueProcessId,
3926 _Inout_ PRTL_DEBUG_INFORMATION Buffer
3935 _In_ PVOID DllHandle,
3936 _In_ ULONG MessageTableId,
3937 _In_ ULONG MessageLanguageId,
3938 _In_ ULONG MessageId,
3939 _Out_ PMESSAGE_RESOURCE_ENTRY *MessageEntry
3946 _In_ PWSTR MessageFormat,
3947 _In_ ULONG MaximumWidth,
3948 _In_ BOOLEAN IgnoreInserts,
3949 _In_ BOOLEAN ArgumentsAreAnsi,
3950 _In_ BOOLEAN ArgumentsAreAnArray,
3951 _In_ va_list *Arguments,
3952 _Out_writes_bytes_to_(Length, *ReturnLength) PWSTR Buffer,
3954 _Out_opt_ PULONG ReturnLength
3967 #define INIT_PARSE_MESSAGE_CONTEXT(ctx) \
3969 (ctx)->fFlags = 0; \
3972 #define TEST_PARSE_MESSAGE_CONTEXT_FLAG(ctx, flag) ((ctx)->fFlags & (flag))
3973 #define SET_PARSE_MESSAGE_CONTEXT_FLAG(ctx, flag) ((ctx)->fFlags |= (flag))
3974 #define CLEAR_PARSE_MESSAGE_CONTEXT_FLAG(ctx, flag) ((ctx)->fFlags &= ~(flag))
3980 _In_ PWSTR MessageFormat,
3981 _In_ ULONG MaximumWidth,
3982 _In_ BOOLEAN IgnoreInserts,
3983 _In_ BOOLEAN ArgumentsAreAnsi,
3984 _In_ BOOLEAN ArgumentsAreAnArray,
3985 _In_ va_list *Arguments,
3986 _Out_writes_bytes_to_(Length, *ReturnLength) PWSTR Buffer,
3988 _Out_opt_ PULONG ReturnLength,
3989 _Out_opt_ PPARSE_MESSAGE_CONTEXT ParseContext
3998 _In_ NTSTATUS Status
4005 _In_ NTSTATUS Status
4026 _In_ NTSTATUS Status
4033 _In_
LONG Win32Error
4040 _In_
LONG Win32Error
4043 #define RTL_ERRORMODE_NOGPFAULTERRORBOX 0x0020
4044 #define RTL_ERRORMODE_NOOPENFILEERRORBOX 0x0040
4058 _Out_opt_ PULONG OldMode
4063 #if (PHNT_VERSION >= PHNT_VISTA)
4069 _In_ PEXCEPTION_RECORD ExceptionRecord,
4070 _In_ PCONTEXT ContextRecord,
4075 #if (PHNT_VERSION >= PHNT_VISTA)
4082 _In_ HANDLE CrashReportSharedMem,
4084 _Out_ PHANDLE CrashVerticalProcessHandle
4088 #if (PHNT_VERSION >= PHNT_WIN7)
4094 _In_ HANDLE ProcessHandle,
4095 _In_ NTSTATUS ExitStatus
4106 _In_ PVECTORED_EXCEPTION_HANDLER Handler
4121 _In_ PVECTORED_EXCEPTION_HANDLER Handler
4159 _Out_writes_bytes_(16) PCHAR Hash,
4160 _In_ ULONG ImportTableHashRevision
4170 _In_opt_ ULONG Base,
4171 _In_
LONG OutputLength,
4180 _In_opt_ ULONG Base,
4188 _In_ PLARGE_INTEGER Value,
4189 _In_opt_ ULONG Base,
4190 _In_
LONG OutputLength,
4199 _In_opt_ ULONG Base,
4207 _In_ ULONGLONG Value,
4208 _In_opt_ ULONG Base,
4213 #define RtlIntPtrToUnicodeString(Value, Base, String) RtlInt64ToUnicodeString(Value, Base, String)
4215 #define RtlIntPtrToUnicodeString(Value, Base, String) RtlIntegerToUnicodeString(Value, Base, String)
4223 _In_opt_ ULONG Base,
4236 _In_
struct in_addr *Addr,
4237 _Out_writes_(16) PWSTR S
4244 _In_
struct in_addr *Address,
4246 _Out_writes_to_(*AddressStringLength, *AddressStringLength) PWSTR AddressString,
4247 _Inout_ PULONG AddressStringLength
4254 _In_
struct in6_addr *Addr,
4255 _Out_writes_(65) PWSTR S
4262 _In_
struct in6_addr *Address,
4265 _Out_writes_to_(*AddressStringLength, *AddressStringLength) PWSTR AddressString,
4266 _Inout_ PULONG AddressStringLength
4274 _In_ BOOLEAN Strict,
4275 _Out_ PWSTR *Terminator,
4276 _Out_
struct in_addr *Addr
4283 _In_ PWSTR AddressString,
4284 _In_ BOOLEAN Strict,
4285 _Out_
struct in_addr *Address,
4294 _Out_ PWSTR *Terminator,
4295 _Out_
struct in6_addr *Addr
4302 _In_ PWSTR AddressString,
4303 _Out_
struct in6_addr *Address,
4304 _Out_ PULONG ScopeId,
4308 #define RtlIpv4AddressToString RtlIpv4AddressToStringW
4309 #define RtlIpv4AddressToStringEx RtlIpv4AddressToStringExW
4310 #define RtlIpv6AddressToString RtlIpv6AddressToStringW
4311 #define RtlIpv6AddressToStringEx RtlIpv6AddressToStringExW
4312 #define RtlIpv4StringToAddress RtlIpv4StringToAddressW
4313 #define RtlIpv4StringToAddressEx RtlIpv4StringToAddressExW
4314 #define RtlIpv6StringToAddress RtlIpv6StringToAddressW
4315 #define RtlIpv6StringToAddressEx RtlIpv6StringToAddressExW
4335 _In_ PTIME_FIELDS CutoverTime,
4336 _Out_ PLARGE_INTEGER SystemTime,
4337 _In_ PLARGE_INTEGER CurrentSystemTime,
4338 _In_ BOOLEAN ThisYear
4345 _In_ PLARGE_INTEGER SystemTime,
4346 _Out_ PLARGE_INTEGER LocalTime
4353 _In_ PLARGE_INTEGER LocalTime,
4354 _Out_ PLARGE_INTEGER SystemTime
4361 _In_ PLARGE_INTEGER Time,
4362 _Out_ PTIME_FIELDS TimeFields
4369 _In_ PLARGE_INTEGER Time,
4370 _Out_ PTIME_FIELDS TimeFields
4377 _In_ PTIME_FIELDS TimeFields,
4378 _Out_ PLARGE_INTEGER Time
4385 _In_ PLARGE_INTEGER Time,
4386 _Out_ PULONG ElapsedSeconds
4393 _In_ ULONG ElapsedSeconds,
4394 _Out_ PLARGE_INTEGER Time
4401 _In_ PLARGE_INTEGER Time,
4402 _Out_ PULONG ElapsedSeconds
4409 _In_ ULONG ElapsedSeconds,
4410 _Out_ PLARGE_INTEGER Time
4430 _Out_ PRTL_TIME_ZONE_INFORMATION TimeZoneInformation
4437 _In_ PRTL_TIME_ZONE_INFORMATION TimeZoneInformation
4452 _Out_ PRTL_BITMAP BitMapHeader,
4453 _In_ PULONG BitMapBuffer,
4454 _In_ ULONG SizeOfBitMap
4457 #if (PHNT_MODE == PHNT_MODE_KERNEL)
4462 _In_ PRTL_BITMAP BitMapHeader,
4463 _In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitNumber
4467 #if (PHNT_MODE == PHNT_MODE_KERNEL)
4472 _In_ PRTL_BITMAP BitMapHeader,
4473 _In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitNumber
4482 _In_ PRTL_BITMAP BitMapHeader,
4483 _In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitNumber
4490 _In_ PRTL_BITMAP BitMapHeader
4497 _In_ PRTL_BITMAP BitMapHeader
4506 _In_ PRTL_BITMAP BitMapHeader,
4517 _In_ PRTL_BITMAP BitMapHeader,
4518 _In_ ULONG NumberToFind,
4519 _In_ ULONG HintIndex
4526 RtlFindClearBitsAndSet(
4527 _In_ PRTL_BITMAP BitMapHeader,
4528 _In_ ULONG NumberToFind,
4529 _In_ ULONG HintIndex
4536 RtlFindSetBitsAndClear(
4537 _In_ PRTL_BITMAP BitMapHeader,
4538 _In_ ULONG NumberToFind,
4539 _In_ ULONG HintIndex
4546 _In_ PRTL_BITMAP BitMapHeader,
4547 _In_range_(0, BitMapHeader->SizeOfBitMap - NumberToClear) ULONG StartingIndex,
4548 _In_range_(0, BitMapHeader->SizeOfBitMap - StartingIndex) ULONG NumberToClear
4555 _In_ PRTL_BITMAP BitMapHeader,
4556 _In_range_(0, BitMapHeader->SizeOfBitMap - NumberToSet) ULONG StartingIndex,
4557 _In_range_(0, BitMapHeader->SizeOfBitMap - StartingIndex) ULONG NumberToSet
4570 _In_ PRTL_BITMAP BitMapHeader,
4571 _Out_writes_to_(SizeOfRunArray,
return) PRTL_BITMAP_RUN RunArray,
4572 _In_range_(>, 0) ULONG SizeOfRunArray,
4573 _In_ BOOLEAN LocateLongestRuns
4580 _In_ PRTL_BITMAP BitMapHeader,
4581 _Out_ PULONG StartingIndex
4588 _In_ PRTL_BITMAP BitMapHeader,
4589 _Out_ PULONG StartingIndex
4596 _In_ PRTL_BITMAP BitMapHeader,
4597 _In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitPosition
4601 return BitTest64((LONG64
const *)BitMapHeader->Buffer, (LONG64)BitPosition);
4603 return (((PLONG)BitMapHeader->Buffer)[BitPosition / 32] >> (BitPosition % 32)) & 0x1;
4611 _In_ PRTL_BITMAP BitMapHeader
4618 _In_ PRTL_BITMAP BitMapHeader
4626 _In_ PRTL_BITMAP BitMapHeader,
4627 _In_ ULONG StartingIndex,
4636 _In_ PRTL_BITMAP BitMapHeader,
4637 _In_ ULONG StartingIndex,
4645 _In_ PRTL_BITMAP BitMapHeader,
4646 _In_ ULONG FromIndex,
4647 _Out_ PULONG StartingRunIndex
4654 _In_ PRTL_BITMAP BitMapHeader,
4655 _In_ ULONG FromIndex,
4656 _Out_ PULONG StartingRunIndex
4659 #if (PHNT_VERSION >= PHNT_WIN7)
4666 _In_ PRTL_BITMAP BitMapHeader,
4667 _In_range_(0, BitMapHeader->SizeOfBitMap - NumberToClear) ULONG StartingIndex,
4668 _In_range_(0, BitMapHeader->SizeOfBitMap - StartingIndex) ULONG NumberToClear
4676 _In_ PRTL_BITMAP BitMapHeader,
4677 _In_range_(0, BitMapHeader->SizeOfBitMap - NumberToSet) ULONG StartingIndex,
4678 _In_range_(0, BitMapHeader->SizeOfBitMap - StartingIndex) ULONG NumberToSet
4694 #define RTL_HANDLE_ALLOCATED (USHORT)0x0001
4711 _In_ ULONG MaximumNumberOfHandles,
4712 _In_ ULONG SizeOfHandleTableEntry,
4713 _Out_ PRTL_HANDLE_TABLE HandleTable
4720 _Inout_ PRTL_HANDLE_TABLE HandleTable
4724 PRTL_HANDLE_TABLE_ENTRY
4727 _In_ PRTL_HANDLE_TABLE HandleTable,
4728 _Out_opt_ PULONG HandleIndex
4735 _In_ PRTL_HANDLE_TABLE HandleTable,
4736 _In_ PRTL_HANDLE_TABLE_ENTRY Handle
4743 _In_ PRTL_HANDLE_TABLE HandleTable,
4744 _In_ PRTL_HANDLE_TABLE_ENTRY Handle
4751 _In_ PRTL_HANDLE_TABLE HandleTable,
4752 _In_ ULONG HandleIndex,
4753 _Out_ PRTL_HANDLE_TABLE_ENTRY *Handle
4758 #define RTL_ATOM_MAXIMUM_INTEGER_ATOM (RTL_ATOM)0xc000
4759 #define RTL_ATOM_INVALID_ATOM (RTL_ATOM)0x0000
4760 #define RTL_ATOM_TABLE_DEFAULT_NUMBER_OF_BUCKETS 37
4761 #define RTL_ATOM_MAXIMUM_NAME_LENGTH 255
4762 #define RTL_ATOM_PINNED 0x01
4768 _In_ ULONG NumberOfBuckets,
4769 _Out_ PVOID *AtomTableHandle
4776 _In_ _Post_invalid_ PVOID AtomTableHandle
4783 _In_ PVOID AtomTableHandle,
4784 _In_ BOOLEAN IncludePinnedAtoms
4791 _In_ PVOID AtomTableHandle,
4792 _In_ PWSTR AtomName,
4800 _In_ PVOID AtomTableHandle,
4801 _In_ PWSTR AtomName,
4809 _In_ PVOID AtomTableHandle,
4817 _In_ PVOID AtomTableHandle,
4825 _In_ PVOID AtomTableHandle,
4827 _Out_opt_ PULONG AtomUsage,
4828 _Out_opt_ PULONG AtomFlags,
4829 _Inout_updates_bytes_to_opt_(*AtomNameLength, *AtomNameLength) PWSTR AtomName,
4830 _Inout_opt_ PULONG AtomNameLength
4833 #if (PHNT_VERSION >= PHNT_VISTA)
4839 _In_ PWSTR AtomName,
4840 _Out_opt_ PUSHORT IntegerAtom
4867 _In_ ULONG SubAuthorityCount
4874 _In_ _Post_invalid_ PSID Sid
4882 _In_ PSID_IDENTIFIER_AUTHORITY IdentifierAuthority,
4883 _In_ UCHAR SubAuthorityCount,
4884 _In_ ULONG SubAuthority0,
4885 _In_ ULONG SubAuthority1,
4886 _In_ ULONG SubAuthority2,
4887 _In_ ULONG SubAuthority3,
4888 _In_ ULONG SubAuthority4,
4889 _In_ ULONG SubAuthority5,
4890 _In_ ULONG SubAuthority6,
4891 _In_ ULONG SubAuthority7,
4900 _In_ PSID_IDENTIFIER_AUTHORITY IdentifierAuthority,
4901 _In_ UCHAR SubAuthorityCount
4904 #if (PHNT_VERSION >= PHNT_THRESHOLD)
4909 _Out_writes_bytes_(SECURITY_SID_SIZE(SubAuthorityCount)) PSID Sid,
4910 _In_ PSID_IDENTIFIER_AUTHORITY IdentifierAuthority,
4911 _In_ UCHAR SubAuthorityCount,
4917 PSID_IDENTIFIER_AUTHORITY
4928 _In_ ULONG SubAuthority
4949 _In_ ULONG DestinationSidLength,
4950 _In_reads_bytes_(DestinationSidLength) PSID DestinationSid,
4954 #if (PHNT_VERSION >= PHNT_VISTA)
4960 _Out_writes_bytes_opt_(*ServiceSidLength) PSID ServiceSid,
4961 _Inout_ PULONG ServiceSidLength
4965 #if (PHNT_VERSION >= PHNT_VISTA)
4973 _Out_ PBOOLEAN pbDominate
4977 #if (PHNT_VERSION >= PHNT_VISTA)
4985 _Out_ PBOOLEAN pbEqual
4989 #if (PHNT_VERSION >= PHNT_VISTA)
4997 _Out_ PBOOLEAN pbHigher
5001 #if (PHNT_VERSION >= PHNT_WIN7)
5007 _In_ ULONG BaseSubAuthority,
5008 _Out_writes_bytes_(*SidLength) PSID Sid,
5009 _Inout_ PULONG SidLength
5013 #if (PHNT_VERSION >= PHNT_WIN7)
5018 _Inout_ PSECURITY_DESCRIPTOR SecurityDescriptor,
5021 _Out_ ULONG *NumChanges
5025 #define MAX_UNICODE_STACK_BUFFER_LENGTH 256
5033 _In_ BOOLEAN AllocateDestinationString
5036 #if (PHNT_VERSION >= PHNT_VISTA)
5042 _In_reads_(SidCount) PSID_AND_ATTRIBUTES SidAttr,
5043 _In_ ULONG SidCount,
5044 _Out_ PSID_AND_ATTRIBUTES_HASH SidAttrHash
5048 #if (PHNT_VERSION >= PHNT_VISTA)
5054 _In_ PSID_AND_ATTRIBUTES_HASH SidAttrHash,
5065 _Out_ PSECURITY_DESCRIPTOR SecurityDescriptor,
5074 _In_ PSECURITY_DESCRIPTOR SecurityDescriptor
5081 _In_ PSECURITY_DESCRIPTOR SecurityDescriptor
5089 _In_reads_bytes_(SecurityDescriptorLength) PSECURITY_DESCRIPTOR SecurityDescriptorInput,
5090 _In_ ULONG SecurityDescriptorLength,
5091 _In_ SECURITY_INFORMATION RequiredInformation
5098 _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
5099 _Out_ PSECURITY_DESCRIPTOR_CONTROL Control,
5100 _Out_ PULONG Revision
5107 _Inout_ PSECURITY_DESCRIPTOR SecurityDescriptor,
5108 _In_ SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest,
5109 _In_ SECURITY_DESCRIPTOR_CONTROL ControlBitsToSet
5116 _Inout_ PSECURITY_DESCRIPTOR SecurityDescriptor,
5117 _In_ SECURITY_DESCRIPTOR_CONTROL Control,
5118 _Out_ PULONG Revision
5125 _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
5126 _Out_ PUCHAR RMControl
5133 _Inout_ PSECURITY_DESCRIPTOR SecurityDescriptor,
5134 _In_opt_ PUCHAR RMControl
5141 _Inout_ PSECURITY_DESCRIPTOR SecurityDescriptor,
5142 _In_ BOOLEAN DaclPresent,
5144 _In_opt_ BOOLEAN DaclDefaulted
5151 _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
5152 _Out_ PBOOLEAN DaclPresent,
5154 _Out_ PBOOLEAN DaclDefaulted
5161 _Inout_ PSECURITY_DESCRIPTOR SecurityDescriptor,
5162 _In_ BOOLEAN SaclPresent,
5164 _In_opt_ BOOLEAN SaclDefaulted
5171 _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
5172 _Out_ PBOOLEAN SaclPresent,
5174 _Out_ PBOOLEAN SaclDefaulted
5181 _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
5182 _Out_ PBOOLEAN SaclPresent,
5184 _Out_ PBOOLEAN SaclDefaulted
5191 _Inout_ PSECURITY_DESCRIPTOR SecurityDescriptor,
5192 _In_opt_ PSID Owner,
5193 _In_opt_ BOOLEAN OwnerDefaulted
5200 _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
5202 _Out_ PBOOLEAN OwnerDefaulted
5209 _Inout_ PSECURITY_DESCRIPTOR SecurityDescriptor,
5210 _In_opt_ PSID Group,
5211 _In_opt_ BOOLEAN GroupDefaulted
5218 _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
5220 _Out_ PBOOLEAN GroupDefaulted
5227 _In_ PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor,
5228 _Out_writes_bytes_(*BufferLength) PSECURITY_DESCRIPTOR SelfRelativeSecurityDescriptor,
5229 _Inout_ PULONG BufferLength
5236 _In_ PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor,
5237 _Out_writes_bytes_to_opt_(*BufferLength, *BufferLength) PSECURITY_DESCRIPTOR SelfRelativeSecurityDescriptor,
5238 _Inout_ PULONG BufferLength
5245 _In_ PSECURITY_DESCRIPTOR SelfRelativeSecurityDescriptor,
5246 _Out_writes_bytes_to_opt_(*AbsoluteSecurityDescriptorSize, *AbsoluteSecurityDescriptorSize) PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor,
5247 _Inout_ PULONG AbsoluteSecurityDescriptorSize,
5248 _Out_writes_bytes_to_opt_(*DaclSize, *DaclSize) PACL Dacl,
5249 _Inout_ PULONG DaclSize,
5250 _Out_writes_bytes_to_opt_(*SaclSize, *SaclSize) PACL Sacl,
5251 _Inout_ PULONG SaclSize,
5252 _Out_writes_bytes_to_opt_(*OwnerSize, *OwnerSize) PSID Owner,
5253 _Inout_ PULONG OwnerSize,
5254 _Out_writes_bytes_to_opt_(*PrimaryGroupSize, *PrimaryGroupSize) PSID PrimaryGroup,
5255 _Inout_ PULONG PrimaryGroupSize
5263 _Inout_ PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor,
5264 _Inout_ PULONG pBufferSize
5273 _In_ ACCESS_MASK GrantedAccess,
5274 _In_ ACCESS_MASK DesiredAccess
5281 _In_ ACCESS_MASK GrantedAccess,
5282 _In_ ACCESS_MASK DesiredAccess
5289 _Inout_ PACCESS_MASK AccessMask,
5290 _In_ PGENERIC_MAPPING GenericMapping
5299 _Out_writes_bytes_(AclLength) PACL Acl,
5300 _In_ ULONG AclLength,
5301 _In_ ULONG AclRevision
5316 _Out_writes_bytes_(AclInformationLength) PVOID AclInformation,
5317 _In_ ULONG AclInformationLength,
5318 _In_ ACL_INFORMATION_CLASS AclInformationClass
5326 _In_reads_bytes_(AclInformationLength) PVOID AclInformation,
5327 _In_ ULONG AclInformationLength,
5328 _In_ ACL_INFORMATION_CLASS AclInformationClass
5336 _In_ ULONG AceRevision,
5337 _In_ ULONG StartingAceIndex,
5338 _In_reads_bytes_(AceListLength) PVOID AceList,
5339 _In_ ULONG AceListLength
5355 _In_ ULONG AceIndex,
5364 _Out_ PVOID *FirstFree
5367 #if (PHNT_VERSION >= PHNT_VISTA)
5375 _Out_opt_ PULONG pIndex
5379 #if (PHNT_VERSION >= PHNT_VISTA)
5394 _In_ ULONG AceRevision,
5395 _In_ ACCESS_MASK AccessMask,
5404 _In_ ULONG AceRevision,
5405 _In_ ULONG AceFlags,
5406 _In_ ACCESS_MASK AccessMask,
5415 _In_ ULONG AceRevision,
5416 _In_ ACCESS_MASK AccessMask,
5425 _In_ ULONG AceRevision,
5426 _In_ ULONG AceFlags,
5427 _In_ ACCESS_MASK AccessMask,
5436 _In_ ULONG AceRevision,
5437 _In_ ACCESS_MASK AccessMask,
5439 _In_ BOOLEAN AuditSuccess,
5440 _In_ BOOLEAN AuditFailure
5448 _In_ ULONG AceRevision,
5449 _In_ ULONG AceFlags,
5450 _In_ ACCESS_MASK AccessMask,
5452 _In_ BOOLEAN AuditSuccess,
5453 _In_ BOOLEAN AuditFailure
5461 _In_ ULONG AceRevision,
5462 _In_ ULONG AceFlags,
5463 _In_ ACCESS_MASK AccessMask,
5464 _In_opt_
PGUID ObjectTypeGuid,
5465 _In_opt_
PGUID InheritedObjectTypeGuid,
5474 _In_ ULONG AceRevision,
5475 _In_ ULONG AceFlags,
5476 _In_ ACCESS_MASK AccessMask,
5477 _In_opt_
PGUID ObjectTypeGuid,
5478 _In_opt_
PGUID InheritedObjectTypeGuid,
5487 _In_ ULONG AceRevision,
5488 _In_ ULONG AceFlags,
5489 _In_ ACCESS_MASK AccessMask,
5490 _In_opt_
PGUID ObjectTypeGuid,
5491 _In_opt_
PGUID InheritedObjectTypeGuid,
5493 _In_ BOOLEAN AuditSuccess,
5494 _In_ BOOLEAN AuditFailure
5502 _In_ ULONG AceRevision,
5504 _In_ ACCESS_MASK AccessMask,
5505 _In_ PSID ServerSid,
5509 #if (PHNT_VERSION >= PHNT_VISTA)
5516 _In_ ULONG AceRevision,
5517 _In_ ULONG AceFlags,
5520 _In_ ACCESS_MASK AccessMask
5530 _In_opt_ PSECURITY_DESCRIPTOR ParentDescriptor,
5531 _In_opt_ PSECURITY_DESCRIPTOR CreatorDescriptor,
5532 _Out_ PSECURITY_DESCRIPTOR *NewDescriptor,
5533 _In_ BOOLEAN IsDirectoryObject,
5534 _In_opt_ HANDLE Token,
5535 _In_ PGENERIC_MAPPING GenericMapping
5542 _In_opt_ PSECURITY_DESCRIPTOR ParentDescriptor,
5543 _In_opt_ PSECURITY_DESCRIPTOR CreatorDescriptor,
5544 _Out_ PSECURITY_DESCRIPTOR *NewDescriptor,
5545 _In_opt_ GUID *ObjectType,
5546 _In_ BOOLEAN IsDirectoryObject,
5547 _In_ ULONG AutoInheritFlags,
5548 _In_opt_ HANDLE Token,
5549 _In_ PGENERIC_MAPPING GenericMapping
5556 _In_opt_ PSECURITY_DESCRIPTOR ParentDescriptor,
5557 _In_opt_ PSECURITY_DESCRIPTOR CreatorDescriptor,
5558 _Out_ PSECURITY_DESCRIPTOR *NewDescriptor,
5559 _In_opt_ GUID **ObjectType,
5560 _In_ ULONG GuidCount,
5561 _In_ BOOLEAN IsDirectoryObject,
5562 _In_ ULONG AutoInheritFlags,
5563 _In_opt_ HANDLE Token,
5564 _In_ PGENERIC_MAPPING GenericMapping
5571 _Inout_ PSECURITY_DESCRIPTOR *ObjectDescriptor
5578 _In_ PSECURITY_DESCRIPTOR ObjectDescriptor,
5579 _In_ SECURITY_INFORMATION SecurityInformation,
5580 _Out_opt_ PSECURITY_DESCRIPTOR ResultantDescriptor,
5581 _In_ ULONG DescriptorLength,
5582 _Out_ PULONG ReturnLength
5589 _In_ SECURITY_INFORMATION SecurityInformation,
5590 _In_ PSECURITY_DESCRIPTOR ModificationDescriptor,
5591 _Inout_ PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor,
5592 _In_ PGENERIC_MAPPING GenericMapping,
5593 _In_opt_ HANDLE Token
5600 _In_ SECURITY_INFORMATION SecurityInformation,
5601 _In_ PSECURITY_DESCRIPTOR ModificationDescriptor,
5602 _Inout_ PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor,
5603 _In_ ULONG AutoInheritFlags,
5604 _In_ PGENERIC_MAPPING GenericMapping,
5605 _In_opt_ HANDLE Token
5612 _In_opt_ PSECURITY_DESCRIPTOR ParentDescriptor,
5613 _In_ PSECURITY_DESCRIPTOR CurrentSecurityDescriptor,
5614 _Out_ PSECURITY_DESCRIPTOR *NewSecurityDescriptor,
5615 _In_opt_ GUID *ObjectType,
5616 _In_ BOOLEAN IsDirectoryObject,
5617 _In_ PGENERIC_MAPPING GenericMapping
5624 _In_ BOOLEAN ParentDescriptorChanged,
5625 _In_ BOOLEAN CreatorDescriptorChanged,
5626 _In_ PLUID OldClientTokenModifiedId,
5627 _Out_ PLUID NewClientTokenModifiedId,
5628 _In_opt_ PSECURITY_DESCRIPTOR ParentDescriptor,
5629 _In_opt_ PSECURITY_DESCRIPTOR CreatorDescriptor,
5630 _Out_ PSECURITY_DESCRIPTOR *NewDescriptor,
5631 _In_ BOOLEAN IsDirectoryObject,
5633 _In_ PGENERIC_MAPPING GenericMapping
5640 _In_ PSECURITY_DESCRIPTOR InputSecurityDescriptor,
5641 _Out_ PSECURITY_DESCRIPTOR *OutputSecurityDescriptor
5650 _Inout_ PUCHAR Seed,
5666 _In_ SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
5669 #if (PHNT_VERSION >= PHNT_VISTA)
5675 _In_ SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
5676 _In_opt_ ACCESS_MASK AdditionalAccess,
5677 _Out_opt_ PHANDLE ThreadToken
5685 _In_ ULONG Privilege,
5686 _In_ BOOLEAN Enable,
5687 _In_ BOOLEAN Client,
5688 _Out_ PBOOLEAN WasEnabled
5691 #define RTL_ACQUIRE_PRIVILEGE_REVERT 0x00000001
5692 #define RTL_ACQUIRE_PRIVILEGE_PROCESS 0x00000002
5698 _In_ PULONG Privilege,
5701 _Out_ PVOID *ReturnedState
5708 _In_ PVOID StatePointer
5711 #if (PHNT_VERSION >= PHNT_VISTA)
5718 _In_ PULONG PrivilegesToKeep,
5719 _In_ ULONG PrivilegeCount
5723 #if (PHNT_VERSION >= PHNT_WIN8)
5729 _In_opt_ HANDLE Handle,
5730 _In_opt_ PVOID Object,
5731 _Out_ PBOOLEAN UntrustedObject
5745 #if (PHNT_VERSION >= PHNT_VISTA)
5761 _In_ PVOID BoundaryDescriptor
5768 _Inout_ PVOID *BoundaryDescriptor,
5769 _In_ PSID RequiredSid
5772 #if (PHNT_VERSION >= PHNT_WIN7)
5778 _Inout_ PVOID *BoundaryDescriptor,
5779 _In_ PSID IntegrityLabel
5793 _Out_ PRTL_OSVERSIONINFOW lpVersionInformation
5800 _In_ PRTL_OSVERSIONINFOEXW VersionInfo,
5801 _In_ ULONG TypeMask,
5802 _In_ ULONGLONG ConditionMask
5826 _Out_opt_ PULONG pNtMajorVersion,
5827 _Out_opt_ PULONG pNtMinorVersion,
5828 _Out_opt_ PULONG pNtBuildNumber
5837 #if (PHNT_VERSION >= PHNT_THRESHOLD)
5852 _Out_ PHANDLE WaitHandle,
5854 _In_ WAITORTIMERCALLBACKFUNC Function,
5856 _In_ ULONG Milliseconds,
5864 _In_ HANDLE WaitHandle
5871 _In_ HANDLE WaitHandle,
5879 _In_ WORKERCALLBACKFUNC Function,
5888 _In_ HANDLE FileHandle,
5889 _In_ APC_CALLBACK_FUNCTION CompletionProc,
5897 _Out_ PHANDLE TimerQueueHandle
5904 _In_ HANDLE TimerQueueHandle,
5905 _Out_ PHANDLE Handle,
5906 _In_ WAITORTIMERCALLBACKFUNC Function,
5917 _In_ HANDLE TimerQueueHandle,
5918 _In_ HANDLE TimerHandle,
5927 _In_ HANDLE TimerQueueHandle,
5928 _In_ HANDLE TimerToCancel,
5936 _In_ HANDLE TimerQueueHandle
5943 _In_ HANDLE TimerQueueHandle,
5960 _In_ ACCESS_MASK DesiredAccess,
5961 _Out_ PHANDLE CurrentUserKey
5964 #define RTL_REGISTRY_ABSOLUTE 0
5965 #define RTL_REGISTRY_SERVICES 1 // \Registry\Machine\System\CurrentControlSet\Services
5966 #define RTL_REGISTRY_CONTROL 2 // \Registry\Machine\System\CurrentControlSet\Control
5967 #define RTL_REGISTRY_WINDOWS_NT 3 // \Registry\Machine\Software\Microsoft\Windows NT\CurrentVersion
5968 #define RTL_REGISTRY_DEVICEMAP 4 // \Registry\Machine\Hardware\DeviceMap
5969 #define RTL_REGISTRY_USER 5 // \Registry\User\CurrentUser
5970 #define RTL_REGISTRY_MAXIMUM 6
5971 #define RTL_REGISTRY_HANDLE 0x40000000
5972 #define RTL_REGISTRY_OPTIONAL 0x80000000
5978 _In_ ULONG RelativeTo,
5986 _In_ ULONG RelativeTo,
5991 _In_ PWSTR ValueName,
5992 _In_ ULONG ValueType,
5993 _In_ PVOID ValueData,
5994 _In_ ULONG ValueLength,
5996 _In_ PVOID EntryContext
6010 #define RTL_QUERY_REGISTRY_SUBKEY 0x00000001
6011 #define RTL_QUERY_REGISTRY_TOPKEY 0x00000002
6012 #define RTL_QUERY_REGISTRY_REQUIRED 0x00000004
6013 #define RTL_QUERY_REGISTRY_NOVALUE 0x00000008
6014 #define RTL_QUERY_REGISTRY_NOEXPAND 0x00000010
6015 #define RTL_QUERY_REGISTRY_DIRECT 0x00000020
6016 #define RTL_QUERY_REGISTRY_DELETE 0x00000040
6022 _In_ ULONG RelativeTo,
6024 _In_ PRTL_QUERY_REGISTRY_TABLE QueryTable,
6026 _In_opt_ PVOID Environment
6033 _In_ ULONG RelativeTo,
6035 _In_ PWSTR ValueName,
6036 _In_ ULONG ValueType,
6037 _In_ PVOID ValueData,
6038 _In_ ULONG ValueLength
6045 _In_ ULONG RelativeTo,
6047 _In_ PWSTR ValueName
6073 #define DBG_STATUS_CONTROL_C 1
6074 #define DBG_STATUS_SYSRQ 2
6075 #define DBG_STATUS_BUGCHECK_FIRST 3
6076 #define DBG_STATUS_BUGCHECK_SECOND 4
6077 #define DBG_STATUS_FATAL 5
6078 #define DBG_STATUS_DEBUG_CONTROL 6
6079 #define DBG_STATUS_WORKER 7
6085 _In_z_ _Printf_format_string_ PSTR Format,
6093 _In_ ULONG ComponentId,
6095 _In_z_ _Printf_format_string_ PSTR Format,
6103 _In_ ULONG ComponentId,
6106 _In_ va_list arglist
6114 _In_ ULONG ComponentId,
6117 _In_ va_list arglist
6124 _In_ ULONG ComponentId,
6132 _In_ ULONG ComponentId,
6142 _Out_writes_bytes_(Length) PCH Response,
6148 #if (PHNT_VERSION >= PHNT_WIN7)
6156 _In_ HANDLE ThreadHandle,
6158 _In_ ULONG64 HardwareCounters,
6159 _Out_ PVOID *PerformanceDataHandle
6166 _In_ PVOID PerformanceDataHandle
6173 _In_ HANDLE ThreadHandle,
6174 _Out_ PBOOLEAN Enabled
6181 _In_ HANDLE PerformanceDataHandle,
6183 _Out_ PPERFORMANCE_DATA PerformanceData
6203 _In_ ULONG32 PartialCrc,
6257 #if (PHNT_VERSION >= PHNT_VISTA)
6262 _Out_ PRTL_ELEVATION_FLAGS Flags
6268 #if (PHNT_VERSION >= PHNT_VISTA)
6278 #if (PHNT_VERSION >= PHNT_VISTA)
6288 #if (PHNT_VERSION >= PHNT_VISTA)
6298 #if (PHNT_VERSION >= PHNT_VISTA)
6308 #if (PHNT_VERSION >= PHNT_VISTA)
6320 #define RTL_UNLOAD_EVENT_TRACE_NUMBER 64
6335 PRTL_UNLOAD_EVENT_TRACE
6341 #if (PHNT_VERSION >= PHNT_VISTA)
6346 _Out_ PULONG *ElementSize,
6347 _Out_ PULONG *ElementCount,
6348 _Out_ PVOID *EventTrace
6354 #if (PHNT_VERSION >= PHNT_WIN7)
6360 _Out_ PLARGE_INTEGER PerformanceCounter
6364 #if (PHNT_VERSION >= PHNT_WIN7)
6370 _Out_ PLARGE_INTEGER PerformanceFrequency
6374 #if (PHNT_VERSION >= PHNT_WIN8)
6380 _In_reads_bytes_(
Size)
const void *Buffer,
6382 _In_ ULONG InitialCrc
6389 _In_reads_bytes_(
Size)
const void *Buffer,
6391 _In_ ULONGLONG InitialCrc