IUPnPRegistrar::RegisterDeviceProvider method (upnphost.h)

The RegisterDeviceProvider method registers a device provider with the device host. The device provider is not published on the network. Instead, it creates devices dynamically and registers them using RegisterRunningDevice.

Syntax

HRESULT RegisterDeviceProvider(
  [in] BSTR bstrProviderName,
  [in] BSTR bstrProgIDProviderClass,
  [in] BSTR bstrInitString,
  [in] BSTR bstrContainerId
);

Parameters

[in] bstrProviderName

Specifies the name of the device provider.

[in] bstrProgIDProviderClass

Specifies the ProgID of object that implements the IUPnPDeviceProvider interface. This object must already be registered with COM. This object must be an in-process COM server (CLSCTX_INPROC_SERVER) and must be accessible to LocalService.

[in] bstrInitString

Identifies an initialization string specific to a device provider.

[in] bstrContainerId

Specifies a string that identifies the process group in which the device provider belongs. All devices and device providers with the same container ID are contained in the same process.

Return value

If the method succeeds, the return value is S_OK. Otherwise, the method returns one of the COM error codes defined in WinError.h.

Remarks

Common errors that can occur when invoking this function include:

  • The necessary COM object was not found.
  • There is no access to the COM object for LocalService.
  • Subordinate COM interfaces.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server None supported
Target Platform Windows
Header upnphost.h
DLL Upnphost.dll

See also

IUPnPRegistrar

IUPnPRegistrar::UnregisterDeviceProvider