ReactOS  0.4.15-dev-3316-g067ca88
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 
27 VOID
28 RtlFailFast(
29  _In_ ULONG Code)
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 
47 VOID
49  _Out_ PLIST_ENTRY ListHead)
50 {
51  ListHead->Flink = ListHead->Blink = ListHead;
52 }
53 
56 BOOLEAN
58  _In_ const LIST_ENTRY * ListHead)
59 {
60  return (BOOLEAN)(ListHead->Flink == ListHead);
61 }
62 
64 BOOLEAN
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)
80 VOID
82  _In_ PVOID P1,
83  _In_ PVOID P2,
84  _In_ PVOID P3)
85 {
89 
90  RtlFailFast(FAST_FAIL_CORRUPT_LIST_ENTRY);
91 }
92 
94 VOID
97 {
98  if (Entry->Flink->Blink != Entry || Entry->Blink->Flink != Entry)
99  FatalListEntryError(Entry->Blink, Entry, Entry->Flink);
100 }
101 #endif
102 
104 BOOLEAN
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 
179 VOID
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 
200 VOID
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 
221 VOID
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 
241  _Inout_ PSINGLE_LIST_ENTRY ListHead)
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 
252 VOID
254  _Inout_ PSINGLE_LIST_ENTRY ListHead,
256 {
257  Entry->Next = ListHead->Next;
258  ListHead->Next = Entry;
259 }
260 
261 #endif /* !defined(MIDL_PASS) && !defined(SORTPP_PASS) */
262 
264 NTSYSAPI
265 VOID
266 NTAPI
267 RtlAssert(
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)
285 NTSYSAPI
286 VOID
287 NTAPI
291  _In_ SIZE_T Length);
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 
325 NTSYSAPI
326 VOID
327 NTAPI
331 
334 NTSYSAPI
335 NTSTATUS
336 NTAPI
340 
344 _At_(DestinationString->Length, _Post_equal_to_(_String_length_(SourceString) * sizeof(WCHAR)))
349 NTSYSAPI
350 VOID
351 NTAPI
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 
367 NTSYSAPI
368 NTSTATUS
369 NTAPI
371  _In_ REFGUID Guid,
372  _Out_ _At_(GuidString->Buffer, __drv_allocatesMem(Mem))
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 
388 $if (_WDMDDK_)
390 NTSYSAPI
391 BOOLEAN
392 NTAPI
394  _In_ PRTL_BITMAP BitMapHeader,
396  _In_ ULONG Length);
397 
399 NTSYSAPI
400 BOOLEAN
401 NTAPI
403  _In_ PRTL_BITMAP BitMapHeader,
405  _In_ ULONG Length);
406 
409 NTSYSAPI
410 NTSTATUS
411 NTAPI
418 
420 NTSYSAPI
421 ULONG
422 NTAPI
425 
426 #define RtlAnsiStringToUnicodeSize(String) ( \
427  NLS_MB_CODE_PAGE_TAG ? \
428  RtlxAnsiStringToUnicodeSize(String) : \
429  ((String)->Length + sizeof(ANSI_NULL)) * sizeof(WCHAR) \
430 )
431 
432 _Success_(1)
437  _At_(return, _Out_range_(==, 0)))
440  _At_(return, _Out_range_(<, 0)))
441 NTSYSAPI
442 NTSTATUS
443 NTAPI
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))) */
457 NTSYSAPI
458 NTSTATUS
459 NTAPI
463 
466 NTSYSAPI
467 NTSTATUS
468 NTAPI
470  _In_ ULONG RelativeTo,
472 
473 NTSYSAPI
474 VOID
475 NTAPI
477  _In_ PRTL_BITMAP BitMapHeader);
478 
479 NTSYSAPI
480 VOID
481 NTAPI
483  _In_ PRTL_BITMAP BitMapHeader,
484  _In_range_(0, BitMapHeader->SizeOfBitMap - NumberToClear) ULONG StartingIndex,
485  _In_range_(0, BitMapHeader->SizeOfBitMap - StartingIndex) ULONG NumberToClear);
486 
488 NTSYSAPI
489 SIZE_T
490 NTAPI
492  _In_ const VOID *Source1,
493  _In_ const VOID *Source2,
494  _In_ SIZE_T Length);
495 
498 NTSYSAPI
499 LONG
500 NTAPI
502  _In_ PCUNICODE_STRING String1,
505 
508 NTSYSAPI
509 LONG
510 NTAPI
512  _In_reads_(String1Length) PCWCH String1,
517 
525 NTSYSAPI
526 VOID
527 NTAPI
531 
533 NTSYSAPI
534 NTSTATUS
535 NTAPI
537  _In_ ULONG RelativeTo,
538  _In_ PWSTR Path);
539 
541 NTSYSAPI
542 NTSTATUS
543 NTAPI
547 
549 NTSYSAPI
550 NTSTATUS
551 NTAPI
553  _In_ ULONG RelativeTo,
556 
559 NTSYSAPI
560 BOOLEAN
561 NTAPI
563  _In_ CONST UNICODE_STRING *String1,
566 
567 #if !defined(_AMD64_) && !defined(_IA64_)
568 NTSYSAPI
570 NTAPI
572  _In_ LARGE_INTEGER Multiplicand,
573  _In_ LONG Multiplier);
574 
575 NTSYSAPI
577 NTAPI
579  _In_ LARGE_INTEGER Dividend,
582 #endif
583 
584 #if defined(_X86_) || defined(_IA64_)
585 NTSYSAPI
587 NTAPI
589  _In_ LARGE_INTEGER Dividend,
590  _In_ LARGE_INTEGER MagicDivisor,
591  _In_ CCHAR ShiftCount);
592 #endif
593 
595 NTSYSAPI
596 VOID
597 NTAPI
599  _Inout_ _At_(AnsiString->Buffer, __drv_freesMem(Mem))
601 
602 _Success_(return != -1)
604 NTSYSAPI
605 ULONG
606 NTAPI
608  _In_ PRTL_BITMAP BitMapHeader,
611 
612 _Success_(return != -1)
613 NTSYSAPI
614 ULONG
615 NTAPI
617  _In_ PRTL_BITMAP BitMapHeader,
620 
621 NTSYSAPI
622 ULONG
623 NTAPI
625  _In_ PRTL_BITMAP BitMapHeader,
627 
628 NTSYSAPI
629 ULONG
630 NTAPI
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 
637 NTSYSAPI
638 ULONG
639 NTAPI
641  _In_ PRTL_BITMAP BitMapHeader,
642  _In_ ULONG FromIndex,
643  _Out_ PULONG StartingRunIndex);
644 
645 _Success_(return != -1)
647 NTSYSAPI
648 CCHAR
649 NTAPI
651  _In_ ULONGLONG Set);
652 
653 NTSYSAPI
654 ULONG
655 NTAPI
657  _In_ PRTL_BITMAP BitMapHeader,
659 
660 _Success_(return != -1)
662 NTSYSAPI
663 CCHAR
664 NTAPI
666  _In_ ULONGLONG Set);
667 
668 NTSYSAPI
669 ULONG
670 NTAPI
672  _In_ PRTL_BITMAP BitMapHeader,
673  _In_ ULONG FromIndex,
674  _Out_ PULONG StartingRunIndex);
675 
676 _Success_(return != -1)
678 NTSYSAPI
679 ULONG
680 NTAPI
682  _In_ PRTL_BITMAP BitMapHeader,
685 
686 _Success_(return != -1)
687 NTSYSAPI
688 ULONG
689 NTAPI
691  _In_ PRTL_BITMAP BitMapHeader,
694 
696 NTSYSAPI
697 VOID
698 NTAPI
702 
703 _At_(BitMapHeader->SizeOfBitMap, _Post_equal_to_(SizeOfBitMap))
704 _At_(BitMapHeader->Buffer, _Post_equal_to_(BitMapBuffer))
705 NTSYSAPI
706 VOID
707 NTAPI
709  _Out_ PRTL_BITMAP BitMapHeader,
710  _In_opt_ __drv_aliasesMem PULONG BitMapBuffer,
711  _In_opt_ ULONG SizeOfBitMap);
712 
714 NTSYSAPI
715 VOID
716 NTAPI
720 
723 NTSYSAPI
724 NTSTATUS
725 NTAPI
727  _In_ ULONG Value,
730 
733 NTSYSAPI
734 NTSTATUS
735 NTAPI
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 
757 NTSYSAPI
758 ULONG
759 NTAPI
762 
763 NTSYSAPI
764 ULONG
765 NTAPI
767  _In_ PRTL_BITMAP BitMapHeader);
768 
769 NTSYSAPI
770 ULONG
771 NTAPI
773  _In_ PRTL_BITMAP BitMapHeader);
774 
776 NTSYSAPI
777 NTSTATUS
778 NTAPI
780  _In_ ULONG RelativeTo,
781  _In_ PCWSTR Path,
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 
800 NTSYSAPI
801 VOID
802 NTAPI
804  _In_ PRTL_BITMAP BitMapHeader);
805 
806 NTSYSAPI
807 VOID
808 NTAPI
809 RtlSetBits(
810  _In_ PRTL_BITMAP BitMapHeader,
811  _In_range_(0, BitMapHeader->SizeOfBitMap - NumberToSet) ULONG StartingIndex,
812  _In_range_(0, BitMapHeader->SizeOfBitMap - StartingIndex) ULONG NumberToSet);
813 
815 NTSYSAPI
816 NTSTATUS
817 NTAPI
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)
936 NTSYSAPI
937 BOOLEAN
938 NTAPI
942 
943 NTSYSAPI
944 VOID
945 NTAPI
949 
950 NTSYSAPI
951 USHORT
952 FASTCALL
954  _In_ USHORT Source);
955 
956 NTSYSAPI
957 ULONG
958 FASTCALL
960  _In_ ULONG Source);
961 
962 NTSYSAPI
963 ULONGLONG
964 FASTCALL
967 
970  _Out_range_(<=, (SourceString->MaximumLength / sizeof(WCHAR)))))
976 NTSYSAPI
977 NTSTATUS
978 NTAPI
985 
988 NTSYSAPI
989 NTSTATUS
990 NTAPI
997 
999 NTSYSAPI
1000 ULONG
1001 NTAPI
1004 
1005 #define RtlUnicodeStringToAnsiSize(String) ( \
1006  NLS_MB_CODE_PAGE_TAG ? \
1007  RtlxUnicodeStringToAnsiSize(String) : \
1008  ((String)->Length + sizeof(UNICODE_NULL)) / sizeof(WCHAR) \
1009 )
1010 
1012 NTSYSAPI
1013 NTSTATUS
1014 NTAPI
1018  _Out_ PULONG Value);
1019 
1021 NTSYSAPI
1022 WCHAR
1023 NTAPI
1025  _In_ WCHAR SourceCharacter);
1026 
1029 NTSYSAPI
1030 BOOLEAN
1031 NTAPI
1036 
1039 NTSYSAPI
1040 BOOLEAN
1041 NTAPI
1044 
1046 NTSYSAPI
1047 NTSTATUS
1048 NTAPI
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 
1058 NTSYSAPI
1059 NTSTATUS
1060 NTAPI
1065 
1067 NTSYSAPI
1068 NTSTATUS
1069 NTAPI
1071  _In_ ULONG RelativeTo,
1077 
1078 $endif (_WDMDDK_)
1079 $if (_NTDDK_)
1080 
1081 #ifndef RTL_USE_AVL_TABLES
1082 
1083 NTSYSAPI
1084 VOID
1085 NTAPI
1092 
1093 NTSYSAPI
1094 PVOID
1095 NTAPI
1100  _Out_opt_ PBOOLEAN NewElement);
1101 
1102 NTSYSAPI
1103 PVOID
1104 NTAPI
1109  _Out_opt_ PBOOLEAN NewElement,
1110  _In_ PVOID NodeOrParent,
1111  _In_ TABLE_SEARCH_RESULT SearchResult);
1112 
1113 NTSYSAPI
1114 BOOLEAN
1115 NTAPI
1118  _In_ PVOID Buffer);
1119 
1121 NTSYSAPI
1122 PVOID
1123 NTAPI
1126  _In_ PVOID Buffer);
1127 
1128 NTSYSAPI
1129 PVOID
1130 NTAPI
1133  _In_ PVOID Buffer,
1134  _Out_ PVOID *NodeOrParent,
1135  _Out_ TABLE_SEARCH_RESULT *SearchResult);
1136 
1138 NTSYSAPI
1139 PVOID
1140 NTAPI
1143  _In_ BOOLEAN Restart);
1144 
1146 NTSYSAPI
1147 PVOID
1148 NTAPI
1151  _Inout_ PVOID *RestartKey);
1152 
1154 NTSYSAPI
1155 PVOID
1156 NTAPI
1159  _In_ ULONG I);
1160 
1161 NTSYSAPI
1162 ULONG
1163 NTAPI
1166 
1168 NTSYSAPI
1169 BOOLEAN
1170 NTAPI
1173 
1174 #endif /* !RTL_USE_AVL_TABLES */
1175 
1176 #define RTL_STACK_WALKING_MODE_FRAMES_TO_SKIP_SHIFT 8
1177 
1178 NTSYSAPI
1180 NTAPI
1181 RtlSplay(
1182  _Inout_ PRTL_SPLAY_LINKS Links);
1183 
1184 NTSYSAPI
1186 NTAPI
1187 RtlDelete(
1188  _In_ PRTL_SPLAY_LINKS Links);
1189 
1190 NTSYSAPI
1191 VOID
1192 NTAPI
1194  _In_ PRTL_SPLAY_LINKS Links,
1196 
1198 NTSYSAPI
1200 NTAPI
1202  _In_ PRTL_SPLAY_LINKS Links);
1203 
1205 NTSYSAPI
1207 NTAPI
1209  _In_ PRTL_SPLAY_LINKS Links);
1210 
1212 NTSYSAPI
1214 NTAPI
1216  _In_ PRTL_SPLAY_LINKS Links);
1217 
1219 NTSYSAPI
1221 NTAPI
1223  _In_ PRTL_SPLAY_LINKS Links);
1224 
1227 NTSYSAPI
1228 BOOLEAN
1229 NTAPI
1231  _In_ PCUNICODE_STRING String1,
1234 
1236 NTSYSAPI
1237 VOID
1238 NTAPI
1241  _In_ const STRING *SourceString);
1242 
1245 NTSYSAPI
1246 NTSTATUS
1247 NTAPI
1254 
1256 NTSYSAPI
1257 VOID
1258 NTAPI
1262 
1264 NTSYSAPI
1265 NTSTATUS
1266 NTAPI
1267 RtlVolumeDeviceToDosName(
1268  _In_ PVOID VolumeDeviceObject,
1270 
1273 NTSYSAPI
1274 LONG
1275 NTAPI
1277  _In_ const STRING *String1,
1278  _In_ const STRING *String2,
1280 
1281 NTSYSAPI
1282 VOID
1283 NTAPI
1286  _In_opt_ const STRING *SourceString);
1287 
1290 NTSYSAPI
1291 BOOLEAN
1292 NTAPI
1294  _In_ const STRING *String1,
1295  _In_ const STRING *String2,
1297 
1299 NTSYSAPI
1300 NTSTATUS
1301 NTAPI
1303  _In_z_ PCSZ String,
1305  _Out_ PULONG Value);
1306 
1308 NTSYSAPI
1309 CHAR
1310 NTAPI
1311 RtlUpperChar(
1312  _In_ CHAR Character);
1313 
1314 NTSYSAPI
1315 ULONG
1316 NTAPI
1319  PVOID *Callers,
1320  _In_ ULONG Count,
1321  _In_ ULONG Flags);
1322 
1323 $endif (_NTDDK_)
1324 $if (_NTIFS_)
1325 
1329 NTSYSAPI
1330 PVOID
1331 NTAPI
1333  _In_ HANDLE HeapHandle,
1335  _In_ SIZE_T Size);
1336 
1337 _Success_(return != 0)
1338 NTSYSAPI
1339 BOOLEAN
1340 NTAPI
1341 RtlFreeHeap(
1342  _In_ PVOID HeapHandle,
1345 
1346 NTSYSAPI
1347 VOID
1348 NTAPI
1351 
1352 _Ret_range_(<, MAXLONG)
1353 NTSYSAPI
1354 ULONG
1355 NTAPI
1356 RtlRandom(
1357  _Inout_ PULONG Seed);
1358 
1360 _Success_(return != 0)
1362 NTSYSAPI
1363 BOOLEAN
1364 NTAPI
1369 
1372 NTSYSAPI
1373 BOOLEAN
1374 NTAPI
1376  _In_ const STRING *String1,
1379 
1381 NTSYSAPI
1382 NTSTATUS
1383 NTAPI
1387 
1390 NTSYSAPI
1391 NTSTATUS
1392 NTAPI
1399 
1402 NTSYSAPI
1403 NTSTATUS
1404 NTAPI
1411 
1414 NTSYSAPI
1415 NTSTATUS
1416 NTAPI
1423 
1426 NTSYSAPI
1427 NTSTATUS
1428 NTAPI
1435 
1438 NTSYSAPI
1439 NTSTATUS
1440 NTAPI
1441 RtlUnicodeStringToCountedOemString(
1447 
1450 NTSYSAPI
1451 NTSTATUS
1452 NTAPI
1459 
1462 NTSYSAPI
1463 NTSTATUS
1464 NTAPI
1468  PUNICODE_STRING UniDest,
1469  _In_ PCUNICODE_STRING UniSource,
1471 
1473 NTSYSAPI
1474 VOID
1475 NTAPI
1478 
1480 NTSYSAPI
1481 ULONG
1482 NTAPI
1485 
1487 NTSYSAPI
1488 ULONG
1489 NTAPI
1492 
1494 NTSYSAPI
1495 NTSTATUS
1496 NTAPI
1503 
1505 NTSYSAPI
1506 NTSTATUS
1507 NTAPI
1512 
1514 NTSYSAPI
1515 NTSTATUS
1516 NTAPI
1521 
1523 NTSYSAPI
1524 NTSTATUS
1525 NTAPI
1532 
1534 NTSYSAPI
1535 NTSTATUS
1536 NTAPI
1543 
1545 NTSYSAPI
1546 NTSTATUS
1547 NTAPI
1554 
1556 NTSYSAPI
1557 NTSTATUS
1558 NTAPI
1565 
1567 NTSYSAPI
1568 NTSTATUS
1569 NTAPI
1576 
1577 #if (NTDDI_VERSION >= NTDDI_VISTASP1)
1579 NTSYSAPI
1580 NTSTATUS
1581 NTAPI
1587 #else
1589 NTSYSAPI
1590 VOID
1591 NTAPI
1597 #endif
1598 
1601 NTSYSAPI
1602 BOOLEAN
1603 NTAPI
1608 
1611 NTSYSAPI
1612 BOOLEAN
1613 NTAPI
1615  _Inout_ PWCHAR Char);
1616 
1618 NTSYSAPI
1619 VOID
1620 NTAPI
1622  _Out_ PPREFIX_TABLE PrefixTable);
1623 
1625 NTSYSAPI
1626 BOOLEAN
1627 NTAPI
1629  _In_ PPREFIX_TABLE PrefixTable,
1632 
1634 NTSYSAPI
1635 VOID
1636 NTAPI
1638  _In_ PPREFIX_TABLE PrefixTable,
1640 
1643 NTSYSAPI
1645 NTAPI
1647  _In_ PPREFIX_TABLE PrefixTable,
1649 
1651 NTSYSAPI
1652 VOID
1653 NTAPI
1655  _Out_ PUNICODE_PREFIX_TABLE PrefixTable);
1656 
1658 NTSYSAPI
1659 BOOLEAN
1660 NTAPI
1662  _In_ PUNICODE_PREFIX_TABLE PrefixTable,
1665 
1667 NTSYSAPI
1668 VOID
1669 NTAPI
1671  _In_ PUNICODE_PREFIX_TABLE PrefixTable,
1673 
1676 NTSYSAPI
1678 NTAPI
1680  _In_ PUNICODE_PREFIX_TABLE PrefixTable,
1683 
1686 NTSYSAPI
1688 NTAPI
1690  _In_ PUNICODE_PREFIX_TABLE PrefixTable,
1692 
1694 NTSYSAPI
1695 SIZE_T
1696 NTAPI
1699  _In_ SIZE_T Length,
1700  _In_ ULONG Pattern);
1701 
1702 _Success_(return != 0)
1703 NTSYSAPI
1704 BOOLEAN
1705 NTAPI
1709 
1710 NTSYSAPI
1711 VOID
1712 NTAPI
1716 
1717 _Success_(return != 0)
1718 NTSYSAPI
1719 BOOLEAN
1720 NTAPI
1724 
1725 NTSYSAPI
1726 VOID
1727 NTAPI
1731 
1734 NTSYSAPI
1735 BOOLEAN
1736 NTAPI
1737 RtlValidSid(
1738  _In_ PSID Sid);
1739 
1741 NTSYSAPI
1742 BOOLEAN
1743 NTAPI
1744 RtlEqualSid(
1745  _In_ PSID Sid1,
1746  _In_ PSID Sid2);
1747 
1750 NTSYSAPI
1751 BOOLEAN
1752 NTAPI
1754  _In_ PSID Sid1,
1756 
1758 NTSYSAPI
1759 ULONG
1760 NTAPI
1763 
1764 NTSYSAPI
1765 PVOID
1766 NTAPI
1767 RtlFreeSid(
1769 
1771 NTSYSAPI
1772 NTSTATUS
1773 NTAPI
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 
1788 NTSYSAPI
1789 NTSTATUS
1790 NTAPI
1792  _Out_ PSID Sid,
1795 
1796 NTSYSAPI
1797 PULONG
1798 NTAPI
1800  _In_ PSID Sid,
1801  _In_ ULONG SubAuthority);
1802 
1804 NTSYSAPI
1805 ULONG
1806 NTAPI
1807 RtlLengthSid(
1808  _In_ PSID Sid);
1809 
1811 NTSYSAPI
1812 NTSTATUS
1813 NTAPI
1814 RtlCopySid(
1815  _In_ ULONG DestinationSidLength,
1816  _Out_writes_bytes_(DestinationSidLength) PSID DestinationSid,
1818 
1820 NTSYSAPI
1821 NTSTATUS
1822 NTAPI
1827 
1829 NTSYSAPI
1830 VOID
1831 NTAPI
1832 RtlCopyLuid(
1833  _Out_ PLUID DestinationLuid,
1835 
1837 NTSYSAPI
1838 NTSTATUS
1839 NTAPI
1840 RtlCreateAcl(
1844 
1846 NTSYSAPI
1847 NTSTATUS
1848 NTAPI
1849 RtlAddAce(
1850  _Inout_ PACL Acl,
1855 
1857 NTSYSAPI
1858 NTSTATUS
1859 NTAPI
1860 RtlDeleteAce(
1861  _Inout_ PACL Acl,
1863 
1864 NTSYSAPI
1865 NTSTATUS
1866 NTAPI
1867 RtlGetAce(
1868  _In_ PACL Acl,
1870  _Outptr_ PVOID *Ace);
1871 
1873 NTSYSAPI
1874 NTSTATUS
1875 NTAPI
1877  _Inout_ PACL Acl,
1880  _In_ PSID Sid);
1881 
1883 NTSYSAPI
1884 NTSTATUS
1885 NTAPI
1887  _Inout_ PACL Acl,
1891  _In_ PSID Sid);
1892 
1894 NTSYSAPI
1895 NTSTATUS
1896 NTAPI
1899  _In_ ULONG Revision);
1900 
1901 NTSYSAPI
1902 NTSTATUS
1903 NTAPI
1907  _Out_ PACL *Dacl,
1909 
1911 NTSYSAPI
1912 NTSTATUS
1913 NTAPI
1918 
1920 NTSYSAPI
1921 NTSTATUS
1922 NTAPI
1925  _Out_ PSID *Owner,
1927 
1929 _When_(Status < 0, _Out_range_(>, 0))
1930 _When_(Status >= 0, _Out_range_(==, 0))
1931 NTSYSAPI
1932 ULONG
1933 NTAPI
1935  _In_ NTSTATUS Status);
1936 
1938 NTSYSAPI
1939 NTSTATUS
1940 NTAPI
1942  _In_ PCPTABLEINFO CustomCP,
1946  _In_reads_bytes_(BytesInCustomCPString) PCH CustomCPString,
1948 
1950 NTSYSAPI
1951 NTSTATUS
1952 NTAPI
1954  _In_ PCPTABLEINFO CustomCP,
1960 
1962 NTSYSAPI
1963 NTSTATUS
1964 NTAPI
1966  _In_ PCPTABLEINFO CustomCP,
1972 
1974 NTSYSAPI
1975 VOID
1976 NTAPI
1978  _In_ PUSHORT TableBase,
1980 
1981 $endif (_NTIFS_)
1982 
1983 #endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
1984 
1985 $if (_WDMDDK_)
1986 
1987 #if (NTDDI_VERSION >= NTDDI_WIN2KSP3)
1988 NTSYSAPI
1989 VOID
1990 FASTCALL
1992  _In_ PVOID Source,
1993  _In_ SIZE_T Length);
1994 #endif
1995 
1996 $endif (_WDMDDK_)
1997 
1998 #if (NTDDI_VERSION >= NTDDI_WINXP)
1999 
2000 $if (_WDMDDK_)
2001 
2002 NTSYSAPI
2003 VOID
2004 NTAPI
2005 RtlClearBit(
2006  _In_ PRTL_BITMAP BitMapHeader,
2007  _In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitNumber);
2008 
2010 NTSYSAPI
2011 WCHAR
2012 NTAPI
2014  _In_ WCHAR SourceCharacter);
2015 
2016 NTSYSAPI
2017 VOID
2018 NTAPI
2019 RtlSetBit(
2020  _In_ PRTL_BITMAP BitMapHeader,
2021  _In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitNumber);
2022 
2024 NTSYSAPI
2025 BOOLEAN
2026 NTAPI
2027 RtlTestBit(
2028  _In_ PRTL_BITMAP BitMapHeader,
2029  _In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitNumber);
2030 
2032 NTSYSAPI
2033 NTSTATUS
2034 NTAPI
2040 
2041 $endif (_WDMDDK_)
2042 
2043 $if (_NTDDK_)
2044 
2045 NTSYSAPI
2046 VOID
2047 NTAPI
2054 
2055 NTSYSAPI
2056 PVOID
2057 NTAPI
2062  _Out_opt_ PBOOLEAN NewElement);
2063 
2064 NTSYSAPI
2065 PVOID
2066 NTAPI
2071  _Out_opt_ PBOOLEAN NewElement,
2072  _In_ PVOID NodeOrParent,
2073  _In_ TABLE_SEARCH_RESULT SearchResult);
2074 
2075 NTSYSAPI
2076 BOOLEAN
2077 NTAPI
2080  _In_ PVOID Buffer);
2081 
2083 NTSYSAPI
2084 PVOID
2085 NTAPI
2088  _In_ PVOID Buffer);
2089 
2090 NTSYSAPI
2091 PVOID
2092 NTAPI
2095  _In_ PVOID Buffer,
2096  _Out_ PVOID *NodeOrParent,
2097  _Out_ TABLE_SEARCH_RESULT *SearchResult);
2098 
2100 NTSYSAPI
2101 PVOID
2102 NTAPI
2105  _In_ BOOLEAN Restart);
2106 
2108 NTSYSAPI
2109 PVOID
2110 NTAPI
2113  _Inout_ PVOID *RestartKey);
2114 
2116 NTSYSAPI
2117 PVOID
2118 NTAPI
2121  _In_ PVOID Buffer,
2122  _Out_ PVOID *RestartKey);
2123 
2125 NTSYSAPI
2126 PVOID
2127 NTAPI
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 
2138 NTSYSAPI
2139 PVOID
2140 NTAPI
2143  _In_ ULONG I);
2144 
2145 NTSYSAPI
2146 ULONG
2147 NTAPI
2150 
2152 NTSYSAPI
2153 BOOLEAN
2154 NTAPI
2157 
2158 $endif (_NTDDK_)
2159 $if (_NTIFS_)
2160 
2162 NTSYSAPI
2163 PVOID
2164 NTAPI
2166  _In_ ULONG Flags,
2172 
2173 NTSYSAPI
2174 PVOID
2175 NTAPI
2177  _In_ _Post_invalid_ PVOID HeapHandle);
2178 
2179 NTSYSAPI
2180 USHORT
2181 NTAPI
2183  _In_ ULONG FramesToSkip,
2185  _Out_writes_to_(FramesToCapture, return) PVOID *BackTrace,
2187 
2188 _Ret_range_(<, MAXLONG)
2189 NTSYSAPI
2190 ULONG
2191 NTAPI
2192 RtlRandomEx(
2193  _Inout_ PULONG Seed);
2194 
2196 NTSYSAPI
2197 NTSTATUS
2198 NTAPI
2202 
2204 NTSYSAPI
2205 NTSTATUS
2206 NTAPI
2208  _In_ ULONG Flags,
2210 
2213 NTSYSAPI
2214 NTSTATUS
2215 NTAPI
2217  _In_ ULONG Flags,
2220 
2221 NTSYSAPI
2222 NTSTATUS
2223 NTAPI
2225  _In_ USHORT CompressionFormatAndEngine,
2226  _Out_ PULONG CompressBufferWorkSpaceSize,
2227  _Out_ PULONG CompressFragmentWorkSpaceSize);
2228 
2229 NTSYSAPI
2230 NTSTATUS
2231 NTAPI
2233  _In_ USHORT CompressionFormatAndEngine,
2234  _In_reads_bytes_(UncompressedBufferSize) PUCHAR UncompressedBuffer,
2238  _In_ ULONG UncompressedChunkSize,
2239  _Out_ PULONG FinalCompressedSize,
2240  _In_ PVOID WorkSpace);
2241 
2243 NTSYSAPI
2244 NTSTATUS
2245 NTAPI
2247  _In_ USHORT CompressionFormat,
2253 
2255 NTSYSAPI
2256 NTSTATUS
2257 NTAPI
2259  _In_ USHORT CompressionFormat,
2264  _In_range_(<, CompressedBufferSize) ULONG FragmentOffset,
2266  _In_ PVOID WorkSpace);
2267 
2269 NTSYSAPI
2270 NTSTATUS
2271 NTAPI
2273  _In_ USHORT CompressionFormat,
2278 
2280 NTSYSAPI
2281 NTSTATUS
2282 NTAPI
2284  _In_ USHORT CompressionFormat,
2288  _In_ ULONG ChunkSize);
2289 
2291 NTSYSAPI
2292 NTSTATUS
2293 NTAPI
2295  _Out_writes_bytes_(UncompressedBufferSize) PUCHAR UncompressedBuffer,
2299  _In_reads_bytes_(CompressedTailSize) PUCHAR CompressedTail,
2302 
2304 NTSYSAPI
2305 NTSTATUS
2306 NTAPI
2308  _In_reads_bytes_(UncompressedBufferSize) PUCHAR UncompressedBuffer,
2314  _In_ PVOID WorkSpace);
2315 
2317 NTSYSAPI
2319 NTAPI
2321  _In_ PSID Sid);
2322 
2323 NTSYSAPI
2324 PUCHAR
2325 NTAPI
2327  _In_ PSID Sid);
2328 
2329 _When_(Status < 0, _Out_range_(>, 0))
2330 _When_(Status >= 0, _Out_range_(==, 0))
2331 NTSYSAPI
2332 ULONG
2333 NTAPI
2335  _In_ NTSTATUS Status);
2336 
2338 NTSYSAPI
2339 NTSTATUS
2340 NTAPI
2342  _In_ PCUNICODE_STRING VolumeRootPath);
2343 
2344 #if defined(_M_AMD64)
2345 
2347 VOID
2350  _In_ SIZE_T Length,
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 
2373 NTSYSAPI
2374 VOID
2375 NTAPI
2378  _In_ SIZE_T Length,
2379  _In_ ULONG Pattern);
2380 
2381 NTSYSAPI
2382 VOID
2383 NTAPI
2386  _In_ SIZE_T Length,
2387  _In_ ULONGLONG Pattern);
2388 
2389 #endif /* defined(_M_AMD64) */
2390 $endif (_NTIFS_)
2391 
2392 #endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
2393 
2394 $if (_NTIFS_)
2395 #if (NTDDI_VERSION >= NTDDI_WS03)
2397 NTSYSAPI
2398 NTSTATUS
2399 NTAPI
2403 #endif
2404 
2405 #if (NTDDI_VERSION >= NTDDI_WS03SP1)
2406 
2408 NTSYSAPI
2409 NTSTATUS
2410 NTAPI
2414  _Out_ PACL *Sacl,
2416 
2418 NTSYSAPI
2419 NTSTATUS
2420 NTAPI
2425 
2427 NTSYSAPI
2428 NTSTATUS
2429 NTAPI
2432  _Out_ PSID *Group,
2434 
2436 NTSYSAPI
2437 NTSTATUS
2438 NTAPI
2443 
2445 NTSYSAPI
2446 NTSTATUS
2447 NTAPI
2460 
2461 #endif /* (NTDDI_VERSION >= NTDDI_WS03SP1) */
2462 $endif (_NTIFS_)
2463 
2464 #if (NTDDI_VERSION >= NTDDI_VISTA)
2465 
2466 $if (_WDMDDK_)
2467 NTSYSAPI
2468 ULONG
2469 NTAPI
2470 RtlNumberOfSetBitsUlongPtr(
2472 
2473 NTSYSAPI
2474 ULONGLONG
2475 NTAPI
2479  _Out_opt_ PULONGLONG MinimumAddress,
2480  _Out_opt_ PULONGLONG MaximumAddress);
2481 
2482 NTSYSAPI
2483 NTSTATUS
2484 NTAPI
2487  _In_ UCHAR Type,
2490  _In_ ULONGLONG MinimumAddress,
2491  _In_ ULONGLONG MaximumAddress);
2492 
2493 NTSYSAPI
2494 ULONGLONG
2495 NTAPI
2499 
2500 NTSYSAPI
2501 NTSTATUS
2502 NTAPI
2504  _In_ ULONGLONG SourceLength,
2505  _Out_ PULONGLONG TargetLength);
2506 
2507 NTSYSAPI
2508 NTSTATUS
2509 NTAPI
2512  _In_ UCHAR Type,
2514  _In_ ULONGLONG Start);
2515 
2516 $endif (_WDMDDK_)
2517 $if (_NTDDK_)
2518 
2520 NTSYSAPI
2521 VOID
2522 NTAPI
2524  _Out_ PRTL_RUN_ONCE RunOnce);
2525 
2528 NTSYSAPI
2529 NTSTATUS
2530 NTAPI
2532  _Inout_ PRTL_RUN_ONCE RunOnce,
2536 
2539 NTSYSAPI
2540 NTSTATUS
2541 NTAPI
2543  _Inout_ PRTL_RUN_ONCE RunOnce,
2544  _In_ ULONG Flags,
2546 
2548 NTSYSAPI
2549 NTSTATUS
2550 NTAPI
2552  _Inout_ PRTL_RUN_ONCE RunOnce,
2553  _In_ ULONG Flags,
2555 
2556 NTSYSAPI
2557 BOOLEAN
2558 NTAPI
2560  _In_ ULONG OSMajorVersion,
2561  _In_ ULONG OSMinorVersion,
2562  _In_ ULONG SpMajorVersion,
2563  _In_ ULONG SpMinorVersion,
2564  _Out_ PULONG ReturnedProductType);
2565 
2566 $endif (_NTDDK_)
2567 $if (_NTIFS_)
2568 NTSYSAPI
2569 NTSTATUS
2570 NTAPI
2571 RtlNormalizeString(
2572  _In_ ULONG NormForm,
2577 
2578 NTSYSAPI
2579 NTSTATUS
2580 NTAPI
2582  _In_ ULONG NormForm,
2585  _Out_ PBOOLEAN Normalized);
2586 
2587 NTSYSAPI
2588 NTSTATUS
2589 NTAPI
2591  _In_ ULONG Flags,
2596 
2597 NTSYSAPI
2598 NTSTATUS
2599 NTAPI
2601  IN ULONG Flags,
2606 
2607 NTSYSAPI
2608 NTSTATUS
2609 NTAPI
2611  _In_ ULONG Flags,
2616 
2617 NTSYSAPI
2618 NTSTATUS
2619 NTAPI
2622  _Out_writes_bytes_opt_(*ServiceSidLength) PSID ServiceSid,
2623  _Inout_ PULONG ServiceSidLength);
2624 
2625 NTSYSAPI
2626 LONG
2627 NTAPI
2629  _In_ PCUNICODE_STRING Altitude1,
2630  _In_ PCUNICODE_STRING Altitude2);
2631 
2632 $endif (_NTIFS_)
2633 
2634 #endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
2635 
2636 #if (NTDDI_VERSION >= NTDDI_WIN7)
2637 
2638 $if (_WDMDDK_)
2641 NTSYSAPI
2642 NTSTATUS
2643 NTAPI
2649  _In_reads_bytes_(UnicodeStringByteCount) PCWCH UnicodeStringSource,
2651 
2654 NTSYSAPI
2655 NTSTATUS
2656 NTAPI
2662  _In_reads_bytes_(UTF8StringByteCount) PCCH UTF8StringSource,
2664 
2665 NTSYSAPI
2666 ULONG64
2667 NTAPI
2669  IN ULONG64 FeatureMask);
2670 
2671 $endif (_WDMDDK_)
2672 $if (_NTDDK_)
2673 
2675 NTSYSAPI
2676 BOOLEAN
2677 NTAPI
2678 RtlCreateHashTable(
2683 
2684 NTSYSAPI
2685 VOID
2686 NTAPI
2690 
2691 NTSYSAPI
2692 BOOLEAN
2693 NTAPI
2699 
2700 NTSYSAPI
2701 BOOLEAN
2702 NTAPI
2707 
2709 NTSYSAPI
2711 NTAPI
2716 
2718 NTSYSAPI
2720 NTAPI
2724 
2725 NTSYSAPI
2726 BOOLEAN
2727 NTAPI
2731 
2733 NTSYSAPI
2735 NTAPI
2739 
2740 NTSYSAPI
2741 VOID
2742 NTAPI
2746 
2747 NTSYSAPI
2748 BOOLEAN
2749 NTAPI
2753 
2755 NTSYSAPI
2757 NTAPI
2761 
2762 NTSYSAPI
2763 VOID
2764 NTAPI
2768 
2769 NTSYSAPI
2770 BOOLEAN
2771 NTAPI
2774 
2775 NTSYSAPI
2776 BOOLEAN
2777 NTAPI
2780 
2781 $endif (_NTDDK_)
2782 $if (_NTIFS_)
2785 NTSYSAPI
2786 NTSTATUS
2787 NTAPI
2792  _In_reads_bytes_(UnicodeStringByteCount) PCWCH UnicodeStringSource,
2794 
2797 NTSYSAPI
2798 NTSTATUS
2799 NTAPI
2804  _In_reads_bytes_(UTF8StringByteCount) PCCH UTF8StringSource,
2806 
2808 NTSYSAPI
2809 NTSTATUS
2810 NTAPI
2811 RtlReplaceSidInSd(
2814  _In_ PSID NewSid,
2816 
2817 NTSYSAPI
2818 NTSTATUS
2819 NTAPI
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
2834 static __inline
2838  _In_ LONG SignedInteger)
2839 {
2841  ret.QuadPart = SignedInteger;
2842  return ret;
2843 }
2844 
2845 //DECLSPEC_DEPRECATED_DDK_WINXP
2846 static __inline
2850  _In_ ULONG UnsignedInteger)
2851 {
2853  ret.QuadPart = UnsignedInteger;
2854  return ret;
2855 }
2856 
2857 //DECLSPEC_DEPRECATED_DDK_WINXP
2858 static __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
2872 static __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
2886 static __inline
2887 ULONG
2890  _In_ ULARGE_INTEGER Dividend,
2891  _In_ ULONG Divisor,
2893 {
2894  if (Remainder)
2895  *Remainder = (ULONG)(Dividend.QuadPart % Divisor);
2896  return (ULONG)(Dividend.QuadPart / Divisor);
2897 }
2898 
2899 //DECLSPEC_DEPRECATED_DDK
2900 static __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
2913 static __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
2927 static __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
2940 static __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))
2956 VOID
2957 RtlInitEmptyAnsiString(
2961 {
2962  AnsiString->Length = 0;
2963  AnsiString->MaximumLength = BufferSize;
2964  AnsiString->Buffer = Buffer;
2965 }
2966 
2968 _At_(UnicodeString->Length, _Post_equal_to_(0))
2971 VOID
2972 RtlInitEmptyUnicodeString(
2975  _When_(BufferSize != 0, _Notnull_)
2979  UnicodeString->Length = 0;
2980  UnicodeString->MaximumLength = BufferSize;
2981  UnicodeString->Buffer = Buffer;
2982 }
2983 $endif (_WDMDDK_)
2984 
2985 #if defined(_AMD64_) || defined(_IA64_)
2986 
2987 $if (_WDMDDK_)
2988 
2989 static __inline
2993  _In_ LARGE_INTEGER Multiplicand,
2994  _In_ LONG Multiplier)
2995 {
2997  ret.QuadPart = Multiplicand.QuadPart * Multiplier;
2998  return ret;
2999 }
3000 
3001 static __inline
3005  _In_ LARGE_INTEGER Dividend,
3006  _In_ ULONG Divisor,
3008 {
3010  ret.QuadPart = (ULONG64)Dividend.QuadPart / Divisor;
3011  if (Remainder)
3012  *Remainder = (ULONG)(Dividend.QuadPart % Divisor);
3013  return ret;
3014 }
3015 
3016 $endif (_WDMDDK_)
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)
3039 NTSYSAPI
3041 NTAPI
3043  _In_ LARGE_INTEGER Dividend,
3046 #endif
3047 
3048 $endif (_NTDDK_)
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
3060 static __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
3081 static __inline
3085  _In_ LARGE_INTEGER Addend1,
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
3103 static __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 
3124 PVOID
3127  _In_ SIZE_T Size)
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)
3144 BOOLEAN
3145 RtlCheckBit(
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 
3334 VOID
3336  _Out_ PSLIST_HEADER SListHead);
3337 
3338 #else /* defined(_WIN64) && ... */
3339 
3340 /* HACK */
3344 VOID
3345 NTAPI
3347  _In_ NTSTATUS Status);
3348 
3350 VOID
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 
3373 FASTCALL
3375  _Inout_ PSLIST_HEADER SListHead,
3377 
3380 FASTCALL
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 
3418 BOOLEAN
3420  _In_ ULONG Version);
3421 
3422 BOOLEAN
3424  _In_ ULONG Version);
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 
3524 LUID
3526 RtlConvertLongToLuid(
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 
3539 LUID
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)
3559 NTSYSAPI
3560 VOID
3561 NTAPI
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 
3573 VOID
3574 NTAPI
3577 {
3578  Context->ChainHead = NULL;
3579  Context->PrevLinkage = NULL;
3580 }
3581 
3583 VOID
3584 NTAPI
3588 {
3589  Context->ChainHead = Enumerator->ChainHead;
3590  Context->PrevLinkage = Enumerator->HashEntry.Linkage.Blink;
3591 }
3592 
3594 VOID
3595 NTAPI
3598 {
3600  return;
3601 }
3602 
3604 ULONG
3605 NTAPI
3608 {
3609  return HashTable->TableSize;
3610 }
3611 
3613 ULONG
3614 NTAPI
3617 {
3618  return HashTable->NonEmptyBuckets;
3619 }
3620 
3622 ULONG
3623 NTAPI
3626 {
3627  return HashTable->TableSize - HashTable->NonEmptyBuckets;
3628 }
3629 
3631 ULONG
3632 NTAPI
3635 {
3636  return HashTable->NumEntries;
3637 }
3638 
3640 ULONG
3641 NTAPI
3644 {
3645  return HashTable->NumEnumerators;
3646 }
3647 
3648 #endif /* (NTDDI_VERSION >= NTDDI_WIN7) */
3649 
3650 #endif /* !defined(MIDL_PASS) && !defined(SORTPP_PASS) */
3651 
3652 $endif (_NTDDK_)
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))))
3675 $endif (_NTIFS_)
_Notnull_ __drv_aliasesMem PWSTR Buffer
Definition: rtlfuncs.h:2976
NTSYSAPI PRTL_SPLAY_LINKS NTAPI RtlSplay(_Inout_ PRTL_SPLAY_LINKS Links)
_In_ PWSTR Path
Definition: rtlfuncs.h:4122
_When_(Status< 0, _Out_range_(>, 0)) _When_(Status >=0
__analysis_noreturn NTSYSAPI VOID NTAPI RtlAssert(_In_ PVOID FailedAssertion, _In_ PVOID FileName, _In_ ULONG LineNumber, _In_opt_z_ PSTR Message)
signed char * PCHAR
Definition: retypes.h:7
static __inline LARGE_INTEGER NTAPI_INLINE RtlConvertUlongToLargeInteger(_In_ ULONG UnsignedInteger)
Definition: rtlfuncs.h:2849
NTSTATUS NTAPI RtlUnicodeToUTF8N(CHAR *utf8_dest, ULONG utf8_bytes_max, ULONG *utf8_bytes_written, const WCHAR *uni_src, ULONG uni_bytes)
Definition: rtl.c:17
NTSYSAPI ULONG NTAPI RtlRandom(_Inout_ PULONG Seed)
CONST WCHAR * PCWCH
Definition: ntbasedef.h:411
CONST char * PCSZ
Definition: umtypes.h:125
NTSYSAPI PVOID NTAPI RtlLookupElementGenericTableFull(_In_ PRTL_GENERIC_TABLE Table, _In_ PVOID Buffer, _Out_ PVOID *NodeOrParent, _Out_ TABLE_SEARCH_RESULT *SearchResult)
FORCEINLINE VOID NTAPI RtlReleaseHashTableContext(_Inout_ PRTL_DYNAMIC_HASH_TABLE_CONTEXT Context)
Definition: rtlfuncs.h:3596
NTSYSAPI VOID NTAPI RtlUpperString(PSTRING DestinationString, PSTRING SourceString)
_Must_inspect_result_ NTSYSAPI PVOID NTAPI RtlEnumerateGenericTableWithoutSplaying(_In_ PRTL_GENERIC_TABLE Table, _Inout_ PVOID *RestartKey)
_In_ SIZE_T String1Length
Definition: rtlfuncs.h:513
RTL_GENERIC_COMPARE_ROUTINE * PRTL_GENERIC_COMPARE_ROUTINE
Definition: rtltypes.h:452
NTSYSAPI VOID NTAPI RtlGetCallersAddress(_Out_ PVOID *CallersAddress, _Out_ PVOID *CallersCaller)
Definition: except.c:22
*BytesInOemString PCHAR OemString
Definition: rtlfuncs.h:1560
NTSYSAPI BOOLEAN NTAPI RtlValidSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor)
Definition: sd.c:1055
_In_ ULONG TypeMask
Definition: rtlfuncs.h:4622
NTSYSAPI LONGLONG WINAPI RtlConvertLongToLargeInteger(LONG)
Definition: largeint.c:31
_In_ LARGE_INTEGER Addend2
Definition: rtlfuncs.h:3087
static PWSTR GuidString
Definition: apphelp.c:93
const uint16_t * PCWSTR
Definition: typedefs.h:57
_In_ PCWSTR _Inout_ _At_ QueryTable _Pre_unknown_ PRTL_QUERY_REGISTRY_TABLE QueryTable
Definition: rtlfuncs.h:4155
#define IN
Definition: typedefs.h:39
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
Definition: wdfdevice.h:3767
BOOLEAN NTAPI RtlIsNameLegalDOS8Dot3(_In_ PUNICODE_STRING Name, _Inout_opt_ POEM_STRING OemName, _Inout_opt_ PBOOLEAN NameContainsSpaces)
return
Definition: dirsup.c:529
FORCEINLINE ULONG NTAPI RtlActiveEnumeratorsHashTable(_In_ PRTL_DYNAMIC_HASH_TABLE HashTable)
Definition: rtlfuncs.h:3642
RTL_AVL_COMPARE_ROUTINE * PRTL_AVL_COMPARE_ROUTINE
Definition: rtltypes.h:385
FORCEINLINE VOID RtlpCheckListEntry(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:95
Definition: rtltypes.h:509
ASMGENDATA Table[]
Definition: genincdata.c:61
_Out_ PLARGE_INTEGER Time
Definition: rtlfuncs.h:4585
_In_opt_ PSID _In_opt_ BOOLEAN OwnerDefaulted
Definition: rtlfuncs.h:1629
*UnicodeStringActualByteCount PWSTR _In_ ULONG UnicodeStringMaxByteCount
Definition: rtlfuncs.h:2659
_Must_inspect_result_ NTSYSAPI NTSTATUS NTAPI RtlDowncaseUnicodeString(_When_(AllocateDestinationString, _Out_ _At_(UniDest->Buffer, __drv_allocatesMem(Mem))) _When_(!AllocateDestinationString, _Inout_) PUNICODE_STRING UniDest, _In_ PCUNICODE_STRING UniSource, _In_ BOOLEAN AllocateDestinationString)
_In_ __drv_aliasesMem PSTRING Prefix
Definition: rtlfuncs.h:1630
NTSYSAPI ULONG NTAPI RtlWalkFrameChain(_Out_writes_(Count -(Flags >> RTL_STACK_WALKING_MODE_FRAMES_TO_SKIP_SHIFT)) PVOID *Callers, _In_ ULONG Count, _In_ ULONG Flags)
NTSYSAPI ULONG64 NTAPI RtlGetEnabledExtendedFeatures(IN ULONG64 FeatureMask)
RTL_GENERIC_ALLOCATE_ROUTINE * PRTL_GENERIC_ALLOCATE_ROUTINE
Definition: rtltypes.h:461
NTSYSAPI VOID NTAPI RtlDeleteNoSplay(_In_ PRTL_SPLAY_LINKS Links, _Inout_ PRTL_SPLAY_LINKS *Root)
NTSYSAPI LONG WINAPI RtlCompareUnicodeStrings(const WCHAR *, SIZE_T, const WCHAR *, SIZE_T, BOOLEAN)
Definition: hash.c:67
_In_ PCWSTR _In_ LONG _Out_writes_to_ DestinationStringLength PWSTR _Inout_ PLONG DestinationStringLength
Definition: rtlfuncs.h:2575
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
_Must_inspect_result_ NTSYSAPI PVOID NTAPI RtlEnumerateGenericTableLikeADirectory(_In_ PRTL_AVL_TABLE Table, _In_opt_ PRTL_AVL_MATCH_FUNCTION MatchFunction, _In_opt_ PVOID MatchData, _In_ ULONG NextFlag, _Inout_ PVOID *RestartKey, _Inout_ PULONG DeleteCount, _In_ PVOID Buffer)
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: wdfresource.h:339
NTSYSAPI VOID NTAPI RtlSetBits(_In_ PRTL_BITMAP BitMapHeader, _In_range_(0, BitMapHeader->SizeOfBitMap - NumberToSet) ULONG StartingIndex, _In_range_(0, BitMapHeader->SizeOfBitMap - StartingIndex) ULONG NumberToSet)
Definition: bitmap.c:374
NTSYSAPI NTSTATUS WINAPI RtlOemToUnicodeN(LPWSTR, DWORD, LPDWORD, LPCSTR, DWORD)
#define _In_opt_
Definition: ms_sal.h:309
NTSYSAPI VOID NTAPI RtlDeleteHashTable(_In_ _When_((HashTable->Flags &RTL_HASH_ALLOCATED_HEADER), __drv_freesMem(Mem) _Post_invalid_) PRTL_DYNAMIC_HASH_TABLE HashTable)
NTSYSAPI NTSTATUS NTAPI RtlSetGroupSecurityDescriptor(IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor, IN PSID Group, IN BOOLEAN GroupDefaulted)
Definition: sd.c:410
_In_ __inner_callback PRTL_RUN_ONCE_INIT_FN InitFn
Definition: rtlfuncs.h:2533
#define SECURITY_MAX_SID_SIZE
Definition: setypes.h:473
NTSTATUS NTAPI RtlGetVersion(IN OUT PRTL_OSVERSIONINFOW lpVersionInformation)
Definition: version.c:158
NTSYSAPI NTSTATUS NTAPI RtlCreateSecurityDescriptorRelative(_Out_ PISECURITY_DESCRIPTOR_RELATIVE SecurityDescriptor, _In_ ULONG Revision)
NTSYSAPI LONG NTAPI RtlCompareString(PSTRING String1, PSTRING String2, BOOLEAN CaseInSensitive)
NTSYSAPI NTSTATUS WINAPI RtlInitUnicodeStringEx(PUNICODE_STRING, PCWSTR)
#define _Inout_
Definition: ms_sal.h:378
_Inout_opt_ POEM_STRING _Out_opt_ PBOOLEAN NameContainsSpaces
Definition: rtlfuncs.h:3036
_Must_inspect_result_ _In_ WDFQUEUE _In_opt_ WDFREQUEST _In_opt_ WDFFILEOBJECT _Inout_opt_ PWDF_REQUEST_PARAMETERS Parameters
Definition: wdfio.h:863
_Success_(return!=FALSE) NTSYSAPI BOOLEAN NTAPI RtlIsValidIndexHandle(_In_ PRTL_HANDLE_TABLE HandleTable
Definition: mapping.c:279
_Must_inspect_result_ NTSYSAPI SIZE_T NTAPI RtlCompareMemoryUlong(_In_reads_bytes_(Length) PVOID Source, _In_ SIZE_T Length, _In_ ULONG Pattern)
_In_ BOOLEAN _In_opt_ PACL _In_opt_ BOOLEAN DaclDefaulted
Definition: rtlfuncs.h:1594
BOOLEAN NTAPI RtlIsValidOemCharacter(IN PWCHAR Char)
Definition: unicode.c:514
NTSYSAPI NTSTATUS WINAPI RtlQueryRegistryValues(ULONG, PCWSTR, PRTL_QUERY_REGISTRY_TABLE, PVOID, PVOID)
struct _Entry Entry
Definition: kefuncs.h:627
NTSYSAPI BOOLEAN WINAPI RtlPrefixString(const STRING *, const STRING *, BOOLEAN)
Definition: unicode.c:886
Definition: scsiwmi.h:51
NTSYSAPI BOOLEAN NTAPI RtlExpandHashTable(_In_ PRTL_DYNAMIC_HASH_TABLE HashTable)
NTSTATUS NTAPI RtlDescribeChunk(IN USHORT CompressionFormat, IN OUT PUCHAR *CompressedBuffer, IN PUCHAR EndOfCompressedBufferPlus1, OUT PUCHAR *ChunkBuffer, OUT PULONG ChunkSize)
Definition: compress.c:389
static __inline LARGE_INTEGER NTAPI_INLINE RtlLargeIntegerSubtract(_In_ LARGE_INTEGER Minuend, _In_ LARGE_INTEGER Subtrahend)
Definition: rtlfuncs.h:2916
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY ListEnd
Definition: exfuncs.h:1223
Definition: ntbasedef.h:628
static __inline ULONG NTAPI_INLINE RtlEnlargedUnsignedDivide(_In_ ULARGE_INTEGER Dividend, _In_ ULONG Divisor, _Out_opt_ PULONG Remainder)
Definition: rtlfuncs.h:2889
#define MAXLONG
Definition: umtypes.h:116
#define _In_opt_z_
Definition: ms_sal.h:314
#define RtlUlonglongByteSwap(_x)
Definition: rtlfuncs.h:3199
#define _Out_
Definition: ms_sal.h:345
NTSYSAPI ULONG NTAPI RtlNumberGenericTableElements(_In_ PRTL_GENERIC_TABLE Table)
return ret
Definition: rtlfuncs.h:3090
NTSYSAPI ULONG NTAPI RtlNumberOfClearBits(_In_ PRTL_BITMAP BitMapHeader)
Definition: bitmap.c:500
NTSYSAPI CCHAR WINAPI RtlFindMostSignificantBit(ULONGLONG)
Definition: bitmap.c:211
NTSYSAPI NTSTATUS WINAPI RtlInitAnsiStringEx(PANSI_STRING, PCSZ)
* PSID_IDENTIFIER_AUTHORITY
Definition: setypes.h:451
void WINAPI RtlRunOnceInitialize(RTL_RUN_ONCE *once)
Definition: runonce.c:11
_Ret_range_(<, MAXLONG) NTSYSAPI ULONG NTAPI RtlRandom(_Inout_ PULONG Seed)
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID _In_opt_ const WSK_CLIENT_CONNECTION_DISPATCH _In_opt_ PEPROCESS _In_opt_ PETHREAD _In_opt_ PSECURITY_DESCRIPTOR SecurityDescriptor
Definition: wsk.h:182
#define RtlUshortByteSwap(_x)
Definition: rtlfuncs.h:3197
_Must_inspect_result_ NTSYSAPI PRTL_SPLAY_LINKS NTAPI RtlSubtreeSuccessor(_In_ PRTL_SPLAY_LINKS Links)
_In_ ULONG FramesToCapture
_Must_inspect_result_ NTSYSAPI PRTL_DYNAMIC_HASH_TABLE_ENTRY NTAPI RtlGetNextEntryHashTable(_In_ PRTL_DYNAMIC_HASH_TABLE HashTable, _In_ PRTL_DYNAMIC_HASH_TABLE_CONTEXT Context)
NTSYSAPI ULONGLONG WINAPI RtlLargeIntegerDivide(ULONGLONG, ULONGLONG, ULONGLONG *)
NTSYSAPI VOID NTAPI RtlSecondsSince1970ToTime(_In_ ULONG SecondsSince1970, _Out_ PLARGE_INTEGER Time)
uint16_t * PWSTR
Definition: typedefs.h:56
struct _LIST_ENTRY * Blink
Definition: typedefs.h:122
FORCEINLINE VOID InsertHeadList(_Inout_ PLIST_ENTRY ListHead, _Inout_ __drv_aliasesMem PLIST_ENTRY Entry)
Definition: rtlfuncs.h:201
NTSYSAPI BOOLEAN NTAPI RtlDeleteElementGenericTableAvl(_In_ PRTL_AVL_TABLE Table, _In_ PVOID Buffer)
_In_ BOOLEAN _In_ ULONG HashAlgorithm
Definition: rtlfuncs.h:2037
NTSYSAPI PVOID NTAPI RtlFreeSid(_In_ _Post_invalid_ PSID Sid)
VOID NTAPI RtlRemoveUnicodePrefix(PUNICODE_PREFIX_TABLE PrefixTable, PUNICODE_PREFIX_TABLE_ENTRY PrefixTableEntry)
_In_opt_ PSID Group
Definition: rtlfuncs.h:1605
_In_ PCWSTR _Inout_ _At_ QueryTable _Pre_unknown_ PRTL_QUERY_REGISTRY_TABLE _In_opt_ PVOID _In_opt_ PVOID Environment
Definition: rtlfuncs.h:4155
_In_ __drv_aliasesMem PSTRING _Out_ PPREFIX_TABLE_ENTRY PrefixTableEntry
Definition: rtlfuncs.h:1630
unsigned char * PUCHAR
Definition: retypes.h:3
char CHAR
Definition: xmlstorage.h:175
FORCEINLINE PLIST_ENTRY RemoveTailList(_Inout_ PLIST_ENTRY ListHead)
Definition: rtlfuncs.h:154
NTSYSAPI ULONGLONG NTAPI RtlCmDecodeMemIoResource(_In_ struct _CM_PARTIAL_RESOURCE_DESCRIPTOR *Descriptor, _Out_opt_ PULONGLONG Start)
#define _Outptr_
Definition: ms_sal.h:427
enum _TABLE_SEARCH_RESULT TABLE_SEARCH_RESULT
NTSYSAPI LONG NTAPI RtlCompareUnicodeString(PCUNICODE_STRING String1, PCUNICODE_STRING String2, BOOLEAN CaseInsensitive)
Definition: string_lib.cpp:31
NTSYSAPI NTSTATUS NTAPI RtlUnicodeToMultiByteSize(PULONG MbSize, PCWCH UnicodeString, ULONG UnicodeSize)
NTSYSAPI void WINAPI RtlInitializeBitMap(PRTL_BITMAP, PULONG, ULONG)
LONG NTSTATUS
Definition: precomp.h:26
_Must_inspect_result_ NTSYSAPI PVOID NTAPI RtlEnumerateGenericTable(_In_ PRTL_GENERIC_TABLE Table, _In_ BOOLEAN Restart)
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:606
NTSYSAPI NTSTATUS NTAPI RtlFindClosestEncodableLength(_In_ ULONGLONG SourceLength, _Out_ PULONGLONG TargetLength)
#define _Out_writes_to_(size, count)
Definition: ms_sal.h:355
_In_opt_ ULONG Base
Definition: rtlfuncs.h:2386
ush Pos
Definition: deflate.h:92
_In_ ULONG MaxBytesInCustomCPString
Definition: rtlfuncs.h:1956
NTSYSAPI VOID NTAPI RtlSetBit(_In_ PRTL_BITMAP BitMapHeader, _In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitNumber)
Definition: bitmap.c:304
#define _NTIFS_
Definition: ifssupp.h:20
_In_ PCWSTR _In_ LONG SourceStringLength
Definition: rtlfuncs.h:2573
_In_ BOOLEAN _In_ ULONG _Out_ PULONG HashValue
Definition: rtlfuncs.h:2037
NTSYSAPI NTSTATUS WINAPI RtlMultiByteToUnicodeSize(DWORD *, LPCSTR, UINT)
NTSYSAPI PVOID NTAPI RtlLookupElementGenericTableFullAvl(_In_ PRTL_AVL_TABLE Table, _In_ PVOID Buffer, _Out_ PVOID *NodeOrParent, _Out_ TABLE_SEARCH_RESULT *SearchResult)
static __inline LARGE_INTEGER NTAPI_INLINE RtlLargeIntegerNegate(_In_ LARGE_INTEGER Subtrahend)
Definition: rtlfuncs.h:2903
#define RtlCopyMemoryNonTemporal
Definition: rtlfuncs.h:293
#define ExRaiseStatus
Definition: ntoskrnl.h:104
NTSYSAPI LONGLONG WINAPI RtlExtendedMagicDivide(LONGLONG, LONGLONG, INT)
NTSYSAPI NTSTATUS NTAPI RtlIdnToAscii(_In_ ULONG Flags, _In_ PCWSTR SourceString, _In_ LONG SourceStringLength, _Out_writes_to_(*DestinationStringLength, *DestinationStringLength) PWSTR DestinationString, _Inout_ PLONG DestinationStringLength)
NTSYSAPI PVOID NTAPI RtlInsertElementGenericTableFullAvl(_In_ PRTL_AVL_TABLE Table, _In_reads_bytes_(BufferSize) PVOID Buffer, _In_ CLONG BufferSize, _Out_opt_ PBOOLEAN NewElement, _In_ PVOID NodeOrParent, _In_ TABLE_SEARCH_RESULT SearchResult)
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
NTSTATUS WINAPI RtlUTF8ToUnicodeN(PWSTR uni_dest, ULONG uni_bytes_max, PULONG uni_bytes_written, PCCH utf8_src, ULONG utf8_bytes)
Definition: reactos.cpp:21
unsigned short Length
Definition: sprintf.c:451
#define _WDMDDK_
Definition: wdm.template.h:26
NTSYSAPI PULONG NTAPI RtlSubAuthoritySid(_In_ PSID Sid, _In_ ULONG SubAuthority)
NTSTATUS NTAPI RtlOemStringToCountedUnicodeString(IN OUT PUNICODE_STRING UniDest, IN PCOEM_STRING OemSource, IN BOOLEAN AllocateDestinationString)
Definition: unicode.c:1474
#define RtlCheckBit(BMH, BP)
Definition: rtlfuncs.h:3152
NTSYSAPI NTSTATUS WINAPI RtlSetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR, PSID, BOOLEAN)
NTSYSAPI VOID NTAPI RtlSetAllBits(_In_ PRTL_BITMAP BitMapHeader)
Definition: bitmap.c:283
NTSYSAPI ULONG NTAPI RtlFindNextForwardRunClear(_In_ PRTL_BITMAP BitMapHeader, _In_ ULONG FromIndex, _Out_ PULONG StartingRunIndex)
VOID NTAPI RtlInitializeUnicodePrefix(PUNICODE_PREFIX_TABLE PrefixTable)
_Must_inspect_result_ NTSYSAPI PVOID NTAPI RtlEnumerateGenericTableWithoutSplayingAvl(_In_ PRTL_AVL_TABLE Table, _Inout_ PVOID *RestartKey)
NTSYSAPI NTSTATUS NTAPI RtlGetGroupSecurityDescriptor(_In_ PSECURITY_DESCRIPTOR SecurityDescriptor, _Out_ PSID *Group, _Out_ PBOOLEAN GroupDefaulted)
NTSYSAPI NTSTATUS NTAPI RtlGetAce(PACL Acl, ULONG AceIndex, PVOID *Ace)
_In_ PRTL_GENERIC_COMPARE_ROUTINE _In_ PRTL_GENERIC_ALLOCATE_ROUTINE _In_ PRTL_GENERIC_FREE_ROUTINE _In_opt_ PVOID TableContext
Definition: rtlfuncs.h:1088
NTSYSAPI NTSTATUS WINAPI RtlSelfRelativeToAbsoluteSD(PSECURITY_DESCRIPTOR, PSECURITY_DESCRIPTOR, PDWORD, PACL, PDWORD, PACL, PDWORD, PSID, PDWORD, PSID, PDWORD)
NTSYSAPI LONGLONG WINAPI RtlLargeIntegerAdd(LONGLONG, LONGLONG)
NTSYSAPI ULONG WINAPI RtlFindSetBits(PCRTL_BITMAP, ULONG, ULONG)
NTSYSAPI NTSTATUS NTAPI RtlCreateSecurityDescriptor(_Out_ PSECURITY_DESCRIPTOR SecurityDescriptor, _In_ ULONG Revision)
$endif(_WDMDDK_) $if(_WDMDDK_) _Must_inspect_result_ NTSYSAPI BOOLEAN NTAPI RtlAreBitsClear(_In_ PRTL_BITMAP BitMapHeader
Definition: rtlfuncs.h:3455
_Unchanged_(DestinationString->Buffer) _Unchanged_(DestinationString -> MaximumLength) _At_(DestinationString->Length, _When_(SourceString->Length > DestinationString->MaximumLength, _Post_equal_to_(DestinationString->MaximumLength)) _When_(SourceString->Length<=DestinationString->MaximumLength, _Post_equal_to_(SourceString->Length))) NTSYSAPI VOID NTAPI RtlCopyUnicodeString(_Inout_ PUNICODE_STRING DestinationString, _In_opt_ PCUNICODE_STRING SourceString)
NTSYSAPI BOOLEAN NTAPI RtlEqualUnicodeString(PCUNICODE_STRING String1, PCUNICODE_STRING String2, BOOLEAN CaseInsensitive)
uint16_t * PWCHAR
Definition: typedefs.h:56
__drv_allocatesMem(Mem)) PRTL_DYNAMIC_HASH_TABLE *HashTable
Definition: exfuncs.h:1476
NTSYSAPI BOOLEAN WINAPI RtlValidRelativeSecurityDescriptor(PSECURITY_DESCRIPTOR, ULONG, SECURITY_INFORMATION)
_In_ PVOID Parameter
Definition: ldrtypes.h:241
NTSYSAPI NTSTATUS WINAPI RtlAddAccessAllowedAce(PACL, DWORD, DWORD, PSID)
if(dx==0 &&dy==0)
Definition: linetemp.h:174
VOID NTAPI PfxRemovePrefix(IN PPREFIX_TABLE PrefixTable, IN PPREFIX_TABLE_ENTRY PrefixTableEntry)
Definition: prefix.c:34
NTSYSAPI NTSTATUS WINAPI RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR, BOOLEAN, PACL, BOOLEAN)
NTSYSAPI VOID NTAPI RtlCopyString(_Out_ PSTRING DestinationString, _In_opt_ const STRING *SourceString)
NTSYSAPI ULONG WINAPI RtlLengthSecurityDescriptor(PSECURITY_DESCRIPTOR)
NTSYSAPI BOOLEAN NTAPI RtlEqualString(PSTRING String1, PSTRING String2, BOOLEAN CaseInSensitive)
NTSYSAPI VOID NTAPI RtlCaptureContext(_Out_ PCONTEXT ContextRecord)
#define RtlIsServicePackVersionInstalled
Definition: rtlfuncs.h:3431
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _In_ ULONG _Out_opt_ PULONG _Out_opt_ PULONG ValueType
Definition: wdfregistry.h:279
NTSYSAPI WCHAR NTAPI RtlUpcaseUnicodeChar(WCHAR Source)
#define FASTCALL
Definition: nt_native.h:50
#define NTSYSAPI
Definition: ntoskrnl.h:14
_In_ ULONG SecurityDescriptorLength
Definition: rtlfuncs.h:1673
_In_ ULONG Revision
Definition: rtlfuncs.h:1103
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
#define _Post_equal_to_(expr)
Definition: ms_sal.h:578
#define DECLSPEC_NORETURN
Definition: ntbasedef.h:176
#define _Pre_readable_size_(size)
Definition: ms_sal.h:644
#define _Pre_unknown_
Definition: ms_sal.h:677
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
$if(_WDMDDK_) DECLSPEC_NORETURN FORCEINLINE VOID RtlFailFast(_In_ ULONG Code)
Definition: rtlfuncs.h:5
_In_ BOOLEAN DaclPresent
Definition: rtlfuncs.h:1594
static BOOL Set
Definition: pageheap.c:10
NTSYSAPI ULONG NTAPI RtlxUnicodeStringToAnsiSize(IN PCUNICODE_STRING UnicodeString)
Definition: unicode.c:2178
NTSYSAPI NTSTATUS NTAPI RtlGetDaclSecurityDescriptor(_In_ PSECURITY_DESCRIPTOR SecurityDescriptor, _Out_ PBOOLEAN DaclPresent, _Out_ PACL *Dacl, _Out_ PBOOLEAN DaclDefaulted)
_In_ ULONG _In_ ULONG HintIndex
Definition: rtlfuncs.h:609
NTSYSAPI LARGE_INTEGER NTAPI RtlExtendedIntegerMultiply(_In_ LARGE_INTEGER Multiplicand, _In_ LONG Multiplier)
_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:1558
NTSYSAPI BOOLEAN NTAPI RtlInitWeakEnumerationHashTable(_In_ PRTL_DYNAMIC_HASH_TABLE HashTable, _Out_ PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator)
OSVERSIONINFOW VersionInfo
Definition: wkssvc.c:40
NTSYSAPI NTSTATUS NTAPI RtlCreateAcl(PACL Acl, ULONG AclSize, ULONG AclRevision)
NTSYSAPI NTSTATUS NTAPI RtlCharToInteger(PCSZ String, ULONG Base, PULONG Value)
Definition: unicode.c:261
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
#define _Reserved_
Definition: ms_sal.h:295
uint32_t ULONG_PTR
Definition: typedefs.h:65
NTSYSAPI ULONG NTAPI RtlxOemStringToUnicodeSize(IN PCOEM_STRING OemString)
Definition: unicode.c:2125
_Must_inspect_result_ NTSYSAPI PRTL_SPLAY_LINKS NTAPI RtlSubtreePredecessor(_In_ PRTL_SPLAY_LINKS Links)
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
FORCEINLINE ULONG NTAPI RtlTotalEntriesHashTable(_In_ PRTL_DYNAMIC_HASH_TABLE HashTable)
Definition: rtlfuncs.h:3633
NTSYSAPI VOID NTAPI RtlClearAllBits(_In_ PRTL_BITMAP BitMapHeader)
Definition: bitmap.c:272
NTSYSAPI VOID NTAPI RtlClearBits(_In_ PRTL_BITMAP BitMapHeader, _In_range_(0, BitMapHeader->SizeOfBitMap - NumberToClear) ULONG StartingIndex, _In_range_(0, BitMapHeader->SizeOfBitMap - StartingIndex) ULONG NumberToClear)
Definition: bitmap.c:314
#define RTLVERLIB_DDI(x)
Definition: rtltypes.h:226
FORCEINLINE VOID PushEntryList(_Inout_ PSINGLE_LIST_ENTRY ListHead, _Inout_ __drv_aliasesMem PSINGLE_LIST_ENTRY Entry)
Definition: rtlfuncs.h:253
NTSYSAPI ULONG NTAPI RtlNumberOfSetBits(_In_ PRTL_BITMAP BitMapHeader)
Definition: bitmap.c:474
PPREFIX_TABLE_ENTRY NTAPI PfxFindPrefix(IN PPREFIX_TABLE PrefixTable, IN PSTRING FullName)
Definition: prefix.c:42
ULONG CLONG
Definition: umtypes.h:126
FORCEINLINE ULONG NTAPI RtlNonEmptyBucketsHashTable(_In_ PRTL_DYNAMIC_HASH_TABLE HashTable)
Definition: rtlfuncs.h:3615
#define RTL_STACK_WALKING_MODE_FRAMES_TO_SKIP_SHIFT
Definition: rtlfuncs.h:1176
NTSYSAPI NTSTATUS NTAPI RtlInitializeSid(IN OUT PSID Sid, IN PSID_IDENTIFIER_AUTHORITY IdentifierAuthority, IN UCHAR SubAuthorityCount)
NTSYSAPI NTSTATUS NTAPI RtlGetOwnerSecurityDescriptor(_In_ PSECURITY_DESCRIPTOR SecurityDescriptor, _Out_ PSID *Owner, _Out_ PBOOLEAN OwnerDefaulted)
_In_ ULONG _In_ ULONG _Out_ PULONG FinalUncompressedSize
Definition: rtlfuncs.h:3229
void * Buffer
Definition: sprintf.c:453
NTSYSAPI NTSTATUS NTAPI RtlIoEncodeMemIoResource(_In_ struct _IO_RESOURCE_DESCRIPTOR *Descriptor, _In_ UCHAR Type, _In_ ULONGLONG Length, _In_ ULONGLONG Alignment, _In_ ULONGLONG MinimumAddress, _In_ ULONGLONG MaximumAddress)
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
NTSYSAPI NTSTATUS WINAPI RtlVerifyVersionInfo(const RTL_OSVERSIONINFOEXW *, DWORD, DWORDLONG)
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2430
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
_In_ ULONG NumberToFind
Definition: rtlfuncs.h:609
#define FALSE
Definition: types.h:117
_In_opt_ PVOID _In_opt_ SIZE_T _In_opt_ SIZE_T CommitSize
Definition: rtlfuncs.h:2167
NTSYSAPI LONG NTAPI RtlCompareAltitudes(_In_ PCUNICODE_STRING Altitude1, _In_ PCUNICODE_STRING Altitude2)
NTSYSAPI VOID NTAPI RtlSecondsSince1980ToTime(_In_ ULONG ElapsedSeconds, _Out_ PLARGE_INTEGER Time)
_Inout_ PUCHAR _In_ PUCHAR _Out_ PUCHAR _Out_ PULONG ChunkSize
Definition: rtlfuncs.h:2274
NTSYSAPI NTSTATUS WINAPI RtlWriteRegistryValue(ULONG, PCWSTR, PCWSTR, ULONG, PVOID, ULONG)
_Inout_ PUCHAR * CompressedBuffer
Definition: rtlfuncs.h:2274
#define RtlIsNtDdiVersionAvailable
Definition: rtlfuncs.h:3427
NTSYSAPI NTSTATUS NTAPI RtlUnicodeToOemN(PCHAR OemString, ULONG OemSize, PULONG ResultSize, PCWCH UnicodeString, ULONG UnicodeSize)
_In_ PSID OldSid
Definition: rtlfuncs.h:2813
long LONG
Definition: pedump.c:60
DWORD SECURITY_INFORMATION
Definition: ms-dtyp.idl:311
NTSYSAPI CHAR NTAPI RtlUpperChar(CHAR Source)
*BytesInMultiByteString PCHAR _In_ ULONG MaxBytesInMultiByteString
Definition: rtlfuncs.h:1527
_In_ const STRING _In_ BOOLEAN CaseInSensitive
Definition: rtlfuncs.h:2335
_In_ PSID SourceSid
Definition: rtlfuncs.h:1332
_In_ PRTL_GENERIC_COMPARE_ROUTINE CompareRoutine
Definition: rtlfuncs.h:1088
#define __inner_callback
Definition: ms_sal.h:2636
NTSTATUS NTAPI RtlCustomCPToUnicodeN(IN PCPTABLEINFO CustomCP, OUT PWCHAR UnicodeString, IN ULONG UnicodeSize, OUT PULONG ResultSize OPTIONAL, IN PCHAR CustomString, IN ULONG CustomSize)
Definition: nls.c:45
RTL_GENERIC_FREE_ROUTINE * PRTL_GENERIC_FREE_ROUTINE
Definition: rtltypes.h:469
NTSYSAPI NTSTATUS NTAPI RtlUpcaseUnicodeStringToOemString(POEM_STRING DestinationString, PCUNICODE_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI NTSTATUS NTAPI RtlCreateServiceSid(_In_ PUNICODE_STRING ServiceName, _Out_writes_bytes_opt_(*ServiceSidLength) PSID ServiceSid, _Inout_ PULONG ServiceSidLength)
Definition: sid.c:412
NTSYSAPI PUCHAR NTAPI RtlSubAuthorityCountSid(_In_ PSID Sid)
Definition: rtltypes.h:621
_Must_inspect_result_ NTSYSAPI PRTL_DYNAMIC_HASH_TABLE_ENTRY NTAPI RtlEnumerateEntryHashTable(_In_ PRTL_DYNAMIC_HASH_TABLE HashTable, _Inout_ PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator)
NTSYSAPI NTSTATUS NTAPI RtlAbsoluteToSelfRelativeSD(IN PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor, IN OUT PSECURITY_DESCRIPTOR SelfRelativeSecurityDescriptor, IN PULONG BufferLength)
Definition: sd.c:626
NTSYSAPI NTSTATUS WINAPI RtlInt64ToUnicodeString(ULONGLONG, ULONG, UNICODE_STRING *)
_Out_ PBOOLEAN SaclPresent
Definition: rtlfuncs.h:2413
#define __drv_aliasesMem
Definition: btrfs_drv.h:205
CHAR * PCH
Definition: ntbasedef.h:391
Definition: card.h:12
#define _Maybe_raises_SEH_exception_
Definition: ms_sal.h:2956
NTSYSAPI PVOID NTAPI RtlInsertElementGenericTableAvl(_In_ PRTL_AVL_TABLE Table, _In_reads_bytes_(BufferSize) PVOID Buffer, _In_ CLONG BufferSize, _Out_opt_ PBOOLEAN NewElement)
NTSYSAPI NTSTATUS NTAPI RtlValidateUnicodeString(_In_ ULONG Flags, _In_ PCUNICODE_STRING String)
Definition: unicode.c:2559
_Out_writes_bytes_to_(UncompressedBufferSize, *FinalUncompressedSize) PUCHAR UncompressedBuffer
NTSYSAPI VOID NTAPI RtlTimeToTimeFields(PLARGE_INTEGER Time, PTIME_FIELDS TimeFields)
_In_ ULONG _Out_opt_ PULONG BackTraceHash
unsigned char BOOLEAN
_In_ ULONG _In_ SECURITY_INFORMATION RequiredInformation
Definition: rtlfuncs.h:1673
NTSYSAPI NTSTATUS NTAPI RtlGetCompressionWorkSpaceSize(_In_ USHORT CompressionFormatAndEngine, _Out_ PULONG CompressBufferWorkSpaceSize, _Out_ PULONG CompressFragmentWorkSpaceSize)
_Out_ _Inout_ POEM_STRING DestinationString
Definition: rtlfuncs.h:1868
static WCHAR Address[46]
Definition: ping.c:68
_In_ ULONG _Out_opt_ PULONG _In_ ULONG BytesInCustomCPString
Definition: rtlfuncs.h:1947
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PCANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
#define _Out_writes_bytes_all_(size)
Definition: ms_sal.h:362
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
#define _In_
Definition: ms_sal.h:308
NTSTATUS NTAPI RtlCompressChunks(IN PUCHAR UncompressedBuffer, IN ULONG UncompressedBufferSize, OUT PUCHAR CompressedBuffer, IN ULONG CompressedBufferSize, IN OUT PCOMPRESSED_DATA_INFO CompressedDataInfo, IN ULONG CompressedDataInfoLength, IN PVOID WorkSpace)
Definition: compress.c:310
_In_ ULONG _In_ ACCESS_MASK _In_ PSID Sid
Definition: rtlfuncs.h:1103
NTSYSAPI ULONG WINAPI RtlFindClearBitsAndSet(PRTL_BITMAP, ULONG, ULONG)
NTSYSAPI LARGE_INTEGER NTAPI RtlExtendedLargeIntegerDivide(_In_ LARGE_INTEGER Dividend, _In_ ULONG Divisor, _Out_opt_ PULONG Remainder)
_In_ PGENERIC_MAPPING GenericMapping
Definition: rtlfuncs.h:1261
FORCEINLINE PLIST_ENTRY RemoveHeadList(_Inout_ PLIST_ENTRY ListHead)
Definition: rtlfuncs.h:128
NTSYSAPI BOOLEAN NTAPI RtlContractHashTable(_In_ PRTL_DYNAMIC_HASH_TABLE HashTable)
#define NTKERNELAPI
NTSYSAPI NTSTATUS NTAPI RtlCreateRegistryKey(_In_ ULONG RelativeTo, _In_ PWSTR Path)
#define _In_z_
Definition: ms_sal.h:313
_Out_ _At_(DestinationString->Buffer, __drv_allocatesMem(Mem))) _When_(!AllocateDestinationString
_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:1554
_In_ const STRING _In_ BOOLEAN CaseInsensitive
Definition: rtlfuncs.h:2304
_In_ PRTL_GENERIC_COMPARE_ROUTINE _In_ PRTL_GENERIC_ALLOCATE_ROUTINE _In_ PRTL_GENERIC_FREE_ROUTINE FreeRoutine
Definition: rtlfuncs.h:1088
Definition: bufpool.h:45
NTSYSAPI ULONG WINAPI RtlFindClearBits(PCRTL_BITMAP, ULONG, ULONG)
NTSYSAPI ULONG NTAPI RtlLengthSid(IN PSID Sid)
Definition: sid.c:150
_IRQL_requires_max_(APC_LEVEL) _When_(Status< 0
Definition: cddata.c:197
_Must_inspect_result_ NTSYSAPI PRTL_DYNAMIC_HASH_TABLE_ENTRY NTAPI RtlLookupEntryHashTable(_In_ PRTL_DYNAMIC_HASH_TABLE HashTable, _In_ ULONG_PTR Signature, _Out_opt_ PRTL_DYNAMIC_HASH_TABLE_CONTEXT Context)
NTSYSAPI BOOLEAN NTAPI RtlValidSid(IN PSID Sid)
Definition: sid.c:21
NTSYSAPI VOID NTAPI RtlCopyUnicodeString(PUNICODE_STRING DestinationString, PCUNICODE_STRING SourceString)
FORCEINLINE VOID NTAPI RtlInitHashTableContext(_Inout_ PRTL_DYNAMIC_HASH_TABLE_CONTEXT Context)
Definition: rtlfuncs.h:3575
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)
static __inline LARGE_INTEGER NTAPI_INLINE RtlLargeIntegerShiftRight(_In_ LARGE_INTEGER LargeInteger, _In_ CCHAR ShiftCount)
Definition: rtlfuncs.h:2875
_In_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _Out_ PVOID _Out_ PMDL _Out_ PIO_STATUS_BLOCK _Out_ struct _COMPRESSED_DATA_INFO _In_ ULONG CompressedDataInfoLength
Definition: iotypes.h:1658
_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)
#define _Valid_
Definition: ms_sal.h:626
_Inout_opt_ POEM_STRING OemName
Definition: rtlfuncs.h:3036
FORCEINLINE PSINGLE_LIST_ENTRY PopEntryList(_Inout_ PSINGLE_LIST_ENTRY ListHead)
Definition: rtlfuncs.h:240
#define _Out_writes_bytes_opt_(size)
Definition: ms_sal.h:351
FORCEINLINE VOID InitializeSListHead(_Out_ PSLIST_HEADER SListHead)
Definition: rtlfuncs.h:3351
_In_ ULONG _Inout_updates_bytes_(CompressedDataInfoLength) PCOMPRESSED_DATA_INFO CompressedDataInfo
_In_opt_ ULONG _In_ _Post_invalid_ PVOID BaseAddress
Definition: rtlfuncs.h:1343
_In_ PCWSTR _In_z_ PCWSTR _In_ ULONG _In_reads_bytes_opt_(ValueLength) PVOID ValueData
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:406
_Must_inspect_result_ NTSYSAPI PVOID NTAPI RtlLookupElementGenericTable(_In_ PRTL_GENERIC_TABLE Table, _In_ PVOID Buffer)
DWORD WINAPI RtlRunOnceBeginInitialize(RTL_RUN_ONCE *once, ULONG flags, void **context)
Definition: runonce.c:19
NTSYSAPI WCHAR NTAPI RtlDowncaseUnicodeChar(IN WCHAR Source)
Definition: nls.c:131
_In_ ULONG _In_ ULONG StartingAceIndex
Definition: rtlfuncs.h:1851
*UnicodeStringActualByteCount PWSTR _In_ ULONG _Out_ PULONG _In_ ULONG UTF8StringByteCount
Definition: rtlfuncs.h:2663
Status
Definition: gdiplustypes.h:24
_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:1558
NTSYSAPI ULONG WINAPI RtlNtStatusToDosErrorNoTeb(NTSTATUS)
#define _Writable_bytes_(size)
Definition: ms_sal.h:637
int64_t LONGLONG
Definition: typedefs.h:68
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToAnsiString(PANSI_STRING DestinationString, PCUNICODE_STRING SourceString, BOOLEAN AllocateDestinationString)
#define UNALIGNED
Definition: crtdefs.h:144
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
int64_t LONG64
Definition: typedefs.h:68
NTSYSAPI NTSTATUS NTAPI RtlIntegerToUnicodeString(ULONG Value, ULONG Base, PUNICODE_STRING String)
#define _Notnull_
Definition: ms_sal.h:658
root entry for file system trees
Definition: entries.h:148
_In_ ULONG _In_ ULONG AceFlags
Definition: rtlfuncs.h:1114
CONST CHAR * PCCH
Definition: ntbasedef.h:392
int Count
Definition: noreturn.cpp:7
_In_ SIZE_T _In_ SIZE_T String2Length
Definition: rtlfuncs.h:515
NTSYSAPI ULONG NTAPI RtlFindLastBackwardRunClear(_In_ PRTL_BITMAP BitMapHeader, _In_ ULONG FromIndex, _Out_ PULONG StartingRunIndex)
NTSYSAPI BOOLEAN WINAPI RtlTimeToSecondsSince1980(const LARGE_INTEGER *, LPDWORD)
*BytesInOemString PCHAR _In_ ULONG MaxBytesInOemString
Definition: rtlfuncs.h:1560
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
NTSYSAPI VOID NTAPI RtlEndEnumerationHashTable(_In_ PRTL_DYNAMIC_HASH_TABLE HashTable, _Inout_ PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator)
NTSYSAPI VOID NTAPI RtlFillMemoryUlong(_Out_writes_bytes_all_(Length) PVOID Destination, _In_ SIZE_T Length, _In_ ULONG Pattern)
LPTSTR ServiceName
Definition: ServiceMain.c:15
NTSYSAPI NTSTATUS NTAPI RtlCmEncodeMemIoResource(_In_ PCM_PARTIAL_RESOURCE_DESCRIPTOR Descriptor, _In_ UCHAR Type, _In_ ULONGLONG Length, _In_ ULONGLONG Start)
NTSYSAPI BOOLEAN NTAPI RtlInsertEntryHashTable(_In_ PRTL_DYNAMIC_HASH_TABLE HashTable, _In_ __drv_aliasesMem PRTL_DYNAMIC_HASH_TABLE_ENTRY Entry, _In_ ULONG_PTR Signature, _Inout_opt_ PRTL_DYNAMIC_HASH_TABLE_CONTEXT Context)
NTSYSAPI NTSTATUS WINAPI RtlMultiByteToUnicodeN(LPWSTR, DWORD, LPDWORD, LPCSTR, DWORD)
_In_ WDFDMATRANSACTION _In_ size_t MaximumLength
NTSYSAPI NTSTATUS NTAPI RtlAppendUnicodeToString(PUNICODE_STRING Destination, PCWSTR Source)
FORCEINLINE VOID NTAPI RtlInitHashTableContextFromEnumerator(_Inout_ PRTL_DYNAMIC_HASH_TABLE_CONTEXT Context, _In_ PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator)
Definition: rtlfuncs.h:3585
NTSYSAPI PRTL_SPLAY_LINKS NTAPI RtlDelete(_In_ PRTL_SPLAY_LINKS Links)
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
FORCEINLINE VOID InsertTailList(_Inout_ PLIST_ENTRY ListHead, _Inout_ __drv_aliasesMem PLIST_ENTRY Entry)
Definition: rtlfuncs.h:180
NTSTATUS NTAPI RtlCreateSystemVolumeInformationFolder(IN PUNICODE_STRING VolumeRootPath)
Definition: sysvol.c:551
__wchar_t WCHAR
Definition: xmlstorage.h:180
NTSYSAPI ULONG NTAPI RtlFindLongestRunClear(_In_ PRTL_BITMAP BitMapHeader, _Out_ PULONG StartingIndex)
NTSYSAPI PSID_IDENTIFIER_AUTHORITY NTAPI RtlIdentifierAuthoritySid(PSID Sid)
NTSYSAPI NTSTATUS WINAPI RtlDuplicateUnicodeString(int, const UNICODE_STRING *, UNICODE_STRING *)
_Must_inspect_result_ NTSYSAPI PVOID NTAPI RtlEnumerateGenericTableAvl(_In_ PRTL_AVL_TABLE Table, _In_ BOOLEAN Restart)
DWORD LowPart
char CCHAR
Definition: typedefs.h:51
_Must_inspect_result_ _In_ WDFOBJECT _In_ CONST GUID * Guid
Definition: wdfobject.h:760
NTSYSAPI NTSTATUS NTAPI RtlAppendUnicodeStringToString(PUNICODE_STRING Destination, PCUNICODE_STRING Source)
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor
Definition: rtlfuncs.h:1550
FORCEINLINE LUID NTAPI_INLINE RtlConvertUlongToLuid(_In_ ULONG Val)
Definition: rtlfuncs.h:3541
uint64_t ULONGLONG
Definition: typedefs.h:67
_In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitNumber)
FORCEINLINE ULONG NTAPI RtlEmptyBucketsHashTable(_In_ PRTL_DYNAMIC_HASH_TABLE HashTable)
Definition: rtlfuncs.h:3624
#define NTAPI_INLINE
Definition: umtypes.h:68
_Must_inspect_result_ NTSYSAPI PVOID NTAPI RtlGetElementGenericTable(_In_ PRTL_GENERIC_TABLE Table, _In_ ULONG I)
NTSYSAPI DWORD WINAPI RtlRunOnceComplete(PRTL_RUN_ONCE, DWORD, PVOID)
NTSYSAPI VOID NTAPI RtlEndWeakEnumerationHashTable(_In_ PRTL_DYNAMIC_HASH_TABLE HashTable, _Inout_ PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator)
NTSYSAPI ULONG NTAPI RtlNumberGenericTableElementsAvl(_In_ PRTL_AVL_TABLE Table)
#define FAST_FAIL_CORRUPT_LIST_ENTRY
_In_ GUID _In_ PVOID ValueData
Definition: hubbusif.h:311
RTL_RUN_ONCE_INIT_FN * PRTL_RUN_ONCE_INIT_FN
Definition: winnt_old.h:2661
NTSYSAPI VOID NTAPI RtlFreeAnsiString(PANSI_STRING AnsiString)
*UTF8StringActualByteCount PCHAR _In_ ULONG _Out_ PULONG _In_ ULONG UnicodeStringByteCount
Definition: rtlfuncs.h:2650
Type
Definition: Type.h:6
VOID NTAPI RtlClearBit(_In_ PRTL_BITMAP BitMapHeader, _In_ BITMAP_INDEX BitNumber)
Definition: bitmap.c:294
HRESULT Next([in] ULONG celt, [out, size_is(celt), length_is(*pceltFetched)] STATPROPSETSTG *rgelt, [out] ULONG *pceltFetched)
_In_ PSTRING FullName
Definition: rtlfuncs.h:1648
_Notnull_ __drv_aliasesMem PWSTR _In_ USHORT BufferSize
Definition: rtlfuncs.h:2978
*BytesInUnicodeString PWCH _In_ ULONG _Out_opt_ PULONG BytesInUnicodeString
Definition: rtlfuncs.h:1992
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
Definition: rtlfuncs.h:2950
*UnicodeStringActualByteCount PWSTR _In_ ULONG _Out_ PULONG UnicodeStringActualByteCount
Definition: rtlfuncs.h:2659
PUNICODE_PREFIX_TABLE_ENTRY NTAPI RtlFindUnicodePrefix(PUNICODE_PREFIX_TABLE PrefixTable, PUNICODE_STRING FullName, ULONG CaseInsensitiveIndex)
IN PVOID IN PVOID IN USHORT Version
Definition: pci.h:361
#define PSLIST_ENTRY
Definition: rtltypes.h:134
_Must_inspect_result_ NTSYSAPI BOOLEAN NTAPI RtlTestBit(_In_ PRTL_BITMAP BitMapHeader, _In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitNumber)
Definition: bitmap.c:434
*UTF8StringActualByteCount PCHAR UTF8StringDestination
Definition: rtlfuncs.h:2646
#define _Pre_
Definition: ms_sal.h:619
#define RTL_HASH_ALLOCATED_HEADER
Definition: rtltypes.h:507
RTL_AVL_MATCH_FUNCTION * PRTL_AVL_MATCH_FUNCTION
Definition: rtltypes.h:411
Definition: partlist.h:33
CONST STRING * PCOEM_STRING
Definition: umtypes.h:205
NTSYSAPI NTSTATUS NTAPI RtlConvertSidToUnicodeString(OUT PUNICODE_STRING DestinationString, IN PVOID Sid, IN BOOLEAN AllocateDestinationString)
NTSYSAPI NTSTATUS NTAPI RtlUpcaseUnicodeToOemN(PCHAR OemString, ULONG OemSize, PULONG ResultSize, PCWCH UnicodeString, ULONG UnicodeSize)
#define _Ret_maybenull_
Definition: ms_sal.h:529
NTSYSAPI NTSTATUS NTAPI RtlAddAce(_Inout_ PACL Acl, _In_ ULONG AceRevision, _In_ ULONG StartingAceIndex, _In_reads_bytes_(AceListLength) PVOID AceList, _In_ ULONG AceListLength)
CHAR Message[80]
Definition: alive.c:5
std::wstring STRING
Definition: fontsub.cpp:33
WCHAR * PWCH
Definition: ntbasedef.h:410
_IRQL_requires_same_ _In_ PVOID _Inout_ struct _CONTEXT * ContextRecord
Definition: ntbasedef.h:654
_Out_writes_bytes_to_opt_ BufferLength PSECURITY_DESCRIPTOR SelfRelativeSecurityDescriptor
Definition: rtlfuncs.h:1093
unsigned __int64 ULONG64
Definition: imports.h:198
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
Definition: wdfregistry.h:240
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL Dacl
Definition: rtlfuncs.h:1552
FORCEINLINE BOOLEAN RemoveEntryListUnsafe(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:65
unsigned char UCHAR
Definition: xmlstorage.h:181
struct _SINGLE_LIST_ENTRY * Next
Definition: ntbasedef.h:629
char * PBOOLEAN
Definition: retypes.h:11
NTSYSAPI NTSTATUS NTAPI RtlUnicodeToMultiByteN(PCHAR MbString, ULONG MbSize, PULONG ResultSize, PCWCH UnicodeString, ULONG UnicodeSize)
NTSYSAPI NTSTATUS NTAPI RtlCreateVirtualAccountSid(_In_ PCUNICODE_STRING Name, _In_ ULONG BaseSubAuthority, _Out_writes_bytes_(*SidLength) PSID Sid, _Inout_ PULONG SidLength)
_In_ BOOLEAN Restart
Definition: rtlfuncs.h:1691
_Out_ _Inout_ POEM_STRING _In_ PCUNICODE_STRING SourceString
Definition: rtlfuncs.h:1868
NTSYSAPI NTSTATUS WINAPI RtlAddAccessAllowedAceEx(PACL, DWORD, DWORD, DWORD, PSID)
LONG HighPart
NTSYSAPI NTSTATUS NTAPI RtlIdnToUnicode(IN ULONG Flags, IN PCWSTR SourceString, IN LONG SourceStringLength, OUT PWSTR DestinationString, IN OUT PLONG DestinationStringLength)
NTSYSAPI NTSTATUS WINAPI RtlGUIDFromString(PUNICODE_STRING, GUID *)
NTSYSAPI NTSTATUS WINAPI RtlDeleteRegistryValue(ULONG, PCWSTR, PCWSTR)
#define _Inout_opt_
Definition: ms_sal.h:379
_In_ UCHAR _In_ UCHAR _In_ ULONG Code
Definition: wdfdevice.h:1697
_In_ ULONG _In_ ULONG AclRevision
Definition: rtlfuncs.h:1842
NTSTATUS NTAPI RtlDecompressFragment(IN USHORT format, OUT PUCHAR uncompressed, IN ULONG uncompressed_size, IN PUCHAR compressed, IN ULONG compressed_size, IN ULONG offset, OUT PULONG final_size, IN PVOID workspace)
Definition: compress.c:342
#define InterlockedPushEntrySList(SListHead, SListEntry)
Definition: rtlfuncs.h:3389
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToOemString(POEM_STRING DestinationString, PCUNICODE_STRING SourceString, BOOLEAN AllocateDestinationString)
#define I(s)
NTSYSAPI NTSTATUS NTAPI RtlIdnToNameprepUnicode(_In_ ULONG Flags, _In_ PCWSTR SourceString, _In_ LONG SourceStringLength, _Out_writes_to_(*DestinationStringLength, *DestinationStringLength) PWSTR DestinationString, _Inout_ PLONG DestinationStringLength)
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
NTSYSAPI PVOID NTAPI RtlCreateHeap(IN ULONG Flags, IN PVOID HeapBase OPTIONAL, IN ULONG ReserveSize OPTIONAL, IN ULONG CommitSize OPTIONAL, IN PVOID Lock OPTIONAL, IN PRTL_HEAP_PARAMETERS Parameters OPTIONAL)
VOID NTAPI RtlInitCodePageTable(IN PUSHORT TableBase, OUT PCPTABLEINFO CodePageTable)
Definition: nls.c:155
FORCEINLINE VOID AppendTailList(_Inout_ PLIST_ENTRY ListHead, _Inout_ PLIST_ENTRY ListToAppend)
Definition: rtlfuncs.h:222
BOOLEAN NTAPI RtlInsertUnicodePrefix(PUNICODE_PREFIX_TABLE PrefixTable, PUNICODE_STRING Prefix, PUNICODE_PREFIX_TABLE_ENTRY PrefixTableEntry)
Definition: typedefs.h:119
NTSYSAPI BOOLEAN WINAPI RtlCopySid(DWORD, PSID, PSID)
NTSYSAPI BOOLEAN NTAPI RtlRemoveEntryHashTable(_In_ PRTL_DYNAMIC_HASH_TABLE HashTable, _In_ PRTL_DYNAMIC_HASH_TABLE_ENTRY Entry, _Inout_opt_ PRTL_DYNAMIC_HASH_TABLE_CONTEXT Context)
FORCEINLINE ULONG NTAPI RtlTotalBucketsHashTable(_In_ PRTL_DYNAMIC_HASH_TABLE HashTable)
Definition: rtlfuncs.h:3606
NTSYSAPI ULONG NTAPI RtlFindClearRuns(_In_ PRTL_BITMAP BitMapHeader, _Out_writes_to_(SizeOfRunArray, return) PRTL_BITMAP_RUN RunArray, _In_range_(>, 0) ULONG SizeOfRunArray, _In_ BOOLEAN LocateLongestRuns)
_In_ BOOLEAN _Inout_ PGENERATE_NAME_CONTEXT _Inout_ PUNICODE_STRING Name8dot3
Definition: rtlfuncs.h:1584
_In_ PSID_IDENTIFIER_AUTHORITY _In_ UCHAR SubAuthorityCount
Definition: rtlfuncs.h:1486
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
_In_ ULONG StartingIndex
Definition: rtlfuncs.h:395
_In_ ULONG UncompressedFragmentSize
Definition: rtlfuncs.h:2261
_In_ ULONG AceIndex
Definition: rtlfuncs.h:1862
#define _Out_writes_bytes_to_opt_(size, count)
Definition: ms_sal.h:361
RTL_AVL_FREE_ROUTINE * PRTL_AVL_FREE_ROUTINE
Definition: rtltypes.h:402
#define _Must_inspect_result_
Definition: ms_sal.h:558
#define _Post_invalid_
Definition: ms_sal.h:695
Definition: rtltypes.h:607
#define _Pre_maybenull_
Definition: ms_sal.h:681
_In_ ULONG _In_ ULONG _In_ ULONG AceListLength
Definition: rtlfuncs.h:1854
NTSYSAPI NTSTATUS NTAPI RtlOemStringToUnicodeString(PUNICODE_STRING DestinationString, PCOEM_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI ULONG NTAPI RtlxAnsiStringToUnicodeSize(PCANSI_STRING AnsiString)
NTSYSAPI BOOLEAN NTAPI RtlInitEnumerationHashTable(_In_ PRTL_DYNAMIC_HASH_TABLE HashTable, _Out_ PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator)
_In_opt_ PVOID HeapBase
Definition: rtlfuncs.h:2167
NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeStringToCountedOemString(STRING *, const UNICODE_STRING *, BOOLEAN)
NTSYSAPI NTSTATUS NTAPI RtlUpcaseUnicodeToMultiByteN(PCHAR MbString, ULONG MbSize, PULONG ResultSize, PCWCH UnicodeString, ULONG UnicodeSize)
NTSYSAPI NTSTATUS NTAPI RtlIsNormalizedString(_In_ ULONG NormForm, _In_ PCWSTR SourceString, _In_ LONG SourceStringLength, _Out_ PBOOLEAN Normalized)
*BytesInUnicodeString PWCH _In_ ULONG _Out_opt_ PULONG _In_ ULONG BytesInOemString
Definition: rtlfuncs.h:1997
_In_ ULONG _In_ ACCESS_MASK AccessMask
Definition: rtlfuncs.h:1103
_In_ SIZE_T _In_reads_(String2Length) PCWCH String2
NTSYSAPI VOID NTAPI RtlInitString(PSTRING DestinationString, PCSZ SourceString)
NTSYSAPI ULONG NTAPI RtlRandomEx(PULONG Seed)
_Post_satisfies_(return >=8 &&return<=SECURITY_MAX_SID_SIZE) NTSYSAPI ULONG NTAPI RtlLengthSid(_In_ PSID Sid)
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
ULONG_PTR SIZE_T
Definition: typedefs.h:80
NTSYSAPI NTSTATUS WINAPI RtlDecompressBuffer(USHORT, PUCHAR, ULONG, PUCHAR, ULONG, PULONG)
NTSYSAPI BOOLEAN NTAPI RtlEqualPrefixSid(PSID Sid1, PSID Sid2)
NTSYSAPI BOOLEAN NTAPI RtlDeleteElementGenericTable(_In_ PRTL_GENERIC_TABLE Table, _In_ PVOID Buffer)
NTSTATUS NTAPI RtlUnicodeToCustomCPN(IN PCPTABLEINFO CustomCP, OUT PCHAR CustomString, IN ULONG CustomSize, OUT PULONG ResultSize OPTIONAL, IN PWCHAR UnicodeString, IN ULONG UnicodeSize)
Definition: nls.c:480
#define _Outptr_opt_result_maybenull_
Definition: ms_sal.h:430
NTSYSAPI BOOLEAN NTAPI RtlIsGenericTableEmpty(_In_ PRTL_GENERIC_TABLE Table)
_Must_inspect_result_ NTSYSAPI SIZE_T NTAPI RtlCompareMemory(_In_ const VOID *Source1, _In_ const VOID *Source2, _In_ SIZE_T Length)
NTSYSAPI NTSTATUS NTAPI RtlGetSaclSecurityDescriptor(_In_ PSECURITY_DESCRIPTOR SecurityDescriptor, _Out_ PBOOLEAN SaclPresent, _Out_ PACL *Sacl, _Out_ PBOOLEAN SaclDefaulted)
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:1216
_Out_range_(>, 0)) _When_(Status >=0
NTSYSAPI PVOID NTAPI RtlDestroyHeap(_In_ _Post_invalid_ PVOID HeapHandle)
unsigned short USHORT
Definition: pedump.c:61
NTSYSAPI ULONG NTAPI RtlxUnicodeStringToOemSize(IN PCUNICODE_STRING UnicodeString)
Definition: unicode.c:1091
*UTF8StringActualByteCount PCHAR _In_ ULONG UTF8StringMaxByteCount
Definition: rtlfuncs.h:2646
_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)
_Must_inspect_result_ NTSYSAPI BOOLEAN NTAPI RtlIsGenericTableEmptyAvl(_In_ PRTL_AVL_TABLE Table)
VOID NTAPI PfxInitialize(IN PPREFIX_TABLE PrefixTable)
Definition: