2006-05-10 17:47:44 +00:00
|
|
|
/*++ NDK Version: 0098
|
2005-11-22 04:57:45 +00:00
|
|
|
|
|
|
|
Copyright (c) Alex Ionescu. All rights reserved.
|
|
|
|
|
|
|
|
Header Name:
|
|
|
|
|
|
|
|
rtlfuncs.h
|
|
|
|
|
|
|
|
Abstract:
|
|
|
|
|
|
|
|
Function definitions for the Run-Time Library
|
|
|
|
|
|
|
|
Author:
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
|
2005-11-22 04:57:45 +00:00
|
|
|
|
|
|
|
--*/
|
|
|
|
|
2005-06-18 23:33:40 +00:00
|
|
|
#ifndef _RTLFUNCS_H
|
|
|
|
#define _RTLFUNCS_H
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Dependencies
|
|
|
|
//
|
2005-11-25 00:17:40 +00:00
|
|
|
#include <umtypes.h>
|
2005-07-26 14:00:45 +00:00
|
|
|
#include <ntnls.h>
|
2005-11-25 00:17:40 +00:00
|
|
|
#include <rtltypes.h>
|
2010-03-25 12:22:59 +00:00
|
|
|
#include <pstypes.h>
|
2006-05-10 17:47:44 +00:00
|
|
|
#include <extypes.h>
|
|
|
|
#include "in6addr.h"
|
|
|
|
#include "inaddr.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2005-06-18 23:33:40 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
#ifdef NTOS_MODE_USER
|
2005-11-07 01:01:29 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// List Functions
|
|
|
|
//
|
|
|
|
FORCEINLINE
|
|
|
|
VOID
|
|
|
|
InitializeListHead(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Out_ PLIST_ENTRY ListHead
|
2005-11-22 04:57:45 +00:00
|
|
|
)
|
|
|
|
{
|
|
|
|
ListHead->Flink = ListHead->Blink = ListHead;
|
|
|
|
}
|
2005-11-07 01:01:29 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
FORCEINLINE
|
|
|
|
VOID
|
|
|
|
InsertHeadList(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Inout_ PLIST_ENTRY ListHead,
|
|
|
|
_Inout_ PLIST_ENTRY Entry
|
2005-11-22 04:57:45 +00:00
|
|
|
)
|
|
|
|
{
|
|
|
|
PLIST_ENTRY OldFlink;
|
|
|
|
OldFlink = ListHead->Flink;
|
|
|
|
Entry->Flink = OldFlink;
|
|
|
|
Entry->Blink = ListHead;
|
|
|
|
OldFlink->Blink = Entry;
|
|
|
|
ListHead->Flink = Entry;
|
|
|
|
}
|
2005-11-07 01:01:29 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
FORCEINLINE
|
|
|
|
VOID
|
|
|
|
InsertTailList(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Inout_ PLIST_ENTRY ListHead,
|
|
|
|
_Inout_ PLIST_ENTRY Entry
|
2005-11-22 04:57:45 +00:00
|
|
|
)
|
|
|
|
{
|
|
|
|
PLIST_ENTRY OldBlink;
|
|
|
|
OldBlink = ListHead->Blink;
|
|
|
|
Entry->Flink = ListHead;
|
|
|
|
Entry->Blink = OldBlink;
|
|
|
|
OldBlink->Flink = Entry;
|
|
|
|
ListHead->Blink = Entry;
|
|
|
|
}
|
2005-11-08 22:54:39 +00:00
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_Must_inspect_result_
|
2005-11-22 04:57:45 +00:00
|
|
|
FORCEINLINE
|
2008-12-03 17:28:24 +00:00
|
|
|
BOOLEAN
|
2005-11-22 04:57:45 +00:00
|
|
|
IsListEmpty(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ const LIST_ENTRY * ListHead
|
2005-11-22 04:57:45 +00:00
|
|
|
)
|
|
|
|
{
|
|
|
|
return (BOOLEAN)(ListHead->Flink == ListHead);
|
|
|
|
}
|
2005-11-07 19:14:38 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
FORCEINLINE
|
|
|
|
PSINGLE_LIST_ENTRY
|
|
|
|
PopEntryList(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Inout_ PSINGLE_LIST_ENTRY ListHead
|
2005-11-22 04:57:45 +00:00
|
|
|
)
|
|
|
|
{
|
|
|
|
PSINGLE_LIST_ENTRY FirstEntry;
|
|
|
|
FirstEntry = ListHead->Next;
|
|
|
|
if (FirstEntry != NULL) {
|
|
|
|
ListHead->Next = FirstEntry->Next;
|
|
|
|
}
|
2005-11-07 01:01:29 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
return FirstEntry;
|
|
|
|
}
|
2005-11-07 01:01:29 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
FORCEINLINE
|
|
|
|
VOID
|
|
|
|
PushEntryList(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Inout_ PSINGLE_LIST_ENTRY ListHead,
|
|
|
|
_Inout_ PSINGLE_LIST_ENTRY Entry
|
2005-11-22 04:57:45 +00:00
|
|
|
)
|
|
|
|
{
|
|
|
|
Entry->Next = ListHead->Next;
|
|
|
|
ListHead->Next = Entry;
|
|
|
|
}
|
2005-11-07 01:01:29 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
FORCEINLINE
|
|
|
|
BOOLEAN
|
|
|
|
RemoveEntryList(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PLIST_ENTRY Entry)
|
2005-11-22 04:57:45 +00:00
|
|
|
{
|
|
|
|
PLIST_ENTRY OldFlink;
|
|
|
|
PLIST_ENTRY OldBlink;
|
|
|
|
|
|
|
|
OldFlink = Entry->Flink;
|
|
|
|
OldBlink = Entry->Blink;
|
|
|
|
OldFlink->Blink = OldBlink;
|
|
|
|
OldBlink->Flink = OldFlink;
|
|
|
|
return (BOOLEAN)(OldFlink == OldBlink);
|
|
|
|
}
|
2005-11-07 19:31:15 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
FORCEINLINE
|
|
|
|
PLIST_ENTRY
|
|
|
|
RemoveHeadList(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Inout_ PLIST_ENTRY ListHead)
|
2005-11-22 04:57:45 +00:00
|
|
|
{
|
|
|
|
PLIST_ENTRY Flink;
|
|
|
|
PLIST_ENTRY Entry;
|
|
|
|
|
|
|
|
Entry = ListHead->Flink;
|
|
|
|
Flink = Entry->Flink;
|
|
|
|
ListHead->Flink = Flink;
|
|
|
|
Flink->Blink = ListHead;
|
|
|
|
return Entry;
|
|
|
|
}
|
2005-11-07 22:05:46 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
FORCEINLINE
|
|
|
|
PLIST_ENTRY
|
|
|
|
RemoveTailList(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Inout_ PLIST_ENTRY ListHead)
|
2005-11-22 04:57:45 +00:00
|
|
|
{
|
|
|
|
PLIST_ENTRY Blink;
|
|
|
|
PLIST_ENTRY Entry;
|
|
|
|
|
|
|
|
Entry = ListHead->Blink;
|
|
|
|
Blink = Entry->Blink;
|
|
|
|
ListHead->Blink = Blink;
|
|
|
|
Blink->Flink = ListHead;
|
|
|
|
return Entry;
|
|
|
|
}
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
//
|
|
|
|
// Unicode string macros
|
|
|
|
//
|
2013-01-13 14:49:21 +00:00
|
|
|
_At_(UnicodeString->Buffer, _Post_equal_to_(Buffer))
|
|
|
|
_At_(UnicodeString->Length, _Post_equal_to_(0))
|
|
|
|
_At_(UnicodeString->MaximumLength, _Post_equal_to_(BufferSize))
|
2006-05-10 17:47:44 +00:00
|
|
|
FORCEINLINE
|
|
|
|
VOID
|
2013-01-13 14:49:21 +00:00
|
|
|
RtlInitEmptyUnicodeString(
|
|
|
|
_Out_ PUNICODE_STRING UnicodeString,
|
|
|
|
_When_(BufferSize != 0, _Notnull_) _Writable_bytes_(BufferSize) __drv_aliasesMem PWCHAR Buffer,
|
|
|
|
_In_ USHORT BufferSize)
|
2006-05-10 17:47:44 +00:00
|
|
|
{
|
|
|
|
UnicodeString->Length = 0;
|
|
|
|
UnicodeString->MaximumLength = BufferSize;
|
|
|
|
UnicodeString->Buffer = Buffer;
|
|
|
|
}
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_At_(AnsiString->Buffer, _Post_equal_to_(Buffer))
|
|
|
|
_At_(AnsiString->Length, _Post_equal_to_(0))
|
|
|
|
_At_(AnsiString->MaximumLength, _Post_equal_to_(BufferSize))
|
2011-07-20 14:46:15 +00:00
|
|
|
FORCEINLINE
|
|
|
|
VOID
|
2013-01-13 14:49:21 +00:00
|
|
|
RtlInitEmptyAnsiString(
|
|
|
|
_Out_ PANSI_STRING AnsiString,
|
|
|
|
_When_(BufferSize != 0, _Notnull_) _Writable_bytes_(BufferSize) __drv_aliasesMem PCHAR Buffer,
|
|
|
|
_In_ USHORT BufferSize)
|
2011-07-20 14:46:15 +00:00
|
|
|
{
|
|
|
|
AnsiString->Length = 0;
|
|
|
|
AnsiString->MaximumLength = BufferSize;
|
|
|
|
AnsiString->Buffer = Buffer;
|
|
|
|
}
|
2006-05-10 17:47:44 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// LUID Macros
|
|
|
|
//
|
|
|
|
#define RtlEqualLuid(L1, L2) (((L1)->HighPart == (L2)->HighPart) && \
|
|
|
|
((L1)->LowPart == (L2)->LowPart))
|
2006-05-10 17:47:44 +00:00
|
|
|
FORCEINLINE
|
|
|
|
LUID
|
|
|
|
NTAPI_INLINE
|
2013-01-13 14:49:21 +00:00
|
|
|
RtlConvertUlongToLuid(
|
|
|
|
_In_ ULONG Ulong)
|
2006-05-10 17:47:44 +00:00
|
|
|
{
|
|
|
|
LUID TempLuid;
|
|
|
|
|
|
|
|
TempLuid.LowPart = Ulong;
|
|
|
|
TempLuid.HighPart = 0;
|
|
|
|
return TempLuid;
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// ASSERT Macros
|
|
|
|
//
|
|
|
|
#ifndef ASSERT
|
|
|
|
#if DBG
|
|
|
|
|
|
|
|
#define ASSERT( exp ) \
|
2008-11-28 14:33:21 +00:00
|
|
|
((void)((!(exp)) ? \
|
2011-12-17 22:55:05 +00:00
|
|
|
(RtlAssert( (PVOID)#exp, (PVOID)__FILE__, __LINE__, NULL ),FALSE) : \
|
2008-11-28 14:33:21 +00:00
|
|
|
TRUE))
|
2006-05-10 17:47:44 +00:00
|
|
|
|
|
|
|
#define ASSERTMSG( msg, exp ) \
|
2008-11-28 14:33:21 +00:00
|
|
|
((void)((!(exp)) ? \
|
2011-12-17 22:55:05 +00:00
|
|
|
(RtlAssert( (PVOID)#exp, (PVOID)__FILE__, __LINE__, (PCHAR)msg ),FALSE) : \
|
2008-11-28 14:33:21 +00:00
|
|
|
TRUE))
|
2006-05-10 17:47:44 +00:00
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#define ASSERT( exp ) ((void) 0)
|
|
|
|
#define ASSERTMSG( msg, exp ) ((void) 0)
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
2005-11-07 22:05:46 +00:00
|
|
|
|
2006-10-16 03:19:14 +00:00
|
|
|
#ifdef NTOS_KERNEL_RUNTIME
|
|
|
|
|
2006-06-23 21:21:45 +00:00
|
|
|
//
|
2006-10-16 03:19:14 +00:00
|
|
|
// Executing RTL functions at DISPATCH_LEVEL or higher will result in a
|
|
|
|
// bugcheck.
|
|
|
|
//
|
|
|
|
#define RTL_PAGED_CODE PAGED_CODE
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
//
|
|
|
|
// This macro does nothing in user mode
|
2006-06-23 21:21:45 +00:00
|
|
|
//
|
2020-03-26 15:28:10 +00:00
|
|
|
#define RTL_PAGED_CODE()
|
2006-06-23 21:21:45 +00:00
|
|
|
|
2006-10-16 03:19:14 +00:00
|
|
|
#endif
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// RTL Splay Tree Functions
|
|
|
|
//
|
2011-08-05 01:20:28 +00:00
|
|
|
#ifndef RTL_USE_AVL_TABLES
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlInitializeGenericTable(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Out_ PRTL_GENERIC_TABLE Table,
|
|
|
|
_In_ PRTL_GENERIC_COMPARE_ROUTINE CompareRoutine,
|
|
|
|
_In_opt_ PRTL_GENERIC_ALLOCATE_ROUTINE AllocateRoutine,
|
|
|
|
_In_opt_ PRTL_GENERIC_FREE_ROUTINE FreeRoutine,
|
|
|
|
_In_opt_ PVOID TableContext
|
2011-08-05 01:20:28 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
RtlInsertElementGenericTable(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_GENERIC_TABLE Table,
|
|
|
|
_In_reads_bytes_(BufferSize) PVOID Buffer,
|
|
|
|
_In_ CLONG BufferSize,
|
|
|
|
_Out_opt_ PBOOLEAN NewElement
|
2011-08-05 01:20:28 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
RtlInsertElementGenericTableFull(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_GENERIC_TABLE Table,
|
|
|
|
_In_reads_bytes_(BufferSize) PVOID Buffer,
|
|
|
|
_In_ CLONG BufferSize,
|
|
|
|
_Out_opt_ PBOOLEAN NewElement,
|
|
|
|
_In_ PVOID NodeOrParent,
|
|
|
|
_In_ TABLE_SEARCH_RESULT SearchResult
|
2011-08-05 01:20:28 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
RtlDeleteElementGenericTable(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_GENERIC_TABLE Table,
|
|
|
|
_In_ PVOID Buffer
|
2011-08-05 01:20:28 +00:00
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_Must_inspect_result_
|
2011-08-05 01:20:28 +00:00
|
|
|
NTSYSAPI
|
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
RtlLookupElementGenericTable(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_GENERIC_TABLE Table,
|
|
|
|
_In_ PVOID Buffer
|
2011-08-05 01:20:28 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
RtlLookupElementGenericTableFull(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_GENERIC_TABLE Table,
|
|
|
|
_In_ PVOID Buffer,
|
|
|
|
_Out_ PVOID *NodeOrParent,
|
|
|
|
_Out_ TABLE_SEARCH_RESULT *SearchResult
|
2011-08-05 01:20:28 +00:00
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_Must_inspect_result_
|
2011-08-05 01:20:28 +00:00
|
|
|
NTSYSAPI
|
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
RtlEnumerateGenericTable(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_GENERIC_TABLE Table,
|
|
|
|
_In_ BOOLEAN Restart
|
2011-08-05 01:20:28 +00:00
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_Must_inspect_result_
|
2011-08-05 01:20:28 +00:00
|
|
|
NTSYSAPI
|
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
RtlEnumerateGenericTableWithoutSplaying(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_GENERIC_TABLE Table,
|
|
|
|
_Inout_ PVOID *RestartKey
|
2011-08-05 01:20:28 +00:00
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_Must_inspect_result_
|
2011-08-05 01:20:28 +00:00
|
|
|
NTSYSAPI
|
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
RtlGetElementGenericTable(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_GENERIC_TABLE Table,
|
|
|
|
_In_ ULONG I
|
2011-08-05 01:20:28 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
RtlNumberGenericTableElements(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_GENERIC_TABLE Table
|
2011-08-05 01:20:28 +00:00
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_Must_inspect_result_
|
2011-08-05 01:20:28 +00:00
|
|
|
NTSYSAPI
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
RtlIsGenericTableEmpty(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_GENERIC_TABLE Table
|
2011-08-05 01:20:28 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
#endif /* !RTL_USE_AVL_TABLES */
|
|
|
|
|
2005-11-07 01:01:29 +00:00
|
|
|
NTSYSAPI
|
|
|
|
PRTL_SPLAY_LINKS
|
|
|
|
NTAPI
|
2006-10-16 03:19:14 +00:00
|
|
|
RtlSplay(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Inout_ PRTL_SPLAY_LINKS Links
|
2006-10-16 03:19:14 +00:00
|
|
|
);
|
2005-11-07 01:01:29 +00:00
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
PRTL_SPLAY_LINKS
|
|
|
|
NTAPI
|
2011-08-05 01:20:28 +00:00
|
|
|
RtlDelete(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_SPLAY_LINKS Links
|
2006-10-16 03:19:14 +00:00
|
|
|
);
|
2005-11-07 01:01:29 +00:00
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlDeleteNoSplay(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_SPLAY_LINKS Links,
|
|
|
|
_Inout_ PRTL_SPLAY_LINKS *Root
|
2005-11-07 01:01:29 +00:00
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_Must_inspect_result_
|
2005-11-07 01:01:29 +00:00
|
|
|
NTSYSAPI
|
|
|
|
PRTL_SPLAY_LINKS
|
|
|
|
NTAPI
|
2006-10-16 03:19:14 +00:00
|
|
|
RtlSubtreeSuccessor(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_SPLAY_LINKS Links
|
2006-10-16 03:19:14 +00:00
|
|
|
);
|
2005-11-07 01:01:29 +00:00
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_Must_inspect_result_
|
2005-11-07 01:01:29 +00:00
|
|
|
NTSYSAPI
|
|
|
|
PRTL_SPLAY_LINKS
|
|
|
|
NTAPI
|
2006-10-16 03:19:14 +00:00
|
|
|
RtlSubtreePredecessor(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_SPLAY_LINKS Links
|
2006-10-16 03:19:14 +00:00
|
|
|
);
|
2005-11-07 01:01:29 +00:00
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_Must_inspect_result_
|
2005-11-07 01:01:29 +00:00
|
|
|
NTSYSAPI
|
|
|
|
PRTL_SPLAY_LINKS
|
|
|
|
NTAPI
|
2006-10-16 03:19:14 +00:00
|
|
|
RtlRealSuccessor(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_SPLAY_LINKS Links
|
2006-10-16 03:19:14 +00:00
|
|
|
);
|
2005-11-07 01:01:29 +00:00
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_Must_inspect_result_
|
2005-11-07 01:01:29 +00:00
|
|
|
NTSYSAPI
|
|
|
|
PRTL_SPLAY_LINKS
|
|
|
|
NTAPI
|
2006-10-16 03:19:14 +00:00
|
|
|
RtlRealPredecessor(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_SPLAY_LINKS Links
|
2006-10-16 03:19:14 +00:00
|
|
|
);
|
2005-11-07 01:01:29 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
#define RtlIsLeftChild(Links) \
|
|
|
|
(RtlLeftChild(RtlParent(Links)) == (PRTL_SPLAY_LINKS)(Links))
|
|
|
|
|
|
|
|
#define RtlIsRightChild(Links) \
|
|
|
|
(RtlRightChild(RtlParent(Links)) == (PRTL_SPLAY_LINKS)(Links))
|
|
|
|
|
|
|
|
#define RtlRightChild(Links) \
|
|
|
|
((PRTL_SPLAY_LINKS)(Links))->RightChild
|
|
|
|
|
|
|
|
#define RtlIsRoot(Links) \
|
|
|
|
(RtlParent(Links) == (PRTL_SPLAY_LINKS)(Links))
|
|
|
|
|
|
|
|
#define RtlLeftChild(Links) \
|
|
|
|
((PRTL_SPLAY_LINKS)(Links))->LeftChild
|
|
|
|
|
|
|
|
#define RtlParent(Links) \
|
|
|
|
((PRTL_SPLAY_LINKS)(Links))->Parent
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
// FIXME: use inline function
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
#define RtlInitializeSplayLinks(Links) \
|
|
|
|
{ \
|
|
|
|
PRTL_SPLAY_LINKS _SplayLinks; \
|
|
|
|
_SplayLinks = (PRTL_SPLAY_LINKS)(Links); \
|
|
|
|
_SplayLinks->Parent = _SplayLinks; \
|
|
|
|
_SplayLinks->LeftChild = NULL; \
|
|
|
|
_SplayLinks->RightChild = NULL; \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define RtlInsertAsLeftChild(ParentLinks,ChildLinks) \
|
|
|
|
{ \
|
|
|
|
PRTL_SPLAY_LINKS _SplayParent; \
|
|
|
|
PRTL_SPLAY_LINKS _SplayChild; \
|
|
|
|
_SplayParent = (PRTL_SPLAY_LINKS)(ParentLinks); \
|
|
|
|
_SplayChild = (PRTL_SPLAY_LINKS)(ChildLinks); \
|
|
|
|
_SplayParent->LeftChild = _SplayChild; \
|
|
|
|
_SplayChild->Parent = _SplayParent; \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define RtlInsertAsRightChild(ParentLinks,ChildLinks) \
|
|
|
|
{ \
|
|
|
|
PRTL_SPLAY_LINKS _SplayParent; \
|
|
|
|
PRTL_SPLAY_LINKS _SplayChild; \
|
|
|
|
_SplayParent = (PRTL_SPLAY_LINKS)(ParentLinks); \
|
|
|
|
_SplayChild = (PRTL_SPLAY_LINKS)(ChildLinks); \
|
|
|
|
_SplayParent->RightChild = _SplayChild; \
|
|
|
|
_SplayChild->Parent = _SplayParent; \
|
|
|
|
}
|
2011-08-05 01:20:28 +00:00
|
|
|
|
2010-07-22 01:09:43 +00:00
|
|
|
//
|
|
|
|
// RTL AVL Tree Functions
|
|
|
|
//
|
|
|
|
NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlInitializeGenericTableAvl(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Out_ PRTL_AVL_TABLE Table,
|
|
|
|
_In_ PRTL_AVL_COMPARE_ROUTINE CompareRoutine,
|
|
|
|
_In_opt_ PRTL_AVL_ALLOCATE_ROUTINE AllocateRoutine,
|
|
|
|
_In_opt_ PRTL_AVL_FREE_ROUTINE FreeRoutine,
|
|
|
|
_In_opt_ PVOID TableContext
|
2010-07-22 01:09:43 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
RtlInsertElementGenericTableAvl(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_AVL_TABLE Table,
|
|
|
|
_In_reads_bytes_(BufferSize) PVOID Buffer,
|
|
|
|
_In_ CLONG BufferSize,
|
|
|
|
_Out_opt_ PBOOLEAN NewElement
|
2010-07-22 01:09:43 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
RtlInsertElementGenericTableFullAvl(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_AVL_TABLE Table,
|
|
|
|
_In_reads_bytes_(BufferSize) PVOID Buffer,
|
|
|
|
_In_ CLONG BufferSize,
|
|
|
|
_Out_opt_ PBOOLEAN NewElement,
|
|
|
|
_In_ PVOID NodeOrParent,
|
|
|
|
_In_ TABLE_SEARCH_RESULT SearchResult
|
2010-07-22 01:09:43 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
RtlDeleteElementGenericTableAvl(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_AVL_TABLE Table,
|
|
|
|
_In_ PVOID Buffer
|
2010-07-22 01:09:43 +00:00
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_Must_inspect_result_
|
2010-07-22 01:09:43 +00:00
|
|
|
NTSYSAPI
|
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
RtlLookupElementGenericTableAvl(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_AVL_TABLE Table,
|
|
|
|
_In_ PVOID Buffer
|
2010-07-22 01:09:43 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
RtlLookupElementGenericTableFullAvl(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_AVL_TABLE Table,
|
|
|
|
_In_ PVOID Buffer,
|
|
|
|
_Out_ PVOID *NodeOrParent,
|
|
|
|
_Out_ TABLE_SEARCH_RESULT *SearchResult
|
2010-07-22 01:09:43 +00:00
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_Must_inspect_result_
|
2010-07-22 01:09:43 +00:00
|
|
|
NTSYSAPI
|
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
RtlEnumerateGenericTableAvl(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_AVL_TABLE Table,
|
|
|
|
_In_ BOOLEAN Restart
|
2010-07-22 01:09:43 +00:00
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_Must_inspect_result_
|
2010-07-22 01:09:43 +00:00
|
|
|
NTSYSAPI
|
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
RtlEnumerateGenericTableWithoutSplayingAvl(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_AVL_TABLE Table,
|
|
|
|
_Inout_ PVOID *RestartKey
|
2010-07-22 01:09:43 +00:00
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_Must_inspect_result_
|
2010-07-22 01:09:43 +00:00
|
|
|
NTSYSAPI
|
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
RtlLookupFirstMatchingElementGenericTableAvl(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_AVL_TABLE Table,
|
|
|
|
_In_ PVOID Buffer,
|
|
|
|
_Out_ PVOID *RestartKey
|
2010-07-22 01:09:43 +00:00
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_Must_inspect_result_
|
2010-07-22 01:09:43 +00:00
|
|
|
NTSYSAPI
|
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
RtlEnumerateGenericTableLikeADirectory(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_AVL_TABLE Table,
|
|
|
|
_In_opt_ PRTL_AVL_MATCH_FUNCTION MatchFunction,
|
|
|
|
_In_opt_ PVOID MatchData,
|
|
|
|
_In_ ULONG NextFlag,
|
|
|
|
_Inout_ PVOID *RestartKey,
|
|
|
|
_Inout_ PULONG DeleteCount,
|
|
|
|
_In_ PVOID Buffer
|
2010-07-22 01:09:43 +00:00
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_Must_inspect_result_
|
2010-07-22 01:09:43 +00:00
|
|
|
NTSYSAPI
|
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
RtlGetElementGenericTableAvl(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_AVL_TABLE Table,
|
|
|
|
_In_ ULONG I
|
2010-07-22 01:09:43 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
RtlNumberGenericTableElementsAvl(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_AVL_TABLE Table
|
2010-07-22 01:09:43 +00:00
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_Must_inspect_result_
|
2010-07-22 01:09:43 +00:00
|
|
|
NTSYSAPI
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
RtlIsGenericTableEmptyAvl(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_AVL_TABLE Table
|
2010-07-22 01:09:43 +00:00
|
|
|
);
|
2011-08-05 01:20:28 +00:00
|
|
|
|
|
|
|
#ifdef RTL_USE_AVL_TABLES
|
|
|
|
|
|
|
|
#define RtlInitializeGenericTable RtlInitializeGenericTableAvl
|
|
|
|
#define RtlInsertElementGenericTable RtlInsertElementGenericTableAvl
|
|
|
|
#define RtlInsertElementGenericTableFull RtlInsertElementGenericTableFullAvl
|
|
|
|
#define RtlDeleteElementGenericTable RtlDeleteElementGenericTableAvl
|
|
|
|
#define RtlLookupElementGenericTable RtlLookupElementGenericTableAvl
|
|
|
|
#define RtlLookupElementGenericTableFull RtlLookupElementGenericTableFullAvl
|
|
|
|
#define RtlEnumerateGenericTable RtlEnumerateGenericTableAvl
|
|
|
|
#define RtlEnumerateGenericTableWithoutSplaying RtlEnumerateGenericTableWithoutSplayingAvl
|
|
|
|
#define RtlGetElementGenericTable RtlGetElementGenericTableAvl
|
|
|
|
#define RtlNumberGenericTableElements RtlNumberGenericTableElementsAvl
|
|
|
|
#define RtlIsGenericTableEmpty RtlIsGenericTableEmptyAvl
|
|
|
|
|
|
|
|
#endif /* RTL_USE_AVL_TABLES */
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
2016-07-02 20:37:35 +00:00
|
|
|
// Exception and Error Functions
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
PVOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
RtlAddVectoredExceptionHandler(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG FirstHandler,
|
|
|
|
_In_ PVECTORED_EXCEPTION_HANDLER VectoredHandler
|
2005-06-21 02:08:42 +00:00
|
|
|
);
|
2005-06-18 23:33:40 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2017-03-06 19:04:17 +00:00
|
|
|
ULONG
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2017-03-06 19:04:17 +00:00
|
|
|
RtlRemoveVectoredExceptionHandler(
|
|
|
|
_In_ PVOID VectoredHandlerHandle
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
RtlAddVectoredContinueHandler(
|
|
|
|
_In_ ULONG FirstHandler,
|
|
|
|
_In_ PVECTORED_EXCEPTION_HANDLER VectoredHandler
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
RtlRemoveVectoredContinueHandler(
|
|
|
|
_In_ PVOID VectoredHandlerHandle
|
2005-06-20 05:36:32 +00:00
|
|
|
);
|
|
|
|
|
Major refactoring of the exception handling code + misc fixes:
- Fix/add prototypes for RtlCaptureContext, RtlDispatchException and RtlUnwind
- Fix EXCEPTION_REGISTRATION_RECORD structure and PEXCEPTION_ROUTINE
- Add w32api excpt.h (based on mingw) with PSDK compatibility fixes
- Fix seriously broken User-Mode Ldr thunk and APC Callback prototypes
- Fix KiUserExceptionDispatcher
- Remove useless NTDLL entrypoint
- Implement NTDLL Ki* callbacks in ASM
- Implement RtlCaptureContext
- Fix RtlRaiseException to handle cases when a user-mode debugger is present
- Fix RtlRaiseStatus as above, plus set the exception address and capture context
- Little cleanup of RTL headers
- Implement RtlpGetStackLimits, RtlpGetExceptionList, RtlpSetExceptionList, RtlpGetExceptionAddress in ASM
- Fix RtlDispatchException, add cases for exceptions in the DPC stack and validate the validity of the
exception frames. Add support for exception logging by the global flag. Use TRAP_FRAME/EXCPETION_FRAME instead of
Context.
- Fix RtlUnwind logic, support cases where it's called with custom arguments instead of NULL.
- Reimplement RtlpCaptureContext to work properly, convert exception handler calling functions to INTEL syntax
and fix some bugs (like checking for the right unwind flag, clearing volatile register values, etc. Also use some
optimizations to increase speed.
- Modify some kernel functions (like KeContextToTrapFrame, KiDispatchException, KiInitializeUserApc, etc.) to
support a PKEXCEPTION_FRAME for future PPC compatibility.
- Reimplement RtlCaptureUnicodeString/FreeUnicodeString as inlined probe macros and optimize them.
- Export ExRaiseStatus/Exception as Rtl*
- Reimplement NtContinue to have more platform-independent code, and to protect and validate user-mode context
and parameters with SEH.
- Implement KiRaiseException, add SEH to all user-mode parameters and when copying data to the user-mode stack.
- Fix KiInitializeUserApc to use KeTrapFrameToContext, to save the debug registers, not to deliver APCs during
v86 mode, and to protect user-mode stack operations in SEH and probing. Also make it generate the proper stack for the
user-mode callback.
- Implement KiUnexpectedInterrupt and KiCoprocessorError
- Reimplement NtRaiseException in ASM to take advantage of optimizations due to the trap frame being in the
stack when called through System call interface.
- Fix Ntcontinue to respect AlertThread paramter
- Fix some functiosn to return with KiServiceExit2 instead of KiServiceExit when required/needed
- Fix KiDispatchException's logic, fix hacks when calling KeUserExceptionDispatcher, use correct context
flags,...
- Make NTDLL Ki* callbacks have SEH to protect them and return to kernel-mode with notification of any
exceptions (the kernel-mode code to handle this isn't written yet though)
svn path=/trunk/; revision=17811
2005-09-11 22:32:20 +00:00
|
|
|
NTSYSAPI
|
2011-12-18 01:50:11 +00:00
|
|
|
VOID
|
Major refactoring of the exception handling code + misc fixes:
- Fix/add prototypes for RtlCaptureContext, RtlDispatchException and RtlUnwind
- Fix EXCEPTION_REGISTRATION_RECORD structure and PEXCEPTION_ROUTINE
- Add w32api excpt.h (based on mingw) with PSDK compatibility fixes
- Fix seriously broken User-Mode Ldr thunk and APC Callback prototypes
- Fix KiUserExceptionDispatcher
- Remove useless NTDLL entrypoint
- Implement NTDLL Ki* callbacks in ASM
- Implement RtlCaptureContext
- Fix RtlRaiseException to handle cases when a user-mode debugger is present
- Fix RtlRaiseStatus as above, plus set the exception address and capture context
- Little cleanup of RTL headers
- Implement RtlpGetStackLimits, RtlpGetExceptionList, RtlpSetExceptionList, RtlpGetExceptionAddress in ASM
- Fix RtlDispatchException, add cases for exceptions in the DPC stack and validate the validity of the
exception frames. Add support for exception logging by the global flag. Use TRAP_FRAME/EXCPETION_FRAME instead of
Context.
- Fix RtlUnwind logic, support cases where it's called with custom arguments instead of NULL.
- Reimplement RtlpCaptureContext to work properly, convert exception handler calling functions to INTEL syntax
and fix some bugs (like checking for the right unwind flag, clearing volatile register values, etc. Also use some
optimizations to increase speed.
- Modify some kernel functions (like KeContextToTrapFrame, KiDispatchException, KiInitializeUserApc, etc.) to
support a PKEXCEPTION_FRAME for future PPC compatibility.
- Reimplement RtlCaptureUnicodeString/FreeUnicodeString as inlined probe macros and optimize them.
- Export ExRaiseStatus/Exception as Rtl*
- Reimplement NtContinue to have more platform-independent code, and to protect and validate user-mode context
and parameters with SEH.
- Implement KiRaiseException, add SEH to all user-mode parameters and when copying data to the user-mode stack.
- Fix KiInitializeUserApc to use KeTrapFrameToContext, to save the debug registers, not to deliver APCs during
v86 mode, and to protect user-mode stack operations in SEH and probing. Also make it generate the proper stack for the
user-mode callback.
- Implement KiUnexpectedInterrupt and KiCoprocessorError
- Reimplement NtRaiseException in ASM to take advantage of optimizations due to the trap frame being in the
stack when called through System call interface.
- Fix Ntcontinue to respect AlertThread paramter
- Fix some functiosn to return with KiServiceExit2 instead of KiServiceExit when required/needed
- Fix KiDispatchException's logic, fix hacks when calling KeUserExceptionDispatcher, use correct context
flags,...
- Make NTDLL Ki* callbacks have SEH to protect them and return to kernel-mode with notification of any
exceptions (the kernel-mode code to handle this isn't written yet though)
svn path=/trunk/; revision=17811
2005-09-11 22:32:20 +00:00
|
|
|
NTAPI
|
2006-05-10 17:47:44 +00:00
|
|
|
RtlSetUnhandledExceptionFilter(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTLP_UNHANDLED_EXCEPTION_FILTER TopLevelExceptionFilter
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
Major refactoring of the exception handling code + misc fixes:
- Fix/add prototypes for RtlCaptureContext, RtlDispatchException and RtlUnwind
- Fix EXCEPTION_REGISTRATION_RECORD structure and PEXCEPTION_ROUTINE
- Add w32api excpt.h (based on mingw) with PSDK compatibility fixes
- Fix seriously broken User-Mode Ldr thunk and APC Callback prototypes
- Fix KiUserExceptionDispatcher
- Remove useless NTDLL entrypoint
- Implement NTDLL Ki* callbacks in ASM
- Implement RtlCaptureContext
- Fix RtlRaiseException to handle cases when a user-mode debugger is present
- Fix RtlRaiseStatus as above, plus set the exception address and capture context
- Little cleanup of RTL headers
- Implement RtlpGetStackLimits, RtlpGetExceptionList, RtlpSetExceptionList, RtlpGetExceptionAddress in ASM
- Fix RtlDispatchException, add cases for exceptions in the DPC stack and validate the validity of the
exception frames. Add support for exception logging by the global flag. Use TRAP_FRAME/EXCPETION_FRAME instead of
Context.
- Fix RtlUnwind logic, support cases where it's called with custom arguments instead of NULL.
- Reimplement RtlpCaptureContext to work properly, convert exception handler calling functions to INTEL syntax
and fix some bugs (like checking for the right unwind flag, clearing volatile register values, etc. Also use some
optimizations to increase speed.
- Modify some kernel functions (like KeContextToTrapFrame, KiDispatchException, KiInitializeUserApc, etc.) to
support a PKEXCEPTION_FRAME for future PPC compatibility.
- Reimplement RtlCaptureUnicodeString/FreeUnicodeString as inlined probe macros and optimize them.
- Export ExRaiseStatus/Exception as Rtl*
- Reimplement NtContinue to have more platform-independent code, and to protect and validate user-mode context
and parameters with SEH.
- Implement KiRaiseException, add SEH to all user-mode parameters and when copying data to the user-mode stack.
- Fix KiInitializeUserApc to use KeTrapFrameToContext, to save the debug registers, not to deliver APCs during
v86 mode, and to protect user-mode stack operations in SEH and probing. Also make it generate the proper stack for the
user-mode callback.
- Implement KiUnexpectedInterrupt and KiCoprocessorError
- Reimplement NtRaiseException in ASM to take advantage of optimizations due to the trap frame being in the
stack when called through System call interface.
- Fix Ntcontinue to respect AlertThread paramter
- Fix some functiosn to return with KiServiceExit2 instead of KiServiceExit when required/needed
- Fix KiDispatchException's logic, fix hacks when calling KeUserExceptionDispatcher, use correct context
flags,...
- Make NTDLL Ki* callbacks have SEH to protect them and return to kernel-mode with notification of any
exceptions (the kernel-mode code to handle this isn't written yet though)
svn path=/trunk/; revision=17811
2005-09-11 22:32:20 +00:00
|
|
|
|
2006-04-10 19:57:47 +00:00
|
|
|
NTSYSAPI
|
2016-07-02 20:37:35 +00:00
|
|
|
LONG
|
2006-04-10 19:57:47 +00:00
|
|
|
NTAPI
|
2016-07-02 20:37:35 +00:00
|
|
|
RtlUnhandledExceptionFilter(
|
|
|
|
_In_ struct _EXCEPTION_POINTERS* ExceptionInfo
|
2006-06-26 14:10:10 +00:00
|
|
|
);
|
2006-04-10 19:57:47 +00:00
|
|
|
|
2017-03-06 19:04:17 +00:00
|
|
|
__analysis_noreturn
|
|
|
|
NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlAssert(
|
|
|
|
_In_ PVOID FailedAssertion,
|
|
|
|
_In_ PVOID FileName,
|
|
|
|
_In_ ULONG LineNumber,
|
|
|
|
_In_opt_z_ PCHAR Message
|
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
PVOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2006-06-26 14:10:10 +00:00
|
|
|
RtlEncodePointer(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID Pointer
|
2006-06-26 14:10:10 +00:00
|
|
|
);
|
2005-06-21 02:08:42 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
PVOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2006-06-26 14:10:10 +00:00
|
|
|
RtlDecodePointer(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID Pointer
|
2006-06-26 14:10:10 +00:00
|
|
|
);
|
2005-06-21 02:08:42 +00:00
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
NTSYSAPI
|
|
|
|
PVOID
|
|
|
|
NTAPI
|
2006-06-26 14:10:10 +00:00
|
|
|
RtlEncodeSystemPointer(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID Pointer
|
2006-06-26 14:10:10 +00:00
|
|
|
);
|
2006-05-10 17:47:44 +00:00
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
PVOID
|
|
|
|
NTAPI
|
2006-06-26 14:10:10 +00:00
|
|
|
RtlDecodeSystemPointer(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID Pointer
|
2006-06-26 14:10:10 +00:00
|
|
|
);
|
2006-05-10 17:47:44 +00:00
|
|
|
|
2016-07-02 20:37:35 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlGetLastNtStatus(
|
|
|
|
VOID
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
RtlGetLastWin32Error(
|
|
|
|
VOID
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlSetLastWin32Error(
|
|
|
|
_In_ ULONG LastError
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlSetLastWin32ErrorAndNtStatusFromNtStatus(
|
|
|
|
_In_ NTSTATUS Status
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlSetThreadErrorMode(
|
|
|
|
_In_ ULONG NewMode,
|
|
|
|
_Out_opt_ PULONG OldMode
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
RtlGetThreadErrorMode(
|
|
|
|
VOID
|
|
|
|
);
|
|
|
|
|
|
|
|
#endif /* NTOS_MODE_USER */
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlCaptureContext(
|
|
|
|
_Out_ PCONTEXT ContextRecord
|
|
|
|
);
|
|
|
|
|
Major refactoring of the exception handling code + misc fixes:
- Fix/add prototypes for RtlCaptureContext, RtlDispatchException and RtlUnwind
- Fix EXCEPTION_REGISTRATION_RECORD structure and PEXCEPTION_ROUTINE
- Add w32api excpt.h (based on mingw) with PSDK compatibility fixes
- Fix seriously broken User-Mode Ldr thunk and APC Callback prototypes
- Fix KiUserExceptionDispatcher
- Remove useless NTDLL entrypoint
- Implement NTDLL Ki* callbacks in ASM
- Implement RtlCaptureContext
- Fix RtlRaiseException to handle cases when a user-mode debugger is present
- Fix RtlRaiseStatus as above, plus set the exception address and capture context
- Little cleanup of RTL headers
- Implement RtlpGetStackLimits, RtlpGetExceptionList, RtlpSetExceptionList, RtlpGetExceptionAddress in ASM
- Fix RtlDispatchException, add cases for exceptions in the DPC stack and validate the validity of the
exception frames. Add support for exception logging by the global flag. Use TRAP_FRAME/EXCPETION_FRAME instead of
Context.
- Fix RtlUnwind logic, support cases where it's called with custom arguments instead of NULL.
- Reimplement RtlpCaptureContext to work properly, convert exception handler calling functions to INTEL syntax
and fix some bugs (like checking for the right unwind flag, clearing volatile register values, etc. Also use some
optimizations to increase speed.
- Modify some kernel functions (like KeContextToTrapFrame, KiDispatchException, KiInitializeUserApc, etc.) to
support a PKEXCEPTION_FRAME for future PPC compatibility.
- Reimplement RtlCaptureUnicodeString/FreeUnicodeString as inlined probe macros and optimize them.
- Export ExRaiseStatus/Exception as Rtl*
- Reimplement NtContinue to have more platform-independent code, and to protect and validate user-mode context
and parameters with SEH.
- Implement KiRaiseException, add SEH to all user-mode parameters and when copying data to the user-mode stack.
- Fix KiInitializeUserApc to use KeTrapFrameToContext, to save the debug registers, not to deliver APCs during
v86 mode, and to protect user-mode stack operations in SEH and probing. Also make it generate the proper stack for the
user-mode callback.
- Implement KiUnexpectedInterrupt and KiCoprocessorError
- Reimplement NtRaiseException in ASM to take advantage of optimizations due to the trap frame being in the
stack when called through System call interface.
- Fix Ntcontinue to respect AlertThread paramter
- Fix some functiosn to return with KiServiceExit2 instead of KiServiceExit when required/needed
- Fix KiDispatchException's logic, fix hacks when calling KeUserExceptionDispatcher, use correct context
flags,...
- Make NTDLL Ki* callbacks have SEH to protect them and return to kernel-mode with notification of any
exceptions (the kernel-mode code to handle this isn't written yet though)
svn path=/trunk/; revision=17811
2005-09-11 22:32:20 +00:00
|
|
|
NTSYSAPI
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
RtlDispatchException(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PEXCEPTION_RECORD ExceptionRecord,
|
|
|
|
_In_ PCONTEXT Context
|
Major refactoring of the exception handling code + misc fixes:
- Fix/add prototypes for RtlCaptureContext, RtlDispatchException and RtlUnwind
- Fix EXCEPTION_REGISTRATION_RECORD structure and PEXCEPTION_ROUTINE
- Add w32api excpt.h (based on mingw) with PSDK compatibility fixes
- Fix seriously broken User-Mode Ldr thunk and APC Callback prototypes
- Fix KiUserExceptionDispatcher
- Remove useless NTDLL entrypoint
- Implement NTDLL Ki* callbacks in ASM
- Implement RtlCaptureContext
- Fix RtlRaiseException to handle cases when a user-mode debugger is present
- Fix RtlRaiseStatus as above, plus set the exception address and capture context
- Little cleanup of RTL headers
- Implement RtlpGetStackLimits, RtlpGetExceptionList, RtlpSetExceptionList, RtlpGetExceptionAddress in ASM
- Fix RtlDispatchException, add cases for exceptions in the DPC stack and validate the validity of the
exception frames. Add support for exception logging by the global flag. Use TRAP_FRAME/EXCPETION_FRAME instead of
Context.
- Fix RtlUnwind logic, support cases where it's called with custom arguments instead of NULL.
- Reimplement RtlpCaptureContext to work properly, convert exception handler calling functions to INTEL syntax
and fix some bugs (like checking for the right unwind flag, clearing volatile register values, etc. Also use some
optimizations to increase speed.
- Modify some kernel functions (like KeContextToTrapFrame, KiDispatchException, KiInitializeUserApc, etc.) to
support a PKEXCEPTION_FRAME for future PPC compatibility.
- Reimplement RtlCaptureUnicodeString/FreeUnicodeString as inlined probe macros and optimize them.
- Export ExRaiseStatus/Exception as Rtl*
- Reimplement NtContinue to have more platform-independent code, and to protect and validate user-mode context
and parameters with SEH.
- Implement KiRaiseException, add SEH to all user-mode parameters and when copying data to the user-mode stack.
- Fix KiInitializeUserApc to use KeTrapFrameToContext, to save the debug registers, not to deliver APCs during
v86 mode, and to protect user-mode stack operations in SEH and probing. Also make it generate the proper stack for the
user-mode callback.
- Implement KiUnexpectedInterrupt and KiCoprocessorError
- Reimplement NtRaiseException in ASM to take advantage of optimizations due to the trap frame being in the
stack when called through System call interface.
- Fix Ntcontinue to respect AlertThread paramter
- Fix some functiosn to return with KiServiceExit2 instead of KiServiceExit when required/needed
- Fix KiDispatchException's logic, fix hacks when calling KeUserExceptionDispatcher, use correct context
flags,...
- Make NTDLL Ki* callbacks have SEH to protect them and return to kernel-mode with notification of any
exceptions (the kernel-mode code to handle this isn't written yet though)
svn path=/trunk/; revision=17811
2005-09-11 22:32:20 +00:00
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_IRQL_requires_max_(APC_LEVEL)
|
|
|
|
_When_(Status < 0, _Out_range_(>, 0))
|
|
|
|
_When_(Status >= 0, _Out_range_(==, 0))
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
ULONG
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2006-06-26 14:10:10 +00:00
|
|
|
RtlNtStatusToDosError(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ NTSTATUS Status
|
2006-06-26 14:10:10 +00:00
|
|
|
);
|
2005-06-20 05:36:32 +00:00
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_When_(Status < 0, _Out_range_(>, 0))
|
|
|
|
_When_(Status >= 0, _Out_range_(==, 0))
|
2008-09-12 15:09:17 +00:00
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
RtlNtStatusToDosErrorNoTeb(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ NTSTATUS Status
|
2008-09-12 15:09:17 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2016-07-02 20:37:35 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2016-07-02 20:37:35 +00:00
|
|
|
RtlMapSecurityErrorToNtStatus(
|
|
|
|
_In_ ULONG SecurityError
|
2006-06-26 14:10:10 +00:00
|
|
|
);
|
2005-06-20 05:36:32 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2006-06-26 14:10:10 +00:00
|
|
|
RtlRaiseException(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PEXCEPTION_RECORD ExceptionRecord
|
2006-06-26 14:10:10 +00:00
|
|
|
);
|
|
|
|
|
2009-01-17 21:11:38 +00:00
|
|
|
DECLSPEC_NORETURN
|
2006-06-26 14:10:10 +00:00
|
|
|
NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlRaiseStatus(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ NTSTATUS Status
|
2006-06-26 14:10:10 +00:00
|
|
|
);
|
2005-06-20 05:36:32 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlUnwind(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_opt_ PVOID TargetFrame,
|
|
|
|
_In_opt_ PVOID TargetIp,
|
|
|
|
_In_opt_ PEXCEPTION_RECORD ExceptionRecord,
|
|
|
|
_In_ PVOID ReturnValue
|
2005-06-20 05:36:32 +00:00
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
#define RTL_STACK_WALKING_MODE_FRAMES_TO_SKIP_SHIFT 8
|
|
|
|
|
2022-07-19 06:05:31 +00:00
|
|
|
#ifdef _M_AMD64
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
PRUNTIME_FUNCTION
|
|
|
|
NTAPI
|
|
|
|
RtlLookupFunctionEntry(
|
|
|
|
_In_ DWORD64 ControlPc,
|
|
|
|
_Out_ PDWORD64 ImageBase,
|
|
|
|
_Inout_opt_ PUNWIND_HISTORY_TABLE HistoryTable
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
PEXCEPTION_ROUTINE
|
|
|
|
NTAPI
|
|
|
|
RtlVirtualUnwind(
|
|
|
|
_In_ ULONG HandlerType,
|
|
|
|
_In_ ULONG64 ImageBase,
|
|
|
|
_In_ ULONG64 ControlPc,
|
|
|
|
_In_ PRUNTIME_FUNCTION FunctionEntry,
|
|
|
|
_Inout_ PCONTEXT Context,
|
|
|
|
_Outptr_ PVOID* HandlerData,
|
|
|
|
_Out_ PULONG64 EstablisherFrame,
|
|
|
|
_Inout_opt_ PKNONVOLATILE_CONTEXT_POINTERS ContextPointers
|
|
|
|
);
|
|
|
|
|
|
|
|
#endif // _M_AMD64
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
//
|
|
|
|
// Tracing Functions
|
|
|
|
//
|
2007-10-01 17:58:49 +00:00
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
RtlWalkFrameChain(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Out_writes_(Count - (Flags >> RTL_STACK_WALKING_MODE_FRAMES_TO_SKIP_SHIFT)) PVOID *Callers,
|
|
|
|
_In_ ULONG Count,
|
|
|
|
_In_ ULONG Flags
|
2007-10-01 17:58:49 +00:00
|
|
|
);
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
NTSYSAPI
|
|
|
|
USHORT
|
|
|
|
NTAPI
|
2006-06-26 14:10:10 +00:00
|
|
|
RtlLogStackBackTrace(
|
|
|
|
VOID
|
|
|
|
);
|
2006-05-10 17:47:44 +00:00
|
|
|
|
2012-09-26 09:40:44 +00:00
|
|
|
#ifdef NTOS_MODE_USER
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Heap Functions
|
|
|
|
//
|
2013-01-13 14:49:21 +00:00
|
|
|
_Must_inspect_result_
|
|
|
|
_Ret_maybenull_
|
|
|
|
_Post_writable_byte_size_(Size)
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
PVOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlAllocateHeap(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID HeapHandle,
|
|
|
|
_In_opt_ ULONG Flags,
|
|
|
|
_In_ SIZE_T Size
|
2005-06-20 05:36:32 +00:00
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_Must_inspect_result_
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
PVOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlCreateHeap(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG Flags,
|
|
|
|
_In_opt_ PVOID BaseAddress,
|
|
|
|
_In_opt_ SIZE_T SizeToReserve,
|
|
|
|
_In_opt_ SIZE_T SizeToCommit,
|
|
|
|
_In_opt_ PVOID Lock,
|
|
|
|
_In_opt_ PRTL_HEAP_PARAMETERS Parameters
|
2005-06-20 05:36:32 +00:00
|
|
|
);
|
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2006-05-10 17:47:44 +00:00
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
RtlCreateTagHeap(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE HeapHandle,
|
|
|
|
_In_ ULONG Flags,
|
2021-05-24 06:56:17 +00:00
|
|
|
_In_opt_ PWSTR TagName,
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PWSTR TagSubName
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
ULONG
|
|
|
|
NTAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
RtlCompactHeap(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE Heap,
|
|
|
|
_In_ ULONG Flags
|
2005-06-21 02:08:42 +00:00
|
|
|
);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_Must_inspect_result_
|
2006-06-23 21:21:45 +00:00
|
|
|
NTSYSAPI
|
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
RtlDebugCreateHeap(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG Flags,
|
|
|
|
_In_opt_ PVOID BaseAddress,
|
|
|
|
_In_opt_ SIZE_T SizeToReserve,
|
|
|
|
_In_opt_ SIZE_T SizeToCommit,
|
|
|
|
_In_opt_ PVOID Lock,
|
|
|
|
_In_opt_ PRTL_HEAP_PARAMETERS Parameters
|
2006-06-23 21:21:45 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
HANDLE
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2006-06-24 19:49:28 +00:00
|
|
|
RtlDestroyHeap(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ _Post_invalid_ HANDLE Heap
|
2006-06-24 19:49:28 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
RtlExtendHeap(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE Heap,
|
|
|
|
_In_ ULONG Flags,
|
|
|
|
_In_ PVOID P,
|
|
|
|
_In_ SIZE_T Size
|
2006-06-24 19:49:28 +00:00
|
|
|
);
|
2005-06-20 05:36:32 +00:00
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_Success_(return != 0)
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
BOOLEAN
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlFreeHeap(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE HeapHandle,
|
|
|
|
_In_opt_ ULONG Flags,
|
|
|
|
_In_ _Post_invalid_ PVOID P
|
2005-06-20 05:36:32 +00:00
|
|
|
);
|
|
|
|
|
2005-06-21 02:08:42 +00:00
|
|
|
ULONG
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
RtlGetProcessHeaps(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG HeapCount,
|
|
|
|
_Out_cap_(HeapCount) HANDLE *HeapArray
|
2005-06-21 02:08:42 +00:00
|
|
|
);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_Success_(return != 0)
|
2006-06-23 23:10:58 +00:00
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
RtlGetUserInfoHeap(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID HeapHandle,
|
|
|
|
_In_ ULONG Flags,
|
|
|
|
_In_ PVOID BaseAddress,
|
2013-01-19 21:49:12 +00:00
|
|
|
_Inout_opt_ PVOID *UserValue,
|
2013-01-13 14:49:21 +00:00
|
|
|
_Out_opt_ PULONG UserFlags
|
2006-06-23 23:10:58 +00:00
|
|
|
);
|
|
|
|
|
2008-09-12 15:09:17 +00:00
|
|
|
NTSYSAPI
|
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
RtlProtectHeap(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID HeapHandle,
|
|
|
|
_In_ BOOLEAN Protect
|
2008-09-12 15:09:17 +00:00
|
|
|
);
|
|
|
|
|
2010-10-11 08:39:04 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
2013-01-19 21:49:12 +00:00
|
|
|
RtlQueryHeapInformation(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID HeapHandle,
|
|
|
|
_In_ HEAP_INFORMATION_CLASS HeapInformationClass,
|
2013-01-19 21:49:12 +00:00
|
|
|
_Out_ PVOID HeapInformation,
|
|
|
|
_In_ SIZE_T HeapInformationLength,
|
|
|
|
_When_(HeapInformationClass==HeapCompatibilityInformation, _On_failure_(_Out_opt_))
|
|
|
|
_Out_opt_ PSIZE_T ReturnLength
|
|
|
|
);
|
2010-10-11 08:39:04 +00:00
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_Ret_opt_z_
|
2006-06-24 19:49:28 +00:00
|
|
|
NTSYSAPI
|
|
|
|
PWSTR
|
|
|
|
NTAPI
|
|
|
|
RtlQueryTagHeap(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID HeapHandle,
|
|
|
|
_In_ ULONG Flags,
|
|
|
|
_In_ USHORT TagIndex,
|
|
|
|
_In_ BOOLEAN ResetCounters,
|
|
|
|
_Out_ PRTL_HEAP_TAG_INFO HeapTagInfo
|
2006-06-24 19:49:28 +00:00
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_Must_inspect_result_
|
|
|
|
_Ret_maybenull_
|
|
|
|
_Post_writable_byte_size_(Size)
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
PVOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlReAllocateHeap(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE Heap,
|
|
|
|
_In_opt_ ULONG Flags,
|
|
|
|
_In_ _Post_invalid_ PVOID Ptr,
|
|
|
|
_In_ SIZE_T Size
|
2005-06-20 05:36:32 +00:00
|
|
|
);
|
|
|
|
|
2010-10-11 08:39:04 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
2013-01-19 21:49:12 +00:00
|
|
|
RtlSetHeapInformation(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID HeapHandle,
|
|
|
|
_In_ HEAP_INFORMATION_CLASS HeapInformationClass,
|
2013-01-19 21:49:12 +00:00
|
|
|
_When_(HeapInformationClass==HeapCompatibilityInformation,_In_) PVOID HeapInformation,
|
|
|
|
_In_ SIZE_T HeapInformationLength
|
|
|
|
);
|
2010-10-11 08:39:04 +00:00
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
BOOLEAN
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2006-06-24 19:49:28 +00:00
|
|
|
RtlLockHeap(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE Heap
|
2006-06-24 19:49:28 +00:00
|
|
|
);
|
|
|
|
|
2010-10-11 08:39:04 +00:00
|
|
|
NTSYSAPI
|
2020-04-24 08:45:43 +00:00
|
|
|
ULONG
|
2010-10-11 08:39:04 +00:00
|
|
|
NTAPI
|
2020-04-24 08:45:43 +00:00
|
|
|
RtlMultipleAllocateHeap(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE HeapHandle,
|
|
|
|
_In_ ULONG Flags,
|
|
|
|
_In_ SIZE_T Size,
|
|
|
|
_In_ ULONG Count,
|
|
|
|
_Out_cap_(Count) _Deref_post_bytecap_(Size) PVOID * Array
|
2020-04-24 08:45:43 +00:00
|
|
|
);
|
2010-10-11 08:39:04 +00:00
|
|
|
|
|
|
|
NTSYSAPI
|
2020-04-24 08:45:43 +00:00
|
|
|
ULONG
|
2010-10-11 08:39:04 +00:00
|
|
|
NTAPI
|
2020-04-24 08:45:43 +00:00
|
|
|
RtlMultipleFreeHeap(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE HeapHandle,
|
|
|
|
_In_ ULONG Flags,
|
|
|
|
_In_ ULONG Count,
|
|
|
|
_In_count_(Count) /* _Deref_ _Post_invalid_ */ PVOID * Array
|
2020-04-24 08:45:43 +00:00
|
|
|
);
|
2010-10-11 08:39:04 +00:00
|
|
|
|
2006-06-24 19:49:28 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlUsageHeap(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE Heap,
|
|
|
|
_In_ ULONG Flags,
|
|
|
|
_Out_ PRTL_HEAP_USAGE Usage
|
2006-06-24 19:49:28 +00:00
|
|
|
);
|
2005-06-20 05:36:32 +00:00
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
BOOLEAN
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2006-06-24 19:49:28 +00:00
|
|
|
RtlUnlockHeap(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE Heap
|
2006-06-24 19:49:28 +00:00
|
|
|
);
|
2005-06-20 05:36:32 +00:00
|
|
|
|
2006-06-23 23:10:58 +00:00
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
RtlSetUserValueHeap(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID HeapHandle,
|
|
|
|
_In_ ULONG Flags,
|
|
|
|
_In_ PVOID BaseAddress,
|
|
|
|
_In_ PVOID UserValue
|
2006-06-23 23:10:58 +00:00
|
|
|
);
|
|
|
|
|
2008-07-10 09:46:25 +00:00
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
RtlSetUserFlagsHeap(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID HeapHandle,
|
|
|
|
_In_ ULONG Flags,
|
|
|
|
_In_ PVOID BaseAddress,
|
|
|
|
_In_ ULONG UserFlagsReset,
|
|
|
|
_In_ ULONG UserFlagsSet
|
2008-07-10 09:46:25 +00:00
|
|
|
);
|
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
BOOLEAN
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlValidateHeap(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE Heap,
|
|
|
|
_In_ ULONG Flags,
|
2013-01-19 21:49:12 +00:00
|
|
|
_In_opt_ PVOID P
|
2005-06-20 05:36:32 +00:00
|
|
|
);
|
|
|
|
|
2008-09-12 15:09:17 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlWalkHeap(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE HeapHandle,
|
|
|
|
_In_ PVOID HeapEntry
|
2008-09-12 15:09:17 +00:00
|
|
|
);
|
2008-11-28 14:33:21 +00:00
|
|
|
|
2005-06-20 05:36:32 +00:00
|
|
|
#define RtlGetProcessHeap() (NtCurrentPeb()->ProcessHeap)
|
|
|
|
|
2012-09-26 09:40:44 +00:00
|
|
|
#endif // NTOS_MODE_USER
|
|
|
|
|
2017-03-02 20:40:21 +00:00
|
|
|
#define NtCurrentPeb() (NtCurrentTeb()->ProcessEnvironmentBlock)
|
|
|
|
|
2012-09-26 09:40:44 +00:00
|
|
|
NTSYSAPI
|
|
|
|
SIZE_T
|
|
|
|
NTAPI
|
|
|
|
RtlSizeHeap(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID HeapHandle,
|
|
|
|
_In_ ULONG Flags,
|
|
|
|
_In_ PVOID MemoryPointer
|
2012-09-26 09:40:44 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Security Functions
|
|
|
|
//
|
2013-01-13 14:49:21 +00:00
|
|
|
_IRQL_requires_max_(APC_LEVEL)
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlAbsoluteToSelfRelativeSD(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor,
|
|
|
|
_Out_writes_bytes_to_opt_(*BufferLength, *BufferLength) PSECURITY_DESCRIPTOR SelfRelativeSecurityDescriptor,
|
|
|
|
_Inout_ PULONG BufferLength
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_IRQL_requires_max_(APC_LEVEL)
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlAddAccessAllowedAce(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Inout_ PACL Acl,
|
|
|
|
_In_ ULONG Revision,
|
|
|
|
_In_ ACCESS_MASK AccessMask,
|
|
|
|
_In_ PSID Sid
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
2005-06-20 18:54:47 +00:00
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_IRQL_requires_max_(APC_LEVEL)
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 18:54:47 +00:00
|
|
|
RtlAddAccessAllowedAceEx(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Inout_ PACL pAcl,
|
|
|
|
_In_ ULONG dwAceRevision,
|
|
|
|
_In_ ULONG AceFlags,
|
|
|
|
_In_ ACCESS_MASK AccessMask,
|
|
|
|
_In_ PSID pSid
|
2005-06-20 18:54:47 +00:00
|
|
|
);
|
|
|
|
|
2006-05-10 09:32:23 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlAddAccessAllowedObjectAce(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Inout_ PACL pAcl,
|
|
|
|
_In_ ULONG dwAceRevision,
|
|
|
|
_In_ ULONG AceFlags,
|
|
|
|
_In_ ACCESS_MASK AccessMask,
|
|
|
|
_In_opt_ GUID *ObjectTypeGuid,
|
|
|
|
_In_opt_ GUID *InheritedObjectTypeGuid,
|
|
|
|
_In_ PSID pSid
|
2006-05-10 09:32:23 +00:00
|
|
|
);
|
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 18:54:47 +00:00
|
|
|
RtlAddAccessDeniedAce(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Inout_ PACL Acl,
|
|
|
|
_In_ ULONG Revision,
|
|
|
|
_In_ ACCESS_MASK AccessMask,
|
|
|
|
_In_ PSID Sid
|
2005-06-20 18:54:47 +00:00
|
|
|
);
|
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 18:54:47 +00:00
|
|
|
RtlAddAccessDeniedAceEx(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Inout_ PACL Acl,
|
|
|
|
_In_ ULONG Revision,
|
|
|
|
_In_ ULONG Flags,
|
|
|
|
_In_ ACCESS_MASK AccessMask,
|
|
|
|
_In_ PSID Sid
|
2005-06-20 18:54:47 +00:00
|
|
|
);
|
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2006-05-10 09:32:23 +00:00
|
|
|
RtlAddAccessDeniedObjectAce(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Inout_ PACL pAcl,
|
|
|
|
_In_ ULONG dwAceRevision,
|
|
|
|
_In_ ULONG AceFlags,
|
|
|
|
_In_ ACCESS_MASK AccessMask,
|
|
|
|
_In_opt_ GUID *ObjectTypeGuid,
|
|
|
|
_In_opt_ GUID *InheritedObjectTypeGuid,
|
|
|
|
_In_ PSID pSid
|
2005-06-20 18:54:47 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 18:54:47 +00:00
|
|
|
RtlAddAce(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Inout_ PACL Acl,
|
|
|
|
_In_ ULONG AceRevision,
|
|
|
|
_In_ ULONG StartingAceIndex,
|
|
|
|
_In_reads_bytes_(AceListLength) PVOID AceList,
|
|
|
|
_In_ ULONG AceListLength
|
2005-06-20 18:54:47 +00:00
|
|
|
);
|
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 18:54:47 +00:00
|
|
|
RtlAddAuditAccessAce(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Inout_ PACL Acl,
|
|
|
|
_In_ ULONG Revision,
|
|
|
|
_In_ ACCESS_MASK AccessMask,
|
|
|
|
_In_ PSID Sid,
|
|
|
|
_In_ BOOLEAN Success,
|
|
|
|
_In_ BOOLEAN Failure
|
2005-06-20 18:54:47 +00:00
|
|
|
);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlAcquirePrivilege(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PULONG Privilege,
|
|
|
|
_In_ ULONG NumPriv,
|
|
|
|
_In_ ULONG Flags,
|
|
|
|
_Out_ PVOID *ReturnedState
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
|
|
|
|
2006-05-10 09:32:23 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlAddAuditAccessAceEx(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Inout_ PACL Acl,
|
|
|
|
_In_ ULONG Revision,
|
|
|
|
_In_ ULONG Flags,
|
|
|
|
_In_ ACCESS_MASK AccessMask,
|
|
|
|
_In_ PSID Sid,
|
|
|
|
_In_ BOOLEAN Success,
|
|
|
|
_In_ BOOLEAN Failure
|
2006-05-10 09:32:23 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlAddAuditAccessObjectAce(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Inout_ PACL Acl,
|
|
|
|
_In_ ULONG Revision,
|
|
|
|
_In_ ULONG Flags,
|
|
|
|
_In_ ACCESS_MASK AccessMask,
|
|
|
|
_In_opt_ GUID *ObjectTypeGuid,
|
|
|
|
_In_opt_ GUID *InheritedObjectTypeGuid,
|
|
|
|
_In_ PSID Sid,
|
|
|
|
_In_ BOOLEAN Success,
|
|
|
|
_In_ BOOLEAN Failure
|
2006-05-10 09:32:23 +00:00
|
|
|
);
|
|
|
|
|
2006-10-15 16:52:25 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlAddMandatoryAce(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Inout_ PACL Acl,
|
|
|
|
_In_ ULONG Revision,
|
|
|
|
_In_ ULONG Flags,
|
|
|
|
_In_ ULONG MandatoryFlags,
|
|
|
|
_In_ UCHAR AceType,
|
|
|
|
_In_ PSID LabelSid);
|
2006-10-15 16:52:25 +00:00
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-09-04 18:00:59 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-09-04 18:00:59 +00:00
|
|
|
RtlAdjustPrivilege(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG Privilege,
|
|
|
|
_In_ BOOLEAN NewValue,
|
|
|
|
_In_ BOOLEAN ForThread,
|
|
|
|
_Out_ PBOOLEAN OldValue
|
2005-09-04 18:00:59 +00:00
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_Must_inspect_result_
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-19 23:59:40 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlAllocateAndInitializeSid(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PSID_IDENTIFIER_AUTHORITY IdentifierAuthority,
|
|
|
|
_In_ UCHAR SubAuthorityCount,
|
|
|
|
_In_ ULONG SubAuthority0,
|
|
|
|
_In_ ULONG SubAuthority1,
|
|
|
|
_In_ ULONG SubAuthority2,
|
|
|
|
_In_ ULONG SubAuthority3,
|
|
|
|
_In_ ULONG SubAuthority4,
|
|
|
|
_In_ ULONG SubAuthority5,
|
|
|
|
_In_ ULONG SubAuthority6,
|
|
|
|
_In_ ULONG SubAuthority7,
|
|
|
|
_Outptr_ PSID *Sid
|
2005-06-19 23:59:40 +00:00
|
|
|
);
|
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
BOOLEAN
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 18:54:47 +00:00
|
|
|
RtlAreAllAccessesGranted(
|
|
|
|
ACCESS_MASK GrantedAccess,
|
|
|
|
ACCESS_MASK DesiredAccess
|
|
|
|
);
|
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
BOOLEAN
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 18:54:47 +00:00
|
|
|
RtlAreAnyAccessesGranted(
|
|
|
|
ACCESS_MASK GrantedAccess,
|
|
|
|
ACCESS_MASK DesiredAccess
|
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_IRQL_requires_max_(APC_LEVEL)
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2013-01-13 14:49:21 +00:00
|
|
|
RtlCopyLuid (
|
|
|
|
_Out_ PLUID DestinationLuid,
|
|
|
|
_In_ PLUID SourceLuid
|
|
|
|
);
|
2005-06-18 23:33:40 +00:00
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
RtlCopyLuidAndAttributesArray(
|
|
|
|
ULONG Count,
|
|
|
|
PLUID_AND_ATTRIBUTES Src,
|
|
|
|
PLUID_AND_ATTRIBUTES Dest
|
|
|
|
);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
RtlCopySidAndAttributesArray(
|
2016-11-04 17:52:32 +00:00
|
|
|
_In_ ULONG Count,
|
|
|
|
_In_ PSID_AND_ATTRIBUTES Src,
|
|
|
|
_In_ ULONG SidAreaSize,
|
|
|
|
_In_ PSID_AND_ATTRIBUTES Dest,
|
|
|
|
_In_ PSID SidArea,
|
|
|
|
_Out_ PSID* RemainingSidArea,
|
|
|
|
_Out_ PULONG RemainingSidAreaSize
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_IRQL_requires_max_(APC_LEVEL)
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlConvertSidToUnicodeString(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Inout_ PUNICODE_STRING UnicodeString,
|
|
|
|
_In_ PSID Sid,
|
|
|
|
_In_ BOOLEAN AllocateDestinationString
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_IRQL_requires_max_(APC_LEVEL)
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlCopySid(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG DestinationSidLength,
|
|
|
|
_Out_writes_bytes_(DestinationSidLength) PSID DestinationSid,
|
|
|
|
_In_ PSID SourceSid
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
RtlCreateAcl(
|
|
|
|
PACL Acl,
|
|
|
|
ULONG AclSize,
|
|
|
|
ULONG AclRevision
|
|
|
|
);
|
2005-06-19 19:36:05 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-19 23:59:40 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-19 23:59:40 +00:00
|
|
|
RtlCreateSecurityDescriptor(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Out_ PSECURITY_DESCRIPTOR SecurityDescriptor,
|
|
|
|
_In_ ULONG Revision
|
2005-06-19 23:59:40 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-19 23:59:40 +00:00
|
|
|
RtlCreateSecurityDescriptorRelative(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Out_ PISECURITY_DESCRIPTOR_RELATIVE SecurityDescriptor,
|
|
|
|
_In_ ULONG Revision
|
2005-06-19 23:59:40 +00:00
|
|
|
);
|
|
|
|
|
2007-10-23 21:42:03 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlCopySecurityDescriptor(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PSECURITY_DESCRIPTOR pSourceSecurityDescriptor,
|
|
|
|
_Out_ PSECURITY_DESCRIPTOR *pDestinationSecurityDescriptor
|
2007-10-23 21:42:03 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 18:54:47 +00:00
|
|
|
RtlDeleteAce(
|
|
|
|
PACL Acl,
|
|
|
|
ULONG AceIndex
|
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
BOOLEAN
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 18:54:47 +00:00
|
|
|
RtlEqualPrefixSid(
|
|
|
|
PSID Sid1,
|
|
|
|
PSID Sid2
|
|
|
|
);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
BOOLEAN
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlEqualSid (
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PSID Sid1,
|
|
|
|
_In_ PSID Sid2
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
BOOLEAN
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 18:54:47 +00:00
|
|
|
RtlFirstFreeAce(
|
|
|
|
PACL Acl,
|
|
|
|
PACE* Ace
|
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
PVOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2013-01-13 14:49:21 +00:00
|
|
|
RtlFreeSid(
|
|
|
|
_In_ _Post_invalid_ PSID Sid
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 18:54:47 +00:00
|
|
|
RtlGetAce(
|
|
|
|
PACL Acl,
|
|
|
|
ULONG AceIndex,
|
2005-09-05 18:06:20 +00:00
|
|
|
PVOID *Ace
|
2005-06-20 18:54:47 +00:00
|
|
|
);
|
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 18:54:47 +00:00
|
|
|
RtlGetControlSecurityDescriptor(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
|
|
|
|
_Out_ PSECURITY_DESCRIPTOR_CONTROL Control,
|
|
|
|
_Out_ PULONG Revision
|
2005-06-20 18:54:47 +00:00
|
|
|
);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlGetDaclSecurityDescriptor(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
|
|
|
|
_Out_ PBOOLEAN DaclPresent,
|
|
|
|
_Out_ PACL *Dacl,
|
|
|
|
_Out_ PBOOLEAN DaclDefaulted
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlGetSaclSecurityDescriptor(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
|
|
|
|
_Out_ PBOOLEAN SaclPresent,
|
|
|
|
_Out_ PACL* Sacl,
|
|
|
|
_Out_ PBOOLEAN SaclDefaulted
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlGetGroupSecurityDescriptor(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
|
|
|
|
_Out_ PSID *Group,
|
|
|
|
_Out_ PBOOLEAN GroupDefaulted
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlGetOwnerSecurityDescriptor(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
|
|
|
|
_Out_ PSID *Owner,
|
|
|
|
_Out_ PBOOLEAN OwnerDefaulted
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
BOOLEAN
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 18:54:47 +00:00
|
|
|
RtlGetSecurityDescriptorRMControl(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
|
|
|
|
_Out_ PUCHAR RMControl
|
2005-06-20 18:54:47 +00:00
|
|
|
);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
PSID_IDENTIFIER_AUTHORITY
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 18:54:47 +00:00
|
|
|
RtlIdentifierAuthoritySid(PSID Sid);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 18:54:47 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 18:54:47 +00:00
|
|
|
RtlImpersonateSelf(IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_IRQL_requires_max_(APC_LEVEL)
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlInitializeSid(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Out_ PSID Sid,
|
|
|
|
_In_ PSID_IDENTIFIER_AUTHORITY IdentifierAuthority,
|
|
|
|
_In_ UCHAR SubAuthorityCount
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
ULONG
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
|
|
|
RtlLengthRequiredSid(IN ULONG SubAuthorityCount);
|
2005-06-20 05:36:32 +00:00
|
|
|
|
2016-08-21 21:31:40 +00:00
|
|
|
_IRQL_requires_max_(APC_LEVEL)
|
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
RtlLengthSecurityDescriptor(
|
|
|
|
_In_ PSECURITY_DESCRIPTOR SecurityDescriptor);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
ULONG
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlLengthSid(IN PSID Sid);
|
|
|
|
|
2005-12-20 23:16:09 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlMakeSelfRelativeSD(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PSECURITY_DESCRIPTOR AbsoluteSD,
|
|
|
|
_Out_ PSECURITY_DESCRIPTOR SelfRelativeSD,
|
|
|
|
_Inout_ PULONG BufferLength);
|
2005-12-20 23:16:09 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 21:16:59 +00:00
|
|
|
RtlMapGenericMask(
|
|
|
|
PACCESS_MASK AccessMask,
|
|
|
|
PGENERIC_MAPPING GenericMapping
|
|
|
|
);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2008-12-01 15:12:23 +00:00
|
|
|
#ifdef NTOS_MODE_USER
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 18:54:47 +00:00
|
|
|
RtlQueryInformationAcl(
|
|
|
|
PACL Acl,
|
|
|
|
PVOID Information,
|
|
|
|
ULONG InformationLength,
|
|
|
|
ACL_INFORMATION_CLASS InformationClass
|
|
|
|
);
|
2005-06-20 05:36:32 +00:00
|
|
|
|
2008-12-01 15:12:23 +00:00
|
|
|
#endif
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlReleasePrivilege(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID ReturnedState
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
|
|
|
|
2022-10-05 12:31:39 +00:00
|
|
|
#if (NTDDI_VERSION >= NTDDI_VISTA)
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlRemovePrivileges(
|
|
|
|
_In_ HANDLE TokenHandle,
|
|
|
|
_In_reads_opt_(PrivilegeCount) _When_(PrivilegeCount != 0, _Notnull_)
|
|
|
|
PULONG PrivilegesToKeep,
|
|
|
|
_In_ ULONG PrivilegeCount
|
|
|
|
);
|
|
|
|
|
|
|
|
#endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
|
|
|
|
|
2013-01-19 21:49:12 +00:00
|
|
|
_IRQL_requires_max_(APC_LEVEL)
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlSelfRelativeToAbsoluteSD(
|
2013-01-19 21:49:12 +00:00
|
|
|
_In_ PSECURITY_DESCRIPTOR SelfRelativeSecurityDescriptor,
|
|
|
|
_Out_writes_bytes_to_opt_(*AbsoluteSecurityDescriptorSize, *AbsoluteSecurityDescriptorSize) PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor,
|
|
|
|
_Inout_ PULONG AbsoluteSecurityDescriptorSize,
|
|
|
|
_Out_writes_bytes_to_opt_(*DaclSize, *DaclSize) PACL Dacl,
|
|
|
|
_Inout_ PULONG DaclSize,
|
|
|
|
_Out_writes_bytes_to_opt_(*SaclSize, *SaclSize) PACL Sacl,
|
|
|
|
_Inout_ PULONG SaclSize,
|
|
|
|
_Out_writes_bytes_to_opt_(*OwnerSize, *OwnerSize) PSID Owner,
|
|
|
|
_Inout_ PULONG OwnerSize,
|
|
|
|
_Out_writes_bytes_to_opt_(*PrimaryGroupSize, *PrimaryGroupSize) PSID PrimaryGroup,
|
|
|
|
_Inout_ PULONG PrimaryGroupSize
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2005-10-23 18:23:57 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlSelfRelativeToAbsoluteSD2(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Inout_ PSECURITY_DESCRIPTOR SelfRelativeSD,
|
|
|
|
_Out_ PULONG BufferSize
|
2005-10-23 18:23:57 +00:00
|
|
|
);
|
|
|
|
|
2005-12-21 19:07:47 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlSetAttributesSecurityDescriptor(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Inout_ PSECURITY_DESCRIPTOR SecurityDescriptor,
|
|
|
|
_In_ SECURITY_DESCRIPTOR_CONTROL Control,
|
|
|
|
_Out_ PULONG Revision
|
2005-12-21 19:07:47 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 18:54:47 +00:00
|
|
|
RtlSetControlSecurityDescriptor(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
|
|
|
|
_In_ SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest,
|
|
|
|
_In_ SECURITY_DESCRIPTOR_CONTROL ControlBitsToSet
|
2005-06-20 18:54:47 +00:00
|
|
|
);
|
2005-06-20 05:36:32 +00:00
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_IRQL_requires_max_(APC_LEVEL)
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2013-01-13 14:49:21 +00:00
|
|
|
RtlSetDaclSecurityDescriptor(
|
|
|
|
_Inout_ PSECURITY_DESCRIPTOR SecurityDescriptor,
|
|
|
|
_In_ BOOLEAN DaclPresent,
|
|
|
|
_In_opt_ PACL Dacl,
|
|
|
|
_In_opt_ BOOLEAN DaclDefaulted
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2013-01-19 21:49:12 +00:00
|
|
|
_IRQL_requires_max_(APC_LEVEL)
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlSetGroupSecurityDescriptor(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Inout_ PSECURITY_DESCRIPTOR SecurityDescriptor,
|
2013-01-19 21:49:12 +00:00
|
|
|
_In_opt_ PSID Group,
|
|
|
|
_In_opt_ BOOLEAN GroupDefaulted
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2008-12-01 15:12:23 +00:00
|
|
|
#ifdef NTOS_MODE_USER
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 18:54:47 +00:00
|
|
|
RtlSetInformationAcl(
|
|
|
|
PACL Acl,
|
|
|
|
PVOID Information,
|
|
|
|
ULONG InformationLength,
|
|
|
|
ACL_INFORMATION_CLASS InformationClass
|
|
|
|
);
|
|
|
|
|
2008-12-01 15:12:23 +00:00
|
|
|
#endif
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_IRQL_requires_max_(APC_LEVEL)
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlSetOwnerSecurityDescriptor(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Inout_ PSECURITY_DESCRIPTOR SecurityDescriptor,
|
|
|
|
_In_opt_ PSID Owner,
|
|
|
|
_In_opt_ BOOLEAN OwnerDefaulted
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlSetSaclSecurityDescriptor(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Inout_ PSECURITY_DESCRIPTOR SecurityDescriptor,
|
|
|
|
_In_ BOOLEAN SaclPresent,
|
|
|
|
_In_ PACL Sacl,
|
|
|
|
_In_ BOOLEAN SaclDefaulted
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 18:54:47 +00:00
|
|
|
RtlSetSecurityDescriptorRMControl(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Inout_ PSECURITY_DESCRIPTOR SecurityDescriptor,
|
|
|
|
_In_ PUCHAR RMControl
|
2005-06-20 18:54:47 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
PUCHAR
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlSubAuthorityCountSid(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PSID Sid
|
2005-06-20 05:36:32 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
PULONG
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlSubAuthoritySid(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PSID Sid,
|
|
|
|
_In_ ULONG SubAuthority
|
2005-06-20 05:36:32 +00:00
|
|
|
);
|
2005-06-18 23:33:40 +00:00
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_IRQL_requires_max_(APC_LEVEL)
|
|
|
|
_Must_inspect_result_
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 18:54:47 +00:00
|
|
|
BOOLEAN
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 18:54:47 +00:00
|
|
|
RtlValidRelativeSecurityDescriptor(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_reads_bytes_(SecurityDescriptorLength) PSECURITY_DESCRIPTOR SecurityDescriptorInput,
|
|
|
|
_In_ ULONG SecurityDescriptorLength,
|
|
|
|
_In_ SECURITY_INFORMATION RequiredInformation
|
2005-06-20 18:54:47 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
BOOLEAN
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 18:54:47 +00:00
|
|
|
RtlValidSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
BOOLEAN
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlValidSid(IN PSID Sid);
|
2005-06-18 23:33:40 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
BOOLEAN
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlValidAcl(PACL Acl);
|
2005-06-20 04:07:34 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-27 21:11:29 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-27 21:11:29 +00:00
|
|
|
RtlDeleteSecurityObject(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PSECURITY_DESCRIPTOR *ObjectDescriptor
|
2005-06-27 21:11:29 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-27 21:11:29 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-27 21:11:29 +00:00
|
|
|
RtlNewSecurityObject(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PSECURITY_DESCRIPTOR ParentDescriptor,
|
|
|
|
_In_ PSECURITY_DESCRIPTOR CreatorDescriptor,
|
|
|
|
_Out_ PSECURITY_DESCRIPTOR *NewDescriptor,
|
|
|
|
_In_ BOOLEAN IsDirectoryObject,
|
|
|
|
_In_ HANDLE Token,
|
|
|
|
_In_ PGENERIC_MAPPING GenericMapping
|
2005-06-27 21:11:29 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-27 21:11:29 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-27 21:11:29 +00:00
|
|
|
RtlQuerySecurityObject(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PSECURITY_DESCRIPTOR ObjectDescriptor,
|
|
|
|
_In_ SECURITY_INFORMATION SecurityInformation,
|
|
|
|
_Out_ PSECURITY_DESCRIPTOR ResultantDescriptor,
|
|
|
|
_In_ ULONG DescriptorLength,
|
|
|
|
_Out_ PULONG ReturnLength
|
2005-06-27 21:11:29 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-27 21:11:29 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-27 21:11:29 +00:00
|
|
|
RtlSetSecurityObject(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ SECURITY_INFORMATION SecurityInformation,
|
|
|
|
_In_ PSECURITY_DESCRIPTOR ModificationDescriptor,
|
|
|
|
_Out_ PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor,
|
|
|
|
_In_ PGENERIC_MAPPING GenericMapping,
|
|
|
|
_In_ HANDLE Token
|
2005-06-27 21:11:29 +00:00
|
|
|
);
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Single-Character Functions
|
|
|
|
//
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlLargeIntegerToChar(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PLARGE_INTEGER Value,
|
|
|
|
_In_ ULONG Base,
|
|
|
|
_In_ ULONG Length,
|
2013-01-22 22:51:51 +00:00
|
|
|
_Out_ PCHAR String
|
2005-06-20 05:36:32 +00:00
|
|
|
);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
CHAR
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlUpperChar(CHAR Source);
|
2005-06-20 04:07:34 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
WCHAR
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlUpcaseUnicodeChar(WCHAR Source);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
WCHAR
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlDowncaseUnicodeChar(IN WCHAR Source);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlIntegerToChar(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG Value,
|
|
|
|
_In_ ULONG Base,
|
|
|
|
_In_ ULONG Length,
|
2013-01-19 21:49:12 +00:00
|
|
|
_Out_ PCHAR String
|
2005-06-20 05:36:32 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlIntegerToUnicode(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG Value,
|
|
|
|
_In_opt_ ULONG Base,
|
|
|
|
_In_opt_ ULONG Length,
|
|
|
|
_Inout_ LPWSTR String
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
|
|
|
_At_(String->MaximumLength, _Const_)
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlIntegerToUnicodeString(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG Value,
|
|
|
|
_In_opt_ ULONG Base,
|
|
|
|
_Inout_ PUNICODE_STRING String
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlCharToInteger(
|
|
|
|
PCSZ String,
|
|
|
|
ULONG Base,
|
|
|
|
PULONG Value
|
|
|
|
);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Byte Swap Functions
|
|
|
|
//
|
2009-02-06 13:04:18 +00:00
|
|
|
#ifdef NTOS_MODE_USER
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
unsigned short __cdecl _byteswap_ushort(unsigned short);
|
|
|
|
unsigned long __cdecl _byteswap_ulong (unsigned long);
|
|
|
|
unsigned __int64 __cdecl _byteswap_uint64(unsigned __int64);
|
2015-05-02 22:19:47 +00:00
|
|
|
#ifdef _MSC_VER
|
2005-09-05 18:06:20 +00:00
|
|
|
#pragma intrinsic(_byteswap_ushort)
|
|
|
|
#pragma intrinsic(_byteswap_ulong)
|
|
|
|
#pragma intrinsic(_byteswap_uint64)
|
2015-05-02 22:19:47 +00:00
|
|
|
#endif // _MSC_VER
|
2005-09-05 18:06:20 +00:00
|
|
|
#define RtlUshortByteSwap(_x) _byteswap_ushort((USHORT)(_x))
|
|
|
|
#define RtlUlongByteSwap(_x) _byteswap_ulong((_x))
|
|
|
|
#define RtlUlonglongByteSwap(_x) _byteswap_uint64((_x))
|
2005-11-22 04:57:45 +00:00
|
|
|
|
2009-02-06 13:04:18 +00:00
|
|
|
#endif // NTOS_MODE_USER
|
2005-09-05 18:06:20 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Unicode->Ansi String Functions
|
|
|
|
//
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
ULONG
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-09-06 17:33:56 +00:00
|
|
|
RtlxUnicodeStringToAnsiSize(IN PCUNICODE_STRING UnicodeString);
|
|
|
|
|
|
|
|
#ifdef NTOS_MODE_USER
|
2005-11-22 04:57:45 +00:00
|
|
|
|
2005-09-06 17:33:56 +00:00
|
|
|
#define RtlUnicodeStringToAnsiSize(STRING) ( \
|
|
|
|
NLS_MB_CODE_PAGE_TAG ? \
|
|
|
|
RtlxUnicodeStringToAnsiSize(STRING) : \
|
|
|
|
((STRING)->Length + sizeof(UNICODE_NULL)) / sizeof(WCHAR) \
|
|
|
|
)
|
2005-11-22 04:57:45 +00:00
|
|
|
|
2005-09-06 17:33:56 +00:00
|
|
|
#endif
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlUnicodeStringToAnsiString(
|
|
|
|
PANSI_STRING DestinationString,
|
2005-09-05 18:06:20 +00:00
|
|
|
PCUNICODE_STRING SourceString,
|
2005-06-20 05:36:32 +00:00
|
|
|
BOOLEAN AllocateDestinationString
|
|
|
|
);
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Unicode->OEM String Functions
|
|
|
|
//
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlUpcaseUnicodeStringToOemString(
|
|
|
|
POEM_STRING DestinationString,
|
2005-09-05 18:06:20 +00:00
|
|
|
PCUNICODE_STRING SourceString,
|
2005-06-20 05:36:32 +00:00
|
|
|
BOOLEAN AllocateDestinationString
|
|
|
|
);
|
2005-06-20 03:55:42 +00:00
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
|
|
|
_Must_inspect_result_
|
2013-01-19 21:49:12 +00:00
|
|
|
//_At_(DestinationString->Buffer, _Post_bytecount_(DestinationString->Length))
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlUpcaseUnicodeStringToCountedOemString(
|
2013-01-13 14:49:21 +00:00
|
|
|
_When_(AllocateDestinationString, _Out_ _At_(DestinationString->Buffer, __drv_allocatesMem(Mem)))
|
|
|
|
_When_(!AllocateDestinationString, _Inout_)
|
|
|
|
POEM_STRING DestinationString,
|
|
|
|
_In_ PCUNICODE_STRING SourceString,
|
|
|
|
_In_ BOOLEAN AllocateDestinationString
|
2005-06-20 05:36:32 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-19 23:59:40 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlUnicodeStringToOemString(
|
|
|
|
POEM_STRING DestinationString,
|
2005-09-05 18:06:20 +00:00
|
|
|
PCUNICODE_STRING SourceString,
|
2005-06-20 05:36:32 +00:00
|
|
|
BOOLEAN AllocateDestinationString
|
|
|
|
);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2021-05-18 21:07:07 +00:00
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
|
|
|
_Must_inspect_result_
|
2021-05-12 21:31:20 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlUnicodeStringToCountedOemString(
|
2021-05-18 21:07:07 +00:00
|
|
|
_When_(AllocateDestinationString, _Out_ _At_(DestinationString->Buffer, __drv_allocatesMem(Mem)))
|
|
|
|
_When_(!AllocateDestinationString, _Inout_)
|
|
|
|
POEM_STRING DestinationString,
|
|
|
|
_In_ PCUNICODE_STRING SourceString,
|
|
|
|
_In_ BOOLEAN AllocateDestinationString
|
|
|
|
);
|
2021-05-12 21:31:20 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-19 19:36:05 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlUpcaseUnicodeToOemN(
|
|
|
|
PCHAR OemString,
|
|
|
|
ULONG OemSize,
|
|
|
|
PULONG ResultSize,
|
[FREELDR] Define _BLDR_ for WDK header compatibility
[HAL] Define _NTHALDLL_ for WDK header compatibility, get rif of DECLSPEC_IMPORT header hack
[NDK/RTL] Fix some Rtl prototypes (PCHAR -> PCCH)
[NDK] Fix ZwOpenEvent prototype
[NTIFS] Fix definition of NTKERNELAPI, move some types, fix PRTL_ALLOCATE_STRING_ROUTINE, PRTL_REALLOCATE_STRING_ROUTINE, PRTL_FREE_STRING_ROUTINE, define CTL_CODE, DEVICE_TYPE_FROM_CTL_CODE, FILE_ANY_ACCESS, FILE_SPECIAL_ACCESS, FILE_READ_ACCESS, FILE_WRITE_ACCESS identical to wdm.h, remove duplicate RtlGenerate8dot3Name, remove ZwOpenEvent
[NTPOAPI] Guard some types with #ifndef _PO_DDK_
[WDM] Create reactos compatible definition of NTKERNELAPI, add KDPC_WATCHDOG_INFORMATION, BATTERY_REPORTING_SCALE, fix ALIGN_UP_POINTER_BY, guard some types with #ifndef _PO_DDK_, update POWER_INFORMATION_LEVEL, make some FILE_DEVICE_ definitions identical to ntifs.h, fix HalAllocateCommonBuffer
svn path=/branches/header-work/; revision=46050
2010-03-10 04:16:52 +00:00
|
|
|
PCWCH UnicodeString,
|
2005-06-20 05:36:32 +00:00
|
|
|
ULONG UnicodeSize
|
|
|
|
);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
ULONG
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-09-06 17:33:56 +00:00
|
|
|
RtlxUnicodeStringToOemSize(IN PCUNICODE_STRING UnicodeString);
|
|
|
|
|
|
|
|
#ifdef NTOS_MODE_USER
|
2005-11-22 04:57:45 +00:00
|
|
|
|
|
|
|
#define RtlUnicodeStringToOemSize(STRING) ( \
|
|
|
|
NLS_MB_OEM_CODE_PAGE_TAG ? \
|
|
|
|
RtlxUnicodeStringToOemSize(STRING) : \
|
|
|
|
((STRING)->Length + sizeof(UNICODE_NULL)) / sizeof(WCHAR) \
|
2005-09-06 17:33:56 +00:00
|
|
|
)
|
2005-11-22 04:57:45 +00:00
|
|
|
|
|
|
|
#define RtlUnicodeStringToCountedOemSize(STRING) ( \
|
|
|
|
(ULONG)(RtlUnicodeStringToOemSize(STRING) - sizeof(ANSI_NULL)) \
|
2005-09-06 17:33:56 +00:00
|
|
|
)
|
2005-11-22 04:57:45 +00:00
|
|
|
|
2005-09-06 17:33:56 +00:00
|
|
|
#endif
|
2005-06-18 23:33:40 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlUnicodeToOemN(
|
|
|
|
PCHAR OemString,
|
|
|
|
ULONG OemSize,
|
|
|
|
PULONG ResultSize,
|
[FREELDR] Define _BLDR_ for WDK header compatibility
[HAL] Define _NTHALDLL_ for WDK header compatibility, get rif of DECLSPEC_IMPORT header hack
[NDK/RTL] Fix some Rtl prototypes (PCHAR -> PCCH)
[NDK] Fix ZwOpenEvent prototype
[NTIFS] Fix definition of NTKERNELAPI, move some types, fix PRTL_ALLOCATE_STRING_ROUTINE, PRTL_REALLOCATE_STRING_ROUTINE, PRTL_FREE_STRING_ROUTINE, define CTL_CODE, DEVICE_TYPE_FROM_CTL_CODE, FILE_ANY_ACCESS, FILE_SPECIAL_ACCESS, FILE_READ_ACCESS, FILE_WRITE_ACCESS identical to wdm.h, remove duplicate RtlGenerate8dot3Name, remove ZwOpenEvent
[NTPOAPI] Guard some types with #ifndef _PO_DDK_
[WDM] Create reactos compatible definition of NTKERNELAPI, add KDPC_WATCHDOG_INFORMATION, BATTERY_REPORTING_SCALE, fix ALIGN_UP_POINTER_BY, guard some types with #ifndef _PO_DDK_, update POWER_INFORMATION_LEVEL, make some FILE_DEVICE_ definitions identical to ntifs.h, fix HalAllocateCommonBuffer
svn path=/branches/header-work/; revision=46050
2010-03-10 04:16:52 +00:00
|
|
|
PCWCH UnicodeString,
|
2005-06-20 05:36:32 +00:00
|
|
|
ULONG UnicodeSize
|
|
|
|
);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Unicode->MultiByte String Functions
|
|
|
|
//
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlUnicodeToMultiByteN(
|
|
|
|
PCHAR MbString,
|
|
|
|
ULONG MbSize,
|
|
|
|
PULONG ResultSize,
|
2012-01-24 21:15:55 +00:00
|
|
|
PCWCH UnicodeString,
|
2005-06-20 05:36:32 +00:00
|
|
|
ULONG UnicodeSize
|
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlUpcaseUnicodeToMultiByteN(
|
|
|
|
PCHAR MbString,
|
|
|
|
ULONG MbSize,
|
|
|
|
PULONG ResultSize,
|
[FREELDR] Define _BLDR_ for WDK header compatibility
[HAL] Define _NTHALDLL_ for WDK header compatibility, get rif of DECLSPEC_IMPORT header hack
[NDK/RTL] Fix some Rtl prototypes (PCHAR -> PCCH)
[NDK] Fix ZwOpenEvent prototype
[NTIFS] Fix definition of NTKERNELAPI, move some types, fix PRTL_ALLOCATE_STRING_ROUTINE, PRTL_REALLOCATE_STRING_ROUTINE, PRTL_FREE_STRING_ROUTINE, define CTL_CODE, DEVICE_TYPE_FROM_CTL_CODE, FILE_ANY_ACCESS, FILE_SPECIAL_ACCESS, FILE_READ_ACCESS, FILE_WRITE_ACCESS identical to wdm.h, remove duplicate RtlGenerate8dot3Name, remove ZwOpenEvent
[NTPOAPI] Guard some types with #ifndef _PO_DDK_
[WDM] Create reactos compatible definition of NTKERNELAPI, add KDPC_WATCHDOG_INFORMATION, BATTERY_REPORTING_SCALE, fix ALIGN_UP_POINTER_BY, guard some types with #ifndef _PO_DDK_, update POWER_INFORMATION_LEVEL, make some FILE_DEVICE_ definitions identical to ntifs.h, fix HalAllocateCommonBuffer
svn path=/branches/header-work/; revision=46050
2010-03-10 04:16:52 +00:00
|
|
|
PCWCH UnicodeString,
|
2005-06-20 05:36:32 +00:00
|
|
|
ULONG UnicodeSize
|
|
|
|
);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlUnicodeToMultiByteSize(
|
|
|
|
PULONG MbSize,
|
[FREELDR] Define _BLDR_ for WDK header compatibility
[HAL] Define _NTHALDLL_ for WDK header compatibility, get rif of DECLSPEC_IMPORT header hack
[NDK/RTL] Fix some Rtl prototypes (PCHAR -> PCCH)
[NDK] Fix ZwOpenEvent prototype
[NTIFS] Fix definition of NTKERNELAPI, move some types, fix PRTL_ALLOCATE_STRING_ROUTINE, PRTL_REALLOCATE_STRING_ROUTINE, PRTL_FREE_STRING_ROUTINE, define CTL_CODE, DEVICE_TYPE_FROM_CTL_CODE, FILE_ANY_ACCESS, FILE_SPECIAL_ACCESS, FILE_READ_ACCESS, FILE_WRITE_ACCESS identical to wdm.h, remove duplicate RtlGenerate8dot3Name, remove ZwOpenEvent
[NTPOAPI] Guard some types with #ifndef _PO_DDK_
[WDM] Create reactos compatible definition of NTKERNELAPI, add KDPC_WATCHDOG_INFORMATION, BATTERY_REPORTING_SCALE, fix ALIGN_UP_POINTER_BY, guard some types with #ifndef _PO_DDK_, update POWER_INFORMATION_LEVEL, make some FILE_DEVICE_ definitions identical to ntifs.h, fix HalAllocateCommonBuffer
svn path=/branches/header-work/; revision=46050
2010-03-10 04:16:52 +00:00
|
|
|
PCWCH UnicodeString,
|
2005-06-20 05:36:32 +00:00
|
|
|
ULONG UnicodeSize
|
|
|
|
);
|
2005-06-18 23:33:40 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
ULONG
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-09-06 17:33:56 +00:00
|
|
|
RtlxOemStringToUnicodeSize(IN PCOEM_STRING OemString);
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// OEM to Unicode Functions
|
|
|
|
//
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlOemStringToUnicodeString(
|
|
|
|
PUNICODE_STRING DestinationString,
|
2006-03-17 10:51:45 +00:00
|
|
|
PCOEM_STRING SourceString,
|
2005-06-20 05:36:32 +00:00
|
|
|
BOOLEAN AllocateDestinationString
|
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-19 20:01:07 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlOemToUnicodeN(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Out_writes_bytes_to_(MaxBytesInUnicodeString, *BytesInUnicodeString) PWCH UnicodeString,
|
|
|
|
_In_ ULONG MaxBytesInUnicodeString,
|
|
|
|
_Out_opt_ PULONG BytesInUnicodeString,
|
|
|
|
_In_reads_bytes_(BytesInOemString) PCCH OemString,
|
|
|
|
_In_ ULONG BytesInOemString
|
2005-06-20 05:36:32 +00:00
|
|
|
);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
#ifdef NTOS_MODE_USER
|
|
|
|
|
|
|
|
#define RtlOemStringToUnicodeSize(STRING) ( \
|
|
|
|
NLS_MB_OEM_CODE_PAGE_TAG ? \
|
|
|
|
RtlxOemStringToUnicodeSize(STRING) : \
|
|
|
|
((STRING)->Length + sizeof(ANSI_NULL)) * sizeof(WCHAR) \
|
|
|
|
)
|
|
|
|
|
|
|
|
#define RtlOemStringToCountedUnicodeSize(STRING) ( \
|
|
|
|
(ULONG)(RtlOemStringToUnicodeSize(STRING) - sizeof(UNICODE_NULL)) \
|
|
|
|
)
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//
|
|
|
|
// Ansi->Unicode String Functions
|
|
|
|
//
|
2015-07-11 00:18:30 +00:00
|
|
|
_IRQL_requires_max_(APC_LEVEL)
|
2005-09-23 07:19:47 +00:00
|
|
|
NTSYSAPI
|
2015-07-11 00:18:30 +00:00
|
|
|
WCHAR
|
2005-09-23 07:19:47 +00:00
|
|
|
NTAPI
|
2015-07-11 00:18:30 +00:00
|
|
|
RtlAnsiCharToUnicodeChar(
|
|
|
|
_Inout_ PUCHAR *SourceCharacter);
|
2005-09-23 07:19:47 +00:00
|
|
|
|
2005-09-06 05:58:48 +00:00
|
|
|
NTSYSAPI
|
2005-06-19 19:36:05 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlAnsiStringToUnicodeString(
|
|
|
|
PUNICODE_STRING DestinationString,
|
2005-09-05 18:06:20 +00:00
|
|
|
PCANSI_STRING SourceString,
|
2005-06-20 05:36:32 +00:00
|
|
|
BOOLEAN AllocateDestinationString
|
|
|
|
);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2015-07-11 00:18:30 +00:00
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
RtlxAnsiStringToUnicodeSize(
|
|
|
|
PCANSI_STRING AnsiString
|
|
|
|
);
|
|
|
|
|
2005-09-06 17:33:56 +00:00
|
|
|
#ifdef NTOS_MODE_USER
|
2005-11-22 04:57:45 +00:00
|
|
|
|
|
|
|
#define RtlAnsiStringToUnicodeSize(STRING) ( \
|
|
|
|
NLS_MB_CODE_PAGE_TAG ? \
|
|
|
|
RtlxAnsiStringToUnicodeSize(STRING) : \
|
|
|
|
((STRING)->Length + sizeof(ANSI_NULL)) * sizeof(WCHAR) \
|
2005-09-06 17:33:56 +00:00
|
|
|
)
|
2005-11-22 04:57:45 +00:00
|
|
|
|
2005-09-06 17:33:56 +00:00
|
|
|
#endif
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
BOOLEAN
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlCreateUnicodeStringFromAsciiz(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Out_ PUNICODE_STRING Destination,
|
|
|
|
_In_ PCSZ Source
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Unicode String Functions
|
|
|
|
//
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlAppendUnicodeToString(
|
|
|
|
PUNICODE_STRING Destination,
|
|
|
|
PCWSTR Source
|
2005-06-19 23:59:40 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlAppendUnicodeStringToString(
|
|
|
|
PUNICODE_STRING Destination,
|
2005-09-05 18:06:20 +00:00
|
|
|
PCUNICODE_STRING Source
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
LONG
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlCompareUnicodeString(
|
2005-09-05 18:06:20 +00:00
|
|
|
PCUNICODE_STRING String1,
|
|
|
|
PCUNICODE_STRING String2,
|
2005-06-20 05:36:32 +00:00
|
|
|
BOOLEAN CaseInsensitive
|
2005-06-19 23:59:40 +00:00
|
|
|
);
|
|
|
|
|
2023-08-13 12:43:10 +00:00
|
|
|
_Must_inspect_result_
|
|
|
|
NTSYSAPI
|
|
|
|
LONG
|
|
|
|
NTAPI
|
|
|
|
RtlCompareUnicodeStrings(
|
|
|
|
_In_reads_(String1Length) PCWCH String1,
|
|
|
|
_In_ SIZE_T String1Length,
|
|
|
|
_In_reads_(String2Length) PCWCH String2,
|
|
|
|
_In_ SIZE_T String2Length,
|
|
|
|
_In_ BOOLEAN CaseInSensitive
|
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlCopyUnicodeString(
|
|
|
|
PUNICODE_STRING DestinationString,
|
2005-09-05 18:06:20 +00:00
|
|
|
PCUNICODE_STRING SourceString
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
BOOLEAN
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlCreateUnicodeString(
|
|
|
|
PUNICODE_STRING DestinationString,
|
|
|
|
PCWSTR SourceString
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2005-09-06 05:58:48 +00:00
|
|
|
#ifdef NTOS_MODE_USER
|
2005-11-22 04:57:45 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-07-22 22:25:25 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-07-22 22:25:25 +00:00
|
|
|
RtlDowncaseUnicodeString(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Inout_ PUNICODE_STRING UniDest,
|
|
|
|
_In_ PCUNICODE_STRING UniSource,
|
|
|
|
_In_ BOOLEAN AllocateDestinationString
|
2005-07-20 02:52:52 +00:00
|
|
|
);
|
2005-11-22 04:57:45 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-07-22 22:25:25 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-07-22 22:25:25 +00:00
|
|
|
RtlDuplicateUnicodeString(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG Flags,
|
|
|
|
_In_ PCUNICODE_STRING SourceString,
|
|
|
|
_Out_ PUNICODE_STRING DestinationString
|
2005-07-22 22:25:25 +00:00
|
|
|
);
|
|
|
|
|
2019-12-29 12:44:59 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlFindCharInUnicodeString(
|
|
|
|
_In_ ULONG Flags,
|
|
|
|
_In_ PCUNICODE_STRING SearchString,
|
|
|
|
_In_ PCUNICODE_STRING MatchString,
|
|
|
|
_Out_ PUSHORT Position
|
|
|
|
);
|
|
|
|
|
2010-03-29 03:16:25 +00:00
|
|
|
//
|
|
|
|
// Memory Functions
|
|
|
|
//
|
2019-09-23 11:57:32 +00:00
|
|
|
#if defined(_M_AMD64)
|
|
|
|
|
|
|
|
FORCEINLINE
|
|
|
|
VOID
|
|
|
|
RtlFillMemoryUlong(
|
|
|
|
_Out_writes_bytes_all_(Length) PVOID Destination,
|
|
|
|
_In_ SIZE_T Length,
|
|
|
|
_In_ ULONG Pattern)
|
|
|
|
{
|
|
|
|
PULONG Address = (PULONG)Destination;
|
|
|
|
if ((Length /= 4) != 0) {
|
|
|
|
if (((ULONG64)Address & 4) != 0) {
|
|
|
|
*Address = Pattern;
|
|
|
|
if ((Length -= 1) == 0) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
Address += 1;
|
|
|
|
}
|
|
|
|
__stosq((PULONG64)(Address), Pattern | ((ULONG64)Pattern << 32), Length / 2);
|
|
|
|
if ((Length & 1) != 0) Address[Length - 1] = Pattern;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
#define RtlFillMemoryUlonglong(Destination, Length, Pattern) \
|
|
|
|
__stosq((PULONG64)(Destination), Pattern, (Length) / 8)
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
2010-03-29 03:16:25 +00:00
|
|
|
NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlFillMemoryUlong(
|
2019-09-23 11:57:32 +00:00
|
|
|
_Out_writes_bytes_all_(Length) PVOID Destination,
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ SIZE_T Length,
|
2019-09-23 11:57:32 +00:00
|
|
|
_In_ ULONG Pattern
|
2010-03-29 03:16:25 +00:00
|
|
|
);
|
|
|
|
|
2012-01-24 21:15:55 +00:00
|
|
|
NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlFillMemoryUlonglong(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Out_ PVOID Destination,
|
|
|
|
_In_ SIZE_T Length,
|
|
|
|
_In_ ULONGLONG Pattern
|
2012-01-24 21:15:55 +00:00
|
|
|
);
|
|
|
|
|
2019-09-23 11:57:32 +00:00
|
|
|
#endif
|
|
|
|
|
2015-06-21 19:15:01 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlCopyMappedMemory(
|
|
|
|
_Out_writes_bytes_all_(Size) PVOID Destination,
|
|
|
|
_In_reads_bytes_(Size) const VOID *Source,
|
|
|
|
_In_ SIZE_T Size
|
|
|
|
);
|
2012-01-24 21:15:55 +00:00
|
|
|
|
2011-08-05 09:36:32 +00:00
|
|
|
NTSYSAPI
|
|
|
|
SIZE_T
|
|
|
|
NTAPI
|
|
|
|
RtlCompareMemoryUlong(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID Source,
|
|
|
|
_In_ SIZE_T Length,
|
|
|
|
_In_ ULONG Pattern
|
2011-08-05 09:36:32 +00:00
|
|
|
);
|
|
|
|
|
2015-03-14 22:11:20 +00:00
|
|
|
#ifndef RtlEqualMemory
|
2012-10-04 17:08:51 +00:00
|
|
|
#define RtlEqualMemory(Destination, Source, Length) \
|
|
|
|
(!memcmp(Destination, Source, Length))
|
2015-03-14 22:11:20 +00:00
|
|
|
#endif
|
2012-10-04 17:08:51 +00:00
|
|
|
|
2011-08-05 09:36:32 +00:00
|
|
|
#define RtlCopyBytes RtlCopyMemory
|
|
|
|
#define RtlFillBytes RtlFillMemory
|
|
|
|
#define RtlZeroBytes RtlZeroMemory
|
|
|
|
|
2008-06-02 10:21:49 +00:00
|
|
|
#endif
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
BOOLEAN
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlEqualUnicodeString(
|
|
|
|
PCUNICODE_STRING String1,
|
|
|
|
PCUNICODE_STRING String2,
|
|
|
|
BOOLEAN CaseInsensitive
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2013-11-16 12:02:17 +00:00
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
|
|
|
NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlFreeUnicodeString(
|
|
|
|
_Inout_ _At_(UnicodeString->Buffer, __drv_freesMem(Mem))
|
|
|
|
PUNICODE_STRING UnicodeString
|
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2013-11-16 12:02:17 +00:00
|
|
|
RtlEraseUnicodeString(
|
|
|
|
_Inout_ PUNICODE_STRING String
|
|
|
|
);
|
2005-06-18 23:33:40 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-07-20 02:52:52 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-07-20 02:52:52 +00:00
|
|
|
RtlHashUnicodeString(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ CONST UNICODE_STRING *String,
|
|
|
|
_In_ BOOLEAN CaseInSensitive,
|
|
|
|
_In_ ULONG HashAlgorithm,
|
|
|
|
_Out_ PULONG HashValue
|
2005-07-20 02:52:52 +00:00
|
|
|
);
|
|
|
|
|
2019-06-20 06:56:05 +00:00
|
|
|
_IRQL_requires_max_(DISPATCH_LEVEL)
|
|
|
|
_At_(DestinationString->Buffer, _Post_equal_to_(SourceString))
|
|
|
|
_When_(SourceString != NULL,
|
|
|
|
_At_(DestinationString->Length, _Post_equal_to_(_String_length_(SourceString)))
|
|
|
|
_At_(DestinationString->MaximumLength, _Post_equal_to_(DestinationString->Length + sizeof(CHAR))))
|
|
|
|
_When_(SourceString == NULL,
|
|
|
|
_At_(DestinationString->Length, _Post_equal_to_(0))
|
|
|
|
_At_(DestinationString->MaximumLength, _Post_equal_to_(0)))
|
|
|
|
NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlInitString(
|
|
|
|
_Out_ PSTRING DestinationString,
|
|
|
|
_In_opt_z_ __drv_aliasesMem PCSTR SourceString
|
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_IRQL_requires_max_(DISPATCH_LEVEL)
|
|
|
|
_At_(DestinationString->Buffer, _Post_equal_to_(SourceString))
|
2013-01-22 22:51:51 +00:00
|
|
|
_When_(SourceString != NULL,
|
2013-01-13 14:49:21 +00:00
|
|
|
_At_(DestinationString->Length, _Post_equal_to_(_String_length_(SourceString) * sizeof(WCHAR)))
|
2013-01-22 22:51:51 +00:00
|
|
|
_At_(DestinationString->MaximumLength, _Post_equal_to_(DestinationString->Length + sizeof(WCHAR))))
|
|
|
|
_When_(SourceString == NULL,
|
|
|
|
_At_(DestinationString->Length, _Post_equal_to_(0))
|
|
|
|
_At_(DestinationString->MaximumLength, _Post_equal_to_(0)))
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlInitUnicodeString(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Out_ PUNICODE_STRING DestinationString,
|
|
|
|
_In_opt_z_ __drv_aliasesMem PCWSTR SourceString
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_IRQL_requires_max_(DISPATCH_LEVEL)
|
2006-05-10 17:47:44 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlInitUnicodeStringEx(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Out_ PUNICODE_STRING DestinationString,
|
|
|
|
_In_opt_z_ __drv_aliasesMem PCWSTR SourceString
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
2005-06-18 23:33:40 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2008-06-06 21:33:43 +00:00
|
|
|
BOOLEAN
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-26 16:35:51 +00:00
|
|
|
RtlIsTextUnicode(
|
2016-08-07 18:52:49 +00:00
|
|
|
_In_ CONST VOID* Buffer,
|
|
|
|
_In_ INT Size,
|
|
|
|
_Inout_opt_ INT* Flags
|
2005-06-26 16:35:51 +00:00
|
|
|
);
|
|
|
|
|
2013-11-05 20:40:01 +00:00
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
|
|
|
_Must_inspect_result_
|
2005-11-08 20:53:53 +00:00
|
|
|
NTSYSAPI
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
RtlPrefixString(
|
2013-11-05 20:40:01 +00:00
|
|
|
_In_ const STRING *String1,
|
|
|
|
_In_ const STRING *String2,
|
|
|
|
_In_ BOOLEAN CaseInsensitive
|
2005-11-08 20:53:53 +00:00
|
|
|
);
|
|
|
|
|
2013-11-05 20:40:01 +00:00
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
|
|
|
_Must_inspect_result_
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
BOOLEAN
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlPrefixUnicodeString(
|
2013-11-05 20:40:01 +00:00
|
|
|
_In_ PCUNICODE_STRING String1,
|
|
|
|
_In_ PCUNICODE_STRING String2,
|
|
|
|
_In_ BOOLEAN CaseInsensitive
|
|
|
|
);
|
|
|
|
|
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
|
|
|
NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlUpperString(
|
|
|
|
_Inout_ PSTRING DestinationString,
|
|
|
|
_In_ const STRING *SourceString
|
|
|
|
);
|
|
|
|
|
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
|
|
|
_Must_inspect_result_
|
|
|
|
NTSYSAPI
|
|
|
|
LONG
|
|
|
|
NTAPI
|
|
|
|
RtlCompareString(
|
|
|
|
_In_ const STRING *String1,
|
|
|
|
_In_ const STRING *String2,
|
|
|
|
_In_ BOOLEAN CaseInSensitive
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlCopyString(
|
|
|
|
_Out_ PSTRING DestinationString,
|
|
|
|
_In_opt_ const STRING *SourceString
|
|
|
|
);
|
|
|
|
|
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
|
|
|
_Must_inspect_result_
|
|
|
|
NTSYSAPI
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
RtlEqualString(
|
|
|
|
_In_ const STRING *String1,
|
|
|
|
_In_ const STRING *String2,
|
|
|
|
_In_ BOOLEAN CaseInSensitive
|
|
|
|
);
|
|
|
|
|
|
|
|
_IRQL_requires_max_(APC_LEVEL)
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlAppendStringToString(
|
|
|
|
_Inout_ PSTRING Destination,
|
|
|
|
_In_ const STRING *Source
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
|
|
|
_When_(AllocateDestinationString, _Must_inspect_result_)
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-07-20 02:52:52 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-07-20 02:52:52 +00:00
|
|
|
RtlUpcaseUnicodeString(
|
2013-01-13 14:49:21 +00:00
|
|
|
_When_(AllocateDestinationString, _Out_ _At_(DestinationString->Buffer, __drv_allocatesMem(Mem)))
|
|
|
|
_When_(!AllocateDestinationString, _Inout_)
|
|
|
|
PUNICODE_STRING DestinationString,
|
|
|
|
_In_ PCUNICODE_STRING SourceString,
|
|
|
|
_In_ BOOLEAN AllocateDestinationString
|
2013-11-05 20:40:01 +00:00
|
|
|
);
|
2005-07-20 02:52:52 +00:00
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlUnicodeStringToInteger(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PCUNICODE_STRING String,
|
|
|
|
_In_opt_ ULONG Base,
|
|
|
|
_Out_ PULONG Value
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlValidateUnicodeString(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG Flags,
|
|
|
|
_In_ PCUNICODE_STRING String
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
|
|
|
|
2017-03-02 20:40:21 +00:00
|
|
|
#define RTL_SKIP_BUFFER_COPY 0x00000001
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlpEnsureBufferSize(
|
|
|
|
_In_ ULONG Flags,
|
|
|
|
_Inout_ PRTL_BUFFER Buffer,
|
|
|
|
_In_ SIZE_T RequiredSize
|
|
|
|
);
|
|
|
|
|
|
|
|
#ifdef NTOS_MODE_USER
|
|
|
|
|
|
|
|
FORCEINLINE
|
|
|
|
VOID
|
|
|
|
RtlInitBuffer(
|
|
|
|
_Inout_ PRTL_BUFFER Buffer,
|
|
|
|
_In_ PUCHAR Data,
|
|
|
|
_In_ ULONG DataSize
|
|
|
|
)
|
|
|
|
{
|
|
|
|
Buffer->Buffer = Buffer->StaticBuffer = Data;
|
|
|
|
Buffer->Size = Buffer->StaticSize = DataSize;
|
|
|
|
Buffer->ReservedForAllocatedSize = 0;
|
|
|
|
Buffer->ReservedForIMalloc = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
FORCEINLINE
|
|
|
|
NTSTATUS
|
|
|
|
RtlEnsureBufferSize(
|
|
|
|
_In_ ULONG Flags,
|
|
|
|
_Inout_ PRTL_BUFFER Buffer,
|
|
|
|
_In_ ULONG RequiredSize
|
|
|
|
)
|
|
|
|
{
|
|
|
|
if (Buffer && RequiredSize <= Buffer->Size)
|
|
|
|
return STATUS_SUCCESS;
|
|
|
|
return RtlpEnsureBufferSize(Flags, Buffer, RequiredSize);
|
|
|
|
}
|
|
|
|
|
|
|
|
FORCEINLINE
|
|
|
|
VOID
|
|
|
|
RtlFreeBuffer(
|
|
|
|
_Inout_ PRTL_BUFFER Buffer
|
|
|
|
)
|
|
|
|
{
|
|
|
|
if (Buffer->Buffer != Buffer->StaticBuffer && Buffer->Buffer)
|
|
|
|
RtlFreeHeap(RtlGetProcessHeap(), 0, Buffer->Buffer);
|
|
|
|
Buffer->Buffer = Buffer->StaticBuffer;
|
|
|
|
Buffer->Size = Buffer->StaticSize;
|
|
|
|
}
|
|
|
|
|
2020-02-16 10:05:25 +00:00
|
|
|
NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlRunEncodeUnicodeString(
|
|
|
|
_Inout_ PUCHAR Hash,
|
|
|
|
_Inout_ PUNICODE_STRING String
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlRunDecodeUnicodeString(
|
|
|
|
_In_ UCHAR Hash,
|
|
|
|
_Inout_ PUNICODE_STRING String
|
|
|
|
);
|
|
|
|
|
2017-03-02 20:40:21 +00:00
|
|
|
#endif /* NTOS_MODE_USER */
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Ansi String Functions
|
|
|
|
//
|
2013-01-13 14:49:21 +00:00
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2013-01-13 14:49:21 +00:00
|
|
|
RtlFreeAnsiString(
|
|
|
|
_Inout_ _At_(AnsiString->Buffer, __drv_freesMem(Mem))
|
|
|
|
PANSI_STRING AnsiString
|
|
|
|
);
|
2005-06-20 03:55:42 +00:00
|
|
|
|
2013-01-19 21:49:12 +00:00
|
|
|
_IRQL_requires_max_(DISPATCH_LEVEL)
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlInitAnsiString(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Out_ PANSI_STRING DestinationString,
|
2013-01-19 21:49:12 +00:00
|
|
|
_In_opt_z_ __drv_aliasesMem PCSZ SourceString
|
2005-06-20 05:36:32 +00:00
|
|
|
);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2013-01-19 21:49:12 +00:00
|
|
|
_IRQL_requires_max_(DISPATCH_LEVEL)
|
2008-06-02 10:21:49 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlInitAnsiStringEx(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Out_ PANSI_STRING DestinationString,
|
2013-01-19 21:49:12 +00:00
|
|
|
_In_opt_z_ __drv_aliasesMem PCSZ SourceString
|
2008-06-02 10:21:49 +00:00
|
|
|
);
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// OEM String Functions
|
|
|
|
//
|
2013-01-13 14:49:21 +00:00
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2013-01-13 14:49:21 +00:00
|
|
|
RtlFreeOemString(
|
|
|
|
_Inout_ _At_(OemString->Buffer, __drv_freesMem(Mem))
|
|
|
|
POEM_STRING OemString
|
|
|
|
);
|
2005-06-20 03:55:42 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// MultiByte->Unicode String Functions
|
|
|
|
//
|
2013-01-13 14:49:21 +00:00
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 03:55:42 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlMultiByteToUnicodeN(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Out_writes_bytes_to_(MaxBytesInUnicodeString, *BytesInUnicodeString) PWCH UnicodeString,
|
|
|
|
_In_ ULONG MaxBytesInUnicodeString,
|
|
|
|
_Out_opt_ PULONG BytesInUnicodeString,
|
|
|
|
_In_reads_bytes_(BytesInMultiByteString) const CHAR *MultiByteString,
|
|
|
|
_In_ ULONG BytesInMultiByteString
|
2005-06-20 05:36:32 +00:00
|
|
|
);
|
2005-06-20 03:55:42 +00:00
|
|
|
|
2013-01-19 21:49:12 +00:00
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlMultiByteToUnicodeSize(
|
2013-01-19 21:49:12 +00:00
|
|
|
_Out_ PULONG BytesInUnicodeString,
|
|
|
|
_In_reads_bytes_(BytesInMultiByteString) const CHAR *MultiByteString,
|
|
|
|
_In_ ULONG BytesInMultiByteString
|
2005-06-20 05:36:32 +00:00
|
|
|
);
|
2005-06-20 03:55:42 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Atom Functions
|
|
|
|
//
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlAddAtomToAtomTable(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_ATOM_TABLE AtomTable,
|
|
|
|
_In_ PWSTR AtomName,
|
|
|
|
_Out_ PRTL_ATOM Atom
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlCreateAtomTable(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG TableSize,
|
|
|
|
_Inout_ PRTL_ATOM_TABLE *AtomTable
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
2005-06-20 03:55:42 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlDeleteAtomFromAtomTable(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_ATOM_TABLE AtomTable,
|
|
|
|
_In_ RTL_ATOM Atom
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlDestroyAtomTable(IN PRTL_ATOM_TABLE AtomTable);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlQueryAtomInAtomTable(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_ATOM_TABLE AtomTable,
|
|
|
|
_In_ RTL_ATOM Atom,
|
2013-03-02 15:39:59 +00:00
|
|
|
_Out_opt_ PULONG RefCount,
|
|
|
|
_Out_opt_ PULONG PinCount,
|
|
|
|
_Out_opt_z_bytecap_(*NameLength) PWSTR AtomName,
|
2013-01-13 14:49:21 +00:00
|
|
|
_Inout_opt_ PULONG NameLength
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2005-11-12 05:51:44 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlPinAtomInAtomTable(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_ATOM_TABLE AtomTable,
|
|
|
|
_In_ RTL_ATOM Atom
|
2005-12-20 23:16:09 +00:00
|
|
|
);
|
2005-11-12 05:51:44 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlLookupAtomInAtomTable(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_ATOM_TABLE AtomTable,
|
|
|
|
_In_ PWSTR AtomName,
|
|
|
|
_Out_ PRTL_ATOM Atom
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Process Management Functions
|
|
|
|
//
|
2008-09-12 15:09:17 +00:00
|
|
|
NTSYSAPI
|
|
|
|
PPEB
|
|
|
|
NTAPI
|
|
|
|
RtlGetCurrentPeb(
|
|
|
|
VOID
|
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlAcquirePebLock(VOID);
|
2005-06-18 23:33:40 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 21:16:59 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 21:16:59 +00:00
|
|
|
RtlCreateProcessParameters (
|
2013-01-13 14:49:21 +00:00
|
|
|
_Out_ PRTL_USER_PROCESS_PARAMETERS *ProcessParameters,
|
2013-01-19 21:49:12 +00:00
|
|
|
_In_ PUNICODE_STRING ImagePathName,
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_opt_ PUNICODE_STRING DllPath,
|
|
|
|
_In_opt_ PUNICODE_STRING CurrentDirectory,
|
|
|
|
_In_opt_ PUNICODE_STRING CommandLine,
|
|
|
|
_In_opt_ PWSTR Environment,
|
|
|
|
_In_opt_ PUNICODE_STRING WindowTitle,
|
|
|
|
_In_opt_ PUNICODE_STRING DesktopInfo,
|
|
|
|
_In_opt_ PUNICODE_STRING ShellInfo,
|
|
|
|
_In_opt_ PUNICODE_STRING RuntimeInfo
|
2005-06-20 21:16:59 +00:00
|
|
|
);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 21:16:59 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 21:16:59 +00:00
|
|
|
RtlCreateUserProcess(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PUNICODE_STRING ImageFileName,
|
|
|
|
_In_ ULONG Attributes,
|
|
|
|
_In_ PRTL_USER_PROCESS_PARAMETERS ProcessParameters,
|
|
|
|
_In_opt_ PSECURITY_DESCRIPTOR ProcessSecutityDescriptor,
|
|
|
|
_In_opt_ PSECURITY_DESCRIPTOR ThreadSecurityDescriptor,
|
|
|
|
_In_opt_ HANDLE ParentProcess,
|
|
|
|
_In_ BOOLEAN CurrentDirectory,
|
|
|
|
_In_opt_ HANDLE DebugPort,
|
|
|
|
_In_opt_ HANDLE ExceptionPort,
|
|
|
|
_Out_ PRTL_USER_PROCESS_INFORMATION ProcessInfo
|
2005-06-20 21:16:59 +00:00
|
|
|
);
|
|
|
|
|
2013-01-19 21:49:12 +00:00
|
|
|
#if (NTDDI_VERSION >= NTDDI_WIN7)
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlCreateUserThread(
|
|
|
|
_In_ PVOID ThreadContext,
|
|
|
|
_Out_ HANDLE *OutThreadHandle,
|
|
|
|
_Reserved_ PVOID Reserved1,
|
|
|
|
_Reserved_ PVOID Reserved2,
|
|
|
|
_Reserved_ PVOID Reserved3,
|
|
|
|
_Reserved_ PVOID Reserved4,
|
|
|
|
_Reserved_ PVOID Reserved5,
|
|
|
|
_Reserved_ PVOID Reserved6,
|
|
|
|
_Reserved_ PVOID Reserved7,
|
|
|
|
_Reserved_ PVOID Reserved8
|
|
|
|
);
|
|
|
|
#else
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlCreateUserThread(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE ProcessHandle,
|
2013-01-19 21:49:12 +00:00
|
|
|
_In_opt_ PSECURITY_DESCRIPTOR SecurityDescriptor,
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ BOOLEAN CreateSuspended,
|
|
|
|
_In_ ULONG StackZeroBits,
|
|
|
|
_In_ SIZE_T StackReserve,
|
|
|
|
_In_ SIZE_T StackCommit,
|
|
|
|
_In_ PTHREAD_START_ROUTINE StartAddress,
|
|
|
|
_In_ PVOID Parameter,
|
2013-01-22 22:51:51 +00:00
|
|
|
_Out_opt_ PHANDLE ThreadHandle,
|
|
|
|
_Out_opt_ PCLIENT_ID ClientId
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
2013-01-19 21:49:12 +00:00
|
|
|
#endif
|
2005-06-18 23:33:40 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
PRTL_USER_PROCESS_PARAMETERS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2013-01-13 14:49:21 +00:00
|
|
|
RtlDeNormalizeProcessParams(
|
|
|
|
_In_ PRTL_USER_PROCESS_PARAMETERS ProcessParameters);
|
2005-06-26 16:35:51 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 16:35:51 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2013-01-13 14:49:21 +00:00
|
|
|
RtlDestroyProcessParameters(
|
|
|
|
_In_ PRTL_USER_PROCESS_PARAMETERS ProcessParameters);
|
2005-06-26 16:35:51 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-07-12 01:56:14 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2013-01-13 14:49:21 +00:00
|
|
|
RtlExitUserThread(
|
|
|
|
_In_ NTSTATUS Status);
|
2005-07-02 13:42:43 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-07-12 01:56:14 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-07-02 13:42:43 +00:00
|
|
|
RtlInitializeContext(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE ProcessHandle,
|
|
|
|
_Out_ PCONTEXT ThreadContext,
|
|
|
|
_In_opt_ PVOID ThreadStartParam,
|
|
|
|
_In_ PTHREAD_START_ROUTINE ThreadStartAddress,
|
|
|
|
_In_ PINITIAL_TEB InitialTeb
|
2005-07-02 13:42:43 +00:00
|
|
|
);
|
|
|
|
|
2012-01-24 21:15:55 +00:00
|
|
|
#ifdef _M_AMD64
|
2012-02-08 16:25:13 +00:00
|
|
|
typedef struct _WOW64_CONTEXT *PWOW64_CONTEXT;
|
|
|
|
|
2012-01-24 21:15:55 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlWow64GetThreadContext(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE ThreadHandle,
|
|
|
|
_Inout_ PWOW64_CONTEXT ThreadContext
|
2012-01-24 21:15:55 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlWow64SetThreadContext(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE ThreadHandle,
|
|
|
|
_In_ PWOW64_CONTEXT ThreadContext
|
2012-01-24 21:15:55 +00:00
|
|
|
);
|
|
|
|
#endif
|
|
|
|
|
2009-09-11 07:12:30 +00:00
|
|
|
NTSYSAPI
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
RtlIsThreadWithinLoaderCallout(VOID);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 16:35:51 +00:00
|
|
|
PRTL_USER_PROCESS_PARAMETERS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2013-01-13 14:49:21 +00:00
|
|
|
RtlNormalizeProcessParams(
|
|
|
|
_In_ PRTL_USER_PROCESS_PARAMETERS ProcessParameters);
|
2005-06-18 23:33:40 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 19:50:52 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-26 16:35:51 +00:00
|
|
|
RtlReleasePebLock(VOID);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2008-09-12 15:09:17 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlRemoteCall(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE Process,
|
|
|
|
_In_ HANDLE Thread,
|
|
|
|
_In_ PVOID CallSite,
|
|
|
|
_In_ ULONG ArgumentCount,
|
|
|
|
_In_ PULONG Arguments,
|
|
|
|
_In_ BOOLEAN PassContext,
|
|
|
|
_In_ BOOLEAN AlreadySuspended
|
2008-09-12 15:09:17 +00:00
|
|
|
);
|
|
|
|
|
2005-10-02 08:22:49 +00:00
|
|
|
NTSYSAPI
|
2010-05-29 18:22:47 +00:00
|
|
|
NTSTATUS
|
2014-01-07 20:23:44 +00:00
|
|
|
__cdecl
|
2005-10-02 08:22:49 +00:00
|
|
|
RtlSetProcessIsCritical(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ BOOLEAN NewValue,
|
|
|
|
_Out_opt_ PBOOLEAN OldValue,
|
|
|
|
_In_ BOOLEAN NeedBreaks
|
2005-10-02 08:22:49 +00:00
|
|
|
);
|
|
|
|
|
2012-01-30 01:14:33 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
2014-01-07 20:23:44 +00:00
|
|
|
__cdecl
|
2012-01-30 01:14:33 +00:00
|
|
|
RtlSetThreadIsCritical(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ BOOLEAN NewValue,
|
|
|
|
_Out_opt_ PBOOLEAN OldValue,
|
|
|
|
_In_ BOOLEAN NeedBreaks
|
2012-01-30 01:14:33 +00:00
|
|
|
);
|
|
|
|
|
2008-09-12 15:09:17 +00:00
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
RtlGetCurrentProcessorNumber(
|
|
|
|
VOID
|
|
|
|
);
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
|
2006-07-03 20:23:48 +00:00
|
|
|
//
|
|
|
|
// Thread Pool Functions
|
|
|
|
//
|
[RTL/NTDLL/KERNEL32]: Rtl provides worker queue and timer queue functionality, which queues a worker thread associated with a caller-supplied callback. In Windows, Rtl by default calls RtlCreateUserThread, but as soon as kernel32 loads, it's DllMain calls an exported function RtlSetThreadPoolStartFunc which changes that default to a special Base function that calls CreateRemoteThread instead. The net result is that Win32 processes using the Rtl functionality get their threads properly registered with CSRSS. In ReactOS, this did not happen, so when those threads called into CSRSS, CSRSS had no CSR_THREAD structure/state for them, which is why CsrCreateThread (and the API loop) are so badly hacked. This commit implements RtlSetThreadPoolStartFunc, implements the kernel32 base functions which wrap CreateRemoteThread, and implements the rtl functions which wrap RtlCreateUserThread. Services, Setup, and any ReactOS application using RPC now have the worker threads correctly registered.
svn path=/trunk/; revision=55706
2012-02-19 10:06:31 +00:00
|
|
|
//
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlSetThreadPoolStartFunc(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_START_POOL_THREAD StartPoolThread,
|
|
|
|
_In_ PRTL_EXIT_POOL_THREAD ExitPoolThread
|
[RTL/NTDLL/KERNEL32]: Rtl provides worker queue and timer queue functionality, which queues a worker thread associated with a caller-supplied callback. In Windows, Rtl by default calls RtlCreateUserThread, but as soon as kernel32 loads, it's DllMain calls an exported function RtlSetThreadPoolStartFunc which changes that default to a special Base function that calls CreateRemoteThread instead. The net result is that Win32 processes using the Rtl functionality get their threads properly registered with CSRSS. In ReactOS, this did not happen, so when those threads called into CSRSS, CSRSS had no CSR_THREAD structure/state for them, which is why CsrCreateThread (and the API loop) are so badly hacked. This commit implements RtlSetThreadPoolStartFunc, implements the kernel32 base functions which wrap CreateRemoteThread, and implements the rtl functions which wrap RtlCreateUserThread. Services, Setup, and any ReactOS application using RPC now have the worker threads correctly registered.
svn path=/trunk/; revision=55706
2012-02-19 10:06:31 +00:00
|
|
|
);
|
|
|
|
|
2008-04-01 01:07:09 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlDeregisterWaitEx(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE hWaitHandle,
|
2013-01-22 22:51:51 +00:00
|
|
|
_In_opt_ HANDLE hCompletionEvent
|
2008-04-01 01:07:09 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlDeregisterWait(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE hWaitHandle
|
2008-04-01 01:07:09 +00:00
|
|
|
);
|
|
|
|
|
2006-07-03 20:23:48 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlQueueWorkItem(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ WORKERCALLBACKFUNC Function,
|
|
|
|
_In_opt_ PVOID Context,
|
|
|
|
_In_ ULONG Flags
|
2006-08-05 16:27:20 +00:00
|
|
|
);
|
2006-07-03 20:23:48 +00:00
|
|
|
|
2008-11-17 11:44:31 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlSetIoCompletionCallback(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE FileHandle,
|
|
|
|
_In_ PIO_APC_ROUTINE Callback,
|
|
|
|
_In_ ULONG Flags
|
2008-11-17 11:44:31 +00:00
|
|
|
);
|
|
|
|
|
2008-04-01 01:07:09 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlRegisterWait(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PHANDLE phNewWaitObject,
|
|
|
|
_In_ HANDLE hObject,
|
|
|
|
_In_ WAITORTIMERCALLBACKFUNC Callback,
|
|
|
|
_In_ PVOID pvContext,
|
|
|
|
_In_ ULONG ulMilliseconds,
|
|
|
|
_In_ ULONG ulFlags
|
2008-04-01 01:07:09 +00:00
|
|
|
);
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Environment/Path Functions
|
|
|
|
//
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-26 16:35:51 +00:00
|
|
|
RtlCreateEnvironment(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ BOOLEAN Inherit,
|
|
|
|
_Out_ PWSTR *Environment
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlComputePrivatizedDllName_U(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PUNICODE_STRING DllName,
|
2019-02-02 01:30:40 +00:00
|
|
|
_Inout_ PUNICODE_STRING RealName,
|
|
|
|
_Inout_ PUNICODE_STRING LocalName
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 16:35:51 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2006-05-10 17:47:44 +00:00
|
|
|
RtlDestroyEnvironment(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PWSTR Environment
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
2005-06-26 16:35:51 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
BOOLEAN
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2006-05-10 17:47:44 +00:00
|
|
|
RtlDoesFileExists_U(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PCWSTR FileName
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2013-06-07 20:40:34 +00:00
|
|
|
RTL_PATH_TYPE
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2006-05-10 17:47:44 +00:00
|
|
|
RtlDetermineDosPathNameType_U(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PCWSTR Path
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
ULONG
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
RtlDosSearchPath_U(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PCWSTR Path,
|
|
|
|
_In_ PCWSTR FileName,
|
|
|
|
_In_ PCWSTR Extension,
|
|
|
|
_In_ ULONG BufferSize,
|
|
|
|
_Out_ PWSTR Buffer,
|
|
|
|
_Out_ PWSTR *PartName
|
2005-06-21 02:08:42 +00:00
|
|
|
);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2012-05-01 07:16:02 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
2011-12-14 03:55:54 +00:00
|
|
|
NTAPI
|
|
|
|
RtlDosSearchPath_Ustr(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG Flags,
|
|
|
|
_In_ PUNICODE_STRING PathString,
|
|
|
|
_In_ PUNICODE_STRING FileNameString,
|
|
|
|
_In_ PUNICODE_STRING ExtensionString,
|
|
|
|
_In_ PUNICODE_STRING CallerBuffer,
|
|
|
|
_Inout_opt_ PUNICODE_STRING DynamicString,
|
|
|
|
_Out_opt_ PUNICODE_STRING* FullNameOut,
|
|
|
|
_Out_opt_ PSIZE_T FilePartSize,
|
|
|
|
_Out_opt_ PSIZE_T LengthNeeded
|
2011-12-14 03:55:54 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 16:35:51 +00:00
|
|
|
BOOLEAN
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-26 16:35:51 +00:00
|
|
|
RtlDosPathNameToNtPathName_U(
|
2013-01-19 21:49:12 +00:00
|
|
|
_In_opt_z_ PCWSTR DosPathName,
|
2013-01-13 14:49:21 +00:00
|
|
|
_Out_ PUNICODE_STRING NtPathName,
|
2013-01-19 21:49:12 +00:00
|
|
|
_Out_opt_ PCWSTR *NtFileNamePart,
|
|
|
|
_Out_opt_ PRTL_RELATIVE_NAME_U DirectoryInfo
|
2005-06-26 16:35:51 +00:00
|
|
|
);
|
|
|
|
|
2017-03-02 21:29:38 +00:00
|
|
|
|
|
|
|
#define RTL_UNCHANGED_UNK_PATH 1
|
|
|
|
#define RTL_CONVERTED_UNC_PATH 2
|
|
|
|
#define RTL_CONVERTED_NT_PATH 3
|
|
|
|
#define RTL_UNCHANGED_DOS_PATH 4
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlNtPathNameToDosPathName(
|
|
|
|
_In_ ULONG Flags,
|
2017-03-02 21:51:22 +00:00
|
|
|
_Inout_ PRTL_UNICODE_STRING_BUFFER Path,
|
|
|
|
_Out_opt_ PULONG PathType,
|
|
|
|
_Out_opt_ PULONG Unknown
|
2017-03-02 21:29:38 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
|
2012-01-01 17:17:07 +00:00
|
|
|
NTSYSAPI
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
RtlDosPathNameToRelativeNtPathName_U(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PCWSTR DosName,
|
|
|
|
_Out_ PUNICODE_STRING NtName,
|
|
|
|
_Out_ PCWSTR *PartName,
|
|
|
|
_Out_ PRTL_RELATIVE_NAME_U RelativeName
|
2012-01-01 17:17:07 +00:00
|
|
|
);
|
|
|
|
|
2013-01-19 21:49:12 +00:00
|
|
|
_At_(Destination->Buffer, _Out_bytecap_(Destination->MaximumLength))
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 16:35:51 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-26 16:35:51 +00:00
|
|
|
RtlExpandEnvironmentStrings_U(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_z_ PWSTR Environment,
|
|
|
|
_In_ PUNICODE_STRING Source,
|
2013-01-19 21:49:12 +00:00
|
|
|
_Inout_ PUNICODE_STRING Destination,
|
2013-01-13 14:49:21 +00:00
|
|
|
_Out_ PULONG Length
|
2005-06-26 16:35:51 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
ULONG
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
RtlGetCurrentDirectory_U(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG MaximumLength,
|
2013-01-22 22:51:51 +00:00
|
|
|
_Out_bytecap_(MaximumLength) PWSTR Buffer
|
2005-06-21 02:08:42 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
ULONG
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
RtlGetFullPathName_U(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PCWSTR FileName,
|
|
|
|
_In_ ULONG Size,
|
2013-01-19 21:49:12 +00:00
|
|
|
_Out_z_bytecap_(Size) PWSTR Buffer,
|
|
|
|
_Out_opt_ PWSTR *ShortName
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
|
|
|
|
2012-01-24 21:15:55 +00:00
|
|
|
#if (NTDDI_VERSION >= NTDDI_WIN7)
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlGetFullPathName_UEx(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PWSTR FileName,
|
|
|
|
_In_ ULONG BufferLength,
|
|
|
|
_Out_ PWSTR Buffer,
|
|
|
|
_Out_opt_ PWSTR *FilePart,
|
|
|
|
_Out_opt_ RTL_PATH_TYPE *InputPathType
|
2012-01-24 21:15:55 +00:00
|
|
|
);
|
|
|
|
#endif
|
|
|
|
|
2012-04-21 06:57:07 +00:00
|
|
|
NTSTATUS
|
2012-01-15 03:16:00 +00:00
|
|
|
NTAPI
|
|
|
|
RtlGetFullPathName_UstrEx(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PUNICODE_STRING FileName,
|
2013-01-19 21:49:12 +00:00
|
|
|
_In_opt_ PUNICODE_STRING StaticString,
|
|
|
|
_In_opt_ PUNICODE_STRING DynamicString,
|
|
|
|
_Out_opt_ PUNICODE_STRING *StringUsed,
|
|
|
|
_Out_opt_ PSIZE_T FilePartSize,
|
|
|
|
_Out_opt_ PBOOLEAN NameInvalid,
|
2013-01-13 14:49:21 +00:00
|
|
|
_Out_ RTL_PATH_TYPE* PathType,
|
2013-01-19 21:49:12 +00:00
|
|
|
_Out_opt_ PSIZE_T LengthNeeded
|
2012-01-15 03:16:00 +00:00
|
|
|
);
|
|
|
|
|
2013-09-24 22:16:30 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
2013-09-28 09:01:31 +00:00
|
|
|
RtlGetLengthWithoutTrailingPathSeperators(
|
|
|
|
_Reserved_ ULONG Flags,
|
2013-09-24 22:16:30 +00:00
|
|
|
_In_ PCUNICODE_STRING PathString,
|
|
|
|
_Out_ PULONG Length
|
|
|
|
);
|
|
|
|
|
2012-04-25 07:24:17 +00:00
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
RtlGetLongestNtPathLength(
|
|
|
|
VOID
|
|
|
|
);
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
RtlIsDosDeviceName_U(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PCWSTR Name
|
2005-06-21 02:08:42 +00:00
|
|
|
);
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
RtlIsDosDeviceName_Ustr(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PCUNICODE_STRING Name
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
|
|
|
_Must_inspect_result_
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 16:35:51 +00:00
|
|
|
BOOLEAN
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-26 16:35:51 +00:00
|
|
|
RtlIsNameLegalDOS8Dot3(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PCUNICODE_STRING Name,
|
|
|
|
_Inout_opt_ POEM_STRING OemName,
|
|
|
|
_Out_opt_ PBOOLEAN NameContainsSpaces
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlQueryEnvironmentVariable_U(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_opt_ PWSTR Environment,
|
2017-05-13 17:26:59 +00:00
|
|
|
_In_ PCUNICODE_STRING Name,
|
2013-01-13 14:49:21 +00:00
|
|
|
_Out_ PUNICODE_STRING Value
|
2005-06-20 05:36:32 +00:00
|
|
|
);
|
2005-06-18 23:33:40 +00:00
|
|
|
|
2011-07-16 18:58:52 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlReleaseRelativeName(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_RELATIVE_NAME_U RelativeName
|
2011-07-16 18:58:52 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2006-05-10 17:47:44 +00:00
|
|
|
RtlSetCurrentDirectory_U(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PUNICODE_STRING name
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 19:50:52 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 19:50:52 +00:00
|
|
|
RtlSetEnvironmentVariable(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_z_ PWSTR *Environment,
|
|
|
|
_In_ PUNICODE_STRING Name,
|
|
|
|
_In_ PUNICODE_STRING Value
|
2005-06-20 19:50:52 +00:00
|
|
|
);
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Critical Section/Resource Functions
|
|
|
|
//
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlDeleteCriticalSection (
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_CRITICAL_SECTION CriticalSection
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlEnterCriticalSection(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_CRITICAL_SECTION CriticalSection
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlInitializeCriticalSection(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_CRITICAL_SECTION CriticalSection
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
RtlInitializeCriticalSectionAndSpinCount(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_CRITICAL_SECTION CriticalSection,
|
|
|
|
_In_ ULONG SpinCount
|
2005-06-21 02:08:42 +00:00
|
|
|
);
|
|
|
|
|
2017-06-15 06:47:42 +00:00
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
RtlIsCriticalSectionLocked(
|
|
|
|
_In_ PRTL_CRITICAL_SECTION CriticalSection
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
RtlIsCriticalSectionLockedByThread(
|
|
|
|
_In_ PRTL_CRITICAL_SECTION CriticalSection
|
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlLeaveCriticalSection(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_CRITICAL_SECTION CriticalSection
|
2005-06-27 21:11:29 +00:00
|
|
|
);
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
NTSYSAPI
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
RtlTryEnterCriticalSection(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_CRITICAL_SECTION CriticalSection
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-27 21:11:29 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-27 21:11:29 +00:00
|
|
|
RtlpUnWaitCriticalSection(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_CRITICAL_SECTION CriticalSection
|
2005-06-27 21:11:29 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-27 21:11:29 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-27 21:11:29 +00:00
|
|
|
RtlpWaitForCriticalSection(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_CRITICAL_SECTION CriticalSection
|
2005-06-26 01:08:55 +00:00
|
|
|
);
|
2005-06-18 23:33:40 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 11:07:15 +00:00
|
|
|
BOOLEAN
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-26 11:07:15 +00:00
|
|
|
RtlAcquireResourceExclusive(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_RESOURCE Resource,
|
|
|
|
_In_ BOOLEAN Wait
|
2005-06-26 11:07:15 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 11:07:15 +00:00
|
|
|
BOOLEAN
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-26 11:07:15 +00:00
|
|
|
RtlAcquireResourceShared(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_RESOURCE Resource,
|
|
|
|
_In_ BOOLEAN Wait
|
2005-06-26 11:07:15 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 11:07:15 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-26 11:07:15 +00:00
|
|
|
RtlConvertExclusiveToShared(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_RESOURCE Resource
|
2005-06-26 11:07:15 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 11:07:15 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-26 11:07:15 +00:00
|
|
|
RtlConvertSharedToExclusive(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_RESOURCE Resource
|
2005-06-26 11:07:15 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 11:07:15 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-26 11:07:15 +00:00
|
|
|
RtlDeleteResource(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_RESOURCE Resource
|
2005-06-26 11:07:15 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 11:07:15 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-26 11:07:15 +00:00
|
|
|
RtlDumpResource(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_RESOURCE Resource
|
2005-06-26 11:07:15 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 11:07:15 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-26 11:07:15 +00:00
|
|
|
RtlInitializeResource(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_RESOURCE Resource
|
2005-06-26 11:07:15 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 11:07:15 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-26 11:07:15 +00:00
|
|
|
RtlReleaseResource(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_RESOURCE Resource
|
2005-06-26 11:07:15 +00:00
|
|
|
);
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Compression Functions
|
|
|
|
//
|
2013-01-13 14:49:21 +00:00
|
|
|
NTSYSAPI //NT_RTL_COMPRESS_API
|
2005-06-19 23:59:40 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlCompressBuffer(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ USHORT CompressionFormatAndEngine,
|
|
|
|
_In_reads_bytes_(UncompressedBufferSize) PUCHAR UncompressedBuffer,
|
|
|
|
_In_ ULONG UncompressedBufferSize,
|
|
|
|
_Out_writes_bytes_to_(CompressedBufferSize, *FinalCompressedSize) PUCHAR CompressedBuffer,
|
|
|
|
_In_ ULONG CompressedBufferSize,
|
|
|
|
_In_ ULONG UncompressedChunkSize,
|
|
|
|
_Out_ PULONG FinalCompressedSize,
|
|
|
|
_In_ PVOID WorkSpace
|
2005-06-19 23:59:40 +00:00
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_IRQL_requires_max_(APC_LEVEL)
|
|
|
|
NTSYSAPI //NT_RTL_COMPRESS_API
|
2005-06-18 23:33:40 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlDecompressBuffer(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ USHORT CompressionFormat,
|
|
|
|
_Out_writes_bytes_to_(UncompressedBufferSize, *FinalUncompressedSize) PUCHAR UncompressedBuffer,
|
|
|
|
_In_ ULONG UncompressedBufferSize,
|
|
|
|
_In_reads_bytes_(CompressedBufferSize) PUCHAR CompressedBuffer,
|
|
|
|
_In_ ULONG CompressedBufferSize,
|
|
|
|
_Out_ PULONG FinalUncompressedSize
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlGetCompressionWorkSpaceSize(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ USHORT CompressionFormatAndEngine,
|
|
|
|
_Out_ PULONG CompressBufferWorkSpaceSize,
|
|
|
|
_Out_ PULONG CompressFragmentWorkSpaceSize
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2016-01-03 16:23:38 +00:00
|
|
|
//
|
|
|
|
// Frame Functions
|
|
|
|
//
|
|
|
|
NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlPopFrame(
|
|
|
|
_In_ PTEB_ACTIVE_FRAME Frame
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlPushFrame(
|
|
|
|
_In_ PTEB_ACTIVE_FRAME Frame
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
PTEB_ACTIVE_FRAME
|
|
|
|
NTAPI
|
|
|
|
RtlGetFrame(
|
|
|
|
VOID
|
|
|
|
);
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Debug Info Functions
|
|
|
|
//
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2006-05-10 17:47:44 +00:00
|
|
|
PRTL_DEBUG_INFORMATION
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
RtlCreateQueryDebugBuffer(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG Size,
|
|
|
|
_In_ BOOLEAN EventPair
|
2005-06-21 02:08:42 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2006-05-10 17:47:44 +00:00
|
|
|
RtlDestroyQueryDebugBuffer(IN PRTL_DEBUG_INFORMATION DebugBuffer);
|
2005-06-21 02:08:42 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
RtlQueryProcessDebugInformation(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG ProcessId,
|
|
|
|
_In_ ULONG DebugInfoClassMask,
|
|
|
|
_Inout_ PRTL_DEBUG_INFORMATION DebugBuffer
|
2005-06-21 02:08:42 +00:00
|
|
|
);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Bitmap Functions
|
|
|
|
//
|
2017-05-04 16:12:52 +00:00
|
|
|
#ifdef NTOS_MODE_USER
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
BOOLEAN
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlAreBitsClear(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_BITMAP BitMapHeader,
|
|
|
|
_In_ ULONG StartingIndex,
|
|
|
|
_In_ ULONG Length
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
BOOLEAN
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlAreBitsSet(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_BITMAP BitMapHeader,
|
|
|
|
_In_ ULONG StartingIndex,
|
|
|
|
_In_ ULONG Length
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2012-05-29 18:40:41 +00:00
|
|
|
NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlClearAllBits(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_BITMAP BitMapHeader
|
2012-05-29 18:40:41 +00:00
|
|
|
);
|
|
|
|
|
2017-03-29 16:36:13 +00:00
|
|
|
NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlClearBit(
|
|
|
|
_In_ PRTL_BITMAP BitMapHeader,
|
|
|
|
_In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitNumber
|
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlClearBits(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_BITMAP BitMapHeader,
|
|
|
|
_In_range_(0, BitMapHeader->SizeOfBitMap - NumberToClear) ULONG StartingIndex,
|
|
|
|
_In_range_(0, BitMapHeader->SizeOfBitMap - StartingIndex) ULONG NumberToClear
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
ULONG
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlFindClearBits(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_BITMAP BitMapHeader,
|
|
|
|
_In_ ULONG NumberToFind,
|
|
|
|
_In_ ULONG HintIndex
|
2005-06-20 05:36:32 +00:00
|
|
|
);
|
2005-06-20 03:55:42 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
ULONG
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlFindClearBitsAndSet(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_BITMAP BitMapHeader,
|
|
|
|
_In_ ULONG NumberToFind,
|
|
|
|
_In_ ULONG HintIndex
|
2005-06-20 05:36:32 +00:00
|
|
|
);
|
2005-06-18 23:33:40 +00:00
|
|
|
|
2015-07-11 00:18:30 +00:00
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
RtlFindFirstRunClear(
|
|
|
|
_In_ PRTL_BITMAP BitMapHeader,
|
|
|
|
_Out_ PULONG StartingIndex
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
RtlFindClearRuns(
|
|
|
|
_In_ PRTL_BITMAP BitMapHeader,
|
|
|
|
_Out_writes_to_(SizeOfRunArray, return) PRTL_BITMAP_RUN RunArray,
|
|
|
|
_In_range_(>, 0) ULONG SizeOfRunArray,
|
|
|
|
_In_ BOOLEAN LocateLongestRuns
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
RtlFindLastBackwardRunClear(
|
|
|
|
_In_ PRTL_BITMAP BitMapHeader,
|
|
|
|
_In_ ULONG FromIndex,
|
|
|
|
_Out_ PULONG StartingRunIndex
|
|
|
|
);
|
|
|
|
|
2012-05-29 18:40:41 +00:00
|
|
|
NTSYSAPI
|
|
|
|
CCHAR
|
|
|
|
NTAPI
|
|
|
|
RtlFindLeastSignificantBit(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONGLONG Value
|
2012-05-29 18:40:41 +00:00
|
|
|
);
|
|
|
|
|
2017-03-29 16:36:13 +00:00
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
RtlFindLongestRunClear(
|
|
|
|
_In_ PRTL_BITMAP BitMapHeader,
|
|
|
|
_Out_ PULONG StartingIndex
|
|
|
|
);
|
|
|
|
|
2012-05-29 18:40:41 +00:00
|
|
|
NTSYSAPI
|
|
|
|
CCHAR
|
|
|
|
NTAPI
|
|
|
|
RtlFindMostSignificantBit(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONGLONG Value
|
2012-05-29 18:40:41 +00:00
|
|
|
);
|
|
|
|
|
2006-06-29 18:07:53 +00:00
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
RtlFindNextForwardRunClear(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_BITMAP BitMapHeader,
|
|
|
|
_In_ ULONG FromIndex,
|
|
|
|
_Out_ PULONG StartingRunIndex
|
2006-06-29 18:07:53 +00:00
|
|
|
);
|
|
|
|
|
2012-05-29 18:40:41 +00:00
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
RtlFindNextForwardRunSet(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_BITMAP BitMapHeader,
|
|
|
|
_In_ ULONG FromIndex,
|
2013-01-19 21:49:12 +00:00
|
|
|
_Out_ PULONG StartingRunIndex
|
2012-05-29 18:40:41 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
RtlFindSetBits(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_BITMAP BitMapHeader,
|
|
|
|
_In_ ULONG NumberToFind,
|
|
|
|
_In_ ULONG HintIndex
|
2012-05-29 18:40:41 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
RtlFindSetBitsAndClear(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_BITMAP BitMapHeader,
|
|
|
|
_In_ ULONG NumberToFind,
|
|
|
|
_In_ ULONG HintIndex
|
2012-05-29 18:40:41 +00:00
|
|
|
);
|
|
|
|
|
2019-07-28 22:31:56 +00:00
|
|
|
#ifdef __REACTOS__ // ReactOS improvement
|
2013-01-13 14:49:21 +00:00
|
|
|
_At_(BitMapHeader->SizeOfBitMap, _Post_equal_to_(SizeOfBitMap))
|
|
|
|
_At_(BitMapHeader->Buffer, _Post_equal_to_(BitMapBuffer))
|
|
|
|
#endif
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlInitializeBitMap(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Out_ PRTL_BITMAP BitMapHeader,
|
|
|
|
_In_opt_ __drv_aliasesMem PULONG BitMapBuffer,
|
|
|
|
_In_opt_ ULONG SizeOfBitMap
|
2005-06-20 05:36:32 +00:00
|
|
|
);
|
|
|
|
|
2012-05-29 18:40:41 +00:00
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
RtlNumberOfClearBits(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_BITMAP BitMapHeader
|
2012-05-29 18:40:41 +00:00
|
|
|
);
|
|
|
|
|
2006-06-29 18:07:53 +00:00
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
RtlNumberOfSetBits(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_BITMAP BitMapHeader
|
2006-06-29 18:07:53 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2006-05-10 17:47:44 +00:00
|
|
|
RtlSetBit(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_BITMAP BitMapHeader,
|
|
|
|
_In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitNumber
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlSetBits(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_BITMAP BitMapHeader,
|
|
|
|
_In_range_(0, BitMapHeader->SizeOfBitMap - NumberToSet) ULONG StartingIndex,
|
|
|
|
_In_range_(0, BitMapHeader->SizeOfBitMap - StartingIndex) ULONG NumberToSet
|
2005-06-20 05:36:32 +00:00
|
|
|
);
|
|
|
|
|
2008-01-16 23:19:01 +00:00
|
|
|
NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlSetAllBits(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_BITMAP BitMapHeader
|
2008-01-16 23:19:01 +00:00
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_Must_inspect_result_
|
2008-01-16 23:19:01 +00:00
|
|
|
NTSYSAPI
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
RtlTestBit(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_BITMAP BitMapHeader,
|
|
|
|
_In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitNumber
|
2008-01-16 23:19:01 +00:00
|
|
|
);
|
|
|
|
|
2017-03-29 16:36:13 +00:00
|
|
|
#if defined(_M_AMD64)
|
|
|
|
_Must_inspect_result_
|
|
|
|
FORCEINLINE
|
|
|
|
BOOLEAN
|
|
|
|
RtlCheckBit(
|
|
|
|
_In_ PRTL_BITMAP BitMapHeader,
|
|
|
|
_In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitPosition)
|
|
|
|
{
|
|
|
|
return BitTest64((LONG64 CONST*)BitMapHeader->Buffer, (LONG64)BitPosition);
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
#define RtlCheckBit(BMH,BP) (((((PLONG)(BMH)->Buffer)[(BP)/32]) >> ((BP)%32)) & 0x1)
|
|
|
|
#endif /* defined(_M_AMD64) */
|
|
|
|
|
2017-05-04 16:12:52 +00:00
|
|
|
#endif // NTOS_MODE_USER
|
|
|
|
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Timer Functions
|
|
|
|
//
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
RtlCreateTimer(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE TimerQueue,
|
|
|
|
_In_ PHANDLE phNewTimer,
|
|
|
|
_In_ WAITORTIMERCALLBACKFUNC Callback,
|
|
|
|
_In_ PVOID Parameter,
|
|
|
|
_In_ ULONG DueTime,
|
|
|
|
_In_ ULONG Period,
|
|
|
|
_In_ ULONG Flags
|
2005-06-21 02:08:42 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
RtlCreateTimerQueue(PHANDLE TimerQueue);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
RtlDeleteTimer(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE TimerQueue,
|
|
|
|
_In_ HANDLE Timer,
|
|
|
|
_In_ HANDLE CompletionEvent
|
2005-06-21 02:08:42 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
RtlUpdateTimer(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE TimerQueue,
|
|
|
|
_In_ HANDLE Timer,
|
|
|
|
_In_ ULONG DueTime,
|
|
|
|
_In_ ULONG Period
|
2005-06-21 02:08:42 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
RtlDeleteTimerQueueEx(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE TimerQueue,
|
2013-01-22 22:51:51 +00:00
|
|
|
_In_opt_ HANDLE CompletionEvent
|
2005-06-21 02:08:42 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
RtlDeleteTimerQueue(HANDLE TimerQueue);
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
//
|
|
|
|
// SList functions
|
|
|
|
//
|
|
|
|
PSLIST_ENTRY
|
|
|
|
FASTCALL
|
|
|
|
InterlockedPushListSList(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Inout_ PSLIST_HEADER ListHead,
|
|
|
|
_Inout_ __drv_aliasesMem PSLIST_ENTRY List,
|
|
|
|
_Inout_ PSLIST_ENTRY ListEnd,
|
|
|
|
_In_ ULONG Count
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
//
|
|
|
|
// Range List functions
|
|
|
|
//
|
|
|
|
NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
2010-06-28 04:26:18 +00:00
|
|
|
RtlInitializeRangeList(
|
2020-06-13 09:55:53 +00:00
|
|
|
_Out_ PRTL_RANGE_LIST RangeList
|
2010-06-28 04:26:18 +00:00
|
|
|
);
|
2011-08-05 01:20:28 +00:00
|
|
|
|
2010-06-28 04:26:18 +00:00
|
|
|
NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlFreeRangeList(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_RANGE_LIST RangeList
|
2010-06-28 04:26:18 +00:00
|
|
|
);
|
|
|
|
|
2020-06-13 09:55:53 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlCopyRangeList(
|
|
|
|
_Out_ PRTL_RANGE_LIST CopyRangeList,
|
|
|
|
_In_ PRTL_RANGE_LIST RangeList
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlMergeRangeLists(
|
|
|
|
_Out_ PRTL_RANGE_LIST MergedRangeList,
|
|
|
|
_In_ PRTL_RANGE_LIST RangeList1,
|
|
|
|
_In_ PRTL_RANGE_LIST RangeList2,
|
|
|
|
_In_ ULONG Flags
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlInvertRangeList(
|
|
|
|
_Out_ PRTL_RANGE_LIST InvertedRangeList,
|
|
|
|
_In_ PRTL_RANGE_LIST RangeList
|
|
|
|
);
|
|
|
|
|
2010-06-28 04:26:18 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlAddRange(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Inout_ PRTL_RANGE_LIST RangeList,
|
|
|
|
_In_ ULONGLONG Start,
|
|
|
|
_In_ ULONGLONG End,
|
|
|
|
_In_ UCHAR Attributes,
|
|
|
|
_In_ ULONG Flags,
|
|
|
|
_In_opt_ PVOID UserData,
|
|
|
|
_In_opt_ PVOID Owner
|
2010-06-28 04:26:18 +00:00
|
|
|
);
|
2006-05-10 17:47:44 +00:00
|
|
|
|
2020-06-13 09:55:53 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlDeleteRange(
|
|
|
|
_Inout_ PRTL_RANGE_LIST RangeList,
|
|
|
|
_In_ ULONGLONG Start,
|
|
|
|
_In_ ULONGLONG End,
|
|
|
|
_In_ PVOID Owner
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlDeleteOwnersRanges(
|
|
|
|
_Inout_ PRTL_RANGE_LIST RangeList,
|
|
|
|
_In_ _Maybenull_ PVOID Owner
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlFindRange(
|
|
|
|
_In_ PRTL_RANGE_LIST RangeList,
|
|
|
|
_In_ ULONGLONG Minimum,
|
|
|
|
_In_ ULONGLONG Maximum,
|
|
|
|
_In_ ULONG Length,
|
|
|
|
_In_ ULONG Alignment,
|
|
|
|
_In_ ULONG Flags,
|
|
|
|
_In_ UCHAR AttributeAvailableMask,
|
|
|
|
_In_opt_ PVOID Context,
|
|
|
|
_In_opt_ PRTL_CONFLICT_RANGE_CALLBACK Callback,
|
|
|
|
_Out_ PULONGLONG Start
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlIsRangeAvailable(
|
|
|
|
_In_ PRTL_RANGE_LIST RangeList,
|
|
|
|
_In_ ULONGLONG Start,
|
|
|
|
_In_ ULONGLONG End,
|
|
|
|
_In_ ULONG Flags,
|
|
|
|
_In_ UCHAR AttributeAvailableMask,
|
|
|
|
_In_opt_ PVOID Context,
|
|
|
|
_In_opt_ PRTL_CONFLICT_RANGE_CALLBACK Callback,
|
|
|
|
_Out_ PBOOLEAN Available
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlGetFirstRange(
|
|
|
|
_In_ PRTL_RANGE_LIST RangeList,
|
|
|
|
_Out_ PRTL_RANGE_LIST_ITERATOR Iterator,
|
|
|
|
_Outptr_ PRTL_RANGE *Range
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlGetNextRange(
|
|
|
|
_Inout_ PRTL_RANGE_LIST_ITERATOR Iterator,
|
|
|
|
_Outptr_ PRTL_RANGE *Range,
|
|
|
|
_In_ BOOLEAN MoveForwards
|
|
|
|
);
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Debug Functions
|
|
|
|
//
|
2005-06-21 02:08:42 +00:00
|
|
|
ULONG
|
2005-09-05 18:06:20 +00:00
|
|
|
__cdecl
|
2005-06-21 02:08:42 +00:00
|
|
|
DbgPrint(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_z_ _Printf_format_string_ PCSTR Format,
|
|
|
|
...
|
2005-06-21 02:08:42 +00:00
|
|
|
);
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
__cdecl
|
|
|
|
DbgPrintEx(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG ComponentId,
|
|
|
|
_In_ ULONG Level,
|
|
|
|
_In_z_ _Printf_format_string_ PCSTR Format,
|
|
|
|
...
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
|
|
|
|
[FREELDR] Include ntddk.h instead of winddk.h
[RAMDISK] Add missing DO_XIP definition (not in WDK/DDK)
[FASTFAT] Remove duplicate VOLUME_IS_DIRTY definition
[HAL] Add case stubs for missing HAL_QUERY_INFORMATION_CLASS members
[NDK] Fix DbgPrompt prototype
[NTDDK]
- Move from winddk.h: _KUSER_SHARED_DATA (updated), pHalIoAssignDriveLetters, PHAL_RESET_DISPLAY_PARAMETERS, HAL_DISPATCH, HalDispatchTable, PCREATE_PROCESS_NOTIFY_ROUTINE, PCREATE_THREAD_NOTIFY_ROUTINE, IMAGE_INFO, PLOAD_IMAGE_NOTIFY_ROUTINE, BUS_DATA_TYPE (updated), PROCESSINFOCLASS (updated), THREADINFOCLASS (updated), DISK_SIGNATURE, PTIMER_APC_ROUTINE, Exfi386InterlockedIncrementLong, Exfi386InterlockedDecrementLong, Exfi386InterlockedExchangeUlong
- Add pHalGetAcpiTable, PCI_ERROR_HANDLER_CALLBACK, pHalSetPciErrorHandlerCallback
[WDM] Add _DECL_HAL_KE_IMPORT, Reorder sections (types before functions)
svn path=/branches/header-work/; revision=46097
2010-03-11 14:49:41 +00:00
|
|
|
NTSYSAPI
|
2006-05-10 17:47:44 +00:00
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
DbgPrompt(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_z_ PCCH Prompt,
|
2013-01-19 21:49:12 +00:00
|
|
|
_Out_writes_bytes_(MaximumResponseLength) PCH Response,
|
|
|
|
_In_ ULONG MaximumResponseLength
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
|
|
|
|
2013-03-23 21:57:17 +00:00
|
|
|
#undef DbgBreakPoint
|
2005-06-21 02:08:42 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2007-01-24 19:48:34 +00:00
|
|
|
DbgBreakPoint(
|
|
|
|
VOID
|
|
|
|
);
|
|
|
|
|
2009-10-09 11:51:07 +00:00
|
|
|
VOID
|
2007-01-24 19:48:34 +00:00
|
|
|
NTAPI
|
|
|
|
DbgLoadImageSymbols(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PSTRING Name,
|
|
|
|
_In_ PVOID Base,
|
|
|
|
_In_ ULONG_PTR ProcessId
|
2007-02-18 20:47:04 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
DbgUnLoadImageSymbols(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PSTRING Name,
|
|
|
|
_In_ PVOID Base,
|
|
|
|
_In_ ULONG_PTR ProcessId
|
2007-01-24 19:48:34 +00:00
|
|
|
);
|
2005-06-21 02:08:42 +00:00
|
|
|
|
2009-11-02 17:45:51 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
DbgCommandString(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PCCH Name,
|
|
|
|
_In_ PCCH Command
|
2009-11-02 17:45:51 +00:00
|
|
|
);
|
|
|
|
|
2006-10-16 03:19:14 +00:00
|
|
|
//
|
|
|
|
// Generic Table Functions
|
|
|
|
//
|
2006-10-17 04:20:48 +00:00
|
|
|
#if defined(NTOS_MODE_USER) || defined(_NTIFS_)
|
- Fix the way NlsOemLeadByteInfo is exported.
- Fix definition of PFAST_IO_UNLOCK_ALL_BY_KEY.
- Add IO_REPARSE and IO_REMOUNT definitions.
- Add IOCTL_CDROM_DISK_TYPE definition.
- Add FlagOn, BooleanFlagOn, SetFlag and ClearFlag definitions.
- Add FILE_READ_ONLY_VOLUME, FILE_SEQUENTIAL_WRITE_ONCE, FILE_SUPPORTS_TRANSACTIONS definitions.
- Add FSRTL_FLAG_ADVANCED_HEADER definition.
- Add FSRTL_FLAG2_PURGE_WHEN_MAPPED and FSRTL_FLAG2_IS_PAGING_FILE definitions.
- Add FILE_ID_FULL_DIR_INFORMATION and FILE_ID_BOTH_DIR_INFORMATION structures.
- Add FSRTL_FCB_HEADER_V0 and FSRTL_FCB_HEADER_V1 definitions.
- Add FSRTL_COMPARISION_RESULT enumeration.
- Add backwards compatibility support for non-AVL tree routines.
- Add RtlInsertElementGenericTableAvl, RtlDeleteElementGenericTableAvl, RtlLookupElementGenericTableAvl, RtlEnumerateGenericTableWithoutSplayingAvl prototypes.
- Add FsRtlSetupAdvancedHeader macro.
- Add FsRtlIsFatDbcsLegal prototype.
- Add FsRtlTeardownPerStreamContexts prototype.
- Add RtlFreeOemString, RtlOemStringToCountedUnicodeString, RtlUnicodeStringToCountedOemString, RtlOemToUnicodeN prototypes.
- Fix GenericTable prototypes in rtlfuncs.h
- It seems the ntoskrnl_i386.def exports file is totally incorrect with respect to mingw -- most FsRtl functions are not properly exported. We fixed the ones we need, someone needs to go fix this entire file.
- Add memcmp to the NTOS exports -- we're not entirely sure how you were even expecting 3rd party drivers to load in React?
- Fix FastFat's "VfatFastIoUnlockAllByKey" prototype to match the fixed up PFAST_IO_UNLOCK_ALL_BY_KEY definition.
- Clean-build-tested on i386.
svn path=/trunk/; revision=34611
2008-07-20 19:19:02 +00:00
|
|
|
NTSYSAPI
|
2006-10-16 03:19:14 +00:00
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
RtlInsertElementGenericTable(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_GENERIC_TABLE Table,
|
|
|
|
_In_reads_bytes_(BufferSize) PVOID Buffer,
|
|
|
|
_In_ CLONG BufferSize,
|
|
|
|
_Out_opt_ PBOOLEAN NewElement
|
2006-10-16 03:19:14 +00:00
|
|
|
);
|
|
|
|
|
- Fix the way NlsOemLeadByteInfo is exported.
- Fix definition of PFAST_IO_UNLOCK_ALL_BY_KEY.
- Add IO_REPARSE and IO_REMOUNT definitions.
- Add IOCTL_CDROM_DISK_TYPE definition.
- Add FlagOn, BooleanFlagOn, SetFlag and ClearFlag definitions.
- Add FILE_READ_ONLY_VOLUME, FILE_SEQUENTIAL_WRITE_ONCE, FILE_SUPPORTS_TRANSACTIONS definitions.
- Add FSRTL_FLAG_ADVANCED_HEADER definition.
- Add FSRTL_FLAG2_PURGE_WHEN_MAPPED and FSRTL_FLAG2_IS_PAGING_FILE definitions.
- Add FILE_ID_FULL_DIR_INFORMATION and FILE_ID_BOTH_DIR_INFORMATION structures.
- Add FSRTL_FCB_HEADER_V0 and FSRTL_FCB_HEADER_V1 definitions.
- Add FSRTL_COMPARISION_RESULT enumeration.
- Add backwards compatibility support for non-AVL tree routines.
- Add RtlInsertElementGenericTableAvl, RtlDeleteElementGenericTableAvl, RtlLookupElementGenericTableAvl, RtlEnumerateGenericTableWithoutSplayingAvl prototypes.
- Add FsRtlSetupAdvancedHeader macro.
- Add FsRtlIsFatDbcsLegal prototype.
- Add FsRtlTeardownPerStreamContexts prototype.
- Add RtlFreeOemString, RtlOemStringToCountedUnicodeString, RtlUnicodeStringToCountedOemString, RtlOemToUnicodeN prototypes.
- Fix GenericTable prototypes in rtlfuncs.h
- It seems the ntoskrnl_i386.def exports file is totally incorrect with respect to mingw -- most FsRtl functions are not properly exported. We fixed the ones we need, someone needs to go fix this entire file.
- Add memcmp to the NTOS exports -- we're not entirely sure how you were even expecting 3rd party drivers to load in React?
- Fix FastFat's "VfatFastIoUnlockAllByKey" prototype to match the fixed up PFAST_IO_UNLOCK_ALL_BY_KEY definition.
- Clean-build-tested on i386.
svn path=/trunk/; revision=34611
2008-07-20 19:19:02 +00:00
|
|
|
NTSYSAPI
|
2006-10-16 03:19:14 +00:00
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
RtlInsertElementGenericTableFull(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_GENERIC_TABLE Table,
|
|
|
|
_In_reads_bytes_(BufferSize) PVOID Buffer,
|
|
|
|
_In_ CLONG BufferSize,
|
|
|
|
_Out_opt_ PBOOLEAN NewElement,
|
|
|
|
_In_ PVOID NodeOrParent,
|
|
|
|
_In_ TABLE_SEARCH_RESULT SearchResult
|
2006-10-16 03:19:14 +00:00
|
|
|
);
|
|
|
|
|
- Fix the way NlsOemLeadByteInfo is exported.
- Fix definition of PFAST_IO_UNLOCK_ALL_BY_KEY.
- Add IO_REPARSE and IO_REMOUNT definitions.
- Add IOCTL_CDROM_DISK_TYPE definition.
- Add FlagOn, BooleanFlagOn, SetFlag and ClearFlag definitions.
- Add FILE_READ_ONLY_VOLUME, FILE_SEQUENTIAL_WRITE_ONCE, FILE_SUPPORTS_TRANSACTIONS definitions.
- Add FSRTL_FLAG_ADVANCED_HEADER definition.
- Add FSRTL_FLAG2_PURGE_WHEN_MAPPED and FSRTL_FLAG2_IS_PAGING_FILE definitions.
- Add FILE_ID_FULL_DIR_INFORMATION and FILE_ID_BOTH_DIR_INFORMATION structures.
- Add FSRTL_FCB_HEADER_V0 and FSRTL_FCB_HEADER_V1 definitions.
- Add FSRTL_COMPARISION_RESULT enumeration.
- Add backwards compatibility support for non-AVL tree routines.
- Add RtlInsertElementGenericTableAvl, RtlDeleteElementGenericTableAvl, RtlLookupElementGenericTableAvl, RtlEnumerateGenericTableWithoutSplayingAvl prototypes.
- Add FsRtlSetupAdvancedHeader macro.
- Add FsRtlIsFatDbcsLegal prototype.
- Add FsRtlTeardownPerStreamContexts prototype.
- Add RtlFreeOemString, RtlOemStringToCountedUnicodeString, RtlUnicodeStringToCountedOemString, RtlOemToUnicodeN prototypes.
- Fix GenericTable prototypes in rtlfuncs.h
- It seems the ntoskrnl_i386.def exports file is totally incorrect with respect to mingw -- most FsRtl functions are not properly exported. We fixed the ones we need, someone needs to go fix this entire file.
- Add memcmp to the NTOS exports -- we're not entirely sure how you were even expecting 3rd party drivers to load in React?
- Fix FastFat's "VfatFastIoUnlockAllByKey" prototype to match the fixed up PFAST_IO_UNLOCK_ALL_BY_KEY definition.
- Clean-build-tested on i386.
svn path=/trunk/; revision=34611
2008-07-20 19:19:02 +00:00
|
|
|
NTSYSAPI
|
2006-10-16 03:19:14 +00:00
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
RtlIsGenericTableEmpty(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_GENERIC_TABLE Table
|
2006-10-16 03:19:14 +00:00
|
|
|
);
|
|
|
|
|
- Fix the way NlsOemLeadByteInfo is exported.
- Fix definition of PFAST_IO_UNLOCK_ALL_BY_KEY.
- Add IO_REPARSE and IO_REMOUNT definitions.
- Add IOCTL_CDROM_DISK_TYPE definition.
- Add FlagOn, BooleanFlagOn, SetFlag and ClearFlag definitions.
- Add FILE_READ_ONLY_VOLUME, FILE_SEQUENTIAL_WRITE_ONCE, FILE_SUPPORTS_TRANSACTIONS definitions.
- Add FSRTL_FLAG_ADVANCED_HEADER definition.
- Add FSRTL_FLAG2_PURGE_WHEN_MAPPED and FSRTL_FLAG2_IS_PAGING_FILE definitions.
- Add FILE_ID_FULL_DIR_INFORMATION and FILE_ID_BOTH_DIR_INFORMATION structures.
- Add FSRTL_FCB_HEADER_V0 and FSRTL_FCB_HEADER_V1 definitions.
- Add FSRTL_COMPARISION_RESULT enumeration.
- Add backwards compatibility support for non-AVL tree routines.
- Add RtlInsertElementGenericTableAvl, RtlDeleteElementGenericTableAvl, RtlLookupElementGenericTableAvl, RtlEnumerateGenericTableWithoutSplayingAvl prototypes.
- Add FsRtlSetupAdvancedHeader macro.
- Add FsRtlIsFatDbcsLegal prototype.
- Add FsRtlTeardownPerStreamContexts prototype.
- Add RtlFreeOemString, RtlOemStringToCountedUnicodeString, RtlUnicodeStringToCountedOemString, RtlOemToUnicodeN prototypes.
- Fix GenericTable prototypes in rtlfuncs.h
- It seems the ntoskrnl_i386.def exports file is totally incorrect with respect to mingw -- most FsRtl functions are not properly exported. We fixed the ones we need, someone needs to go fix this entire file.
- Add memcmp to the NTOS exports -- we're not entirely sure how you were even expecting 3rd party drivers to load in React?
- Fix FastFat's "VfatFastIoUnlockAllByKey" prototype to match the fixed up PFAST_IO_UNLOCK_ALL_BY_KEY definition.
- Clean-build-tested on i386.
svn path=/trunk/; revision=34611
2008-07-20 19:19:02 +00:00
|
|
|
NTSYSAPI
|
2006-10-16 03:39:49 +00:00
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
RtlLookupElementGenericTableFull(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_GENERIC_TABLE Table,
|
|
|
|
_In_ PVOID Buffer,
|
|
|
|
_Out_ PVOID *NodeOrParent,
|
|
|
|
_Out_ TABLE_SEARCH_RESULT *SearchResult
|
2006-10-16 03:39:49 +00:00
|
|
|
);
|
2006-10-17 04:20:48 +00:00
|
|
|
#endif
|
2006-10-16 03:39:49 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Handle Table Functions
|
|
|
|
//
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-24 18:11:16 +00:00
|
|
|
PRTL_HANDLE_TABLE_ENTRY
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-26 16:35:51 +00:00
|
|
|
RtlAllocateHandle(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_HANDLE_TABLE HandleTable,
|
|
|
|
_Inout_ PULONG Index
|
2005-06-21 02:08:42 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2013-01-13 14:49:21 +00:00
|
|
|
RtlDestroyHandleTable(
|
|
|
|
_Inout_ PRTL_HANDLE_TABLE HandleTable);
|
2005-06-21 02:08:42 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
BOOLEAN
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-26 16:35:51 +00:00
|
|
|
RtlFreeHandle(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_HANDLE_TABLE HandleTable,
|
|
|
|
_In_ PRTL_HANDLE_TABLE_ENTRY Handle
|
2005-06-21 02:08:42 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-26 16:35:51 +00:00
|
|
|
RtlInitializeHandleTable(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG TableSize,
|
|
|
|
_In_ ULONG HandleSize,
|
|
|
|
_In_ PRTL_HANDLE_TABLE HandleTable
|
2005-06-21 02:08:42 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
BOOLEAN
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-26 16:35:51 +00:00
|
|
|
RtlIsValidHandle(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_HANDLE_TABLE HandleTable,
|
|
|
|
_In_ PRTL_HANDLE_TABLE_ENTRY Handle
|
2005-06-20 21:16:59 +00:00
|
|
|
);
|
|
|
|
|
2013-01-19 21:49:12 +00:00
|
|
|
_Success_(return!=FALSE)
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
BOOLEAN
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-26 16:35:51 +00:00
|
|
|
RtlIsValidIndexHandle(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_HANDLE_TABLE HandleTable,
|
|
|
|
_In_ ULONG Index,
|
|
|
|
_Out_ PRTL_HANDLE_TABLE_ENTRY *Handle
|
2005-06-21 02:08:42 +00:00
|
|
|
);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// PE Functions
|
|
|
|
//
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 21:16:59 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 21:16:59 +00:00
|
|
|
RtlFindMessage(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID BaseAddress,
|
|
|
|
_In_ ULONG Type,
|
|
|
|
_In_ ULONG Language,
|
|
|
|
_In_ ULONG MessageId,
|
|
|
|
_Out_ PMESSAGE_RESOURCE_ENTRY *MessageResourceEntry
|
2005-06-20 21:16:59 +00:00
|
|
|
);
|
2005-06-21 02:08:42 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
ULONG
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-21 02:08:42 +00:00
|
|
|
RtlGetNtGlobalFlags(VOID);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2013-01-19 21:49:12 +00:00
|
|
|
_Success_(return!=NULL)
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
PVOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlImageDirectoryEntryToData(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID BaseAddress,
|
|
|
|
_In_ BOOLEAN MappedAsImage,
|
|
|
|
_In_ USHORT Directory,
|
|
|
|
_Out_ PULONG Size
|
2005-06-20 05:36:32 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-12-08 23:55:34 +00:00
|
|
|
PVOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlImageRvaToVa(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PIMAGE_NT_HEADERS NtHeader,
|
|
|
|
_In_ PVOID BaseAddress,
|
|
|
|
_In_ ULONG Rva,
|
2013-01-19 21:49:12 +00:00
|
|
|
_Inout_opt_ PIMAGE_SECTION_HEADER *SectionHeader
|
2005-06-20 05:36:32 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
PIMAGE_NT_HEADERS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2013-01-13 14:49:21 +00:00
|
|
|
RtlImageNtHeader(
|
|
|
|
_In_ PVOID BaseAddress);
|
2005-06-20 05:36:32 +00:00
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlImageNtHeaderEx(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG Flags,
|
|
|
|
_In_ PVOID BaseAddress,
|
|
|
|
_In_ ULONGLONG Size,
|
2013-01-19 21:49:12 +00:00
|
|
|
_Out_ PIMAGE_NT_HEADERS *NtHeader
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
PIMAGE_SECTION_HEADER
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlImageRvaToSection(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PIMAGE_NT_HEADERS NtHeader,
|
|
|
|
_In_ PVOID BaseAddress,
|
|
|
|
_In_ ULONG Rva
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2006-09-10 08:00:57 +00:00
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
LdrRelocateImageWithBias(
|
2023-11-15 19:59:32 +00:00
|
|
|
_In_ PVOID BaseAddress,
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ LONGLONG AdditionalBias,
|
2023-11-15 19:59:32 +00:00
|
|
|
_In_opt_ PCSTR LoaderName,
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG Success,
|
|
|
|
_In_ ULONG Conflict,
|
|
|
|
_In_ ULONG Invalid
|
2006-09-10 08:00:57 +00:00
|
|
|
);
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
//
|
|
|
|
// Activation Context Functions
|
|
|
|
//
|
|
|
|
#ifdef NTOS_MODE_USER
|
2011-07-20 14:46:15 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlActivateActivationContextEx(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG Flags,
|
|
|
|
_In_ PTEB Teb,
|
|
|
|
_In_ PVOID Context,
|
2013-01-19 21:49:12 +00:00
|
|
|
_Out_ PULONG_PTR Cookie
|
2011-07-20 14:46:15 +00:00
|
|
|
);
|
2008-09-12 15:09:17 +00:00
|
|
|
|
2008-11-23 10:02:20 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlActivateActivationContext(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG Flags,
|
|
|
|
_In_ HANDLE Handle,
|
|
|
|
_Out_ PULONG_PTR Cookie
|
2008-11-23 10:02:20 +00:00
|
|
|
);
|
|
|
|
|
2008-09-12 15:09:17 +00:00
|
|
|
NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlAddRefActivationContext(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID Context
|
2008-09-12 15:09:17 +00:00
|
|
|
);
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
NTSYSAPI
|
2011-04-08 17:49:49 +00:00
|
|
|
PRTL_ACTIVATION_CONTEXT_STACK_FRAME
|
|
|
|
FASTCALL
|
2006-05-10 17:47:44 +00:00
|
|
|
RtlActivateActivationContextUnsafeFast(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED Frame,
|
|
|
|
_In_ PVOID Context
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlAllocateActivationContextStack(
|
2013-03-17 22:31:40 +00:00
|
|
|
_In_ PACTIVATION_CONTEXT_STACK *Stack
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
|
|
|
|
2008-11-23 10:02:20 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlCreateActivationContext(
|
2013-09-13 22:44:57 +00:00
|
|
|
_In_ ULONG Flags,
|
|
|
|
_In_ PACTIVATION_CONTEXT_DATA ActivationContextData,
|
|
|
|
_In_ ULONG ExtraBytes,
|
|
|
|
_In_ PVOID NotificationRoutine,
|
|
|
|
_In_ PVOID NotificationContext,
|
|
|
|
_Out_ PACTIVATION_CONTEXT *ActCtx
|
2008-11-23 10:02:20 +00:00
|
|
|
);
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlGetActiveActivationContext(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID *Context
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlReleaseActivationContext(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE handle
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
|
|
|
|
2008-09-12 15:09:17 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlDeactivateActivationContext(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG dwFlags,
|
|
|
|
_In_ ULONG_PTR ulCookie
|
2008-09-12 15:09:17 +00:00
|
|
|
);
|
|
|
|
|
2009-12-02 09:43:35 +00:00
|
|
|
NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
2013-03-17 20:58:41 +00:00
|
|
|
RtlFreeActivationContextStack(
|
|
|
|
_In_ PACTIVATION_CONTEXT_STACK Stack
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlFreeThreadActivationContextStack(VOID);
|
2009-12-02 09:43:35 +00:00
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
NTSYSAPI
|
2011-04-08 17:49:49 +00:00
|
|
|
PRTL_ACTIVATION_CONTEXT_STACK_FRAME
|
|
|
|
FASTCALL
|
2006-05-10 17:47:44 +00:00
|
|
|
RtlDeactivateActivationContextUnsafeFast(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED Frame
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlDosApplyFileIsolationRedirection_Ustr(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG Flags,
|
|
|
|
_In_ PUNICODE_STRING OriginalName,
|
|
|
|
_In_ PUNICODE_STRING Extension,
|
|
|
|
_Inout_ PUNICODE_STRING StaticString,
|
|
|
|
_Inout_ PUNICODE_STRING DynamicString,
|
|
|
|
_Inout_ PUNICODE_STRING *NewName,
|
|
|
|
_In_ PULONG NewFlags,
|
|
|
|
_In_ PSIZE_T FileNameSize,
|
|
|
|
_In_ PSIZE_T RequiredLength
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlFindActivationContextSectionString(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG dwFlags,
|
|
|
|
_In_ const GUID *ExtensionGuid,
|
|
|
|
_In_ ULONG SectionType,
|
2014-05-08 14:14:01 +00:00
|
|
|
_In_ const UNICODE_STRING *SectionName,
|
2013-01-13 14:49:21 +00:00
|
|
|
_Inout_ PVOID ReturnedData
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
2008-09-12 15:09:17 +00:00
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlQueryInformationActivationContext(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ DWORD dwFlags,
|
2013-01-19 21:49:12 +00:00
|
|
|
_In_opt_ PVOID Context,
|
|
|
|
_In_opt_ PVOID pvSubInstance,
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG ulInfoClass,
|
2013-01-19 21:49:12 +00:00
|
|
|
_Out_bytecap_(cbBuffer) PVOID pvBuffer,
|
|
|
|
_In_opt_ SIZE_T cbBuffer,
|
|
|
|
_Out_opt_ SIZE_T *pcbWrittenOrRequired
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlQueryInformationActiveActivationContext(
|
|
|
|
_In_ ULONG ulInfoClass,
|
|
|
|
_Out_bytecap_(cbBuffer) PVOID pvBuffer,
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_opt_ SIZE_T cbBuffer,
|
|
|
|
_Out_opt_ SIZE_T *pcbWrittenOrRequired
|
2008-09-12 15:09:17 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlZombifyActivationContext(
|
|
|
|
PVOID Context
|
|
|
|
);
|
|
|
|
|
2011-11-07 01:40:33 +00:00
|
|
|
//
|
|
|
|
// WOW64 Functions
|
|
|
|
//
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlWow64EnableFsRedirection(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ BOOLEAN Wow64FsEnableRedirection
|
2011-11-07 01:40:33 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlWow64EnableFsRedirectionEx(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID Wow64FsEnableRedirection,
|
|
|
|
_Out_ PVOID *OldFsRedirectionLevel
|
2011-11-07 01:40:33 +00:00
|
|
|
);
|
2008-09-12 15:09:17 +00:00
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
#endif
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Registry Functions
|
|
|
|
//
|
2013-01-19 21:49:12 +00:00
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
|
|
|
_Must_inspect_result_
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 21:16:59 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 21:16:59 +00:00
|
|
|
RtlCheckRegistryKey(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG RelativeTo,
|
2013-01-19 21:49:12 +00:00
|
|
|
_In_ PWSTR Path
|
2005-06-20 21:16:59 +00:00
|
|
|
);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2007-04-07 05:33:30 +00:00
|
|
|
RtlCreateRegistryKey(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG RelativeTo,
|
|
|
|
_In_ PWSTR Path
|
2007-04-07 05:33:30 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlFormatCurrentUserKeyPath(
|
2013-01-22 22:51:51 +00:00
|
|
|
_Out_ _At_(KeyPath->Buffer, __drv_allocatesMem(Mem) _Post_bytecap_(KeyPath->MaximumLength) _Post_bytecount_(KeyPath->Length))
|
|
|
|
PUNICODE_STRING KeyPath
|
2007-04-07 05:33:30 +00:00
|
|
|
);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlOpenCurrentUser(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ACCESS_MASK DesiredAccess,
|
|
|
|
_Out_ PHANDLE KeyHandle
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlQueryRegistryValues(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG RelativeTo,
|
|
|
|
_In_ PCWSTR Path,
|
|
|
|
_Inout_ _At_(*(*QueryTable).EntryContext, _Pre_unknown_)
|
|
|
|
PRTL_QUERY_REGISTRY_TABLE QueryTable,
|
|
|
|
_In_opt_ PVOID Context,
|
|
|
|
_In_opt_ PVOID Environment
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlWriteRegistryValue(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG RelativeTo,
|
|
|
|
_In_ PCWSTR Path,
|
|
|
|
_In_z_ PCWSTR ValueName,
|
|
|
|
_In_ ULONG ValueType,
|
|
|
|
_In_reads_bytes_opt_(ValueLength) PVOID ValueData,
|
|
|
|
_In_ ULONG ValueLength
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2011-09-18 23:59:06 +00:00
|
|
|
#ifdef NTOS_MODE_USER
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlpNtCreateKey(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Out_ HANDLE KeyHandle,
|
|
|
|
_In_ ACCESS_MASK DesiredAccess,
|
|
|
|
_In_ POBJECT_ATTRIBUTES ObjectAttributes,
|
|
|
|
_In_ ULONG TitleIndex,
|
|
|
|
_In_ PUNICODE_STRING Class,
|
|
|
|
_Out_ PULONG Disposition
|
2011-09-18 23:59:06 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlpNtEnumerateSubKey(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE KeyHandle,
|
2013-01-22 22:51:51 +00:00
|
|
|
_Inout_ PUNICODE_STRING SubKeyName,
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG Index,
|
|
|
|
_In_ ULONG Unused
|
2011-09-18 23:59:06 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlpNtMakeTemporaryKey(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE KeyHandle
|
2011-09-18 23:59:06 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlpNtOpenKey(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Out_ HANDLE KeyHandle,
|
|
|
|
_In_ ACCESS_MASK DesiredAccess,
|
|
|
|
_In_ POBJECT_ATTRIBUTES ObjectAttributes,
|
|
|
|
_In_ ULONG Unused
|
2011-09-18 23:59:06 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlpNtQueryValueKey(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE KeyHandle,
|
|
|
|
_Out_opt_ PULONG Type,
|
|
|
|
_Out_opt_ PVOID Data,
|
|
|
|
_Inout_opt_ PULONG DataLength,
|
|
|
|
_In_ ULONG Unused
|
2011-09-18 23:59:06 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlpNtSetValueKey(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE KeyHandle,
|
|
|
|
_In_ ULONG Type,
|
|
|
|
_In_ PVOID Data,
|
|
|
|
_In_ ULONG DataLength
|
2011-09-18 23:59:06 +00:00
|
|
|
);
|
|
|
|
#endif
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// NLS Functions
|
|
|
|
//
|
2008-05-20 13:21:21 +00:00
|
|
|
NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlGetDefaultCodePage(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Out_ PUSHORT AnsiCodePage,
|
|
|
|
_Out_ PUSHORT OemCodePage
|
2008-05-20 13:21:21 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlInitNlsTables(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PUSHORT AnsiTableBase,
|
|
|
|
_In_ PUSHORT OemTableBase,
|
|
|
|
_In_ PUSHORT CaseTableBase,
|
|
|
|
_Out_ PNLSTABLEINFO NlsTable
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
2005-06-20 03:55:42 +00:00
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlInitCodePageTable(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PUSHORT TableBase,
|
2013-01-19 21:49:12 +00:00
|
|
|
_Out_ PCPTABLEINFO CodePageTable
|
2005-06-20 05:36:32 +00:00
|
|
|
);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2013-01-13 14:49:21 +00:00
|
|
|
RtlResetRtlTranslations(
|
|
|
|
_In_ PNLSTABLEINFO NlsTable);
|
2005-06-20 03:55:42 +00:00
|
|
|
|
2005-09-06 05:58:48 +00:00
|
|
|
#if defined(NTOS_MODE_USER) && !defined(NO_RTL_INLINES)
|
2005-11-22 04:57:45 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Misc conversion functions
|
|
|
|
//
|
2005-09-06 05:58:48 +00:00
|
|
|
static __inline
|
2005-06-26 01:08:55 +00:00
|
|
|
LARGE_INTEGER
|
2005-09-06 05:58:48 +00:00
|
|
|
NTAPI_INLINE
|
2005-11-22 06:57:36 +00:00
|
|
|
RtlConvertLongToLargeInteger(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ LONG SignedInteger
|
2005-11-22 04:57:45 +00:00
|
|
|
)
|
2005-09-06 05:58:48 +00:00
|
|
|
{
|
|
|
|
LARGE_INTEGER Result;
|
2005-06-20 19:28:45 +00:00
|
|
|
|
2005-09-06 05:58:48 +00:00
|
|
|
Result.QuadPart = SignedInteger;
|
|
|
|
return Result;
|
|
|
|
}
|
|
|
|
|
|
|
|
static __inline
|
2005-06-20 19:28:45 +00:00
|
|
|
LARGE_INTEGER
|
2005-09-06 05:58:48 +00:00
|
|
|
NTAPI_INLINE
|
2005-06-20 19:28:45 +00:00
|
|
|
RtlEnlargedIntegerMultiply(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ LONG Multiplicand,
|
|
|
|
_In_ LONG Multiplier
|
2005-11-22 04:57:45 +00:00
|
|
|
)
|
2005-09-06 05:58:48 +00:00
|
|
|
{
|
|
|
|
LARGE_INTEGER Product;
|
2005-06-20 19:28:45 +00:00
|
|
|
|
2005-09-06 05:58:48 +00:00
|
|
|
Product.QuadPart = (LONGLONG)Multiplicand * (ULONGLONG)Multiplier;
|
|
|
|
return Product;
|
|
|
|
}
|
|
|
|
|
|
|
|
static __inline
|
2005-06-20 19:28:45 +00:00
|
|
|
ULONG
|
2005-09-06 05:58:48 +00:00
|
|
|
NTAPI_INLINE
|
2005-06-20 19:28:45 +00:00
|
|
|
RtlEnlargedUnsignedDivide(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULARGE_INTEGER Dividend,
|
|
|
|
_In_ ULONG Divisor,
|
|
|
|
_In_opt_ PULONG Remainder
|
2005-11-22 04:57:45 +00:00
|
|
|
)
|
2005-09-06 05:58:48 +00:00
|
|
|
{
|
|
|
|
ULONG Quotient;
|
2005-06-20 19:28:45 +00:00
|
|
|
|
2005-09-06 05:58:48 +00:00
|
|
|
Quotient = (ULONG)(Dividend.QuadPart / Divisor);
|
|
|
|
if (Remainder) {
|
|
|
|
*Remainder = (ULONG)(Dividend.QuadPart % Divisor);
|
|
|
|
}
|
|
|
|
|
|
|
|
return Quotient;
|
|
|
|
}
|
|
|
|
|
|
|
|
static __inline
|
2005-06-20 19:28:45 +00:00
|
|
|
LARGE_INTEGER
|
2005-09-06 05:58:48 +00:00
|
|
|
NTAPI_INLINE
|
2005-06-20 19:28:45 +00:00
|
|
|
RtlEnlargedUnsignedMultiply(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG Multiplicand,
|
|
|
|
_In_ ULONG Multiplier
|
2005-11-22 04:57:45 +00:00
|
|
|
)
|
2005-09-06 05:58:48 +00:00
|
|
|
{
|
|
|
|
LARGE_INTEGER Product;
|
|
|
|
|
|
|
|
Product.QuadPart = (ULONGLONG)Multiplicand * (ULONGLONG)Multiplier;
|
|
|
|
return Product;
|
|
|
|
}
|
2011-11-12 18:28:16 +00:00
|
|
|
|
2011-11-13 23:47:21 +00:00
|
|
|
#if defined(_AMD64_) || defined(_IA64_)
|
|
|
|
static __inline
|
|
|
|
LARGE_INTEGER
|
|
|
|
NTAPI_INLINE
|
|
|
|
RtlExtendedLargeIntegerDivide(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ LARGE_INTEGER Dividend,
|
|
|
|
_In_ ULONG Divisor,
|
|
|
|
_Out_opt_ PULONG Remainder)
|
2011-11-13 23:47:21 +00:00
|
|
|
{
|
|
|
|
LARGE_INTEGER ret;
|
|
|
|
ret.QuadPart = (ULONG64)Dividend.QuadPart / Divisor;
|
|
|
|
if (Remainder)
|
|
|
|
*Remainder = (ULONG)(Dividend.QuadPart % Divisor);
|
|
|
|
return ret;
|
|
|
|
}
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2011-11-13 23:47:21 +00:00
|
|
|
#else
|
2011-11-12 18:28:16 +00:00
|
|
|
NTSYSAPI
|
|
|
|
LARGE_INTEGER
|
|
|
|
NTAPI
|
|
|
|
RtlExtendedLargeIntegerDivide(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ LARGE_INTEGER Dividend,
|
|
|
|
_In_ ULONG Divisor,
|
|
|
|
_Out_opt_ PULONG Remainder
|
2011-11-12 18:28:16 +00:00
|
|
|
);
|
|
|
|
|
2011-11-13 23:47:21 +00:00
|
|
|
#endif /* defined(_AMD64_) || defined(_IA64_) */
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
ULONG
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2006-05-10 17:47:44 +00:00
|
|
|
RtlUniform(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PULONG Seed
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
|
|
|
|
2007-09-27 18:07:44 +00:00
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
RtlRandom(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Inout_ PULONG Seed
|
2007-09-27 18:07:44 +00:00
|
|
|
);
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
RtlComputeCrc32(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG InitialCrc,
|
|
|
|
_In_ PUCHAR Buffer,
|
|
|
|
_In_ ULONG Length
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
2005-06-20 19:58:43 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Network Functions
|
|
|
|
//
|
2015-04-04 07:38:39 +00:00
|
|
|
NTSYSAPI
|
|
|
|
PSTR
|
|
|
|
NTAPI
|
|
|
|
RtlIpv4AddressToStringA(
|
|
|
|
_In_ const struct in_addr *Addr,
|
|
|
|
_Out_writes_(16) PCHAR S
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
PWSTR
|
|
|
|
NTAPI
|
|
|
|
RtlIpv4AddressToStringW(
|
|
|
|
_In_ const struct in_addr *Addr,
|
|
|
|
_Out_writes_(16) PWCHAR S
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlIpv4AddressToStringExA(
|
|
|
|
_In_ const struct in_addr *Address,
|
|
|
|
_In_ USHORT Port,
|
|
|
|
_Out_writes_to_(*AddressStringLength, *AddressStringLength) PCHAR AddressString,
|
|
|
|
_Inout_ PULONG AddressStringLength
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlIpv4AddressToStringExW(
|
|
|
|
_In_ const struct in_addr *Address,
|
|
|
|
_In_ USHORT Port,
|
|
|
|
_Out_writes_to_(*AddressStringLength, *AddressStringLength) PWCHAR AddressString,
|
|
|
|
_Inout_ PULONG AddressStringLength
|
|
|
|
);
|
|
|
|
|
2014-01-19 14:56:13 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlIpv4StringToAddressA(
|
|
|
|
_In_ PCSTR String,
|
|
|
|
_In_ BOOLEAN Strict,
|
|
|
|
_Out_ PCSTR *Terminator,
|
|
|
|
_Out_ struct in_addr *Addr
|
|
|
|
);
|
|
|
|
|
2005-10-19 17:03:38 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlIpv4StringToAddressW(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PCWSTR String,
|
|
|
|
_In_ BOOLEAN Strict,
|
2014-01-19 14:56:13 +00:00
|
|
|
_Out_ PCWSTR *Terminator,
|
2013-01-13 14:49:21 +00:00
|
|
|
_Out_ struct in_addr *Addr
|
2005-10-19 17:03:38 +00:00
|
|
|
);
|
|
|
|
|
2014-01-19 14:56:13 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlIpv4StringToAddressExA(
|
|
|
|
_In_ PCSTR AddressString,
|
|
|
|
_In_ BOOLEAN Strict,
|
|
|
|
_Out_ struct in_addr *Address,
|
|
|
|
_Out_ PUSHORT Port
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlIpv4StringToAddressExW(
|
|
|
|
_In_ PCWSTR AddressString,
|
|
|
|
_In_ BOOLEAN Strict,
|
|
|
|
_Out_ struct in_addr *Address,
|
|
|
|
_Out_ PUSHORT Port
|
|
|
|
);
|
|
|
|
|
2015-04-04 07:38:39 +00:00
|
|
|
NTSYSAPI
|
|
|
|
PSTR
|
|
|
|
NTAPI
|
|
|
|
RtlIpv6AddressToStringA(
|
|
|
|
_In_ const struct in6_addr *Addr,
|
|
|
|
_Out_writes_(46) PSTR S
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
PWSTR
|
|
|
|
NTAPI
|
|
|
|
RtlIpv6AddressToStringW(
|
|
|
|
_In_ const struct in6_addr *Addr,
|
|
|
|
_Out_writes_(46) PWSTR S
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlIpv6AddressToStringExA(
|
|
|
|
_In_ const struct in6_addr *Address,
|
|
|
|
_In_ ULONG ScopeId,
|
|
|
|
_In_ USHORT Port,
|
|
|
|
_Out_writes_to_(*AddressStringLength, *AddressStringLength) PSTR AddressString,
|
|
|
|
_Inout_ PULONG AddressStringLength
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlIpv6AddressToStringExW(
|
|
|
|
_In_ const struct in6_addr *Address,
|
|
|
|
_In_ ULONG ScopeId,
|
|
|
|
_In_ USHORT Port,
|
|
|
|
_Out_writes_to_(*AddressStringLength, *AddressStringLength) PWCHAR AddressString,
|
|
|
|
_Inout_ PULONG AddressStringLength
|
|
|
|
);
|
|
|
|
|
2005-12-04 03:24:11 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlIpv6StringToAddressA(
|
2015-04-04 07:38:39 +00:00
|
|
|
_In_ PCSTR String,
|
|
|
|
_Out_ PCSTR *Terminator,
|
2013-01-13 14:49:21 +00:00
|
|
|
_Out_ struct in6_addr *Addr
|
2005-12-04 03:24:11 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlIpv6StringToAddressW(
|
2015-04-04 07:38:39 +00:00
|
|
|
_In_ PCWSTR String,
|
|
|
|
_Out_ PCWSTR *Terminator,
|
2013-01-13 14:49:21 +00:00
|
|
|
_Out_ struct in6_addr *Addr
|
2005-12-04 03:24:11 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlIpv6StringToAddressExA(
|
2015-04-04 07:38:39 +00:00
|
|
|
_In_ PCSTR AddressString,
|
|
|
|
_Out_ struct in6_addr *Address,
|
|
|
|
_Out_ PULONG ScopeId,
|
|
|
|
_Out_ PUSHORT Port
|
2005-12-04 03:24:11 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlIpv6StringToAddressExW(
|
2015-04-04 07:38:39 +00:00
|
|
|
_In_ PCWSTR AddressString,
|
|
|
|
_Out_ struct in6_addr *Address,
|
|
|
|
_Out_ PULONG ScopeId,
|
|
|
|
_Out_ PUSHORT Port
|
2005-12-04 03:24:11 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Time Functions
|
|
|
|
//
|
2021-04-03 07:38:07 +00:00
|
|
|
NTSYSAPI
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
RtlCutoverTimeToSystemTime(
|
|
|
|
_In_ PTIME_FIELDS CutoverTimeFields,
|
|
|
|
_Out_ PLARGE_INTEGER SystemTime,
|
|
|
|
_In_ PLARGE_INTEGER CurrentTime,
|
|
|
|
_In_ BOOLEAN ThisYearsCutoverOnly);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2013-01-13 14:49:21 +00:00
|
|
|
RtlQueryTimeZoneInformation(
|
|
|
|
_Out_ PRTL_TIME_ZONE_INFORMATION TimeZoneInformation);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlSecondsSince1970ToTime(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG SecondsSince1970,
|
|
|
|
_Out_ PLARGE_INTEGER Time
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2013-01-13 14:49:21 +00:00
|
|
|
RtlSetTimeZoneInformation(
|
|
|
|
_In_ PRTL_TIME_ZONE_INFORMATION TimeZoneInformation);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2021-06-22 08:28:47 +00:00
|
|
|
_Success_(return != FALSE)
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
BOOLEAN
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlTimeFieldsToTime(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PTIME_FIELDS TimeFields,
|
|
|
|
_Out_ PLARGE_INTEGER Time
|
2005-06-20 05:36:32 +00:00
|
|
|
);
|
|
|
|
|
2021-06-22 08:28:47 +00:00
|
|
|
_Success_(return != FALSE)
|
2008-02-11 12:49:21 +00:00
|
|
|
NTSYSAPI
|
2008-02-11 13:19:06 +00:00
|
|
|
BOOLEAN
|
2008-02-11 12:49:21 +00:00
|
|
|
NTAPI
|
|
|
|
RtlTimeToSecondsSince1970(
|
2013-01-22 22:51:51 +00:00
|
|
|
_In_ PLARGE_INTEGER Time,
|
|
|
|
_Out_ PULONG ElapsedSeconds
|
2008-02-11 12:49:21 +00:00
|
|
|
);
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
VOID
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlTimeToTimeFields(
|
|
|
|
PLARGE_INTEGER Time,
|
|
|
|
PTIME_FIELDS TimeFields
|
|
|
|
);
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlSystemTimeToLocalTime(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PLARGE_INTEGER SystemTime,
|
|
|
|
_Out_ PLARGE_INTEGER LocalTime
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Version Functions
|
|
|
|
//
|
2013-01-13 14:49:21 +00:00
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
|
|
|
_Must_inspect_result_
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
RtlVerifyVersionInfo(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_OSVERSIONINFOEXW VersionInfo,
|
|
|
|
_In_ ULONG TypeMask,
|
|
|
|
_In_ ULONGLONG ConditionMask
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
2005-09-05 18:06:20 +00:00
|
|
|
NTSYSAPI
|
2005-06-20 05:36:32 +00:00
|
|
|
NTSTATUS
|
2005-09-05 18:06:20 +00:00
|
|
|
NTAPI
|
2013-01-13 14:49:21 +00:00
|
|
|
RtlGetVersion(
|
|
|
|
_Out_
|
|
|
|
_At_(lpVersionInformation->dwOSVersionInfoSize, _Pre_ _Valid_)
|
|
|
|
_When_(lpVersionInformation->dwOSVersionInfoSize == sizeof(RTL_OSVERSIONINFOEXW),
|
|
|
|
_At_((PRTL_OSVERSIONINFOEXW)lpVersionInformation, _Out_))
|
|
|
|
PRTL_OSVERSIONINFOW lpVersionInformation
|
|
|
|
);
|
2005-06-18 23:33:40 +00:00
|
|
|
|
2020-08-08 14:32:12 +00:00
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
2005-10-19 17:03:38 +00:00
|
|
|
NTSYSAPI
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
2020-02-28 12:14:36 +00:00
|
|
|
RtlGetNtProductType(_Out_ PNT_PRODUCT_TYPE ProductType);
|
2005-09-08 06:52:01 +00:00
|
|
|
|
2006-06-23 21:21:45 +00:00
|
|
|
//
|
|
|
|
// Secure Memory Functions
|
|
|
|
//
|
|
|
|
#ifdef NTOS_MODE_USER
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlRegisterSecureMemoryCacheCallback(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PRTL_SECURE_MEMORY_CACHE_CALLBACK Callback);
|
2006-06-23 21:21:45 +00:00
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
RtlFlushSecureMemoryCache(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID MemoryCache,
|
|
|
|
_In_opt_ SIZE_T MemoryLength
|
2006-06-23 21:21:45 +00:00
|
|
|
);
|
|
|
|
#endif
|
|
|
|
|
2010-06-26 09:49:31 +00:00
|
|
|
//
|
|
|
|
// Boot Status Data Functions
|
|
|
|
//
|
|
|
|
#ifdef NTOS_MODE_USER
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlCreateBootStatusDataFile(
|
|
|
|
VOID
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlGetSetBootStatusData(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE FileHandle,
|
|
|
|
_In_ BOOLEAN WriteMode,
|
|
|
|
_In_ RTL_BSD_ITEM_TYPE DataClass,
|
|
|
|
_In_ PVOID Buffer,
|
|
|
|
_In_ ULONG BufferSize,
|
|
|
|
_Out_opt_ PULONG ReturnLength
|
2010-06-26 09:49:31 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlLockBootStatusData(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Out_ PHANDLE FileHandle
|
2010-06-26 09:49:31 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlUnlockBootStatusData(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE FileHandle
|
2010-06-26 09:49:31 +00:00
|
|
|
);
|
|
|
|
#endif
|
|
|
|
|
2011-08-19 17:45:34 +00:00
|
|
|
#ifdef NTOS_MODE_USER
|
2013-07-07 07:56:46 +00:00
|
|
|
_Must_inspect_result_
|
2011-08-19 17:45:34 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlGUIDFromString(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PUNICODE_STRING GuidString,
|
|
|
|
_Out_ GUID *Guid);
|
2012-02-04 21:16:52 +00:00
|
|
|
|
2013-07-07 07:56:46 +00:00
|
|
|
_Must_inspect_result_
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlStringFromGUID(
|
|
|
|
_In_ REFGUID Guid,
|
|
|
|
_Out_ _At_(GuidString->Buffer, __drv_allocatesMem(Mem))
|
|
|
|
PUNICODE_STRING GuidString);
|
|
|
|
|
2012-01-15 03:16:00 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlComputeImportTableHash(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE hFile,
|
|
|
|
_Out_ PCHAR Hash,
|
|
|
|
_In_ ULONG ImportTableHashRevision
|
2012-01-15 03:16:00 +00:00
|
|
|
);
|
2011-08-19 17:45:34 +00:00
|
|
|
#endif
|
|
|
|
|
2013-10-19 17:48:27 +00:00
|
|
|
//
|
|
|
|
// MemoryStream functions
|
|
|
|
//
|
|
|
|
#ifdef NTOS_MODE_USER
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlInitMemoryStream(
|
|
|
|
_Out_ PRTL_MEMORY_STREAM Stream
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlInitOutOfProcessMemoryStream(
|
|
|
|
_Out_ PRTL_MEMORY_STREAM Stream
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlFinalReleaseOutOfProcessMemoryStream(
|
|
|
|
_In_ PRTL_MEMORY_STREAM Stream
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
HRESULT
|
|
|
|
NTAPI
|
2014-01-07 20:23:44 +00:00
|
|
|
RtlQueryInterfaceMemoryStream(
|
2013-10-19 17:48:27 +00:00
|
|
|
_In_ struct IStream *This,
|
|
|
|
_In_ REFIID RequestedIid,
|
|
|
|
_Outptr_ PVOID *ResultObject
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
2014-01-07 20:23:44 +00:00
|
|
|
RtlAddRefMemoryStream(
|
2013-10-19 17:48:27 +00:00
|
|
|
_In_ struct IStream *This
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
2014-01-07 20:23:44 +00:00
|
|
|
RtlReleaseMemoryStream(
|
2013-10-19 17:48:27 +00:00
|
|
|
_In_ struct IStream *This
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
HRESULT
|
|
|
|
NTAPI
|
2014-01-07 20:23:44 +00:00
|
|
|
RtlReadMemoryStream(
|
2013-10-19 17:48:27 +00:00
|
|
|
_In_ struct IStream *This,
|
|
|
|
_Out_writes_bytes_(Length) PVOID Buffer,
|
|
|
|
_In_ ULONG Length,
|
|
|
|
_Out_opt_ PULONG BytesRead
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
HRESULT
|
|
|
|
NTAPI
|
2014-01-07 20:23:44 +00:00
|
|
|
RtlReadOutOfProcessMemoryStream(
|
2013-10-19 17:48:27 +00:00
|
|
|
_In_ struct IStream *This,
|
|
|
|
_Out_writes_bytes_(Length) PVOID Buffer,
|
|
|
|
_In_ ULONG Length,
|
|
|
|
_Out_opt_ PULONG BytesRead
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
HRESULT
|
|
|
|
NTAPI
|
2014-01-07 20:23:44 +00:00
|
|
|
RtlSeekMemoryStream(
|
2013-10-19 17:48:27 +00:00
|
|
|
_In_ struct IStream *This,
|
|
|
|
_In_ LARGE_INTEGER RelativeOffset,
|
|
|
|
_In_ ULONG Origin,
|
|
|
|
_Out_opt_ PULARGE_INTEGER ResultOffset
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
HRESULT
|
|
|
|
NTAPI
|
2014-01-07 20:23:44 +00:00
|
|
|
RtlCopyMemoryStreamTo(
|
2013-10-19 17:48:27 +00:00
|
|
|
_In_ struct IStream *This,
|
|
|
|
_In_ struct IStream *Target,
|
|
|
|
_In_ ULARGE_INTEGER Length,
|
|
|
|
_Out_opt_ PULARGE_INTEGER BytesRead,
|
|
|
|
_Out_opt_ PULARGE_INTEGER BytesWritten
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
HRESULT
|
|
|
|
NTAPI
|
2014-01-07 20:23:44 +00:00
|
|
|
RtlCopyOutOfProcessMemoryStreamTo(
|
2013-10-19 17:48:27 +00:00
|
|
|
_In_ struct IStream *This,
|
|
|
|
_In_ struct IStream *Target,
|
|
|
|
_In_ ULARGE_INTEGER Length,
|
|
|
|
_Out_opt_ PULARGE_INTEGER BytesRead,
|
|
|
|
_Out_opt_ PULARGE_INTEGER BytesWritten
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
HRESULT
|
|
|
|
NTAPI
|
2014-01-07 20:23:44 +00:00
|
|
|
RtlStatMemoryStream(
|
2013-10-19 17:48:27 +00:00
|
|
|
_In_ struct IStream *This,
|
|
|
|
_Out_ struct tagSTATSTG *Stats,
|
|
|
|
_In_ ULONG Flags
|
|
|
|
);
|
|
|
|
|
|
|
|
// Dummy functions
|
|
|
|
NTSYSAPI
|
|
|
|
HRESULT
|
|
|
|
NTAPI
|
2014-01-07 20:23:44 +00:00
|
|
|
RtlWriteMemoryStream(
|
2013-10-19 17:48:27 +00:00
|
|
|
_In_ struct IStream *This,
|
|
|
|
_In_reads_bytes_(Length) CONST VOID *Buffer,
|
|
|
|
_In_ ULONG Length,
|
|
|
|
_Out_opt_ PULONG BytesWritten
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
HRESULT
|
|
|
|
NTAPI
|
2014-01-07 20:23:44 +00:00
|
|
|
RtlSetMemoryStreamSize(
|
2013-10-19 17:48:27 +00:00
|
|
|
_In_ struct IStream *This,
|
|
|
|
_In_ ULARGE_INTEGER NewSize
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
HRESULT
|
|
|
|
NTAPI
|
2014-01-07 20:23:44 +00:00
|
|
|
RtlCommitMemoryStream(
|
2013-10-19 17:48:27 +00:00
|
|
|
_In_ struct IStream *This,
|
|
|
|
_In_ ULONG CommitFlags
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
HRESULT
|
|
|
|
NTAPI
|
2014-01-07 20:23:44 +00:00
|
|
|
RtlRevertMemoryStream(
|
2013-10-19 17:48:27 +00:00
|
|
|
_In_ struct IStream *This
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
HRESULT
|
|
|
|
NTAPI
|
2014-01-07 20:23:44 +00:00
|
|
|
RtlLockMemoryStreamRegion(
|
2013-10-19 17:48:27 +00:00
|
|
|
_In_ struct IStream *This,
|
|
|
|
_In_ ULARGE_INTEGER Offset,
|
|
|
|
_In_ ULARGE_INTEGER Length,
|
|
|
|
_In_ ULONG LockType
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
HRESULT
|
|
|
|
NTAPI
|
2014-01-07 20:23:44 +00:00
|
|
|
RtlUnlockMemoryStreamRegion(
|
2013-10-19 17:48:27 +00:00
|
|
|
_In_ struct IStream *This,
|
|
|
|
_In_ ULARGE_INTEGER Offset,
|
|
|
|
_In_ ULARGE_INTEGER Length,
|
|
|
|
_In_ ULONG LockType
|
|
|
|
);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
HRESULT
|
|
|
|
NTAPI
|
2014-01-07 20:23:44 +00:00
|
|
|
RtlCloneMemoryStream(
|
2013-10-19 17:48:27 +00:00
|
|
|
_In_ struct IStream *This,
|
|
|
|
_Outptr_ struct IStream **ResultStream
|
|
|
|
);
|
|
|
|
|
2019-10-02 08:50:59 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlGetNativeSystemInformation(
|
|
|
|
_In_ SYSTEM_INFORMATION_CLASS SystemInformationClass,
|
|
|
|
_Out_writes_bytes_to_opt_(SystemInformationLength, *ReturnLength) PVOID SystemInformation,
|
|
|
|
_In_ ULONG SystemInformationLength,
|
|
|
|
_Out_opt_ PULONG ReturnLength
|
|
|
|
);
|
|
|
|
|
2023-09-06 22:40:53 +00:00
|
|
|
#if (_WIN32_WINNT >= _WIN32_WINNT_VISTA) || (DLL_EXPORT_VERSION >= _WIN32_WINNT_VISTA)
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlRunOnceInitialize(
|
|
|
|
_Out_ PRTL_RUN_ONCE RunOnce);
|
|
|
|
|
|
|
|
_Maybe_raises_SEH_exception_
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlRunOnceExecuteOnce(
|
|
|
|
_Inout_ PRTL_RUN_ONCE RunOnce,
|
|
|
|
_In_ __inner_callback PRTL_RUN_ONCE_INIT_FN InitFn,
|
|
|
|
_Inout_opt_ PVOID Parameter,
|
|
|
|
_Outptr_opt_result_maybenull_ PVOID *Context);
|
|
|
|
|
|
|
|
_Must_inspect_result_
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlRunOnceBeginInitialize(
|
|
|
|
_Inout_ PRTL_RUN_ONCE RunOnce,
|
|
|
|
_In_ ULONG Flags,
|
|
|
|
_Outptr_opt_result_maybenull_ PVOID *Context);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlRunOnceComplete(
|
|
|
|
_Inout_ PRTL_RUN_ONCE RunOnce,
|
|
|
|
_In_ ULONG Flags,
|
|
|
|
_In_opt_ PVOID Context);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2021-01-29 17:41:38 +00:00
|
|
|
#if (_WIN32_WINNT >= _WIN32_WINNT_VISTA) || (defined(__REACTOS__) && defined(_NTDLLBUILD_))
|
|
|
|
/* Put NTSYSAPI back when this will be really exported. Only statically linked for now */
|
|
|
|
// NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlInitializeSRWLock(OUT PRTL_SRWLOCK SRWLock);
|
|
|
|
|
|
|
|
// NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlAcquireSRWLockShared(IN OUT PRTL_SRWLOCK SRWLock);
|
|
|
|
|
|
|
|
// NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlAcquireSRWLockExclusive(IN OUT PRTL_SRWLOCK SRWLock);
|
|
|
|
|
|
|
|
// NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlReleaseSRWLockShared(IN OUT PRTL_SRWLOCK SRWLock);
|
|
|
|
|
|
|
|
// NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
RtlReleaseSRWLockExclusive(IN OUT PRTL_SRWLOCK SRWLock);
|
|
|
|
|
|
|
|
#endif /* Win vista or Reactos Ntdll build */
|
|
|
|
|
|
|
|
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7) || (defined(__REACTOS__) && defined(_NTDLLBUILD_))
|
|
|
|
|
|
|
|
// NTSYSAPI
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
RtlTryAcquireSRWLockShared(PRTL_SRWLOCK SRWLock);
|
|
|
|
|
|
|
|
// NTSYSAPI
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
RtlTryAcquireSRWLockExclusive(PRTL_SRWLOCK SRWLock);
|
|
|
|
|
|
|
|
#endif /* Win7 or Reactos Ntdll build */
|
|
|
|
|
2013-10-19 17:48:27 +00:00
|
|
|
#endif // NTOS_MODE_USER
|
|
|
|
|
2014-05-08 14:09:06 +00:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlFindActivationContextSectionGuid(
|
|
|
|
ULONG flags,
|
|
|
|
const GUID *extguid,
|
|
|
|
ULONG section_kind,
|
|
|
|
const GUID *guid,
|
|
|
|
void *ptr
|
|
|
|
);
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2005-06-18 23:33:40 +00:00
|
|
|
#endif
|