The TWUCheckUpdate function retrieves a package information file and uses the information in it to check if the currently installed version of the application needs to be updated.

    TWUPDATE hUpdate,
    const TCHAR *pszUpdateURL,
    const TCHAR *pszSection,
    DWORD dwFlags,
    BOOL *pbUpdateAvailable


[Input] Handle of active update session, created with TWUOpenUpdate.
[Input] Fully qualified URL to the package information file that you want to download and parse. This must include the protocol specifier. Some examples of valid URLs:


Be sure to include the file:// prefix if you are referring to a local or UNC file path.
[Input,optional] Name of the package section to use in the package information file. This name is optional; if you pass NULL to this parameter, the default section name "main" will be used.
[Input] Processing flags; must be set to TWU_UFLAGS_DEFAULT (0) in the current release.
[Output] Receives a TRUE (nonzero) or FALSE (0) value. A nonzero value indicates that a newer version of the application specified by the package information file is available, or that the application in question is not yet installed on the system. A FALSE value indicates that the application in question is up to date, or that no update information was available. In the latter case, the return value of the function will be a nonzero Win32 API error code.

Return value

If the function succeeds, it returns ERROR_SUCCESS (0). If the function fails, it returns a nonzero Win32 API error code. You can use TWUGetErrorMessage to retrieve the error message that corresponds to the error code.