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

# IXtfCopyFileCallback::OnEndFileCopy Method

> IXtfCopyFileCallback::OnEndFileCopy Method

# IXtfCopyFileCallback::OnEndFileCopy Method

在开发主机上的两个位置之间的文件复制完成时调用。

<a id="syntaxSection" />

## 语法

```cpp theme={null}
public:
HRESULT OnEndFileCopy(
         LPCWSTR pszRootDirectory,
         LPCWSTR pszSearchPattern,
         LPCXTFFILEINFO pSrcFileInfo,
         LPCWSTR pszDstFileName,
         HRESULT hrErrorCode
)  
```

<a id="parametersSection" />

### 参数

*pszRootDirectory*\
类型：LPCWSTR

指向复制的根目录路径的指针。

*pszSearchPattern*\
类型：LPCWSTR

指向搜索模式的指针，该模式定义要复制的源文件的文件名。此参数接受通配符，以匹配符合指定模式的字符串。

*pSrcFileInfo*\
类型：LPCXTFFILEINFO

指向 [XTFFILEINFO](/reference/tools/xtf/xtffileio/structures/xtffileinfo-xtffileio-xbox-microsoft-t) 结构的指针，该结构包含有关所复制文件的信息。

*pszDstFileName*\
类型：LPCWSTR

指向目标文件的文件名的指针。

*hrErrorCode*\
类型：HRESULT

HRESULT 成功或错误代码。

<a id="retvalSection" />

### 返回值

类型：HRESULT

如果成功，则返回 `S_OK`；否则返回 HRESULT 错误代码。

<a id="remarksSection" />

## 备注

此函数由 [IXtfFileIOClient::CopyFiles](/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/copyfiles-ixtffileioclient-xtffileio-xbox-microsoft-m) 函数在文件复制操作结束时调用一次。回调函数中指定的信息包括 [XTFFILEINFO](/reference/tools/xtf/xtffileio/structures/xtffileinfo-xtffileio-xbox-microsoft-t) 结构中传输的字节总数。可以检查此函数的 `hrErrorCode` 参数以识别文件复制操作期间可能发生的任何错误。

<a id="requirementsSection" />

## 要求

**头文件：** xtffileio.h

**库：** xtffileio.lib

**支持的平台：** Windows（用于 XBOX 主机工具）

<a id="seealsoSection" />

## 另请参阅

[IXtfCopyFileCallback Interface](/reference/tools/xtf/xtffileio/classes/IXtfCopyFileCallback/ixtfcopyfilecallback-xtffileio-xbox-microsoft-t)\
[XtfFileIO](/reference/tools/xtf/xtffileio/xtffileio-xbox-microsoft-n)


## Related topics

- [IXtfCopyFileCallback::OnFileCopyProgress Method](/zh-CN/reference/tools/xtf/xtffileio/classes/IXtfCopyFileCallback/methods/onfilecopyprogress-ixtfcopyfilecallback-xtffileio-xbox-microsoft-m.md)
- [IXtfCopyFileCallback::OnStartFileCopy Method](/zh-CN/reference/tools/xtf/xtffileio/classes/IXtfCopyFileCallback/methods/onstartfilecopy-ixtfcopyfilecallback-xtffileio-xbox-microsoft-m.md)
- [IXtfBatchFileIOClient::CopyFiles Method](/zh-CN/reference/tools/xtf/xtffileio/classes/IXtfBatchFileIOClient/methods/copyfiles-ixtfbatchfileioclient-xtffileio-xbox-microsoft-m.md)
- [IXtfFileIOClient::CopyFiles Method](/zh-CN/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/copyfiles-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
- [XTFFILEINFO](/zh-CN/reference/tools/xtf/xtffileio/structures/xtffileinfo-xtffileio-xbox-microsoft-t.md)
