Fixed CreateShortcut failure on Vista caused by security changes in r6645/2.47
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6684 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
e2db35bf45
commit
0979ab23fc
2 changed files with 16 additions and 2 deletions
|
@ -110,8 +110,14 @@ EXTERN_C void NSISWinMainNOCRT()
|
|||
// dynamically loaded modules (with relative paths) to just
|
||||
// %windir%\System32 and directories added with AddDllDirectory().
|
||||
// This prevents DLL search order attacks (CAPEC-471).
|
||||
FARPROC fp = myGetProcAddress(MGA_SetDefaultDllDirectories);
|
||||
if (fp) ((BOOL(WINAPI*)(DWORD))fp)(LOAD_LIBRARY_SEARCH_SYSTEM32|LOAD_LIBRARY_SEARCH_USER_DIRS);
|
||||
DWORD winver = GetVersion();
|
||||
// CoCreateInstance(CLSID_ShellLink, ...) fails on Vista if SetDefaultDllDirectories is called
|
||||
BOOL avoidwinbug = LOWORD(winver) == MAKEWORD(6, 0);
|
||||
if (!avoidwinbug)
|
||||
{
|
||||
FARPROC fp = myGetProcAddress(MGA_SetDefaultDllDirectories);
|
||||
if (fp) ((BOOL(WINAPI*)(DWORD))fp)(LOAD_LIBRARY_SEARCH_SYSTEM32|LOAD_LIBRARY_SEARCH_USER_DIRS);
|
||||
}
|
||||
}
|
||||
|
||||
// Because myGetProcAddress now loads dlls with a full path
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue