Sync with trunk r43123
[reactos.git] / reactos / dll / ntdll / rtl / libsupp.c
index 038e426..da47b62 100644 (file)
@@ -14,6 +14,7 @@
 #include <debug.h>
 
 SIZE_T RtlpAllocDeallocQueryBufferSize = PAGE_SIZE;
+PTEB LdrpTopLevelDllBeingLoadedTeb = NULL;
 #define IMAGE_DOS_MAGIC 0x5a4d
 #define IMAGE_PE_MAGIC 0x00004550
 
@@ -167,7 +168,7 @@ RtlpFreeMemory(PVOID Mem,
 }
 
 
-#ifdef DBG
+#if DBG
 VOID FASTCALL
 CHECK_PAGED_CODE_RTL(char *file, int line)
 {
@@ -221,6 +222,13 @@ RtlpGetStackLimits(
 }
 #endif
 
+BOOLEAN
+NTAPI
+RtlIsThreadWithinLoaderCallout(VOID)
+{
+    return LdrpTopLevelDllBeingLoadedTeb == NtCurrentTeb();
+}
+
 /* RTL Atom Tables ************************************************************/
 
 typedef struct _RTL_ATOM_HANDLE