IMDSPDevice::GetSerialNumber
The GetSerialNumber method retrieves the serial number that uniquely identifies the device.
Syntax
HRESULT GetSerialNumber(PWMDMIDpSerialNumber,BYTEabMac[WMDM_MAC_LENGTH]);
Parameters
pSerialNumber
[out] Pointer to a WMDMID structure that receives the serial number for the device. This parameter is included in the output message authentication code.
abMac
[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 |
E_INVALIDARG | The pSerialNumber parameter is an invalid or NULL pointer. |
WMDM_E_NOTCERTIFIED | The caller is not authorized, and calls to other service provider interfaces will also fail and return this code. |
WMDM_E_NOTSUPPORTED | This device does not support serial numbers. |
E_FAIL | An unspecified error occurred. |
Remarks
Not all media devices support serial numbers. To determine whether the device supports serial numbers, always check the return code when calling this method. If a media device does support serial numbers, the serial number of the media device is guaranteed to be unique.
This method is optional. When transferring protected content, Windows Media Device Manager uses IMDSPStorageGlobals::GetSerialNumber. For more information, see Mandatory and Optional Interfaces.
Requirements
Header: Defined in mswmdm.h.
Library: mssachlp.lib
See Also