#include <debug.h>
SIZE_T RtlpAllocDeallocQueryBufferSize = PAGE_SIZE;
+PTEB LdrpTopLevelDllBeingLoadedTeb = NULL;
/* FUNCTIONS ***************************************************************/
+#ifndef _M_AMD64
+// FIXME: Why "Not implemented"???
/*
* @implemented
*/
/* Not implemented for user-mode */
return 0;
}
+#endif
BOOLEAN
NTAPI
-RtlpCheckForActiveDebugger(BOOLEAN Type)
+RtlpCheckForActiveDebugger(VOID)
{
- return (NtCurrentPeb()->BeingDebugged);
+ /* Return the flag in the PEB */
+ return NtCurrentPeb()->BeingDebugged;
}
BOOLEAN
NTAPI
-RtlpSetInDbgPrint(IN BOOLEAN NewValue)
+RtlpSetInDbgPrint(VOID)
{
- /* If we're setting it to false, do it and return */
- if (NewValue == FALSE)
- {
- NtCurrentTeb()->InDbgPrint = FALSE;
- return FALSE;
- }
-
- /* Setting to true; check if it's not already */
+ /* Check if it's already set and return TRUE if so */
if (NtCurrentTeb()->InDbgPrint) return TRUE;
/* Set it and return */
return FALSE;
}
+VOID
+NTAPI
+RtlpClearInDbgPrint(VOID)
+{
+ /* Clear the flag */
+ NtCurrentTeb()->InDbgPrint = FALSE;
+}
+
KPROCESSOR_MODE
NTAPI
RtlpGetMode()
RtlAcquirePebLock(VOID)
{
PPEB Peb = NtCurrentPeb ();
- Peb->FastPebLockRoutine (Peb->FastPebLock);
+ RtlEnterCriticalSection(Peb->FastPebLock);
}
/*
RtlReleasePebLock(VOID)
{
PPEB Peb = NtCurrentPeb ();
- Peb->FastPebUnlockRoutine (Peb->FastPebLock);
+ RtlLeaveCriticalSection(Peb->FastPebLock);
}
/*
}
-#ifdef DBG
+#if DBG
VOID FASTCALL
CHECK_PAGED_CODE_RTL(char *file, int line)
{
IN ULONG_PTR *StackEnd)
{
/* FIXME: Verify */
- *StackBegin = (ULONG_PTR)NtCurrentTeb()->Tib.StackLimit;
- *StackEnd = (ULONG_PTR)NtCurrentTeb()->Tib.StackBase;
+ *StackBegin = (ULONG_PTR)NtCurrentTeb()->NtTib.StackLimit;
+ *StackEnd = (ULONG_PTR)NtCurrentTeb()->NtTib.StackBase;
return TRUE;
}
+#ifdef _AMD64_
+VOID
+NTAPI
+RtlpGetStackLimits(
+ OUT PULONG_PTR LowLimit,
+ OUT PULONG_PTR HighLimit)
+{
+ *LowLimit = (ULONG_PTR)NtCurrentTeb()->NtTib.StackLimit;
+ *HighLimit = (ULONG_PTR)NtCurrentTeb()->NtTib.StackBase;
+ return;
+}
+#endif
+
+BOOLEAN
+NTAPI
+RtlIsThreadWithinLoaderCallout(VOID)
+{
+ return LdrpTopLevelDllBeingLoadedTeb == NtCurrentTeb();
+}
+
/* RTL Atom Tables ************************************************************/
typedef struct _RTL_ATOM_HANDLE