SwDeviceGetLifetime function

Gets the lifetime of a software device.

Syntax

HRESULT SwDeviceGetLifetime(
  HSWDEVICE           hSwDevice,
  PSW_DEVICE_LIFETIME pLifetime
);

Parameters

hSwDevice

The HSWDEVICE handle to the software device to retrieve.

pLifetime

A pointer to a variable that receives a SW_DEVICE_LIFETIME-typed value that indicates the current lifetime value for the software device. Here are possible values:

Value Meaning
SWDeviceLifetimeHandle
Indicates that the lifetime of the software device is determined by the lifetime of the handle that is associated with the software device. As long as the handle is open, the software device is enumerated by PnP.
SWDeviceLifetimeParentPresent
Indicates that the lifetime of the software device is tied to the lifetime of its parent.

Return value

S_OK is returned if SwDeviceSetLifetime successfully retrieved the lifetime.

Requirements

   
Minimum supported client Windows 8.1
Minimum supported server Windows Server 2012 R2
Target Platform Universal
Header swdevice.h
Library Swdevice.lib; OneCoreUAP.lib on Windows 10
DLL Cfgmgr32.dll