diff options
Diffstat (limited to 'widget/windows/WinUtils.cpp')
-rw-r--r-- | widget/windows/WinUtils.cpp | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/widget/windows/WinUtils.cpp b/widget/windows/WinUtils.cpp index bd42e78f6..28033193f 100644 --- a/widget/windows/WinUtils.cpp +++ b/widget/windows/WinUtils.cpp @@ -419,26 +419,10 @@ 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"; static HMODULE sShellDll = nullptr; -static const wchar_t kDwmLibraryName[] = L"dwmapi.dll"; -static HMODULE sDwmDll = nullptr; - -WinUtils::DwmExtendFrameIntoClientAreaProc WinUtils::dwmExtendFrameIntoClientAreaPtr = nullptr; -WinUtils::DwmIsCompositionEnabledProc WinUtils::dwmIsCompositionEnabledPtr = nullptr; -WinUtils::DwmSetIconicThumbnailProc WinUtils::dwmSetIconicThumbnailPtr = nullptr; -WinUtils::DwmSetIconicLivePreviewBitmapProc WinUtils::dwmSetIconicLivePreviewBitmapPtr = nullptr; -WinUtils::DwmGetWindowAttributeProc WinUtils::dwmGetWindowAttributePtr = nullptr; -WinUtils::DwmSetWindowAttributeProc WinUtils::dwmSetWindowAttributePtr = nullptr; -WinUtils::DwmInvalidateIconicBitmapsProc WinUtils::dwmInvalidateIconicBitmapsPtr = nullptr; -WinUtils::DwmDefWindowProcProc WinUtils::dwmDwmDefWindowProcPtr = nullptr; -WinUtils::DwmGetCompositionTimingInfoProc WinUtils::dwmGetCompositionTimingInfoPtr = nullptr; -WinUtils::DwmFlushProc WinUtils::dwmFlushProcPtr = nullptr; - // Prefix for path used by NT calls. const wchar_t kNTPrefix[] = L"\\??\\"; const size_t kNTPrefixLen = ArrayLength(kNTPrefix) - 1; @@ -462,23 +446,6 @@ static NtTestAlertPtr sNtTestAlert = nullptr; void WinUtils::Initialize() { - if (!sDwmDll) { - sDwmDll = ::LoadLibraryW(kDwmLibraryName); - - if (sDwmDll) { - dwmExtendFrameIntoClientAreaPtr = (DwmExtendFrameIntoClientAreaProc)::GetProcAddress(sDwmDll, "DwmExtendFrameIntoClientArea"); - dwmIsCompositionEnabledPtr = (DwmIsCompositionEnabledProc)::GetProcAddress(sDwmDll, "DwmIsCompositionEnabled"); - dwmSetIconicThumbnailPtr = (DwmSetIconicThumbnailProc)::GetProcAddress(sDwmDll, "DwmSetIconicThumbnail"); - dwmSetIconicLivePreviewBitmapPtr = (DwmSetIconicLivePreviewBitmapProc)::GetProcAddress(sDwmDll, "DwmSetIconicLivePreviewBitmap"); - dwmGetWindowAttributePtr = (DwmGetWindowAttributeProc)::GetProcAddress(sDwmDll, "DwmGetWindowAttribute"); - dwmSetWindowAttributePtr = (DwmSetWindowAttributeProc)::GetProcAddress(sDwmDll, "DwmSetWindowAttribute"); - dwmInvalidateIconicBitmapsPtr = (DwmInvalidateIconicBitmapsProc)::GetProcAddress(sDwmDll, "DwmInvalidateIconicBitmaps"); - dwmDwmDefWindowProcPtr = (DwmDefWindowProcProc)::GetProcAddress(sDwmDll, "DwmDefWindowProc"); - dwmGetCompositionTimingInfoPtr = (DwmGetCompositionTimingInfoProc)::GetProcAddress(sDwmDll, "DwmGetCompositionTimingInfo"); - dwmFlushProcPtr = (DwmFlushProc)::GetProcAddress(sDwmDll, "DwmFlush"); - } - } - if (IsWin10OrLater()) { HMODULE user32Dll = ::GetModuleHandleW(L"user32"); if (user32Dll) { @@ -1179,32 +1146,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) { |