TWUParseVersion

The TWUParseVersion function parses a string of the form a.b.c.d to a low and a high-order DWORD value, suitable for version comparison with TWUCompareVersions.

BOOL TWUParseVersion(
    const TCHAR *pszVersion,
    DWORD *pdwVersionLow,
    DWORD *pdwVersionHigh
);

Delphi version:

function TWUParseVersion(
    pszVersion: PTCHAR;
    var pdwVersionLow: DWORD;
    var pdwVersionHigh: DWORD
): BOOL;

Parameters

pszVersion
[Input] Version string in the format a.b.c.d, from most to least-significant. Less significant parts may be omitted from the right and are taken to be 0, so 2.1.0.0, 2.1.0, and 2.1 all designate the same version.
pdwVersionLow
[Output] Pointer to a variable that receives the low-order DWORD of the version number.
pdwVersionHigh
[Output] Pointer to a variable that receives the high-order DWORD of the version number.

Return value

If the function succeeds, it returns a nonzero value; if it fails, it returns FALSE (0). If the passed-in string is not in the correct format, the version numbers will be set to 0, but no error is indicated.