CopyFile2ProgressRoutine callback function
An application-defined callback function used with the CopyFile2 function. It is called when a portion of a copy or move operation is completed. The PCOPYFILE2_PROGRESS_ROUTINE type defines a pointer to this callback function. CopyFile2ProgressRoutine is a placeholder for the application-defined function name.
Syntax
COPYFILE2_MESSAGE_ACTION CALLBACK CopyFile2ProgressRoutine( _In_ const COPYFILE2_MESSAGE *pMessage, _In_opt_ PVOID pvCallbackContext ); typedef COPYFILE2_MESSAGE_ACTION (*PCOPYFILE2_PROGRESS_ROUTINE)( _In_ const COPYFILE2_MESSAGE *pMessage, _In_opt_ PVOID pvCallbackContext );
Parameters
- pMessage [in]
-
Pointer to a COPYFILE2_MESSAGE structure.
- pvCallbackContext [in, optional]
-
Copy of value passed in the pvCallbackContext member of the COPYFILE2_EXTENDED_PARAMETERS structure passed to CopyFile2.
Return value
Value from the COPYFILE2_MESSAGE_ACTION enumeration indicating what action should be taken.
| Return code/value | Description |
|---|---|
|
Continue the copy operation. |
|
Cancel the copy operation. The CopyFile2 function
will fail, return
|
|
Stop the copy operation. The CopyFile2 function will
fail, return |
|
Continue the copy operation but do not call the CopyFile2ProgressRoutine callback function again for this operation. |
|
Pause the copy operation. In most cases the CopyFile2
function will fail and return
|
Remarks
The COPYFILE2_CALLBACK_STREAM_FINISHED message is the last message for a paused copy. If COPYFILE2_PROGRESS_PAUSE is returned in response to a COPYFILE2_CALLBACK_STREAM_FINISHED message then no further callbacks will be sent.
To compile an application that uses the PCOPYFILE2_PROGRESS_ROUTINE function pointer type, define the _WIN32_WINNT macro as 0x0601 or later. For more information, see Using the Windows Headers.
In Windows 8 and Windows Server 2012, this function is supported by the following technologies.
| Technology | Supported |
|---|---|
|
Server Message Block (SMB) 3.0 protocol |
Yes |
|
SMB 3.0 Transparent Failover (TFO) |
Yes |
|
SMB 3.0 with Scale-out File Shares (SO) |
Yes |
|
Cluster Shared Volume File System (CsvFS) |
Yes |
|
Resilient File System (ReFS) |
Yes |
Requirements
|
Minimum supported client |
Windows 8 [desktop apps | Windows Store apps] |
|---|---|
|
Minimum supported server |
Windows Server 2012 [desktop apps | Windows Store apps] |
|
Header |
|