Unregistering a Device

Use the IUPnPRegistrar::UnregisterDevice method to unregister a device. The device can be unregistered (removed from the device host) temporarily or permanently, depending on the value of fPermanent. Developers should remove devices temporarily if the devices will be re-registered, and the devices should use the same UDN. Otherwise, the devices are removed permanently.

The GUID used to unregister is not the UDN. You must use the ID returned to you by IUPnPRegistrar::RegisterDevice or IUPnPRegistrar::RegisterRunningDevice.

Note  You can release the IUPnPRegistrar object. Only the ID must be cached.

If fPermanent is FALSE, the device is removed temporarily. Use IUPnPReregistrar interface to re-register the device. The IUPnPReregistrar::ReregisterDevice and IUPnPReregistrar::ReregisterRunningDevice methods use the same UDN or UDNs, in the case of nested devices, previously generated by the device host for the unregistered device.

If fPermanent is TRUE, the device is permanently removed from the device host. Registering this device again on the same computer creates a different UDN than the one previously created.

Note  When a device is registered multiple times on the same computer, the device host generates different UDNs for each instance of the device.