IBackgroundCopyFile3::SetValidationState method (bits3_0.h)
Sets the validation state of this file.
HRESULT SetValidationState( BOOL state );
Set to TRUE if the file content is valid, otherwise, FALSE.
The method returns the following return values.
||You cannot validate the file until the download is complete.|
||The cached record associated with this file has been deleted.|
If you set the validation state to FALSE and the file was downloaded from the origin server, the job moves to the error state with an error code of BG_E_VALIDATION_FAILED and the file progress is set to zero. You can then call the IBackgroundCopyJob::Resume method to download the file again.
BITS 3.0: Do not call the IBackgroundCopyJob::Resume method to download the file again. Instead, call the IBackgroundCopyJob::Complete or IBackgroundCopyJob::Cancel method to cleanup the current job and then create a new job to download the file.
If you set the validation state to FALSE and the file was downloaded from a peer, BITS removes the file from the cache, resets the file progress to zero, and downloads the file again from the origin server.
You can call this method only after BITS finishes transferring the file. To receive notification when the transfer is complete, implement the IBackgroundCopyCallback2::FileTransferred method.
Calling the IBackgroundCopyJob::Complete method implicitly validates the file.
If you validate a file in the cache and then call IBackgroundCopyJob4::SetPeerCachingFlags to disable caching (or peer caching is disable through Group Policy), the file remains in the cache. If you disable caching before validating the file, BITS removes the file from the cache.
|Minimum supported client||Windows Vista|
|Minimum supported server||Windows Server 2008|
|Header||bits3_0.h (include Bits.h)|