IBackgroundCopyJob::Complete method

Ends the job and saves the transferred files on the client.

Syntax

HRESULT Complete();

Parameters

This method has no parameters.

Return value

This method returns the following HRESULT values. The method can also return errors related to renaming the temporary copies of the transferred files to their given names.

Return code Description
S_OK
All files transferred successfully.
DO_E_INVALID_STATE
For downloads, the state of the job cannot be BG_JOB_STATE_CANCELLED or BG_JOB_STATE_ACKNOWLEDGED.
For uploads, the state of the job must be BG_JOB_STATE_TRANSFERRED.

Remarks

All of the files have been successfully transferred if the job's state is BG_JOB_STATE_TRANSFERRED. To check the state of the job, call the IBackgroundCopyJob::GetState method. You can also implement the IBackgroundCopyCallback interface to receive notification when all of the files have been transferred to the client.

Delivery Optimization retains jobs that are less than 30 days only. All older jobs will be removed. Delivery Optimization does not support the JobInactivityTimeout Group Policy.

For download jobs, you can call the Complete method at anytime during the transfer process; however, only files that were successfully transferred to the client before calling this method are saved. For example, if you call the Complete method while Delivery Optimization is processing the third of five files, only the first two files are saved. To determine which files have been transferred, call the IBackgroundCopyFile::GetProgress method and compare the BytesTransferred member to the BytesTotal member of the BG_FILE_PROGRESS structure.

For upload jobs, you can call the Complete method only when the job's state is BG_JOB_STATE_TRANSFERRED.

The owner of the file is the user who made the call. For example, if an administrator completes someone else's job, the administrator not the owner of the job owns the file.

Requirements

Requirement Value
Minimum supported client
Windows 10, version 1709 [desktop apps only]
Minimum supported server
Windows Server, version 1709 [desktop apps only]
Header
Deliveryoptimization.h
IDL
DeliveryOptimization.idl
Library
Dosvc.lib
DLL
Dosvc.dll
IID
IID_IBackgroundCopyJob is defined as 37668D37-507E-4160-9316-26306D150B12

See also

IBackgroundCopyJob

IBackgroundCopyJob::Cancel

IBackgroundCopyJob::GetState