## EXPORT_SPEC int UpnpRegisterRootDevice

## ( IN const char* DescUrl,
IN Upnp_FunPtr Callback,
IN const void* Cookie,
OUT UpnpDevice_Handle* Hnd )

> UpnpRegisterRootDevice registers a device application with the SDK.

## Documentation

> UpnpRegisterRootDevice registers a device application with the SDK. A device application cannot make any other API calls until it registers using this function. Device applications can also register as control points (see UpnpRegisterClient to get a control point handle to perform control point functionality).

> UpnpRegisterRootDevice is synchronous and does not generate any callbacks. Callbacks can occur as soon as this function returns.

Parameters:
  DescUrl - Pointer to a string containing the description URL for this root device instance.
  Callback - Pointer to the callback function for receiving asynchronous events.
  Cookie - Pointer to user data returned with the callback function when invoked.
  Hnd - Pointer to a variable to store the new device handle.
Returns:
  [int] An integer representing one of the following:
  - `UPNP_E_SUCCESS`: The operation completed successfully.
  - `UPNP_E_FINISH`: The SDK is already terminated or is not initialized.
  - `UPNP_E_INVALID_DESC`: The description document was not a valid device description.
  - `UPNP_E_INVALID_URL`: The URL for the description document is not valid.
  - `UPNP_E_INVALID_PARAM`: Either Callback or Hnd is not a valid pointer or DescURL is `NULL`.
  - `UPNP_E_NETWORK_ERROR`: A network error occurred.
  - `UPNP_E_SOCKET_WRITE`: An error or timeout occurred writing to a socket.
  - `UPNP_E_SOCKET_READ`: An error or timeout occurred reading from a socket.
  - `UPNP_E_SOCKET_BIND`: An error occurred binding a socket.
  - `UPNP_E_SOCKET_CONNECT`: An error occurred connecting the socket.
  - `UPNP_E_OUTOF_SOCKET`: Too many sockets are currently allocated.
  - `UPNP_E_OUTOF_MEMORY`: There are insufficient resources to register this root device.

Alphabetic index

This page was generated with the help of DOC++.