Skip to content

winVersion.WinVersion: define processor architecture property#14464

Merged
seanbudd merged 6 commits into
nvaccess:masterfrom
josephsl:i14439winVersionArchitecture
Dec 21, 2022
Merged

winVersion.WinVersion: define processor architecture property#14464
seanbudd merged 6 commits into
nvaccess:masterfrom
josephsl:i14439winVersionArchitecture

Conversation

@josephsl

Copy link
Copy Markdown
Contributor

Link to issue number:

Closes #14439
Follow-up to #14397
Follow-up to #14403

Summary of the issue:

winVersion.WinVersion class should define processor architecture property to record machine architecture for the current Windows installation.

Description of user facing changes

At NVDA startup, processor architecture will be logged as part of Windows information.

Description of development approach

Add "processorArchitecture" property to winVersion.WinVersion class to record machine architecture (currently x86 (32-bit) AMD64 (x64), ARM64). From getWinVer() function, this value will be fetched via Python's platform.machine() function, which itself looks up processor architecture from environment variables. This means NVDA can read the new property instead of consulting environment variables every time it wishes to check machine architecture. Also, added a unit test to see if the processor architecture recorded is indeed the one Windows says.

Testing strategy:

Unit test: compare winVersion.getWinVer().processorArchitecture against environment variables.

Known issues with pull request:

None

Change log entries:

For developers:

The processor architecture for the computer can be queried from winVersion.WinVersion.processorArchitecture attribute. (#14439)

Code Review Checklist:

  • Pull Request description:
    • description is up to date
    • change log entries
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • API is compatible with existing add-ons.
  • Documentation:
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • Security precautions taken.

…cess#14439.

Define 'processorArchitecture' property in WinVersion class to store machine arcthiecture for the Windows installatoin (x86/32-bit, AMD64, ARM64). This is useful in detecting 64-bit systems and different architectures for use for log output, 64-bit versus 32-bit differences, and testing and debugging.
…#14439.

Print processor architecture for the Windows installation as part of Windows version output.
…ine() function. Re nvaccess#14439.

Python's platform module provides platform.machine() function, returing the processor architecture for the system. If Windows is detected, it internally retrieves PROCESSOR_ARCHITEW6432 and PROCESSOR_ARCHITECTURE environment variabls, in that order so it can detect WoW64 (such as x86 program running on an x64 processor). Because winVersion.getWinVer() function caches the current Windows installatoin, processor architecture string is always available and cached as part of the resulting WinVersion object. The practical implication is that NVDA no longer needs to consult environment variables every time it wants to detect processor architecture as the result is already known at program startup.
…r. Re nvaccess#14439.

Add winVersion.getWinVer().processorArchitecture test to see if what it says matches processor architecture (and WoW64 version) environment variable. Python's platform.machine() function is not used because that function consults environment variables itself.
@josephsl josephsl requested a review from a team as a code owner December 20, 2022 16:10
@seanbudd seanbudd merged commit 8083585 into nvaccess:master Dec 21, 2022
@nvaccessAuto nvaccessAuto added this to the 2023.1 milestone Dec 21, 2022
@josephsl josephsl deleted the i14439winVersionArchitecture branch December 21, 2022 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WinVersion: add machine architecture property

3 participants