UrlFixupW Function

Attempts to correct a URL whose protocol identifier is incorrect. For example, htttp will be changed to http. Priority is given to the first character in the protocol identifier section so htp will be converted to http instead of ftp.

Syntax

HRESULT UrlFixupW(      
    LPCWSTR pszIn,
    LPWSTR pszOut,
    DWORD cchOut
);

Parameters

  • pszIn
    [in] A pointer to the URL as a Unicode string.
  • pszOut
    [out] A pointer to the corrected URL as a NULL terminated Unicode string.
  • cchOut
    The size of the pszOut string.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

Note  This function is available through Windows Vista and Windows Server 2003. It might be altered or unavailable in subsequent versions of Windows.

The following code example demonstrates the use of this function:

WCHAR szURL[MAX_URL_STRING];
    UrlFixupW(pszInput, szURL, ARRAYSIZE(szUrl));

Function Information

Minimum DLL Version shlwapi.dll
Custom Implementation No
Header shlwapi.h
Import library None
Minimum operating systems Windows Vista