summaryrefslogtreecommitdiffstats
path: root/toolkit/xre/nsEmbedFunctions.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-02-19 10:00:25 +0100
committerwolfbeast <mcwerewolf@gmail.com>2018-02-19 10:00:25 +0100
commitc7668971968e044e85446d79362d7744846efdd0 (patch)
treee2d5b4f54edebe1373684ceb007cad39f2399c0f /toolkit/xre/nsEmbedFunctions.cpp
parent85edb1c711f7816ed1a30edd07b37d314fac216a (diff)
downloadUXP-c7668971968e044e85446d79362d7744846efdd0.tar
UXP-c7668971968e044e85446d79362d7744846efdd0.tar.gz
UXP-c7668971968e044e85446d79362d7744846efdd0.tar.lz
UXP-c7668971968e044e85446d79362d7744846efdd0.tar.xz
UXP-c7668971968e044e85446d79362d7744846efdd0.zip
Remove the use of GetProcAddress() for shell32
This avoids manually hooking into shell32.dll and using the native shell API instead. Tag #22.
Diffstat (limited to 'toolkit/xre/nsEmbedFunctions.cpp')
-rw-r--r--toolkit/xre/nsEmbedFunctions.cpp24
1 files changed, 2 insertions, 22 deletions
diff --git a/toolkit/xre/nsEmbedFunctions.cpp b/toolkit/xre/nsEmbedFunctions.cpp
index 0e85532b9..1e67ea7ce 100644
--- a/toolkit/xre/nsEmbedFunctions.cpp
+++ b/toolkit/xre/nsEmbedFunctions.cpp
@@ -24,6 +24,7 @@
#ifdef XP_WIN
#include <process.h>
+#include <shobjidl.h>
#include "mozilla/ipc/WindowsMessageLoop.h"
#endif
@@ -119,10 +120,6 @@ using mozilla::startup::sChildProcessType;
static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID);
-#ifdef XP_WIN
-static const wchar_t kShellLibraryName[] = L"shell32.dll";
-#endif
-
nsresult
XRE_LockProfileDirectory(nsIFile* aDirectory,
nsISupports* *aLockObject)
@@ -270,26 +267,9 @@ XRE_SetRemoteExceptionHandler(const char* aPipe/*= 0*/)
void
SetTaskbarGroupId(const nsString& aId)
{
- typedef HRESULT (WINAPI * SetCurrentProcessExplicitAppUserModelIDPtr)(PCWSTR AppID);
-
- SetCurrentProcessExplicitAppUserModelIDPtr funcAppUserModelID = nullptr;
-
- HMODULE hDLL = ::LoadLibraryW(kShellLibraryName);
-
- funcAppUserModelID = (SetCurrentProcessExplicitAppUserModelIDPtr)
- GetProcAddress(hDLL, "SetCurrentProcessExplicitAppUserModelID");
-
- if (!funcAppUserModelID) {
- ::FreeLibrary(hDLL);
- return;
- }
-
- if (FAILED(funcAppUserModelID(aId.get()))) {
+ if (FAILED(SetCurrentProcessExplicitAppUserModelID(aId.get()))) {
NS_WARNING("SetCurrentProcessExplicitAppUserModelID failed for child process.");
}
-
- if (hDLL)
- ::FreeLibrary(hDLL);
}
#endif