[DllImport("kernel32", SetLastError = true)]
private static extern bool GetVersionEx(ref OSVERSIONINFOEX osvi);
[StructLayout(LayoutKind.Sequential)]
private struct OSVERSIONINFOEX
{
public int dwOSVersionInfoSize;
public int dwMajorVersion;
public int dwMinorVersion;
public int dwBuildNumber;
public int dwPlatformId;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
public string szCSDVersion;
public UInt16 wServicePackMajor;
public UInt16 wServicePackMinor;
public UInt16 wSuiteMask;
public byte wProductType;
public byte wReserved;
}
Declare Function APIGetVersionEx Lib "kernel32.dll" (TODO) As TODO
None.
None.
don't forget to set the dwOSVersionInfoSize
OSVERSIONINFOEX osVersionInfo = new OSVERSIONINFOEX();
osVersionInfo.dwOSVersionInfoSize = Marshal.SizeOf(osVersionInfo); // don't forget this line, please!
GetVersionEx(ref osVersionInfo);
Do you know one? Please contribute it!