IPortableDevice::GetPnPDeviceID method (portabledeviceapi.h)
The GetPnPDeviceID method retrieves the Plug and Play (PnP) device identifier that the application used to open the device.
Syntax
HRESULT GetPnPDeviceID(
[out] LPWSTR *ppszPnPDeviceID
);
Parameters
[out] ppszPnPDeviceID
Pointer to a null-terminated string that contains the Plug and Play ID string for the device.
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. |
|
The IPortableDevice::Open method has not been called yet for this device. |
Remarks
After the application is through using the string returned by this method, it must call the CoTaskMemFree function to free the string.
The ppszPnPDeviceID argument must not be set to NULL.
Requirements
Requirement | Value |
---|---|
Target Platform | Windows |
Header | portabledeviceapi.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