IPNPXDeviceAssociation::Unassociate method (pnpxassoc.h)

[Function Discovery is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions.]

Marks an association database entry as unassociated and sends an appropriate notification.

Syntax

HRESULT Unassociate(
  [in, optional] const WCHAR                    *pszSubCategory,
  [in]           IFunctionDiscoveryNotification *pIFunctionDiscoveryNotification
);

Parameters

[in, optional] pszSubCategory

The subcategory of the association database in which the entry is stored. This parameter can be NULL.

[in] pIFunctionDiscoveryNotification

An IFunctionDiscoveryNotification object that is registered for notifications with Function Discovery.

Return value

Possible return values include, but are not limited to, the following.

Return code Description
S_OK
The method succeeded.
E_FAIL
The method failed.

Remarks

This method modifies the association database entry corresponding to the function instance from which the IPNPXDeviceAssociation interface was obtained.

The following logic is used to determine the callback method used for notification:

  • If a PnP notification is received after the device is unassociated, then the IFunctionDiscoveryNotification::OnUpdate method is called with the enumQueryUpdateAction parameter set to QUA_REMOVE.
  • If no PnP notification is received after the device is unassociated, and there are no pending PnP events, then the IFunctionDiscoveryNotification::OnError method is called.
  • Finally, if no PnP notification is received after the device is unassociated, and there are pending PnP events, then no callback method is called.
This method does not remove the entry from the association database. To remove an entry from the association database, call IPNPXAssociation::Delete.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header pnpxassoc.h

See also

IPNPXAssociation::Unassociate

IPNPXDeviceAssociation