ReactOS 0.4.16-dev-306-g647d351
cfgmgr.c File Reference
#include "setupapi_private.h"
#include <dbt.h>
#include <pnp_c.h>
#include <winsvc.h>
#include <pseh/pseh2.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  _RES_DES_INFO
 
struct  _NOTIFY_DATA
 
struct  _INTERNAL_RANGE
 
struct  _INTERNAL_RANGE_LIST
 
struct  _CONFLICT_DATA
 

Macros

#define LOG_CONF_MAGIC   0x464E434C /* "LCNF" */
 
#define RES_DES_MAGIC   0x53445352 /* "RSDS" */
 
#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 _RES_DES_INFO RES_DES_INFO
 
typedef struct _RES_DES_INFOPRES_DES_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

DWORD WINAPI I_ScPnPGetServiceName (IN SERVICE_STATUS_HANDLE hServiceStatus, OUT LPWSTR lpServiceName, IN DWORD cchServiceName)
 
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 IsValidResDes (_In_opt_ PRES_DES_INFO pResDesInfo)
 
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_ DEVINST dnDevInst, _In_ ULONG ulHardwareProfile, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Delete_DevNode_Key_Ex (_In_ DEVINST dnDevInst, _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 BackslashOpenBrace [] = {'\\', '{', 0}
 
static const WCHAR CloseBrace [] = {'}', 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 117 of file cfgmgr.c.

◆ LOG_CONF_MAGIC

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

Definition at line 71 of file cfgmgr.c.

◆ NOTIFY_MAGIC

#define NOTIFY_MAGIC   0x44556677

Definition at line 91 of file cfgmgr.c.

◆ RANGE_LIST_MAGIC

#define RANGE_LIST_MAGIC   0x33445566

Definition at line 109 of file cfgmgr.c.

◆ RES_DES_MAGIC

#define RES_DES_MAGIC   0x53445352 /* "RSDS" */

Definition at line 83 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

◆ PRES_DES_INFO

◆ RES_DES_INFO

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 900 of file cfgmgr.c.

905{
906 TRACE("CM_Add_Empty_Log_Conf(%p %p %lu %lx)\n",
907 plcLogConf, dnDevInst, Priority, ulFlags);
908
909 return CM_Add_Empty_Log_Conf_Ex(plcLogConf, dnDevInst, Priority,
910 ulFlags, NULL);
911}
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:919
#define NULL
Definition: types.h:112
#define TRACE(s)
Definition: solgame.cpp:4
_In_ WDFINTERRUPT _In_ WDF_INTERRUPT_POLICY _In_ WDF_INTERRUPT_PRIORITY Priority
Definition: wdfinterrupt.h:655

◆ 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 919 of file cfgmgr.c.

925{
927 HSTRING_TABLE StringTable = NULL;
928 ULONG ulLogConfTag = 0;
929 LPWSTR lpDevInst;
930 PLOG_CONF_INFO pLogConfInfo;
932
933 FIXME("CM_Add_Empty_Log_Conf_Ex(%p %p %lu %lx %p)\n",
934 plcLogConf, dnDevInst, Priority, ulFlags, hMachine);
935
936 if (!pSetupIsUserAdmin())
937 return CR_ACCESS_DENIED;
938
939 if (plcLogConf == NULL)
940 return CR_INVALID_POINTER;
941
942 if (dnDevInst == 0)
943 return CR_INVALID_DEVINST;
944
945 if (Priority > 0xFFFF)
946 return CR_INVALID_PRIORITY;
947
948 if (ulFlags & ~(LOG_CONF_BITS | PRIORITY_BIT))
949 return CR_INVALID_FLAG;
950
951 if (hMachine != NULL)
952 {
953 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
954 if (BindingHandle == NULL)
955 return CR_FAILURE;
956
957 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
958 if (StringTable == 0)
959 return CR_FAILURE;
960 }
961 else
962 {
963 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
964 return CR_FAILURE;
965 }
966
967 lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
968 if (lpDevInst == NULL)
969 return CR_INVALID_DEVNODE;
970
972 {
974 &ulLogConfTag, ulFlags);
975 }
977 {
979 }
981
982 if (ret == CR_SUCCESS)
983 {
984 pLogConfInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(LOG_CONF_INFO));
985 if (pLogConfInfo == NULL)
986 {
988 }
989 else
990 {
991 pLogConfInfo->ulMagic = LOG_CONF_MAGIC;
992 pLogConfInfo->dnDevInst = dnDevInst;
993 pLogConfInfo->ulType = ulFlags;
994 pLogConfInfo->ulTag = ulLogConfTag;
995
996 *plcLogConf = (LOG_CONF)pLogConfInfo;
997
998 ret = CR_SUCCESS;
999 }
1000 }
1001
1002 return ret;
1003}
DWORD WINAPI PNP_AddEmptyLogConf(handle_t hBinding, LPWSTR pDeviceID, DWORD ulPriority, DWORD *pulLogConfTag, DWORD ulFlags)
Definition: rpcserver.c:4164
#define FIXME(fmt,...)
Definition: precomp.h:53
#define CR_OUT_OF_MEMORY
Definition: cfgmgr32.h:844
#define CR_INVALID_PRIORITY
Definition: cfgmgr32.h:885
DWORD_PTR LOG_CONF
Definition: cfgmgr32.h:90
#define CR_FAILURE
Definition: cfgmgr32.h:865
#define CR_INVALID_DEVINST
Definition: cfgmgr32.h:848
#define LOG_CONF_BITS
Definition: cfgmgr32.h:603
#define PRIORITY_BIT
Definition: cfgmgr32.h:607
#define CR_ACCESS_DENIED
Definition: cfgmgr32.h:897
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
#define CR_SUCCESS
Definition: cfgmgr32.h:842
#define CR_INVALID_DEVNODE
Definition: cfgmgr32.h:847
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:147
#define LOG_CONF_MAGIC
Definition: cfgmgr.c:71
struct _MACHINE_INFO * PMACHINE_INFO
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
BOOL WINAPI pSetupIsUserAdmin(VOID)
Definition: misc.c:1817
BOOL PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle, HSTRING_TABLE *StringTable)
Definition: rpc.c:66
LPWSTR WINAPI pSetupStringTableStringFromId(HSTRING_TABLE hStringTable, DWORD dwId)
Definition: stringtable.c:722
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:90
#define RpcEndExcept
Definition: rpc.h:128
#define RpcTryExcept
Definition: rpc.h:126
#define RpcExcept(expr)
Definition: rpc.h:127
#define RpcExceptionCode()
Definition: rpc.h:132
ULONG ulTag
Definition: cfgmgr.c:68
ULONG ulType
Definition: cfgmgr.c:67
DEVINST dnDevInst
Definition: cfgmgr.c:66
ULONG ulMagic
Definition: cfgmgr.c:65
_In_ ULONG _Out_ HANDLE * BindingHandle
Definition: tdikrnl.h:1147
uint32_t ULONG
Definition: typedefs.h:59
int ret
WCHAR * LPWSTR
Definition: xmlstorage.h:184

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 1045 of file cfgmgr.c.

1050{
1051 PWSTR pszIDW;
1052 CONFIGRET ret;
1053
1054 TRACE("CM_Add_ID_ExA(%p %s %lx %p)\n",
1055 dnDevInst, debugstr_a(pszID), ulFlags, hMachine);
1056
1057 if (pSetupCaptureAndConvertAnsiArg(pszID, &pszIDW))
1058 return CR_INVALID_DATA;
1059
1060 ret = CM_Add_ID_ExW(dnDevInst, pszIDW, ulFlags, hMachine);
1061
1062 MyFree(pszIDW);
1063
1064 return ret;
1065}
#define CR_INVALID_DATA
Definition: cfgmgr32.h:877
CONFIGRET WINAPI CM_Add_ID_ExW(_In_ DEVINST dnDevInst, _In_ PWSTR pszID, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:1073
DWORD WINAPI pSetupCaptureAndConvertAnsiArg(LPCSTR pSrc, LPWSTR *pDst)
Definition: misc.c:574
VOID WINAPI MyFree(LPVOID lpMem)
Definition: misc.c:128
#define debugstr_a
Definition: kernel32.h:31
uint16_t * PWSTR
Definition: typedefs.h:56

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 1073 of file cfgmgr.c.

1078{
1080 HSTRING_TABLE StringTable = NULL;
1081 LPWSTR lpDevInst;
1082 CONFIGRET ret;
1083
1084 TRACE("CM_Add_ID_ExW(%p %s %lx %p)\n",
1085 dnDevInst, debugstr_w(pszID), ulFlags, hMachine);
1086
1087 if (!pSetupIsUserAdmin())
1088 return CR_ACCESS_DENIED;
1089
1090 if (dnDevInst == 0)
1091 return CR_INVALID_DEVINST;
1092
1093 if (pszID == NULL)
1094 return CR_INVALID_POINTER;
1095
1096 if (ulFlags & ~CM_ADD_ID_BITS)
1097 return CR_INVALID_FLAG;
1098
1099 if (hMachine != NULL)
1100 {
1101 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1102 if (BindingHandle == NULL)
1103 return CR_FAILURE;
1104
1105 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
1106 if (StringTable == 0)
1107 return CR_FAILURE;
1108 }
1109 else
1110 {
1111 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
1112 return CR_FAILURE;
1113 }
1114
1115 lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
1116 if (lpDevInst == NULL)
1117 return CR_INVALID_DEVNODE;
1118
1120 {
1122 lpDevInst,
1123 pszID,
1124 ulFlags);
1125 }
1127 {
1129 }
1131
1132 return ret;
1133}
DWORD WINAPI PNP_AddID(handle_t hBinding, LPWSTR pszDeviceID, LPWSTR pszID, DWORD ulFlags)
Definition: rpcserver.c:3630
#define CM_ADD_ID_BITS
Definition: cfgmgr32.h:616
#define debugstr_w
Definition: kernel32.h:32

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 1011 of file cfgmgr.c.

1015{
1016 TRACE("CM_Add_IDA(%p %s %lx)\n",
1017 dnDevInst, debugstr_a(pszID), ulFlags);
1018
1019 return CM_Add_ID_ExA(dnDevInst, pszID, ulFlags, NULL);
1020}
CONFIGRET WINAPI CM_Add_ID_ExA(_In_ DEVINST dnDevInst, _In_ PSTR pszID, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:1045

◆ CM_Add_IDW()

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

Definition at line 1028 of file cfgmgr.c.

1032{
1033 TRACE("CM_Add_IDW(%p %s %lx)\n",
1034 dnDevInst, debugstr_w(pszID), ulFlags);
1035
1036 return CM_Add_ID_ExW(dnDevInst, pszID, ulFlags, NULL);
1037}

◆ CM_Add_Range()

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

Definition at line 1141 of file cfgmgr.c.

1146{
1147 PINTERNAL_RANGE_LIST pRangeList;
1148 PINTERNAL_RANGE pRange;
1150
1151 FIXME("CM_Add_Range(%I64u %I64u %p %lx)\n",
1152 ullStartValue, ullEndValue, rlh, ulFlags);
1153
1154 pRangeList = (PINTERNAL_RANGE_LIST)rlh;
1155
1156 if (!IsValidRangeList(pRangeList))
1157 return CR_INVALID_RANGE_LIST;
1158
1159 if (ulFlags & ~CM_ADD_RANGE_BITS)
1160 return CR_INVALID_FLAG;
1161
1162 if (ullEndValue < ullStartValue)
1163 return CR_INVALID_RANGE;
1164
1165 /* Lock the range list */
1166 WaitForSingleObject(pRangeList->hMutex, INFINITE);
1167
1168 /* Allocate the new range */
1169 pRange = HeapAlloc(GetProcessHeap(), 0, sizeof(INTERNAL_RANGE));
1170 if (pRange == NULL)
1171 {
1173 goto done;
1174 }
1175
1176 pRange->pRangeList = pRangeList;
1177 pRange->ullStart = ullStartValue;
1178 pRange->ullEnd = ullEndValue;
1179
1180 /* Insert the range */
1181 if (IsListEmpty(&pRangeList->ListHead))
1182 {
1183 InsertTailList(&pRangeList->ListHead, &pRange->ListEntry);
1184 }
1185 else
1186 {
1187 HeapFree(GetProcessHeap(), 0, pRange);
1189 }
1190
1191done:
1192 /* Unlock the range list */
1193 ReleaseMutex(pRangeList->hMutex);
1194
1195 return ret;
1196}
#define UNIMPLEMENTED
Definition: ntoskrnl.c:15
#define CM_ADD_RANGE_BITS
Definition: cfgmgr32.h:594
#define CR_INVALID_RANGE
Definition: cfgmgr32.h:864
#define CR_INVALID_RANGE_LIST
Definition: cfgmgr32.h:863
struct _INTERNAL_RANGE_LIST * PINTERNAL_RANGE_LIST
BOOL IsValidRangeList(_In_opt_ PINTERNAL_RANGE_LIST pRangeList)
Definition: cfgmgr.c:401
#define HeapFree(x, y, z)
Definition: compat.h:735
#define INFINITE
Definition: serial.h:102
#define InsertTailList(ListHead, Entry)
#define IsListEmpty(ListHead)
Definition: env_spec_w32.h:954
LIST_ENTRY ListHead
Definition: cfgmgr.c:106
DWORDLONG ullEnd
Definition: cfgmgr.c:99
DWORDLONG ullStart
Definition: cfgmgr.c:98
struct _INTERNAL_RANGE_LIST * pRangeList
Definition: cfgmgr.c:97
LIST_ENTRY ListEntry
Definition: cfgmgr.c:96
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseMutex(IN HANDLE hMutex)
Definition: synch.c:618

◆ 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 1204 of file cfgmgr.c.

1211{
1212 TRACE("CM_Add_Res_Des(%p %p %lu %p %lu %lx)\n",
1213 prdResDes, lcLogConf, ResourceID, ResourceData, ResourceLen, ulFlags);
1214
1215 return CM_Add_Res_Des_Ex(prdResDes, lcLogConf, ResourceID, ResourceData,
1216 ResourceLen, ulFlags, NULL);
1217}
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:1225

◆ 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 1225 of file cfgmgr.c.

1233{
1234 FIXME("CM_Add_Res_Des_Ex(%p %p %lu %p %lu %lx %p)\n",
1235 prdResDes, lcLogConf, ResourceID,
1236 ResourceData, ResourceLen, ulFlags, hMachine);
1237
1239}
#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 1247 of file cfgmgr.c.

1250{
1251 PWSTR pServerNameW;
1252 CONFIGRET ret;
1253
1254 TRACE("CM_Connect_MachineA(%s %p)\n",
1255 debugstr_a(UNCServerName), phMachine);
1256
1257 if (UNCServerName == NULL || *UNCServerName == 0)
1258 return CM_Connect_MachineW(NULL, phMachine);
1259
1260 if (pSetupCaptureAndConvertAnsiArg(UNCServerName, &pServerNameW))
1261 return CR_INVALID_DATA;
1262
1263 ret = CM_Connect_MachineW(pServerNameW, phMachine);
1264
1265 MyFree(pServerNameW);
1266
1267 return ret;
1268}
CONFIGRET WINAPI CM_Connect_MachineW(_In_opt_ PCWSTR UNCServerName, _Out_ PHMACHINE phMachine)
Definition: cfgmgr.c:1276

◆ CM_Connect_MachineW()

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

Definition at line 1276 of file cfgmgr.c.

1279{
1280 PMACHINE_INFO pMachine;
1281
1282 TRACE("CM_Connect_MachineW(%s %p)\n",
1283 debugstr_w(UNCServerName), phMachine);
1284
1285 if (phMachine == NULL)
1286 return CR_INVALID_POINTER;
1287
1288 *phMachine = NULL;
1289
1290 pMachine = HeapAlloc(GetProcessHeap(), 0, sizeof(MACHINE_INFO));
1291 if (pMachine == NULL)
1292 return CR_OUT_OF_MEMORY;
1293
1294 if (UNCServerName == NULL || *UNCServerName == 0)
1295 {
1296 pMachine->bLocal = TRUE;
1297
1298 /* FIXME: store the computers name in pMachine->szMachineName */
1299
1300 if (!PnpGetLocalHandles(&pMachine->BindingHandle,
1301 &pMachine->StringTable))
1302 {
1303 HeapFree(GetProcessHeap(), 0, pMachine);
1304 return CR_FAILURE;
1305 }
1306 }
1307 else
1308 {
1309 pMachine->bLocal = FALSE;
1310 if (wcslen(UNCServerName) >= SP_MAX_MACHINENAME_LENGTH - 1)
1311 {
1312 HeapFree(GetProcessHeap(), 0, pMachine);
1314 }
1315 lstrcpyW(pMachine->szMachineName, UNCServerName);
1316
1318 if (pMachine->StringTable == NULL)
1319 {
1320 HeapFree(GetProcessHeap(), 0, pMachine);
1321 return CR_FAILURE;
1322 }
1323
1324 pSetupStringTableAddString(pMachine->StringTable, L"PLT", 1);
1325
1326 if (!PnpBindRpc(UNCServerName, &pMachine->BindingHandle))
1327 {
1329 HeapFree(GetProcessHeap(), 0, pMachine);
1331 }
1332 }
1333
1334 *phMachine = (PHMACHINE)pMachine;
1335
1336 return CR_SUCCESS;
1337}
HMACHINE * PHMACHINE
Definition: cfgmgr32.h:109
#define CR_INVALID_MACHINENAME
Definition: cfgmgr32.h:893
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define lstrcpyW
Definition: compat.h:749
RPC_STATUS PnpBindRpc(LPCWSTR pszMachine, RPC_BINDING_HANDLE *BindingHandle)
Definition: rpc.c:28
HSTRING_TABLE WINAPI pSetupStringTableInitialize(VOID)
Definition: stringtable.c:54
DWORD WINAPI pSetupStringTableAddString(HSTRING_TABLE hStringTable, LPWSTR lpString, DWORD dwFlags)
Definition: stringtable.c:196
VOID WINAPI pSetupStringTableDestroy(HSTRING_TABLE hStringTable)
Definition: stringtable.c:145
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define L(x)
Definition: ntvdm.h:50
#define SP_MAX_MACHINENAME_LENGTH
Definition: setupapi.h:27
WCHAR szMachineName[SP_MAX_MACHINENAME_LENGTH]
Definition: cfgmgr.c:56
HSTRING_TABLE StringTable
Definition: cfgmgr.c:58
RPC_BINDING_HANDLE BindingHandle
Definition: cfgmgr.c:57
BOOL bLocal
Definition: cfgmgr.c:59

Referenced by CM_Connect_MachineA(), SetupDiBuildClassInfoListExW(), 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 1383 of file cfgmgr.c.

1389{
1390 DEVINSTID_W pDeviceIDW;
1391 CONFIGRET ret;
1392
1393 TRACE("CM_Create_DevNode_ExA(%p %s %p %lx %p)\n",
1394 pdnDevInst, debugstr_a(pDeviceID), dnParent, ulFlags, hMachine);
1395
1396 if (pSetupCaptureAndConvertAnsiArg(pDeviceID, &pDeviceIDW))
1397 return CR_INVALID_DATA;
1398
1399 ret = CM_Create_DevNode_ExW(pdnDevInst, pDeviceIDW, dnParent, ulFlags,
1400 hMachine);
1401
1402 MyFree(pDeviceIDW);
1403
1404 return ret;
1405}
_Null_terminated_ WCHAR * DEVINSTID_W
Definition: cfgmgr32.h:80
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:1413

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 1413 of file cfgmgr.c.

1419{
1421 HSTRING_TABLE StringTable = NULL;
1422 LPWSTR lpParentDevInst;
1424 WCHAR szLocalDeviceID[MAX_DEVICE_ID_LEN];
1425
1426 TRACE("CM_Create_DevNode_ExW(%p %s %p %lx %p)\n",
1427 pdnDevInst, debugstr_w(pDeviceID), dnParent, ulFlags, hMachine);
1428
1429 if (!pSetupIsUserAdmin())
1430 return CR_ACCESS_DENIED;
1431
1432 if (pdnDevInst == NULL)
1433 return CR_INVALID_POINTER;
1434
1435 if (pDeviceID == NULL || wcslen(pDeviceID) == 0 || wcslen(pDeviceID) >= MAX_DEVICE_ID_LEN)
1436 return CR_INVALID_DEVICE_ID;
1437
1438 if (dnParent == 0)
1439 return CR_INVALID_DEVNODE;
1440
1441 if (ulFlags & ~CM_CREATE_DEVNODE_BITS)
1442 return CR_INVALID_FLAG;
1443
1444 if (hMachine != NULL)
1445 {
1446 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1447 if (BindingHandle == NULL)
1448 return CR_FAILURE;
1449
1450 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
1451 if (StringTable == 0)
1452 return CR_FAILURE;
1453 }
1454 else
1455 {
1456 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
1457 return CR_FAILURE;
1458 }
1459
1460 lpParentDevInst = pSetupStringTableStringFromId(StringTable, dnParent);
1461 if (lpParentDevInst == NULL)
1462 return CR_INVALID_DEVNODE;
1463
1464 wcscpy(szLocalDeviceID, pDeviceID);
1465
1467 {
1469 szLocalDeviceID,
1470 lpParentDevInst,
1472 ulFlags);
1473 }
1475 {
1477 }
1479
1480 if (ret == CR_SUCCESS)
1481 {
1482 /* If CM_CREATE_DEVINST_GENERATE_ID was passed in, PNP_CreateDevInst
1483 * will return the generated device ID in szLocalDeviceID */
1484 *pdnDevInst = pSetupStringTableAddString(StringTable, szLocalDeviceID, 1);
1485 if (*pdnDevInst == 0)
1487 }
1488
1489 return ret;
1490}
DWORD WINAPI PNP_CreateDevInst(handle_t hBinding, LPWSTR pszDeviceID, LPWSTR pszParentDeviceID, PNP_RPC_STRING_LEN ulLength, DWORD ulFlags)
Definition: rpcserver.c:3129
#define CR_INVALID_DEVICE_ID
Definition: cfgmgr32.h:876
#define CR_NO_SUCH_DEVNODE
Definition: cfgmgr32.h:857
#define CM_CREATE_DEVNODE_BITS
Definition: cfgmgr32.h:624
#define MAX_DEVICE_ID_LEN
Definition: devaction.c:40
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
__wchar_t WCHAR
Definition: xmlstorage.h:180

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 1345 of file cfgmgr.c.

1350{
1351 TRACE("CM_Create_DevNodeA(%p %s %p %lx)\n",
1352 pdnDevInst, debugstr_a(pDeviceID), dnParent, ulFlags);
1353
1354 return CM_Create_DevNode_ExA(pdnDevInst, pDeviceID, dnParent,
1355 ulFlags, NULL);
1356}
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:1383

◆ CM_Create_DevNodeW()

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

Definition at line 1364 of file cfgmgr.c.

1369{
1370 TRACE("CM_Create_DevNodeW(%p %s %p %lx)\n",
1371 pdnDevInst, debugstr_w(pDeviceID), dnParent, ulFlags);
1372
1373 return CM_Create_DevNode_ExW(pdnDevInst, pDeviceID, dnParent,
1374 ulFlags, NULL);
1375}

◆ CM_Create_Range_List()

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

Definition at line 1498 of file cfgmgr.c.

1501{
1502 PINTERNAL_RANGE_LIST pRangeList;
1503
1504 FIXME("CM_Create_Range_List(%p %lx)\n",
1505 prlh, ulFlags);
1506
1507 if (ulFlags != 0)
1508 return CR_INVALID_FLAG;
1509
1510 if (prlh == NULL)
1511 return CR_INVALID_POINTER;
1512
1513 /* Allocate the range list */
1515 if (pRangeList == NULL)
1516 return CR_OUT_OF_MEMORY;
1517
1518 /* Set the magic value */
1519 pRangeList->ulMagic = RANGE_LIST_MAGIC;
1520
1521 /* Initialize the mutex for synchonized access */
1522 pRangeList->hMutex = CreateMutex(NULL, FALSE, NULL);
1523 if (pRangeList->hMutex == NULL)
1524 {
1525 HeapFree(GetProcessHeap(), 0, pRangeList);
1526 return CR_FAILURE;
1527 }
1528
1529 InitializeListHead(&pRangeList->ListHead);
1530
1531 *prlh = (RANGE_LIST)pRangeList;
1532
1533 return CR_SUCCESS;
1534}
DWORD_PTR RANGE_LIST
Definition: cfgmgr32.h:102
#define RANGE_LIST_MAGIC
Definition: cfgmgr.c:109
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define CreateMutex
Definition: winbase.h:3781

◆ CM_Delete_Class_Key()

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

Definition at line 1542 of file cfgmgr.c.

1545{
1546 TRACE("CM_Delete_Class_Key(%p %lx)\n",
1547 ClassGuid, ulFlags);
1548
1549 return CM_Delete_Class_Key_Ex(ClassGuid, ulFlags, NULL);
1550}
CONFIGRET WINAPI CM_Delete_Class_Key_Ex(_In_ LPGUID ClassGuid, _In_ ULONG ulFlags, _In_opt_ HANDLE hMachine)
Definition: cfgmgr.c:1558

◆ 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 1558 of file cfgmgr.c.

1562{
1563 WCHAR szGuidString[MAX_GUID_STRING_LEN];
1565 CONFIGRET ret;
1566
1567 TRACE("CM_Delete_Class_Key_Ex(%p %lx %p)\n",
1568 ClassGuid, ulFlags, hMachine);
1569
1570 if (ClassGuid == NULL)
1571 return CR_INVALID_POINTER;
1572
1573 if (ulFlags & ~CM_DELETE_CLASS_BITS)
1574 return CR_INVALID_FLAG;
1575
1576 if (!GuidToString(ClassGuid, szGuidString))
1577 return CR_INVALID_DATA;
1578
1579 if (hMachine != NULL)
1580 {
1581 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1582 if (BindingHandle == NULL)
1583 return CR_FAILURE;
1584 }
1585 else
1586 {
1588 return CR_FAILURE;
1589 }
1590
1592 {
1594 szGuidString,
1595 ulFlags);
1596 }
1598 {
1600 }
1602
1603 return ret;
1604}
DWORD WINAPI PNP_DeleteClassKey(handle_t hBinding, LPWSTR pszClassGuid, DWORD ulFlags)
Definition: rpcserver.c:2555
#define CM_DELETE_CLASS_BITS
Definition: cfgmgr32.h:639
static BOOL GuidToString(_In_ LPGUID Guid, _Out_ LPWSTR String)
Definition: cfgmgr.c:124
#define MAX_GUID_STRING_LEN
Definition: apphelp.c:29

Referenced by CM_Delete_Class_Key().

◆ CM_Delete_DevNode_Key()

CONFIGRET WINAPI CM_Delete_DevNode_Key ( _In_ DEVINST  dnDevInst,
_In_ ULONG  ulHardwareProfile,
_In_ ULONG  ulFlags 
)

Definition at line 1612 of file cfgmgr.c.

1616{
1617 TRACE("CM_Delete_DevNode_Key(%p %lu %lx)\n",
1618 dnDevInst, ulHardwareProfile, ulFlags);
1619
1620 return CM_Delete_DevNode_Key_Ex(dnDevInst, ulHardwareProfile, ulFlags,
1621 NULL);
1622}
CONFIGRET WINAPI CM_Delete_DevNode_Key_Ex(_In_ DEVINST dnDevInst, _In_ ULONG ulHardwareProfile, _In_ ULONG ulFlags, _In_opt_ HANDLE hMachine)
Definition: cfgmgr.c:1630

◆ CM_Delete_DevNode_Key_Ex()

CONFIGRET WINAPI CM_Delete_DevNode_Key_Ex ( _In_ DEVINST  dnDevInst,
_In_ ULONG  ulHardwareProfile,
_In_ ULONG  ulFlags,
_In_opt_ HANDLE  hMachine 
)

Definition at line 1630 of file cfgmgr.c.

1635{
1637 HSTRING_TABLE StringTable = NULL;
1638 PWSTR pszDevInst, pszKeyPath = NULL, pszInstancePath = NULL;
1639 CONFIGRET ret;
1640
1641 FIXME("CM_Delete_DevNode_Key_Ex(%p %lu %lx %p)\n",
1642 dnDevInst, ulHardwareProfile, ulFlags, hMachine);
1643
1644 if (dnDevInst == 0)
1645 return CR_INVALID_DEVINST;
1646
1647 if (ulFlags & ~CM_REGISTRY_BITS)
1648 return CR_INVALID_FLAG;
1649
1650 if ((ulFlags & CM_REGISTRY_USER) && (ulFlags & CM_REGISTRY_CONFIG))
1651 return CR_INVALID_FLAG;
1652
1653 if (hMachine != NULL)
1654 {
1655 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1656 if (BindingHandle == NULL)
1657 return CR_FAILURE;
1658
1659 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
1660 if (StringTable == 0)
1661 return CR_FAILURE;
1662 }
1663 else
1664 {
1665 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
1666 return CR_FAILURE;
1667 }
1668
1669 pszDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
1670 if (pszDevInst == NULL)
1671 return CR_INVALID_DEVNODE;
1672
1673 TRACE("pszDevInst: %S\n", pszDevInst);
1674
1675 pszKeyPath = MyMalloc(512 * sizeof(WCHAR));
1676 if (pszKeyPath == NULL)
1677 {
1679 goto done;
1680 }
1681
1682 pszInstancePath = MyMalloc(512 * sizeof(WCHAR));
1683 if (pszInstancePath == NULL)
1684 {
1686 goto done;
1687 }
1688
1690 pszDevInst,
1691 pszKeyPath,
1692 pszInstancePath,
1693 ulHardwareProfile,
1694 ulFlags);
1695 if (ret != CR_SUCCESS)
1696 goto done;
1697
1698 TRACE("pszKeyPath: %S\n", pszKeyPath);
1699 TRACE("pszInstancePath: %S\n", pszInstancePath);
1700
1701 if (ulFlags & CM_REGISTRY_USER)
1702 {
1703 FIXME("The CM_REGISTRY_USER flag is not supported yet!\n");
1704 }
1705 else
1706 {
1707#if 0
1708 if (!pSetupIsUserAdmin())
1709 {
1711 goto done;
1712 }
1713#endif
1714
1715 if (!(ulFlags & CM_REGISTRY_CONFIG))
1716 ulHardwareProfile = 0;
1717
1719 {
1721 pszDevInst,
1722 pszKeyPath,
1723 pszInstancePath,
1724 ulHardwareProfile);
1725 }
1727 {
1729 }
1731 }
1732
1733done:
1734 if (pszInstancePath != NULL)
1735 MyFree(pszInstancePath);
1736
1737 if (pszKeyPath != NULL)
1738 MyFree(pszKeyPath);
1739
1740 return ret;
1741}
DWORD WINAPI PNP_DeleteRegistryKey(handle_t hBinding, LPWSTR pszDeviceID, LPWSTR pszParentKey, LPWSTR pszChildKey, DWORD ulFlags)
Definition: rpcserver.c:2437
#define CM_REGISTRY_BITS
Definition: cfgmgr32.h:804
#define CM_REGISTRY_USER
Definition: cfgmgr32.h:802
#define CM_REGISTRY_CONFIG
Definition: cfgmgr32.h:803
static CONFIGRET GetDeviceInstanceKeyPath(_In_ RPC_BINDING_HANDLE BindingHandle, _In_ PWSTR pszDeviceInst, _Out_ PWSTR pszKeyPath, _Out_ PWSTR pszInstancePath, _In_ ULONG ulHardwareProfile, _In_ ULONG ulFlags)
Definition: cfgmgr.c:235
LPVOID WINAPI MyMalloc(DWORD dwSize)
Definition: misc.c:147

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 1749 of file cfgmgr.c.

1754{
1755 FIXME("CM_Delete_Range(%I64u %I64u %p %lx)\n",
1756 ullStartValue, ullEndValue, rlh, ulFlags);
1757
1759}

◆ 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 1767 of file cfgmgr.c.

1774{
1775 TRACE("CM_Detect_Resource_Conflict(%p %lu %p %lu %p 0x%lx)\n",
1776 dnDevInst, ResourceID, ResourceData, ResourceLen,
1777 pbConflictDetected, ulFlags);
1778
1779 return CM_Detect_Resource_Conflict_Ex(dnDevInst,
1780 ResourceID,
1781 ResourceData,
1782 ResourceLen,
1783 pbConflictDetected,
1784 ulFlags,
1785 NULL);
1786}
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:1794

◆ 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 1794 of file cfgmgr.c.

1802{
1803 FIXME("CM_Detect_Resource_Conflict_Ex(%p %lu %p %lu %p 0x%lx %p)\n",
1804 dnDevInst, ResourceID, ResourceData, ResourceLen,
1805 pbConflictDetected, ulFlags, hMachine);
1806
1808}

Referenced by CM_Detect_Resource_Conflict().

◆ CM_Disable_DevNode()

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

Definition at line 1816 of file cfgmgr.c.

1819{
1820 TRACE("CM_Disable_DevNode(%p %lx)\n",
1821 dnDevInst, ulFlags);
1822
1823 return CM_Disable_DevNode_Ex(dnDevInst, ulFlags, NULL);
1824}
CONFIGRET WINAPI CM_Disable_DevNode_Ex(_In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:1832

◆ CM_Disable_DevNode_Ex()

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

Definition at line 1832 of file cfgmgr.c.

1836{
1838 HSTRING_TABLE StringTable = NULL;
1839 LPWSTR lpDevInst;
1840 CONFIGRET ret;
1841
1842 TRACE("CM_Disable_DevNode_Ex(%p %lx %p)\n",
1843 dnDevInst, ulFlags, hMachine);
1844
1845 if (!pSetupIsUserAdmin())
1846 return CR_ACCESS_DENIED;
1847
1848 if (dnDevInst == 0)
1849 return CR_INVALID_DEVINST;
1850
1851 if (ulFlags != 0)
1852 return CR_INVALID_FLAG;
1853
1854 if (hMachine != NULL)
1855 {
1856 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1857 if (BindingHandle == NULL)
1858 return CR_FAILURE;
1859
1860 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
1861 if (StringTable == 0)
1862 return CR_FAILURE;
1863 }
1864 else
1865 {
1866 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
1867 return CR_FAILURE;
1868 }
1869
1870 lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
1871 if (lpDevInst == NULL)
1872 return CR_INVALID_DEVNODE;
1873
1875 {
1877 lpDevInst,
1878 NULL,
1879 NULL,
1880 0,
1881 ulFlags);
1882 }
1884 {
1886 }
1888
1889 return ret;
1890}
DWORD WINAPI PNP_DisableDevInst(handle_t hBinding, LPWSTR pDeviceID, PPNP_VETO_TYPE pVetoType, LPWSTR pszVetoName, DWORD ulNameLength, DWORD ulFlags)
Definition: rpcserver.c:3545

Referenced by CM_Disable_DevNode(), and StopDevice().

◆ CM_Disconnect_Machine()

CONFIGRET WINAPI CM_Disconnect_Machine ( _In_opt_ HMACHINE  hMachine)

Definition at line 1898 of file cfgmgr.c.

1900{
1901 PMACHINE_INFO pMachine;
1902
1903 TRACE("CM_Disconnect_Machine(%p)\n", hMachine);
1904
1905 pMachine = (PMACHINE_INFO)hMachine;
1906 if (pMachine == NULL)
1907 return CR_SUCCESS;
1908
1909 if (pMachine->bLocal == FALSE)
1910 {
1911 if (pMachine->StringTable != NULL)
1913
1914 if (!PnpUnbindRpc(pMachine->BindingHandle))
1915 return CR_ACCESS_DENIED;
1916 }
1917
1918 HeapFree(GetProcessHeap(), 0, pMachine);
1919
1920 return CR_SUCCESS;
1921}
RPC_STATUS PnpUnbindRpc(RPC_BINDING_HANDLE *BindingHandle)
Definition: rpc.c:53

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

◆ CM_Dup_Range_List()

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

Definition at line 1929 of file cfgmgr.c.

1933{
1934 PINTERNAL_RANGE_LIST pOldRangeList, pNewRangeList;
1935 PINTERNAL_RANGE pOldRange, pNewRange;
1936 PLIST_ENTRY ListEntry;
1938
1939 FIXME("CM_Dup_Range_List(%p %p %lx)\n",
1940 rlhOld, rlhNew, ulFlags);
1941
1942 pOldRangeList = (PINTERNAL_RANGE_LIST)rlhOld;
1943 pNewRangeList = (PINTERNAL_RANGE_LIST)rlhNew;
1944
1945 if (!IsValidRangeList(pOldRangeList))
1946 return CR_INVALID_RANGE_LIST;
1947
1948 if (!IsValidRangeList(pNewRangeList))
1949 return CR_INVALID_RANGE_LIST;
1950
1951 if (ulFlags != 0)
1952 return CR_INVALID_FLAG;
1953
1954 /* Lock the range lists */
1955 WaitForSingleObject(pOldRangeList->hMutex, INFINITE);
1956 WaitForSingleObject(pNewRangeList->hMutex, INFINITE);
1957
1958 /* Delete the new range list, if ist is not empty */
1959 while (!IsListEmpty(&pNewRangeList->ListHead))
1960 {
1961 ListEntry = RemoveHeadList(&pNewRangeList->ListHead);
1962 pNewRange = CONTAINING_RECORD(ListEntry, INTERNAL_RANGE, ListEntry);
1963 HeapFree(GetProcessHeap(), 0, pNewRange);
1964 }
1965
1966 /* Copy the old range list into the new range list */
1967 ListEntry = &pOldRangeList->ListHead;
1968 while (ListEntry->Flink == &pOldRangeList->ListHead)
1969 {
1970 pOldRange = CONTAINING_RECORD(ListEntry, INTERNAL_RANGE, ListEntry);
1971
1972 pNewRange = HeapAlloc(GetProcessHeap(), 0, sizeof(INTERNAL_RANGE));
1973 if (pNewRange == NULL)
1974 {
1976 goto done;
1977 }
1978
1979 pNewRange->pRangeList = pNewRangeList;
1980 pNewRange->ullStart = pOldRange->ullStart;
1981 pNewRange->ullEnd = pOldRange->ullEnd;
1982
1983 InsertTailList(&pNewRangeList->ListHead, &pNewRange->ListEntry);
1984
1985 ListEntry = ListEntry->Flink;
1986 }
1987
1988done:
1989 /* Unlock the range lists */
1990 ReleaseMutex(pNewRangeList->hMutex);
1991 ReleaseMutex(pOldRangeList->hMutex);
1992
1993 return ret;
1994}
#define RemoveHeadList(ListHead)
Definition: env_spec_w32.h:964
Definition: typedefs.h:120
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

◆ CM_Enable_DevNode()

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

Definition at line 2002 of file cfgmgr.c.

2005{
2006 TRACE("CM_Enable_DevNode(%p %lx)\n",
2007 dnDevInst, ulFlags);
2008
2009 return CM_Enable_DevNode_Ex(dnDevInst, ulFlags, NULL);
2010}
CONFIGRET WINAPI CM_Enable_DevNode_Ex(_In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2018

◆ CM_Enable_DevNode_Ex()

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

Definition at line 2018 of file cfgmgr.c.

2022{
2024 HSTRING_TABLE StringTable = NULL;
2025 LPWSTR lpDevInst;
2026 CONFIGRET ret;
2027
2028 TRACE("CM_Enable_DevNode_Ex(%p %lx %p)\n",
2029 dnDevInst, ulFlags, hMachine);
2030
2031 if (!pSetupIsUserAdmin())
2032 return CR_ACCESS_DENIED;
2033
2034 if (dnDevInst == 0)
2035 return CR_INVALID_DEVINST;
2036
2037 if (ulFlags != 0)
2038 return CR_INVALID_FLAG;
2039
2040 if (hMachine != NULL)
2041 {
2042 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2043 if (BindingHandle == NULL)
2044 return CR_FAILURE;
2045
2046 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
2047 if (StringTable == 0)
2048 return CR_FAILURE;
2049 }
2050 else
2051 {
2052 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
2053 return CR_FAILURE;
2054 }
2055
2056 lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
2057 if (lpDevInst == NULL)
2058 return CR_INVALID_DEVNODE;
2059
2061 {
2063 PNP_DEVINST_ENABLE,
2064 ulFlags,
2065 lpDevInst,
2066 NULL);
2067 }
2069 {
2071 }
2073
2074 return ret;
2075}
DWORD WINAPI PNP_DeviceInstanceAction(handle_t hBinding, DWORD ulMajorAction, DWORD ulMinorAction, LPWSTR pszDeviceInstance1, LPWSTR pszDeviceInstance2)
Definition: rpcserver.c:3369

Referenced by CM_Enable_DevNode(), ResetDevice(), and SetupDiRestartDevices().

◆ CM_Enumerate_Classes()

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

Definition at line 2083 of file cfgmgr.c.

2087{
2088 TRACE("CM_Enumerate_Classes(%lx %p %lx)\n",
2089 ulClassIndex, ClassGuid, ulFlags);
2090
2091 return CM_Enumerate_Classes_Ex(ulClassIndex, ClassGuid, ulFlags, NULL);
2092}
CONFIGRET WINAPI CM_Enumerate_Classes_Ex(_In_ ULONG ulClassIndex, _Out_ LPGUID ClassGuid, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2100

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 2100 of file cfgmgr.c.

2105{
2106 WCHAR szBuffer[MAX_GUID_STRING_LEN];
2109 ULONG ulLength = MAX_GUID_STRING_LEN;
2110
2111 TRACE("CM_Enumerate_Classes_Ex(%lx %p %lx %p)\n",
2112 ulClassIndex, ClassGuid, ulFlags, hMachine);
2113
2114 if (ClassGuid == NULL)
2115 return CR_INVALID_POINTER;
2116
2117 if (ulFlags != 0)
2118 return CR_INVALID_FLAG;
2119
2120 if (hMachine != NULL)
2121 {
2122 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2123 if (BindingHandle == NULL)
2124 return CR_FAILURE;
2125 }
2126 else
2127 {
2129 return CR_FAILURE;
2130 }
2131
2133 {
2135 PNP_CLASS_SUBKEYS,
2136 ulClassIndex,
2137 szBuffer,
2139 &ulLength,
2140 ulFlags);
2141 }
2143 {
2145 }
2147
2148 if (ret == CR_SUCCESS)
2149 {
2150 /* Remove the {} */
2151 szBuffer[MAX_GUID_STRING_LEN - 2] = UNICODE_NULL;
2152
2153 /* Convert the buffer to a GUID */
2154 if (UuidFromStringW(&szBuffer[1], ClassGuid) != RPC_S_OK)
2155 return CR_FAILURE;
2156 }
2157
2158 return ret;
2159}
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: rpcserver.c:928
#define UNICODE_NULL
#define RPC_S_OK
Definition: rpcnterr.h:22
RPC_STATUS WINAPI UuidFromStringW(RPC_WSTR s, UUID *uuid)
Definition: rpcrt4_main.c:614

Referenced by CM_Enumerate_Classes(), and SetupDiBuildClassInfoListExW().

◆ 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 2205 of file cfgmgr.c.

2211{
2212 WCHAR szBuffer[MAX_DEVICE_ID_LEN];
2213 ULONG ulOrigLength;
2214 ULONG ulLength;
2216
2217 TRACE("CM_Enumerate_Enumerators_ExA(%lu %p %p %lx %p)\n",
2218 ulEnumIndex, Buffer, pulLength, ulFlags, hMachine);
2219
2220 if (Buffer == NULL || pulLength == NULL)
2221 return CR_INVALID_POINTER;
2222
2223 if (ulFlags != 0)
2224 return CR_INVALID_FLAG;
2225
2226 ulOrigLength = *pulLength;
2227 *pulLength = 0;
2228
2229 ulLength = MAX_DEVICE_ID_LEN;
2230 ret = CM_Enumerate_Enumerators_ExW(ulEnumIndex, szBuffer, &ulLength,
2231 ulFlags, hMachine);
2232 if (ret == CR_SUCCESS)
2233 {
2235 0,
2236 szBuffer,
2237 ulLength,
2238 Buffer,
2239 ulOrigLength,
2240 NULL,
2241 NULL) == 0)
2242 ret = CR_FAILURE;
2243 else
2244 *pulLength = lstrlenA(Buffer) + 1;
2245 }
2246
2247 return ret;
2248}
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:2256
Definition: bufpool.h:45
#define CP_ACP
Definition: compat.h:109
#define WideCharToMultiByte
Definition: compat.h:111
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145

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 2256 of file cfgmgr.c.

2262{
2264 CONFIGRET ret;
2265
2266 TRACE("CM_Enumerate_Enumerators_ExW(%lu %p %p %lx %p)\n",
2267 ulEnumIndex, Buffer, pulLength, ulFlags, hMachine);
2268
2269 if (Buffer == NULL || pulLength == NULL)
2270 return CR_INVALID_POINTER;
2271
2272 if (ulFlags != 0)
2273 return CR_INVALID_FLAG;
2274
2276
2277 if (hMachine != NULL)
2278 {
2279 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2280 if (BindingHandle == NULL)
2281 return CR_FAILURE;
2282 }
2283 else
2284 {
2286 return CR_FAILURE;
2287 }
2288
2290 {
2292 PNP_ENUMERATOR_SUBKEYS,
2293 ulEnumIndex,
2294 Buffer,
2295 *pulLength,
2296 pulLength,
2297 ulFlags);
2298 }
2300 {
2302 }
2304
2305 return ret;
2306}

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 2167 of file cfgmgr.c.

2172{
2173 TRACE("CM_Enumerate_EnumeratorsA(%lu %p %p %lx)\n",
2174 ulEnumIndex, Buffer, pulLength, ulFlags);
2175
2176 return CM_Enumerate_Enumerators_ExA(ulEnumIndex, Buffer, pulLength,
2177 ulFlags, NULL);
2178}
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:2205

◆ 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 2186 of file cfgmgr.c.

2191{
2192 TRACE("CM_Enumerate_EnumeratorsW(%lu %p %p %lx)\n",
2193 ulEnumIndex, Buffer, pulLength, ulFlags);
2194
2195 return CM_Enumerate_Enumerators_ExW(ulEnumIndex, Buffer, pulLength,
2196 ulFlags, NULL);
2197}

◆ 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 2314 of file cfgmgr.c.

2322{
2323 FIXME("CM_Find_Range(%p %I64u %lu %I64u %I64u %p %lx)\n",
2324 pullStart, ullStart, ulLength, ullAlignment, ullEnd, rlh, ulFlags);
2325
2327}

◆ 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 2335 of file cfgmgr.c.

2341{
2342 PINTERNAL_RANGE_LIST pRangeList;
2343 PINTERNAL_RANGE pRange;
2344 PLIST_ENTRY ListEntry;
2346
2347 FIXME("CM_First_Range(%p %p %p %p %lx)\n",
2348 rlh, pullStart, pullEnd, preElement, ulFlags);
2349
2350 pRangeList = (PINTERNAL_RANGE_LIST)rlh;
2351
2352 if (!IsValidRangeList(pRangeList))
2353 return CR_INVALID_RANGE_LIST;
2354
2355 if (pullStart == NULL || pullEnd == NULL || preElement == NULL)
2356 return CR_INVALID_POINTER;
2357
2358 if (ulFlags != 0)
2359 return CR_INVALID_FLAG;
2360
2361 /* Lock the range list */
2362 WaitForSingleObject(pRangeList->hMutex, INFINITE);
2363
2364 /* Fail, if the list is empty */
2365 if (IsListEmpty(&pRangeList->ListHead))
2366 {
2367 ret = CR_FAILURE;
2368 goto done;
2369 }
2370
2371 /* Get the first range */
2372 ListEntry = pRangeList->ListHead.Flink;
2373 pRange = CONTAINING_RECORD(ListEntry, INTERNAL_RANGE, ListEntry);
2374
2375 /* Return the range data */
2376 *pullStart = pRange->ullStart;
2377 *pullEnd = pRange->ullEnd;
2378 *preElement = (RANGE_ELEMENT)pRange;
2379
2380done:
2381 /* Unlock the range list */
2382 ReleaseMutex(pRangeList->hMutex);
2383
2384 return ret;
2385}
DWORD_PTR RANGE_ELEMENT
Definition: cfgmgr32.h:105

◆ CM_Free_Log_Conf()

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

Definition at line 2393 of file cfgmgr.c.

2396{
2397 TRACE("CM_Free_Log_Conf(%lx %lx)\n",
2398 lcLogConfToBeFreed, ulFlags);
2399
2400 return CM_Free_Log_Conf_Ex(lcLogConfToBeFreed, ulFlags, NULL);
2401}
CONFIGRET WINAPI CM_Free_Log_Conf_Ex(_In_ LOG_CONF lcLogConfToBeFreed, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2409

◆ 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 2409 of file cfgmgr.c.

2413{
2415 HSTRING_TABLE StringTable = NULL;
2416 LPWSTR lpDevInst;
2417 PLOG_CONF_INFO pLogConfInfo;
2418 CONFIGRET ret;
2419
2420 TRACE("CM_Free_Log_Conf_Ex(%lx %lx %p)\n",
2421 lcLogConfToBeFreed, ulFlags, hMachine);
2422
2423 if (!pSetupIsUserAdmin())
2424 return CR_ACCESS_DENIED;
2425
2426 pLogConfInfo = (PLOG_CONF_INFO)lcLogConfToBeFreed;
2427 if (!IsValidLogConf(pLogConfInfo))
2428 return CR_INVALID_LOG_CONF;
2429
2430 if (ulFlags != 0)
2431 return CR_INVALID_FLAG;
2432
2433 if (hMachine != NULL)
2434 {
2435 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2436 if (BindingHandle == NULL)
2437 return CR_FAILURE;
2438
2439 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
2440 if (StringTable == 0)
2441 return CR_FAILURE;
2442 }
2443 else
2444 {
2445 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
2446 return CR_FAILURE;
2447 }
2448
2449 lpDevInst = pSetupStringTableStringFromId(StringTable, pLogConfInfo->dnDevInst);
2450 if (lpDevInst == NULL)
2451 return CR_INVALID_DEVNODE;
2452
2454 {
2456 lpDevInst,
2457 pLogConfInfo->ulType,
2458 pLogConfInfo->ulTag,
2459 0);
2460 }
2462 {
2464 }
2466
2467 return ret;
2468}
DWORD WINAPI PNP_FreeLogConf(handle_t hBinding, LPWSTR pDeviceID, DWORD ulLogConfType, DWORD ulLogConfTag, DWORD ulFlags)
Definition: rpcserver.c:4179
#define CR_INVALID_LOG_CONF
Definition: cfgmgr32.h:850
BOOL IsValidLogConf(_In_opt_ PLOG_CONF_INFO pLogConfInfo)
Definition: cfgmgr.c:425
struct _LOG_CONF_INFO * PLOG_CONF_INFO

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 2476 of file cfgmgr.c.

2478{
2479 PLOG_CONF_INFO pLogConfInfo;
2480
2481 TRACE("CM_Free_Log_Conf_Handle(%lx)\n", lcLogConf);
2482
2483 pLogConfInfo = (PLOG_CONF_INFO)lcLogConf;
2484 if (!IsValidLogConf(pLogConfInfo))
2485 return CR_INVALID_LOG_CONF;
2486
2487 HeapFree(GetProcessHeap(), 0, pLogConfInfo);
2488
2489 return CR_SUCCESS;
2490}

◆ CM_Free_Range_List()

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

Definition at line 2498 of file cfgmgr.c.

2501{
2502 PINTERNAL_RANGE_LIST pRangeList;
2503 PINTERNAL_RANGE pRange;
2504 PLIST_ENTRY ListEntry;
2505
2506 FIXME("CM_Free_Range_List(%p %lx)\n",
2507 RangeList, ulFlags);
2508
2509 pRangeList = (PINTERNAL_RANGE_LIST)RangeList;
2510
2511 if (!IsValidRangeList(pRangeList))
2512 return CR_INVALID_RANGE_LIST;
2513
2514 if (ulFlags != 0)
2515 return CR_INVALID_FLAG;
2516
2517 /* Lock the range list */
2518 WaitForSingleObject(pRangeList->hMutex, INFINITE);
2519
2520 /* Free the list of ranges */
2521 while (!IsListEmpty(&pRangeList->ListHead))
2522 {
2523 ListEntry = RemoveHeadList(&pRangeList->ListHead);
2524 pRange = CONTAINING_RECORD(ListEntry, INTERNAL_RANGE, ListEntry);
2525 HeapFree(GetProcessHeap(), 0, pRange);
2526 }
2527
2528 /* Unlock the range list */
2529 ReleaseMutex(pRangeList->hMutex);
2530
2531 /* Close the mutex */
2532 CloseHandle(pRangeList->hMutex);
2533
2534 /* Free the range list */
2535 HeapFree(GetProcessHeap(), 0, pRangeList);
2536
2537 return CR_SUCCESS;
2538}
#define CloseHandle
Definition: compat.h:739

◆ CM_Free_Res_Des()

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

Definition at line 2546 of file cfgmgr.c.

2550{
2551 TRACE("CM_Free_Res_Des(%p %p %lx)\n",
2552 prdResDes, rdResDes, ulFlags);
2553
2554 return CM_Free_Res_Des_Ex(prdResDes, rdResDes, ulFlags, NULL);
2555}
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:2563

◆ 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 2563 of file cfgmgr.c.

2568{
2569 FIXME("CM_Free_Res_Des_Ex(%p %p %lx %p)\n",
2570 prdResDes, rdResDes, ulFlags, hMachine);
2571
2573}

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 2581 of file cfgmgr.c.

2583{
2584 PRES_DES_INFO pResDesInfo;
2585
2586 FIXME("CM_Free_Res_Des_Handle(%p)\n", rdResDes);
2587
2588 pResDesInfo = (PRES_DES_INFO)rdResDes;
2589 if (!IsValidResDes(pResDesInfo))
2590 return CR_INVALID_RES_DES;
2591
2592 HeapFree(GetProcessHeap(), 0, pResDesInfo);
2593
2594 return CR_SUCCESS;
2595}
#define CR_INVALID_RES_DES
Definition: cfgmgr32.h:849
BOOL IsValidResDes(_In_opt_ PRES_DES_INFO pResDesInfo)
Definition: cfgmgr.c:449
struct _RES_DES_INFO * PRES_DES_INFO

◆ CM_Free_Resource_Conflict_Handle()

CONFIGRET WINAPI CM_Free_Resource_Conflict_Handle ( _In_ CONFLICT_LIST  clConflictList)

Definition at line 2603 of file cfgmgr.c.

2605{
2606 PCONFLICT_DATA pConflictData;
2607
2608 FIXME("CM_Free_Resource_Conflict_Handle(%p)\n",
2609 clConflictList);
2610
2611 pConflictData = (PCONFLICT_DATA)clConflictList;
2612 if (!IsValidConflictData(pConflictData))
2614
2615 if (pConflictData->pConflictList != NULL)
2616 MyFree(pConflictData->pConflictList);
2617
2618 MyFree(pConflictData);
2619
2620 return CR_SUCCESS;
2621}
#define CR_INVALID_CONFLICT_LIST
Definition: cfgmgr32.h:903
BOOL IsValidConflictData(_In_opt_ PCONFLICT_DATA pConflictData)
Definition: cfgmgr.c:473
struct _CONFLICT_DATA * PCONFLICT_DATA
PPNP_CONFLICT_LIST pConflictList
Definition: cfgmgr.c:114

◆ CM_Get_Child()

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

Definition at line 2629 of file cfgmgr.c.

2633{
2634 TRACE("CM_Get_Child(%p %p %lx)\n",
2635 pdnDevInst, dnDevInst, ulFlags);
2636
2637 return CM_Get_Child_Ex(pdnDevInst, dnDevInst, ulFlags, NULL);
2638}
CONFIGRET WINAPI CM_Get_Child_Ex(_Out_ PDEVINST pdnDevInst, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2646

Referenced by CfmListRecursiveInsertSubDevices(), DevTreeRecursiveInsertSubDevices(), CDeviceView::GetChildDevice(), and GetMonitorDevInstID().

◆ 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 2646 of file cfgmgr.c.

2651{
2652 WCHAR szRelatedDevInst[MAX_DEVICE_ID_LEN];
2654 HSTRING_TABLE StringTable = NULL;
2655 LPWSTR lpDevInst;
2656 DWORD dwIndex, dwLength = MAX_DEVICE_ID_LEN;
2657 CONFIGRET ret;
2658
2659 TRACE("CM_Get_Child_Ex(%p %lx %lx %p)\n",
2660 pdnDevInst, dnDevInst, ulFlags, hMachine);
2661
2662 if (pdnDevInst == NULL)
2663 return CR_INVALID_POINTER;
2664
2665 if (dnDevInst == 0)
2666 return CR_INVALID_DEVINST;
2667
2668 if (ulFlags != 0)
2669 return CR_INVALID_FLAG;
2670
2671 *pdnDevInst = -1;
2672
2673 if (hMachine != NULL)
2674 {
2675 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2676 if (BindingHandle == NULL)
2677 return CR_FAILURE;
2678
2679 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
2680 if (StringTable == 0)
2681 return CR_FAILURE;
2682 }
2683 else
2684 {
2685 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
2686 return CR_FAILURE;
2687 }
2688
2689 lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
2690 if (lpDevInst == NULL)
2691 return CR_INVALID_DEVNODE;
2692
2694 {
2696 PNP_GET_CHILD_DEVICE_INSTANCE,
2697 lpDevInst,
2698 szRelatedDevInst,
2699 &dwLength,
2700 0);
2701 }
2703 {
2705 }
2707
2708 if (ret != CR_SUCCESS)
2709 return ret;
2710
2711 TRACE("szRelatedDevInst: %s\n", debugstr_w(szRelatedDevInst));
2712
2713 dwIndex = pSetupStringTableAddString(StringTable, szRelatedDevInst, 1);
2714 if (dwIndex == -1)
2715 return CR_FAILURE;
2716
2717 *pdnDevInst = dwIndex;
2718
2719 return CR_SUCCESS;
2720}
DWORD WINAPI PNP_GetRelatedDeviceInstance(handle_t hBinding, DWORD ulRelationship, LPWSTR pDeviceID, LPWSTR pRelatedDeviceId, PNP_RPC_STRING_LEN *pulLength, DWORD ulFlags)
Definition: rpcserver.c:850
static DWORD DWORD * dwLength
Definition: fusion.c:86
unsigned long DWORD
Definition: ntddk_ex.h:95

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 2766 of file cfgmgr.c.

2772{
2773 WCHAR szBuffer[MAX_GUID_STRING_LEN];
2775 ULONG ulLength;
2776 ULONG ulOrigLength;
2777
2778 TRACE("CM_Get_Class_Key_Name_ExA(%p %p %p %lx %p)\n",
2779 ClassGuid, pszKeyName, pulLength, ulFlags, hMachine);
2780
2781 if (ClassGuid == NULL || pszKeyName == NULL || pulLength == NULL)
2782 return CR_INVALID_POINTER;
2783
2784 ulOrigLength = *pulLength;
2785 *pulLength = 0;
2786
2787 ulLength = MAX_GUID_STRING_LEN;
2788 ret = CM_Get_Class_Key_Name_ExW(ClassGuid, szBuffer, &ulLength,
2789 ulFlags, hMachine);
2790 if (ret == CR_SUCCESS)
2791 {
2793 0,
2794 szBuffer,
2795 ulLength,
2796 pszKeyName,
2797 ulOrigLength,
2798 NULL,
2799 NULL) == 0)
2800 ret = CR_FAILURE;
2801 else
2802 *pulLength = lstrlenA(pszKeyName) + 1;
2803 }
2804
2805 return CR_SUCCESS;
2806}
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:2814

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 2814 of file cfgmgr.c.

2820{
2821 TRACE("CM_Get_Class_Key_Name_ExW(%p %p %p %lx %p)\n",
2822 ClassGuid, pszKeyName, pulLength, ulFlags, hMachine);
2823
2824 if (ClassGuid == NULL || pszKeyName == NULL || pulLength == NULL)
2825 return CR_INVALID_POINTER;
2826
2827 if (ulFlags != 0)
2828 return CR_INVALID_FLAG;
2829
2830 if (*pulLength < MAX_GUID_STRING_LEN)
2831 {
2832 *pulLength = 0;
2833 return CR_BUFFER_SMALL;
2834 }
2835
2836 if (!GuidToString(ClassGuid, pszKeyName))
2837 return CR_INVALID_DATA;
2838
2839 *pulLength = MAX_GUID_STRING_LEN;
2840
2841 return CR_SUCCESS;
2842}
#define CR_BUFFER_SMALL
Definition: cfgmgr32.h:872

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 2728 of file cfgmgr.c.

2733{
2734 TRACE("CM_Get_Class_Key_NameA(%p %p %p %lx)\n",
2735 ClassGuid, pszKeyName, pulLength, ulFlags);
2736
2737 return CM_Get_Class_Key_Name_ExA(ClassGuid, pszKeyName, pulLength,
2738 ulFlags, NULL);
2739}
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:2766

◆ 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 2747 of file cfgmgr.c.

2752{
2753 TRACE("CM_Get_Class_Key_NameW(%p %p %p %lx)\n",
2754 ClassGuid, pszKeyName, pulLength, ulFlags);
2755
2756 return CM_Get_Class_Key_Name_ExW(ClassGuid, pszKeyName, pulLength,
2757 ulFlags, NULL);
2758}

◆ 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 2888 of file cfgmgr.c.

2894{
2895 WCHAR szBuffer[MAX_CLASS_NAME_LEN];
2897 ULONG ulLength;
2898 ULONG ulOrigLength;
2899
2900 TRACE("CM_Get_Class_Name_ExA(%p %p %p %lx %p)\n",
2901 ClassGuid, Buffer, pulLength, ulFlags, hMachine);
2902
2903 if (ClassGuid == NULL || Buffer == NULL || pulLength == NULL)
2904 return CR_INVALID_POINTER;
2905
2906 ulOrigLength = *pulLength;
2907 *pulLength = 0;
2908
2909 ulLength = MAX_CLASS_NAME_LEN;
2910 ret = CM_Get_Class_Name_ExW(ClassGuid, szBuffer, &ulLength,
2911 ulFlags, hMachine);
2912 if (ret == CR_SUCCESS)
2913 {
2915 0,
2916 szBuffer,
2917 ulLength,
2918 Buffer,
2919 ulOrigLength,
2920 NULL,
2921 NULL) == 0)
2922 ret = CR_FAILURE;
2923 else
2924 *pulLength = lstrlenA(Buffer) + 1;
2925 }
2926
2927 return ret;
2928}
#define MAX_CLASS_NAME_LEN
Definition: cfgmgr32.h:52
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:2936

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 2936 of file cfgmgr.c.

2942{
2943 WCHAR szGuidString[MAX_GUID_STRING_LEN];
2945 CONFIGRET ret;
2946
2947 TRACE("CM_Get_Class_Name_ExW(%p %p %p %lx %p\n",
2948 ClassGuid, Buffer, pulLength, ulFlags, hMachine);
2949
2950 if (ClassGuid == NULL || Buffer == NULL || pulLength == NULL)
2951 return CR_INVALID_POINTER;
2952
2953 if (ulFlags != 0)
2954 return CR_INVALID_FLAG;
2955
2956 if (!GuidToString(ClassGuid, szGuidString))
2957 return CR_INVALID_DATA;
2958
2959 TRACE("Guid %s\n", debugstr_w(szGuidString));
2960
2961 if (hMachine != NULL)
2962 {
2963 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2964 if (BindingHandle == NULL)
2965 return CR_FAILURE;
2966 }
2967 else
2968 {
2970 return CR_FAILURE;
2971 }
2972
2974 {
2976 szGuidString,
2977 Buffer,
2978 pulLength,
2979 ulFlags);
2980 }
2982 {
2984 }
2986
2987 return ret;
2988}
DWORD WINAPI PNP_GetClassName(handle_t hBinding, LPWSTR pszClassGuid, LPWSTR Buffer, PNP_RPC_STRING_LEN *pulLength, DWORD ulFlags)
Definition: rpcserver.c:2497

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 2850 of file cfgmgr.c.

2855{
2856 TRACE("CM_Get_Class_NameA(%p %p %p %lx)\n",
2857 ClassGuid, Buffer, pulLength, ulFlags);
2858
2859 return CM_Get_Class_Name_ExA(ClassGuid, Buffer, pulLength, ulFlags,
2860 NULL);
2861}
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:2888

◆ 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 2869 of file cfgmgr.c.

2874{
2875 TRACE("CM_Get_Class_NameW(%p %p %p %lx)\n",
2876 ClassGuid, Buffer, pulLength, ulFlags);
2877
2878 return CM_Get_Class_Name_ExW(ClassGuid, Buffer, pulLength, ulFlags,
2879 NULL);
2880}

◆ 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 2996 of file cfgmgr.c.

3004{
3005 PWSTR BufferW;
3006 ULONG ulLength = 0;
3007 ULONG ulType;
3008 CONFIGRET ret;
3009
3010 TRACE("CM_Get_Class_Registry_PropertyA(%p %lu %p %p %p %lx %p)\n",
3011 ClassGuid, ulProperty, pulRegDataType, Buffer, pulLength,
3012 ulFlags, hMachine);
3013
3014 if (pulLength == NULL)
3015 return CR_INVALID_POINTER;
3016
3017 if (ulProperty < CM_CRP_MIN || ulProperty > CM_CRP_MAX)
3018 return CR_INVALID_PROPERTY;
3019
3020 ulType = GetRegistryPropertyType(ulProperty);
3021 if (ulType == REG_SZ || ulType == REG_MULTI_SZ)
3022 {
3023 /* Get the required buffer size */
3024 ret = CM_Get_Class_Registry_PropertyW(ClassGuid, ulProperty, pulRegDataType,
3025 NULL, &ulLength, ulFlags, hMachine);
3026 if (ret != CR_BUFFER_SMALL)
3027 return ret;
3028
3029 /* Allocate the unicode buffer */
3030 BufferW = HeapAlloc(GetProcessHeap(), 0, ulLength);
3031 if (BufferW == NULL)
3032 return CR_OUT_OF_MEMORY;
3033
3034 /* Get the property */
3035 ret = CM_Get_Class_Registry_PropertyW(ClassGuid, ulProperty, pulRegDataType,
3036 BufferW, &ulLength, ulFlags, hMachine);
3037 if (ret != CR_SUCCESS)
3038 {
3039 HeapFree(GetProcessHeap(), 0, BufferW);
3040 return ret;
3041 }
3042
3043 /* Do W->A conversion */
3044 *pulLength = WideCharToMultiByte(CP_ACP,
3045 0,
3046 BufferW,
3047 ulLength,
3048 Buffer,
3049 *pulLength,
3050 NULL,
3051 NULL);
3052
3053 /* Release the unicode buffer */
3054 HeapFree(GetProcessHeap(), 0, BufferW);
3055
3056 if (*pulLength == 0)
3057 ret = CR_FAILURE;
3058 }
3059 else
3060 {
3061 /* Get the property */
3062 ret = CM_Get_Class_Registry_PropertyW(ClassGuid, ulProperty, pulRegDataType,
3063 Buffer, pulLength, ulFlags, hMachine);
3064 }
3065
3066 return ret;
3067}
#define CR_INVALID_PROPERTY
Definition: cfgmgr32.h:899
#define CM_CRP_MAX
Definition: cfgmgr32.h:733
CONFIGRET WINAPI CM_Get_Class_Registry_PropertyW(LPGUID ClassGuid, ULONG ulProperty, PULONG pulRegDataType, PVOID Buffer, PULONG pulLength, ULONG ulFlags, HMACHINE hMachine)
Definition: cfgmgr.c:3075
static ULONG GetRegistryPropertyType(_In_ ULONG ulProperty)
Definition: cfgmgr.c:156
#define REG_SZ
Definition: layer.c:22
#define REG_MULTI_SZ
Definition: nt_native.h:1501
_In_z_ PCWSTR _In_ ULONG ulType
Definition: ntuser.h:43

◆ 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 3075 of file cfgmgr.c.

3083{
3085 WCHAR szGuidString[PNP_MAX_GUID_STRING_LEN + 1];
3086 ULONG ulType = 0;
3087 ULONG ulTransferLength = 0;
3088 CONFIGRET ret;
3089
3090 TRACE("CM_Get_Class_Registry_PropertyW(%p %lu %p %p %p %lx %p)\n",
3091 ClassGuid, ulProperty, pulRegDataType, Buffer, pulLength,
3092 ulFlags, hMachine);
3093
3094 if (ClassGuid == NULL || pulLength == NULL)
3095 return CR_INVALID_POINTER;
3096
3097 if (ulFlags != 0)
3098 return CR_INVALID_FLAG;
3099
3100 if (pSetupStringFromGuid(ClassGuid,
3101 szGuidString,
3103 return CR_INVALID_DATA;
3104
3105 if (ulProperty < CM_CRP_MIN || ulProperty > CM_CRP_MAX)
3106 return CR_INVALID_PROPERTY;
3107
3108 if (hMachine != NULL)
3109 {
3110 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
3111 if (BindingHandle == NULL)
3112 return CR_FAILURE;
3113 }
3114 else
3115 {
3117 return CR_FAILURE;
3118 }
3119
3120 ulTransferLength = *pulLength;
3121
3123 {
3125 szGuidString,
3126 ulProperty,
3127 &ulType,
3128 Buffer,
3129 &ulTransferLength,
3130 pulLength,
3131 ulFlags);
3132 }
3134 {
3136 }
3138
3139 if (ret == CR_SUCCESS)
3140 {
3141 if (pulRegDataType != NULL)
3142 *pulRegDataType = ulType;
3143 }
3144
3145 return ret;
3146}
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: rpcserver.c:2730
DWORD WINAPI pSetupStringFromGuid(LPGUID lpGUID, PWSTR pString, DWORD dwStringLen)
Definition: misc.c:1775
const unsigned long PNP_MAX_GUID_STRING_LEN
Definition: pnp.idl:12

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 3154 of file cfgmgr.c.

3158{
3159 TRACE("CM_Get_Depth(%p %lx %lx)\n",
3160 pulDepth, dnDevInst, ulFlags);
3161
3162 return CM_Get_Depth_Ex(pulDepth, dnDevInst, ulFlags, NULL);
3163}
CONFIGRET WINAPI CM_Get_Depth_Ex(_Out_ PULONG pulDepth, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:3171

◆ 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 3171 of file cfgmgr.c.

3176{
3178 HSTRING_TABLE StringTable = NULL;
3179 LPWSTR lpDevInst;
3180 CONFIGRET ret;
3181
3182 TRACE("CM_Get_Depth_Ex(%p %lx %lx %p)\n",
3183 pulDepth, dnDevInst, ulFlags, hMachine);
3184
3185 if (pulDepth == NULL)
3186 return CR_INVALID_POINTER;
3187
3188 if (dnDevInst == 0)
3189 return CR_INVALID_DEVINST;
3190
3191 if (ulFlags != 0)
3192 return CR_INVALID_FLAG;
3193
3194 if (hMachine != NULL)
3195 {
3196 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
3197 if (BindingHandle == NULL)
3198 return CR_FAILURE;
3199
3200 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
3201 if (StringTable == 0)
3202 return CR_FAILURE;
3203 }
3204 else
3205 {
3206 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
3207 return CR_FAILURE;
3208 }
3209
3210 lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
3211 if (lpDevInst == NULL)
3212 return CR_INVALID_DEVNODE;
3213
3215 {
3217 lpDevInst,
3218 pulDepth,
3219 ulFlags);
3220 }
3222 {
3224 }
3226
3227 return ret;
3228}
DWORD WINAPI PNP_GetDepth(handle_t hBinding, LPWSTR pszDeviceID, DWORD *pulDepth, DWORD ulFlags)
Definition: rpcserver.c:1795

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 3793 of file cfgmgr.c.

3799{
3800 WCHAR szBufferW[MAX_DEVICE_ID_LEN];
3802
3803 TRACE("CM_Get_Device_ID_ExA(%lx %p %lu %lx %p)\n",
3804 dnDevInst, Buffer, BufferLen, ulFlags, hMachine);
3805
3806 if (Buffer == NULL)
3807 return CR_INVALID_POINTER;
3808
3809 ret = CM_Get_Device_ID_ExW(dnDevInst,
3810 szBufferW,
3812 ulFlags,
3813 hMachine);
3814 if (ret == CR_SUCCESS)
3815 {
3817 0,
3818 szBufferW,
3819 lstrlenW(szBufferW) + 1,
3820 Buffer,
3821 BufferLen,
3822 NULL,
3823 NULL) == 0)
3824 ret = CR_FAILURE;
3825 }
3826
3827 return ret;
3828}
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:3836
#define lstrlenW
Definition: compat.h:750

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 3836 of file cfgmgr.c.

3842{
3843 HSTRING_TABLE StringTable = NULL;
3844
3845 TRACE("CM_Get_Device_ID_ExW(%lx %p %lu %lx %p)\n",
3846 dnDevInst, Buffer, BufferLen, ulFlags, hMachine);
3847
3848 if (dnDevInst == 0)
3849 return CR_INVALID_DEVINST;
3850
3851 if (Buffer == NULL)
3852 return CR_INVALID_POINTER;
3853
3854 if (ulFlags != 0)
3855 return CR_INVALID_FLAG;
3856
3857 if (hMachine != NULL)
3858 {
3859 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
3860 if (StringTable == NULL)
3861 return CR_FAILURE;
3862 }
3863 else
3864 {
3865 if (!PnpGetLocalHandles(NULL, &StringTable))
3866 return CR_FAILURE;
3867 }
3868
3869 if (!pSetupStringTableStringFromIdEx(StringTable,
3870 dnDevInst,
3871 Buffer,
3872 &BufferLen))
3873 return CR_FAILURE;
3874
3875 return CR_SUCCESS;
3876}
BOOL WINAPI pSetupStringTableStringFromIdEx(HSTRING_TABLE hStringTable, DWORD dwId, LPWSTR lpBuffer, LPDWORD lpBufferLength)
Definition: stringtable.c:760

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 3922 of file cfgmgr.c.

3928{
3929 LPWSTR BufferW = NULL;
3930 LPWSTR pszFilterW = NULL;
3932
3933 TRACE("CM_Get_Device_ID_List_ExA(%p %p %lu %lx %p)\n",
3934 pszFilter, Buffer, BufferLen, ulFlags, hMachine);
3935
3936 BufferW = MyMalloc(BufferLen * sizeof(WCHAR));
3937 if (BufferW == NULL)
3938 return CR_OUT_OF_MEMORY;
3939
3940 if (pszFilter == NULL)
3941 {
3943 BufferW,
3944 BufferLen,
3945 ulFlags,
3946 hMachine);
3947 }
3948 else
3949 {
3950 if (pSetupCaptureAndConvertAnsiArg(pszFilter, &pszFilterW))
3951 {
3953 goto Done;
3954 }
3955
3956 ret = CM_Get_Device_ID_List_ExW(pszFilterW,
3957 BufferW,
3958 BufferLen,
3959 ulFlags,
3960 hMachine);
3961
3962 MyFree(pszFilterW);
3963 }
3964
3966 0,
3967 BufferW,
3968 BufferLen,
3969 Buffer,
3970 BufferLen,
3971 NULL,
3972 NULL) == 0)
3973 ret = CR_FAILURE;
3974
3975Done:
3976 MyFree(BufferW);
3977
3978 return ret;
3979}
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)
Definition: cfgmgr.c:3987

Referenced by CM_Get_Device_ID_ListA().

◆ CM_Get_Device_ID_List_ExW()

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 
)

Definition at line 3987 of file cfgmgr.c.

3993{
3995 CONFIGRET ret;
3996
3997 TRACE("CM_Get_Device_ID_List_ExW(%p %p %lu %lx %p)\n",
3998 pszFilter, Buffer, BufferLen, ulFlags, hMachine);
3999
4000 if (Buffer == NULL || BufferLen == 0)
4001 return CR_INVALID_POINTER;
4002
4003 if (ulFlags & ~CM_GETIDLIST_FILTER_BITS)
4004 return CR_INVALID_FLAG;
4005
4006 if (hMachine != NULL)
4007 {
4008 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
4009 if (BindingHandle == NULL)
4010 return CR_FAILURE;
4011 }
4012 else
4013 {
4015 return CR_FAILURE;
4016 }
4017
4018 *Buffer = 0;
4019
4021 {
4023 (LPWSTR)pszFilter,
4024 Buffer,
4025 &BufferLen,
4026 ulFlags);
4027 }
4029 {
4031 }
4033
4034 return ret;
4035}
DWORD WINAPI PNP_GetDeviceList(handle_t hBinding, LPWSTR pszFilter, LPWSTR Buffer, PNP_RPC_STRING_LEN *pulLength, DWORD ulFlags)
Definition: rpcserver.c:1349
#define CM_GETIDLIST_FILTER_BITS
Definition: cfgmgr32.h:669

Referenced by CM_Get_Device_ID_List_ExA(), CM_Get_Device_ID_ListW(), DisplayDeviceRelations(), and SETUP_CreateDevicesList().

◆ CM_Get_Device_ID_List_Size_ExA()

CONFIGRET WINAPI CM_Get_Device_ID_List_Size_ExA ( _Out_ PULONG  pulLen,
_In_opt_ PCSTR  pszFilter,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 4077 of file cfgmgr.c.

4082{
4083 LPWSTR pszFilterW = NULL;
4085
4086 FIXME("CM_Get_Device_ID_List_Size_ExA(%p %s %lx %p)\n",
4087 pulLen, debugstr_a(pszFilter), ulFlags, hMachine);
4088
4089 if (pszFilter == NULL)
4090 {
4092 NULL,
4093 ulFlags,
4094 hMachine);
4095 }
4096 else
4097 {
4098 if (pSetupCaptureAndConvertAnsiArg(pszFilter, &pszFilterW))
4099 return CR_INVALID_DEVICE_ID;
4100
4102 pszFilterW,
4103 ulFlags,
4104 hMachine);
4105
4106 MyFree(pszFilterW);
4107 }
4108
4109 return ret;
4110}
CONFIGRET WINAPI CM_Get_Device_ID_List_Size_ExW(_Out_ PULONG pulLen, _In_opt_ PCWSTR pszFilter, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:4118

Referenced by CM_Get_Device_ID_List_SizeA().

◆ CM_Get_Device_ID_List_Size_ExW()

CONFIGRET WINAPI CM_Get_Device_ID_List_Size_ExW ( _Out_ PULONG  pulLen,
_In_opt_ PCWSTR  pszFilter,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 4118 of file cfgmgr.c.

4123{
4125 CONFIGRET ret;
4126
4127 FIXME("CM_Get_Device_ID_List_Size_ExW(%p %s %lx %p)\n",
4128 pulLen, debugstr_w(pszFilter), ulFlags, hMachine);
4129
4130 if (pulLen == NULL)
4131 return CR_INVALID_POINTER;
4132
4133 if (ulFlags & ~CM_GETIDLIST_FILTER_BITS)
4134 return CR_INVALID_FLAG;
4135
4136 if (hMachine != NULL)
4137 {
4138 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
4139 if (BindingHandle == NULL)
4140 return CR_FAILURE;
4141 }
4142 else
4143 {
4145 return CR_FAILURE;
4146 }
4147
4148 *pulLen = 0;
4149
4151 {
4153 (LPWSTR)pszFilter,
4154 pulLen,
4155 ulFlags);
4156 }
4158 {
4160 }
4162
4163 return ret;
4164}
DWORD WINAPI PNP_GetDeviceListSize(handle_t hBinding, LPWSTR pszFilter, PNP_RPC_BUFFER_SIZE *pulLength, DWORD ulFlags)
Definition: rpcserver.c:1720

Referenced by CM_Get_Device_ID_List_Size_ExA(), CM_Get_Device_ID_List_SizeW(), and DisplayDeviceRelations().

◆ CM_Get_Device_ID_List_SizeA()

CONFIGRET WINAPI CM_Get_Device_ID_List_SizeA ( _Out_ PULONG  pulLen,
_In_opt_ PCSTR  pszFilter,
_In_ ULONG  ulFlags 
)

Definition at line 4043 of file cfgmgr.c.

4047{
4048 TRACE("CM_Get_Device_ID_List_SizeA(%p %s %lx)\n",
4049 pulLen, debugstr_a(pszFilter), ulFlags);
4050
4051 return CM_Get_Device_ID_List_Size_ExA(pulLen, pszFilter, ulFlags, NULL);
4052}
CONFIGRET WINAPI CM_Get_Device_ID_List_Size_ExA(_Out_ PULONG pulLen, _In_opt_ PCSTR pszFilter, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:4077

◆ CM_Get_Device_ID_List_SizeW()

CONFIGRET WINAPI CM_Get_Device_ID_List_SizeW ( _Out_ PULONG  pulLen,
_In_opt_ PCWSTR  pszFilter,
_In_ ULONG  ulFlags 
)

Definition at line 4060 of file cfgmgr.c.

4064{
4065 TRACE("CM_Get_Device_ID_List_SizeW(%p %s %lx)\n",
4066 pulLen, debugstr_w(pszFilter), ulFlags);
4067
4068 return CM_Get_Device_ID_List_Size_ExW(pulLen, pszFilter, ulFlags, NULL);
4069}

◆ CM_Get_Device_ID_ListA()

CONFIGRET WINAPI CM_Get_Device_ID_ListA ( _In_ PCSTR  pszFilter,
_Out_writes_(BufferLen) PCHAR  Buffer,
_In_ ULONG  BufferLen,
_In_ ULONG  ulFlags 
)

Definition at line 3884 of file cfgmgr.c.

3889{
3890 TRACE("CM_Get_Device_ID_ListA(%p %p %lu %lx)\n",
3891 pszFilter, Buffer, BufferLen, ulFlags);
3892
3893 return CM_Get_Device_ID_List_ExA(pszFilter, Buffer, BufferLen,
3894 ulFlags, NULL);
3895}
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: cfgmgr.c:3922

◆ CM_Get_Device_ID_ListW()

CONFIGRET WINAPI CM_Get_Device_ID_ListW ( _In_ PCWSTR  pszFilter,
_Out_writes_(BufferLen) PWCHAR  Buffer,
_In_ ULONG  BufferLen,
_In_ ULONG  ulFlags 
)

Definition at line 3903 of file cfgmgr.c.

3908{
3909 TRACE("CM_Get_Device_ID_ListW(%p %p %lu %lx)\n",
3910 pszFilter, Buffer, BufferLen, ulFlags);
3911
3912 return CM_Get_Device_ID_List_ExW(pszFilter, Buffer, BufferLen,
3913 ulFlags, NULL);
3914}

◆ CM_Get_Device_ID_Size()

CONFIGRET WINAPI CM_Get_Device_ID_Size ( _Out_ PULONG  pulLen,
_In_ DEVINST  dnDevInst,
_In_ ULONG  ulFlags 
)

Definition at line 4172 of file cfgmgr.c.

4176{
4177 TRACE("CM_Get_Device_ID_Size(%p %lx %lx)\n",
4178 pulLen, dnDevInst, ulFlags);
4179
4180 return CM_Get_Device_ID_Size_Ex(pulLen, dnDevInst, ulFlags, NULL);
4181}
CONFIGRET WINAPI CM_Get_Device_ID_Size_Ex(_Out_ PULONG pulLen, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:4189

Referenced by GetMonitorDevInstID(), CDeviceNode::SetupNode(), and ShowDeviceProperties().

◆ CM_Get_Device_ID_Size_Ex()

CONFIGRET WINAPI CM_Get_Device_ID_Size_Ex ( _Out_ PULONG  pulLen,
_In_ DEVINST  dnDevInst,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 4189 of file cfgmgr.c.

4194{
4195 HSTRING_TABLE StringTable = NULL;
4196 LPWSTR DeviceId;
4197
4198 TRACE("CM_Get_Device_ID_Size_Ex(%p %lx %lx %p)\n",
4199 pulLen, dnDevInst, ulFlags, hMachine);
4200
4201 if (pulLen == NULL)
4202 return CR_INVALID_POINTER;
4203
4204 if (dnDevInst == 0)
4205 return CR_INVALID_DEVINST;
4206
4207 if (ulFlags != 0)
4208 return CR_INVALID_FLAG;
4209
4210 if (hMachine != NULL)
4211 {
4212 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
4213 if (StringTable == NULL)
4214 return CR_FAILURE;
4215 }
4216 else
4217 {
4218 if (!PnpGetLocalHandles(NULL, &StringTable))
4219 return CR_FAILURE;
4220 }
4221
4222 DeviceId = pSetupStringTableStringFromId(StringTable, dnDevInst);
4223 if (DeviceId == NULL)
4224 {
4225 *pulLen = 0;
4226 return CR_SUCCESS;
4227 }
4228
4229 *pulLen = lstrlenW(DeviceId);
4230
4231 return CR_SUCCESS;
4232}

Referenced by CM_Get_Device_ID_Size().

◆ CM_Get_Device_IDA()

CONFIGRET WINAPI CM_Get_Device_IDA ( _In_ DEVINST  dnDevInst,
_Out_writes_(BufferLen) PCHAR  Buffer,
_In_ ULONG  BufferLen,
_In_ ULONG  ulFlags 
)

Definition at line 3757 of file cfgmgr.c.

3762{
3763 TRACE("CM_Get_Device_IDA(%lx %p %lu %lx)\n",
3764 dnDevInst, Buffer, BufferLen, ulFlags);
3765
3766 return CM_Get_Device_ID_ExA(dnDevInst, Buffer, BufferLen, ulFlags, NULL);
3767}
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: cfgmgr.c:3793

Referenced by test_devnode().

◆ CM_Get_Device_IDW()

CONFIGRET WINAPI CM_Get_Device_IDW ( _In_ DEVINST  dnDevInst,
_Out_writes_(BufferLen) PWCHAR  Buffer,
_In_ ULONG  BufferLen,
_In_ ULONG  ulFlags 
)

Definition at line 3775 of file cfgmgr.c.

3780{
3781 TRACE("CM_Get_Device_IDW(%lx %p %lu %lx)\n",
3782 dnDevInst, Buffer, BufferLen, ulFlags);
3783
3784 return CM_Get_Device_ID_ExW(dnDevInst, Buffer, BufferLen, ulFlags, NULL);
3785}

Referenced by CDeviceNode::SetupNode(), and ShowDeviceProperties().

◆ CM_Get_Device_Interface_Alias_ExA()

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 
)

Definition at line 4284 of file cfgmgr.c.

4291{
4292 FIXME("CM_Get_Device_Interface_Alias_ExA(%p %p %p %p %lx %p)\n",
4293 pszDeviceInterface, AliasInterfaceGuid,
4294 pszAliasDeviceInterface, pulLength, ulFlags, hMachine);
4295
4297}

Referenced by CM_Get_Device_Interface_AliasA().

◆ CM_Get_Device_Interface_Alias_ExW()

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 
)

Definition at line 4305 of file cfgmgr.c.

4312{
4314 ULONG ulTransferLength;
4316
4317 TRACE("CM_Get_Device_Interface_Alias_ExW(%p %p %p %p %lx %p)\n",
4318 pszDeviceInterface, AliasInterfaceGuid,
4319 pszAliasDeviceInterface, pulLength, ulFlags, hMachine);
4320
4321 if (pszDeviceInterface == NULL ||
4322 AliasInterfaceGuid == NULL ||
4323 pszAliasDeviceInterface == NULL ||
4324 pulLength == NULL)
4325 return CR_INVALID_POINTER;
4326
4327 if (ulFlags != 0)
4328 return CR_INVALID_FLAG;
4329
4330 if (hMachine != NULL)
4331 {
4332 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
4333 if (BindingHandle == NULL)
4334 return CR_FAILURE;
4335 }
4336 else
4337 {
4339 return CR_FAILURE;
4340 }
4341
4342 ulTransferLength = *pulLength;
4343
4345 {
4347 (LPWSTR)pszDeviceInterface,
4348 AliasInterfaceGuid,
4349 pszAliasDeviceInterface,
4350 pulLength,
4351 &ulTransferLength,
4352 0);
4353 }
4355 {
4357 }
4359
4360 return ret;
4361}
DWORD WINAPI PNP_GetInterfaceDeviceAlias(handle_t hBinding, LPWSTR pszInterfaceDevice, GUID *AliasInterfaceGuid, LPWSTR pszAliasInterfaceDevice, PNP_RPC_STRING_LEN *pulLength, PNP_RPC_STRING_LEN *pulTransferLen, DWORD ulFlags)
Definition: rpcserver.c:2587

Referenced by CM_Get_Device_Interface_AliasW().

◆ CM_Get_Device_Interface_AliasA()

CONFIGRET WINAPI CM_Get_Device_Interface_AliasA ( _In_ LPCSTR  pszDeviceInterface,
_In_ LPGUID  AliasInterfaceGuid,
_Out_writes_ *pulLength LPSTR  pszAliasDeviceInterface,
_Inout_ PULONG  pulLength,
_In_ ULONG  ulFlags 
)

Definition at line 4240 of file cfgmgr.c.

4246{
4247 TRACE("CM_Get_Device_Interface_AliasA(%p %p %p %p %lx)\n",
4248 pszDeviceInterface, AliasInterfaceGuid,
4249 pszAliasDeviceInterface, pulLength, ulFlags);
4250
4251 return CM_Get_Device_Interface_Alias_ExA(pszDeviceInterface,
4252 AliasInterfaceGuid, pszAliasDeviceInterface, pulLength,
4253 ulFlags, NULL);
4254}
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)
Definition: cfgmgr.c:4284

◆ CM_Get_Device_Interface_AliasW()

CONFIGRET WINAPI CM_Get_Device_Interface_AliasW ( _In_ LPCWSTR  pszDeviceInterface,
_In_ LPGUID  AliasInterfaceGuid,
_Out_writes_ *pulLength LPWSTR  pszAliasDeviceInterface,
_Inout_ PULONG  pulLength,
_In_ ULONG  ulFlags 
)

Definition at line 4262 of file cfgmgr.c.

4268{
4269 TRACE("CM_Get_Device_Interface_AliasW(%p %p %p %p %lx)\n",
4270 pszDeviceInterface, AliasInterfaceGuid,
4271 pszAliasDeviceInterface, pulLength, ulFlags);
4272
4273 return CM_Get_Device_Interface_Alias_ExW(pszDeviceInterface,
4274 AliasInterfaceGuid, pszAliasDeviceInterface, pulLength,
4275 ulFlags, NULL);
4276}
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)
Definition: cfgmgr.c:4305

◆ CM_Get_Device_Interface_List_ExA()

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 
)

Definition at line 4411 of file cfgmgr.c.

4418{
4419 DEVINSTID_W pDeviceIdW = NULL;
4420 PWCHAR BufferW = NULL;
4422
4423 TRACE("CM_Get_Device_Interface_List_ExA(%s %s %p %lu 0x%08lx %p)\n",
4425 Buffer, BufferLen, ulFlags, hMachine);
4426
4427 if (Buffer == NULL ||
4428 BufferLen == 0)
4429 return CR_INVALID_POINTER;
4430
4431 if (pDeviceID != NULL)
4432 {
4433 if (!pSetupCaptureAndConvertAnsiArg(pDeviceID, &pDeviceIdW))
4434 return CR_INVALID_DEVICE_ID;
4435 }
4436
4437 BufferW = MyMalloc(BufferLen * sizeof(WCHAR));
4438 if (BufferW == NULL)
4439 {
4441 goto Done;
4442 }
4443
4445 BufferW, BufferLen, ulFlags,
4446 hMachine);
4447 if (ret != CR_SUCCESS)
4448 goto Done;
4449
4451 0,
4452 BufferW,
4453 BufferLen,
4454 Buffer,
4455 BufferLen,
4456 NULL,
4457 NULL) == 0)
4458 ret = CR_FAILURE;
4459
4460Done:
4461 if (BufferW != NULL)
4462 MyFree(BufferW);
4463
4464 if (pDeviceIdW != NULL)
4465 MyFree(pDeviceIdW);
4466
4467 return ret;
4468}
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)
Definition: cfgmgr.c:4476
#define debugstr_guid
Definition: kernel32.h:35
uint16_t * PWCHAR
Definition: typedefs.h:56
_In_ CONST GUID * InterfaceClassGuid
Definition: iofuncs.h:1136

Referenced by CM_Get_Device_Interface_ListA().

◆ CM_Get_Device_Interface_List_ExW()

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 
)

Definition at line 4476 of file cfgmgr.c.

4483{
4487
4488 TRACE("CM_Get_Device_Interface_List_ExW(%s %s %p %lu 0x%08lx %p)\n",
4490 Buffer, BufferLen, ulFlags, hMachine);
4491
4492 if (Buffer == NULL ||
4493 BufferLen == 0)
4494 return CR_INVALID_POINTER;
4495
4496 if (ulFlags & ~CM_GET_DEVICE_INTERFACE_LIST_BITS)
4497 return CR_INVALID_FLAG;
4498
4499 if (hMachine != NULL)
4500 {
4501 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
4502 if (BindingHandle == NULL)
4503 return CR_FAILURE;
4504 }
4505 else
4506 {
4508 return CR_FAILURE;
4509 }
4510
4511 *Buffer = 0;
4512 BufferSize = BufferLen;
4513
4515 {
4518 pDeviceID,
4519 (LPBYTE)Buffer,
4520 &BufferSize,
4521 ulFlags);
4522 }
4524 {
4526 }
4528
4529 return ret;
4530}
DWORD WINAPI PNP_GetInterfaceDeviceList(handle_t hBinding, GUID *InterfaceGuid, LPWSTR pszDeviceID, BYTE *Buffer, PNP_RPC_BUFFER_SIZE *pulLength, DWORD ulFlags)
Definition: rpcserver.c:2604
#define CM_GET_DEVICE_INTERFACE_LIST_BITS
Definition: cfgmgr32.h:674
unsigned long PNP_RPC_BUFFER_SIZE
Definition: pnp.idl:34
unsigned char * LPBYTE
Definition: typedefs.h:53
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:254

Referenced by CM_Get_Device_Interface_List_ExA(), and CM_Get_Device_Interface_ListW().

◆ CM_Get_Device_Interface_List_Size_ExA()

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 
)

Definition at line 4576 of file cfgmgr.c.

4582{
4583 DEVINSTID_W pDeviceIdW = NULL;
4585
4586 TRACE("CM_Get_Device_Interface_List_Size_ExA(%p %p %s 0x%08lx %p)\n",
4587 pulLen, InterfaceClassGuid, debugstr_a(pDeviceID), ulFlags, hMachine);
4588
4589 if (pulLen == NULL)
4590 return CR_INVALID_POINTER;
4591
4592 if (pDeviceID != NULL)
4593 {
4594 if (!pSetupCaptureAndConvertAnsiArg(pDeviceID, &pDeviceIdW))
4595 return CR_INVALID_DEVICE_ID;
4596 }
4597
4598 *pulLen = 0;
4599
4601 pDeviceIdW, ulFlags, hMachine);
4602
4603 if (pDeviceIdW != NULL)
4604 MyFree(pDeviceIdW);
4605
4606 return ret;
4607}
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)
Definition: cfgmgr.c:4615

Referenced by CM_Get_Device_Interface_List_SizeA().

◆ CM_Get_Device_Interface_List_Size_ExW()

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 
)

Definition at line 4615 of file cfgmgr.c.

4621{
4624
4625 TRACE("CM_Get_Device_Interface_List_Size_ExW(%p %p %s 0x%08lx %p)\n",
4626 pulLen, InterfaceClassGuid, debugstr_w(pDeviceID), ulFlags, hMachine);
4627
4628 if (pulLen == NULL)
4629 return CR_INVALID_POINTER;
4630
4631 if (ulFlags & ~CM_GET_DEVICE_INTERFACE_LIST_BITS)
4632 return CR_INVALID_FLAG;
4633
4634 if (hMachine != NULL)
4635 {
4636 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
4637 if (BindingHandle == NULL)
4638 return CR_FAILURE;
4639 }
4640 else
4641 {
4643 return CR_FAILURE;
4644 }
4645
4646 *pulLen = 0;
4647
4649 {
4651 pulLen,
4653 pDeviceID,
4654 ulFlags);
4655 }
4657 {
4659 }
4661
4662 return ret;
4663}
DWORD WINAPI PNP_GetInterfaceDeviceListSize(handle_t hBinding, PNP_RPC_BUFFER_SIZE *pulLen, GUID *InterfaceGuid, LPWSTR pszDeviceID, DWORD ulFlags)
Definition: rpcserver.c:2652

Referenced by CM_Get_Device_Interface_List_Size_ExA(), and CM_Get_Device_Interface_List_SizeW().

◆ CM_Get_Device_Interface_List_SizeA()

CONFIGRET WINAPI CM_Get_Device_Interface_List_SizeA ( _Out_ PULONG  pulLen,
_In_ LPGUID  InterfaceClassGuid,
_In_opt_ DEVINSTID_A  pDeviceID,
_In_ ULONG  ulFlags 
)

Definition at line 4538 of file cfgmgr.c.

4543{
4544 TRACE("CM_Get_Device_Interface_List_SizeA(%p %p %s 0x%08lx)\n",
4545 pulLen, InterfaceClassGuid, debugstr_a(pDeviceID), ulFlags);
4546
4548 pDeviceID, ulFlags, NULL);
4549}
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)
Definition: cfgmgr.c:4576

◆ CM_Get_Device_Interface_List_SizeW()

CONFIGRET WINAPI CM_Get_Device_Interface_List_SizeW ( _Out_ PULONG  pulLen,
_In_ LPGUID  InterfaceClassGuid,
_In_opt_ DEVINSTID_W  pDeviceID,
_In_ ULONG  ulFlags 
)

Definition at line 4557 of file cfgmgr.c.

4562{
4563 TRACE("CM_Get_Device_Interface_List_SizeW(%p %p %s 0x%08lx)\n",
4564 pulLen, InterfaceClassGuid, debugstr_w(pDeviceID), ulFlags);
4565
4567 pDeviceID, ulFlags, NULL);
4568}

◆ CM_Get_Device_Interface_ListA()

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 
)

Definition at line 4369 of file cfgmgr.c.

4375{
4376 TRACE("CM_Get_Device_Interface_ListA(%s %s %p %lu 0x%08lx)\n",
4378 Buffer, BufferLen, ulFlags);
4379
4381 Buffer, BufferLen, ulFlags, NULL);
4382}
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)
Definition: cfgmgr.c:4411

◆ CM_Get_Device_Interface_ListW()

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 
)

Definition at line 4390 of file cfgmgr.c.

4396{
4397 TRACE("CM_Get_Device_Interface_ListW(%s %s %p %lu 0x%08lx)\n",
4399 Buffer, BufferLen, ulFlags);
4400
4402 Buffer, BufferLen, ulFlags, NULL);
4403}

◆ CM_Get_DevNode_Custom_Property_ExA()

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 
)

Definition at line 3282 of file cfgmgr.c.

3290{
3291 LPWSTR pszPropertyNameW;
3292 PVOID BufferW;
3293 ULONG ulLengthW;
3294 ULONG ulDataType = REG_NONE;
3295 CONFIGRET ret;
3296
3297 TRACE("CM_Get_DevNode_Custom_Property_ExA(%lx %s %p %p %p %lx %p)\n",
3298 dnDevInst, pszCustomPropertyName, pulRegDataType,
3299 Buffer, pulLength, ulFlags, hMachine);
3300
3301 if (!pulLength)
3302 return CR_INVALID_POINTER;
3303
3304 ulLengthW = *pulLength * sizeof(WCHAR);
3305 BufferW = HeapAlloc(GetProcessHeap(), 0, ulLengthW);
3306 if (!BufferW)
3307 return CR_OUT_OF_MEMORY;
3308
3309 pszPropertyNameW = pSetupMultiByteToUnicode(pszCustomPropertyName,
3310 CP_ACP);
3311 if (pszPropertyNameW == NULL)
3312 {
3313 HeapFree(GetProcessHeap(), 0, BufferW);
3314 return CR_OUT_OF_MEMORY;
3315 }
3316
3318 pszPropertyNameW,
3319 &ulDataType,
3320 BufferW,
3321 &ulLengthW,
3322 ulFlags,
3323 hMachine);
3324 if (ret == CR_SUCCESS)
3325 {
3326 if (ulDataType == REG_SZ ||
3327 ulDataType == REG_EXPAND_SZ ||
3328 ulDataType ==