DWsDecodeUrl function
Evaluates the components of an URL to determine its "scheme". A WS_URL_SCHEME_TYPE value is encapsulated in a WS_URL structure and a reference to the structure is returned via output parameter. If the scheme is not recognized, the function returns WS_E_INVALID_FORMAT. Only scheme types identified in WS_URL_SCHEME_TYPE are supported.
Syntax
HRESULT WINAPI WsDecodeUrl(
_In_ const WS_STRING* url,
_In_ ULONG flags,
_In_ WS_HEAP* heap,
WS_URL** outUrl,
_In_opt_ WS_ERROR* error
);
Parameters
- url [in]
-
A pointer to a WS_STRING representation of the URL to evaluate.
- flags [in]
-
Determines the URL scheme evaluation method. See WS_URL_FLAGS.
- heap [in]
-
A pointer to a WS_HEAP in which to allocate the returned URL reference.
- outUrl
-
Reference to the WS_URL structure that encapsulates the WS_URL_SCHEME_TYPE value.
- error [in, optional]
-
A pointer to a WS_ERROR object where additional information about the error should be stored if the function fails.
Return value
This function can return one of these values.
| Return code | Description |
|---|---|
|
One or more arguments are invalid. |
|
Ran out of memory. |
|
The input URL was not in the correct format, or the scheme was not recognized. |
|
This function may return other errors not listed above. |
Security
WsDecodeUrl will perform string parsing to decode the given encoded URL string into its components based on its scheme. It does not mitigate against potential security vulnerabilities in the consuming application based on its interpretation and usage of the decoded components (for example, 'http://format.exe' is a valid URL and will be parsed into components successfully). It neither classifies the given URL based on security zones nor performs any authorization check over the resources that it identifies.
Remarks
The grammar parsed for the schemes "http", "https", "net.tcp" and "soap.udp" can be found at http://www.ietf.org/rfc/rfc3986.txt. For these schemes:
- A non-empty hostname is required.
- For the IP-literal production all the characters demarcated by "[" and "]" are returned. They are not enforced to follow the IPv6Address production.
- The userinfo part of authority (for example, userinfo@hostname:port) is not supported.
If no port is specified the default port for that scheme is returned.
If no port is specified for the soap.udp scheme 0xFFFFFFFF is returned as the default.
Requirements
|
Minimum supported client | Windows 7 [desktop apps | Windows Store apps] |
|---|---|
|
Minimum supported server | Windows Server 2008 R2 [desktop apps | Windows Store apps] |
|
Header |
|
|
Library |
|
|
DLL |
|