ReactOS  r74406
rtlfuncs.h
Go to the documentation of this file.
1 /*++ NDK Version: 0098
2 
3 Copyright (c) Alex Ionescu. All rights reserved.
4 
5 Header Name:
6 
7  rtlfuncs.h
8 
9 Abstract:
10 
11  Function definitions for the Run-Time Library
12 
13 Author:
14 
15  Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
16 
17 --*/
18 
19 #ifndef _RTLFUNCS_H
20 #define _RTLFUNCS_H
21 
22 //
23 // Dependencies
24 //
25 #include <umtypes.h>
26 #include <ntnls.h>
27 #include <rtltypes.h>
28 #include <pstypes.h>
29 #include <extypes.h>
30 #include "in6addr.h"
31 #include "inaddr.h"
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 #ifdef NTOS_MODE_USER
38 
39 //
40 // List Functions
41 //
43 VOID
45  _Out_ PLIST_ENTRY ListHead
46 )
47 {
48  ListHead->Flink = ListHead->Blink = ListHead;
49 }
50 
52 VOID
54  _Inout_ PLIST_ENTRY ListHead,
56 )
57 {
58  PLIST_ENTRY OldFlink;
59  OldFlink = ListHead->Flink;
60  Entry->Flink = OldFlink;
61  Entry->Blink = ListHead;
62  OldFlink->Blink = Entry;
63  ListHead->Flink = Entry;
64 }
65 
67 VOID
69  _Inout_ PLIST_ENTRY ListHead,
71 )
72 {
73  PLIST_ENTRY OldBlink;
74  OldBlink = ListHead->Blink;
75  Entry->Flink = ListHead;
76  Entry->Blink = OldBlink;
77  OldBlink->Flink = Entry;
78  ListHead->Blink = Entry;
79 }
80 
83 BOOLEAN
85  _In_ const LIST_ENTRY * ListHead
86 )
87 {
88  return (BOOLEAN)(ListHead->Flink == ListHead);
89 }
90 
95 )
96 {
97  PSINGLE_LIST_ENTRY FirstEntry;
98  FirstEntry = ListHead->Next;
99  if (FirstEntry != NULL) {
100  ListHead->Next = FirstEntry->Next;
101  }
102 
103  return FirstEntry;
104 }
105 
107 VOID
109  _Inout_ PSINGLE_LIST_ENTRY ListHead,
111 )
112 {
113  Entry->Next = ListHead->Next;
114  ListHead->Next = Entry;
115 }
116 
118 BOOLEAN
121 {
122  PLIST_ENTRY OldFlink;
123  PLIST_ENTRY OldBlink;
124 
125  OldFlink = Entry->Flink;
126  OldBlink = Entry->Blink;
127  OldFlink->Blink = OldBlink;
128  OldBlink->Flink = OldFlink;
129  return (BOOLEAN)(OldFlink == OldBlink);
130 }
131 
135  _Inout_ PLIST_ENTRY ListHead)
136 {
137  PLIST_ENTRY Flink;
139 
140  Entry = ListHead->Flink;
141  Flink = Entry->Flink;
142  ListHead->Flink = Flink;
143  Flink->Blink = ListHead;
144  return Entry;
145 }
146 
150  _Inout_ PLIST_ENTRY ListHead)
151 {
152  PLIST_ENTRY Blink;
154 
155  Entry = ListHead->Blink;
156  Blink = Entry->Blink;
157  ListHead->Blink = Blink;
158  Blink->Flink = ListHead;
159  return Entry;
160 }
161 
162 //
163 // Unicode string macros
164 //
169 VOID
170 RtlInitEmptyUnicodeString(
173  _In_ USHORT BufferSize)
174 {
175  UnicodeString->Length = 0;
176  UnicodeString->MaximumLength = BufferSize;
177  UnicodeString->Buffer = Buffer;
178 }
179 
184 VOID
185 RtlInitEmptyAnsiString(
188  _In_ USHORT BufferSize)
189 {
190  AnsiString->Length = 0;
191  AnsiString->MaximumLength = BufferSize;
192  AnsiString->Buffer = Buffer;
193 }
194 
195 //
196 // LUID Macros
197 //
198 #define RtlEqualLuid(L1, L2) (((L1)->HighPart == (L2)->HighPart) && \
199  ((L1)->LowPart == (L2)->LowPart))
201 LUID
204  _In_ ULONG Ulong)
205 {
206  LUID TempLuid;
207 
208  TempLuid.LowPart = Ulong;
209  TempLuid.HighPart = 0;
210  return TempLuid;
211 }
212 
213 //
214 // ASSERT Macros
215 //
216 #ifndef ASSERT
217 #if DBG
218 
219 #define ASSERT( exp ) \
220  ((void)((!(exp)) ? \
221  (RtlAssert( (PVOID)#exp, (PVOID)__FILE__, __LINE__, NULL ),FALSE) : \
222  TRUE))
223 
224 #define ASSERTMSG( msg, exp ) \
225  ((void)((!(exp)) ? \
226  (RtlAssert( (PVOID)#exp, (PVOID)__FILE__, __LINE__, (PCHAR)msg ),FALSE) : \
227  TRUE))
228 
229 #else
230 
231 #define ASSERT( exp ) ((void) 0)
232 #define ASSERTMSG( msg, exp ) ((void) 0)
233 
234 #endif
235 #endif
236 
237 #ifdef NTOS_KERNEL_RUNTIME
238 
239 //
240 // Executing RTL functions at DISPATCH_LEVEL or higher will result in a
241 // bugcheck.
242 //
243 #define RTL_PAGED_CODE PAGED_CODE
244 
245 #else
246 
247 //
248 // This macro does nothing in user mode
249 //
250 #define RTL_PAGED_CODE NOP_FUNCTION
251 
252 #endif
253 
254 //
255 // RTL Splay Tree Functions
256 //
257 #ifndef RTL_USE_AVL_TABLES
258 
259 NTSYSAPI
260 VOID
261 NTAPI
268 );
269 
270 NTSYSAPI
271 PVOID
272 NTAPI
277  _Out_opt_ PBOOLEAN NewElement
278 );
279 
280 NTSYSAPI
281 PVOID
282 NTAPI
284  _In_ PRTL_GENERIC_TABLE Table,
287  _Out_opt_ PBOOLEAN NewElement,
288  _In_ PVOID NodeOrParent,
289  _In_ TABLE_SEARCH_RESULT SearchResult
290 );
291 
292 NTSYSAPI
293 BOOLEAN
294 NTAPI
296  _In_ PRTL_GENERIC_TABLE Table,
298 );
299 
301 NTSYSAPI
302 PVOID
303 NTAPI
305  _In_ PRTL_GENERIC_TABLE Table,
307 );
308 
309 NTSYSAPI
310 PVOID
311 NTAPI
313  _In_ PRTL_GENERIC_TABLE Table,
314  _In_ PVOID Buffer,
315  _Out_ PVOID *NodeOrParent,
316  _Out_ TABLE_SEARCH_RESULT *SearchResult
317 );
318 
320 NTSYSAPI
321 PVOID
322 NTAPI
324  _In_ PRTL_GENERIC_TABLE Table,
326 );
327 
329 NTSYSAPI
330 PVOID
331 NTAPI
333  _In_ PRTL_GENERIC_TABLE Table,
334  _Inout_ PVOID *RestartKey
335 );
336 
338 NTSYSAPI
339 PVOID
340 NTAPI
342  _In_ PRTL_GENERIC_TABLE Table,
343  _In_ ULONG I
344 );
345 
346 NTSYSAPI
347 ULONG
348 NTAPI
351 );
352 
354 NTSYSAPI
355 BOOLEAN
356 NTAPI
359 );
360 
361 #endif /* !RTL_USE_AVL_TABLES */
362 
363 NTSYSAPI
365 NTAPI
366 RtlSplay(
368 );
369 
370 NTSYSAPI
372 NTAPI
373 RtlDelete(
374  _In_ PRTL_SPLAY_LINKS Links
375 );
376 
377 NTSYSAPI
378 VOID
379 NTAPI
381  _In_ PRTL_SPLAY_LINKS Links,
383 );
384 
386 NTSYSAPI
388 NTAPI
390  _In_ PRTL_SPLAY_LINKS Links
391 );
392 
394 NTSYSAPI
396 NTAPI
398  _In_ PRTL_SPLAY_LINKS Links
399 );
400 
402 NTSYSAPI
404 NTAPI
406  _In_ PRTL_SPLAY_LINKS Links
407 );
408 
410 NTSYSAPI
412 NTAPI
414  _In_ PRTL_SPLAY_LINKS Links
415 );
416 
417 #define RtlIsLeftChild(Links) \
418  (RtlLeftChild(RtlParent(Links)) == (PRTL_SPLAY_LINKS)(Links))
419 
420 #define RtlIsRightChild(Links) \
421  (RtlRightChild(RtlParent(Links)) == (PRTL_SPLAY_LINKS)(Links))
422 
423 #define RtlRightChild(Links) \
424  ((PRTL_SPLAY_LINKS)(Links))->RightChild
425 
426 #define RtlIsRoot(Links) \
427  (RtlParent(Links) == (PRTL_SPLAY_LINKS)(Links))
428 
429 #define RtlLeftChild(Links) \
430  ((PRTL_SPLAY_LINKS)(Links))->LeftChild
431 
432 #define RtlParent(Links) \
433  ((PRTL_SPLAY_LINKS)(Links))->Parent
434 
435 // FIXME: use inline function
436 
437 #define RtlInitializeSplayLinks(Links) \
438  { \
439  PRTL_SPLAY_LINKS _SplayLinks; \
440  _SplayLinks = (PRTL_SPLAY_LINKS)(Links); \
441  _SplayLinks->Parent = _SplayLinks; \
442  _SplayLinks->LeftChild = NULL; \
443  _SplayLinks->RightChild = NULL; \
444  }
445 
446 #define RtlInsertAsLeftChild(ParentLinks,ChildLinks) \
447  { \
448  PRTL_SPLAY_LINKS _SplayParent; \
449  PRTL_SPLAY_LINKS _SplayChild; \
450  _SplayParent = (PRTL_SPLAY_LINKS)(ParentLinks); \
451  _SplayChild = (PRTL_SPLAY_LINKS)(ChildLinks); \
452  _SplayParent->LeftChild = _SplayChild; \
453  _SplayChild->Parent = _SplayParent; \
454  }
455 
456 #define RtlInsertAsRightChild(ParentLinks,ChildLinks) \
457  { \
458  PRTL_SPLAY_LINKS _SplayParent; \
459  PRTL_SPLAY_LINKS _SplayChild; \
460  _SplayParent = (PRTL_SPLAY_LINKS)(ParentLinks); \
461  _SplayChild = (PRTL_SPLAY_LINKS)(ChildLinks); \
462  _SplayParent->RightChild = _SplayChild; \
463  _SplayChild->Parent = _SplayParent; \
464  }
465 
466 //
467 // RTL AVL Tree Functions
468 //
469 NTSYSAPI
470 VOID
471 NTAPI
473  _Out_ PRTL_AVL_TABLE Table,
478 );
479 
480 NTSYSAPI
481 PVOID
482 NTAPI
484  _In_ PRTL_AVL_TABLE Table,
487  _Out_opt_ PBOOLEAN NewElement
488 );
489 
490 NTSYSAPI
491 PVOID
492 NTAPI
494  _In_ PRTL_AVL_TABLE Table,
497  _Out_opt_ PBOOLEAN NewElement,
498  _In_ PVOID NodeOrParent,
499  _In_ TABLE_SEARCH_RESULT SearchResult
500 );
501 
502 NTSYSAPI
503 BOOLEAN
504 NTAPI
506  _In_ PRTL_AVL_TABLE Table,
508 );
509 
511 NTSYSAPI
512 PVOID
513 NTAPI
515  _In_ PRTL_AVL_TABLE Table,
517 );
518 
519 NTSYSAPI
520 PVOID
521 NTAPI
523  _In_ PRTL_AVL_TABLE Table,
524  _In_ PVOID Buffer,
525  _Out_ PVOID *NodeOrParent,
526  _Out_ TABLE_SEARCH_RESULT *SearchResult
527 );
528 
530 NTSYSAPI
531 PVOID
532 NTAPI
534  _In_ PRTL_AVL_TABLE Table,
536 );
537 
539 NTSYSAPI
540 PVOID
541 NTAPI
543  _In_ PRTL_AVL_TABLE Table,
544  _Inout_ PVOID *RestartKey
545 );
546 
548 NTSYSAPI
549 PVOID
550 NTAPI
552  _In_ PRTL_AVL_TABLE Table,
553  _In_ PVOID Buffer,
554  _Out_ PVOID *RestartKey
555 );
556 
558 NTSYSAPI
559 PVOID
560 NTAPI
562  _In_ PRTL_AVL_TABLE Table,
563  _In_opt_ PRTL_AVL_MATCH_FUNCTION MatchFunction,
565  _In_ ULONG NextFlag,
566  _Inout_ PVOID *RestartKey,
567  _Inout_ PULONG DeleteCount,
569 );
570 
572 NTSYSAPI
573 PVOID
574 NTAPI
576  _In_ PRTL_AVL_TABLE Table,
577  _In_ ULONG I
578 );
579 
580 NTSYSAPI
581 ULONG
582 NTAPI
584  _In_ PRTL_AVL_TABLE Table
585 );
586 
588 NTSYSAPI
589 BOOLEAN
590 NTAPI
592  _In_ PRTL_AVL_TABLE Table
593 );
594 
595 #ifdef RTL_USE_AVL_TABLES
596 
597 #define RtlInitializeGenericTable RtlInitializeGenericTableAvl
598 #define RtlInsertElementGenericTable RtlInsertElementGenericTableAvl
599 #define RtlInsertElementGenericTableFull RtlInsertElementGenericTableFullAvl
600 #define RtlDeleteElementGenericTable RtlDeleteElementGenericTableAvl
601 #define RtlLookupElementGenericTable RtlLookupElementGenericTableAvl
602 #define RtlLookupElementGenericTableFull RtlLookupElementGenericTableFullAvl
603 #define RtlEnumerateGenericTable RtlEnumerateGenericTableAvl
604 #define RtlEnumerateGenericTableWithoutSplaying RtlEnumerateGenericTableWithoutSplayingAvl
605 #define RtlGetElementGenericTable RtlGetElementGenericTableAvl
606 #define RtlNumberGenericTableElements RtlNumberGenericTableElementsAvl
607 #define RtlIsGenericTableEmpty RtlIsGenericTableEmptyAvl
608 
609 #endif /* RTL_USE_AVL_TABLES */
610 
611 //
612 // Exception and Error Functions
613 //
614 NTSYSAPI
615 PVOID
616 NTAPI
618  _In_ ULONG FirstHandler,
619  _In_ PVECTORED_EXCEPTION_HANDLER VectoredHandler
620 );
621 
622 NTSYSAPI
623 ULONG
624 NTAPI
626  _In_ PVOID VectoredHandlerHandle
627 );
628 
629 NTSYSAPI
630 PVOID
631 NTAPI
633  _In_ ULONG FirstHandler,
634  _In_ PVECTORED_EXCEPTION_HANDLER VectoredHandler
635 );
636 
637 NTSYSAPI
638 ULONG
639 NTAPI
641  _In_ PVOID VectoredHandlerHandle
642 );
643 
644 NTSYSAPI
645 VOID
646 NTAPI
648  _In_ PRTLP_UNHANDLED_EXCEPTION_FILTER TopLevelExceptionFilter
649 );
650 
651 NTSYSAPI
652 LONG
653 NTAPI
655  _In_ struct _EXCEPTION_POINTERS* ExceptionInfo
656 );
657 
659 NTSYSAPI
660 VOID
661 NTAPI
662 RtlAssert(
663  _In_ PVOID FailedAssertion,
667 );
668 
669 NTSYSAPI
670 PVOID
671 NTAPI
673  _In_ PVOID Pointer
674 );
675 
676 NTSYSAPI
677 PVOID
678 NTAPI
680  _In_ PVOID Pointer
681 );
682 
683 NTSYSAPI
684 PVOID
685 NTAPI
687  _In_ PVOID Pointer
688 );
689 
690 NTSYSAPI
691 PVOID
692 NTAPI
694  _In_ PVOID Pointer
695 );
696 
697 NTSYSAPI
698 NTSTATUS
699 NTAPI
701  VOID
702 );
703 
704 NTSYSAPI
705 ULONG
706 NTAPI
708  VOID
709 );
710 
711 NTSYSAPI
712 VOID
713 NTAPI
715  _In_ ULONG LastError
716 );
717 
718 NTSYSAPI
719 VOID
720 NTAPI
723 );
724 
725 NTSYSAPI
726 NTSTATUS
727 NTAPI
729  _In_ ULONG NewMode,
730  _Out_opt_ PULONG OldMode
731 );
732 
733 NTSYSAPI
734 ULONG
735 NTAPI
737  VOID
738 );
739 
740 #endif /* NTOS_MODE_USER */
741 
742 NTSYSAPI
743 VOID
744 NTAPI
747 );
748 
749 NTSYSAPI
750 BOOLEAN
751 NTAPI
753  _In_ PEXCEPTION_RECORD ExceptionRecord,
755 );
756 
758 _When_(Status < 0, _Out_range_(>, 0))
759 _When_(Status >= 0, _Out_range_(==, 0))
760 NTSYSAPI
761 ULONG
762 NTAPI
764  _In_ NTSTATUS Status
765 );
766 
767 _When_(Status < 0, _Out_range_(>, 0))
768 _When_(Status >= 0, _Out_range_(==, 0))
769 NTSYSAPI
770 ULONG
771 NTAPI
773  _In_ NTSTATUS Status
774 );
775 
776 NTSYSAPI
777 NTSTATUS
778 NTAPI
780  _In_ ULONG SecurityError
781 );
782 
783 NTSYSAPI
784 VOID
785 NTAPI
787  _In_ PEXCEPTION_RECORD ExceptionRecord
788 );
789 
791 NTSYSAPI
792 VOID
793 NTAPI
795  _In_ NTSTATUS Status
796 );
797 
798 NTSYSAPI
799 VOID
800 NTAPI
801 RtlUnwind(
802  _In_opt_ PVOID TargetFrame,
803  _In_opt_ PVOID TargetIp,
804  _In_opt_ PEXCEPTION_RECORD ExceptionRecord,
806 );
807 
808 #define RTL_STACK_WALKING_MODE_FRAMES_TO_SKIP_SHIFT 8
809 
810 //
811 // Tracing Functions
812 //
813 NTSYSAPI
814 ULONG
815 NTAPI
818  _In_ ULONG Count,
820 );
821 
822 NTSYSAPI
823 USHORT
824 NTAPI
826  VOID
827 );
828 
829 #ifdef NTOS_MODE_USER
830 //
831 // Heap Functions
832 //
836 NTSYSAPI
837 PVOID
838 NTAPI
840  _In_ PVOID HeapHandle,
843 );
844 
846 NTSYSAPI
847 PVOID
848 NTAPI
850  _In_ ULONG Flags,
852  _In_opt_ SIZE_T SizeToReserve,
853  _In_opt_ SIZE_T SizeToCommit,
856 );
857 
858 NTSYSAPI
859 ULONG
860 NTAPI
862  _In_ HANDLE HeapHandle,
863  _In_ ULONG Flags,
864  _In_ PWSTR TagName,
865  _In_ PWSTR TagSubName
866 );
867 
868 ULONG
869 NTAPI
871  _In_ HANDLE Heap,
872  _In_ ULONG Flags
873 );
874 
876 NTSYSAPI
877 PVOID
878 NTAPI
880  _In_ ULONG Flags,
881  _In_opt_ PVOID BaseAddress,
882  _In_opt_ SIZE_T SizeToReserve,
883  _In_opt_ SIZE_T SizeToCommit,
884  _In_opt_ PVOID Lock,
885  _In_opt_ PRTL_HEAP_PARAMETERS Parameters
886 );
887 
888 NTSYSAPI
889 HANDLE
890 NTAPI
893 );
894 
895 NTSYSAPI
896 ULONG
897 NTAPI
899  _In_ HANDLE Heap,
900  _In_ ULONG Flags,
901  _In_ PVOID P,
902  _In_ SIZE_T Size
903 );
904 
905 _Success_(return != 0)
906 NTSYSAPI
907 BOOLEAN
908 NTAPI
910  _In_ HANDLE HeapHandle,
911  _In_opt_ ULONG Flags,
913 );
914 
915 ULONG
916 NTAPI
918  _In_ ULONG HeapCount,
919  _Out_cap_(HeapCount) HANDLE *HeapArray
920 );
921 
922 _Success_(return != 0)
923 BOOLEAN
924 NTAPI
926  _In_ PVOID HeapHandle,
927  _In_ ULONG Flags,
928  _In_ PVOID BaseAddress,
929  _Inout_opt_ PVOID *UserValue,
930  _Out_opt_ PULONG UserFlags
931 );
932 
933 NTSYSAPI
934 PVOID
935 NTAPI
937  _In_ PVOID HeapHandle,
939 );
940 
941 NTSYSAPI
942 NTSTATUS
943 NTAPI
945  _In_ PVOID HeapHandle,
946  _In_ HEAP_INFORMATION_CLASS HeapInformationClass,
947  _Out_ PVOID HeapInformation,
948  _In_ SIZE_T HeapInformationLength,
951 );
952 
954 NTSYSAPI
955 PWSTR
956 NTAPI
958  _In_ PVOID HeapHandle,
959  _In_ ULONG Flags,
960  _In_ USHORT TagIndex,
961  _In_ BOOLEAN ResetCounters,
962  _Out_ PRTL_HEAP_TAG_INFO HeapTagInfo
963 );
964 
968 NTSYSAPI
969 PVOID
970 NTAPI
972  _In_ HANDLE Heap,
973  _In_opt_ ULONG Flags,
975  _In_ SIZE_T Size
976 );
977 
978 NTSYSAPI
979 NTSTATUS
980 NTAPI
982  _In_ PVOID HeapHandle,
983  _In_ HEAP_INFORMATION_CLASS HeapInformationClass,
984  _When_(HeapInformationClass==HeapCompatibilityInformation,_In_) PVOID HeapInformation,
985  _In_ SIZE_T HeapInformationLength
986 );
987 
988 NTSYSAPI
989 BOOLEAN
990 NTAPI
992  _In_ HANDLE Heap
993 );
994 
996 NTSYSAPI
997 NTSTATUS
998 NTAPI
1000  _In_ HANDLE HeapHandle,
1001  _In_ ULONG Flags,
1002  _In_ SIZE_T Size,
1003  _In_ ULONG Count,
1004  _Out_cap_(Count) _Deref_post_bytecap_(Size) PVOID * Array
1005  );
1006 
1007 NTSYSAPI
1008 NTSTATUS
1009 NTAPI
1011  _In_ HANDLE HeapHandle,
1012  _In_ ULONG Flags,
1013  _In_ ULONG Count,
1014  _In_count_(Count) /* _Deref_ _Post_invalid_ */ PVOID * Array
1015  );
1016 
1017 NTSYSAPI
1018 NTSTATUS
1019 NTAPI
1020 RtlUsageHeap(
1021  _In_ HANDLE Heap,
1022  _In_ ULONG Flags,
1024 );
1025 
1026 NTSYSAPI
1027 BOOLEAN
1028 NTAPI
1030  _In_ HANDLE Heap
1031 );
1032 
1033 BOOLEAN
1034 NTAPI
1036  _In_ PVOID HeapHandle,
1037  _In_ ULONG Flags,
1038  _In_ PVOID BaseAddress,
1039  _In_ PVOID UserValue
1040 );
1041 
1042 BOOLEAN
1043 NTAPI
1045  _In_ PVOID HeapHandle,
1046  _In_ ULONG Flags,
1047  _In_ PVOID BaseAddress,
1048  _In_ ULONG UserFlagsReset,
1049  _In_ ULONG UserFlagsSet
1050 );
1051 
1052 NTSYSAPI
1053 BOOLEAN
1054 NTAPI
1056  _In_ HANDLE Heap,
1057  _In_ ULONG Flags,
1058  _In_opt_ PVOID P
1059 );
1060 
1061 NTSYSAPI
1062 NTSTATUS
1063 NTAPI
1064 RtlWalkHeap(
1065  _In_ HANDLE HeapHandle,
1066  _In_ PVOID HeapEntry
1067 );
1068 
1069 #define RtlGetProcessHeap() (NtCurrentPeb()->ProcessHeap)
1070 
1071 #endif // NTOS_MODE_USER
1072 
1073 #define NtCurrentPeb() (NtCurrentTeb()->ProcessEnvironmentBlock)
1074 
1075 NTSYSAPI
1076 SIZE_T
1077 NTAPI
1078 RtlSizeHeap(
1079  _In_ PVOID HeapHandle,
1080  _In_ ULONG Flags,
1081  _In_ PVOID MemoryPointer
1082 );
1083 
1084 
1085 //
1086 // Security Functions
1087 //
1089 NTSYSAPI
1090 NTSTATUS
1091 NTAPI
1095  _Inout_ PULONG BufferLength
1096 );
1097 
1099 NTSYSAPI
1100 NTSTATUS
1101 NTAPI
1103  _Inout_ PACL Acl,
1106  _In_ PSID Sid
1107 );
1108 
1110 NTSYSAPI
1111 NTSTATUS
1112 NTAPI
1114  _Inout_ PACL pAcl,
1117  _In_ ACCESS_MASK AccessMask,
1118  _In_ PSID pSid
1119 );
1120 
1121 NTSYSAPI
1122 NTSTATUS
1123 NTAPI
1125  _Inout_ PACL pAcl,
1126  _In_ ULONG dwAceRevision,
1127  _In_ ULONG AceFlags,
1128  _In_ ACCESS_MASK AccessMask,
1129  _In_opt_ GUID *ObjectTypeGuid,
1130  _In_opt_ GUID *InheritedObjectTypeGuid,
1131  _In_ PSID pSid
1132 );
1133 
1134 NTSYSAPI
1135 NTSTATUS
1136 NTAPI
1138  _Inout_ PACL Acl,
1139  _In_ ULONG Revision,
1140  _In_ ACCESS_MASK AccessMask,
1141  _In_ PSID Sid
1142 );
1143 
1144 NTSYSAPI
1145 NTSTATUS
1146 NTAPI
1148  _Inout_ PACL Acl,
1149  _In_ ULONG Revision,
1150  _In_ ULONG Flags,
1151  _In_ ACCESS_MASK AccessMask,
1152  _In_ PSID Sid
1153 );
1154 
1155 NTSYSAPI
1156 NTSTATUS
1157 NTAPI
1159  _Inout_ PACL pAcl,
1160  _In_ ULONG dwAceRevision,
1161  _In_ ULONG AceFlags,
1162  _In_ ACCESS_MASK AccessMask,
1163  _In_opt_ GUID *ObjectTypeGuid,
1164  _In_opt_ GUID *InheritedObjectTypeGuid,
1165  _In_ PSID pSid
1166 );
1167 
1168 NTSYSAPI
1169 NTSTATUS
1170 NTAPI
1171 RtlAddAce(
1172  _Inout_ PACL Acl,
1177 );
1178 
1179 NTSYSAPI
1180 NTSTATUS
1181 NTAPI
1183  _Inout_ PACL Acl,
1184  _In_ ULONG Revision,
1185  _In_ ACCESS_MASK AccessMask,
1186  _In_ PSID Sid,
1188  _In_ BOOLEAN Failure
1189 );
1190 
1191 NTSYSAPI
1192 NTSTATUS
1193 NTAPI
1196  _In_ ULONG NumPriv,
1197  _In_ ULONG Flags,
1198  _Out_ PVOID *ReturnedState
1199 );
1200 
1201 NTSYSAPI
1202 NTSTATUS
1203 NTAPI
1205  _Inout_ PACL Acl,
1206  _In_ ULONG Revision,
1207  _In_ ULONG Flags,
1208  _In_ ACCESS_MASK AccessMask,
1209  _In_ PSID Sid,
1210  _In_ BOOLEAN Success,
1211  _In_ BOOLEAN Failure
1212 );
1213 
1214 NTSYSAPI
1215 NTSTATUS
1216 NTAPI
1218  _Inout_ PACL Acl,
1219  _In_ ULONG Revision,
1220  _In_ ULONG Flags,
1221  _In_ ACCESS_MASK AccessMask,
1222  _In_opt_ GUID *ObjectTypeGuid,
1223  _In_opt_ GUID *InheritedObjectTypeGuid,
1224  _In_ PSID Sid,
1225  _In_ BOOLEAN Success,
1226  _In_ BOOLEAN Failure
1227 );
1228 
1229 NTSYSAPI
1230 NTSTATUS
1231 NTAPI
1233  _Inout_ PACL Acl,
1234  _In_ ULONG Revision,
1235  _In_ ULONG Flags,
1236  _In_ ULONG MandatoryFlags,
1237  _In_ UCHAR AceType,
1238  _In_ PSID LabelSid);
1239 
1240 NTSYSAPI
1241 NTSTATUS
1242 NTAPI
1244  _In_ ULONG Privilege,
1245  _In_ BOOLEAN NewValue,
1246  _In_ BOOLEAN ForThread,
1247  _Out_ PBOOLEAN OldValue
1248 );
1249 
1251 NTSYSAPI
1252 NTSTATUS
1253 NTAPI
1257  _In_ ULONG SubAuthority0,
1258  _In_ ULONG SubAuthority1,
1259  _In_ ULONG SubAuthority2,
1260  _In_ ULONG SubAuthority3,
1261  _In_ ULONG SubAuthority4,
1262  _In_ ULONG SubAuthority5,
1263  _In_ ULONG SubAuthority6,
1264  _In_ ULONG SubAuthority7,
1265  _Outptr_ PSID *Sid
1266 );
1267 
1268 NTSYSAPI
1269 BOOLEAN
1270 NTAPI
1274 );
1275 
1276 NTSYSAPI
1277 BOOLEAN
1278 NTAPI
1280  ACCESS_MASK GrantedAccess,
1281  ACCESS_MASK DesiredAccess
1282 );
1283 
1285 NTSYSAPI
1286 VOID
1287 NTAPI
1288 RtlCopyLuid (
1289  _Out_ PLUID DestinationLuid,
1291  );
1292 
1293 NTSYSAPI
1294 VOID
1295 NTAPI
1297  ULONG Count,
1300 );
1301 
1302 NTSYSAPI
1303 NTSTATUS
1304 NTAPI
1306  _In_ ULONG Count,
1308  _In_ ULONG SidAreaSize,
1310  _In_ PSID SidArea,
1311  _Out_ PSID* RemainingSidArea,
1312  _Out_ PULONG RemainingSidAreaSize
1313 );
1314 
1316 NTSYSAPI
1317 NTSTATUS
1318 NTAPI
1321  _In_ PSID Sid,
1323 );
1324 
1326 NTSYSAPI
1327 NTSTATUS
1328 NTAPI
1329 RtlCopySid(
1330  _In_ ULONG DestinationSidLength,
1331  _Out_writes_bytes_(DestinationSidLength) PSID DestinationSid,
1333 );
1334 
1335 NTSYSAPI
1336 NTSTATUS
1337 NTAPI
1338 RtlCreateAcl(
1339  PACL Acl,
1340  ULONG AclSize,
1342 );
1343 
1344 NTSYSAPI
1345 NTSTATUS
1346 NTAPI
1349  _In_ ULONG Revision
1350 );
1351 
1352 NTSYSAPI
1353 NTSTATUS
1354 NTAPI
1356  _Out_ PISECURITY_DESCRIPTOR_RELATIVE SecurityDescriptor,
1357  _In_ ULONG Revision
1358 );
1359 
1360 NTSYSAPI
1361 NTSTATUS
1362 NTAPI
1364  _In_ PSECURITY_DESCRIPTOR pSourceSecurityDescriptor,
1365  _Out_ PSECURITY_DESCRIPTOR *pDestinationSecurityDescriptor
1366 );
1367 
1368 NTSYSAPI
1369 NTSTATUS
1370 NTAPI
1371 RtlDeleteAce(
1372  PACL Acl,
1373  ULONG AceIndex
1374 );
1375 
1376 NTSYSAPI
1377 BOOLEAN
1378 NTAPI
1380  PSID Sid1,
1381  PSID Sid2
1382 );
1383 
1384 NTSYSAPI
1385 BOOLEAN
1386 NTAPI
1387 RtlEqualSid (
1388  _In_ PSID Sid1,
1389  _In_ PSID Sid2
1390 );
1391 
1392 NTSYSAPI
1393 BOOLEAN
1394 NTAPI
1396  PACL Acl,
1397  PACE* Ace
1398 );
1399 
1400 NTSYSAPI
1401 PVOID
1402 NTAPI
1403 RtlFreeSid(
1405 );
1406 
1407 NTSYSAPI
1408 NTSTATUS
1409 NTAPI
1410 RtlGetAce(
1411  PACL Acl,
1412  ULONG AceIndex,
1413  PVOID *Ace
1414 );
1415 
1416 NTSYSAPI
1417 NTSTATUS
1418 NTAPI
1420  _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
1422  _Out_ PULONG Revision
1423 );
1424 
1425 NTSYSAPI
1426 NTSTATUS
1427 NTAPI
1429  _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
1431  _Out_ PACL *Dacl,
1433 );
1434 
1435 NTSYSAPI
1436 NTSTATUS
1437 NTAPI
1439  _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
1441  _Out_ PACL* Sacl,
1443 );
1444 
1445 NTSYSAPI
1446 NTSTATUS
1447 NTAPI
1449  _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
1450  _Out_ PSID *Group,
1452 );
1453 
1454 NTSYSAPI
1455 NTSTATUS
1456 NTAPI
1458  _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
1459  _Out_ PSID *Owner,
1461 );
1462 
1463 NTSYSAPI
1464 BOOLEAN
1465 NTAPI
1467  _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
1468  _Out_ PUCHAR RMControl
1469 );
1470 
1471 NTSYSAPI
1473 NTAPI
1475 
1476 NTSYSAPI
1477 NTSTATUS
1478 NTAPI
1480 
1482 NTSYSAPI
1483 NTSTATUS
1484 NTAPI
1486  _Out_ PSID Sid,
1487  _In_ PSID_IDENTIFIER_AUTHORITY IdentifierAuthority,
1488  _In_ UCHAR SubAuthorityCount
1489 );
1490 
1491 NTSYSAPI
1492 ULONG
1493 NTAPI
1494 RtlLengthRequiredSid(IN ULONG SubAuthorityCount);
1495 
1497 NTSYSAPI
1498 ULONG
1499 NTAPI
1501  _In_ PSECURITY_DESCRIPTOR SecurityDescriptor);
1502 
1503 NTSYSAPI
1504 ULONG
1505 NTAPI
1506 RtlLengthSid(IN PSID Sid);
1507 
1508 NTSYSAPI
1509 NTSTATUS
1510 NTAPI
1512  _In_ PSECURITY_DESCRIPTOR AbsoluteSD,
1513  _Out_ PSECURITY_DESCRIPTOR SelfRelativeSD,
1514  _Inout_ PULONG BufferLength);
1515 
1516 NTSYSAPI
1517 VOID
1518 NTAPI
1520  PACCESS_MASK AccessMask,
1522 );
1523 
1524 #ifdef NTOS_MODE_USER
1525 
1526 NTSYSAPI
1527 NTSTATUS
1528 NTAPI
1530  PACL Acl,
1532  ULONG InformationLength,
1534 );
1535 
1536 #endif
1537 
1538 NTSYSAPI
1539 VOID
1540 NTAPI
1542  _In_ PVOID ReturnedState
1543 );
1544 
1546 NTSYSAPI
1547 NTSTATUS
1548 NTAPI
1550  _In_ PSECURITY_DESCRIPTOR SelfRelativeSecurityDescriptor,
1551  _Out_writes_bytes_to_opt_(*AbsoluteSecurityDescriptorSize, *AbsoluteSecurityDescriptorSize) PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor,
1552  _Inout_ PULONG AbsoluteSecurityDescriptorSize,
1554  _Inout_ PULONG DaclSize,
1556  _Inout_ PULONG SaclSize,
1558  _Inout_ PULONG OwnerSize,
1560  _Inout_ PULONG PrimaryGroupSize
1561 );
1562 
1563 NTSYSAPI
1564 NTSTATUS
1565 NTAPI
1567  _Inout_ PSECURITY_DESCRIPTOR SelfRelativeSD,
1569 );
1570 
1571 NTSYSAPI
1572 NTSTATUS
1573 NTAPI
1575  _Inout_ PSECURITY_DESCRIPTOR SecurityDescriptor,
1577  _Out_ PULONG Revision
1578 );
1579 
1580 NTSYSAPI
1581 NTSTATUS
1582 NTAPI
1584  _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
1585  _In_ SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest,
1586  _In_ SECURITY_DESCRIPTOR_CONTROL ControlBitsToSet
1587 );
1588 
1590 NTSYSAPI
1591 NTSTATUS
1592 NTAPI
1594  _Inout_ PSECURITY_DESCRIPTOR SecurityDescriptor,
1595  _In_ BOOLEAN DaclPresent,
1596  _In_opt_ PACL Dacl,
1597  _In_opt_ BOOLEAN DaclDefaulted
1598 );
1599 
1601 NTSYSAPI
1602 NTSTATUS
1603 NTAPI
1605  _Inout_ PSECURITY_DESCRIPTOR SecurityDescriptor,
1607  _In_opt_ BOOLEAN GroupDefaulted
1608 );
1609 
1610 #ifdef NTOS_MODE_USER
1611 
1612 NTSYSAPI
1613 NTSTATUS
1614 NTAPI
1616  PACL Acl,
1618  ULONG InformationLength,
1620 );
1621 
1622 #endif
1623 
1625 NTSYSAPI
1626 NTSTATUS
1627 NTAPI
1629  _Inout_ PSECURITY_DESCRIPTOR SecurityDescriptor,
1631  _In_opt_ BOOLEAN OwnerDefaulted
1632 );
1633 
1634 NTSYSAPI
1635 NTSTATUS
1636 NTAPI
1638  _Inout_ PSECURITY_DESCRIPTOR SecurityDescriptor,
1639  _In_ BOOLEAN SaclPresent,
1640  _In_ PACL Sacl,
1641  _In_ BOOLEAN SaclDefaulted
1642 );
1643 
1644 NTSYSAPI
1645 VOID
1646 NTAPI
1648  _Inout_ PSECURITY_DESCRIPTOR SecurityDescriptor,
1649  _In_ PUCHAR RMControl
1650 );
1651 
1652 NTSYSAPI
1653 PUCHAR
1654 NTAPI
1656  _In_ PSID Sid
1657 );
1658 
1659 NTSYSAPI
1660 PULONG
1661 NTAPI
1663  _In_ PSID Sid,
1664  _In_ ULONG SubAuthority
1665 );
1666 
1669 NTSYSAPI
1670 BOOLEAN
1671 NTAPI
1676 );
1677 
1678 NTSYSAPI
1679 BOOLEAN
1680 NTAPI
1682 
1683 NTSYSAPI
1684 BOOLEAN
1685 NTAPI
1686 RtlValidSid(IN PSID Sid);
1687 
1688 NTSYSAPI
1689 BOOLEAN
1690 NTAPI
1691 RtlValidAcl(PACL Acl);
1692 
1693 NTSYSAPI
1694 NTSTATUS
1695 NTAPI
1697  _In_ PSECURITY_DESCRIPTOR *ObjectDescriptor
1698 );
1699 
1700 NTSYSAPI
1701 NTSTATUS
1702 NTAPI
1704  _In_ PSECURITY_DESCRIPTOR ParentDescriptor,
1705  _In_ PSECURITY_DESCRIPTOR CreatorDescriptor,
1708  _In_ HANDLE Token,
1709  _In_ PGENERIC_MAPPING GenericMapping
1710 );
1711 
1712 NTSYSAPI
1713 NTSTATUS
1714 NTAPI
1716  _In_ PSECURITY_DESCRIPTOR ObjectDescriptor,
1718  _Out_ PSECURITY_DESCRIPTOR ResultantDescriptor,
1719  _In_ ULONG DescriptorLength,
1720  _Out_ PULONG ReturnLength
1721 );
1722 
1723 NTSYSAPI
1724 NTSTATUS
1725 NTAPI
1727  _In_ SECURITY_INFORMATION SecurityInformation,
1728  _In_ PSECURITY_DESCRIPTOR ModificationDescriptor,
1729  _Out_ PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor,
1730  _In_ PGENERIC_MAPPING GenericMapping,
1731  _In_ HANDLE Token
1732 );
1733 
1734 //
1735 // Single-Character Functions
1736 //
1737 NTSYSAPI
1738 NTSTATUS
1739 NTAPI
1742  _In_ ULONG Base,
1743  _In_ ULONG Length,
1745 );
1746 
1747 NTSYSAPI
1748 CHAR
1749 NTAPI
1751 
1752 NTSYSAPI
1753 WCHAR
1754 NTAPI
1755 RtlUpcaseUnicodeChar(WCHAR Source);
1756 
1757 NTSYSAPI
1758 WCHAR
1759 NTAPI
1761 
1762 NTSYSAPI
1763 NTSTATUS
1764 NTAPI
1766  _In_ ULONG Value,
1767  _In_ ULONG Base,
1768  _In_ ULONG Length,
1769  _Out_ PCHAR String
1770 );
1771 
1772 NTSYSAPI
1773 NTSTATUS
1774 NTAPI
1776  _In_ ULONG Value,
1777  _In_opt_ ULONG Base,
1778  _In_opt_ ULONG Length,
1779  _Inout_ LPWSTR String
1780 );
1781 
1783 _At_(String->MaximumLength, _Const_)
1784 NTSYSAPI
1785 NTSTATUS
1786 NTAPI
1788  _In_ ULONG Value,
1789  _In_opt_ ULONG Base,
1790  _Inout_ PUNICODE_STRING String
1791 );
1792 
1793 NTSYSAPI
1794 NTSTATUS
1795 NTAPI
1797  PCSZ String,
1798  ULONG Base,
1799  PULONG Value
1800 );
1801 
1802 //
1803 // Byte Swap Functions
1804 //
1805 #ifdef NTOS_MODE_USER
1806 
1807 unsigned short __cdecl _byteswap_ushort(unsigned short);
1808 unsigned long __cdecl _byteswap_ulong (unsigned long);
1809 unsigned __int64 __cdecl _byteswap_uint64(unsigned __int64);
1810 #ifdef _MSC_VER
1811 #pragma intrinsic(_byteswap_ushort)
1812 #pragma intrinsic(_byteswap_ulong)
1813 #pragma intrinsic(_byteswap_uint64)
1814 #endif // _MSC_VER
1815 #define RtlUshortByteSwap(_x) _byteswap_ushort((USHORT)(_x))
1816 #define RtlUlongByteSwap(_x) _byteswap_ulong((_x))
1817 #define RtlUlonglongByteSwap(_x) _byteswap_uint64((_x))
1818 
1819 #endif // NTOS_MODE_USER
1820 
1821 //
1822 // Unicode->Ansi String Functions
1823 //
1824 NTSYSAPI
1825 ULONG
1826 NTAPI
1828 
1829 #ifdef NTOS_MODE_USER
1830 
1831 #define RtlUnicodeStringToAnsiSize(STRING) ( \
1832  NLS_MB_CODE_PAGE_TAG ? \
1833  RtlxUnicodeStringToAnsiSize(STRING) : \
1834  ((STRING)->Length + sizeof(UNICODE_NULL)) / sizeof(WCHAR) \
1835 )
1836 
1837 #endif
1838 
1839 NTSYSAPI
1840 NTSTATUS
1841 NTAPI
1845  BOOLEAN AllocateDestinationString
1846 );
1847 
1848 //
1849 // Unicode->OEM String Functions
1850 //
1851 NTSYSAPI
1852 NTSTATUS
1853 NTAPI
1857  BOOLEAN AllocateDestinationString
1858 );
1859 
1862 //_At_(DestinationString->Buffer, _Post_bytecount_(DestinationString->Length))
1863 NTSYSAPI
1864 NTSTATUS
1865 NTAPI
1867  _When_(AllocateDestinationString, _Out_ _At_(DestinationString->Buffer, __drv_allocatesMem(Mem)))
1868  _When_(!AllocateDestinationString, _Inout_)
1871  _In_ BOOLEAN AllocateDestinationString
1872 );
1873 
1874 NTSYSAPI
1875 NTSTATUS
1876 NTAPI
1878  POEM_STRING DestinationString,
1879  PCUNICODE_STRING SourceString,
1880  BOOLEAN AllocateDestinationString
1881 );
1882 
1883 NTSYSAPI
1884 NTSTATUS
1885 NTAPI
1887  PCHAR OemString,
1888  ULONG OemSize,
1889  PULONG ResultSize,
1890  PCWCH UnicodeString,
1891  ULONG UnicodeSize
1892 );
1893 
1894 NTSYSAPI
1895 ULONG
1896 NTAPI
1898 
1899 #ifdef NTOS_MODE_USER
1900 
1901 #define RtlUnicodeStringToOemSize(STRING) ( \
1902  NLS_MB_OEM_CODE_PAGE_TAG ? \
1903  RtlxUnicodeStringToOemSize(STRING) : \
1904  ((STRING)->Length + sizeof(UNICODE_NULL)) / sizeof(WCHAR) \
1905 )
1906 
1907 #define RtlUnicodeStringToCountedOemSize(STRING) ( \
1908  (ULONG)(RtlUnicodeStringToOemSize(STRING) - sizeof(ANSI_NULL)) \
1909 )
1910 
1911 #endif
1912 
1913 NTSYSAPI
1914 NTSTATUS
1915 NTAPI
1917  PCHAR OemString,
1918  ULONG OemSize,
1919  PULONG ResultSize,
1920  PCWCH UnicodeString,
1921  ULONG UnicodeSize
1922 );
1923 
1924 //
1925 // Unicode->MultiByte String Functions
1926 //
1927 NTSYSAPI
1928 NTSTATUS
1929 NTAPI
1931  PCHAR MbString,
1932  ULONG MbSize,
1933  PULONG ResultSize,
1934  PCWCH UnicodeString,
1935  ULONG UnicodeSize
1936 );
1937 
1938 NTSYSAPI
1939 NTSTATUS
1940 NTAPI
1942  PCHAR MbString,
1943  ULONG MbSize,
1944  PULONG ResultSize,
1945  PCWCH UnicodeString,
1946  ULONG UnicodeSize
1947 );
1948 
1949 NTSYSAPI
1950 NTSTATUS
1951 NTAPI
1953  PULONG MbSize,
1954  PCWCH UnicodeString,
1955  ULONG UnicodeSize
1956 );
1957 
1958 NTSYSAPI
1959 ULONG
1960 NTAPI
1962 
1963 //
1964 // OEM to Unicode Functions
1965 //
1966 NTSYSAPI
1967 NTSTATUS
1968 NTAPI
1970  PUNICODE_STRING DestinationString,
1971  PCOEM_STRING SourceString,
1972  BOOLEAN AllocateDestinationString
1973 );
1974 
1976 NTSYSAPI
1977 NTSTATUS
1978 NTAPI
1981  _In_ ULONG MaxBytesInUnicodeString,
1985 );
1986 
1987 #ifdef NTOS_MODE_USER
1988 
1989 #define RtlOemStringToUnicodeSize(STRING) ( \
1990  NLS_MB_OEM_CODE_PAGE_TAG ? \
1991  RtlxOemStringToUnicodeSize(STRING) : \
1992  ((STRING)->Length + sizeof(ANSI_NULL)) * sizeof(WCHAR) \
1993 )
1994 
1995 #define RtlOemStringToCountedUnicodeSize(STRING) ( \
1996  (ULONG)(RtlOemStringToUnicodeSize(STRING) - sizeof(UNICODE_NULL)) \
1997 )
1998 
1999 #endif
2000 
2001 //
2002 // Ansi->Unicode String Functions
2003 //
2005 NTSYSAPI
2006 WCHAR
2007 NTAPI
2009  _Inout_ PUCHAR *SourceCharacter);
2010 
2011 NTSYSAPI
2012 NTSTATUS
2013 NTAPI
2015  PUNICODE_STRING DestinationString,
2016  PCANSI_STRING SourceString,
2017  BOOLEAN AllocateDestinationString
2018 );
2019 
2020 NTSYSAPI
2021 ULONG
2022 NTAPI
2025 );
2026 
2027 #ifdef NTOS_MODE_USER
2028 
2029 #define RtlAnsiStringToUnicodeSize(STRING) ( \
2030  NLS_MB_CODE_PAGE_TAG ? \
2031  RtlxAnsiStringToUnicodeSize(STRING) : \
2032  ((STRING)->Length + sizeof(ANSI_NULL)) * sizeof(WCHAR) \
2033 )
2034 
2035 #endif
2036 
2037 NTSYSAPI
2038 BOOLEAN
2039 NTAPI
2042  _In_ PCSZ Source
2043 );
2044 
2045 //
2046 // Unicode String Functions
2047 //
2048 NTSYSAPI
2049 NTSTATUS
2050 NTAPI
2053  PCWSTR Source
2054 );
2055 
2056 NTSYSAPI
2057 NTSTATUS
2058 NTAPI
2061  PCUNICODE_STRING Source
2062 );
2063 
2064 NTSYSAPI
2065 LONG
2066 NTAPI
2068  PCUNICODE_STRING String1,
2071 );
2072 
2073 NTSYSAPI
2074 VOID
2075 NTAPI
2077  PUNICODE_STRING DestinationString,
2078  PCUNICODE_STRING SourceString
2079 );
2080 
2081 NTSYSAPI
2082 BOOLEAN
2083 NTAPI
2085  PUNICODE_STRING DestinationString,
2086  PCWSTR SourceString
2087 );
2088 
2089 #ifdef NTOS_MODE_USER
2090 
2091 NTSYSAPI
2092 NTSTATUS
2093 NTAPI
2095  _Inout_ PUNICODE_STRING UniDest,
2096  _In_ PCUNICODE_STRING UniSource,
2097  _In_ BOOLEAN AllocateDestinationString
2098 );
2099 
2100 NTSYSAPI
2101 NTSTATUS
2102 NTAPI
2104  _In_ ULONG Flags,
2105  _In_ PCUNICODE_STRING SourceString,
2106  _Out_ PUNICODE_STRING DestinationString
2107 );
2108 
2109 //
2110 // Memory Functions
2111 //
2112 NTSYSAPI
2113 VOID
2114 NTAPI
2117  _In_ SIZE_T Length,
2118  _In_ ULONG Fill
2119 );
2120 
2121 NTSYSAPI
2122 VOID
2123 NTAPI
2126  _In_ SIZE_T Length,
2127  _In_ ULONGLONG Pattern
2128 );
2129 
2130 NTSYSAPI
2131 NTSTATUS
2132 NTAPI
2135  _In_reads_bytes_(Size) const VOID *Source,
2136  _In_ SIZE_T Size
2137 );
2138 
2139 NTSYSAPI
2140 SIZE_T
2141 NTAPI
2143  _In_ PVOID Source,
2144  _In_ SIZE_T Length,
2145  _In_ ULONG Pattern
2146 );
2147 
2148 #ifndef RtlEqualMemory
2149 #define RtlEqualMemory(Destination, Source, Length) \
2150  (!memcmp(Destination, Source, Length))
2151 #endif
2152 
2153 #define RtlCopyBytes RtlCopyMemory
2154 #define RtlFillBytes RtlFillMemory
2155 #define RtlZeroBytes RtlZeroMemory
2156 
2157 #endif
2158 
2159 NTSYSAPI
2160 BOOLEAN
2161 NTAPI
2163  PCUNICODE_STRING String1,
2166 );
2167 
2168 NTSYSAPI
2169 NTSTATUS
2170 NTAPI
2172  _In_ ULONG Flags,
2173  _In_ PCUNICODE_STRING SearchString,
2174  _In_ PCUNICODE_STRING MatchString,
2176 );
2177 
2179 NTSYSAPI
2180 VOID
2181 NTAPI
2183  _Inout_ _At_(UnicodeString->Buffer, __drv_freesMem(Mem))
2184  PUNICODE_STRING UnicodeString
2185 );
2186 
2187 NTSYSAPI
2188 VOID
2189 NTAPI
2191  _Inout_ PUNICODE_STRING String
2192 );
2193 
2194 NTSYSAPI
2195 NTSTATUS
2196 NTAPI
2198  _In_ CONST UNICODE_STRING *String,
2202 );
2203 
2205 _At_(DestinationString->Buffer, _Post_equal_to_(SourceString))
2206 _When_(SourceString != NULL,
2207 _At_(DestinationString->Length, _Post_equal_to_(_String_length_(SourceString) * sizeof(WCHAR)))
2208 _At_(DestinationString->MaximumLength, _Post_equal_to_(DestinationString->Length + sizeof(WCHAR))))
2209 _When_(SourceString == NULL,
2210 _At_(DestinationString->Length, _Post_equal_to_(0))
2211 _At_(DestinationString->MaximumLength, _Post_equal_to_(0)))
2212 NTSYSAPI
2213 VOID
2214 NTAPI
2216  _Out_ PUNICODE_STRING DestinationString,
2217  _In_opt_z_ __drv_aliasesMem PCWSTR SourceString
2218 );
2219 
2221 NTSYSAPI
2222 NTSTATUS
2223 NTAPI
2225  _Out_ PUNICODE_STRING DestinationString,
2226  _In_opt_z_ __drv_aliasesMem PCWSTR SourceString
2227 );
2228 
2229 NTSYSAPI
2230 BOOLEAN
2231 NTAPI
2233  _In_ CONST VOID* Buffer,
2234  _In_ INT Size,
2235  _Inout_opt_ INT* Flags
2236 );
2237 
2240 NTSYSAPI
2241 BOOLEAN
2242 NTAPI
2244  _In_ const STRING *String1,
2247 );
2248 
2251 NTSYSAPI
2252 BOOLEAN
2253 NTAPI
2255  _In_ PCUNICODE_STRING String1,
2256  _In_ PCUNICODE_STRING String2,
2257  _In_ BOOLEAN CaseInsensitive
2258 );
2259 
2261 NTSYSAPI
2262 VOID
2263 NTAPI
2265  _Inout_ PSTRING DestinationString,
2266  _In_ const STRING *SourceString
2267 );
2268 
2271 NTSYSAPI
2272 LONG
2273 NTAPI
2275  _In_ const STRING *String1,
2276  _In_ const STRING *String2,
2277  _In_ BOOLEAN CaseInSensitive
2278 );
2279 
2280 NTSYSAPI
2281 VOID
2282 NTAPI
2284  _Out_ PSTRING DestinationString,
2285  _In_opt_ const STRING *SourceString
2286 );
2287 
2290 NTSYSAPI
2291 BOOLEAN
2292 NTAPI
2294  _In_ const STRING *String1,
2295  _In_ const STRING *String2,
2296  _In_ BOOLEAN CaseInSensitive
2297 );
2298 
2300 NTSYSAPI
2301 NTSTATUS
2302 NTAPI
2304  _Inout_ PSTRING Destination,
2305  _In_ const STRING *Source
2306 );
2307 
2309 _When_(AllocateDestinationString, _Must_inspect_result_)
2310 NTSYSAPI
2311 NTSTATUS
2312 NTAPI
2314  _When_(AllocateDestinationString, _Out_ _At_(DestinationString->Buffer, __drv_allocatesMem(Mem)))
2315  _When_(!AllocateDestinationString, _Inout_)
2316  PUNICODE_STRING DestinationString,
2317  _In_ PCUNICODE_STRING SourceString,
2318  _In_ BOOLEAN AllocateDestinationString
2319 );
2320 
2322 NTSYSAPI
2323 NTSTATUS
2324 NTAPI
2326  _In_ PCUNICODE_STRING String,
2328  _Out_ PULONG Value
2329 );
2330 
2331 NTSYSAPI
2332 NTSTATUS
2333 NTAPI
2335  _In_ ULONG Flags,
2336  _In_ PCUNICODE_STRING String
2337 );
2338 
2339 #define RTL_SKIP_BUFFER_COPY 0x00000001
2340 
2341 NTSYSAPI
2342 NTSTATUS
2343 NTAPI
2345  _In_ ULONG Flags,
2346  _Inout_ PRTL_BUFFER Buffer,
2348 );
2349 
2350 #ifdef NTOS_MODE_USER
2351 
2353 VOID
2354 RtlInitBuffer(
2355  _Inout_ PRTL_BUFFER Buffer,
2356  _In_ PUCHAR Data,
2358 )
2359 {
2360  Buffer->Buffer = Buffer->StaticBuffer = Data;
2361  Buffer->Size = Buffer->StaticSize = DataSize;
2362  Buffer->ReservedForAllocatedSize = 0;
2363  Buffer->ReservedForIMalloc = NULL;
2364 }
2365 
2367 NTSTATUS
2368 RtlEnsureBufferSize(
2369  _In_ ULONG Flags,
2370  _Inout_ PRTL_BUFFER Buffer,
2372 )
2373 {
2374  if (Buffer && RequiredSize <= Buffer->Size)
2375  return STATUS_SUCCESS;
2376  return RtlpEnsureBufferSize(Flags, Buffer, RequiredSize);
2377 }
2378 
2380 VOID
2381 RtlFreeBuffer(
2382  _Inout_ PRTL_BUFFER Buffer
2383 )
2384 {
2385  if (Buffer->Buffer != Buffer->StaticBuffer && Buffer->Buffer)
2386  RtlFreeHeap(RtlGetProcessHeap(), 0, Buffer->Buffer);
2387  Buffer->Buffer = Buffer->StaticBuffer;
2388  Buffer->Size = Buffer->StaticSize;
2389 }
2390 
2391 #endif /* NTOS_MODE_USER */
2392 
2393 //
2394 // Ansi String Functions
2395 //
2397 NTSYSAPI
2398 VOID
2399 NTAPI
2401  _Inout_ _At_(AnsiString->Buffer, __drv_freesMem(Mem))
2402  PANSI_STRING AnsiString
2403 );
2404 
2406 NTSYSAPI
2407 VOID
2408 NTAPI
2410  _Out_ PANSI_STRING DestinationString,
2411  _In_opt_z_ __drv_aliasesMem PCSZ SourceString
2412 );
2413 
2415 NTSYSAPI
2416 NTSTATUS
2417 NTAPI
2419  _Out_ PANSI_STRING DestinationString,
2420  _In_opt_z_ __drv_aliasesMem PCSZ SourceString
2421 );
2422 
2423 //
2424 // OEM String Functions
2425 //
2427 NTSYSAPI
2428 VOID
2429 NTAPI
2431  _Inout_ _At_(OemString->Buffer, __drv_freesMem(Mem))
2432  POEM_STRING OemString
2433 );
2434 
2435 //
2436 // MultiByte->Unicode String Functions
2437 //
2439 NTSYSAPI
2440 NTSTATUS
2441 NTAPI
2443  _Out_writes_bytes_to_(MaxBytesInUnicodeString, *BytesInUnicodeString) PWCH UnicodeString,
2444  _In_ ULONG MaxBytesInUnicodeString,
2445  _Out_opt_ PULONG BytesInUnicodeString,
2448 );
2449 
2451 NTSYSAPI
2452 NTSTATUS
2453 NTAPI
2455  _Out_ PULONG BytesInUnicodeString,
2458 );
2459 
2460 //
2461 // Atom Functions
2462 //
2463 NTSYSAPI
2464 NTSTATUS
2465 NTAPI
2467  _In_ PRTL_ATOM_TABLE AtomTable,
2468  _In_ PWSTR AtomName,
2470 );
2471 
2472 NTSYSAPI
2473 NTSTATUS
2474 NTAPI
2477  _Inout_ PRTL_ATOM_TABLE *AtomTable
2478 );
2479 
2480 NTSYSAPI
2481 NTSTATUS
2482 NTAPI
2484  _In_ PRTL_ATOM_TABLE AtomTable,
2485  _In_ RTL_ATOM Atom
2486 );
2487 
2488 NTSYSAPI
2489 NTSTATUS
2490 NTAPI
2492 
2493 NTSYSAPI
2494 NTSTATUS
2495 NTAPI
2497  _In_ PRTL_ATOM_TABLE AtomTable,
2498  _In_ RTL_ATOM Atom,
2499  _Out_opt_ PULONG RefCount,
2501  _Out_opt_z_bytecap_(*NameLength) PWSTR AtomName,
2502  _Inout_opt_ PULONG NameLength
2503 );
2504 
2505 NTSYSAPI
2506 NTSTATUS
2507 NTAPI
2509  _In_ PRTL_ATOM_TABLE AtomTable,
2510  _In_ RTL_ATOM Atom
2511 );
2512 
2513 NTSYSAPI
2514 NTSTATUS
2515 NTAPI
2517  _In_ PRTL_ATOM_TABLE AtomTable,
2518  _In_ PWSTR AtomName,
2519  _Out_ PRTL_ATOM Atom
2520 );
2521 
2522 //
2523 // Process Management Functions
2524 //
2525 NTSYSAPI
2526 PPEB
2527 NTAPI
2529  VOID
2530 );
2531 
2532 NTSYSAPI
2533 VOID
2534 NTAPI
2535 RtlAcquirePebLock(VOID);
2536 
2537 NTSYSAPI
2538 NTSTATUS
2539 NTAPI
2541  _Out_ PRTL_USER_PROCESS_PARAMETERS *ProcessParameters,
2542  _In_ PUNICODE_STRING ImagePathName,
2545  _In_opt_ PUNICODE_STRING CommandLine,
2547  _In_opt_ PUNICODE_STRING WindowTitle,
2548  _In_opt_ PUNICODE_STRING DesktopInfo,
2549  _In_opt_ PUNICODE_STRING ShellInfo,
2550  _In_opt_ PUNICODE_STRING RuntimeInfo
2551 );
2552 
2553 NTSYSAPI
2554 NTSTATUS
2555 NTAPI
2557  _In_ PUNICODE_STRING ImageFileName,
2559  _In_ PRTL_USER_PROCESS_PARAMETERS ProcessParameters,
2560  _In_opt_ PSECURITY_DESCRIPTOR ProcessSecutityDescriptor,
2561  _In_opt_ PSECURITY_DESCRIPTOR ThreadSecurityDescriptor,
2562  _In_opt_ HANDLE ParentProcess,
2563  _In_ BOOLEAN CurrentDirectory,
2564  _In_opt_ HANDLE DebugPort,
2565  _In_opt_ HANDLE ExceptionPort,
2567 );
2568 
2569 #if (NTDDI_VERSION >= NTDDI_WIN7)
2570 NTSYSAPI
2571 NTSTATUS
2572 NTAPI
2574  _In_ PVOID ThreadContext,
2575  _Out_ HANDLE *OutThreadHandle,
2581  _Reserved_ PVOID Reserved6,
2583  _Reserved_ PVOID Reserved8
2584 );
2585 #else
2586 NTSYSAPI
2587 NTSTATUS
2588 NTAPI
2591  _In_opt_ PSECURITY_DESCRIPTOR SecurityDescriptor,
2592  _In_ BOOLEAN CreateSuspended,
2593  _In_ ULONG StackZeroBits,
2594  _In_ SIZE_T StackReserve,
2595  _In_ SIZE_T StackCommit,
2596  _In_ PTHREAD_START_ROUTINE StartAddress,
2598  _Out_opt_ PHANDLE ThreadHandle,
2600 );
2601 #endif
2602 
2603 NTSYSAPI
2605 NTAPI
2607  _In_ PRTL_USER_PROCESS_PARAMETERS ProcessParameters);
2608 
2609 NTSYSAPI
2610 NTSTATUS
2611 NTAPI
2613  _In_ PRTL_USER_PROCESS_PARAMETERS ProcessParameters);
2614 
2615 NTSYSAPI
2616 VOID
2617 NTAPI
2619  _In_ NTSTATUS Status);
2620 
2621 NTSYSAPI
2622 VOID
2623 NTAPI
2626  _Out_ PCONTEXT ThreadContext,
2627  _In_opt_ PVOID ThreadStartParam,
2628  _In_ PTHREAD_START_ROUTINE ThreadStartAddress,
2629  _In_ PINITIAL_TEB InitialTeb
2630 );
2631 
2632 #ifdef _M_AMD64
2633 typedef struct _WOW64_CONTEXT *PWOW64_CONTEXT;
2634 
2635 NTSYSAPI
2636 NTSTATUS
2637 NTAPI
2638 RtlWow64GetThreadContext(
2639  _In_ HANDLE ThreadHandle,
2640  _Inout_ PWOW64_CONTEXT ThreadContext
2641 );
2642 
2643 
2644 NTSYSAPI
2645 NTSTATUS
2646 NTAPI
2647 RtlWow64SetThreadContext(
2648  _In_ HANDLE ThreadHandle,
2649  _In_ PWOW64_CONTEXT ThreadContext
2650 );
2651 #endif
2652 
2653 NTSYSAPI
2654 BOOLEAN
2655 NTAPI
2657 
2658 NTSYSAPI
2660 NTAPI
2662  _In_ PRTL_USER_PROCESS_PARAMETERS ProcessParameters);
2663 
2664 NTSYSAPI
2665 VOID
2666 NTAPI
2667 RtlReleasePebLock(VOID);
2668 
2669 NTSYSAPI
2670 NTSTATUS
2671 NTAPI
2674  _In_ HANDLE Thread,
2675  _In_ PVOID CallSite,
2676  _In_ ULONG ArgumentCount,
2677  _In_ PULONG Arguments,
2678  _In_ BOOLEAN PassContext,
2679  _In_ BOOLEAN AlreadySuspended
2680 );
2681 
2682 NTSYSAPI
2683 NTSTATUS
2684 __cdecl
2686  _In_ BOOLEAN NewValue,
2687  _Out_opt_ PBOOLEAN OldValue,
2688  _In_ BOOLEAN NeedBreaks
2689 );
2690 
2691 NTSYSAPI
2692 NTSTATUS
2693 __cdecl
2695  _In_ BOOLEAN NewValue,
2696  _Out_opt_ PBOOLEAN OldValue,
2697  _In_ BOOLEAN NeedBreaks
2698 );
2699 
2700 NTSYSAPI
2701 ULONG
2702 NTAPI
2704  VOID
2705 );
2706 
2707 
2708 //
2709 // Thread Pool Functions
2710 //
2711 //
2712 NTSTATUS
2713 NTAPI
2715  _In_ PRTL_START_POOL_THREAD StartPoolThread,
2716  _In_ PRTL_EXIT_POOL_THREAD ExitPoolThread
2717 );
2718 
2719 NTSYSAPI
2720 NTSTATUS
2721 NTAPI
2723  _In_ HANDLE hWaitHandle,
2724  _In_opt_ HANDLE hCompletionEvent
2725 );
2726 
2727 NTSYSAPI
2728 NTSTATUS
2729 NTAPI
2731  _In_ HANDLE hWaitHandle
2732 );
2733 
2734 NTSYSAPI
2735 NTSTATUS
2736 NTAPI
2740  _In_ ULONG Flags
2741 );
2742 
2743 NTSYSAPI
2744 NTSTATUS
2745 NTAPI
2749  _In_ ULONG Flags
2750 );
2751 
2752 NTSYSAPI
2753 NTSTATUS
2754 NTAPI
2756  _In_ PHANDLE phNewWaitObject,
2759  _In_ PVOID pvContext,
2760  _In_ ULONG ulMilliseconds,
2761  _In_ ULONG ulFlags
2762 );
2763 
2764 //
2765 // Environment/Path Functions
2766 //
2767 NTSYSAPI
2768 NTSTATUS
2769 NTAPI
2771  _In_ BOOLEAN Inherit,
2772  _Out_ PWSTR *Environment
2773 );
2774 
2775 NTSYSAPI
2776 NTSTATUS
2777 NTAPI
2779  _In_ PUNICODE_STRING DllName,
2780  _Out_ PUNICODE_STRING RealName,
2781  _Out_ PUNICODE_STRING LocalName
2782 );
2783 
2784 NTSYSAPI
2785 VOID
2786 NTAPI
2788  _In_ PWSTR Environment
2789 );
2790 
2791 NTSYSAPI
2792 BOOLEAN
2793 NTAPI
2796 );
2797 
2798 NTSYSAPI
2800 NTAPI
2802  _In_ PCWSTR Path
2803 );
2804 
2805 NTSYSAPI
2806 ULONG
2807 NTAPI
2809  _In_ PCWSTR Path,
2812  _In_ ULONG BufferSize,
2813  _Out_ PWSTR Buffer,
2814  _Out_ PWSTR *PartName
2815 );
2816 
2817 NTSYSAPI
2818 NTSTATUS
2819 NTAPI
2821  _In_ ULONG Flags,
2822  _In_ PUNICODE_STRING PathString,
2823  _In_ PUNICODE_STRING FileNameString,
2824  _In_ PUNICODE_STRING ExtensionString,
2825  _In_ PUNICODE_STRING CallerBuffer,
2827  _Out_opt_ PUNICODE_STRING* FullNameOut,
2828  _Out_opt_ PSIZE_T FilePartSize,
2830 );
2831 
2832 NTSYSAPI
2833 BOOLEAN
2834 NTAPI
2836  _In_opt_z_ PCWSTR DosPathName,
2837  _Out_ PUNICODE_STRING NtPathName,
2838  _Out_opt_ PCWSTR *NtFileNamePart,
2839  _Out_opt_ PRTL_RELATIVE_NAME_U DirectoryInfo
2840 );
2841 
2842 
2843 #define RTL_UNCHANGED_UNK_PATH 1
2844 #define RTL_CONVERTED_UNC_PATH 2
2845 #define RTL_CONVERTED_NT_PATH 3
2846 #define RTL_UNCHANGED_DOS_PATH 4
2847 
2848 NTSYSAPI
2849 NTSTATUS
2850 NTAPI
2852  _In_ ULONG Flags,
2856 );
2857 
2858 
2859 NTSYSAPI
2860 BOOLEAN
2861 NTAPI
2864  _Out_ PUNICODE_STRING NtName,
2865  _Out_ PCWSTR *PartName,
2866  _Out_ PRTL_RELATIVE_NAME_U RelativeName
2867 );
2868 
2869 _At_(Destination->Buffer, _Out_bytecap_(Destination->MaximumLength))
2870 NTSYSAPI
2871 NTSTATUS
2872 NTAPI
2874  _In_z_ PWSTR Environment,
2876  _Inout_ PUNICODE_STRING Destination,
2877  _Out_ PULONG Length
2878 );
2879 
2880 NTSYSAPI
2881 ULONG
2882 NTAPI
2884  _In_ ULONG MaximumLength,
2885  _Out_bytecap_(MaximumLength) PWSTR Buffer
2886 );
2887 
2888 NTSYSAPI
2889 ULONG
2890 NTAPI
2893  _In_ ULONG Size,
2894  _Out_z_bytecap_(Size) PWSTR Buffer,
2896 );
2897 
2898 #if (NTDDI_VERSION >= NTDDI_WIN7)
2899 NTSYSAPI
2900 NTSTATUS
2901 NTAPI
2903  _In_ PWSTR FileName,
2904  _In_ ULONG BufferLength,
2905  _Out_ PWSTR Buffer,
2906  _Out_opt_ PWSTR *FilePart,
2907  _Out_opt_ RTL_PATH_TYPE *InputPathType
2908  );
2909 #endif
2910 
2911 NTSTATUS
2912 NTAPI
2914  _In_ PUNICODE_STRING FileName,
2918  _Out_opt_ PSIZE_T FilePartSize,
2922 );
2923 
2924 NTSYSAPI
2925 NTSTATUS
2926 NTAPI
2928  _Reserved_ ULONG Flags,
2929  _In_ PCUNICODE_STRING PathString,
2930  _Out_ PULONG Length
2931 );
2932 
2933 NTSYSAPI
2934 ULONG
2935 NTAPI
2937  VOID
2938 );
2939 
2940 NTSYSAPI
2941 ULONG
2942 NTAPI
2944  _In_ PCWSTR Name
2945 );
2946 
2947 NTSYSAPI
2948 ULONG
2949 NTAPI
2952 );
2953 
2956 NTSYSAPI
2957 BOOLEAN
2958 NTAPI
2963 );
2964 
2965 NTSYSAPI
2966 NTSTATUS
2967 NTAPI
2969  _In_opt_ PWSTR Environment,
2970  _In_ PUNICODE_STRING Name,
2971  _Out_ PUNICODE_STRING Value
2972 );
2973 
2974 VOID
2975 NTAPI
2977  _In_ PRTL_RELATIVE_NAME_U RelativeName
2978 );
2979 
2980 NTSYSAPI
2981 NTSTATUS
2982 NTAPI
2985 );
2986 
2987 NTSYSAPI
2988 NTSTATUS
2989 NTAPI
2991  _In_z_ PWSTR *Environment,
2992  _In_ PUNICODE_STRING Name,
2993  _In_ PUNICODE_STRING Value
2994 );
2995 
2996 //
2997 // Critical Section/Resource Functions
2998 //
2999 NTSYSAPI
3000 NTSTATUS
3001 NTAPI
3004 );
3005 
3006 NTSYSAPI
3007 NTSTATUS
3008 NTAPI
3010  _In_ PRTL_CRITICAL_SECTION CriticalSection
3011 );
3012 
3013 NTSYSAPI
3014 NTSTATUS
3015 NTAPI
3017  _In_ PRTL_CRITICAL_SECTION CriticalSection
3018 );
3019 
3020 NTSYSAPI
3021 NTSTATUS
3022 NTAPI
3024  _In_ PRTL_CRITICAL_SECTION CriticalSection,
3025  _In_ ULONG SpinCount
3026 );
3027 
3028 NTSYSAPI
3029 NTSTATUS
3030 NTAPI
3032  _In_ PRTL_CRITICAL_SECTION CriticalSection
3033 );
3034 
3035 NTSYSAPI
3036 BOOLEAN
3037 NTAPI
3039  _In_ PRTL_CRITICAL_SECTION CriticalSection
3040 );
3041 
3042 NTSYSAPI
3043 VOID
3044 NTAPI
3046  _In_ PRTL_CRITICAL_SECTION CriticalSection
3047 );
3048 
3049 NTSYSAPI
3050 NTSTATUS
3051 NTAPI
3053  _In_ PRTL_CRITICAL_SECTION CriticalSection
3054 );
3055 
3056 NTSYSAPI
3057 BOOLEAN
3058 NTAPI
3061  _In_ BOOLEAN Wait
3062 );
3063 
3064 NTSYSAPI
3065 BOOLEAN
3066 NTAPI
3068  _In_ PRTL_RESOURCE Resource,
3069  _In_ BOOLEAN Wait
3070 );
3071 
3072 NTSYSAPI
3073 VOID
3074 NTAPI
3076  _In_ PRTL_RESOURCE Resource
3077 );
3078 
3079 NTSYSAPI
3080 VOID
3081 NTAPI
3083  _In_ PRTL_RESOURCE Resource
3084 );
3085 
3086 NTSYSAPI
3087 VOID
3088 NTAPI
3090  _In_ PRTL_RESOURCE Resource
3091 );
3092 
3093 NTSYSAPI
3094 VOID
3095 NTAPI
3097  _In_ PRTL_RESOURCE Resource
3098 );
3099 
3100 NTSYSAPI
3101 VOID
3102 NTAPI
3104  _In_ PRTL_RESOURCE Resource
3105 );
3106 
3107 NTSYSAPI
3108 VOID
3109 NTAPI
3111  _In_ PRTL_RESOURCE Resource
3112 );
3113 
3114 //
3115 // Compression Functions
3116 //
3117 NTSYSAPI //NT_RTL_COMPRESS_API
3118 NTSTATUS
3119 NTAPI
3121  _In_ USHORT CompressionFormatAndEngine,
3122  _In_reads_bytes_(UncompressedBufferSize) PUCHAR UncompressedBuffer,
3125  _In_ ULONG CompressedBufferSize,
3126  _In_ ULONG UncompressedChunkSize,
3127  _Out_ PULONG FinalCompressedSize,
3129 );
3130 
3132 NTSYSAPI //NT_RTL_COMPRESS_API
3133 NTSTATUS
3134 NTAPI
3136  _In_ USHORT CompressionFormat,
3137  _Out_writes_bytes_to_(UncompressedBufferSize, *FinalUncompressedSize) PUCHAR UncompressedBuffer,
3138  _In_ ULONG UncompressedBufferSize,
3139  _In_reads_bytes_(CompressedBufferSize) PUCHAR CompressedBuffer,
3140  _In_ ULONG CompressedBufferSize,
3142 );
3143 
3144 NTSYSAPI
3145 NTSTATUS
3146 NTAPI
3148  _In_ USHORT CompressionFormatAndEngine,
3149  _Out_ PULONG CompressBufferWorkSpaceSize,
3150  _Out_ PULONG CompressFragmentWorkSpaceSize
3151 );
3152 
3153 //
3154 // Frame Functions
3155 //
3156 NTSYSAPI
3157 VOID
3158 NTAPI
3159 RtlPopFrame(
3160  _In_ PTEB_ACTIVE_FRAME Frame
3161 );
3162 
3163 NTSYSAPI
3164 VOID
3165 NTAPI
3166 RtlPushFrame(
3167  _In_ PTEB_ACTIVE_FRAME Frame
3168 );
3169 
3170 NTSYSAPI
3172 NTAPI
3173 RtlGetFrame(
3174  VOID
3175 );
3176 
3177 //
3178 // Debug Info Functions
3179 //
3180 NTSYSAPI
3182 NTAPI
3184  _In_ ULONG Size,
3185  _In_ BOOLEAN EventPair
3186 );
3187 
3188 NTSYSAPI
3189 NTSTATUS
3190 NTAPI
3192 
3193 NTSYSAPI
3194 NTSTATUS
3195 NTAPI
3198  _In_ ULONG DebugInfoClassMask,
3199  _Inout_ PRTL_DEBUG_INFORMATION DebugBuffer
3200 );
3201 
3202 //
3203 // Bitmap Functions
3204 //
3205 NTSYSAPI
3206 BOOLEAN
3207 NTAPI
3209  _In_ PRTL_BITMAP BitMapHeader,
3211  _In_ ULONG Length
3212 );
3213 
3214 NTSYSAPI
3215 BOOLEAN
3216 NTAPI
3218  _In_ PRTL_BITMAP BitMapHeader,
3219  _In_ ULONG StartingIndex,
3220  _In_ ULONG Length
3221 );
3222 
3223 NTSYSAPI
3224 VOID
3225 NTAPI
3227  _In_ PRTL_BITMAP BitMapHeader
3228 );
3229 
3230 NTSYSAPI
3231 VOID
3232 NTAPI
3233 RtlClearBit(
3234  _In_ PRTL_BITMAP BitMapHeader,
3235  _In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitNumber
3236 );
3237 
3238 NTSYSAPI
3239 VOID
3240 NTAPI
3241 RtlClearBits(
3242  _In_ PRTL_BITMAP BitMapHeader,
3243  _In_range_(0, BitMapHeader->SizeOfBitMap - NumberToClear) ULONG StartingIndex,
3244  _In_range_(0, BitMapHeader->SizeOfBitMap - StartingIndex) ULONG NumberToClear
3245 );
3246 
3247 NTSYSAPI
3248 ULONG
3249 NTAPI
3251  _In_ PRTL_BITMAP BitMapHeader,
3254 );
3255 
3256 NTSYSAPI
3257 ULONG
3258 NTAPI
3260  _In_ PRTL_BITMAP BitMapHeader,
3261  _In_ ULONG NumberToFind,
3262  _In_ ULONG HintIndex
3263 );
3264 
3265 NTSYSAPI
3266 ULONG
3267 NTAPI
3269  _In_ PRTL_BITMAP BitMapHeader,
3270  _Out_ PULONG StartingIndex
3271 );
3272 
3273 NTSYSAPI
3274 ULONG
3275 NTAPI
3277  _In_ PRTL_BITMAP BitMapHeader,
3278  _Out_writes_to_(SizeOfRunArray, return) PRTL_BITMAP_RUN RunArray,
3279  _In_range_(>, 0) ULONG SizeOfRunArray,
3280  _In_ BOOLEAN LocateLongestRuns
3281 );
3282 
3283 NTSYSAPI
3284 ULONG
3285 NTAPI
3287  _In_ PRTL_BITMAP BitMapHeader,
3288  _In_ ULONG FromIndex,
3289  _Out_ PULONG StartingRunIndex
3290 );
3291 
3292 NTSYSAPI
3293 CCHAR
3294 NTAPI
3296  _In_ ULONGLONG Value
3297 );
3298 
3299 NTSYSAPI
3300 ULONG
3301 NTAPI
3303  _In_ PRTL_BITMAP BitMapHeader,
3304  _Out_ PULONG StartingIndex
3305 );
3306 
3307 NTSYSAPI
3308 CCHAR
3309 NTAPI
3311  _In_ ULONGLONG Value
3312 );
3313 
3314 NTSYSAPI
3315 ULONG
3316 NTAPI
3318  _In_ PRTL_BITMAP BitMapHeader,
3319  _In_ ULONG FromIndex,
3320  _Out_ PULONG StartingRunIndex
3321 );
3322 
3323 NTSYSAPI
3324 ULONG
3325 NTAPI
3327  _In_ PRTL_BITMAP BitMapHeader,
3328  _In_ ULONG FromIndex,
3329  _Out_ PULONG StartingRunIndex
3330 );
3331 
3332 NTSYSAPI
3333 ULONG
3334 NTAPI
3336  _In_ PRTL_BITMAP BitMapHeader,
3337  _In_ ULONG NumberToFind,
3338  _In_ ULONG HintIndex
3339 );
3340 
3341 NTSYSAPI
3342 ULONG
3343 NTAPI
3345  _In_ PRTL_BITMAP BitMapHeader,
3346  _In_ ULONG NumberToFind,
3347  _In_ ULONG HintIndex
3348 );
3349 
3350 #ifdef _REACTOS_ // ReactOS improvement
3351 _At_(BitMapHeader->SizeOfBitMap, _Post_equal_to_(SizeOfBitMap))
3352 _At_(BitMapHeader->Buffer, _Post_equal_to_(BitMapBuffer))
3353 #endif
3354 NTSYSAPI
3355 VOID
3356 NTAPI
3358  _Out_ PRTL_BITMAP BitMapHeader,
3359  _In_opt_ __drv_aliasesMem PULONG BitMapBuffer,
3360  _In_opt_ ULONG SizeOfBitMap
3361 );
3362 
3363 NTSYSAPI
3364 ULONG
3365 NTAPI
3367  _In_ PRTL_BITMAP BitMapHeader
3368 );
3369 
3370 NTSYSAPI
3371 ULONG
3372 NTAPI
3374  _In_ PRTL_BITMAP BitMapHeader
3375 );
3376 
3377 NTSYSAPI
3378 VOID
3379 NTAPI
3380 RtlSetBit(
3381  _In_ PRTL_BITMAP BitMapHeader,
3382  _In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitNumber
3383 );
3384 
3385 NTSYSAPI
3386 VOID
3387 NTAPI
3388 RtlSetBits(
3389  _In_ PRTL_BITMAP BitMapHeader,
3390  _In_range_(0, BitMapHeader->SizeOfBitMap - NumberToSet) ULONG StartingIndex,
3391  _In_range_(0, BitMapHeader->SizeOfBitMap - StartingIndex) ULONG NumberToSet
3392 );
3393 
3394 NTSYSAPI
3395 VOID
3396 NTAPI
3398  _In_ PRTL_BITMAP BitMapHeader
3399 );
3400 
3402 NTSYSAPI
3403 BOOLEAN
3404 NTAPI
3405 RtlTestBit(
3406  _In_ PRTL_BITMAP BitMapHeader,
3407  _In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitNumber
3408 );
3409 
3410 #if defined(_M_AMD64)
3413 BOOLEAN
3414 RtlCheckBit(
3415  _In_ PRTL_BITMAP BitMapHeader,
3416  _In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitPosition)
3417 {
3418  return BitTest64((LONG64 CONST*)BitMapHeader->Buffer, (LONG64)BitPosition);
3419 }
3420 #else
3421 #define RtlCheckBit(BMH,BP) (((((PLONG)(BMH)->Buffer)[(BP)/32]) >> ((BP)%32)) & 0x1)
3422 #endif /* defined(_M_AMD64) */
3423 
3424 //
3425 // Timer Functions
3426 //
3427 NTSYSAPI
3428 NTSTATUS
3429 NTAPI
3431  _In_ HANDLE TimerQueue,
3432  _In_ PHANDLE phNewTimer,
3435  _In_ ULONG DueTime,
3436  _In_ ULONG Period,
3437  _In_ ULONG Flags
3438 );
3439 
3440 NTSYSAPI
3441 NTSTATUS
3442 NTAPI
3443 RtlCreateTimerQueue(PHANDLE TimerQueue);
3444 
3445 NTSYSAPI
3446 NTSTATUS
3447 NTAPI
3449  _In_ HANDLE TimerQueue,
3450  _In_ HANDLE Timer,
3451  _In_ HANDLE CompletionEvent
3452 );
3453 
3454 NTSYSAPI
3455 NTSTATUS
3456 NTAPI
3458  _In_ HANDLE TimerQueue,
3459  _In_ HANDLE Timer,
3460  _In_ ULONG DueTime,
3461  _In_ ULONG Period
3462 );
3463 
3464 NTSYSAPI
3465 NTSTATUS
3466 NTAPI
3468  _In_ HANDLE TimerQueue,
3469  _In_opt_ HANDLE CompletionEvent
3470 );
3471 
3472 NTSYSAPI
3473 NTSTATUS
3474 NTAPI
3475 RtlDeleteTimerQueue(HANDLE TimerQueue);
3476 
3477 //
3478 // SList functions
3479 //
3481 FASTCALL
3483  _Inout_ PSLIST_HEADER ListHead,
3486  _In_ ULONG Count
3487 );
3488 
3489 //
3490 // Range List functions
3491 //
3492 NTSYSAPI
3493 VOID
3494 NTAPI
3496  _Inout_ PRTL_RANGE_LIST RangeList
3497 );
3498 
3499 NTSYSAPI
3500 VOID
3501 NTAPI
3503  _In_ PRTL_RANGE_LIST RangeList
3504 );
3505 
3506 NTSYSAPI
3507 NTSTATUS
3508 NTAPI
3509 RtlAddRange(
3510  _Inout_ PRTL_RANGE_LIST RangeList,
3512  _In_ ULONGLONG End,
3513  _In_ UCHAR Attributes,
3514  _In_ ULONG Flags,
3516  _In_opt_ PVOID Owner
3517 );
3518 
3519 //
3520 // Debug Functions
3521 //
3522 ULONG
3523 __cdecl
3524 DbgPrint(
3526  ...
3527 );
3528 
3529 NTSYSAPI
3530 ULONG
3531 __cdecl
3532 DbgPrintEx(
3534  _In_ ULONG Level,
3536  ...
3537 );
3538 
3539 NTSYSAPI
3540 ULONG
3541 NTAPI
3542 DbgPrompt(
3543  _In_z_ PCCH Prompt,
3546 );
3547 
3548 #undef DbgBreakPoint
3549 VOID
3550 NTAPI
3552  VOID
3553 );
3554 
3555 VOID
3556 NTAPI
3558  _In_ PSTRING Name,
3559  _In_ PVOID Base,
3560  _In_ ULONG_PTR ProcessId
3561 );
3562 
3563 VOID
3564 NTAPI
3566  _In_ PSTRING Name,
3567  _In_ PVOID Base,
3568  _In_ ULONG_PTR ProcessId
3569 );
3570 
3571 VOID
3572 NTAPI
3574  _In_ PCCH Name,
3575  _In_ PCCH Command
3576 );
3577 
3578 //
3579 // Generic Table Functions
3580 //
3581 #if defined(NTOS_MODE_USER) || defined(_NTIFS_)
3582 NTSYSAPI
3583 PVOID
3584 NTAPI
3586  _In_ PRTL_GENERIC_TABLE Table,
3587  _In_reads_bytes_(BufferSize) PVOID Buffer,
3588  _In_ CLONG BufferSize,
3589  _Out_opt_ PBOOLEAN NewElement
3590 );
3591 
3592 NTSYSAPI
3593 PVOID
3594 NTAPI
3596  _In_ PRTL_GENERIC_TABLE Table,
3597  _In_reads_bytes_(BufferSize) PVOID Buffer,
3598  _In_ CLONG BufferSize,
3599  _Out_opt_ PBOOLEAN NewElement,
3600  _In_ PVOID NodeOrParent,
3601  _In_ TABLE_SEARCH_RESULT SearchResult
3602 );
3603 
3604 NTSYSAPI
3605 BOOLEAN
3606 NTAPI
3608  _In_ PRTL_GENERIC_TABLE Table
3609 );
3610 
3611 NTSYSAPI
3612 PVOID
3613 NTAPI
3615  _In_ PRTL_GENERIC_TABLE Table,
3616  _In_ PVOID Buffer,
3617  _Out_ PVOID *NodeOrParent,
3618  _Out_ TABLE_SEARCH_RESULT *SearchResult
3619 );
3620 #endif
3621 
3622 //
3623 // Handle Table Functions
3624 //
3625 NTSYSAPI
3627 NTAPI
3631 );
3632 
3633 NTSYSAPI
3634 VOID
3635 NTAPI
3638 
3639 NTSYSAPI
3640 BOOLEAN
3641 NTAPI
3645 );
3646 
3647 NTSYSAPI
3648 VOID
3649 NTAPI
3651  _In_ ULONG TableSize,
3652  _In_ ULONG HandleSize,
3654 );
3655 
3656 NTSYSAPI
3657 BOOLEAN
3658 NTAPI
3662 );
3663 
3664 _Success_(return!=FALSE)
3665 NTSYSAPI
3666 BOOLEAN
3667 NTAPI
3672 );
3673 
3674 //
3675 // PE Functions
3676 //
3677 NTSYSAPI
3678 NTSTATUS
3679 NTAPI
3681  _In_ PVOID BaseAddress,
3682  _In_ ULONG Type,
3683  _In_ ULONG Language,
3684  _In_ ULONG MessageId,
3685  _Out_ PMESSAGE_RESOURCE_ENTRY *MessageResourceEntry
3686 );
3687 
3688 NTSYSAPI
3689 ULONG
3690 NTAPI
3691 RtlGetNtGlobalFlags(VOID);
3692 
3693 _Success_(return!=NULL)
3694 NTSYSAPI
3695 PVOID
3696 NTAPI
3698  _In_ PVOID BaseAddress,
3701  _Out_ PULONG Size
3702 );
3703 
3704 NTSYSAPI
3705 PVOID
3706 NTAPI
3708  _In_ PIMAGE_NT_HEADERS NtHeader,
3709  _In_ PVOID BaseAddress,
3710  _In_ ULONG Rva,
3711  _Inout_opt_ PIMAGE_SECTION_HEADER *SectionHeader
3712 );
3713 
3714 NTSYSAPI
3716 NTAPI
3718  _In_ PVOID BaseAddress);
3719 
3720 NTSYSAPI
3721 NTSTATUS
3722 NTAPI
3724  _In_ ULONG Flags,
3725  _In_ PVOID BaseAddress,
3726  _In_ ULONGLONG Size,
3727  _Out_ PIMAGE_NT_HEADERS *NtHeader
3728 );
3729 
3730 NTSYSAPI
3732 NTAPI
3734  _In_ PIMAGE_NT_HEADERS NtHeader,
3735  _In_ PVOID BaseAddress,
3736  _In_ ULONG Rva
3737 );
3738 
3739 NTSYSAPI
3740 ULONG
3741 NTAPI
3743  _In_ PVOID NewAddress,
3744  _In_ LONGLONG AdditionalBias,
3745  _In_ PCCH LoaderName,
3746  _In_ ULONG Success,
3747  _In_ ULONG Conflict,
3748  _In_ ULONG Invalid
3749 );
3750 
3751 //
3752 // Activation Context Functions
3753 //
3754 #ifdef NTOS_MODE_USER
3755 NTSYSAPI
3756 NTSTATUS
3757 NTAPI
3759  _In_ ULONG Flags,
3760  _In_ PTEB Teb,
3761  _In_ PVOID Context,
3763 );
3764 
3765 NTSYSAPI
3766 NTSTATUS
3767 NTAPI
3769  _In_ ULONG Flags,
3770  _In_ HANDLE Handle,
3772 );
3773 
3774 NTSYSAPI
3775 VOID
3776 NTAPI
3779 );
3780 
3781 NTSYSAPI
3783 FASTCALL
3785  _In_ PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED Frame,
3787 );
3788 
3789 NTSYSAPI
3790 NTSTATUS
3791 NTAPI
3794 );
3795 
3796 NTSYSAPI
3797 NTSTATUS
3798 NTAPI
3800  _In_ ULONG Flags,
3801  _In_ PACTIVATION_CONTEXT_DATA ActivationContextData,
3802  _In_ ULONG ExtraBytes,
3803  _In_ PVOID NotificationRoutine,
3806 );
3807 
3808 NTSYSAPI
3809 NTSTATUS
3810 NTAPI
3812  _In_ PVOID *Context
3813 );
3814 
3815 NTSYSAPI
3816 VOID
3817 NTAPI
3819  _In_ HANDLE handle
3820 );
3821 
3822 NTSYSAPI
3823 NTSTATUS
3824 NTAPI
3826  _In_ ULONG dwFlags,
3827  _In_ ULONG_PTR ulCookie
3828 );
3829 
3830 NTSYSAPI
3831 VOID
3832 NTAPI
3835 );
3836 
3837 NTSYSAPI
3838 VOID
3839 NTAPI
3841 
3842 NTSYSAPI
3844 FASTCALL
3846  _In_ PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED Frame
3847 );
3848 
3849 NTSYSAPI
3850 NTSTATUS
3851 NTAPI
3853  _In_ ULONG Flags,
3854  _In_ PUNICODE_STRING OriginalName,
3859  _In_ PULONG NewFlags,
3860  _In_ PSIZE_T FileNameSize,
3862 );
3863 
3864 NTSYSAPI
3865 NTSTATUS
3866 NTAPI
3868  _In_ ULONG dwFlags,
3869  _In_ const GUID *ExtensionGuid,
3870  _In_ ULONG SectionType,
3871  _In_ const UNICODE_STRING *SectionName,
3872  _Inout_ PVOID ReturnedData
3873 );
3874 
3875 NTSYSAPI
3876 NTSTATUS
3877 NTAPI
3879  _In_ DWORD dwFlags,
3881  _In_opt_ PVOID pvSubInstance,
3882  _In_ ULONG ulInfoClass,
3883  _Out_bytecap_(cbBuffer) PVOID pvBuffer,
3885  _Out_opt_ SIZE_T *pcbWrittenOrRequired
3886 );
3887 
3888 NTSYSAPI
3889 NTSTATUS
3890 NTAPI
3892  _In_ ULONG ulInfoClass,
3893  _Out_bytecap_(cbBuffer) PVOID pvBuffer,
3895  _Out_opt_ SIZE_T *pcbWrittenOrRequired
3896 );
3897 
3898 NTSYSAPI
3899 NTSTATUS
3900 NTAPI
3902  PVOID Context
3903 );
3904 
3905 //
3906 // WOW64 Functions
3907 //
3908 NTSYSAPI
3909 NTSTATUS
3910 NTAPI
3912  _In_ BOOLEAN Wow64FsEnableRedirection
3913 );
3914 
3915 NTSYSAPI
3916 NTSTATUS
3917 NTAPI
3919  _In_ PVOID Wow64FsEnableRedirection,
3920  _Out_ PVOID *OldFsRedirectionLevel
3921 );
3922 
3923 #endif
3924 
3925 //
3926 // Registry Functions
3927 //
3930 NTSYSAPI
3931 NTSTATUS
3932 NTAPI
3934  _In_ ULONG RelativeTo,
3935  _In_ PWSTR Path
3936 );
3937 
3938 NTSYSAPI
3939 NTSTATUS
3940 NTAPI
3942  _In_ ULONG RelativeTo,
3943  _In_ PWSTR Path
3944 );
3945 
3946 NTSYSAPI
3947 NTSTATUS
3948 NTAPI
3950  _Out_ _At_(KeyPath->Buffer, __drv_allocatesMem(Mem) _Post_bytecap_(KeyPath->MaximumLength) _Post_bytecount_(KeyPath->Length))
3951  PUNICODE_STRING KeyPath
3952 );
3953 
3954 NTSYSAPI
3955 NTSTATUS
3956 NTAPI
3958  _In_ ACCESS_MASK DesiredAccess,
3960 );
3961 
3963 NTSYSAPI
3964 NTSTATUS
3965 NTAPI
3967  _In_ ULONG RelativeTo,
3968  _In_ PCWSTR Path,
3971  _In_opt_ PVOID Context,
3972  _In_opt_ PVOID Environment
3973 );
3974 
3976 NTSYSAPI
3977 NTSTATUS
3978 NTAPI
3980  _In_ ULONG RelativeTo,
3981  _In_ PCWSTR Path,
3986 );
3987 
3988 #ifdef NTOS_MODE_USER
3989 NTSYSAPI
3990 NTSTATUS
3991 NTAPI
3993  _Out_ HANDLE KeyHandle,
3994  _In_ ACCESS_MASK DesiredAccess,
3999 );
4000 
4001 NTSYSAPI
4002 NTSTATUS
4003 NTAPI
4005  _In_ HANDLE KeyHandle,
4007  _In_ ULONG Index,
4008  _In_ ULONG Unused
4009 );
4010 
4011 NTSYSAPI
4012 NTSTATUS
4013 NTAPI
4015  _In_ HANDLE KeyHandle
4016 );
4017 
4018 NTSYSAPI
4019 NTSTATUS
4020 NTAPI
4022  _Out_ HANDLE KeyHandle,
4023  _In_ ACCESS_MASK DesiredAccess,
4025  _In_ ULONG Unused
4026 );
4027 
4028 NTSYSAPI
4029 NTSTATUS
4030 NTAPI
4032  _In_ HANDLE KeyHandle,
4033  _Out_opt_ PULONG Type,
4036  _In_ ULONG Unused
4037 );
4038 
4039 NTSYSAPI
4040 NTSTATUS
4041 NTAPI
4043  _In_ HANDLE KeyHandle,
4044  _In_ ULONG Type,
4045  _In_ PVOID Data,
4047 );
4048 #endif
4049 
4050 //
4051 // NLS Functions
4052 //
4053 NTSYSAPI
4054 VOID
4055 NTAPI
4059 );
4060 
4061 NTSYSAPI
4062 VOID
4063 NTAPI
4065  _In_ PUSHORT AnsiTableBase,
4066  _In_ PUSHORT OemTableBase,
4067  _In_ PUSHORT CaseTableBase,
4068  _Out_ PNLSTABLEINFO NlsTable
4069 );
4070 
4072 NTSYSAPI
4073 VOID
4074 NTAPI
4076  _In_ PUSHORT TableBase,
4078 );
4079 
4080 NTSYSAPI
4081 VOID
4082 NTAPI
4084  _In_ PNLSTABLEINFO NlsTable);
4085 
4086 #if defined(NTOS_MODE_USER) && !defined(NO_RTL_INLINES)
4087 
4088 //
4089 // Misc conversion functions
4090 //
4091 static __inline
4095  _In_ LONG SignedInteger
4096 )
4097 {
4099 
4100  Result.QuadPart = SignedInteger;
4101  return Result;
4102 }
4103 
4104 static __inline
4108  _In_ LONG Multiplicand,
4109  _In_ LONG Multiplier
4110 )
4111 {
4112  LARGE_INTEGER Product;
4113 
4114  Product.QuadPart = (LONGLONG)Multiplicand * (ULONGLONG)Multiplier;
4115  return Product;
4116 }
4117 
4118 static __inline
4119 ULONG
4122  _In_ ULARGE_INTEGER Dividend,
4123  _In_ ULONG Divisor,
4125 )
4126 {
4127  ULONG Quotient;
4128 
4129  Quotient = (ULONG)(Dividend.QuadPart / Divisor);
4130  if (Remainder) {
4131  *Remainder = (ULONG)(Dividend.QuadPart % Divisor);
4132  }
4133 
4134  return Quotient;
4135 }
4136 
4137 static __inline
4141  _In_ ULONG Multiplicand,
4142  _In_ ULONG Multiplier
4143 )
4144 {
4145  LARGE_INTEGER Product;
4146 
4147  Product.QuadPart = (ULONGLONG)Multiplicand * (ULONGLONG)Multiplier;
4148  return Product;
4149 }
4150 
4151 #if defined(_AMD64_) || defined(_IA64_)
4152 static __inline
4156  _In_ LARGE_INTEGER Dividend,
4157  _In_ ULONG Divisor,
4158  _Out_opt_ PULONG Remainder)
4159 {
4161  ret.QuadPart = (ULONG64)Dividend.QuadPart / Divisor;
4162  if (Remainder)
4163  *Remainder = (ULONG)(Dividend.QuadPart % Divisor);
4164  return ret;
4165 }
4166 
4167 #else
4168 NTSYSAPI
4170 NTAPI
4172  _In_ LARGE_INTEGER Dividend,
4173  _In_ ULONG Divisor,
4174  _Out_opt_ PULONG Remainder
4175 );
4176 
4177 #endif /* defined(_AMD64_) || defined(_IA64_) */
4178 
4179 #endif
4180 
4181 
4182 NTSYSAPI
4183 ULONG
4184 NTAPI
4185 RtlUniform(
4186  _In_ PULONG Seed
4187 );
4188 
4189 NTSYSAPI
4190 ULONG
4191 NTAPI
4192 RtlRandom(
4193  _Inout_ PULONG Seed
4194 );
4195 
4196 NTSYSAPI
4197 ULONG
4198 NTAPI
4200  _In_ ULONG InitialCrc,
4201  _In_ PUCHAR Buffer,
4202  _In_ ULONG Length
4203 );
4204 
4205 //
4206 // Network Functions
4207 //
4208 NTSYSAPI
4209 PSTR
4210 NTAPI
4212  _In_ const struct in_addr *Addr,
4213  _Out_writes_(16) PCHAR S
4214 );
4215 
4216 NTSYSAPI
4217 PWSTR
4218 NTAPI
4220  _In_ const struct in_addr *Addr,
4221  _Out_writes_(16) PWCHAR S
4222 );
4223 
4224 NTSYSAPI
4225 NTSTATUS
4226 NTAPI
4228  _In_ const struct in_addr *Address,
4229  _In_ USHORT Port,
4230  _Out_writes_to_(*AddressStringLength, *AddressStringLength) PCHAR AddressString,
4231  _Inout_ PULONG AddressStringLength
4232 );
4233 
4234 NTSTATUS
4235 NTAPI
4237  _In_ const struct in_addr *Address,
4238  _In_ USHORT Port,
4239  _Out_writes_to_(*AddressStringLength, *AddressStringLength) PWCHAR AddressString,
4240  _Inout_ PULONG AddressStringLength
4241 );
4242 
4243 NTSYSAPI
4244 NTSTATUS
4245 NTAPI
4247  _In_ PCSTR String,
4248  _In_ BOOLEAN Strict,
4249  _Out_ PCSTR *Terminator,
4250  _Out_ struct in_addr *Addr
4251 );
4252 
4253 NTSYSAPI
4254 NTSTATUS
4255 NTAPI
4257  _In_ PCWSTR String,
4258  _In_ BOOLEAN Strict,
4259  _Out_ PCWSTR *Terminator,
4260  _Out_ struct in_addr *Addr
4261 );
4262 
4263 NTSYSAPI
4264 NTSTATUS
4265 NTAPI
4267  _In_ PCSTR AddressString,
4268  _In_ BOOLEAN Strict,
4269  _Out_ struct in_addr *Address,
4270  _Out_ PUSHORT Port
4271 );
4272 
4273 NTSYSAPI
4274 NTSTATUS
4275 NTAPI
4277  _In_ PCWSTR AddressString,
4278  _In_ BOOLEAN Strict,
4279  _Out_ struct in_addr *Address,
4280  _Out_ PUSHORT Port
4281 );
4282 
4283 NTSYSAPI
4284 PSTR
4285 NTAPI
4287  _In_ const struct in6_addr *Addr,
4288  _Out_writes_(46) PSTR S
4289 );
4290 
4291 NTSYSAPI
4292 PWSTR
4293 NTAPI
4295  _In_ const struct in6_addr *Addr,
4296  _Out_writes_(46) PWSTR S
4297 );
4298 
4299 NTSYSAPI
4300 NTSTATUS
4301 NTAPI
4303  _In_ const struct in6_addr *Address,
4304  _In_ ULONG ScopeId,
4305  _In_ USHORT Port,
4306  _Out_writes_to_(*AddressStringLength, *AddressStringLength) PSTR AddressString,
4307  _Inout_ PULONG AddressStringLength
4308 );
4309 
4310 NTSYSAPI
4311 NTSTATUS
4312 NTAPI
4314  _In_ const struct in6_addr *Address,
4315  _In_ ULONG ScopeId,
4316  _In_ USHORT Port,
4317  _Out_writes_to_(*AddressStringLength, *AddressStringLength) PWCHAR AddressString,
4318  _Inout_ PULONG AddressStringLength
4319 );
4320 
4321 NTSYSAPI
4322 NTSTATUS
4323 NTAPI
4325  _In_ PCSTR String,
4326  _Out_ PCSTR *Terminator,
4327  _Out_ struct in6_addr *Addr
4328 );
4329 
4330 NTSYSAPI
4331 NTSTATUS
4332 NTAPI
4334  _In_ PCWSTR String,
4335  _Out_ PCWSTR *Terminator,
4336  _Out_ struct in6_addr *Addr
4337 );
4338 
4339 NTSYSAPI
4340 NTSTATUS
4341 NTAPI
4343  _In_ PCSTR AddressString,
4344  _Out_ struct in6_addr *Address,
4345  _Out_ PULONG ScopeId,
4346  _Out_ PUSHORT Port
4347 );
4348 
4349 NTSYSAPI
4350 NTSTATUS
4351 NTAPI
4353  _In_ PCWSTR AddressString,
4354  _Out_ struct in6_addr *Address,
4355  _Out_ PULONG ScopeId,
4356  _Out_ PUSHORT Port
4357 );
4358 
4359 
4360 //
4361 // Time Functions
4362 //
4363 NTSYSAPI
4364 NTSTATUS
4365 NTAPI
4367  _Out_ PRTL_TIME_ZONE_INFORMATION TimeZoneInformation);
4368 
4369 NTSYSAPI
4370 VOID
4371 NTAPI
4373  _In_ ULONG SecondsSince1970,
4375 );
4376 
4377 NTSYSAPI
4378 NTSTATUS
4379 NTAPI
4381  _In_ PRTL_TIME_ZONE_INFORMATION TimeZoneInformation);
4382 
4383 _Success_(return!=FALSE)
4385 NTSYSAPI
4386 BOOLEAN
4387 NTAPI
4391 );
4392 
4393 _Success_(return != 0)
4395 NTSYSAPI
4396 BOOLEAN
4397 NTAPI
4401 );
4402 
4403 NTSYSAPI
4404 VOID
4405 NTAPI
4407  PLARGE_INTEGER Time,
4408  PTIME_FIELDS TimeFields
4409 );
4410 
4411 NTSYSAPI
4412 NTSTATUS
4413 NTAPI
4415  _In_ PLARGE_INTEGER SystemTime,
4416  _Out_ PLARGE_INTEGER LocalTime
4417 );
4418 
4419 //
4420 // Version Functions
4421 //
4424 NTSYSAPI
4425 NTSTATUS
4426 NTAPI
4428  _In_ PRTL_OSVERSIONINFOEXW VersionInfo,
4431 );
4432 
4434 NTSYSAPI
4435 NTSTATUS
4436 NTAPI
4438  _Out_
4439  _At_(lpVersionInformation->dwOSVersionInfoSize, _Pre_ _Valid_)
4440  _When_(lpVersionInformation->dwOSVersionInfoSize == sizeof(RTL_OSVERSIONINFOEXW),
4441  _At_((PRTL_OSVERSIONINFOEXW)lpVersionInformation, _Out_))
4442  PRTL_OSVERSIONINFOW lpVersionInformation
4443 );
4444 
4445 NTSYSAPI
4446 BOOLEAN
4447 NTAPI
4449 
4450 //
4451 // Secure Memory Functions
4452 //
4453 #ifdef NTOS_MODE_USER
4454 NTSYSAPI
4455 NTSTATUS
4456 NTAPI
4458  _In_ PRTL_SECURE_MEMORY_CACHE_CALLBACK Callback);
4459 
4460 NTSYSAPI
4461 BOOLEAN
4462 NTAPI
4464  _In_ PVOID MemoryCache,
4465  _In_opt_ SIZE_T MemoryLength
4466 );
4467 #endif
4468 
4469 //
4470 // Boot Status Data Functions
4471 //
4472 #ifdef NTOS_MODE_USER
4473 NTSYSAPI
4474 NTSTATUS
4475 NTAPI
4477  VOID
4478 );
4479 
4480 NTSYSAPI
4481 NTSTATUS
4482 NTAPI
4485  _In_ BOOLEAN WriteMode,
4486  _In_ RTL_BSD_ITEM_TYPE DataClass,
4487  _In_ PVOID Buffer,
4488  _In_ ULONG BufferSize,
4489  _Out_opt_ PULONG ReturnLength
4490 );
4491 
4492 NTSYSAPI
4493 NTSTATUS
4494 NTAPI
4497 );
4498 
4499 NTSYSAPI
4500 NTSTATUS
4501 NTAPI
4504 );
4505 #endif
4506 
4507 #ifdef NTOS_MODE_USER
4509 NTSYSAPI
4510 NTSTATUS
4511 NTAPI
4513  _In_ PUNICODE_STRING GuidString,
4514  _Out_ GUID *Guid);
4515 
4517 NTSYSAPI
4518 NTSTATUS
4519 NTAPI
4521  _In_ REFGUID Guid,
4522  _Out_ _At_(GuidString->Buffer, __drv_allocatesMem(Mem))
4523  PUNICODE_STRING GuidString);
4524 
4525 NTSYSAPI
4526 NTSTATUS
4527 NTAPI
4529  _In_ HANDLE hFile,
4530  _Out_ PCHAR Hash,
4531  _In_ ULONG ImportTableHashRevision
4532 );
4533 #endif
4534 
4535 //
4536 // MemoryStream functions
4537 //
4538 #ifdef NTOS_MODE_USER
4539 
4540 NTSYSAPI
4541 VOID
4542 NTAPI
4544  _Out_ PRTL_MEMORY_STREAM Stream
4545 );
4546 
4547 NTSYSAPI
4548 VOID
4549 NTAPI
4551  _Out_ PRTL_MEMORY_STREAM Stream
4552 );
4553 
4554 NTSYSAPI
4555 VOID
4556 NTAPI
4558  _In_ PRTL_MEMORY_STREAM Stream
4559 );
4560 
4561 NTSYSAPI
4562 HRESULT
4563 NTAPI
4565  _In_ struct IStream *This,
4566  _In_ REFIID RequestedIid,
4567  _Outptr_ PVOID *ResultObject
4568 );
4569 
4570 NTSYSAPI
4571 ULONG
4572 NTAPI
4574  _In_ struct IStream *This
4575 );
4576 
4577 NTSYSAPI
4578 ULONG
4579 NTAPI
4581  _In_ struct IStream *This
4582 );
4583 
4584 NTSYSAPI
4585 HRESULT
4586 NTAPI
4588  _In_ struct IStream *This,
4589  _Out_writes_bytes_(Length) PVOID Buffer,
4590  _In_ ULONG Length,
4592 );
4593 
4594 NTSYSAPI
4595 HRESULT
4596 NTAPI
4598  _In_ struct IStream *This,
4599  _Out_writes_bytes_(Length) PVOID Buffer,
4600  _In_ ULONG Length,
4602 );
4603 
4604 NTSYSAPI
4605 HRESULT
4606 NTAPI
4608  _In_ struct IStream *This,
4609  _In_ LARGE_INTEGER RelativeOffset,
4610  _In_ ULONG Origin,
4611  _Out_opt_ PULARGE_INTEGER ResultOffset
4612 );
4613 
4614 NTSYSAPI
4615 HRESULT
4616 NTAPI
4618  _In_ struct IStream *This,
4619  _In_ struct IStream *Target,
4620  _In_ ULARGE_INTEGER Length,
4623 );
4624 
4625 NTSYSAPI
4626 HRESULT
4627 NTAPI
4628 RtlCopyOutOfProcessMemoryStreamTo(
4629  _In_ struct IStream *This,
4630  _In_ struct IStream *Target,
4631  _In_ ULARGE_INTEGER Length,
4634 );
4635 
4636 NTSYSAPI
4637 HRESULT
4638 NTAPI
4640  _In_ struct IStream *This,
4641  _Out_ struct tagSTATSTG *Stats,
4642  _In_ ULONG Flags
4643 );
4644 
4645 // Dummy functions
4646 NTSYSAPI
4647 HRESULT
4648 NTAPI
4650  _In_ struct IStream *This,
4651  _In_reads_bytes_(Length) CONST VOID *Buffer,
4652  _In_ ULONG Length,
4654 );
4655 
4656 NTSYSAPI
4657 HRESULT
4658 NTAPI
4660  _In_ struct IStream *This,
4662 );
4663 
4664 NTSYSAPI
4665 HRESULT
4666 NTAPI
4668  _In_ struct IStream *This,
4669  _In_ ULONG CommitFlags
4670 );
4671 
4672 NTSYSAPI
4673 HRESULT
4674 NTAPI
4676  _In_ struct IStream *This
4677 );
4678 
4679 NTSYSAPI
4680 HRESULT
4681 NTAPI
4683  _In_ struct IStream *This,
4685  _In_ ULARGE_INTEGER Length,
4686  _In_ ULONG LockType
4687 );
4688 
4689 NTSYSAPI
4690 HRESULT
4691 NTAPI
4693  _In_ struct IStream *This,
4695  _In_ ULARGE_INTEGER Length,
4696  _In_ ULONG LockType
4697 );
4698 
4699 NTSYSAPI
4700 HRESULT
4701 NTAPI
4703  _In_ struct IStream *This,
4704  _Outptr_ struct IStream **ResultStream
4705 );
4706 
4707 #endif // NTOS_MODE_USER
4708 
4709 NTSYSAPI
4710 NTSTATUS
4711 NTAPI
4713  ULONG flags,
4714  const GUID *extguid,
4715  ULONG section_kind,
4716  const GUID *guid,
4717  void *ptr
4718 );
4719 
4720 #ifdef __cplusplus
4721 }
4722 #endif
4723 
4724 #endif
NTSYSAPI VOID NTAPI RtlConvertExclusiveToShared(_In_ PRTL_RESOURCE Resource)
DWORD *typedef PVOID
Definition: winlogon.h:52
NTSYSAPI NTSTATUS NTAPI RtlCreateTimer(_In_ HANDLE TimerQueue, _In_ PHANDLE phNewTimer, _In_ WAITORTIMERCALLBACKFUNC Callback, _In_ PVOID Parameter, _In_ ULONG DueTime, _In_ ULONG Period, _In_ ULONG Flags)
_Notnull_ __drv_aliasesMem PWSTR Buffer
Definition: rtlfuncs.h:2978
NTSYSAPI PRTL_SPLAY_LINKS NTAPI RtlSplay(_Inout_ PRTL_SPLAY_LINKS Links)
_In_ PWSTR Path
Definition: rtlfuncs.h:3936
LONG(NTAPI * PVECTORED_EXCEPTION_HANDLER)(PEXCEPTION_POINTERS ExceptionPointers)
Definition: rtltypes.h:481
_When_(Status< 0, _Out_range_(>, 0)) _When_(Status >=0
NTSYSAPI NTSTATUS NTAPI RtlDeregisterWaitEx(_In_ HANDLE hWaitHandle, _In_opt_ HANDLE hCompletionEvent)
__analysis_noreturn NTSYSAPI VOID NTAPI RtlAssert(_In_ PVOID FailedAssertion, _In_ PVOID FileName, _In_ ULONG LineNumber, _In_opt_z_ PSTR Message)
PVOID NTAPI RtlEncodeSystemPointer(IN PVOID Pointer)
Definition: process.c:429
NTSYSAPI ULONG NTAPI RtlRandom(_Inout_ PULONG Seed)
CONST WCHAR * PCWCH
Definition: ntbasedef.h:410
CONST char * PCSZ
Definition: umtypes.h:113
NTSYSAPI ULONG NTAPI RtlFindClearBitsAndSet(_In_ PRTL_BITMAP BitMapHeader, _In_ ULONG NumberToFind, _In_ ULONG HintIndex)
Definition: bitmap.c:645
NTSYSAPI PVOID NTAPI RtlLookupElementGenericTableFull(_In_ PRTL_GENERIC_TABLE Table, _In_ PVOID Buffer, _Out_ PVOID *NodeOrParent, _Out_ TABLE_SEARCH_RESULT *SearchResult)
#define STATUS_SUCCESS
Definition: contextmenu.cpp:55
NTSYSAPI ULONG WINAPI RtlNtStatusToDosErrorNoTeb(NTSTATUS)
static int Hash(const char *)
Definition: reader.c:2247
NTSYSAPI VOID NTAPI RtlUpperString(PSTRING DestinationString, PSTRING SourceString)
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
_Must_inspect_result_ NTSYSAPI PVOID NTAPI RtlEnumerateGenericTableWithoutSplaying(_In_ PRTL_GENERIC_TABLE Table, _Inout_ PVOID *RestartKey)
NTSYSAPI NTSTATUS NTAPI RtlLookupAtomInAtomTable(_In_ PRTL_ATOM_TABLE AtomTable, _In_ PWSTR AtomName, _Out_ PRTL_ATOM Atom)
NTSYSAPI NTSTATUS NTAPI RtlNewSecurityObject(_In_ PSECURITY_DESCRIPTOR ParentDescriptor, _In_ PSECURITY_DESCRIPTOR CreatorDescriptor, _Out_ PSECURITY_DESCRIPTOR *NewDescriptor, _In_ BOOLEAN IsDirectoryObject, _In_ HANDLE Token, _In_ PGENERIC_MAPPING GenericMapping)
RTL_GENERIC_COMPARE_ROUTINE * PRTL_GENERIC_COMPARE_ROUTINE
Definition: rtltypes.h:448
*BytesInOemString PCHAR OemString
Definition: rtlfuncs.h:1561
enum _RTL_PATH_TYPE RTL_PATH_TYPE
NTSYSAPI BOOLEAN NTAPI RtlValidSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor)
Definition: sd.c:1055
_In_ ULONG TypeMask
Definition: rtlfuncs.h:4429
NTSYSAPI ULONG NTAPI RtlNumberOfSetBits(_In_ PRTL_BITMAP BitMapHeader)
Definition: bitmap.c:474
IN CINT OUT PVOID IN ULONG OUT PULONG ReturnLength
Definition: dumpinfo.c:39
CPPORT Port[4]
Definition: headless.c:34
_Must_inspect_result_ typedef _In_ PVOID Unused
Definition: iotypes.h:1128
#define _Pre_unknown_
Definition: no_sal2.h:535
const uint16_t * PCWSTR
Definition: typedefs.h:56
_In_ PCWSTR _Inout_ _At_ QueryTable _Pre_unknown_ PRTL_QUERY_REGISTRY_TABLE QueryTable
Definition: rtlfuncs.h:3969
#define IN
Definition: typedefs.h:39
DECLSPEC_NORETURN NTSYSAPI VOID NTAPI RtlRaiseStatus(_In_ NTSTATUS Status)
#define RTL_STACK_WALKING_MODE_FRAMES_TO_SKIP_SHIFT
Definition: rtlfuncs.h:808
NTSYSAPI NTSTATUS NTAPI RtlSetSaclSecurityDescriptor(_Inout_ PSECURITY_DESCRIPTOR SecurityDescriptor, _In_ BOOLEAN SaclPresent, _In_ PACL Sacl, _In_ BOOLEAN SaclDefaulted)
NTSYSAPI NTSTATUS NTAPI RtlIpv4StringToAddressA(_In_ PCSTR String, _In_ BOOLEAN Strict, _Out_ PCSTR *Terminator, _Out_ struct in_addr *Addr)
Definition: network.c:338
NTSYSAPI VOID NTAPI RtlResetRtlTranslations(_In_ PNLSTABLEINFO NlsTable)
NTSYSAPI VOID NTAPI RtlSetSecurityDescriptorRMControl(_Inout_ PSECURITY_DESCRIPTOR SecurityDescriptor, _In_ PUCHAR RMControl)
RTL_AVL_COMPARE_ROUTINE * PRTL_AVL_COMPARE_ROUTINE
Definition: rtltypes.h:381
static CODEPAGE_ENTRY AnsiCodePage
Definition: nls.c:41
NTSYSAPI NTSTATUS NTAPI RtlCreateProcessParameters(_Out_ PRTL_USER_PROCESS_PARAMETERS *ProcessParameters, _In_ PUNICODE_STRING ImagePathName, _In_opt_ PUNICODE_STRING DllPath, _In_opt_ PUNICODE_STRING CurrentDirectory, _In_opt_ PUNICODE_STRING CommandLine, _In_opt_ PWSTR Environment, _In_opt_ PUNICODE_STRING WindowTitle, _In_opt_ PUNICODE_STRING DesktopInfo, _In_opt_ PUNICODE_STRING ShellInfo, _In_opt_ PUNICODE_STRING RuntimeInfo)
#define _In_opt_z_
Definition: no_sal2.h:221
HRESULT NTAPI RtlUnlockMemoryStreamRegion(_In_ IStream *This, _In_ ULARGE_INTEGER Offset, _In_ ULARGE_INTEGER Length, _In_ ULONG LockType)
Definition: memstream.c:440
#define _Must_inspect_result_
Definition: no_sal2.h:314
_Out_ PLARGE_INTEGER Time
Definition: rtlfuncs.h:4391
_In_opt_ PSID _In_opt_ BOOLEAN OwnerDefaulted
Definition: rtlfuncs.h:1630
_Must_inspect_result_ _In_ PFILE_OBJECT _In_opt_ PLARGE_INTEGER _In_ ULONG _In_ FLT_IO_OPERATION_FLAGS _Out_opt_ PULONG BytesWritten
Definition: fltkernel.h:1293
Definition: rtltypes.h:1731
_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)
#define REFIID
Definition: guiddef.h:113
NTSYSAPI VOID NTAPI RtlDeleteResource(_In_ PRTL_RESOURCE Resource)
_In_ ULONG _Out_writes_bytes_all_(Length) PUCHAR Buffer
Definition: ntddpcm.h:100
RTL_GENERIC_ALLOCATE_ROUTINE * PRTL_GENERIC_ALLOCATE_ROUTINE
Definition: rtltypes.h:457
PVOID ULONG Address
Definition: oprghdlr.h:14
NTSYSAPI VOID NTAPI RtlDeleteNoSplay(_In_ PRTL_SPLAY_LINKS Links, _Inout_ PRTL_SPLAY_LINKS *Root)
VOID(* PIO_APC_ROUTINE)(IN PVOID ApcContext, IN PIO_STATUS_BLOCK IoStatusBlock, IN ULONG Reserved)
Definition: nt_native.h:877
#define _Notnull_
Definition: no_sal2.h:316
unsigned short RTL_ATOM
Definition: atom.c:42
#define _Post_invalid_
Definition: no_sal2.h:457
static ACCESS_MASK const OBJECT_ATTRIBUTES ULONG TitleIndex
Definition: reg.c:130
NTSYSAPI ULONG NTAPI RtlWalkFrameChain(_Out_writes_(Count-(Flags >> RTL_STACK_WALKING_MODE_FRAMES_TO_SKIP_SHIFT)) PVOID *Callers, _In_ ULONG Count, _In_ ULONG Flags)
_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)
NTSYSAPI NTSTATUS NTAPI RtlGetControlSecurityDescriptor(_In_ PSECURITY_DESCRIPTOR SecurityDescriptor, _Out_ PSECURITY_DESCRIPTOR_CONTROL Control, _Out_ PULONG Revision)
void Fill(HDC hdc, LONG x, LONG y, COLORREF color)
Definition: drawing.cpp:109
NTSYSAPI VOID NTAPI RtlConvertSharedToExclusive(_In_ PRTL_RESOURCE Resource)
WORD * PSECURITY_DESCRIPTOR_CONTROL
Definition: lsa.idl:37
NTSYSAPI NTSTATUS NTAPI RtlSetGroupSecurityDescriptor(IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor, IN PSID Group, IN BOOLEAN GroupDefaulted)
Definition: sd.c:410
NTSYSAPI VOID NTAPI RtlSetBit(_In_ PRTL_BITMAP BitMapHeader, _In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitNumber)
Definition: bitmap.c:304
NTSTATUS NTAPI RtlGetVersion(IN OUT PRTL_OSVERSIONINFOW lpVersionInformation)
Definition: version.c:158
_In_ ULONG_PTR _In_count_(cFiles) PVOID *ppvView
Definition: winddi.h:3721
NTSYSAPI NTSTATUS NTAPI RtlCreateSecurityDescriptorRelative(_Out_ PISECURITY_DESCRIPTOR_RELATIVE SecurityDescriptor, _In_ ULONG Revision)
NTSYSAPI LONG NTAPI RtlCompareString(PSTRING String1, PSTRING String2, BOOLEAN CaseInSensitive)
Type
Definition: Type.h:6
enum _ACL_INFORMATION_CLASS ACL_INFORMATION_CLASS
NTSTATUS NTAPI RtlSetThreadPoolStartFunc(_In_ PRTL_START_POOL_THREAD StartPoolThread, _In_ PRTL_EXIT_POOL_THREAD ExitPoolThread)
VOID NTAPI RtlInitOutOfProcessMemoryStream(_Out_ PRTL_MEMORY_STREAM Stream)
Definition: memstream.c:84
_Inout_opt_ POEM_STRING _Out_opt_ PBOOLEAN NameContainsSpaces
Definition: rtlfuncs.h:2961
_Success_(return!=FALSE) NTSYSAPI BOOLEAN NTAPI RtlIsValidIndexHandle(_In_ PRTL_HANDLE_TABLE HandleTable
Definition: mapping.c:279
NTSYSAPI PWSTR NTAPI RtlIpv4AddressToStringW(_In_ const struct in_addr *Addr, _Out_writes_(16) PWCHAR S)
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ PNDIS_STRING SubKeyName
Definition: ndis.h:4704
NTSYSAPI PVOID WINAPI RtlAddVectoredExceptionHandler(ULONG, PVECTORED_EXCEPTION_HANDLER)
_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:1595
struct _Entry Entry
Definition: kefuncs.h:640
Definition: scsiwmi.h:51
#define __cdecl
Definition: accygwin.h:78
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
NTSYSAPI void WINAPI RtlAddRefActivationContext(HANDLE)
Definition: actctx.c:4878
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
Definition: ndis.h:4692
NTSYSAPI PSTR NTAPI RtlIpv4AddressToStringA(_In_ const struct in_addr *Addr, _Out_writes_(16) PCHAR S)
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY ListEnd
Definition: exfuncs.h:1015
Definition: ntbasedef.h:627
static __inline ULONG NTAPI_INLINE RtlEnlargedUnsignedDivide(_In_ ULARGE_INTEGER Dividend, _In_ ULONG Divisor, _Out_opt_ PULONG Remainder)
Definition: rtlfuncs.h:2891
DECLSPEC_HOTPATCH PVOID NTAPI RtlAddVectoredContinueHandler(IN ULONG FirstHandler, IN PVECTORED_EXCEPTION_HANDLER VectoredHandler)
Definition: vectoreh.c:311
ULONG(NTAPI * PTHREAD_START_ROUTINE)(PVOID Parameter)
Definition: rtltypes.h:542
NTSYSAPI VOID NTAPI RtlDestroyHandleTable(_Inout_ PRTL_HANDLE_TABLE HandleTable)
NTSTATUS NTAPI RtlUsageHeap(IN HANDLE Heap, IN ULONG Flags, OUT PRTL_HEAP_USAGE Usage)
Definition: heap.c:3831
NTSYSAPI NTSTATUS WINAPI RtlCheckRegistryKey(ULONG, PWSTR)
#define _Out_writes_bytes_to_opt_(size, count)
Definition: no_sal2.h:375
NTSYSAPI ULONG NTAPI RtlNumberGenericTableElements(_In_ PRTL_GENERIC_TABLE Table)
return ret
Definition: rtlfuncs.h:3092
NTSYSAPI VOID NTAPI RtlExitUserThread(_In_ NTSTATUS Status)
WCHAR CurrentDirectory[1024]
Definition: chkdsk.c:71
#define RtlCheckBit(BMH, BP)
Definition: rtlfuncs.h:3421
NTSYSAPI NTSTATUS WINAPI RtlMultiByteToUnicodeN(LPWSTR, DWORD, LPDWORD, LPCSTR, DWORD)
* PSID_IDENTIFIER_AUTHORITY
Definition: setypes.h:411
NTSYSAPI ULONG NTAPI DbgPrompt(_In_z_ PCCH Prompt, _Out_writes_bytes_(MaximumResponseLength) PCH Response, _In_ ULONG MaximumResponseLength)
NTSYSAPI void WINAPI RtlReleaseActivationContext(HANDLE)
Definition: actctx.c:4889
BOOLEAN NTAPI RtlTimeToSecondsSince1970(PLARGE_INTEGER Time, PULONG ElapsedSeconds)
NTSYSAPI PSTR NTAPI RtlIpv6AddressToStringA(_In_ const struct in6_addr *Addr, _Out_writes_(46) PSTR S)
NTSYSAPI VOID NTAPI RtlSetAllBits(_In_ PRTL_BITMAP BitMapHeader)
Definition: bitmap.c:283
NTSYSAPI VOID NTAPI RtlInitializeHandleTable(_In_ ULONG TableSize, _In_ ULONG HandleSize, _In_ PRTL_HANDLE_TABLE HandleTable)
_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
__wchar_t WCHAR
Definition: xmlstorage.h:180
_In_opt_ PVOID _In_opt_ SIZE_T _In_opt_ SIZE_T _In_opt_ PVOID Lock
Definition: rtlfuncs.h:2169
_In_ LARGE_INTEGER DueTime
Definition: kefuncs.h:524
_Must_inspect_result_ NTSYSAPI PRTL_SPLAY_LINKS NTAPI RtlSubtreeSuccessor(_In_ PRTL_SPLAY_LINKS Links)
NTSYSAPI ULONG NTAPI RtlFindClearBits(_In_ PRTL_BITMAP BitMapHeader, _In_ ULONG NumberToFind, _In_ ULONG HintIndex)
Definition: bitmap.c:509
HRESULT NTAPI RtlCopyMemoryStreamTo(_In_ IStream *This, _In_ IStream *Target, _In_ ULARGE_INTEGER Length, _Out_opt_ PULARGE_INTEGER BytesRead, _Out_opt_ PULARGE_INTEGER BytesWritten)
Definition: memstream.c:277
NTSYSAPI VOID NTAPI RtlDestroyEnvironment(_In_ PWSTR Environment)
NTSYSAPI VOID NTAPI RtlSecondsSince1970ToTime(_In_ ULONG SecondsSince1970, _Out_ PLARGE_INTEGER Time)
struct _LIST_ENTRY * Blink
Definition: typedefs.h:121
FORCEINLINE VOID InsertHeadList(_Inout_ PLIST_ENTRY ListHead, _Inout_ __drv_aliasesMem PLIST_ENTRY Entry)
Definition: rtlfuncs.h:201
NTSYSAPI NTSTATUS WINAPI RtlInitAnsiStringEx(PANSI_STRING, PCSZ)
#define _Ret_opt_z_
Definition: no_sal2.h:608
NTSYSAPI BOOLEAN NTAPI RtlAcquireResourceShared(_In_ PRTL_RESOURCE Resource, _In_ BOOLEAN Wait)
NTSYSAPI BOOLEAN NTAPI RtlDeleteElementGenericTableAvl(_In_ PRTL_AVL_TABLE Table, _In_ PVOID Buffer)
const char * PCSTR
Definition: typedefs.h:52
_Must_inspect_result_ _In_ USAGE _In_ USHORT _In_ USAGE Usage
Definition: hidpi.h:382
_In_ BOOLEAN _In_ ULONG HashAlgorithm
Definition: rtlfuncs.h:2039
NTSYSAPI PVOID NTAPI RtlFreeSid(_In_ _Post_invalid_ PSID Sid)
IN OUT PIRP IN ULONG IN WMIENABLEDISABLECONTROL Function
Definition: wmilib.h:37
_In_opt_ PSECURITY_DESCRIPTOR _Out_ PSECURITY_DESCRIPTOR _In_ BOOLEAN IsDirectoryObject
Definition: sefuncs.h:29
_In_ PCWSTR _Inout_ _At_ QueryTable _Pre_unknown_ PRTL_QUERY_REGISTRY_TABLE _In_opt_ PVOID _In_opt_ PVOID Environment
Definition: rtlfuncs.h:3969
_In_opt_ PSID Group
Definition: rtlfuncs.h:1606
NTSTATUS NTAPI RtlRegisterSecureMemoryCacheCallback(IN PRTL_SECURE_MEMORY_CACHE_CALLBACK Callback)
Definition: security.c:819
unsigned char * PUCHAR
Definition: retypes.h:3
NTSYSAPI NTSTATUS WINAPI RtlSetHeapInformation(HANDLE, HEAP_INFORMATION_CLASS, PVOID, SIZE_T)
char CHAR
Definition: xmlstorage.h:175
FORCEINLINE PLIST_ENTRY RemoveTailList(_Inout_ PLIST_ENTRY ListHead)
Definition: rtlfuncs.h:154
_In_ PCWSTR _In_z_ PCWSTR _In_ ULONG ValueType
Definition: rtlfuncs.h:3981
NTSYSAPI NTSTATUS NTAPI RtlIpv4StringToAddressExW(_In_ PCWSTR AddressString, _In_ BOOLEAN Strict, _Out_ struct in_addr *Address, _Out_ PUSHORT Port)
Definition: network.c:450
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
NTSYSAPI NTSTATUS NTAPI RtlAddAtomToAtomTable(_In_ PRTL_ATOM_TABLE AtomTable, _In_ PWSTR AtomName, _Out_ PRTL_ATOM Atom)
NTSYSAPI NTSTATUS NTAPI RtlIntegerToUnicode(_In_ ULONG Value, _In_opt_ ULONG Base, _In_opt_ ULONG Length, _Inout_ LPWSTR String)
enum _TABLE_SEARCH_RESULT TABLE_SEARCH_RESULT
VOID NTAPI RtlReleaseRelativeName(_In_ PRTL_RELATIVE_NAME_U RelativeName)
NTSYSAPI NTSTATUS NTAPI RtlCopySidAndAttributesArray(_In_ ULONG Count, _In_ PSID_AND_ATTRIBUTES Src, _In_ ULONG SidAreaSize, _In_ PSID_AND_ATTRIBUTES Dest, _In_ PSID SidArea, _Out_ PSID *RemainingSidArea, _Out_ PULONG RemainingSidAreaSize)
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)
_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:603
NTSYSAPI NTSTATUS NTAPI RtlDeregisterWait(_In_ HANDLE hWaitHandle)
_IRQL_requires_same_ _In_ PLSA_STRING _In_ SECURITY_LOGON_TYPE _In_ ULONG _In_ ULONG _In_opt_ PTOKEN_GROUPS _In_ PTOKEN_SOURCE _Out_ PVOID _Out_ PULONG _Inout_ PLUID _Out_ PHANDLE Token
_In_opt_ ULONG Base
Definition: rtlfuncs.h:2327
NTSYSAPI NTSTATUS NTAPI RtlQueueWorkItem(_In_ WORKERCALLBACKFUNC Function, _In_opt_ PVOID Context, _In_ ULONG Flags)
VOID NTAPI RtlFreeOemString(POEM_STRING OemString)
NTSYSAPI BOOLEAN WINAPI RtlLockHeap(HANDLE)
NTSYSAPI VOID NTAPI RtlEraseUnicodeString(_Inout_ PUNICODE_STRING String)
#define _Post_bytecap_(size)
Definition: no_sal2.h:447
#define _Outptr_
Definition: no_sal2.h:396
PVOID *typedef PWSTR
Definition: winlogon.h:57
NTSYSAPI NTSTATUS NTAPI RtlDestroyProcessParameters(_In_ PRTL_USER_PROCESS_PARAMETERS ProcessParameters)
_In_ BOOLEAN _In_ ULONG _Out_ PULONG HashValue
Definition: rtlfuncs.h:2039
NTSYSAPI PVOID NTAPI RtlLookupElementGenericTableFullAvl(_In_ PRTL_AVL_TABLE Table, _In_ PVOID Buffer, _Out_ PVOID *NodeOrParent, _Out_ TABLE_SEARCH_RESULT *SearchResult)
NTSYSAPI ULONG __cdecl DbgPrintEx(_In_ ULONG ComponentId, _In_ ULONG Level, _In_z_ _Printf_format_string_ PCSTR Format,...)
PWSTR NTAPI RtlQueryTagHeap(IN PVOID HeapHandle, IN ULONG Flags, IN USHORT TagIndex, IN BOOLEAN ResetCounters, OUT PRTL_HEAP_TAG_INFO HeapTagInfo)
Definition: heap.c:3842
NTSYSAPI VOID NTAPI RtlUnwind(_In_opt_ PVOID TargetFrame, _In_opt_ PVOID TargetIp, _In_opt_ PEXCEPTION_RECORD ExceptionRecord, _In_ PVOID ReturnValue)
Definition: except.c:47
NTSYSAPI NTSTATUS NTAPI RtlEnterCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
#define _Const_
Definition: no_sal2.h:18
static EMS_HANDLE HandleTable[EMS_MAX_HANDLES]
Definition: emsdrv.c:40
NTSYSAPI NTSTATUS NTAPI RtlFindMessage(_In_ PVOID BaseAddress, _In_ ULONG Type, _In_ ULONG Language, _In_ ULONG MessageId, _Out_ PMESSAGE_RESOURCE_ENTRY *MessageResourceEntry)
_In_ LARGE_INTEGER _In_ ULONG Period
Definition: kefuncs.h:1268
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)
NTSYSAPI NTSTATUS NTAPI RtlWow64EnableFsRedirection(IN BOOLEAN Wow64FsEnableRedirection)
Definition: libsupp.c:574
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
NTSYSAPI PULONG NTAPI RtlSubAuthoritySid(_In_ PSID Sid, _In_ ULONG SubAuthority)
NTSYSAPI NTSTATUS NTAPI RtlAdjustPrivilege(_In_ ULONG Privilege, _In_ BOOLEAN NewValue, _In_ BOOLEAN ForThread, _Out_ PBOOLEAN OldValue)
NTSYSAPI PVOID WINAPI RtlDecodePointer(PVOID)
PVOID ULONG ULONG PULONG Data
Definition: oprghdlr.h:14
NTSYSAPI NTSTATUS WINAPI RtlOemToUnicodeN(LPWSTR, DWORD, LPDWORD, LPCSTR, DWORD)