8 #include <rosrtl/string.h>
10 #if defined(__NTOSKRNL__) || defined(__NTDRIVER__) || defined(__NTHAL__) || defined(__NTDLL__) || defined (__NTAPP__)
15 #endif /* __NTOSKRNL__ || __NTDRIVER__ || __NTHAL__ || __NTDLL__ || __NTAPP__ */
17 #define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))
18 #define ROUND_DOWN(N, S) ((N) - ((N) % (S)))
23 * PURPOSE: Flags for RtlQueryRegistryValues
25 #define RTL_QUERY_REGISTRY_SUBKEY (0x00000001)
26 #define RTL_QUERY_REGISTRY_TOPKEY (0x00000002)
27 #define RTL_QUERY_REGISTRY_REQUIRED (0x00000004)
28 #define RTL_QUERY_REGISTRY_NOVALUE (0x00000008)
29 #define RTL_QUERY_REGISTRY_NOEXPAND (0x00000010)
30 #define RTL_QUERY_REGISTRY_DIRECT (0x00000020)
31 #define RTL_QUERY_REGISTRY_DELETE (0x00000040)
35 * PURPOSE: Flags used by RtlIsTextUnicode and IsTextUnicode
37 #define IS_TEXT_UNICODE_ASCII16 (0x00000001)
38 #define IS_TEXT_UNICODE_REVERSE_ASCII16 (0x00000010)
39 #define IS_TEXT_UNICODE_STATISTICS (0x00000002)
40 #define IS_TEXT_UNICODE_REVERSE_STATISTICS (0x00000020)
41 #define IS_TEXT_UNICODE_CONTROLS (0x00000004)
42 #define IS_TEXT_UNICODE_REVERSE_CONTROLS (0x00000040)
43 #define IS_TEXT_UNICODE_SIGNATURE (0x00000008)
44 #define IS_TEXT_UNICODE_REVERSE_SIGNATURE (0x00000080)
45 #define IS_TEXT_UNICODE_ILLEGAL_CHARS (0x00000100)
46 #define IS_TEXT_UNICODE_ODD_LENGTH (0x00000200)
47 #define IS_TEXT_UNICODE_NULL_BYTES (0x00001000)
48 #define IS_TEXT_UNICODE_UNICODE_MASK (0x0000000F)
49 #define IS_TEXT_UNICODE_REVERSE_MASK (0x000000F0)
50 #define IS_TEXT_UNICODE_NOT_UNICODE_MASK (0x00000F00)
51 #define IS_TEXT_UNICODE_NOT_ASCII_MASK (0x0000F000)
55 * InitializeObjectAttributes (
56 * POBJECT_ATTRIBUTES InitializedAttributes,
57 * PUNICODE_STRING ObjectName,
59 * HANDLE RootDirectory,
60 * PSECURITY_DESCRIPTOR SecurityDescriptor
63 * FUNCTION: Sets up a parameter of type OBJECT_ATTRIBUTES for a
64 * subsequent call to ZwCreateXXX or ZwOpenXXX
66 * InitializedAttributes (OUT) = Caller supplied storage for the
68 * ObjectName = Full path name for object
69 * Attributes = Attributes for the object
70 * RootDirectory = Where the object should be placed or NULL
71 * SecurityDescriptor = Ignored
73 #define InitializeObjectAttributes(p,n,a,r,s) \
75 (p)->Length = sizeof(OBJECT_ATTRIBUTES); \
76 (p)->ObjectName = n; \
77 (p)->Attributes = a; \
78 (p)->RootDirectory = r; \
79 (p)->SecurityDescriptor = s; \
80 (p)->SecurityQualityOfService = NULL; \
86 * InitializeListHead (
87 * PLIST_ENTRY ListHead
90 * FUNCTION: Initializes a double linked list
92 * ListHead = Caller supplied storage for the head of the list
96 IN PLIST_ENTRY ListHead
)
98 ListHead
->Flink
= ListHead
->Blink
= ListHead
;
105 * PLIST_ENTRY ListHead,
109 * FUNCTION: Inserts an entry in a double linked list
111 * ListHead = Head of the list
112 * Entry = Entry to insert
116 IN PLIST_ENTRY ListHead
,
117 IN PLIST_ENTRY Entry
)
119 PLIST_ENTRY OldFlink
;
120 OldFlink
= ListHead
->Flink
;
121 Entry
->Flink
= OldFlink
;
122 Entry
->Blink
= ListHead
;
123 OldFlink
->Blink
= Entry
;
124 ListHead
->Flink
= Entry
;
131 * PLIST_ENTRY ListHead,
136 * Inserts an entry in a double linked list
139 * ListHead = Head of the list
140 * Entry = Entry to insert
144 IN PLIST_ENTRY ListHead
,
145 IN PLIST_ENTRY Entry
)
147 PLIST_ENTRY OldBlink
;
148 OldBlink
= ListHead
->Blink
;
149 Entry
->Flink
= ListHead
;
150 Entry
->Blink
= OldBlink
;
151 OldBlink
->Flink
= Entry
;
152 ListHead
->Blink
= Entry
;
158 * PLIST_ENTRY ListHead
162 * Checks if a double linked list is empty
165 * ListHead = Head of the list
167 #define IsListEmpty(ListHead) \
168 ((ListHead)->Flink == (ListHead))
174 * PSINGLE_LIST_ENTRY ListHead
178 * Removes an entry from the head of a single linked list
181 * ListHead = Head of the list
186 #define PopEntryList(ListHead) \
189 PSINGLE_LIST_ENTRY _FirstEntry; \
190 _FirstEntry = (ListHead)->Next; \
191 if (_FirstEntry != NULL) \
192 (ListHead)->Next = _FirstEntry->Next; \
195 #define RtlCopyMemory(Destination,Source,Length) \
196 memcpy((Destination),(Source),(Length))
198 #define PushEntryList(_ListHead, _Entry) \
199 (_Entry)->Next = (_ListHead)->Next; \
200 (_ListHead)->Next = (_Entry); \
209 * Removes an entry from a double linked list
212 * ListEntry = Entry to remove
214 static __inline BOOLEAN
216 IN PLIST_ENTRY Entry
)
218 PLIST_ENTRY OldFlink
;
219 PLIST_ENTRY OldBlink
;
221 OldFlink
= Entry
->Flink
;
222 OldBlink
= Entry
->Blink
;
223 OldFlink
->Blink
= OldBlink
;
224 OldBlink
->Flink
= OldFlink
;
225 return (OldFlink
== OldBlink
);
232 * PLIST_ENTRY ListHead
236 * Removes the head entry from a double linked list
239 * ListHead = Head of the list
244 static __inline PLIST_ENTRY
246 IN PLIST_ENTRY ListHead
)
251 Entry
= ListHead
->Flink
;
252 Flink
= Entry
->Flink
;
253 ListHead
->Flink
= Flink
;
254 Flink
->Blink
= ListHead
;
262 * PLIST_ENTRY ListHead
266 * Removes the tail entry from a double linked list
269 * ListHead = Head of the list
274 static __inline PLIST_ENTRY
276 IN PLIST_ENTRY ListHead
)
281 Entry
= ListHead
->Blink
;
282 Blink
= Entry
->Blink
;
283 ListHead
->Blink
= Blink
;
284 Blink
->Flink
= ListHead
;
291 * PLIST_ENTRY ListHead,
295 #define IsFirstEntry(ListHead, Entry) ((ListHead)->Flink == Entry)
297 #define IsLastEntry(ListHead, Entry) ((ListHead)->Blink == Entry)
299 #define RtlEqualMemory(Destination,Source,Length) (!memcmp((Destination), (Source), (Length)))
303 RtlCreateUserThread (
304 IN HANDLE ProcessHandle
,
305 IN PSECURITY_DESCRIPTOR SecurityDescriptor
,
306 IN BOOLEAN CreateSuspended
,
307 IN LONG StackZeroBits
,
308 IN OUT PULONG StackReserve
,
309 IN OUT PULONG StackCommit
,
310 IN PTHREAD_START_ROUTINE StartAddress
,
312 IN OUT PHANDLE ThreadHandle
,
313 IN OUT PCLIENT_ID ClientId
318 RtlAppendUnicodeToString (
319 PUNICODE_STRING Destination
,
324 RtlCompareMemory(IN
const VOID
*Source1
,
325 IN
const VOID
*Source2
,
330 RtlEqualUnicodeString (
331 PUNICODE_STRING String1
,
332 PUNICODE_STRING String2
,
333 BOOLEAN CaseInSensitive
338 RtlQueryRegistryValues (
341 IN PRTL_QUERY_REGISTRY_TABLE QueryTable
,
348 RtlWriteRegistryValue (
358 RtlDeleteRegistryValue(IN ULONG RelativeTo
,
360 IN PCWSTR ValueName
);
363 RtlMoveMemory (PVOID Destination
, CONST VOID
* Source
, ULONG Length
);
366 RtlEqualLuid(IN PLUID Luid1
,
378 RtlZeroMemory (PVOID Destination
, ULONG Length
);
380 #else /* __USE_W32API */
382 #include <ddk/ntifs.h>
384 #endif /* __USE_W32API */
387 * FIFO versions are slower but ensures that entries with equal SortField value
388 * are placed in FIFO order (assuming that entries are removed from Head).
391 #define InsertAscendingListFIFO(ListHead, Type, ListEntryField, NewEntry, SortField)\
393 PLIST_ENTRY current;\
395 current = (ListHead)->Flink;\
396 while (current != (ListHead))\
398 if (CONTAINING_RECORD(current, Type, ListEntryField)->SortField >\
399 (NewEntry)->SortField)\
403 current = current->Flink;\
406 InsertTailList(current, &((NewEntry)->ListEntryField));\
410 #define InsertDescendingListFIFO(ListHead, Type, ListEntryField, NewEntry, SortField)\
412 PLIST_ENTRY current;\
414 current = (ListHead)->Flink;\
415 while (current != (ListHead))\
417 if (CONTAINING_RECORD(current, Type, ListEntryField)->SortField <\
418 (NewEntry)->SortField)\
422 current = current->Flink;\
425 InsertTailList(current, &((NewEntry)->ListEntryField));\
429 #define InsertAscendingList(ListHead, Type, ListEntryField, NewEntry, SortField)\
431 PLIST_ENTRY current;\
433 current = (ListHead)->Flink;\
434 while (current != (ListHead))\
436 if (CONTAINING_RECORD(current, Type, ListEntryField)->SortField >=\
437 (NewEntry)->SortField)\
441 current = current->Flink;\
444 InsertTailList(current, &((NewEntry)->ListEntryField));\
448 #define InsertDescendingList(ListHead, Type, ListEntryField, NewEntry, SortField)\
450 PLIST_ENTRY current;\
452 current = (ListHead)->Flink;\
453 while (current != (ListHead))\
455 if (CONTAINING_RECORD(current, Type, ListEntryField)->SortField <=\
456 (NewEntry)->SortField)\
460 current = current->Flink;\
463 InsertTailList(current, &((NewEntry)->ListEntryField));\
467 * PURPOSE: Used with RtlCheckRegistryKey, RtlCreateRegistryKey,
468 * RtlDeleteRegistryKey
470 #define RTL_REGISTRY_ABSOLUTE 0
471 #define RTL_REGISTRY_SERVICES 1
472 #define RTL_REGISTRY_CONTROL 2
473 #define RTL_REGISTRY_WINDOWS_NT 3
474 #define RTL_REGISTRY_DEVICEMAP 4
475 #define RTL_REGISTRY_USER 5
476 #define RTL_REGISTRY_MAXIMUM 6
478 #define RTL_REGISTRY_HANDLE 0x40000000
479 #define RTL_REGISTRY_OPTIONAL 0x80000000
482 #define SHORT_SIZE (sizeof(USHORT))
483 #define SHORT_MASK (SHORT_SIZE-1)
484 #define LOWBYTE_MASK 0x00FF
486 #define FIRSTBYTE(Value) ((Value) & LOWBYTE_MASK)
487 #define SECONDBYTE(Value) (((Value) >> 8) & LOWBYTE_MASK)
488 #define THIRDBYTE(Value) (((Value) >> 16) & LOWBYTE_MASK)
489 #define FOURTHBYTE(Value) (((Value) >> 24) & LOWBYTE_MASK)
491 /* FIXME: reverse byte-order on big-endian machines (e.g. MIPS) */
492 #define SHORT_LEAST_SIGNIFICANT_BIT 0
493 #define SHORT_MOST_SIGNIFICANT_BIT 1
495 #define LONG_LEAST_SIGNIFICANT_BIT 0
496 #define LONG_3RD_MOST_SIGNIFICANT_BIT 1
497 #define LONG_2RD_MOST_SIGNIFICANT_BIT 2
498 #define LONG_MOST_SIGNIFICANT_BIT 3
501 #define NLS_ANSI_CODE_PAGE NlsAnsiCodePage
502 #define NLS_LEAD_BYTE_INFO NlsLeadByteInfo
503 #define NLS_MB_OEM_CODE_PAGE_TAG NlsMbOemCodePageTag
504 #define NLS_OEM_LEAD_BYTE_INFO NlsOemLeadByteInfo
506 #if defined(__NTOSKRNL__) || defined(__NTDLL__)
507 extern USHORT EXPORTED NlsAnsiCodePage
;
508 extern PUSHORT EXPORTED NlsLeadByteInfo
;
509 extern BOOLEAN EXPORTED NlsMbCodePageTag
;
510 extern BOOLEAN EXPORTED NlsMbOemCodePageTag
;
511 extern PUSHORT EXPORTED NlsOemLeadByteInfo
;
513 extern USHORT IMPORTED NlsAnsiCodePage
;
514 extern PUSHORT IMPORTED NlsLeadByteInfo
;
515 extern BOOLEAN IMPORTED NlsMbCodePageTag
;
516 extern BOOLEAN IMPORTED NlsMbOemCodePageTag
;
517 extern PUSHORT IMPORTED NlsOemLeadByteInfo
;
518 #endif /* __NTOSKRNL__ || __NTDLL__ */
523 PSINGLE_LIST_ENTRY ListHead,
524 PSINGLE_LIST_ENTRY Entry
528 #define PushEntryList(ListHead,Entry) \
529 (Entry)->Next = (ListHead)->Next; \
530 (ListHead)->Next = (Entry)
535 RtlAbsoluteToSelfRelativeSD (PSECURITY_DESCRIPTOR AbsSD
,
536 PSECURITY_DESCRIPTOR_RELATIVE RelSD
,
537 PULONG BufferLength
);
540 RtlAddAccessAllowedAce (PACL Acl
,
542 ACCESS_MASK AccessMask
,
547 RtlAddAccessAllowedAceEx(
549 IN DWORD dwAceRevision
,
556 RtlAddAccessDeniedAce (PACL Acl
,
558 ACCESS_MASK AccessMask
,
566 ULONG AceListLength
);
569 RtlAddAtomToAtomTable (IN PRTL_ATOM_TABLE AtomTable
,
574 RtlAddAuditAccessAce (PACL Acl
,
576 ACCESS_MASK AccessMask
,
582 RtlAddRange (IN OUT PRTL_RANGE_LIST RangeList
,
586 IN ULONG Flags
, /* RTL_RANGE_LIST_ADD_... flags */
587 IN PVOID UserData OPTIONAL
,
588 IN PVOID Owner OPTIONAL
);
591 RtlAllocateAndInitializeSid (IN PSID_IDENTIFIER_AUTHORITY IdentifierAuthority
,
592 IN UCHAR SubAuthorityCount
,
593 IN ULONG SubAuthority0
,
594 IN ULONG SubAuthority1
,
595 IN ULONG SubAuthority2
,
596 IN ULONG SubAuthority3
,
597 IN ULONG SubAuthority4
,
598 IN ULONG SubAuthority5
,
599 IN ULONG SubAuthority6
,
600 IN ULONG SubAuthority7
,
611 RtlAnsiCharToUnicodeChar (IN CHAR AnsiChar
);
615 RtlAnsiStringToUnicodeSize (
616 PANSI_STRING AnsiString
621 RtlAnsiStringToUnicodeString (
622 PUNICODE_STRING DestinationString
,
623 PANSI_STRING SourceString
,
624 BOOLEAN AllocateDestinationString
629 RtlAppendAsciizToString(
636 RtlAppendStringToString (
643 RtlAppendUnicodeStringToString (
644 PUNICODE_STRING Destination
,
645 PUNICODE_STRING Source
649 RtlAreAllAccessesGranted (ACCESS_MASK GrantedAccess
,
650 ACCESS_MASK DesiredAccess
);
653 RtlAreAnyAccessesGranted (ACCESS_MASK GrantedAccess
,
654 ACCESS_MASK DesiredAccess
);
659 PRTL_BITMAP BitMapHeader
,
667 PRTL_BITMAP BitMapHeader
,
675 PVOID FailedAssertion
,
684 OUT PCONTEXT ContextRecord
689 RtlCaptureStackBackTrace (
690 IN ULONG FramesToSkip
,
691 IN ULONG FramesToCapture
,
692 OUT PVOID
*BackTrace
,
693 OUT PULONG BackTraceHash OPTIONAL
708 RtlCheckRegistryKey (
716 IN PRTL_BITMAP BitMapHeader
722 PRTL_BITMAP BitMapHeader
,
729 IN PRTL_BITMAP BitMapHeader
,
730 IN ULONG StartingIndex
,
731 IN ULONG NumberToClear
745 BOOLEAN CaseInsensitive
750 RtlCompareUnicodeString (
751 PUNICODE_STRING String1
,
752 PUNICODE_STRING String2
,
753 BOOLEAN CaseInsensitive
757 RtlCompressBuffer(IN USHORT CompressionFormatAndEngine
,
758 IN PUCHAR UncompressedBuffer
,
759 IN ULONG UncompressedBufferSize
,
760 OUT PUCHAR CompressedBuffer
,
761 IN ULONG CompressedBufferSize
,
762 IN ULONG UncompressedChunkSize
,
763 OUT PULONG FinalCompressedSize
,
767 RtlCompressChunks(IN PUCHAR UncompressedBuffer
,
768 IN ULONG UncompressedBufferSize
,
769 OUT PUCHAR CompressedBuffer
,
770 IN ULONG CompressedBufferSize
,
771 IN OUT PCOMPRESSED_DATA_INFO CompressedDataInfo
,
772 IN ULONG CompressedDataInfoLength
,
775 LARGE_INTEGER STDCALL
776 RtlConvertLongToLargeInteger (IN LONG SignedInteger
);
779 RtlConvertSidToUnicodeString (IN OUT PUNICODE_STRING String
,
781 IN BOOLEAN AllocateString
);
783 LARGE_INTEGER STDCALL
784 RtlConvertUlongToLargeInteger (IN ULONG UnsignedInteger
);
802 #define RtlCopyBytes RtlCopyMemory
805 RtlCopyLuid(IN PLUID LuidDest
,
809 RtlCopyLuidAndAttributesArray(ULONG Count
,
810 PLUID_AND_ATTRIBUTES Src
,
811 PLUID_AND_ATTRIBUTES Dest
);
814 RtlCopyRangeList (OUT PRTL_RANGE_LIST CopyRangeList
,
815 IN PRTL_RANGE_LIST RangeList
);
818 RtlCopySid(ULONG BufferLength
,
823 RtlCopySidAndAttributesArray(ULONG Count
,
824 PSID_AND_ATTRIBUTES Src
,
826 PSID_AND_ATTRIBUTES Dest
,
828 PVOID
* RemainingSidArea
,
829 PULONG RemainingSidAreaSize
);
832 RtlCopyString(PSTRING DestinationString
,
833 PSTRING SourceString
);
836 RtlCopyUnicodeString(PUNICODE_STRING DestinationString
,
837 PUNICODE_STRING SourceString
);
840 RtlCreateAcl (PACL Acl
,
845 RtlCreateAtomTable(IN ULONG TableSize
,
846 IN OUT PRTL_ATOM_TABLE
*AtomTable
);
853 ULONG SizeToReserve
, /* dwMaximumSize */
854 ULONG SizeToCommit
, /* dwInitialSize */
856 PRTL_HEAP_DEFINITION Definition
860 RtlCreateRegistryKey (ULONG RelativeTo
,
864 RtlCreateSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor
,
868 RtlCreateSecurityDescriptorRelative (PSECURITY_DESCRIPTOR_RELATIVE SecurityDescriptor
,
873 RtlCreateSystemVolumeInformationFolder(
874 IN PUNICODE_STRING VolumeRootPath
878 RtlCreateUnicodeString (OUT PUNICODE_STRING Destination
,
882 RtlCreateUnicodeStringFromAsciiz (OUT PUNICODE_STRING Destination
,
887 RtlCustomCPToUnicodeN (
888 IN PCPTABLEINFO CustomCP
,
889 PWCHAR UnicodeString
,
897 RtlCutoverTimeToSystemTime(IN PTIME_FIELDS CutoverTimeFields
,
898 OUT PLARGE_INTEGER SystemTime
,
899 IN PLARGE_INTEGER CurrentTime
,
900 IN BOOLEAN ThisYearsCutoverOnly
);
903 RtlDecompressBuffer(IN USHORT CompressionFormat
,
904 OUT PUCHAR UncompressedBuffer
,
905 IN ULONG UncompressedBufferSize
,
906 IN PUCHAR CompressedBuffer
,
907 IN ULONG CompressedBufferSize
,
908 OUT PULONG FinalUncompressedSize
);
911 RtlDecompressChunks(OUT PUCHAR UncompressedBuffer
,
912 IN ULONG UncompressedBufferSize
,
913 IN PUCHAR CompressedBuffer
,
914 IN ULONG CompressedBufferSize
,
915 IN PUCHAR CompressedTail
,
916 IN ULONG CompressedTailSize
,
917 IN PCOMPRESSED_DATA_INFO CompressedDataInfo
);
920 RtlDecompressFragment(IN USHORT CompressionFormat
,
921 OUT PUCHAR UncompressedFragment
,
922 IN ULONG UncompressedFragmentSize
,
923 IN PUCHAR CompressedBuffer
,
924 IN ULONG CompressedBufferSize
,
925 IN ULONG FragmentOffset
,
926 OUT PULONG FinalUncompressedSize
,
932 PRTL_SPLAY_LINKS Links
936 RtlDeleteAce (PACL Acl
,
940 RtlDeleteAtomFromAtomTable (IN PRTL_ATOM_TABLE AtomTable
,
945 RtlDeleteElementGenericTable (
946 PRTL_GENERIC_TABLE Table
,
952 RtlDeleteElementGenericTableAvl (
953 PRTL_AVL_TABLE Table
,
960 PRTL_SPLAY_LINKS Links
,
961 PRTL_SPLAY_LINKS
*Root
966 RtlDeleteOwnersRanges (IN OUT PRTL_RANGE_LIST RangeList
,
970 RtlDeleteRange (IN OUT PRTL_RANGE_LIST RangeList
,
976 RtlDescribeChunk(IN USHORT CompressionFormat
,
977 IN OUT PUCHAR
*CompressedBuffer
,
978 IN PUCHAR EndOfCompressedBufferPlus1
,
979 OUT PUCHAR
*ChunkBuffer
,
980 OUT PULONG ChunkSize
);
983 RtlDestroyAtomTable (IN PRTL_ATOM_TABLE AtomTable
);
986 RtlDestroyHeap (HANDLE hheap
);
990 RtlDispatchException(
991 PEXCEPTION_RECORD pExcptRec
,
998 RtlDowncaseUnicodeString (
999 IN OUT PUNICODE_STRING DestinationString
,
1000 IN PUNICODE_STRING SourceString
,
1001 IN BOOLEAN AllocateDestinationString
1007 IN PRTL_ATOM_TABLE AtomTable
,
1008 IN BOOLEAN DeletePinned
1013 RtlEnlargedIntegerMultiply (
1020 RtlEnlargedUnsignedDivide (
1021 ULARGE_INTEGER Dividend
,
1028 RtlEnlargedUnsignedMultiply (
1035 RtlEnumerateGenericTable (
1036 PRTL_GENERIC_TABLE Table
,
1042 RtlEnumerateGenericTableAvl (
1043 PRTL_AVL_TABLE Table
,
1049 RtlEnumerateGenericTableLikeADirectory (
1050 IN PRTL_AVL_TABLE Table
,
1051 IN PRTL_AVL_MATCH_FUNCTION MatchFunction
,
1054 IN OUT PVOID
*RestartKey
,
1055 IN OUT PULONG DeleteCount
,
1061 RtlEnumerateGenericTableWithoutSplaying (
1062 PRTL_GENERIC_TABLE Table
,
1068 RtlEnumerateGenericTableWithoutSplayingAvl (
1069 PRTL_AVL_TABLE Table
,
1074 RtlEqualPrefixSid (PSID Sid1
,
1078 RtlEqualSid (PSID Sid1
,
1086 BOOLEAN CaseInSensitive
1091 RtlExtendedIntegerMultiply (
1092 LARGE_INTEGER Multiplicand
,
1098 RtlExtendedLargeIntegerDivide (
1099 LARGE_INTEGER Dividend
,
1106 RtlExtendedMagicDivide (
1107 LARGE_INTEGER Dividend
,
1108 LARGE_INTEGER MagicDivisor
,
1114 RtlFillMemoryUlong (
1123 PRTL_BITMAP BitMapHeader
,
1130 RtlFindClearBitsAndSet (
1131 PRTL_BITMAP BitMapHeader
,
1139 PRTL_BITMAP BitMapHeader
,
1140 PRTL_BITMAP_RUN RunArray
,
1141 ULONG SizeOfRunArray
,
1142 BOOLEAN LocateLongestRuns
1147 RtlFindLastBackwardRunClear (
1148 IN PRTL_BITMAP BitMapHeader
,
1150 IN PULONG StartingRunIndex
1155 RtlFindNextForwardRunClear (
1156 IN PRTL_BITMAP BitMapHeader
,
1158 IN PULONG StartingRunIndex
1162 PUNICODE_PREFIX_TABLE_ENTRY
1164 RtlFindUnicodePrefix (
1165 PUNICODE_PREFIX_TABLE PrefixTable
,
1166 PUNICODE_STRING FullName
,
1167 ULONG CaseInsensitiveIndex
1172 RtlFindFirstRunClear (
1173 PRTL_BITMAP BitMapHeader
,
1174 PULONG StartingIndex
1179 RtlFindFirstRunSet (
1180 PRTL_BITMAP BitMapHeader
,
1181 PULONG StartingIndex
1185 RtlFindLeastSignificantBit (IN ULONGLONG Set
);
1189 RtlFindLongestRunClear (
1190 PRTL_BITMAP BitMapHeader
,
1191 PULONG StartingIndex
1196 RtlFindLongestRunSet (
1197 PRTL_BITMAP BitMapHeader
,
1198 PULONG StartingIndex
1204 IN PVOID BaseAddress
,
1208 OUT PRTL_MESSAGE_RESOURCE_ENTRY
*MessageResourceEntry
1212 RtlFindMostSignificantBit (IN ULONGLONG Set
);
1215 RtlFindRange (IN PRTL_RANGE_LIST RangeList
,
1216 IN ULONGLONG Minimum
,
1217 IN ULONGLONG Maximum
,
1221 IN UCHAR AttributeAvailableMask
,
1222 IN PVOID Context OPTIONAL
,
1223 IN PRTL_CONFLICT_RANGE_CALLBACK Callback OPTIONAL
,
1224 OUT PULONGLONG Start
);
1229 PRTL_BITMAP BitMapHeader
,
1236 RtlFindSetBitsAndClear (
1237 PRTL_BITMAP BitMapHeader
,
1243 RtlFirstFreeAce (PACL Acl
,
1247 RtlFormatCurrentUserKeyPath (IN OUT PUNICODE_STRING KeyPath
);
1250 RtlFreeAnsiString (IN PANSI_STRING AnsiString
);
1261 RtlFreeOemString (IN POEM_STRING OemString
);
1264 RtlFreeRangeList (IN PRTL_RANGE_LIST RangeList
);
1267 RtlFreeSid (PSID Sid
);
1270 RtlFreeUnicodeString (IN PUNICODE_STRING UnicodeString
);
1273 RtlGenerate8dot3Name (IN PUNICODE_STRING Name
,
1274 IN BOOLEAN AllowExtendedCharacters
,
1275 IN OUT PGENERATE_NAME_CONTEXT Context
,
1276 OUT PUNICODE_STRING Name8dot3
);
1279 RtlGetAce (PACL Acl
,
1285 RtlGetCallersAddress(
1286 OUT PVOID
*CallersAddress
,
1287 OUT PVOID
*CallersCaller
1291 RtlGetCompressionWorkSpaceSize (IN USHORT CompressionFormatAndEngine
,
1292 OUT PULONG CompressBufferAndWorkSpaceSize
,
1293 OUT PULONG CompressFragmentWorkSpaceSize
);
1296 RtlGetControlSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor
,
1297 PSECURITY_DESCRIPTOR_CONTROL Control
,
1301 RtlGetDaclSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor
,
1302 PBOOLEAN DaclPresent
,
1304 PBOOLEAN DaclDefaulted
);
1307 RtlGetDefaultCodePage (OUT PUSHORT AnsiCodePage
,
1308 OUT PUSHORT OemCodePage
);
1312 RtlGetElementGenericTable(
1313 PRTL_GENERIC_TABLE Table
,
1319 RtlGetElementGenericTableAvl (
1320 PRTL_AVL_TABLE Table
,
1325 RtlGetFirstRange (IN PRTL_RANGE_LIST RangeList
,
1326 OUT PRTL_RANGE_LIST_ITERATOR Iterator
,
1327 OUT PRTL_RANGE
*Range
);
1330 RtlGetGroupSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor
,
1332 PBOOLEAN GroupDefaulted
);
1335 RtlGetLastNtStatus(VOID
);
1338 RtlGetLastWin32Error(VOID
);
1341 RtlGetNextRange (IN OUT PRTL_RANGE_LIST_ITERATOR Iterator
,
1342 OUT PRTL_RANGE
*Range
,
1343 IN BOOLEAN MoveForwards
);
1347 RtlGetNtGlobalFlags (
1352 RtlGetOwnerSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor
,
1354 PBOOLEAN OwnerDefaulted
);
1357 RtlGetSaclSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor
,
1358 PBOOLEAN SaclPresent
,
1360 PBOOLEAN SaclDefaulted
);
1363 RtlGetSecurityDescriptorRMControl(PSECURITY_DESCRIPTOR SecurityDescriptor
,
1368 RtlGetSetBootStatusData(
1378 RtlGUIDFromString (IN PUNICODE_STRING GuidString
,
1383 RtlHashUnicodeString(
1384 IN
const UNICODE_STRING
*String
,
1385 IN BOOLEAN CaseInSensitive
,
1386 IN ULONG HashAlgorithm
,
1387 OUT PULONG HashValue
1390 PSID_IDENTIFIER_AUTHORITY STDCALL
1391 RtlIdentifierAuthoritySid (PSID Sid
);
1395 RtlImageDirectoryEntryToData (
1405 IN PVOID BaseAddress
1408 PIMAGE_SECTION_HEADER
1410 RtlImageRvaToSection (
1411 PIMAGE_NT_HEADERS NtHeader
,
1419 PIMAGE_NT_HEADERS NtHeader
,
1422 PIMAGE_SECTION_HEADER
*SectionHeader
1428 PANSI_STRING DestinationString
,
1434 RtlInitCodePageTable (
1435 IN PUSHORT TableBase
,
1436 OUT PCPTABLEINFO CodePageTable
1441 RtlInitializeUnicodePrefix (
1442 PUNICODE_PREFIX_TABLE PrefixTable
1446 RtlInitializeSid (PSID Sid
,
1447 PSID_IDENTIFIER_AUTHORITY IdentifierAuthority
,
1448 UCHAR SubAuthorityCount
);
1452 RtlInitializeBitMap(
1453 IN PRTL_BITMAP BitMapHeader
,
1454 IN PULONG BitMapBuffer
,
1455 IN ULONG SizeOfBitMap
);
1460 IN PUSHORT AnsiTableBase
,
1461 IN PUSHORT OemTableBase
,
1462 IN PUSHORT CaseTableBase
,
1463 OUT PNLSTABLEINFO NlsTable
1469 PSTRING DestinationString
,
1475 RtlInitUnicodeString (
1476 PUNICODE_STRING DestinationString
,
1482 RtlInitializeBitMap (
1483 IN OUT PRTL_BITMAP BitMapHeader
,
1484 IN PULONG BitMapBuffer
,
1485 IN ULONG SizeOfBitMap
1490 RtlInitializeContext (
1491 IN HANDLE ProcessHandle
,
1492 OUT PCONTEXT ThreadContext
,
1493 IN PVOID ThreadStartParam OPTIONAL
,
1494 IN PTHREAD_START_ROUTINE ThreadStartAddress
,
1495 IN PINITIAL_TEB InitialTeb
1500 RtlInitializeGenericTable (
1501 PRTL_GENERIC_TABLE Table
,
1502 PRTL_GENERIC_COMPARE_ROUTINE CompareRoutine
,
1503 PRTL_GENERIC_ALLOCATE_ROUTINE AllocateRoutine
,
1504 PRTL_GENERIC_FREE_ROUTINE FreeRoutine
,
1510 RtlInitializeGenericTableAvl (
1511 PRTL_AVL_TABLE Table
,
1512 PRTL_AVL_COMPARE_ROUTINE CompareRoutine
,
1513 PRTL_AVL_ALLOCATE_ROUTINE AllocateRoutine
,
1514 PRTL_AVL_FREE_ROUTINE FreeRoutine
,
1519 RtlInitializeRangeList (IN OUT PRTL_RANGE_LIST RangeList
);
1523 RtlInsertElementGenericTable (
1524 PRTL_GENERIC_TABLE Table
,
1527 PBOOLEAN NewElement OPTIONAL
1532 RtlInsertElementGenericTableAvl (
1533 PRTL_AVL_TABLE Table
,
1536 PBOOLEAN NewElement OPTIONAL
1541 RtlInsertElementGenericTableFull (
1542 PRTL_GENERIC_TABLE Table
,
1545 PBOOLEAN NewElement OPTIONAL
,
1547 TABLE_SEARCH_RESULT SearchResult
1552 RtlInsertElementGenericTableFullAvl (
1553 PRTL_AVL_TABLE Table
,
1556 PBOOLEAN NewElement OPTIONAL
,
1558 TABLE_SEARCH_RESULT SearchResult
1563 RtlInsertUnicodePrefix (
1564 PUNICODE_PREFIX_TABLE PrefixTable
,
1565 PUNICODE_STRING Prefix
,
1566 PUNICODE_PREFIX_TABLE_ENTRY PrefixTableEntry
1571 RtlInt64ToUnicodeString (
1573 IN ULONG Base OPTIONAL
,
1574 IN OUT PUNICODE_STRING String
1588 RtlIntegerToUnicode(
1590 IN ULONG Base OPTIONAL
,
1591 IN ULONG Length OPTIONAL
,
1592 IN OUT LPWSTR String
1597 RtlIntegerToUnicodeString (
1600 IN OUT PUNICODE_STRING String
1604 RtlInvertRangeList (OUT PRTL_RANGE_LIST InvertedRangeList
,
1605 IN PRTL_RANGE_LIST RangeList
);
1609 RtlIpv4AddressToStringA(
1616 RtlIpv4AddressToStringExA(
1625 RtlIpv4AddressToStringW(
1632 RtlIpv4AddressToStringExW(
1641 RtlIpv4StringToAddressA(
1644 OUT PVOID PtrToIpAddr
,
1650 RtlIpv4StringToAddressExA(
1659 RtlIpv4StringToAddressW(
1662 OUT PVOID PtrToIpAddr
,
1668 RtlIpv4StringToAddressExW(
1677 RtlIpv6AddressToStringA(
1684 RtlIpv6AddressToStringExA(
1693 RtlIpv6AddressToStringW(
1700 RtlIpv6AddressToStringExW(
1709 RtlIpv6StringToAddressA(
1712 OUT PVOID PtrToIpAddr
,
1718 RtlIpv6StringToAddressExA(
1727 RtlIpv6StringToAddressW(
1730 OUT PVOID PtrToIpAddr
,
1736 RtlIpv6StringToAddressExW(
1745 RtlIsGenericTableEmpty (
1746 PRTL_GENERIC_TABLE Table
1751 RtlIsGenericTableEmptyAvl (
1752 PRTL_AVL_TABLE Table
1757 RtlIsNameLegalDOS8Dot3 (IN PUNICODE_STRING UnicodeName
,
1758 IN PANSI_STRING AnsiName
,
1759 OUT PBOOLEAN SpacesFound
);
1762 RtlIsRangeAvailable (IN PRTL_RANGE_LIST RangeList
,
1766 IN UCHAR AttributeAvailableMask
,
1767 IN PVOID Context OPTIONAL
,
1768 IN PRTL_CONFLICT_RANGE_CALLBACK Callback OPTIONAL
,
1769 OUT PBOOLEAN Available
);
1781 RtlIsValidOemCharacter (
1787 RtlLargeIntegerAdd (
1788 LARGE_INTEGER Addend1
,
1789 LARGE_INTEGER Addend2
1794 * RtlLargeIntegerAnd (
1795 * PLARGE_INTEGER Result,
1796 * LARGE_INTEGER Source,
1797 * LARGE_INTEGER Mask
1800 #define RtlLargeIntegerAnd(Result, Source, Mask) \
1802 Result.HighPart = Source.HighPart & Mask.HighPart; \
1803 Result.LowPart = Source.LowPart & Mask.LowPart; \
1808 RtlLargeIntegerArithmeticShift (
1809 LARGE_INTEGER LargeInteger
,
1815 RtlLargeIntegerDivide (
1816 LARGE_INTEGER Dividend
,
1817 LARGE_INTEGER Divisor
,
1818 PLARGE_INTEGER Remainder
1823 * RtlLargeIntegerEqualTo (
1824 * LARGE_INTEGER Operand1,
1825 * LARGE_INTEGER Operand2
1828 #define RtlLargeIntegerEqualTo(X,Y) \
1829 (!(((X).LowPart ^ (Y).LowPart) | ((X).HighPart ^ (Y).HighPart)))
1833 * RtlLargeIntegerEqualToZero (
1834 * LARGE_INTEGER Operand
1837 #define RtlLargeIntegerEqualToZero(X) \
1838 (!((X).LowPart | (X).HighPart))
1842 * RtlLargeIntegerGreaterThan (
1843 * LARGE_INTEGER Operand1,
1844 * LARGE_INTEGER Operand2
1847 #define RtlLargeIntegerGreaterThan(X,Y) \
1848 ((((X).HighPart == (Y).HighPart) && ((X).LowPart > (Y).LowPart)) || \
1849 ((X).HighPart > (Y).HighPart))
1853 * RtlLargeIntegerGreaterThanOrEqualTo (
1854 * LARGE_INTEGER Operand1,
1855 * LARGE_INTEGER Operand2
1858 #define RtlLargeIntegerGreaterThanOrEqualTo(X,Y) \
1859 ((((X).HighPart == (Y).HighPart) && ((X).LowPart >= (Y).LowPart)) || \
1860 ((X).HighPart > (Y).HighPart))
1864 * RtlLargeIntegerGreaterThanOrEqualToZero (
1865 * LARGE_INTEGER Operand1
1868 #define RtlLargeIntegerGreaterOrEqualToZero(X) \
1873 * RtlLargeIntegerGreaterThanZero (
1874 * LARGE_INTEGER Operand1
1877 #define RtlLargeIntegerGreaterThanZero(X) \
1878 ((((X).HighPart == 0) && ((X).LowPart > 0)) || \
1879 ((X).HighPart > 0 ))
1883 * RtlLargeIntegerLessThan (
1884 * LARGE_INTEGER Operand1,
1885 * LARGE_INTEGER Operand2
1888 #define RtlLargeIntegerLessThan(X,Y) \
1889 ((((X).HighPart == (Y).HighPart) && ((X).LowPart < (Y).LowPart)) || \
1890 ((X).HighPart < (Y).HighPart))
1894 * RtlLargeIntegerLessThanOrEqualTo (
1895 * LARGE_INTEGER Operand1,
1896 * LARGE_INTEGER Operand2
1899 #define RtlLargeIntegerLessThanOrEqualTo(X,Y) \
1900 ((((X).HighPart == (Y).HighPart) && ((X).LowPart <= (Y).LowPart)) || \
1901 ((X).HighPart < (Y).HighPart))
1905 * RtlLargeIntegerLessThanOrEqualToZero (
1906 * LARGE_INTEGER Operand
1909 #define RtlLargeIntegerLessOrEqualToZero(X) \
1910 (((X).HighPart < 0) || !((X).LowPart | (X).HighPart))
1914 * RtlLargeIntegerLessThanZero (
1915 * LARGE_INTEGER Operand
1918 #define RtlLargeIntegerLessThanZero(X) \
1919 (((X).HighPart < 0))
1923 RtlLargeIntegerNegate (
1924 LARGE_INTEGER Subtrahend
1929 * RtlLargeIntegerNotEqualTo (
1930 * LARGE_INTEGER Operand1,
1931 * LARGE_INTEGER Operand2
1934 #define RtlLargeIntegerNotEqualTo(X,Y) \
1935 ((((X).LowPart ^ (Y).LowPart) | ((X).HighPart ^ (Y).HighPart)))
1939 * RtlLargeIntegerNotEqualToZero (
1940 * LARGE_INTEGER Operand
1943 #define RtlLargeIntegerNotEqualToZero(X) \
1944 (((X).LowPart | (X).HighPart))
1948 RtlLargeIntegerShiftLeft (
1949 LARGE_INTEGER LargeInteger
,
1955 RtlLargeIntegerShiftRight (
1956 LARGE_INTEGER LargeInteger
,
1962 RtlLargeIntegerSubtract (
1963 LARGE_INTEGER Minuend
,
1964 LARGE_INTEGER Subtrahend
1968 RtlLengthRequiredSid (UCHAR SubAuthorityCount
);
1971 RtlLengthSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor
);
1974 RtlLengthSid (PSID Sid
);
1978 RtlLockBootStatusData(
1983 RtlLockHeap (IN HANDLE Heap
);
1986 RtlLookupAtomInAtomTable (IN PRTL_ATOM_TABLE AtomTable
,
1988 OUT PRTL_ATOM Atom
);
1992 RtlLookupElementGenericTable (
1993 PRTL_GENERIC_TABLE Table
,
1999 RtlLookupElementGenericTableAvl (
2000 PRTL_AVL_TABLE Table
,
2006 RtlLookupElementGenericTableFull (
2007 PRTL_GENERIC_TABLE Table
,
2009 OUT PVOID
*NodeOrParent
,
2010 OUT TABLE_SEARCH_RESULT
*SearchResult
2015 RtlLookupElementGenericTableFullAvl (
2016 PRTL_AVL_TABLE Table
,
2018 OUT PVOID
*NodeOrParent
,
2019 OUT TABLE_SEARCH_RESULT
*SearchResult
2023 RtlMakeSelfRelativeSD (PSECURITY_DESCRIPTOR AbsSD
,
2024 PSECURITY_DESCRIPTOR_RELATIVE RelSD
,
2025 PULONG BufferLength
);
2028 RtlMapGenericMask (PACCESS_MASK AccessMask
,
2029 PGENERIC_MAPPING GenericMapping
);
2033 RtlMapSecurityErrorToNtStatus(
2034 IN ULONG SecurityError
2038 RtlMergeRangeLists (OUT PRTL_RANGE_LIST MergedRangeList
,
2039 IN PRTL_RANGE_LIST RangeList1
,
2040 IN PRTL_RANGE_LIST RangeList2
,
2045 RtlMultiByteToUnicodeN (
2046 PWCHAR UnicodeString
,
2049 const PCHAR MbString
,
2055 RtlMultiByteToUnicodeSize (
2061 PUNICODE_PREFIX_TABLE_ENTRY
2063 RtlNextUnicodePrefix (
2064 PUNICODE_PREFIX_TABLE PrefixTable
,
2070 RtlNtStatusToDosError (
2076 RtlNtStatusToDosErrorNoTeb (
2082 RtlNtStatusToPsxErrno (
2088 RtlNumberGenericTableElements(
2089 PRTL_GENERIC_TABLE Table
2094 RtlNumberGenericTableElementsAvl (
2095 PRTL_AVL_TABLE Table
2101 RtlNumberOfClearBits (
2102 PRTL_BITMAP BitMapHeader
2107 RtlNumberOfSetBits (
2108 PRTL_BITMAP BitMapHeader
2113 RtlOemStringToUnicodeSize (
2114 POEM_STRING AnsiString
2119 RtlOemStringToUnicodeString (
2120 PUNICODE_STRING DestinationString
,
2121 POEM_STRING SourceString
,
2122 BOOLEAN AllocateDestinationString
2128 PWSTR UnicodeString
,
2129 ULONG MaxBytesInUnicodeString
,
2130 PULONG BytesInUnicodeString
,
2132 ULONG BytesInOemString
2136 RtlPinAtomInAtomTable (
2137 IN PRTL_ATOM_TABLE AtomTable
,
2143 RtlPrefetchMemoryNonTemporal(
2151 PANSI_STRING String1
,
2152 PANSI_STRING String2
,
2153 BOOLEAN CaseInsensitive
2158 RtlPrefixUnicodeString (
2159 PUNICODE_STRING String1
,
2160 PUNICODE_STRING String2
,
2161 BOOLEAN CaseInsensitive
2166 RtlQueryAtomInAtomTable (
2167 IN PRTL_ATOM_TABLE AtomTable
,
2169 IN OUT PULONG RefCount OPTIONAL
,
2170 IN OUT PULONG PinCount OPTIONAL
,
2171 IN OUT PWSTR AtomName OPTIONAL
,
2172 IN OUT PULONG NameLength OPTIONAL
2176 RtlQueryInformationAcl (PACL Acl
,
2178 ULONG InformationLength
,
2179 ACL_INFORMATION_CLASS InformationClass
);
2182 RtlQueryTimeZoneInformation (IN OUT PTIME_ZONE_INFORMATION TimeZoneInformation
);
2185 RtlRaiseException (IN PEXCEPTION_RECORD ExceptionRecord
);
2188 RtlRaiseStatus(NTSTATUS Status
);
2191 RtlRandom (PULONG Seed
);
2201 RtlRealPredecessor (
2202 PRTL_SPLAY_LINKS Links
2208 PRTL_SPLAY_LINKS Links
2221 RtlRemoveUnicodePrefix (
2222 PUNICODE_PREFIX_TABLE PrefixTable
,
2223 PUNICODE_PREFIX_TABLE_ENTRY PrefixTableEntry
2229 IN USHORT CompressionFormat
,
2230 IN OUT PUCHAR
*CompressedBuffer
,
2231 IN PUCHAR EndOfCompressedBufferPlus1
,
2232 OUT PUCHAR
*ChunkBuffer
,
2237 RtlResetRtlTranslations (IN PNLSTABLEINFO NlsTable
);
2240 RtlRestoreLastWin32Error(IN ULONG Error
);
2244 * RtlRetrieveUlong (
2245 * PULONG DestinationAddress,
2246 * PULONG SourceAddress
2249 #define RtlRetrieveUlong(DestAddress,SrcAddress) \
2250 if ((ULONG_PTR)(SrcAddress) & LONG_MASK) \
2252 ((PUCHAR)(DestAddress))[0]=((PUCHAR)(SrcAddress))[0]; \
2253 ((PUCHAR)(DestAddress))[1]=((PUCHAR)(SrcAddress))[1]; \
2254 ((PUCHAR)(DestAddress))[2]=((PUCHAR)(SrcAddress))[2]; \
2255 ((PUCHAR)(DestAddress))[3]=((PUCHAR)(SrcAddress))[3]; \
2259 *((PULONG)(DestAddress))=*((PULONG)(SrcAddress)); \
2264 * RtlRetrieveUshort (
2265 * PUSHORT DestinationAddress,
2266 * PUSHORT SourceAddress
2269 #define RtlRetrieveUshort(DestAddress,SrcAddress) \
2270 if ((ULONG_PTR)(SrcAddress) & SHORT_MASK) \
2272 ((PUCHAR)(DestAddress))[0]=((PUCHAR)(SrcAddress))[0]; \
2273 ((PUCHAR)(DestAddress))[1]=((PUCHAR)(SrcAddress))[1]; \
2277 *((PUSHORT)(DestAddress))=*((PUSHORT)(SrcAddress)); \
2281 RtlSecondsSince1970ToTime (ULONG SecondsSince1970
,
2282 PLARGE_INTEGER Time
);
2285 RtlSecondsSince1980ToTime (ULONG SecondsSince1980
,
2286 PLARGE_INTEGER Time
);
2289 RtlSelfRelativeToAbsoluteSD (PSECURITY_DESCRIPTOR_RELATIVE RelSD
,
2290 PSECURITY_DESCRIPTOR AbsSD
,
2303 RtlSelfRelativeToAbsoluteSD2(
2304 PSECURITY_DESCRIPTOR_RELATIVE SelfRelativeSecurityDescriptor
,
2309 RtlSetAllBits (IN PRTL_BITMAP BitMapHeader
);
2312 RtlSetAttributesSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor
,
2313 IN SECURITY_DESCRIPTOR_CONTROL Control
,
2314 OUT PULONG Revision
);
2319 PRTL_BITMAP BitMapHeader
,
2326 PRTL_BITMAP BitMapHeader
,
2327 ULONG StartingIndex
,
2332 RtlSetControlSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor
,
2333 IN SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest
,
2334 IN SECURITY_DESCRIPTOR_CONTROL ControlBitsToSet
);
2337 RtlSetDaclSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor
,
2338 BOOLEAN DaclPresent
,
2340 BOOLEAN DaclDefaulted
);
2343 RtlSetGroupSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor
,
2345 BOOLEAN GroupDefaulted
);
2348 RtlSetInformationAcl (PACL Acl
,
2350 ULONG InformationLength
,
2351 ACL_INFORMATION_CLASS InformationClass
);
2354 RtlSetLastWin32Error(IN ULONG Error
);
2357 RtlSetLastWin32ErrorAndNtStatusFromNtStatus(IN NTSTATUS Status
);
2360 RtlSetOwnerSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor
,
2362 BOOLEAN OwnerDefaulted
);
2365 RtlSetSaclSecurityDescriptor (PSECURITY_DESCRIPTOR SecurityDescriptor
,
2366 BOOLEAN SaclPresent
,
2368 BOOLEAN SaclDefaulted
);
2371 RtlSetSecurityDescriptorRMControl(PSECURITY_DESCRIPTOR SecurityDescriptor
,
2375 RtlSetTimeZoneInformation (IN OUT PTIME_ZONE_INFORMATION TimeZoneInformation
);
2379 IN PVOID HeapHandle
,
2381 IN PVOID MemoryPointer
2387 PRTL_SPLAY_LINKS Links
2397 #define RtlStoreUlong(Address,Value) \
2398 if ((ULONG_PTR)(Address) & LONG_MASK) \
2400 ((PUCHAR)(Address))[LONG_LEAST_SIGNIFICANT_BIT]=(UCHAR)(FIRSTBYTE(Value)); \
2401 ((PUCHAR)(Address))[LONG_3RD_MOST_SIGNIFICANT_BIT]=(UCHAR)(SECONDBYTE(Value)); \
2402 ((PUCHAR)(Address))[LONG_2ND_MOST_SIGNIFICANT_BIT]=(UCHAR)(THIRDBYTE(Value)); \
2403 ((PUCHAR)(Address))[LONG_MOST_SIGNIFICANT_BIT]=(UCHAR)(FOURTHBYTE(Value)); \
2407 *((PULONG)(Address))=(ULONG)(Value); \
2417 #define RtlStoreUshort(Address,Value) \
2418 if ((ULONG_PTR)(Address) & SHORT_MASK) \
2420 ((PUCHAR)(Address))[SHORT_LEAST_SIGNIFICANT_BIT]=(UCHAR)(FIRSTBYTE(Value)); \
2421 ((PUCHAR)(Address))[SHORT_MOST_SIGNIFICANT_BIT]=(UCHAR)(SECONDBYTE(Value)); \
2425 *((PUSHORT)(Address))=(USHORT)(Value); \
2429 RtlStringFromGUID (IN REFGUID Guid
,
2430 OUT PUNICODE_STRING GuidString
);
2433 RtlSubAuthoritySid (PSID Sid
,
2434 ULONG SubAuthority
);
2437 RtlSubAuthoritySid (PSID Sid
,
2438 ULONG SubAuthority
);
2441 RtlSubAuthorityCountSid (PSID Sid
);
2445 RtlSubtreePredecessor (
2446 PRTL_SPLAY_LINKS Links
2451 RtlSubtreeSuccessor (
2452 PRTL_SPLAY_LINKS Links
2458 PRTL_BITMAP BitMapHeader
,
2464 RtlTimeFieldsToTime (PTIME_FIELDS TimeFields
,
2465 PLARGE_INTEGER Time
);
2469 RtlTimeToSecondsSince1970 (
2470 PLARGE_INTEGER Time
,
2471 PULONG SecondsSince1970
2476 RtlTimeToSecondsSince1980 (
2477 PLARGE_INTEGER Time
,
2478 PULONG SecondsSince1980
2483 RtlTimeToElapsedTimeFields(
2484 PLARGE_INTEGER Time
,
2485 PTIME_FIELDS TimeFields
2490 RtlTimeToTimeFields (
2491 PLARGE_INTEGER Time
,
2492 PTIME_FIELDS TimeFields
2497 RtlUlongByteSwap (IN ULONG Source
);
2500 RtlUlonglongByteSwap (IN ULONGLONG Source
);
2504 RtlUnicodeStringToAnsiSize (
2505 IN PUNICODE_STRING UnicodeString
2510 RtlUnicodeStringToAnsiString (
2511 IN OUT PANSI_STRING DestinationString
,
2512 IN PUNICODE_STRING SourceString
,
2513 IN BOOLEAN AllocateDestinationString
2518 RtlUnicodeStringToInteger (
2519 IN PUNICODE_STRING String
,
2526 RtlUnicodeStringToOemSize (
2527 IN PUNICODE_STRING UnicodeString
2532 RtlUnicodeStringToCountedOemString (
2533 IN OUT POEM_STRING DestinationString
,
2534 IN PUNICODE_STRING SourceString
,
2535 IN BOOLEAN AllocateDestinationString
2540 RtlUnicodeStringToOemString (
2541 IN OUT POEM_STRING DestinationString
,
2542 IN PUNICODE_STRING SourceString
,
2543 IN BOOLEAN AllocateDestinationString
2548 RtlUnicodeToCustomCPN (
2549 IN PCPTABLEINFO CustomCP
,
2553 PWCHAR UnicodeString
,
2559 RtlUnicodeToMultiByteN (
2563 PWCHAR UnicodeString
,
2569 RtlUnicodeToMultiByteSize (
2571 PWCHAR UnicodeString
,
2581 PWCHAR UnicodeString
,
2586 RtlUniform (PULONG Seed
);
2589 RtlUnlockHeap (IN HANDLE Heap
);
2593 RtlUnlockBootStatusData(
2600 PEXCEPTION_REGISTRATION RegistrationFrame
,
2601 PVOID ReturnAddress
,
2602 PEXCEPTION_RECORD ExceptionRecord
,
2608 RtlUpcaseUnicodeChar (
2614 RtlUpcaseUnicodeString (
2615 IN OUT PUNICODE_STRING DestinationString
,
2616 IN PCUNICODE_STRING SourceString
,
2617 IN BOOLEAN AllocateDestinationString
2622 RtlUpcaseUnicodeStringToAnsiString (
2623 IN OUT PANSI_STRING DestinationString
,
2624 IN PUNICODE_STRING SourceString
,
2625 IN BOOLEAN AllocateDestinationString
2630 RtlUpcaseUnicodeStringToCountedOemString (
2631 IN OUT POEM_STRING DestinationString
,
2632 IN PUNICODE_STRING SourceString
,
2633 IN BOOLEAN AllocateDestinationString
2638 RtlUpcaseUnicodeStringToOemString (
2639 IN OUT POEM_STRING DestinationString
,
2640 IN PUNICODE_STRING SourceString
,
2641 IN BOOLEAN AllocateDestinationString
2646 RtlUpcaseUnicodeToCustomCPN (
2647 IN PCPTABLEINFO CustomCP
,
2651 PWCHAR UnicodeString
,
2657 RtlUpcaseUnicodeToMultiByteN (
2661 PWCHAR UnicodeString
,
2667 RtlUpcaseUnicodeToOemN (
2671 PWCHAR UnicodeString
,
2676 RtlUpperChar (CHAR Source
);
2679 RtlUpperString (PSTRING DestinationString
,
2680 PSTRING SourceString
);
2683 RtlUshortByteSwap (IN USHORT Source
);
2686 RtlValidAcl (PACL Acl
);
2697 RtlValidRelativeSecurityDescriptor (
2698 IN PSECURITY_DESCRIPTOR_RELATIVE SecurityDescriptorInput
,
2699 IN ULONG SecurityDescriptorLength
,
2700 IN SECURITY_INFORMATION RequiredInformation
2704 RtlValidSecurityDescriptor (IN PSECURITY_DESCRIPTOR SecurityDescriptor
);
2707 RtlValidSid (IN PSID Sid
);
2712 RtlVerifyVersionInfo(
2713 IN PRTL_OSVERSIONINFOEXW VersionInfo,
2715 IN ULONGLONG ConditionMask
2721 RtlVolumeDeviceToDosName(
2722 IN PVOID VolumeDeviceObject
,
2723 OUT PUNICODE_STRING DosName
2736 IN PVOID HeapHandle
,
2742 RtlxAnsiStringToUnicodeSize (
2743 IN PANSI_STRING AnsiString
2748 RtlxOemStringToUnicodeSize (
2749 IN POEM_STRING OemString
2754 RtlxUnicodeStringToAnsiSize (
2755 IN PUNICODE_STRING UnicodeString
2760 RtlxUnicodeStringToOemSize (
2761 IN PUNICODE_STRING UnicodeString
2764 /* Register io functions */
2768 READ_REGISTER_UCHAR (
2774 READ_REGISTER_USHORT (
2780 READ_REGISTER_ULONG (
2786 READ_REGISTER_BUFFER_UCHAR (
2794 READ_REGISTER_BUFFER_USHORT (
2802 READ_REGISTER_BUFFER_ULONG (
2810 WRITE_REGISTER_UCHAR (
2817 WRITE_REGISTER_USHORT (
2824 WRITE_REGISTER_ULONG (
2831 WRITE_REGISTER_BUFFER_UCHAR (
2839 WRITE_REGISTER_BUFFER_USHORT (
2847 WRITE_REGISTER_BUFFER_ULONG (
2854 /* functions exported from NTOSKRNL.EXE which are considered RTL */
2856 #if defined(__NTOSKRNL__) || defined(__NTDRIVER__) || defined(__NTHAL__) || defined(__NTDLL__) || defined(__NTAPP__)
2858 char *_itoa (int value
, char *string
, int radix
);
2859 wchar_t *_itow (int value
, wchar_t *string
, int radix
);
2860 int _snprintf(char * buf
, size_t cnt
, const char *fmt
, ...);
2861 int _snwprintf(wchar_t *buf
, size_t cnt
, const wchar_t *fmt
, ...);
2862 int _stricmp(const char *s1
, const char *s2
);
2863 char * _strlwr(char *x
);
2864 int _strnicmp(const char *s1
, const char *s2
, size_t n
);
2865 char * _strnset(char* szToFill
, int szFill
, size_t sizeMaxFill
);
2866 char * _strrev(char *s
);
2867 char * _strset(char* szToFill
, int szFill
);
2868 char * _strupr(char *x
);
2869 int _vsnprintf(char *buf
, size_t cnt
, const char *fmt
, va_list args
);
2870 int _wcsicmp (const wchar_t* cs
, const wchar_t* ct
);
2871 wchar_t * _wcslwr (wchar_t *x
);
2872 int _wcsnicmp (const wchar_t * cs
,const wchar_t * ct
,size_t count
);
2873 wchar_t* _wcsnset (wchar_t* wsToFill
, wchar_t wcFill
, size_t sizeMaxFill
);
2874 wchar_t * _wcsrev(wchar_t *s
);
2875 wchar_t *_wcsupr(wchar_t *x
);
2877 int atoi(const char *str
);
2878 long atol(const char *str
);
2884 int isxdigit(int c
);
2885 size_t mbstowcs (wchar_t *wcstr
, const char *mbstr
, size_t count
);
2886 int mbtowc (wchar_t *wchar
, const char *mbchar
, size_t count
);
2887 void * memchr(const void *s
, int c
, size_t n
);
2888 void * memcpy(void *to
, const void *from
, size_t count
);
2889 void * memmove(void *dest
,const void *src
, size_t count
);
2890 void * memset(void *src
, int val
, size_t count
);
2897 int sprintf(char * buf
, const char *fmt
, ...);
2898 void srand(unsigned seed
);
2899 char * strcat(char *s
, const char *append
);
2900 char * strchr(const char *s
, int c
);
2901 int strcmp(const char *s1
, const char *s2
);
2902 char * strcpy(char *to
, const char *from
);
2903 size_t strlen(const char *str
);
2904 char * strncat(char *dst
, const char *src
, size_t n
);
2905 int strncmp(const char *s1
, const char *s2
, size_t n
);
2906 char *strncpy(char *dst
, const char *src
, size_t n
);
2907 char *strrchr(const char *s
, int c
);
2908 size_t strspn(const char *s1
, const char *s2
);
2909 char *strstr(const char *s
, const char *find
);
2910 int swprintf(wchar_t *buf
, const wchar_t *fmt
, ...);
2913 wchar_t towlower(wchar_t c
);
2914 wchar_t towupper(wchar_t c
);
2915 int vsprintf(char *buf
, const char *fmt
, va_list args
);
2916 wchar_t * wcscat(wchar_t *dest
, const wchar_t *src
);
2917 wchar_t * wcschr(const wchar_t *str
, wchar_t ch
);
2918 int wcscmp(const wchar_t *cs
, const wchar_t *ct
);
2919 wchar_t* wcscpy(wchar_t* str1
, const wchar_t* str2
);
2920 size_t wcscspn(const wchar_t *str
,const wchar_t *reject
);
2921 size_t wcslen(const wchar_t *s
);
2922 wchar_t * wcsncat(wchar_t *dest
, const wchar_t *src
, size_t count
);
2923 int wcsncmp(const wchar_t *cs
, const wchar_t *ct
, size_t count
);
2924 wchar_t * wcsncpy(wchar_t *dest
, const wchar_t *src
, size_t count
);
2925 wchar_t * wcsrchr(const wchar_t *str
, wchar_t ch
);
2926 size_t wcsspn(const wchar_t *str
,const wchar_t *accept
);
2927 wchar_t *wcsstr(const wchar_t *s
,const wchar_t *b
);
2928 size_t wcstombs (char *mbstr
, const wchar_t *wcstr
, size_t count
);
2929 int wctomb (char *mbchar
, wchar_t wchar
);
2931 #endif /* __NTOSKRNL__ || __NTDRIVER__ || __NTHAL__ || __NTDLL__ || __NTAPP__ */
2933 #endif /* __DDK_RTL_H */