GetVersionEx function Null safety kernel32

int GetVersionEx (
  1. Pointer<OSVERSIONINFO> lpVersionInformation

With the release of Windows 8.1, the behavior of the GetVersionEx API has changed in the value it will return for the operating system version. The value returned by the GetVersionEx function now depends on how the application is manifested. Applications not manifested for Windows 8.1 or Windows 10 will return the Windows 8 OS version value (6.2). Once an application is manifested for a given operating system version, GetVersionEx will always return the version that the application is manifested for in future releases.

BOOL GetVersionExW(
  LPOSVERSIONINFOW lpVersionInformation


int GetVersionEx(Pointer<OSVERSIONINFO> lpVersionInformation) {
  final _GetVersionEx = _kernel32.lookupFunction<
      Int32 Function(Pointer<OSVERSIONINFO> lpVersionInformation),
      int Function(
          Pointer<OSVERSIONINFO> lpVersionInformation)>('GetVersionExW');
  return _GetVersionEx(lpVersionInformation);