> ## 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

在複製作業期間呼叫，以回報錯誤和警告訊息。

## 語法

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

### 參數

`severity _In_`\
類型：**[WdCopyErrorSeverity](/zh-TW/reference/remoting/enums/wdcopyerrorseverity)**

訊息的嚴重性 (Warning 或 Error)。

`message _In_z_`\
類型：**const char\***

包含診斷訊息、以 Null 結尾的字串。

`error _In_`\
類型：**HRESULT**

與訊息相關聯的 HRESULT 錯誤碼。警告訊息為 `S_OK`。

`context _In_opt_`\
類型：**void\***

在 [WdCopyStatusCallbacks](/zh-TW/reference/remoting/structs/wdcopystatuscallbacks) 結構中指定的使用者定義內容指標。

### 傳回值

類型：**HRESULT**

傳回值會被忽略。傳回失敗的 HRESULT 不會中止複製，也不會變更 [WdRemoteCopy](/zh-TW/reference/remoting/functions/wdremotecopy) 傳回的結果。

## 備註

[WdRemoteCopy](/zh-TW/reference/remoting/functions/wdremotecopy) 會叫用此回呼，以在複製作業期間回報錯誤或警告等診斷訊息。`error` 參數提供與錯誤訊息相關聯的 HRESULT；若為警告訊息，`error` 為 `S_OK`。

此回呼會在與 `WdRemoteCopy` 呼叫相同的執行緒上叫用。`message` 字串只在回呼叫用期間有效。

## 需求

| 需求 | 值 |
| - | - |
| **標頭** | WdRemoteIteration.h |
| **程式庫** | wdremoteapi.lib |
| **支援的作業系統** | Windows 11 及更新版本 |
| **支援的架構** | x64、ARM64 |

## 另請參閱

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


## Related topics

- [WdCopyErrorCallback](/reference/remoting/callbacks/wdcopyerrorcallback.md)
- [WdCopyErrorSeverity](/reference/remoting/enums/wdcopyerrorseverity.md)
