IPortableDevice::GetPnPDeviceID method

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

Syntax


HRESULT GetPnPDeviceID(
  [out] LPCWSTR *ppszPnPDeviceID
);

Parameters

ppszPnPDeviceID [out]

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 codeDescription
S_OK

The method succeeded.

E_WPD_DEVICE_NOT_OPEN

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

PortableDeviceApi.h

Library

PortableDeviceGUIDs.lib

See also

IPortableDevice::Open
IPortableDevice Interface

 

 

Community Additions

ADD
Show: