Skip to main content

CompareBrowserVersions

Function CompareBrowserVersions 

Source
pub unsafe extern "stdcall" fn CompareBrowserVersions(
    version1: PCWSTR,
    version2: PCWSTR,
    result: *mut i32,
) -> HRESULT
Expand description

This method is for anyone want to compare version correctly to determine which version is newer, older or same. It can be used to determine whether to use webview2 or certain feature base on version. Sets the value of result to -1, 0 or 1 if version1 is less than, equal or greater than version2 respectively. Returns E_INVALIDARG if it fails to parse any of the version strings or any input parameter is null. Input can directly use the versionInfo obtained from GetAvailableCoreWebView2BrowserVersionString, channel info will be ignored.