Share via


IMDSPObject2::WriteOnClearChannel

banner art

The WriteOnClearChannel method writes data to the object to the current position within the object, without using secure authenticated channels. This operation is valid only if the storage object represents a file. If IMDSPObject2 is supported, this method must be implemented. Windows Media Device Manager does not fall back to IMDSPObject::Write if this method fails.

Syntax

HRESULT WriteOnClearChannel(BYTE*pData,DWORD*pdwSize);

Parameters

pData

[in]  Pointer to the buffer containing the data to write to the object.

pdwSize

[in, out]  Pointer to a DWORD containing the number of bytes of data to write. Upon return, this parameter contains the actual number of bytes written.

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.
WMDM_E_BUSY The media device is busy.
WMDM_E_INTERFACEDEAD The file or folder was previously deleted.
WMDM_E_CALL_OUT_OF_SEQUENCE Open was not called before calling Write.
E_INVALIDARG One or more parameters is invalid or is a NULL pointer.
HRESULT_FROM_WIN32 (ERROR_DISK_FULL) Write failed because there is not enough space on the disk.

Note: Use the macro HRESULT_FROM_WIN32 to convert the Windows error ERROR_DISK_FULL (defined in Winerror.h) to an HRESULT.

Remarks

This method can be used with DRM-protected content. It is more efficient than IMDSPObject::Write because this method does not involve encrypting and decrypting parameters.

Unlike IMDSPObject::Write, this method does not need to decrypt the data before writing to a device, and is therefore more efficient.

Requirements

Header: Defined in mswmdm.h.

Library: mssachlp.lib

See Also