ReactOS 0.4.15-dev-5895-g2687c1b
rtlp.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _RTL_BITMAP64
 
struct  _RTL_BITMAP_RUN64
 

Macros

#define PAGED_CODE_RTL()
 
#define SWAPD(x)   (x)
 
#define SWAPW(x)   (x)
 
#define SWAPQ(x)   (x)
 
#define ROUND_DOWN(n, align)    (((ULONG_PTR)(n)) & ~((align) - 1l))
 
#define ROUND_UP(n, align)    ROUND_DOWN(((ULONG_PTR)(n)) + (align) - 1, (align))
 
#define RVA(m, b)   ((PVOID)((ULONG_PTR)(b) + (ULONG_PTR)(m)))
 
#define RtlpAllocateStringMemory   RtlpAllocateMemory
 
#define RtlpFreeStringMemory   RtlpFreeMemory
 
#define NtGetTickCount   RtlGetTickCount
 
#define TAG_USTR   'RTSU'
 
#define TAG_ASTR   'RTSA'
 
#define TAG_OSTR   'RTSO'
 

Typedefs

typedef struct _RTL_BITMAP64 RTL_BITMAP64
 
typedef struct _RTL_BITMAP64PRTL_BITMAP64
 
typedef struct _RTL_BITMAP_RUN64 RTL_BITMAP_RUN64
 
typedef struct _RTL_BITMAP_RUN64PRTL_BITMAP_RUN64
 

Functions

NTSTATUS NTAPI RtlpSafeCopyMemory (_Out_writes_bytes_all_(Length) VOID UNALIGNED *Destination, _In_reads_bytes_(Length) CONST VOID UNALIGNED *Source, _In_ SIZE_T Length)
 
VOID NTAPI RtlpGetStackLimits (PULONG_PTR LowLimit, PULONG_PTR HighLimit)
 
VOID NTAPI RtlpSetHeapParameters (IN PRTL_HEAP_PARAMETERS Parameters)
 
BOOLEAN NTAPI RtlCallVectoredExceptionHandlers (IN PEXCEPTION_RECORD ExceptionRecord, IN PCONTEXT Context)
 
VOID NTAPI RtlCallVectoredContinueHandlers (IN PEXCEPTION_RECORD ExceptionRecord, IN PCONTEXT Context)
 
PVOID NTAPI RtlpAllocateMemory (SIZE_T Bytes, ULONG Tag)
 
VOID NTAPI RtlpFreeMemory (PVOID Mem, ULONG Tag)
 
KPROCESSOR_MODE NTAPI RtlpGetMode (VOID)
 
BOOLEAN NTAPI RtlpCaptureStackLimits (IN ULONG_PTR Ebp, IN ULONG_PTR *StackBegin, IN ULONG_PTR *StackEnd)
 
NTSTATUS NTAPI RtlDeleteHeapLock (IN OUT PHEAP_LOCK Lock)
 
NTSTATUS NTAPI RtlEnterHeapLock (IN OUT PHEAP_LOCK Lock, IN BOOLEAN Exclusive)
 
BOOLEAN NTAPI RtlTryEnterHeapLock (IN OUT PHEAP_LOCK Lock, IN BOOLEAN Exclusive)
 
NTSTATUS NTAPI RtlInitializeHeapLock (IN OUT PHEAP_LOCK *Lock)
 
NTSTATUS NTAPI RtlLeaveHeapLock (IN OUT PHEAP_LOCK Lock)
 
BOOLEAN NTAPI RtlpCheckForActiveDebugger (VOID)
 
BOOLEAN NTAPI RtlpHandleDpcStackException (IN PEXCEPTION_REGISTRATION_RECORD RegistrationFrame, IN ULONG_PTR RegistrationFrameEnd, IN OUT PULONG_PTR StackLow, IN OUT PULONG_PTR StackHigh)
 
ULONG NTAPI RtlGetTickCount (VOID)
 
BOOLEAN NTAPI RtlpSetInDbgPrint (VOID)
 
VOID NTAPI RtlpClearInDbgPrint (VOID)
 
EXCEPTION_DISPOSITION NTAPI RtlpExecuteHandlerForUnwind (PEXCEPTION_RECORD ExceptionRecord, PEXCEPTION_REGISTRATION_RECORD RegistrationFrame, PCONTEXT Context, PVOID DispatcherContext, PEXCEPTION_ROUTINE ExceptionHandler)
 
VOID NTAPI RtlpCheckLogException (IN PEXCEPTION_RECORD ExceptionRecord, IN PCONTEXT ContextRecord, IN PVOID ContextData, IN ULONG Size)
 
VOID NTAPI RtlpCaptureContext (OUT PCONTEXT ContextRecord)
 
ULONG NTAPI DebugService (IN ULONG Service, IN PVOID Argument1, IN PVOID Argument2, IN PVOID Argument3, IN PVOID Argument4)
 
VOID NTAPI DebugService2 (IN PVOID Argument1, IN PVOID Argument2, IN ULONG Service)
 
NTSTATUS RtlpInitializeTimerThread (VOID)
 
WCHAR NTAPI RtlpUpcaseUnicodeChar (IN WCHAR Source)
 
WCHAR NTAPI RtlpDowncaseUnicodeChar (IN WCHAR Source)
 
VOID NTAPI LdrpInitializeProcessCompat (PVOID pProcessActctx, PVOID *pOldShimData)
 
PVOID NTAPI RtlpDebugBufferCommit (_Inout_ PRTL_DEBUG_INFORMATION Buffer, _In_ SIZE_T Size)
 

Variables

PVOID MmHighestUserAddress
 
HANDLE TimerThreadHandle
 

Macro Definition Documentation

◆ NtGetTickCount

#define NtGetTickCount   RtlGetTickCount

Definition at line 163 of file rtlp.h.

◆ PAGED_CODE_RTL

#define PAGED_CODE_RTL ( )

Definition at line 16 of file rtlp.h.

◆ ROUND_DOWN

#define ROUND_DOWN (   n,
  align 
)     (((ULONG_PTR)(n)) & ~((align) - 1l))

Definition at line 29 of file rtlp.h.

◆ ROUND_UP

#define ROUND_UP (   n,
  align 
)     ROUND_DOWN(((ULONG_PTR)(n)) + (align) - 1, (align))

Definition at line 32 of file rtlp.h.

◆ RtlpAllocateStringMemory

#define RtlpAllocateStringMemory   RtlpAllocateMemory

Definition at line 155 of file rtlp.h.

◆ RtlpFreeStringMemory

#define RtlpFreeStringMemory   RtlpFreeMemory

Definition at line 156 of file rtlp.h.

◆ RVA

#define RVA (   m,
  b 
)    ((PVOID)((ULONG_PTR)(b) + (ULONG_PTR)(m)))

Definition at line 35 of file rtlp.h.

◆ SWAPD

#define SWAPD (   x)    (x)

Definition at line 24 of file rtlp.h.

◆ SWAPQ

#define SWAPQ (   x)    (x)

Definition at line 26 of file rtlp.h.

◆ SWAPW

#define SWAPW (   x)    (x)

Definition at line 25 of file rtlp.h.

◆ TAG_ASTR

#define TAG_ASTR   'RTSA'

Definition at line 252 of file rtlp.h.

◆ TAG_OSTR

#define TAG_OSTR   'RTSO'

Definition at line 253 of file rtlp.h.

◆ TAG_USTR

#define TAG_USTR   'RTSU'

Definition at line 251 of file rtlp.h.

Typedef Documentation

◆ PRTL_BITMAP64

◆ PRTL_BITMAP_RUN64

◆ RTL_BITMAP64

◆ RTL_BITMAP_RUN64

Function Documentation

◆ DebugService()

ULONG NTAPI DebugService ( IN ULONG  Service,
IN PVOID  Argument1,
IN PVOID  Argument2,
IN PVOID  Argument3,
IN PVOID  Argument4 
)

Referenced by DebugPrint(), and DebugPrompt().

◆ DebugService2()

VOID NTAPI DebugService2 ( IN PVOID  Argument1,
IN PVOID  Argument2,
IN ULONG  Service 
)

◆ LdrpInitializeProcessCompat()

VOID NTAPI LdrpInitializeProcessCompat ( PVOID  pProcessActctx,
PVOID pOldShimData 
)

Definition at line 1576 of file ldrinit.c.

1577{
1578 static const struct
1579 {
1580 const GUID* Guid;
1581 const DWORD Version;
1582 } KnownCompatGuids[] = {
1583 { &COMPAT_GUID_WIN10, _WIN32_WINNT_WIN10 },
1584 { &COMPAT_GUID_WIN81, _WIN32_WINNT_WINBLUE },
1585 { &COMPAT_GUID_WIN8, _WIN32_WINNT_WIN8 },
1586 { &COMPAT_GUID_WIN7, _WIN32_WINNT_WIN7 },
1587 { &COMPAT_GUID_VISTA, _WIN32_WINNT_VISTA },
1588 };
1589
1590 ULONG Buffer[(sizeof(COMPATIBILITY_CONTEXT_ELEMENT) * 10 + sizeof(ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION)) / sizeof(ULONG)];
1591 ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION* ContextCompatInfo;
1592 SIZE_T SizeRequired;
1594 DWORD n, cur;
1595 ReactOS_ShimData* pShimData = *pOldShimData;
1596
1597 if (pShimData)
1598 {
1599 if (pShimData->dwMagic != REACTOS_SHIMDATA_MAGIC ||
1600 pShimData->dwSize != sizeof(ReactOS_ShimData))
1601 {
1602 DPRINT1("LdrpInitializeProcessCompat: Corrupt pShimData (0x%x, %u)\n", pShimData->dwMagic, pShimData->dwSize);
1603 return;
1604 }
1605 if (pShimData->dwRosProcessCompatVersion)
1606 {
1608 {
1609 DPRINT1("LdrpInitializeProcessCompat: ProcessCompatVersion set to ignore manifest\n");
1610 }
1611 else
1612 {
1613 DPRINT1("LdrpInitializeProcessCompat: ProcessCompatVersion already set to 0x%x\n", pShimData->dwRosProcessCompatVersion);
1614 }
1615 return;
1616 }
1617 }
1618
1619 SizeRequired = sizeof(Buffer);
1621 pProcessActctx,
1622 NULL,
1623 CompatibilityInformationInActivationContext,
1624 Buffer,
1625 sizeof(Buffer),
1626 &SizeRequired);
1627
1628 if (!NT_SUCCESS(Status))
1629 {
1630 DPRINT1("LdrpInitializeProcessCompat: Unable to query process actctx with status %x\n", Status);
1631 return;
1632 }
1633
1634 ContextCompatInfo = (ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION*)Buffer;
1635 /* No Compatibility elements present, bail out */
1636 if (ContextCompatInfo->ElementCount == 0)
1637 return;
1638
1639 /* Search for known GUIDs, starting from oldest to newest.
1640 Note that on Windows it is somewhat reversed, starting from the latest known
1641 version, going down. But we are not Windows, trying to allow a lower version,
1642 we are ReactOS trying to fake a higher version. So we interpret what Windows
1643 does as "try the closest version to the actual version", so we start with the
1644 lowest version, which is closest to Windows 2003, which we mostly are. */
1645 for (cur = RTL_NUMBER_OF(KnownCompatGuids) - 1; cur != -1; --cur)
1646 {
1647 for (n = 0; n < ContextCompatInfo->ElementCount; ++n)
1648 {
1649 if (ContextCompatInfo->Elements[n].Type == ACTCTX_COMPATIBILITY_ELEMENT_TYPE_OS &&
1650 RtlCompareMemory(&ContextCompatInfo->Elements[n].Id, KnownCompatGuids[cur].Guid, sizeof(GUID)) == sizeof(GUID))
1651 {
1653 {
1654 DPRINT1("LdrpInitializeProcessCompat: Not applying automatic fix for winver 0x%x due to policy\n", KnownCompatGuids[cur].Version);
1655 return;
1656 }
1657
1658 /* If this process did not need shim data before, allocate and store it */
1659 if (pShimData == NULL)
1660 {
1661 PPEB Peb = NtCurrentPeb();
1662
1663 ASSERT(Peb->pShimData == NULL);
1664 pShimData = RtlAllocateHeap(Peb->ProcessHeap, HEAP_ZERO_MEMORY, sizeof(*pShimData));
1665
1666 if (!pShimData)
1667 {
1668 DPRINT1("LdrpInitializeProcessCompat: Unable to allocated %u bytes\n", sizeof(*pShimData));
1669 return;
1670 }
1671
1672 pShimData->dwSize = sizeof(*pShimData);
1673 pShimData->dwMagic = REACTOS_SHIMDATA_MAGIC;
1674
1675 Peb->pShimData = pShimData;
1676 *pOldShimData = pShimData;
1677 }
1678
1679 /* Store the lowest found version, and bail out. */
1680 pShimData->dwRosProcessCompatVersion = KnownCompatGuids[cur].Version;
1681 DPRINT1("LdrpInitializeProcessCompat: Found guid for winver 0x%x in manifest from %wZ\n",
1682 KnownCompatGuids[cur].Version,
1683 &(NtCurrentPeb()->ProcessParameters->ImagePathName));
1684 return;
1685 }
1686 }
1687 }
1688}
#define NtCurrentPeb()
Definition: FLS.c:22
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
Definition: bufpool.h:45
#define REACTOS_SHIMDATA_MAGIC
Definition: compat_undoc.h:15
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
PPEB Peb
Definition: dllmain.c:27
#define RtlCompareMemory(s1, s2, l)
Definition: env_spec_w32.h:465
unsigned long DWORD
Definition: ntddk_ex.h:95
FxCollectionEntry * cur
Status
Definition: gdiplustypes.h:25
GLdouble n
Definition: glext.h:7729
#define REACTOS_COMPATVERSION_IGNOREMANIFEST
Definition: hsdb.c:32
NTSYSAPI NTSTATUS WINAPI RtlQueryInformationActivationContext(ULONG, HANDLE, PVOID, ULONG, PVOID, SIZE_T, SIZE_T *)
Definition: actctx.c:5515
BOOLEAN NTAPI LdrpDisableProcessCompatGuidDetection(VOID)
Definition: ldrinit.c:1542
#define ASSERT(a)
Definition: mode.c:44
#define RTL_QUERY_ACTIVATION_CONTEXT_FLAG_NO_ADDREF
Definition: rtltypes.h:119
#define _WIN32_WINNT_WIN10
Definition: sdkddkver.h:32
#define _WIN32_WINNT_WINBLUE
Definition: sdkddkver.h:30
#define _WIN32_WINNT_WIN8
Definition: sdkddkver.h:29
#define _WIN32_WINNT_WIN7
Definition: sdkddkver.h:28
#define _WIN32_WINNT_VISTA
Definition: sdkddkver.h:25
PVOID ProcessHeap
Definition: ntddk_ex.h:249
DWORD dwRosProcessCompatVersion
Definition: compat_undoc.h:11
ULONG_PTR SIZE_T
Definition: typedefs.h:80
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE _In_ USHORT _In_ USHORT Version
Definition: wdffdo.h:469
_Must_inspect_result_ _In_ WDFOBJECT _In_ CONST GUID * Guid
Definition: wdfobject.h:762

Referenced by actctx_init().

◆ RtlCallVectoredContinueHandlers()

VOID NTAPI RtlCallVectoredContinueHandlers ( IN PEXCEPTION_RECORD  ExceptionRecord,
IN PCONTEXT  Context 
)

Definition at line 284 of file vectoreh.c.

286{
287 /*
288 * Call the shared routine (ignoring result,
289 * execution always continues at this point)
290 */
291 (VOID)RtlpCallVectoredHandlers(ExceptionRecord,
292 Context,
294}
#define VOID
Definition: acefi.h:82
BOOLEAN NTAPI RtlpCallVectoredHandlers(IN PEXCEPTION_RECORD ExceptionRecord, IN PCONTEXT Context, IN PLIST_ENTRY VectoredHandlerList)
Definition: vectoreh.c:40
LIST_ENTRY RtlpVectoredContinueList
Definition: vectoreh.c:17

◆ RtlCallVectoredExceptionHandlers()

BOOLEAN NTAPI RtlCallVectoredExceptionHandlers ( IN PEXCEPTION_RECORD  ExceptionRecord,
IN PCONTEXT  Context 
)

Definition at line 273 of file vectoreh.c.

275{
276 /* Call the shared routine */
277 return RtlpCallVectoredHandlers(ExceptionRecord,
278 Context,
280}
LIST_ENTRY RtlpVectoredExceptionList
Definition: vectoreh.c:17

◆ RtlDeleteHeapLock()

NTSTATUS NTAPI RtlDeleteHeapLock ( IN OUT PHEAP_LOCK  Lock)

Definition at line 101 of file libsupp.c.

102{
103 return RtlDeleteCriticalSection(&Lock->CriticalSection);
104}
NTSYSAPI NTSTATUS NTAPI RtlDeleteCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
Definition: wdfsync.h:127

Referenced by RtlDestroyHeap(), and RtlpPageHeapDestroy().

◆ RtlEnterHeapLock()

◆ RtlGetTickCount()

ULONG NTAPI RtlGetTickCount ( VOID  )

Definition at line 1058 of file libsupp.c.

1059{
1060 ULARGE_INTEGER TickCount;
1061
1062#ifdef _WIN64
1063 TickCount.QuadPart = *((volatile ULONG64*)&SharedUserData->TickCount);
1064#else
1065 while (TRUE)
1066 {
1067 TickCount.HighPart = (ULONG)SharedUserData->TickCount.High1Time;
1068 TickCount.LowPart = SharedUserData->TickCount.LowPart;
1069
1070 if (TickCount.HighPart == (ULONG)SharedUserData->TickCount.High2Time)
1071 break;
1072
1074 }
1075#endif
1076
1077 return (ULONG)((UInt32x32To64(TickCount.LowPart,
1078 SharedUserData->TickCountMultiplier) >> 24) +
1079 UInt32x32To64((TickCount.HighPart << 8) & 0xFFFFFFFF,
1080 SharedUserData->TickCountMultiplier));
1081}
#define TRUE
Definition: types.h:120
#define UInt32x32To64(a, b)
Definition: intsafe.h:252
if(dx< 0)
Definition: linetemp.h:194
unsigned __int64 ULONG64
Definition: imports.h:198
#define YieldProcessor
Definition: ke.h:48
#define SharedUserData
$ULONG LowPart
Definition: ntbasedef.h:569
ULONGLONG QuadPart
Definition: ms-dtyp.idl:185
$ULONG HighPart
Definition: ntbasedef.h:570

◆ RtlInitializeHeapLock()

NTSTATUS NTAPI RtlInitializeHeapLock ( IN OUT PHEAP_LOCK Lock)

Definition at line 126 of file libsupp.c.

127{
128 return RtlInitializeCriticalSection(&(*Lock)->CriticalSection);
129}
NTSYSAPI NTSTATUS NTAPI RtlInitializeCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)

Referenced by RtlpDphInitializeDelayedFreeQueue(), RtlpDphProcessStartupInitialization(), RtlpInitializeHeap(), and RtlpPageHeapCreate().

◆ RtlLeaveHeapLock()

◆ RtlpAllocateMemory()

PVOID NTAPI RtlpAllocateMemory ( SIZE_T  Bytes,
ULONG  Tag 
)

Definition at line 35 of file libsupp.c.

37{
39}
PVOID FrLdrHeapAllocateEx(PVOID HeapHandle, SIZE_T ByteSize, ULONG Tag)
Definition: heap.c:320
PVOID FrLdrDefaultHeap
Definition: heap.c:34
_In_ UINT Bytes
Definition: mmcopy.h:9
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4065

◆ RtlpCaptureContext()

VOID NTAPI RtlpCaptureContext ( OUT PCONTEXT  ContextRecord)

Referenced by RtlUnwind().

◆ RtlpCaptureStackLimits()

BOOLEAN NTAPI RtlpCaptureStackLimits ( IN ULONG_PTR  Ebp,
IN ULONG_PTR StackBegin,
IN ULONG_PTR StackEnd 
)

Definition at line 211 of file libsupp.c.

214{
215 /* FIXME: Verify */
216 *StackBegin = (ULONG_PTR)NtCurrentTeb()->NtTib.StackLimit;
217 *StackEnd = (ULONG_PTR)NtCurrentTeb()->NtTib.StackBase;
218 return TRUE;
219}
#define ULONG_PTR
Definition: config.h:101
#define NtCurrentTeb

Referenced by RtlWalkFrameChain().

◆ RtlpCheckForActiveDebugger()

BOOLEAN NTAPI RtlpCheckForActiveDebugger ( VOID  )

Definition at line 25 of file libsupp.c.

26{
27 /* Return the flag in the PEB */
28 return NtCurrentPeb()->BeingDebugged;
29}

Referenced by RtlRaiseException(), RtlRaiseStatus(), and vDbgPrintExWithPrefixInternal().

◆ RtlpCheckLogException()

VOID NTAPI RtlpCheckLogException ( IN PEXCEPTION_RECORD  ExceptionRecord,
IN PCONTEXT  ContextRecord,
IN PVOID  ContextData,
IN ULONG  Size 
)

Definition at line 201 of file libsupp.c.

205{
206 /* Exception logging is not done in user-mode */
207}

Referenced by RtlDispatchException(), and RtlpUnwindInternal().

◆ RtlpClearInDbgPrint()

VOID NTAPI RtlpClearInDbgPrint ( VOID  )

Definition at line 45 of file libsupp.c.

46{
47 /* Clear the flag */
48 NtCurrentTeb()->InDbgPrint = FALSE;
49}
#define FALSE
Definition: types.h:117

Referenced by vDbgPrintExWithPrefixInternal().

◆ RtlpDebugBufferCommit()

PVOID NTAPI RtlpDebugBufferCommit ( _Inout_ PRTL_DEBUG_INFORMATION  Buffer,
_In_ SIZE_T  Size 
)

Definition at line 20 of file dbgbuffer.c.

22{
23 ULONG Remaining = Buffer->CommitSize - Buffer->OffsetFree;
26
27 if (Size > MAXLONG)
28 return NULL;
29
30 if (Remaining < Size)
31 {
32 PVOID Buf;
34
35 Buf = (PVOID)((ULONG_PTR)Buffer->ViewBaseClient + Buffer->CommitSize);
36 CommitSize = Size - Remaining;
37
38 /* this is not going to end well.. */
39 if (CommitSize > MAXLONG)
40 return NULL;
41
43 if (!NT_SUCCESS(Status))
44 return NULL;
45
46 Buffer->CommitSize += CommitSize;
47 Remaining = Buffer->CommitSize - Buffer->OffsetFree;
48 /* Sanity check */
49 ASSERT(Remaining >= Size);
50 if (Remaining < Size)
51 return NULL;
52 }
53
54 Result = (PBYTE)Buffer->ViewBaseClient + Buffer->OffsetFree;
55 Buffer->OffsetFree += Size;
56
57 return Result;
58}
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID _In_ ULONG_PTR _In_ SIZE_T CommitSize
Definition: mmfuncs.h:406
#define PAGE_READWRITE
Definition: nt_native.h:1304
#define NtCurrentProcess()
Definition: nt_native.h:1657
#define MEM_COMMIT
Definition: nt_native.h:1313
NTSTATUS NTAPI NtAllocateVirtualMemory(IN HANDLE ProcessHandle, IN OUT PVOID *UBaseAddress, IN ULONG_PTR ZeroBits, IN OUT PSIZE_T URegionSize, IN ULONG AllocationType, IN ULONG Protect)
Definition: virtual.c:4486
BYTE * PBYTE
Definition: pedump.c:66
void * PVOID
Definition: typedefs.h:50
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define MAXLONG
Definition: umtypes.h:116
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426

Referenced by RtlQueryProcessDebugInformation().

◆ RtlpDowncaseUnicodeChar()

WCHAR NTAPI RtlpDowncaseUnicodeChar ( IN WCHAR  Source)

Definition at line 89 of file nls.c.

90{
92
94
95 if (Source < L'A')
96 return Source;
97
98 if (Source <= L'Z')
99 return Source + (L'a' - L'A');
100
101 if (Source < 0x80)
102 return Source;
103
104 Offset = ((USHORT)Source >> 8);
105 DPRINT("Offset: %hx\n", Offset);
106
108 DPRINT("Offset: %hx\n", Offset);
109
110 Offset += (((USHORT)Source & 0x00F0) >> 4);
111 DPRINT("Offset: %hx\n", Offset);
112
114 DPRINT("Offset: %hx\n", Offset);
115
116 Offset += ((USHORT)Source & 0x000F);
117 DPRINT("Offset: %hx\n", Offset);
118
120 DPRINT("Offset: %hx\n", Offset);
121
122 DPRINT("Result: %hx\n", Source + (SHORT)Offset);
123
124 return Source + (SHORT)Offset;
125}
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
Definition: ndis.h:3169
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
#define L(x)
Definition: ntvdm.h:50
short SHORT
Definition: pedump.c:59
unsigned short USHORT
Definition: pedump.c:61
#define PAGED_CODE_RTL()
Definition: rtlp.h:16
PUSHORT NlsUnicodeLowercaseTable
Definition: nls.c:19
#define DPRINT
Definition: sndvol32.h:71

Referenced by RtlDowncaseUnicodeChar().

◆ RtlpExecuteHandlerForUnwind()

EXCEPTION_DISPOSITION NTAPI RtlpExecuteHandlerForUnwind ( PEXCEPTION_RECORD  ExceptionRecord,
PEXCEPTION_REGISTRATION_RECORD  RegistrationFrame,
PCONTEXT  Context,
PVOID  DispatcherContext,
PEXCEPTION_ROUTINE  ExceptionHandler 
)

Referenced by RtlUnwind().

◆ RtlpFreeMemory()

VOID NTAPI RtlpFreeMemory ( PVOID  Mem,
ULONG  Tag 
)

Definition at line 44 of file libsupp.c.

46{
48}
VOID FrLdrHeapFreeEx(PVOID HeapHandle, PVOID Pointer, ULONG Tag)
Definition: heap.c:438

◆ RtlpGetMode()

KPROCESSOR_MODE NTAPI RtlpGetMode ( VOID  )

Definition at line 53 of file libsupp.c.

54{
55 return UserMode;
56}
#define UserMode
Definition: asm.h:35

Referenced by RtlCreateHeap(), RtlCreateProcessParameters(), RtlDestroyHeap(), RtlFreeHeap(), RtlpExtendHeap(), RtlpInitializeHeap(), and RtlWalkFrameChain().

◆ RtlpGetStackLimits()

VOID NTAPI RtlpGetStackLimits ( PULONG_PTR  LowLimit,
PULONG_PTR  HighLimit 
)

◆ RtlpHandleDpcStackException()

BOOLEAN NTAPI RtlpHandleDpcStackException ( IN PEXCEPTION_REGISTRATION_RECORD  RegistrationFrame,
IN ULONG_PTR  RegistrationFrameEnd,
IN OUT PULONG_PTR  StackLow,
IN OUT PULONG_PTR  StackHigh 
)

Definition at line 190 of file libsupp.c.

194{
195 /* There's no such thing as a DPC stack in user-mode */
196 return FALSE;
197}

Referenced by RtlDispatchException(), and RtlUnwind().

◆ RtlpInitializeTimerThread()

NTSTATUS RtlpInitializeTimerThread ( VOID  )

Definition at line 27 of file timerqueue.c.

28{
30}
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:239

Referenced by RtlpQueueWorkerThread().

◆ RtlpSafeCopyMemory()

NTSTATUS NTAPI RtlpSafeCopyMemory ( _Out_writes_bytes_all_(Length) VOID UNALIGNED Destination,
_In_reads_bytes_(Length) CONST VOID UNALIGNED Source,
_In_ SIZE_T  Length 
)

Definition at line 56 of file rtlcompat.c.

61{
63 return STATUS_SUCCESS;
64}
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
Definition: rtlfuncs.h:2992
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define STATUS_SUCCESS
Definition: shellext.h:65
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263

Referenced by RtlLargeIntegerToChar().

◆ RtlpSetHeapParameters()

VOID NTAPI RtlpSetHeapParameters ( IN PRTL_HEAP_PARAMETERS  Parameters)

Definition at line 174 of file libsupp.c.

175{
176 PPEB Peb;
177
178 /* Get PEB */
180
181 /* Apply defaults for non-set parameters */
182 if (!Parameters->SegmentCommit) Parameters->SegmentCommit = Peb->HeapSegmentCommit;
183 if (!Parameters->SegmentReserve) Parameters->SegmentReserve = Peb->HeapSegmentReserve;
184 if (!Parameters->DeCommitFreeBlockThreshold) Parameters->DeCommitFreeBlockThreshold = Peb->HeapDeCommitFreeBlockThreshold;
185 if (!Parameters->DeCommitTotalFreeThreshold) Parameters->DeCommitTotalFreeThreshold = Peb->HeapDeCommitTotalFreeThreshold;
186}
NTSYSAPI PEB *WINAPI RtlGetCurrentPeb(void)
Definition: libsupp.c:63
ULONG HeapDeCommitTotalFreeThreshold
Definition: ntddk_ex.h:277
ULONG HeapSegmentCommit
Definition: ntddk_ex.h:276
ULONG HeapSegmentReserve
Definition: ntddk_ex.h:275
ULONG HeapDeCommitFreeBlockThreshold
Definition: ntddk_ex.h:278
_Must_inspect_result_ _In_ WDFQUEUE _In_opt_ WDFREQUEST _In_opt_ WDFFILEOBJECT _Inout_opt_ PWDF_REQUEST_PARAMETERS Parameters
Definition: wdfio.h:869

Referenced by RtlCreateHeap().

◆ RtlpSetInDbgPrint()

BOOLEAN NTAPI RtlpSetInDbgPrint ( VOID  )

Definition at line 33 of file libsupp.c.

34{
35 /* Check if it's already set and return TRUE if so */
36 if (NtCurrentTeb()->InDbgPrint) return TRUE;
37
38 /* Set it and return */
39 NtCurrentTeb()->InDbgPrint = TRUE;
40 return FALSE;
41}

Referenced by vDbgPrintExWithPrefixInternal().

◆ RtlpUpcaseUnicodeChar()

WCHAR NTAPI RtlpUpcaseUnicodeChar ( IN WCHAR  Source)

Definition at line 695 of file nls.c.

696{
698
699 if (Source < 'a')
700 return Source;
701
702 if (Source <= 'z')
703 return (Source - ('a' - 'A'));
704
705 Offset = ((USHORT)Source >> 8) & 0xFF;
707
708 Offset += ((USHORT)Source >> 4) & 0xF;
710
711 Offset += ((USHORT)Source & 0xF);
713
714 return Source + (SHORT)Offset;
715}
PUSHORT NlsUnicodeUpcaseTable
Definition: nls.c:18

Referenced by RtlUpcaseUnicodeChar(), RtlUpcaseUnicodeToCustomCPN(), RtlUpcaseUnicodeToMultiByteN(), RtlUpcaseUnicodeToOemN(), and RtlUpperChar().

◆ RtlTryEnterHeapLock()

BOOLEAN NTAPI RtlTryEnterHeapLock ( IN OUT PHEAP_LOCK  Lock,
IN BOOLEAN  Exclusive 
)

Definition at line 117 of file libsupp.c.

118{
120
121 return RtlTryEnterCriticalSection(&Lock->CriticalSection);
122}
NTSYSAPI BOOLEAN NTAPI RtlTryEnterCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)

Referenced by RtlpDphEnterCriticalSection().

Variable Documentation

◆ MmHighestUserAddress

◆ TimerThreadHandle

HANDLE TimerThreadHandle
extern

Definition at line 24 of file timerqueue.c.

Referenced by RtlpQueueWorkerThread().