次の方法で共有


CSecureChannelClient::Authenticate

banner art

The Authenticate method triggers the communication between the CSecureChannelClient object in one component and the CSecureChannelServer object in the other component. Messages are exchanged and trust established if both the client and server certificates are validated.

Syntax

HRESULT Authenticate(
  DWORD  dwProtocolID
);

Parameters

  dwProtocolID

DWORD specifying the protocol identifier.

Return Values

The method returns an HRESULT. All the interface methods in Windows Media Device Manager and service provider can return any of the following classes of error codes:

  • Standard COM error codes
  • Windows error codes converted to HRESULT values
  • Windows Media Device Manager error codes

For a complete list of possible error codes, see Error Codes.

Possible values include, but are not limited to, those in the following table.

Return code Description
S_OK The method succeeded.
E_INVALIDARG The dwProtocol parameter is invalid.
E_FAIL An unspecified error occurred.

Remarks

This method specifies which protocol method is to be used. That method is then called. In this version of Windows Media Device Manager, SAC_PROTOCOL_V1 must be used.

CSecureChannelClient::SetCertificate and CSecureChannelClient::SetInterface must be called before Authenticate.

Example Code

// Authenticate with the SAC_PROTOCOL_V1 protocol.
HRESULT hr;
m_pSAC = new CSecureChannelClient;
hr = m_pSAC->Authenticate( SAC_PROTOCOL_V1 );
ExitOnFail( hr );

Requirements

Header: Include scclient.h.

Library: mssachlp.lib

See Also