The UnregisterEndpointNotificationCallback method deletes the registration of a notification interface that the client registered in a previous call to the IMMDeviceEnumerator::RegisterEndpointNotificationCallback method.
HRESULT UnregisterEndpointNotificationCallback( IMMNotificationClient *pClient );
Pointer to the client's IMMNotificationClient interface. The client passed this same interface pointer to the device enumerator in a previous call to the IMMDeviceEnumerator::RegisterEndpointNotificationCallback method. For more information, see Remarks.
If the method succeeds, it returns S_OK. If it fails, possible return codes include, but are not limited to, the values shown in the following table.
||Parameter pNotify is NULL.|
||The specified notification interface was not found.|
The client must ensure that the IMMNotificationClient object is not released after the RegisterEndpointNotificationCallback call and before calling UnregisterEndpointNotificationCallback. These methods do not call the client's IMMNotificationClient::AddRef and IMMNotificationClient::Release implementations. The client is responsible for maintaining the reference count of the IMMNotificationClient object. The client must increment the count if the RegisterEndpointNotificationCallback call succeeds and release the final reference only after calling UnregisterEndpointNotificationCallback or implement some other mechanism to ensure that the object is not deleted before UnregisterEndpointNotificationCallback is called. Otherwise, the application leaks the resources held by the IMMNotificationClient and any other object that is implemented in the same container.
For more information about the AddRef and Release methods, see the discussion of the IUnknown interface in the Windows SDK documentation.
|Minimum supported client||Windows Vista [desktop apps only]|
|Minimum supported server||Windows Server 2008 [desktop apps only]|