Export (0) Print
Expand All

IBitsTokenOptions::SetHelperTokenFlags method

Sets the usage flags for a token that is associated with a BITS transfer job.

Syntax


HRESULT SetHelperTokenFlags(
  DWORD UsageFlags
);

Parameters

UsageFlags

Specifies the usage flag. This parameter must be set to one of the following values:

ValueMeaning
BG_TOKEN_LOCAL_FILE
0x0001

If this flag is specified, the helper token is used

  • To open the local file of an upload job
  • To create or rename the temporary file of a download job
  • To create or rename the reply file of an upload-reply job
BG_TOKEN_NETWORK
0x0002

If this flag is specified, the helper token is used

  • To open the remote file of a Server Message Block (SMB) upload or download job
  • In response to an HTTP server or proxy challenge for implicit NTLM or Kerberos credentials

An application is required to call IBackgroundCopyJob2::SetCredentials (..., NULL, NULL) to allow the credentials to be sent over HTTP.

 

Return value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

The usage flags allow the helper token access only to the resources described in the individual flags. These flags do not provide access to all resources. For example, the client certificate is accessed by using the job owner identity.

If a client certificate is specified and the owner of the BITS job is not the LocalSystem account, setting the UsageFlag parameter to BG_TOKEN_NETWORK will cause the job to fail with the error code 0x80072f9a (ERROR_WINHTTP_CLIENT_CERT_NO_ACCESS_PRIVATE_KEY).

Requirements

Minimum supported client

Windows 7

Minimum supported server

Windows Server 2008 R2

Redistributable

Windows Management Framework on Windows Vista with SP1, Windows Vista with SP2, and Windows Server 2008 with SP2

Header

Bits4_0.h

IDL

Bits4_0.idl

IID

IID_IBitsTokenOptions is defined as 9a2584c3-f7d2-457a-9a5e-22b67bffc7d2

See also

IBitsTokenOptions

 

 

Community Additions

ADD
Show:
© 2014 Microsoft