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.
This commit is contained in:
Moonchild
2020-09-17 15:24:50 +00:00
parent b6b868b1bd
commit 8151bb2b05
4 changed files with 5 additions and 47 deletions
+3 -3
View File
@@ -40,8 +40,8 @@
#ifdef XP_WIN
#include "nsWindowsDllInterceptor.h"
#include "mozilla/widget/AudioSession.h"
#include "WinUtils.h"
#include <knownfolders.h>
#include <shlobj.h>
#endif
#ifdef MOZ_WIDGET_COCOA
@@ -1918,8 +1918,8 @@ GetLocalLowTempPath(size_t aLen, LPWSTR aPath)
{
NS_NAMED_LITERAL_STRING(tempname, "\\Temp");
LPWSTR path;
if (SUCCEEDED(WinUtils::SHGetKnownFolderPath(FOLDERID_LocalAppDataLow, 0,
nullptr, &path))) {
if (SUCCEEDED(SHGetKnownFolderPath(FOLDERID_LocalAppDataLow, 0,
nullptr, &path))) {
if (wcslen(path) + tempname.Length() < aLen) {
wcscpy(aPath, path);
wcscat(aPath, tempname.get());