ReactOS  0.4.14-dev-1286-g61a54ae
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()
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 NTSYSAPI
2439 VOID
2440 NTAPI
2444 );
2445 
2446 NTSYSAPI
2447 VOID
2448 NTAPI
2450  _In_ UCHAR Hash,
2452 );
2453 
2454 #endif /* NTOS_MODE_USER */
2455 
2456 //
2457 // Ansi String Functions
2458 //
2460 NTSYSAPI
2461 VOID
2462 NTAPI
2464  _Inout_ _At_(AnsiString->Buffer, __drv_freesMem(Mem))
2466 );
2467 
2469 NTSYSAPI
2470 VOID
2471 NTAPI
2475 );
2476 
2478 NTSYSAPI
2479 NTSTATUS
2480 NTAPI
2484 );
2485 
2486 //
2487 // OEM String Functions
2488 //
2490 NTSYSAPI
2491 VOID
2492 NTAPI
2494  _Inout_ _At_(OemString->Buffer, __drv_freesMem(Mem))
2496 );
2497 
2498 //
2499 // MultiByte->Unicode String Functions
2500 //
2502 NTSYSAPI
2503 NTSTATUS
2504 NTAPI
2511 );
2512 
2514 NTSYSAPI
2515 NTSTATUS
2516 NTAPI
2521 );
2522 
2523 //
2524 // Atom Functions
2525 //
2526 NTSYSAPI
2527 NTSTATUS
2528 NTAPI
2530  _In_ PRTL_ATOM_TABLE AtomTable,
2531  _In_ PWSTR AtomName,
2533 );
2534 
2535 NTSYSAPI
2536 NTSTATUS
2537 NTAPI
2540  _Inout_ PRTL_ATOM_TABLE *AtomTable
2541 );
2542 
2543 NTSYSAPI
2544 NTSTATUS
2545 NTAPI
2547  _In_ PRTL_ATOM_TABLE AtomTable,
2549 );
2550 
2551 NTSYSAPI
2552 NTSTATUS
2553 NTAPI
2555 
2556 NTSYSAPI
2557 NTSTATUS
2558 NTAPI
2560  _In_ PRTL_ATOM_TABLE AtomTable,
2561  _In_ RTL_ATOM Atom,
2562  _Out_opt_ PULONG RefCount,
2564  _Out_opt_z_bytecap_(*NameLength) PWSTR AtomName,
2565  _Inout_opt_ PULONG NameLength
2566 );
2567 
2568 NTSYSAPI
2569 NTSTATUS
2570 NTAPI
2572  _In_ PRTL_ATOM_TABLE AtomTable,
2574 );
2575 
2576 NTSYSAPI
2577 NTSTATUS
2578 NTAPI
2580  _In_ PRTL_ATOM_TABLE AtomTable,
2581  _In_ PWSTR AtomName,
2583 );
2584 
2585 //
2586 // Process Management Functions
2587 //
2588 NTSYSAPI
2589 PPEB
2590 NTAPI
2592  VOID
2593 );
2594 
2595 NTSYSAPI
2596 VOID
2597 NTAPI
2599 
2600 NTSYSAPI
2601 NTSTATUS
2602 NTAPI
2604  _Out_ PRTL_USER_PROCESS_PARAMETERS *ProcessParameters,
2605  _In_ PUNICODE_STRING ImagePathName,
2608  _In_opt_ PUNICODE_STRING CommandLine,
2610  _In_opt_ PUNICODE_STRING WindowTitle,
2611  _In_opt_ PUNICODE_STRING DesktopInfo,
2612  _In_opt_ PUNICODE_STRING ShellInfo,
2613  _In_opt_ PUNICODE_STRING RuntimeInfo
2614 );
2615 
2616 NTSYSAPI
2617 NTSTATUS
2618 NTAPI
2620  _In_ PUNICODE_STRING ImageFileName,
2622  _In_ PRTL_USER_PROCESS_PARAMETERS ProcessParameters,
2623  _In_opt_ PSECURITY_DESCRIPTOR ProcessSecutityDescriptor,
2624  _In_opt_ PSECURITY_DESCRIPTOR ThreadSecurityDescriptor,
2625  _In_opt_ HANDLE ParentProcess,
2627  _In_opt_ HANDLE DebugPort,
2628  _In_opt_ HANDLE ExceptionPort,
2630 );
2631 
2632 #if (NTDDI_VERSION >= NTDDI_WIN7)
2633 NTSYSAPI
2634 NTSTATUS
2635 NTAPI
2637  _In_ PVOID ThreadContext,
2638  _Out_ HANDLE *OutThreadHandle,
2644  _Reserved_ PVOID Reserved6,
2646  _Reserved_ PVOID Reserved8
2647 );
2648 #else
2649 NTSYSAPI
2650 NTSTATUS
2651 NTAPI
2655  _In_ BOOLEAN CreateSuspended,
2656  _In_ ULONG StackZeroBits,
2657  _In_ SIZE_T StackReserve,
2658  _In_ SIZE_T StackCommit,
2659  _In_ PTHREAD_START_ROUTINE StartAddress,
2661  _Out_opt_ PHANDLE ThreadHandle,
2663 );
2664 #endif
2665 
2666 NTSYSAPI
2668 NTAPI
2670  _In_ PRTL_USER_PROCESS_PARAMETERS ProcessParameters);
2671 
2672 NTSYSAPI
2673 NTSTATUS
2674 NTAPI
2676  _In_ PRTL_USER_PROCESS_PARAMETERS ProcessParameters);
2677 
2678 NTSYSAPI
2679 VOID
2680 NTAPI
2682  _In_ NTSTATUS Status);
2683 
2684 NTSYSAPI
2685 VOID
2686 NTAPI
2689  _Out_ PCONTEXT ThreadContext,
2690  _In_opt_ PVOID ThreadStartParam,
2691  _In_ PTHREAD_START_ROUTINE ThreadStartAddress,
2692  _In_ PINITIAL_TEB InitialTeb
2693 );
2694 
2695 #ifdef _M_AMD64
2696 typedef struct _WOW64_CONTEXT *PWOW64_CONTEXT;
2697 
2698 NTSYSAPI
2699 NTSTATUS
2700 NTAPI
2701 RtlWow64GetThreadContext(
2702  _In_ HANDLE ThreadHandle,
2703  _Inout_ PWOW64_CONTEXT ThreadContext
2704 );
2705 
2706 
2707 NTSYSAPI
2708 NTSTATUS
2709 NTAPI
2710 RtlWow64SetThreadContext(
2711  _In_ HANDLE ThreadHandle,
2712  _In_ PWOW64_CONTEXT ThreadContext
2713 );
2714 #endif
2715 
2716 NTSYSAPI
2717 BOOLEAN
2718 NTAPI
2720 
2721 NTSYSAPI
2723 NTAPI
2725  _In_ PRTL_USER_PROCESS_PARAMETERS ProcessParameters);
2726 
2727 NTSYSAPI
2728 VOID
2729 NTAPI
2731 
2732 NTSYSAPI
2733 NTSTATUS
2734 NTAPI
2737  _In_ HANDLE Thread,
2738  _In_ PVOID CallSite,
2739  _In_ ULONG ArgumentCount,
2740  _In_ PULONG Arguments,
2741  _In_ BOOLEAN PassContext,
2742  _In_ BOOLEAN AlreadySuspended
2743 );
2744 
2745 NTSYSAPI
2746 NTSTATUS
2747 __cdecl
2749  _In_ BOOLEAN NewValue,
2750  _Out_opt_ PBOOLEAN OldValue,
2751  _In_ BOOLEAN NeedBreaks
2752 );
2753 
2754 NTSYSAPI
2755 NTSTATUS
2756 __cdecl
2758  _In_ BOOLEAN NewValue,
2759  _Out_opt_ PBOOLEAN OldValue,
2760  _In_ BOOLEAN NeedBreaks
2761 );
2762 
2763 NTSYSAPI
2764 ULONG
2765 NTAPI
2767  VOID
2768 );
2769 
2770 
2771 //
2772 // Thread Pool Functions
2773 //
2774 //
2775 NTSTATUS
2776 NTAPI
2778  _In_ PRTL_START_POOL_THREAD StartPoolThread,
2779  _In_ PRTL_EXIT_POOL_THREAD ExitPoolThread
2780 );
2781 
2782 NTSYSAPI
2783 NTSTATUS
2784 NTAPI
2786  _In_ HANDLE hWaitHandle,
2787  _In_opt_ HANDLE hCompletionEvent
2788 );
2789 
2790 NTSYSAPI
2791 NTSTATUS
2792 NTAPI
2794  _In_ HANDLE hWaitHandle
2795 );
2796 
2797 NTSYSAPI
2798 NTSTATUS
2799 NTAPI
2803  _In_ ULONG Flags
2804 );
2805 
2806 NTSYSAPI
2807 NTSTATUS
2808 NTAPI
2812  _In_ ULONG Flags
2813 );
2814 
2815 NTSYSAPI
2816 NTSTATUS
2817 NTAPI
2819  _In_ PHANDLE phNewWaitObject,
2820  _In_ HANDLE hObject,
2822  _In_ PVOID pvContext,
2823  _In_ ULONG ulMilliseconds,
2824  _In_ ULONG ulFlags
2825 );
2826 
2827 //
2828 // Environment/Path Functions
2829 //
2830 NTSYSAPI
2831 NTSTATUS
2832 NTAPI
2834  _In_ BOOLEAN Inherit,
2836 );
2837 
2838 NTSYSAPI
2839 NTSTATUS
2840 NTAPI
2842  _In_ PUNICODE_STRING DllName,
2843  _Inout_ PUNICODE_STRING RealName,
2844  _Inout_ PUNICODE_STRING LocalName
2845 );
2846 
2847 NTSYSAPI
2848 VOID
2849 NTAPI
2852 );
2853 
2854 NTSYSAPI
2855 BOOLEAN
2856 NTAPI
2859 );
2860 
2861 NTSYSAPI
2863 NTAPI
2865  _In_ PCWSTR Path
2866 );
2867 
2868 NTSYSAPI
2869 ULONG
2870 NTAPI
2872  _In_ PCWSTR Path,
2876  _Out_ PWSTR Buffer,
2877  _Out_ PWSTR *PartName
2878 );
2879 
2880 NTSYSAPI
2881 NTSTATUS
2882 NTAPI
2884  _In_ ULONG Flags,
2885  _In_ PUNICODE_STRING PathString,
2886  _In_ PUNICODE_STRING FileNameString,
2887  _In_ PUNICODE_STRING ExtensionString,
2888  _In_ PUNICODE_STRING CallerBuffer,
2890  _Out_opt_ PUNICODE_STRING* FullNameOut,
2891  _Out_opt_ PSIZE_T FilePartSize,
2893 );
2894 
2895 NTSYSAPI
2896 BOOLEAN
2897 NTAPI
2899  _In_opt_z_ PCWSTR DosPathName,
2900  _Out_ PUNICODE_STRING NtPathName,
2901  _Out_opt_ PCWSTR *NtFileNamePart,
2902  _Out_opt_ PRTL_RELATIVE_NAME_U DirectoryInfo
2903 );
2904 
2905 
2906 #define RTL_UNCHANGED_UNK_PATH 1
2907 #define RTL_CONVERTED_UNC_PATH 2
2908 #define RTL_CONVERTED_NT_PATH 3
2909 #define RTL_UNCHANGED_DOS_PATH 4
2910 
2911 NTSYSAPI
2912 NTSTATUS
2913 NTAPI
2915  _In_ ULONG Flags,
2919 );
2920 
2921 
2922 NTSYSAPI
2923 BOOLEAN
2924 NTAPI
2927  _Out_ PUNICODE_STRING NtName,
2928  _Out_ PCWSTR *PartName,
2929  _Out_ PRTL_RELATIVE_NAME_U RelativeName
2930 );
2931 
2933 NTSYSAPI
2934 NTSTATUS
2935 NTAPI
2941 );
2942 
2943 NTSYSAPI
2944 ULONG
2945 NTAPI
2949 );
2950 
2951 NTSYSAPI
2952 ULONG
2953 NTAPI
2956  _In_ ULONG Size,
2959 );
2960 
2961 #if (NTDDI_VERSION >= NTDDI_WIN7)
2962 NTSYSAPI
2963 NTSTATUS
2964 NTAPI
2968  _Out_ PWSTR Buffer,
2969  _Out_opt_ PWSTR *FilePart,
2970  _Out_opt_ RTL_PATH_TYPE *InputPathType
2971  );
2972 #endif
2973 
2974 NTSTATUS
2975 NTAPI
2981  _Out_opt_ PSIZE_T FilePartSize,
2985 );
2986 
2987 NTSYSAPI
2988 NTSTATUS
2989 NTAPI
2992  _In_ PCUNICODE_STRING PathString,
2994 );
2995 
2996 NTSYSAPI
2997 ULONG
2998 NTAPI
3000  VOID
3001 );
3002 
3003 NTSYSAPI
3004 ULONG
3005 NTAPI
3007  _In_ PCWSTR Name
3008 );
3009 
3010 NTSYSAPI
3011 ULONG
3012 NTAPI
3015 );
3016 
3019 NTSYSAPI
3020 BOOLEAN
3021 NTAPI
3026 );
3027 
3028 NTSYSAPI
3029 NTSTATUS
3030 NTAPI
3035 );
3036 
3037 VOID
3038 NTAPI
3040  _In_ PRTL_RELATIVE_NAME_U RelativeName
3041 );
3042 
3043 NTSYSAPI
3044 NTSTATUS
3045 NTAPI
3048 );
3049 
3050 NTSYSAPI
3051 NTSTATUS
3052 NTAPI
3057 );
3058 
3059 //
3060 // Critical Section/Resource Functions
3061 //
3062 NTSYSAPI
3063 NTSTATUS
3064 NTAPI
3067 );
3068 
3069 NTSYSAPI
3070 NTSTATUS
3071 NTAPI
3074 );
3075 
3076 NTSYSAPI
3077 NTSTATUS
3078 NTAPI
3081 );
3082 
3083 NTSYSAPI
3084 NTSTATUS
3085 NTAPI
3088  _In_ ULONG SpinCount
3089 );
3090 
3091 NTSYSAPI
3092 ULONG
3093 NTAPI
3096 );
3097 
3098 NTSYSAPI
3099 ULONG
3100 NTAPI
3103 );
3104 
3105 NTSYSAPI
3106 NTSTATUS
3107 NTAPI
3110 );
3111 
3112 NTSYSAPI
3113 BOOLEAN
3114 NTAPI
3117 );
3118 
3119 NTSYSAPI
3120 VOID
3121 NTAPI
3124 );
3125 
3126 NTSYSAPI
3127 NTSTATUS
3128 NTAPI
3131 );
3132 
3133 NTSYSAPI
3134 BOOLEAN
3135 NTAPI
3138  _In_ BOOLEAN Wait
3139 );
3140 
3141 NTSYSAPI
3142 BOOLEAN
3143 NTAPI
3146  _In_ BOOLEAN Wait
3147 );
3148 
3149 NTSYSAPI
3150 VOID
3151 NTAPI
3154 );
3155 
3156 NTSYSAPI
3157 VOID
3158 NTAPI
3161 );
3162 
3163 NTSYSAPI
3164 VOID
3165 NTAPI
3168 );
3169 
3170 NTSYSAPI
3171 VOID
3172 NTAPI
3175 );
3176 
3177 NTSYSAPI
3178 VOID
3179 NTAPI
3182 );
3183 
3184 NTSYSAPI
3185 VOID
3186 NTAPI
3189 );
3190 
3191 //
3192 // Compression Functions
3193 //
3194 NTSYSAPI //NT_RTL_COMPRESS_API
3195 NTSTATUS
3196 NTAPI
3198  _In_ USHORT CompressionFormatAndEngine,
3199  _In_reads_bytes_(UncompressedBufferSize) PUCHAR UncompressedBuffer,
3203  _In_ ULONG UncompressedChunkSize,
3204  _Out_ PULONG FinalCompressedSize,
3206 );
3207 
3209 NTSYSAPI //NT_RTL_COMPRESS_API
3210 NTSTATUS
3211 NTAPI
3213  _In_ USHORT CompressionFormat,
3219 );
3220 
3221 NTSYSAPI
3222 NTSTATUS
3223 NTAPI
3225  _In_ USHORT CompressionFormatAndEngine,
3226  _Out_ PULONG CompressBufferWorkSpaceSize,
3227  _Out_ PULONG CompressFragmentWorkSpaceSize
3228 );
3229 
3230 //
3231 // Frame Functions
3232 //
3233 NTSYSAPI
3234 VOID
3235 NTAPI
3236 RtlPopFrame(
3237  _In_ PTEB_ACTIVE_FRAME Frame
3238 );
3239 
3240 NTSYSAPI
3241 VOID
3242 NTAPI
3243 RtlPushFrame(
3244  _In_ PTEB_ACTIVE_FRAME Frame
3245 );
3246 
3247 NTSYSAPI
3249 NTAPI
3250 RtlGetFrame(
3251  VOID
3252 );
3253 
3254 //
3255 // Debug Info Functions
3256 //
3257 NTSYSAPI
3259 NTAPI
3261  _In_ ULONG Size,
3262  _In_ BOOLEAN EventPair
3263 );
3264 
3265 NTSYSAPI
3266 NTSTATUS
3267 NTAPI
3269 
3270 NTSYSAPI
3271 NTSTATUS
3272 NTAPI
3275  _In_ ULONG DebugInfoClassMask,
3276  _Inout_ PRTL_DEBUG_INFORMATION DebugBuffer
3277 );
3278 
3279 //
3280 // Bitmap Functions
3281 //
3282 #ifdef NTOS_MODE_USER
3283 
3284 NTSYSAPI
3285 BOOLEAN
3286 NTAPI
3288  _In_ PRTL_BITMAP BitMapHeader,
3290  _In_ ULONG Length
3291 );
3292 
3293 NTSYSAPI
3294 BOOLEAN
3295 NTAPI
3297  _In_ PRTL_BITMAP BitMapHeader,
3299  _In_ ULONG Length
3300 );
3301 
3302 NTSYSAPI
3303 VOID
3304 NTAPI
3306  _In_ PRTL_BITMAP BitMapHeader
3307 );
3308 
3309 NTSYSAPI
3310 VOID
3311 NTAPI
3312 RtlClearBit(
3313  _In_ PRTL_BITMAP BitMapHeader,
3314  _In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitNumber
3315 );
3316 
3317 NTSYSAPI
3318 VOID
3319 NTAPI
3320 RtlClearBits(
3321  _In_ PRTL_BITMAP BitMapHeader,
3322  _In_range_(0, BitMapHeader->SizeOfBitMap - NumberToClear) ULONG StartingIndex,
3323  _In_range_(0, BitMapHeader->SizeOfBitMap - StartingIndex) ULONG NumberToClear
3324 );
3325 
3326 NTSYSAPI
3327 ULONG
3328 NTAPI
3330  _In_ PRTL_BITMAP BitMapHeader,
3333 );
3334 
3335 NTSYSAPI
3336 ULONG
3337 NTAPI
3339  _In_ PRTL_BITMAP BitMapHeader,
3342 );
3343 
3344 NTSYSAPI
3345 ULONG
3346 NTAPI
3348  _In_ PRTL_BITMAP BitMapHeader,
3350 );
3351 
3352 NTSYSAPI
3353 ULONG
3354 NTAPI
3356  _In_ PRTL_BITMAP BitMapHeader,
3357  _Out_writes_to_(SizeOfRunArray, return) PRTL_BITMAP_RUN RunArray,
3358  _In_range_(>, 0) ULONG SizeOfRunArray,
3359  _In_ BOOLEAN LocateLongestRuns
3360 );
3361 
3362 NTSYSAPI
3363 ULONG
3364 NTAPI
3366  _In_ PRTL_BITMAP BitMapHeader,
3367  _In_ ULONG FromIndex,
3368  _Out_ PULONG StartingRunIndex
3369 );
3370 
3371 NTSYSAPI
3372 CCHAR
3373 NTAPI
3376 );
3377 
3378 NTSYSAPI
3379 ULONG
3380 NTAPI
3382  _In_ PRTL_BITMAP BitMapHeader,
3384 );
3385 
3386 NTSYSAPI
3387 CCHAR
3388 NTAPI
3391 );
3392 
3393 NTSYSAPI
3394 ULONG
3395 NTAPI
3397  _In_ PRTL_BITMAP BitMapHeader,
3398  _In_ ULONG FromIndex,
3399  _Out_ PULONG StartingRunIndex
3400 );
3401 
3402 NTSYSAPI
3403 ULONG
3404 NTAPI
3406  _In_ PRTL_BITMAP BitMapHeader,
3407  _In_ ULONG FromIndex,
3408  _Out_ PULONG StartingRunIndex
3409 );
3410 
3411 NTSYSAPI
3412 ULONG
3413 NTAPI
3415  _In_ PRTL_BITMAP BitMapHeader,
3418 );
3419 
3420 NTSYSAPI
3421 ULONG
3422 NTAPI
3424  _In_ PRTL_BITMAP BitMapHeader,
3427 );
3428 
3429 #ifdef __REACTOS__ // ReactOS improvement
3430 _At_(BitMapHeader->SizeOfBitMap, _Post_equal_to_(SizeOfBitMap))
3431 _At_(BitMapHeader->Buffer, _Post_equal_to_(BitMapBuffer))
3432 #endif
3433 NTSYSAPI
3434 VOID
3435 NTAPI
3437  _Out_ PRTL_BITMAP BitMapHeader,
3438  _In_opt_ __drv_aliasesMem PULONG BitMapBuffer,
3439  _In_opt_ ULONG SizeOfBitMap
3440 );
3441 
3442 NTSYSAPI
3443 ULONG
3444 NTAPI
3446  _In_ PRTL_BITMAP BitMapHeader
3447 );
3448 
3449 NTSYSAPI
3450 ULONG
3451 NTAPI
3453  _In_ PRTL_BITMAP BitMapHeader
3454 );
3455 
3456 NTSYSAPI
3457 VOID
3458 NTAPI
3459 RtlSetBit(
3460  _In_ PRTL_BITMAP BitMapHeader,
3461  _In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitNumber
3462 );
3463 
3464 NTSYSAPI
3465 VOID
3466 NTAPI
3467 RtlSetBits(
3468  _In_ PRTL_BITMAP BitMapHeader,
3469  _In_range_(0, BitMapHeader->SizeOfBitMap - NumberToSet) ULONG StartingIndex,
3470  _In_range_(0, BitMapHeader->SizeOfBitMap - StartingIndex) ULONG NumberToSet
3471 );
3472 
3473 NTSYSAPI
3474 VOID
3475 NTAPI
3477  _In_ PRTL_BITMAP BitMapHeader
3478 );
3479 
3481 NTSYSAPI
3482 BOOLEAN
3483 NTAPI
3484 RtlTestBit(
3485  _In_ PRTL_BITMAP BitMapHeader,
3486  _In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitNumber
3487 );
3488 
3489 #if defined(_M_AMD64)
3492 BOOLEAN
3493 RtlCheckBit(
3494  _In_ PRTL_BITMAP BitMapHeader,
3495  _In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitPosition)
3496 {
3497  return BitTest64((LONG64 CONST*)BitMapHeader->Buffer, (LONG64)BitPosition);
3498 }
3499 #else
3500 #define RtlCheckBit(BMH,BP) (((((PLONG)(BMH)->Buffer)[(BP)/32]) >> ((BP)%32)) & 0x1)
3501 #endif /* defined(_M_AMD64) */
3502 
3503 #endif // NTOS_MODE_USER
3504 
3505 
3506 //
3507 // Timer Functions
3508 //
3509 NTSYSAPI
3510 NTSTATUS
3511 NTAPI
3513  _In_ HANDLE TimerQueue,
3514  _In_ PHANDLE phNewTimer,
3517  _In_ ULONG DueTime,
3518  _In_ ULONG Period,
3519  _In_ ULONG Flags
3520 );
3521 
3522 NTSYSAPI
3523 NTSTATUS
3524 NTAPI
3525 RtlCreateTimerQueue(PHANDLE TimerQueue);
3526 
3527 NTSYSAPI
3528 NTSTATUS
3529 NTAPI
3531  _In_ HANDLE TimerQueue,
3532  _In_ HANDLE Timer,
3533  _In_ HANDLE CompletionEvent
3534 );
3535 
3536 NTSYSAPI
3537 NTSTATUS
3538 NTAPI
3540  _In_ HANDLE TimerQueue,
3541  _In_ HANDLE Timer,
3542  _In_ ULONG DueTime,
3543  _In_ ULONG Period
3544 );
3545 
3546 NTSYSAPI
3547 NTSTATUS
3548 NTAPI
3550  _In_ HANDLE TimerQueue,
3551  _In_opt_ HANDLE CompletionEvent
3552 );
3553 
3554 NTSYSAPI
3555 NTSTATUS
3556 NTAPI
3557 RtlDeleteTimerQueue(HANDLE TimerQueue);
3558 
3559 //
3560 // SList functions
3561 //
3563 FASTCALL
3565  _Inout_ PSLIST_HEADER ListHead,
3568  _In_ ULONG Count
3569 );
3570 
3571 //
3572 // Range List functions
3573 //
3574 NTSYSAPI
3575 VOID
3576 NTAPI
3578  _Inout_ PRTL_RANGE_LIST RangeList
3579 );
3580 
3581 NTSYSAPI
3582 VOID
3583 NTAPI
3585  _In_ PRTL_RANGE_LIST RangeList
3586 );
3587 
3588 NTSYSAPI
3589 NTSTATUS
3590 NTAPI
3591 RtlAddRange(
3592  _Inout_ PRTL_RANGE_LIST RangeList,
3594  _In_ ULONGLONG End,
3596  _In_ ULONG Flags,
3599 );
3600 
3601 //
3602 // Debug Functions
3603 //
3604 ULONG
3605 __cdecl
3606 DbgPrint(
3608  ...
3609 );
3610 
3611 NTSYSAPI
3612 ULONG
3613 __cdecl
3614 DbgPrintEx(
3616  _In_ ULONG Level,
3618  ...
3619 );
3620 
3621 NTSYSAPI
3622 ULONG
3623 NTAPI
3624 DbgPrompt(
3625  _In_z_ PCCH Prompt,
3628 );
3629 
3630 #undef DbgBreakPoint
3631 VOID
3632 NTAPI
3634  VOID
3635 );
3636 
3637 VOID
3638 NTAPI
3640  _In_ PSTRING Name,
3641  _In_ PVOID Base,
3643 );
3644 
3645 VOID
3646 NTAPI
3648  _In_ PSTRING Name,
3649  _In_ PVOID Base,
3651 );
3652 
3653 VOID
3654 NTAPI
3656  _In_ PCCH Name,
3657  _In_ PCCH Command
3658 );
3659 
3660 //
3661 // Generic Table Functions
3662 //
3663 #if defined(NTOS_MODE_USER) || defined(_NTIFS_)
3664 NTSYSAPI
3665 PVOID
3666 NTAPI
3671  _Out_opt_ PBOOLEAN NewElement
3672 );
3673 
3674 NTSYSAPI
3675 PVOID
3676 NTAPI
3681  _Out_opt_ PBOOLEAN NewElement,
3682  _In_ PVOID NodeOrParent,
3683  _In_ TABLE_SEARCH_RESULT SearchResult
3684 );
3685 
3686 NTSYSAPI
3687 BOOLEAN
3688 NTAPI
3691 );
3692 
3693 NTSYSAPI
3694 PVOID
3695 NTAPI
3698  _In_ PVOID Buffer,
3699  _Out_ PVOID *NodeOrParent,
3700  _Out_ TABLE_SEARCH_RESULT *SearchResult
3701 );
3702 #endif
3703 
3704 //
3705 // Handle Table Functions
3706 //
3707 NTSYSAPI
3709 NTAPI
3713 );
3714 
3715 NTSYSAPI
3716 VOID
3717 NTAPI
3720 
3721 NTSYSAPI
3722 BOOLEAN
3723 NTAPI
3727 );
3728 
3729 NTSYSAPI
3730 VOID
3731 NTAPI
3734  _In_ ULONG HandleSize,
3736 );
3737 
3738 NTSYSAPI
3739 BOOLEAN
3740 NTAPI
3744 );
3745 
3746 _Success_(return!=FALSE)
3747 NTSYSAPI
3748 BOOLEAN
3749 NTAPI
3754 );
3755 
3756 //
3757 // PE Functions
3758 //
3759 NTSYSAPI
3760 NTSTATUS
3761 NTAPI
3764  _In_ ULONG Type,
3765  _In_ ULONG Language,
3766  _In_ ULONG MessageId,
3767  _Out_ PMESSAGE_RESOURCE_ENTRY *MessageResourceEntry
3768 );
3769 
3770 NTSYSAPI
3771 ULONG
3772 NTAPI
3774 
3775 _Success_(return!=NULL)
3776 NTSYSAPI
3777 PVOID
3778 NTAPI
3783  _Out_ PULONG Size
3784 );
3785 
3786 NTSYSAPI
3787 PVOID
3788 NTAPI
3790  _In_ PIMAGE_NT_HEADERS NtHeader,
3792  _In_ ULONG Rva,
3793  _Inout_opt_ PIMAGE_SECTION_HEADER *SectionHeader
3794 );
3795 
3796 NTSYSAPI
3798 NTAPI
3801 
3802 NTSYSAPI
3803 NTSTATUS
3804 NTAPI
3806  _In_ ULONG Flags,
3809  _Out_ PIMAGE_NT_HEADERS *NtHeader
3810 );
3811 
3812 NTSYSAPI
3814 NTAPI
3816  _In_ PIMAGE_NT_HEADERS NtHeader,
3818  _In_ ULONG Rva
3819 );
3820 
3821 NTSYSAPI
3822 ULONG
3823 NTAPI
3825  _In_ PVOID NewAddress,
3826  _In_ LONGLONG AdditionalBias,
3827  _In_ PCCH LoaderName,
3828  _In_ ULONG Success,
3829  _In_ ULONG Conflict,
3830  _In_ ULONG Invalid
3831 );
3832 
3833 //
3834 // Activation Context Functions
3835 //
3836 #ifdef NTOS_MODE_USER
3837 NTSYSAPI
3838 NTSTATUS
3839 NTAPI
3841  _In_ ULONG Flags,
3842  _In_ PTEB Teb,
3843  _In_ PVOID Context,
3845 );
3846 
3847 NTSYSAPI
3848 NTSTATUS
3849 NTAPI
3851  _In_ ULONG Flags,
3852  _In_ HANDLE Handle,
3854 );
3855 
3856 NTSYSAPI
3857 VOID
3858 NTAPI
3861 );
3862 
3863 NTSYSAPI
3865 FASTCALL
3867  _In_ PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED Frame,
3869 );
3870 
3871 NTSYSAPI
3872 NTSTATUS
3873 NTAPI
3876 );
3877 
3878 NTSYSAPI
3879 NTSTATUS
3880 NTAPI
3882  _In_ ULONG Flags,
3883  _In_ PACTIVATION_CONTEXT_DATA ActivationContextData,
3884  _In_ ULONG ExtraBytes,
3885  _In_ PVOID NotificationRoutine,
3888 );
3889 
3890 NTSYSAPI
3891 NTSTATUS
3892 NTAPI
3894  _In_ PVOID *Context
3895 );
3896 
3897 NTSYSAPI
3898 VOID
3899 NTAPI
3902 );
3903 
3904 NTSYSAPI
3905 NTSTATUS
3906 NTAPI
3908  _In_ ULONG dwFlags,
3909  _In_ ULONG_PTR ulCookie
3910 );
3911 
3912 NTSYSAPI
3913 VOID
3914 NTAPI
3917 );
3918 
3919 NTSYSAPI
3920 VOID
3921 NTAPI
3923 
3924 NTSYSAPI
3926 FASTCALL
3928  _In_ PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED Frame
3929 );
3930 
3931 NTSYSAPI
3932 NTSTATUS
3933 NTAPI
3935  _In_ ULONG Flags,
3936  _In_ PUNICODE_STRING OriginalName,
3941  _In_ PULONG NewFlags,
3942  _In_ PSIZE_T FileNameSize,
3944 );
3945 
3946 NTSYSAPI
3947 NTSTATUS
3948 NTAPI
3950  _In_ ULONG dwFlags,
3951  _In_ const GUID *ExtensionGuid,
3952  _In_ ULONG SectionType,
3953  _In_ const UNICODE_STRING *SectionName,
3954  _Inout_ PVOID ReturnedData
3955 );
3956 
3957 NTSYSAPI
3958 NTSTATUS
3959 NTAPI
3961  _In_ DWORD dwFlags,
3963  _In_opt_ PVOID pvSubInstance,
3964  _In_ ULONG ulInfoClass,
3965  _Out_bytecap_(cbBuffer) PVOID pvBuffer,
3966  _In_opt_ SIZE_T cbBuffer,
3967  _Out_opt_ SIZE_T *pcbWrittenOrRequired
3968 );
3969 
3970 NTSYSAPI
3971 NTSTATUS
3972 NTAPI
3974  _In_ ULONG ulInfoClass,
3975  _Out_bytecap_(cbBuffer) PVOID pvBuffer,
3976  _In_opt_ SIZE_T cbBuffer,
3977  _Out_opt_ SIZE_T *pcbWrittenOrRequired
3978 );
3979 
3980 NTSYSAPI
3981 NTSTATUS
3982 NTAPI
3984  PVOID Context
3985 );
3986 
3987 //
3988 // WOW64 Functions
3989 //
3990 NTSYSAPI
3991 NTSTATUS
3992 NTAPI
3994  _In_ BOOLEAN Wow64FsEnableRedirection
3995 );
3996 
3997 NTSYSAPI
3998 NTSTATUS
3999 NTAPI
4001  _In_ PVOID Wow64FsEnableRedirection,
4002  _Out_ PVOID *OldFsRedirectionLevel
4003 );
4004 
4005 #endif
4006 
4007 //
4008 // Registry Functions
4009 //
4012 NTSYSAPI
4013 NTSTATUS
4014 NTAPI
4016  _In_ ULONG RelativeTo,
4017  _In_ PWSTR Path
4018 );
4019 
4020 NTSYSAPI
4021 NTSTATUS
4022 NTAPI
4024  _In_ ULONG RelativeTo,
4025  _In_ PWSTR Path
4026 );
4027 
4028 NTSYSAPI
4029 NTSTATUS
4030 NTAPI
4032  _Out_ _At_(KeyPath->Buffer, __drv_allocatesMem(Mem) _Post_bytecap_(KeyPath->MaximumLength) _Post_bytecount_(KeyPath->Length))
4033  PUNICODE_STRING KeyPath
4034 );
4035 
4036 NTSYSAPI
4037 NTSTATUS
4038 NTAPI
4042 );
4043 
4045 NTSYSAPI
4046 NTSTATUS
4047 NTAPI
4049  _In_ ULONG RelativeTo,
4050  _In_ PCWSTR Path,
4051  _Inout_ _At_(*(*QueryTable).EntryContext, _Pre_unknown_)
4055 );
4056 
4058 NTSYSAPI
4059 NTSTATUS
4060 NTAPI
4062  _In_ ULONG RelativeTo,
4068 );
4069 
4070 #ifdef NTOS_MODE_USER
4071 NTSYSAPI
4072 NTSTATUS
4073 NTAPI
4081 );
4082 
4083 NTSYSAPI
4084 NTSTATUS
4085 NTAPI
4089  _In_ ULONG Index,
4090  _In_ ULONG Unused
4091 );
4092 
4093 NTSYSAPI
4094 NTSTATUS
4095 NTAPI
4098 );
4099 
4100 NTSYSAPI
4101 NTSTATUS
4102 NTAPI
4107  _In_ ULONG Unused
4108 );
4109 
4110 NTSYSAPI
4111 NTSTATUS
4112 NTAPI
4118  _In_ ULONG Unused
4119 );
4120 
4121 NTSYSAPI
4122 NTSTATUS
4123 NTAPI
4126  _In_ ULONG Type,
4127  _In_ PVOID Data,
4129 );
4130 #endif
4131 
4132 //
4133 // NLS Functions
4134 //
4135 NTSYSAPI
4136 VOID
4137 NTAPI
4141 );
4142 
4143 NTSYSAPI
4144 VOID
4145 NTAPI
4147  _In_ PUSHORT AnsiTableBase,
4148  _In_ PUSHORT OemTableBase,
4149  _In_ PUSHORT CaseTableBase,
4150  _Out_ PNLSTABLEINFO NlsTable
4151 );
4152 
4154 NTSYSAPI
4155 VOID
4156 NTAPI
4158  _In_ PUSHORT TableBase,
4160 );
4161 
4162 NTSYSAPI
4163 VOID
4164 NTAPI
4166  _In_ PNLSTABLEINFO NlsTable);
4167 
4168 #if defined(NTOS_MODE_USER) && !defined(NO_RTL_INLINES)
4169 
4170 //
4171 // Misc conversion functions
4172 //
4173 static __inline
4177  _In_ LONG SignedInteger
4178 )
4179 {
4181 
4182  Result.QuadPart = SignedInteger;
4183  return Result;
4184 }
4185 
4186 static __inline
4190  _In_ LONG Multiplicand,
4191  _In_ LONG Multiplier
4192 )
4193 {
4194  LARGE_INTEGER Product;
4195 
4196  Product.QuadPart = (LONGLONG)Multiplicand * (ULONGLONG)Multiplier;
4197  return Product;
4198 }
4199 
4200 static __inline
4201 ULONG
4204  _In_ ULARGE_INTEGER Dividend,
4205  _In_ ULONG Divisor,
4207 )
4208 {
4209  ULONG Quotient;
4210 
4211  Quotient = (ULONG)(Dividend.QuadPart / Divisor);
4212  if (Remainder) {
4213  *Remainder = (ULONG)(Dividend.QuadPart % Divisor);
4214  }
4215 
4216  return Quotient;
4217 }
4218 
4219 static __inline
4223  _In_ ULONG Multiplicand,
4224  _In_ ULONG Multiplier
4225 )
4226 {
4227  LARGE_INTEGER Product;
4228 
4229  Product.QuadPart = (ULONGLONG)Multiplicand * (ULONGLONG)Multiplier;
4230  return Product;
4231 }
4232 
4233 #if defined(_AMD64_) || defined(_IA64_)
4234 static __inline
4238  _In_ LARGE_INTEGER Dividend,
4239  _In_ ULONG Divisor,
4241 {
4243  ret.QuadPart = (ULONG64)Dividend.QuadPart / Divisor;
4244  if (Remainder)
4245  *Remainder = (ULONG)(Dividend.QuadPart % Divisor);
4246  return ret;
4247 }
4248 
4249 #else
4250 NTSYSAPI
4252 NTAPI
4254  _In_ LARGE_INTEGER Dividend,
4255  _In_ ULONG Divisor,
4257 );
4258 
4259 #endif /* defined(_AMD64_) || defined(_IA64_) */
4260 
4261 #endif
4262 
4263 
4264 NTSYSAPI
4265 ULONG
4266 NTAPI
4267 RtlUniform(
4268  _In_ PULONG Seed
4269 );
4270 
4271 NTSYSAPI
4272 ULONG
4273 NTAPI
4274 RtlRandom(
4275  _Inout_ PULONG Seed
4276 );
4277 
4278 NTSYSAPI
4279 ULONG
4280 NTAPI
4282  _In_ ULONG InitialCrc,
4283  _In_ PUCHAR Buffer,
4284  _In_ ULONG Length
4285 );
4286 
4287 //
4288 // Network Functions
4289 //
4290 NTSYSAPI
4291 PSTR
4292 NTAPI
4294  _In_ const struct in_addr *Addr,
4295  _Out_writes_(16) PCHAR S
4296 );
4297 
4298 NTSYSAPI
4299 PWSTR
4300 NTAPI
4302  _In_ const struct in_addr *Addr,
4303  _Out_writes_(16) PWCHAR S
4304 );
4305 
4306 NTSYSAPI
4307 NTSTATUS
4308 NTAPI
4310  _In_ const struct in_addr *Address,
4311  _In_ USHORT Port,
4312  _Out_writes_to_(*AddressStringLength, *AddressStringLength) PCHAR AddressString,
4313  _Inout_ PULONG AddressStringLength
4314 );
4315 
4316 NTSTATUS
4317 NTAPI
4319  _In_ const struct in_addr *Address,
4320  _In_ USHORT Port,
4321  _Out_writes_to_(*AddressStringLength, *AddressStringLength) PWCHAR AddressString,
4322  _Inout_ PULONG AddressStringLength
4323 );
4324 
4325 NTSYSAPI
4326 NTSTATUS
4327 NTAPI
4329  _In_ PCSTR String,
4330  _In_ BOOLEAN Strict,
4331  _Out_ PCSTR *Terminator,
4332  _Out_ struct in_addr *Addr
4333 );
4334 
4335 NTSYSAPI
4336 NTSTATUS
4337 NTAPI
4339  _In_ PCWSTR String,
4340  _In_ BOOLEAN Strict,
4341  _Out_ PCWSTR *Terminator,
4342  _Out_ struct in_addr *Addr
4343 );
4344 
4345 NTSYSAPI
4346 NTSTATUS
4347 NTAPI
4349  _In_ PCSTR AddressString,
4350  _In_ BOOLEAN Strict,
4351  _Out_ struct in_addr *Address,
4353 );
4354 
4355 NTSYSAPI
4356 NTSTATUS
4357 NTAPI
4359  _In_ PCWSTR AddressString,
4360  _In_ BOOLEAN Strict,
4361  _Out_ struct in_addr *Address,
4363 );
4364 
4365 NTSYSAPI
4366 PSTR
4367 NTAPI
4369  _In_ const struct in6_addr *Addr,
4370  _Out_writes_(46) PSTR S
4371 );
4372 
4373 NTSYSAPI
4374 PWSTR
4375 NTAPI
4377  _In_ const struct in6_addr *Addr,
4378  _Out_writes_(46) PWSTR S
4379 );
4380 
4381 NTSYSAPI
4382 NTSTATUS
4383 NTAPI
4385  _In_ const struct in6_addr *Address,
4386  _In_ ULONG ScopeId,
4387  _In_ USHORT Port,
4388  _Out_writes_to_(*AddressStringLength, *AddressStringLength) PSTR AddressString,
4389  _Inout_ PULONG AddressStringLength
4390 );
4391 
4392 NTSYSAPI
4393 NTSTATUS
4394 NTAPI
4396  _In_ const struct in6_addr *Address,
4397  _In_ ULONG ScopeId,
4398  _In_ USHORT Port,
4399  _Out_writes_to_(*AddressStringLength, *AddressStringLength) PWCHAR AddressString,
4400  _Inout_ PULONG AddressStringLength
4401 );
4402 
4403 NTSYSAPI
4404 NTSTATUS
4405 NTAPI
4407  _In_ PCSTR String,
4408  _Out_ PCSTR *Terminator,
4409  _Out_ struct in6_addr *Addr
4410 );
4411 
4412 NTSYSAPI
4413 NTSTATUS
4414 NTAPI
4416  _In_ PCWSTR String,
4417  _Out_ PCWSTR *Terminator,
4418  _Out_ struct in6_addr *Addr
4419 );
4420 
4421 NTSYSAPI
4422 NTSTATUS
4423 NTAPI
4425  _In_ PCSTR AddressString,
4426  _Out_ struct in6_addr *Address,
4427  _Out_ PULONG ScopeId,
4429 );
4430 
4431 NTSYSAPI
4432 NTSTATUS
4433 NTAPI
4435  _In_ PCWSTR AddressString,
4436  _Out_ struct in6_addr *Address,
4437  _Out_ PULONG ScopeId,
4439 );
4440 
4441 
4442 //
4443 // Time Functions
4444 //
4445 NTSYSAPI
4446 NTSTATUS
4447 NTAPI
4449  _Out_ PRTL_TIME_ZONE_INFORMATION TimeZoneInformation);
4450 
4451 NTSYSAPI
4452 VOID
4453 NTAPI
4455  _In_ ULONG SecondsSince1970,
4457 );
4458 
4459 NTSYSAPI
4460 NTSTATUS
4461 NTAPI
4463  _In_ PRTL_TIME_ZONE_INFORMATION TimeZoneInformation);
4464 
4465 _Success_(return!=FALSE)
4467 NTSYSAPI
4468 BOOLEAN
4469 NTAPI
4473 );
4474 
4475 _Success_(return != 0)
4477 NTSYSAPI
4478 BOOLEAN
4479 NTAPI
4483 );
4484 
4485 NTSYSAPI
4486 VOID
4487 NTAPI
4491 );
4492 
4493 NTSYSAPI
4494 NTSTATUS
4495 NTAPI
4497  _In_ PLARGE_INTEGER SystemTime,
4498  _Out_ PLARGE_INTEGER LocalTime
4499 );
4500 
4501 //
4502 // Version Functions
4503 //
4506 NTSYSAPI
4507 NTSTATUS
4508 NTAPI
4510  _In_ PRTL_OSVERSIONINFOEXW VersionInfo,
4513 );
4514 
4516 NTSYSAPI
4517 NTSTATUS
4518 NTAPI
4520  _Out_
4521  _At_(lpVersionInformation->dwOSVersionInfoSize, _Pre_ _Valid_)
4522  _When_(lpVersionInformation->dwOSVersionInfoSize == sizeof(RTL_OSVERSIONINFOEXW),
4523  _At_((PRTL_OSVERSIONINFOEXW)lpVersionInformation, _Out_))
4524  PRTL_OSVERSIONINFOW lpVersionInformation
4525 );
4526 
4527 NTSYSAPI
4528 BOOLEAN
4529 NTAPI
4531 
4532 //
4533 // Secure Memory Functions
4534 //
4535 #ifdef NTOS_MODE_USER
4536 NTSYSAPI
4537 NTSTATUS
4538 NTAPI
4540  _In_ PRTL_SECURE_MEMORY_CACHE_CALLBACK Callback);
4541 
4542 NTSYSAPI
4543 BOOLEAN
4544 NTAPI
4546  _In_ PVOID MemoryCache,
4547  _In_opt_ SIZE_T MemoryLength
4548 );
4549 #endif
4550 
4551 //
4552 // Boot Status Data Functions
4553 //
4554 #ifdef NTOS_MODE_USER
4555 NTSYSAPI
4556 NTSTATUS
4557 NTAPI
4559  VOID
4560 );
4561 
4562 NTSYSAPI
4563 NTSTATUS
4564 NTAPI
4567  _In_ BOOLEAN WriteMode,
4568  _In_ RTL_BSD_ITEM_TYPE DataClass,
4569  _In_ PVOID Buffer,
4572 );
4573 
4574 NTSYSAPI
4575 NTSTATUS
4576 NTAPI
4579 );
4580 
4581 NTSYSAPI
4582 NTSTATUS
4583 NTAPI
4586 );
4587 #endif
4588 
4589 #ifdef NTOS_MODE_USER
4591 NTSYSAPI
4592 NTSTATUS
4593 NTAPI
4596  _Out_ GUID *Guid);
4597 
4599 NTSYSAPI
4600 NTSTATUS
4601 NTAPI
4603  _In_ REFGUID Guid,
4604  _Out_ _At_(GuidString->Buffer, __drv_allocatesMem(Mem))
4606 
4607 NTSYSAPI
4608 NTSTATUS
4609 NTAPI
4611  _In_ HANDLE hFile,
4612  _Out_ PCHAR Hash,
4613  _In_ ULONG ImportTableHashRevision
4614 );
4615 #endif
4616 
4617 //
4618 // MemoryStream functions
4619 //
4620 #ifdef NTOS_MODE_USER
4621 
4622 NTSYSAPI
4623 VOID
4624 NTAPI
4626  _Out_ PRTL_MEMORY_STREAM Stream
4627 );
4628 
4629 NTSYSAPI
4630 VOID
4631 NTAPI
4633  _Out_ PRTL_MEMORY_STREAM Stream
4634 );
4635 
4636 NTSYSAPI
4637 VOID
4638 NTAPI
4640  _In_ PRTL_MEMORY_STREAM Stream
4641 );
4642 
4643 NTSYSAPI
4644 HRESULT
4645 NTAPI
4647  _In_ struct IStream *This,
4648  _In_ REFIID RequestedIid,
4649  _Outptr_ PVOID *ResultObject
4650 );
4651 
4652 NTSYSAPI
4653 ULONG
4654 NTAPI
4656  _In_ struct IStream *This
4657 );
4658 
4659 NTSYSAPI
4660 ULONG
4661 NTAPI
4663  _In_ struct IStream *This
4664 );
4665 
4666 NTSYSAPI
4667 HRESULT
4668 NTAPI
4670  _In_ struct IStream *This,
4672  _In_ ULONG Length,
4674 );
4675 
4676 NTSYSAPI
4677 HRESULT
4678 NTAPI
4680  _In_ struct IStream *This,
4682  _In_ ULONG Length,
4684 );
4685 
4686 NTSYSAPI
4687 HRESULT
4688 NTAPI
4690  _In_ struct IStream *This,
4691  _In_ LARGE_INTEGER RelativeOffset,
4692  _In_ ULONG Origin,
4693  _Out_opt_ PULARGE_INTEGER ResultOffset
4694 );
4695 
4696 NTSYSAPI
4697 HRESULT
4698 NTAPI
4700  _In_ struct IStream *This,
4701  _In_ struct IStream *Target,
4705 );
4706 
4707 NTSYSAPI
4708 HRESULT
4709 NTAPI
4710 RtlCopyOutOfProcessMemoryStreamTo(
4711  _In_ struct IStream *This,
4712  _In_ struct IStream *Target,
4716 );
4717 
4718 NTSYSAPI
4719 HRESULT
4720 NTAPI
4722  _In_ struct IStream *This,
4723  _Out_ struct tagSTATSTG *Stats,
4724  _In_ ULONG Flags
4725 );
4726 
4727 // Dummy functions
4728 NTSYSAPI
4729 HRESULT
4730 NTAPI
4732  _In_ struct IStream *This,
4734  _In_ ULONG Length,
4736 );
4737 
4738 NTSYSAPI
4739 HRESULT
4740 NTAPI
4742  _In_ struct IStream *This,
4744 );
4745 
4746 NTSYSAPI
4747 HRESULT
4748 NTAPI
4750  _In_ struct IStream *This,
4751  _In_ ULONG CommitFlags
4752 );
4753 
4754 NTSYSAPI
4755 HRESULT
4756 NTAPI
4758  _In_ struct IStream *This
4759 );
4760 
4761 NTSYSAPI
4762 HRESULT
4763 NTAPI
4765  _In_ struct IStream *This,
4768  _In_ ULONG LockType
4769 );
4770 
4771 NTSYSAPI
4772 HRESULT
4773 NTAPI
4775  _In_ struct IStream *This,
4778  _In_ ULONG LockType
4779 );
4780 
4781 NTSYSAPI
4782 HRESULT
4783 NTAPI
4785  _In_ struct IStream *This,
4786  _Outptr_ struct IStream **ResultStream
4787 );
4788 
4789 NTSYSAPI
4790 NTSTATUS
4791 NTAPI
4792 RtlGetNativeSystemInformation(
4793  _In_ SYSTEM_INFORMATION_CLASS SystemInformationClass,
4794  _Out_writes_bytes_to_opt_(SystemInformationLength, *ReturnLength) PVOID SystemInformation,
4795  _In_ ULONG SystemInformationLength,
4797 );
4798 
4799 #endif // NTOS_MODE_USER
4800 
4801 NTSYSAPI
4802 NTSTATUS
4803 NTAPI
4805  ULONG flags,
4806  const GUID *extguid,
4807  ULONG section_kind,
4808  const GUID *guid,
4809  void *ptr
4810 );
4811 
4812 #ifdef __cplusplus
4813 }
4814 #endif
4815 
4816 #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:4018
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)
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:4511
NTSYSAPI LONGLONG WINAPI RtlConvertLongToLargeInteger(LONG)
Definition: largeint.c:31
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: