Skip to content

Commit

Permalink
Bug 945192 - Followup to support Older SDKs in loaddlls.cpp. r=bbondy…
Browse files Browse the repository at this point in the history
… a=Sylvestre
  • Loading branch information
Robert Strong committed Feb 17, 2015
1 parent d36ba06 commit 1ff0204
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions toolkit/mozapps/update/updater/loaddlls.cpp
Expand Up @@ -5,6 +5,13 @@

#include <windows.h>

// Support SDK's that don't have LOAD_LIBRARY_SEARCH_SYSTEM32 or
// SetDefaultDllDirectories.
#ifndef NTDDI_WIN8
#define LOAD_LIBRARY_SEARCH_SYSTEM32 0x00000800
#endif
typedef BOOL (WINAPI *SetDefaultDllDirectoriesFunction) (DWORD DirectoryFlags);

// Delayed load libraries are loaded when the first symbol is used.
// The following ensures that we load the delayed loaded libraries from the
// system directory.
Expand All @@ -21,8 +28,9 @@ struct AutoLoadSystemDependencies
// SetDefaultDllDirectories is always available on Windows 8 and above. It
// is also available on Windows Vista, Windows Server 2008, and
// Windows 7 when MS KB2533623 has been applied.
decltype(SetDefaultDllDirectories)* setDefaultDllDirectories =
(decltype(SetDefaultDllDirectories)*) GetProcAddress(module, "SetDefaultDllDirectories");
SetDefaultDllDirectoriesFunction setDefaultDllDirectories =
reinterpret_cast<SetDefaultDllDirectoriesFunction>(
::GetProcAddress(module, "SetDefaultDllDirectories"));
if (setDefaultDllDirectories) {
setDefaultDllDirectories(LOAD_LIBRARY_SEARCH_SYSTEM32);
return;
Expand Down

0 comments on commit 1ff0204

Please sign in to comment.