- Timestamp:
- Jun 14, 2013 1:39:16 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/win/ldrNative-win.cpp
r44528 r46561 36 36 #include <iprt/err.h> 37 37 #include <iprt/alloca.h> 38 #include <iprt/once.h> 38 39 #include <iprt/string.h> 39 40 #include "internal/ldr.h" 40 41 42 static RTONCE g_Once = RTONCE_INITIALIZER; 43 44 static DECLCALLBACK(int) rtldrOnceSetDllDirectory(void *pvUser) 45 { 46 HMODULE hmod = GetModuleHandle(TEXT("kernel32.dll")); 47 if (hmod) 48 { 49 typedef BOOLEAN (WINAPI *PFNSETDLLDIRECTORY)(LPCWSTR); 50 PFNSETDLLDIRECTORY pfn = (PFNSETDLLDIRECTORY)GetProcAddress(hmod, "SetDllDirectoryW"); 51 if (pfn) 52 { 53 BOOL fOk = pfn(L""); 54 if (!fOk) 55 return RTErrConvertFromWin32(GetLastError()); 56 } 57 } 58 return VINF_SUCCESS; 59 } 41 60 42 61 int rtldrNativeLoad(const char *pszFilename, uintptr_t *phHandle, uint32_t fFlags, PRTERRINFO pErrInfo) … … 60 79 61 80 /* 81 * Don't allow loading DLLs from the current directory. 82 */ 83 #if 0 84 int rc = RTOnce(&g_Once, rtldrOnceSetDllDirectory, NULL); 85 if (RT_FAILURE(rc)) 86 return rc; 87 #else 88 int rc = VINF_SUCCESS; 89 #endif 90 91 /* 62 92 * Attempt load. 63 93 */ … … 73 103 */ 74 104 DWORD dwErr = GetLastError(); 75 int rc= RTErrConvertFromWin32(dwErr);105 rc = RTErrConvertFromWin32(dwErr); 76 106 return RTErrInfoSetF(pErrInfo, rc, "GetLastError=%u", dwErr); 77 107 }
Note:
See TracChangeset
for help on using the changeset viewer.