IWMPSubscriptionService2::deviceAvailable method (subscriptionservices.h)
[The feature associated with this page, Windows Media Player SDK, is a legacy feature. It has been superseded by MediaPlayer. MediaPlayer has been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer instead of Windows Media Player SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]
Syntax
HRESULT deviceAvailable(
[in] BSTR bstrDeviceName,
[in] IWMPSubscriptionServiceCallback *pCB
);
Parameters
[in] bstrDeviceName
String containing the device name.
[in] pCB
Pointer to an IWMPSubscriptionServiceCallback interface. The online store uses this pointer to notify Windows Media Player that device-specific processing is complete.
Return value
The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Return code | Description |
---|---|
|
The method succeeded. |
Remarks
Windows Media Player calls this method after a synchronization operation if the time elapsed since the last call is one week or more.
Your code should not perform lengthy operations synchronously when Windows Media Player calls this method. Instead, you must perform time-consuming tasks on a separate worker thread. When the worker thread has completed its work, it must call IWMPSubscriptionServiceCallback::onComplete.
Use the following procedure to provide your worker thread with a pointer to an IWMPSubscriptionServiceCallback interface.
- Pass pCB to CoMarshalInterThreadInterfaceInStream, which returns an IStream pointer.
- Pass the IStream pointer to your worker thread.
- In your worker thread, call CoGetInterfaceAndReleaseStream, which returns an interface pointer that you can use to call onComplete.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Media Player 10 or later. |
Target Platform | Windows |
Header | subscriptionservices.h |