Partager via


IMDSPStorageGlobals::GetSerialNumber

banner art

The GetSerialNumber method retrieves a serial number uniquely identifying the storage medium. This method must be implemented for protected content transfer, but otherwise it is optional. For more information, see Mandatory and Optional Interfaces.

.

Syntax

HRESULT GetSerialNumber(PWMDMIDpSerialNum,BYTEabMac[WMDM_MAC_LENGTH]);

Parameters

pSerialNum

[out]  Pointer to a WMDMID structure containing the serial number information. 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 The device does not support serial numbers.
E_INVALIDARG The pSerialNum parameter is an invalid or NULL pointer.
E_FAIL An unspecified error occurred.

Remarks

Not all storage media support serial numbers. The return code must always be checked to determine whether the storage medium provides this support. If the storage medium does not support returning a unique serial number, protected content cannot be transferred to the medium. If the storage represented is removable media, the serial number returned must be the storage serial number, which should be distinct from the device serial number.

Requirements

Header: Defined in mswmdm.h.

Library: mssachlp.lib

See Also