- Quick implementation of RtlIsThreadWithinLoaderCallout.
authorJames Tabor <james.tabor@reactos.org>
Fri, 11 Sep 2009 07:12:30 +0000 (07:12 +0000)
committerJames Tabor <james.tabor@reactos.org>
Fri, 11 Sep 2009 07:12:30 +0000 (07:12 +0000)
svn path=/trunk/; revision=43029

reactos/dll/ntdll/def/ntdll_i386.def
reactos/dll/ntdll/ldr/startup.c
reactos/dll/ntdll/rtl/libsupp.c
reactos/include/ndk/rtlfuncs.h

index 6c090ba..17ccadf 100644 (file)
@@ -748,7 +748,7 @@ RtlIsGenericTableEmpty@4
 RtlIsGenericTableEmptyAvl@4
 RtlIsNameLegalDOS8Dot3@12
 RtlIsTextUnicode@12
-;RtlIsThreadWithinLoaderCallout
+RtlIsThreadWithinLoaderCallout@0
 RtlIsValidHandle@8
 RtlIsValidIndexHandle@12
 RtlLargeIntegerAdd@16
index e3c6236..44b11e4 100644 (file)
@@ -19,6 +19,7 @@ VOID LdrpInitLoader(VOID);
 VOID NTAPI RtlpInitDeferedCriticalSection(VOID);
 NTSTATUS LdrpAttachThread(VOID);
 VOID RtlpInitializeVectoredExceptionHandling(VOID);
+extern PTEB LdrpTopLevelDllBeingLoadedTeb;
 
 /* GLOBALS *******************************************************************/
 
@@ -470,6 +471,8 @@ LdrpInit2(PCONTEXT Context,
     ExeModule->SizeOfImage = LdrpGetResidentSize(NTHeaders);
     ExeModule->TimeDateStamp = NTHeaders->FileHeader.TimeDateStamp;
 
+    LdrpTopLevelDllBeingLoadedTeb = NtCurrentTeb();
+
     InsertHeadList(&Peb->Ldr->InLoadOrderModuleList,
                    &ExeModule->InLoadOrderLinks);
 
index bd1f798..1ef8c26 100644 (file)
@@ -14,6 +14,7 @@
 #include <debug.h>
 
 SIZE_T RtlpAllocDeallocQueryBufferSize = PAGE_SIZE;
+PTEB LdrpTopLevelDllBeingLoadedTeb = NULL;
 
 /* FUNCTIONS ***************************************************************/
 
@@ -203,6 +204,13 @@ RtlpCaptureStackLimits(IN ULONG_PTR Ebp,
     return TRUE;
 }
 
+BOOLEAN
+NTAPI
+RtlIsThreadWithinLoaderCallout(VOID)
+{
+    return LdrpTopLevelDllBeingLoadedTeb == NtCurrentTeb();
+}
+
 /* RTL Atom Tables ************************************************************/
 
 typedef struct _RTL_ATOM_HANDLE
index 1a164ef..9f1957f 100644 (file)
@@ -2012,6 +2012,11 @@ RtlInitializeContext(
     IN PINITIAL_TEB InitialTeb
 );
 
+NTSYSAPI
+BOOLEAN
+NTAPI
+RtlIsThreadWithinLoaderCallout(VOID);
+
 NTSYSAPI
 PRTL_USER_PROCESS_PARAMETERS
 NTAPI