Preload more dlls for Vista and 7 without KB2533623
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6700 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
7ddcbee988
commit
a0d918b472
2 changed files with 18 additions and 4 deletions
|
@ -108,9 +108,23 @@ EXTERN_C void NSISWinMainNOCRT()
|
||||||
FARPROC fp = myGetProcAddress(MGA_SetDefaultDllDirectories);
|
FARPROC fp = myGetProcAddress(MGA_SetDefaultDllDirectories);
|
||||||
if (fp) ((BOOL(WINAPI*)(DWORD))fp)(LOAD_LIBRARY_SEARCH_SYSTEM32|LOAD_LIBRARY_SEARCH_USER_DIRS);
|
if (fp) ((BOOL(WINAPI*)(DWORD))fp)(LOAD_LIBRARY_SEARCH_SYSTEM32|LOAD_LIBRARY_SEARCH_USER_DIRS);
|
||||||
}
|
}
|
||||||
LoadSystemLibrary("UXTHEME"); // On Vista OleInitialize calls NtUserCreateWindowEx and that pulls in UXTheme.dll
|
// SetDefaultDllDirectories might not be available so we try to preload various libraries as
|
||||||
LoadSystemLibrary("USERENV"); // On Vista SHGetFileInfo ends up in SHELL32.kfapi::GetUserProfileDir and that pulls in UserEnv.dll
|
// best we can before Windows gets a chance to mess things up by loading from the wrong directory.
|
||||||
LoadSystemLibrary("SETUPAPI"); // On XP SHGetFileInfo ends up in CMountPoint::_InitLocalDriveHelper and that pulls in SetupAPI.dll
|
{
|
||||||
|
static const char preload[] =
|
||||||
|
"UXTHEME\0" // Vista: OleInitialize calls NtUserCreateWindowEx and that pulls in UXTheme.dll
|
||||||
|
"USERENV\0" // Vista: SHGetFileInfo ends up in SHELL32.kfapi::GetUserProfileDir and that pulls in UserEnv.dll
|
||||||
|
"SETUPAPI\0" // XP: SHGetFileInfo ends up in CMountPoint::_InitLocalDriveHelper and that pulls in SetupAPI.dll
|
||||||
|
"APPHELP\0" // Vista: SHGetFileInfo ... SHELL32.SHILAliasTranslate ... SHELL32.ApphelpCheckShellObject
|
||||||
|
"PROPSYS\0" // Vista: SHGetFileInfo ... SHELL32.SHILAliasTranslate ... SHLWAPI.#187 ... SHLWAPI.#505/SHPropertyBag_ReadGUID
|
||||||
|
"DWMAPI\0" // Win7 without KB2533623: UXTheme pulls in DWMAPI.dll
|
||||||
|
"CRYPTBASE\0" // Win7 without KB2533623: OleInitialize ... RPCRT4.UuidCreate ... RPCRT4.GenerateRandomNumber
|
||||||
|
"OLEACC\0" // Vista: SHFileOperation ... SHELL32.CProgressDialogUI::_Setup ... SHELL32.GetRoleTextW
|
||||||
|
;
|
||||||
|
const char *dll;
|
||||||
|
for (dll = preload; dll[0]; dll += lstrlenA(dll) + 1)
|
||||||
|
LoadSystemLibrary(dll);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Because myGetProcAddress now loads dlls with a full path
|
// Because myGetProcAddress now loads dlls with a full path
|
||||||
|
|
|
@ -1139,7 +1139,7 @@ HMODULE NSISCALL LoadSystemLibrary(LPCSTR name)
|
||||||
cch = 0; // \\?\ paths so we have to settle for just the name.
|
cch = 0; // \\?\ paths so we have to settle for just the name.
|
||||||
wsprintf(path + cch, fmt, TEXT("\\") + (!cch || path[cch-1] == '\\'), name);
|
wsprintf(path + cch, fmt, TEXT("\\") + (!cch || path[cch-1] == '\\'), name);
|
||||||
|
|
||||||
return LoadLibrary(path);
|
return LoadLibraryEx(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue