IPortableDeviceService::GetPnPServiceID method (portabledeviceapi.h)

The GetPnPServiceID method retrieves a Plug and Play (PnP) identifier for the service.

Syntax

HRESULT GetPnPServiceID(
  [out] LPWSTR *ppszPnPServiceID
);

Parameters

[out] ppszPnPServiceID

The retrieved PnP identifier, which is the same identifier that was passed to the Open method.

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.
E_POINTER
A NULL parameter was specified.
E_WPD_SERVICE_NOT_OPEN
The Open method has not yet been called for the service.

Remarks

The Open method must be called on the service before a PnP identifier can be retrieved.

When an application no longer needs the PnP identifier, it should call the CoTaskMemFree function to free the identifier memory.

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps | UWP apps]
Minimum supported server None supported
Target Platform Windows
Header portabledeviceapi.h

See also

IPortableDeviceService Interface