Compartir a través de


IPortableDevice::GetPnPDeviceID

banner art

Previous Next

IPortableDevice::GetPnPDeviceID

The GetPnPDeviceID method retrieves the Plug and Play (PnP) device identifier that the application used to open the device.

Syntax

  HRESULT GetPnPDeviceID(
  LPCWSTR*  ppszPnPDeviceID
);

Parameters

ppszPnPDeviceID

[out]  Pointer to a null-terminated string that contains the Plug and Play ID string for the device.

Return Values

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.
E_WPD_DEVICE_ALREADY_OPENED 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

Header: Defined in PortableDeviceApi.h

Library: PortableDeviceGUIDs.lib

See Also

Previous Next