Skip to content

Commit a5c14c2

Browse files
authored
Merge 8c00e59 into e16c310
2 parents e16c310 + 8c00e59 commit a5c14c2

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

source/COMRegistrationFixes/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# A part of NonVisual Desktop Access (NVDA)
2-
# Copyright (C) 2018-2021 NV Access Limited, Luke Davis (Open Source Systems, Ltd.)
2+
# Copyright (C) 2018-2023 NV Access Limited, Luke Davis (Open Source Systems, Ltd.)
33
# This file is covered by the GNU General Public License.
44
# See the file COPYING for more details.
55

@@ -110,13 +110,13 @@ def apply64bitRegistryPatch(fileName: str) -> None:
110110
log.debug(f"Applied 64-bit registry patch from {fileName}")
111111

112112

113-
def fixCOMRegistrations():
113+
def fixCOMRegistrations() -> None:
114114
"""Registers most common COM proxies, in case they have accidentally been unregistered or overwritten by
115115
3rd party software installs or uninstalls.
116116
"""
117-
is64bit = os.environ.get("PROCESSOR_ARCHITEW6432", "").endswith("64")
118117
winVer = winVersion.getWinVer()
119118
OSMajorMinor = (winVer.major, winVer.minor)
119+
is64bit = winVer.processorArchitecture.endswith("64")
120120
log.debug(
121121
f"Fixing COM registrations for Windows {OSMajorMinor[0]}.{OSMajorMinor[1]}, "
122122
"{} bit.".format("64" if is64bit else "32")

source/NVDAHelper.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# A part of NonVisual Desktop Access (NVDA)
2-
# Copyright (C) 2008-2022 NV Access Limited, Peter Vagner, Davy Kager, Mozilla Corporation, Google LLC,
2+
# Copyright (C) 2008-2023 NV Access Limited, Peter Vagner, Davy Kager, Mozilla Corporation, Google LLC,
33
# Leonard de Ruijter
44
# This file is covered by the GNU General Public License.
55
# See the file COPYING for more details.
@@ -528,7 +528,7 @@ def terminate(self):
528528
winKernel.closeHandle(self._process)
529529

530530

531-
def initialize():
531+
def initialize() -> None:
532532
global _remoteLib, _remoteLoaderAMD64, _remoteLoaderARM64
533533
global localLib, generateBeep, VBuf_getTextInRange, lastLanguageID, lastLayoutString
534534
hkl=c_ulong(windll.User32.GetKeyboardLayout(0)).value
@@ -595,7 +595,7 @@ def initialize():
595595
#Manually start the in-process manager thread for this NVDA main thread now, as a slow system can cause this action to confuse WX
596596
_remoteLib.initInprocManagerThreadIfNeeded()
597597
versionedLibARM64Path
598-
arch = os.environ.get('PROCESSOR_ARCHITEW6432')
598+
arch = winVersion.getWinVer().processorArchitecture
599599
if arch == 'AMD64':
600600
_remoteLoaderAMD64 = _RemoteLoader(versionedLibAMD64Path)
601601
elif arch == 'ARM64':

source/appModuleHandler.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: UTF-8 -*-
22
# A part of NonVisual Desktop Access (NVDA)
3-
# Copyright (C) 2006-2022 NV Access Limited, Peter Vágner, Aleksey Sadovoy, Patrick Zajda, Joseph Lee,
3+
# Copyright (C) 2006-2023 NV Access Limited, Peter Vágner, Aleksey Sadovoy, Patrick Zajda, Joseph Lee,
44
# Babbage B.V., Mozilla Corporation, Julien Cochuyt, Leonard de Ruijter
55
# This file is covered by the GNU General Public License.
66
# See the file COPYING for more details.
@@ -628,11 +628,11 @@ def _get_appPath(self):
628628
self.appPath = path.value if path else None
629629
return self.appPath
630630

631-
def _get_is64BitProcess(self):
631+
def _get_is64BitProcess(self) -> bool:
632632
"""Whether the underlying process is a 64 bit process.
633633
@rtype: bool
634634
"""
635-
if os.environ.get("PROCESSOR_ARCHITEW6432") not in ("AMD64","ARM64"):
635+
if winVersion.getWinVer().processorArchitecture not in ("AMD64","ARM64"):
636636
# This is 32 bit Windows.
637637
self.is64BitProcess = False
638638
return False
@@ -733,7 +733,7 @@ def _get_appArchitecture(self) -> str:
733733
processMachine = ctypes.wintypes.USHORT()
734734
ctypes.windll.kernel32.IsWow64Process2(self.processHandle, ctypes.byref(processMachine), None)
735735
if not processMachine.value:
736-
self.appArchitecture = os.environ.get("PROCESSOR_ARCHITEW6432")
736+
self.appArchitecture = winVersion.getWinVer().processorArchitecture
737737
else:
738738
# On ARM64, two 32-bit architectures are supported: x86 (via emulation) and ARM (natively).
739739
self.appArchitecture = archValues2ArchNames[processMachine.value]

0 commit comments

Comments
 (0)