ReactOS  0.4.14-dev-593-g1793dcc
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 //
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))
2185 );
2186 
2187 NTSYSAPI
2188 VOID
2189 NTAPI
2192 );
2193 
2194 NTSYSAPI
2195 NTSTATUS
2196 NTAPI
2202 );
2203 
2212 NTSYSAPI
2213 VOID
2214 NTAPI
2218 );
2219 
2228 NTSYSAPI
2229 VOID
2230 NTAPI
2234 );
2235 
2237 NTSYSAPI
2238 NTSTATUS
2239 NTAPI
2243 );
2244 
2245 NTSYSAPI
2246 BOOLEAN
2247 NTAPI
2249  _In_ CONST VOID* Buffer,
2250  _In_ INT Size,
2252 );
2253 
2256 NTSYSAPI
2257 BOOLEAN
2258 NTAPI
2260  _In_ const STRING *String1,
2263 );
2264 
2267 NTSYSAPI
2268 BOOLEAN
2269 NTAPI
2271  _In_ PCUNICODE_STRING String1,
2274 );
2275 
2277 NTSYSAPI
2278 VOID
2279 NTAPI
2283 );
2284 
2287 NTSYSAPI
2288 LONG
2289 NTAPI
2291  _In_ const STRING *String1,
2294 );
2295 
2296 NTSYSAPI
2297 VOID
2298 NTAPI
2302 );
2303 
2306 NTSYSAPI
2307 BOOLEAN
2308 NTAPI
2310  _In_ const STRING *String1,
2313 );
2314 
2316 NTSYSAPI
2317 NTSTATUS
2318 NTAPI
2322 );
2323 
2326 NTSYSAPI
2327 NTSTATUS
2328 NTAPI
2335 );
2336 
2338 NTSYSAPI
2339 NTSTATUS
2340 NTAPI
2345 );
2346 
2347 NTSYSAPI
2348 NTSTATUS
2349 NTAPI
2351  _In_ ULONG Flags,
2353 );
2354 
2355 #define RTL_SKIP_BUFFER_COPY 0x00000001
2356 
2357 NTSYSAPI
2358 NTSTATUS
2359 NTAPI
2361  _In_ ULONG Flags,
2364 );
2365 
2366 #ifdef NTOS_MODE_USER
2367 
2369 VOID
2370 RtlInitBuffer(
2372  _In_ PUCHAR Data,
2374 )
2375 {
2376  Buffer->Buffer = Buffer->StaticBuffer = Data;
2377  Buffer->Size = Buffer->StaticSize = DataSize;
2378  Buffer->ReservedForAllocatedSize = 0;
2379  Buffer->ReservedForIMalloc = NULL;
2380 }
2381 
2383 NTSTATUS
2384 RtlEnsureBufferSize(
2385  _In_ ULONG Flags,
2388 )
2389 {
2390  if (Buffer && RequiredSize <= Buffer->Size)
2391  return STATUS_SUCCESS;
2393 }
2394 
2396 VOID
2397 RtlFreeBuffer(
2399 )
2400 {
2401  if (Buffer->Buffer != Buffer->StaticBuffer && Buffer->Buffer)
2402  RtlFreeHeap(RtlGetProcessHeap(), 0, Buffer->Buffer);
2403  Buffer->Buffer = Buffer->StaticBuffer;
2404  Buffer->Size = Buffer->StaticSize;
2405 }
2406 
2407 #endif /* NTOS_MODE_USER */
2408 
2409 //
2410 // Ansi String Functions
2411 //
2413 NTSYSAPI
2414 VOID
2415 NTAPI
2417  _Inout_ _At_(AnsiString->Buffer, __drv_freesMem(Mem))
2419 );
2420 
2422 NTSYSAPI
2423 VOID
2424 NTAPI
2428 );
2429 
2431 NTSYSAPI
2432 NTSTATUS
2433 NTAPI
2437 );
2438 
2439 //
2440 // OEM String Functions
2441 //
2443 NTSYSAPI
2444 VOID
2445 NTAPI
2447  _Inout_ _At_(OemString->Buffer, __drv_freesMem(Mem))
2449 );
2450 
2451 //
2452 // MultiByte->Unicode String Functions
2453 //
2455 NTSYSAPI
2456 NTSTATUS
2457 NTAPI
2464 );
2465 
2467 NTSYSAPI
2468 NTSTATUS
2469 NTAPI
2474 );
2475 
2476 //
2477 // Atom Functions
2478 //
2479 NTSYSAPI
2480 NTSTATUS
2481 NTAPI
2483  _In_ PRTL_ATOM_TABLE AtomTable,
2484  _In_ PWSTR AtomName,
2486 );
2487 
2488 NTSYSAPI
2489 NTSTATUS
2490 NTAPI
2493  _Inout_ PRTL_ATOM_TABLE *AtomTable
2494 );
2495 
2496 NTSYSAPI
2497 NTSTATUS
2498 NTAPI
2500  _In_ PRTL_ATOM_TABLE AtomTable,
2502 );
2503 
2504 NTSYSAPI
2505 NTSTATUS
2506 NTAPI
2508 
2509 NTSYSAPI
2510 NTSTATUS
2511 NTAPI
2513  _In_ PRTL_ATOM_TABLE AtomTable,
2514  _In_ RTL_ATOM Atom,
2515  _Out_opt_ PULONG RefCount,
2517  _Out_opt_z_bytecap_(*NameLength) PWSTR AtomName,
2518  _Inout_opt_ PULONG NameLength
2519 );
2520 
2521 NTSYSAPI
2522 NTSTATUS
2523 NTAPI
2525  _In_ PRTL_ATOM_TABLE AtomTable,
2527 );
2528 
2529 NTSYSAPI
2530 NTSTATUS
2531 NTAPI
2533  _In_ PRTL_ATOM_TABLE AtomTable,
2534  _In_ PWSTR AtomName,
2536 );
2537 
2538 //
2539 // Process Management Functions
2540 //
2541 NTSYSAPI
2542 PPEB
2543 NTAPI
2545  VOID
2546 );
2547 
2548 NTSYSAPI
2549 VOID
2550 NTAPI
2552 
2553 NTSYSAPI
2554 NTSTATUS
2555 NTAPI
2557  _Out_ PRTL_USER_PROCESS_PARAMETERS *ProcessParameters,
2558  _In_ PUNICODE_STRING ImagePathName,
2561  _In_opt_ PUNICODE_STRING CommandLine,
2563  _In_opt_ PUNICODE_STRING WindowTitle,
2564  _In_opt_ PUNICODE_STRING DesktopInfo,
2565  _In_opt_ PUNICODE_STRING ShellInfo,
2566  _In_opt_ PUNICODE_STRING RuntimeInfo
2567 );
2568 
2569 NTSYSAPI
2570 NTSTATUS
2571 NTAPI
2573  _In_ PUNICODE_STRING ImageFileName,
2575  _In_ PRTL_USER_PROCESS_PARAMETERS ProcessParameters,
2576  _In_opt_ PSECURITY_DESCRIPTOR ProcessSecutityDescriptor,
2577  _In_opt_ PSECURITY_DESCRIPTOR ThreadSecurityDescriptor,
2578  _In_opt_ HANDLE ParentProcess,
2580  _In_opt_ HANDLE DebugPort,
2581  _In_opt_ HANDLE ExceptionPort,
2583 );
2584 
2585 #if (NTDDI_VERSION >= NTDDI_WIN7)
2586 NTSYSAPI
2587 NTSTATUS
2588 NTAPI
2590  _In_ PVOID ThreadContext,
2591  _Out_ HANDLE *OutThreadHandle,
2597  _Reserved_ PVOID Reserved6,
2599  _Reserved_ PVOID Reserved8
2600 );
2601 #else
2602 NTSYSAPI
2603 NTSTATUS
2604 NTAPI
2608  _In_ BOOLEAN CreateSuspended,
2609  _In_ ULONG StackZeroBits,
2610  _In_ SIZE_T StackReserve,
2611  _In_ SIZE_T StackCommit,
2612  _In_ PTHREAD_START_ROUTINE StartAddress,
2614  _Out_opt_ PHANDLE ThreadHandle,
2616 );
2617 #endif
2618 
2619 NTSYSAPI
2621 NTAPI
2623  _In_ PRTL_USER_PROCESS_PARAMETERS ProcessParameters);
2624 
2625 NTSYSAPI
2626 NTSTATUS
2627 NTAPI
2629  _In_ PRTL_USER_PROCESS_PARAMETERS ProcessParameters);
2630 
2631 NTSYSAPI
2632 VOID
2633 NTAPI
2635  _In_ NTSTATUS Status);
2636 
2637 NTSYSAPI
2638 VOID
2639 NTAPI
2642  _Out_ PCONTEXT ThreadContext,
2643  _In_opt_ PVOID ThreadStartParam,
2644  _In_ PTHREAD_START_ROUTINE ThreadStartAddress,
2645  _In_ PINITIAL_TEB InitialTeb
2646 );
2647 
2648 #ifdef _M_AMD64
2649 typedef struct _WOW64_CONTEXT *PWOW64_CONTEXT;
2650 
2651 NTSYSAPI
2652 NTSTATUS
2653 NTAPI
2654 RtlWow64GetThreadContext(
2655  _In_ HANDLE ThreadHandle,
2656  _Inout_ PWOW64_CONTEXT ThreadContext
2657 );
2658 
2659 
2660 NTSYSAPI
2661 NTSTATUS
2662 NTAPI
2663 RtlWow64SetThreadContext(
2664  _In_ HANDLE ThreadHandle,
2665  _In_ PWOW64_CONTEXT ThreadContext
2666 );
2667 #endif
2668 
2669 NTSYSAPI
2670 BOOLEAN
2671 NTAPI
2673 
2674 NTSYSAPI
2676 NTAPI
2678  _In_ PRTL_USER_PROCESS_PARAMETERS ProcessParameters);
2679 
2680 NTSYSAPI
2681 VOID
2682 NTAPI
2684 
2685 NTSYSAPI
2686 NTSTATUS
2687 NTAPI
2690  _In_ HANDLE Thread,
2691  _In_ PVOID CallSite,
2692  _In_ ULONG ArgumentCount,
2693  _In_ PULONG Arguments,
2694  _In_ BOOLEAN PassContext,
2695  _In_ BOOLEAN AlreadySuspended
2696 );
2697 
2698 NTSYSAPI
2699 NTSTATUS
2700 __cdecl
2702  _In_ BOOLEAN NewValue,
2703  _Out_opt_ PBOOLEAN OldValue,
2704  _In_ BOOLEAN NeedBreaks
2705 );
2706 
2707 NTSYSAPI
2708 NTSTATUS
2709 __cdecl
2711  _In_ BOOLEAN NewValue,
2712  _Out_opt_ PBOOLEAN OldValue,
2713  _In_ BOOLEAN NeedBreaks
2714 );
2715 
2716 NTSYSAPI
2717 ULONG
2718 NTAPI
2720  VOID
2721 );
2722 
2723 
2724 //
2725 // Thread Pool Functions
2726 //
2727 //
2728 NTSTATUS
2729 NTAPI
2731  _In_ PRTL_START_POOL_THREAD StartPoolThread,
2732  _In_ PRTL_EXIT_POOL_THREAD ExitPoolThread
2733 );
2734 
2735 NTSYSAPI
2736 NTSTATUS
2737 NTAPI
2739  _In_ HANDLE hWaitHandle,
2740  _In_opt_ HANDLE hCompletionEvent
2741 );
2742 
2743 NTSYSAPI
2744 NTSTATUS
2745 NTAPI
2747  _In_ HANDLE hWaitHandle
2748 );
2749 
2750 NTSYSAPI
2751 NTSTATUS
2752 NTAPI
2756  _In_ ULONG Flags
2757 );
2758 
2759 NTSYSAPI
2760 NTSTATUS
2761 NTAPI
2765  _In_ ULONG Flags
2766 );
2767 
2768 NTSYSAPI
2769 NTSTATUS
2770 NTAPI
2772  _In_ PHANDLE phNewWaitObject,
2773  _In_ HANDLE hObject,
2775  _In_ PVOID pvContext,
2776  _In_ ULONG ulMilliseconds,
2777  _In_ ULONG ulFlags
2778 );
2779 
2780 //
2781 // Environment/Path Functions
2782 //
2783 NTSYSAPI
2784 NTSTATUS
2785 NTAPI
2787  _In_ BOOLEAN Inherit,
2789 );
2790 
2791 NTSYSAPI
2792 NTSTATUS
2793 NTAPI
2795  _In_ PUNICODE_STRING DllName,
2796  _Inout_ PUNICODE_STRING RealName,
2797  _Inout_ PUNICODE_STRING LocalName
2798 );
2799 
2800 NTSYSAPI
2801 VOID
2802 NTAPI
2805 );
2806 
2807 NTSYSAPI
2808 BOOLEAN
2809 NTAPI
2812 );
2813 
2814 NTSYSAPI
2816 NTAPI
2818  _In_ PCWSTR Path
2819 );
2820 
2821 NTSYSAPI
2822 ULONG
2823 NTAPI
2825  _In_ PCWSTR Path,
2829  _Out_ PWSTR Buffer,
2830  _Out_ PWSTR *PartName
2831 );
2832 
2833 NTSYSAPI
2834 NTSTATUS
2835 NTAPI
2837  _In_ ULONG Flags,
2838  _In_ PUNICODE_STRING PathString,
2839  _In_ PUNICODE_STRING FileNameString,
2840  _In_ PUNICODE_STRING ExtensionString,
2841  _In_ PUNICODE_STRING CallerBuffer,
2843  _Out_opt_ PUNICODE_STRING* FullNameOut,
2844  _Out_opt_ PSIZE_T FilePartSize,
2846 );
2847 
2848 NTSYSAPI
2849 BOOLEAN
2850 NTAPI
2852  _In_opt_z_ PCWSTR DosPathName,
2853  _Out_ PUNICODE_STRING NtPathName,
2854  _Out_opt_ PCWSTR *NtFileNamePart,
2855  _Out_opt_ PRTL_RELATIVE_NAME_U DirectoryInfo
2856 );
2857 
2858 
2859 #define RTL_UNCHANGED_UNK_PATH 1
2860 #define RTL_CONVERTED_UNC_PATH 2
2861 #define RTL_CONVERTED_NT_PATH 3
2862 #define RTL_UNCHANGED_DOS_PATH 4
2863 
2864 NTSYSAPI
2865 NTSTATUS
2866 NTAPI
2868  _In_ ULONG Flags,
2872 );
2873 
2874 
2875 NTSYSAPI
2876 BOOLEAN
2877 NTAPI
2880  _Out_ PUNICODE_STRING NtName,
2881  _Out_ PCWSTR *PartName,
2882  _Out_ PRTL_RELATIVE_NAME_U RelativeName
2883 );
2884 
2886 NTSYSAPI
2887 NTSTATUS
2888 NTAPI
2894 );
2895 
2896 NTSYSAPI
2897 ULONG
2898 NTAPI
2902 );
2903 
2904 NTSYSAPI
2905 ULONG
2906 NTAPI
2909  _In_ ULONG Size,
2912 );
2913 
2914 #if (NTDDI_VERSION >= NTDDI_WIN7)
2915 NTSYSAPI
2916 NTSTATUS
2917 NTAPI
2921  _Out_ PWSTR Buffer,
2922  _Out_opt_ PWSTR *FilePart,
2923  _Out_opt_ RTL_PATH_TYPE *InputPathType
2924  );
2925 #endif
2926 
2927 NTSTATUS
2928 NTAPI
2934  _Out_opt_ PSIZE_T FilePartSize,
2938 );
2939 
2940 NTSYSAPI
2941 NTSTATUS
2942 NTAPI
2945  _In_ PCUNICODE_STRING PathString,
2947 );
2948 
2949 NTSYSAPI
2950 ULONG
2951 NTAPI
2953  VOID
2954 );
2955 
2956 NTSYSAPI
2957 ULONG
2958 NTAPI
2960  _In_ PCWSTR Name
2961 );
2962 
2963 NTSYSAPI
2964 ULONG
2965 NTAPI
2968 );
2969 
2972 NTSYSAPI
2973 BOOLEAN
2974 NTAPI
2979 );
2980 
2981 NTSYSAPI
2982 NTSTATUS
2983 NTAPI
2988 );
2989 
2990 VOID
2991 NTAPI
2993  _In_ PRTL_RELATIVE_NAME_U RelativeName
2994 );
2995 
2996 NTSYSAPI
2997 NTSTATUS
2998 NTAPI
3001 );
3002 
3003 NTSYSAPI
3004 NTSTATUS
3005 NTAPI
3010 );
3011 
3012 //
3013 // Critical Section/Resource Functions
3014 //
3015 NTSYSAPI
3016 NTSTATUS
3017 NTAPI
3020 );
3021 
3022 NTSYSAPI
3023 NTSTATUS
3024 NTAPI
3027 );
3028 
3029 NTSYSAPI
3030 NTSTATUS
3031 NTAPI
3034 );
3035 
3036 NTSYSAPI
3037 NTSTATUS
3038 NTAPI
3041  _In_ ULONG SpinCount
3042 );
3043 
3044 NTSYSAPI
3045 ULONG
3046 NTAPI
3049 );
3050 
3051 NTSYSAPI
3052 ULONG
3053 NTAPI
3056 );
3057 
3058 NTSYSAPI
3059 NTSTATUS
3060 NTAPI
3063 );
3064 
3065 NTSYSAPI
3066 BOOLEAN
3067 NTAPI
3070 );
3071 
3072 NTSYSAPI
3073 VOID
3074 NTAPI
3077 );
3078 
3079 NTSYSAPI
3080 NTSTATUS
3081 NTAPI
3084 );
3085 
3086 NTSYSAPI
3087 BOOLEAN
3088 NTAPI
3091  _In_ BOOLEAN Wait
3092 );
3093 
3094 NTSYSAPI
3095 BOOLEAN
3096 NTAPI
3099  _In_ BOOLEAN Wait
3100 );
3101 
3102 NTSYSAPI
3103 VOID
3104 NTAPI
3107 );
3108 
3109 NTSYSAPI
3110 VOID
3111 NTAPI
3114 );
3115 
3116 NTSYSAPI
3117 VOID
3118 NTAPI
3121 );
3122 
3123 NTSYSAPI
3124 VOID
3125 NTAPI
3128 );
3129 
3130 NTSYSAPI
3131 VOID
3132 NTAPI
3135 );
3136 
3137 NTSYSAPI
3138 VOID
3139 NTAPI
3142 );
3143 
3144 //
3145 // Compression Functions
3146 //
3147 NTSYSAPI //NT_RTL_COMPRESS_API
3148 NTSTATUS
3149 NTAPI
3151  _In_ USHORT CompressionFormatAndEngine,
3152  _In_reads_bytes_(UncompressedBufferSize) PUCHAR UncompressedBuffer,
3156  _In_ ULONG UncompressedChunkSize,
3157  _Out_ PULONG FinalCompressedSize,
3159 );
3160 
3162 NTSYSAPI //NT_RTL_COMPRESS_API
3163 NTSTATUS
3164 NTAPI
3166  _In_ USHORT CompressionFormat,
3172 );
3173 
3174 NTSYSAPI
3175 NTSTATUS
3176 NTAPI
3178  _In_ USHORT CompressionFormatAndEngine,
3179  _Out_ PULONG CompressBufferWorkSpaceSize,
3180  _Out_ PULONG CompressFragmentWorkSpaceSize
3181 );
3182 
3183 //
3184 // Frame Functions
3185 //
3186 NTSYSAPI
3187 VOID
3188 NTAPI
3189 RtlPopFrame(
3190  _In_ PTEB_ACTIVE_FRAME Frame
3191 );
3192 
3193 NTSYSAPI
3194 VOID
3195 NTAPI
3196 RtlPushFrame(
3197  _In_ PTEB_ACTIVE_FRAME Frame
3198 );
3199 
3200 NTSYSAPI
3202 NTAPI
3203 RtlGetFrame(
3204  VOID
3205 );
3206 
3207 //
3208 // Debug Info Functions
3209 //
3210 NTSYSAPI
3212 NTAPI
3214  _In_ ULONG Size,
3215  _In_ BOOLEAN EventPair
3216 );
3217 
3218 NTSYSAPI
3219 NTSTATUS
3220 NTAPI
3222 
3223 NTSYSAPI
3224 NTSTATUS
3225 NTAPI
3228  _In_ ULONG DebugInfoClassMask,
3229  _Inout_ PRTL_DEBUG_INFORMATION DebugBuffer
3230 );
3231 
3232 //
3233 // Bitmap Functions
3234 //
3235 #ifdef NTOS_MODE_USER
3236 
3237 NTSYSAPI
3238 BOOLEAN
3239 NTAPI
3241  _In_ PRTL_BITMAP BitMapHeader,
3243  _In_ ULONG Length
3244 );
3245 
3246 NTSYSAPI
3247 BOOLEAN
3248 NTAPI
3250  _In_ PRTL_BITMAP BitMapHeader,
3252  _In_ ULONG Length
3253 );
3254 
3255 NTSYSAPI
3256 VOID
3257 NTAPI
3259  _In_ PRTL_BITMAP BitMapHeader
3260 );
3261 
3262 NTSYSAPI
3263 VOID
3264 NTAPI
3265 RtlClearBit(
3266  _In_ PRTL_BITMAP BitMapHeader,
3267  _In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitNumber
3268 );
3269 
3270 NTSYSAPI
3271 VOID
3272 NTAPI
3273 RtlClearBits(
3274  _In_ PRTL_BITMAP BitMapHeader,
3275  _In_range_(0, BitMapHeader->SizeOfBitMap - NumberToClear) ULONG StartingIndex,
3276  _In_range_(0, BitMapHeader->SizeOfBitMap - StartingIndex) ULONG NumberToClear
3277 );
3278 
3279 NTSYSAPI
3280 ULONG
3281 NTAPI
3283  _In_ PRTL_BITMAP BitMapHeader,
3286 );
3287 
3288 NTSYSAPI
3289 ULONG
3290 NTAPI
3292  _In_ PRTL_BITMAP BitMapHeader,
3295 );
3296 
3297 NTSYSAPI
3298 ULONG
3299 NTAPI
3301  _In_ PRTL_BITMAP BitMapHeader,
3303 );
3304 
3305 NTSYSAPI
3306 ULONG
3307 NTAPI
3309  _In_ PRTL_BITMAP BitMapHeader,
3310  _Out_writes_to_(SizeOfRunArray, return) PRTL_BITMAP_RUN RunArray,
3311  _In_range_(>, 0) ULONG SizeOfRunArray,
3312  _In_ BOOLEAN LocateLongestRuns
3313 );
3314 
3315 NTSYSAPI
3316 ULONG
3317 NTAPI
3319  _In_ PRTL_BITMAP BitMapHeader,
3320  _In_ ULONG FromIndex,
3321  _Out_ PULONG StartingRunIndex
3322 );
3323 
3324 NTSYSAPI
3325 CCHAR
3326 NTAPI
3329 );
3330 
3331 NTSYSAPI
3332 ULONG
3333 NTAPI
3335  _In_ PRTL_BITMAP BitMapHeader,
3337 );
3338 
3339 NTSYSAPI
3340 CCHAR
3341 NTAPI
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 ULONG
3357 NTAPI
3359  _In_ PRTL_BITMAP BitMapHeader,
3360  _In_ ULONG FromIndex,
3361  _Out_ PULONG StartingRunIndex
3362 );
3363 
3364 NTSYSAPI
3365 ULONG
3366 NTAPI
3368  _In_ PRTL_BITMAP BitMapHeader,
3371 );
3372 
3373 NTSYSAPI
3374 ULONG
3375 NTAPI
3377  _In_ PRTL_BITMAP BitMapHeader,
3380 );
3381 
3382 #ifdef __REACTOS__ // ReactOS improvement
3383 _At_(BitMapHeader->SizeOfBitMap, _Post_equal_to_(SizeOfBitMap))
3384 _At_(BitMapHeader->Buffer, _Post_equal_to_(BitMapBuffer))
3385 #endif
3386 NTSYSAPI
3387 VOID
3388 NTAPI
3390  _Out_ PRTL_BITMAP BitMapHeader,
3391  _In_opt_ __drv_aliasesMem PULONG BitMapBuffer,
3392  _In_opt_ ULONG SizeOfBitMap
3393 );
3394 
3395 NTSYSAPI
3396 ULONG
3397 NTAPI
3399  _In_ PRTL_BITMAP BitMapHeader
3400 );
3401 
3402 NTSYSAPI
3403 ULONG
3404 NTAPI
3406  _In_ PRTL_BITMAP BitMapHeader
3407 );
3408 
3409 NTSYSAPI
3410 VOID
3411 NTAPI
3412 RtlSetBit(
3413  _In_ PRTL_BITMAP BitMapHeader,
3414  _In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitNumber
3415 );
3416 
3417 NTSYSAPI
3418 VOID
3419 NTAPI
3420 RtlSetBits(
3421  _In_ PRTL_BITMAP BitMapHeader,
3422  _In_range_(0, BitMapHeader->SizeOfBitMap - NumberToSet) ULONG StartingIndex,
3423  _In_range_(0, BitMapHeader->SizeOfBitMap - StartingIndex) ULONG NumberToSet
3424 );
3425 
3426 NTSYSAPI
3427 VOID
3428 NTAPI
3430  _In_ PRTL_BITMAP BitMapHeader
3431 );
3432 
3434 NTSYSAPI
3435 BOOLEAN
3436 NTAPI
3437 RtlTestBit(
3438  _In_ PRTL_BITMAP BitMapHeader,
3439  _In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitNumber
3440 );
3441 
3442 #if defined(_M_AMD64)
3445 BOOLEAN
3446 RtlCheckBit(
3447  _In_ PRTL_BITMAP BitMapHeader,
3448  _In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitPosition)
3449 {
3450  return BitTest64((LONG64 CONST*)BitMapHeader->Buffer, (LONG64)BitPosition);
3451 }
3452 #else
3453 #define RtlCheckBit(BMH,BP) (((((PLONG)(BMH)->Buffer)[(BP)/32]) >> ((BP)%32)) & 0x1)
3454 #endif /* defined(_M_AMD64) */
3455 
3456 #endif // NTOS_MODE_USER
3457 
3458 
3459 //
3460 // Timer Functions
3461 //
3462 NTSYSAPI
3463 NTSTATUS
3464 NTAPI
3466  _In_ HANDLE TimerQueue,
3467  _In_ PHANDLE phNewTimer,
3470  _In_ ULONG DueTime,
3471  _In_ ULONG Period,
3472  _In_ ULONG Flags
3473 );
3474 
3475 NTSYSAPI
3476 NTSTATUS
3477 NTAPI
3478 RtlCreateTimerQueue(PHANDLE TimerQueue);
3479 
3480 NTSYSAPI
3481 NTSTATUS
3482 NTAPI
3484  _In_ HANDLE TimerQueue,
3485  _In_ HANDLE Timer,
3486  _In_ HANDLE CompletionEvent
3487 );
3488 
3489 NTSYSAPI
3490 NTSTATUS
3491 NTAPI
3493  _In_ HANDLE TimerQueue,
3494  _In_ HANDLE Timer,
3495  _In_ ULONG DueTime,
3496  _In_ ULONG Period
3497 );
3498 
3499 NTSYSAPI
3500 NTSTATUS
3501 NTAPI
3503  _In_ HANDLE TimerQueue,
3504  _In_opt_ HANDLE CompletionEvent
3505 );
3506 
3507 NTSYSAPI
3508 NTSTATUS
3509 NTAPI
3510 RtlDeleteTimerQueue(HANDLE TimerQueue);
3511 
3512 //
3513 // SList functions
3514 //
3516 FASTCALL
3518  _Inout_ PSLIST_HEADER ListHead,
3521  _In_ ULONG Count
3522 );
3523 
3524 //
3525 // Range List functions
3526 //
3527 NTSYSAPI
3528 VOID
3529 NTAPI
3531  _Inout_ PRTL_RANGE_LIST RangeList
3532 );
3533 
3534 NTSYSAPI
3535 VOID
3536 NTAPI
3538  _In_ PRTL_RANGE_LIST RangeList
3539 );
3540 
3541 NTSYSAPI
3542 NTSTATUS
3543 NTAPI
3544 RtlAddRange(
3545  _Inout_ PRTL_RANGE_LIST RangeList,
3547  _In_ ULONGLONG End,
3549  _In_ ULONG Flags,
3552 );
3553 
3554 //
3555 // Debug Functions
3556 //
3557 ULONG
3558 __cdecl
3559 DbgPrint(
3561  ...
3562 );
3563 
3564 NTSYSAPI
3565 ULONG
3566 __cdecl
3567 DbgPrintEx(
3569  _In_ ULONG Level,
3571  ...
3572 );
3573 
3574 NTSYSAPI
3575 ULONG
3576 NTAPI
3577 DbgPrompt(
3578  _In_z_ PCCH Prompt,
3581 );
3582 
3583 #undef DbgBreakPoint
3584 VOID
3585 NTAPI
3587  VOID
3588 );
3589 
3590 VOID
3591 NTAPI
3593  _In_ PSTRING Name,
3594  _In_ PVOID Base,
3596 );
3597 
3598 VOID
3599 NTAPI
3601  _In_ PSTRING Name,
3602  _In_ PVOID Base,
3604 );
3605 
3606 VOID
3607 NTAPI
3609  _In_ PCCH Name,
3610  _In_ PCCH Command
3611 );
3612 
3613 //
3614 // Generic Table Functions
3615 //
3616 #if defined(NTOS_MODE_USER) || defined(_NTIFS_)
3617 NTSYSAPI
3618 PVOID
3619 NTAPI
3624  _Out_opt_ PBOOLEAN NewElement
3625 );
3626 
3627 NTSYSAPI
3628 PVOID
3629 NTAPI
3634  _Out_opt_ PBOOLEAN NewElement,
3635  _In_ PVOID NodeOrParent,
3636  _In_ TABLE_SEARCH_RESULT SearchResult
3637 );
3638 
3639 NTSYSAPI
3640 BOOLEAN
3641 NTAPI
3644 );
3645 
3646 NTSYSAPI
3647 PVOID
3648 NTAPI
3651  _In_ PVOID Buffer,
3652  _Out_ PVOID *NodeOrParent,
3653  _Out_ TABLE_SEARCH_RESULT *SearchResult
3654 );
3655 #endif
3656 
3657 //
3658 // Handle Table Functions
3659 //
3660 NTSYSAPI
3662 NTAPI
3666 );
3667 
3668 NTSYSAPI
3669 VOID
3670 NTAPI
3673 
3674 NTSYSAPI
3675 BOOLEAN
3676 NTAPI
3680 );
3681 
3682 NTSYSAPI
3683 VOID
3684 NTAPI
3687  _In_ ULONG HandleSize,
3689 );
3690 
3691 NTSYSAPI
3692 BOOLEAN
3693 NTAPI
3697 );
3698 
3699 _Success_(return!=FALSE)
3700 NTSYSAPI
3701 BOOLEAN
3702 NTAPI
3707 );
3708 
3709 //
3710 // PE Functions
3711 //
3712 NTSYSAPI
3713 NTSTATUS
3714 NTAPI
3717  _In_ ULONG Type,
3718  _In_ ULONG Language,
3719  _In_ ULONG MessageId,
3720  _Out_ PMESSAGE_RESOURCE_ENTRY *MessageResourceEntry
3721 );
3722 
3723 NTSYSAPI
3724 ULONG
3725 NTAPI
3727 
3728 _Success_(return!=NULL)
3729 NTSYSAPI
3730 PVOID
3731 NTAPI
3736  _Out_ PULONG Size
3737 );
3738 
3739 NTSYSAPI
3740 PVOID
3741 NTAPI
3743  _In_ PIMAGE_NT_HEADERS NtHeader,
3745  _In_ ULONG Rva,
3746  _Inout_opt_ PIMAGE_SECTION_HEADER *SectionHeader
3747 );
3748 
3749 NTSYSAPI
3751 NTAPI
3754 
3755 NTSYSAPI
3756 NTSTATUS
3757 NTAPI
3759  _In_ ULONG Flags,
3762  _Out_ PIMAGE_NT_HEADERS *NtHeader
3763 );
3764 
3765 NTSYSAPI
3767 NTAPI
3769  _In_ PIMAGE_NT_HEADERS NtHeader,
3771  _In_ ULONG Rva
3772 );
3773 
3774 NTSYSAPI
3775 ULONG
3776 NTAPI
3778  _In_ PVOID NewAddress,
3779  _In_ LONGLONG AdditionalBias,
3780  _In_ PCCH LoaderName,
3781  _In_ ULONG Success,
3782  _In_ ULONG Conflict,
3783  _In_ ULONG Invalid
3784 );
3785 
3786 //
3787 // Activation Context Functions
3788 //
3789 #ifdef NTOS_MODE_USER
3790 NTSYSAPI
3791 NTSTATUS
3792 NTAPI
3794  _In_ ULONG Flags,
3795  _In_ PTEB Teb,
3796  _In_ PVOID Context,
3798 );
3799 
3800 NTSYSAPI
3801 NTSTATUS
3802 NTAPI
3804  _In_ ULONG Flags,
3805  _In_ HANDLE Handle,
3807 );
3808 
3809 NTSYSAPI
3810 VOID
3811 NTAPI
3814 );
3815 
3816 NTSYSAPI
3818 FASTCALL
3820  _In_ PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED Frame,
3822 );
3823 
3824 NTSYSAPI
3825 NTSTATUS
3826 NTAPI
3829 );
3830 
3831 NTSYSAPI
3832 NTSTATUS
3833 NTAPI
3835  _In_ ULONG Flags,
3836  _In_ PACTIVATION_CONTEXT_DATA ActivationContextData,
3837  _In_ ULONG ExtraBytes,
3838  _In_ PVOID NotificationRoutine,
3841 );
3842 
3843 NTSYSAPI
3844 NTSTATUS
3845 NTAPI
3847  _In_ PVOID *Context
3848 );
3849 
3850 NTSYSAPI
3851 VOID
3852 NTAPI
3855 );
3856 
3857 NTSYSAPI
3858 NTSTATUS
3859 NTAPI
3861  _In_ ULONG dwFlags,
3862  _In_ ULONG_PTR ulCookie
3863 );
3864 
3865 NTSYSAPI
3866 VOID
3867 NTAPI
3870 );
3871 
3872 NTSYSAPI
3873 VOID
3874 NTAPI
3876 
3877 NTSYSAPI
3879 FASTCALL
3881  _In_ PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED Frame
3882 );
3883 
3884 NTSYSAPI
3885 NTSTATUS
3886 NTAPI
3888  _In_ ULONG Flags,
3889  _In_ PUNICODE_STRING OriginalName,
3894  _In_ PULONG NewFlags,
3895  _In_ PSIZE_T FileNameSize,
3897 );
3898 
3899 NTSYSAPI
3900 NTSTATUS
3901 NTAPI
3903  _In_ ULONG dwFlags,
3904  _In_ const GUID *ExtensionGuid,
3905  _In_ ULONG SectionType,
3906  _In_ const UNICODE_STRING *SectionName,
3907  _Inout_ PVOID ReturnedData
3908 );
3909 
3910 NTSYSAPI
3911 NTSTATUS
3912 NTAPI
3914  _In_ DWORD dwFlags,
3916  _In_opt_ PVOID pvSubInstance,
3917  _In_ ULONG ulInfoClass,
3918  _Out_bytecap_(cbBuffer) PVOID pvBuffer,
3919  _In_opt_ SIZE_T cbBuffer,
3920  _Out_opt_ SIZE_T *pcbWrittenOrRequired
3921 );
3922 
3923 NTSYSAPI
3924 NTSTATUS
3925 NTAPI
3927  _In_ ULONG ulInfoClass,
3928  _Out_bytecap_(cbBuffer) PVOID pvBuffer,
3929  _In_opt_ SIZE_T cbBuffer,
3930  _Out_opt_ SIZE_T *pcbWrittenOrRequired
3931 );
3932 
3933 NTSYSAPI
3934 NTSTATUS
3935 NTAPI
3937  PVOID Context
3938 );
3939 
3940 //
3941 // WOW64 Functions
3942 //
3943 NTSYSAPI
3944 NTSTATUS
3945 NTAPI
3947  _In_ BOOLEAN Wow64FsEnableRedirection
3948 );
3949 
3950 NTSYSAPI
3951 NTSTATUS
3952 NTAPI
3954  _In_ PVOID Wow64FsEnableRedirection,
3955  _Out_ PVOID *OldFsRedirectionLevel
3956 );
3957 
3958 #endif
3959 
3960 //
3961 // Registry Functions
3962 //
3965 NTSYSAPI
3966 NTSTATUS
3967 NTAPI
3969  _In_ ULONG RelativeTo,
3970  _In_ PWSTR Path
3971 );
3972 
3973 NTSYSAPI
3974 NTSTATUS
3975 NTAPI
3977  _In_ ULONG RelativeTo,
3978  _In_ PWSTR Path
3979 );
3980 
3981 NTSYSAPI
3982 NTSTATUS
3983 NTAPI
3985  _Out_ _At_(KeyPath->Buffer, __drv_allocatesMem(Mem) _Post_bytecap_(KeyPath->MaximumLength) _Post_bytecount_(KeyPath->Length))
3986  PUNICODE_STRING KeyPath
3987 );
3988 
3989 NTSYSAPI
3990 NTSTATUS
3991 NTAPI
3995 );
3996 
3998 NTSYSAPI
3999 NTSTATUS
4000 NTAPI
4002  _In_ ULONG RelativeTo,
4003  _In_ PCWSTR Path,
4004  _Inout_ _At_(*(*QueryTable).EntryContext, _Pre_unknown_)
4008 );
4009 
4011 NTSYSAPI
4012 NTSTATUS
4013 NTAPI
4015  _In_ ULONG RelativeTo,
4021 );
4022 
4023 #ifdef NTOS_MODE_USER
4024 NTSYSAPI
4025 NTSTATUS
4026 NTAPI
4034 );
4035 
4036 NTSYSAPI
4037 NTSTATUS
4038 NTAPI
4042  _In_ ULONG Index,
4043  _In_ ULONG Unused
4044 );
4045 
4046 NTSYSAPI
4047 NTSTATUS
4048 NTAPI
4051 );
4052 
4053 NTSYSAPI
4054 NTSTATUS
4055 NTAPI
4060  _In_ ULONG Unused
4061 );
4062 
4063 NTSYSAPI
4064 NTSTATUS
4065 NTAPI
4071  _In_ ULONG Unused
4072 );
4073 
4074 NTSYSAPI
4075 NTSTATUS
4076 NTAPI
4079  _In_ ULONG Type,
4080  _In_ PVOID Data,
4082 );
4083 #endif
4084 
4085 //
4086 // NLS Functions
4087 //
4088 NTSYSAPI
4089 VOID
4090 NTAPI
4094 );
4095 
4096 NTSYSAPI
4097 VOID
4098 NTAPI
4100  _In_ PUSHORT AnsiTableBase,
4101  _In_ PUSHORT OemTableBase,
4102  _In_ PUSHORT CaseTableBase,
4103  _Out_ PNLSTABLEINFO NlsTable
4104 );
4105 
4107 NTSYSAPI
4108 VOID
4109 NTAPI
4111  _In_ PUSHORT TableBase,
4113 );
4114 
4115 NTSYSAPI
4116 VOID
4117 NTAPI
4119  _In_ PNLSTABLEINFO NlsTable);
4120 
4121 #if defined(NTOS_MODE_USER) && !defined(NO_RTL_INLINES)
4122 
4123 //
4124 // Misc conversion functions
4125 //
4126 static __inline
4130  _In_ LONG SignedInteger
4131 )
4132 {
4134 
4135  Result.QuadPart = SignedInteger;
4136  return Result;
4137 }
4138 
4139 static __inline
4143  _In_ LONG Multiplicand,
4144  _In_ LONG Multiplier
4145 )
4146 {
4147  LARGE_INTEGER Product;
4148 
4149  Product.QuadPart = (LONGLONG)Multiplicand * (ULONGLONG)Multiplier;
4150  return Product;
4151 }
4152 
4153 static __inline
4154 ULONG
4157  _In_ ULARGE_INTEGER Dividend,
4158  _In_ ULONG Divisor,
4160 )
4161 {
4162  ULONG Quotient;
4163 
4164  Quotient = (ULONG)(Dividend.QuadPart / Divisor);
4165  if (Remainder) {
4166  *Remainder = (ULONG)(Dividend.QuadPart % Divisor);
4167  }
4168 
4169  return Quotient;
4170 }
4171 
4172 static __inline
4176  _In_ ULONG Multiplicand,
4177  _In_ ULONG Multiplier
4178 )
4179 {
4180  LARGE_INTEGER Product;
4181 
4182  Product.QuadPart = (ULONGLONG)Multiplicand * (ULONGLONG)Multiplier;
4183  return Product;
4184 }
4185 
4186 #if defined(_AMD64_) || defined(_IA64_)
4187 static __inline
4191  _In_ LARGE_INTEGER Dividend,
4192  _In_ ULONG Divisor,
4194 {
4196  ret.QuadPart = (ULONG64)Dividend.QuadPart / Divisor;
4197  if (Remainder)
4198  *Remainder = (ULONG)(Dividend.QuadPart % Divisor);
4199  return ret;
4200 }
4201 
4202 #else
4203 NTSYSAPI
4205 NTAPI
4207  _In_ LARGE_INTEGER Dividend,
4208  _In_ ULONG Divisor,
4210 );
4211 
4212 #endif /* defined(_AMD64_) || defined(_IA64_) */
4213 
4214 #endif
4215 
4216 
4217 NTSYSAPI
4218 ULONG
4219 NTAPI
4220 RtlUniform(
4221  _In_ PULONG Seed
4222 );
4223 
4224 NTSYSAPI
4225 ULONG
4226 NTAPI
4227 RtlRandom(
4228  _Inout_ PULONG Seed
4229 );
4230 
4231 NTSYSAPI
4232 ULONG
4233 NTAPI
4235  _In_ ULONG InitialCrc,
4236  _In_ PUCHAR Buffer,
4237  _In_ ULONG Length
4238 );
4239 
4240 //
4241 // Network Functions
4242 //
4243 NTSYSAPI
4244 PSTR
4245 NTAPI
4247  _In_ const struct in_addr *Addr,
4248  _Out_writes_(16) PCHAR S
4249 );
4250 
4251 NTSYSAPI
4252 PWSTR
4253 NTAPI
4255  _In_ const struct in_addr *Addr,
4256  _Out_writes_(16) PWCHAR S
4257 );
4258 
4259 NTSYSAPI
4260 NTSTATUS
4261 NTAPI
4263  _In_ const struct in_addr *Address,
4264  _In_ USHORT Port,
4265  _Out_writes_to_(*AddressStringLength, *AddressStringLength) PCHAR AddressString,
4266  _Inout_ PULONG AddressStringLength
4267 );
4268 
4269 NTSTATUS
4270 NTAPI
4272  _In_ const struct in_addr *Address,
4273  _In_ USHORT Port,
4274  _Out_writes_to_(*AddressStringLength, *AddressStringLength) PWCHAR AddressString,
4275  _Inout_ PULONG AddressStringLength
4276 );
4277 
4278 NTSYSAPI
4279 NTSTATUS
4280 NTAPI
4282  _In_ PCSTR String,
4283  _In_ BOOLEAN Strict,
4284  _Out_ PCSTR *Terminator,
4285  _Out_ struct in_addr *Addr
4286 );
4287 
4288 NTSYSAPI
4289 NTSTATUS
4290 NTAPI
4292  _In_ PCWSTR String,
4293  _In_ BOOLEAN Strict,
4294  _Out_ PCWSTR *Terminator,
4295  _Out_ struct in_addr *Addr
4296 );
4297 
4298 NTSYSAPI
4299 NTSTATUS
4300 NTAPI
4302  _In_ PCSTR AddressString,
4303  _In_ BOOLEAN Strict,
4304  _Out_ struct in_addr *Address,
4306 );
4307 
4308 NTSYSAPI
4309 NTSTATUS
4310 NTAPI
4312  _In_ PCWSTR AddressString,
4313  _In_ BOOLEAN Strict,
4314  _Out_ struct in_addr *Address,
4316 );
4317 
4318 NTSYSAPI
4319 PSTR
4320 NTAPI
4322  _In_ const struct in6_addr *Addr,
4323  _Out_writes_(46) PSTR S
4324 );
4325 
4326 NTSYSAPI
4327 PWSTR
4328 NTAPI
4330  _In_ const struct in6_addr *Addr,
4331  _Out_writes_(46) PWSTR S
4332 );
4333 
4334 NTSYSAPI
4335 NTSTATUS
4336 NTAPI
4338  _In_ const struct in6_addr *Address,
4339  _In_ ULONG ScopeId,
4340  _In_ USHORT Port,
4341  _Out_writes_to_(*AddressStringLength, *AddressStringLength) PSTR AddressString,
4342  _Inout_ PULONG AddressStringLength
4343 );
4344 
4345 NTSYSAPI
4346 NTSTATUS
4347 NTAPI
4349  _In_ const struct in6_addr *Address,
4350  _In_ ULONG ScopeId,
4351  _In_ USHORT Port,
4352  _Out_writes_to_(*AddressStringLength, *AddressStringLength) PWCHAR AddressString,
4353  _Inout_ PULONG AddressStringLength
4354 );
4355 
4356 NTSYSAPI
4357 NTSTATUS
4358 NTAPI
4360  _In_ PCSTR String,
4361  _Out_ PCSTR *Terminator,
4362  _Out_ struct in6_addr *Addr
4363 );
4364 
4365 NTSYSAPI
4366 NTSTATUS
4367 NTAPI
4369  _In_ PCWSTR String,
4370  _Out_ PCWSTR *Terminator,
4371  _Out_ struct in6_addr *Addr
4372 );
4373 
4374 NTSYSAPI
4375 NTSTATUS
4376 NTAPI
4378  _In_ PCSTR AddressString,
4379  _Out_ struct in6_addr *Address,
4380  _Out_ PULONG ScopeId,
4382 );
4383 
4384 NTSYSAPI
4385 NTSTATUS
4386 NTAPI
4388  _In_ PCWSTR AddressString,
4389  _Out_ struct in6_addr *Address,
4390  _Out_ PULONG ScopeId,
4392 );
4393 
4394 
4395 //
4396 // Time Functions
4397 //
4398 NTSYSAPI
4399 NTSTATUS
4400 NTAPI
4402  _Out_ PRTL_TIME_ZONE_INFORMATION TimeZoneInformation);
4403 
4404 NTSYSAPI
4405 VOID
4406 NTAPI
4408  _In_ ULONG SecondsSince1970,
4410 );
4411 
4412 NTSYSAPI
4413 NTSTATUS
4414 NTAPI
4416  _In_ PRTL_TIME_ZONE_INFORMATION TimeZoneInformation);
4417 
4418 _Success_(return!=FALSE)
4420 NTSYSAPI
4421 BOOLEAN
4422 NTAPI
4426 );
4427 
4428 _Success_(return != 0)
4430 NTSYSAPI
4431 BOOLEAN
4432 NTAPI
4436 );
4437 
4438 NTSYSAPI
4439 VOID
4440 NTAPI
4444 );
4445 
4446 NTSYSAPI
4447 NTSTATUS
4448 NTAPI
4450  _In_ PLARGE_INTEGER SystemTime,
4451  _Out_ PLARGE_INTEGER LocalTime
4452 );
4453 
4454 //
4455 // Version Functions
4456 //
4459 NTSYSAPI
4460 NTSTATUS
4461 NTAPI
4463  _In_ PRTL_OSVERSIONINFOEXW VersionInfo,
4466 );
4467 
4469 NTSYSAPI
4470 NTSTATUS
4471 NTAPI
4473  _Out_
4474  _At_(lpVersionInformation->dwOSVersionInfoSize, _Pre_ _Valid_)
4475  _When_(lpVersionInformation->dwOSVersionInfoSize == sizeof(RTL_OSVERSIONINFOEXW),
4476  _At_((PRTL_OSVERSIONINFOEXW)lpVersionInformation, _Out_))
4477  PRTL_OSVERSIONINFOW lpVersionInformation
4478 );
4479 
4480 NTSYSAPI
4481 BOOLEAN
4482 NTAPI
4484 
4485 //
4486 // Secure Memory Functions
4487 //
4488 #ifdef NTOS_MODE_USER
4489 NTSYSAPI
4490 NTSTATUS
4491 NTAPI
4493  _In_ PRTL_SECURE_MEMORY_CACHE_CALLBACK Callback);
4494 
4495 NTSYSAPI
4496 BOOLEAN
4497 NTAPI
4499  _In_ PVOID MemoryCache,
4500  _In_opt_ SIZE_T MemoryLength
4501 );
4502 #endif
4503 
4504 //
4505 // Boot Status Data Functions
4506 //
4507 #ifdef NTOS_MODE_USER
4508 NTSYSAPI
4509 NTSTATUS
4510 NTAPI
4512  VOID
4513 );
4514 
4515 NTSYSAPI
4516 NTSTATUS
4517 NTAPI
4520  _In_ BOOLEAN WriteMode,
4521  _In_ RTL_BSD_ITEM_TYPE DataClass,
4522  _In_ PVOID Buffer,
4525 );
4526 
4527 NTSYSAPI
4528 NTSTATUS
4529 NTAPI
4532 );
4533 
4534 NTSYSAPI
4535 NTSTATUS
4536 NTAPI
4539 );
4540 #endif
4541 
4542 #ifdef NTOS_MODE_USER
4544 NTSYSAPI
4545 NTSTATUS
4546 NTAPI
4549  _Out_ GUID *Guid);
4550 
4552 NTSYSAPI
4553 NTSTATUS
4554 NTAPI
4556  _In_ REFGUID Guid,
4557  _Out_ _At_(GuidString->Buffer, __drv_allocatesMem(Mem))
4559 
4560 NTSYSAPI
4561 NTSTATUS
4562 NTAPI
4564  _In_ HANDLE hFile,
4565  _Out_ PCHAR Hash,
4566  _In_ ULONG ImportTableHashRevision
4567 );
4568 #endif
4569 
4570 //
4571 // MemoryStream functions
4572 //
4573 #ifdef NTOS_MODE_USER
4574 
4575 NTSYSAPI
4576 VOID
4577 NTAPI
4579  _Out_ PRTL_MEMORY_STREAM Stream
4580 );
4581 
4582 NTSYSAPI
4583 VOID
4584 NTAPI
4586  _Out_ PRTL_MEMORY_STREAM Stream
4587 );
4588 
4589 NTSYSAPI
4590 VOID
4591 NTAPI
4593  _In_ PRTL_MEMORY_STREAM Stream
4594 );
4595 
4596 NTSYSAPI
4597 HRESULT
4598 NTAPI
4600  _In_ struct IStream *This,
4601  _In_ REFIID RequestedIid,
4602  _Outptr_ PVOID *ResultObject
4603 );
4604 
4605 NTSYSAPI
4606 ULONG
4607 NTAPI
4609  _In_ struct IStream *This
4610 );
4611 
4612 NTSYSAPI
4613 ULONG
4614 NTAPI
4616  _In_ struct IStream *This
4617 );
4618 
4619 NTSYSAPI
4620 HRESULT
4621 NTAPI
4623  _In_ struct IStream *This,
4625  _In_ ULONG Length,
4627 );
4628 
4629 NTSYSAPI
4630 HRESULT
4631 NTAPI
4633  _In_ struct IStream *This,
4635  _In_ ULONG Length,
4637 );
4638 
4639 NTSYSAPI
4640 HRESULT
4641 NTAPI
4643  _In_ struct IStream *This,
4644  _In_ LARGE_INTEGER RelativeOffset,
4645  _In_ ULONG Origin,
4646  _Out_opt_ PULARGE_INTEGER ResultOffset
4647 );
4648 
4649 NTSYSAPI
4650 HRESULT
4651 NTAPI
4653  _In_ struct IStream *This,
4654  _In_ struct IStream *Target,
4658 );
4659 
4660 NTSYSAPI
4661 HRESULT
4662 NTAPI
4663 RtlCopyOutOfProcessMemoryStreamTo(
4664  _In_ struct IStream *This,
4665  _In_ struct IStream *Target,
4669 );
4670 
4671 NTSYSAPI
4672 HRESULT
4673 NTAPI
4675  _In_ struct IStream *This,
4676  _Out_ struct tagSTATSTG *Stats,
4677  _In_ ULONG Flags
4678 );
4679 
4680 // Dummy functions
4681 NTSYSAPI
4682 HRESULT
4683 NTAPI
4685  _In_ struct IStream *This,
4687  _In_ ULONG Length,
4689 );
4690 
4691 NTSYSAPI
4692 HRESULT
4693 NTAPI
4695  _In_ struct IStream *This,
4697 );
4698 
4699 NTSYSAPI
4700 HRESULT
4701 NTAPI
4703  _In_ struct IStream *This,
4704  _In_ ULONG CommitFlags
4705 );
4706 
4707 NTSYSAPI
4708 HRESULT
4709 NTAPI
4711  _In_ struct IStream *This
4712 );
4713 
4714 NTSYSAPI
4715 HRESULT
4716 NTAPI
4718  _In_ struct IStream *This,
4721  _In_ ULONG LockType
4722 );
4723 
4724 NTSYSAPI
4725 HRESULT
4726 NTAPI
4728  _In_ struct IStream *This,
4731  _In_ ULONG LockType
4732 );
4733 
4734 NTSYSAPI
4735 HRESULT
4736 NTAPI
4738  _In_ struct IStream *This,
4739  _Outptr_ struct IStream **ResultStream
4740 );
4741 
4742 NTSYSAPI
4743 NTSTATUS
4744 NTAPI
4745 RtlGetNativeSystemInformation(
4746  _In_ SYSTEM_INFORMATION_CLASS SystemInformationClass,
4747  _Out_writes_bytes_to_opt_(SystemInformationLength, *ReturnLength) PVOID SystemInformation,
4748  _In_ ULONG SystemInformationLength,
4750 );
4751 
4752 #endif // NTOS_MODE_USER
4753 
4754 NTSYSAPI
4755 NTSTATUS
4756 NTAPI
4758  ULONG flags,
4759  const GUID *extguid,
4760  ULONG section_kind,
4761  const GUID *guid,
4762  void *ptr
4763 );
4764 
4765 #ifdef __cplusplus
4766 }
4767 #endif
4768 
4769 #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:3971
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:2343
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:4464
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:4004
#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)
RTL_AVL_COMPARE_ROUTINE * PRTL_AVL_COMPARE_ROUTINE
Definition: rtltypes.h:381
static CODEPAGE_ENTRY AnsiCodePage
Definition: nls.c:46
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ProcessId
Definition: fatprocs.h:2697
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:445
ASMGENDATA Table[]
Definition: genincdata.c:61
#define _Must_inspect_result_
Definition: no_sal2.h:314
_Out_ PLARGE_INTEGER Time
Definition: rtlfuncs.h:4426
_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:1827
_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:118
NTSYSAPI VOID