summaryrefslogtreecommitdiffstats
path: root/widget/windows/WinUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'widget/windows/WinUtils.cpp')
-rw-r--r--widget/windows/WinUtils.cpp59
1 files changed, 25 insertions, 34 deletions
diff --git a/widget/windows/WinUtils.cpp b/widget/windows/WinUtils.cpp
index 149513b2f..0a57ad439 100644
--- a/widget/windows/WinUtils.cpp
+++ b/widget/windows/WinUtils.cpp
@@ -462,7 +462,7 @@ static NtTestAlertPtr sNtTestAlert = nullptr;
void
WinUtils::Initialize()
{
- if (!sDwmDll && IsVistaOrLater()) {
+ if (!sDwmDll) {
sDwmDll = ::LoadLibraryW(kDwmLibraryName);
if (sDwmDll) {
@@ -601,7 +601,7 @@ WinUtils::SystemScaleFactor()
return systemScale;
}
-#ifndef WM_DPICHANGED
+#if WINVER < 0x603
typedef enum {
MDT_EFFECTIVE_DPI = 0,
MDT_ANGULAR_DPI = 1,
@@ -628,16 +628,14 @@ GETPROCESSDPIAWARENESSPROC sGetProcessDpiAwareness;
static bool
SlowIsPerMonitorDPIAware()
{
- if (IsVistaOrLater()) {
- // Intentionally leak the handle.
- HMODULE shcore =
- LoadLibraryEx(L"shcore", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);
- if (shcore) {
- sGetDpiForMonitor =
- (GETDPIFORMONITORPROC) GetProcAddress(shcore, "GetDpiForMonitor");
- sGetProcessDpiAwareness =
- (GETPROCESSDPIAWARENESSPROC) GetProcAddress(shcore, "GetProcessDpiAwareness");
- }
+ // Intentionally leak the handle.
+ HMODULE shcore =
+ LoadLibraryEx(L"shcore", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);
+ if (shcore) {
+ sGetDpiForMonitor =
+ (GETDPIFORMONITORPROC) GetProcAddress(shcore, "GetDpiForMonitor");
+ sGetProcessDpiAwareness =
+ (GETPROCESSDPIAWARENESSPROC) GetProcAddress(shcore, "GetProcessDpiAwareness");
}
PROCESS_DPI_AWARENESS dpiAwareness;
return sGetDpiForMonitor && sGetProcessDpiAwareness &&
@@ -760,7 +758,7 @@ static DWORD
GetWaitFlags()
{
DWORD result = MWMO_INPUTAVAILABLE;
- if (IsVistaOrLater() && XRE_IsContentProcess()) {
+ if (XRE_IsContentProcess()) {
result |= MWMO_ALERTABLE;
}
return result;
@@ -1878,7 +1876,7 @@ WinUtils::IsTouchDeviceSupportPresent()
uint32_t
WinUtils::GetMaxTouchPoints()
{
- if (IsWin7OrLater() && IsTouchDeviceSupportPresent()) {
+ if (IsTouchDeviceSupportPresent()) {
return GetSystemMetrics(SM_MAXIMUMTOUCHES);
}
return 0;
@@ -1893,11 +1891,6 @@ typedef DWORD (WINAPI * GetFinalPathNameByHandlePtr)(HANDLE hFile,
bool
WinUtils::ResolveJunctionPointsAndSymLinks(std::wstring& aPath)
{
- // Users folder was introduced with Vista.
- if (!IsVistaOrLater()) {
- return true;
- }
-
wchar_t path[MAX_PATH] = { 0 };
nsAutoHandle handle(
@@ -2025,21 +2018,19 @@ WinUtils::GetAppInitDLLs(nsAString& aOutput)
}
nsAutoRegKey key(hkey);
LONG status;
- if (IsVistaOrLater()) {
- const wchar_t kLoadAppInitDLLs[] = L"LoadAppInit_DLLs";
- DWORD loadAppInitDLLs = 0;
- DWORD loadAppInitDLLsLen = sizeof(loadAppInitDLLs);
- status = RegQueryValueExW(hkey, kLoadAppInitDLLs, nullptr,
- nullptr, (LPBYTE)&loadAppInitDLLs,
- &loadAppInitDLLsLen);
- if (status != ERROR_SUCCESS) {
- return false;
- }
- if (!loadAppInitDLLs) {
- // If loadAppInitDLLs is zero then AppInit_DLLs is disabled.
- // In this case we'll return true along with an empty output string.
- return true;
- }
+ const wchar_t kLoadAppInitDLLs[] = L"LoadAppInit_DLLs";
+ DWORD loadAppInitDLLs = 0;
+ DWORD loadAppInitDLLsLen = sizeof(loadAppInitDLLs);
+ status = RegQueryValueExW(hkey, kLoadAppInitDLLs, nullptr,
+ nullptr, (LPBYTE)&loadAppInitDLLs,
+ &loadAppInitDLLsLen);
+ if (status != ERROR_SUCCESS) {
+ return false;
+ }
+ if (!loadAppInitDLLs) {
+ // If loadAppInitDLLs is zero then AppInit_DLLs is disabled.
+ // In this case we'll return true along with an empty output string.
+ return true;
}
DWORD numBytes = 0;
const wchar_t kAppInitDLLs[] = L"AppInit_DLLs";