mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-29 02:40:05 +00:00
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:
@@ -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
@@ -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,
|
||||
};
|
||||
Reference in New Issue
Block a user