diff --git a/xpcom/io/SpecialSystemDirectory.cpp b/xpcom/io/SpecialSystemDirectory.cpp index 43fc27cc938..a59686324cd 100644 --- a/xpcom/io/SpecialSystemDirectory.cpp +++ b/xpcom/io/SpecialSystemDirectory.cpp @@ -19,6 +19,9 @@ #include #include #include +#include "mozilla/WindowsVersion.h" + +using mozilla::IsWin7OrLater; #elif defined(XP_OS2) @@ -155,10 +158,7 @@ GetLibrarySaveToPath(int aFallbackFolderId, REFKNOWNFOLDERID aFolderId, nsIFile** aFile) { // Skip off checking for library support if the os is Vista or lower. - DWORD dwVersion = GetVersion(); - if ((DWORD)(LOBYTE(LOWORD(dwVersion))) < 6 || - ((DWORD)(LOBYTE(LOWORD(dwVersion))) == 6 && - (DWORD)(HIBYTE(LOWORD(dwVersion))) == 0)) + if (!IsWin7OrLater()) return GetWindowsFolder(aFallbackFolderId, aFile); nsRefPtr shellLib; diff --git a/xpcom/io/nsLocalFileWin.cpp b/xpcom/io/nsLocalFileWin.cpp index 3d1e3e01ab0..223b4bd0c51 100644 --- a/xpcom/io/nsLocalFileWin.cpp +++ b/xpcom/io/nsLocalFileWin.cpp @@ -5,6 +5,7 @@ #include "mozilla/DebugOnly.h" #include "mozilla/Util.h" +#include "mozilla/WindowsVersion.h" #include "nsCOMPtr.h" #include "nsAutoPtr.h" @@ -1834,10 +1835,8 @@ nsLocalFile::CopySingleFile(nsIFile *sourceFile, nsIFile *destParent, // Copying a 1KB file without COPY_FILE_NO_BUFFERING takes < 1ms. // So we only use COPY_FILE_NO_BUFFERING when we have a remote drive. int copyOK; - DWORD dwVersion = GetVersion(); - DWORD dwMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion))); DWORD dwCopyFlags = COPY_FILE_ALLOW_DECRYPTED_DESTINATION; - if (dwMajorVersion > 5) { + if (IsVistaOrLater()) { bool path1Remote, path2Remote; if (!IsRemoteFilePath(filePath.get(), path1Remote) || !IsRemoteFilePath(destPath.get(), path2Remote) ||