Author: jimtabor
Date: Fri Sep 11 09:12:30 2009
New Revision: 43029
URL:
http://svn.reactos.org/svn/reactos?rev=43029&view=rev
Log:
- Quick implementation of RtlIsThreadWithinLoaderCallout.
Modified:
trunk/reactos/dll/ntdll/def/ntdll_i386.def
trunk/reactos/dll/ntdll/ldr/startup.c
trunk/reactos/dll/ntdll/rtl/libsupp.c
trunk/reactos/include/ndk/rtlfuncs.h
Modified: trunk/reactos/dll/ntdll/def/ntdll_i386.def
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/def/ntdll_i386.d…
==============================================================================
--- trunk/reactos/dll/ntdll/def/ntdll_i386.def [iso-8859-1] (original)
+++ trunk/reactos/dll/ntdll/def/ntdll_i386.def [iso-8859-1] Fri Sep 11 09:12:30 2009
@@ -748,7 +748,7 @@
RtlIsGenericTableEmptyAvl@4
RtlIsNameLegalDOS8Dot3@12
RtlIsTextUnicode@12
-;RtlIsThreadWithinLoaderCallout
+RtlIsThreadWithinLoaderCallout@0
RtlIsValidHandle@8
RtlIsValidIndexHandle@12
RtlLargeIntegerAdd@16
Modified: trunk/reactos/dll/ntdll/ldr/startup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/startup.c?re…
==============================================================================
--- trunk/reactos/dll/ntdll/ldr/startup.c [iso-8859-1] (original)
+++ trunk/reactos/dll/ntdll/ldr/startup.c [iso-8859-1] Fri Sep 11 09:12:30 2009
@@ -19,6 +19,7 @@
VOID NTAPI RtlpInitDeferedCriticalSection(VOID);
NTSTATUS LdrpAttachThread(VOID);
VOID RtlpInitializeVectoredExceptionHandling(VOID);
+extern PTEB LdrpTopLevelDllBeingLoadedTeb;
/* GLOBALS *******************************************************************/
@@ -470,6 +471,8 @@
ExeModule->SizeOfImage = LdrpGetResidentSize(NTHeaders);
ExeModule->TimeDateStamp = NTHeaders->FileHeader.TimeDateStamp;
+ LdrpTopLevelDllBeingLoadedTeb = NtCurrentTeb();
+
InsertHeadList(&Peb->Ldr->InLoadOrderModuleList,
&ExeModule->InLoadOrderLinks);
Modified: trunk/reactos/dll/ntdll/rtl/libsupp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/rtl/libsupp.c?re…
==============================================================================
--- trunk/reactos/dll/ntdll/rtl/libsupp.c [iso-8859-1] (original)
+++ trunk/reactos/dll/ntdll/rtl/libsupp.c [iso-8859-1] Fri Sep 11 09:12:30 2009
@@ -14,6 +14,7 @@
#include <debug.h>
SIZE_T RtlpAllocDeallocQueryBufferSize = PAGE_SIZE;
+PTEB LdrpTopLevelDllBeingLoadedTeb = NULL;
/* FUNCTIONS ***************************************************************/
@@ -201,6 +202,13 @@
*StackBegin = (ULONG_PTR)NtCurrentTeb()->Tib.StackLimit;
*StackEnd = (ULONG_PTR)NtCurrentTeb()->Tib.StackBase;
return TRUE;
+}
+
+BOOLEAN
+NTAPI
+RtlIsThreadWithinLoaderCallout(VOID)
+{
+ return LdrpTopLevelDllBeingLoadedTeb == NtCurrentTeb();
}
/* RTL Atom Tables ************************************************************/
Modified: trunk/reactos/include/ndk/rtlfuncs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/rtlfuncs.h?rev…
==============================================================================
--- trunk/reactos/include/ndk/rtlfuncs.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/rtlfuncs.h [iso-8859-1] Fri Sep 11 09:12:30 2009
@@ -2013,6 +2013,11 @@
);
NTSYSAPI
+BOOLEAN
+NTAPI
+RtlIsThreadWithinLoaderCallout(VOID);
+
+NTSYSAPI
PRTL_USER_PROCESS_PARAMETERS
NTAPI
RtlNormalizeProcessParams(IN PRTL_USER_PROCESS_PARAMETERS ProcessParameters);