IWMDRMDeviceApp::AcquireDeviceData
The AcquireDeviceData method initializes or resets a device secure clock.
Syntax
HRESULT AcquireDeviceData(IWMDMDevice*pDevice,IWMDMProgress3*pProgressCallback,DWORDdwFlags,DWORD*pdwStatus);
Parameters
pDevice
[in] Pointer to an IWMDMDevice interface for the device that will report metering data.
pProgressCallback
[in] Progress callback through which the application can track the progress of the event, or cancel the event. The progress is identified by the EventId parameter of IWMDMProgress3 methods.
dwFlags
[in] A logical OR of one or both of the following flags, specifying what action to perform. This value is retrieved from the pdwStatus parameter of IWMDRMDeviceApp::QueryDeviceStatus or IWMDRMDeviceApp2::QueryDeviceStatus2. You can use the pdwStatus flag directly.
Flag | Description |
WMDRM_DEVICE_NEEDCLOCK | Acquire a clock from a secure clock server. |
WMDRM_DEVICE_REFRESHCLOCK | Refresh the clock from a secure clock server. |
pdwStatus
[out] One of the following DWORD values specifying the status returned by the device.
Status | Description |
0 | The action is not supported. |
1 | The device secure clock could not be acquired from the service. |
2 | The device's secure clock could not be set. |
3 | The device's secure clock was set. |
Return Values
The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Return code | Description |
S_OK | The method succeeded. |
DRM_E_INVALIDARG | One or more arguments are not valid. |
NS_E_DEVICE_NOT_WMDRM_DEVICE | The specified device is not a Windows Media DRM–compatible device. |
NS_E_DRM_UNABLE_TO_GET_SECURE_CLOCK | Failed to retrieve secure clock challenge from the device or unable to retrieve the secure clock URL from the challenge. |
NS_E_DRM_UNABLE_TO_GET_SECURE_CLOCK_FROM_SERVER | Failed to retrieve the secure clock response from the secure clock server. |
NS_E_DRM_UNABLE_TO_SET_SECURE_CLOCK | Failed to send the secure clock challenge to the device, or the device failed to set the clock. |
Remarks
This is an asynchronous method; the device must await the IWMDMProgress::End callback for this operation before attempting to play any licensed content.
An application can learn if the device must have its clock reset or updated by calling IWMDRMDeviceApp::QueryDeviceStatus or IWMDRMDeviceApp2::QueryDeviceStatus2.
Your application must have an Internet connection to enable it to acquire or reset a secure clock.
Requirements
Header: Requires both WMDRMDeviceApp.h and wmdrmdeviceapp_i.c (built from WMDRMDeviceApp.idl).
Library: mssachlp.lib
See Also