IPortableDeviceConnector::Disconnect method (portabledeviceconnectapi.h)
The Disconnect method sends an asynchronous disconnect request to the MTP/Bluetooth device.
Syntax
HRESULT Disconnect(
[in] IConnectionRequestCallback *pCallback
);
Parameters
[in] 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 |
---|---|
|
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
Requirement | Value |
---|---|
Minimum supported client | Windows 7 [desktop apps only] |
Minimum supported server | None supported |
Target Platform | Windows |
Header | portabledeviceconnectapi.h |
Library | PortableDeviceGuids.lib |
See also
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for