IPortableDeviceConnector::Disconnect method (portabledeviceconnectapi.h)

The Disconnect method sends an asynchronous disconnect request to the MTP/Bluetooth device.

Syntax

HRESULT Disconnect(
  IConnectionRequestCallback *pCallback
);

Parameters

pCallback

A pointer to an IConnectionRequestCallback interface.

Return value

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.

Remarks

This method will queue a disconnect request and then return immediately.

To be notified when the request is complete, applications should provide a pointer to the IConnectionRequestCallback interface. This will disconnect the MTP/Bluetooth link and remove the Windows Portable Devices (WPD) class driver stack for that device.

Once the disconnection completes, the WPD API will no longer enumerate this device.

Requirements

   
Minimum supported client Windows 7 [desktop apps only]
Minimum supported server None supported
Target Platform Windows
Header portabledeviceconnectapi.h
Library PortableDeviceGuids.lib

See also

IPortableDeviceConnector