ReactOS 0.4.15-dev-5667-ged97270
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  _NOTIFY_DATA
 
struct  _INTERNAL_RANGE
 
struct  _INTERNAL_RANGE_LIST
 
struct  _CONFLICT_DATA
 

Macros

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

Typedefs

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

Functions

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

◆ RANGE_LIST_MAGIC

#define RANGE_LIST_MAGIC   0x33445566

Definition at line 98 of file cfgmgr.c.

Typedef Documentation

◆ CONFLICT_DATA

◆ INTERNAL_RANGE

◆ INTERNAL_RANGE_LIST

◆ LOG_CONF_INFO

◆ MACHINE_INFO

◆ NOTIFY_DATA

◆ PCONFLICT_DATA

◆ PINTERNAL_RANGE

◆ PINTERNAL_RANGE_LIST

◆ PLOG_CONF_INFO

◆ PMACHINE_INFO

◆ PNOTIFY_DATA

Function Documentation

◆ CM_Add_Empty_Log_Conf()

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

Definition at line 865 of file cfgmgr.c.

870{
871 TRACE("CM_Add_Empty_Log_Conf(%p %p %lu %lx)\n",
872 plcLogConf, dnDevInst, Priority, ulFlags);
873
874 return CM_Add_Empty_Log_Conf_Ex(plcLogConf, dnDevInst, Priority,
875 ulFlags, NULL);
876}
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:884
#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 884 of file cfgmgr.c.

890{
892 HSTRING_TABLE StringTable = NULL;
893 ULONG ulLogConfTag = 0;
894 LPWSTR lpDevInst;
895 PLOG_CONF_INFO pLogConfInfo;
897
898 FIXME("CM_Add_Empty_Log_Conf_Ex(%p %p %lu %lx %p)\n",
899 plcLogConf, dnDevInst, Priority, ulFlags, hMachine);
900
901 if (!pSetupIsUserAdmin())
902 return CR_ACCESS_DENIED;
903
904 if (plcLogConf == NULL)
905 return CR_INVALID_POINTER;
906
907 if (dnDevInst == 0)
908 return CR_INVALID_DEVINST;
909
910 if (Priority > 0xFFFF)
911 return CR_INVALID_PRIORITY;
912
913 if (ulFlags & ~(LOG_CONF_BITS | PRIORITY_BIT))
914 return CR_INVALID_FLAG;
915
916 if (hMachine != NULL)
917 {
918 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
919 if (BindingHandle == NULL)
920 return CR_FAILURE;
921
922 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
923 if (StringTable == 0)
924 return CR_FAILURE;
925 }
926 else
927 {
928 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
929 return CR_FAILURE;
930 }
931
932 lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
933 if (lpDevInst == NULL)
934 return CR_INVALID_DEVNODE;
935
937 {
939 &ulLogConfTag, ulFlags);
940 }
942 {
944 }
946
947 if (ret == CR_SUCCESS)
948 {
949 pLogConfInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(LOG_CONF_INFO));
950 if (pLogConfInfo == NULL)
951 {
953 }
954 else
955 {
956 pLogConfInfo->ulMagic = LOG_CONF_MAGIC;
957 pLogConfInfo->dnDevInst = dnDevInst;
958 pLogConfInfo->ulType = ulFlags;
959 pLogConfInfo->ulTag = ulLogConfTag;
960
961 *plcLogConf = (LOG_CONF)pLogConfInfo;
962
963 ret = CR_SUCCESS;
964 }
965 }
966
967 return ret;
968}
DWORD WINAPI PNP_AddEmptyLogConf(handle_t hBinding, LPWSTR pDeviceID, DWORD ulPriority, DWORD *pulLogConfTag, DWORD ulFlags)
Definition: rpcserver.c:4087
#define FIXME(fmt,...)
Definition: debug.h:111
#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:136
#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:85
#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 1010 of file cfgmgr.c.

1015{
1016 PWSTR pszIDW;
1017 CONFIGRET ret;
1018
1019 TRACE("CM_Add_ID_ExA(%p %s %lx %p)\n",
1020 dnDevInst, debugstr_a(pszID), ulFlags, hMachine);
1021
1022 if (pSetupCaptureAndConvertAnsiArg(pszID, &pszIDW))
1023 return CR_INVALID_DATA;
1024
1025 ret = CM_Add_ID_ExW(dnDevInst, pszIDW, ulFlags, hMachine);
1026
1027 MyFree(pszIDW);
1028
1029 return ret;
1030}
#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:1038
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 1038 of file cfgmgr.c.

1043{
1045 HSTRING_TABLE StringTable = NULL;
1046 LPWSTR lpDevInst;
1047 CONFIGRET ret;
1048
1049 TRACE("CM_Add_ID_ExW(%p %s %lx %p)\n",
1050 dnDevInst, debugstr_w(pszID), ulFlags, hMachine);
1051
1052 if (!pSetupIsUserAdmin())
1053 return CR_ACCESS_DENIED;
1054
1055 if (dnDevInst == 0)
1056 return CR_INVALID_DEVINST;
1057
1058 if (pszID == NULL)
1059 return CR_INVALID_POINTER;
1060
1061 if (ulFlags & ~CM_ADD_ID_BITS)
1062 return CR_INVALID_FLAG;
1063
1064 if (hMachine != NULL)
1065 {
1066 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1067 if (BindingHandle == NULL)
1068 return CR_FAILURE;
1069
1070 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
1071 if (StringTable == 0)
1072 return CR_FAILURE;
1073 }
1074 else
1075 {
1076 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
1077 return CR_FAILURE;
1078 }
1079
1080 lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
1081 if (lpDevInst == NULL)
1082 return CR_INVALID_DEVNODE;
1083
1085 {
1087 lpDevInst,
1088 pszID,
1089 ulFlags);
1090 }
1092 {
1094 }
1096
1097 return ret;
1098}
DWORD WINAPI PNP_AddID(handle_t hBinding, LPWSTR pszDeviceID, LPWSTR pszID, DWORD ulFlags)
Definition: rpcserver.c:3553
#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 976 of file cfgmgr.c.

980{
981 TRACE("CM_Add_IDA(%p %s %lx)\n",
982 dnDevInst, debugstr_a(pszID), ulFlags);
983
984 return CM_Add_ID_ExA(dnDevInst, pszID, ulFlags, NULL);
985}
CONFIGRET WINAPI CM_Add_ID_ExA(_In_ DEVINST dnDevInst, _In_ PSTR pszID, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:1010

◆ CM_Add_IDW()

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

Definition at line 993 of file cfgmgr.c.

997{
998 TRACE("CM_Add_IDW(%p %s %lx)\n",
999 dnDevInst, debugstr_w(pszID), ulFlags);
1000
1001 return CM_Add_ID_ExW(dnDevInst, pszID, ulFlags, NULL);
1002}

◆ CM_Add_Range()

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

Definition at line 1106 of file cfgmgr.c.

1111{
1112 PINTERNAL_RANGE_LIST pRangeList;
1113 PINTERNAL_RANGE pRange;
1115
1116 FIXME("CM_Add_Range(%I64u %I64u %p %lx)\n",
1117 ullStartValue, ullEndValue, rlh, ulFlags);
1118
1119 pRangeList = (PINTERNAL_RANGE_LIST)rlh;
1120
1121 if (!IsValidRangeList(pRangeList))
1122 return CR_INVALID_RANGE_LIST;
1123
1124 if (ulFlags & ~CM_ADD_RANGE_BITS)
1125 return CR_INVALID_FLAG;
1126
1127 if (ullEndValue < ullStartValue)
1128 return CR_INVALID_RANGE;
1129
1130 /* Lock the range list */
1131 WaitForSingleObject(pRangeList->hMutex, INFINITE);
1132
1133 /* Allocate the new range */
1134 pRange = HeapAlloc(GetProcessHeap(), 0, sizeof(INTERNAL_RANGE));
1135 if (pRange == NULL)
1136 {
1138 goto done;
1139 }
1140
1141 pRange->pRangeList = pRangeList;
1142 pRange->ullStart = ullStartValue;
1143 pRange->ullEnd = ullEndValue;
1144
1145 /* Insert the range */
1146 if (IsListEmpty(&pRangeList->ListHead))
1147 {
1148 InsertTailList(&pRangeList->ListHead, &pRange->ListEntry);
1149 }
1150 else
1151 {
1152 HeapFree(GetProcessHeap(), 0, pRange);
1154 }
1155
1156done:
1157 /* Unlock the range list */
1158 ReleaseMutex(pRangeList->hMutex);
1159
1160 return ret;
1161}
#define UNIMPLEMENTED
Definition: debug.h:115
#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:390
#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:95
DWORDLONG ullEnd
Definition: cfgmgr.c:88
DWORDLONG ullStart
Definition: cfgmgr.c:87
struct _INTERNAL_RANGE_LIST * pRangeList
Definition: cfgmgr.c:86
LIST_ENTRY ListEntry
Definition: cfgmgr.c:85
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 1169 of file cfgmgr.c.

1176{
1177 TRACE("CM_Add_Res_Des(%p %p %lu %p %lu %lx)\n",
1178 prdResDes, lcLogConf, ResourceID, ResourceData, ResourceLen, ulFlags);
1179
1180 return CM_Add_Res_Des_Ex(prdResDes, lcLogConf, ResourceID, ResourceData,
1181 ResourceLen, ulFlags, NULL);
1182}
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:1190

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

1198{
1199 FIXME("CM_Add_Res_Des_Ex(%p %p %lu %p %lu %lx %p)\n",
1200 prdResDes, lcLogConf, ResourceID,
1201 ResourceData, ResourceLen, ulFlags, hMachine);
1202
1204}
#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 1212 of file cfgmgr.c.

1215{
1216 PWSTR pServerNameW;
1217 CONFIGRET ret;
1218
1219 TRACE("CM_Connect_MachineA(%s %p)\n",
1220 debugstr_a(UNCServerName), phMachine);
1221
1222 if (UNCServerName == NULL || *UNCServerName == 0)
1223 return CM_Connect_MachineW(NULL, phMachine);
1224
1225 if (pSetupCaptureAndConvertAnsiArg(UNCServerName, &pServerNameW))
1226 return CR_INVALID_DATA;
1227
1228 ret = CM_Connect_MachineW(pServerNameW, phMachine);
1229
1230 MyFree(pServerNameW);
1231
1232 return ret;
1233}
CONFIGRET WINAPI CM_Connect_MachineW(_In_opt_ PCWSTR UNCServerName, _Out_ PHMACHINE phMachine)
Definition: cfgmgr.c:1241

◆ CM_Connect_MachineW()

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

Definition at line 1241 of file cfgmgr.c.

1244{
1245 PMACHINE_INFO pMachine;
1246
1247 TRACE("CM_Connect_MachineW(%s %p)\n",
1248 debugstr_w(UNCServerName), phMachine);
1249
1250 if (phMachine == NULL)
1251 return CR_INVALID_POINTER;
1252
1253 *phMachine = NULL;
1254
1255 pMachine = HeapAlloc(GetProcessHeap(), 0, sizeof(MACHINE_INFO));
1256 if (pMachine == NULL)
1257 return CR_OUT_OF_MEMORY;
1258
1259 if (UNCServerName == NULL || *UNCServerName == 0)
1260 {
1261 pMachine->bLocal = TRUE;
1262
1263 /* FIXME: store the computers name in pMachine->szMachineName */
1264
1265 if (!PnpGetLocalHandles(&pMachine->BindingHandle,
1266 &pMachine->StringTable))
1267 {
1268 HeapFree(GetProcessHeap(), 0, pMachine);
1269 return CR_FAILURE;
1270 }
1271 }
1272 else
1273 {
1274 pMachine->bLocal = FALSE;
1275 if (wcslen(UNCServerName) >= SP_MAX_MACHINENAME_LENGTH - 1)
1276 {
1277 HeapFree(GetProcessHeap(), 0, pMachine);
1279 }
1280 lstrcpyW(pMachine->szMachineName, UNCServerName);
1281
1283 if (pMachine->StringTable == NULL)
1284 {
1285 HeapFree(GetProcessHeap(), 0, pMachine);
1286 return CR_FAILURE;
1287 }
1288
1289 pSetupStringTableAddString(pMachine->StringTable, L"PLT", 1);
1290
1291 if (!PnpBindRpc(UNCServerName, &pMachine->BindingHandle))
1292 {
1294 HeapFree(GetProcessHeap(), 0, pMachine);
1296 }
1297 }
1298
1299 *phMachine = (PHMACHINE)pMachine;
1300
1301 return CR_SUCCESS;
1302}
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 1348 of file cfgmgr.c.

1354{
1355 DEVINSTID_W pDeviceIDW;
1356 CONFIGRET ret;
1357
1358 TRACE("CM_Create_DevNode_ExA(%p %s %p %lx %p)\n",
1359 pdnDevInst, debugstr_a(pDeviceID), dnParent, ulFlags, hMachine);
1360
1361 if (pSetupCaptureAndConvertAnsiArg(pDeviceID, &pDeviceIDW))
1362 return CR_INVALID_DATA;
1363
1364 ret = CM_Create_DevNode_ExW(pdnDevInst, pDeviceIDW, dnParent, ulFlags,
1365 hMachine);
1366
1367 MyFree(pDeviceIDW);
1368
1369 return ret;
1370}
_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:1378

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

1384{
1386 HSTRING_TABLE StringTable = NULL;
1387 LPWSTR lpParentDevInst;
1389 WCHAR szLocalDeviceID[MAX_DEVICE_ID_LEN];
1390
1391 TRACE("CM_Create_DevNode_ExW(%p %s %p %lx %p)\n",
1392 pdnDevInst, debugstr_w(pDeviceID), dnParent, ulFlags, hMachine);
1393
1394 if (!pSetupIsUserAdmin())
1395 return CR_ACCESS_DENIED;
1396
1397 if (pdnDevInst == NULL)
1398 return CR_INVALID_POINTER;
1399
1400 if (pDeviceID == NULL || wcslen(pDeviceID) == 0 || wcslen(pDeviceID) >= MAX_DEVICE_ID_LEN)
1401 return CR_INVALID_DEVICE_ID;
1402
1403 if (dnParent == 0)
1404 return CR_INVALID_DEVNODE;
1405
1406 if (ulFlags & ~CM_CREATE_DEVNODE_BITS)
1407 return CR_INVALID_FLAG;
1408
1409 if (hMachine != NULL)
1410 {
1411 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1412 if (BindingHandle == NULL)
1413 return CR_FAILURE;
1414
1415 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
1416 if (StringTable == 0)
1417 return CR_FAILURE;
1418 }
1419 else
1420 {
1421 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
1422 return CR_FAILURE;
1423 }
1424
1425 lpParentDevInst = pSetupStringTableStringFromId(StringTable, dnParent);
1426 if (lpParentDevInst == NULL)
1427 return CR_INVALID_DEVNODE;
1428
1429 wcscpy(szLocalDeviceID, pDeviceID);
1430
1432 {
1434 szLocalDeviceID,
1435 lpParentDevInst,
1437 ulFlags);
1438 }
1440 {
1442 }
1444
1445 if (ret == CR_SUCCESS)
1446 {
1447 /* If CM_CREATE_DEVINST_GENERATE_ID was passed in, PNP_CreateDevInst
1448 * will return the generated device ID in szLocalDeviceID */
1449 *pdnDevInst = pSetupStringTableAddString(StringTable, szLocalDeviceID, 1);
1450 if (*pdnDevInst == 0)
1452 }
1453
1454 return ret;
1455}
DWORD WINAPI PNP_CreateDevInst(handle_t hBinding, LPWSTR pszDeviceID, LPWSTR pszParentDeviceID, PNP_RPC_STRING_LEN ulLength, DWORD ulFlags)
Definition: rpcserver.c:3052
#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 1310 of file cfgmgr.c.

1315{
1316 TRACE("CM_Create_DevNodeA(%p %s %p %lx)\n",
1317 pdnDevInst, debugstr_a(pDeviceID), dnParent, ulFlags);
1318
1319 return CM_Create_DevNode_ExA(pdnDevInst, pDeviceID, dnParent,
1320 ulFlags, NULL);
1321}
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:1348

◆ CM_Create_DevNodeW()

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

Definition at line 1329 of file cfgmgr.c.

1334{
1335 TRACE("CM_Create_DevNodeW(%p %s %p %lx)\n",
1336 pdnDevInst, debugstr_w(pDeviceID), dnParent, ulFlags);
1337
1338 return CM_Create_DevNode_ExW(pdnDevInst, pDeviceID, dnParent,
1339 ulFlags, NULL);
1340}

◆ CM_Create_Range_List()

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

Definition at line 1463 of file cfgmgr.c.

1466{
1467 PINTERNAL_RANGE_LIST pRangeList = NULL;
1468
1469 FIXME("CM_Create_Range_List(%p %lx)\n",
1470 prlh, ulFlags);
1471
1472 if (ulFlags != 0)
1473 return CR_INVALID_FLAG;
1474
1475 if (prlh == NULL)
1476 return CR_INVALID_POINTER;
1477
1478 /* Allocate the range list */
1480 if (pRangeList == NULL)
1481 return CR_OUT_OF_MEMORY;
1482
1483 /* Set the magic value */
1484 pRangeList->ulMagic = RANGE_LIST_MAGIC;
1485
1486 /* Initialize the mutex for synchonized access */
1487 pRangeList->hMutex = CreateMutex(NULL, FALSE, NULL);
1488 if (pRangeList->hMutex == NULL)
1489 {
1490 HeapFree(GetProcessHeap(), 0, pRangeList);
1491 return CR_FAILURE;
1492 }
1493
1494 InitializeListHead(&pRangeList->ListHead);
1495
1496 *prlh = (RANGE_LIST)pRangeList;
1497
1498 return CR_SUCCESS;
1499}
DWORD_PTR RANGE_LIST
Definition: cfgmgr32.h:102
#define RANGE_LIST_MAGIC
Definition: cfgmgr.c:98
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define CreateMutex
Definition: winbase.h:3627

◆ CM_Delete_Class_Key()

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

Definition at line 1507 of file cfgmgr.c.

1510{
1511 TRACE("CM_Delete_Class_Key(%p %lx)\n",
1512 ClassGuid, ulFlags);
1513
1514 return CM_Delete_Class_Key_Ex(ClassGuid, ulFlags, NULL);
1515}
CONFIGRET WINAPI CM_Delete_Class_Key_Ex(_In_ LPGUID ClassGuid, _In_ ULONG ulFlags, _In_opt_ HANDLE hMachine)
Definition: cfgmgr.c:1523

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

1527{
1528 WCHAR szGuidString[MAX_GUID_STRING_LEN];
1530 CONFIGRET ret;
1531
1532 TRACE("CM_Delete_Class_Key_Ex(%p %lx %p)\n",
1533 ClassGuid, ulFlags, hMachine);
1534
1535 if (ClassGuid == NULL)
1536 return CR_INVALID_POINTER;
1537
1538 if (ulFlags & ~CM_DELETE_CLASS_BITS)
1539 return CR_INVALID_FLAG;
1540
1541 if (!GuidToString(ClassGuid, szGuidString))
1542 return CR_INVALID_DATA;
1543
1544 if (hMachine != NULL)
1545 {
1546 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1547 if (BindingHandle == NULL)
1548 return CR_FAILURE;
1549 }
1550 else
1551 {
1553 return CR_FAILURE;
1554 }
1555
1557 {
1559 szGuidString,
1560 ulFlags);
1561 }
1563 {
1565 }
1567
1568 return ret;
1569}
DWORD WINAPI PNP_DeleteClassKey(handle_t hBinding, LPWSTR pszClassGuid, DWORD ulFlags)
Definition: rpcserver.c:2478
#define CM_DELETE_CLASS_BITS
Definition: cfgmgr32.h:639
static BOOL GuidToString(_In_ LPGUID Guid, _Out_ LPWSTR String)
Definition: cfgmgr.c:113
#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 1577 of file cfgmgr.c.

1581{
1582 TRACE("CM_Delete_DevNode_Key(%p %lu %lx)\n",
1583 dnDevInst, ulHardwareProfile, ulFlags);
1584
1585 return CM_Delete_DevNode_Key_Ex(dnDevInst, ulHardwareProfile, ulFlags,
1586 NULL);
1587}
CONFIGRET WINAPI CM_Delete_DevNode_Key_Ex(_In_ DEVINST dnDevInst, _In_ ULONG ulHardwareProfile, _In_ ULONG ulFlags, _In_opt_ HANDLE hMachine)
Definition: cfgmgr.c:1595

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

1600{
1602 HSTRING_TABLE StringTable = NULL;
1603 PWSTR pszDevInst, pszKeyPath = NULL, pszInstancePath = NULL;
1604 CONFIGRET ret;
1605
1606 FIXME("CM_Delete_DevNode_Key_Ex(%p %lu %lx %p)\n",
1607 dnDevInst, ulHardwareProfile, ulFlags, hMachine);
1608
1609 if (dnDevInst == 0)
1610 return CR_INVALID_DEVINST;
1611
1612 if (ulFlags & ~CM_REGISTRY_BITS)
1613 return CR_INVALID_FLAG;
1614
1615 if ((ulFlags & CM_REGISTRY_USER) && (ulFlags & CM_REGISTRY_CONFIG))
1616 return CR_INVALID_FLAG;
1617
1618 if (hMachine != NULL)
1619 {
1620 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1621 if (BindingHandle == NULL)
1622 return CR_FAILURE;
1623
1624 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
1625 if (StringTable == 0)
1626 return CR_FAILURE;
1627 }
1628 else
1629 {
1630 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
1631 return CR_FAILURE;
1632 }
1633
1634 pszDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
1635 if (pszDevInst == NULL)
1636 return CR_INVALID_DEVNODE;
1637
1638 TRACE("pszDevInst: %S\n", pszDevInst);
1639
1640 pszKeyPath = MyMalloc(512 * sizeof(WCHAR));
1641 if (pszKeyPath == NULL)
1642 {
1644 goto done;
1645 }
1646
1647 pszInstancePath = MyMalloc(512 * sizeof(WCHAR));
1648 if (pszInstancePath == NULL)
1649 {
1651 goto done;
1652 }
1653
1655 pszDevInst,
1656 pszKeyPath,
1657 pszInstancePath,
1658 ulHardwareProfile,
1659 ulFlags);
1660 if (ret != CR_SUCCESS)
1661 goto done;
1662
1663 TRACE("pszKeyPath: %S\n", pszKeyPath);
1664 TRACE("pszInstancePath: %S\n", pszInstancePath);
1665
1666 if (ulFlags & CM_REGISTRY_USER)
1667 {
1668 FIXME("The CM_REGISTRY_USER flag is not supported yet!\n");
1669 }
1670 else
1671 {
1672#if 0
1673 if (!pSetupIsUserAdmin())
1674 {
1676 goto done;
1677 }
1678#endif
1679
1680 if (!(ulFlags & CM_REGISTRY_CONFIG))
1681 ulHardwareProfile = 0;
1682
1684 {
1686 pszDevInst,
1687 pszKeyPath,
1688 pszInstancePath,
1689 ulHardwareProfile);
1690 }
1692 {
1694 }
1696 }
1697
1698done:
1699 if (pszInstancePath != NULL)
1700 MyFree(pszInstancePath);
1701
1702 if (pszKeyPath != NULL)
1703 MyFree(pszKeyPath);
1704
1705 return ret;
1706}
DWORD WINAPI PNP_DeleteRegistryKey(handle_t hBinding, LPWSTR pszDeviceID, LPWSTR pszParentKey, LPWSTR pszChildKey, DWORD ulFlags)
Definition: rpcserver.c:2360
#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:224
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 1714 of file cfgmgr.c.

1719{
1720 FIXME("CM_Delete_Range(%I64u %I64u %p %lx)\n",
1721 ullStartValue, ullEndValue, rlh, ulFlags);
1722
1724}

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

1739{
1740 TRACE("CM_Detect_Resource_Conflict(%p %lu %p %lu %p 0x%lx)\n",
1741 dnDevInst, ResourceID, ResourceData, ResourceLen,
1742 pbConflictDetected, ulFlags);
1743
1744 return CM_Detect_Resource_Conflict_Ex(dnDevInst,
1745 ResourceID,
1746 ResourceData,
1747 ResourceLen,
1748 pbConflictDetected,
1749 ulFlags,
1750 NULL);
1751}
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:1759

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

1767{
1768 FIXME("CM_Detect_Resource_Conflict_Ex(%p %lu %p %lu %p 0x%lx %p)\n",
1769 dnDevInst, ResourceID, ResourceData, ResourceLen,
1770 pbConflictDetected, ulFlags, hMachine);
1771
1773}

Referenced by CM_Detect_Resource_Conflict().

◆ CM_Disable_DevNode()

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

Definition at line 1781 of file cfgmgr.c.

1784{
1785 TRACE("CM_Disable_DevNode(%p %lx)\n",
1786 dnDevInst, ulFlags);
1787
1788 return CM_Disable_DevNode_Ex(dnDevInst, ulFlags, NULL);
1789}
CONFIGRET WINAPI CM_Disable_DevNode_Ex(_In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:1797

◆ CM_Disable_DevNode_Ex()

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

Definition at line 1797 of file cfgmgr.c.

1801{
1803 HSTRING_TABLE StringTable = NULL;
1804 LPWSTR lpDevInst;
1805 CONFIGRET ret;
1806
1807 TRACE("CM_Disable_DevNode_Ex(%p %lx %p)\n",
1808 dnDevInst, ulFlags, hMachine);
1809
1810 if (!pSetupIsUserAdmin())
1811 return CR_ACCESS_DENIED;
1812
1813 if (dnDevInst == 0)
1814 return CR_INVALID_DEVINST;
1815
1816 if (ulFlags != 0)
1817 return CR_INVALID_FLAG;
1818
1819 if (hMachine != NULL)
1820 {
1821 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1822 if (BindingHandle == NULL)
1823 return CR_FAILURE;
1824
1825 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
1826 if (StringTable == 0)
1827 return CR_FAILURE;
1828 }
1829 else
1830 {
1831 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
1832 return CR_FAILURE;
1833 }
1834
1835 lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
1836 if (lpDevInst == NULL)
1837 return CR_INVALID_DEVNODE;
1838
1840 {
1842 lpDevInst,
1843 NULL,
1844 NULL,
1845 0,
1846 ulFlags);
1847 }
1849 {
1851 }
1853
1854 return ret;
1855}
DWORD WINAPI PNP_DisableDevInst(handle_t hBinding, LPWSTR pDeviceID, PPNP_VETO_TYPE pVetoType, LPWSTR pszVetoName, DWORD ulNameLength, DWORD ulFlags)
Definition: rpcserver.c:3468

Referenced by CM_Disable_DevNode(), and StopDevice().

◆ CM_Disconnect_Machine()

CONFIGRET WINAPI CM_Disconnect_Machine ( _In_opt_ HMACHINE  hMachine)

Definition at line 1863 of file cfgmgr.c.

1865{
1866 PMACHINE_INFO pMachine;
1867
1868 TRACE("CM_Disconnect_Machine(%p)\n", hMachine);
1869
1870 pMachine = (PMACHINE_INFO)hMachine;
1871 if (pMachine == NULL)
1872 return CR_SUCCESS;
1873
1874 if (pMachine->bLocal == FALSE)
1875 {
1876 if (pMachine->StringTable != NULL)
1878
1879 if (!PnpUnbindRpc(pMachine->BindingHandle))
1880 return CR_ACCESS_DENIED;
1881 }
1882
1883 HeapFree(GetProcessHeap(), 0, pMachine);
1884
1885 return CR_SUCCESS;
1886}
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 1894 of file cfgmgr.c.

1898{
1899 FIXME("CM_Dup_Range_List(%p %p %lx)\n",
1900 rlhOld, rlhNew, ulFlags);
1901
1903}

◆ CM_Enable_DevNode()

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

Definition at line 1911 of file cfgmgr.c.

1914{
1915 TRACE("CM_Enable_DevNode(%p %lx)\n",
1916 dnDevInst, ulFlags);
1917
1918 return CM_Enable_DevNode_Ex(dnDevInst, ulFlags, NULL);
1919}
CONFIGRET WINAPI CM_Enable_DevNode_Ex(_In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:1927

◆ CM_Enable_DevNode_Ex()

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

Definition at line 1927 of file cfgmgr.c.

1931{
1933 HSTRING_TABLE StringTable = NULL;
1934 LPWSTR lpDevInst;
1935 CONFIGRET ret;
1936
1937 TRACE("CM_Enable_DevNode_Ex(%p %lx %p)\n",
1938 dnDevInst, ulFlags, hMachine);
1939
1940 if (!pSetupIsUserAdmin())
1941 return CR_ACCESS_DENIED;
1942
1943 if (dnDevInst == 0)
1944 return CR_INVALID_DEVINST;
1945
1946 if (ulFlags != 0)
1947 return CR_INVALID_FLAG;
1948
1949 if (hMachine != NULL)
1950 {
1951 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1952 if (BindingHandle == NULL)
1953 return CR_FAILURE;
1954
1955 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
1956 if (StringTable == 0)
1957 return CR_FAILURE;
1958 }
1959 else
1960 {
1961 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
1962 return CR_FAILURE;
1963 }
1964
1965 lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
1966 if (lpDevInst == NULL)
1967 return CR_INVALID_DEVNODE;
1968
1970 {
1972 PNP_DEVINST_ENABLE,
1973 ulFlags,
1974 lpDevInst,
1975 NULL);
1976 }
1978 {
1980 }
1982
1983 return ret;
1984}
DWORD WINAPI PNP_DeviceInstanceAction(handle_t hBinding, DWORD ulMajorAction, DWORD ulMinorAction, LPWSTR pszDeviceInstance1, LPWSTR pszDeviceInstance2)
Definition: rpcserver.c:3292

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

1996{
1997 TRACE("CM_Enumerate_Classes(%lx %p %lx)\n",
1998 ulClassIndex, ClassGuid, ulFlags);
1999
2000 return CM_Enumerate_Classes_Ex(ulClassIndex, ClassGuid, ulFlags, NULL);
2001}
CONFIGRET WINAPI CM_Enumerate_Classes_Ex(_In_ ULONG ulClassIndex, _Out_ LPGUID ClassGuid, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2009

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

2014{
2015 WCHAR szBuffer[MAX_GUID_STRING_LEN];
2018 ULONG ulLength = MAX_GUID_STRING_LEN;
2019
2020 TRACE("CM_Enumerate_Classes_Ex(%lx %p %lx %p)\n",
2021 ulClassIndex, ClassGuid, ulFlags, hMachine);
2022
2023 if (ClassGuid == NULL)
2024 return CR_INVALID_POINTER;
2025
2026 if (ulFlags != 0)
2027 return CR_INVALID_FLAG;
2028
2029 if (hMachine != NULL)
2030 {
2031 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2032 if (BindingHandle == NULL)
2033 return CR_FAILURE;
2034 }
2035 else
2036 {
2038 return CR_FAILURE;
2039 }
2040
2042 {
2044 PNP_CLASS_SUBKEYS,
2045 ulClassIndex,
2046 szBuffer,
2048 &ulLength,
2049 ulFlags);
2050 }
2052 {
2054 }
2056
2057 if (ret == CR_SUCCESS)
2058 {
2059 /* Remove the {} */
2060 szBuffer[MAX_GUID_STRING_LEN - 2] = UNICODE_NULL;
2061
2062 /* Convert the buffer to a GUID */
2063 if (UuidFromStringW(&szBuffer[1], ClassGuid) != RPC_S_OK)
2064 return CR_FAILURE;
2065 }
2066
2067 return ret;
2068}
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:851
#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 2114 of file cfgmgr.c.

2120{
2121 WCHAR szBuffer[MAX_DEVICE_ID_LEN];
2122 ULONG ulOrigLength;
2123 ULONG ulLength;
2125
2126 TRACE("CM_Enumerate_Enumerators_ExA(%lu %p %p %lx %p)\n",
2127 ulEnumIndex, Buffer, pulLength, ulFlags, hMachine);
2128
2129 if (Buffer == NULL || pulLength == NULL)
2130 return CR_INVALID_POINTER;
2131
2132 if (ulFlags != 0)
2133 return CR_INVALID_FLAG;
2134
2135 ulOrigLength = *pulLength;
2136 *pulLength = 0;
2137
2138 ulLength = MAX_DEVICE_ID_LEN;
2139 ret = CM_Enumerate_Enumerators_ExW(ulEnumIndex, szBuffer, &ulLength,
2140 ulFlags, hMachine);
2141 if (ret == CR_SUCCESS)
2142 {
2144 0,
2145 szBuffer,
2146 ulLength,
2147 Buffer,
2148 ulOrigLength,
2149 NULL,
2150 NULL) == 0)
2151 ret = CR_FAILURE;
2152 else
2153 *pulLength = lstrlenA(Buffer) + 1;
2154 }
2155
2156 return ret;
2157}
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:2165
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 2165 of file cfgmgr.c.

2171{
2173 CONFIGRET ret;
2174
2175 TRACE("CM_Enumerate_Enumerators_ExW(%lu %p %p %lx %p)\n",
2176 ulEnumIndex, Buffer, pulLength, ulFlags, hMachine);
2177
2178 if (Buffer == NULL || pulLength == NULL)
2179 return CR_INVALID_POINTER;
2180
2181 if (ulFlags != 0)
2182 return CR_INVALID_FLAG;
2183
2185
2186 if (hMachine != NULL)
2187 {
2188 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2189 if (BindingHandle == NULL)
2190 return CR_FAILURE;
2191 }
2192 else
2193 {
2195 return CR_FAILURE;
2196 }
2197
2199 {
2201 PNP_ENUMERATOR_SUBKEYS,
2202 ulEnumIndex,
2203 Buffer,
2204 *pulLength,
2205 pulLength,
2206 ulFlags);
2207 }
2209 {
2211 }
2213
2214 return ret;
2215}

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

2081{
2082 TRACE("CM_Enumerate_EnumeratorsA(%lu %p %p %lx)\n",
2083 ulEnumIndex, Buffer, pulLength, ulFlags);
2084
2085 return CM_Enumerate_Enumerators_ExA(ulEnumIndex, Buffer, pulLength,
2086 ulFlags, NULL);
2087}
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:2114

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

2100{
2101 TRACE("CM_Enumerate_EnumeratorsW(%lu %p %p %lx)\n",
2102 ulEnumIndex, Buffer, pulLength, ulFlags);
2103
2104 return CM_Enumerate_Enumerators_ExW(ulEnumIndex, Buffer, pulLength,
2105 ulFlags, NULL);
2106}

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

2231{
2232 FIXME("CM_Find_Range(%p %I64u %lu %I64u %I64u %p %lx)\n",
2233 pullStart, ullStart, ulLength, ullAlignment, ullEnd, rlh, ulFlags);
2234
2236}

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

2250{
2251 PINTERNAL_RANGE_LIST pRangeList;
2252 PINTERNAL_RANGE pRange;
2253 PLIST_ENTRY ListEntry;
2255
2256 FIXME("CM_First_Range(%p %p %p %p %lx)\n",
2257 rlh, pullStart, pullEnd, preElement, ulFlags);
2258
2259 pRangeList = (PINTERNAL_RANGE_LIST)rlh;
2260
2261 if (!IsValidRangeList(pRangeList))
2262 return CR_INVALID_RANGE_LIST;
2263
2264 if (pullStart == NULL || pullEnd == NULL || preElement == NULL)
2265 return CR_INVALID_POINTER;
2266
2267 if (ulFlags != 0)
2268 return CR_INVALID_FLAG;
2269
2270 /* Lock the range list */
2271 WaitForSingleObject(pRangeList->hMutex, INFINITE);
2272
2273 /* Fail, if the list is empty */
2274 if (IsListEmpty(&pRangeList->ListHead))
2275 {
2276 ret = CR_FAILURE;
2277 goto done;
2278 }
2279
2280 /* Get the first range */
2281 ListEntry = pRangeList->ListHead.Flink;
2282 pRange = CONTAINING_RECORD(ListEntry, INTERNAL_RANGE, ListEntry);
2283
2284 /* Return the range data */
2285 *pullStart = pRange->ullStart;
2286 *pullEnd = pRange->ullEnd;
2287 *preElement = (RANGE_ELEMENT)pRange;
2288
2289done:
2290 /* Unlock the range list */
2291 ReleaseMutex(pRangeList->hMutex);
2292
2293 return ret;
2294}
DWORD_PTR RANGE_ELEMENT
Definition: cfgmgr32.h:105
Definition: typedefs.h:120
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

◆ CM_Free_Log_Conf()

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

Definition at line 2302 of file cfgmgr.c.

2305{
2306 TRACE("CM_Free_Log_Conf(%lx %lx)\n",
2307 lcLogConfToBeFreed, ulFlags);
2308
2309 return CM_Free_Log_Conf_Ex(lcLogConfToBeFreed, ulFlags, NULL);
2310}
CONFIGRET WINAPI CM_Free_Log_Conf_Ex(_In_ LOG_CONF lcLogConfToBeFreed, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2318

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

2322{
2324 HSTRING_TABLE StringTable = NULL;
2325 LPWSTR lpDevInst;
2326 PLOG_CONF_INFO pLogConfInfo;
2327 CONFIGRET ret;
2328
2329 TRACE("CM_Free_Log_Conf_Ex(%lx %lx %p)\n",
2330 lcLogConfToBeFreed, ulFlags, hMachine);
2331
2332 if (!pSetupIsUserAdmin())
2333 return CR_ACCESS_DENIED;
2334
2335 pLogConfInfo = (PLOG_CONF_INFO)lcLogConfToBeFreed;
2336 if (!IsValidLogConf(pLogConfInfo))
2337 return CR_INVALID_LOG_CONF;
2338
2339 if (ulFlags != 0)
2340 return CR_INVALID_FLAG;
2341
2342 if (hMachine != NULL)
2343 {
2344 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2345 if (BindingHandle == NULL)
2346 return CR_FAILURE;
2347
2348 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
2349 if (StringTable == 0)
2350 return CR_FAILURE;
2351 }
2352 else
2353 {
2354 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
2355 return CR_FAILURE;
2356 }
2357
2358 lpDevInst = pSetupStringTableStringFromId(StringTable, pLogConfInfo->dnDevInst);
2359 if (lpDevInst == NULL)
2360 return CR_INVALID_DEVNODE;
2361
2363 {
2365 lpDevInst,
2366 pLogConfInfo->ulType,
2367 pLogConfInfo->ulTag,
2368 0);
2369 }
2371 {
2373 }
2375
2376 return ret;
2377}
DWORD WINAPI PNP_FreeLogConf(handle_t hBinding, LPWSTR pDeviceID, DWORD ulLogConfType, DWORD ulLogConfTag, DWORD ulFlags)
Definition: rpcserver.c:4102
#define CR_INVALID_LOG_CONF
Definition: cfgmgr32.h:850
BOOL IsValidLogConf(_In_opt_ PLOG_CONF_INFO pLogConfInfo)
Definition: cfgmgr.c:414
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 2385 of file cfgmgr.c.

2387{
2388 PLOG_CONF_INFO pLogConfInfo;
2389
2390 TRACE("CM_Free_Log_Conf_Handle(%lx)\n", lcLogConf);
2391
2392 pLogConfInfo = (PLOG_CONF_INFO)lcLogConf;
2393 if (!IsValidLogConf(pLogConfInfo))
2394 return CR_INVALID_LOG_CONF;
2395
2396 HeapFree(GetProcessHeap(), 0, pLogConfInfo);
2397
2398 return CR_SUCCESS;
2399}

◆ CM_Free_Range_List()

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

Definition at line 2407 of file cfgmgr.c.

2410{
2411 PINTERNAL_RANGE_LIST pRangeList;
2412 PINTERNAL_RANGE pRange;
2413 PLIST_ENTRY ListEntry;
2414
2415 FIXME("CM_Free_Range_List(%p %lx)\n",
2416 RangeList, ulFlags);
2417
2418 pRangeList = (PINTERNAL_RANGE_LIST)RangeList;
2419
2420 if (!IsValidRangeList(pRangeList))
2421 return CR_INVALID_RANGE_LIST;
2422
2423 if (ulFlags != 0)
2424 return CR_INVALID_FLAG;
2425
2426 /* Lock the range list */
2427 WaitForSingleObject(pRangeList->hMutex, INFINITE);
2428
2429 /* Free the list of ranges */
2430 while (!IsListEmpty(&pRangeList->ListHead))
2431 {
2432 ListEntry = RemoveHeadList(&pRangeList->ListHead);
2433 pRange = CONTAINING_RECORD(ListEntry, INTERNAL_RANGE, ListEntry);
2434 HeapFree(GetProcessHeap(), 0, pRange);
2435 }
2436
2437 /* Unlock the range list */
2438 ReleaseMutex(pRangeList->hMutex);
2439
2440 /* Close the mutex */
2441 CloseHandle(pRangeList->hMutex);
2442
2443 /* Free the range list */
2444 HeapFree(GetProcessHeap(), 0, pRangeList);
2445
2446 return CR_SUCCESS;
2447}
#define CloseHandle
Definition: compat.h:739
#define RemoveHeadList(ListHead)
Definition: env_spec_w32.h:964

◆ CM_Free_Res_Des()

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

Definition at line 2455 of file cfgmgr.c.

2459{
2460 TRACE("CM_Free_Res_Des(%p %p %lx)\n",
2461 prdResDes, rdResDes, ulFlags);
2462
2463 return CM_Free_Res_Des_Ex(prdResDes, rdResDes, ulFlags, NULL);
2464}
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:2472

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

2477{
2478 FIXME("CM_Free_Res_Des_Ex(%p %p %lx %p)\n",
2479 prdResDes, rdResDes, ulFlags, hMachine);
2480
2482}

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

2492{
2493 FIXME("CM_Free_Res_Des_Handle(%p)\n", rdResDes);
2494
2496}

◆ CM_Free_Resource_Conflict_Handle()

CONFIGRET WINAPI CM_Free_Resource_Conflict_Handle ( _In_ CONFLICT_LIST  clConflictList)

Definition at line 2504 of file cfgmgr.c.

2506{
2507 PCONFLICT_DATA pConflictData;
2508
2509 FIXME("CM_Free_Resource_Conflict_Handle(%p)\n",
2510 clConflictList);
2511
2512 pConflictData = (PCONFLICT_DATA)clConflictList;
2513 if (!IsValidConflictData(pConflictData))
2515
2516 if (pConflictData->pConflictList != NULL)
2517 MyFree(pConflictData->pConflictList);
2518
2519 MyFree(pConflictData);
2520
2521 return CR_SUCCESS;
2522}
#define CR_INVALID_CONFLICT_LIST
Definition: cfgmgr32.h:903
BOOL IsValidConflictData(_In_opt_ PCONFLICT_DATA pConflictData)
Definition: cfgmgr.c:438
struct _CONFLICT_DATA * PCONFLICT_DATA
PPNP_CONFLICT_LIST pConflictList
Definition: cfgmgr.c:103

◆ CM_Get_Child()

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

Definition at line 2530 of file cfgmgr.c.

2534{
2535 TRACE("CM_Get_Child(%p %p %lx)\n",
2536 pdnDevInst, dnDevInst, ulFlags);
2537
2538 return CM_Get_Child_Ex(pdnDevInst, dnDevInst, ulFlags, NULL);
2539}
CONFIGRET WINAPI CM_Get_Child_Ex(_Out_ PDEVINST pdnDevInst, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2547

Referenced by CDeviceView::GetChildDevice(), GetMonitorDevInstID(), and RecursiveInsertSubDevices().

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

2552{
2553 WCHAR szRelatedDevInst[MAX_DEVICE_ID_LEN];
2555 HSTRING_TABLE StringTable = NULL;
2556 LPWSTR lpDevInst;
2557 DWORD dwIndex, dwLength = MAX_DEVICE_ID_LEN;
2558 CONFIGRET ret;
2559
2560 TRACE("CM_Get_Child_Ex(%p %lx %lx %p)\n",
2561 pdnDevInst, dnDevInst, ulFlags, hMachine);
2562
2563 if (pdnDevInst == NULL)
2564 return CR_INVALID_POINTER;
2565
2566 if (dnDevInst == 0)
2567 return CR_INVALID_DEVINST;
2568
2569 if (ulFlags != 0)
2570 return CR_INVALID_FLAG;
2571
2572 *pdnDevInst = -1;
2573
2574 if (hMachine != NULL)
2575 {
2576 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2577 if (BindingHandle == NULL)
2578 return CR_FAILURE;
2579
2580 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
2581 if (StringTable == 0)
2582 return CR_FAILURE;
2583 }
2584 else
2585 {
2586 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
2587 return CR_FAILURE;
2588 }
2589
2590 lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
2591 if (lpDevInst == NULL)
2592 return CR_INVALID_DEVNODE;
2593
2595 {
2597 PNP_GET_CHILD_DEVICE_INSTANCE,
2598 lpDevInst,
2599 szRelatedDevInst,
2600 &dwLength,
2601 0);
2602 }
2604 {
2606 }
2608
2609 if (ret != CR_SUCCESS)
2610 return ret;
2611
2612 TRACE("szRelatedDevInst: %s\n", debugstr_w(szRelatedDevInst));
2613
2614 dwIndex = pSetupStringTableAddString(StringTable, szRelatedDevInst, 1);
2615 if (dwIndex == -1)
2616 return CR_FAILURE;
2617
2618 *pdnDevInst = dwIndex;
2619
2620 return CR_SUCCESS;
2621}
DWORD WINAPI PNP_GetRelatedDeviceInstance(handle_t hBinding, DWORD ulRelationship, LPWSTR pDeviceID, LPWSTR pRelatedDeviceId, PNP_RPC_STRING_LEN *pulLength, DWORD ulFlags)
Definition: rpcserver.c:773
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 2667 of file cfgmgr.c.

2673{
2674 WCHAR szBuffer[MAX_GUID_STRING_LEN];
2676 ULONG ulLength;
2677 ULONG ulOrigLength;
2678
2679 TRACE("CM_Get_Class_Key_Name_ExA(%p %p %p %lx %p)\n",
2680 ClassGuid, pszKeyName, pulLength, ulFlags, hMachine);
2681
2682 if (ClassGuid == NULL || pszKeyName == NULL || pulLength == NULL)
2683 return CR_INVALID_POINTER;
2684
2685 ulOrigLength = *pulLength;
2686 *pulLength = 0;
2687
2688 ulLength = MAX_GUID_STRING_LEN;
2689 ret = CM_Get_Class_Key_Name_ExW(ClassGuid, szBuffer, &ulLength,
2690 ulFlags, hMachine);
2691 if (ret == CR_SUCCESS)
2692 {
2694 0,
2695 szBuffer,
2696 ulLength,
2697 pszKeyName,
2698 ulOrigLength,
2699 NULL,
2700 NULL) == 0)
2701 ret = CR_FAILURE;
2702 else
2703 *pulLength = lstrlenA(pszKeyName) + 1;
2704 }
2705
2706 return CR_SUCCESS;
2707}
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:2715

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

2721{
2722 TRACE("CM_Get_Class_Key_Name_ExW(%p %p %p %lx %p)\n",
2723 ClassGuid, pszKeyName, pulLength, ulFlags, hMachine);
2724
2725 if (ClassGuid == NULL || pszKeyName == NULL || pulLength == NULL)
2726 return CR_INVALID_POINTER;
2727
2728 if (ulFlags != 0)
2729 return CR_INVALID_FLAG;
2730
2731 if (*pulLength < MAX_GUID_STRING_LEN)
2732 {
2733 *pulLength = 0;
2734 return CR_BUFFER_SMALL;
2735 }
2736
2737 if (!GuidToString(ClassGuid, pszKeyName))
2738 return CR_INVALID_DATA;
2739
2740 *pulLength = MAX_GUID_STRING_LEN;
2741
2742 return CR_SUCCESS;
2743}
#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 2629 of file cfgmgr.c.

2634{
2635 TRACE("CM_Get_Class_Key_NameA(%p %p %p %lx)\n",
2636 ClassGuid, pszKeyName, pulLength, ulFlags);
2637
2638 return CM_Get_Class_Key_Name_ExA(ClassGuid, pszKeyName, pulLength,
2639 ulFlags, NULL);
2640}
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:2667

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

2653{
2654 TRACE("CM_Get_Class_Key_NameW(%p %p %p %lx)\n",
2655 ClassGuid, pszKeyName, pulLength, ulFlags);
2656
2657 return CM_Get_Class_Key_Name_ExW(ClassGuid, pszKeyName, pulLength,
2658 ulFlags, NULL);
2659}

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

2795{
2796 WCHAR szBuffer[MAX_CLASS_NAME_LEN];
2798 ULONG ulLength;
2799 ULONG ulOrigLength;
2800
2801 TRACE("CM_Get_Class_Name_ExA(%p %p %p %lx %p)\n",
2802 ClassGuid, Buffer, pulLength, ulFlags, hMachine);
2803
2804 if (ClassGuid == NULL || Buffer == NULL || pulLength == NULL)
2805 return CR_INVALID_POINTER;
2806
2807 ulOrigLength = *pulLength;
2808 *pulLength = 0;
2809
2810 ulLength = MAX_CLASS_NAME_LEN;
2811 ret = CM_Get_Class_Name_ExW(ClassGuid, szBuffer, &ulLength,
2812 ulFlags, hMachine);
2813 if (ret == CR_SUCCESS)
2814 {
2816 0,
2817 szBuffer,
2818 ulLength,
2819 Buffer,
2820 ulOrigLength,
2821 NULL,
2822 NULL) == 0)
2823 ret = CR_FAILURE;
2824 else
2825 *pulLength = lstrlenA(Buffer) + 1;
2826 }
2827
2828 return ret;
2829}
#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:2837

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

2843{
2844 WCHAR szGuidString[MAX_GUID_STRING_LEN];
2846 CONFIGRET ret;
2847
2848 TRACE("CM_Get_Class_Name_ExW(%p %p %p %lx %p\n",
2849 ClassGuid, Buffer, pulLength, ulFlags, hMachine);
2850
2851 if (ClassGuid == NULL || Buffer == NULL || pulLength == NULL)
2852 return CR_INVALID_POINTER;
2853
2854 if (ulFlags != 0)
2855 return CR_INVALID_FLAG;
2856
2857 if (!GuidToString(ClassGuid, szGuidString))
2858 return CR_INVALID_DATA;
2859
2860 TRACE("Guid %s\n", debugstr_w(szGuidString));
2861
2862 if (hMachine != NULL)
2863 {
2864 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2865 if (BindingHandle == NULL)
2866 return CR_FAILURE;
2867 }
2868 else
2869 {
2871 return CR_FAILURE;
2872 }
2873
2875 {
2877 szGuidString,
2878 Buffer,
2879 pulLength,
2880 ulFlags);
2881 }
2883 {
2885 }
2887
2888 return ret;
2889}
DWORD WINAPI PNP_GetClassName(handle_t hBinding, LPWSTR pszClassGuid, LPWSTR Buffer, PNP_RPC_STRING_LEN *pulLength, DWORD ulFlags)
Definition: rpcserver.c:2420

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

2756{
2757 TRACE("CM_Get_Class_NameA(%p %p %p %lx)\n",
2758 ClassGuid, Buffer, pulLength, ulFlags);
2759
2760 return CM_Get_Class_Name_ExA(ClassGuid, Buffer, pulLength, ulFlags,
2761 NULL);
2762}
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:2789

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

2775{
2776 TRACE("CM_Get_Class_NameW(%p %p %p %lx)\n",
2777 ClassGuid, Buffer, pulLength, ulFlags);
2778
2779 return CM_Get_Class_Name_ExW(ClassGuid, Buffer, pulLength, ulFlags,
2780 NULL);
2781}

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

2905{
2906 PWSTR BufferW = NULL;
2907 ULONG ulLength = 0;
2908 ULONG ulType;
2909 CONFIGRET ret;
2910
2911 TRACE("CM_Get_Class_Registry_PropertyA(%p %lu %p %p %p %lx %p)\n",
2912 ClassGuid, ulProperty, pulRegDataType, Buffer, pulLength,
2913 ulFlags, hMachine);
2914
2915 if (pulLength == NULL)
2916 return CR_INVALID_POINTER;
2917
2918 if (ulProperty < CM_CRP_MIN || ulProperty > CM_CRP_MAX)
2919 return CR_INVALID_PROPERTY;
2920
2921 ulType = GetRegistryPropertyType(ulProperty);
2922 if (ulType == REG_SZ || ulType == REG_MULTI_SZ)
2923 {
2924 /* Get the required buffer size */
2925 ret = CM_Get_Class_Registry_PropertyW(ClassGuid, ulProperty, pulRegDataType,
2926 NULL, &ulLength, ulFlags, hMachine);
2927 if (ret != CR_BUFFER_SMALL)
2928 return ret;
2929
2930 /* Allocate the unicode buffer */
2931 BufferW = HeapAlloc(GetProcessHeap(), 0, ulLength);
2932 if (BufferW == NULL)
2933 return CR_OUT_OF_MEMORY;
2934
2935 /* Get the property */
2936 ret = CM_Get_Class_Registry_PropertyW(ClassGuid, ulProperty, pulRegDataType,
2937 BufferW, &ulLength, ulFlags, hMachine);
2938 if (ret != CR_SUCCESS)
2939 {
2940 HeapFree(GetProcessHeap(), 0, BufferW);
2941 return ret;
2942 }
2943
2944 /* Do W->A conversion */
2945 *pulLength = WideCharToMultiByte(CP_ACP,
2946 0,
2947 BufferW,
2948 ulLength,
2949 Buffer,
2950 *pulLength,
2951 NULL,
2952 NULL);
2953
2954 /* Release the unicode buffer */
2955 HeapFree(GetProcessHeap(), 0, BufferW);
2956
2957 if (*pulLength == 0)
2958 ret = CR_FAILURE;
2959 }
2960 else
2961 {
2962 /* Get the property */
2963 ret = CM_Get_Class_Registry_PropertyW(ClassGuid, ulProperty, pulRegDataType,
2964 Buffer, pulLength, ulFlags, hMachine);
2965 }
2966
2967 return ret;
2968}
#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:2976
static ULONG GetRegistryPropertyType(_In_ ULONG ulProperty)
Definition: cfgmgr.c:145
#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:48

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

2984{
2986 WCHAR szGuidString[PNP_MAX_GUID_STRING_LEN + 1];
2987 ULONG ulType = 0;
2988 ULONG ulTransferLength = 0;
2989 CONFIGRET ret;
2990
2991 TRACE("CM_Get_Class_Registry_PropertyW(%p %lu %p %p %p %lx %p)\n",
2992 ClassGuid, ulProperty, pulRegDataType, Buffer, pulLength,
2993 ulFlags, hMachine);
2994
2995 if (ClassGuid == NULL || pulLength == NULL)
2996 return CR_INVALID_POINTER;
2997
2998 if (ulFlags != 0)
2999 return CR_INVALID_FLAG;
3000
3001 if (pSetupStringFromGuid(ClassGuid,
3002 szGuidString,
3004 return CR_INVALID_DATA;
3005
3006 if (ulProperty < CM_CRP_MIN || ulProperty > CM_CRP_MAX)
3007 return CR_INVALID_PROPERTY;
3008
3009 if (hMachine != NULL)
3010 {
3011 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
3012 if (BindingHandle == NULL)
3013 return CR_FAILURE;
3014 }
3015 else
3016 {
3018 return CR_FAILURE;
3019 }
3020
3021 ulTransferLength = *pulLength;
3022
3024 {
3026 szGuidString,
3027 ulProperty,
3028 &ulType,
3029 Buffer,
3030 &ulTransferLength,
3031 pulLength,
3032 ulFlags);
3033 }
3035 {
3037 }
3039
3040 if (ret == CR_SUCCESS)
3041 {
3042 if (pulRegDataType != NULL)
3043 *pulRegDataType = ulType;
3044 }
3045
3046 return ret;
3047}
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:2653
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 3055 of file cfgmgr.c.

3059{
3060 TRACE("CM_Get_Depth(%p %lx %lx)\n",
3061 pulDepth, dnDevInst, ulFlags);
3062
3063 return CM_Get_Depth_Ex(pulDepth, dnDevInst, ulFlags, NULL);
3064}
CONFIGRET WINAPI CM_Get_Depth_Ex(_Out_ PULONG pulDepth, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:3072

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

3077{
3079 HSTRING_TABLE StringTable = NULL;
3080 LPWSTR lpDevInst;
3081 CONFIGRET ret;
3082
3083 TRACE("CM_Get_Depth_Ex(%p %lx %lx %p)\n",
3084 pulDepth, dnDevInst, ulFlags, hMachine);
3085
3086 if (pulDepth == NULL)
3087 return CR_INVALID_POINTER;
3088
3089 if (dnDevInst == 0)
3090 return CR_INVALID_DEVINST;
3091
3092 if (ulFlags != 0)
3093 return CR_INVALID_FLAG;
3094
3095 if (hMachine != NULL)
3096 {
3097 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
3098 if (BindingHandle == NULL)
3099 return CR_FAILURE;
3100
3101 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
3102 if (StringTable == 0)
3103 return CR_FAILURE;
3104 }
3105 else
3106 {
3107 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
3108 return CR_FAILURE;
3109 }
3110
3111 lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
3112 if (lpDevInst == NULL)
3113 return CR_INVALID_DEVNODE;
3114
3116 {
3118 lpDevInst,
3119 pulDepth,
3120 ulFlags);
3121 }
3123 {
3125 }
3127
3128 return ret;
3129}
DWORD WINAPI PNP_GetDepth(handle_t hBinding, LPWSTR pszDeviceID, DWORD *pulDepth, DWORD ulFlags)
Definition: rpcserver.c:1718

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

3701{
3702 WCHAR szBufferW[MAX_DEVICE_ID_LEN];
3704
3705 TRACE("CM_Get_Device_ID_ExA(%lx %p %lu %lx %p)\n",
3706 dnDevInst, Buffer, BufferLen, ulFlags, hMachine);
3707
3708 if (Buffer == NULL)
3709 return CR_INVALID_POINTER;
3710
3711 ret = CM_Get_Device_ID_ExW(dnDevInst,
3712 szBufferW,
3714 ulFlags,
3715 hMachine);
3716 if (ret == CR_SUCCESS)
3717 {
3719 0,
3720 szBufferW,
3721 lstrlenW(szBufferW) + 1,
3722 Buffer,
3723 BufferLen,
3724 NULL,
3725 NULL) == 0)
3726 ret = CR_FAILURE;
3727 }
3728
3729 return ret;
3730}
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:3738
#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 3738 of file cfgmgr.c.

3744{
3745 HSTRING_TABLE StringTable = NULL;
3746
3747 TRACE("CM_Get_Device_ID_ExW(%lx %p %lu %lx %p)\n",
3748 dnDevInst, Buffer, BufferLen, ulFlags, hMachine);
3749
3750 if (dnDevInst == 0)
3751 return CR_INVALID_DEVINST;
3752
3753 if (Buffer == NULL)
3754 return CR_INVALID_POINTER;
3755
3756 if (ulFlags != 0)
3757 return CR_INVALID_FLAG;
3758
3759 if (hMachine != NULL)
3760 {
3761 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
3762 if (StringTable == NULL)
3763 return CR_FAILURE;
3764 }
3765 else
3766 {
3767 if (!PnpGetLocalHandles(NULL, &StringTable))
3768 return CR_FAILURE;
3769 }
3770
3771 if (!pSetupStringTableStringFromIdEx(StringTable,
3772 dnDevInst,
3773 Buffer,
3774 &BufferLen))
3775 return CR_FAILURE;
3776
3777 return CR_SUCCESS;
3778}
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 3824 of file cfgmgr.c.

3830{
3831 LPWSTR BufferW = NULL;
3832 LPWSTR pszFilterW = NULL;
3834
3835 TRACE("CM_Get_Device_ID_List_ExA(%p %p %lu %lx %p)\n",
3836 pszFilter, Buffer, BufferLen, ulFlags, hMachine);
3837
3838 BufferW = MyMalloc(BufferLen * sizeof(WCHAR));
3839 if (BufferW == NULL)
3840 return CR_OUT_OF_MEMORY;
3841
3842 if (pszFilter == NULL)
3843 {
3845 BufferW,
3846 BufferLen,
3847 ulFlags,
3848 hMachine);
3849 }
3850 else
3851 {
3852 if (pSetupCaptureAndConvertAnsiArg(pszFilter, &pszFilterW))
3853 {
3855 goto Done;
3856 }
3857
3858 ret = CM_Get_Device_ID_List_ExW(pszFilterW,
3859 BufferW,
3860 BufferLen,
3861 ulFlags,
3862 hMachine);
3863
3864 MyFree(pszFilterW);
3865 }
3866
3868 0,
3869 BufferW,
3870 BufferLen,
3871 Buffer,
3872 BufferLen,
3873 NULL,
3874 NULL) == 0)
3875 ret = CR_FAILURE;
3876
3877Done:
3878 MyFree(BufferW);
3879
3880 return ret;
3881}
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:3889

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

3895{
3897 CONFIGRET ret;
3898
3899 TRACE("CM_Get_Device_ID_List_ExW(%p %p %lu %lx %p)\n",
3900 pszFilter, Buffer, BufferLen, ulFlags, hMachine);
3901
3902 if (Buffer == NULL || BufferLen == 0)
3903 return CR_INVALID_POINTER;
3904
3905 if (ulFlags & ~CM_GETIDLIST_FILTER_BITS)
3906 return CR_INVALID_FLAG;
3907
3908 if (hMachine != NULL)
3909 {
3910 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
3911 if (BindingHandle == NULL)
3912 return CR_FAILURE;
3913 }
3914 else
3915 {
3917 return CR_FAILURE;
3918 }
3919
3920 *Buffer = 0;
3921
3923 {
3925 (LPWSTR)pszFilter,
3926 Buffer,
3927 &BufferLen,
3928 ulFlags);
3929 }
3931 {
3933 }
3935
3936 return ret;
3937}
DWORD WINAPI PNP_GetDeviceList(handle_t hBinding, LPWSTR pszFilter, LPWSTR Buffer, PNP_RPC_STRING_LEN *pulLength, DWORD ulFlags)
Definition: rpcserver.c:1272
#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 3979 of file cfgmgr.c.

3984{
3985 LPWSTR pszFilterW = NULL;
3987
3988 FIXME("CM_Get_Device_ID_List_Size_ExA(%p %s %lx %p)\n",
3989 pulLen, debugstr_a(pszFilter), ulFlags, hMachine);
3990
3991 if (pszFilter == NULL)
3992 {
3994 NULL,
3995 ulFlags,
3996 hMachine);
3997 }
3998 else
3999 {
4000 if (pSetupCaptureAndConvertAnsiArg(pszFilter, &pszFilterW))
4001 return CR_INVALID_DEVICE_ID;
4002
4004 pszFilterW,
4005 ulFlags,
4006 hMachine);
4007
4008 MyFree(pszFilterW);
4009 }
4010
4011 return ret;
4012}
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:4020

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

4025{
4027 CONFIGRET ret;
4028
4029 FIXME("CM_Get_Device_ID_List_Size_ExW(%p %s %lx %p)\n",
4030 pulLen, debugstr_w(pszFilter), ulFlags, hMachine);
4031
4032 if (pulLen == NULL)
4033 return CR_INVALID_POINTER;
4034
4035 if (ulFlags & ~CM_GETIDLIST_FILTER_BITS)
4036 return CR_INVALID_FLAG;
4037
4038 if (hMachine != NULL)
4039 {
4040 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
4041 if (BindingHandle == NULL)
4042 return CR_FAILURE;
4043 }
4044 else
4045 {
4047 return CR_FAILURE;
4048 }
4049
4050 *pulLen = 0;
4051
4053 {
4055 (LPWSTR)pszFilter,
4056 pulLen,
4057 ulFlags);
4058 }
4060 {
4062 }
4064
4065 return ret;
4066}
DWORD WINAPI PNP_GetDeviceListSize(handle_t hBinding, LPWSTR pszFilter, PNP_RPC_BUFFER_SIZE *pulLength, DWORD ulFlags)
Definition: rpcserver.c:1643

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

3949{
3950 TRACE("CM_Get_Device_ID_List_SizeA(%p %s %lx)\n",
3951 pulLen, debugstr_a(pszFilter), ulFlags);
3952
3953 return CM_Get_Device_ID_List_Size_ExA(pulLen, pszFilter, ulFlags, NULL);
3954}
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:3979

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

3966{
3967 TRACE("CM_Get_Device_ID_List_SizeW(%p %s %lx)\n",
3968 pulLen, debugstr_w(pszFilter), ulFlags);
3969
3970 return CM_Get_Device_ID_List_Size_ExW(pulLen, pszFilter, ulFlags, NULL);
3971}

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

3791{
3792 TRACE("CM_Get_Device_ID_ListA(%p %p %lu %lx)\n",
3793 pszFilter, Buffer, BufferLen, ulFlags);
3794
3795 return CM_Get_Device_ID_List_ExA(pszFilter, Buffer, BufferLen,
3796 ulFlags, NULL);
3797}
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:3824

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

3810{
3811 TRACE("CM_Get_Device_ID_ListW(%p %p %lu %lx)\n",
3812 pszFilter, Buffer, BufferLen, ulFlags);
3813
3814 return CM_Get_Device_ID_List_ExW(pszFilter, Buffer, BufferLen,
3815 ulFlags, NULL);
3816}

◆ CM_Get_Device_ID_Size()

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

Definition at line 4074 of file cfgmgr.c.

4078{
4079 TRACE("CM_Get_Device_ID_Size(%p %lx %lx)\n",
4080 pulLen, dnDevInst, ulFlags);
4081
4082 return CM_Get_Device_ID_Size_Ex(pulLen, dnDevInst, ulFlags, NULL);
4083}
CONFIGRET WINAPI CM_Get_Device_ID_Size_Ex(_Out_ PULONG pulLen, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:4091

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

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

4096{
4097 HSTRING_TABLE StringTable = NULL;
4098 LPWSTR DeviceId;
4099
4100 TRACE("CM_Get_Device_ID_Size_Ex(%p %lx %lx %p)\n",
4101 pulLen, dnDevInst, ulFlags, hMachine);
4102
4103 if (pulLen == NULL)
4104 return CR_INVALID_POINTER;
4105
4106 if (dnDevInst == 0)
4107 return CR_INVALID_DEVINST;
4108
4109 if (ulFlags != 0)
4110 return CR_INVALID_FLAG;
4111
4112 if (hMachine != NULL)
4113 {
4114 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
4115 if (StringTable == NULL)
4116 return CR_FAILURE;
4117 }
4118 else
4119 {
4120 if (!PnpGetLocalHandles(NULL, &StringTable))
4121 return CR_FAILURE;
4122 }
4123
4124 DeviceId = pSetupStringTableStringFromId(StringTable, dnDevInst);
4125 if (DeviceId == NULL)
4126 {
4127 *pulLen = 0;
4128 return CR_SUCCESS;
4129 }
4130
4131 *pulLen = lstrlenW(DeviceId);
4132
4133 return CR_SUCCESS;
4134}

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

3664{
3665 TRACE("CM_Get_Device_IDA(%lx %p %lu %lx)\n",
3666 dnDevInst, Buffer, BufferLen, ulFlags);
3667
3668 return CM_Get_Device_ID_ExA(dnDevInst, Buffer, BufferLen, ulFlags, NULL);
3669}
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:3695

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

3682{
3683 TRACE("CM_Get_Device_IDW(%lx %p %lu %lx)\n",
3684 dnDevInst, Buffer, BufferLen, ulFlags);
3685
3686 return CM_Get_Device_ID_ExW(dnDevInst, Buffer, BufferLen, ulFlags, NULL);
3687}

Referenced by CDeviceNode::SetupNode().

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

4193{
4194 FIXME("CM_Get_Device_Interface_Alias_ExA(%p %p %p %p %lx %p)\n",
4195 pszDeviceInterface, AliasInterfaceGuid,
4196 pszAliasDeviceInterface, pulLength, ulFlags, hMachine);
4197
4199}

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

4214{
4216 ULONG ulTransferLength;
4218
4219 TRACE("CM_Get_Device_Interface_Alias_ExW(%p %p %p %p %lx %p)\n",
4220 pszDeviceInterface, AliasInterfaceGuid,
4221 pszAliasDeviceInterface, pulLength, ulFlags, hMachine);
4222
4223 if (pszDeviceInterface == NULL ||
4224 AliasInterfaceGuid == NULL ||
4225 pszAliasDeviceInterface == NULL ||
4226 pulLength == NULL)
4227 return CR_INVALID_POINTER;
4228
4229 if (ulFlags != 0)
4230 return CR_INVALID_FLAG;
4231
4232 if (hMachine != NULL)
4233 {
4234 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
4235 if (BindingHandle == NULL)
4236 return CR_FAILURE;
4237 }
4238 else
4239 {
4241 return CR_FAILURE;
4242 }
4243
4244 ulTransferLength = *pulLength;
4245
4247 {
4249 (LPWSTR)pszDeviceInterface,
4250 AliasInterfaceGuid,
4251 pszAliasDeviceInterface,
4252 pulLength,
4253 &ulTransferLength,
4254 0);
4255 }
4257 {
4259 }
4261
4262 return ret;
4263}
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:2510

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

4148{
4149 TRACE("CM_Get_Device_Interface_AliasA(%p %p %p %p %lx)\n",
4150 pszDeviceInterface, AliasInterfaceGuid,
4151 pszAliasDeviceInterface, pulLength, ulFlags);
4152
4153 return CM_Get_Device_Interface_Alias_ExA(pszDeviceInterface,
4154 AliasInterfaceGuid, pszAliasDeviceInterface, pulLength,
4155 ulFlags, NULL);
4156}
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:4186

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

4170{
4171 TRACE("CM_Get_Device_Interface_AliasW(%p %p %p %p %lx)\n",
4172 pszDeviceInterface, AliasInterfaceGuid,
4173 pszAliasDeviceInterface, pulLength, ulFlags);
4174
4175 return CM_Get_Device_Interface_Alias_ExW(pszDeviceInterface,
4176 AliasInterfaceGuid, pszAliasDeviceInterface, pulLength,
4177 ulFlags, NULL);
4178}
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:4207

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

4320{
4321 DEVINSTID_W pDeviceIdW = NULL;
4322 PWCHAR BufferW = NULL;
4324
4325 TRACE("CM_Get_Device_Interface_List_ExA(%s %s %p %lu 0x%08lx %p)\n",
4327 Buffer, BufferLen, ulFlags, hMachine);
4328
4329 if (Buffer == NULL ||
4330 BufferLen == 0)
4331 return CR_INVALID_POINTER;
4332
4333 if (pDeviceID != NULL)
4334 {
4335 if (!pSetupCaptureAndConvertAnsiArg(pDeviceID, &pDeviceIdW))
4336 return CR_INVALID_DEVICE_ID;
4337 }
4338
4339 BufferW = MyMalloc(BufferLen * sizeof(WCHAR));
4340 if (BufferW == NULL)
4341 {
4343 goto Done;
4344 }
4345
4347 BufferW, BufferLen, ulFlags,
4348 hMachine);
4349 if (ret != CR_SUCCESS)
4350 goto Done;
4351
4353 0,
4354 BufferW,
4355 BufferLen,
4356 Buffer,
4357 BufferLen,
4358 NULL,
4359 NULL) == 0)
4360 ret = CR_FAILURE;
4361
4362Done:
4363 if (BufferW != NULL)
4364 MyFree(BufferW);
4365
4366 if (pDeviceIdW != NULL)
4367 MyFree(pDeviceIdW);
4368
4369 return ret;
4370}
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:4378
#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 4378 of file cfgmgr.c.

4385{
4389
4390 TRACE("CM_Get_Device_Interface_List_ExW(%s %s %p %lu 0x%08lx %p)\n",
4392 Buffer, BufferLen, ulFlags, hMachine);
4393
4394 if (Buffer == NULL ||
4395 BufferLen == 0)
4396 return CR_INVALID_POINTER;
4397
4398 if (ulFlags & ~CM_GET_DEVICE_INTERFACE_LIST_BITS)
4399 return CR_INVALID_FLAG;
4400
4401 if (hMachine != NULL)
4402 {
4403 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
4404 if (BindingHandle == NULL)
4405 return CR_FAILURE;
4406 }
4407 else
4408 {
4410 return CR_FAILURE;
4411 }
4412
4413 *Buffer = 0;
4414 BufferSize = BufferLen;
4415
4417 {
4420 pDeviceID,
4421 (LPBYTE)Buffer,
4422 &BufferSize,
4423 ulFlags);
4424 }
4426 {
4428 }
4430
4431 return ret;
4432}
DWORD WINAPI PNP_GetInterfaceDeviceList(handle_t hBinding, GUID *InterfaceGuid, LPWSTR pszDeviceID, BYTE *Buffer, PNP_RPC_BUFFER_SIZE *pulLength, DWORD ulFlags)
Definition: rpcserver.c:2527
#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 4478 of file cfgmgr.c.

4484{
4485 DEVINSTID_W pDeviceIdW = NULL;
4487
4488 TRACE("CM_Get_Device_Interface_List_Size_ExA(%p %p %s 0x%08lx %p)\n",
4489 pulLen, InterfaceClassGuid, debugstr_a(pDeviceID), ulFlags, hMachine);
4490
4491 if (pulLen == NULL)
4492 return CR_INVALID_POINTER;
4493
4494 if (pDeviceID != NULL)
4495 {
4496 if (!pSetupCaptureAndConvertAnsiArg(pDeviceID, &pDeviceIdW))
4497 return CR_INVALID_DEVICE_ID;
4498 }
4499
4500 *pulLen = 0;
4501
4503 pDeviceIdW, ulFlags, hMachine);
4504
4505 if (pDeviceIdW != NULL)
4506 MyFree(pDeviceIdW);
4507
4508 return ret;
4509}
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:4517

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

4523{
4526
4527 TRACE("CM_Get_Device_Interface_List_Size_ExW(%p %p %s 0x%08lx %p)\n",
4528 pulLen, InterfaceClassGuid, debugstr_w(pDeviceID), ulFlags, hMachine);
4529
4530 if (pulLen == NULL)
4531 return CR_INVALID_POINTER;
4532
4533 if (ulFlags & ~CM_GET_DEVICE_INTERFACE_LIST_BITS)
4534 return CR_INVALID_FLAG;
4535
4536 if (hMachine != NULL)
4537 {
4538 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
4539 if (BindingHandle == NULL)
4540 return CR_FAILURE;
4541 }
4542 else
4543 {
4545 return CR_FAILURE;
4546 }
4547
4548 *pulLen = 0;
4549
4551 {
4553 pulLen,
4555 pDeviceID,
4556 ulFlags);
4557 }
4559 {
4561 }
4563
4564 return ret;
4565}
DWORD WINAPI PNP_GetInterfaceDeviceListSize(handle_t hBinding, PNP_RPC_BUFFER_SIZE *pulLen, GUID *InterfaceGuid, LPWSTR pszDeviceID, DWORD ulFlags)
Definition: rpcserver.c:2575

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

4445{
4446 TRACE("CM_Get_Device_Interface_List_SizeA(%p %p %s 0x%08lx)\n",
4447 pulLen, InterfaceClassGuid, debugstr_a(pDeviceID), ulFlags);
4448
4450 pDeviceID, ulFlags, NULL);
4451}
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:4478

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

4464{
4465 TRACE("CM_Get_Device_Interface_List_SizeW(%p %p %s 0x%08lx)\n",
4466 pulLen, InterfaceClassGuid, debugstr_w(pDeviceID), ulFlags);
4467
4469 pDeviceID, ulFlags, NULL);
4470}

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

4277{
4278 TRACE("CM_Get_Device_Interface_ListA(%s %s %p %lu 0x%08lx)\n",
4280 Buffer, BufferLen, ulFlags);
4281
4283 Buffer, BufferLen, ulFlags, NULL);
4284}
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:4313

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

4298{
4299 TRACE("CM_Get_Device_Interface_ListW(%s %s %p %lu 0x%08lx)\n",
4301 Buffer, BufferLen, ulFlags);
4302
4304 Buffer, BufferLen, ulFlags, NULL);
4305}

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

3191{
3192 LPWSTR pszPropertyNameW = NULL;
3193 PVOID BufferW;
3194 ULONG ulLengthW;
3195 ULONG ulDataType = REG_NONE;
3196 CONFIGRET ret;
3197
3198 TRACE("CM_Get_DevNode_Custom_Property_ExA(%lx %s %p %p %p %lx %p)\n",
3199 dnDevInst, pszCustomPropertyName, pulRegDataType,
3200 Buffer, pulLength, ulFlags, hMachine);
3201
3202 if (!pulLength)
3203 return CR_INVALID_POINTER;
3204
3205 ulLengthW = *pulLength * sizeof(WCHAR);
3206 BufferW = HeapAlloc(GetProcessHeap(), 0, ulLengthW);
3207 if (!BufferW)
3208 return CR_OUT_OF_MEMORY;
3209
3210 pszPropertyNameW = pSetupMultiByteToUnicode(pszCustomPropertyName,
3211 CP_ACP);
3212 if (pszPropertyNameW == NULL)
3213 {
3214 HeapFree(GetProcessHeap(), 0, BufferW);
3215 return CR_OUT_OF_MEMORY;
3216 }
3217
3219 pszPropertyNameW,
3220 &ulDataType,
3221 BufferW,
3222 &ulLengthW,
3223 ulFlags,
3224 hMachine);
3225 if (ret == CR_SUCCESS)
3226 {
3227 if (ulDataType == REG_SZ ||
3228 ulDataType == REG_EXPAND_SZ ||
3229 ulDataType == REG_MULTI_SZ)
3230 {
3231 /* Do W->A conversion */
3232 *pulLength = WideCharToMultiByte(CP_ACP,
3233 0,
3234 BufferW,
3235 lstrlenW(BufferW) + 1,
3236 Buffer,
3237 *pulLength,
3238 NULL,
3239 NULL);
3240 if (*pulLength == 0)
3241 ret = CR_FAILURE;
3242 }
3243 else
3244 {
3245 /* Directly copy the value */
3246 if (ulLengthW <= *pulLength)
3247 memcpy(Buffer, BufferW, ulLengthW);
3248 else
3249 {
3250 *pulLength = ulLengthW;
3252 }
3253 }
3254 }
3255
3256 if (pulRegDataType)
3257 *pulRegDataType = ulDataType;
3258
3259 HeapFree(GetProcessHeap(), 0, BufferW);
3260 MyFree(pszPropertyNameW);
3261
3262 return ret;
3263}
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)
Definition: cfgmgr.c:3271
LPWSTR WINAPI pSetupMultiByteToUnicode(LPCSTR lpMultiByteStr, UINT uCodePage)
Definition: misc.c:281
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define REG_NONE
Definition: nt_native.h:1492
#define REG_EXPAND_SZ
Definition: nt_native.h:1494

Referenced by CM_Get_DevNode_Custom_PropertyA().

◆ CM_Get_DevNode_Custom_Property_ExW()

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 
)

Definition at line 3271 of file cfgmgr.c.

3279{
3281 HSTRING_TABLE StringTable = NULL;
3282 LPWSTR lpDevInst;
3283 ULONG ulDataType = REG_NONE;
3284 ULONG ulTransferLength;
3286
3287 TRACE("CM_Get_DevNode_Custom_Property_ExW(%lx %s %p %p %p %lx %p)\n",
3288 dnDevInst, debugstr_w(pszCustomPropertyName), pulRegDataType,
3289 Buffer, pulLength, ulFlags, hMachine);
3290
3291 if (dnDevInst == 0)
3292 return CR_INVALID_DEVNODE;
3293
3294 if (pszCustomPropertyName == NULL ||
3295 pulLength == NULL ||
3296 *pulLength == 0)
3297 return CR_INVALID_POINTER;
3298
3299 if (ulFlags & ~CM_CUSTOMDEVPROP_BITS)
3300 return CR_INVALID_FLAG;
3301
3302 if (hMachine != NULL)
3303 {
3304 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
3305 if (BindingHandle == NULL)
3306 return CR_FAILURE;
3307
3308 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
3309 if (StringTable == 0)
3310 return CR_FAILURE;
3311 }
3312 else
3313 {
3314 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
3315 return CR_FAILURE;
3316 }
3317
3318 lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
3319 if (lpDevInst == NULL)
3320 return CR_INVALID_DEVNODE;
3321
3322 ulTransferLength = *pulLength;
3323
3324