IMDSPStorage::GetRights

banner art

The GetRights method retrieves the rights information for an object.

Syntax

HRESULT GetRights(PWMDMRIGHTS*ppRights,UINT*pnRightsCount,BYTEabMac[WMDM_MAC_LENGTH]);

Parameters

ppRights

[out]  Pointer to an array of WMDMRIGHTS structures that contain the storage object rights information. This parameter is included in the output message authentication code.

pnRightsCount

[out]  Pointer to the number of WMDMRIGHTS structures in the ppRights array. This parameter is included in the output message authentication code.

abMac[WMDM_MAC_LENGTH]

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

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_NOTSUPPORTED Rights are not supported for this object.
E_INVALIDARG One or more parameters is not valid or is a NULL pointer.
E_FAIL An unspecified error occurred.

Remarks

Object rights describe the usage permissions for media content. For example, the WMDMRIGHTS structure can contain information concerning how many times a file can be played and who can play it.

The ppRights array is allocated by this method, and must be freed by the application using CoTaskMemFree, a standard Win32 function.

This method is optional. For more information, see Mandatory and Optional Interfaces.

Requirements

Header: Defined in mswmdm.h.

Library: mssachlp.lib

See Also