IComponentAuthenticate::SACAuth 方法 (mswmdm.h)

SACAuth 方法在组件之间建立经过身份验证的安全通道。

语法

HRESULT SACAuth(
  [in]  DWORD dwProtocolID,
  [in]  DWORD dwPass,
  [in]  BYTE  *pbDataIn,
  [in]  DWORD dwDataInLen,
  [out] BYTE  **ppbDataOut,
  [out] DWORD *pdwDataOutLen
);

参数

[in] dwProtocolID

包含协议标识符的 DWORD。 对于此版本的 Windows Media 设备管理器,始终将此参数设置为 SAC_PROTOCOL_V1。

[in] dwPass

包含当前通信传递编号的 DWORD。 传递由两条消息组成,每个方向各一条消息。 SAC_PROTOCOL_V1是双传递协议,传递编号为 0 和 1。

[in] pbDataIn

指向输入数据的指针。

[in] dwDataInLen

包含 pbDataIn 指向的数据长度的 DWORD

[out] ppbDataOut

指向指向输出数据的指针的指针。

[out] pdwDataOutLen

指向包含 ppbDataOut 指向的数据长度的 DWORD 的指针。

返回值

该方法返回 HRESULT。 Windows Media 设备管理器 中的所有接口方法都可以返回以下任一类错误代码:

  • 标准 COM 错误代码
  • 转换为 HRESULT 值的 Windows 错误代码
  • Windows Media 设备管理器错误代码
有关可能错误代码的广泛列表,请参阅 错误代码

注解

此方法仅由服务提供商调用。 它根据协议标识符的指示调用一次或多次。

pbDataInppbDataOut 中的数据结构由 dwProtocolIDdwPass 的值决定。

示例

以下 C++ 代码演示了服务提供商对 SACAuth 的实现。 它在以前创建的专用 CSecureChannelServer 成员上调用 CSecureChannelServer ::SACAuth。


HRESULT CMyServiceProvider::SACAuth(
    DWORD   dwProtocolID,
    DWORD   dwPass,
    BYTE   *pbDataIn,
    DWORD   dwDataInLen,
    BYTE  **ppbDataOut,
    DWORD  *pdwDataOutLen)
{
    HRESULT hr = S_OK;

    // Verify that the global CSecureChannelServer member is valid.
    if(g_pAppSCServer == NULL)
        return E_FAIL;

    hr = g_pAppSCServer->SACAuth(
        dwProtocolID,
        dwPass,
        pbDataIn, dwDataInLen,
        ppbDataOut, pdwDataOutLen
    );
    return hr;
}

要求

要求
目标平台 Windows
标头 mswmdm.h
Library Mssachlp.lib

另请参阅

对服务提供商进行身份验证

CSecureChannelServer::SACAuth

IComponentAuthenticate 接口