InternetCombineUrl

This function combines a base and relative URL into a single URL. The resultant URL is canonicalized.

At a Glance

Header file: Wininet.h
Windows CE versions: 2.0 and later

Syntax

BOOL WINAPI InternetCombineUrl(
LPCTSTR
lpszBaseUrl, LPCTSTR lpszRelativeUrl,  LPTSTR lpszBuffer,  
LPDWORD
lpdwBufferLength, DWORD dwFlags);

Parameters

lpszBaseUrl

Long pointer to the null-terminated string that contains the base URL to be combined.

lpszRelativeUrl

Long pointer to the null-terminated string that contains the relative URL to be combined.

lpszBuffer

Long pointer to a buffer that receives the null-terminated string that contains the resulting URL.

lpdwBufferLength

Long pointer to the size, in bytes, of the lpszBuffer buffer. If the function succeeds, this parameter receives the length, in characters, of the resultant combined URL—the length does not include the terminating null character. If the function fails, this parameter receives the length, in bytes, of the required buffer—the length includes the terminating null character.

dwFlags

Specifies the operation of the function. It is one of the following values:

Value Description
ICU_BROWSER_MODE Does not encode or decode characters after "#" or "?", and does not remove trailing white space after "?". If this value is not specified, the entire URL is encoded and trailing white space is removed.
ICU_DECODE Converts all %XX sequences to characters, including escape sequences, before the URL is parsed.
ICU_ENCODE_SPACES_ONLY Encodes spaces only.
ICU_NO_ENCODE Does not convert unsafe characters to escape sequences.
ICU_NO_META Does not remove meta sequences (such as "." and "..") from the URL.

Return Values

TRUE indicates success. FALSE indicates failure. To get extended error information, call GetLastError. Possible error values for GetLastError are described in the following table.

Value Description
ERROR_BAD_PATHNAME The URLs could not be combined.
ERROR_INSUFFICIENT_BUFFER The buffer supplied to the function was insufficient or NULL. The DWORD indicated by the lpdwBufferLength parameter will contain the number of bytes required to hold the resultant, combined URL.
ERROR_INTERNET_INVALID_URL The format of the URL is invalid.
ERROR_INVALID_PARAMETER Bad string, buffer, buffer size, or flags parameter.

Windows CE Remarks

The lpdwBufferLength parameter refers to the count of characters.

See Also

InternetCanonicalizeUrl