summaryrefslogtreecommitdiff
path: root/xpcom
diff options
context:
space:
mode:
Diffstat (limited to 'xpcom')
-rw-r--r--xpcom/build/XPCOMInit.cpp3
-rw-r--r--xpcom/glue/nsThreadUtils.cpp8
-rw-r--r--xpcom/io/SpecialSystemDirectory.cpp43
-rw-r--r--xpcom/io/SpecialSystemDirectory.h3
-rw-r--r--xpcom/io/nsLocalFileWin.cpp13
5 files changed, 10 insertions, 60 deletions
diff --git a/xpcom/build/XPCOMInit.cpp b/xpcom/build/XPCOMInit.cpp
index c72ea48d77..6ead5cdc73 100644
--- a/xpcom/build/XPCOMInit.cpp
+++ b/xpcom/build/XPCOMInit.cpp
@@ -111,7 +111,6 @@ extern nsresult nsStringInputStreamConstructor(nsISupports*, REFNSIID, void**);
#include "SpecialSystemDirectory.h"
#if defined(XP_WIN)
-#include "mozilla/WindowsVersion.h"
#include "nsWindowsRegKey.h"
#endif
@@ -584,8 +583,6 @@ NS_InitXPCOM2(nsIServiceManager** aResult,
NS_StartupLocalFile();
- StartupSpecialSystemDirectory();
-
nsDirectoryService::RealInit();
bool value;
diff --git a/xpcom/glue/nsThreadUtils.cpp b/xpcom/glue/nsThreadUtils.cpp
index 287ada7bef..2f2383fd8a 100644
--- a/xpcom/glue/nsThreadUtils.cpp
+++ b/xpcom/glue/nsThreadUtils.cpp
@@ -20,15 +20,10 @@
#ifdef XP_WIN
#include <windows.h>
-#include "mozilla/WindowsVersion.h"
-using mozilla::IsVistaOrLater;
#elif defined(XP_MACOSX)
#include <sys/resource.h>
#endif
-#include <pratom.h>
-#include <prthread.h>
-
using namespace mozilla;
#ifndef XPCOM_GLUE_AVOID_NSPR
@@ -443,8 +438,7 @@ nsThreadPoolNaming::SetThreadPoolName(const nsACString& aPoolName,
nsAutoLowPriorityIO::nsAutoLowPriorityIO()
{
#if defined(XP_WIN)
- lowIOPrioritySet = IsVistaOrLater() &&
- SetThreadPriority(GetCurrentThread(),
+ lowIOPrioritySet = SetThreadPriority(GetCurrentThread(),
THREAD_MODE_BACKGROUND_BEGIN);
#elif defined(XP_MACOSX)
oldPriority = getiopolicy_np(IOPOL_TYPE_DISK, IOPOL_SCOPE_THREAD);
diff --git a/xpcom/io/SpecialSystemDirectory.cpp b/xpcom/io/SpecialSystemDirectory.cpp
index 9ce8eb85b3..ab65d38f9a 100644
--- a/xpcom/io/SpecialSystemDirectory.cpp
+++ b/xpcom/io/SpecialSystemDirectory.cpp
@@ -12,7 +12,6 @@
#if defined(XP_WIN)
#include <windows.h>
-#include <shlobj.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -20,9 +19,6 @@
#include <shlobj.h>
#include <knownfolders.h>
#include <guiddef.h>
-#include "mozilla/WindowsVersion.h"
-
-using mozilla::IsWin7OrLater;
#elif defined(XP_UNIX)
@@ -51,40 +47,17 @@ using mozilla::IsWin7OrLater;
#endif
#endif
-#ifdef XP_WIN
-typedef HRESULT (WINAPI* nsGetKnownFolderPath)(GUID& rfid,
- DWORD dwFlags,
- HANDLE hToken,
- PWSTR* ppszPath);
-
-static nsGetKnownFolderPath gGetKnownFolderPath = nullptr;
-#endif
-
-void
-StartupSpecialSystemDirectory()
-{
-#if defined (XP_WIN)
- // SHGetKnownFolderPath is only available on Windows Vista
- // so that we need to use GetProcAddress to get the pointer.
- HMODULE hShell32DLLInst = GetModuleHandleW(L"shell32.dll");
- if (hShell32DLLInst) {
- gGetKnownFolderPath = (nsGetKnownFolderPath)
- GetProcAddress(hShell32DLLInst, "SHGetKnownFolderPath");
- }
-#endif
-}
-
#if defined (XP_WIN)
static nsresult
GetKnownFolder(GUID* aGuid, nsIFile** aFile)
{
- if (!aGuid || !gGetKnownFolderPath) {
+ if (!aGuid) {
return NS_ERROR_FAILURE;
}
PWSTR path = nullptr;
- gGetKnownFolderPath(*aGuid, 0, nullptr, &path);
+ SHGetKnownFolderPath(*aGuid, 0, nullptr, &path);
if (!path) {
return NS_ERROR_FAILURE;
@@ -139,19 +112,13 @@ SHLoadLibraryFromKnownFolder(REFKNOWNFOLDERID aFolderId, DWORD aMode,
}
/*
- * Check to see if we're on Win7 and up, and if so, returns the default
- * save-to location for the Windows Library passed in through aFolderId.
- * Otherwise falls back on pre-win7 GetWindowsFolder.
+ * Return the default save-to location for the Windows Library passed in
+ * through aFolderId.
*/
static nsresult
GetLibrarySaveToPath(int aFallbackFolderId, REFKNOWNFOLDERID aFolderId,
nsIFile** aFile)
{
- // Skip off checking for library support if the os is Vista or lower.
- if (!IsWin7OrLater()) {
- return GetWindowsFolder(aFallbackFolderId, aFile);
- }
-
RefPtr<IShellLibrary> shellLib;
RefPtr<IShellItem> savePath;
HRESULT hr =
@@ -740,8 +707,6 @@ GetSpecialSystemDirectory(SystemDirectories aSystemSystemDirectory,
}
#if defined(MOZ_CONTENT_SANDBOX)
case Win_LocalAppdataLow: {
- // This should only really fail on versions pre-Vista, in which case this
- // shouldn't have been used in the first place.
GUID localAppDataLowGuid = FOLDERID_LocalAppDataLow;
return GetKnownFolder(&localAppDataLowGuid, aFile);
}
diff --git a/xpcom/io/SpecialSystemDirectory.h b/xpcom/io/SpecialSystemDirectory.h
index dd3d883795..7c7f8fa422 100644
--- a/xpcom/io/SpecialSystemDirectory.h
+++ b/xpcom/io/SpecialSystemDirectory.h
@@ -16,9 +16,6 @@
#include "prenv.h"
#endif
-extern void StartupSpecialSystemDirectory();
-
-
enum SystemDirectories {
OS_DriveDirectory = 1,
OS_TemporaryDirectory = 2,
diff --git a/xpcom/io/nsLocalFileWin.cpp b/xpcom/io/nsLocalFileWin.cpp
index 3a7e570f56..66e2678075 100644
--- a/xpcom/io/nsLocalFileWin.cpp
+++ b/xpcom/io/nsLocalFileWin.cpp
@@ -7,7 +7,6 @@
#include "mozilla/ArrayUtils.h"
#include "mozilla/DebugOnly.h"
#include "mozilla/UniquePtrExtensions.h"
-#include "mozilla/WindowsVersion.h"
#include "nsCOMPtr.h"
#include "nsAutoPtr.h"
@@ -1970,13 +1969,11 @@ nsLocalFile::CopySingleFile(nsIFile* aSourceFile, nsIFile* aDestParent,
// So we only use COPY_FILE_NO_BUFFERING when we have a remote drive.
int copyOK;
DWORD dwCopyFlags = COPY_FILE_ALLOW_DECRYPTED_DESTINATION;
- if (IsVistaOrLater()) {
- bool path1Remote, path2Remote;
- if (!IsRemoteFilePath(filePath.get(), path1Remote) ||
- !IsRemoteFilePath(destPath.get(), path2Remote) ||
- path1Remote || path2Remote) {
- dwCopyFlags |= COPY_FILE_NO_BUFFERING;
- }
+ bool path1Remote, path2Remote;
+ if (!IsRemoteFilePath(filePath.get(), path1Remote) ||
+ !IsRemoteFilePath(destPath.get(), path2Remote) ||
+ path1Remote || path2Remote) {
+ dwCopyFlags |= COPY_FILE_NO_BUFFERING;
}
if (!move) {