src/Cedar/VLanWin32.c
// Get the version information of Windows

Get the version information of Windows
Get the version information of Windows
void Win32GetWinVer(RPC_WINVER *v)
{
	if (v == NULL)
	{
		return;
	}
	Zero(v, sizeof(RPC_WINVER));
	v->IsWindows = true;
	if (OS_IS_WINDOWS_NT(GetOsType()) == false)
	{
		OSVERSIONINFO os;
		Zero(&os, sizeof(os));
		os.dwOSVersionInfoSize = sizeof(os);
		GetVersionEx(&os);
		v->Build = LOWORD(os.dwBuildNumber);
		v->VerMajor = os.dwMajorVersion;
		v->VerMinor = os.dwMinorVersion;
		Format(v->Title, sizeof(v->Title), "%s %s",
			GetOsInfo()->OsProductName,
			GetOsInfo()->OsVersion);
		Trim(v->Title);
	}
	else
	{
		OSVERSIONINFOEX os;
		Zero(&os, sizeof(os));
		os.dwOSVersionInfoSize = sizeof(os);
		Win32GetVersionExInternal((LPOSVERSIONINFOA)&os);
		v->IsNT = true;
		v->Build = os.dwBuildNumber;
		v->ServicePack = os.wServicePackMajor;
		if (os.wProductType != VER_NT_WORKSTATION)
		{
			v->IsServer = true;
		}
		v->VerMajor = os.dwMajorVersion;
		v->VerMinor = os.dwMinorVersion;
		if (GetOsInfo()->OsServicePack == 0)
		{
			StrCpy(v->Title, sizeof(v->Title), GetOsInfo()->OsProductName);
		}
		else
		{
			Format(v->Title, sizeof(v->Title), "%s Service Pack %u",
				GetOsInfo()->OsProductName,
				GetOsInfo()->OsServicePack);
		}
		Trim(v->Title);
		if (InStr(GetOsInfo()->OsVersion, "rc") ||
			InStr(GetOsInfo()->OsVersion, "beta"))
		{
			v->IsBeta = true;
		}
	}
}
void Win32GetWinVer ( RPC_WINVER * v ) { if ( v == NULL ) { return ; } Zero ( v , sizeof ( RPC_WINVER ) ) ; v -> IsWindows = true ; if ( OS_IS_WINDOWS_NT ( GetOsType ( ) ) == false ) { OSVERSIONINFO os ; Zero ( & os , sizeof ( os ) ) ; os . dwOSVersionInfoSize = sizeof ( os ) ; GetVersionEx ( & os ) ; v -> Build = LOWORD ( os . dwBuildNumber ) ; v -> VerMajor = os . dwMajorVersion ; v -> VerMinor = os . dwMinorVersion ; Format ( v -> Title , sizeof ( v -> Title ) , " " , GetOsInfo ( ) -> OsProductName , GetOsInfo ( ) -> OsVersion ) ; Trim ( v -> Title ) ; } else { OSVERSIONINFOEX os ; Zero ( & os , sizeof ( os ) ) ; os . dwOSVersionInfoSize = sizeof ( os ) ; Win32GetVersionExInternal ( ( LPOSVERSIONINFOA ) & os ) ; v -> IsNT = true ; v -> Build = os . dwBuildNumber ; v -> ServicePack = os . wServicePackMajor ; if ( os . wProductType != VER_NT_WORKSTATION ) { v -> IsServer = true ; } v -> VerMajor = os . dwMajorVersion ; v -> VerMinor = os . dwMinorVersion ; if ( GetOsInfo ( ) -> OsServicePack == 0 ) { StrCpy ( v -> Title , sizeof ( v -> Title ) , GetOsInfo ( ) -> OsProductName ) ; } else { Format ( v -> Title , sizeof ( v -> Title ) , " " , GetOsInfo ( ) -> OsProductName , GetOsInfo ( ) -> OsServicePack ) ; } Trim ( v -> Title ) ; if ( InStr ( GetOsInfo ( ) -> OsVersion , " " ) || InStr ( GetOsInfo ( ) -> OsVersion , " " ) ) { v -> IsBeta = true ; } } }
Get the version information of Windows
Get the version information of Windows
// Validate arguments
 // Windows 9x
 // Windows NT 4.0 SP6 or later
