Partager via


IBackgroundCopyJob2::SetReplyFileName method

Specifies the name of the file to contain the reply data from the server application. Call this method only if the job's type is BG_JOB_TYPE_UPLOAD_REPLY.

Syntax

HRESULT SetReplyFileName(
  [in] LPWSTR ReplyFileNamePathSpec
);

Parameters

  • ReplyFileNamePathSpec [in]
    Null-terminated string that contains the full path to the reply file. DO generates the file name if ReplyFileNamePathSpec is NULL or an empty string. You cannot use wildcards in the path or file name, and directories in the path must exist. The path is limited to MAX_PATH, not including the null terminator. The user must have permissions to write to the directory. DO does not support NTFS streams. Instead of using network drives, which are session specific, use UNC paths (for example, \\server\share\path\file). Do not include the \\? prefix in the path.

Return value

This method returns the following HRESULT values, as well as others.

Return code Description
S_OK

Successfully specified the name of the file to contain the reply data.

BG_E_INVALID_STATE

You cannot change the reply file name after DO begins transferring the reply to the client. DO is transferring the reply to the client if the state is BG_JOB_STATE_TRANSFERRING and the BytesTotal member of the BG_JOB_REPLY_PROGRESS structure is not BG_SIZE_UNKNOWN.

E_ACCESSDENIED

User does not have permission to write to the specified directory on the client.

E_INVALIDARG

The reply file name is invalid or exceeds MAX_PATH.

 

Remarks

DO generates the file name if you do not call the SetReplyFileName method before calling the IBackgroundCopyJob::Resume method for the first time.

If DO generates the file name, the reply file is written to the same directory as the local upload file.

You can call the SetReplyFileName method anytime before DO begins downloading the reply from the server application; the method fails if the download has begun.

The reply file is available to the client after calling the IBackgroundCopyJob::Complete method. To retrieve the reply data before calling the Complete method, call the IBackgroundCopyJob2::GetReplyData method.

The file is empty if the server application did not provide a reply.

Requirements

Minimum supported client

Windows 10, version 1709 [desktop apps only]

Minimum supported server

Windows Server 2016 [desktop apps only]

Header

Deliveryoptimization.h

IDL

DeliveryOptimization.idl

Library

Dosvc.lib

DLL

Dosvc.dll

IID

IID_IBackgroundCopyJob2 is defined as 54B50739-686F-45EB-9DFF-D6A9A0FAA9AF

See also

IBackgroundCopyJob2

IBackgroundCopyJob::GetReplyData

IBackgroundCopyJob::GetReplyFileName