IPortableDeviceService::Open method (portabledeviceapi.h)

The Open method opens a connection to the service.

Syntax

HRESULT Open(
  [in] LPCWSTR               pszPnPServiceID,
  [in] IPortableDeviceValues *pClientInfo
);

Parameters

[in] pszPnPServiceID

The Plug and Play (PnP) identifier for the service, which is the same identifier that is retrieved by the GetPnPServiceId method.

[in] pClientInfo

The IPortableDeviceValues interface specifying the client information.

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_INVALIDARG
The PnP identifier specified by the pszPnPServiceID parameter is invalid.
E_POINTER
A NULL parameter was specified.
E_WPD_SERVICE_ALREADY_OPENED
This method has already been called for the service.

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

Opening a Service