共用方式為


CSecureChannelServer::DecryptParam

banner art

DecryptParam uses the session key of the secure authenticated channel to decrypt the data contained in a parameter.

Syntax

HRESULT DecryptParam(
  BYTE*  pbData,
  DWORD  dwDataLen
);

Parameters

  pbData

[in, out]  Pointer to the first byte of a data buffer containing the encrypted parameter that is to be decrypted.

  dwDataLen

[in]  Pointer to a DWORD specifying the length of the buffer to which pbData points.

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
  • 8Windows 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 A parameter is invalid or is a NULL pointer.
E_FAIL An unspecified error occurred.

Remarks

Components should copy the data to a temporary buffer before calling DecryptParam and then decrypt the temporary buffer. This method only needs to be called for encrypted parameters. See Secure Authenticated Channel Interface for a table of methods that must use the message authentication code algorithm and encrypted parameters.

Example Code

extern CSecureChannelServer *g_pSCWMDM;
HRESULT hr;
pTempData = new BYTE[dwSize];
memcpy(pTempData, pData, dwSize);

// Decrypt the pData Parameter.
hr = g_pSCWMDM->DecryptParam(pTempData, dwSize);
if (FAILED(hr))
{
    CHECK(E_FAIL);
}

Requirements

Header: Include scserver.h.

Library: mssachlp.lib

See Also