> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# WdCopyErrorCallback

> WdCopyErrorCallback

# WdCopyErrorCallback

Called to report error and warning messages during a copy operation.

## Syntax

```cpp theme={null}
typedef HRESULT (*WdCopyErrorCallback)( 
    _In_ WdCopyErrorSeverity severity,
    _In_z_ const char* message,
    _In_ HRESULT error,
    _In_opt_ void* context
);
```

### Parameters

`severity _In_`\
Type: **[WdCopyErrorSeverity](/reference/remoting/enums/wdcopyerrorseverity)**

The severity of the message (Warning or Error).

`message _In_z_`\
Type: **const char\***

A null-terminated string containing the diagnostic message.

`error _In_`\
Type: **HRESULT**

The HRESULT error code associated with the message. `S_OK` for warning messages.

`context _In_opt_`\
Type: **void\***

The user-defined context pointer that was specified in the [WdCopyStatusCallbacks](/reference/remoting/structs/wdcopystatuscallbacks) structure.

### Return value

Type: **HRESULT**

Return `S_OK` to continue the copy operation. Return a failure HRESULT to abort the copy.

## Remarks

This callback is invoked by [WdRemoteCopy](/reference/remoting/functions/wdremotecopy) to report diagnostic messages during a copy operation, such as errors or warnings. The `error` parameter provides the HRESULT associated with error messages; for warning messages, `error` is `S_OK`.

The callback is invoked on the same thread as the `WdRemoteCopy` call. The `message` string is only valid for the duration of the callback invocation.

## Requirements

| Requirement                 | Value                |
| --------------------------- | -------------------- |
| **Header**                  | WdRemoteIteration.h  |
| **Library**                 | wdremoteapi.lib      |
| **Supported OS**            | Windows 11 and later |
| **Supported architectures** | x64, ARM64           |

## See also

* [WdRemoteCopy](/reference/remoting/functions/wdremotecopy)
* [WdCopyErrorSeverity](/reference/remoting/enums/wdcopyerrorseverity)
* [WdCopyStatusCallbacks](/reference/remoting/structs/wdcopystatuscallbacks)
* [XBOX PC Remote Iteration API](/reference/remoting/remoteiteration_members)


## Related topics

- [WdCopyErrorSeverity](/reference/remoting/enums/wdcopyerrorseverity.md)
- [WdCopyStatusCallbacks](/reference/remoting/structs/wdcopystatuscallbacks.md)
- [XBOX PC Remote Iteration API](/reference/remoting/remoteiteration_members.md)
- [WdCopyFilesStatusCallback](/reference/remoting/callbacks/wdcopyfilesstatuscallback.md)
- [WdRemoteCopy](/reference/remoting/functions/wdremotecopy.md)
