PathCreateFromUrlW function (shlwapi.h)

Converts a file URL to a Microsoft MS-DOS path.

Syntax

LWSTDAPI PathCreateFromUrlW(
  [in]      PCWSTR pszUrl,
  [out]     PWSTR  pszPath,
  [in, out] DWORD  *pcchPath,
            DWORD  dwFlags
);

Parameters

[in] pszUrl

Type: PCTSTR

A null-terminated string of maximum length INTERNET_MAX_URL_LENGTH that contains the URL.

[out] pszPath

Type: PTSTR

A pointer to a buffer that, when this function returns successfully, receives the MS-DOS path. You must set the size of this buffer to MAX_PATH to ensure that it is large enough to hold the returned string.

[in, out] pcchPath

Type: DWORD*

The number of characters in the pszPath buffer.

dwFlags

Type: DWORD

Reserved. Set this parameter to NULL.

Return value

Type: HRESULT

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

Note

The shlwapi.h header defines PathCreateFromUrl as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional, Windows XP [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header shlwapi.h
Library Shlwapi.lib
DLL Shlwapi.dll (version 5.0 or later)