Fixed getting windows version. The former function is no longer working on Windows 10. Also fixed the struct to use correct win32 names

This commit is contained in:
zhibog
2020-10-24 00:14:01 +02:00
parent feeb342c00
commit 4c4112fbc7
3 changed files with 37 additions and 29 deletions
+8
View File
@@ -0,0 +1,8 @@
package version
foreign import ntdll_lib "system:ntdll.lib"
@(default_calling_convention="std")
foreign ntdll_lib {
RtlGetVersion :: proc(lpVersionInformation: ^OSVERSIONINFOEXW) -> NTSTATUS ---;
}
+13 -12
View File
@@ -36,6 +36,7 @@ ULONG_PTR :: uint;
DWORD_PTR :: ULONG_PTR;
ULONG :: c_ulong;
UCHAR :: BYTE;
NTSTATUS :: c.long;
PDWORD_PTR :: ^DWORD_PTR;
ATOM :: distinct WORD;
@@ -721,15 +722,15 @@ SYSTEM_INFO :: struct {
// https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/ns-wdm-_osversioninfoexw
OSVERSIONINFOEXW :: struct {
os_version_info_size: ULONG,
major_version: ULONG,
minor_version: ULONG,
build_number: ULONG,
platform_id : ULONG,
service_pack_string: [128]WCHAR,
service_pack_major: USHORT,
service_pack_minor: USHORT,
suite_mask: USHORT,
product_type: UCHAR,
reserved: UCHAR,
}
dwOSVersionInfoSize: ULONG,
dwMajorVersion: ULONG,
dwMinorVersion: ULONG,
dwBuildNumber: ULONG,
dwPlatformId: ULONG,
szCSDVersion: [128]WCHAR,
wServicePackMajor: USHORT,
wServicePackMinor: USHORT,
wSuiteMask: USHORT,
wProductType: UCHAR,
wReserved: UCHAR,
};