DavGetExtendedError function (davclnt.h)

Retrieves the extended error code information that the WebDAV server returned for the previous failed I/O operation.

Syntax

DWORD DavGetExtendedError(
  [in]      HANDLE hFile,
  [out]     DWORD  *ExtError,
  [out]     LPWSTR ExtErrorString,
  [in, out] DWORD  *cChSize
);

Parameters

[in] hFile

A handle to an open file for which the previous I/O operation has failed. If the previous operation is a failed create operation, in which case there is no open file handle, specify INVALID_HANDLE_VALUE for this parameter.

[out] ExtError

Pointer to a variable that receives the extended error code.

[out] ExtErrorString

Pointer to a buffer that receives the extended error information as a null-terminated Unicode string.

[in, out] cChSize

A pointer to a variable that on input specifies the size, in Unicode characters, of the buffer that the ExtErrorString parameter points to. This value must be at least 1024 characters.

If the function succeeds, on output the variable receives the number of characters that are actually copied into the buffer. If the function fails with ERROR_INSUFFICIENT_BUFFER, the variable receives 1024, but no characters are copied into the ExtErrorString buffer.

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 one of the following values.

Return code Description
ERROR_INVALID_PARAMETER
One or more parameter values were not valid.
ERROR_INSUFFICIENT_BUFFER
The value that the cChSize parameter points to was less than 1024.

Remarks

If you call this function for a file handle whose previous I/O operation was successful, it returns ERROR_INVALID_PARAMETER.

Requirements

Requirement Value
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

See also

CreateFile

OpenFile

WriteFile