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

# WdCancelRemoteCopy

> WdCancelRemoteCopy

# WdCancelRemoteCopy

取消進行中的複製作業。

## 語法

```cpp theme={null}
HRESULT WdCancelRemoteCopy(  
         _In_ WdCancellationHandle cancellationHandle  
);  
```

### 參數

`_In_ cancellationHandle`\
類型：**[WdCancellationHandle](/zh-TW/reference/remoting/structs/wdcancellationhandle)**

由 [WdCreateCancellationHandle](/zh-TW/reference/remoting/functions/wdcreatecancellationhandle) 建立並傳遞給 [WdRemoteCopy](/zh-TW/reference/remoting/functions/wdremotecopy) 的取消控制代碼。對此控制代碼發出訊號會導致進行中的複製遭到取消。

### 傳回值

類型：**HRESULT**

如果成功，則傳回 `S_OK`；否則傳回錯誤碼。

## 備註

從另一個執行緒呼叫 `WdCancelRemoteCopy`，以取消封鎖中的 [WdRemoteCopy](/zh-TW/reference/remoting/functions/wdremotecopy) 呼叫。`WdCancelRemoteCopy` 是發出取消訊號的非封鎖函式；`WdRemoteCopy` 可能會傳回 `S_OK` 或失敗。

由於 `WdRemoteCopy` 在觀察到取消後可能傳回任一種結果，因此單憑傳回值無法判斷作業是遭到取消還是執行完成。如果您需要區分這兩者，請在自己的程式碼中追蹤取消狀態，例如在使用者起始取消之後隱藏錯誤訊息或略過重試。

## 需求

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

## 另請參閱

* [WdRemoteCopy](/zh-TW/reference/remoting/functions/wdremotecopy)
* [WdCancellationHandle](/zh-TW/reference/remoting/structs/wdcancellationhandle)
* [WdCreateCancellationHandle](/zh-TW/reference/remoting/functions/wdcreatecancellationhandle)
* [WdCloseCancellationHandle](/zh-TW/reference/remoting/functions/wdclosecancellationhandle)
* [XBOX PC Remote Iteration API](/zh-TW/reference/remoting/remoteiteration_members)


## Related topics

- [WdCancelRemoteCopy](/reference/remoting/functions/wdcancelremotecopy.md)
- [WdRemoteCopy](/ko/reference/remoting/functions/wdremotecopy.md)
- [WdCancellationHandle](/reference/remoting/structs/wdcancellationhandle.md)
- [WdCreateCancellationHandle](/reference/remoting/functions/wdcreatecancellationhandle.md)
- [WdDuplicateCancellationHandle](/reference/remoting/functions/wdduplicatecancellationhandle.md)
