diff options
author | nyamatongwe <devnull@localhost> | 2012-10-04 16:03:34 +1000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2012-10-04 16:03:34 +1000 |
commit | 0a3d0824747907bb22120e83f4236f8b9a23f1a2 (patch) | |
tree | 5e788560ab74234ffeac77812b14ba0f1f510438 | |
parent | 823b818b12f03208e9ea3731c37089274397288c (diff) | |
download | scintilla-mirror-0a3d0824747907bb22120e83f4236f8b9a23f1a2.tar.gz |
Only look for D2D1.DLL and DWRITE.DLL in %windows%\system32 to avoid
malware loading from directory near front of DLL search path.
From Mat Berchtold.
-rw-r--r-- | win32/PlatWin.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index 2dfdfb1ee..380389f2f 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -133,7 +133,7 @@ bool LoadD2D() { typedef HRESULT (WINAPI *DWriteCFSig)(DWRITE_FACTORY_TYPE factoryType, REFIID iid, IUnknown **factory); - hDLLD2D = ::LoadLibrary(TEXT("D2D1.DLL")); + hDLLD2D = ::LoadLibraryEx(TEXT("D2D1.DLL"), 0, 0x00000800 /*LOAD_LIBRARY_SEARCH_SYSTEM32*/); if (hDLLD2D) { D2D1CFSig fnD2DCF = (D2D1CFSig)::GetProcAddress(hDLLD2D, "D2D1CreateFactory"); if (fnD2DCF) { @@ -144,7 +144,7 @@ bool LoadD2D() { reinterpret_cast<IUnknown**>(&pD2DFactory)); } } - hDLLDWrite = ::LoadLibrary(TEXT("DWRITE.DLL")); + hDLLDWrite = ::LoadLibraryEx(TEXT("DWRITE.DLL"), 0, 0x00000800 /*LOAD_LIBRARY_SEARCH_SYSTEM32*/); if (hDLLDWrite) { DWriteCFSig fnDWCF = (DWriteCFSig)::GetProcAddress(hDLLDWrite, "DWriteCreateFactory"); if (fnDWCF) { |