Wraps the lowlevel RtlGetVersion routine.

  Args:
    os_version_info_struct: instance of either a RTL_OSVERSIONINFOW structure
                            or a RTL_OSVERSIONINFOEXW structure,
                            ctypes.Structure-wrapped, with the
                            dwOSVersionInfoSize field preset to
                            ctypes.sizeof(self).

  Raises:
    OSError: if the underlaying routine fails.

  See: https://msdn.microsoft.com/en-us/library/
  windows/hardware/ff561910(v=vs.85).aspx .

def RtlGetVersion(os_version_info_struct):
  """Wraps the lowlevel RtlGetVersion routine.

  Args:
    os_version_info_struct: instance of either a RTL_OSVERSIONINFOW structure
                            or a RTL_OSVERSIONINFOEXW structure,
                            ctypes.Structure-wrapped, with the
                            dwOSVersionInfoSize field preset to
                            ctypes.sizeof(self).

  Raises:
    OSError: if the underlaying routine fails.

  See: https://msdn.microsoft.com/en-us/library/
  windows/hardware/ff561910(v=vs.85).aspx .
  """
  rc = ctypes.windll.Ntdll.RtlGetVersion(ctypes.byref(os_version_info_struct))
  if rc != 0:
    raise OSError("Getting Windows version failed.")