UPnP Registry Settings

Windows CE uses the registry to track the UPnP device-hosting services. The registry keys are set automatically if the UPNPSVC and UPNPHOST modules are selected in the platform.

Note   The default registry values vary depending on which features are included in your platform. For more information, see Default Registry Settings.

The HKEY_LOCAL_MACHINE\Services\UPNPSVC registry key loads the UPnP service as a built-in stream driver. The following table shows the named values.

Value : type Description
Prefix : REG_SZ Default setting is to "UPP".
Dll : REG_SZ Default setting is "upnpsvc.dll".
Index : REG_DWORD Default setting is 1.
Order : REG_DWORD Default setting is 5.
Context : REG_DWORD Default setting is 0.

The HKEY_LOCAL_MACHINE\COMM\HTTPD\VROOTS\/upnp registry key sets the virtual root directory for UPnP. All UPnP files and resources published on the network must be located in this directory or in its subdirectories. The following table shows the named values.

Value : type Description
@ : REG_SZ Default setting is "\\windows\\upnp\\".
a : REG_SZ Default setting is 0.

The HKEY_LOCAL_MACHINE\COMM\HTTPD\VROOTS\/upnpisapi registry key sets the virtual root directory for UPnP ISAPIs.

Value : type Description
@ : REG_SZ Default setting is "\\windows\\upnpsvc.dll".
a : REG_SZ Default setting is 0.

The HKEY_CLASSES_ROOT\CLSID\{204810b9-73b2-11d4-bf42-00b0d0118b56} registers the COM coclass for the UPnPRegistrar interface. The following table shows the named values.

Value : type Description
ProgID : REG_SZ Default setting is "UPnP.UPnPRegistrar.1".
VersionIndependentProgID : REG_SZ Default setting is "UPnP.UPnPRegistrar".

The HKEY_CLASSES_ROOT\CLSID\{204810b9-73b2-11d4-bf42-00b0d0118b56}\InprocServer32 registers the COM coclass for the UPnPRegistrar interface. The following table shows the named values.

Value : type Description
@ : REG_SZ Default setting is "\\Windows\\upnphost.dll".
ThreadingModel : REG_SZ Default setting is "Free".

The HKEY_CLASSES_ROOT\UPnP.UPnPRegistrar.1 registers COM the coclass for the UPnPRegistrar interface. The following table shows the named values.

Value : type Description
@ : REG_SZ Default setting is "UPnP Registrar Class".

The HKEY_CLASSES_ROOT\UPnP.UPnPRegistrar.1\CLSID registers the COM coclass for the UPnPRegistrar interface. The following table shows the named values.

Value : type Description
@ : REG_SZ Default setting is "{204810b9-73b2-11d4-bf42-00b0d0118b56}".

The HKEY_LOCAL_MACHINE\COMM\UPnP\Exclude registry key allows you to enable or disable UPnP on one or more public interfaces (network adapters), where <Interfaces> is the name of the public interface of your gateway.

Registry key Settings
Interfaces : MULTI_SZ Default is not set in the registry. If the value is not present in the registry, all interfaces enable UPnP.

Names of the network interfaces that should not use UPnP.

The following sample code shows how to exclude specific network adapters.

[HKEY_LOCAL_MACHINE\COMM\UPnP\Exclude]
"Interfaces"=multi_sz:"adapter1","adapter2","adapter3"
ExcludeAllExceptListed :

REG_DWORD

If this value is present in the registry and set to a non-zero value, then UPnP is disabled on all network interfaces except those interfaces specified in Interfaces.

The following sample code shows how to exclude all network adapters except those specified.

[HKEY_LOCAL_MACHINE\COMM\UPnP\Exclude]
"ExcludeAllExceptListed"=dword:1
"Interfaces"=multi_sz:"adapter1"

The HKEY_LOCAL_MACHINE\COMM\UPnP registry key defines the behavior of the UPnP. The following table shows the named values.

Value : type Description
DiscoveryTimeToLive : REG_DWORD Default setting is 1 in the registry. If the value is not present in the registry, the value defaults to 4.

Specifies the maximum number of hops before the multicast message is discarded.

Security Note   The higher the number of hops, network segments, the farther away the broadcast goes, which increases the surface of exposure to other networks. The lower the number of hops decreases the possibility of exposure to irrelevant networks.
DownloadScope : REG_DWORD Default not set in the registry. If the value is not present in the registry, UPnP accepts only a URL from the same subnet. The following values are valid:
  • 0 - accepts URL from the same subnet.
  • 1 - accepts URL from the same subnet and private addresses.
  • 2 - accepts URL if the hop count is below a number specified in DiscoveryTimeToLive registry value.
  • 3 - accepts any URL without restrictions.

Allows UPnP to verify URLs received from the network before making a request. These restrictions apply to all URLs in UPnP, such as device description, service description, device control, device event subscription, and control point event callback.

IPVersionSetting : REG_DWORD Default not set in the registry. If the value is not present in the registry, UPnP uses both IPv4 and IPv6 if they are present on the image. The following values are valid:
  • 1 - uses IPv4 only.
  • 2 - uses IPv6 only.
  • 3 - uses both IPv4 and IPv6 if they are present on the image.

Specifies the IP version to use.

This setting applies to devices and control points. The device and control point can interact only if they support at least one common version.

IPv6SiteScope : REG_DWORD Default not set in the registry. If the value is not present in the registry, UPnP supports link-local addresses. The only valid value is 5 and all other values are invalid:
  • 5 - supports link-local and site-local addresses.

Specifies what addresses UPnP uses for IPv6. UPnP always uses link-local addresses, which allow interaction for devices and control points that are on the same link. UPnP supports link-local scope by default.

This registry value is valid only if IPv6 is used as indicated by IPVersionSetting setting to 2 or 3.

This setting applies to devices and control points. The device and control point that are on the same site but not on the same link can interact only if IPv6SiteScope is set to 5 for both.

MaxActionResponse Default is 49152 (48 KB).

Specifies the maximum size, in bytes, of action or query variable response to download.

MaxControlPointDelay : REG_DWORD Default not set in the registry. If the value is not present in the registry, the value defaults to 3000.

Specifies the maximum delay, in milliseconds, before a control point makes a request to a newly discovered device. The control point uses a random delay from 0 to this value before responding to a device advertisement.

Security Note   To prevent a storm of requests that consumes device resources and causes a denial of service, MaxControlPointDelay spaces out responses over time.
MaxDocumentSize Default is 204800 (200 KB).

Specifies the maximum size, in bytes, of UPnP device or service description document to download.

MaxSubscribers : REG_DWORD Default not set in the registry. If the value is not present in the registry, the value defaults to 30.

Sets the subscriber limit per device host and not per UPnP device. All UPnP devices on a given machine share a specified limit of subscribers.

Security Note   By defining the number of subscribers, you can prevent a denial of service when the device is swamped with too many requests for services. It allows you to control the resources that the device uses as well as the efficiency to respond to requests. UPnP rejects subscriptions when it reaches the maximum number of subscribers and sends an error message–HTTP_STATUS_SERVICE_UNAVAIL (503).
NotificationQueueSize : REG_DWORD Default setting is 128 (0x80).

If the value is not present in the registry, the default value is 0x80.

Notifications sent to a control point are stored in a message queue and the control point application removes them from the queue for processing. The size of the queue varies depending on the amount of time the application needs to process a notification, the size of the notification, and the characteristics of the UPnP device.

Port : REG_DWORD Default setting is 5120 (0x1400).

Sets TCP port used by UPnP for control and eventing.

Note   If you change the default port, you must also change the HKEY_LOCAL_MACHINE\Services\HTTPD\Accept key for the Web server to listen on the new UPnP port. For more information, see Web Server Registry Settings.
SubDefaultTimeout : REG_DWORD Default setting is 1800.

Specifies the default value for subscription timeout, in seconds. UPnP uses this value as the actual subscription timeout when the request does not specify a timeout value.

SubMaxTimeout : REG_DWORD Default setting is 3600.

Specifies the maximum timeout values, in seconds. UPnP uses this value as an upper bound to determine the actual subscription timeout when it accepts a request.

SubMinTimeout : REG_DWORD Default setting is 1800.

Specifies the minimum subscription timeout values, in seconds. UPnP uses this value as a lower bound to determine the actual subscription timeout when it accepts a request.

 Last updated on Tuesday, May 18, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.