ReactOS  0.4.13-dev-52-g0efcfec
cfgmgr.c File Reference
#include "setupapi_private.h"
#include <dbt.h>
#include <pnp_c.h>
#include "rpc_private.h"
Include dependency graph for cfgmgr.c:

Go to the source code of this file.

Classes

struct  _MACHINE_INFO
 
struct  _LOG_CONF_INFO
 
struct  _NOTIFY_DATA
 
struct  _INTERNAL_RANGE
 
struct  _INTERNAL_RANGE_LIST
 
struct  _CONFLICT_DATA
 

Macros

#define LOG_CONF_MAGIC   0x464E434C /* "LCNF" */
 
#define NOTIFY_MAGIC   0x44556677
 
#define RANGE_LIST_MAGIC   0x33445566
 
#define CONFLICT_MAGIC   0x11225588
 

Typedefs

typedef struct _MACHINE_INFO MACHINE_INFO
 
typedef struct _MACHINE_INFOPMACHINE_INFO
 
typedef struct _LOG_CONF_INFO LOG_CONF_INFO
 
typedef struct _LOG_CONF_INFOPLOG_CONF_INFO
 
typedef struct _NOTIFY_DATA NOTIFY_DATA
 
typedef struct _NOTIFY_DATAPNOTIFY_DATA
 
typedef struct _INTERNAL_RANGE INTERNAL_RANGE
 
typedef struct _INTERNAL_RANGEPINTERNAL_RANGE
 
typedef struct _INTERNAL_RANGE_LIST INTERNAL_RANGE_LIST
 
typedef struct _INTERNAL_RANGE_LISTPINTERNAL_RANGE_LIST
 
typedef struct _CONFLICT_DATA CONFLICT_DATA
 
typedef struct _CONFLICT_DATAPCONFLICT_DATA
 

Functions

static BOOL GuidToString (_In_ LPGUID Guid, _Out_ LPWSTR String)
 
static CONFIGRET RpcStatusToCmStatus (_In_ RPC_STATUS Status)
 
static ULONG GetRegistryPropertyType (_In_ ULONG ulProperty)
 
static VOID SplitDeviceInstanceId (_In_ PWSTR pszDeviceInstanceId, _Out_ PWSTR pszDeviceId, _Out_ PWSTR pszInstanceId)
 
static CONFIGRET GetDeviceInstanceKeyPath (_In_ RPC_BINDING_HANDLE BindingHandle, _In_ PWSTR pszDeviceInst, _Out_ PWSTR pszKeyPath, _Out_ PWSTR pszInstancePath, _In_ ULONG ulHardwareProfile, _In_ ULONG ulFlags)
 
BOOL IsValidRangeList (_In_opt_ PINTERNAL_RANGE_LIST pRangeList)
 
BOOL IsValidLogConf (_In_opt_ PLOG_CONF_INFO pLogConfInfo)
 
BOOL IsValidConflictData (_In_opt_ PCONFLICT_DATA pConflictData)
 
CONFIGRET WINAPI CMP_GetBlockedDriverInfo (_Out_opt_ LPWSTR pszNames, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CMP_GetServerSideDeviceInstallFlags (_Out_ PULONG pulSSDIFlags, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CMP_Init_Detection (_In_ ULONG ulMagic)
 
CONFIGRET WINAPI CMP_RegisterNotification (_In_ HANDLE hRecipient, _In_ LPVOID lpvNotificationFilter, _In_ ULONG ulFlags, _Out_ PHDEVNOTIFY phDevNotify)
 
CONFIGRET WINAPI CMP_Report_LogOn (_In_ DWORD dwMagic, _In_ DWORD dwProcessId)
 
CONFIGRET WINAPI CMP_UnregisterNotification (_In_ HDEVNOTIFY hDevNotify)
 
DWORD WINAPI CMP_WaitNoPendingInstallEvents (_In_ DWORD dwTimeout)
 
CONFIGRET WINAPI CMP_WaitServicesAvailable (_In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Add_Empty_Log_Conf (_Out_ PLOG_CONF plcLogConf, _In_ DEVINST dnDevInst, _In_ PRIORITY Priority, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Add_Empty_Log_Conf_Ex (_Out_ PLOG_CONF plcLogConf, _In_ DEVINST dnDevInst, _In_ PRIORITY Priority, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Add_IDA (_In_ DEVINST dnDevInst, _In_ PSTR pszID, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Add_IDW (_In_ DEVINST dnDevInst, _In_ PWSTR pszID, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Add_ID_ExA (_In_ DEVINST dnDevInst, _In_ PSTR pszID, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Add_ID_ExW (_In_ DEVINST dnDevInst, _In_ PWSTR pszID, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Add_Range (_In_ DWORDLONG ullStartValue, _In_ DWORDLONG ullEndValue, _In_ RANGE_LIST rlh, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Add_Res_Des (_Out_opt_ PRES_DES prdResDes, _In_ LOG_CONF lcLogConf, _In_ RESOURCEID ResourceID, _In_reads_bytes_(ResourceLen) PCVOID ResourceData, _In_ ULONG ResourceLen, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Add_Res_Des_Ex (_Out_opt_ PRES_DES prdResDes, _In_ LOG_CONF lcLogConf, _In_ RESOURCEID ResourceID, _In_reads_bytes_(ResourceLen) PCVOID ResourceData, _In_ ULONG ResourceLen, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Connect_MachineA (_In_opt_ PCSTR UNCServerName, _Out_ PHMACHINE phMachine)
 
CONFIGRET WINAPI CM_Connect_MachineW (_In_opt_ PCWSTR UNCServerName, _Out_ PHMACHINE phMachine)
 
CONFIGRET WINAPI CM_Create_DevNodeA (_Out_ PDEVINST pdnDevInst, _In_ DEVINSTID_A pDeviceID, _In_ DEVINST dnParent, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Create_DevNodeW (_Out_ PDEVINST pdnDevInst, _In_ DEVINSTID_W pDeviceID, _In_ DEVINST dnParent, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Create_DevNode_ExA (_Out_ PDEVINST pdnDevInst, _In_ DEVINSTID_A pDeviceID, _In_ DEVINST dnParent, _In_ ULONG ulFlags, _In_opt_ HANDLE hMachine)
 
CONFIGRET WINAPI CM_Create_DevNode_ExW (_Out_ PDEVINST pdnDevInst, _In_ DEVINSTID_W pDeviceID, _In_ DEVINST dnParent, _In_ ULONG ulFlags, _In_opt_ HANDLE hMachine)
 
CONFIGRET WINAPI CM_Create_Range_List (_Out_ PRANGE_LIST prlh, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Delete_Class_Key (_In_ LPGUID ClassGuid, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Delete_Class_Key_Ex (_In_ LPGUID ClassGuid, _In_ ULONG ulFlags, _In_opt_ HANDLE hMachine)
 
CONFIGRET WINAPI CM_Delete_DevNode_Key (_In_ DEVNODE dnDevNode, _In_ ULONG ulHardwareProfile, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Delete_DevNode_Key_Ex (_In_ DEVNODE dnDevNode, _In_ ULONG ulHardwareProfile, _In_ ULONG ulFlags, _In_opt_ HANDLE hMachine)
 
CONFIGRET WINAPI CM_Delete_Range (_In_ DWORDLONG ullStartValue, _In_ DWORDLONG ullEndValue, _In_ RANGE_LIST rlh, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Detect_Resource_Conflict (_In_ DEVINST dnDevInst, _In_ RESOURCEID ResourceID, _In_reads_bytes_(ResourceLen) PCVOID ResourceData, _In_ ULONG ResourceLen, _Out_ PBOOL pbConflictDetected, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Detect_Resource_Conflict_Ex (_In_ DEVINST dnDevInst, _In_ RESOURCEID ResourceID, _In_reads_bytes_(ResourceLen) PCVOID ResourceData, _In_ ULONG ResourceLen, _Out_ PBOOL pbConflictDetected, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Disable_DevNode (_In_ DEVINST dnDevInst, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Disable_DevNode_Ex (_In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Disconnect_Machine (_In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Dup_Range_List (_In_ RANGE_LIST rlhOld, _In_ RANGE_LIST rlhNew, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Enable_DevNode (_In_ DEVINST dnDevInst, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Enable_DevNode_Ex (_In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Enumerate_Classes (_In_ ULONG ulClassIndex, _Out_ LPGUID ClassGuid, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Enumerate_Classes_Ex (_In_ ULONG ulClassIndex, _Out_ LPGUID ClassGuid, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Enumerate_EnumeratorsA (_In_ ULONG ulEnumIndex, _Out_writes_(*pulLength) PCHAR Buffer, _Inout_ PULONG pulLength, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Enumerate_EnumeratorsW (_In_ ULONG ulEnumIndex, _Out_writes_(*pulLength) PWCHAR Buffer, _Inout_ PULONG pulLength, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Enumerate_Enumerators_ExA (_In_ ULONG ulEnumIndex, _Out_writes_(*pulLength) PCHAR Buffer, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Enumerate_Enumerators_ExW (_In_ ULONG ulEnumIndex, _Out_writes_(*pulLength) PWCHAR Buffer, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Find_Range (_Out_ PDWORDLONG pullStart, _In_ DWORDLONG ullStart, _In_ ULONG ulLength, _In_ DWORDLONG ullAlignment, _In_ DWORDLONG ullEnd, _In_ RANGE_LIST rlh, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_First_Range (_In_ RANGE_LIST rlh, _Out_ PDWORDLONG pullStart, _Out_ PDWORDLONG pullEnd, _Out_ PRANGE_ELEMENT preElement, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Free_Log_Conf (_In_ LOG_CONF lcLogConfToBeFreed, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Free_Log_Conf_Ex (_In_ LOG_CONF lcLogConfToBeFreed, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Free_Log_Conf_Handle (_In_ LOG_CONF lcLogConf)
 
CONFIGRET WINAPI CM_Free_Range_List (_In_ RANGE_LIST RangeList, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Free_Res_Des (_Out_ PRES_DES prdResDes, _In_ RES_DES rdResDes, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Free_Res_Des_Ex (_Out_ PRES_DES prdResDes, _In_ RES_DES rdResDes, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Free_Res_Des_Handle (_In_ RES_DES rdResDes)
 
CONFIGRET WINAPI CM_Free_Resource_Conflict_Handle (_In_ CONFLICT_LIST clConflictList)
 
CONFIGRET WINAPI CM_Get_Child (_Out_ PDEVINST pdnDevInst, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_Child_Ex (_Out_ PDEVINST pdnDevInst, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_Class_Key_NameA (_In_ LPGUID ClassGuid, _Out_writes_opt_(*pulLength) LPSTR pszKeyName, _Inout_ PULONG pulLength, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_Class_Key_NameW (_In_ LPGUID ClassGuid, _Out_writes_opt_(*pulLength) LPWSTR pszKeyName, _Inout_ PULONG pulLength, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_Class_Key_Name_ExA (_In_ LPGUID ClassGuid, _Out_writes_opt_(*pulLength) LPSTR pszKeyName, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_Class_Key_Name_ExW (_In_ LPGUID ClassGuid, _Out_writes_opt_(*pulLength) LPWSTR pszKeyName, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_Class_NameA (_In_ LPGUID ClassGuid, _Out_writes_opt_(*pulLength) PCHAR Buffer, _Inout_ PULONG pulLength, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_Class_NameW (_In_ LPGUID ClassGuid, _Out_writes_opt_(*pulLength) PWCHAR Buffer, _Inout_ PULONG pulLength, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_Class_Name_ExA (_In_ LPGUID ClassGuid, _Out_writes_opt_(*pulLength) PCHAR Buffer, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_Class_Name_ExW (_In_ LPGUID ClassGuid, _Out_writes_opt_(*pulLength) PWCHAR Buffer, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_Class_Registry_PropertyA (LPGUID ClassGuid, ULONG ulProperty, PULONG pulRegDataType, PVOID Buffer, PULONG pulLength, ULONG ulFlags, HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_Class_Registry_PropertyW (LPGUID ClassGuid, ULONG ulProperty, PULONG pulRegDataType, PVOID Buffer, PULONG pulLength, ULONG ulFlags, HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_Depth (_Out_ PULONG pulDepth, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_Depth_Ex (_Out_ PULONG pulDepth, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_DevNode_Custom_PropertyA (_In_ DEVINST dnDevInst, _In_ PCSTR pszCustomPropertyName, _Out_opt_ PULONG pulRegDataType, _Out_writes_bytes_opt_(*pulLength) PVOID Buffer, _Inout_ PULONG pulLength, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_DevNode_Custom_PropertyW (_In_ DEVINST dnDevInst, _In_ PCWSTR pszCustomPropertyName, _Out_opt_ PULONG pulRegDataType, _Out_writes_bytes_opt_(*pulLength) PVOID Buffer, _Inout_ PULONG pulLength, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_DevNode_Custom_Property_ExA (_In_ DEVINST dnDevInst, _In_ PCSTR pszCustomPropertyName, _Out_opt_ PULONG pulRegDataType, _Out_writes_bytes_opt_(*pulLength) PVOID Buffer, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_DevNode_Custom_Property_ExW (_In_ DEVINST dnDevInst, _In_ PCWSTR pszCustomPropertyName, _Out_opt_ PULONG pulRegDataType, _Out_writes_bytes_opt_(*pulLength) PVOID Buffer, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_DevNode_Registry_PropertyA (_In_ DEVINST dnDevInst, _In_ ULONG ulProperty, _Out_opt_ PULONG pulRegDataType, _Out_writes_bytes_opt_(*pulLength) PVOID Buffer, _Inout_ PULONG pulLength, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_DevNode_Registry_PropertyW (_In_ DEVINST dnDevInst, _In_ ULONG ulProperty, _Out_opt_ PULONG pulRegDataType, _Out_writes_bytes_opt_(*pulLength) PVOID Buffer, _Inout_ PULONG pulLength, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_DevNode_Registry_Property_ExA (_In_ DEVINST dnDevInst, _In_ ULONG ulProperty, _Out_opt_ PULONG pulRegDataType, _Out_writes_bytes_opt_(*pulLength) PVOID Buffer, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_DevNode_Registry_Property_ExW (_In_ DEVINST dnDevInst, _In_ ULONG ulProperty, _Out_opt_ PULONG pulRegDataType, _Out_writes_bytes_opt_(*pulLength) PVOID Buffer, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_DevNode_Status (_Out_ PULONG pulStatus, _Out_ PULONG pulProblemNumber, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_DevNode_Status_Ex (_Out_ PULONG pulStatus, _Out_ PULONG pulProblemNumber, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_Device_IDA (_In_ DEVINST dnDevInst, _Out_writes_(BufferLen) PCHAR Buffer, _In_ ULONG BufferLen, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_Device_IDW (_In_ DEVINST dnDevInst, _Out_writes_(BufferLen) PWCHAR Buffer, _In_ ULONG BufferLen, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_Device_ID_ExA (_In_ DEVINST dnDevInst, _Out_writes_(BufferLen) PCHAR Buffer, _In_ ULONG BufferLen, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_Device_ID_ExW (_In_ DEVINST dnDevInst, _Out_writes_(BufferLen) PWCHAR Buffer, _In_ ULONG BufferLen, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_Device_ID_ListA (_In_ PCSTR pszFilter, _Out_writes_(BufferLen) PCHAR Buffer, _In_ ULONG BufferLen, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_Device_ID_ListW (_In_ PCWSTR pszFilter, _Out_writes_(BufferLen) PWCHAR Buffer, _In_ ULONG BufferLen, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_Device_ID_List_ExA (_In_ PCSTR pszFilter, _Out_writes_(BufferLen) PCHAR Buffer, _In_ ULONG BufferLen, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_Device_ID_List_ExW (_In_ PCWSTR pszFilter, _Out_writes_(BufferLen) PWCHAR Buffer, _In_ ULONG BufferLen, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_Device_ID_List_SizeA (_Out_ PULONG pulLen, _In_opt_ PCSTR pszFilter, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_Device_ID_List_SizeW (_Out_ PULONG pulLen, _In_opt_ PCWSTR pszFilter, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_Device_ID_List_Size_ExA (_Out_ PULONG pulLen, _In_opt_ PCSTR pszFilter, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_Device_ID_List_Size_ExW (_Out_ PULONG pulLen, _In_opt_ PCWSTR pszFilter, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_Device_ID_Size (_Out_ PULONG pulLen, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_Device_ID_Size_Ex (_Out_ PULONG pulLen, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_Device_Interface_AliasA (_In_ LPCSTR pszDeviceInterface, _In_ LPGUID AliasInterfaceGuid, _Out_writes_(*pulLength) LPSTR pszAliasDeviceInterface, _Inout_ PULONG pulLength, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_Device_Interface_AliasW (_In_ LPCWSTR pszDeviceInterface, _In_ LPGUID AliasInterfaceGuid, _Out_writes_(*pulLength) LPWSTR pszAliasDeviceInterface, _Inout_ PULONG pulLength, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_Device_Interface_Alias_ExA (_In_ LPCSTR pszDeviceInterface, _In_ LPGUID AliasInterfaceGuid, _Out_writes_(*pulLength) LPSTR pszAliasDeviceInterface, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_Device_Interface_Alias_ExW (_In_ LPCWSTR pszDeviceInterface, _In_ LPGUID AliasInterfaceGuid, _Out_writes_(*pulLength) LPWSTR pszAliasDeviceInterface, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_Device_Interface_ListA (_In_ LPGUID InterfaceClassGuid, _In_opt_ DEVINSTID_A pDeviceID, _Out_writes_(BufferLen) PCHAR Buffer, _In_ ULONG BufferLen, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_Device_Interface_ListW (_In_ LPGUID InterfaceClassGuid, _In_opt_ DEVINSTID_W pDeviceID, _Out_writes_(BufferLen) PWCHAR Buffer, _In_ ULONG BufferLen, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_Device_Interface_List_ExA (_In_ LPGUID InterfaceClassGuid, _In_opt_ DEVINSTID_A pDeviceID, _Out_writes_(BufferLen) PCHAR Buffer, _In_ ULONG BufferLen, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_Device_Interface_List_ExW (_In_ LPGUID InterfaceClassGuid, _In_opt_ DEVINSTID_W pDeviceID, _Out_writes_(BufferLen) PWCHAR Buffer, _In_ ULONG BufferLen, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_Device_Interface_List_SizeA (_Out_ PULONG pulLen, _In_ LPGUID InterfaceClassGuid, _In_opt_ DEVINSTID_A pDeviceID, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_Device_Interface_List_SizeW (_Out_ PULONG pulLen, _In_ LPGUID InterfaceClassGuid, _In_opt_ DEVINSTID_W pDeviceID, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_Device_Interface_List_Size_ExA (_Out_ PULONG pulLen, _In_ LPGUID InterfaceClassGuid, _In_opt_ DEVINSTID_A pDeviceID, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_Device_Interface_List_Size_ExW (_Out_ PULONG pulLen, _In_ LPGUID InterfaceClassGuid, _In_opt_ DEVINSTID_W pDeviceID, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_First_Log_Conf (_Out_opt_ PLOG_CONF plcLogConf, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_First_Log_Conf_Ex (_Out_opt_ PLOG_CONF plcLogConf, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_Global_State (_Out_ PULONG pulState, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_Global_State_Ex (_Out_ PULONG pulState, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_HW_Prof_FlagsA (_In_ DEVINSTID_A szDevInstName, _In_ ULONG ulHardwareProfile, _Out_ PULONG pulValue, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_HW_Prof_FlagsW (_In_ DEVINSTID_W szDevInstName, _In_ ULONG ulHardwareProfile, _Out_ PULONG pulValue, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_HW_Prof_Flags_ExA (_In_ DEVINSTID_A szDevInstName, _In_ ULONG ulHardwareProfile, _Out_ PULONG pulValue, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_HW_Prof_Flags_ExW (_In_ DEVINSTID_W szDevInstName, _In_ ULONG ulHardwareProfile, _Out_ PULONG pulValue, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_Hardware_Profile_InfoA (_In_ ULONG ulIndex, _Out_ PHWPROFILEINFO_A pHWProfileInfo, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_Hardware_Profile_InfoW (_In_ ULONG ulIndex, _Out_ PHWPROFILEINFO_W pHWProfileInfo, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_Hardware_Profile_Info_ExA (_In_ ULONG ulIndex, _Out_ PHWPROFILEINFO_A pHWProfileInfo, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_Hardware_Profile_Info_ExW (_In_ ULONG ulIndex, _Out_ PHWPROFILEINFO_W pHWProfileInfo, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_Log_Conf_Priority (_In_ LOG_CONF lcLogConf, _Out_ PPRIORITY pPriority, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_Log_Conf_Priority_Ex (_In_ LOG_CONF lcLogConf, _Out_ PPRIORITY pPriority, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_Next_Log_Conf (_Out_opt_ PLOG_CONF plcLogConf, _In_ LOG_CONF lcLogConf, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_Next_Log_Conf_Ex (_Out_opt_ PLOG_CONF plcLogConf, _In_ LOG_CONF lcLogConf, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_Next_Res_Des (_Out_ PRES_DES prdResDes, _In_ RES_DES rdResDes, _In_ RESOURCEID ForResource, _Out_opt_ PRESOURCEID pResourceID, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_Next_Res_Des_Ex (_Out_ PRES_DES prdResDes, _In_ RES_DES rdResDes, _In_ RESOURCEID ForResource, _Out_opt_ PRESOURCEID pResourceID, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_Parent (_Out_ PDEVINST pdnDevInst, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_Parent_Ex (_Out_ PDEVINST pdnDevInst, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_Res_Des_Data (_In_ RES_DES rdResDes, _Out_writes_bytes_(BufferLen) PVOID Buffer, _In_ ULONG BufferLen, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_Res_Des_Data_Ex (_In_ RES_DES rdResDes, _Out_writes_bytes_(BufferLen) PVOID Buffer, _In_ ULONG BufferLen, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_Res_Des_Data_Size (_Out_ PULONG pulSize, _In_ RES_DES rdResDes, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_Res_Des_Data_Size_Ex (_Out_ PULONG pulSize, _In_ RES_DES rdResDes, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Get_Resource_Conflict_Count (_In_ CONFLICT_LIST clConflictList, _Out_ PULONG pulCount)
 
CONFIGRET WINAPI CM_Get_Resource_Conflict_DetailsA (_In_ CONFLICT_LIST clConflictList, _In_ ULONG ulIndex, _Inout_ PCONFLICT_DETAILS_A pConflictDetails)
 
CONFIGRET WINAPI CM_Get_Resource_Conflict_DetailsW (_In_ CONFLICT_LIST clConflictList, _In_ ULONG ulIndex, _Inout_ PCONFLICT_DETAILS_W pConflictDetails)
 
CONFIGRET WINAPI CM_Get_Sibling (_Out_ PDEVINST pdnDevInst, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Get_Sibling_Ex (_Out_ PDEVINST pdnDevInst, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
WORD WINAPI CM_Get_Version (VOID)
 
WORD WINAPI CM_Get_Version_Ex (_In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Intersect_Range_List (_In_ RANGE_LIST rlhOld1, _In_ RANGE_LIST rlhOld2, _In_ RANGE_LIST rlhNew, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Invert_Range_List (_In_ RANGE_LIST rlhOld, _In_ RANGE_LIST rlhNew, _In_ DWORDLONG ullMaxValue, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Is_Dock_Station_Present (_Out_ PBOOL pbPresent)
 
CONFIGRET WINAPI CM_Is_Dock_Station_Present_Ex (_Out_ PBOOL pbPresent, _In_opt_ HMACHINE hMachine)
 
BOOL WINAPI CM_Is_Version_Available (_In_ WORD wVersion)
 
BOOL WINAPI CM_Is_Version_Available_Ex (_In_ WORD wVersion, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Locate_DevNodeA (_Out_ PDEVINST pdnDevInst, _In_opt_ DEVINSTID_A pDeviceID, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Locate_DevNodeW (_Out_ PDEVINST pdnDevInst, _In_opt_ DEVINSTID_W pDeviceID, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Locate_DevNode_ExA (_Out_ PDEVINST pdnDevInst, _In_opt_ DEVINSTID_A pDeviceID, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Locate_DevNode_ExW (_Out_ PDEVINST pdnDevInst, _In_opt_ DEVINSTID_W pDeviceID, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Merge_Range_List (_In_ RANGE_LIST rlhOld1, _In_ RANGE_LIST rlhOld2, _In_ RANGE_LIST rlhNew, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Modify_Res_Des (_Out_ PRES_DES prdResDes, _In_ RES_DES rdResDes, _In_ RESOURCEID ResourceID, _In_reads_bytes_(ResourceLen) PCVOID ResourceData, _In_ ULONG ResourceLen, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Modify_Res_Des_Ex (_Out_ PRES_DES prdResDes, _In_ RES_DES rdResDes, _In_ RESOURCEID ResourceID, _In_reads_bytes_(ResourceLen) PCVOID ResourceData, _In_ ULONG ResourceLen, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Move_DevNode (_In_ DEVINST dnFromDevInst, _In_ DEVINST dnToDevInst, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Move_DevNode_Ex (_In_ DEVINST dnFromDevInst, _In_ DEVINST dnToDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Next_Range (_Inout_ PRANGE_ELEMENT preElement, _Out_ PDWORDLONG pullStart, _Out_ PDWORDLONG pullEnd, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Open_Class_KeyA (_In_opt_ LPGUID pClassGuid, _In_opt_ LPCSTR pszClassName, _In_ REGSAM samDesired, _In_ REGDISPOSITION Disposition, _Out_ PHKEY phkClass, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Open_Class_KeyW (_In_opt_ LPGUID pClassGuid, _In_opt_ LPCWSTR pszClassName, _In_ REGSAM samDesired, _In_ REGDISPOSITION Disposition, _Out_ PHKEY phkClass, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Open_Class_Key_ExA (_In_opt_ LPGUID pClassGuid, _In_opt_ LPCSTR pszClassName, _In_ REGSAM samDesired, _In_ REGDISPOSITION Disposition, _Out_ PHKEY phkClass, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Open_Class_Key_ExW (_In_opt_ LPGUID pClassGuid, _In_opt_ LPCWSTR pszClassName, _In_ REGSAM samDesired, _In_ REGDISPOSITION Disposition, _Out_ PHKEY phkClass, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Open_DevNode_Key (_In_ DEVINST dnDevNode, _In_ REGSAM samDesired, _In_ ULONG ulHardwareProfile, _In_ REGDISPOSITION Disposition, _Out_ PHKEY phkDevice, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Open_DevNode_Key_Ex (_In_ DEVINST dnDevNode, _In_ REGSAM samDesired, _In_ ULONG ulHardwareProfile, _In_ REGDISPOSITION Disposition, _Out_ PHKEY phkDevice, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Query_And_Remove_SubTreeA (_In_ DEVINST dnAncestor, _Out_opt_ PPNP_VETO_TYPE pVetoType, _Out_writes_opt_(ulNameLength) LPSTR pszVetoName, _In_ ULONG ulNameLength, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Query_And_Remove_SubTreeW (_In_ DEVINST dnAncestor, _Out_opt_ PPNP_VETO_TYPE pVetoType, _Out_writes_opt_(ulNameLength) LPWSTR pszVetoName, _In_ ULONG ulNameLength, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Query_And_Remove_SubTree_ExA (_In_ DEVINST dnAncestor, _Out_opt_ PPNP_VETO_TYPE pVetoType, _Out_writes_opt_(ulNameLength) LPSTR pszVetoName, _In_ ULONG ulNameLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Query_And_Remove_SubTree_ExW (_In_ DEVINST dnAncestor, _Out_opt_ PPNP_VETO_TYPE pVetoType, _Out_writes_opt_(ulNameLength) LPWSTR pszVetoName, _In_ ULONG ulNameLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Query_Arbitrator_Free_Data (_Out_writes_bytes_(DataLen) PVOID pData, _In_ ULONG DataLen, _In_ DEVINST dnDevInst, _In_ RESOURCEID ResourceID, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Query_Arbitrator_Free_Data_Ex (_Out_writes_bytes_(DataLen) PVOID pData, _In_ ULONG DataLen, _In_ DEVINST dnDevInst, _In_ RESOURCEID ResourceID, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Query_Arbitrator_Free_Size (_Out_ PULONG pulSize, _In_ DEVINST dnDevInst, _In_ RESOURCEID ResourceID, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Query_Arbitrator_Free_Size_Ex (_Out_ PULONG pulSize, _In_ DEVINST dnDevInst, _In_ RESOURCEID ResourceID, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Query_Remove_SubTree (_In_ DEVINST dnAncestor, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Query_Remove_SubTree_Ex (_In_ DEVINST dnAncestor, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Query_Resource_Conflict_List (_Out_ PCONFLICT_LIST pclConflictList, _In_ DEVINST dnDevInst, _In_ RESOURCEID ResourceID, _In_ PCVOID ResourceData, _In_ ULONG ResourceLen, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Reenumerate_DevNode (_In_ DEVINST dnDevInst, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Reenumerate_DevNode_Ex (_In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Register_Device_Driver (_In_ DEVINST dnDevInst, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Register_Device_Driver_Ex (_In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Register_Device_InterfaceA (_In_ DEVINST dnDevInst, _In_ LPGUID InterfaceClassGuid, _In_opt_ LPCSTR pszReference, _Out_writes_(*pulLength) LPSTR pszDeviceInterface, _Inout_ PULONG pulLength, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Register_Device_InterfaceW (_In_ DEVINST dnDevInst, _In_ LPGUID InterfaceClassGuid, _In_opt_ LPCWSTR pszReference, _Out_writes_(*pulLength) LPWSTR pszDeviceInterface, _Inout_ PULONG pulLength, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Register_Device_Interface_ExA (_In_ DEVINST dnDevInst, _In_ LPGUID InterfaceClassGuid, _In_opt_ LPCSTR pszReference, _Out_writes_(*pulLength) LPSTR pszDeviceInterface, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Register_Device_Interface_ExW (_In_ DEVINST dnDevInst, _In_ LPGUID InterfaceClassGuid, _In_opt_ LPCWSTR pszReference, _Out_writes_(*pulLength) LPWSTR pszDeviceInterface, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Remove_SubTree (_In_ DEVINST dnAncestor, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Remove_SubTree_Ex (_In_ DEVINST dnAncestor, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Request_Device_EjectA (_In_ DEVINST dnDevInst, _Out_opt_ PPNP_VETO_TYPE pVetoType, _Out_writes_opt_(ulNameLength) LPSTR pszVetoName, _In_ ULONG ulNameLength, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Request_Device_EjectW (_In_ DEVINST dnDevInst, _Out_opt_ PPNP_VETO_TYPE pVetoType, _Out_writes_opt_(ulNameLength) LPWSTR pszVetoName, _In_ ULONG ulNameLength, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Request_Device_Eject_ExA (_In_ DEVINST dnDevInst, _Out_opt_ PPNP_VETO_TYPE pVetoType, _Out_writes_opt_(ulNameLength) LPSTR pszVetoName, _In_ ULONG ulNameLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Request_Device_Eject_ExW (_In_ DEVINST dnDevInst, _Out_opt_ PPNP_VETO_TYPE pVetoType, _Out_writes_opt_(ulNameLength) LPWSTR pszVetoName, _In_ ULONG ulNameLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Request_Eject_PC (VOID)
 
CONFIGRET WINAPI CM_Request_Eject_PC_Ex (_In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Run_Detection (_In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Run_Detection_Ex (_In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Set_Class_Registry_PropertyA (_In_ LPGUID ClassGuid, _In_ ULONG ulProperty, _In_reads_bytes_opt_(ulLength) PCVOID Buffer, _In_ ULONG ulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Set_Class_Registry_PropertyW (_In_ LPGUID ClassGuid, _In_ ULONG ulProperty, _In_reads_bytes_opt_(ulLength) PCVOID Buffer, _In_ ULONG ulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Set_DevNode_Problem (_In_ DEVINST dnDevInst, _In_ ULONG ulProblem, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Set_DevNode_Problem_Ex (_In_ DEVINST dnDevInst, _In_ ULONG ulProblem, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Set_DevNode_Registry_PropertyA (_In_ DEVINST dnDevInst, _In_ ULONG ulProperty, _In_reads_bytes_opt_(ulLength) PCVOID Buffer, _In_ ULONG ulLength, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Set_DevNode_Registry_PropertyW (_In_ DEVINST dnDevInst, _In_ ULONG ulProperty, _In_reads_bytes_opt_(ulLength) PCVOID Buffer, _In_ ULONG ulLength, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Set_DevNode_Registry_Property_ExA (_In_ DEVINST dnDevInst, _In_ ULONG ulProperty, _In_reads_bytes_opt_(ulLength) PCVOID Buffer, _In_ ULONG ulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Set_DevNode_Registry_Property_ExW (_In_ DEVINST dnDevInst, _In_ ULONG ulProperty, _In_reads_bytes_opt_(ulLength) PCVOID Buffer, _In_ ULONG ulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Set_HW_Prof (_In_ ULONG ulHardwareProfile, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Set_HW_Prof_Ex (_In_ ULONG ulHardwareProfile, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Set_HW_Prof_FlagsA (_In_ DEVINSTID_A szDevInstName, _In_ ULONG ulConfig, _In_ ULONG ulValue, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Set_HW_Prof_FlagsW (_In_ DEVINSTID_W szDevInstName, _In_ ULONG ulConfig, _In_ ULONG ulValue, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Set_HW_Prof_Flags_ExA (_In_ DEVINSTID_A szDevInstName, _In_ ULONG ulConfig, _In_ ULONG ulValue, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Set_HW_Prof_Flags_ExW (_In_ DEVINSTID_W szDevInstName, _In_ ULONG ulConfig, _In_ ULONG ulValue, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Setup_DevNode (_In_ DEVINST dnDevInst, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Setup_DevNode_Ex (_In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Test_Range_Available (_In_ DWORDLONG ullStartValue, _In_ DWORDLONG ullEndValue, _In_ RANGE_LIST rlh, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Uninstall_DevNode (_In_ DEVINST dnPhantom, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Uninstall_DevNode_Ex (_In_ DEVINST dnPhantom, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Unregister_Device_InterfaceA (_In_ LPCSTR pszDeviceInterface, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Unregister_Device_InterfaceW (_In_ LPCWSTR pszDeviceInterface, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Unregister_Device_Interface_ExA (_In_ LPCSTR pszDeviceInterface, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 
CONFIGRET WINAPI CM_Unregister_Device_Interface_ExW (_In_ LPCWSTR pszDeviceInterface, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
 

Variables

static const WCHAR Backslash [] = {'\\', 0}
 
static const WCHAR Class [] = {'C','l','a','s','s',0}
 
static const WCHAR ControlClass []
 
static const WCHAR DeviceClasses []
 

Macro Definition Documentation

◆ CONFLICT_MAGIC

#define CONFLICT_MAGIC   0x11225588

Definition at line 95 of file cfgmgr.c.

◆ LOG_CONF_MAGIC

#define LOG_CONF_MAGIC   0x464E434C /* "LCNF" */

Definition at line 60 of file cfgmgr.c.

◆ NOTIFY_MAGIC

#define NOTIFY_MAGIC   0x44556677

Definition at line 69 of file cfgmgr.c.

◆ RANGE_LIST_MAGIC

#define RANGE_LIST_MAGIC   0x33445566

Definition at line 87 of file cfgmgr.c.

Typedef Documentation

◆ CONFLICT_DATA

◆ INTERNAL_RANGE

◆ INTERNAL_RANGE_LIST

◆ LOG_CONF_INFO

◆ MACHINE_INFO

◆ NOTIFY_DATA

◆ PCONFLICT_DATA

◆ PINTERNAL_RANGE

◆ PINTERNAL_RANGE_LIST

◆ PLOG_CONF_INFO

◆ PMACHINE_INFO

◆ PNOTIFY_DATA

Function Documentation

◆ CM_Add_Empty_Log_Conf()

CONFIGRET WINAPI CM_Add_Empty_Log_Conf ( _Out_ PLOG_CONF  plcLogConf,
_In_ DEVINST  dnDevInst,
_In_ PRIORITY  Priority,
_In_ ULONG  ulFlags 
)

Definition at line 794 of file cfgmgr.c.

799 {
800  TRACE("CM_Add_Empty_Log_Conf(%p %p %lu %lx)\n",
801  plcLogConf, dnDevInst, Priority, ulFlags);
802 
803  return CM_Add_Empty_Log_Conf_Ex(plcLogConf, dnDevInst, Priority,
804  ulFlags, NULL);
805 }
_In_ KPRIORITY Priority
Definition: kefuncs.h:516
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
CONFIGRET WINAPI CM_Add_Empty_Log_Conf_Ex(_Out_ PLOG_CONF plcLogConf, _In_ DEVINST dnDevInst, _In_ PRIORITY Priority, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:812

◆ CM_Add_Empty_Log_Conf_Ex()

CONFIGRET WINAPI CM_Add_Empty_Log_Conf_Ex ( _Out_ PLOG_CONF  plcLogConf,
_In_ DEVINST  dnDevInst,
_In_ PRIORITY  Priority,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 812 of file cfgmgr.c.

818 {
820  HSTRING_TABLE StringTable = NULL;
821  ULONG ulLogConfTag = 0;
822  LPWSTR lpDevInst;
823  PLOG_CONF_INFO pLogConfInfo;
825 
826  FIXME("CM_Add_Empty_Log_Conf_Ex(%p %p %lu %lx %p)\n",
827  plcLogConf, dnDevInst, Priority, ulFlags, hMachine);
828 
829  if (!pSetupIsUserAdmin())
830  return CR_ACCESS_DENIED;
831 
832  if (plcLogConf == NULL)
833  return CR_INVALID_POINTER;
834 
835  if (dnDevInst == 0)
836  return CR_INVALID_DEVINST;
837 
838  if (Priority > 0xFFFF)
839  return CR_INVALID_PRIORITY;
840 
841  if (ulFlags & ~(LOG_CONF_BITS | PRIORITY_BIT))
842  return CR_INVALID_FLAG;
843 
844  if (hMachine != NULL)
845  {
846  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
847  if (BindingHandle == NULL)
848  return CR_FAILURE;
849 
850  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
851  if (StringTable == 0)
852  return CR_FAILURE;
853  }
854  else
855  {
856  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
857  return CR_FAILURE;
858  }
859 
860  lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
861  if (lpDevInst == NULL)
862  return CR_INVALID_DEVNODE;
863 
865  {
867  &ulLogConfTag, ulFlags);
868  }
870  {
872  }
873  RpcEndExcept;
874 
875  if (ret == CR_SUCCESS)
876  {
877  pLogConfInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(LOG_CONF_INFO));
878  if (pLogConfInfo == NULL)
879  {
881  }
882  else
883  {
884  pLogConfInfo->ulMagic = LOG_CONF_MAGIC;
885  pLogConfInfo->dnDevInst = dnDevInst;
886  pLogConfInfo->ulFlags = ulFlags;
887  pLogConfInfo->ulTag = ulLogConfTag;
888 
889  *plcLogConf = (LOG_CONF)pLogConfInfo;
890 
891  ret = CR_SUCCESS;
892  }
893  }
894 
895  return ret;
896 }
#define RpcEndExcept
Definition: rpc.h:128
#define CR_INVALID_DEVINST
Definition: cfgmgr32.h:848
ULONG ulMagic
Definition: cfgmgr.c:54
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
_In_ KPRIORITY Priority
Definition: kefuncs.h:516
struct _MACHINE_INFO * PMACHINE_INFO
#define PRIORITY_BIT
Definition: cfgmgr32.h:607
_In_ ULONG _Out_ HANDLE * BindingHandle
Definition: tdikrnl.h:1146
ULONG ulTag
Definition: cfgmgr.c:57
#define CR_ACCESS_DENIED
Definition: cfgmgr32.h:897
BOOL PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle, HSTRING_TABLE *StringTable)
Definition: rpc.c:66
#define FIXME(fmt,...)
Definition: debug.h:110
#define RpcTryExcept
Definition: rpc.h:126
#define CR_SUCCESS
Definition: cfgmgr32.h:842
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
DWORD_PTR LOG_CONF
Definition: cfgmgr32.h:90
smooth NULL
Definition: ftsmooth.c:416
#define CR_OUT_OF_MEMORY
Definition: cfgmgr32.h:844
DWORD WINAPI PNP_AddEmptyLogConf(handle_t hBinding, LPWSTR pDeviceID, DWORD ulPriority, DWORD *pulLogConfTag, DWORD ulFlags)
Definition: umpnpmgr.c:3185
#define RpcExceptionCode()
Definition: rpc.h:132
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define CR_FAILURE
Definition: cfgmgr32.h:865
int ret
#define CR_INVALID_DEVNODE
Definition: cfgmgr32.h:847
#define LOG_CONF_BITS
Definition: cfgmgr32.h:603
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:125
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
#define CR_INVALID_PRIORITY
Definition: cfgmgr32.h:885
unsigned int ULONG
Definition: retypes.h:1
#define LOG_CONF_MAGIC
Definition: cfgmgr.c:60
BOOL WINAPI pSetupIsUserAdmin(VOID)
Definition: misc.c:1817
WCHAR * LPWSTR
Definition: xmlstorage.h:184
DEVINST dnDevInst
Definition: cfgmgr.c:55
ULONG ulFlags
Definition: cfgmgr.c:56
LPWSTR WINAPI pSetupStringTableStringFromId(HSTRING_TABLE hStringTable, DWORD dwId)
Definition: stringtable.c:722
#define RpcExcept(expr)
Definition: rpc.h:127

Referenced by CM_Add_Empty_Log_Conf().

◆ CM_Add_ID_ExA()

CONFIGRET WINAPI CM_Add_ID_ExA ( _In_ DEVINST  dnDevInst,
_In_ PSTR  pszID,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 938 of file cfgmgr.c.

943 {
944  PWSTR pszIDW;
945  CONFIGRET ret;
946 
947  TRACE("CM_Add_ID_ExA(%p %s %lx %p)\n",
948  dnDevInst, debugstr_a(pszID), ulFlags, hMachine);
949 
950  if (pSetupCaptureAndConvertAnsiArg(pszID, &pszIDW))
951  return CR_INVALID_DATA;
952 
953  ret = CM_Add_ID_ExW(dnDevInst, pszIDW, ulFlags, hMachine);
954 
955  MyFree(pszIDW);
956 
957  return ret;
958 }
uint16_t * PWSTR
Definition: typedefs.h:54
DWORD WINAPI pSetupCaptureAndConvertAnsiArg(LPCSTR pSrc, LPWSTR *pDst)
Definition: misc.c:574
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
#define CR_INVALID_DATA
Definition: cfgmgr32.h:877
int ret
CONFIGRET WINAPI CM_Add_ID_ExW(_In_ DEVINST dnDevInst, _In_ PWSTR pszID, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:966
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
VOID WINAPI MyFree(LPVOID lpMem)
Definition: misc.c:128

Referenced by CM_Add_IDA().

◆ CM_Add_ID_ExW()

CONFIGRET WINAPI CM_Add_ID_ExW ( _In_ DEVINST  dnDevInst,
_In_ PWSTR  pszID,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 966 of file cfgmgr.c.

971 {
973  HSTRING_TABLE StringTable = NULL;
974  LPWSTR lpDevInst;
975  CONFIGRET ret;
976 
977  TRACE("CM_Add_ID_ExW(%p %s %lx %p)\n",
978  dnDevInst, debugstr_w(pszID), ulFlags, hMachine);
979 
980  if (!pSetupIsUserAdmin())
981  return CR_ACCESS_DENIED;
982 
983  if (dnDevInst == 0)
984  return CR_INVALID_DEVINST;
985 
986  if (pszID == NULL)
987  return CR_INVALID_POINTER;
988 
989  if (ulFlags & ~CM_ADD_ID_BITS)
990  return CR_INVALID_FLAG;
991 
992  if (hMachine != NULL)
993  {
994  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
995  if (BindingHandle == NULL)
996  return CR_FAILURE;
997 
998  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
999  if (StringTable == 0)
1000  return CR_FAILURE;
1001  }
1002  else
1003  {
1004  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
1005  return CR_FAILURE;
1006  }
1007 
1008  lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
1009  if (lpDevInst == NULL)
1010  return CR_INVALID_DEVNODE;
1011 
1012  RpcTryExcept
1013  {
1015  lpDevInst,
1016  pszID,
1017  ulFlags);
1018  }
1020  {
1022  }
1023  RpcEndExcept;
1024 
1025  return ret;
1026 }
#define CM_ADD_ID_BITS
Definition: cfgmgr32.h:616
#define RpcEndExcept
Definition: rpc.h:128
#define CR_INVALID_DEVINST
Definition: cfgmgr32.h:848
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
struct _MACHINE_INFO * PMACHINE_INFO
_In_ ULONG _Out_ HANDLE * BindingHandle
Definition: tdikrnl.h:1146
#define CR_ACCESS_DENIED
Definition: cfgmgr32.h:897
BOOL PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle, HSTRING_TABLE *StringTable)
Definition: rpc.c:66
#define debugstr_w
Definition: kernel32.h:32
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define CR_FAILURE
Definition: cfgmgr32.h:865
int ret
#define CR_INVALID_DEVNODE
Definition: cfgmgr32.h:847
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:125
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
BOOL WINAPI pSetupIsUserAdmin(VOID)
Definition: misc.c:1817
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LPWSTR WINAPI pSetupStringTableStringFromId(HSTRING_TABLE hStringTable, DWORD dwId)
Definition: stringtable.c:722
DWORD WINAPI PNP_AddID(handle_t hBinding, LPWSTR pszDeviceID, LPWSTR pszID, DWORD ulFlags)
Definition: umpnpmgr.c:2749
#define RpcExcept(expr)
Definition: rpc.h:127

Referenced by CM_Add_ID_ExA(), and CM_Add_IDW().

◆ CM_Add_IDA()

CONFIGRET WINAPI CM_Add_IDA ( _In_ DEVINST  dnDevInst,
_In_ PSTR  pszID,
_In_ ULONG  ulFlags 
)

Definition at line 904 of file cfgmgr.c.

908 {
909  TRACE("CM_Add_IDA(%p %s %lx)\n",
910  dnDevInst, debugstr_a(pszID), ulFlags);
911 
912  return CM_Add_ID_ExA(dnDevInst, pszID, ulFlags, NULL);
913 }
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
CONFIGRET WINAPI CM_Add_ID_ExA(_In_ DEVINST dnDevInst, _In_ PSTR pszID, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:938

◆ CM_Add_IDW()

CONFIGRET WINAPI CM_Add_IDW ( _In_ DEVINST  dnDevInst,
_In_ PWSTR  pszID,
_In_ ULONG  ulFlags 
)

Definition at line 921 of file cfgmgr.c.

925 {
926  TRACE("CM_Add_IDW(%p %s %lx)\n",
927  dnDevInst, debugstr_w(pszID), ulFlags);
928 
929  return CM_Add_ID_ExW(dnDevInst, pszID, ulFlags, NULL);
930 }
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
CONFIGRET WINAPI CM_Add_ID_ExW(_In_ DEVINST dnDevInst, _In_ PWSTR pszID, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:966

◆ CM_Add_Range()

CONFIGRET WINAPI CM_Add_Range ( _In_ DWORDLONG  ullStartValue,
_In_ DWORDLONG  ullEndValue,
_In_ RANGE_LIST  rlh,
_In_ ULONG  ulFlags 
)

Definition at line 1034 of file cfgmgr.c.

1039 {
1040  PINTERNAL_RANGE_LIST pRangeList;
1041  PINTERNAL_RANGE pRange;
1043 
1044  FIXME("CM_Add_Range(%I64u %I64u %p %lx)\n",
1045  ullStartValue, ullEndValue, rlh, ulFlags);
1046 
1047  pRangeList = (PINTERNAL_RANGE_LIST)rlh;
1048 
1049  if (!IsValidRangeList(pRangeList))
1050  return CR_INVALID_RANGE_LIST;
1051 
1052  if (ulFlags & ~CM_ADD_RANGE_BITS)
1053  return CR_INVALID_FLAG;
1054 
1055  if (ullEndValue < ullStartValue)
1056  return CR_INVALID_RANGE;
1057 
1058  /* Lock the range list */
1059  WaitForSingleObject(pRangeList->hMutex, INFINITE);
1060 
1061  /* Allocate the new range */
1062  pRange = HeapAlloc(GetProcessHeap(), 0, sizeof(INTERNAL_RANGE));
1063  if (pRange == NULL)
1064  {
1066  goto done;
1067  }
1068 
1069  pRange->pRangeList = pRangeList;
1070  pRange->ullStart = ullStartValue;
1071  pRange->ullEnd = ullEndValue;
1072 
1073  /* Insert the range */
1074  if (IsListEmpty(&pRangeList->ListHead))
1075  {
1076  InsertTailList(&pRangeList->ListHead, &pRange->ListEntry);
1077  }
1078  else
1079  {
1080  HeapFree(GetProcessHeap(), 0, pRange);
1081  UNIMPLEMENTED;
1082  }
1083 
1084 done:
1085  /* Unlock the range list */
1086  ReleaseMutex(pRangeList->hMutex);
1087 
1088  return ret;
1089 }
#define CR_INVALID_RANGE
Definition: cfgmgr32.h:864
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
BOOL IsValidRangeList(_In_opt_ PINTERNAL_RANGE_LIST pRangeList)
Definition: cfgmgr.c:354
struct _INTERNAL_RANGE_LIST * pRangeList
Definition: cfgmgr.c:75
#define InsertTailList(ListHead, Entry)
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define FIXME(fmt,...)
Definition: debug.h:110
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
struct _INTERNAL_RANGE_LIST * PINTERNAL_RANGE_LIST
#define CR_OUT_OF_MEMORY
Definition: cfgmgr32.h:844
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
DWORDLONG ullStart
Definition: cfgmgr.c:76
LIST_ENTRY ListEntry
Definition: cfgmgr.c:74
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseMutex(IN HANDLE hMutex)
Definition: synch.c:564
int ret
DWORDLONG ullEnd
Definition: cfgmgr.c:77
#define CR_INVALID_RANGE_LIST
Definition: cfgmgr32.h:863
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
LIST_ENTRY ListHead
Definition: cfgmgr.c:84
#define UNIMPLEMENTED
Definition: debug.h:114
#define INFINITE
Definition: serial.h:102
#define CM_ADD_RANGE_BITS
Definition: cfgmgr32.h:594
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ CM_Add_Res_Des()

CONFIGRET WINAPI CM_Add_Res_Des ( _Out_opt_ PRES_DES  prdResDes,
_In_ LOG_CONF  lcLogConf,
_In_ RESOURCEID  ResourceID,
_In_reads_bytes_(ResourceLen) PCVOID  ResourceData,
_In_ ULONG  ResourceLen,
_In_ ULONG  ulFlags 
)

Definition at line 1097 of file cfgmgr.c.

1104 {
1105  TRACE("CM_Add_Res_Des(%p %p %lu %p %lu %lx)\n",
1106  prdResDes, lcLogConf, ResourceID, ResourceData, ResourceLen, ulFlags);
1107 
1108  return CM_Add_Res_Des_Ex(prdResDes, lcLogConf, ResourceID, ResourceData,
1109  ResourceLen, ulFlags, NULL);
1110 }
CONFIGRET WINAPI CM_Add_Res_Des_Ex(_Out_opt_ PRES_DES prdResDes, _In_ LOG_CONF lcLogConf, _In_ RESOURCEID ResourceID, _In_reads_bytes_(ResourceLen) PCVOID ResourceData, _In_ ULONG ResourceLen, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:1118
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4

◆ CM_Add_Res_Des_Ex()

CONFIGRET WINAPI CM_Add_Res_Des_Ex ( _Out_opt_ PRES_DES  prdResDes,
_In_ LOG_CONF  lcLogConf,
_In_ RESOURCEID  ResourceID,
_In_reads_bytes_(ResourceLen) PCVOID  ResourceData,
_In_ ULONG  ResourceLen,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 1118 of file cfgmgr.c.

1126 {
1127  FIXME("CM_Add_Res_Des_Ex(%p %p %lu %p %lu %lx %p)\n",
1128  prdResDes, lcLogConf, ResourceID,
1129  ResourceData, ResourceLen, ulFlags, hMachine);
1130 
1131  return CR_CALL_NOT_IMPLEMENTED;
1132 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898

Referenced by CM_Add_Res_Des().

◆ CM_Connect_MachineA()

CONFIGRET WINAPI CM_Connect_MachineA ( _In_opt_ PCSTR  UNCServerName,
_Out_ PHMACHINE  phMachine 
)

Definition at line 1140 of file cfgmgr.c.

1143 {
1144  PWSTR pServerNameW;
1145  CONFIGRET ret;
1146 
1147  TRACE("CM_Connect_MachineA(%s %p)\n",
1148  debugstr_a(UNCServerName), phMachine);
1149 
1150  if (UNCServerName == NULL || *UNCServerName == 0)
1151  return CM_Connect_MachineW(NULL, phMachine);
1152 
1153  if (pSetupCaptureAndConvertAnsiArg(UNCServerName, &pServerNameW))
1154  return CR_INVALID_DATA;
1155 
1156  ret = CM_Connect_MachineW(pServerNameW, phMachine);
1157 
1158  MyFree(pServerNameW);
1159 
1160  return ret;
1161 }
uint16_t * PWSTR
Definition: typedefs.h:54
DWORD WINAPI pSetupCaptureAndConvertAnsiArg(LPCSTR pSrc, LPWSTR *pDst)
Definition: misc.c:574
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
CONFIGRET WINAPI CM_Connect_MachineW(_In_opt_ PCWSTR UNCServerName, _Out_ PHMACHINE phMachine)
Definition: cfgmgr.c:1169
#define CR_INVALID_DATA
Definition: cfgmgr32.h:877
int ret
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
VOID WINAPI MyFree(LPVOID lpMem)
Definition: misc.c:128

◆ CM_Connect_MachineW()

CONFIGRET WINAPI CM_Connect_MachineW ( _In_opt_ PCWSTR  UNCServerName,
_Out_ PHMACHINE  phMachine 
)

Definition at line 1169 of file cfgmgr.c.

1172 {
1173  PMACHINE_INFO pMachine;
1174 
1175  TRACE("CM_Connect_MachineW(%s %p)\n",
1176  debugstr_w(UNCServerName), phMachine);
1177 
1178  if (phMachine == NULL)
1179  return CR_INVALID_POINTER;
1180 
1181  *phMachine = NULL;
1182 
1183  pMachine = HeapAlloc(GetProcessHeap(), 0, sizeof(MACHINE_INFO));
1184  if (pMachine == NULL)
1185  return CR_OUT_OF_MEMORY;
1186 
1187  if (UNCServerName == NULL || *UNCServerName == 0)
1188  {
1189  pMachine->bLocal = TRUE;
1190 
1191  /* FIXME: store the computers name in pMachine->szMachineName */
1192 
1193  if (!PnpGetLocalHandles(&pMachine->BindingHandle,
1194  &pMachine->StringTable))
1195  {
1196  HeapFree(GetProcessHeap(), 0, pMachine);
1197  return CR_FAILURE;
1198  }
1199  }
1200  else
1201  {
1202  pMachine->bLocal = FALSE;
1203  if (wcslen(UNCServerName) >= SP_MAX_MACHINENAME_LENGTH - 1)
1204  {
1205  HeapFree(GetProcessHeap(), 0, pMachine);
1206  return CR_INVALID_MACHINENAME;
1207  }
1208  lstrcpyW(pMachine->szMachineName, UNCServerName);
1209 
1211  if (pMachine->StringTable == NULL)
1212  {
1213  HeapFree(GetProcessHeap(), 0, pMachine);
1214  return CR_FAILURE;
1215  }
1216 
1217  pSetupStringTableAddString(pMachine->StringTable, L"PLT", 1);
1218 
1219  if (!PnpBindRpc(UNCServerName, &pMachine->BindingHandle))
1220  {
1222  HeapFree(GetProcessHeap(), 0, pMachine);
1223  return CR_INVALID_MACHINENAME;
1224  }
1225  }
1226 
1227  *phMachine = (PHMACHINE)pMachine;
1228 
1229  return CR_SUCCESS;
1230 }
#define SP_MAX_MACHINENAME_LENGTH
Definition: setupapi.h:27
#define TRUE
Definition: types.h:120
HSTRING_TABLE WINAPI pSetupStringTableInitialize(VOID)
Definition: stringtable.c:54
RPC_STATUS PnpBindRpc(LPCWSTR pszMachine, RPC_BINDING_HANDLE *BindingHandle)
Definition: rpc.c:28
BOOL PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle, HSTRING_TABLE *StringTable)
Definition: rpc.c:66
#define debugstr_w
Definition: kernel32.h:32
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
RPC_BINDING_HANDLE BindingHandle
Definition: cfgmgr.c:46
#define CR_OUT_OF_MEMORY
Definition: cfgmgr32.h:844
DWORD WINAPI pSetupStringTableAddString(HSTRING_TABLE hStringTable, LPWSTR lpString, DWORD dwFlags)
Definition: stringtable.c:196
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
WCHAR szMachineName[SP_MAX_MACHINENAME_LENGTH]
Definition: cfgmgr.c:45
#define CR_FAILURE
Definition: cfgmgr32.h:865
static const WCHAR L[]
Definition: oid.c:1250
#define CR_INVALID_MACHINENAME
Definition: cfgmgr32.h:893
HMACHINE * PHMACHINE
Definition: cfgmgr32.h:109
VOID WINAPI pSetupStringTableDestroy(HSTRING_TABLE hStringTable)
Definition: stringtable.c:145
#define lstrcpyW
Definition: compat.h:406
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
BOOL bLocal
Definition: cfgmgr.c:48
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define HeapFree(x, y, z)
Definition: compat.h:394
HSTRING_TABLE StringTable
Definition: cfgmgr.c:47

Referenced by CM_Connect_MachineA(), and SetupDiCreateDeviceInfoListExW().

◆ CM_Create_DevNode_ExA()

CONFIGRET WINAPI CM_Create_DevNode_ExA ( _Out_ PDEVINST  pdnDevInst,
_In_ DEVINSTID_A  pDeviceID,
_In_ DEVINST  dnParent,
_In_ ULONG  ulFlags,
_In_opt_ HANDLE  hMachine 
)

Definition at line 1276 of file cfgmgr.c.

1282 {
1283  DEVINSTID_W pDeviceIDW;
1284  CONFIGRET ret;
1285 
1286  TRACE("CM_Create_DevNode_ExA(%p %s %p %lx %p)\n",
1287  pdnDevInst, debugstr_a(pDeviceID), dnParent, ulFlags, hMachine);
1288 
1289  if (pSetupCaptureAndConvertAnsiArg(pDeviceID, &pDeviceIDW))
1290  return CR_INVALID_DATA;
1291 
1292  ret = CM_Create_DevNode_ExW(pdnDevInst, pDeviceIDW, dnParent, ulFlags,
1293  hMachine);
1294 
1295  MyFree(pDeviceIDW);
1296 
1297  return ret;
1298 }
_Null_terminated_ WCHAR * DEVINSTID_W
Definition: cfgmgr32.h:80
DWORD WINAPI pSetupCaptureAndConvertAnsiArg(LPCSTR pSrc, LPWSTR *pDst)
Definition: misc.c:574
CONFIGRET WINAPI CM_Create_DevNode_ExW(_Out_ PDEVINST pdnDevInst, _In_ DEVINSTID_W pDeviceID, _In_ DEVINST dnParent, _In_ ULONG ulFlags, _In_opt_ HANDLE hMachine)
Definition: cfgmgr.c:1306
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
#define CR_INVALID_DATA
Definition: cfgmgr32.h:877
int ret
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
VOID WINAPI MyFree(LPVOID lpMem)
Definition: misc.c:128

Referenced by CM_Create_DevNodeA().

◆ CM_Create_DevNode_ExW()

CONFIGRET WINAPI CM_Create_DevNode_ExW ( _Out_ PDEVINST  pdnDevInst,
_In_ DEVINSTID_W  pDeviceID,
_In_ DEVINST  dnParent,
_In_ ULONG  ulFlags,
_In_opt_ HANDLE  hMachine 
)

Definition at line 1306 of file cfgmgr.c.

1312 {
1314  HSTRING_TABLE StringTable = NULL;
1315  LPWSTR lpParentDevInst;
1317  WCHAR szLocalDeviceID[MAX_DEVICE_ID_LEN];
1318 
1319  TRACE("CM_Create_DevNode_ExW(%p %s %p %lx %p)\n",
1320  pdnDevInst, debugstr_w(pDeviceID), dnParent, ulFlags, hMachine);
1321 
1322  if (!pSetupIsUserAdmin())
1323  return CR_ACCESS_DENIED;
1324 
1325  if (pdnDevInst == NULL)
1326  return CR_INVALID_POINTER;
1327 
1328  if (pDeviceID == NULL || wcslen(pDeviceID) == 0 || wcslen(pDeviceID) >= MAX_DEVICE_ID_LEN)
1329  return CR_INVALID_DEVICE_ID;
1330 
1331  if (dnParent == 0)
1332  return CR_INVALID_DEVNODE;
1333 
1334  if (ulFlags & ~CM_CREATE_DEVNODE_BITS)
1335  return CR_INVALID_FLAG;
1336 
1337  if (hMachine != NULL)
1338  {
1339  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1340  if (BindingHandle == NULL)
1341  return CR_FAILURE;
1342 
1343  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
1344  if (StringTable == 0)
1345  return CR_FAILURE;
1346  }
1347  else
1348  {
1349  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
1350  return CR_FAILURE;
1351  }
1352 
1353  lpParentDevInst = pSetupStringTableStringFromId(StringTable, dnParent);
1354  if (lpParentDevInst == NULL)
1355  return CR_INVALID_DEVNODE;
1356 
1357  wcscpy(szLocalDeviceID, pDeviceID);
1358 
1359  RpcTryExcept
1360  {
1362  szLocalDeviceID,
1363  lpParentDevInst,
1365  ulFlags);
1366  }
1368  {
1370  }
1371  RpcEndExcept;
1372 
1373  if (ret == CR_SUCCESS)
1374  {
1375  /* If CM_CREATE_DEVINST_GENERATE_ID was passed in, PNP_CreateDevInst
1376  * will return the generated device ID in szLocalDeviceID */
1377  *pdnDevInst = pSetupStringTableAddString(StringTable, szLocalDeviceID, 1);
1378  if (*pdnDevInst == 0)
1380  }
1381 
1382  return ret;
1383 }
#define RpcEndExcept
Definition: rpc.h:128
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
struct _MACHINE_INFO * PMACHINE_INFO
#define MAX_DEVICE_ID_LEN
Definition: pnpmgr.c:28
_In_ ULONG _Out_ HANDLE * BindingHandle
Definition: tdikrnl.h:1146
#define CR_ACCESS_DENIED
Definition: cfgmgr32.h:897
#define CR_INVALID_DEVICE_ID
Definition: cfgmgr32.h:876
BOOL PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle, HSTRING_TABLE *StringTable)
Definition: rpc.c:66
#define debugstr_w
Definition: kernel32.h:32
#define RpcTryExcept
Definition: rpc.h:126
#define CR_SUCCESS
Definition: cfgmgr32.h:842
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define CM_CREATE_DEVNODE_BITS
Definition: cfgmgr32.h:624
#define RpcExceptionCode()
Definition: rpc.h:132
DWORD WINAPI pSetupStringTableAddString(HSTRING_TABLE hStringTable, LPWSTR lpString, DWORD dwFlags)
Definition: stringtable.c:196
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define CR_FAILURE
Definition: cfgmgr32.h:865
int ret
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define CR_INVALID_DEVNODE
Definition: cfgmgr32.h:847
DWORD WINAPI PNP_CreateDevInst(handle_t hBinding, LPWSTR pszDeviceID, LPWSTR pszParentDeviceID, PNP_RPC_STRING_LEN ulLength, DWORD ulFlags)
Definition: umpnpmgr.c:2432
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:125
#define CR_NO_SUCH_DEVNODE
Definition: cfgmgr32.h:857
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
BOOL WINAPI pSetupIsUserAdmin(VOID)
Definition: misc.c:1817
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LPWSTR WINAPI pSetupStringTableStringFromId(HSTRING_TABLE hStringTable, DWORD dwId)
Definition: stringtable.c:722
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define RpcExcept(expr)
Definition: rpc.h:127

Referenced by CM_Create_DevNode_ExA(), and CM_Create_DevNodeW().

◆ CM_Create_DevNodeA()

CONFIGRET WINAPI CM_Create_DevNodeA ( _Out_ PDEVINST  pdnDevInst,
_In_ DEVINSTID_A  pDeviceID,
_In_ DEVINST  dnParent,
_In_ ULONG  ulFlags 
)

Definition at line 1238 of file cfgmgr.c.

1243 {
1244  TRACE("CM_Create_DevNodeA(%p %s %p %lx)\n",
1245  pdnDevInst, debugstr_a(pDeviceID), dnParent, ulFlags);
1246 
1247  return CM_Create_DevNode_ExA(pdnDevInst, pDeviceID, dnParent,
1248  ulFlags, NULL);
1249 }
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
CONFIGRET WINAPI CM_Create_DevNode_ExA(_Out_ PDEVINST pdnDevInst, _In_ DEVINSTID_A pDeviceID, _In_ DEVINST dnParent, _In_ ULONG ulFlags, _In_opt_ HANDLE hMachine)
Definition: cfgmgr.c:1276

◆ CM_Create_DevNodeW()

CONFIGRET WINAPI CM_Create_DevNodeW ( _Out_ PDEVINST  pdnDevInst,
_In_ DEVINSTID_W  pDeviceID,
_In_ DEVINST  dnParent,
_In_ ULONG  ulFlags 
)

Definition at line 1257 of file cfgmgr.c.

1262 {
1263  TRACE("CM_Create_DevNodeW(%p %s %p %lx)\n",
1264  pdnDevInst, debugstr_w(pDeviceID), dnParent, ulFlags);
1265 
1266  return CM_Create_DevNode_ExW(pdnDevInst, pDeviceID, dnParent,
1267  ulFlags, NULL);
1268 }
CONFIGRET WINAPI CM_Create_DevNode_ExW(_Out_ PDEVINST pdnDevInst, _In_ DEVINSTID_W pDeviceID, _In_ DEVINST dnParent, _In_ ULONG ulFlags, _In_opt_ HANDLE hMachine)
Definition: cfgmgr.c:1306
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4

◆ CM_Create_Range_List()

CONFIGRET WINAPI CM_Create_Range_List ( _Out_ PRANGE_LIST  prlh,
_In_ ULONG  ulFlags 
)

Definition at line 1391 of file cfgmgr.c.

1394 {
1395  PINTERNAL_RANGE_LIST pRangeList = NULL;
1396 
1397  FIXME("CM_Create_Range_List(%p %lx)\n",
1398  prlh, ulFlags);
1399 
1400  if (ulFlags != 0)
1401  return CR_INVALID_FLAG;
1402 
1403  if (prlh == NULL)
1404  return CR_INVALID_POINTER;
1405 
1406  /* Allocate the range list */
1408  if (pRangeList == NULL)
1409  return CR_OUT_OF_MEMORY;
1410 
1411  /* Set the magic value */
1412  pRangeList->ulMagic = RANGE_LIST_MAGIC;
1413 
1414  /* Initialize the mutex for synchonized access */
1415  pRangeList->hMutex = CreateMutex(NULL, FALSE, NULL);
1416  if (pRangeList->hMutex == NULL)
1417  {
1418  HeapFree(GetProcessHeap(), 0, pRangeList);
1419  return CR_FAILURE;
1420  }
1421 
1422  InitializeListHead(&pRangeList->ListHead);
1423 
1424  *prlh = (RANGE_LIST)pRangeList;
1425 
1426  return CR_SUCCESS;
1427 }
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
#define FIXME(fmt,...)
Definition: debug.h:110
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
#define CR_OUT_OF_MEMORY
Definition: cfgmgr32.h:844
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define CreateMutex
Definition: winbase.h:3570
#define CR_FAILURE
Definition: cfgmgr32.h:865
#define RANGE_LIST_MAGIC
Definition: cfgmgr.c:87
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
LIST_ENTRY ListHead
Definition: cfgmgr.c:84
DWORD_PTR RANGE_LIST
Definition: cfgmgr32.h:102
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ CM_Delete_Class_Key()

CONFIGRET WINAPI CM_Delete_Class_Key ( _In_ LPGUID  ClassGuid,
_In_ ULONG  ulFlags 
)

Definition at line 1435 of file cfgmgr.c.

1438 {
1439  TRACE("CM_Delete_Class_Key(%p %lx)\n",
1440  ClassGuid, ulFlags);
1441 
1442  return CM_Delete_Class_Key_Ex(ClassGuid, ulFlags, NULL);
1443 }
CONFIGRET WINAPI CM_Delete_Class_Key_Ex(_In_ LPGUID ClassGuid, _In_ ULONG ulFlags, _In_opt_ HANDLE hMachine)
Definition: cfgmgr.c:1451
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4

◆ CM_Delete_Class_Key_Ex()

CONFIGRET WINAPI CM_Delete_Class_Key_Ex ( _In_ LPGUID  ClassGuid,
_In_ ULONG  ulFlags,
_In_opt_ HANDLE  hMachine 
)

Definition at line 1451 of file cfgmgr.c.

1455 {
1456  WCHAR szGuidString[MAX_GUID_STRING_LEN];
1458  CONFIGRET ret;
1459 
1460  TRACE("CM_Delete_Class_Key_Ex(%p %lx %p)\n",
1461  ClassGuid, ulFlags, hMachine);
1462 
1463  if (ClassGuid == NULL)
1464  return CR_INVALID_POINTER;
1465 
1466  if (ulFlags & ~CM_DELETE_CLASS_BITS)
1467  return CR_INVALID_FLAG;
1468 
1469  if (!GuidToString(ClassGuid, szGuidString))
1470  return CR_INVALID_DATA;
1471 
1472  if (hMachine != NULL)
1473  {
1474  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1475  if (BindingHandle == NULL)
1476  return CR_FAILURE;
1477  }
1478  else
1479  {
1481  return CR_FAILURE;
1482  }
1483 
1484  RpcTryExcept
1485  {
1487  szGuidString,
1488  ulFlags);
1489  }
1491  {
1493  }
1494  RpcEndExcept;
1495 
1496  return ret;
1497 }
#define RpcEndExcept
Definition: rpc.h:128
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
struct _MACHINE_INFO * PMACHINE_INFO
_In_ ULONG _Out_ HANDLE * BindingHandle
Definition: tdikrnl.h:1146
BOOL PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle, HSTRING_TABLE *StringTable)
Definition: rpc.c:66
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define CM_DELETE_CLASS_BITS
Definition: cfgmgr32.h:639
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_GUID_STRING_LEN
Definition: apphelp.c:29
#define CR_FAILURE
Definition: cfgmgr32.h:865
DWORD WINAPI PNP_DeleteClassKey(handle_t hBinding, LPWSTR pszClassGuid, DWORD ulFlags)
Definition: umpnpmgr.c:1936
#define CR_INVALID_DATA
Definition: cfgmgr32.h:877
int ret
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:125
static BOOL GuidToString(_In_ LPGUID Guid, _Out_ LPWSTR String)
Definition: cfgmgr.c:102
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
#define RpcExcept(expr)
Definition: rpc.h:127

Referenced by CM_Delete_Class_Key().

◆ CM_Delete_DevNode_Key()

CONFIGRET WINAPI CM_Delete_DevNode_Key ( _In_ DEVNODE  dnDevNode,
_In_ ULONG  ulHardwareProfile,
_In_ ULONG  ulFlags 
)

Definition at line 1505 of file cfgmgr.c.

1509 {
1510  TRACE("CM_Delete_DevNode_Key(%p %lu %lx)\n",
1511  dnDevNode, ulHardwareProfile, ulFlags);
1512 
1513  return CM_Delete_DevNode_Key_Ex(dnDevNode, ulHardwareProfile, ulFlags,
1514  NULL);
1515 }
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
CONFIGRET WINAPI CM_Delete_DevNode_Key_Ex(_In_ DEVNODE dnDevNode, _In_ ULONG ulHardwareProfile, _In_ ULONG ulFlags, _In_opt_ HANDLE hMachine)
Definition: cfgmgr.c:1523

◆ CM_Delete_DevNode_Key_Ex()

CONFIGRET WINAPI CM_Delete_DevNode_Key_Ex ( _In_ DEVNODE  dnDevNode,
_In_ ULONG  ulHardwareProfile,
_In_ ULONG  ulFlags,
_In_opt_ HANDLE  hMachine 
)

Definition at line 1523 of file cfgmgr.c.

1528 {
1529  FIXME("CM_Delete_DevNode_Key_Ex(%p %lu %lx %p)\n",
1530  dnDevNode, ulHardwareProfile, ulFlags, hMachine);
1531 
1532  return CR_CALL_NOT_IMPLEMENTED;
1533 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898

Referenced by CM_Delete_DevNode_Key().

◆ CM_Delete_Range()

CONFIGRET WINAPI CM_Delete_Range ( _In_ DWORDLONG  ullStartValue,
_In_ DWORDLONG  ullEndValue,
_In_ RANGE_LIST  rlh,
_In_ ULONG  ulFlags 
)

Definition at line 1541 of file cfgmgr.c.

1546 {
1547  FIXME("CM_Delete_Range(%I64u %I64u %p %lx)\n",
1548  ullStartValue, ullEndValue, rlh, ulFlags);
1549 
1550  return CR_CALL_NOT_IMPLEMENTED;
1551 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898

◆ CM_Detect_Resource_Conflict()

CONFIGRET WINAPI CM_Detect_Resource_Conflict ( _In_ DEVINST  dnDevInst,
_In_ RESOURCEID  ResourceID,
_In_reads_bytes_(ResourceLen) PCVOID  ResourceData,
_In_ ULONG  ResourceLen,
_Out_ PBOOL  pbConflictDetected,
_In_ ULONG  ulFlags 
)

Definition at line 1559 of file cfgmgr.c.

1566 {
1567  TRACE("CM_Detect_Resource_Conflict(%p %lu %p %lu %p 0x%lx)\n",
1568  dnDevInst, ResourceID, ResourceData, ResourceLen,
1569  pbConflictDetected, ulFlags);
1570 
1571  return CM_Detect_Resource_Conflict_Ex(dnDevInst,
1572  ResourceID,
1573  ResourceData,
1574  ResourceLen,
1575  pbConflictDetected,
1576  ulFlags,
1577  NULL);
1578 }
smooth NULL
Definition: ftsmooth.c:416
CONFIGRET WINAPI CM_Detect_Resource_Conflict_Ex(_In_ DEVINST dnDevInst, _In_ RESOURCEID ResourceID, _In_reads_bytes_(ResourceLen) PCVOID ResourceData, _In_ ULONG ResourceLen, _Out_ PBOOL pbConflictDetected, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:1586
#define TRACE(s)
Definition: solgame.cpp:4

◆ CM_Detect_Resource_Conflict_Ex()

CONFIGRET WINAPI CM_Detect_Resource_Conflict_Ex ( _In_ DEVINST  dnDevInst,
_In_ RESOURCEID  ResourceID,
_In_reads_bytes_(ResourceLen) PCVOID  ResourceData,
_In_ ULONG  ResourceLen,
_Out_ PBOOL  pbConflictDetected,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 1586 of file cfgmgr.c.

1594 {
1595  FIXME("CM_Detect_Resource_Conflict_Ex(%p %lu %p %lu %p 0x%lx %p)\n",
1596  dnDevInst, ResourceID, ResourceData, ResourceLen,
1597  pbConflictDetected, ulFlags, hMachine);
1598 
1599  return CR_CALL_NOT_IMPLEMENTED;
1600 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898

Referenced by CM_Detect_Resource_Conflict().

◆ CM_Disable_DevNode()

CONFIGRET WINAPI CM_Disable_DevNode ( _In_ DEVINST  dnDevInst,
_In_ ULONG  ulFlags 
)

Definition at line 1608 of file cfgmgr.c.

1611 {
1612  TRACE("CM_Disable_DevNode(%p %lx)\n",
1613  dnDevInst, ulFlags);
1614 
1615  return CM_Disable_DevNode_Ex(dnDevInst, ulFlags, NULL);
1616 }
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
CONFIGRET WINAPI CM_Disable_DevNode_Ex(_In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:1624

◆ CM_Disable_DevNode_Ex()

CONFIGRET WINAPI CM_Disable_DevNode_Ex ( _In_ DEVINST  dnDevInst,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 1624 of file cfgmgr.c.

1628 {
1630  HSTRING_TABLE StringTable = NULL;
1631  LPWSTR lpDevInst;
1632  CONFIGRET ret;
1633 
1634  FIXME("CM_Disable_DevNode_Ex(%p %lx %p)\n",
1635  dnDevInst, ulFlags, hMachine);
1636 
1637  if (!pSetupIsUserAdmin())
1638  return CR_ACCESS_DENIED;
1639 
1640  if (dnDevInst == 0)
1641  return CR_INVALID_DEVINST;
1642 
1643  if (ulFlags != 0)
1644  return CR_INVALID_FLAG;
1645 
1646  if (hMachine != NULL)
1647  {
1648  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1649  if (BindingHandle == NULL)
1650  return CR_FAILURE;
1651 
1652  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
1653  if (StringTable == 0)
1654  return CR_FAILURE;
1655  }
1656  else
1657  {
1658  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
1659  return CR_FAILURE;
1660  }
1661 
1662  lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
1663  if (lpDevInst == NULL)
1664  return CR_INVALID_DEVNODE;
1665 
1666  RpcTryExcept
1667  {
1669  PNP_DEVINST_DISABLE,
1670  ulFlags,
1671  lpDevInst,
1672  NULL);
1673  }
1675  {
1677  }
1678  RpcEndExcept;
1679 
1680  return ret;
1681 }
#define RpcEndExcept
Definition: rpc.h:128
#define CR_INVALID_DEVINST
Definition: cfgmgr32.h:848
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
struct _MACHINE_INFO * PMACHINE_INFO
_In_ ULONG _Out_ HANDLE * BindingHandle
Definition: tdikrnl.h:1146
#define CR_ACCESS_DENIED
Definition: cfgmgr32.h:897
BOOL PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle, HSTRING_TABLE *StringTable)
Definition: rpc.c:66
#define FIXME(fmt,...)
Definition: debug.h:110
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
#define CR_FAILURE
Definition: cfgmgr32.h:865
DWORD WINAPI PNP_DeviceInstanceAction(handle_t hBinding, DWORD ulAction, DWORD ulFlags, LPWSTR pszDeviceInstance1, LPWSTR pszDeviceInstance2)
Definition: umpnpmgr.c:2571
int ret
#define CR_INVALID_DEVNODE
Definition: cfgmgr32.h:847
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:125
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
BOOL WINAPI pSetupIsUserAdmin(VOID)
Definition: misc.c:1817
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LPWSTR WINAPI pSetupStringTableStringFromId(HSTRING_TABLE hStringTable, DWORD dwId)
Definition: stringtable.c:722
#define RpcExcept(expr)
Definition: rpc.h:127

Referenced by CM_Disable_DevNode().

◆ CM_Disconnect_Machine()

CONFIGRET WINAPI CM_Disconnect_Machine ( _In_opt_ HMACHINE  hMachine)

Definition at line 1689 of file cfgmgr.c.

1691 {
1692  PMACHINE_INFO pMachine;
1693 
1694  TRACE("CM_Disconnect_Machine(%p)\n", hMachine);
1695 
1696  pMachine = (PMACHINE_INFO)hMachine;
1697  if (pMachine == NULL)
1698  return CR_SUCCESS;
1699 
1700  if (pMachine->bLocal == FALSE)
1701  {
1702  if (pMachine->StringTable != NULL)
1704 
1705  if (!PnpUnbindRpc(pMachine->BindingHandle))
1706  return CR_ACCESS_DENIED;
1707  }
1708 
1709  HeapFree(GetProcessHeap(), 0, pMachine);
1710 
1711  return CR_SUCCESS;
1712 }
struct _MACHINE_INFO * PMACHINE_INFO
#define CR_ACCESS_DENIED
Definition: cfgmgr32.h:897
RPC_STATUS PnpUnbindRpc(RPC_BINDING_HANDLE *BindingHandle)
Definition: rpc.c:53
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
RPC_BINDING_HANDLE BindingHandle
Definition: cfgmgr.c:46
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
VOID WINAPI pSetupStringTableDestroy(HSTRING_TABLE hStringTable)
Definition: stringtable.c:145
BOOL bLocal
Definition: cfgmgr.c:48
#define HeapFree(x, y, z)
Definition: compat.h:394
HSTRING_TABLE StringTable
Definition: cfgmgr.c:47

Referenced by DestroyDeviceInfoSet(), DeviceProblemWizardW(), and DisplayDeviceAdvancedProperties().

◆ CM_Dup_Range_List()

CONFIGRET WINAPI CM_Dup_Range_List ( _In_ RANGE_LIST  rlhOld,
_In_ RANGE_LIST  rlhNew,
_In_ ULONG  ulFlags 
)

Definition at line 1720 of file cfgmgr.c.

1724 {
1725  FIXME("CM_Dup_Range_List(%p %p %lx)\n",
1726  rlhOld, rlhNew, ulFlags);
1727 
1728  return CR_CALL_NOT_IMPLEMENTED;
1729 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898

◆ CM_Enable_DevNode()

CONFIGRET WINAPI CM_Enable_DevNode ( _In_ DEVINST  dnDevInst,
_In_ ULONG  ulFlags 
)

Definition at line 1737 of file cfgmgr.c.

1740 {
1741  TRACE("CM_Enable_DevNode(%p %lx)\n",
1742  dnDevInst, ulFlags);
1743 
1744  return CM_Enable_DevNode_Ex(dnDevInst, ulFlags, NULL);
1745 }
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
CONFIGRET WINAPI CM_Enable_DevNode_Ex(_In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:1753

◆ CM_Enable_DevNode_Ex()

CONFIGRET WINAPI CM_Enable_DevNode_Ex ( _In_ DEVINST  dnDevInst,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 1753 of file cfgmgr.c.

1757 {
1759  HSTRING_TABLE StringTable = NULL;
1760  LPWSTR lpDevInst;
1761  CONFIGRET ret;
1762 
1763  TRACE("CM_Enable_DevNode_Ex(%p %lx %p)\n",
1764  dnDevInst, ulFlags, hMachine);
1765 
1766  if (!pSetupIsUserAdmin())
1767  return CR_ACCESS_DENIED;
1768 
1769  if (dnDevInst == 0)
1770  return CR_INVALID_DEVINST;
1771 
1772  if (ulFlags != 0)
1773  return CR_INVALID_FLAG;
1774 
1775  if (hMachine != NULL)
1776  {
1777  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1778  if (BindingHandle == NULL)
1779  return CR_FAILURE;
1780 
1781  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
1782  if (StringTable == 0)
1783  return CR_FAILURE;
1784  }
1785  else
1786  {
1787  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
1788  return CR_FAILURE;
1789  }
1790 
1791  lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
1792  if (lpDevInst == NULL)
1793  return CR_INVALID_DEVNODE;
1794 
1795  RpcTryExcept
1796  {
1798  PNP_DEVINST_ENABLE,
1799  ulFlags,
1800  lpDevInst,
1801  NULL);
1802  }
1804  {
1806  }
1807  RpcEndExcept;
1808 
1809  return ret;
1810 }
#define RpcEndExcept
Definition: rpc.h:128
#define CR_INVALID_DEVINST
Definition: cfgmgr32.h:848
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
struct _MACHINE_INFO * PMACHINE_INFO
_In_ ULONG _Out_ HANDLE * BindingHandle
Definition: tdikrnl.h:1146
#define CR_ACCESS_DENIED
Definition: cfgmgr32.h:897
BOOL PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle, HSTRING_TABLE *StringTable)
Definition: rpc.c:66
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define CR_FAILURE
Definition: cfgmgr32.h:865
DWORD WINAPI PNP_DeviceInstanceAction(handle_t hBinding, DWORD ulAction, DWORD ulFlags, LPWSTR pszDeviceInstance1, LPWSTR pszDeviceInstance2)
Definition: umpnpmgr.c:2571
int ret
#define CR_INVALID_DEVNODE
Definition: cfgmgr32.h:847
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:125
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
BOOL WINAPI pSetupIsUserAdmin(VOID)
Definition: misc.c:1817
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LPWSTR WINAPI pSetupStringTableStringFromId(HSTRING_TABLE hStringTable, DWORD dwId)
Definition: stringtable.c:722
#define RpcExcept(expr)
Definition: rpc.h:127

Referenced by CM_Enable_DevNode(), and ResetDevice().

◆ CM_Enumerate_Classes()

CONFIGRET WINAPI CM_Enumerate_Classes ( _In_ ULONG  ulClassIndex,
_Out_ LPGUID  ClassGuid,
_In_ ULONG  ulFlags 
)

Definition at line 1818 of file cfgmgr.c.

1822 {
1823  TRACE("CM_Enumerate_Classes(%lx %p %lx)\n",
1824  ulClassIndex, ClassGuid, ulFlags);
1825 
1826  return CM_Enumerate_Classes_Ex(ulClassIndex, ClassGuid, ulFlags, NULL);
1827 }
CONFIGRET WINAPI CM_Enumerate_Classes_Ex(_In_ ULONG ulClassIndex, _Out_ LPGUID ClassGuid, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:1835
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by EnumDeviceClasses(), and CDeviceView::GetNextClass().

◆ CM_Enumerate_Classes_Ex()

CONFIGRET WINAPI CM_Enumerate_Classes_Ex ( _In_ ULONG  ulClassIndex,
_Out_ LPGUID  ClassGuid,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 1835 of file cfgmgr.c.

1840 {
1841  WCHAR szBuffer[MAX_GUID_STRING_LEN];
1844  ULONG ulLength = MAX_GUID_STRING_LEN;
1845 
1846  TRACE("CM_Enumerate_Classes_Ex(%lx %p %lx %p)\n",
1847  ulClassIndex, ClassGuid, ulFlags, hMachine);
1848 
1849  if (ClassGuid == NULL)
1850  return CR_INVALID_POINTER;
1851 
1852  if (ulFlags != 0)
1853  return CR_INVALID_FLAG;
1854 
1855  if (hMachine != NULL)
1856  {
1857  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1858  if (BindingHandle == NULL)
1859  return CR_FAILURE;
1860  }
1861  else
1862  {
1864  return CR_FAILURE;
1865  }
1866 
1867  RpcTryExcept
1868  {
1870  PNP_CLASS_SUBKEYS,
1871  ulClassIndex,
1872  szBuffer,
1874  &ulLength,
1875  ulFlags);
1876  }
1878  {
1880  }
1881  RpcEndExcept;
1882 
1883  if (ret == CR_SUCCESS)
1884  {
1885  /* Remove the {} */
1886  szBuffer[MAX_GUID_STRING_LEN - 2] = UNICODE_NULL;
1887 
1888  /* Convert the buffer to a GUID */
1889  if (UuidFromStringW(&szBuffer[1], ClassGuid) != RPC_S_OK)
1890  return CR_FAILURE;
1891  }
1892 
1893  return ret;
1894 }
#define RpcEndExcept
Definition: rpc.h:128
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
struct _MACHINE_INFO * PMACHINE_INFO
_In_ ULONG _Out_ HANDLE * BindingHandle
Definition: tdikrnl.h:1146
BOOL PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle, HSTRING_TABLE *StringTable)
Definition: rpc.c:66
#define UNICODE_NULL
RPC_STATUS WINAPI UuidFromStringW(RPC_WSTR s, UUID *uuid)
Definition: rpcrt4_main.c:615
#define RpcTryExcept
Definition: rpc.h:126
#define CR_SUCCESS
Definition: cfgmgr32.h:842
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_GUID_STRING_LEN
Definition: apphelp.c:29
#define CR_FAILURE
Definition: cfgmgr32.h:865
int ret
DWORD WINAPI PNP_EnumerateSubKeys(handle_t hBinding, DWORD ulBranch, DWORD ulIndex, LPWSTR Buffer, PNP_RPC_STRING_LEN ulLength, PNP_RPC_STRING_LEN *pulRequiredLen, DWORD ulFlags)
Definition: umpnpmgr.c:476
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:125
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
unsigned int ULONG
Definition: retypes.h:1
#define RPC_S_OK
Definition: rpcnterr.h:22
#define RpcExcept(expr)
Definition: rpc.h:127

Referenced by CM_Enumerate_Classes().

◆ CM_Enumerate_Enumerators_ExA()

CONFIGRET WINAPI CM_Enumerate_Enumerators_ExA ( _In_ ULONG  ulEnumIndex,
_Out_writes_ *pulLength PCHAR  Buffer,
_Inout_ PULONG  pulLength,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 1940 of file cfgmgr.c.

1946 {
1947  WCHAR szBuffer[MAX_DEVICE_ID_LEN];
1948  ULONG ulOrigLength;
1949  ULONG ulLength;
1951 
1952  TRACE("CM_Enumerate_Enumerators_ExA(%lu %p %p %lx %p)\n",
1953  ulEnumIndex, Buffer, pulLength, ulFlags, hMachine);
1954 
1955  if (Buffer == NULL || pulLength == NULL)
1956  return CR_INVALID_POINTER;
1957 
1958  if (ulFlags != 0)
1959  return CR_INVALID_FLAG;
1960 
1961  ulOrigLength = *pulLength;
1962  *pulLength = 0;
1963 
1964  ulLength = MAX_DEVICE_ID_LEN;
1965  ret = CM_Enumerate_Enumerators_ExW(ulEnumIndex, szBuffer, &ulLength,
1966  ulFlags, hMachine);
1967  if (ret == CR_SUCCESS)
1968  {
1970  0,
1971  szBuffer,
1972  ulLength,
1973  Buffer,
1974  ulOrigLength,
1975  NULL,
1976  NULL) == 0)
1977  ret = CR_FAILURE;
1978  else
1979  *pulLength = lstrlenA(Buffer) + 1;
1980  }
1981 
1982  return ret;
1983 }
#define WideCharToMultiByte
Definition: compat.h:101
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
#define CP_ACP
Definition: compat.h:99
#define MAX_DEVICE_ID_LEN
Definition: pnpmgr.c:28
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define CR_FAILURE
Definition: cfgmgr32.h:865
int ret
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
CONFIGRET WINAPI CM_Enumerate_Enumerators_ExW(_In_ ULONG ulEnumIndex, _Out_writes_(*pulLength) PWCHAR Buffer, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:1991
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
unsigned int ULONG
Definition: retypes.h:1

Referenced by CM_Enumerate_EnumeratorsA().

◆ CM_Enumerate_Enumerators_ExW()

CONFIGRET WINAPI CM_Enumerate_Enumerators_ExW ( _In_ ULONG  ulEnumIndex,
_Out_writes_ *pulLength PWCHAR  Buffer,
_Inout_ PULONG  pulLength,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 1991 of file cfgmgr.c.

1997 {
1999  CONFIGRET ret;
2000 
2001  TRACE("CM_Enumerate_Enumerators_ExW(%lu %p %p %lx %p)\n",
2002  ulEnumIndex, Buffer, pulLength, ulFlags, hMachine);
2003 
2004  if (Buffer == NULL || pulLength == NULL)
2005  return CR_INVALID_POINTER;
2006 
2007  if (ulFlags != 0)
2008  return CR_INVALID_FLAG;
2009 
2010  *Buffer = UNICODE_NULL;
2011 
2012  if (hMachine != NULL)
2013  {
2014  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2015  if (BindingHandle == NULL)
2016  return CR_FAILURE;
2017  }
2018  else
2019  {
2021  return CR_FAILURE;
2022  }
2023 
2024  RpcTryExcept
2025  {
2027  PNP_ENUMERATOR_SUBKEYS,
2028  ulEnumIndex,
2029  Buffer,
2030  *pulLength,
2031  pulLength,
2032  ulFlags);
2033  }
2035  {
2037  }
2038  RpcEndExcept;
2039 
2040  return ret;
2041 }
#define RpcEndExcept
Definition: rpc.h:128
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
struct _MACHINE_INFO * PMACHINE_INFO
_In_ ULONG _Out_ HANDLE * BindingHandle
Definition: tdikrnl.h:1146
BOOL PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle, HSTRING_TABLE *StringTable)
Definition: rpc.c:66
#define UNICODE_NULL
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define CR_FAILURE
Definition: cfgmgr32.h:865
int ret
DWORD WINAPI PNP_EnumerateSubKeys(handle_t hBinding, DWORD ulBranch, DWORD ulIndex, LPWSTR Buffer, PNP_RPC_STRING_LEN ulLength, PNP_RPC_STRING_LEN *pulRequiredLen, DWORD ulFlags)
Definition: umpnpmgr.c:476
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:125
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
#define RpcExcept(expr)
Definition: rpc.h:127

Referenced by CM_Enumerate_Enumerators_ExA(), and CM_Enumerate_EnumeratorsW().

◆ CM_Enumerate_EnumeratorsA()

CONFIGRET WINAPI CM_Enumerate_EnumeratorsA ( _In_ ULONG  ulEnumIndex,
_Out_writes_ *pulLength PCHAR  Buffer,
_Inout_ PULONG  pulLength,
_In_ ULONG  ulFlags 
)

Definition at line 1902 of file cfgmgr.c.

1907 {
1908  TRACE("CM_Enumerate_EnumeratorsA(%lu %p %p %lx)\n",
1909  ulEnumIndex, Buffer, pulLength, ulFlags);
1910 
1911  return CM_Enumerate_Enumerators_ExA(ulEnumIndex, Buffer, pulLength,
1912  ulFlags, NULL);
1913 }
CONFIGRET WINAPI CM_Enumerate_Enumerators_ExA(_In_ ULONG ulEnumIndex, _Out_writes_(*pulLength) PCHAR Buffer, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:1940
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define TRACE(s)
Definition: solgame.cpp:4

◆ CM_Enumerate_EnumeratorsW()

CONFIGRET WINAPI CM_Enumerate_EnumeratorsW ( _In_ ULONG  ulEnumIndex,
_Out_writes_ *pulLength PWCHAR  Buffer,
_Inout_ PULONG  pulLength,
_In_ ULONG  ulFlags 
)

Definition at line 1921 of file cfgmgr.c.

1926 {
1927  TRACE("CM_Enumerate_EnumeratorsW(%lu %p %p %lx)\n",
1928  ulEnumIndex, Buffer, pulLength, ulFlags);
1929 
1930  return CM_Enumerate_Enumerators_ExW(ulEnumIndex, Buffer, pulLength,
1931  ulFlags, NULL);
1932 }
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define TRACE(s)
Definition: solgame.cpp:4
CONFIGRET WINAPI CM_Enumerate_Enumerators_ExW(_In_ ULONG ulEnumIndex, _Out_writes_(*pulLength) PWCHAR Buffer, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:1991

◆ CM_Find_Range()

CONFIGRET WINAPI CM_Find_Range ( _Out_ PDWORDLONG  pullStart,
_In_ DWORDLONG  ullStart,
_In_ ULONG  ulLength,
_In_ DWORDLONG  ullAlignment,
_In_ DWORDLONG  ullEnd,
_In_ RANGE_LIST  rlh,
_In_ ULONG  ulFlags 
)

Definition at line 2049 of file cfgmgr.c.

2057 {
2058  FIXME("CM_Find_Range(%p %I64u %lu %I64u %I64u %p %lx)\n",
2059  pullStart, ullStart, ulLength, ullAlignment, ullEnd, rlh, ulFlags);
2060 
2061  return CR_CALL_NOT_IMPLEMENTED;
2062 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898

◆ CM_First_Range()

CONFIGRET WINAPI CM_First_Range ( _In_ RANGE_LIST  rlh,
_Out_ PDWORDLONG  pullStart,
_Out_ PDWORDLONG  pullEnd,
_Out_ PRANGE_ELEMENT  preElement,
_In_ ULONG  ulFlags 
)

Definition at line 2070 of file cfgmgr.c.

2076 {
2077  PINTERNAL_RANGE_LIST pRangeList;
2078  PINTERNAL_RANGE pRange;
2079  PLIST_ENTRY ListEntry;
2081 
2082  FIXME("CM_First_Range(%p %p %p %p %lx)\n",
2083  rlh, pullStart, pullEnd, preElement, ulFlags);
2084 
2085  pRangeList = (PINTERNAL_RANGE_LIST)rlh;
2086 
2087  if (!IsValidRangeList(pRangeList))
2088  return CR_INVALID_RANGE_LIST;
2089 
2090  if (pullStart == NULL || pullEnd == NULL || preElement == NULL)
2091  return CR_INVALID_POINTER;
2092 
2093  if (ulFlags != 0)
2094  return CR_INVALID_FLAG;
2095 
2096  /* Lock the range list */
2097  WaitForSingleObject(pRangeList->hMutex, INFINITE);
2098 
2099  /* Fail, if the list is empty */
2100  if (IsListEmpty(&pRangeList->ListHead))
2101  {
2102  ret = CR_FAILURE;
2103  goto done;
2104  }
2105 
2106  /* Get the first range */
2107  ListEntry = pRangeList->ListHead.Flink;
2108  pRange = CONTAINING_RECORD(ListEntry, INTERNAL_RANGE, ListEntry);
2109 
2110  /* Return the range data */
2111  *pullStart = pRange->ullStart;
2112  *pullEnd = pRange->ullEnd;
2113  *preElement = (RANGE_ELEMENT)pRange;
2114 
2115 done:
2116  /* Unlock the range list */
2117  ReleaseMutex(pRangeList->hMutex);
2118 
2119  return ret;
2120 }
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
BOOL IsValidRangeList(_In_opt_ PINTERNAL_RANGE_LIST pRangeList)
Definition: cfgmgr.c:354
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define FIXME(fmt,...)
Definition: debug.h:110
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
struct _INTERNAL_RANGE_LIST * PINTERNAL_RANGE_LIST
DWORD_PTR RANGE_ELEMENT
Definition: cfgmgr32.h:105
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
DWORDLONG ullStart
Definition: cfgmgr.c:76
#define CR_FAILURE
Definition: cfgmgr32.h:865
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseMutex(IN HANDLE hMutex)
Definition: synch.c:564
int ret
DWORDLONG ullEnd
Definition: cfgmgr.c:77
Definition: typedefs.h:117
#define CR_INVALID_RANGE_LIST
Definition: cfgmgr32.h:863
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
LIST_ENTRY ListHead
Definition: cfgmgr.c:84
#define INFINITE
Definition: serial.h:102

◆ CM_Free_Log_Conf()

CONFIGRET WINAPI CM_Free_Log_Conf ( _In_ LOG_CONF  lcLogConfToBeFreed,
_In_ ULONG  ulFlags 
)

Definition at line 2128 of file cfgmgr.c.

2131 {
2132  TRACE("CM_Free_Log_Conf(%lx %lx)\n",
2133  lcLogConfToBeFreed, ulFlags);
2134 
2135  return CM_Free_Log_Conf_Ex(lcLogConfToBeFreed, ulFlags, NULL);
2136 }
CONFIGRET WINAPI CM_Free_Log_Conf_Ex(_In_ LOG_CONF lcLogConfToBeFreed, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2144
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4

◆ CM_Free_Log_Conf_Ex()

CONFIGRET WINAPI CM_Free_Log_Conf_Ex ( _In_ LOG_CONF  lcLogConfToBeFreed,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 2144 of file cfgmgr.c.

2148 {
2150  HSTRING_TABLE StringTable = NULL;
2151  LPWSTR lpDevInst;
2152  PLOG_CONF_INFO pLogConfInfo;
2153  CONFIGRET ret;
2154 
2155  TRACE("CM_Free_Log_Conf_Ex(%lx %lx %p)\n",
2156  lcLogConfToBeFreed, ulFlags, hMachine);
2157 
2158  if (!pSetupIsUserAdmin())
2159  return CR_ACCESS_DENIED;
2160 
2161  pLogConfInfo = (PLOG_CONF_INFO)lcLogConfToBeFreed;
2162  if (!IsValidLogConf(pLogConfInfo))
2163  return CR_INVALID_LOG_CONF;
2164 
2165  if (ulFlags != 0)
2166  return CR_INVALID_FLAG;
2167 
2168  if (hMachine != NULL)
2169  {
2170  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2171  if (BindingHandle == NULL)
2172  return CR_FAILURE;
2173 
2174  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
2175  if (StringTable == 0)
2176  return CR_FAILURE;
2177  }
2178  else
2179  {
2180  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
2181  return CR_FAILURE;
2182  }
2183 
2184  lpDevInst = pSetupStringTableStringFromId(StringTable, pLogConfInfo->dnDevInst);
2185  if (lpDevInst == NULL)
2186  return CR_INVALID_DEVNODE;
2187 
2188  RpcTryExcept
2189  {
2190  ret = PNP_FreeLogConf(BindingHandle, lpDevInst, pLogConfInfo->ulFlags,
2191  pLogConfInfo->ulTag, 0);
2192  }
2194  {
2196  }
2197  RpcEndExcept;
2198 
2199  return ret;
2200 }
#define RpcEndExcept
Definition: rpc.h:128
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
struct _MACHINE_INFO * PMACHINE_INFO
_In_ ULONG _Out_ HANDLE * BindingHandle
Definition: tdikrnl.h:1146
ULONG ulTag
Definition: cfgmgr.c:57
DWORD WINAPI PNP_FreeLogConf(handle_t hBinding, LPWSTR pDeviceID, DWORD ulLogConfType, DWORD ulLogConfTag, DWORD ulFlags)
Definition: umpnpmgr.c:3200
#define CR_ACCESS_DENIED
Definition: cfgmgr32.h:897
struct _LOG_CONF_INFO * PLOG_CONF_INFO
BOOL PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle, HSTRING_TABLE *StringTable)
Definition: rpc.c:66
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define CR_INVALID_LOG_CONF
Definition: cfgmgr32.h:850
#define CR_FAILURE
Definition: cfgmgr32.h:865
int ret
#define CR_INVALID_DEVNODE
Definition: cfgmgr32.h:847
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:125
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
BOOL WINAPI pSetupIsUserAdmin(VOID)
Definition: misc.c:1817
WCHAR * LPWSTR
Definition: xmlstorage.h:184
DEVINST dnDevInst
Definition: cfgmgr.c:55
ULONG ulFlags
Definition: cfgmgr.c:56
LPWSTR WINAPI pSetupStringTableStringFromId(HSTRING_TABLE hStringTable, DWORD dwId)
Definition: stringtable.c:722
#define RpcExcept(expr)
Definition: rpc.h:127
BOOL IsValidLogConf(_In_opt_ PLOG_CONF_INFO pLogConfInfo)
Definition: cfgmgr.c:378

Referenced by CM_Free_Log_Conf().

◆ CM_Free_Log_Conf_Handle()

CONFIGRET WINAPI CM_Free_Log_Conf_Handle ( _In_ LOG_CONF  lcLogConf)

Definition at line 2208 of file cfgmgr.c.

2210 {
2211  PLOG_CONF_INFO pLogConfInfo;
2212 
2213  TRACE("CM_Free_Log_Conf_Handle(%lx)\n", lcLogConf);
2214 
2215  pLogConfInfo = (PLOG_CONF_INFO)lcLogConf;
2216  if (!IsValidLogConf(pLogConfInfo))
2217  return CR_INVALID_LOG_CONF;
2218 
2219  HeapFree(GetProcessHeap(), 0, pLogConfInfo);
2220 
2221  return CR_SUCCESS;
2222 }
struct _LOG_CONF_INFO * PLOG_CONF_INFO
#define CR_SUCCESS
Definition: cfgmgr32.h:842
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
#define CR_INVALID_LOG_CONF
Definition: cfgmgr32.h:850
#define HeapFree(x, y, z)
Definition: compat.h:394
BOOL IsValidLogConf(_In_opt_ PLOG_CONF_INFO pLogConfInfo)
Definition: cfgmgr.c:378

◆ CM_Free_Range_List()

CONFIGRET WINAPI CM_Free_Range_List ( _In_ RANGE_LIST  RangeList,
_In_ ULONG  ulFlags 
)

Definition at line 2230 of file cfgmgr.c.

2233 {
2234  PINTERNAL_RANGE_LIST pRangeList;
2235  PINTERNAL_RANGE pRange;
2236  PLIST_ENTRY ListEntry;
2237 
2238  FIXME("CM_Free_Range_List(%p %lx)\n",
2239  RangeList, ulFlags);
2240 
2241  pRangeList = (PINTERNAL_RANGE_LIST)RangeList;
2242 
2243  if (!IsValidRangeList(pRangeList))
2244  return CR_INVALID_RANGE_LIST;
2245 
2246  if (ulFlags != 0)
2247  return CR_INVALID_FLAG;
2248 
2249  /* Lock the range list */
2250  WaitForSingleObject(pRangeList->hMutex, INFINITE);
2251 
2252  /* Free the list of ranges */
2253  while (!IsListEmpty(&pRangeList->ListHead))
2254  {
2255  ListEntry = RemoveHeadList(&pRangeList->ListHead);
2256  pRange = CONTAINING_RECORD(ListEntry, INTERNAL_RANGE, ListEntry);
2257  HeapFree(GetProcessHeap(), 0, pRange);
2258  }
2259 
2260  /* Unlock the range list */
2261  ReleaseMutex(pRangeList->hMutex);
2262 
2263  /* Close the mutex */
2264  CloseHandle(pRangeList->hMutex);
2265 
2266  /* Free the range list */
2267  HeapFree(GetProcessHeap(), 0, pRangeList);
2268 
2269  return CR_SUCCESS;
2270 }
#define CloseHandle
Definition: compat.h:398
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
BOOL IsValidRangeList(_In_opt_ PINTERNAL_RANGE_LIST pRangeList)
Definition: cfgmgr.c:354
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define FIXME(fmt,...)
Definition: debug.h:110
#define CR_SUCCESS
Definition: cfgmgr32.h:842
struct _INTERNAL_RANGE_LIST * PINTERNAL_RANGE_LIST
FORCEINLINE PLIST_ENTRY RemoveHeadList(_Inout_ PLIST_ENTRY ListHead)
Definition: rtlfuncs.h:128
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define GetProcessHeap()
Definition: compat.h:395
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseMutex(IN HANDLE hMutex)
Definition: synch.c:564
Definition: typedefs.h:117
#define CR_INVALID_RANGE_LIST
Definition: cfgmgr32.h:863
LIST_ENTRY ListHead
Definition: cfgmgr.c:84
#define INFINITE
Definition: serial.h:102
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ CM_Free_Res_Des()

CONFIGRET WINAPI CM_Free_Res_Des ( _Out_ PRES_DES  prdResDes,
_In_ RES_DES  rdResDes,
_In_ ULONG  ulFlags 
)

Definition at line 2278 of file cfgmgr.c.

2282 {
2283  TRACE("CM_Free_Res_Des(%p %p %lx)\n",
2284  prdResDes, rdResDes, ulFlags);
2285 
2286  return CM_Free_Res_Des_Ex(prdResDes, rdResDes, ulFlags, NULL);
2287 }
CONFIGRET WINAPI CM_Free_Res_Des_Ex(_Out_ PRES_DES prdResDes, _In_ RES_DES rdResDes, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2295
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4

◆ CM_Free_Res_Des_Ex()

CONFIGRET WINAPI CM_Free_Res_Des_Ex ( _Out_ PRES_DES  prdResDes,
_In_ RES_DES  rdResDes,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 2295 of file cfgmgr.c.

2300 {
2301  FIXME("CM_Free_Res_Des_Ex(%p %p %lx %p)\n",
2302  prdResDes, rdResDes, ulFlags, hMachine);
2303 
2304  return CR_CALL_NOT_IMPLEMENTED;
2305 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898

Referenced by CM_Free_Res_Des().

◆ CM_Free_Res_Des_Handle()

CONFIGRET WINAPI CM_Free_Res_Des_Handle ( _In_ RES_DES  rdResDes)

Definition at line 2313 of file cfgmgr.c.

2315 {
2316  FIXME("CM_Free_Res_Des_Handle(%p)\n", rdResDes);
2317 
2318  return CR_CALL_NOT_IMPLEMENTED;
2319 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898

◆ CM_Free_Resource_Conflict_Handle()

CONFIGRET WINAPI CM_Free_Resource_Conflict_Handle ( _In_ CONFLICT_LIST  clConflictList)

Definition at line 2327 of file cfgmgr.c.

2329 {
2330  PCONFLICT_DATA pConflictData;
2331 
2332  FIXME("CM_Free_Resource_Conflict_Handle(%p)\n",
2333  clConflictList);
2334 
2335  pConflictData = (PCONFLICT_DATA)clConflictList;
2336  if (!IsValidConflictData(pConflictData))
2337  return CR_INVALID_CONFLICT_LIST;
2338 
2339  if (pConflictData->pConflictList != NULL)
2340  MyFree(pConflictData->pConflictList);
2341 
2342  MyFree(pConflictData);
2343 
2344  return CR_SUCCESS;
2345 }
BOOL IsValidConflictData(_In_opt_ PCONFLICT_DATA pConflictData)
Definition: cfgmgr.c:402
PPNP_CONFLICT_LIST pConflictList
Definition: cfgmgr.c:92
#define FIXME(fmt,...)
Definition: debug.h:110
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
#define CR_INVALID_CONFLICT_LIST
Definition: cfgmgr32.h:903
struct _CONFLICT_DATA * PCONFLICT_DATA
VOID WINAPI MyFree(LPVOID lpMem)
Definition: misc.c:128

◆ CM_Get_Child()

CONFIGRET WINAPI CM_Get_Child ( _Out_ PDEVINST  pdnDevInst,
_In_ DEVINST  dnDevInst,
_In_ ULONG  ulFlags 
)

Definition at line 2353 of file cfgmgr.c.

2357 {
2358  TRACE("CM_Get_Child(%p %p %lx)\n",
2359  pdnDevInst, dnDevInst, ulFlags);
2360 
2361  return CM_Get_Child_Ex(pdnDevInst, dnDevInst, ulFlags, NULL);
2362 }
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
CONFIGRET WINAPI CM_Get_Child_Ex(_Out_ PDEVINST pdnDevInst, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2370

Referenced by CDeviceView::GetChildDevice().

◆ CM_Get_Child_Ex()

CONFIGRET WINAPI CM_Get_Child_Ex ( _Out_ PDEVINST  pdnDevInst,
_In_ DEVINST  dnDevInst,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 2370 of file cfgmgr.c.

2375 {
2376  WCHAR szRelatedDevInst[MAX_DEVICE_ID_LEN];
2378  HSTRING_TABLE StringTable = NULL;
2379  LPWSTR lpDevInst;
2380  DWORD dwIndex, dwLength = MAX_DEVICE_ID_LEN;
2381  CONFIGRET ret;
2382 
2383  TRACE("CM_Get_Child_Ex(%p %lx %lx %p)\n",
2384  pdnDevInst, dnDevInst, ulFlags, hMachine);
2385 
2386  if (pdnDevInst == NULL)
2387  return CR_INVALID_POINTER;
2388 
2389  if (dnDevInst == 0)
2390  return CR_INVALID_DEVINST;
2391 
2392  if (ulFlags != 0)
2393  return CR_INVALID_FLAG;
2394 
2395  *pdnDevInst = -1;
2396 
2397  if (hMachine != NULL)
2398  {
2399  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2400  if (BindingHandle == NULL)
2401  return CR_FAILURE;
2402 
2403  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
2404  if (StringTable == 0)
2405  return CR_FAILURE;
2406  }
2407  else
2408  {
2409  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
2410  return CR_FAILURE;
2411  }
2412 
2413  lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
2414  if (lpDevInst == NULL)
2415  return CR_INVALID_DEVNODE;
2416 
2417  RpcTryExcept
2418  {
2420  PNP_GET_CHILD_DEVICE_INSTANCE,
2421  lpDevInst,
2422  szRelatedDevInst,
2423  &dwLength,
2424  0);
2425  }
2427  {
2429  }
2430  RpcEndExcept;
2431 
2432  if (ret != CR_SUCCESS)
2433  return ret;
2434 
2435  TRACE("szRelatedDevInst: %s\n", debugstr_w(szRelatedDevInst));
2436 
2437  dwIndex = pSetupStringTableAddString(StringTable, szRelatedDevInst, 1);
2438  if (dwIndex == -1)
2439  return CR_FAILURE;
2440 
2441  *pdnDevInst = dwIndex;
2442 
2443  return CR_SUCCESS;
2444 }
#define RpcEndExcept
Definition: rpc.h:128
#define CR_INVALID_DEVINST
Definition: cfgmgr32.h:848
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
struct _MACHINE_INFO * PMACHINE_INFO
_In_ ULONG _Out_ HANDLE * BindingHandle
Definition: tdikrnl.h:1146
#define MAX_DEVICE_ID_LEN
Definition: pnpmgr.c:28
BOOL PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle, HSTRING_TABLE *StringTable)
Definition: rpc.c:66
#define debugstr_w
Definition: kernel32.h:32
#define RpcTryExcept
Definition: rpc.h:126
#define CR_SUCCESS
Definition: cfgmgr32.h:842
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
DWORD WINAPI pSetupStringTableAddString(HSTRING_TABLE hStringTable, LPWSTR lpString, DWORD dwFlags)
Definition: stringtable.c:196
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
static DWORD DWORD * dwLength
Definition: fusion.c:83
#define CR_FAILURE
Definition: cfgmgr32.h:865
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
#define CR_INVALID_DEVNODE
Definition: cfgmgr32.h:847
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:125
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LPWSTR WINAPI pSetupStringTableStringFromId(HSTRING_TABLE hStringTable, DWORD dwId)
Definition: stringtable.c:722
DWORD WINAPI PNP_GetRelatedDeviceInstance(handle_t hBinding, DWORD ulRelationship, LPWSTR pDeviceID, LPWSTR pRelatedDeviceId, PNP_RPC_STRING_LEN *pulLength, DWORD ulFlags)
Definition: umpnpmgr.c:428
#define RpcExcept(expr)
Definition: rpc.h:127

Referenced by CM_Get_Child().

◆ CM_Get_Class_Key_Name_ExA()

CONFIGRET WINAPI CM_Get_Class_Key_Name_ExA ( _In_ LPGUID  ClassGuid,
_Out_writes_opt_ *pulLength LPSTR  pszKeyName,
_Inout_ PULONG  pulLength,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 2490 of file cfgmgr.c.

2496 {
2497  WCHAR szBuffer[MAX_GUID_STRING_LEN];
2499  ULONG ulLength;
2500  ULONG ulOrigLength;
2501 
2502  TRACE("CM_Get_Class_Key_Name_ExA(%p %p %p %lx %p)\n",
2503  ClassGuid, pszKeyName, pulLength, ulFlags, hMachine);
2504 
2505  if (ClassGuid == NULL || pszKeyName == NULL || pulLength == NULL)
2506  return CR_INVALID_POINTER;
2507 
2508  ulOrigLength = *pulLength;
2509  *pulLength = 0;
2510 
2511  ulLength = MAX_GUID_STRING_LEN;
2512  ret = CM_Get_Class_Key_Name_ExW(ClassGuid, szBuffer, &ulLength,
2513  ulFlags, hMachine);
2514  if (ret == CR_SUCCESS)
2515  {
2517  0,
2518  szBuffer,
2519  ulLength,
2520  pszKeyName,
2521  ulOrigLength,
2522  NULL,
2523  NULL) == 0)
2524  ret = CR_FAILURE;
2525  else
2526  *pulLength = lstrlenA(pszKeyName) + 1;
2527  }
2528 
2529  return CR_SUCCESS;
2530 }
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_GUID_STRING_LEN
Definition: apphelp.c:29
#define CR_FAILURE
Definition: cfgmgr32.h:865
int ret
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
unsigned int ULONG
Definition: retypes.h:1
CONFIGRET WINAPI CM_Get_Class_Key_Name_ExW(_In_ LPGUID ClassGuid, _Out_writes_opt_(*pulLength) LPWSTR pszKeyName, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2538

Referenced by CM_Get_Class_Key_NameA().

◆ CM_Get_Class_Key_Name_ExW()

CONFIGRET WINAPI CM_Get_Class_Key_Name_ExW ( _In_ LPGUID  ClassGuid,
_Out_writes_opt_ *pulLength LPWSTR  pszKeyName,
_Inout_ PULONG  pulLength,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 2538 of file cfgmgr.c.

2544 {
2545  TRACE("CM_Get_Class_Key_Name_ExW(%p %p %p %lx %p)\n",
2546  ClassGuid, pszKeyName, pulLength, ulFlags, hMachine);
2547 
2548  if (ClassGuid == NULL || pszKeyName == NULL || pulLength == NULL)
2549  return CR_INVALID_POINTER;
2550 
2551  if (ulFlags != 0)
2552  return CR_INVALID_FLAG;
2553 
2554  if (*pulLength < MAX_GUID_STRING_LEN)
2555  {
2556  *pulLength = 0;
2557  return CR_BUFFER_SMALL;
2558  }
2559 
2560  if (!GuidToString(ClassGuid, pszKeyName))
2561  return CR_INVALID_DATA;
2562 
2563  *pulLength = MAX_GUID_STRING_LEN;
2564 
2565  return CR_SUCCESS;
2566 }
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define MAX_GUID_STRING_LEN
Definition: apphelp.c:29
#define CR_BUFFER_SMALL
Definition: cfgmgr32.h:872
#define CR_INVALID_DATA
Definition: cfgmgr32.h:877
static BOOL GuidToString(_In_ LPGUID Guid, _Out_ LPWSTR String)
Definition: cfgmgr.c:102
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845

Referenced by CM_Get_Class_Key_Name_ExA(), and CM_Get_Class_Key_NameW().

◆ CM_Get_Class_Key_NameA()

CONFIGRET WINAPI CM_Get_Class_Key_NameA ( _In_ LPGUID  ClassGuid,
_Out_writes_opt_ *pulLength LPSTR  pszKeyName,
_Inout_ PULONG  pulLength,
_In_ ULONG  ulFlags 
)

Definition at line 2452 of file cfgmgr.c.

2457 {
2458  TRACE("CM_Get_Class_Key_NameA(%p %p %p %lx)\n",
2459  ClassGuid, pszKeyName, pulLength, ulFlags);
2460 
2461  return CM_Get_Class_Key_Name_ExA(ClassGuid, pszKeyName, pulLength,
2462  ulFlags, NULL);
2463 }
CONFIGRET WINAPI CM_Get_Class_Key_Name_ExA(_In_ LPGUID ClassGuid, _Out_writes_opt_(*pulLength) LPSTR pszKeyName, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2490
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4

◆ CM_Get_Class_Key_NameW()

CONFIGRET WINAPI CM_Get_Class_Key_NameW ( _In_ LPGUID  ClassGuid,
_Out_writes_opt_ *pulLength LPWSTR  pszKeyName,
_Inout_ PULONG  pulLength,
_In_ ULONG  ulFlags 
)

Definition at line 2471 of file cfgmgr.c.

2476 {
2477  TRACE("CM_Get_Class_Key_NameW(%p %p %p %lx)\n",
2478  ClassGuid, pszKeyName, pulLength, ulFlags);
2479 
2480  return CM_Get_Class_Key_Name_ExW(ClassGuid, pszKeyName, pulLength,
2481  ulFlags, NULL);
2482 }
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
CONFIGRET WINAPI CM_Get_Class_Key_Name_ExW(_In_ LPGUID ClassGuid, _Out_writes_opt_(*pulLength) LPWSTR pszKeyName, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2538

◆ CM_Get_Class_Name_ExA()

CONFIGRET WINAPI CM_Get_Class_Name_ExA ( _In_ LPGUID  ClassGuid,
_Out_writes_opt_ *pulLength PCHAR  Buffer,
_Inout_ PULONG  pulLength,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 2612 of file cfgmgr.c.

2618 {
2619  WCHAR szBuffer[MAX_CLASS_NAME_LEN];
2621  ULONG ulLength;
2622  ULONG ulOrigLength;
2623 
2624  TRACE("CM_Get_Class_Name_ExA(%p %p %p %lx %p)\n",
2625  ClassGuid, Buffer, pulLength, ulFlags, hMachine);
2626 
2627  if (ClassGuid == NULL || Buffer == NULL || pulLength == NULL)
2628  return CR_INVALID_POINTER;
2629 
2630  ulOrigLength = *pulLength;
2631  *pulLength = 0;
2632 
2633  ulLength = MAX_CLASS_NAME_LEN;
2634  ret = CM_Get_Class_Name_ExW(ClassGuid, szBuffer, &ulLength,
2635  ulFlags, hMachine);
2636  if (ret == CR_SUCCESS)
2637  {
2639  0,
2640  szBuffer,
2641  ulLength,
2642  Buffer,
2643  ulOrigLength,
2644  NULL,
2645  NULL) == 0)
2646  ret = CR_FAILURE;
2647  else
2648  *pulLength = lstrlenA(Buffer) + 1;
2649  }
2650 
2651  return ret;
2652 }
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define CR_FAILURE
Definition: cfgmgr32.h:865
int ret
CONFIGRET WINAPI CM_Get_Class_Name_ExW(_In_ LPGUID ClassGuid, _Out_writes_opt_(*pulLength) PWCHAR Buffer, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2660
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
unsigned int ULONG
Definition: retypes.h:1
#define MAX_CLASS_NAME_LEN
Definition: cfgmgr32.h:52

Referenced by CM_Get_Class_NameA().

◆ CM_Get_Class_Name_ExW()

CONFIGRET WINAPI CM_Get_Class_Name_ExW ( _In_ LPGUID  ClassGuid,
_Out_writes_opt_ *pulLength PWCHAR  Buffer,
_Inout_ PULONG  pulLength,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 2660 of file cfgmgr.c.

2666 {
2667  WCHAR szGuidString[MAX_GUID_STRING_LEN];
2669  CONFIGRET ret;
2670 
2671  TRACE("CM_Get_Class_Name_ExW(%p %p %p %lx %p\n",
2672  ClassGuid, Buffer, pulLength, ulFlags, hMachine);
2673 
2674  if (ClassGuid == NULL || Buffer == NULL || pulLength == NULL)
2675  return CR_INVALID_POINTER;
2676 
2677  if (ulFlags != 0)
2678  return CR_INVALID_FLAG;
2679 
2680  if (!GuidToString(ClassGuid, szGuidString))
2681  return CR_INVALID_DATA;
2682 
2683  TRACE("Guid %s\n", debugstr_w(szGuidString));
2684 
2685  if (hMachine != NULL)
2686  {
2687  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2688  if (BindingHandle == NULL)
2689  return CR_FAILURE;
2690  }
2691  else
2692  {
2694  return CR_FAILURE;
2695  }
2696 
2697  RpcTryExcept
2698  {
2700  szGuidString,
2701  Buffer,
2702  pulLength,
2703  ulFlags);
2704  }
2706  {
2708  }
2709  RpcEndExcept;
2710 
2711  return ret;
2712 }
#define RpcEndExcept
Definition: rpc.h:128
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
struct _MACHINE_INFO * PMACHINE_INFO
_In_ ULONG _Out_ HANDLE * BindingHandle
Definition: tdikrnl.h:1146
BOOL PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle, HSTRING_TABLE *StringTable)
Definition: rpc.c:66
#define debugstr_w
Definition: kernel32.h:32
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_GUID_STRING_LEN
Definition: apphelp.c:29
#define CR_FAILURE
Definition: cfgmgr32.h:865
#define CR_INVALID_DATA
Definition: cfgmgr32.h:877
int ret
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:125
static BOOL GuidToString(_In_ LPGUID Guid, _Out_ LPWSTR String)
Definition: cfgmgr.c:102
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
DWORD WINAPI PNP_GetClassName(handle_t hBinding, LPWSTR pszClassGuid, LPWSTR Buffer, PNP_RPC_STRING_LEN *pulLength, DWORD ulFlags)
Definition: umpnpmgr.c:1879
#define RpcExcept(expr)
Definition: rpc.h:127

Referenced by CM_Get_Class_Name_ExA(), and CM_Get_Class_NameW().

◆ CM_Get_Class_NameA()

CONFIGRET WINAPI CM_Get_Class_NameA ( _In_ LPGUID  ClassGuid,
_Out_writes_opt_ *pulLength PCHAR  Buffer,
_Inout_ PULONG  pulLength,
_In_ ULONG  ulFlags 
)

Definition at line 2574 of file cfgmgr.c.

2579 {
2580  TRACE("CM_Get_Class_NameA(%p %p %p %lx)\n",
2581  ClassGuid, Buffer, pulLength, ulFlags);
2582 
2583  return CM_Get_Class_Name_ExA(ClassGuid, Buffer, pulLength, ulFlags,
2584  NULL);
2585 }
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define TRACE(s)
Definition: solgame.cpp:4
CONFIGRET WINAPI CM_Get_Class_Name_ExA(_In_ LPGUID ClassGuid, _Out_writes_opt_(*pulLength) PCHAR Buffer, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2612

◆ CM_Get_Class_NameW()

CONFIGRET WINAPI CM_Get_Class_NameW ( _In_ LPGUID  ClassGuid,
_Out_writes_opt_ *pulLength PWCHAR  Buffer,
_Inout_ PULONG  pulLength,
_In_ ULONG  ulFlags 
)

Definition at line 2593 of file cfgmgr.c.

2598 {
2599  TRACE("CM_Get_Class_NameW(%p %p %p %lx)\n",
2600  ClassGuid, Buffer, pulLength, ulFlags);
2601 
2602  return CM_Get_Class_Name_ExW(ClassGuid, Buffer, pulLength, ulFlags,
2603  NULL);
2604 }
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define TRACE(s)
Definition: solgame.cpp:4
CONFIGRET WINAPI CM_Get_Class_Name_ExW(_In_ LPGUID ClassGuid, _Out_writes_opt_(*pulLength) PWCHAR Buffer, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2660

◆ CM_Get_Class_Registry_PropertyA()

CONFIGRET WINAPI CM_Get_Class_Registry_PropertyA ( LPGUID  ClassGuid,
ULONG  ulProperty,
PULONG  pulRegDataType,
PVOID  Buffer,
PULONG  pulLength,
ULONG  ulFlags,
HMACHINE  hMachine 
)

Definition at line 2720 of file cfgmgr.c.

2728 {
2729  PWSTR BufferW = NULL;
2730  ULONG ulLength = 0;
2731  ULONG ulType;
2732  CONFIGRET ret;
2733 
2734  TRACE("CM_Get_Class_Registry_PropertyA(%p %lu %p %p %p %lx %p)\n",
2735  ClassGuid, ulProperty, pulRegDataType, Buffer, pulLength,
2736  ulFlags, hMachine);
2737 
2738  if (pulLength == NULL)
2739  return CR_INVALID_POINTER;
2740 
2741  if (ulProperty < CM_CRP_MIN || ulProperty > CM_CRP_MAX)
2742  return CR_INVALID_PROPERTY;
2743 
2744  ulType = GetRegistryPropertyType(ulProperty);
2745  if (ulType == REG_SZ || ulType == REG_MULTI_SZ)
2746  {
2747  /* Get the required buffer size */
2748  ret = CM_Get_Class_Registry_PropertyW(ClassGuid, ulProperty, pulRegDataType,
2749  NULL, &ulLength, ulFlags, hMachine);
2750  if (ret != CR_BUFFER_SMALL)
2751  return ret;
2752 
2753  /* Allocate the unicode buffer */
2754  BufferW = HeapAlloc(GetProcessHeap(), 0, ulLength);
2755  if (BufferW == NULL)
2756  return CR_OUT_OF_MEMORY;
2757 
2758  /* Get the property */
2759  ret = CM_Get_Class_Registry_PropertyW(ClassGuid, ulProperty, pulRegDataType,
2760  BufferW, &ulLength, ulFlags, hMachine);
2761  if (ret != CR_SUCCESS)
2762  {
2763  HeapFree(GetProcessHeap(), 0, BufferW);
2764  return ret;
2765  }
2766 
2767  /* Do W->A conversion */
2768  *pulLength = WideCharToMultiByte(CP_ACP,
2769  0,
2770  BufferW,
2771  lstrlenW(BufferW) + 1,
2772  Buffer,
2773  *pulLength,
2774  NULL,
2775  NULL);
2776 
2777  /* Release the unicode buffer */
2778  HeapFree(GetProcessHeap(), 0, BufferW);
2779 
2780  if (*pulLength == 0)
2781  ret = CR_FAILURE;
2782  }
2783  else
2784  {
2785  /* Get the property */
2786  ret = CM_Get_Class_Registry_PropertyW(ClassGuid, ulProperty, pulRegDataType,
2787  Buffer, pulLength, ulFlags, hMachine);
2788  }
2789 
2790  return ret;
2791 }
#define WideCharToMultiByte
Definition: compat.h:101
CONFIGRET WINAPI CM_Get_Class_Registry_PropertyW(LPGUID ClassGuid, ULONG ulProperty, PULONG pulRegDataType, PVOID Buffer, PULONG pulLength, ULONG ulFlags, HMACHINE hMachine)
Definition: cfgmgr.c:2799
uint16_t * PWSTR
Definition: typedefs.h:54
#define CP_ACP
Definition: compat.h:99
#define lstrlenW
Definition: compat.h:407
#define REG_MULTI_SZ
Definition: nt_native.h:1501
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
#define CR_INVALID_PROPERTY
Definition: cfgmgr32.h:899
#define CR_OUT_OF_MEMORY
Definition: cfgmgr32.h:844
Definition: bufpool.h:45
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define CR_BUFFER_SMALL
Definition: cfgmgr32.h:872
#define CR_FAILURE
Definition: cfgmgr32.h:865
int ret
#define CM_CRP_MAX
Definition: cfgmgr32.h:733
static ULONG GetRegistryPropertyType(_In_ ULONG ulProperty)
Definition: cfgmgr.c:134
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
_In_z_ PCWSTR _In_ ULONG ulType
Definition: ntuser.h:36
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
unsigned int ULONG
Definition: retypes.h:1
#define HeapFree(x, y, z)
Definition: compat.h:394
#define REG_SZ
Definition: layer.c:22

◆ CM_Get_Class_Registry_PropertyW()

CONFIGRET WINAPI CM_Get_Class_Registry_PropertyW ( LPGUID  ClassGuid,
ULONG  ulProperty,
PULONG  pulRegDataType,
PVOID  Buffer,
PULONG  pulLength,
ULONG  ulFlags,
HMACHINE  hMachine 
)

Definition at line 2799 of file cfgmgr.c.

2807 {
2809  WCHAR szGuidString[PNP_MAX_GUID_STRING_LEN + 1];
2810  ULONG ulType = 0;
2811  ULONG ulTransferLength = 0;
2812  CONFIGRET ret;
2813 
2814  TRACE("CM_Get_Class_Registry_PropertyW(%p %lu %p %p %p %lx %p)\n",
2815  ClassGuid, ulProperty, pulRegDataType, Buffer, pulLength,
2816  ulFlags, hMachine);
2817 
2818  if (ClassGuid == NULL || pulLength == NULL)
2819  return CR_INVALID_POINTER;
2820 
2821  if (ulFlags != 0)
2822  return CR_INVALID_FLAG;
2823 
2824  if (pSetupStringFromGuid(ClassGuid,
2825  szGuidString,
2827  return CR_INVALID_DATA;
2828 
2829  if (ulProperty < CM_CRP_MIN || ulProperty > CM_CRP_MAX)
2830  return CR_INVALID_PROPERTY;
2831 
2832  if (hMachine != NULL)
2833  {
2834  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2835  if (BindingHandle == NULL)
2836  return CR_FAILURE;
2837  }
2838  else
2839  {
2841  return CR_FAILURE;
2842  }
2843 
2844  ulTransferLength = *pulLength;
2845 
2846  RpcTryExcept
2847  {
2849  szGuidString,
2850  ulProperty,
2851  &ulType,
2852  Buffer,
2853  &ulTransferLength,
2854  pulLength,
2855  ulFlags);
2856  }
2858  {
2860  }
2861  RpcEndExcept;
2862 
2863  if (ret == CR_SUCCESS)
2864  {
2865  if (pulRegDataType != NULL)
2866  *pulRegDataType = ulType;
2867  }
2868 
2869  return ret;
2870 }
#define RpcEndExcept
Definition: rpc.h:128
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
struct _MACHINE_INFO * PMACHINE_INFO
_In_ ULONG _Out_ HANDLE * BindingHandle
Definition: tdikrnl.h:1146
BOOL PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle, HSTRING_TABLE *StringTable)
Definition: rpc.c:66
#define RpcTryExcept
Definition: rpc.h:126
#define CR_SUCCESS
Definition: cfgmgr32.h:842
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
const unsigned long PNP_MAX_GUID_STRING_LEN
Definition: pnp.idl:9
smooth NULL
Definition: ftsmooth.c:416
#define CR_INVALID_PROPERTY
Definition: cfgmgr32.h:899
Definition: bufpool.h:45
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define CR_FAILURE
Definition: cfgmgr32.h:865
DWORD WINAPI pSetupStringFromGuid(LPGUID lpGUID, PWSTR pString, DWORD dwStringLen)
Definition: misc.c:1775
#define CR_INVALID_DATA
Definition: cfgmgr32.h:877
int ret
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:125
#define CM_CRP_MAX
Definition: cfgmgr32.h:733
DWORD WINAPI PNP_GetClassRegProp(handle_t hBinding, LPWSTR pszClassGuid, DWORD ulProperty, DWORD *pulRegDataType, BYTE *Buffer, PNP_RPC_STRING_LEN *pulTransferLen, PNP_RPC_STRING_LEN *pulLength, DWORD ulFlags)
Definition: umpnpmgr.c:2100
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
_In_z_ PCWSTR _In_ ULONG ulType
Definition: ntuser.h:36
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
unsigned int ULONG
Definition: retypes.h:1
#define RpcExcept(expr)
Definition: rpc.h:127

Referenced by CM_Get_Class_Registry_PropertyA().

◆ CM_Get_Depth()

CONFIGRET WINAPI CM_Get_Depth ( _Out_ PULONG  pulDepth,
_In_ DEVINST  dnDevInst,
_In_ ULONG  ulFlags 
)

Definition at line 2878 of file cfgmgr.c.

2882 {
2883  TRACE("CM_Get_Depth(%p %lx %lx)\n",
2884  pulDepth, dnDevInst, ulFlags);
2885 
2886  return CM_Get_Depth_Ex(pulDepth, dnDevInst, ulFlags, NULL);
2887 }
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
CONFIGRET WINAPI CM_Get_Depth_Ex(_Out_ PULONG pulDepth, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2895

◆ CM_Get_Depth_Ex()

CONFIGRET WINAPI CM_Get_Depth_Ex ( _Out_ PULONG  pulDepth,
_In_ DEVINST  dnDevInst,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 2895 of file cfgmgr.c.

2900 {
2902  HSTRING_TABLE StringTable = NULL;
2903  LPWSTR lpDevInst;
2904  CONFIGRET ret;
2905 
2906  TRACE("CM_Get_Depth_Ex(%p %lx %lx %p)\n",
2907  pulDepth, dnDevInst, ulFlags, hMachine);
2908 
2909  if (pulDepth == NULL)
2910  return CR_INVALID_POINTER;
2911 
2912  if (dnDevInst == 0)
2913  return CR_INVALID_DEVINST;
2914 
2915  if (ulFlags != 0)
2916  return CR_INVALID_FLAG;
2917 
2918  if (hMachine != NULL)
2919  {
2920  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2921  if (BindingHandle == NULL)
2922  return CR_FAILURE;
2923 
2924  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
2925  if (StringTable == 0)
2926  return CR_FAILURE;
2927  }
2928  else
2929  {
2930  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
2931  return CR_FAILURE;
2932  }
2933 
2934  lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
2935  if (lpDevInst == NULL)
2936  return CR_INVALID_DEVNODE;
2937 
2938  RpcTryExcept
2939  {
2941  lpDevInst,
2942  pulDepth,
2943  ulFlags);
2944  }
2946  {
2948  }
2949  RpcEndExcept;
2950 
2951  return ret;
2952 }
#define RpcEndExcept
Definition: rpc.h:128
#define CR_INVALID_DEVINST
Definition: cfgmgr32.h:848
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
struct _MACHINE_INFO * PMACHINE_INFO
_In_ ULONG _Out_ HANDLE * BindingHandle
Definition: tdikrnl.h:1146
BOOL PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle, HSTRING_TABLE *StringTable)
Definition: rpc.c:66
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define CR_FAILURE
Definition: cfgmgr32.h:865
int ret
#define CR_INVALID_DEVNODE
Definition: cfgmgr32.h:847
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:125
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LPWSTR WINAPI pSetupStringTableStringFromId(HSTRING_TABLE hStringTable, DWORD dwId)
Definition: stringtable.c:722
DWORD WINAPI PNP_GetDepth(handle_t hBinding, LPWSTR pszDeviceID, DWORD *pulDepth, DWORD ulFlags)
Definition: umpnpmgr.c:1340
#define RpcExcept(expr)
Definition: rpc.h:127

Referenced by CM_Get_Depth().

◆ CM_Get_Device_ID_ExA()

CONFIGRET WINAPI CM_Get_Device_ID_ExA ( _In_ DEVINST  dnDevInst,
_Out_writes_(BufferLen) PCHAR  Buffer,
_In_ ULONG  BufferLen,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 3518 of file cfgmgr.c.

3524 {
3525  WCHAR szBufferW[MAX_DEVICE_ID_LEN];
3527 
3528  TRACE("CM_Get_Device_ID_ExA(%lx %p %lu %lx %p)\n",
3529  dnDevInst, Buffer, BufferLen, ulFlags, hMachine);
3530 
3531  if (Buffer == NULL)
3532  return CR_INVALID_POINTER;
3533 
3534  ret = CM_Get_Device_ID_ExW(dnDevInst,
3535  szBufferW,
3537  ulFlags,
3538  hMachine);
3539  if (ret == CR_SUCCESS)
3540  {
3542  0,
3543  szBufferW,
3544  lstrlenW(szBufferW) + 1,
3545  Buffer,
3546  BufferLen,
3547  NULL,
3548  NULL) == 0)
3549  ret = CR_FAILURE;
3550  }
3551 
3552  return ret;
3553 }
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
#define MAX_DEVICE_ID_LEN
Definition: pnpmgr.c:28
#define lstrlenW
Definition: compat.h:407
CONFIGRET WINAPI CM_Get_Device_ID_ExW(_In_ DEVINST dnDevInst, _Out_writes_(BufferLen) PWCHAR Buffer, _In_ ULONG BufferLen, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:3561
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define CR_FAILURE
Definition: cfgmgr32.h:865
int ret
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845

Referenced by CM_Get_Device_IDA().

◆ CM_Get_Device_ID_ExW()

CONFIGRET WINAPI CM_Get_Device_ID_ExW ( _In_ DEVINST  dnDevInst,
_Out_writes_(BufferLen) PWCHAR  Buffer,
_In_ ULONG  BufferLen,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 3561 of file cfgmgr.c.

3567 {
3568  HSTRING_TABLE StringTable = NULL;
3569 
3570  TRACE("CM_Get_Device_ID_ExW(%lx %p %lu %lx %p)\n",
3571  dnDevInst, Buffer, BufferLen, ulFlags, hMachine);
3572 
3573  if (dnDevInst == 0)
3574  return CR_INVALID_DEVINST;
3575 
3576  if (Buffer == NULL)
3577  return CR_INVALID_POINTER;
3578 
3579  if (ulFlags != 0)
3580  return CR_INVALID_FLAG;
3581 
3582  if (hMachine != NULL)
3583  {
3584  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
3585  if (StringTable == NULL)
3586  return CR_FAILURE;
3587  }
3588  else
3589  {
3590  if (!PnpGetLocalHandles(NULL, &StringTable))
3591  return CR_FAILURE;
3592  }
3593 
3594  if (!pSetupStringTableStringFromIdEx(StringTable,
3595  dnDevInst,
3596  Buffer,
3597  &BufferLen))
3598  return CR_FAILURE;
3599 
3600  return CR_SUCCESS;
3601 }
BOOL WINAPI pSetupStringTableStringFromIdEx(HSTRING_TABLE hStringTable, DWORD dwId, LPWSTR lpBuffer, LPDWORD lpBufferLength)
Definition: stringtable.c:760
#define CR_INVALID_DEVINST
Definition: cfgmgr32.h:848
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
struct _MACHINE_INFO * PMACHINE_INFO
BOOL PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle, HSTRING_TABLE *StringTable)
Definition: rpc.c:66
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define TRACE(s)
Definition: solgame.cpp:4
#define CR_FAILURE
Definition: cfgmgr32.h:865
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845

Referenced by CM_Get_Device_ID_ExA(), and CM_Get_Device_IDW().

◆ CM_Get_Device_ID_List_ExA()

CONFIGRET WINAPI CM_Get_Device_ID_List_ExA ( _In_ PCSTR  pszFilter,
_Out_writes_(BufferLen) PCHAR  Buffer,
_In_ ULONG  BufferLen,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 3647 of file cfgmgr.c.

3653 {
3654  LPWSTR BufferW = NULL;
3655  LPWSTR pszFilterW = NULL;
3657 
3658  TRACE("CM_Get_Device_ID_List_ExA(%p %p %lu %lx %p)\n",
3659  pszFilter, Buffer, BufferLen, ulFlags, hMachine);
3660 
3661  BufferW = MyMalloc(BufferLen * sizeof(WCHAR));
3662  if (BufferW == NULL)
3663  return CR_OUT_OF_MEMORY;
3664 
3665  if (pszFilter == NULL)
3666  {
3668  BufferW,
3669  BufferLen,
3670  ulFlags,
3671  hMachine);
3672  }
3673  else