summaryrefslogtreecommitdiffstats
path: root/widget/windows/WinUtils.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-02-18 13:56:18 +0100
committerwolfbeast <mcwerewolf@gmail.com>2018-02-18 14:56:31 +0100
commita24398e42d2f300b5979d1fb45a481e2912fd4f3 (patch)
tree82c15ba37726971108f6b92c15a70e9f57950846 /widget/windows/WinUtils.cpp
parentb55f0e7f0d3c66b609ac8979265c62bd1fa85bb6 (diff)
downloadUXP-a24398e42d2f300b5979d1fb45a481e2912fd4f3.tar
UXP-a24398e42d2f300b5979d1fb45a481e2912fd4f3.tar.gz
UXP-a24398e42d2f300b5979d1fb45a481e2912fd4f3.tar.lz
UXP-a24398e42d2f300b5979d1fb45a481e2912fd4f3.tar.xz
UXP-a24398e42d2f300b5979d1fb45a481e2912fd4f3.zip
Remove unnecessary code in /widget.
- Remove numerous blocklist entries that no longer apply. - Remove CanComputeVirtualKeyCodeFromScanCode(), because it's always true. - Remove ShowXP{Folder,File}Picker(), since we have native pickers on supported Windows versions. - Remove the config.trim_on_minimize preference, which is pointless on NT6+ and will just cause problems if used. Tag #22.
Diffstat (limited to 'widget/windows/WinUtils.cpp')
-rw-r--r--widget/windows/WinUtils.cpp57
1 files changed, 24 insertions, 33 deletions
diff --git a/widget/windows/WinUtils.cpp b/widget/windows/WinUtils.cpp
index 149513b2f..418a77182 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) {
@@ -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";