VirtualBox

Ignore:
Timestamp:
Mar 27, 2017 8:08:42 PM (8 years ago)
Author:
vboxsync
Message:

ValidationKit: add Windows build ID to getHostOsVersion()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/common/utils.py

    r65969 r66271  
    218218                     "14": "Unknown 14", }
    219219        sVersion += ' / OS X ' + sOsxVersion + ' (' + codenames[sOsxVersion.split('.')[1]] + ')'
     220
     221    elif sOs == 'win':
     222        class OSVersionInfoEx(ctypes.Structure):
     223            """ OSVERSIONEX """
     224            kaFields = [
     225                    ('dwOSVersionInfoSize', ctypes.c_ulong),
     226                    ('dwMajorVersion',      ctypes.c_ulong),
     227                    ('dwMinorVersion',      ctypes.c_ulong),
     228                    ('dwBuildNumber',       ctypes.c_ulong),
     229                    ('dwPlatformId',        ctypes.c_ulong),
     230                    ('szCSDVersion',        ctypes.c_wchar*128),
     231                    ('wServicePackMajor',   ctypes.c_ushort),
     232                    ('wServicePackMinor',   ctypes.c_ushort),
     233                    ('wSuiteMask',          ctypes.c_ushort),
     234                    ('wProductType',        ctypes.c_byte),
     235                    ('wReserved',           ctypes.c_byte)]
     236            _fields_ = kaFields # pylint: disable=invalid-name
     237
     238            def __init__(self):
     239                super(OSVersionInfoEx, self).__init__()
     240                self.dwOSVersionInfoSize = ctypes.sizeof(self)
     241
     242        oOsVersion = OSVersionInfoEx()
     243        rc = ctypes.windll.Ntdll.RtlGetVersion(ctypes.byref(oOsVersion))
     244        if rc == 0:
     245            sVersion += ' build ' + str(oOsVersion.dwBuildNumber)
    220246
    221247    return sVersion;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette