IMDSPObject::Write method (mswmdm.h)

The Write method writes data to the object at the current position within the object. This operation is valid only if the storage object represents a file.

Syntax

HRESULT Write(
  [in]      BYTE     *pData,
  [in, out] DWORD    *pdwSize,
  [in, out] BYTE [8] abMac
);

Parameters

[in] pData

Pointer to the buffer containing the data to write to the object. This parameter is encrypted and must be decrypted using CSecureChannelServer::DecryptParam with the MAC in abMac. See Remarks.

[in, out] pdwSize

DWORD containing the number of bytes of data to write. Upon return, this parameter contains the actual number of bytes written. This parameter must be included in both the input and output message authentication codes.

[in, out] abMac

Array of eight bytes containing the message authentication code for the parameter data of this method. (WMDM_MAC_LENGTH is defined as 8.)

Return value

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 extensive list of possible error codes, see Error Codes.

Remarks

The MAC used for encryption should include both pData and pdwSize in calls to CSecureChannelServer::MACUpdate.

This method must be implemented. It must not return WMDM_E_NOTSUPPORTED or E_NOTIMPL. For more information, see Mandatory and Optional Interfaces.

Requirements

Requirement Value
Target Platform Windows
Header mswmdm.h
Library Mssachlp.lib

See also

Encryption and Decryption

IMDSPObject Interface

IMDSPObject::Close

IMDSPObject::Open

IMDSPObject::Read