DavGetHTTPFromUNCPath function

Converts the specified UNC path to an equivalent HTTP path.


  LPCWSTR UncPath,
  LPWSTR  Url,
  LPDWORD lpSize



A pointer to a null-terminated Unicode string that contains the UNC path. This path must be in the following format:



  • server is the server name.
  • @SSL is optional and indicates a request for an SSL connection.
  • port is an optional port number. The standard ports are 80 for http and 443 for https (SSL).
  • path is optional and specifies a path to a remote file or directory on the server.


A pointer to a caller-allocated buffer that receives the HTTP path as a null-terminated Unicode string.


A pointer to a variable that on input specifies the maximum size, in Unicode characters, of the buffer that the HttpPath parameter points to. If the function succeeds, on output the variable receives the number of characters that were copied into the buffer. If the function fails with ERROR_INSUFFICIENT_BUFFER, on output the variable receives the number of characters needed to store the HTTP path, including the "http://" or "https://" prefix and the terminating NULL character.

Return value

If the function succeeds, the return value is ERROR_SUCCESS.

If the function fails, the return value is a system error code, such as the following value.

Return code Description
The buffer that the HttpPath parameter points to was not large enough to store the HTTP path.


Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header davclnt.h
Library Netapi32.lib
DLL Netapi32.dll