CreateURLMoniker Function
Deprecated in Windows Internet Explorer 7. Use CreateURLMonikerEx instead.
Syntax
HRESULT CreateURLMoniker( IMoniker *pMkCtx, LPCWSTR szURL, IMoniker **ppmk );
Parameters
- pMkCtx
- [in] The address of the IMoniker interface for the URL moniker to use as the base context when the szURL parameter is a partial URL string. The pMkCtx parameter can be NULL.
- szURL
- [in] The address of a string value that contains the display name to be parsed.
- ppmk
- [out] Pointer to an IMoniker interface for the new URL moniker.
Return Value
Returns one of the following values.
S_OK Success. E_OUTOFMEMORY The operation ran out of memory. MK_E_SYNTAX A moniker cannot be created because szURL does not correspond to valid URL syntax for a full or partial URL. This is uncommon, because most parsing of the URL occurs during binding, and the syntax for URLs is extremely flexible.
Remarks
The CreateURLMoniker function creates a URL moniker from a full URL string, or from a base context URL moniker and a partial URL string.
Security Alert This function does not correctly interpret percent encoded octets in Windows file paths or "file://" scheme Uniform Resource Identifiers (URIs). On systems with Microsoft Internet Explorer 6 and earlier, calling CreateURLMoniker with the output of a previous call might produce a result that is not equivalent. Since CreateURLMoniker can produce results that are not equivalent to the input, its use can result in security problems.
Use CreateURLMonikerEx with the
URL_MK_UNIFORMflag to ensure that Windows file paths and "file://" URIs are interpreted correctly with regard to percent encoded octets; and that the result is equivalent to the input. To correctly extract a Windows file path from the result of CreateURLMoniker, use the PathCreateFromUrl function.
Function Information
Stock Implementation urlmon.dll Custom Implementation No Header Urlmon.h Import library Urlmon.lib Minimum availability Internet Explorer 3.0 Minimum operating systems Windows NT 4.0, Windows 95, Windows CE 2.12
See Also
CreateURLMoniker Considered Harmful
For more on why CreateURLMoniker is deprecated see the CreateURLMoniker Considered Harmful IE7 blog post: http://blogs.msdn.com/ie/archive/2006/09/13/752347.aspx
- 8/22/2007
- davris
Security Alert This function does not correctly interpret percent encoded octets in Windows file paths or "file://" scheme Uniform Resource Identifiers (URIs). On systems with Microsoft Internet Explorer 6 and earlier, calling CreateURLMoniker with the output of a previous call might produce a result that is not equivalent. Since CreateURLMoniker can produce results that are not equivalent to the input, its use can result in security problems.