Allow loading of built-in dlls with LOAD_LIBRARY_AS_DATAFILE flag set.

This commit is contained in:
Dmitry Timoshkov 2001-03-21 03:38:03 +00:00 committed by Alexandre Julliard
parent e746f665ef
commit b77afe76b1
1 changed files with 6 additions and 2 deletions

View File

@ -1258,8 +1258,12 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags)
HANDLE hFile; HANDLE hFile;
HMODULE hmod = 0; HMODULE hmod = 0;
/* This method allows searching for the 'native' libraries only */
if (!SearchPathA( NULL, libname, ".dll", sizeof(filename), filename, NULL )) if (!SearchPathA( NULL, libname, ".dll", sizeof(filename), filename, NULL ))
return 0; {
flags |= DONT_RESOLVE_DLL_REFERENCES; /* Just in case */
goto try_builtin; /* Fallback to normal behaviour */
}
/* FIXME: maybe we should use the hfile parameter instead */ /* FIXME: maybe we should use the hfile parameter instead */
hFile = CreateFileA( filename, GENERIC_READ, FILE_SHARE_READ, hFile = CreateFileA( filename, GENERIC_READ, FILE_SHARE_READ,
NULL, OPEN_EXISTING, 0, 0 ); NULL, OPEN_EXISTING, 0, 0 );
@ -1270,7 +1274,7 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags)
} }
return hmod; return hmod;
} }
try_builtin:
RtlAcquirePebLock(); RtlAcquirePebLock();
wm = MODULE_LoadLibraryExA( libname, hfile, flags ); wm = MODULE_LoadLibraryExA( libname, hfile, flags );