WsGetErrorString function
Retrieves an error string from an error object.
Syntax
HRESULT WINAPI WsGetErrorString( _In_ WS_ERROR* error, _In_ ULONG index, _Out_ WS_STRING* *string );
Parameters
- error [in]
-
The error object containing the string.
- index [in]
-
The zero-based index identifying the string to retrieve. The first error string (index 0) will be the string most recently added to the error object (using WsAddErrorString). When WS_ERROR_PROPERTY_ORIGINAL_ERROR_CODE is presented in the error object, the corresponding error text will be available in the last index.
The number of errors can be retrieved using WS_ERROR_PROPERTY_STRING_COUNT.
- string [out]
-
The returned string. The string is valid until WsResetError or WsFreeError is called.
The string is not zero terminated.
Return value
This function can return one of these values.
| Return code | Description |
|---|---|
|
One or more arguments are invalid. |
|
This function may return other errors not listed above. |
Remarks
The string is in the language specified by the LANGID property of the error object. This can be retrieved using WsGetErrorProperty with WS_ERROR_PROPERTY_LANGID.
Requirements
|
Minimum supported client | Windows 7 [desktop apps | Windows Store apps] |
|---|---|
|
Minimum supported server | Windows Server 2008 R2 [desktop apps | Windows Store apps] |
|
Header |
|
|
Library |
|
|
DLL |
|