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

# OnFileCopyProgress

> IXtfCopyFileCallback::OnFileCopyProgress Method

Called when the progress of a file copy changes.

## Syntax

```cpp theme={null}
public:
HRESULT OnFileCopyProgress(
         LPCWSTR pszSrcFileName,
         LPCWSTR pszDstFileName,
         ULONGLONG ullFileSize,
         ULONGLONG ullBytesCopied
)  
```

### Parameters

*pszSrcFileName*\
Type: LPCWSTR

A pointer to the filename of the source file. This parameter has been deprecated and the value is now a copy of pszDstFileName.

*pszDstFileName*\
Type: LPCWSTR

A pointer to the filename of the target file.

*ullFileSize*\
Type: ULONGLONG

The total size of the source file, in bytes.

*ullBytesCopied*\
Type: ULONGLONG

The number of bytes of the file that have been copied so far.

### Return value

Type: HRESULT

Returns `S_OK` if successful; otherwise, returns an HRESULT error code.

## Remarks

This function is called by the [IXtfFileIOClient::CopyFiles](https://docs.xbox.com/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/copyfiles-ixtffileioclient-xtffileio-xbox-microsoft-m.md) method for each packet transferred during the file copying operation. The initial call to **IXtfCopyFileCallback::OnFileCopyProgress** for a file specifies 0 bytes in `ullBytesCopied` and MAX\_FILE\_SIZE bytes in `ullFileSize`. This initial call indicates that you have started copying a new file. You can then use the file information specified in subsequent **IXtfCopyFileCallback::OnFileCopyProgress** calls to track and display progress during the file copying operation. If this callback function returns an HRESULT error code, the file copying operation is aborted.

## Requirements

**Header:** xtffileio.h

**Library:** xtffileio.lib

**Supported platforms:** Windows (for XBOX console tools)

## See also

[IXtfCopyFileCallback Interface](https://docs.xbox.com/reference/tools/xtf/xtffileio/classes/IXtfCopyFileCallback/ixtfcopyfilecallback-xtffileio-xbox-microsoft-t.md)\
[XtfFileIO](https://docs.xbox.com/reference/tools/xtf/xtffileio/xtffileio-xbox-microsoft-n.md)


## Related topics

- [IXtfCopyFileCallback Interface (Interface contents)](https://docs.xbox.com/reference/tools/xtf/xtffileio/classes/IXtfCopyFileCallback/ixtfcopyfilecallback-xtffileio-xbox-microsoft-t.md)
- [WdCopyFileProgressInfo](https://docs.xbox.com/reference/remoting/structs/wdcopyfileprogressinfo.md)
- [CopyFiles](https://docs.xbox.com/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/copyfiles-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
- [WdCopyFilesStatusCallback](https://docs.xbox.com/reference/remoting/callbacks/wdcopyfilesstatuscallback.md)
- [OnStartFileCopy](https://docs.xbox.com/reference/tools/xtf/xtffileio/classes/IXtfCopyFileCallback/methods/onstartfilecopy-ixtfcopyfilecallback-xtffileio-xbox-microsoft-m.md)
