Author: jgardou
Date: Wed Nov 2 23:37:38 2011
New Revision: 54283
URL:
http://svn.reactos.org/svn/reactos?rev=54283&view=rev
Log:
[KERNEL32]
- Small performance improvement : Directly reference dll when getting its handle instead
of just checking it's there and then load it
Modified:
trunk/reactos/dll/ntdll/def/ntdll.pspec
trunk/reactos/dll/ntdll/def/ntdll.spec
trunk/reactos/dll/win32/kernel32/client/loader.c
trunk/reactos/include/ndk/umfuncs.h
trunk/reactos/include/psdk/winternl.h
Modified: trunk/reactos/dll/ntdll/def/ntdll.pspec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/def/ntdll.pspec?…
==============================================================================
--- trunk/reactos/dll/ntdll/def/ntdll.pspec [iso-8859-1] (original)
+++ trunk/reactos/dll/ntdll/def/ntdll.pspec [iso-8859-1] Wed Nov 2 23:37:38 2011
@@ -85,7 +85,7 @@
@ stdcall LdrFindResource_U(long ptr long ptr)
//@ stdcall LdrFlushAlternateResourceModules
@ stdcall LdrGetDllHandle(wstr long ptr ptr)
-//@ stdcall LdrGetDllHandleEx
+@ stdcall LdrGetDllHandleEx(long wstr long ptr ptr)
@ stdcall LdrGetProcedureAddress(ptr ptr long ptr)
//@ stdcall LdrHotPatchRoutine
//@ stdcall LdrInitShimEngineDynamic
Modified: trunk/reactos/dll/ntdll/def/ntdll.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/def/ntdll.spec?r…
==============================================================================
--- trunk/reactos/dll/ntdll/def/ntdll.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/ntdll/def/ntdll.spec [iso-8859-1] Wed Nov 2 23:37:38 2011
@@ -83,7 +83,7 @@
@ stdcall LdrFindResource_U(long ptr long ptr)
;@ stdcall LdrFlushAlternateResourceModules
@ stdcall LdrGetDllHandle(wstr long ptr ptr)
-;@ stdcall LdrGetDllHandleEx
+@ stdcall LdrGetDllHandleEx(long wstr long ptr ptr)
@ stdcall LdrGetProcedureAddress(ptr ptr long ptr)
;@ stdcall LdrHotPatchRoutine
;@ stdcall LdrInitShimEngineDynamic
Modified: trunk/reactos/dll/win32/kernel32/client/loader.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/loader.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/loader.c [iso-8859-1] Wed Nov 2 23:37:38
2011
@@ -413,13 +413,13 @@
if (dwFlags & LOAD_LIBRARY_AS_DATAFILE)
{
/* If the image is loaded as a datafile, try to get its handle */
- Status = LdrGetDllHandle(SearchPath, NULL, &DllName,
(PVOID*)&hInst);
+ Status = LdrGetDllHandleEx(0, SearchPath, NULL, &DllName,
(PVOID*)&hInst);
if (!NT_SUCCESS(Status))
{
/* It's not loaded yet - so load it up */
Status = BasepLoadLibraryAsDatafile(SearchPath, DllName.Buffer,
&hInst);
- _SEH2_YIELD(goto done;)
}
+ _SEH2_YIELD(goto done;)
}
/* Call the API Properly */
Modified: trunk/reactos/include/ndk/umfuncs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/umfuncs.h?rev=…
==============================================================================
--- trunk/reactos/include/ndk/umfuncs.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/umfuncs.h [iso-8859-1] Wed Nov 2 23:37:38 2011
@@ -215,6 +215,14 @@
IN PUNICODE_STRING DllName,
OUT PVOID *DllHandle
);
+
+NTSTATUS
+NTAPI
+LdrGetDllHandleEx(IN ULONG Flags,
+ IN PWSTR DllPath OPTIONAL,
+ IN PULONG DllCharacteristics OPTIONAL,
+ IN PUNICODE_STRING DllName,
+ OUT PVOID *DllHandle OPTIONAL);
NTSTATUS
NTAPI
Modified: trunk/reactos/include/psdk/winternl.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winternl.h?re…
==============================================================================
--- trunk/reactos/include/psdk/winternl.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/winternl.h [iso-8859-1] Wed Nov 2 23:37:38 2011
@@ -1813,6 +1813,7 @@
NTSTATUS WINAPI LdrFindResourceDirectory_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const
IMAGE_RESOURCE_DIRECTORY**);
NTSTATUS WINAPI LdrFindResource_U(HMODULE,const LDR_RESOURCE_INFO*,ULONG,const
IMAGE_RESOURCE_DATA_ENTRY**);
NTSTATUS WINAPI LdrGetDllHandle(ULONG, ULONG, const UNICODE_STRING*, HMODULE*);
+NTSTATUS WINAPI LdrGetDllHandleEx(ULONG,PWSTR,PULONG,PUNICODE_STRING,PVOID);
NTSTATUS WINAPI LdrGetProcedureAddress(HMODULE, const ANSI_STRING*, ULONG, void**);
void WINAPI LdrInitializeThunk(HANDLE,ULONG,ULONG,ULONG);
NTSTATUS WINAPI LdrLoadDll(LPCWSTR, DWORD, const UNICODE_STRING*, HMODULE*);