Device Registration
[The feature associated with this page, Windows Media Format 11 SDK, is a legacy feature. It has been superseded by Source Reader and Sink Writer. Source Reader and Sink Writer have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use Source Reader and Sink Writer instead of Windows Media Format 11 SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]
The Windows Media Format SDK provides access to the device registration database. This database is secured on the client computer and is used to register devices that support Windows Media DRM 10 for Network Devices.
When a device is added to a network to which the client computer is connected, the device attempts to contact a Windows Media DRM 10 for Network Devices transmitter application. After establishing communications, the device sends a registration request message.
Your application should perform the following steps when it receives a registration request message:
- Parse the message by calling the IWMDRMMessageParser::ParseRegistrationReqMsg method. This method retrieves the device certificate and the device serial number, both of which are needed to identify the device.
- Call the IWMDeviceRegistration::GetRegisteredDeviceByID method, passing in the certificate and device serial number retrieved in step 1. If the device is found, it is already registered and you can skip the next step.
- Call the IWMDeviceRegistration::RegisterDevice method to add the device to the device registration database.
You can access information about any device in the registration database by retrieving the registered device object associated with it. There are two ways to get a registered device object. If you have the certificate and serial number of the device, you can call the IWMDeviceRegistration::GetRegisteredDeviceByID method. If you do not have the certificate and serial number of the device, you can enumerate all the devices in the database by calling IWMDeviceRegistration::GetFirstRegisteredDevice followed by repeated calls to IWMDeviceRegistration::GetNextRegisteredDevice until a call returns S_FALSE.
Before your application can send data to a device, you must ensure that the device is approved, validated, and open.
Device approval should involve interaction with the user. When a device sends a registration message, your application can prompt the user to decide whether the device is one that should receive that user's data. Then update the device registration database by calling the IWMRegisteredDevice::Approve method, passing TRUE or FALSE as appropriate.
Validation is also called proximity detection. This is a process by which the internal DRM objects of the Windows Media Format SDK determine whether the device is "near" enough to the computer running your application to securely transmit media. Nearness is determined by the time it takes to get a response to a message. This feature is intended to prevent unauthorized users from accessing your network and obtaining your secured media. For more information, see Performing Proximity Detection.
To open a device, call IWMRegisteredDevice::Open.
Note
DRM is not supported by the x64-based version of this SDK.
Related topics