ReactOS  0.4.14-dev-815-ge410a12
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(
174 {
175  UnicodeString->Length = 0;
176  UnicodeString->MaximumLength = BufferSize;
177  UnicodeString->Buffer = Buffer;
178 }
179 
181 _At_(AnsiString->Length, _Post_equal_to_(0))
184 VOID
185 RtlInitEmptyAnsiString(
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
287  _Out_opt_ PBOOLEAN NewElement,
288  _In_ PVOID NodeOrParent,
289  _In_ TABLE_SEARCH_RESULT SearchResult
290 );
291 
292 NTSYSAPI
293 BOOLEAN
294 NTAPI
298 );
299 
301 NTSYSAPI
302 PVOID
303 NTAPI
307 );
308 
309 NTSYSAPI
310 PVOID
311 NTAPI
314  _In_ PVOID Buffer,
315  _Out_ PVOID *NodeOrParent,
316  _Out_ TABLE_SEARCH_RESULT *SearchResult
317 );
318 
320 NTSYSAPI
321 PVOID
322 NTAPI
326 );
327 
329 NTSYSAPI
330 PVOID
331 NTAPI
334  _Inout_ PVOID *RestartKey
335 );
336 
338 NTSYSAPI
339 PVOID
340 NTAPI
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
478 );
479 
480 NTSYSAPI
481 PVOID
482 NTAPI
487  _Out_opt_ PBOOLEAN NewElement
488 );
489 
490 NTSYSAPI
491 PVOID
492 NTAPI
497  _Out_opt_ PBOOLEAN NewElement,
498  _In_ PVOID NodeOrParent,
499  _In_ TABLE_SEARCH_RESULT SearchResult
500 );
501 
502 NTSYSAPI
503 BOOLEAN
504 NTAPI
508 );
509 
511 NTSYSAPI
512 PVOID
513 NTAPI
517 );
518 
519 NTSYSAPI
520 PVOID
521 NTAPI
524  _In_ PVOID Buffer,
525  _Out_ PVOID *NodeOrParent,
526  _Out_ TABLE_SEARCH_RESULT *SearchResult
527 );
528 
530 NTSYSAPI
531 PVOID
532 NTAPI
536 );
537 
539 NTSYSAPI
540 PVOID
541 NTAPI
544  _Inout_ PVOID *RestartKey
545 );
546 
548 NTSYSAPI
549 PVOID
550 NTAPI
553  _In_ PVOID Buffer,
554  _Out_ PVOID *RestartKey
555 );
556 
558 NTSYSAPI
559 PVOID
560 NTAPI
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
577  _In_ ULONG I
578 );
579 
580 NTSYSAPI
581 ULONG
582 NTAPI
585 );
586 
588 NTSYSAPI
589 BOOLEAN
590 NTAPI
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
765 );
766 
767 _When_(Status < 0, _Out_range_(>, 0))
768 _When_(Status >= 0, _Out_range_(==, 0))
769 NTSYSAPI
770 ULONG
771 NTAPI
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
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,
873 );
874 
876 NTSYSAPI
877 PVOID
878 NTAPI
880  _In_ ULONG Flags,
882  _In_opt_ SIZE_T SizeToReserve,
883  _In_opt_ SIZE_T SizeToCommit,
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,
903 );
904 
905 _Success_(return != 0)
906 NTSYSAPI
907 BOOLEAN
908 NTAPI
910  _In_ HANDLE HeapHandle,
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,
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,
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,
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,
1039  _In_ PVOID UserValue
1040 );
1041 
1042 BOOLEAN
1043 NTAPI
1045  _In_ PVOID HeapHandle,
1046  _In_ ULONG Flags,
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
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,
1118  _In_ PSID pSid
1119 );
1120 
1121 NTSYSAPI
1122 NTSTATUS
1123 NTAPI
1125  _Inout_ PACL pAcl,
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,
1141  _In_ PSID Sid
1142 );
1143 
1144 NTSYSAPI
1145 NTSTATUS
1146 NTAPI
1148  _Inout_ PACL Acl,
1150  _In_ ULONG Flags,
1152  _In_ PSID Sid
1153 );
1154 
1155 NTSYSAPI
1156 NTSTATUS
1157 NTAPI
1159  _Inout_ PACL pAcl,
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,
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,
1207  _In_ ULONG Flags,
1209  _In_ PSID Sid,
1211  _In_ BOOLEAN Failure
1212 );
1213 
1214 NTSYSAPI
1215 NTSTATUS
1216 NTAPI
1218  _Inout_ PACL Acl,
1220  _In_ ULONG Flags,
1222  _In_opt_ GUID *ObjectTypeGuid,
1223  _In_opt_ GUID *InheritedObjectTypeGuid,
1224  _In_ PSID Sid,
1226  _In_ BOOLEAN Failure
1227 );
1228 
1229 NTSYSAPI
1230 NTSTATUS
1231 NTAPI
1233  _Inout_ PACL Acl,
1235  _In_ ULONG Flags,
1236  _In_ ULONG MandatoryFlags,
1237  _In_ UCHAR AceType,
1238  _In_ PSID LabelSid);
1239 
1240 NTSYSAPI
1241 NTSTATUS
1242 NTAPI
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
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
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
1350 );
1351 
1352 NTSYSAPI
1353 NTSTATUS
1354 NTAPI
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
1423 );
1424 
1425 NTSYSAPI
1426 NTSTATUS
1427 NTAPI
1431  _Out_ PACL *Dacl,
1433 );
1434 
1435 NTSYSAPI
1436 NTSTATUS
1437 NTAPI
1441  _Out_ PACL* Sacl,
1443 );
1444 
1445 NTSYSAPI
1446 NTSTATUS
1447 NTAPI
1450  _Out_ PSID *Group,
1452 );
1453 
1454 NTSYSAPI
1455 NTSTATUS
1456 NTAPI
1459  _Out_ PSID *Owner,
1461 );
1462 
1463 NTSYSAPI
1464 BOOLEAN
1465 NTAPI
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,
1489 );
1490 
1491 NTSYSAPI
1492 ULONG
1493 NTAPI
1495 
1497 NTSYSAPI
1498 ULONG
1499 NTAPI
1502 
1503 NTSYSAPI
1504 ULONG
1505 NTAPI
1507 
1508 NTSYSAPI
1509 NTSTATUS
1510 NTAPI
1512  _In_ PSECURITY_DESCRIPTOR AbsoluteSD,
1513  _Out_ PSECURITY_DESCRIPTOR SelfRelativeSD,
1515 
1516 NTSYSAPI
1517 VOID
1518 NTAPI
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
1561 );
1562 
1563 NTSYSAPI
1564 NTSTATUS
1565 NTAPI
1567  _Inout_ PSECURITY_DESCRIPTOR SelfRelativeSD,
1569 );
1570 
1571 NTSYSAPI
1572 NTSTATUS
1573 NTAPI
1578 );
1579 
1580 NTSYSAPI
1581 NTSTATUS
1582 NTAPI
1585  _In_ SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest,
1586  _In_ SECURITY_DESCRIPTOR_CONTROL ControlBitsToSet
1587 );
1588 
1590 NTSYSAPI
1591 NTSTATUS
1592 NTAPI
1596  _In_opt_ PACL Dacl,
1598 );
1599 
1601 NTSYSAPI
1602 NTSTATUS
1603 NTAPI
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
1632 );
1633 
1634 NTSYSAPI
1635 NTSTATUS
1636 NTAPI
1640  _In_ PACL Sacl,
1642 );
1643 
1644 NTSYSAPI
1645 VOID
1646 NTAPI
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
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,
1710 );
1711 
1712 NTSYSAPI
1713 NTSTATUS
1714 NTAPI
1716  _In_ PSECURITY_DESCRIPTOR ObjectDescriptor,
1718  _Out_ PSECURITY_DESCRIPTOR ResultantDescriptor,
1719  _In_ ULONG DescriptorLength,
1721 );
1722 
1723 NTSYSAPI
1724 NTSTATUS
1725 NTAPI
1728  _In_ PSECURITY_DESCRIPTOR ModificationDescriptor,
1729  _Out_ PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor,
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
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,
1770 );
1771 
1772 NTSYSAPI
1773 NTSTATUS
1774 NTAPI
1776  _In_ ULONG Value,
1780 );
1781 
1783 _At_(String->MaximumLength, _Const_)
1784 NTSYSAPI
1785 NTSTATUS
1786 NTAPI
1788  _In_ ULONG Value,
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
1846 );
1847 
1848 //
1849 // Unicode->OEM String Functions
1850 //
1851 NTSYSAPI
1852 NTSTATUS
1853 NTAPI
1858 );
1859 
1862 //_At_(DestinationString->Buffer, _Post_bytecount_(DestinationString->Length))
1863 NTSYSAPI
1864 NTSTATUS
1865 NTAPI
1872 );
1873 
1874 NTSYSAPI
1875 NTSTATUS
1876 NTAPI
1881 );
1882 
1883 NTSYSAPI
1884 NTSTATUS
1885 NTAPI
1887  PCHAR OemString,
1888  ULONG OemSize,
1889  PULONG ResultSize,
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,
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,
1935  ULONG UnicodeSize
1936 );
1937 
1938 NTSYSAPI
1939 NTSTATUS
1940 NTAPI
1942  PCHAR MbString,
1943  ULONG MbSize,
1944  PULONG ResultSize,
1946  ULONG UnicodeSize
1947 );
1948 
1949 NTSYSAPI
1950 NTSTATUS
1951 NTAPI
1953  PULONG MbSize,
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
1973 );
1974 
1976 NTSYSAPI
1977 NTSTATUS
1978 NTAPI
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
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
2062 );
2063 
2064 NTSYSAPI
2065 LONG
2066 NTAPI
2068  PCUNICODE_STRING String1,
2071 );
2072 
2073 NTSYSAPI
2074 VOID
2075 NTAPI
2079 );
2080 
2081 NTSYSAPI
2082 BOOLEAN
2083 NTAPI
2087 );
2088 
2089 #ifdef NTOS_MODE_USER
2090 
2091 NTSYSAPI
2092 NTSTATUS
2093 NTAPI
2095  _Inout_ PUNICODE_STRING UniDest,
2096  _In_ PCUNICODE_STRING UniSource,
2098 );
2099 
2100 NTSYSAPI
2101 NTSTATUS
2102 NTAPI
2104  _In_ ULONG Flags,
2107 );
2108 
2109 NTSYSAPI
2110 NTSTATUS
2111 NTAPI
2113  _In_ ULONG Flags,
2114  _In_ PCUNICODE_STRING SearchString,
2115  _In_ PCUNICODE_STRING MatchString,
2117 );
2118 
2119 //
2120 // Memory Functions
2121 //
2122 #if defined(_M_AMD64)
2123 
2125 VOID
2128  _In_ SIZE_T Length,
2129  _In_ ULONG Pattern)
2130 {
2132  if ((Length /= 4) != 0) {
2133  if (((ULONG64)Address & 4) != 0) {
2134  *Address = Pattern;
2135  if ((Length -= 1) == 0) {
2136  return;
2137  }
2138  Address += 1;
2139  }
2140  __stosq((PULONG64)(Address), Pattern | ((ULONG64)Pattern << 32), Length / 2);
2141  if ((Length & 1) != 0) Address[Length - 1] = Pattern;
2142  }
2143  return;
2144 }
2145 
2146 #define RtlFillMemoryUlonglong(Destination, Length, Pattern) \
2147  __stosq((PULONG64)(Destination), Pattern, (Length) / 8)
2148 
2149 #else
2150 
2151 NTSYSAPI
2152 VOID
2153 NTAPI
2156  _In_ SIZE_T Length,
2157  _In_ ULONG Pattern
2158 );
2159 
2160 NTSYSAPI
2161 VOID
2162 NTAPI
2165  _In_ SIZE_T Length,
2166  _In_ ULONGLONG Pattern
2167 );
2168 
2169 #endif
2170 
2171 NTSYSAPI
2172 NTSTATUS
2173 NTAPI
2176  _In_reads_bytes_(Size) const VOID *Source,
2177  _In_ SIZE_T Size
2178 );
2179 
2180 NTSYSAPI
2181 SIZE_T
2182 NTAPI
2184  _In_ PVOID Source,
2185  _In_ SIZE_T Length,
2186  _In_ ULONG Pattern
2187 );
2188 
2189 #ifndef RtlEqualMemory
2190 #define RtlEqualMemory(Destination, Source, Length) \
2191  (!memcmp(Destination, Source, Length))
2192 #endif
2193 
2194 #define RtlCopyBytes RtlCopyMemory
2195 #define RtlFillBytes RtlFillMemory
2196 #define RtlZeroBytes RtlZeroMemory
2197 
2198 #endif
2199 
2200 NTSYSAPI
2201 BOOLEAN
2202 NTAPI
2204  PCUNICODE_STRING String1,
2207 );
2208 
2210 NTSYSAPI
2211 VOID
2212 NTAPI
2214  _Inout_ _At_(UnicodeString->Buffer, __drv_freesMem(Mem))
2216 );
2217 
2218 NTSYSAPI
2219 VOID
2220 NTAPI
2223 );
2224 
2225 NTSYSAPI
2226 NTSTATUS
2227 NTAPI
2233 );
2234 
2243 NTSYSAPI
2244 VOID
2245 NTAPI
2249 );
2250 
2259 NTSYSAPI
2260 VOID
2261 NTAPI
2265 );
2266 
2268 NTSYSAPI
2269 NTSTATUS
2270 NTAPI
2274 );
2275 
2276 NTSYSAPI
2277 BOOLEAN
2278 NTAPI
2280  _In_ CONST VOID* Buffer,
2281  _In_ INT Size,
2283 );
2284 
2287 NTSYSAPI
2288 BOOLEAN
2289 NTAPI
2291  _In_ const STRING *String1,
2294 );
2295 
2298 NTSYSAPI
2299 BOOLEAN
2300 NTAPI
2302  _In_ PCUNICODE_STRING String1,
2305 );
2306 
2308 NTSYSAPI
2309 VOID
2310 NTAPI
2314 );
2315 
2318 NTSYSAPI
2319 LONG
2320 NTAPI
2322  _In_ const STRING *String1,
2325 );
2326 
2327 NTSYSAPI
2328 VOID
2329 NTAPI
2333 );
2334 
2337 NTSYSAPI
2338 BOOLEAN
2339 NTAPI
2341  _In_ const STRING *String1,
2344 );
2345 
2347 NTSYSAPI
2348 NTSTATUS
2349 NTAPI
2353 );
2354 
2357 NTSYSAPI
2358 NTSTATUS
2359 NTAPI
2366 );
2367 
2369 NTSYSAPI
2370 NTSTATUS
2371 NTAPI
2376 );
2377 
2378 NTSYSAPI
2379 NTSTATUS
2380 NTAPI
2382  _In_ ULONG Flags,
2384 );
2385 
2386 #define RTL_SKIP_BUFFER_COPY 0x00000001
2387 
2388 NTSYSAPI
2389 NTSTATUS
2390 NTAPI
2392  _In_ ULONG Flags,
2395 );
2396 
2397 #ifdef NTOS_MODE_USER
2398 
2400 VOID
2401 RtlInitBuffer(
2403  _In_ PUCHAR Data,
2405 )
2406 {
2407  Buffer->Buffer = Buffer->StaticBuffer = Data;
2408  Buffer->Size = Buffer->StaticSize = DataSize;
2409  Buffer->ReservedForAllocatedSize = 0;
2410  Buffer->ReservedForIMalloc = NULL;
2411 }
2412 
2414 NTSTATUS
2415 RtlEnsureBufferSize(
2416  _In_ ULONG Flags,
2419 )
2420 {
2421  if (Buffer && RequiredSize <= Buffer->Size)
2422  return STATUS_SUCCESS;
2424 }
2425 
2427 VOID
2428 RtlFreeBuffer(
2430 )
2431 {
2432  if (Buffer->Buffer != Buffer->StaticBuffer && Buffer->Buffer)
2433  RtlFreeHeap(RtlGetProcessHeap(), 0, Buffer->Buffer);
2434  Buffer->Buffer = Buffer->StaticBuffer;
2435  Buffer->Size = Buffer->StaticSize;
2436 }
2437 
2438 #endif /* NTOS_MODE_USER */
2439 
2440 //
2441 // Ansi String Functions
2442 //
2444 NTSYSAPI
2445 VOID
2446 NTAPI
2448  _Inout_ _At_(AnsiString->Buffer, __drv_freesMem(Mem))
2450 );
2451 
2453 NTSYSAPI
2454 VOID
2455 NTAPI
2459 );
2460 
2462 NTSYSAPI
2463 NTSTATUS
2464 NTAPI
2468 );
2469 
2470 //
2471 // OEM String Functions
2472 //
2474 NTSYSAPI
2475 VOID
2476 NTAPI
2478  _Inout_ _At_(OemString->Buffer, __drv_freesMem(Mem))
2480 );
2481 
2482 //
2483 // MultiByte->Unicode String Functions
2484 //
2486 NTSYSAPI
2487 NTSTATUS
2488 NTAPI
2495 );
2496 
2498 NTSYSAPI
2499 NTSTATUS
2500 NTAPI
2505 );
2506 
2507 //
2508 // Atom Functions
2509 //
2510 NTSYSAPI
2511 NTSTATUS
2512 NTAPI
2514  _In_ PRTL_ATOM_TABLE AtomTable,
2515  _In_ PWSTR AtomName,
2517 );
2518 
2519 NTSYSAPI
2520 NTSTATUS
2521 NTAPI
2524  _Inout_ PRTL_ATOM_TABLE *AtomTable
2525 );
2526 
2527 NTSYSAPI
2528 NTSTATUS
2529 NTAPI
2531  _In_ PRTL_ATOM_TABLE AtomTable,
2533 );
2534 
2535 NTSYSAPI
2536 NTSTATUS
2537 NTAPI
2539 
2540 NTSYSAPI
2541 NTSTATUS
2542 NTAPI
2544  _In_ PRTL_ATOM_TABLE AtomTable,
2545  _In_ RTL_ATOM Atom,
2546  _Out_opt_ PULONG RefCount,
2548  _Out_opt_z_bytecap_(*NameLength) PWSTR AtomName,
2549  _Inout_opt_ PULONG NameLength
2550 );
2551 
2552 NTSYSAPI
2553 NTSTATUS
2554 NTAPI
2556  _In_ PRTL_ATOM_TABLE AtomTable,
2558 );
2559 
2560 NTSYSAPI
2561 NTSTATUS
2562 NTAPI
2564  _In_ PRTL_ATOM_TABLE AtomTable,
2565  _In_ PWSTR AtomName,
2567 );
2568 
2569 //
2570 // Process Management Functions
2571 //
2572 NTSYSAPI
2573 PPEB
2574 NTAPI
2576  VOID
2577 );
2578 
2579 NTSYSAPI
2580 VOID
2581 NTAPI
2583 
2584 NTSYSAPI
2585 NTSTATUS
2586 NTAPI
2588  _Out_ PRTL_USER_PROCESS_PARAMETERS *ProcessParameters,
2589  _In_ PUNICODE_STRING ImagePathName,
2592  _In_opt_ PUNICODE_STRING CommandLine,
2594  _In_opt_ PUNICODE_STRING WindowTitle,
2595  _In_opt_ PUNICODE_STRING DesktopInfo,
2596  _In_opt_ PUNICODE_STRING ShellInfo,
2597  _In_opt_ PUNICODE_STRING RuntimeInfo
2598 );
2599 
2600 NTSYSAPI
2601 NTSTATUS
2602 NTAPI
2604  _In_ PUNICODE_STRING ImageFileName,
2606  _In_ PRTL_USER_PROCESS_PARAMETERS ProcessParameters,
2607  _In_opt_ PSECURITY_DESCRIPTOR ProcessSecutityDescriptor,
2608  _In_opt_ PSECURITY_DESCRIPTOR ThreadSecurityDescriptor,
2609  _In_opt_ HANDLE ParentProcess,
2611  _In_opt_ HANDLE DebugPort,
2612  _In_opt_ HANDLE ExceptionPort,
2614 );
2615 
2616 #if (NTDDI_VERSION >= NTDDI_WIN7)
2617 NTSYSAPI
2618 NTSTATUS
2619 NTAPI
2621  _In_ PVOID ThreadContext,
2622  _Out_ HANDLE *OutThreadHandle,
2628  _Reserved_ PVOID Reserved6,
2630  _Reserved_ PVOID Reserved8
2631 );
2632 #else
2633 NTSYSAPI
2634 NTSTATUS
2635 NTAPI
2639  _In_ BOOLEAN CreateSuspended,
2640  _In_ ULONG StackZeroBits,
2641  _In_ SIZE_T StackReserve,
2642  _In_ SIZE_T StackCommit,
2643  _In_ PTHREAD_START_ROUTINE StartAddress,
2645  _Out_opt_ PHANDLE ThreadHandle,
2647 );
2648 #endif
2649 
2650 NTSYSAPI
2652 NTAPI
2654  _In_ PRTL_USER_PROCESS_PARAMETERS ProcessParameters);
2655 
2656 NTSYSAPI
2657 NTSTATUS
2658 NTAPI
2660  _In_ PRTL_USER_PROCESS_PARAMETERS ProcessParameters);
2661 
2662 NTSYSAPI
2663 VOID
2664 NTAPI
2666  _In_ NTSTATUS Status);
2667 
2668 NTSYSAPI
2669 VOID
2670 NTAPI
2673  _Out_ PCONTEXT ThreadContext,
2674  _In_opt_ PVOID ThreadStartParam,
2675  _In_ PTHREAD_START_ROUTINE ThreadStartAddress,
2676  _In_ PINITIAL_TEB InitialTeb
2677 );
2678 
2679 #ifdef _M_AMD64
2680 typedef struct _WOW64_CONTEXT *PWOW64_CONTEXT;
2681 
2682 NTSYSAPI
2683 NTSTATUS
2684 NTAPI
2685 RtlWow64GetThreadContext(
2686  _In_ HANDLE ThreadHandle,
2687  _Inout_ PWOW64_CONTEXT ThreadContext
2688 );
2689 
2690 
2691 NTSYSAPI
2692 NTSTATUS
2693 NTAPI
2694 RtlWow64SetThreadContext(
2695  _In_ HANDLE ThreadHandle,
2696  _In_ PWOW64_CONTEXT ThreadContext
2697 );
2698 #endif
2699 
2700 NTSYSAPI
2701 BOOLEAN
2702 NTAPI
2704 
2705 NTSYSAPI
2707 NTAPI
2709  _In_ PRTL_USER_PROCESS_PARAMETERS ProcessParameters);
2710 
2711 NTSYSAPI
2712 VOID
2713 NTAPI
2715 
2716 NTSYSAPI
2717 NTSTATUS
2718 NTAPI
2721  _In_ HANDLE Thread,
2722  _In_ PVOID CallSite,
2723  _In_ ULONG ArgumentCount,
2724  _In_ PULONG Arguments,
2725  _In_ BOOLEAN PassContext,
2726  _In_ BOOLEAN AlreadySuspended
2727 );
2728 
2729 NTSYSAPI
2730 NTSTATUS
2731 __cdecl
2733  _In_ BOOLEAN NewValue,
2734  _Out_opt_ PBOOLEAN OldValue,
2735  _In_ BOOLEAN NeedBreaks
2736 );
2737 
2738 NTSYSAPI
2739 NTSTATUS
2740 __cdecl
2742  _In_ BOOLEAN NewValue,
2743  _Out_opt_ PBOOLEAN OldValue,
2744  _In_ BOOLEAN NeedBreaks
2745 );
2746 
2747 NTSYSAPI
2748 ULONG
2749 NTAPI
2751  VOID
2752 );
2753 
2754 
2755 //
2756 // Thread Pool Functions
2757 //
2758 //
2759 NTSTATUS
2760 NTAPI
2762  _In_ PRTL_START_POOL_THREAD StartPoolThread,
2763  _In_ PRTL_EXIT_POOL_THREAD ExitPoolThread
2764 );
2765 
2766 NTSYSAPI
2767 NTSTATUS
2768 NTAPI
2770  _In_ HANDLE hWaitHandle,
2771  _In_opt_ HANDLE hCompletionEvent
2772 );
2773 
2774 NTSYSAPI
2775 NTSTATUS
2776 NTAPI
2778  _In_ HANDLE hWaitHandle
2779 );
2780 
2781 NTSYSAPI
2782 NTSTATUS
2783 NTAPI
2787  _In_ ULONG Flags
2788 );
2789 
2790 NTSYSAPI
2791 NTSTATUS
2792 NTAPI
2796  _In_ ULONG Flags
2797 );
2798 
2799 NTSYSAPI
2800 NTSTATUS
2801 NTAPI
2803  _In_ PHANDLE phNewWaitObject,
2804  _In_ HANDLE hObject,
2806  _In_ PVOID pvContext,
2807  _In_ ULONG ulMilliseconds,
2808  _In_ ULONG ulFlags
2809 );
2810 
2811 //
2812 // Environment/Path Functions
2813 //
2814 NTSYSAPI
2815 NTSTATUS
2816 NTAPI
2818  _In_ BOOLEAN Inherit,
2820 );
2821 
2822 NTSYSAPI
2823 NTSTATUS
2824 NTAPI
2826  _In_ PUNICODE_STRING DllName,
2827  _Inout_ PUNICODE_STRING RealName,
2828  _Inout_ PUNICODE_STRING LocalName
2829 );
2830 
2831 NTSYSAPI
2832 VOID
2833 NTAPI
2836 );
2837 
2838 NTSYSAPI
2839 BOOLEAN
2840 NTAPI
2843 );
2844 
2845 NTSYSAPI
2847 NTAPI
2849  _In_ PCWSTR Path
2850 );
2851 
2852 NTSYSAPI
2853 ULONG
2854 NTAPI
2856  _In_ PCWSTR Path,
2860  _Out_ PWSTR Buffer,
2861  _Out_ PWSTR *PartName
2862 );
2863 
2864 NTSYSAPI
2865 NTSTATUS
2866 NTAPI
2868  _In_ ULONG Flags,
2869  _In_ PUNICODE_STRING PathString,
2870  _In_ PUNICODE_STRING FileNameString,
2871  _In_ PUNICODE_STRING ExtensionString,
2872  _In_ PUNICODE_STRING CallerBuffer,
2874  _Out_opt_ PUNICODE_STRING* FullNameOut,
2875  _Out_opt_ PSIZE_T FilePartSize,
2877 );
2878 
2879 NTSYSAPI
2880 BOOLEAN
2881 NTAPI
2883  _In_opt_z_ PCWSTR DosPathName,
2884  _Out_ PUNICODE_STRING NtPathName,
2885  _Out_opt_ PCWSTR *NtFileNamePart,
2886  _Out_opt_ PRTL_RELATIVE_NAME_U DirectoryInfo
2887 );
2888 
2889 
2890 #define RTL_UNCHANGED_UNK_PATH 1
2891 #define RTL_CONVERTED_UNC_PATH 2
2892 #define RTL_CONVERTED_NT_PATH 3
2893 #define RTL_UNCHANGED_DOS_PATH 4
2894 
2895 NTSYSAPI
2896 NTSTATUS
2897 NTAPI
2899  _In_ ULONG Flags,
2903 );
2904 
2905 
2906 NTSYSAPI
2907 BOOLEAN
2908 NTAPI
2911  _Out_ PUNICODE_STRING NtName,
2912  _Out_ PCWSTR *PartName,
2913  _Out_ PRTL_RELATIVE_NAME_U RelativeName
2914 );
2915 
2917 NTSYSAPI
2918 NTSTATUS
2919 NTAPI
2925 );
2926 
2927 NTSYSAPI
2928 ULONG
2929 NTAPI
2933 );
2934 
2935 NTSYSAPI
2936 ULONG
2937 NTAPI
2940  _In_ ULONG Size,
2943 );
2944 
2945 #if (NTDDI_VERSION >= NTDDI_WIN7)
2946 NTSYSAPI
2947 NTSTATUS
2948 NTAPI
2952  _Out_ PWSTR Buffer,
2953  _Out_opt_ PWSTR *FilePart,
2954  _Out_opt_ RTL_PATH_TYPE *InputPathType
2955  );
2956 #endif
2957 
2958 NTSTATUS
2959 NTAPI
2965  _Out_opt_ PSIZE_T FilePartSize,
2969 );
2970 
2971 NTSYSAPI
2972 NTSTATUS
2973 NTAPI
2976  _In_ PCUNICODE_STRING PathString,
2978 );
2979 
2980 NTSYSAPI
2981 ULONG
2982 NTAPI
2984  VOID
2985 );
2986 
2987 NTSYSAPI
2988 ULONG
2989 NTAPI
2991  _In_ PCWSTR Name
2992 );
2993 
2994 NTSYSAPI
2995 ULONG
2996 NTAPI
2999 );
3000 
3003 NTSYSAPI
3004 BOOLEAN
3005 NTAPI
3010 );
3011 
3012 NTSYSAPI
3013 NTSTATUS
3014 NTAPI
3019 );
3020 
3021 VOID
3022 NTAPI
3024  _In_ PRTL_RELATIVE_NAME_U RelativeName
3025 );
3026 
3027 NTSYSAPI
3028 NTSTATUS
3029 NTAPI
3032 );
3033 
3034 NTSYSAPI
3035 NTSTATUS
3036 NTAPI
3041 );
3042 
3043 //
3044 // Critical Section/Resource Functions
3045 //
3046 NTSYSAPI
3047 NTSTATUS
3048 NTAPI
3051 );
3052 
3053 NTSYSAPI
3054 NTSTATUS
3055 NTAPI
3058 );
3059 
3060 NTSYSAPI
3061 NTSTATUS
3062 NTAPI
3065 );
3066 
3067 NTSYSAPI
3068 NTSTATUS
3069 NTAPI
3072  _In_ ULONG SpinCount
3073 );
3074 
3075 NTSYSAPI
3076 ULONG
3077 NTAPI
3080 );
3081 
3082 NTSYSAPI
3083 ULONG
3084 NTAPI
3087 );
3088 
3089 NTSYSAPI
3090 NTSTATUS
3091 NTAPI
3094 );
3095 
3096 NTSYSAPI
3097 BOOLEAN
3098 NTAPI
3101 );
3102 
3103 NTSYSAPI
3104 VOID
3105 NTAPI
3108 );
3109 
3110 NTSYSAPI
3111 NTSTATUS
3112 NTAPI
3115 );
3116 
3117 NTSYSAPI
3118 BOOLEAN
3119 NTAPI
3122  _In_ BOOLEAN Wait
3123 );
3124 
3125 NTSYSAPI
3126 BOOLEAN
3127 NTAPI
3130  _In_ BOOLEAN Wait
3131 );
3132 
3133 NTSYSAPI
3134 VOID
3135 NTAPI
3138 );
3139 
3140 NTSYSAPI
3141 VOID
3142 NTAPI
3145 );
3146 
3147 NTSYSAPI
3148 VOID
3149 NTAPI
3152 );
3153 
3154 NTSYSAPI
3155 VOID
3156 NTAPI
3159 );
3160 
3161 NTSYSAPI
3162 VOID
3163 NTAPI
3166 );
3167 
3168 NTSYSAPI
3169 VOID
3170 NTAPI
3173 );
3174 
3175 //
3176 // Compression Functions
3177 //
3178 NTSYSAPI //NT_RTL_COMPRESS_API
3179 NTSTATUS
3180 NTAPI
3182  _In_ USHORT CompressionFormatAndEngine,
3183  _In_reads_bytes_(UncompressedBufferSize) PUCHAR UncompressedBuffer,
3187  _In_ ULONG UncompressedChunkSize,
3188  _Out_ PULONG FinalCompressedSize,
3190 );
3191 
3193 NTSYSAPI //NT_RTL_COMPRESS_API
3194 NTSTATUS
3195 NTAPI
3197  _In_ USHORT CompressionFormat,
3203 );
3204 
3205 NTSYSAPI
3206 NTSTATUS
3207 NTAPI
3209  _In_ USHORT CompressionFormatAndEngine,
3210  _Out_ PULONG CompressBufferWorkSpaceSize,
3211  _Out_ PULONG CompressFragmentWorkSpaceSize
3212 );
3213 
3214 //
3215 // Frame Functions
3216 //
3217 NTSYSAPI
3218 VOID
3219 NTAPI
3220 RtlPopFrame(
3221  _In_ PTEB_ACTIVE_FRAME Frame
3222 );
3223 
3224 NTSYSAPI
3225 VOID
3226 NTAPI
3227 RtlPushFrame(
3228  _In_ PTEB_ACTIVE_FRAME Frame
3229 );
3230 
3231 NTSYSAPI
3233 NTAPI
3234 RtlGetFrame(
3235  VOID
3236 );
3237 
3238 //
3239 // Debug Info Functions
3240 //
3241 NTSYSAPI
3243 NTAPI
3245  _In_ ULONG Size,
3246  _In_ BOOLEAN EventPair
3247 );
3248 
3249 NTSYSAPI
3250 NTSTATUS
3251 NTAPI
3253 
3254 NTSYSAPI
3255 NTSTATUS
3256 NTAPI
3259  _In_ ULONG DebugInfoClassMask,
3260  _Inout_ PRTL_DEBUG_INFORMATION DebugBuffer
3261 );
3262 
3263 //
3264 // Bitmap Functions
3265 //
3266 #ifdef NTOS_MODE_USER
3267 
3268 NTSYSAPI
3269 BOOLEAN
3270 NTAPI
3272  _In_ PRTL_BITMAP BitMapHeader,
3274  _In_ ULONG Length
3275 );
3276 
3277 NTSYSAPI
3278 BOOLEAN
3279 NTAPI
3281  _In_ PRTL_BITMAP BitMapHeader,
3283  _In_ ULONG Length
3284 );
3285 
3286 NTSYSAPI
3287 VOID
3288 NTAPI
3290  _In_ PRTL_BITMAP BitMapHeader
3291 );
3292 
3293 NTSYSAPI
3294 VOID
3295 NTAPI
3296 RtlClearBit(
3297  _In_ PRTL_BITMAP BitMapHeader,
3298  _In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitNumber
3299 );
3300 
3301 NTSYSAPI
3302 VOID
3303 NTAPI
3304 RtlClearBits(
3305  _In_ PRTL_BITMAP BitMapHeader,
3306  _In_range_(0, BitMapHeader->SizeOfBitMap - NumberToClear) ULONG StartingIndex,
3307  _In_range_(0, BitMapHeader->SizeOfBitMap - StartingIndex) ULONG NumberToClear
3308 );
3309 
3310 NTSYSAPI
3311 ULONG
3312 NTAPI
3314  _In_ PRTL_BITMAP BitMapHeader,
3317 );
3318 
3319 NTSYSAPI
3320 ULONG
3321 NTAPI
3323  _In_ PRTL_BITMAP BitMapHeader,
3326 );
3327 
3328 NTSYSAPI
3329 ULONG
3330 NTAPI
3332  _In_ PRTL_BITMAP BitMapHeader,
3334 );
3335 
3336 NTSYSAPI
3337 ULONG
3338 NTAPI
3340  _In_ PRTL_BITMAP BitMapHeader,
3341  _Out_writes_to_(SizeOfRunArray, return) PRTL_BITMAP_RUN RunArray,
3342  _In_range_(>, 0) ULONG SizeOfRunArray,
3343  _In_ BOOLEAN LocateLongestRuns
3344 );
3345 
3346 NTSYSAPI
3347 ULONG
3348 NTAPI
3350  _In_ PRTL_BITMAP BitMapHeader,
3351  _In_ ULONG FromIndex,
3352  _Out_ PULONG StartingRunIndex
3353 );
3354 
3355 NTSYSAPI
3356 CCHAR
3357 NTAPI
3360 );
3361 
3362 NTSYSAPI
3363 ULONG
3364 NTAPI
3366  _In_ PRTL_BITMAP BitMapHeader,
3368 );
3369 
3370 NTSYSAPI
3371 CCHAR
3372 NTAPI
3375 );
3376 
3377 NTSYSAPI
3378 ULONG
3379 NTAPI
3381  _In_ PRTL_BITMAP BitMapHeader,
3382  _In_ ULONG FromIndex,
3383  _Out_ PULONG StartingRunIndex
3384 );
3385 
3386 NTSYSAPI
3387 ULONG
3388 NTAPI
3390  _In_ PRTL_BITMAP BitMapHeader,
3391  _In_ ULONG FromIndex,
3392  _Out_ PULONG StartingRunIndex
3393 );
3394 
3395 NTSYSAPI
3396 ULONG
3397 NTAPI
3399  _In_ PRTL_BITMAP BitMapHeader,
3402 );
3403 
3404 NTSYSAPI
3405 ULONG
3406 NTAPI
3408  _In_ PRTL_BITMAP BitMapHeader,
3411 );
3412 
3413 #ifdef __REACTOS__ // ReactOS improvement
3414 _At_(BitMapHeader->SizeOfBitMap, _Post_equal_to_(SizeOfBitMap))
3415 _At_(BitMapHeader->Buffer, _Post_equal_to_(BitMapBuffer))
3416 #endif
3417 NTSYSAPI
3418 VOID
3419 NTAPI
3421  _Out_ PRTL_BITMAP BitMapHeader,
3422  _In_opt_ __drv_aliasesMem PULONG BitMapBuffer,
3423  _In_opt_ ULONG SizeOfBitMap
3424 );
3425 
3426 NTSYSAPI
3427 ULONG
3428 NTAPI
3430  _In_ PRTL_BITMAP BitMapHeader
3431 );
3432 
3433 NTSYSAPI
3434 ULONG
3435 NTAPI
3437  _In_ PRTL_BITMAP BitMapHeader
3438 );
3439 
3440 NTSYSAPI
3441 VOID
3442 NTAPI
3443 RtlSetBit(
3444  _In_ PRTL_BITMAP BitMapHeader,
3445  _In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitNumber
3446 );
3447 
3448 NTSYSAPI
3449 VOID
3450 NTAPI
3451 RtlSetBits(
3452  _In_ PRTL_BITMAP BitMapHeader,
3453  _In_range_(0, BitMapHeader->SizeOfBitMap - NumberToSet) ULONG StartingIndex,
3454  _In_range_(0, BitMapHeader->SizeOfBitMap - StartingIndex) ULONG NumberToSet
3455 );
3456 
3457 NTSYSAPI
3458 VOID
3459 NTAPI
3461  _In_ PRTL_BITMAP BitMapHeader
3462 );
3463 
3465 NTSYSAPI
3466 BOOLEAN
3467 NTAPI
3468 RtlTestBit(
3469  _In_ PRTL_BITMAP BitMapHeader,
3470  _In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitNumber
3471 );
3472 
3473 #if defined(_M_AMD64)
3476 BOOLEAN
3477 RtlCheckBit(
3478  _In_ PRTL_BITMAP BitMapHeader,
3479  _In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitPosition)
3480 {
3481  return BitTest64((LONG64 CONST*)BitMapHeader->Buffer, (LONG64)BitPosition);
3482 }
3483 #else
3484 #define RtlCheckBit(BMH,BP) (((((PLONG)(BMH)->Buffer)[(BP)/32]) >> ((BP)%32)) & 0x1)
3485 #endif /* defined(_M_AMD64) */
3486 
3487 #endif // NTOS_MODE_USER
3488 
3489 
3490 //
3491 // Timer Functions
3492 //
3493 NTSYSAPI
3494 NTSTATUS
3495 NTAPI
3497  _In_ HANDLE TimerQueue,
3498  _In_ PHANDLE phNewTimer,
3501  _In_ ULONG DueTime,
3502  _In_ ULONG Period,
3503  _In_ ULONG Flags
3504 );
3505 
3506 NTSYSAPI
3507 NTSTATUS
3508 NTAPI
3509 RtlCreateTimerQueue(PHANDLE TimerQueue);
3510 
3511 NTSYSAPI
3512 NTSTATUS
3513 NTAPI
3515  _In_ HANDLE TimerQueue,
3516  _In_ HANDLE Timer,
3517  _In_ HANDLE CompletionEvent
3518 );
3519 
3520 NTSYSAPI
3521 NTSTATUS
3522 NTAPI
3524  _In_ HANDLE TimerQueue,
3525  _In_ HANDLE Timer,
3526  _In_ ULONG DueTime,
3527  _In_ ULONG Period
3528 );
3529 
3530 NTSYSAPI
3531 NTSTATUS
3532 NTAPI
3534  _In_ HANDLE TimerQueue,
3535  _In_opt_ HANDLE CompletionEvent
3536 );
3537 
3538 NTSYSAPI
3539 NTSTATUS
3540 NTAPI
3541 RtlDeleteTimerQueue(HANDLE TimerQueue);
3542 
3543 //
3544 // SList functions
3545 //
3547 FASTCALL
3549  _Inout_ PSLIST_HEADER ListHead,
3552  _In_ ULONG Count
3553 );
3554 
3555 //
3556 // Range List functions
3557 //
3558 NTSYSAPI
3559 VOID
3560 NTAPI
3562  _Inout_ PRTL_RANGE_LIST RangeList
3563 );
3564 
3565 NTSYSAPI
3566 VOID
3567 NTAPI
3569  _In_ PRTL_RANGE_LIST RangeList
3570 );
3571 
3572 NTSYSAPI
3573 NTSTATUS
3574 NTAPI
3575 RtlAddRange(
3576  _Inout_ PRTL_RANGE_LIST RangeList,
3578  _In_ ULONGLONG End,
3580  _In_ ULONG Flags,
3583 );
3584 
3585 //
3586 // Debug Functions
3587 //
3588 ULONG
3589 __cdecl
3590 DbgPrint(
3592  ...
3593 );
3594 
3595 NTSYSAPI
3596 ULONG
3597 __cdecl
3598 DbgPrintEx(
3600  _In_ ULONG Level,
3602  ...
3603 );
3604 
3605 NTSYSAPI
3606 ULONG
3607 NTAPI
3608 DbgPrompt(
3609  _In_z_ PCCH Prompt,
3612 );
3613 
3614 #undef DbgBreakPoint
3615 VOID
3616 NTAPI
3618  VOID
3619 );
3620 
3621 VOID
3622 NTAPI
3624  _In_ PSTRING Name,
3625  _In_ PVOID Base,
3627 );
3628 
3629 VOID
3630 NTAPI
3632  _In_ PSTRING Name,
3633  _In_ PVOID Base,
3635 );
3636 
3637 VOID
3638 NTAPI
3640  _In_ PCCH Name,
3641  _In_ PCCH Command
3642 );
3643 
3644 //
3645 // Generic Table Functions
3646 //
3647 #if defined(NTOS_MODE_USER) || defined(_NTIFS_)
3648 NTSYSAPI
3649 PVOID
3650 NTAPI
3655  _Out_opt_ PBOOLEAN NewElement
3656 );
3657 
3658 NTSYSAPI
3659 PVOID
3660 NTAPI
3665  _Out_opt_ PBOOLEAN NewElement,
3666  _In_ PVOID NodeOrParent,
3667  _In_ TABLE_SEARCH_RESULT SearchResult
3668 );
3669 
3670 NTSYSAPI
3671 BOOLEAN
3672 NTAPI
3675 );
3676 
3677 NTSYSAPI
3678 PVOID
3679 NTAPI
3682  _In_ PVOID Buffer,
3683  _Out_ PVOID *NodeOrParent,
3684  _Out_ TABLE_SEARCH_RESULT *SearchResult
3685 );
3686 #endif
3687 
3688 //
3689 // Handle Table Functions
3690 //
3691 NTSYSAPI
3693 NTAPI
3697 );
3698 
3699 NTSYSAPI
3700 VOID
3701 NTAPI
3704 
3705 NTSYSAPI
3706 BOOLEAN
3707 NTAPI
3711 );
3712 
3713 NTSYSAPI
3714 VOID
3715 NTAPI
3718  _In_ ULONG HandleSize,
3720 );
3721 
3722 NTSYSAPI
3723 BOOLEAN
3724 NTAPI
3728 );
3729 
3730 _Success_(return!=FALSE)
3731 NTSYSAPI
3732 BOOLEAN
3733 NTAPI
3738 );
3739 
3740 //
3741 // PE Functions
3742 //
3743 NTSYSAPI
3744 NTSTATUS
3745 NTAPI
3748  _In_ ULONG Type,
3749  _In_ ULONG Language,
3750  _In_ ULONG MessageId,
3751  _Out_ PMESSAGE_RESOURCE_ENTRY *MessageResourceEntry
3752 );
3753 
3754 NTSYSAPI
3755 ULONG
3756 NTAPI
3758 
3759 _Success_(return!=NULL)
3760 NTSYSAPI
3761 PVOID
3762 NTAPI
3767  _Out_ PULONG Size
3768 );
3769 
3770 NTSYSAPI
3771 PVOID
3772 NTAPI
3774  _In_ PIMAGE_NT_HEADERS NtHeader,
3776  _In_ ULONG Rva,
3777  _Inout_opt_ PIMAGE_SECTION_HEADER *SectionHeader
3778 );
3779 
3780 NTSYSAPI
3782 NTAPI
3785 
3786 NTSYSAPI
3787 NTSTATUS
3788 NTAPI
3790  _In_ ULONG Flags,
3793  _Out_ PIMAGE_NT_HEADERS *NtHeader
3794 );
3795 
3796 NTSYSAPI
3798 NTAPI
3800  _In_ PIMAGE_NT_HEADERS NtHeader,
3802  _In_ ULONG Rva
3803 );
3804 
3805 NTSYSAPI
3806 ULONG
3807 NTAPI
3809  _In_ PVOID NewAddress,
3810  _In_ LONGLONG AdditionalBias,
3811  _In_ PCCH LoaderName,
3812  _In_ ULONG Success,
3813  _In_ ULONG Conflict,
3814  _In_ ULONG Invalid
3815 );
3816 
3817 //
3818 // Activation Context Functions
3819 //
3820 #ifdef NTOS_MODE_USER
3821 NTSYSAPI
3822 NTSTATUS
3823 NTAPI
3825  _In_ ULONG Flags,
3826  _In_ PTEB Teb,
3827  _In_ PVOID Context,
3829 );
3830 
3831 NTSYSAPI
3832 NTSTATUS
3833 NTAPI
3835  _In_ ULONG Flags,
3836  _In_ HANDLE Handle,
3838 );
3839 
3840 NTSYSAPI
3841 VOID
3842 NTAPI
3845 );
3846 
3847 NTSYSAPI
3849 FASTCALL
3851  _In_ PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED Frame,
3853 );
3854 
3855 NTSYSAPI
3856 NTSTATUS
3857 NTAPI
3860 );
3861 
3862 NTSYSAPI
3863 NTSTATUS
3864 NTAPI
3866  _In_ ULONG Flags,
3867  _In_ PACTIVATION_CONTEXT_DATA ActivationContextData,
3868  _In_ ULONG ExtraBytes,
3869  _In_ PVOID NotificationRoutine,
3872 );
3873 
3874 NTSYSAPI
3875 NTSTATUS
3876 NTAPI
3878  _In_ PVOID *Context
3879 );
3880 
3881 NTSYSAPI
3882 VOID
3883 NTAPI
3886 );
3887 
3888 NTSYSAPI
3889 NTSTATUS
3890 NTAPI
3892  _In_ ULONG dwFlags,
3893  _In_ ULONG_PTR ulCookie
3894 );
3895 
3896 NTSYSAPI
3897 VOID
3898 NTAPI
3901 );
3902 
3903 NTSYSAPI
3904 VOID
3905 NTAPI
3907 
3908 NTSYSAPI
3910 FASTCALL
3912  _In_ PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED Frame
3913 );
3914 
3915 NTSYSAPI
3916 NTSTATUS
3917 NTAPI
3919  _In_ ULONG Flags,
3920  _In_ PUNICODE_STRING OriginalName,
3925  _In_ PULONG NewFlags,
3926  _In_ PSIZE_T FileNameSize,
3928 );
3929 
3930 NTSYSAPI
3931 NTSTATUS
3932 NTAPI
3934  _In_ ULONG dwFlags,
3935  _In_ const GUID *ExtensionGuid,
3936  _In_ ULONG SectionType,
3937  _In_ const UNICODE_STRING *SectionName,
3938  _Inout_ PVOID ReturnedData
3939 );
3940 
3941 NTSYSAPI
3942 NTSTATUS
3943 NTAPI
3945  _In_ DWORD dwFlags,
3947  _In_opt_ PVOID pvSubInstance,
3948  _In_ ULONG ulInfoClass,
3949  _Out_bytecap_(cbBuffer) PVOID pvBuffer,
3950  _In_opt_ SIZE_T cbBuffer,
3951  _Out_opt_ SIZE_T *pcbWrittenOrRequired
3952 );
3953 
3954 NTSYSAPI
3955 NTSTATUS
3956 NTAPI
3958  _In_ ULONG ulInfoClass,
3959  _Out_bytecap_(cbBuffer) PVOID pvBuffer,
3960  _In_opt_ SIZE_T cbBuffer,
3961  _Out_opt_ SIZE_T *pcbWrittenOrRequired
3962 );
3963 
3964 NTSYSAPI
3965 NTSTATUS
3966 NTAPI
3968  PVOID Context
3969 );
3970 
3971 //
3972 // WOW64 Functions
3973 //
3974 NTSYSAPI
3975 NTSTATUS
3976 NTAPI
3978  _In_ BOOLEAN Wow64FsEnableRedirection
3979 );
3980 
3981 NTSYSAPI
3982 NTSTATUS
3983 NTAPI
3985  _In_ PVOID Wow64FsEnableRedirection,
3986  _Out_ PVOID *OldFsRedirectionLevel
3987 );
3988 
3989 #endif
3990 
3991 //
3992 // Registry Functions
3993 //
3996 NTSYSAPI
3997 NTSTATUS
3998 NTAPI
4000  _In_ ULONG RelativeTo,
4001  _In_ PWSTR Path
4002 );
4003 
4004 NTSYSAPI
4005 NTSTATUS
4006 NTAPI
4008  _In_ ULONG RelativeTo,
4009  _In_ PWSTR Path
4010 );
4011 
4012 NTSYSAPI
4013 NTSTATUS
4014 NTAPI
4016  _Out_ _At_(KeyPath->Buffer, __drv_allocatesMem(Mem) _Post_bytecap_(KeyPath->MaximumLength) _Post_bytecount_(KeyPath->Length))
4017  PUNICODE_STRING KeyPath
4018 );
4019 
4020 NTSYSAPI
4021 NTSTATUS
4022 NTAPI
4026 );
4027 
4029 NTSYSAPI
4030 NTSTATUS
4031 NTAPI
4033  _In_ ULONG RelativeTo,
4034  _In_ PCWSTR Path,
4035  _Inout_ _At_(*(*QueryTable).EntryContext, _Pre_unknown_)
4039 );
4040 
4042 NTSYSAPI
4043 NTSTATUS
4044 NTAPI
4046  _In_ ULONG RelativeTo,
4052 );
4053 
4054 #ifdef NTOS_MODE_USER
4055 NTSYSAPI
4056 NTSTATUS
4057 NTAPI
4065 );
4066 
4067 NTSYSAPI
4068 NTSTATUS
4069 NTAPI
4073  _In_ ULONG Index,
4074  _In_ ULONG Unused
4075 );
4076 
4077 NTSYSAPI
4078 NTSTATUS
4079 NTAPI
4082 );
4083 
4084 NTSYSAPI
4085 NTSTATUS
4086 NTAPI
4091  _In_ ULONG Unused
4092 );
4093 
4094 NTSYSAPI
4095 NTSTATUS
4096 NTAPI
4102  _In_ ULONG Unused
4103 );
4104 
4105 NTSYSAPI
4106 NTSTATUS
4107 NTAPI
4110  _In_ ULONG Type,
4111  _In_ PVOID Data,
4113 );
4114 #endif
4115 
4116 //
4117 // NLS Functions
4118 //
4119 NTSYSAPI
4120 VOID
4121 NTAPI
4125 );
4126 
4127 NTSYSAPI
4128 VOID
4129 NTAPI
4131  _In_ PUSHORT AnsiTableBase,
4132  _In_ PUSHORT OemTableBase,
4133  _In_ PUSHORT CaseTableBase,
4134  _Out_ PNLSTABLEINFO NlsTable
4135 );
4136 
4138 NTSYSAPI
4139 VOID
4140 NTAPI
4142  _In_ PUSHORT TableBase,
4144 );
4145 
4146 NTSYSAPI
4147 VOID
4148 NTAPI
4150  _In_ PNLSTABLEINFO NlsTable);
4151 
4152 #if defined(NTOS_MODE_USER) && !defined(NO_RTL_INLINES)
4153 
4154 //
4155 // Misc conversion functions
4156 //
4157 static __inline
4161  _In_ LONG SignedInteger
4162 )
4163 {
4165 
4166  Result.QuadPart = SignedInteger;
4167  return Result;
4168 }
4169 
4170 static __inline
4174  _In_ LONG Multiplicand,
4175  _In_ LONG Multiplier
4176 )
4177 {
4178  LARGE_INTEGER Product;
4179 
4180  Product.QuadPart = (LONGLONG)Multiplicand * (ULONGLONG)Multiplier;
4181  return Product;
4182 }
4183 
4184 static __inline
4185 ULONG
4188  _In_ ULARGE_INTEGER Dividend,
4189  _In_ ULONG Divisor,
4191 )
4192 {
4193  ULONG Quotient;
4194 
4195  Quotient = (ULONG)(Dividend.QuadPart / Divisor);
4196  if (Remainder) {
4197  *Remainder = (ULONG)(Dividend.QuadPart % Divisor);
4198  }
4199 
4200  return Quotient;
4201 }
4202 
4203 static __inline
4207  _In_ ULONG Multiplicand,
4208  _In_ ULONG Multiplier
4209 )
4210 {
4211  LARGE_INTEGER Product;
4212 
4213  Product.QuadPart = (ULONGLONG)Multiplicand * (ULONGLONG)Multiplier;
4214  return Product;
4215 }
4216 
4217 #if defined(_AMD64_) || defined(_IA64_)
4218 static __inline
4222  _In_ LARGE_INTEGER Dividend,
4223  _In_ ULONG Divisor,
4225 {
4227  ret.QuadPart = (ULONG64)Dividend.QuadPart / Divisor;
4228  if (Remainder)
4229  *Remainder = (ULONG)(Dividend.QuadPart % Divisor);
4230  return ret;
4231 }
4232 
4233 #else
4234 NTSYSAPI
4236 NTAPI
4238  _In_ LARGE_INTEGER Dividend,
4239  _In_ ULONG Divisor,
4241 );
4242 
4243 #endif /* defined(_AMD64_) || defined(_IA64_) */
4244 
4245 #endif
4246 
4247 
4248 NTSYSAPI
4249 ULONG
4250 NTAPI
4251 RtlUniform(
4252  _In_ PULONG Seed
4253 );
4254 
4255 NTSYSAPI
4256 ULONG
4257 NTAPI
4258 RtlRandom(
4259  _Inout_ PULONG Seed
4260 );
4261 
4262 NTSYSAPI
4263 ULONG
4264 NTAPI
4266  _In_ ULONG InitialCrc,
4267  _In_ PUCHAR Buffer,
4268  _In_ ULONG Length
4269 );
4270 
4271 //
4272 // Network Functions
4273 //
4274 NTSYSAPI
4275 PSTR
4276 NTAPI
4278  _In_ const struct in_addr *Addr,
4279  _Out_writes_(16) PCHAR S
4280 );
4281 
4282 NTSYSAPI
4283 PWSTR
4284 NTAPI
4286  _In_ const struct in_addr *Addr,
4287  _Out_writes_(16) PWCHAR S
4288 );
4289 
4290 NTSYSAPI
4291 NTSTATUS
4292 NTAPI
4294  _In_ const struct in_addr *Address,
4295  _In_ USHORT Port,
4296  _Out_writes_to_(*AddressStringLength, *AddressStringLength) PCHAR AddressString,
4297  _Inout_ PULONG AddressStringLength
4298 );
4299 
4300 NTSTATUS
4301 NTAPI
4303  _In_ const struct in_addr *Address,
4304  _In_ USHORT Port,
4305  _Out_writes_to_(*AddressStringLength, *AddressStringLength) PWCHAR AddressString,
4306  _Inout_ PULONG AddressStringLength
4307 );
4308 
4309 NTSYSAPI
4310 NTSTATUS
4311 NTAPI
4313  _In_ PCSTR String,
4314  _In_ BOOLEAN Strict,
4315  _Out_ PCSTR *Terminator,
4316  _Out_ struct in_addr *Addr
4317 );
4318 
4319 NTSYSAPI
4320 NTSTATUS
4321 NTAPI
4323  _In_ PCWSTR String,
4324  _In_ BOOLEAN Strict,
4325  _Out_ PCWSTR *Terminator,
4326  _Out_ struct in_addr *Addr
4327 );
4328 
4329 NTSYSAPI
4330 NTSTATUS
4331 NTAPI
4333  _In_ PCSTR AddressString,
4334  _In_ BOOLEAN Strict,
4335  _Out_ struct in_addr *Address,
4337 );
4338 
4339 NTSYSAPI
4340 NTSTATUS
4341 NTAPI
4343  _In_ PCWSTR AddressString,
4344  _In_ BOOLEAN Strict,
4345  _Out_ struct in_addr *Address,
4347 );
4348 
4349 NTSYSAPI
4350 PSTR
4351 NTAPI
4353  _In_ const struct in6_addr *Addr,
4354  _Out_writes_(46) PSTR S
4355 );
4356 
4357 NTSYSAPI
4358 PWSTR
4359 NTAPI
4361  _In_ const struct in6_addr *Addr,
4362  _Out_writes_(46) PWSTR S
4363 );
4364 
4365 NTSYSAPI
4366 NTSTATUS
4367 NTAPI
4369  _In_ const struct in6_addr *Address,
4370  _In_ ULONG ScopeId,
4371  _In_ USHORT Port,
4372  _Out_writes_to_(*AddressStringLength, *AddressStringLength) PSTR AddressString,
4373  _Inout_ PULONG AddressStringLength
4374 );
4375 
4376 NTSYSAPI
4377 NTSTATUS
4378 NTAPI
4380  _In_ const struct in6_addr *Address,
4381  _In_ ULONG ScopeId,
4382  _In_ USHORT Port,
4383  _Out_writes_to_(*AddressStringLength, *AddressStringLength) PWCHAR AddressString,
4384  _Inout_ PULONG AddressStringLength
4385 );
4386 
4387 NTSYSAPI
4388 NTSTATUS
4389 NTAPI
4391  _In_ PCSTR String,
4392  _Out_ PCSTR *Terminator,
4393  _Out_ struct in6_addr *Addr
4394 );
4395 
4396 NTSYSAPI
4397 NTSTATUS
4398 NTAPI
4400  _In_ PCWSTR String,
4401  _Out_ PCWSTR *Terminator,
4402  _Out_ struct in6_addr *Addr
4403 );
4404 
4405 NTSYSAPI
4406 NTSTATUS
4407 NTAPI
4409  _In_ PCSTR AddressString,
4410  _Out_ struct in6_addr *Address,
4411  _Out_ PULONG ScopeId,
4413 );
4414 
4415 NTSYSAPI
4416 NTSTATUS
4417 NTAPI
4419  _In_ PCWSTR AddressString,
4420  _Out_ struct in6_addr *Address,
4421  _Out_ PULONG ScopeId,
4423 );
4424 
4425 
4426 //
4427 // Time Functions
4428 //
4429 NTSYSAPI
4430 NTSTATUS
4431 NTAPI
4433  _Out_ PRTL_TIME_ZONE_INFORMATION TimeZoneInformation);
4434 
4435 NTSYSAPI
4436 VOID
4437 NTAPI
4439  _In_ ULONG SecondsSince1970,
4441 );
4442 
4443 NTSYSAPI
4444 NTSTATUS
4445 NTAPI
4447  _In_ PRTL_TIME_ZONE_INFORMATION TimeZoneInformation);
4448 
4449 _Success_(return!=FALSE)
4451 NTSYSAPI
4452 BOOLEAN
4453 NTAPI
4457 );
4458 
4459 _Success_(return != 0)
4461 NTSYSAPI
4462 BOOLEAN
4463 NTAPI
4467 );
4468 
4469 NTSYSAPI
4470 VOID
4471 NTAPI
4475 );
4476 
4477 NTSYSAPI
4478 NTSTATUS
4479 NTAPI
4481  _In_ PLARGE_INTEGER SystemTime,
4482  _Out_ PLARGE_INTEGER LocalTime
4483 );
4484 
4485 //
4486 // Version Functions
4487 //
4490 NTSYSAPI
4491 NTSTATUS
4492 NTAPI
4494  _In_ PRTL_OSVERSIONINFOEXW VersionInfo,
4497 );
4498 
4500 NTSYSAPI
4501 NTSTATUS
4502 NTAPI
4504  _Out_
4505  _At_(lpVersionInformation->dwOSVersionInfoSize, _Pre_ _Valid_)
4506  _When_(lpVersionInformation->dwOSVersionInfoSize == sizeof(RTL_OSVERSIONINFOEXW),
4507  _At_((PRTL_OSVERSIONINFOEXW)lpVersionInformation, _Out_))
4508  PRTL_OSVERSIONINFOW lpVersionInformation
4509 );
4510 
4511 NTSYSAPI
4512 BOOLEAN
4513 NTAPI
4515 
4516 //
4517 // Secure Memory Functions
4518 //
4519 #ifdef NTOS_MODE_USER
4520 NTSYSAPI
4521 NTSTATUS
4522 NTAPI
4524  _In_ PRTL_SECURE_MEMORY_CACHE_CALLBACK Callback);
4525 
4526 NTSYSAPI
4527 BOOLEAN
4528 NTAPI
4530  _In_ PVOID MemoryCache,
4531  _In_opt_ SIZE_T MemoryLength
4532 );
4533 #endif
4534 
4535 //
4536 // Boot Status Data Functions
4537 //
4538 #ifdef NTOS_MODE_USER
4539 NTSYSAPI
4540 NTSTATUS
4541 NTAPI
4543  VOID
4544 );
4545 
4546 NTSYSAPI
4547 NTSTATUS
4548 NTAPI
4551  _In_ BOOLEAN WriteMode,
4552  _In_ RTL_BSD_ITEM_TYPE DataClass,
4553  _In_ PVOID Buffer,
4556 );
4557 
4558 NTSYSAPI
4559 NTSTATUS
4560 NTAPI
4563 );
4564 
4565 NTSYSAPI
4566 NTSTATUS
4567 NTAPI
4570 );
4571 #endif
4572 
4573 #ifdef NTOS_MODE_USER
4575 NTSYSAPI
4576 NTSTATUS
4577 NTAPI
4580  _Out_ GUID *Guid);
4581 
4583 NTSYSAPI
4584 NTSTATUS
4585 NTAPI
4587  _In_ REFGUID Guid,
4588  _Out_ _At_(GuidString->Buffer, __drv_allocatesMem(Mem))
4590 
4591 NTSYSAPI
4592 NTSTATUS
4593 NTAPI
4595  _In_ HANDLE hFile,
4596  _Out_ PCHAR Hash,
4597  _In_ ULONG ImportTableHashRevision
4598 );
4599 #endif
4600 
4601 //
4602 // MemoryStream functions
4603 //
4604 #ifdef NTOS_MODE_USER
4605 
4606 NTSYSAPI
4607 VOID
4608 NTAPI
4610  _Out_ PRTL_MEMORY_STREAM Stream
4611 );
4612 
4613 NTSYSAPI
4614 VOID
4615 NTAPI
4617  _Out_ PRTL_MEMORY_STREAM Stream
4618 );
4619 
4620 NTSYSAPI
4621 VOID
4622 NTAPI
4624  _In_ PRTL_MEMORY_STREAM Stream
4625 );
4626 
4627 NTSYSAPI
4628 HRESULT
4629 NTAPI
4631  _In_ struct IStream *This,
4632  _In_ REFIID RequestedIid,
4633  _Outptr_ PVOID *ResultObject
4634 );
4635 
4636 NTSYSAPI
4637 ULONG
4638 NTAPI
4640  _In_ struct IStream *This
4641 );
4642 
4643 NTSYSAPI
4644 ULONG
4645 NTAPI
4647  _In_ struct IStream *This
4648 );
4649 
4650 NTSYSAPI
4651 HRESULT
4652 NTAPI
4654  _In_ struct IStream *This,
4656  _In_ ULONG Length,
4658 );
4659 
4660 NTSYSAPI
4661 HRESULT
4662 NTAPI
4664  _In_ struct IStream *This,
4666  _In_ ULONG Length,
4668 );
4669 
4670 NTSYSAPI
4671 HRESULT
4672 NTAPI
4674  _In_ struct IStream *This,
4675  _In_ LARGE_INTEGER RelativeOffset,
4676  _In_ ULONG Origin,
4677  _Out_opt_ PULARGE_INTEGER ResultOffset
4678 );
4679 
4680 NTSYSAPI
4681 HRESULT
4682 NTAPI
4684  _In_ struct IStream *This,
4685  _In_ struct IStream *Target,
4689 );
4690 
4691 NTSYSAPI
4692 HRESULT
4693 NTAPI
4694 RtlCopyOutOfProcessMemoryStreamTo(
4695  _In_ struct IStream *This,
4696  _In_ struct IStream *Target,
4700 );
4701 
4702 NTSYSAPI
4703 HRESULT
4704 NTAPI
4706  _In_ struct IStream *This,
4707  _Out_ struct tagSTATSTG *Stats,
4708  _In_ ULONG Flags
4709 );
4710 
4711 // Dummy functions
4712 NTSYSAPI
4713 HRESULT
4714 NTAPI
4716  _In_ struct IStream *This,
4718  _In_ ULONG Length,
4720 );
4721 
4722 NTSYSAPI
4723 HRESULT
4724 NTAPI
4726  _In_ struct IStream *This,
4728 );
4729 
4730 NTSYSAPI
4731 HRESULT
4732 NTAPI
4734  _In_ struct IStream *This,
4735  _In_ ULONG CommitFlags
4736 );
4737 
4738 NTSYSAPI
4739 HRESULT
4740 NTAPI
4742  _In_ struct IStream *This
4743 );
4744 
4745 NTSYSAPI
4746 HRESULT
4747 NTAPI
4749  _In_ struct IStream *This,
4752  _In_ ULONG LockType
4753 );
4754 
4755 NTSYSAPI
4756 HRESULT
4757 NTAPI
4759  _In_ struct IStream *This,
4762  _In_ ULONG LockType
4763 );
4764 
4765 NTSYSAPI
4766 HRESULT
4767 NTAPI
4769  _In_ struct IStream *This,
4770  _Outptr_ struct IStream **ResultStream
4771 );
4772 
4773 NTSYSAPI
4774 NTSTATUS
4775 NTAPI
4776 RtlGetNativeSystemInformation(
4777  _In_ SYSTEM_INFORMATION_CLASS SystemInformationClass,
4778  _Out_writes_bytes_to_opt_(SystemInformationLength, *ReturnLength) PVOID SystemInformation,
4779  _In_ ULONG SystemInformationLength,
4781 );
4782 
4783 #endif // NTOS_MODE_USER
4784 
4785 NTSYSAPI
4786 NTSTATUS
4787 NTAPI
4789  ULONG flags,
4790  const GUID *extguid,
4791  ULONG section_kind,
4792  const GUID *guid,
4793  void *ptr
4794 );
4795 
4796 #ifdef __cplusplus
4797 }
4798 #endif
4799 
4800 #endif
enum _SYSTEM_INFORMATION_CLASS SYSTEM_INFORMATION_CLASS
NTSYSAPI VOID NTAPI RtlConvertExclusiveToShared(_In_ PRTL_RESOURCE Resource)
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:4002
IN PDCB IN POEM_STRING IN PUNICODE_STRING IN OUT POEM_STRING ShortName
Definition: fatprocs.h:1294
_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)
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2374
PVOID NTAPI RtlEncodeSystemPointer(IN PVOID Pointer)
Definition: process.c:429
signed char * PCHAR
Definition: retypes.h:7
NTSYSAPI ULONG NTAPI RtlRandom(_Inout_ PULONG Seed)
CONST WCHAR * PCWCH
Definition: ntbasedef.h:418
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)
NTSYSAPI ULONG WINAPI RtlNtStatusToDosErrorNoTeb(NTSTATUS)
static int Hash(const char *)
Definition: reader.c:2257
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:4495
IN CINT OUT PVOID IN ULONG OUT PULONG ReturnLength
Definition: dumpinfo.c:39
static PWSTR GuidString
Definition: apphelp.c:91
CPPORT Port[4]
Definition: headless.c:34
_Must_inspect_result_ typedef _In_ PVOID Unused
Definition: iotypes.h:1129
#define _Pre_unknown_
Definition: no_sal2.h:535
const uint16_t * PCWSTR
Definition: typedefs.h:55
_In_ PCWSTR _Inout_ _At_ QueryTable _Pre_unknown_ PRTL_QUERY_REGISTRY_TABLE QueryTable
Definition: rtlfuncs.h:4035
#define IN
Definition: typedefs.h:38
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)
return
Definition: dirsup.c:529
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)