- Create another branch for networking fixes
[reactos.git] / dll / ntdll / rtl / libsupp.c
index 8bae8c6..e37e444 100644 (file)
@@ -14,6 +14,7 @@
 #include <debug.h>
 
 SIZE_T RtlpAllocDeallocQueryBufferSize = PAGE_SIZE;
+PTEB LdrpTopLevelDllBeingLoadedTeb = NULL;
 
 /* FUNCTIONS ***************************************************************/
 
@@ -32,23 +33,17 @@ RtlWalkFrameChain(OUT PVOID *Callers,
 
 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 */
@@ -56,6 +51,14 @@ RtlpSetInDbgPrint(IN BOOLEAN NewValue)
     return FALSE;
 }
 
+VOID
+NTAPI
+RtlpClearInDbgPrint(VOID)
+{
+    /* Clear the flag */
+    NtCurrentTeb()->InDbgPrint = FALSE;
+}
+
 KPROCESSOR_MODE
 NTAPI
 RtlpGetMode()
@@ -162,7 +165,7 @@ RtlpFreeMemory(PVOID Mem,
 }
 
 
-#ifdef DBG
+#if DBG
 VOID FASTCALL
 CHECK_PAGED_CODE_RTL(char *file, int line)
 {
@@ -203,6 +206,13 @@ RtlpCaptureStackLimits(IN ULONG_PTR Ebp,
     return TRUE;
 }
 
+BOOLEAN
+NTAPI
+RtlIsThreadWithinLoaderCallout(VOID)
+{
+    return LdrpTopLevelDllBeingLoadedTeb == NtCurrentTeb();
+}
+
 /* RTL Atom Tables ************************************************************/
 
 typedef struct _RTL_ATOM_HANDLE