ReactOS 0.4.15-dev-5672-gf73ac17
rtlfuncs.h
Go to the documentation of this file.
1/******************************************************************************
2 * Runtime Library Functions *
3 ******************************************************************************/
4
6#define FAST_FAIL_LEGACY_GS_VIOLATION 0
7#define FAST_FAIL_VTGUARD_CHECK_FAILURE 1
8#define FAST_FAIL_STACK_COOKIE_CHECK_FAILURE 2
9#define FAST_FAIL_CORRUPT_LIST_ENTRY 3
10#define FAST_FAIL_INCORRECT_STACK 4
11#define FAST_FAIL_INVALID_ARG 5
12#define FAST_FAIL_GS_COOKIE_INIT 6
13#define FAST_FAIL_FATAL_APP_EXIT 7
14#define FAST_FAIL_RANGE_CHECK_FAILURE 8
15#define FAST_FAIL_UNSAFE_REGISTRY_ACCESS 9
16#define FAST_FAIL_GUARD_ICALL_CHECK_FAILURE 10
17#define FAST_FAIL_GUARD_WRITE_CHECK_FAILURE 11
18#define FAST_FAIL_INVALID_FIBER_SWITCH 12
19#define FAST_FAIL_INVALID_SET_OF_CONTEXT 13
20#define FAST_FAIL_INVALID_REFERENCE_COUNT 14
21#define FAST_FAIL_INVALID_JUMP_BUFFER 18
22#define FAST_FAIL_MRDATA_MODIFIED 19
23#define FAST_FAIL_INVALID_FAST_FAIL_CODE 0xFFFFFFFF
24
27VOID
28RtlFailFast(
30{
31 __fastfail(Code);
32}
33
34#if !defined(NO_KERNEL_LIST_ENTRY_CHECKS) && (defined(_M_CEE_PURE) || defined(_M_CEE_SAFE))
35#define NO_KERNEL_LIST_ENTRY_CHECKS
36#endif
37
38#if !defined(EXTRA_KERNEL_LIST_ENTRY_CHECKS) && defined(__REACTOS__)
39#define EXTRA_KERNEL_LIST_ENTRY_CHECKS
40#endif
41
42#if !defined(MIDL_PASS) && !defined(SORTPP_PASS)
43
44#define RTL_STATIC_LIST_HEAD(x) LIST_ENTRY x = { &x, &x }
45
47VOID
49 _Out_ PLIST_ENTRY ListHead)
50{
51 ListHead->Flink = ListHead->Blink = ListHead;
52}
53
58 _In_ const LIST_ENTRY * ListHead)
59{
60 return (BOOLEAN)(ListHead->Flink == ListHead);
61}
62
67{
68 PLIST_ENTRY OldFlink;
69 PLIST_ENTRY OldBlink;
70
71 OldFlink = Entry->Flink;
72 OldBlink = Entry->Blink;
73 OldFlink->Blink = OldBlink;
74 OldBlink->Flink = OldFlink;
75 return (BOOLEAN)(OldFlink == OldBlink);
76}
77
78#if !defined(NO_KERNEL_LIST_ENTRY_CHECKS)
80VOID
82 _In_ PVOID P1,
83 _In_ PVOID P2,
84 _In_ PVOID P3)
85{
89
91}
92
94VOID
97{
98 if (Entry->Flink->Blink != Entry || Entry->Blink->Flink != Entry)
99 FatalListEntryError(Entry->Blink, Entry, Entry->Flink);
100}
101#endif
102
107{
108 PLIST_ENTRY OldFlink;
109 PLIST_ENTRY OldBlink;
110
111 OldFlink = Entry->Flink;
112 OldBlink = Entry->Blink;
113#if !defined(NO_KERNEL_LIST_ENTRY_CHECKS)
114#ifdef EXTRA_KERNEL_LIST_ENTRY_CHECKS
115 if (OldFlink == Entry || OldBlink == Entry)
116 FatalListEntryError(OldBlink, Entry, OldFlink);
117#endif
118 if (OldFlink->Blink != Entry || OldBlink->Flink != Entry)
119 FatalListEntryError(OldBlink, Entry, OldFlink);
120#endif
121 OldFlink->Blink = OldBlink;
122 OldBlink->Flink = OldFlink;
123 return (BOOLEAN)(OldFlink == OldBlink);
124}
125
129 _Inout_ PLIST_ENTRY ListHead)
130{
131 PLIST_ENTRY Flink;
133
134#if !defined(NO_KERNEL_LIST_ENTRY_CHECKS) && DBG
135 RtlpCheckListEntry(ListHead);
136#ifdef EXTRA_KERNEL_LIST_ENTRY_CHECKS
137 if (ListHead->Flink == ListHead || ListHead->Blink == ListHead)
138 FatalListEntryError(ListHead->Blink, ListHead, ListHead->Flink);
139#endif
140#endif
141 Entry = ListHead->Flink;
142 Flink = Entry->Flink;
143#if !defined(NO_KERNEL_LIST_ENTRY_CHECKS)
144 if (Entry->Blink != ListHead || Flink->Blink != Entry)
145 FatalListEntryError(ListHead, Entry, Flink);
146#endif
147 ListHead->Flink = Flink;
148 Flink->Blink = ListHead;
149 return Entry;
150}
151
155 _Inout_ PLIST_ENTRY ListHead)
156{
157 PLIST_ENTRY Blink;
159
160#if !defined(NO_KERNEL_LIST_ENTRY_CHECKS) && DBG
161 RtlpCheckListEntry(ListHead);
162#ifdef EXTRA_KERNEL_LIST_ENTRY_CHECKS
163 if (ListHead->Flink == ListHead || ListHead->Blink == ListHead)
164 FatalListEntryError(ListHead->Blink, ListHead, ListHead->Flink);
165#endif
166#endif
167 Entry = ListHead->Blink;
168 Blink = Entry->Blink;
169#if !defined(NO_KERNEL_LIST_ENTRY_CHECKS)
170 if (Blink->Flink != Entry || Entry->Flink != ListHead)
171 FatalListEntryError(Blink, Entry, ListHead);
172#endif
173 ListHead->Blink = Blink;
174 Blink->Flink = ListHead;
175 return Entry;
176}
177
179VOID
181 _Inout_ PLIST_ENTRY ListHead,
183{
184 PLIST_ENTRY OldBlink;
185#if !defined(NO_KERNEL_LIST_ENTRY_CHECKS) && DBG
186 RtlpCheckListEntry(ListHead);
187#endif
188 OldBlink = ListHead->Blink;
189 Entry->Flink = ListHead;
190 Entry->Blink = OldBlink;
191#if !defined(NO_KERNEL_LIST_ENTRY_CHECKS)
192 if (OldBlink->Flink != ListHead)
193 FatalListEntryError(OldBlink->Blink, OldBlink, ListHead);
194#endif
195 OldBlink->Flink = Entry;
196 ListHead->Blink = Entry;
197}
198
200VOID
202 _Inout_ PLIST_ENTRY ListHead,
204{
205 PLIST_ENTRY OldFlink;
206#if !defined(NO_KERNEL_LIST_ENTRY_CHECKS) && DBG
207 RtlpCheckListEntry(ListHead);
208#endif
209 OldFlink = ListHead->Flink;
210 Entry->Flink = OldFlink;
211 Entry->Blink = ListHead;
212#if !defined(NO_KERNEL_LIST_ENTRY_CHECKS)
213 if (OldFlink->Blink != ListHead)
214 FatalListEntryError(ListHead, OldFlink, OldFlink->Flink);
215#endif
216 OldFlink->Blink = Entry;
217 ListHead->Flink = Entry;
218}
219
221VOID
223 _Inout_ PLIST_ENTRY ListHead,
224 _Inout_ PLIST_ENTRY ListToAppend)
225{
226 PLIST_ENTRY ListEnd = ListHead->Blink;
227
228#if !defined(NO_KERNEL_LIST_ENTRY_CHECKS)
229 RtlpCheckListEntry(ListHead);
230 RtlpCheckListEntry(ListToAppend);
231#endif
232 ListHead->Blink->Flink = ListToAppend;
233 ListHead->Blink = ListToAppend->Blink;
234 ListToAppend->Blink->Flink = ListHead;
235 ListToAppend->Blink = ListEnd;
236}
237
242{
243 PSINGLE_LIST_ENTRY FirstEntry;
244 FirstEntry = ListHead->Next;
245 if (FirstEntry != NULL) {
246 ListHead->Next = FirstEntry->Next;
247 }
248 return FirstEntry;
249}
250
252VOID
256{
257 Entry->Next = ListHead->Next;
258 ListHead->Next = Entry;
259}
260
261#endif /* !defined(MIDL_PASS) && !defined(SORTPP_PASS) */
262
265VOID
266NTAPI
268 _In_ PVOID FailedAssertion,
272
273/* VOID
274 * RtlCopyMemory(
275 * IN VOID UNALIGNED *Destination,
276 * IN CONST VOID UNALIGNED *Source,
277 * IN SIZE_T Length)
278 */
279#define RtlCopyMemory(Destination, Source, Length) \
280 memcpy(Destination, Source, Length)
281
282#define RtlCopyBytes RtlCopyMemory
283
284#if defined(_M_AMD64)
286VOID
287NTAPI
292#else
293#define RtlCopyMemoryNonTemporal RtlCopyMemory
294#endif
295
296/* BOOLEAN
297 * RtlEqualLuid(
298 * IN PLUID Luid1,
299 * IN PLUID Luid2)
300 */
301#define RtlEqualLuid(Luid1, Luid2) \
302 (((Luid1)->LowPart == (Luid2)->LowPart) && ((Luid1)->HighPart == (Luid2)->HighPart))
303
304/* LOGICAL
305 * RtlEqualMemory(
306 * IN VOID UNALIGNED *Destination,
307 * IN CONST VOID UNALIGNED *Source,
308 * IN SIZE_T Length)
309 */
310#define RtlEqualMemory(Destination, Source, Length) \
311 (!memcmp(Destination, Source, Length))
312
313/* VOID
314 * RtlFillMemory(
315 * IN VOID UNALIGNED *Destination,
316 * IN SIZE_T Length,
317 * IN UCHAR Fill)
318 */
319#define RtlFillMemory(Destination, Length, Fill) \
320 memset(Destination, Fill, Length)
321
322#define RtlFillBytes RtlFillMemory
323
326VOID
327NTAPI
331
336NTAPI
340
344_At_(DestinationString->Length, _Post_equal_to_(_String_length_(SourceString) * sizeof(WCHAR)))
350VOID
351NTAPI
355
356/* VOID
357 * RtlMoveMemory(
358 * IN VOID UNALIGNED *Destination,
359 * IN CONST VOID UNALIGNED *Source,
360 * IN SIZE_T Length)
361 */
362#define RtlMoveMemory(Destination, Source, Length) \
363 memmove(Destination, Source, Length)
364
369NTAPI
374
375/* VOID
376 * RtlZeroMemory(
377 * IN VOID UNALIGNED *Destination,
378 * IN SIZE_T Length)
379 */
380#define RtlZeroMemory(Destination, Length) \
381 memset(Destination, 0, Length)
382
383#define RtlZeroBytes RtlZeroMemory
385
386#if (NTDDI_VERSION >= NTDDI_WIN2K)
387
392NTAPI
394 _In_ PRTL_BITMAP BitMapHeader,
397
401NTAPI
403 _In_ PRTL_BITMAP BitMapHeader,
406
411NTAPI
418
421ULONG
422NTAPI
425
426#define RtlAnsiStringToUnicodeSize(String) ( \
427 NLS_MB_CODE_PAGE_TAG ? \
428 RtlxAnsiStringToUnicodeSize(String) : \
429 ((String)->Length + sizeof(ANSI_NULL)) * sizeof(WCHAR) \
430)
431
437 _At_(return, _Out_range_(==, 0)))
440 _At_(return, _Out_range_(<, 0)))
443NTAPI
447
448_Success_(1)
451/* _When_(_Old_(Destination->Length) + _String_length_(Source) * sizeof(WCHAR) <= Destination->MaximumLength,
452 _At_(Destination->Length, _Post_equal_to_(_Old_(Destination->Length) + _String_length_(Source) * sizeof(WCHAR)))
453 _At_(return, _Out_range_(==, 0)))
454_When_(_Old_(Destination->Length) + _String_length_(Source) * sizeof(WCHAR) > Destination->MaximumLength,
455 _Unchanged_(Destination->Length)
456 _At_(return, _Out_range_(<, 0))) */
459NTAPI
463
468NTAPI
470 _In_ ULONG RelativeTo,
472
474VOID
475NTAPI
477 _In_ PRTL_BITMAP BitMapHeader);
478
480VOID
481NTAPI
483 _In_ PRTL_BITMAP BitMapHeader,
484 _In_range_(0, BitMapHeader->SizeOfBitMap - NumberToClear) ULONG StartingIndex,
485 _In_range_(0, BitMapHeader->SizeOfBitMap - StartingIndex) ULONG NumberToClear);
486
489SIZE_T
490NTAPI
492 _In_ const VOID *Source1,
493 _In_ const VOID *Source2,
495
499LONG
500NTAPI
502 _In_ PCUNICODE_STRING String1,
505
509LONG
510NTAPI
517
526VOID
527NTAPI
531
535NTAPI
537 _In_ ULONG RelativeTo,
538 _In_ PWSTR Path);
539
543NTAPI
547
551NTAPI
553 _In_ ULONG RelativeTo,
556
561NTAPI
563 _In_ CONST UNICODE_STRING *String1,
566
567#if !defined(_AMD64_) && !defined(_IA64_)
570NTAPI
572 _In_ LARGE_INTEGER Multiplicand,
573 _In_ LONG Multiplier);
574
577NTAPI
579 _In_ LARGE_INTEGER Dividend,
582#endif
583
584#if defined(_X86_) || defined(_IA64_)
587NTAPI
589 _In_ LARGE_INTEGER Dividend,
590 _In_ LARGE_INTEGER MagicDivisor,
591 _In_ CCHAR ShiftCount);
592#endif
593
596VOID
601
602_Success_(return != -1)
605ULONG
606NTAPI
608 _In_ PRTL_BITMAP BitMapHeader,
611
612_Success_(return != -1)
614ULONG
615NTAPI
617 _In_ PRTL_BITMAP BitMapHeader,
620
622ULONG
623NTAPI
625 _In_ PRTL_BITMAP BitMapHeader,
627
629ULONG
630NTAPI
632 _In_ PRTL_BITMAP BitMapHeader,
633 _Out_writes_to_(SizeOfRunArray, return) PRTL_BITMAP_RUN RunArray,
634 _In_range_(>, 0) ULONG SizeOfRunArray,
635 _In_ BOOLEAN LocateLongestRuns);
636
638ULONG
639NTAPI
641 _In_ PRTL_BITMAP BitMapHeader,
642 _In_ ULONG FromIndex,
643 _Out_ PULONG StartingRunIndex);
644
645_Success_(return != -1)
648CCHAR
649NTAPI
652
654ULONG
655NTAPI
657 _In_ PRTL_BITMAP BitMapHeader,
659
660_Success_(return != -1)
663CCHAR
664NTAPI
667
669ULONG
670NTAPI
672 _In_ PRTL_BITMAP BitMapHeader,
673 _In_ ULONG FromIndex,
674 _Out_ PULONG StartingRunIndex);
675
676_Success_(return != -1)
679ULONG
680NTAPI
682 _In_ PRTL_BITMAP BitMapHeader,
685
686_Success_(return != -1)
688ULONG
689NTAPI
691 _In_ PRTL_BITMAP BitMapHeader,
694
697VOID
698NTAPI
702
703_At_(BitMapHeader->SizeOfBitMap, _Post_equal_to_(SizeOfBitMap))
704_At_(BitMapHeader->Buffer, _Post_equal_to_(BitMapBuffer))
706VOID
707NTAPI
709 _Out_ PRTL_BITMAP BitMapHeader,
710 _In_opt_ __drv_aliasesMem PULONG BitMapBuffer,
711 _In_opt_ ULONG SizeOfBitMap);
712
715VOID
716NTAPI
720
725NTAPI
730
735NTAPI
740
741#ifdef _WIN64
742#define RtlIntPtrToUnicodeString(Value, Base, String) \
743 RtlInt64ToUnicodeString(Value, Base, String)
744#else
745#define RtlIntPtrToUnicodeString(Value, Base, String) \
746 RtlIntegerToUnicodeString(Value, Base, String)
747#endif
748
749/* BOOLEAN
750 * RtlIsZeroLuid(
751 * IN PLUID L1);
752 */
753#define RtlIsZeroLuid(_L1) \
754 ((BOOLEAN) ((!(_L1)->LowPart) && (!(_L1)->HighPart)))
755
758ULONG
759NTAPI
762
764ULONG
765NTAPI
767 _In_ PRTL_BITMAP BitMapHeader);
768
770ULONG
771NTAPI
773 _In_ PRTL_BITMAP BitMapHeader);
774
778NTAPI
780 _In_ ULONG RelativeTo,
782 _Inout_ _At_(*(*QueryTable).EntryContext, _Pre_unknown_)
786
787#define SHORT_SIZE (sizeof(USHORT))
788#define SHORT_MASK (SHORT_SIZE - 1)
789#define LONG_SIZE (sizeof(LONG))
790#define LONGLONG_SIZE (sizeof(LONGLONG))
791#define LONG_MASK (LONG_SIZE - 1)
792#define LONGLONG_MASK (LONGLONG_SIZE - 1)
793#define LOWBYTE_MASK 0x00FF
794
795#define FIRSTBYTE(VALUE) ((VALUE) & LOWBYTE_MASK)
796#define SECONDBYTE(VALUE) (((VALUE) >> 8) & LOWBYTE_MASK)
797#define THIRDBYTE(VALUE) (((VALUE) >> 16) & LOWBYTE_MASK)
798#define FOURTHBYTE(VALUE) (((VALUE) >> 24) & LOWBYTE_MASK)
799
801VOID
802NTAPI
804 _In_ PRTL_BITMAP BitMapHeader);
805
807VOID
808NTAPI
810 _In_ PRTL_BITMAP BitMapHeader,
811 _In_range_(0, BitMapHeader->SizeOfBitMap - NumberToSet) ULONG StartingIndex,
812 _In_range_(0, BitMapHeader->SizeOfBitMap - StartingIndex) ULONG NumberToSet);
813
817NTAPI
823
824#if defined(_AMD64_)
825
826/* VOID
827 * RtlStoreUlong(
828 * IN PULONG Address,
829 * IN ULONG Value);
830 */
831#define RtlStoreUlong(Address,Value) \
832 *(ULONG UNALIGNED *)(Address) = (Value)
833
834/* VOID
835 * RtlStoreUlonglong(
836 * IN OUT PULONGLONG Address,
837 * ULONGLONG Value);
838 */
839#define RtlStoreUlonglong(Address,Value) \
840 *(ULONGLONG UNALIGNED *)(Address) = (Value)
841
842/* VOID
843 * RtlStoreUshort(
844 * IN PUSHORT Address,
845 * IN USHORT Value);
846 */
847#define RtlStoreUshort(Address,Value) \
848 *(USHORT UNALIGNED *)(Address) = (Value)
849
850/* VOID
851 * RtlRetrieveUshort(
852 * PUSHORT DestinationAddress,
853 * PUSHORT SourceAddress);
854 */
855#define RtlRetrieveUshort(DestAddress,SrcAddress) \
856 *(USHORT UNALIGNED *)(DestAddress) = *(USHORT)(SrcAddress)
857
858/* VOID
859 * RtlRetrieveUlong(
860 * PULONG DestinationAddress,
861 * PULONG SourceAddress);
862 */
863#define RtlRetrieveUlong(DestAddress,SrcAddress) \
864 *(ULONG UNALIGNED *)(DestAddress) = *(PULONG)(SrcAddress)
865
866#else
867
868#define RtlStoreUlong(Address,Value) \
869 if ((ULONG_PTR)(Address) & LONG_MASK) { \
870 ((PUCHAR) (Address))[LONG_LEAST_SIGNIFICANT_BIT] = (UCHAR)(FIRSTBYTE(Value)); \
871 ((PUCHAR) (Address))[LONG_3RD_MOST_SIGNIFICANT_BIT] = (UCHAR)(SECONDBYTE(Value)); \
872 ((PUCHAR) (Address))[LONG_2ND_MOST_SIGNIFICANT_BIT] = (UCHAR)(THIRDBYTE(Value)); \
873 ((PUCHAR) (Address))[LONG_MOST_SIGNIFICANT_BIT] = (UCHAR)(FOURTHBYTE(Value)); \
874 } \
875 else { \
876 *((PULONG)(Address)) = (ULONG) (Value); \
877 }
878
879#define RtlStoreUlonglong(Address,Value) \
880 if ((ULONG_PTR)(Address) & LONGLONG_MASK) { \
881 RtlStoreUlong((ULONG_PTR)(Address), \
882 (ULONGLONG)(Value) & 0xFFFFFFFF); \
883 RtlStoreUlong((ULONG_PTR)(Address)+sizeof(ULONG), \
884 (ULONGLONG)(Value) >> 32); \
885 } else { \
886 *((PULONGLONG)(Address)) = (ULONGLONG)(Value); \
887 }
888
889#define RtlStoreUshort(Address,Value) \
890 if ((ULONG_PTR)(Address) & SHORT_MASK) { \
891 ((PUCHAR) (Address))[SHORT_LEAST_SIGNIFICANT_BIT] = (UCHAR)(FIRSTBYTE(Value)); \
892 ((PUCHAR) (Address))[SHORT_MOST_SIGNIFICANT_BIT ] = (UCHAR)(SECONDBYTE(Value)); \
893 } \
894 else { \
895 *((PUSHORT) (Address)) = (USHORT)Value; \
896 }
897
898#define RtlRetrieveUshort(DestAddress,SrcAddress) \
899 if ((ULONG_PTR)(SrcAddress) & LONG_MASK) \
900 { \
901 ((PUCHAR)(DestAddress))[0]=((PUCHAR)(SrcAddress))[0]; \
902 ((PUCHAR)(DestAddress))[1]=((PUCHAR)(SrcAddress))[1]; \
903 } \
904 else \
905 { \
906 *((PUSHORT)(DestAddress))=*((PUSHORT)(SrcAddress)); \
907 }
908
909#define RtlRetrieveUlong(DestAddress,SrcAddress) \
910 if ((ULONG_PTR)(SrcAddress) & LONG_MASK) \
911 { \
912 ((PUCHAR)(DestAddress))[0]=((PUCHAR)(SrcAddress))[0]; \
913 ((PUCHAR)(DestAddress))[1]=((PUCHAR)(SrcAddress))[1]; \
914 ((PUCHAR)(DestAddress))[2]=((PUCHAR)(SrcAddress))[2]; \
915 ((PUCHAR)(DestAddress))[3]=((PUCHAR)(SrcAddress))[3]; \
916 } \
917 else \
918 { \
919 *((PULONG)(DestAddress))=*((PULONG)(SrcAddress)); \
920 }
921
922#endif /* defined(_AMD64_) */
923
924#ifdef _WIN64
925/* VOID
926 * RtlStoreUlongPtr(
927 * IN OUT PULONG_PTR Address,
928 * IN ULONG_PTR Value);
929 */
930#define RtlStoreUlongPtr(Address,Value) RtlStoreUlonglong(Address,Value)
931#else
932#define RtlStoreUlongPtr(Address,Value) RtlStoreUlong(Address,Value)
933#endif /* _WIN64 */
934
935_Success_(return != FALSE)
938NTAPI
942
944VOID
945NTAPI
949
951USHORT
955
957ULONG
961
967
970 _Out_range_(<=, (SourceString->MaximumLength / sizeof(WCHAR)))))
978NTAPI
985
990NTAPI
997
1000ULONG
1001NTAPI
1004
1005#define RtlUnicodeStringToAnsiSize(String) ( \
1006 NLS_MB_CODE_PAGE_TAG ? \
1007 RtlxUnicodeStringToAnsiSize(String) : \
1008 ((String)->Length + sizeof(UNICODE_NULL)) / sizeof(WCHAR) \
1009)
1010
1014NTAPI
1019
1022WCHAR
1023NTAPI
1025 _In_ WCHAR SourceCharacter);
1026
1030BOOLEAN
1031NTAPI
1036
1040BOOLEAN
1041NTAPI
1044
1048NTAPI
1050 _Out_
1051 _At_(lpVersionInformation->dwOSVersionInfoSize, _Pre_ _Valid_)
1052 _When_(lpVersionInformation->dwOSVersionInfoSize == sizeof(RTL_OSVERSIONINFOEXW),
1053 _At_((PRTL_OSVERSIONINFOEXW)lpVersionInformation, _Out_))
1054 PRTL_OSVERSIONINFOW lpVersionInformation);
1055
1060NTAPI
1065
1069NTAPI
1071 _In_ ULONG RelativeTo,
1077
1079$if (_NTDDK_)
1080
1081#ifndef RTL_USE_AVL_TABLES
1082
1084VOID
1085NTAPI
1092
1094PVOID
1095NTAPI
1100 _Out_opt_ PBOOLEAN NewElement);
1101
1103PVOID
1104NTAPI
1109 _Out_opt_ PBOOLEAN NewElement,
1110 _In_ PVOID NodeOrParent,
1111 _In_ TABLE_SEARCH_RESULT SearchResult);
1112
1114BOOLEAN
1115NTAPI
1118 _In_ PVOID Buffer);
1119
1122PVOID
1123NTAPI
1126 _In_ PVOID Buffer);
1127
1129PVOID
1130NTAPI
1134 _Out_ PVOID *NodeOrParent,
1135 _Out_ TABLE_SEARCH_RESULT *SearchResult);
1136
1139PVOID
1140NTAPI
1144
1147PVOID
1148NTAPI
1151 _Inout_ PVOID *RestartKey);
1152
1155PVOID
1156NTAPI
1159 _In_ ULONG I);
1160
1162ULONG
1163NTAPI
1166
1169BOOLEAN
1170NTAPI
1173
1174#endif /* !RTL_USE_AVL_TABLES */
1175
1176#define RTL_STACK_WALKING_MODE_FRAMES_TO_SKIP_SHIFT 8
1177
1180NTAPI
1183
1186NTAPI
1188 _In_ PRTL_SPLAY_LINKS Links);
1189
1191VOID
1192NTAPI
1194 _In_ PRTL_SPLAY_LINKS Links,
1196
1200NTAPI
1202 _In_ PRTL_SPLAY_LINKS Links);
1203
1207NTAPI
1209 _In_ PRTL_SPLAY_LINKS Links);
1210
1214NTAPI
1216 _In_ PRTL_SPLAY_LINKS Links);
1217
1221NTAPI
1223 _In_ PRTL_SPLAY_LINKS Links);
1224
1228BOOLEAN
1229NTAPI
1231 _In_ PCUNICODE_STRING String1,
1234
1237VOID
1238NTAPI
1241 _In_ const STRING *SourceString);
1242
1247NTAPI
1254
1257VOID
1258NTAPI
1262
1266NTAPI
1267RtlVolumeDeviceToDosName(
1268 _In_ PVOID VolumeDeviceObject,
1270
1274LONG
1275NTAPI
1277 _In_ const STRING *String1,
1278 _In_ const STRING *String2,
1280
1282VOID
1283NTAPI
1287
1291BOOLEAN
1292NTAPI
1294 _In_ const STRING *String1,
1295 _In_ const STRING *String2,
1297
1301NTAPI
1306
1309CHAR
1310NTAPI
1312 _In_ CHAR Character);
1313
1315ULONG
1316NTAPI
1319 PVOID *Callers,
1321 _In_ ULONG Flags);
1322
1324$if (_NTIFS_)
1325
1330PVOID
1331NTAPI
1333 _In_ HANDLE HeapHandle,
1336
1337_Success_(return != 0)
1339BOOLEAN
1340NTAPI
1342 _In_ PVOID HeapHandle,
1345
1347VOID
1348NTAPI
1351
1354ULONG
1355NTAPI
1356RtlRandom(
1357 _Inout_ PULONG Seed);
1358
1360_Success_(return != 0)
1363BOOLEAN
1364NTAPI
1369
1373BOOLEAN
1374NTAPI
1376 _In_ const STRING *String1,
1379
1383NTAPI
1387
1392NTAPI
1399
1404NTAPI
1411
1416NTAPI
1423
1428NTAPI
1435
1440NTAPI
1441RtlUnicodeStringToCountedOemString(
1447
1452NTAPI
1459
1464NTAPI
1468 PUNICODE_STRING UniDest,
1469 _In_ PCUNICODE_STRING UniSource,
1471
1474VOID
1475NTAPI
1478
1481ULONG
1482NTAPI
1485
1488ULONG
1489NTAPI
1492
1496NTAPI
1503
1507NTAPI
1512
1516NTAPI
1521
1525NTAPI
1532
1536NTAPI
1543
1547NTAPI
1554
1558NTAPI
1565
1569NTAPI
1576
1577#if (NTDDI_VERSION >= NTDDI_VISTASP1)
1581NTAPI
1587#else
1590VOID
1591NTAPI
1597#endif
1598
1602BOOLEAN
1603NTAPI
1608
1612BOOLEAN
1613NTAPI
1615 _Inout_ PWCHAR Char);
1616
1619VOID
1620NTAPI
1622 _Out_ PPREFIX_TABLE PrefixTable);
1623
1626BOOLEAN
1627NTAPI
1629 _In_ PPREFIX_TABLE PrefixTable,
1632
1635VOID
1636NTAPI
1638 _In_ PPREFIX_TABLE PrefixTable,
1640
1645NTAPI
1647 _In_ PPREFIX_TABLE PrefixTable,
1649
1652VOID
1653NTAPI
1655 _Out_ PUNICODE_PREFIX_TABLE PrefixTable);
1656
1659BOOLEAN
1660NTAPI
1662 _In_ PUNICODE_PREFIX_TABLE PrefixTable,
1665
1668VOID
1669NTAPI
1671 _In_ PUNICODE_PREFIX_TABLE PrefixTable,
1673
1678NTAPI
1680 _In_ PUNICODE_PREFIX_TABLE PrefixTable,
1683
1688NTAPI
1690 _In_ PUNICODE_PREFIX_TABLE PrefixTable,
1692
1695SIZE_T
1696NTAPI
1700 _In_ ULONG Pattern);
1701
1702_Success_(return != 0)
1704BOOLEAN
1705NTAPI
1709
1711VOID
1712NTAPI
1716
1717_Success_(return != 0)
1719BOOLEAN
1720NTAPI
1724
1726VOID
1727NTAPI
1731
1735BOOLEAN
1736NTAPI
1738 _In_ PSID Sid);
1739
1742BOOLEAN
1743NTAPI
1745 _In_ PSID Sid1,
1746 _In_ PSID Sid2);
1747
1751BOOLEAN
1752NTAPI
1754 _In_ PSID Sid1,
1756
1759ULONG
1760NTAPI
1763
1765PVOID
1766NTAPI
1769
1773NTAPI
1777 _In_ ULONG SubAuthority0,
1778 _In_ ULONG SubAuthority1,
1779 _In_ ULONG SubAuthority2,
1780 _In_ ULONG SubAuthority3,
1781 _In_ ULONG SubAuthority4,
1782 _In_ ULONG SubAuthority5,
1783 _In_ ULONG SubAuthority6,
1784 _In_ ULONG SubAuthority7,
1785 _Outptr_ PSID *Sid);
1786
1790NTAPI
1792 _Out_ PSID Sid,
1795
1797PULONG
1798NTAPI
1800 _In_ PSID Sid,
1801 _In_ ULONG SubAuthority);
1802
1805ULONG
1806NTAPI
1808 _In_ PSID Sid);
1809
1813NTAPI
1815 _In_ ULONG DestinationSidLength,
1816 _Out_writes_bytes_(DestinationSidLength) PSID DestinationSid,
1818
1822NTAPI
1827
1830VOID
1831NTAPI
1833 _Out_ PLUID DestinationLuid,
1835
1839NTAPI
1844
1848NTAPI
1849RtlAddAce(
1850 _Inout_ PACL Acl,
1855
1859NTAPI
1861 _Inout_ PACL Acl,
1863
1866NTAPI
1868 _In_ PACL Acl,
1870 _Outptr_ PVOID *Ace);
1871
1875NTAPI
1877 _Inout_ PACL Acl,
1880 _In_ PSID Sid);
1881
1885NTAPI
1887 _Inout_ PACL Acl,
1891 _In_ PSID Sid);
1892
1896NTAPI
1900
1903NTAPI
1907 _Out_ PACL *Dacl,
1909
1913NTAPI
1918
1922NTAPI
1925 _Out_ PSID *Owner,
1927
1930_When_(Status >= 0, _Out_range_(==, 0))
1932ULONG
1933NTAPI
1936
1940NTAPI
1942 _In_ PCPTABLEINFO CustomCP,
1948
1952NTAPI
1954 _In_ PCPTABLEINFO CustomCP,
1960
1964NTAPI
1966 _In_ PCPTABLEINFO CustomCP,
1972
1975VOID
1976NTAPI
1978 _In_ PUSHORT TableBase,
1980
1982
1983#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
1984
1985$if (_WDMDDK_)
1986
1987#if (NTDDI_VERSION >= NTDDI_WIN2KSP3)
1989VOID
1994#endif
1995
1997
1998#if (NTDDI_VERSION >= NTDDI_WINXP)
1999
2000$if (_WDMDDK_)
2001
2003VOID
2004NTAPI
2006 _In_ PRTL_BITMAP BitMapHeader,
2007 _In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitNumber);
2008
2011WCHAR
2012NTAPI
2014 _In_ WCHAR SourceCharacter);
2015
2017VOID
2018NTAPI
2019RtlSetBit(
2020 _In_ PRTL_BITMAP BitMapHeader,
2021 _In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitNumber);
2022
2025BOOLEAN
2026NTAPI
2028 _In_ PRTL_BITMAP BitMapHeader,
2029 _In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitNumber);
2030
2034NTAPI
2040
2042
2043$if (_NTDDK_)
2044
2046VOID
2047NTAPI
2054
2056PVOID
2057NTAPI
2062 _Out_opt_ PBOOLEAN NewElement);
2063
2065PVOID
2066NTAPI
2071 _Out_opt_ PBOOLEAN NewElement,
2072 _In_ PVOID NodeOrParent,
2073 _In_ TABLE_SEARCH_RESULT SearchResult);
2074
2076BOOLEAN
2077NTAPI
2080 _In_ PVOID Buffer);
2081
2084PVOID
2085NTAPI
2088 _In_ PVOID Buffer);
2089
2091PVOID
2092NTAPI
2096 _Out_ PVOID *NodeOrParent,
2097 _Out_ TABLE_SEARCH_RESULT *SearchResult);
2098
2101PVOID
2102NTAPI
2106
2109PVOID
2110NTAPI
2113 _Inout_ PVOID *RestartKey);
2114
2117PVOID
2118NTAPI
2122 _Out_ PVOID *RestartKey);
2123
2126PVOID
2127NTAPI
2130 _In_opt_ PRTL_AVL_MATCH_FUNCTION MatchFunction,
2132 _In_ ULONG NextFlag,
2133 _Inout_ PVOID *RestartKey,
2134 _Inout_ PULONG DeleteCount,
2135 _In_ PVOID Buffer);
2136
2139PVOID
2140NTAPI
2143 _In_ ULONG I);
2144
2146ULONG
2147NTAPI
2150
2153BOOLEAN
2154NTAPI
2157
2159$if (_NTIFS_)
2160
2163PVOID
2164NTAPI
2172
2174PVOID
2175NTAPI
2177 _In_ _Post_invalid_ PVOID HeapHandle);
2178
2180USHORT
2181NTAPI
2183 _In_ ULONG FramesToSkip,
2185 _Out_writes_to_(FramesToCapture, return) PVOID *BackTrace,
2187
2190ULONG
2191NTAPI
2193 _Inout_ PULONG Seed);
2194
2198NTAPI
2202
2206NTAPI
2210
2215NTAPI
2220
2223NTAPI
2225 _In_ USHORT CompressionFormatAndEngine,
2226 _Out_ PULONG CompressBufferWorkSpaceSize,
2227 _Out_ PULONG CompressFragmentWorkSpaceSize);
2228
2231NTAPI
2233 _In_ USHORT CompressionFormatAndEngine,
2238 _In_ ULONG UncompressedChunkSize,
2239 _Out_ PULONG FinalCompressedSize,
2241
2245NTAPI
2247 _In_ USHORT CompressionFormat,
2253
2257NTAPI
2259 _In_ USHORT CompressionFormat,
2267
2271NTAPI
2273 _In_ USHORT CompressionFormat,
2278
2282NTAPI
2284 _In_ USHORT CompressionFormat,
2289
2293NTAPI
2302
2306NTAPI
2315
2319NTAPI
2321 _In_ PSID Sid);
2322
2324PUCHAR
2325NTAPI
2327 _In_ PSID Sid);
2328
2330_When_(Status >= 0, _Out_range_(==, 0))
2332ULONG
2333NTAPI
2336
2340NTAPI
2342 _In_ PCUNICODE_STRING VolumeRootPath);
2343
2344#if defined(_M_AMD64)
2345
2347VOID
2351 _In_ ULONG Pattern)
2352{
2354 if ((Length /= 4) != 0) {
2355 if (((ULONG64)Address & 4) != 0) {
2356 *Address = Pattern;
2357 if ((Length -= 1) == 0) {
2358 return;
2359 }
2360 Address += 1;
2361 }
2362 __stosq((PULONG64)(Address), Pattern | ((ULONG64)Pattern << 32), Length / 2);
2363 if ((Length & 1) != 0) Address[Length - 1] = Pattern;
2364 }
2365 return;
2366}
2367
2368#define RtlFillMemoryUlonglong(Destination, Length, Pattern) \
2369 __stosq((PULONG64)(Destination), Pattern, (Length) / 8)
2370
2371#else
2372
2374VOID
2375NTAPI
2379 _In_ ULONG Pattern);
2380
2382VOID
2383NTAPI
2387 _In_ ULONGLONG Pattern);
2388
2389#endif /* defined(_M_AMD64) */
2391
2392#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
2393
2394$if (_NTIFS_)
2395#if (NTDDI_VERSION >= NTDDI_WS03)
2399NTAPI
2403#endif
2404
2405#if (NTDDI_VERSION >= NTDDI_WS03SP1)
2406
2410NTAPI
2416
2420NTAPI
2425
2429NTAPI
2432 _Out_ PSID *Group,
2434
2438NTAPI
2443
2447NTAPI
2460
2461#endif /* (NTDDI_VERSION >= NTDDI_WS03SP1) */
2463
2464#if (NTDDI_VERSION >= NTDDI_VISTA)
2465
2466$if (_WDMDDK_)
2468ULONG
2469NTAPI
2470RtlNumberOfSetBitsUlongPtr(
2472
2475NTAPI
2479 _Out_opt_ PULONGLONG MinimumAddress,
2480 _Out_opt_ PULONGLONG MaximumAddress);
2481
2484NTAPI
2487 _In_ UCHAR Type,
2490 _In_ ULONGLONG MinimumAddress,
2491 _In_ ULONGLONG MaximumAddress);
2492
2495NTAPI
2499
2502NTAPI
2504 _In_ ULONGLONG SourceLength,
2505 _Out_ PULONGLONG TargetLength);
2506
2509NTAPI
2512 _In_ UCHAR Type,
2515
2517$if (_NTDDK_)
2518
2521VOID
2522NTAPI
2524 _Out_ PRTL_RUN_ONCE RunOnce);
2525
2530NTAPI
2532 _Inout_ PRTL_RUN_ONCE RunOnce,
2536
2541NTAPI
2543 _Inout_ PRTL_RUN_ONCE RunOnce,
2546
2550NTAPI
2552 _Inout_ PRTL_RUN_ONCE RunOnce,
2555
2557BOOLEAN
2558NTAPI
2560 _In_ ULONG OSMajorVersion,
2561 _In_ ULONG OSMinorVersion,
2562 _In_ ULONG SpMajorVersion,
2563 _In_ ULONG SpMinorVersion,
2564 _Out_ PULONG ReturnedProductType);
2565
2567$if (_NTIFS_)
2570NTAPI
2571RtlNormalizeString(
2572 _In_ ULONG NormForm,
2577
2580NTAPI
2582 _In_ ULONG NormForm,
2585 _Out_ PBOOLEAN Normalized);
2586
2589NTAPI
2596
2599NTAPI
2601 IN ULONG Flags,
2606
2609NTAPI
2616
2619NTAPI
2622 _Out_writes_bytes_opt_(*ServiceSidLength) PSID ServiceSid,
2623 _Inout_ PULONG ServiceSidLength);
2624
2626LONG
2627NTAPI
2629 _In_ PCUNICODE_STRING Altitude1,
2630 _In_ PCUNICODE_STRING Altitude2);
2631
2633
2634#endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
2635
2636#if (NTDDI_VERSION >= NTDDI_WIN7)
2637
2638$if (_WDMDDK_)
2643NTAPI
2651
2656NTAPI
2664
2666ULONG64
2667NTAPI
2669 IN ULONG64 FeatureMask);
2670
2672$if (_NTDDK_)
2673
2676BOOLEAN
2677NTAPI
2678RtlCreateHashTable(
2683
2685VOID
2686NTAPI
2690
2692BOOLEAN
2693NTAPI
2699
2701BOOLEAN
2702NTAPI
2707
2711NTAPI
2716
2720NTAPI
2724
2726BOOLEAN
2727NTAPI
2731
2735NTAPI
2739
2741VOID
2742NTAPI
2746
2748BOOLEAN
2749NTAPI
2753
2757NTAPI
2761
2763VOID
2764NTAPI
2768
2770BOOLEAN
2771NTAPI
2774
2776BOOLEAN
2777NTAPI
2780
2782$if (_NTIFS_)
2787NTAPI
2792 _In_reads_bytes_(UnicodeStringByteCount) PCWCH UnicodeStringSource,
2794
2799NTAPI
2804 _In_reads_bytes_(UTF8StringByteCount) PCCH UTF8StringSource,
2806
2810NTAPI
2811RtlReplaceSidInSd(
2816
2819NTAPI
2822 _In_ ULONG BaseSubAuthority,
2823 _Out_writes_bytes_(*SidLength) PSID Sid,
2824 _Inout_ PULONG SidLength);
2826
2827#endif /* (NTDDI_VERSION >= NTDDI_WIN7) */
2828
2829$if (_WDMDDK_)
2830
2831#if !defined(MIDL_PASS)
2832/* inline funftions */
2833//DECLSPEC_DEPRECATED_DDK_WINXP
2834static __inline
2838 _In_ LONG SignedInteger)
2839{
2841 ret.QuadPart = SignedInteger;
2842 return ret;
2843}
2844
2845//DECLSPEC_DEPRECATED_DDK_WINXP
2846static __inline
2850 _In_ ULONG UnsignedInteger)
2851{
2853 ret.QuadPart = UnsignedInteger;
2854 return ret;
2855}
2856
2857//DECLSPEC_DEPRECATED_DDK_WINXP
2858static __inline
2862 _In_ LARGE_INTEGER LargeInteger,
2863 _In_ CCHAR ShiftCount)
2864{
2866
2867 Result.QuadPart = LargeInteger.QuadPart << ShiftCount;
2868 return Result;
2869}
2870
2871//DECLSPEC_DEPRECATED_DDK_WINXP
2872static __inline
2876 _In_ LARGE_INTEGER LargeInteger,
2877 _In_ CCHAR ShiftCount)
2878{
2880
2881 Result.QuadPart = (ULONG64)LargeInteger.QuadPart >> ShiftCount;
2882 return Result;
2883}
2884
2885//DECLSPEC_DEPRECATED_DDK
2886static __inline
2887ULONG
2890 _In_ ULARGE_INTEGER Dividend,
2893{
2894 if (Remainder)
2895 *Remainder = (ULONG)(Dividend.QuadPart % Divisor);
2896 return (ULONG)(Dividend.QuadPart / Divisor);
2897}
2898
2899//DECLSPEC_DEPRECATED_DDK
2900static __inline
2904 _In_ LARGE_INTEGER Subtrahend)
2905{
2906 LARGE_INTEGER Difference;
2907
2908 Difference.QuadPart = -Subtrahend.QuadPart;
2909 return Difference;
2910}
2911
2912//DECLSPEC_DEPRECATED_DDK
2913static __inline
2917 _In_ LARGE_INTEGER Minuend,
2918 _In_ LARGE_INTEGER Subtrahend)
2919{
2920 LARGE_INTEGER Difference;
2921
2922 Difference.QuadPart = Minuend.QuadPart - Subtrahend.QuadPart;
2923 return Difference;
2924}
2925
2926//DECLSPEC_DEPRECATED_DDK
2927static __inline
2931 _In_ ULONG Multiplicand,
2932 _In_ ULONG Multiplier)
2933{
2935 ret.QuadPart = (ULONGLONG)Multiplicand * (ULONGLONG)Multiplier;
2936 return ret;
2937}
2938
2939//DECLSPEC_DEPRECATED_DDK
2940static __inline
2944 _In_ LONG Multiplicand,
2945 _In_ LONG Multiplier)
2946{
2948 ret.QuadPart = (LONGLONG)Multiplicand * (ULONGLONG)Multiplier;
2949 return ret;
2950}
2951
2953_At_(AnsiString->Length, _Post_equal_to_(0))
2956VOID
2957RtlInitEmptyAnsiString(
2961{
2962 AnsiString->Length = 0;
2963 AnsiString->MaximumLength = BufferSize;
2964 AnsiString->Buffer = Buffer;
2965}
2966
2971VOID
2972RtlInitEmptyUnicodeString(
2978{
2979 UnicodeString->Length = 0;
2980 UnicodeString->MaximumLength = BufferSize;
2981 UnicodeString->Buffer = Buffer;
2982}
2984
2985#if defined(_AMD64_) || defined(_IA64_)
2986
2987$if (_WDMDDK_)
2988
2989static __inline
2993 _In_ LARGE_INTEGER Multiplicand,
2994 _In_ LONG Multiplier)
2995{
2997 ret.QuadPart = Multiplicand.QuadPart * Multiplier;
2998 return ret;
2999}
3000
3001static __inline
3005 _In_ LARGE_INTEGER Dividend,
3008{
3010 ret.QuadPart = (ULONG64)Dividend.QuadPart / Divisor;
3011 if (Remainder)
3012 *Remainder = (ULONG)(Dividend.QuadPart % Divisor);
3013 return ret;
3014}
3015
3017
3018$if (_NTDDK_)
3019
3020//DECLSPEC_DEPRECATED_DDK_WINXP
3025 _In_ LARGE_INTEGER Dividend,
3028{
3030 ret.QuadPart = Dividend.QuadPart / Divisor.QuadPart;
3031 if (Remainder)
3032 Remainder->QuadPart = Dividend.QuadPart % Divisor.QuadPart;
3033 return ret;
3034}
3035
3036#else
3037
3038#if (NTDDI_VERSION >= NTDDI_WIN2K)
3041NTAPI
3043 _In_ LARGE_INTEGER Dividend,
3046#endif
3047
3049
3050#endif /* defined(_AMD64_) || defined(_IA64_) */
3051
3052$if (_WDMDDK_)
3053
3054#if defined(_AMD64_)
3055
3056#define MultiplyHigh __mulh
3057#define UnsignedMultiplyHigh __umulh
3058
3059//DECLSPEC_DEPRECATED_DDK
3060static __inline
3064 _In_ LARGE_INTEGER Dividend,
3065 _In_ LARGE_INTEGER MagicDivisor,
3066 _In_ CCHAR ShiftCount)
3067{
3069 ULONG64 ret64;
3070 BOOLEAN Pos;
3071 Pos = (Dividend.QuadPart >= 0);
3072 ret64 = UnsignedMultiplyHigh(Pos ? Dividend.QuadPart : -Dividend.QuadPart,
3073 MagicDivisor.QuadPart);
3074 ret64 >>= ShiftCount;
3075 ret.QuadPart = Pos ? ret64 : -(LONG64)ret64;
3076 return ret;
3077}
3078#endif
3079
3080//DECLSPEC_DEPRECATED_DDK
3081static __inline
3085 _In_ LARGE_INTEGER Addend1,
3087{
3089 ret.QuadPart = Addend1.QuadPart + Addend2.QuadPart;
3090 return ret;
3091}
3092
3093/* VOID
3094 * RtlLargeIntegerAnd(
3095 * IN OUT LARGE_INTEGER Result,
3096 * IN LARGE_INTEGER Source,
3097 * IN LARGE_INTEGER Mask);
3098 */
3099#define RtlLargeIntegerAnd(Result, Source, Mask) \
3100 Result.QuadPart = Source.QuadPart & Mask.QuadPart
3101
3102//DECLSPEC_DEPRECATED_DDK
3103static __inline
3107 _In_ LARGE_INTEGER LargeInteger,
3108 _In_ CCHAR ShiftCount)
3109{
3111 ret.QuadPart = LargeInteger.QuadPart >> ShiftCount;
3112 return ret;
3113}
3114
3115/* BOOLEAN
3116 * RtlLargeIntegerEqualTo(
3117 * IN LARGE_INTEGER Operand1,
3118 * IN LARGE_INTEGER Operand2);
3119 */
3120#define RtlLargeIntegerEqualTo(X,Y) \
3121 (!(((X).LowPart ^ (Y).LowPart) | ((X).HighPart ^ (Y).HighPart)))
3122
3124PVOID
3128{
3129 volatile char* vptr = (volatile char*)Pointer;
3130#if defined(_M_AMD64)
3131 __stosb((PUCHAR)vptr, 0, Size);
3132#else
3133 char * endptr = (char *)vptr + Size;
3134 while (vptr < endptr) {
3135 *vptr = 0; vptr++;
3136 }
3137#endif
3138 return Pointer;
3139}
3140
3141#if defined(_M_AMD64)
3144BOOLEAN
3146 _In_ PRTL_BITMAP BitMapHeader,
3147 _In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitPosition)
3148{
3149 return BitTest64((LONG64 CONST*)BitMapHeader->Buffer, (LONG64)BitPosition);
3150}
3151#else
3152#define RtlCheckBit(BMH,BP) (((((PLONG)(BMH)->Buffer)[(BP)/32]) >> ((BP)%32)) & 0x1)
3153#endif /* defined(_M_AMD64) */
3154
3155#define RtlLargeIntegerGreaterThan(X,Y) ( \
3156 (((X).HighPart == (Y).HighPart) && ((X).LowPart > (Y).LowPart)) || \
3157 ((X).HighPart > (Y).HighPart) \
3158)
3159
3160#define RtlLargeIntegerGreaterThanOrEqualTo(X,Y) ( \
3161 (((X).HighPart == (Y).HighPart) && ((X).LowPart >= (Y).LowPart)) || \
3162 ((X).HighPart > (Y).HighPart) \
3163)
3164
3165#define RtlLargeIntegerNotEqualTo(X,Y) ( \
3166 (((X).LowPart ^ (Y).LowPart) | ((X).HighPart ^ (Y).HighPart)) \
3167)
3168
3169#define RtlLargeIntegerLessThan(X,Y) ( \
3170 (((X).HighPart == (Y).HighPart) && ((X).LowPart < (Y).LowPart)) || \
3171 ((X).HighPart < (Y).HighPart) \
3172)
3173
3174#define RtlLargeIntegerLessThanOrEqualTo(X,Y) ( \
3175 (((X).HighPart == (Y).HighPart) && ((X).LowPart <= (Y).LowPart)) || \
3176 ((X).HighPart < (Y).HighPart) \
3177)
3178
3179#define RtlLargeIntegerGreaterThanZero(X) ( \
3180 (((X).HighPart == 0) && ((X).LowPart > 0)) || \
3181 ((X).HighPart > 0 ) \
3182)
3183
3184#define RtlLargeIntegerGreaterOrEqualToZero(X) ( (X).HighPart >= 0 )
3185
3186#define RtlLargeIntegerEqualToZero(X) ( !((X).LowPart | (X).HighPart) )
3187
3188#define RtlLargeIntegerNotEqualToZero(X) ( ((X).LowPart | (X).HighPart) )
3189
3190#define RtlLargeIntegerLessThanZero(X) ( ((X).HighPart < 0) )
3191
3192#define RtlLargeIntegerLessOrEqualToZero(X) ( ((X).HighPart < 0) || !((X).LowPart | (X).HighPart) )
3193
3194#endif /* !defined(MIDL_PASS) */
3195
3196/* Byte Swap Functions */
3197#define RtlUshortByteSwap(_x) _byteswap_ushort((USHORT)(_x))
3198#define RtlUlongByteSwap(_x) _byteswap_ulong((_x))
3199#define RtlUlonglongByteSwap(_x) _byteswap_uint64((_x))
3200
3201#if defined(_MSC_VER) && !defined(__clang__)
3202# define __assert_annotationA(msg) __annotation(L"Debug", L"AssertFail", L ## msg)
3203# define __assert_annotationW(msg) __annotation(L"Debug", L"AssertFail", msg)
3204#else
3205# define __assert_annotationA(msg) \
3206 DbgPrint("Assertion failed at %s(%d): %s\n", __FILE__, __LINE__, msg)
3207# define __assert_annotationW(msg) \
3208 DbgPrint("Assertion failed at %s(%d): %S\n", __FILE__, __LINE__, msg)
3209#endif
3210
3211#ifdef _PREFAST_
3212# define NT_ANALYSIS_ASSUME(_exp) _Analysis_assume_(_exp)
3213#elif DBG
3214# define NT_ANALYSIS_ASSUME(_exp) ((void)0)
3215#else
3216# define NT_ANALYSIS_ASSUME(_exp) __noop(_exp)
3217#endif
3218
3219#define NT_ASSERT_ACTION(exp) \
3220 (NT_ANALYSIS_ASSUME(exp), \
3221 ((!(exp)) ? \
3222 (__assert_annotationA(#exp), \
3223 DbgRaiseAssertionFailure(), FALSE) : TRUE))
3224
3225#define NT_ASSERTMSG_ACTION(msg, exp) \
3226 (NT_ANALYSIS_ASSUME(exp), \
3227 ((!(exp)) ? \
3228 (__assert_annotationA(msg), \
3229 DbgRaiseAssertionFailure(), FALSE) : TRUE))
3230
3231#define NT_ASSERTMSGW_ACTION(msg, exp) \
3232 (NT_ANALYSIS_ASSUME(exp), \
3233 ((!(exp)) ? \
3234 (__assert_annotationW(msg), \
3235 DbgRaiseAssertionFailure(), FALSE) : TRUE))
3236
3237#if DBG
3238
3239#define RTL_VERIFY(exp) \
3240 ((!(exp)) ? \
3241 RtlAssert( (PVOID)#exp, (PVOID)__FILE__, __LINE__, NULL ), FALSE : TRUE)
3242
3243#define RTL_VERIFYMSG(msg, exp) \
3244 ((!(exp)) ? \
3245 RtlAssert( (PVOID)#exp, (PVOID)__FILE__, __LINE__, (PCHAR)msg ), FALSE : TRUE)
3246
3247#define RTL_SOFT_VERIFY(exp) \
3248 ((!(exp)) ? \
3249 DbgPrint("%s(%d): Soft assertion failed\n Expression: %s\n", __FILE__, __LINE__, #exp), FALSE : TRUE)
3250
3251#define RTL_SOFT_VERIFYMSG(msg, exp) \
3252 ((!(exp)) ? \
3253 DbgPrint("%s(%d): Soft assertion failed\n Expression: %s\n Message: %s\n", __FILE__, __LINE__, #exp, (msg)), FALSE : TRUE)
3254
3255/* The ASSERTs must be cast to void to avoid warnings about unused results. */
3256#define ASSERT (void)RTL_VERIFY
3257#define ASSERTMSG (void)RTL_VERIFYMSG
3258#define RTL_SOFT_ASSERT (void)RTL_SOFT_VERIFY
3259#define RTL_SOFT_ASSERTMSG (void)RTL_SOFT_VERIFYMSG
3260
3261#define NT_VERIFY NT_ASSERT_ACTION
3262#define NT_VERIFYMSG NT_ASSERTMSG_ACTION
3263#define NT_VERIFYMSGW NT_ASSERTMSGW_ACTION
3264
3265#define NT_ASSERT_ASSUME (void)NT_ASSERT_ACTION
3266#define NT_ASSERTMSG_ASSUME (void)NT_ASSERTMSG_ACTION
3267#define NT_ASSERTMSGW_ASSUME (void)NT_ASSERTMSGW_ACTION
3268
3269#define NT_ASSERT_NOASSUME (void)NT_ASSERT_ACTION
3270#define NT_ASSERTMSG_NOASSUME (void)NT_ASSERTMSG_ACTION
3271#define NT_ASSERTMSGW_NOASSUME (void)NT_ASSERTMSGW_ACTION
3272
3273#else /* !DBG */
3274
3275#define ASSERT(exp) ((void)0)
3276#define ASSERTMSG(msg, exp) ((void)0)
3277
3278#define RTL_SOFT_ASSERT(exp) ((void)0)
3279#define RTL_SOFT_ASSERTMSG(msg, exp) ((void)0)
3280
3281#define RTL_VERIFY(exp) ((exp) ? TRUE : FALSE)
3282#define RTL_VERIFYMSG(msg, exp) ((exp) ? TRUE : FALSE)
3283
3284#define RTL_SOFT_VERIFY(exp) ((exp) ? TRUE : FALSE)
3285#define RTL_SOFT_VERIFYMSG(msg, exp) ((exp) ? TRUE : FALSE)
3286
3287#define NT_VERIFY(exp) (NT_ANALYSIS_ASSUME(exp), ((exp) ? TRUE : FALSE))
3288#define NT_VERIFYMSG(msg, exp) (NT_ANALYSIS_ASSUME(exp), ((exp) ? TRUE : FALSE))
3289#define NT_VERIFYMSGW(msg, exp) (NT_ANALYSIS_ASSUME(exp), ((exp) ? TRUE : FALSE))
3290
3291#define NT_ASSERT_ASSUME(exp) (NT_ANALYSIS_ASSUME(exp), (void)0)
3292#define NT_ASSERTMSG_ASSUME(msg, exp) (NT_ANALYSIS_ASSUME(exp), (void)0)
3293#define NT_ASSERTMSGW_ASSUME(msg, exp) (NT_ANALYSIS_ASSUME(exp), (void)0)
3294
3295#define NT_ASSERT_NOASSUME(exp) ((void)0)
3296#define NT_ASSERTMSG_NOASSUME(msg, exp) ((void)0)
3297#define NT_ASSERTMSGW_NOASSUME(msg, exp) ((void)0)
3298
3299#endif /* DBG */
3300
3301#define NT_FRE_ASSERT (void)NT_ASSERT_ACTION
3302#define NT_FRE_ASSERTMSG (void)NT_ASSERTMSG_ACTION
3303#define NT_FRE_ASSERTMSGW (void)NT_ASSERTMSGW_ACTION
3304
3305#ifdef NT_ASSERT_ALWAYS_ASSUMES
3306# define NT_ASSERT NT_ASSERT_ASSUME
3307# define NT_ASSERTMSG NT_ASSERTMSG_ASSUME
3308# define NT_ASSERTMSGW NT_ASSERTMSGW_ASSUME
3309#else
3310# define NT_ASSERT NT_ASSERT_NOASSUME
3311# define NT_ASSERTMSG NT_ASSERTMSG_NOASSUME
3312# define NT_ASSERTMSGW NT_ASSERTMSGW_NOASSUME
3313#endif /* NT_ASSERT_ALWAYS_ASSUMES */
3314
3315#if defined(_MSC_VER) && (defined(__REACTOS__) || defined(ASSERT_ALWAYS_NT_ASSERT)) && !defined(_BLDR_)
3316#undef ASSERT
3317#define ASSERT NT_ASSERT
3318#undef ASSERTMSG
3319#define ASSERTMSG NT_ASSERTMSG
3320#undef ASSERTMSGW
3321#define ASSERTMSGW NT_ASSERTMSGW
3322#undef RTL_VERIFY
3323#define RTL_VERIFY NT_VERIFY
3324#endif
3325
3326#define InitializeListHead32(ListHead) (\
3327 (ListHead)->Flink = (ListHead)->Blink = PtrToUlong((ListHead)))
3328
3329#if !defined(_WINBASE_)
3330
3331#if defined(_WIN64) && !defined(_NTSYSTEM_) && (defined(_NTDRIVER_) || defined(_NTDDK_) || defined(_NTIFS_) || defined(_NTHAL_) || !defined(_NTOSP_))
3332
3334VOID
3336 _Out_ PSLIST_HEADER SListHead);
3337
3338#else /* defined(_WIN64) && ... */
3339
3340/* HACK */
3344VOID
3345NTAPI
3348
3350VOID
3352 _Out_ PSLIST_HEADER SListHead)
3353{
3354#if defined(_WIN64)
3355 if (((ULONG_PTR)SListHead & 0xf) != 0) {
3357 }
3358#if defined(_IA64_)
3359 SListHead->Region = (ULONG_PTR)SListHead & VRN_MASK;
3360#else
3361 SListHead->Region = 0;
3362#endif /* _IA64_ */
3363#endif /* _WIN64 */
3364 SListHead->Alignment = 0;
3365}
3366
3367#endif /* defined(_WIN64) && ... */
3368
3369#ifdef _X86_
3370
3375 _Inout_ PSLIST_HEADER SListHead,
3377
3382 _Inout_ PSLIST_HEADER SListHead);
3383
3384#define InterlockedFlushSList(SListHead) \
3385 ExInterlockedFlushSList(SListHead)
3386
3387#else /* !_X86_ */
3388
3389#define InterlockedPushEntrySList(SListHead, SListEntry) \
3390 ExpInterlockedPushEntrySList(SListHead, SListEntry)
3391
3392#define InterlockedPopEntrySList(SListHead) \
3393 ExpInterlockedPopEntrySList(SListHead)
3394
3395#define InterlockedFlushSList(SListHead) \
3396 ExpInterlockedFlushSList(SListHead)
3397
3398#endif /* _X86_ */
3399
3400#define QueryDepthSList(SListHead) \
3401 ExQueryDepthSList(SListHead)
3402
3403#endif /* !defined(_WINBASE_) */
3404
3405#define RTL_CONTEXT_EX_OFFSET(ContextEx, Chunk) ((ContextEx)->Chunk.Offset)
3406#define RTL_CONTEXT_EX_LENGTH(ContextEx, Chunk) ((ContextEx)->Chunk.Length)
3407#define RTL_CONTEXT_EX_CHUNK(Base, Layout, Chunk) \
3408 ((PVOID)((PCHAR)(Base) + RTL_CONTEXT_EX_OFFSET(Layout, Chunk)))
3409#define RTL_CONTEXT_OFFSET(Context, Chunk) \
3410 RTL_CONTEXT_EX_OFFSET((PCONTEXT_EX)(Context + 1), Chunk)
3411#define RTL_CONTEXT_LENGTH(Context, Chunk) \
3412 RTL_CONTEXT_EX_LENGTH((PCONTEXT_EX)(Context + 1), Chunk)
3413#define RTL_CONTEXT_CHUNK(Context, Chunk) \
3414 RTL_CONTEXT_EX_CHUNK((PCONTEXT_EX)(Context + 1), \
3415 (PCONTEXT_EX)(Context + 1), \
3416 Chunk)
3417
3418BOOLEAN
3421
3422BOOLEAN
3425
3426#ifndef RtlIsNtDdiVersionAvailable
3427#define RtlIsNtDdiVersionAvailable WdmlibRtlIsNtDdiVersionAvailable
3428#endif
3429
3430#ifndef RtlIsServicePackVersionInstalled
3431#define RtlIsServicePackVersionInstalled WdmlibRtlIsServicePackVersionInstalled
3432#endif
3433
3434#define RtlInterlockedSetBits(Flags, Flag) \
3435 InterlockedOr((PLONG)(Flags), Flag)
3436
3437#define RtlInterlockedAndBits(Flags, Flag) \
3438 InterlockedAnd((PLONG)(Flags), Flag)
3439
3440#define RtlInterlockedClearBits(Flags, Flag) \
3441 RtlInterlockedAndBits(Flags, ~(Flag))
3442
3443#define RtlInterlockedXorBits(Flags, Flag) \
3444 InterlockedXor(Flags, Flag)
3445
3446#define RtlInterlockedSetBitsDiscardReturn(Flags, Flag) \
3447 (VOID) RtlInterlockedSetBits(Flags, Flag)
3448
3449#define RtlInterlockedAndBitsDiscardReturn(Flags, Flag) \
3450 (VOID) RtlInterlockedAndBits(Flags, Flag)
3451
3452#define RtlInterlockedClearBitsDiscardReturn(Flags, Flag) \
3453 RtlInterlockedAndBitsDiscardReturn(Flags, ~(Flag))
3454
3456
3457$if (_NTDDK_)
3458
3459#ifdef RTL_USE_AVL_TABLES
3460
3461#define RtlInitializeGenericTable RtlInitializeGenericTableAvl
3462#define RtlInsertElementGenericTable RtlInsertElementGenericTableAvl
3463#define RtlInsertElementGenericTableFull RtlInsertElementGenericTableFullAvl
3464#define RtlDeleteElementGenericTable RtlDeleteElementGenericTableAvl
3465#define RtlLookupElementGenericTable RtlLookupElementGenericTableAvl
3466#define RtlLookupElementGenericTableFull RtlLookupElementGenericTableFullAvl
3467#define RtlEnumerateGenericTable RtlEnumerateGenericTableAvl
3468#define RtlEnumerateGenericTableWithoutSplaying RtlEnumerateGenericTableWithoutSplayingAvl
3469#define RtlGetElementGenericTable RtlGetElementGenericTableAvl
3470#define RtlNumberGenericTableElements RtlNumberGenericTableElementsAvl
3471#define RtlIsGenericTableEmpty RtlIsGenericTableEmptyAvl
3472
3473#endif /* RTL_USE_AVL_TABLES */
3474
3475#define RtlInitializeSplayLinks(Links) { \
3476 PRTL_SPLAY_LINKS _SplayLinks; \
3477 _SplayLinks = (PRTL_SPLAY_LINKS)(Links); \
3478 _SplayLinks->Parent = _SplayLinks; \
3479 _SplayLinks->LeftChild = NULL; \
3480 _SplayLinks->RightChild = NULL; \
3481}
3482
3483#define RtlIsLeftChild(Links) \
3484 (RtlLeftChild(RtlParent(Links)) == (PRTL_SPLAY_LINKS)(Links))
3485
3486#define RtlIsRightChild(Links) \
3487 (RtlRightChild(RtlParent(Links)) == (PRTL_SPLAY_LINKS)(Links))
3488
3489#define RtlRightChild(Links) \
3490 ((PRTL_SPLAY_LINKS)(Links))->RightChild
3491
3492#define RtlIsRoot(Links) \
3493 (RtlParent(Links) == (PRTL_SPLAY_LINKS)(Links))
3494
3495#define RtlLeftChild(Links) \
3496 ((PRTL_SPLAY_LINKS)(Links))->LeftChild
3497
3498#define RtlParent(Links) \
3499 ((PRTL_SPLAY_LINKS)(Links))->Parent
3500
3501#define RtlInsertAsLeftChild(ParentLinks,ChildLinks) \
3502 { \
3503 PRTL_SPLAY_LINKS _SplayParent; \
3504 PRTL_SPLAY_LINKS _SplayChild; \
3505 _SplayParent = (PRTL_SPLAY_LINKS)(ParentLinks); \
3506 _SplayChild = (PRTL_SPLAY_LINKS)(ChildLinks); \
3507 _SplayParent->LeftChild = _SplayChild; \
3508 _SplayChild->Parent = _SplayParent; \
3509 }
3510
3511#define RtlInsertAsRightChild(ParentLinks,ChildLinks) \
3512 { \
3513 PRTL_SPLAY_LINKS _SplayParent; \
3514 PRTL_SPLAY_LINKS _SplayChild; \
3515 _SplayParent = (PRTL_SPLAY_LINKS)(ParentLinks); \
3516 _SplayChild = (PRTL_SPLAY_LINKS)(ChildLinks); \
3517 _SplayParent->RightChild = _SplayChild; \
3518 _SplayChild->Parent = _SplayParent; \
3519 }
3520
3521#if !defined(MIDL_PASS)
3522
3524LUID
3526RtlConvertLongToLuid(
3527 _In_ LONG Val)
3528{
3529 LUID Luid;
3530 LARGE_INTEGER Temp;
3531
3532 Temp.QuadPart = Val;
3533 Luid.LowPart = Temp.u.LowPart;
3534 Luid.HighPart = Temp.u.HighPart;
3535 return Luid;
3536}
3537
3539LUID
3542 _In_ ULONG Val)
3543{
3544 LUID Luid;
3545
3546 Luid.LowPart = Val;
3547 Luid.HighPart = 0;
3548 return Luid;
3549}
3550
3551#endif /* !defined(MIDL_PASS) */
3552
3553#if (defined(_M_AMD64) || defined(_M_IA64)) && !defined(_REALLY_GET_CALLERS_CALLER_)
3554#define RtlGetCallersAddress(CallersAddress, CallersCaller) \
3555 *CallersAddress = (PVOID)_ReturnAddress(); \
3556 *CallersCaller = NULL;
3557#else
3558#if (NTDDI_VERSION >= NTDDI_WIN2K)
3560VOID
3561NTAPI
3563 _Out_ PVOID *CallersAddress,
3564 _Out_ PVOID *CallersCaller);
3565#endif
3566#endif
3567
3568#if !defined(MIDL_PASS) && !defined(SORTPP_PASS)
3569
3570#if (NTDDI_VERSION >= NTDDI_WIN7)
3571
3573VOID
3574NTAPI
3577{
3578 Context->ChainHead = NULL;
3579 Context->PrevLinkage = NULL;
3580}
3581
3583VOID
3584NTAPI
3588{
3589 Context->ChainHead = Enumerator->ChainHead;
3590 Context->PrevLinkage = Enumerator->HashEntry.Linkage.Blink;
3591}
3592
3594VOID
3595NTAPI
3598{
3600 return;
3601}
3602
3604ULONG
3605NTAPI
3608{
3609 return HashTable->TableSize;
3610}
3611
3613ULONG
3614NTAPI
3617{
3618 return HashTable->NonEmptyBuckets;
3619}
3620
3622ULONG
3623NTAPI
3626{
3627 return HashTable->TableSize - HashTable->NonEmptyBuckets;
3628}
3629
3631ULONG
3632NTAPI
3635{
3636 return HashTable->NumEntries;
3637}
3638
3640ULONG
3641NTAPI
3644{
3645 return HashTable->NumEnumerators;
3646}
3647
3648#endif /* (NTDDI_VERSION >= NTDDI_WIN7) */
3649
3650#endif /* !defined(MIDL_PASS) && !defined(SORTPP_PASS) */
3651
3653$if (_NTIFS_)
3654
3655#define RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE 1
3656#define RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING 2
3657
3658#define RtlUnicodeStringToOemSize(STRING) (NLS_MB_OEM_CODE_PAGE_TAG ? \
3659 RtlxUnicodeStringToOemSize(STRING) : \
3660 ((STRING)->Length + sizeof(UNICODE_NULL)) / sizeof(WCHAR) \
3661)
3662
3663#define RtlOemStringToUnicodeSize(STRING) ( \
3664 NLS_MB_OEM_CODE_PAGE_TAG ? \
3665 RtlxOemStringToUnicodeSize(STRING) : \
3666 ((STRING)->Length + sizeof(ANSI_NULL)) * sizeof(WCHAR) \
3667)
3668
3669#define RtlOemStringToCountedUnicodeSize(STRING) ( \
3670 (ULONG)(RtlOemStringToUnicodeSize(STRING) - sizeof(UNICODE_NULL)) \
3671)
3672
3673#define RtlOffsetToPointer(B,O) ((PCHAR)(((PCHAR)(B)) + ((ULONG_PTR)(O))))
3674#define RtlPointerToOffset(B,P) ((ULONG)(((PCHAR)(P)) - ((PCHAR)(B))))
DWORD WINAPI RtlRunOnceExecuteOnce(RTL_RUN_ONCE *once, PRTL_RUN_ONCE_INIT_FN func, void *param, void **context)
Definition: runonce.c:107
unsigned char BOOLEAN
NTSYSAPI VOID NTAPI RtlGenerate8dot3Name(_In_ PCUNICODE_STRING Name, _In_ BOOLEAN AllowExtendedCharacters, _Inout_ PGENERATE_NAME_CONTEXT Context, _Inout_ PUNICODE_STRING Name8dot3)
static GENERIC_MAPPING GenericMapping
Definition: SeInheritance.c:11
Type
Definition: Type.h:7
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 LineNumber
Definition: acpixf.h:1220
VOID NTAPI RtlInitializeGenericTableAvl(IN OUT PRTL_AVL_TABLE Table, IN PRTL_AVL_COMPARE_ROUTINE CompareRoutine, IN PRTL_AVL_ALLOCATE_ROUTINE AllocateRoutine, IN PRTL_AVL_FREE_ROUTINE FreeRoutine, IN PVOID TableContext)
Definition: avltable.c:26
LONG NTSTATUS
Definition: precomp.h:26
static WCHAR ServiceName[]
Definition: browser.c:19
NTSYSAPI ULONG NTAPI RtlRandomEx(PULONG Seed)
OSVERSIONINFOW VersionInfo
Definition: wkssvc.c:40
#define NTSYSAPI
Definition: ntoskrnl.h:12
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:606
#define __drv_aliasesMem
Definition: btrfs_drv.h:203
@ Ace
Definition: card.h:12
return
Definition: dirsup.c:529
Definition: bufpool.h:45
#define UNALIGNED
Definition: crtdefs.h:144
ush Pos
Definition: deflate.h:92
#define BufferSize
Definition: mmc.h:75
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
NTSTATUS NTAPI RtlGetVersion(IN OUT PRTL_OSVERSIONINFOW lpVersionInformation)
Definition: version.c:158
static const WCHAR Signature[]
Definition: parser.c:141
static const WCHAR Message[]
Definition: register.c:74
@ AnsiString
Definition: dnslib.h:19
BOOLEAN NTAPI RtlIsValidOemCharacter(IN PWCHAR Char)
Definition: unicode.c:514
#define ULONG_PTR
Definition: config.h:101
#define __drv_freesMem(kind)
Definition: driverspecs.h:271
#define _IRQL_requires_max_(irql)
Definition: driverspecs.h:230
#define __drv_allocatesMem(kind)
Definition: driverspecs.h:256
BOOLEAN RtlTimeFieldsToTime(IN PTIME_FIELDS TimeFields, IN PLARGE_INTEGER Time)
#define RemoveEntryList(Entry)
Definition: env_spec_w32.h:986
#define InsertTailList(ListHead, Entry)
#define InsertHeadList(ListHead, Entry)
#define IsListEmpty(ListHead)
Definition: env_spec_w32.h:954
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
#define RtlCompareMemory(s1, s2, l)
Definition: env_spec_w32.h:465
#define APC_LEVEL
Definition: env_spec_w32.h:695
#define RemoveTailList(ListHead)
Definition: env_spec_w32.h:975
#define RemoveHeadList(ListHead)
Definition: env_spec_w32.h:964
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
std::wstring STRING
Definition: fontsub.cpp:33
_In_ ULONG FramesToCapture
_In_ ULONG _Out_opt_ PULONG BackTraceHash
Status
Definition: gdiplustypes.h:25
VOID NTAPI RtlInitializeGenericTable(IN PRTL_GENERIC_TABLE Table, IN PRTL_GENERIC_COMPARE_ROUTINE CompareRoutine, IN PRTL_GENERIC_ALLOCATE_ROUTINE AllocateRoutine, IN PRTL_GENERIC_FREE_ROUTINE FreeRoutine, IN PVOID TableContext)
Definition: generictable.c:100
ASMGENDATA Table[]
Definition: genincdata.c:61
_In_ GUID _In_ PVOID ValueData
Definition: hubbusif.h:312
#define _NTIFS_
Definition: ifssupp.h:20
VOID NTAPI RtlFreeOemString(POEM_STRING OemString)
BOOLEAN NTAPI RtlTimeToSecondsSince1970(PLARGE_INTEGER Time, PULONG ElapsedSeconds)
BOOLEAN NTAPI RtlIsNameLegalDOS8Dot3(_In_ PUNICODE_STRING Name, _Inout_opt_ POEM_STRING OemName, _Inout_opt_ PBOOLEAN NameContainsSpaces)
NTSYSAPI NTSTATUS WINAPI RtlDeleteRegistryValue(ULONG, PCWSTR, PCWSTR)
NTSYSAPI ULONG WINAPI RtlNtStatusToDosErrorNoTeb(NTSTATUS)
NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeStringToAnsiString(STRING *, const UNICODE_STRING *, BOOLEAN)
NTSYSAPI void WINAPI RtlInitializeBitMap(PRTL_BITMAP, PULONG, ULONG)
NTSYSAPI void WINAPI RtlSetAllBits(PRTL_BITMAP)
NTSYSAPI NTSTATUS WINAPI RtlWriteRegistryValue(ULONG, PCWSTR, PCWSTR, ULONG, PVOID, ULONG)
NTSYSAPI NTSTATUS WINAPI RtlVerifyVersionInfo(const RTL_OSVERSIONINFOEXW *, DWORD, DWORDLONG)
NTSYSAPI ULONG WINAPI RtlLengthSecurityDescriptor(PSECURITY_DESCRIPTOR)
NTSYSAPI CCHAR WINAPI RtlFindMostSignificantBit(ULONGLONG)
Definition: bitmap.c:211
NTSYSAPI NTSTATUS WINAPI RtlInitAnsiStringEx(PANSI_STRING, PCSZ)
NTSYSAPI NTSTATUS WINAPI RtlGUIDFromString(PUNICODE_STRING, GUID *)
NTSYSAPI ULONG WINAPI RtlFindClearRuns(PCRTL_BITMAP, PRTL_BITMAP_RUN, ULONG, BOOLEAN)
NTSYSAPI UINT WINAPI RtlEnlargedUnsignedDivide(ULONGLONG, UINT, UINT *)
NTSYSAPI LONGLONG WINAPI RtlExtendedMagicDivide(LONGLONG, LONGLONG, INT)
NTSYSAPI LONGLONG WINAPI RtlConvertLongToLargeInteger(LONG)
Definition: largeint.c:31
NTSYSAPI NTSTATUS WINAPI RtlInitUnicodeStringEx(PUNICODE_STRING, PCWSTR)
NTSYSAPI ULONG WINAPI RtlFindLongestRunClear(PCRTL_BITMAP, PULONG)
NTSYSAPI NTSTATUS WINAPI RtlInt64ToUnicodeString(ULONGLONG, ULONG, UNICODE_STRING *)
NTSYSAPI BOOLEAN WINAPI RtlPrefixString(const STRING *, const STRING *, BOOLEAN)
Definition: unicode.c:886
NTSYSAPI ULONG WINAPI RtlNumberOfClearBits(PCRTL_BITMAP)
NTSYSAPI ULONG WINAPI RtlNumberOfSetBits(PCRTL_BITMAP)
NTSYSAPI NTSTATUS WINAPI RtlAddAccessAllowedAceEx(PACL, DWORD, DWORD, DWORD, PSID)
NTSYSAPI BOOLEAN WINAPI RtlAreBitsClear(PCRTL_BITMAP, ULONG, ULONG)
NTSYSAPI NTSTATUS WINAPI RtlAddAccessAllowedAce(PACL, DWORD, DWORD, PSID)
NTSYSAPI NTSTATUS WINAPI RtlDowncaseUnicodeString(UNICODE_STRING *, const UNICODE_STRING *, BOOLEAN)
NTSYSAPI ULONG WINAPI RtlFindSetBitsAndClear(PRTL_BITMAP, ULONG, ULONG)
NTSYSAPI NTSTATUS WINAPI RtlStringFromGUID(REFGUID, PUNICODE_STRING)
NTSYSAPI NTSTATUS WINAPI RtlSetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR, PSID, BOOLEAN)
NTSYSAPI void WINAPI RtlClearAllBits(PRTL_BITMAP)
NTSYSAPI ULONG WINAPI RtlFindClearBitsAndSet(PRTL_BITMAP, ULONG, ULONG)
NTSYSAPI ULONGLONG WINAPI RtlLargeIntegerDivide(ULONGLONG, ULONGLONG, ULONGLONG *)
NTSYSAPI BOOLEAN WINAPI RtlTimeToSecondsSince1980(const LARGE_INTEGER *, LPDWORD)
NTSYSAPI NTSTATUS WINAPI RtlQueryRegistryValues(ULONG, PCWSTR, PRTL_QUERY_REGISTRY_TABLE, PVOID, PVOID)
NTSYSAPI CCHAR WINAPI RtlFindLeastSignificantBit(ULONGLONG)
Definition: bitmap.c:235
NTSYSAPI LONGLONG WINAPI RtlLargeIntegerAdd(LONGLONG, LONGLONG)
NTSYSAPI NTSTATUS WINAPI RtlDuplicateUnicodeString(int, const UNICODE_STRING *, UNICODE_STRING *)
NTSYSAPI LONG WINAPI RtlCompareUnicodeStrings(const WCHAR *, SIZE_T, const WCHAR *, SIZE_T, BOOLEAN)
NTSYSAPI BOOLEAN WINAPI RtlValidRelativeSecurityDescriptor(PSECURITY_DESCRIPTOR, ULONG, SECURITY_INFORMATION)
NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeStringToCountedOemString(STRING *, const UNICODE_STRING *, BOOLEAN)
NTSYSAPI ULONG WINAPI RtlFindClearBits(PCRTL_BITMAP, ULONG, ULONG)
NTSYSAPI NTSTATUS WINAPI RtlCheckRegistryKey(ULONG, PWSTR)
NTSYSAPI NTSTATUS WINAPI RtlDecompressBuffer(USHORT, PUCHAR, ULONG, PUCHAR, ULONG, PULONG)
NTSYSAPI void WINAPI RtlClearBits(PRTL_BITMAP, ULONG, ULONG)
NTSYSAPI NTSTATUS WINAPI RtlSelfRelativeToAbsoluteSD(PSECURITY_DESCRIPTOR, PSECURITY_DESCRIPTOR, PDWORD, PACL, PDWORD, PACL, PDWORD, PSID, PDWORD, PSID, PDWORD)
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
NTSYSAPI ULONGLONG WINAPI RtlEnlargedUnsignedMultiply(UINT, UINT)
Definition: largeint.c:97
NTSYSAPI LONGLONG WINAPI RtlEnlargedIntegerMultiply(INT, INT)
NTSYSAPI NTSTATUS WINAPI RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR, BOOLEAN, PACL, BOOLEAN)
NTSYSAPI ULONG WINAPI RtlFindLastBackwardRunClear(PCRTL_BITMAP, ULONG, PULONG)
NTSYSAPI ULONG WINAPI RtlFindSetBits(PCRTL_BITMAP, ULONG, ULONG)
NTSYSAPI LONGLONG WINAPI RtlExtendedLargeIntegerDivide(LONGLONG, INT, INT *)
NTSYSAPI NTSTATUS WINAPI RtlAppendStringToString(STRING *, const STRING *)
NTSYSAPI void WINAPI RtlCopyLuid(PLUID, const LUID *)
NTSYSAPI BOOLEAN WINAPI RtlCopySid(DWORD, PSID, PSID)
NTSYSAPI void WINAPI RtlSetBits(PRTL_BITMAP, ULONG, ULONG)
NTSYSAPI BOOLEAN WINAPI RtlAreBitsSet(PCRTL_BITMAP, ULONG, ULONG)
NTSYSAPI ULONG WINAPI RtlFindNextForwardRunClear(PCRTL_BITMAP, ULONG, PULONG)
HRESULT Next([in] ULONG celt, [out, size_is(celt), length_is(*pceltFetched)] STATPROPSETSTG *rgelt, [out] ULONG *pceltFetched)
PPC_QUAL void __stosb(unsigned char *Dest, const unsigned char Data, unsigned long Count)
Definition: intrin_ppc.h:306
#define I(s)
_In_ PVOID Parameter
Definition: ldrtypes.h:241
NTSTATUS NTAPI RtlUnicodeToUTF8N(CHAR *utf8_dest, ULONG utf8_bytes_max, ULONG *utf8_bytes_written, const WCHAR *uni_src, ULONG uni_bytes)
Definition: utf8.c:20
if(dx< 0)
Definition: linetemp.h:194
#define RtlFillMemoryUlong(dst, len, val)
Definition: mkhive.h:55
unsigned __int64 * PULONG64
Definition: imports.h:198
unsigned __int64 ULONG64
Definition: imports.h:198
static PWSTR GuidString
Definition: apphelp.c:93
static PTIME_FIELDS TimeFields
Definition: time.c:104
DWORD SECURITY_INFORMATION
Definition: ms-dtyp.idl:311
#define _Pre_unknown_
Definition: ms_sal.h:677
#define _Out_opt_
Definition: ms_sal.h:346
#define _Success_(expr)
Definition: ms_sal.h:259
#define _Notnull_
Definition: ms_sal.h:658
#define _In_reads_bytes_(size)
Definition: ms_sal.h:321
#define _Inout_
Definition: ms_sal.h:378
#define _Out_writes_bytes_(size)
Definition: ms_sal.h:350
#define _Out_writes_bytes_to_(size, count)
Definition: ms_sal.h:360
#define _Out_range_(lb, ub)
Definition: ms_sal.h:572
#define _Ret_maybenull_
Definition: ms_sal.h:529
#define _Unchanged_(e)
Definition: ms_sal.h:582
#define _Out_writes_bytes_all_(size)
Definition: ms_sal.h:362
#define _Writable_bytes_(size)
Definition: ms_sal.h:637
#define _In_z_
Definition: ms_sal.h:313
#define _Pre_maybenull_
Definition: ms_sal.h:681
#define _In_opt_z_
Definition: ms_sal.h:314
#define _Outptr_
Definition: ms_sal.h:427
#define _Out_writes_(size)
Definition: ms_sal.h:348
#define _Outptr_opt_result_maybenull_
Definition: ms_sal.h:430
#define _Post_equal_to_(expr)
Definition: ms_sal.h:578
#define _Valid_
Definition: ms_sal.h:626
#define __inner_callback
Definition: ms_sal.h:2636
#define _Post_invalid_
Definition: ms_sal.h:695
#define _At_(target, annos)
Definition: ms_sal.h:244
#define _Inout_opt_
Definition: ms_sal.h:379
#define _Must_inspect_result_
Definition: ms_sal.h:558
#define _Inout_updates_bytes_(size)
Definition: ms_sal.h:399
#define _Out_
Definition: ms_sal.h:345
#define _Out_writes_bytes_to_opt_(size, count)
Definition: ms_sal.h:361
#define _In_
Definition: ms_sal.h:308
#define _In_reads_bytes_opt_(size)
Definition: ms_sal.h:322
#define _In_opt_
Definition: ms_sal.h:309
#define _Post_writable_byte_size_(size)
Definition: ms_sal.h:652
#define _Const_
Definition: ms_sal.h:299
#define _Pre_readable_size_(size)
Definition: ms_sal.h:644
#define _Post_satisfies_(cond)
Definition: ms_sal.h:588
#define _Reserved_
Definition: ms_sal.h:295
#define _Out_writes_to_(size, count)
Definition: ms_sal.h:355
#define _In_range_(lb, ub)
Definition: ms_sal.h:571
#define _Out_writes_bytes_opt_(size)
Definition: ms_sal.h:351
#define _Maybe_raises_SEH_exception_
Definition: ms_sal.h:2956
#define _In_reads_(size)
Definition: ms_sal.h:319
#define _Pre_
Definition: ms_sal.h:619
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
Definition: mmfuncs.h:404
NTSYSAPI NTSTATUS NTAPI RtlCreateRegistryKey(_In_ ULONG RelativeTo, _In_ PWSTR Path)
NTSYSAPI NTSTATUS NTAPI RtlAddAce(_Inout_ PACL Acl, _In_ ULONG AceRevision, _In_ ULONG StartingAceIndex, _In_reads_bytes_(AceListLength) PVOID AceList, _In_ ULONG AceListLength)
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL Dacl
Definition: rtlfuncs.h:1593
_In_ PLUID SourceLuid
Definition: rtlfuncs.h:1317
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor
Definition: rtlfuncs.h:1591
_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 _Inout_ PULONG OwnerSize
Definition: rtlfuncs.h:1598
NTSYSAPI NTSTATUS NTAPI RtlUpcaseUnicodeStringToOemString(POEM_STRING DestinationString, PCUNICODE_STRING SourceString, BOOLEAN AllocateDestinationString)
_In_ const STRING * String2
Definition: rtlfuncs.h:2345
_In_opt_ PSID Group
Definition: rtlfuncs.h:1646
NTSYSAPI PULONG NTAPI RtlSubAuthoritySid(_In_ PSID Sid, _In_ ULONG SubAuthority)
_Out_ _Inout_ POEM_STRING _In_ PCUNICODE_STRING SourceString
Definition: rtlfuncs.h:1910
_Must_inspect_result_ NTSYSAPI NTSTATUS NTAPI RtlUpcaseUnicodeString(_When_(AllocateDestinationString, _Out_ _At_(DestinationString->Buffer, __drv_allocatesMem(Mem))) _When_(!AllocateDestinationString, _Inout_) PUNICODE_STRING DestinationString, _In_ PCUNICODE_STRING SourceString, _In_ BOOLEAN AllocateDestinationString)
NTSYSAPI NTSTATUS NTAPI RtlCompressBuffer(_In_ USHORT CompressionFormatAndEngine, _In_reads_bytes_(UncompressedBufferSize) PUCHAR UncompressedBuffer, _In_ ULONG UncompressedBufferSize, _Out_writes_bytes_to_(CompressedBufferSize, *FinalCompressedSize) PUCHAR CompressedBuffer, _In_ ULONG CompressedBufferSize, _In_ ULONG UncompressedChunkSize, _Out_ PULONG FinalCompressedSize, _In_ PVOID WorkSpace)
NTSYSAPI ULONG NTAPI RtlLengthRequiredSid(IN ULONG SubAuthorityCount)
Definition: sid.c:54
_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
Definition: rtlfuncs.h:1597
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToOemString(POEM_STRING DestinationString, PCUNICODE_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI NTSTATUS NTAPI RtlHashUnicodeString(_In_ CONST UNICODE_STRING *String, _In_ BOOLEAN CaseInSensitive, _In_ ULONG HashAlgorithm, _Out_ PULONG HashValue)
_When_(Status< 0, _Out_range_(>, 0)) _When_(Status >=0
_Out_ PLARGE_INTEGER Time
Definition: rtlfuncs.h:4626
_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 _Inout_ PULONG _Out_writes_bytes_to_opt_ PrimaryGroupSize PSID PrimaryGroup
Definition: rtlfuncs.h:1599
_In_ const STRING _In_ BOOLEAN CaseInSensitive
Definition: rtlfuncs.h:2378
_In_ PSID_IDENTIFIER_AUTHORITY _In_ UCHAR SubAuthorityCount
Definition: rtlfuncs.h:1515
NTSYSAPI NTSTATUS NTAPI RtlCreateAcl(PACL Acl, ULONG AclSize, ULONG AclRevision)
NTSYSAPI NTSTATUS NTAPI RtlGetCompressionWorkSpaceSize(_In_ USHORT CompressionFormatAndEngine, _Out_ PULONG CompressBufferWorkSpaceSize, _Out_ PULONG CompressFragmentWorkSpaceSize)
_Out_ PCPTABLEINFO CodePageTable
Definition: rtlfuncs.h:4305
_In_ ULONG TypeMask
Definition: rtlfuncs.h:4663
_In_ PCWSTR _Inout_ _At_ QueryTable _Pre_unknown_ PRTL_QUERY_REGISTRY_TABLE QueryTable
Definition: rtlfuncs.h:4197
NTSYSAPI NTSTATUS NTAPI RtlUnicodeToMultiByteSize(PULONG MbSize, PCWCH UnicodeString, ULONG UnicodeSize)
_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 SaclSize
Definition: rtlfuncs.h:1596
_Inout_opt_ POEM_STRING _Out_opt_ PBOOLEAN NameContainsSpaces
Definition: rtlfuncs.h:3079
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToAnsiString(PANSI_STRING DestinationString, PCUNICODE_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI NTSTATUS NTAPI RtlGetAce(PACL Acl, ULONG AceIndex, PVOID *Ace)
*BytesInUnicodeString PWCH _In_ ULONG _Out_opt_ PULONG BytesInUnicodeString
Definition: rtlfuncs.h:2035
_In_ const STRING _In_ BOOLEAN CaseInsensitive
Definition: rtlfuncs.h:2347
_In_ ULONG _In_ ULONG AceFlags
Definition: rtlfuncs.h:1142
_In_opt_ PSID _In_opt_ BOOLEAN GroupDefaulted
Definition: rtlfuncs.h:1648
_In_ PSID _In_ BOOLEAN AllocateDestinationString
Definition: rtlfuncs.h:1349
NTSYSAPI ULONG NTAPI RtlLengthSid(IN PSID Sid)
Definition: sid.c:150
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
Definition: rtlfuncs.h:2992
_In_ PSID SourceSid
Definition: rtlfuncs.h:1359
_In_ PCWSTR _Inout_ _At_ QueryTable _Pre_unknown_ PRTL_QUERY_REGISTRY_TABLE _In_opt_ PVOID _In_opt_ PVOID Environment
Definition: rtlfuncs.h:4200
NTSYSAPI NTSTATUS NTAPI RtlOemStringToUnicodeString(PUNICODE_STRING DestinationString, PCOEM_STRING SourceString, BOOLEAN AllocateDestinationString)
_In_ BOOLEAN DaclPresent
Definition: rtlfuncs.h:1635
NTSYSAPI ULONG NTAPI RtlxAnsiStringToUnicodeSize(PCANSI_STRING AnsiString)
NTSYSAPI LONG NTAPI RtlCompareUnicodeString(PCUNICODE_STRING String1, PCUNICODE_STRING String2, BOOLEAN CaseInsensitive)
Definition: string_lib.cpp:31
_In_opt_ ULONG Base
Definition: rtlfuncs.h:2427
NTSYSAPI NTSTATUS NTAPI RtlGetSaclSecurityDescriptor(_In_ PSECURITY_DESCRIPTOR SecurityDescriptor, _Out_ PBOOLEAN SaclPresent, _Out_ PACL *Sacl, _Out_ PBOOLEAN SaclDefaulted)
NTSYSAPI BOOLEAN NTAPI RtlValidSid(IN PSID Sid)
Definition: sid.c:21
NTSYSAPI CHAR NTAPI RtlUpperChar(CHAR Source)
NTSYSAPI BOOLEAN NTAPI RtlEqualPrefixSid(PSID Sid1, PSID Sid2)
_In_ ULONG _In_ ULONGLONG ConditionMask
Definition: rtlfuncs.h:4665
NTSYSAPI NTSTATUS NTAPI RtlCreateSecurityDescriptor(_Out_ PSECURITY_DESCRIPTOR SecurityDescriptor, _In_ ULONG Revision)
NTSYSAPI ULONG NTAPI RtlRandom(_Inout_ PULONG Seed)
_Out_writes_bytes_to_opt_ BufferLength PSECURITY_DESCRIPTOR SelfRelativeSecurityDescriptor
Definition: rtlfuncs.h:1120
NTSYSAPI NTSTATUS NTAPI RtlUnicodeToMultiByteN(PCHAR MbString, ULONG MbSize, PULONG ResultSize, PCWCH UnicodeString, ULONG UnicodeSize)
NTSYSAPI NTSTATUS NTAPI RtlValidateUnicodeString(_In_ ULONG Flags, _In_ PCUNICODE_STRING String)
Definition: unicode.c:2559
_In_opt_ PSID _In_opt_ BOOLEAN OwnerDefaulted
Definition: rtlfuncs.h:1672
_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 Sacl
Definition: rtlfuncs.h:1595
_Out_ _Inout_ POEM_STRING DestinationString
Definition: rtlfuncs.h:1909
_In_ ULONG _In_ SECURITY_INFORMATION RequiredInformation
Definition: rtlfuncs.h:1716
NTSYSAPI PUCHAR NTAPI RtlSubAuthorityCountSid(_In_ PSID Sid)
_In_ ULONG _In_ ULONG CompressedBufferSize
Definition: rtlfuncs.h:3270
_In_ ULONG _In_ ULONG _Out_ PULONG FinalUncompressedSize
Definition: rtlfuncs.h:3272
NTSYSAPI NTSTATUS NTAPI RtlAppendUnicodeStringToString(PUNICODE_STRING Destination, PCUNICODE_STRING Source)
_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 _Inout_ PULONG _Out_writes_bytes_to_opt_ PrimaryGroupSize PSID _Inout_ PULONG PrimaryGroupSize
Definition: rtlfuncs.h:1601
_In_ ULONG _In_ ACCESS_MASK _In_ PSID Sid
Definition: rtlfuncs.h:1133
NTSYSAPI NTSTATUS NTAPI RtlGetGroupSecurityDescriptor(_In_ PSECURITY_DESCRIPTOR SecurityDescriptor, _Out_ PSID *Group, _Out_ PBOOLEAN GroupDefaulted)
NTSYSAPI PVOID NTAPI RtlFreeSid(_In_ _Post_invalid_ PSID Sid)
NTSYSAPI VOID NTAPI RtlTimeToTimeFields(PLARGE_INTEGER Time, PTIME_FIELDS TimeFields)
NTSYSAPI ULONG NTAPI RtlxUnicodeStringToOemSize(IN PCUNICODE_STRING UnicodeString)
Definition: unicode.c:1091
_Out_ PULONG ElapsedSeconds
Definition: rtlfuncs.h:4635
_Must_inspect_result_ NTSYSAPI NTSTATUS NTAPI RtlAllocateAndInitializeSid(_In_ PSID_IDENTIFIER_AUTHORITY IdentifierAuthority, _In_ UCHAR SubAuthorityCount, _In_ ULONG SubAuthority0, _In_ ULONG SubAuthority1, _In_ ULONG SubAuthority2, _In_ ULONG SubAuthority3, _In_ ULONG SubAuthority4, _In_ ULONG SubAuthority5, _In_ ULONG SubAuthority6, _In_ ULONG SubAuthority7, _Outptr_ PSID *Sid)
NTSYSAPI ULONG NTAPI RtlWalkFrameChain(_Out_writes_(Count -(Flags > > RTL_STACK_WALKING_MODE_FRAMES_TO_SKIP_SHIFT)) PVOID *Callers, _In_ ULONG Count, _In_ ULONG Flags)
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG AbsoluteSecurityDescriptorSize
Definition: rtlfuncs.h:1592
NTSYSAPI PSID_IDENTIFIER_AUTHORITY NTAPI RtlIdentifierAuthoritySid(PSID Sid)
_In_ ULONG SecurityDescriptorLength
Definition: rtlfuncs.h:1714
NTSYSAPI NTSTATUS NTAPI RtlAppendUnicodeToString(PUNICODE_STRING Destination, PCWSTR Source)
NTSYSAPI NTSTATUS NTAPI RtlDeleteAce(PACL Acl, ULONG AceIndex)
_In_ ULONG Revision
Definition: rtlfuncs.h:1130
NTSYSAPI VOID NTAPI RtlMapGenericMask(PACCESS_MASK AccessMask, PGENERIC_MAPPING GenericMapping)
_In_ const STRING * Source
Definition: rtlfuncs.h:2406
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI ULONG NTAPI RtlxUnicodeStringToAnsiSize(IN PCUNICODE_STRING UnicodeString)
Definition: unicode.c:2178
NTSYSAPI NTSTATUS NTAPI RtlCreateSecurityDescriptorRelative(_Out_ PISECURITY_DESCRIPTOR_RELATIVE SecurityDescriptor, _In_ ULONG Revision)
*BytesInUnicodeString PWCH _In_ ULONG _Out_opt_ PULONG _In_ ULONG BytesInMultiByteString
Definition: rtlfuncs.h:2564
NTSYSAPI NTSTATUS NTAPI RtlGetDaclSecurityDescriptor(_In_ PSECURITY_DESCRIPTOR SecurityDescriptor, _Out_ PBOOLEAN DaclPresent, _Out_ PACL *Dacl, _Out_ PBOOLEAN DaclDefaulted)
NTSYSAPI NTSTATUS NTAPI RtlGetOwnerSecurityDescriptor(_In_ PSECURITY_DESCRIPTOR SecurityDescriptor, _Out_ PSID *Owner, _Out_ PBOOLEAN OwnerDefaulted)
NTSYSAPI NTSTATUS NTAPI RtlUpcaseUnicodeToOemN(PCHAR OemString, ULONG OemSize, PULONG ResultSize, PCWCH UnicodeString, ULONG UnicodeSize)
_Inout_opt_ POEM_STRING OemName
Definition: rtlfuncs.h:3077
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL _Inout_ PULONG DaclSize
Definition: rtlfuncs.h:1594
_In_ ULONG UncompressedBufferSize
Definition: rtlfuncs.h:3268
NTSYSAPI VOID NTAPI RtlCopyString(_Out_ PSTRING DestinationString, _In_opt_ const STRING *SourceString)
NTSYSAPI BOOLEAN NTAPI RtlEqualSid(_In_ PSID Sid1, _In_ PSID Sid2)
NTSYSAPI VOID NTAPI RtlCopyUnicodeString(PUNICODE_STRING DestinationString, PCUNICODE_STRING SourceString)
_In_ ULONG _In_ ACCESS_MASK AccessMask
Definition: rtlfuncs.h:1131
NTSYSAPI NTSTATUS NTAPI RtlUnicodeToOemN(PCHAR OemString, ULONG OemSize, PULONG ResultSize, PCWCH UnicodeString, ULONG UnicodeSize)
NTSYSAPI BOOLEAN NTAPI RtlEqualUnicodeString(PCUNICODE_STRING String1, PCUNICODE_STRING String2, BOOLEAN CaseInsensitive)
NTSYSAPI VOID NTAPI RtlCaptureContext(_Out_ PCONTEXT ContextRecord)
NTSYSAPI BOOLEAN NTAPI RtlValidSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor)
Definition: sd.c:1055
*BytesInUnicodeString PWCH _In_ ULONG _Out_opt_ PULONG _In_ ULONG BytesInOemString
Definition: rtlfuncs.h:2038
#define RTL_STACK_WALKING_MODE_FRAMES_TO_SKIP_SHIFT
Definition: rtlfuncs.h:808
NTSYSAPI WCHAR NTAPI RtlDowncaseUnicodeChar(IN WCHAR Source)
Definition: nls.c:131
NTSYSAPI VOID NTAPI RtlSecondsSince1970ToTime(_In_ ULONG SecondsSince1970, _Out_ PLARGE_INTEGER Time)
NTSYSAPI ULONG NTAPI RtlxOemStringToUnicodeSize(IN PCOEM_STRING OemString)
Definition: unicode.c:2125
_In_ PWSTR Path
Definition: rtlfuncs.h:4163
_In_ PSID_IDENTIFIER_AUTHORITY IdentifierAuthority
Definition: rtlfuncs.h:1513
_In_ BOOLEAN _In_opt_ PACL _In_opt_ BOOLEAN DaclDefaulted
Definition: rtlfuncs.h:1638
*BytesInUnicodeString PWCH _In_ ULONG MaxBytesInUnicodeString
Definition: rtlfuncs.h:2034
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PCANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI NTSTATUS NTAPI RtlUpcaseUnicodeToMultiByteN(PCHAR MbString, ULONG MbSize, PULONG ResultSize, PCWCH UnicodeString, ULONG UnicodeSize)
NTSYSAPI NTSTATUS NTAPI RtlCharToInteger(PCSZ String, ULONG Base, PULONG Value)
Definition: unicode.c:261
NTSYSAPI WCHAR NTAPI RtlUpcaseUnicodeChar(WCHAR Source)