Bug 942402 - Stop using GetVersionEx in c-c. r=Standard8
--- a/mailnews/import/oexpress/nsOESettings.cpp
+++ b/mailnews/import/oexpress/nsOESettings.cpp
@@ -4,27 +4,28 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*
Outlook Express (Win32) settings
*/
+#include "nsOESettings.h"
+#include "mozilla/WindowsVersion.h"
#include "nsCOMPtr.h"
#include "nscore.h"
#include "nsMsgUtils.h"
#include "nsOEImport.h"
#include "nsIComponentManager.h"
#include "nsIServiceManager.h"
#include "nsOERegUtil.h"
#include "nsIMsgAccountManager.h"
#include "nsIMsgAccount.h"
#include "nsIImportSettings.h"
-#include "nsOESettings.h"
#include "nsMsgBaseCID.h"
#include "nsMsgCompCID.h"
#include "nsMsgI18N.h"
#include "nsISmtpService.h"
#include "nsISmtpServer.h"
#include "nsOEStringBundle.h"
#include "OEDebugLog.h"
#include "nsIPop3IncomingServer.h"
@@ -893,32 +894,30 @@ void OESettings::SetSmtpServer(const nsS
nativeSmtpServer.get());
}
}
}
}
bool OESettings::IsKB933612Applied()
{
- OSVERSIONINFOEX versionInfo = { 0 };
- versionInfo.dwOSVersionInfoSize = sizeof(versionInfo);
- GetVersionEx(reinterpret_cast<OSVERSIONINFO*>(&versionInfo));
-
- // Windows XP SP3 and Windows Vista SP1 include KB933612 fix.
+ // The following versions of Windows include KB933612 fix:
+ // - Windows 7 and future versions of Windows
+ // - Windows Vista, SP1 or later
+ // - Windows Server 2003, SP2 or later
+ // - Windows XP, SP3 or later
+ //
+ // The following versions do not:
+ // - Windows Vista SP0
+ // - Windows Server 2003, SP1 or earlier
+ // - Windows XP, SP2 or earlier
+ //
// See http://support.microsoft.com/kb/929123 and
// http://support.microsoft.com/kb/933612
- switch (versionInfo.dwMajorVersion) {
- case 6:
- if ((versionInfo.dwMinorVersion == 0 && versionInfo.wServicePackMajor > 0) ||
- versionInfo.dwMinorVersion == 1) {
- return true;
- }
- break;
- case 5:
- if (versionInfo.dwMinorVersion > 0 && versionInfo.wServicePackMajor > 2)
- return true;
- break;
- default:
- break;
- }
- return false;
+ //
+ // Note that mozilla::IsWin2003SP2OrLater() will return true for
+ // Windows Vista and mozilla::IsXPSP3OrLater() will return true
+ // for Windows Server 2003.
+ return mozilla::IsVistaSP1OrLater() ||
+ !mozilla::IsWin2003OrLater() && mozilla::IsXPSP3OrLater() ||
+ !mozilla::IsVistaOrLater() && mozilla::IsWin2003SP2OrLater();
}