Expand Minimize

WsSetFaultErrorDetail function

Write the fault detail stored in a WS_ERROR object.


HRESULT WINAPI  WsSetFaultErrorDetail(
  _In_ WS_ERROR*                          error,
  _In_ const WS_FAULT_DETAIL_DESCRIPTION* faultDetailDescription,
  _In_ WS_WRITE_OPTION                    writeOption,
       const void*                        value,
  _In_ ULONG                              valueSize


error [in]

The error object that will contain the fault information.

faultDetailDescription [in]

A pointer to a description of the fault detail.

If the action field of the fault detail description is non-NULL, then it is set as the WS_FAULT_ERROR_PROPERTY_ACTION of the WS_ERROR.

The element description of the fault detail description describes the format of the element in the fault detail.

writeOption [in]

Information about how the value is allocated. See WS_WRITE_OPTION for more information.


A pointer to the value to serialize.

valueSize [in]

The size of the value being serialized, in bytes.

If the value is NULL, then the size should be 0.

Return value

This function can return one of these values.

Return codeDescription

The input data was not in the expected format or did not have the expected value.


One or more arguments are invalid.


Ran out of memory.



This API will serialize the value of the detail field of the WS_FAULT stored in the WS_ERROR object.

This functions supports the following scenarios, based on the contents of the WS_ELEMENT_DESCRIPTION in the WS_FAULT_DETAIL_DESCRIPTION supplied:

  • Writing a single element. In this case, the elementLocalName and elementNs fields of the WS_ELEMENT_DESCRIPTION should be set to the local name and namespace of the element to write, and the type and type description represents the type of the value being serialized.
  • Writing multiple elements as a single value. In this case, the elementLocalName and elementNs fields of the WS_ELEMENT_DESCRIPTION should be set to NULL, and a WS_STRUCT_TYPE and WS_STRUCT_DESCRIPTION should be specified. Each field of the structure value being serialized should correspond to element(s) to write within the fault detail. The writeOption parameter must be either WS_WRITE_REQUIRED_VALUE or WS_WRITE_REQUIRED_POINTER.


Minimum supported client

Windows 7 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2008 R2 [desktop apps | Windows Store apps]









Community Additions

© 2015 Microsoft