COPYFILE2_MESSAGE structure
Passed to the CopyFile2ProgressRoutine callback function with information about a pending copy operation.
Syntax
typedef struct COPYFILE2_MESSAGE { COPYFILE2_MESSAGE_TYPE Type; DWORD dwPadding; union { struct { DWORD dwStreamNumber; DWORD dwReserved; HANDLE hSourceFile; HANDLE hDestinationFile; ULARGE_INTEGER uliChunkNumber; ULARGE_INTEGER uliChunkSize; ULARGE_INTEGER uliStreamSize; ULARGE_INTEGER uliTotalFileSize; } ChunkStarted; struct { DWORD dwStreamNumber; DWORD dwReserved; HANDLE hSourceFile; HANDLE hDestinationFile; ULARGE_INTEGER uliChunkNumber; ULARGE_INTEGER uliChunkSize; ULARGE_INTEGER uliStreamSize; ULARGE_INTEGER uliStreamBytesTransferred; ULARGE_INTEGER uliTotalFileSize; ULARGE_INTEGER uliTotalBytesTransferred; } ChunkFinished; struct { DWORD dwStreamNumber; DWORD dwReserved; HANDLE hSourceFile; HANDLE hDestinationFile; ULARGE_INTEGER uliStreamSize; ULARGE_INTEGER uliTotalFileSize; } StreamStarted; struct { DWORD dwStreamNumber; DWORD dwReserved; HANDLE hSourceFile; HANDLE hDestinationFile; ULARGE_INTEGER uliStreamSize; ULARGE_INTEGER uliStreamBytesTransferred; ULARGE_INTEGER uliTotalFileSize; ULARGE_INTEGER uliTotalBytesTransferred; } StreamFinished; struct { DWORD dwReserved; } PollContinue; struct { COPYFILE2_COPY_PHASE CopyPhase; DWORD dwStreamNumber; HRESULT hrFailure; DWORD dwReserved; ULARGE_INTEGER uliChunkNumber; ULARGE_INTEGER uliStreamSize; ULARGE_INTEGER uliStreamBytesTransferred; ULARGE_INTEGER uliTotalFileSize; ULARGE_INTEGER uliTotalBytesTransferred; } Error; } Info; } COPYFILE2_MESSAGE;
Members
- Type
-
Value from the COPYFILE2_MESSAGE_TYPE enumeration used as a discriminant for the Info union within this structure.
Value Meaning - COPYFILE2_CALLBACK_CHUNK_STARTED
- 1
Indicates a single chunk of a stream has started to be copied. Information is in the ChunkStarted structure within the Info union.
- COPYFILE2_CALLBACK_CHUNK_FINISHED
- 2
Indicates the copy of a single chunk of a stream has completed. Information is in the ChunkFinished structure within the Info union.
- COPYFILE2_CALLBACK_STREAM_STARTED
- 3
Indicates both source and destination handles for a stream have been opened and the copy of the stream is about to be started. Information is in the StreamStarted structure within the Info union. This does not indicate that the copy has started for that stream.
- COPYFILE2_CALLBACK_STREAM_FINISHED
- 4
Indicates the copy operation for a stream have started to be completed, either successfully or due to a COPYFILE2_PROGRESS_STOP return from CopyFile2ProgressRoutine. Information is in the StreamFinished structure within the Info union.
- COPYFILE2_CALLBACK_POLL_CONTINUE
- 5
May be sent periodically. Information is in the PollContinue structure within the Info union.
- COPYFILE2_CALLBACK_ERROR
- 6
An error was encountered during the copy operation. Information is in the Error structure within the Info union.
- dwPadding
- Info
-
- ChunkStarted
-
This structure is selected if the Type member is set to COPYFILE2_CALLBACK_CHUNK_STARTED (1).
- dwStreamNumber
-
Indicates which stream within the file is about to be copied. The value used for identifying a stream within a file will start at one (1) and will always be higher than any previous stream for that file.
- dwReserved
-
This member is reserved for internal use.
- hSourceFile
-
Handle to the source stream.
- hDestinationFile
-
Handle to the destination stream.
- uliChunkNumber
-
Indicates which chunk within the current stream is about to be copied. The value used for a chunk will start at zero (0) and will always be higher than that of any previous chunk for the current stream.
- uliChunkSize
-
Size of the copied chunk, in bytes.
- uliStreamSize
-
Size of the current stream, in bytes.
- uliTotalFileSize
-
Size of all streams for this file, in bytes.
- ChunkFinished
-
This structure is selected if the Type member is set to COPYFILE2_CALLBACK_CHUNK_FINISHED (2).
- dwStreamNumber
-
Indicates which stream within the file is about to be copied. The value used for identifying a stream within a file will start at one (1) and will always be higher than any previous stream for that file.
- dwReserved
-
This member is reserved for internal use.
- hSourceFile
-
Handle to the source stream.
- hDestinationFile
-
Handle to the destination stream.
- uliChunkNumber
-
Indicates which chunk within the current stream is in process. The value used for a chunk will start at zero (0) and will always be higher than that of any previous chunk for the current stream.
- uliChunkSize
-
Size of the copied chunk, in bytes.
- uliStreamSize
-
Size of the current stream, in bytes.
- uliStreamBytesTransferred
-
Total bytes copied for this stream so far.
- uliTotalFileSize
-
Size of all streams for this file, in bytes.
- uliTotalBytesTransferred
-
Total bytes copied for this file so far.
- StreamStarted
-
This structure is selected if the Type member is set to COPYFILE2_CALLBACK_STREAM_STARTED (3).
- dwStreamNumber
-
Indicates which stream within the file is about to be copied. The value used for identifying a stream within a file will start at one (1) and will always be higher than any previous stream for that file.
- dwReserved
-
This member is reserved for internal use.
- hSourceFile
-
Handle to the source stream.
- hDestinationFile
-
Handle to the destination stream.
- uliStreamSize
-
Size of the current stream, in bytes.
- uliTotalFileSize
-
Size of all streams for this file, in bytes.
- StreamFinished
-
This structure is selected if the Type member is set to COPYFILE2_CALLBACK_STREAM_FINISHED (4).
- dwStreamNumber
-
Indicates which stream within the file is about to be copied. The value used for identifying a stream within a file will start at one (1) and will always be higher than any previous stream for that file.
- dwReserved
-
This member is reserved for internal use.
- hSourceFile
-
Handle to the source stream.
- hDestinationFile
-
Handle to the destination stream.
- uliStreamSize
-
Size of the current stream, in bytes.
- uliStreamBytesTransferred
-
Total bytes copied for this stream so far.
- uliTotalFileSize
-
Size of all streams for this file, in bytes.
- uliTotalBytesTransferred
-
Total bytes copied for this file so far.
- PollContinue
-
This structure is selected if the Type member is set to COPYFILE2_CALLBACK_POLL_CONTNUE (5).
- dwReserved
-
This member is reserved for internal use.
- Error
-
This structure is selected if the Type member is set to COPYFILE2_CALLBACK_ERROR (6).
- CopyPhase
-
Value from the COPYFILE2_COPY_PHASE enumeration indicating the current phase of the copy at the time of the error.
- dwStreamNumber
-
The number of the stream that was being processed at the time of the error.
- hrFailure
-
Value indicating the problem.
- dwReserved
-
This member is reserved for internal use.
- uliChunkNumber
-
Indicates which chunk within the current stream was being processed at the time of the error. The value used for a chunk will start at zero (0) and will always be higher than that of any previous chunk for the current stream.
- uliStreamSize
-
Size, in bytes, of the stream being processed.
- uliStreamBytesTransferred
-
Number of bytes that had been successfully transferred for the stream being processed.
- uliTotalFileSize
-
Size, in bytes, of the total file being processed.
- uliTotalBytesTransferred
-
Number of bytes that had been successfully transferred for the entire copy operation.
Remarks
To compile an application that uses the COPYFILE2_MESSAGE structure, define the _WIN32_WINNT macro as 0x0601 or later. For more information, see Using the Windows Headers.
Requirements
|
Minimum supported client |
Windows 8 [desktop apps | Windows Store apps] |
|---|---|
|
Minimum supported server |
Windows Server 2012 [desktop apps | Windows Store apps] |
|
Header |
|