Version v0.1.0
The operating system version, read through RtlGetVersion.
OsVersionInfoEx
pub struct OsVersionInfoEx {
pub size: uint32;
pub majorVersion: uint32;
pub minorVersion: uint32;
pub buildNumber: uint32;
pub platformId: uint32;
pub csdVersion: char16[N];
pub servicePackMajor: uint16;
pub servicePackMinor: uint16;
pub suiteMask: uint16;
pub productType: uint8;
pub reserved: uint8;
}
The RTL_OSVERSIONINFOEXW that RtlGetVersion fills in.
Fields
| Name | Type | Description |
|---|---|---|
size | uint32 | The structure's size in bytes, sizeof(OsVersionInfoEx), which the caller sets before the call. |
majorVersion | uint32 | The major version: 10 for both Windows 10 and Windows 11. |
minorVersion | uint32 | The minor version: 0 for both Windows 10 and Windows 11. |
buildNumber | uint32 | The build number, such as 26100, which tells the releases apart. |
platformId | uint32 | The platform: 2, VER_PLATFORM_WIN32_NT, on every supported release. |
csdVersion | char16[N] | The NUL-terminated UTF-16 name of the latest service pack, empty on current releases. |
servicePackMajor | uint16 | The major version of the latest service pack. |
servicePackMinor | uint16 | The minor version of the latest service pack. |
suiteMask | uint16 | The VER_SUITE_ bits saying which product suites are installed. |
productType | uint8 | Whether this is a workstation, VER_NT_WORKSTATION, a domain controller or a server. |
reserved | uint8 | Reserved. |
VER_NT_WORKSTATION
pub const VER_NT_WORKSTATION: uint8 = 1;
VER_NT_WORKSTATION: the product type of a desktop edition, as opposed to a server.
VER_PLATFORM_WIN32_NT
pub const VER_PLATFORM_WIN32_NT: uint32 = 2;
VER_PLATFORM_WIN32_NT: the platform of every supported Windows release.
RtlGetVersion
pub extern func RtlGetVersion(info: *var OsVersionInfoEx) -> int32
Reads the true version of the running system, whatever the program's manifest declares.
The caller sets size first; the call fills in every other field, csdVersion and the fields after it
included, because the size says the structure is the extended one. It returns an NTSTATUS rather than a
Bool, and sets nothing GetLastError reports.
See also: https://learn.microsoft.com/windows-hardware/drivers/ddi/wdm/nf-wdm-rtlgetversion
Parameters
| Name | Type | Description |
|---|---|---|
info | *var OsVersionInfoEx | the structure to fill, with size set to sizeof(OsVersionInfoEx) |
Returns: zero, STATUS_SUCCESS, which is the only status the call returns