ReactOS 0.4.16-dev-287-g2d3f3a1
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 1580 of file ldrinit.c.

1581{
1582 static const struct
1583 {
1584 const GUID* Guid;
1585 const DWORD Version;
1586 } KnownCompatGuids[] = {
1587 { &COMPAT_GUID_WIN10, _WIN32_WINNT_WIN10 },
1588 { &COMPAT_GUID_WIN81, _WIN32_WINNT_WINBLUE },
1589 { &COMPAT_GUID_WIN8, _WIN32_WINNT_WIN8 },
1590 { &COMPAT_GUID_WIN7, _WIN32_WINNT_WIN7 },
1591 { &COMPAT_GUID_VISTA, _WIN32_WINNT_VISTA },
1592 };
1593
1594 ULONG Buffer[(sizeof(COMPATIBILITY_CONTEXT_ELEMENT) * 10 + sizeof(ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION)) / sizeof(ULONG)];
1595 ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION* ContextCompatInfo;
1596 SIZE_T SizeRequired;
1598 DWORD n, cur;
1599 ReactOS_ShimData* pShimData = *pOldShimData;
1600
1601 if (pShimData)
1602 {
1603 if (pShimData->dwMagic != REACTOS_SHIMDATA_MAGIC ||
1604 pShimData->dwSize != sizeof(ReactOS_ShimData))
1605 {
1606 DPRINT1("LdrpInitializeProcessCompat: Corrupt pShimData (0x%x, %u)\n", pShimData->dwMagic, pShimData->dwSize);
1607 return;
1608 }
1609 if (pShimData->dwRosProcessCompatVersion)
1610 {
1612 {
1613 DPRINT1("LdrpInitializeProcessCompat: ProcessCompatVersion set to ignore manifest\n");
1614 }
1615 else
1616 {
1617 DPRINT1("LdrpInitializeProcessCompat: ProcessCompatVersion already set to 0x%x\n", pShimData->dwRosProcessCompatVersion);
1618 }
1619 return;
1620 }
1621 }
1622
1623 SizeRequired = sizeof(Buffer);
1625 pProcessActctx,
1626 NULL,
1627 CompatibilityInformationInActivationContext,
1628 Buffer,
1629 sizeof(Buffer),
1630 &SizeRequired);
1631
1632 if (!NT_SUCCESS(Status))
1633 {
1634 DPRINT1("LdrpInitializeProcessCompat: Unable to query process actctx with status %x\n", Status);
1635 return;
1636 }
1637
1638 ContextCompatInfo = (ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION*)Buffer;
1639 /* No Compatibility elements present, bail out */
1640 if (ContextCompatInfo->ElementCount == 0)
1641 return;
1642
1643 /* Search for known GUIDs, starting from oldest to newest.
1644 Note that on Windows it is somewhat reversed, starting from the latest known
1645 version, going down. But we are not Windows, trying to allow a lower version,
1646 we are ReactOS trying to fake a higher version. So we interpret what Windows
1647 does as "try the closest version to the actual version", so we start with the
1648 lowest version, which is closest to Windows 2003, which we mostly are. */
1649 for (cur = RTL_NUMBER_OF(KnownCompatGuids) - 1; cur != -1; --cur)
1650 {
1651 for (n = 0; n < ContextCompatInfo->ElementCount; ++n)
1652 {
1653 if (ContextCompatInfo->Elements[n].Type == ACTCTX_COMPATIBILITY_ELEMENT_TYPE_OS &&
1654 RtlCompareMemory(&ContextCompatInfo->Elements[n].Id, KnownCompatGuids[cur].Guid, sizeof(GUID)) == sizeof(GUID))
1655 {
1657 {
1658 DPRINT1("LdrpInitializeProcessCompat: Not applying automatic fix for winver 0x%x due to policy\n", KnownCompatGuids[cur].Version);
1659 return;
1660 }
1661
1662 /* If this process did not need shim data before, allocate and store it */
1663 if (pShimData == NULL)
1664 {
1665 PPEB Peb = NtCurrentPeb();
1666
1667 ASSERT(Peb->pShimData == NULL);
1668 pShimData = RtlAllocateHeap(Peb->ProcessHeap, HEAP_ZERO_MEMORY, sizeof(*pShimData));
1669
1670 if (!pShimData)
1671 {
1672 DPRINT1("LdrpInitializeProcessCompat: Unable to allocated %u bytes\n", sizeof(*pShimData));
1673 return;
1674 }
1675
1676 pShimData->dwSize = sizeof(*pShimData);
1677 pShimData->dwMagic = REACTOS_SHIMDATA_MAGIC;
1678
1679 Peb->pShimData = pShimData;
1680 *pOldShimData = pShimData;
1681 }
1682
1683 /* Store the lowest found version, and bail out. */
1684 pShimData->dwRosProcessCompatVersion = KnownCompatGuids[cur].Version;
1685 DPRINT1("LdrpInitializeProcessCompat: Found guid for winver 0x%x in manifest from %wZ\n",
1686 KnownCompatGuids[cur].Version,
1687 &(NtCurrentPeb()->ProcessParameters->ImagePathName));
1688 return;
1689 }
1690 }
1691 }
1692}
#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:590
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:33
#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:5572
BOOLEAN NTAPI LdrpDisableProcessCompatGuidDetection(VOID)
Definition: ldrinit.c:1546
#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

◆ 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 103 of file libsupp.c.

104{
105 return RtlDeleteCriticalSection(&Lock->CriticalSection);
106}
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 1222 of file libsupp.c.

1223{
1224 ULARGE_INTEGER TickCount;
1225
1226#ifdef _WIN64
1227 TickCount.QuadPart = *((volatile ULONG64*)&SharedUserData->TickCount);
1228#else
1229 while (TRUE)
1230 {
1231 TickCount.HighPart = (ULONG)SharedUserData->TickCount.High1Time;
1232 TickCount.LowPart = SharedUserData->TickCount.LowPart;
1233
1234 if (TickCount.HighPart == (ULONG)SharedUserData->TickCount.High2Time)
1235 break;
1236
1238 }
1239#endif
1240
1241 return (ULONG)((UInt32x32To64(TickCount.LowPart,
1242 SharedUserData->TickCountMultiplier) >> 24) +
1243 UInt32x32To64((TickCount.HighPart << 8) & 0xFFFFFFFF,
1244 SharedUserData->TickCountMultiplier));
1245}
#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:577
ULONGLONG QuadPart
Definition: ms-dtyp.idl:185
$ULONG HighPart
Definition: ntbasedef.h:578

◆ RtlInitializeHeapLock()

NTSTATUS NTAPI RtlInitializeHeapLock ( IN OUT PHEAP_LOCK Lock)

Definition at line 128 of file libsupp.c.

129{
130 return RtlInitializeCriticalSection(&(*Lock)->CriticalSection);
131}
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:321
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 213 of file libsupp.c.

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

Referenced by RtlWalkFrameChain().

◆ RtlpCheckForActiveDebugger()

BOOLEAN NTAPI RtlpCheckForActiveDebugger ( VOID  )

Definition at line 27 of file libsupp.c.

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

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 203 of file libsupp.c.

207{
208 /* Exception logging is not done in user-mode */
209}

Referenced by RtlDispatchException(), and RtlpUnwindInternal().

◆ RtlpClearInDbgPrint()

VOID NTAPI RtlpClearInDbgPrint ( VOID  )

Definition at line 47 of file libsupp.c.

48{
49 /* Clear the flag */
50 NtCurrentTeb()->InDbgPrint = FALSE;
51}
#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:4492
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:409

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:73

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:439

◆ RtlpGetMode()

KPROCESSOR_MODE NTAPI RtlpGetMode ( VOID  )

Definition at line 55 of file libsupp.c.

56{
57 return UserMode;
58}
#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 192 of file libsupp.c.

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

Referenced by RtlDispatchException(), and RtlUnwind().

◆ RtlpInitializeTimerThread()

NTSTATUS RtlpInitializeTimerThread ( VOID  )

Definition at line 27 of file timerqueue.c.

28{
30}
#define STATUS_NOT_IMPLEMENTED
Definition: d3dkmdt.h:42

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:3016
_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 176 of file libsupp.c.

177{
178 PPEB Peb;
179
180 /* Get PEB */
182
183 /* Apply defaults for non-set parameters */
184 if (!Parameters->SegmentCommit) Parameters->SegmentCommit = Peb->HeapSegmentCommit;
185 if (!Parameters->SegmentReserve) Parameters->SegmentReserve = Peb->HeapSegmentReserve;
186 if (!Parameters->DeCommitFreeBlockThreshold) Parameters->DeCommitFreeBlockThreshold = Peb->HeapDeCommitFreeBlockThreshold;
187 if (!Parameters->DeCommitTotalFreeThreshold) Parameters->DeCommitTotalFreeThreshold = Peb->HeapDeCommitTotalFreeThreshold;
188}
NTSYSAPI PEB *WINAPI RtlGetCurrentPeb(void)
Definition: libsupp.c:65
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 35 of file libsupp.c.

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

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 119 of file libsupp.c.

120{
122
123 return RtlTryEnterCriticalSection(&Lock->CriticalSection);
124}
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().