The CM_Add_Empty_Log_Conf function creates an empty logical configuration, for a specified configuration type and a specified device instance, on the local machine.
CMAPI CONFIGRET WINAPI
CM_Add_Empty_Log_Conf(
OUT PLOG_CONF plcLogConf,
IN DEVINST dnDevInst,
IN PRIORITY Priority,
IN ULONG ulFlags
);
| Priority Constant | Definition |
|---|---|
| LCPRI_FORCECONFIG | Result of a forced configuration. |
| LCPRI_BOOTCONFIG | Result of a boot configuration. |
| LCPRI_DESIRED | Preferred configuration (better performance). |
| LCPRI_NORMAL | Workable configuration (acceptable performance). |
| LCPRI_LASTBESTCONFIG | For internal use only. |
| LCPRI_SUBOPTIMAL | Not a desirable configuration, but it will work. |
| LCPRI_LASTSOFTCONFIG | For internal use only. |
| LCPRI_RESTART | The system must be restarted |
| LCPRI_REBOOT | The system must be restarted (same as LCPRI_RESTART). |
| LCPRI_POWEROFF | The system must be shut down and powered off. |
| LCPRI_HARDRECONFIG | A jumper must be changed. |
| LCPRI_HARDWIRED | The configuration cannot be changed. |
| LCPRI_IMPOSSIBLE | The configuration cannot exist. |
| LCPRI_DISABLED | Disabled configuration. |
| Configuration Type Flags | Definitions |
|---|---|
| BASIC_LOG_CONF | Resource descriptors added to this configuration will describe a basic configuration. |
| FILTERED_LOG_CONF | Do not use. (Only the PnP manager can create a filtered configuration.) |
| ALLOC_LOG_CONF | Do not use. (Only the PnP manager can create an allocated configuration.) |
| BOOT_LOG_CONF | Resource descriptors added to this configuration will describe a boot configuration. |
| FORCED_LOG_CONF | Resource descriptors added to this configuration will describe a forced configuration. |
| OVERRIDE_LOG_CONF | Resource descriptors added to this configuration will describe an override configuration. |
One of the following bit flags can be OR'ed with the configuration type flag.
| Priority Comparison Flags | Definitions |
|---|---|
| PRIORITY_EQUAL_FIRST | If multiple configurations of the same type (ulFlags) have the same priority (Priority), this configuration is placed at the head of the list. |
| PRIORITY_EQUAL_LAST | (Default) If multiple configurations of the same type (ulFlags) have the same priority (Priority), this configuration is placed at the tail of the list. |
If the operation succeeds, the function returns CR_SUCCESS. Otherwise, it returns one of the CR_-prefixed error codes defined in cfgmgr32.h.
Declared in cfgmgr32.h. Include cfgmgr32.h.
Calling CM_Add_Empty_Log_Conf can cause the handles returned by CM_Get_First_Log_Conf and CM_Get_Next_Log_Conf to become invalid. Thus if you want to obtain logical configurations after calling CM_Add_Empty_Log_Conf, your code must call CM_Get_First_Log_Conf again and start at the first configuration.
To remove a logical configuration created by CM_Add_Empty_Log_Conf, call CM_Free_Log_Conf.
The handle received in plcLogConf must be explicitly freed by calling CM_Free_Log_Conf_Handle.
Callers of this function must have SeLoadDriverPrivilege. (Privileges are described in the Platform SDK documentation.)
For information about using device instance handles that are bound to the local machine, see CM_Get_Child.
CM_Add_Empty_Log_Conf_Ex, CM_Free_Log_Conf, CM_Free_Log_Conf_Handle, CM_Get_Child, CM_Get_First_Log_Conf, CM_Get_Next_Log_Conf