Differential D3094 Diff 14018 ps/trunk/libraries/source/spidermonkey/include-win32-debug/mozilla/WindowsVersion.h
Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/libraries/source/spidermonkey/include-win32-debug/mozilla/WindowsVersion.h
Show First 20 Lines • Show All 166 Lines • ▼ Show 20 Lines | |||||
MOZ_ALWAYS_INLINE bool | MOZ_ALWAYS_INLINE bool | ||||
IsWin8OrLater() | IsWin8OrLater() | ||||
{ | { | ||||
return IsWindowsVersionOrLater(0x06020000ul); | return IsWindowsVersionOrLater(0x06020000ul); | ||||
} | } | ||||
MOZ_ALWAYS_INLINE bool | MOZ_ALWAYS_INLINE bool | ||||
IsWin8Point1OrLater() | |||||
{ | |||||
return IsWindowsVersionOrLater(0x06030000ul); | |||||
} | |||||
MOZ_ALWAYS_INLINE bool | |||||
IsWin10OrLater() | IsWin10OrLater() | ||||
{ | { | ||||
return IsWindowsVersionOrLater(0x0a000000ul); | return IsWindowsVersionOrLater(0x0a000000ul); | ||||
} | } | ||||
MOZ_ALWAYS_INLINE bool | MOZ_ALWAYS_INLINE bool | ||||
IsNotWin7PreRTM() | IsNotWin7PreRTM() | ||||
{ | { | ||||
return IsWin7SP1OrLater() || !IsWin7OrLater() || | return IsWin7SP1OrLater() || !IsWin7OrLater() || | ||||
IsWindowsBuildOrLater(7600); | IsWindowsBuildOrLater(7600); | ||||
} | } | ||||
MOZ_ALWAYS_INLINE bool | |||||
IsWin7AndPre2000Compatible() { | |||||
/* | |||||
* See Bug 1279171. | |||||
* We'd like to avoid using WMF on specific OS version when compatibility | |||||
* mode is in effect. The purpose of this function is to check if FF runs on | |||||
* Win7 OS with application compatibility mode being set to 95/98/ME. | |||||
* Those compatibility mode options (95/98/ME) can only display and | |||||
* be selected for 32-bit application. | |||||
* If the compatibility mode is in effect, the GetVersionEx function will | |||||
* report the OS as it identifies itself, which may not be the OS that is | |||||
* installed. | |||||
* Note : 1) We only target for Win7 build number greater than 7600. | |||||
* 2) GetVersionEx may be altered or unavailable for release after | |||||
* Win8.1. Set pragma to avoid build warning as error. | |||||
*/ | |||||
bool isWin7 = IsNotWin7PreRTM() && !IsWin8OrLater(); | |||||
if (!isWin7) { | |||||
return false; | |||||
} | |||||
OSVERSIONINFOEX info; | |||||
ZeroMemory(&info, sizeof(OSVERSIONINFOEX)); | |||||
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); | |||||
#pragma warning(push) | |||||
#pragma warning(disable:4996) | |||||
bool success = GetVersionEx((LPOSVERSIONINFO) &info); | |||||
#pragma warning(pop) | |||||
if (!success) { | |||||
return false; | |||||
} | |||||
return info.dwMajorVersion < 5; | |||||
} | |||||
} // namespace mozilla | } // namespace mozilla | ||||
#endif /* mozilla_WindowsVersion_h */ | #endif /* mozilla_WindowsVersion_h */ |
Wildfire Games · Phabricator