1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| __inline HMODULE WINAPI LoadLibraryEx_api(LPCTSTR lpFileName, HANDLE hFile, DWORD dwFlags) { return ::LoadLibraryEx(lpFileName, hFile, dwFlags); }
HMODULE WINAPI LoadLibrary_api_s(LPCTSTR lpFileName) { #ifdef __360PubDLLSafeInitHelper
return S360::Helper::LoadLibraryFormSystem32(lpFileName); #elif defined _M_IX86 || defined _M_AMD64 || defined _M_IA64
static int bSafeLoadAvailable = 0; if (bSafeLoadAvailable == 0) { bSafeLoadAvailable = GetProcAddress(GetModuleHandleW(L"Kernel32.dll"), "AddDllDirectory") != NULL ? 1 : -1; }
return LoadLibraryEx_api(lpFileName, NULL, bSafeLoadAvailable == 1 ? 0x00000800 : 0); #else return LoadLibraryEx_api(lpFileName, NULL, 0x00000800); #endif }
|