diff options
author | Moonchild <moonchild@palemoon.org> | 2020-09-17 15:24:50 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2020-09-17 15:25:44 +0000 |
commit | 8151bb2b05f71c7fac9aefc94b97d7b703c8d803 (patch) | |
tree | 5b36af1946702a7a439fd1fd113913b9cee4d395 /widget/windows/WinUtils.cpp | |
parent | b6b868b1bda0d82b85647f3e9ff2ab1f788eeb46 (diff) | |
download | UXP-8151bb2b05f71c7fac9aefc94b97d7b703c8d803.tar UXP-8151bb2b05f71c7fac9aefc94b97d7b703c8d803.tar.gz UXP-8151bb2b05f71c7fac9aefc94b97d7b703c8d803.tar.lz UXP-8151bb2b05f71c7fac9aefc94b97d7b703c8d803.tar.xz UXP-8151bb2b05f71c7fac9aefc94b97d7b703c8d803.zip |
Issue #1653 - Part 1: Remove WinUtils::SHGetKnownFolderPath
Instead of doing the whole dll-load, replace function dance, we can just use the
shlobj.h version of Windows.
Diffstat (limited to 'widget/windows/WinUtils.cpp')
-rw-r--r-- | widget/windows/WinUtils.cpp | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/widget/windows/WinUtils.cpp b/widget/windows/WinUtils.cpp index bd42e78f6..6d9aab50d 100644 --- a/widget/windows/WinUtils.cpp +++ b/widget/windows/WinUtils.cpp @@ -419,8 +419,6 @@ const char FaviconHelper::kShortcutCacheDir[] = "shortcutCache"; // apis available on vista and up. WinUtils::SHCreateItemFromParsingNamePtr WinUtils::sCreateItemFromParsingName = nullptr; -WinUtils::SHGetKnownFolderPathPtr WinUtils::sGetKnownFolderPath = nullptr; - // We just leak these DLL HMODULEs. There's no point in calling FreeLibrary // on them during shutdown anyway. static const wchar_t kShellLibraryName[] = L"shell32.dll"; @@ -1179,32 +1177,6 @@ WinUtils::SHCreateItemFromParsingName(PCWSTR pszPath, IBindCtx *pbc, return sCreateItemFromParsingName(pszPath, pbc, riid, ppv); } -/* static */ -HRESULT -WinUtils::SHGetKnownFolderPath(REFKNOWNFOLDERID rfid, - DWORD dwFlags, - HANDLE hToken, - PWSTR *ppszPath) -{ - if (sGetKnownFolderPath) { - return sGetKnownFolderPath(rfid, dwFlags, hToken, ppszPath); - } - - if (!sShellDll) { - sShellDll = ::LoadLibraryW(kShellLibraryName); - if (!sShellDll) { - return false; - } - } - - sGetKnownFolderPath = (SHGetKnownFolderPathPtr) - GetProcAddress(sShellDll, "SHGetKnownFolderPath"); - if (!sGetKnownFolderPath) - return E_FAIL; - - return sGetKnownFolderPath(rfid, dwFlags, hToken, ppszPath); -} - static BOOL WINAPI EnumFirstChild(HWND hwnd, LPARAM lParam) { |