Changeset 79496 in vbox for trunk/src/VBox/Runtime/r3/win/dllmain-win.cpp
- Timestamp:
- Jul 3, 2019 12:54:38 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/win/dllmain-win.cpp
r76553 r79496 37 37 38 38 /** 39 * Increases the load count on the IPRT DLL so it won't unload. 40 * 41 * This is a separate function so as to not overflow the stack of threads with 42 * very little of it. 43 * 44 * @param hModule The IPRT DLL module handle. 45 */ 46 DECL_NO_INLINE(static, void) EnsureNoUnload(HMODULE hModule) 47 { 48 WCHAR wszName[RTPATH_MAX]; 49 SetLastError(NO_ERROR); 50 if ( GetModuleFileNameW(hModule, wszName, RT_ELEMENTS(wszName)) > 0 51 && GetLastError() == NO_ERROR) 52 { 53 int cExtraLoads = 32; 54 while (cExtraLoads-- > 0) 55 LoadLibraryW(wszName); 56 } 57 } 58 59 60 /** 39 61 * The Dll main entry point. 40 62 */ … … 50 72 */ 51 73 case DLL_PROCESS_ATTACH: 52 { 53 WCHAR wszName[RTPATH_MAX]; 54 SetLastError(NO_ERROR); 55 if ( GetModuleFileNameW((HMODULE)hModule, wszName, RT_ELEMENTS(wszName)) > 0 56 && GetLastError() == NO_ERROR) 57 { 58 int cExtraLoads = 32; 59 while (cExtraLoads-- > 0) 60 LoadLibraryW(wszName); 61 } 74 EnsureNoUnload((HMODULE)hModule); 62 75 break; 63 }64 76 65 77 case DLL_PROCESS_DETACH:
Note:
See TracChangeset
for help on using the changeset viewer.