共用方式為


CSecureChannelClient::EncryptParam

banner art

The EncryptParam method encrypts data being sent out through a parameter. Data is encrypted in-place, in the submitted buffer.

Syntax

HRESULT EncryptParam(BYTE*pbData,
  DWORDdwDataLen);

Parameters

pbData

[in, out] Pointer to the data buffer that holds the information to encrypt. Encryption is handled in-place in the buffer, and the retrieved encrypted data is the same size as the original data.

dwDataLen

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

Return Values

The method returns an HRESULT. All the interface methods in Windows Media Device Manager 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 an extenstive 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

This method is used to encrypt data before sending it to the device in IWMDMOperation::TransferObjectData.

Encrypt only the parameters that are specified as requiring encryption. See Using Secure Authenticated Channels for a table of methods that must use the message authentication code algorithm and encrypted parameters.

For example code, see IWMDMOperation::TransferObjectData.

Requirements

Header: Include scclient.h.

Library: mssachlp.lib

See Also