ReactOS 0.4.16-dev-306-g647d351
cfgmgr.c File Reference
#include "setupapi_private.h"
#include <dbt.h>
#include <pnp_c.h>
#include <winsvc.h>
#include <pseh/pseh2.h>
#include "rpc_private.h"
Include dependency graph for cfgmgr.c:

Go to the source code of this file.

Classes

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

Macros

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

Typedefs

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

Functions

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

Variables

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

Macro Definition Documentation

◆ CONFLICT_MAGIC

#define CONFLICT_MAGIC   0x11225588

Definition at line 117 of file cfgmgr.c.

◆ LOG_CONF_MAGIC

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

Definition at line 71 of file cfgmgr.c.

◆ NOTIFY_MAGIC

#define NOTIFY_MAGIC   0x44556677

Definition at line 91 of file cfgmgr.c.

◆ RANGE_LIST_MAGIC

#define RANGE_LIST_MAGIC   0x33445566

Definition at line 109 of file cfgmgr.c.

◆ RES_DES_MAGIC

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

Definition at line 83 of file cfgmgr.c.

Typedef Documentation

◆ CONFLICT_DATA

◆ INTERNAL_RANGE

◆ INTERNAL_RANGE_LIST

◆ LOG_CONF_INFO

◆ MACHINE_INFO

◆ NOTIFY_DATA

◆ PCONFLICT_DATA

◆ PINTERNAL_RANGE

◆ PINTERNAL_RANGE_LIST

◆ PLOG_CONF_INFO

◆ PMACHINE_INFO

◆ PNOTIFY_DATA

◆ PRES_DES_INFO

◆ RES_DES_INFO

Function Documentation

◆ CM_Add_Empty_Log_Conf()

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

Definition at line 900 of file cfgmgr.c.

905{
906 TRACE("CM_Add_Empty_Log_Conf(%p %p %lu %lx)\n",
907 plcLogConf, dnDevInst, Priority, ulFlags);
908
909 return CM_Add_Empty_Log_Conf_Ex(plcLogConf, dnDevInst, Priority,
910 ulFlags, NULL);
911}
CONFIGRET WINAPI CM_Add_Empty_Log_Conf_Ex(_Out_ PLOG_CONF plcLogConf, _In_ DEVINST dnDevInst, _In_ PRIORITY Priority, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:919
#define NULL
Definition: types.h:112
#define TRACE(s)
Definition: solgame.cpp:4
_In_ WDFINTERRUPT _In_ WDF_INTERRUPT_POLICY _In_ WDF_INTERRUPT_PRIORITY Priority
Definition: wdfinterrupt.h:655

◆ CM_Add_Empty_Log_Conf_Ex()

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

Definition at line 919 of file cfgmgr.c.

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

Referenced by CM_Add_Empty_Log_Conf().

◆ CM_Add_ID_ExA()

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

Definition at line 1045 of file cfgmgr.c.

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

Referenced by CM_Add_IDA().

◆ CM_Add_ID_ExW()

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

Definition at line 1073 of file cfgmgr.c.

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

Referenced by CM_Add_ID_ExA(), and CM_Add_IDW().

◆ CM_Add_IDA()

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

Definition at line 1011 of file cfgmgr.c.

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

◆ CM_Add_IDW()

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

Definition at line 1028 of file cfgmgr.c.

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

◆ CM_Add_Range()

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

Definition at line 1141 of file cfgmgr.c.

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

◆ CM_Add_Res_Des()

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

Definition at line 1204 of file cfgmgr.c.

1211{
1212 TRACE("CM_Add_Res_Des(%p %p %lu %p %lu %lx)\n",
1213 prdResDes, lcLogConf, ResourceID, ResourceData, ResourceLen, ulFlags);
1214
1215 return CM_Add_Res_Des_Ex(prdResDes, lcLogConf, ResourceID, ResourceData,
1216 ResourceLen, ulFlags, NULL);
1217}
CONFIGRET WINAPI CM_Add_Res_Des_Ex(_Out_opt_ PRES_DES prdResDes, _In_ LOG_CONF lcLogConf, _In_ RESOURCEID ResourceID, _In_reads_bytes_(ResourceLen) PCVOID ResourceData, _In_ ULONG ResourceLen, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:1225

◆ CM_Add_Res_Des_Ex()

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

Definition at line 1225 of file cfgmgr.c.

1233{
1234 FIXME("CM_Add_Res_Des_Ex(%p %p %lu %p %lu %lx %p)\n",
1235 prdResDes, lcLogConf, ResourceID,
1236 ResourceData, ResourceLen, ulFlags, hMachine);
1237
1239}
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898

Referenced by CM_Add_Res_Des().

◆ CM_Connect_MachineA()

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

Definition at line 1247 of file cfgmgr.c.

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

◆ CM_Connect_MachineW()

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

Definition at line 1276 of file cfgmgr.c.

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

Referenced by CM_Connect_MachineA(), SetupDiBuildClassInfoListExW(), and SetupDiCreateDeviceInfoListExW().

◆ CM_Create_DevNode_ExA()

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

Definition at line 1383 of file cfgmgr.c.

1389{
1390 DEVINSTID_W pDeviceIDW;
1391 CONFIGRET ret;
1392
1393 TRACE("CM_Create_DevNode_ExA(%p %s %p %lx %p)\n",
1394 pdnDevInst, debugstr_a(pDeviceID), dnParent, ulFlags, hMachine);
1395
1396 if (pSetupCaptureAndConvertAnsiArg(pDeviceID, &pDeviceIDW))
1397 return CR_INVALID_DATA;
1398
1399 ret = CM_Create_DevNode_ExW(pdnDevInst, pDeviceIDW, dnParent, ulFlags,
1400 hMachine);
1401
1402 MyFree(pDeviceIDW);
1403
1404 return ret;
1405}
_Null_terminated_ WCHAR * DEVINSTID_W
Definition: cfgmgr32.h:80
CONFIGRET WINAPI CM_Create_DevNode_ExW(_Out_ PDEVINST pdnDevInst, _In_ DEVINSTID_W pDeviceID, _In_ DEVINST dnParent, _In_ ULONG ulFlags, _In_opt_ HANDLE hMachine)
Definition: cfgmgr.c:1413

Referenced by CM_Create_DevNodeA().

◆ CM_Create_DevNode_ExW()

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

Definition at line 1413 of file cfgmgr.c.

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

Referenced by CM_Create_DevNode_ExA(), and CM_Create_DevNodeW().

◆ CM_Create_DevNodeA()

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

Definition at line 1345 of file cfgmgr.c.

1350{
1351 TRACE("CM_Create_DevNodeA(%p %s %p %lx)\n",
1352 pdnDevInst, debugstr_a(pDeviceID), dnParent, ulFlags);
1353
1354 return CM_Create_DevNode_ExA(pdnDevInst, pDeviceID, dnParent,
1355 ulFlags, NULL);
1356}
CONFIGRET WINAPI CM_Create_DevNode_ExA(_Out_ PDEVINST pdnDevInst, _In_ DEVINSTID_A pDeviceID, _In_ DEVINST dnParent, _In_ ULONG ulFlags, _In_opt_ HANDLE hMachine)
Definition: cfgmgr.c:1383

◆ CM_Create_DevNodeW()

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

Definition at line 1364 of file cfgmgr.c.

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

◆ CM_Create_Range_List()

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

Definition at line 1498 of file cfgmgr.c.

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

◆ CM_Delete_Class_Key()

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

Definition at line 1542 of file cfgmgr.c.

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

◆ CM_Delete_Class_Key_Ex()

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

Definition at line 1558 of file cfgmgr.c.

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

Referenced by CM_Delete_Class_Key().

◆ CM_Delete_DevNode_Key()

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

Definition at line 1612 of file cfgmgr.c.

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

◆ CM_Delete_DevNode_Key_Ex()

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

Definition at line 1630 of file cfgmgr.c.

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

Referenced by CM_Delete_DevNode_Key().

◆ CM_Delete_Range()

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

Definition at line 1749 of file cfgmgr.c.

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

◆ CM_Detect_Resource_Conflict()

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

Definition at line 1767 of file cfgmgr.c.

1774{
1775 TRACE("CM_Detect_Resource_Conflict(%p %lu %p %lu %p 0x%lx)\n",
1776 dnDevInst, ResourceID, ResourceData, ResourceLen,
1777 pbConflictDetected, ulFlags);
1778
1779 return CM_Detect_Resource_Conflict_Ex(dnDevInst,
1780 ResourceID,
1781 ResourceData,
1782 ResourceLen,
1783 pbConflictDetected,
1784 ulFlags,
1785 NULL);
1786}
CONFIGRET WINAPI CM_Detect_Resource_Conflict_Ex(_In_ DEVINST dnDevInst, _In_ RESOURCEID ResourceID, _In_reads_bytes_(ResourceLen) PCVOID ResourceData, _In_ ULONG ResourceLen, _Out_ PBOOL pbConflictDetected, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:1794

◆ CM_Detect_Resource_Conflict_Ex()

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

Definition at line 1794 of file cfgmgr.c.

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

Referenced by CM_Detect_Resource_Conflict().

◆ CM_Disable_DevNode()

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

Definition at line 1816 of file cfgmgr.c.

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

◆ CM_Disable_DevNode_Ex()

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

Definition at line 1832 of file cfgmgr.c.

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

Referenced by CM_Disable_DevNode(), and StopDevice().

◆ CM_Disconnect_Machine()

CONFIGRET WINAPI CM_Disconnect_Machine ( _In_opt_ HMACHINE  hMachine)

Definition at line 1898 of file cfgmgr.c.

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

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

◆ CM_Dup_Range_List()

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

Definition at line 1929 of file cfgmgr.c.

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

◆ CM_Enable_DevNode()

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

Definition at line 2002 of file cfgmgr.c.

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

◆ CM_Enable_DevNode_Ex()

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

Definition at line 2018 of file cfgmgr.c.

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

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

◆ CM_Enumerate_Classes()

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

Definition at line 2083 of file cfgmgr.c.

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

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

◆ CM_Enumerate_Classes_Ex()

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

Definition at line 2100 of file cfgmgr.c.

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

Referenced by CM_Enumerate_Classes(), and SetupDiBuildClassInfoListExW().

◆ CM_Enumerate_Enumerators_ExA()

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

Definition at line 2205 of file cfgmgr.c.

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

Referenced by CM_Enumerate_EnumeratorsA().

◆ CM_Enumerate_Enumerators_ExW()

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

Definition at line 2256 of file cfgmgr.c.

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

Referenced by CM_Enumerate_Enumerators_ExA(), and CM_Enumerate_EnumeratorsW().

◆ CM_Enumerate_EnumeratorsA()

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

Definition at line 2167 of file cfgmgr.c.

2172{
2173 TRACE("CM_Enumerate_EnumeratorsA(%lu %p %p %lx)\n",
2174 ulEnumIndex, Buffer, pulLength, ulFlags);
2175
2176 return CM_Enumerate_Enumerators_ExA(ulEnumIndex, Buffer, pulLength,
2177 ulFlags, NULL);
2178}
CONFIGRET WINAPI CM_Enumerate_Enumerators_ExA(_In_ ULONG ulEnumIndex, _Out_writes_(*pulLength) PCHAR Buffer, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2205

◆ CM_Enumerate_EnumeratorsW()

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

Definition at line 2186 of file cfgmgr.c.

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

◆ CM_Find_Range()

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

Definition at line 2314 of file cfgmgr.c.

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

◆ CM_First_Range()

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

Definition at line 2335 of file cfgmgr.c.

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

◆ CM_Free_Log_Conf()

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

Definition at line 2393 of file cfgmgr.c.

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

◆ CM_Free_Log_Conf_Ex()

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

Definition at line 2409 of file cfgmgr.c.

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

Referenced by CM_Free_Log_Conf().

◆ CM_Free_Log_Conf_Handle()

CONFIGRET WINAPI CM_Free_Log_Conf_Handle ( _In_ LOG_CONF  lcLogConf)

Definition at line 2476 of file cfgmgr.c.

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

◆ CM_Free_Range_List()

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

Definition at line 2498 of file cfgmgr.c.

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

◆ CM_Free_Res_Des()

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

Definition at line 2546 of file cfgmgr.c.

2550{
2551 TRACE("CM_Free_Res_Des(%p %p %lx)\n",
2552 prdResDes, rdResDes, ulFlags);
2553
2554 return CM_Free_Res_Des_Ex(prdResDes, rdResDes, ulFlags, NULL);
2555}
CONFIGRET WINAPI CM_Free_Res_Des_Ex(_Out_ PRES_DES prdResDes, _In_ RES_DES rdResDes, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2563

◆ CM_Free_Res_Des_Ex()

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

Definition at line 2563 of file cfgmgr.c.

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

Referenced by CM_Free_Res_Des().

◆ CM_Free_Res_Des_Handle()

CONFIGRET WINAPI CM_Free_Res_Des_Handle ( _In_ RES_DES  rdResDes)

Definition at line 2581 of file cfgmgr.c.

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

◆ CM_Free_Resource_Conflict_Handle()

CONFIGRET WINAPI CM_Free_Resource_Conflict_Handle ( _In_ CONFLICT_LIST  clConflictList)

Definition at line 2603 of file cfgmgr.c.

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

◆ CM_Get_Child()

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

Definition at line 2629 of file cfgmgr.c.

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

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

◆ CM_Get_Child_Ex()

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

Definition at line 2646 of file cfgmgr.c.

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

Referenced by CM_Get_Child().

◆ CM_Get_Class_Key_Name_ExA()

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

Definition at line 2766 of file cfgmgr.c.

2772{
2773 WCHAR szBuffer[MAX_GUID_STRING_LEN];
2775 ULONG ulLength;
2776 ULONG ulOrigLength;
2777
2778 TRACE("CM_Get_Class_Key_Name_ExA(%p %p %p %lx %p)\n",
2779 ClassGuid, pszKeyName, pulLength, ulFlags, hMachine);
2780
2781 if (ClassGuid == NULL || pszKeyName == NULL || pulLength == NULL)
2782 return CR_INVALID_POINTER;
2783
2784 ulOrigLength = *pulLength;
2785 *pulLength = 0;
2786
2787 ulLength = MAX_GUID_STRING_LEN;
2788 ret = CM_Get_Class_Key_Name_ExW(ClassGuid, szBuffer, &ulLength,
2789 ulFlags, hMachine);
2790 if (ret == CR_SUCCESS)
2791 {
2793 0,
2794 szBuffer,
2795 ulLength,
2796 pszKeyName,
2797 ulOrigLength,
2798 NULL,
2799 NULL) == 0)
2800 ret = CR_FAILURE;
2801 else
2802 *pulLength = lstrlenA(pszKeyName) + 1;
2803 }
2804
2805 return CR_SUCCESS;
2806}
CONFIGRET WINAPI CM_Get_Class_Key_Name_ExW(_In_ LPGUID ClassGuid, _Out_writes_opt_(*pulLength) LPWSTR pszKeyName, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2814

Referenced by CM_Get_Class_Key_NameA().

◆ CM_Get_Class_Key_Name_ExW()

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

Definition at line 2814 of file cfgmgr.c.

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

Referenced by CM_Get_Class_Key_Name_ExA(), and CM_Get_Class_Key_NameW().

◆ CM_Get_Class_Key_NameA()

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

Definition at line 2728 of file cfgmgr.c.

2733{
2734 TRACE("CM_Get_Class_Key_NameA(%p %p %p %lx)\n",
2735 ClassGuid, pszKeyName, pulLength, ulFlags);
2736
2737 return CM_Get_Class_Key_Name_ExA(ClassGuid, pszKeyName, pulLength,
2738 ulFlags, NULL);
2739}
CONFIGRET WINAPI CM_Get_Class_Key_Name_ExA(_In_ LPGUID ClassGuid, _Out_writes_opt_(*pulLength) LPSTR pszKeyName, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2766

◆ CM_Get_Class_Key_NameW()

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

Definition at line 2747 of file cfgmgr.c.

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

◆ CM_Get_Class_Name_ExA()

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

Definition at line 2888 of file cfgmgr.c.

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

Referenced by CM_Get_Class_NameA().

◆ CM_Get_Class_Name_ExW()

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

Definition at line 2936 of file cfgmgr.c.

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

Referenced by CM_Get_Class_Name_ExA(), and CM_Get_Class_NameW().

◆ CM_Get_Class_NameA()

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

Definition at line 2850 of file cfgmgr.c.

2855{
2856 TRACE("CM_Get_Class_NameA(%p %p %p %lx)\n",
2857 ClassGuid, Buffer, pulLength, ulFlags);
2858
2859 return CM_Get_Class_Name_ExA(ClassGuid, Buffer, pulLength, ulFlags,
2860 NULL);
2861}
CONFIGRET WINAPI CM_Get_Class_Name_ExA(_In_ LPGUID ClassGuid, _Out_writes_opt_(*pulLength) PCHAR Buffer, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2888

◆ CM_Get_Class_NameW()

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

Definition at line 2869 of file cfgmgr.c.

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

◆ CM_Get_Class_Registry_PropertyA()

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

Definition at line 2996 of file cfgmgr.c.

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

◆ CM_Get_Class_Registry_PropertyW()

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

Definition at line 3075 of file cfgmgr.c.

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

Referenced by CM_Get_Class_Registry_PropertyA().

◆ CM_Get_Depth()

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

Definition at line 3154 of file cfgmgr.c.

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

◆ CM_Get_Depth_Ex()

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

Definition at line 3171 of file cfgmgr.c.

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

Referenced by CM_Get_Depth().

◆ CM_Get_Device_ID_ExA()

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

Definition at line 3793 of file cfgmgr.c.

3799{
3800 WCHAR szBufferW[MAX_DEVICE_ID_LEN];
3802
3803 TRACE("CM_Get_Device_ID_ExA(%lx %p %lu %lx %p)\n",
3804 dnDevInst, Buffer, BufferLen, ulFlags, hMachine);
3805
3806 if (Buffer == NULL)
3807 return CR_INVALID_POINTER;
3808
3809 ret = CM_Get_Device_ID_ExW(dnDevInst,
3810 szBufferW,
3812 ulFlags,
3813 hMachine);
3814 if (ret == CR_SUCCESS)
3815 {
3817 0,
3818 szBufferW,
3819 lstrlenW(szBufferW) + 1,
3820 Buffer,
3821 BufferLen,
3822 NULL,
3823 NULL) == 0)
3824 ret = CR_FAILURE;
3825 }
3826
3827 return ret;
3828}
CONFIGRET WINAPI CM_Get_Device_ID_ExW(_In_ DEVINST dnDevInst, _Out_writes_(BufferLen) PWCHAR Buffer, _In_ ULONG BufferLen, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:3836
#define lstrlenW
Definition: compat.h:750

Referenced by CM_Get_Device_IDA().

◆ CM_Get_Device_ID_ExW()

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

Definition at line 3836 of file cfgmgr.c.

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

Referenced by CM_Get_Device_ID_ExA(), and CM_Get_Device_IDW().

◆ CM_Get_Device_ID_List_ExA()

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

Definition at line 3922 of file cfgmgr.c.

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

Referenced by CM_Get_Device_ID_ListA().

◆ CM_Get_Device_ID_List_ExW()

CONFIGRET WINAPI CM_Get_Device_ID_List_ExW ( _In_ PCWSTR  pszFilter,
_Out_writes_(BufferLen) PWCHAR  Buffer,
_In_ ULONG  BufferLen,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 3987 of file cfgmgr.c.

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

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

◆ CM_Get_Device_ID_List_Size_ExA()

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

Definition at line 4077 of file cfgmgr.c.

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

Referenced by CM_Get_Device_ID_List_SizeA().

◆ CM_Get_Device_ID_List_Size_ExW()

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

Definition at line 4118 of file cfgmgr.c.

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

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

◆ CM_Get_Device_ID_List_SizeA()

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

Definition at line 4043 of file cfgmgr.c.

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

◆ CM_Get_Device_ID_List_SizeW()

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

Definition at line 4060 of file cfgmgr.c.

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

◆ CM_Get_Device_ID_ListA()

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

Definition at line 3884 of file cfgmgr.c.

3889{
3890 TRACE("CM_Get_Device_ID_ListA(%p %p %lu %lx)\n",
3891 pszFilter, Buffer, BufferLen, ulFlags);
3892
3893 return CM_Get_Device_ID_List_ExA(pszFilter, Buffer, BufferLen,
3894 ulFlags, NULL);
3895}
CONFIGRET WINAPI CM_Get_Device_ID_List_ExA(_In_ PCSTR pszFilter, _Out_writes_(BufferLen) PCHAR Buffer, _In_ ULONG BufferLen, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:3922

◆ CM_Get_Device_ID_ListW()

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

Definition at line 3903 of file cfgmgr.c.

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

◆ CM_Get_Device_ID_Size()

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

Definition at line 4172 of file cfgmgr.c.

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

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

◆ CM_Get_Device_ID_Size_Ex()

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

Definition at line 4189 of file cfgmgr.c.

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

Referenced by CM_Get_Device_ID_Size().

◆ CM_Get_Device_IDA()

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

Definition at line 3757 of file cfgmgr.c.

3762{
3763 TRACE("CM_Get_Device_IDA(%lx %p %lu %lx)\n",
3764 dnDevInst, Buffer, BufferLen, ulFlags);
3765
3766 return CM_Get_Device_ID_ExA(dnDevInst, Buffer, BufferLen, ulFlags, NULL);
3767}
CONFIGRET WINAPI CM_Get_Device_ID_ExA(_In_ DEVINST dnDevInst, _Out_writes_(BufferLen) PCHAR Buffer, _In_ ULONG BufferLen, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:3793

Referenced by test_devnode().

◆ CM_Get_Device_IDW()

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

Definition at line 3775 of file cfgmgr.c.

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

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

◆ CM_Get_Device_Interface_Alias_ExA()

CONFIGRET WINAPI CM_Get_Device_Interface_Alias_ExA ( _In_ LPCSTR  pszDeviceInterface,
_In_ LPGUID  AliasInterfaceGuid,
_Out_writes_ *pulLength LPSTR  pszAliasDeviceInterface,
_Inout_ PULONG  pulLength,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 4284 of file cfgmgr.c.

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

Referenced by CM_Get_Device_Interface_AliasA().

◆ CM_Get_Device_Interface_Alias_ExW()

CONFIGRET WINAPI CM_Get_Device_Interface_Alias_ExW ( _In_ LPCWSTR  pszDeviceInterface,
_In_ LPGUID  AliasInterfaceGuid,
_Out_writes_ *pulLength LPWSTR  pszAliasDeviceInterface,
_Inout_ PULONG  pulLength,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 4305 of file cfgmgr.c.

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

Referenced by CM_Get_Device_Interface_AliasW().

◆ CM_Get_Device_Interface_AliasA()

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

Definition at line 4240 of file cfgmgr.c.

4246{
4247 TRACE("CM_Get_Device_Interface_AliasA(%p %p %p %p %lx)\n",
4248 pszDeviceInterface, AliasInterfaceGuid,
4249 pszAliasDeviceInterface, pulLength, ulFlags);
4250
4251 return CM_Get_Device_Interface_Alias_ExA(pszDeviceInterface,
4252 AliasInterfaceGuid, pszAliasDeviceInterface, pulLength,
4253 ulFlags, NULL);
4254}
CONFIGRET WINAPI CM_Get_Device_Interface_Alias_ExA(_In_ LPCSTR pszDeviceInterface, _In_ LPGUID AliasInterfaceGuid, _Out_writes_(*pulLength) LPSTR pszAliasDeviceInterface, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:4284

◆ CM_Get_Device_Interface_AliasW()

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

Definition at line 4262 of file cfgmgr.c.

4268{
4269 TRACE("CM_Get_Device_Interface_AliasW(%p %p %p %p %lx)\n",
4270 pszDeviceInterface, AliasInterfaceGuid,
4271 pszAliasDeviceInterface, pulLength, ulFlags);
4272
4273 return CM_Get_Device_Interface_Alias_ExW(pszDeviceInterface,
4274 AliasInterfaceGuid, pszAliasDeviceInterface, pulLength,
4275 ulFlags, NULL);
4276}
CONFIGRET WINAPI CM_Get_Device_Interface_Alias_ExW(_In_ LPCWSTR pszDeviceInterface, _In_ LPGUID AliasInterfaceGuid, _Out_writes_(*pulLength) LPWSTR pszAliasDeviceInterface, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:4305

◆ CM_Get_Device_Interface_List_ExA()

CONFIGRET WINAPI CM_Get_Device_Interface_List_ExA ( _In_ LPGUID  InterfaceClassGuid,
_In_opt_ DEVINSTID_A  pDeviceID,
_Out_writes_(BufferLen) PCHAR  Buffer,
_In_ ULONG  BufferLen,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 4411 of file cfgmgr.c.

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

Referenced by CM_Get_Device_Interface_ListA().

◆ CM_Get_Device_Interface_List_ExW()

CONFIGRET WINAPI CM_Get_Device_Interface_List_ExW ( _In_ LPGUID  InterfaceClassGuid,
_In_opt_ DEVINSTID_W  pDeviceID,
_Out_writes_(BufferLen) PWCHAR  Buffer,
_In_ ULONG  BufferLen,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 4476 of file cfgmgr.c.

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

Referenced by CM_Get_Device_Interface_List_ExA(), and CM_Get_Device_Interface_ListW().

◆ CM_Get_Device_Interface_List_Size_ExA()

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

Definition at line 4576 of file cfgmgr.c.

4582{
4583 DEVINSTID_W pDeviceIdW = NULL;
4585
4586 TRACE("CM_Get_Device_Interface_List_Size_ExA(%p %p %s 0x%08lx %p)\n",
4587 pulLen, InterfaceClassGuid, debugstr_a(pDeviceID), ulFlags, hMachine);
4588
4589 if (pulLen == NULL)
4590 return CR_INVALID_POINTER;
4591
4592 if (pDeviceID != NULL)
4593 {
4594 if (!pSetupCaptureAndConvertAnsiArg(pDeviceID, &pDeviceIdW))
4595 return CR_INVALID_DEVICE_ID;
4596 }
4597
4598 *pulLen = 0;
4599
4601 pDeviceIdW, ulFlags, hMachine);
4602
4603 if (pDeviceIdW != NULL)
4604 MyFree(pDeviceIdW);
4605
4606 return ret;
4607}
CONFIGRET WINAPI CM_Get_Device_Interface_List_Size_ExW(_Out_ PULONG pulLen, _In_ LPGUID InterfaceClassGuid, _In_opt_ DEVINSTID_W pDeviceID, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:4615

Referenced by CM_Get_Device_Interface_List_SizeA().

◆ CM_Get_Device_Interface_List_Size_ExW()

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

Definition at line 4615 of file cfgmgr.c.

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

Referenced by CM_Get_Device_Interface_List_Size_ExA(), and CM_Get_Device_Interface_List_SizeW().

◆ CM_Get_Device_Interface_List_SizeA()

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

Definition at line 4538 of file cfgmgr.c.

4543{
4544 TRACE("CM_Get_Device_Interface_List_SizeA(%p %p %s 0x%08lx)\n",
4545 pulLen, InterfaceClassGuid, debugstr_a(pDeviceID), ulFlags);
4546
4548 pDeviceID, ulFlags, NULL);
4549}
CONFIGRET WINAPI CM_Get_Device_Interface_List_Size_ExA(_Out_ PULONG pulLen, _In_ LPGUID InterfaceClassGuid, _In_opt_ DEVINSTID_A pDeviceID, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:4576

◆ CM_Get_Device_Interface_List_SizeW()

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

Definition at line 4557 of file cfgmgr.c.

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

◆ CM_Get_Device_Interface_ListA()

CONFIGRET WINAPI CM_Get_Device_Interface_ListA ( _In_ LPGUID  InterfaceClassGuid,
_In_opt_ DEVINSTID_A  pDeviceID,
_Out_writes_(BufferLen) PCHAR  Buffer,
_In_ ULONG  BufferLen,
_In_ ULONG  ulFlags 
)

Definition at line 4369 of file cfgmgr.c.

4375{
4376 TRACE("CM_Get_Device_Interface_ListA(%s %s %p %lu 0x%08lx)\n",
4378 Buffer, BufferLen, ulFlags);
4379
4381 Buffer, BufferLen, ulFlags, NULL);
4382}
CONFIGRET WINAPI CM_Get_Device_Interface_List_ExA(_In_ LPGUID InterfaceClassGuid, _In_opt_ DEVINSTID_A pDeviceID, _Out_writes_(BufferLen) PCHAR Buffer, _In_ ULONG BufferLen, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:4411

◆ CM_Get_Device_Interface_ListW()

CONFIGRET WINAPI CM_Get_Device_Interface_ListW ( _In_ LPGUID  InterfaceClassGuid,
_In_opt_ DEVINSTID_W  pDeviceID,
_Out_writes_(BufferLen) PWCHAR  Buffer,
_In_ ULONG  BufferLen,
_In_ ULONG  ulFlags 
)

Definition at line 4390 of file cfgmgr.c.

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

◆ CM_Get_DevNode_Custom_Property_ExA()

CONFIGRET WINAPI CM_Get_DevNode_Custom_Property_ExA ( _In_ DEVINST  dnDevInst,
_In_ PCSTR  pszCustomPropertyName,
_Out_opt_ PULONG  pulRegDataType,
_Out_writes_bytes_opt_ *pulLength PVOID  Buffer,
_Inout_ PULONG  pulLength,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 3282 of file cfgmgr.c.

3290{
3291 LPWSTR pszPropertyNameW;
3292 PVOID BufferW;
3293 ULONG ulLengthW;
3294 ULONG ulDataType = REG_NONE;
3295 CONFIGRET ret;
3296
3297 TRACE("CM_Get_DevNode_Custom_Property_ExA(%lx %s %p %p %p %lx %p)\n",
3298 dnDevInst, pszCustomPropertyName, pulRegDataType,
3299 Buffer, pulLength, ulFlags, hMachine);
3300
3301 if (!pulLength)
3302 return CR_INVALID_POINTER;
3303
3304 ulLengthW = *pulLength * sizeof(WCHAR);
3305 BufferW = HeapAlloc(GetProcessHeap(), 0, ulLengthW);
3306 if (!BufferW)
3307 return CR_OUT_OF_MEMORY;
3308
3309 pszPropertyNameW = pSetupMultiByteToUnicode(pszCustomPropertyName,
3310 CP_ACP);
3311 if (pszPropertyNameW == NULL)
3312 {
3313 HeapFree(GetProcessHeap(), 0, BufferW);
3314 return CR_OUT_OF_MEMORY;
3315 }
3316
3318 pszPropertyNameW,
3319 &ulDataType,
3320 BufferW,
3321 &ulLengthW,
3322 ulFlags,
3323 hMachine);
3324 if (ret == CR_SUCCESS)
3325 {
3326 if (ulDataType == REG_SZ ||
3327 ulDataType == REG_EXPAND_SZ ||
3328 ulDataType == REG_MULTI_SZ)
3329 {
3330 /* Do W->A conversion */
3331 *pulLength = WideCharToMultiByte(CP_ACP,
3332 0,
3333 BufferW,
3334 lstrlenW(BufferW) + 1,
3335 Buffer,
3336 *pulLength,
3337 NULL,
3338 NULL);
3339 if (*pulLength == 0)
3340 ret = CR_FAILURE;
3341 }
3342 else
3343 {
3344 /* Directly copy the value */
3345 if (ulLengthW <= *pulLength)
3346 memcpy(Buffer, BufferW, ulLengthW);
3347 else
3348 {
3349 *pulLength = ulLengthW;
3351 }
3352 }
3353 }
3354
3355 if (pulRegDataType)
3356 *pulRegDataType = ulDataType;
3357
3358 HeapFree(GetProcessHeap(), 0, BufferW);
3359 MyFree(pszPropertyNameW);
3360
3361 return ret;
3362}
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:3370
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 3370 of file cfgmgr.c.

3378{
3380 HSTRING_TABLE StringTable = NULL;
3381 LPWSTR lpDevInst;
3382 ULONG ulDataType = REG_NONE;
3383 ULONG ulTransferLength;
3385
3386 TRACE("CM_Get_DevNode_Custom_Property_ExW(%lx %s %p %p %p %lx %p)\n",
3387 dnDevInst, debugstr_w(pszCustomPropertyName), pulRegDataType,
3388 Buffer, pulLength, ulFlags, hMachine);
3389
3390 if (dnDevInst == 0)
3391 return CR_INVALID_DEVNODE;
3392
3393 if (pszCustomPropertyName == NULL ||
3394 pulLength == NULL ||
3395 *pulLength == 0)
3396 return CR_INVALID_POINTER;
3397
3398 if (ulFlags & ~CM_CUSTOMDEVPROP_BITS)
3399 return CR_INVALID_FLAG;
3400
3401 if (hMachine != NULL)
3402 {
3403 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
3404 if (BindingHandle == NULL)
3405 return CR_FAILURE;
3406
3407 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
3408 if (StringTable == 0)
3409 return CR_FAILURE;
3410 }
3411 else
3412 {
3413 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
3414 return CR_FAILURE;
3415 }
3416
3417 lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
3418 if (lpDevInst == NULL)
3419 return CR_INVALID_DEVNODE;
3420
3421 ulTransferLength = *pulLength;
3422
3424 {
3426 lpDevInst,
3427 (LPWSTR)pszCustomPropertyName,
3428 &ulDataType,
3429 Buffer,
3430 &ulTransferLength,
3431 pulLength,
3432 ulFlags);
3433 }
3435 {
3437 }
3439
3440 if (ret == CR_SUCCESS)
3441 {
3442 if (pulRegDataType != NULL)
3443 *pulRegDataType = ulDataType;
3444 }
3445
3446 return ret;
3447}
DWORD WINAPI PNP_GetCustomDevProp(handle_t hBinding, LPWSTR pDeviceID, LPWSTR CustomPropName, DWORD *pulRegDataType, BYTE *Buffer, PNP_RPC_STRING_LEN *pulTransferLen, PNP_RPC_STRING_LEN *pulLength, DWORD ulFlags)
Definition: rpcserver.c:4827
#define CM_CUSTOMDEVPROP_BITS
Definition: cfgmgr32.h:836

Referenced by CM_Get_DevNode_Custom_Property_ExA(), and CM_Get_DevNode_Custom_PropertyW().

◆ CM_Get_DevNode_Custom_PropertyA()

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 
)

Definition at line 3236 of file cfgmgr.c.

3243{
3244 TRACE("CM_Get_DevNode_Custom_PropertyA(%lx %s %p %p %p %lx)\n",
3245 dnDevInst, pszCustomPropertyName, pulRegDataType,
3246 Buffer, pulLength, ulFlags);
3247
3248 return CM_Get_DevNode_Custom_Property_ExA(dnDevInst, pszCustomPropertyName,
3249 pulRegDataType, Buffer,
3250 pulLength, ulFlags, NULL);
3251}
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: cfgmgr.c:3282

◆ CM_Get_DevNode_Custom_PropertyW()

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 
)

Definition at line 3259 of file cfgmgr.c.

3266{
3267 TRACE("CM_Get_DevNode_Custom_PropertyW(%lx %s %p %p %p %lx)\n",
3268 dnDevInst, debugstr_w(pszCustomPropertyName), pulRegDataType,
3269 Buffer, pulLength, ulFlags);
3270
3271 return CM_Get_DevNode_Custom_Property_ExW(dnDevInst, pszCustomPropertyName,
3272 pulRegDataType, Buffer,
3273 pulLength, ulFlags, NULL);
3274}

◆ CM_Get_DevNode_Registry_Property_ExA()

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 
)

Definition at line 3499 of file cfgmgr.c.

3507{
3508 PVOID BufferW;
3509 ULONG LengthW;
3510 ULONG ulDataType = REG_NONE;
3511 CONFIGRET ret;
3512
3513 TRACE("CM_Get_DevNode_Registry_Property_ExA(%lx %lu %p %p %p %lx %p)\n",
3514 dnDevInst, ulProperty, pulRegDataType, Buffer, pulLength,
3515 ulFlags, hMachine);
3516
3517 if (!pulLength)
3518 return CR_INVALID_POINTER;
3519
3520 LengthW = *pulLength * sizeof(WCHAR);
3521 BufferW = HeapAlloc(GetProcessHeap(), 0, LengthW);
3522 if (!BufferW)
3523 return CR_OUT_OF_MEMORY;
3524
3526 ulProperty,
3527 &ulDataType,
3528 BufferW,
3529 &LengthW,
3530 ulFlags,
3531 hMachine);
3532
3533 if (ret == CR_SUCCESS)
3534 {
3535 if (ulDataType == REG_SZ ||
3536 ulDataType == REG_EXPAND_SZ ||
3537 ulDataType == REG_MULTI_SZ)
3538 {
3539 /* Do W->A conversion */
3540 *pulLength = WideCharToMultiByte(CP_ACP,
3541 0,
3542 BufferW,
3543 lstrlenW(BufferW) + 1,
3544 Buffer,
3545 *pulLength,
3546 NULL,
3547 NULL);
3548 if (*pulLength == 0)
3549 ret = CR_FAILURE;
3550 }
3551 else
3552 {
3553 /* Directly copy the value */
3554 if (LengthW <= *pulLength)
3555 memcpy(Buffer, BufferW, LengthW);
3556 else
3557 {
3558 *pulLength = LengthW;
3560 }
3561 }
3562 }
3563
3564 if (pulRegDataType)
3565 *pulRegDataType = ulDataType;
3566
3567 HeapFree(GetProcessHeap(), 0, BufferW);
3568
3569 return ret;
3570}
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)
Definition: cfgmgr.c:3578

Referenced by CM_Get_DevNode_Registry_PropertyA().

◆ CM_Get_DevNode_Registry_Property_ExW()

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 
)

Definition at line 3578 of file cfgmgr.c.

3586{
3588 HSTRING_TABLE StringTable = NULL;
3590 LPWSTR lpDevInst;
3591 ULONG ulDataType = REG_NONE;
3592 ULONG ulTransferLength = 0;
3593
3594 TRACE("CM_Get_DevNode_Registry_Property_ExW(%lx %lu %p %p %p %lx %p)\n",
3595 dnDevInst, ulProperty, pulRegDataType, Buffer, pulLength,
3596 ulFlags, hMachine);
3597
3598 if (dnDevInst == 0)
3599 return CR_INVALID_DEVNODE;
3600
3601 if (ulProperty < CM_DRP_MIN || ulProperty > CM_DRP_MAX)
3602 return CR_INVALID_PROPERTY;
3603
3604 /* pulRegDataType is optional */
3605
3606 /* Buffer is optional */
3607
3608 if (pulLength == NULL)
3609 return CR_INVALID_POINTER;
3610
3611 if (*pulLength == 0)
3612 return CR_INVALID_POINTER;
3613
3614 if (ulFlags != 0)
3615 return CR_INVALID_FLAG;
3616
3617 if (hMachine != NULL)
3618 {
3619 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
3620 if (BindingHandle == NULL)
3621 return CR_FAILURE;
3622
3623 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
3624 if (StringTable == 0)
3625 return CR_FAILURE;
3626 }
3627 else
3628 {
3629 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
3630 return CR_FAILURE;
3631 }
3632
3633 lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
3634 if (lpDevInst == NULL)
3635 return CR_INVALID_DEVNODE;
3636
3637 ulTransferLength = *pulLength;
3638
3640 {
3642 lpDevInst,
3643 ulProperty,
3644 &ulDataType,
3645 Buffer,
3646 &ulTransferLength,
3647 pulLength,
3648 ulFlags);
3649 }
3651 {
3653 }
3655
3656 if (ret == CR_SUCCESS)
3657 {
3658 if (pulRegDataType != NULL)
3659 *pulRegDataType = ulDataType;
3660 }
3661
3662 return ret;
3663}
DWORD WINAPI PNP_GetDeviceRegProp(handle_t hBinding, LPWSTR pDeviceID, DWORD ulProperty, DWORD *pulRegDataType, BYTE *Buffer, PNP_PROP_SIZE *pulTransferLen, PNP_PROP_SIZE *pulLength, DWORD ulFlags)
Definition: rpcserver.c:1838
#define CM_DRP_MAX
Definition: cfgmgr32.h:732

Referenced by CM_Get_DevNode_Registry_Property_ExA(), CM_Get_DevNode_Registry_PropertyW(), DisplayDevNodeEnumerator(), SETUP_CreateDevicesList(), and SetupDiGetDeviceRegistryPropertyW().

◆ CM_Get_DevNode_Registry_PropertyA()

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 
)

Definition at line 3455 of file cfgmgr.c.

3462{
3463 TRACE("CM_Get_DevNode_Registry_PropertyA(%lx %lu %p %p %p %lx)\n",
3464 dnDevInst, ulProperty, pulRegDataType, Buffer, pulLength, ulFlags);
3465
3466 return CM_Get_DevNode_Registry_Property_ExA(dnDevInst, ulProperty,
3467 pulRegDataType, Buffer,
3468 pulLength, ulFlags, NULL);
3469}
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)
Definition: cfgmgr.c:3499

◆ CM_Get_DevNode_Registry_PropertyW()

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 
)

Definition at line 3477 of file cfgmgr.c.

3484{
3485 TRACE("CM_Get_DevNode_Registry_PropertyW(%lx %lu %p %p %p %lx)\n",
3486 dnDevInst, ulProperty, pulRegDataType, Buffer, pulLength, ulFlags);
3487
3488 return CM_Get_DevNode_Registry_Property_ExW(dnDevInst, ulProperty,
3489 pulRegDataType, Buffer,
3490 pulLength, ulFlags, NULL);
3491}

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

◆ CM_Get_DevNode_Status()

CONFIGRET WINAPI CM_Get_DevNode_Status ( _Out_ PULONG  pulStatus,
_Out_ PULONG  pulProblemNumber,
_In_ DEVINST  dnDevInst,
_In_ ULONG  ulFlags 
)

Definition at line 3671 of file cfgmgr.c.

3676{
3677 TRACE("CM_Get_DevNode_Status(%p %p %lx %lx)\n",
3678 pulStatus, pulProblemNumber, dnDevInst, ulFlags);
3679
3680 return CM_Get_DevNode_Status_Ex(pulStatus, pulProblemNumber, dnDevInst,
3681 ulFlags, NULL);
3682}
CONFIGRET WINAPI CM_Get_DevNode_Status_Ex(_Out_ PULONG pulStatus, _Out_ PULONG pulProblemNumber, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:3690

Referenced by EnumHotpluggedDevices(), and StorageCoInstaller().

◆ CM_Get_DevNode_Status_Ex()

CONFIGRET WINAPI CM_Get_DevNode_Status_Ex ( _Out_ PULONG  pulStatus,
_Out_ PULONG  pulProblemNumber,
_In_ DEVINST  dnDevInst,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 3690 of file cfgmgr.c.

3696{
3698 HSTRING_TABLE StringTable = NULL;
3699 LPWSTR lpDevInst;
3700 CONFIGRET ret;
3701
3702 TRACE("CM_Get_DevNode_Status_Ex(%p %p %lx %lx %p)\n",
3703 pulStatus, pulProblemNumber, dnDevInst, ulFlags, hMachine);
3704
3705 if (pulStatus == NULL || pulProblemNumber == NULL)
3706 return CR_INVALID_POINTER;
3707
3708 if (dnDevInst == 0)
3709 return CR_INVALID_DEVINST;
3710
3711 if (ulFlags != 0)
3712 return CR_INVALID_FLAG;
3713
3714 if (hMachine != NULL)
3715 {
3716 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
3717 if (BindingHandle == NULL)
3718 return CR_FAILURE;
3719
3720 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
3721 if (StringTable == 0)
3722 return CR_FAILURE;
3723 }
3724 else
3725 {
3726 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
3727 return CR_FAILURE;
3728 }
3729
3730 lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
3731 if (lpDevInst == NULL)
3732 return CR_INVALID_DEVNODE;
3733
3735 {
3737 lpDevInst,
3738 pulStatus,
3739 pulProblemNumber,
3740 ulFlags);
3741 }
3743 {
3745 }
3747
3748 return ret;
3749}
DWORD WINAPI PNP_GetDeviceStatus(handle_t hBinding, LPWSTR pDeviceID, DWORD *pulStatus, DWORD *pulProblem, DWORD ulFlags)
Definition: rpcserver.c:3414

Referenced by CDeviceNode::CanDisable(), CanDisableDevice(), CDeviceNode::CanUninstall(), CM_Get_DevNode_Status(), DisplayDevNodeFlags(), GetDeviceStatusString(), CDeviceNode::HasProblem(), InitProbeListPage(), IsDeviceHidden(), IsDeviceStarted(), CDeviceNode::IsDisabled(), IsDriverInstalled(), CDeviceNode::IsHidden(), CDeviceNode::IsInstalled(), CDeviceNode::IsStarted(), ShowDeviceProblemWizard(), UpdateDevInfo(), and UpdateDriverDlg().

◆ CM_Get_First_Log_Conf()

CONFIGRET WINAPI CM_Get_First_Log_Conf ( _Out_opt_ PLOG_CONF  plcLogConf,
_In_ DEVINST  dnDevInst,
_In_ ULONG  ulFlags 
)

Definition at line 4671 of file cfgmgr.c.

4675{
4676 TRACE("CM_Get_First_Log_Conf(%p %lx %lx)\n",
4677 plcLogConf, dnDevInst, ulFlags);
4678
4679 return CM_Get_First_Log_Conf_Ex(plcLogConf, dnDevInst, ulFlags, NULL);
4680}
CONFIGRET WINAPI CM_Get_First_Log_Conf_Ex(_Out_opt_ PLOG_CONF plcLogConf, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:4688

◆ CM_Get_First_Log_Conf_Ex()

CONFIGRET WINAPI CM_Get_First_Log_Conf_Ex ( _Out_opt_ PLOG_CONF  plcLogConf,
_In_ DEVINST  dnDevInst,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 4688 of file cfgmgr.c.

4693{
4695 HSTRING_TABLE StringTable = NULL;
4696 LPWSTR lpDevInst = NULL;
4698 ULONG ulTag;
4699 PLOG_CONF_INFO pLogConfInfo;
4700
4701 FIXME("CM_Get_First_Log_Conf_Ex(%p %lx %lx %p)\n",
4702 plcLogConf, dnDevInst, ulFlags, hMachine);
4703
4704 if (dnDevInst == 0)
4705 return CR_INVALID_DEVINST;
4706
4707 if (ulFlags & ~LOG_CONF_BITS)
4708 return CR_INVALID_FLAG;
4709
4710 if (plcLogConf)
4711 *plcLogConf = 0;
4712
4713 if (hMachine != NULL)
4714 {
4715 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
4716 if (BindingHandle == NULL)
4717 return CR_FAILURE;
4718
4719 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
4720 if (StringTable == 0)
4721 return CR_FAILURE;
4722 }
4723 else
4724 {
4725 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
4726 return CR_FAILURE;
4727 }
4728
4729 lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
4730 if (lpDevInst == NULL)
4731 return CR_INVALID_DEVNODE;
4732
4734 {
4736 lpDevInst,
4737 ulFlags,
4738 &ulTag,
4739 ulFlags);
4740 }
4742 {
4744 }
4746
4747 if (ret != CR_SUCCESS)
4748 return ret;
4749
4750 if (plcLogConf)
4751 {
4752 pLogConfInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(LOG_CONF_INFO));
4753 if (pLogConfInfo == NULL)
4754 return CR_OUT_OF_MEMORY;
4755
4756 pLogConfInfo->ulMagic = LOG_CONF_MAGIC;
4757 pLogConfInfo->dnDevInst = dnDevInst;
4758 pLogConfInfo->ulType = ulFlags;
4759 pLogConfInfo->ulTag = ulTag;
4760
4761 *plcLogConf = (LOG_CONF)pLogConfInfo;
4762 }
4763
4764 return CR_SUCCESS;
4765}
DWORD WINAPI PNP_GetFirstLogConf(handle_t hBinding, LPWSTR pDeviceID, DWORD ulLogConfType, DWORD *pulLogConfTag, DWORD ulFlags)
Definition: rpcserver.c:4194
_In_ ULONG _In_ ULONG ulTag
Definition: winddi.h:3942

Referenced by CM_Get_First_Log_Conf().

◆ CM_Get_Global_State()

CONFIGRET WINAPI CM_Get_Global_State ( _Out_ PULONG  pulState,
_In_ ULONG  ulFlags 
)

Definition at line 4773 of file cfgmgr.c.

4776{
4777 TRACE("CM_Get_Global_State(%p %lx)\n",
4778 pulState, ulFlags);
4779
4780 return CM_Get_Global_State_Ex(pulState, ulFlags, NULL);
4781}
CONFIGRET WINAPI CM_Get_Global_State_Ex(_Out_ PULONG pulState, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:4789

◆ CM_Get_Global_State_Ex()

CONFIGRET WINAPI CM_Get_Global_State_Ex ( _Out_ PULONG  pulState,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 4789 of file cfgmgr.c.

4793{
4795 CONFIGRET ret;
4796
4797 TRACE("CM_Get_Global_State_Ex(%p %lx %p)\n",
4798 pulState, ulFlags, hMachine);
4799
4800 if (pulState == NULL)
4801 return CR_INVALID_POINTER;
4802
4803 if (ulFlags != 0)
4804 return CR_INVALID_FLAG;
4805
4806 if (hMachine != NULL)
4807 {
4808 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
4809 if (BindingHandle == NULL)
4810 return CR_FAILURE;
4811 }
4812 else
4813 {
4815 return CR_FAILURE;
4816 }
4817
4819 {
4820 ret = PNP_GetGlobalState(BindingHandle, pulState, ulFlags);
4821 }
4823 {
4825 }
4827
4828 return ret;
4829}
DWORD WINAPI PNP_GetGlobalState(handle_t hBinding, DWORD *pulState, DWORD ulFlags)
Definition: rpcserver.c:675

Referenced by CM_Get_Global_State().

◆ CM_Get_Hardware_Profile_Info_ExA()

CONFIGRET WINAPI CM_Get_Hardware_Profile_Info_ExA ( _In_ ULONG  ulIndex,
_Out_ PHWPROFILEINFO_A  pHWProfileInfo,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 4998 of file cfgmgr.c.

5003{
5004 HWPROFILEINFO_W LocalProfileInfo;
5005 CONFIGRET ret;
5006
5007 TRACE("CM_Get_Hardware_Profile_Info_ExA(%lu %p %lx %p)\n",
5008 ulIndex, pHWProfileInfo, ulFlags, hMachine);
5009
5010 if (pHWProfileInfo == NULL)
5011 return CR_INVALID_POINTER;
5012
5013 ret = CM_Get_Hardware_Profile_Info_ExW(ulIndex, &LocalProfileInfo,
5014 ulFlags, hMachine);
5015 if (ret == CR_SUCCESS)
5016 {
5017 pHWProfileInfo->HWPI_ulHWProfile = LocalProfileInfo.HWPI_ulHWProfile;
5018 pHWProfileInfo->HWPI_dwFlags = LocalProfileInfo.HWPI_dwFlags;
5019
5021 0,
5022 LocalProfileInfo.HWPI_szFriendlyName,
5023 lstrlenW(LocalProfileInfo.HWPI_szFriendlyName) + 1,
5024 pHWProfileInfo->HWPI_szFriendlyName,
5026 NULL,
5027 NULL) == 0)
5028 ret = CR_FAILURE;
5029 }
5030
5031 return ret;
5032}
#define MAX_PROFILE_LEN
Definition: cfgmgr32.h:54
CONFIGRET WINAPI CM_Get_Hardware_Profile_Info_ExW(_In_ ULONG ulIndex, _Out_ PHWPROFILEINFO_W pHWProfileInfo, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:5040
ULONG HWPI_ulHWProfile
Definition: cfgmgr32.h:560
DWORD HWPI_dwFlags
Definition: cfgmgr32.h:562
WCHAR HWPI_szFriendlyName[MAX_PROFILE_LEN]
Definition: cfgmgr32.h:561

Referenced by CM_Get_Hardware_Profile_InfoA().

◆ CM_Get_Hardware_Profile_Info_ExW()

CONFIGRET WINAPI CM_Get_Hardware_Profile_Info_ExW ( _In_ ULONG  ulIndex,
_Out_ PHWPROFILEINFO_W  pHWProfileInfo,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 5040 of file cfgmgr.c.

5045{
5047 CONFIGRET ret;
5048
5049 TRACE("CM_Get_Hardware_Profile_Info_ExW(%lu %p %lx %p)\n",
5050 ulIndex, pHWProfileInfo, ulFlags, hMachine);
5051
5052 if (pHWProfileInfo == NULL)
5053 return CR_INVALID_POINTER;
5054
5055 if (ulFlags != 0)
5056 return CR_INVALID_FLAG;
5057
5058 if (hMachine != NULL)
5059 {
5060 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
5061 if (BindingHandle == NULL)
5062 return CR_FAILURE;
5063 }
5064 else
5065 {
5067 return CR_FAILURE;
5068 }
5069
5071 {
5072 ret = PNP_GetHwProfInfo(BindingHandle, ulIndex, pHWProfileInfo,
5073 sizeof(HWPROFILEINFO_W), 0);
5074 }
5076 {
5078 }
5080
5081 return ret;
5082}
DWORD WINAPI PNP_GetHwProfInfo(handle_t hBinding, DWORD ulIndex, HWPROFILEINFO *pHWProfileInfo, DWORD ulProfileInfoSize, DWORD ulFlags)
Definition: rpcserver.c:4029

Referenced by CM_Get_Hardware_Profile_Info_ExA(), and CM_Get_Hardware_Profile_InfoW().

◆ CM_Get_Hardware_Profile_InfoA()

CONFIGRET WINAPI CM_Get_Hardware_Profile_InfoA ( _In_ ULONG  ulIndex,
_Out_ PHWPROFILEINFO_A  pHWProfileInfo,
_In_ ULONG  ulFlags 
)

Definition at line 4962 of file cfgmgr.c.

4966{
4967 TRACE("CM_Get_Hardware_Profile_InfoA(%lu %p %lx)\n",
4968 ulIndex, pHWProfileInfo, ulFlags);
4969
4970 return CM_Get_Hardware_Profile_Info_ExA(ulIndex, pHWProfileInfo,
4971 ulFlags, NULL);
4972}
CONFIGRET WINAPI CM_Get_Hardware_Profile_Info_ExA(_In_ ULONG ulIndex, _Out_ PHWPROFILEINFO_A pHWProfileInfo, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:4998

◆ CM_Get_Hardware_Profile_InfoW()

CONFIGRET WINAPI CM_Get_Hardware_Profile_InfoW ( _In_ ULONG  ulIndex,
_Out_ PHWPROFILEINFO_W  pHWProfileInfo,
_In_ ULONG  ulFlags 
)

Definition at line 4980 of file cfgmgr.c.

4984{
4985 TRACE("CM_Get_Hardware_Profile_InfoW(%lu %p %lx)\n",
4986 ulIndex, pHWProfileInfo, ulFlags);
4987
4988 return CM_Get_Hardware_Profile_Info_ExW(ulIndex, pHWProfileInfo,
4989 ulFlags, NULL);
4990}

◆ CM_Get_HW_Prof_Flags_ExA()

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 
)

Definition at line 4875 of file cfgmgr.c.

4881{
4882 DEVINSTID_W pszDevIdW = NULL;
4884
4885 TRACE("CM_Get_HW_Prof_Flags_ExA(%s %lu %p %lx %p)\n",
4886 debugstr_a(szDevInstName), ulHardwareProfile, pulValue, ulFlags, hMachine);
4887
4888 if (szDevInstName != NULL)
4889 {
4890 if (pSetupCaptureAndConvertAnsiArg(szDevInstName, &pszDevIdW))
4891 return CR_INVALID_DEVICE_ID;
4892 }
4893
4894 ret = CM_Get_HW_Prof_Flags_ExW(pszDevIdW, ulHardwareProfile,
4895 pulValue, ulFlags, hMachine);
4896
4897 if (pszDevIdW != NULL)
4898 MyFree(pszDevIdW);
4899
4900 return ret;
4901}
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)
Definition: cfgmgr.c:4909

Referenced by CM_Get_HW_Prof_FlagsA().

◆ CM_Get_HW_Prof_Flags_ExW()

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 
)

Definition at line 4909 of file cfgmgr.c.

4915{
4917 CONFIGRET ret;
4918
4919 FIXME("CM_Get_HW_Prof_Flags_ExW(%s %lu %p %lx %p)\n",
4920 debugstr_w(szDevInstName), ulHardwareProfile, pulValue, ulFlags, hMachine);
4921
4922 if ((szDevInstName == NULL) || (pulValue == NULL))
4923 return CR_INVALID_POINTER;
4924
4925 if (ulFlags != 0)
4926 return CR_INVALID_FLAG;
4927
4928 /* FIXME: Check whether szDevInstName is valid */
4929
4930 if (hMachine != NULL)
4931 {
4932 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
4933 if (BindingHandle == NULL)
4934 return CR_FAILURE;
4935 }
4936 else
4937 {
4939 return CR_FAILURE;
4940 }
4941
4943 {
4944 ret = PNP_HwProfFlags(BindingHandle, PNP_GET_HWPROFFLAGS, szDevInstName,
4945 ulHardwareProfile, pulValue, NULL, NULL, 0, 0);
4946 }
4948 {
4950 }
4952
4953 return ret;
4954}
DWORD WINAPI PNP_HwProfFlags(handle_t hBinding, DWORD ulAction, LPWSTR pDeviceID, DWORD ulConfig, DWORD *pulValue, PPNP_VETO_TYPE pVetoType, LPWSTR pszVetoName, DWORD ulNameLength, DWORD ulFlags)
Definition: rpcserver.c:3945

Referenced by CM_Get_HW_Prof_Flags_ExA(), and CM_Get_HW_Prof_FlagsW().

◆ CM_Get_HW_Prof_FlagsA()

CONFIGRET WINAPI CM_Get_HW_Prof_FlagsA ( _In_ DEVINSTID_A  szDevInstName,
_In_ ULONG  ulHardwareProfile,
_Out_ PULONG  pulValue,
_In_ ULONG  ulFlags 
)

Definition at line 4837 of file cfgmgr.c.

4842{
4843 TRACE("CM_Get_HW_Prof_FlagsA(%s %lu %p %lx)\n",
4844 debugstr_a(szDevInstName), ulHardwareProfile, pulValue, ulFlags);
4845
4846 return CM_Get_HW_Prof_Flags_ExA(szDevInstName, ulHardwareProfile,
4847 pulValue, ulFlags, NULL);
4848}
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)
Definition: cfgmgr.c:4875

◆ CM_Get_HW_Prof_FlagsW()

CONFIGRET WINAPI CM_Get_HW_Prof_FlagsW ( _In_ DEVINSTID_W  szDevInstName,
_In_ ULONG  ulHardwareProfile,
_Out_ PULONG  pulValue,
_In_ ULONG  ulFlags 
)

Definition at line 4856 of file cfgmgr.c.

4861{
4862 TRACE("CM_Get_HW_Prof_FlagsW(%s %lu %p %lx)\n",
4863 debugstr_w(szDevInstName), ulHardwareProfile, pulValue, ulFlags);
4864
4865 return CM_Get_HW_Prof_Flags_ExW(szDevInstName, ulHardwareProfile,
4866 pulValue, ulFlags, NULL);
4867}

◆ CM_Get_Log_Conf_Priority()

CONFIGRET WINAPI CM_Get_Log_Conf_Priority ( _In_ LOG_CONF  lcLogConf,
_Out_ PPRIORITY  pPriority,
_In_ ULONG  ulFlags 
)

Definition at line 5090 of file cfgmgr.c.

5094{
5095 TRACE("CM_Get_Log_Conf_Priority(%p %p %lx)\n",
5096 lcLogConf, pPriority, ulFlags);
5097
5098 return CM_Get_Log_Conf_Priority_Ex(lcLogConf, pPriority, ulFlags, NULL);
5099}
CONFIGRET WINAPI CM_Get_Log_Conf_Priority_Ex(_In_ LOG_CONF lcLogConf, _Out_ PPRIORITY pPriority, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:5107

◆ CM_Get_Log_Conf_Priority_Ex()

CONFIGRET WINAPI CM_Get_Log_Conf_Priority_Ex ( _In_ LOG_CONF  lcLogConf,
_Out_ PPRIORITY  pPriority,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 5107 of file cfgmgr.c.

5112{
5114 HSTRING_TABLE StringTable = NULL;
5115 PLOG_CONF_INFO pLogConfInfo;
5116 LPWSTR lpDevInst;
5117 CONFIGRET ret;
5118
5119 FIXME("CM_Get_Log_Conf_Priority_Ex(%p %p %lx %p)\n",
5120 lcLogConf, pPriority, ulFlags, hMachine);
5121
5122 pLogConfInfo = (PLOG_CONF_INFO)lcLogConf;
5123 if (!IsValidLogConf(pLogConfInfo))
5124 return CR_INVALID_LOG_CONF;
5125
5126 if (pPriority == NULL)
5127 return CR_INVALID_POINTER;
5128
5129 if (ulFlags != 0)
5130 return CR_INVALID_FLAG;
5131
5132 if (hMachine != NULL)
5133 {
5134 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
5135 if (BindingHandle == NULL)
5136 return CR_FAILURE;
5137
5138 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
5139 if (StringTable == 0)
5140 return CR_FAILURE;
5141 }
5142 else
5143 {
5144 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
5145 return CR_FAILURE;
5146 }
5147
5148 lpDevInst = pSetupStringTableStringFromId(StringTable, pLogConfInfo->dnDevInst);
5149 if (lpDevInst == NULL)
5150 return CR_INVALID_DEVNODE;
5151
5153 {
5155 lpDevInst,
5156 pLogConfInfo->ulType,
5157 pLogConfInfo->ulTag,
5158 pPriority,
5159 0);
5160 }
5162 {
5164 }
5166
5167 return ret;
5168}
DWORD WINAPI PNP_GetLogConfPriority(handle_t hBinding, LPWSTR pDeviceID, DWORD ulType, DWORD ulTag, DWORD *pPriority, DWORD ulFlags)
Definition: rpcserver.c:4410

Referenced by CM_Get_Log_Conf_Priority().

◆ CM_Get_Next_Log_Conf()

CONFIGRET WINAPI CM_Get_Next_Log_Conf ( _Out_opt_ PLOG_CONF  plcLogConf,
_In_ LOG_CONF  lcLogConf,
_In_ ULONG  ulFlags 
)

Definition at line 5176 of file cfgmgr.c.

5180{
5181 TRACE("CM_Get_Next_Log_Conf(%p %p %lx)\n",
5182 plcLogConf, lcLogConf, ulFlags);
5183
5184 return CM_Get_Next_Log_Conf_Ex(plcLogConf, lcLogConf, ulFlags, NULL);
5185}
CONFIGRET WINAPI CM_Get_Next_Log_Conf_Ex(_Out_opt_ PLOG_CONF plcLogConf, _In_ LOG_CONF lcLogConf, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:5193

◆ CM_Get_Next_Log_Conf_Ex()

CONFIGRET WINAPI CM_Get_Next_Log_Conf_Ex ( _Out_opt_ PLOG_CONF  plcLogConf,
_In_ LOG_CONF  lcLogConf,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 5193 of file cfgmgr.c.

5198{
5200 HSTRING_TABLE StringTable = NULL;
5201 PLOG_CONF_INFO pLogConfInfo;
5202 PLOG_CONF_INFO pNewLogConfInfo;
5203 ULONG ulNewTag;
5204 LPWSTR lpDevInst;
5205 CONFIGRET ret;
5206
5207 FIXME("CM_Get_Next_Log_Conf_Ex(%p %p %lx %p)\n",
5208 plcLogConf, lcLogConf, ulFlags, hMachine);
5209
5210 if (plcLogConf)
5211 *plcLogConf = 0;
5212
5213 pLogConfInfo = (PLOG_CONF_INFO)lcLogConf;
5214 if (!IsValidLogConf(pLogConfInfo))
5215 return CR_INVALID_LOG_CONF;
5216
5217 if (ulFlags != 0)
5218 return CR_INVALID_FLAG;
5219
5220 if (hMachine != NULL)
5221 {
5222 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
5223 if (BindingHandle == NULL)
5224 return CR_FAILURE;
5225
5226 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
5227 if (StringTable == 0)
5228 return CR_FAILURE;
5229 }
5230 else
5231 {
5232 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
5233 return CR_FAILURE;
5234 }
5235
5236 lpDevInst = pSetupStringTableStringFromId(StringTable, pLogConfInfo->dnDevInst);
5237 if (lpDevInst == NULL)
5238 return CR_INVALID_DEVNODE;
5239
5241 {
5243 lpDevInst,
5244 pLogConfInfo->ulType,
5245 pLogConfInfo->ulTag,
5246 &ulNewTag,
5247 0);
5248 }
5250 {
5252 }
5254
5255 if (ret != CR_SUCCESS)
5256 return ret;
5257
5258 if (plcLogConf)
5259 {
5260 pNewLogConfInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(LOG_CONF_INFO));
5261 if (pNewLogConfInfo == NULL)
5262 return CR_OUT_OF_MEMORY;
5263
5264 pNewLogConfInfo->ulMagic = LOG_CONF_MAGIC;
5265 pNewLogConfInfo->dnDevInst = pLogConfInfo->dnDevInst;
5266 pNewLogConfInfo->ulType = pLogConfInfo->ulType;
5267 pNewLogConfInfo->ulTag = ulNewTag;
5268
5269 *plcLogConf = (LOG_CONF)pNewLogConfInfo;
5270 }
5271
5272 return CR_SUCCESS;
5273}
DWORD WINAPI PNP_GetNextLogConf(handle_t hBinding, LPWSTR pDeviceID, DWORD ulLogConfType, DWORD ulCurrentTag, DWORD *pulNextTag, DWORD ulFlags)
Definition: rpcserver.c:4293

Referenced by CM_Get_Next_Log_Conf().

◆ CM_Get_Next_Res_Des()

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 
)

Definition at line 5281 of file cfgmgr.c.

5287{
5288 TRACE("CM_Get_Next_Res_Des(%p %p %lu %p %lx)\n",
5289 prdResDes, rdResDes, ForResource, pResourceID, ulFlags);
5290
5291 return CM_Get_Next_Res_Des_Ex(prdResDes, rdResDes, ForResource,
5292 pResourceID, ulFlags, NULL);
5293}
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)
Definition: cfgmgr.c:5301

◆ CM_Get_Next_Res_Des_Ex()

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 
)

Definition at line 5301 of file cfgmgr.c.

5308{
5310 HSTRING_TABLE StringTable = NULL;
5311 PRES_DES_INFO pNewResDesInfo = NULL;
5312 ULONG ulLogConfTag, ulLogConfType, ulResDesTag;
5313 ULONG ulNextResDesType = 0, ulNextResDesTag = 0;
5314 LPWSTR lpDevInst;
5315 DEVINST dnDevInst;
5316 CONFIGRET ret;
5317
5318 FIXME("CM_Get_Next_Res_Des_Ex(%p %p %lu %p %lx %p)\n",
5319 prdResDes, rdResDes, ForResource, pResourceID, ulFlags, hMachine);
5320
5321 if (prdResDes == NULL)
5322 return CR_INVALID_POINTER;
5323
5324 if (IsValidLogConf((PLOG_CONF_INFO)rdResDes))
5325 {
5326 FIXME("LogConf found!\n");
5327 dnDevInst = ((PLOG_CONF_INFO)rdResDes)->dnDevInst;
5328 ulLogConfTag = ((PLOG_CONF_INFO)rdResDes)->ulTag;
5329 ulLogConfType = ((PLOG_CONF_INFO)rdResDes)->ulType;
5330 ulResDesTag = (ULONG)-1;
5331 }
5332 else if (IsValidResDes((PRES_DES_INFO)rdResDes))
5333 {
5334 FIXME("ResDes found!\n");
5335 dnDevInst = ((PRES_DES_INFO)rdResDes)->dnDevInst;
5336 ulLogConfTag = ((PRES_DES_INFO)rdResDes)->ulLogConfTag;
5337 ulLogConfType = ((PRES_DES_INFO)rdResDes)->ulLogConfType;
5338 ulResDesTag = ((PRES_DES_INFO)rdResDes)->ulResDesTag;
5339 }
5340 else
5341 {
5342 return CR_INVALID_RES_DES;
5343 }
5344
5345 if ((ForResource == ResType_All) && (pResourceID == NULL))
5346 return CR_INVALID_POINTER;
5347
5348 if (ulFlags != 0)
5349 return CR_INVALID_FLAG;
5350
5351 if (hMachine != NULL)
5352 {
5353 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
5354 if (BindingHandle == NULL)
5355 return CR_FAILURE;
5356
5357 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
5358 if (StringTable == 0)
5359 return CR_FAILURE;
5360 }
5361 else
5362 {
5363 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
5364 return CR_FAILURE;
5365 }
5366
5367 lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
5368 if (lpDevInst == NULL)
5369 return CR_INVALID_DEVNODE;
5370
5372 {
5374 lpDevInst,
5375 ulLogConfTag,
5376 ulLogConfType,
5377 ForResource,
5378 ulResDesTag,
5379 &ulNextResDesTag,
5380 &ulNextResDesType,
5381 0);
5382 }
5384 {
5386 }
5388
5389 if (ret != CR_SUCCESS)
5390 return ret;
5391
5392 if (ForResource == ResType_All)
5393 *pResourceID = ulNextResDesType;
5394
5395 if (prdResDes)
5396 {
5397 pNewResDesInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(RES_DES_INFO));
5398 if (pNewResDesInfo == NULL)
5399 return CR_OUT_OF_MEMORY;
5400
5401 pNewResDesInfo->ulMagic = LOG_CONF_MAGIC;
5402 pNewResDesInfo->dnDevInst = dnDevInst;
5403 pNewResDesInfo->ulLogConfType = ulLogConfType;
5404 pNewResDesInfo->ulLogConfTag = ulLogConfTag;
5405 pNewResDesInfo->ulResDesType = ulNextResDesType;
5406 pNewResDesInfo->ulResDesTag = ulNextResDesTag;
5407
5408 *prdResDes = (RES_DES)pNewResDesInfo;
5409 }
5410
5411 return CR_SUCCESS;
5412}
DWORD WINAPI PNP_GetNextResDes(handle_t hBinding, LPWSTR pDeviceID, DWORD ulLogConfTag, DWORD ulLogConfType, RESOURCEID ResourceID, DWORD ulResourceTag, DWORD *pulNextResType, DWORD *pulNextResTag, DWORD ulFlags)
Definition: rpcserver.c:4464
DWORD_PTR RES_DES
Definition: cfgmgr32.h:93
#define ResType_All
Definition: cfgmgr32.h:575
DWORD DEVINST
Definition: cfgmgr32.h:76
ULONG ulLogConfTag
Definition: cfgmgr.c:78
DEVINST dnDevInst
Definition: cfgmgr.c:76
ULONG ulResDesType
Definition: cfgmgr.c:79
ULONG ulResDesTag
Definition: cfgmgr.c:80
ULONG ulLogConfType
Definition: cfgmgr.c:77
ULONG ulMagic
Definition: cfgmgr.c:75

Referenced by CM_Get_Next_Res_Des().

◆ CM_Get_Parent()

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

Definition at line 5420 of file cfgmgr.c.

5424{
5425 TRACE("CM_Get_Parent(%p %p %lx)\n",
5426 pdnDevInst, dnDevInst, ulFlags);
5427
5428 return CM_Get_Parent_Ex(pdnDevInst, dnDevInst, ulFlags, NULL);
5429}
CONFIGRET WINAPI CM_Get_Parent_Ex(_Out_ PDEVINST pdnDevInst, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:5437

◆ CM_Get_Parent_Ex()

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

Definition at line 5437 of file cfgmgr.c.

5442{
5443 WCHAR szRelatedDevInst[MAX_DEVICE_ID_LEN];
5445 HSTRING_TABLE StringTable = NULL;
5446 LPWSTR lpDevInst;
5447 DWORD dwIndex, dwLength = MAX_DEVICE_ID_LEN;
5448 CONFIGRET ret;
5449
5450 TRACE("CM_Get_Parent_Ex(%p %lx %lx %p)\n",
5451 pdnDevInst, dnDevInst, ulFlags, hMachine);
5452
5453 if (pdnDevInst == NULL)
5454 return CR_INVALID_POINTER;
5455
5456 if (dnDevInst == 0)
5457 return CR_INVALID_DEVINST;
5458
5459 if (ulFlags != 0)
5460 return CR_INVALID_FLAG;
5461
5462 *pdnDevInst = -1;
5463
5464 if (hMachine != NULL)
5465 {
5466 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
5467 if (BindingHandle == NULL)
5468 return CR_FAILURE;
5469
5470 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
5471 if (StringTable == 0)
5472 return CR_FAILURE;
5473 }
5474 else
5475 {
5476 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
5477 return CR_FAILURE;
5478 }
5479
5480 lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
5481 if (lpDevInst == NULL)
5482 return CR_INVALID_DEVNODE;
5483
5485 {
5487 PNP_GET_PARENT_DEVICE_INSTANCE,
5488 lpDevInst,
5489 szRelatedDevInst,
5490 &dwLength,
5491 0);
5492 }
5494 {
5496 }
5498
5499 if (ret != CR_SUCCESS)
5500 return ret;
5501
5502 TRACE("szRelatedDevInst: %s\n", debugstr_w(szRelatedDevInst));
5503
5504 dwIndex = pSetupStringTableAddString(StringTable, szRelatedDevInst, 1);
5505 if (dwIndex == -1)
5506 return CR_FAILURE;
5507
5508 *pdnDevInst = dwIndex;
5509
5510 return CR_SUCCESS;
5511}

Referenced by CM_Get_Parent(), SetupDiRegisterDeviceInfo(), and UpdateDevInfo().

◆ CM_Get_Res_Des_Data()

CONFIGRET WINAPI CM_Get_Res_Des_Data ( _In_ RES_DES  rdResDes,
_Out_writes_bytes_(BufferLen) PVOID  Buffer,
_In_ ULONG  BufferLen,
_In_ ULONG  ulFlags 
)

Definition at line 5519 of file cfgmgr.c.

5524{
5525 TRACE("CM_Get_Res_Des_Data(%p %p %lu %lx)\n",
5526 rdResDes, Buffer, BufferLen, ulFlags);
5527
5528 return CM_Get_Res_Des_Data_Ex(rdResDes, Buffer, BufferLen, ulFlags, NULL);
5529}
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)
Definition: cfgmgr.c:5537

◆ CM_Get_Res_Des_Data_Ex()

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 
)

Definition at line 5537 of file cfgmgr.c.

5543{
5544 FIXME("CM_Get_Res_Des_Data_Ex(%p %p %lu %lx %p)\n",
5545 rdResDes, Buffer, BufferLen, ulFlags, hMachine);
5546
5548}

Referenced by CM_Get_Res_Des_Data().

◆ CM_Get_Res_Des_Data_Size()

CONFIGRET WINAPI CM_Get_Res_Des_Data_Size ( _Out_ PULONG  pulSize,
_In_ RES_DES  rdResDes,
_In_ ULONG  ulFlags 
)

Definition at line 5556 of file cfgmgr.c.

5560{
5561 TRACE("CM_Get_Res_Des_Data_Size(%p %p %lx)\n",
5562 pulSize, rdResDes, ulFlags);
5563
5564 return CM_Get_Res_Des_Data_Size_Ex(pulSize, rdResDes, ulFlags, NULL);
5565}
CONFIGRET WINAPI CM_Get_Res_Des_Data_Size_Ex(_Out_ PULONG pulSize, _In_ RES_DES rdResDes, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:5573
_Check_return_ _Out_ PULONG pulSize
Definition: winddi.h:2120

◆ CM_Get_Res_Des_Data_Size_Ex()

CONFIGRET WINAPI CM_Get_Res_Des_Data_Size_Ex ( _Out_ PULONG  pulSize,
_In_ RES_DES  rdResDes,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 5573 of file cfgmgr.c.

5578{
5579 TRACE("CM_Get_Res_Des_Data_Size_Ex(%p %p %lx %p)\n",
5580 pulSize, rdResDes, ulFlags, hMachine);
5581
5583}

Referenced by CM_Get_Res_Des_Data_Size().

◆ CM_Get_Resource_Conflict_Count()

CONFIGRET WINAPI CM_Get_Resource_Conflict_Count ( _In_ CONFLICT_LIST  clConflictList,
_Out_ PULONG  pulCount 
)

Definition at line 5591 of file cfgmgr.c.

5594{
5595 PCONFLICT_DATA pConflictData;
5596
5597 FIXME("CM_Get_Resource_Conflict_Count(%p %p)\n",
5598 clConflictList, pulCount);
5599
5600 pConflictData = (PCONFLICT_DATA)clConflictList;
5601 if (!IsValidConflictData(pConflictData))
5603
5604 if (pulCount == NULL)
5605 return CR_INVALID_POINTER;
5606
5607 *pulCount = pConflictData->pConflictList->ConflictsListed;
5608
5609 return CR_SUCCESS;
5610}
DWORD ConflictsListed
Definition: pnp.idl:240

◆ CM_Get_Resource_Conflict_DetailsA()

CONFIGRET WINAPI CM_Get_Resource_Conflict_DetailsA ( _In_ CONFLICT_LIST  clConflictList,
_In_ ULONG  ulIndex,
_Inout_ PCONFLICT_DETAILS_A  pConflictDetails 
)

Definition at line 5618 of file cfgmgr.c.

5622{
5623 FIXME("CM_Get_Resource_Conflict_CountA(%p %lu %p)\n",
5624 clConflictList, ulIndex, pConflictDetails);
5625
5627}

◆ CM_Get_Resource_Conflict_DetailsW()

CONFIGRET WINAPI CM_Get_Resource_Conflict_DetailsW ( _In_ CONFLICT_LIST  clConflictList,
_In_ ULONG  ulIndex,
_Inout_ PCONFLICT_DETAILS_W  pConflictDetails 
)

Definition at line 5635 of file cfgmgr.c.

5639{
5640 FIXME("CM_Get_Resource_Conflict_CountW(%p %lu %p)\n",
5641 clConflictList, ulIndex, pConflictDetails);
5642
5644}

◆ CM_Get_Sibling()

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

Definition at line 5652 of file cfgmgr.c.

5656{
5657 TRACE("CM_Get_Sibling(%p %p %lx)\n",
5658 pdnDevInst, dnDevInst, ulFlags);
5659
5660 return CM_Get_Sibling_Ex(pdnDevInst, dnDevInst, ulFlags, NULL);
5661}
CONFIGRET WINAPI CM_Get_Sibling_Ex(_Out_ PDEVINST pdnDevInst, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:5669

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

◆ CM_Get_Sibling_Ex()

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

Definition at line 5669 of file cfgmgr.c.

5674{
5675 WCHAR szRelatedDevInst[MAX_DEVICE_ID_LEN];
5677 HSTRING_TABLE StringTable = NULL;
5678 LPWSTR lpDevInst;
5679 DWORD dwIndex, dwLength = MAX_DEVICE_ID_LEN;
5680 CONFIGRET ret;
5681
5682 TRACE("CM_Get_Sibling_Ex(%p %lx %lx %p)\n",
5683 pdnDevInst, dnDevInst, ulFlags, hMachine);
5684
5685 if (pdnDevInst == NULL)
5686 return CR_INVALID_POINTER;
5687
5688 if (dnDevInst == 0)
5689 return CR_INVALID_DEVINST;
5690
5691 if (ulFlags != 0)
5692 return CR_INVALID_FLAG;
5693
5694 *pdnDevInst = -1;
5695
5696 if (hMachine != NULL)
5697 {
5698 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
5699 if (BindingHandle == NULL)
5700 return CR_FAILURE;
5701
5702 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
5703 if (StringTable == 0)
5704 return CR_FAILURE;
5705 }
5706 else
5707 {
5708 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
5709 return CR_FAILURE;
5710 }
5711
5712 lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
5713 if (lpDevInst == NULL)
5714 return CR_INVALID_DEVNODE;
5715
5717 {
5719 PNP_GET_SIBLING_DEVICE_INSTANCE,
5720 lpDevInst,
5721 szRelatedDevInst,
5722 &dwLength,
5723 0);
5724 }
5726 {
5728 }
5730
5731 if (ret != CR_SUCCESS)
5732 return ret;
5733
5734 TRACE("szRelatedDevInst: %s\n", debugstr_w(szRelatedDevInst));
5735
5736 dwIndex = pSetupStringTableAddString(StringTable, szRelatedDevInst, 1);
5737 if (dwIndex == -1)
5738 return CR_FAILURE;
5739
5740 *pdnDevInst = dwIndex;
5741
5742 return CR_SUCCESS;
5743}

Referenced by CM_Get_Sibling().

◆ CM_Get_Version()

WORD WINAPI CM_Get_Version ( VOID  )

Definition at line 5751 of file cfgmgr.c.

5752{
5753 TRACE("CM_Get_Version()\n");
5754
5755 return CM_Get_Version_Ex(NULL);
5756}
WORD WINAPI CM_Get_Version_Ex(_In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:5764

Referenced by test_CM_Get_Version().

◆ CM_Get_Version_Ex()

WORD WINAPI CM_Get_Version_Ex ( _In_opt_ HMACHINE  hMachine)

Definition at line 5764 of file cfgmgr.c.

5766{
5768 WORD Version = 0;
5769 CONFIGRET ret;
5770
5771 TRACE("CM_Get_Version_Ex(%p)\n", hMachine);
5772
5773 if (hMachine != NULL)
5774 {
5775 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
5776 if (BindingHandle == NULL)
5777 return 0;
5778 }
5779 else
5780 {
5782 return CR_FAILURE;
5783 }
5784
5786 {
5788 }
5790 {
5792 }
5794
5795 if (ret != CR_SUCCESS)
5796 return 0;
5797
5798 return Version;
5799}
DWORD WINAPI PNP_GetVersion(handle_t hBinding, WORD *pVersion)
Definition: rpcserver.c:657
unsigned short WORD
Definition: ntddk_ex.h:93
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE _In_ USHORT _In_ USHORT Version
Definition: wdffdo.h:469

Referenced by CM_Get_Version().

◆ CM_Intersect_Range_List()

CONFIGRET WINAPI CM_Intersect_Range_List ( _In_ RANGE_LIST  rlhOld1,
_In_ RANGE_LIST  rlhOld2,
_In_ RANGE_LIST  rlhNew,
_In_ ULONG  ulFlags 
)

Definition at line 5807 of file cfgmgr.c.

5812{
5813 FIXME("CM_Intersect_Range_List(%p %p %p %lx)\n",
5814 rlhOld1, rlhOld2, rlhNew, ulFlags);
5815
5817}

◆ CM_Invert_Range_List()

CONFIGRET WINAPI CM_Invert_Range_List ( _In_ RANGE_LIST  rlhOld,
_In_ RANGE_LIST  rlhNew,
_In_ DWORDLONG  ullMaxValue,
_In_ ULONG  ulFlags 
)

Definition at line 5825 of file cfgmgr.c.

5830{
5831 FIXME("CM_Invert_Range_List(%p %p %I64u %lx)\n",
5832 rlhOld, rlhNew, ullMaxValue, ulFlags);
5833
5835}

◆ CM_Is_Dock_Station_Present()

CONFIGRET WINAPI CM_Is_Dock_Station_Present ( _Out_ PBOOL  pbPresent)

Definition at line 5843 of file cfgmgr.c.

5845{
5846 TRACE("CM_Is_Dock_Station_Present(%p)\n",
5847 pbPresent);
5848
5849 return CM_Is_Dock_Station_Present_Ex(pbPresent, NULL);
5850}
CONFIGRET WINAPI CM_Is_Dock_Station_Present_Ex(_Out_ PBOOL pbPresent, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:5858

◆ CM_Is_Dock_Station_Present_Ex()

CONFIGRET WINAPI CM_Is_Dock_Station_Present_Ex ( _Out_ PBOOL  pbPresent,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 5858 of file cfgmgr.c.

5861{
5863 CONFIGRET ret;
5864
5865 TRACE("CM_Is_Dock_Station_Present_Ex(%p %p)\n",
5866 pbPresent, hMachine);
5867
5868 if (pbPresent == NULL)
5869 return CR_INVALID_POINTER;
5870
5871 *pbPresent = FALSE;
5872
5873 if (hMachine != NULL)
5874 {
5875 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
5876 if (BindingHandle == NULL)
5877 return CR_FAILURE;
5878 }
5879 else
5880 {
5882 return CR_FAILURE;
5883 }
5884
5886 {
5888 pbPresent);
5889 }
5891 {
5893 }
5895
5896 return ret;
5897}
CONFIGRET WINAPI PNP_IsDockStationPresent(handle_t hBinding, BOOL *Present)
Definition: rpcserver.c:3857

Referenced by CM_Is_Dock_Station_Present().

◆ CM_Is_Version_Available()

BOOL WINAPI CM_Is_Version_Available ( _In_ WORD  wVersion)

Definition at line 5905 of file cfgmgr.c.

5907{
5908 TRACE("CM_Is_Version_Available(%hu)\n",
5909 wVersion);
5910
5911 return CM_Is_Version_Available_Ex(wVersion, NULL);
5912}
BOOL WINAPI CM_Is_Version_Available_Ex(_In_ WORD wVersion, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:5920

◆ CM_Is_Version_Available_Ex()

BOOL WINAPI CM_Is_Version_Available_Ex ( _In_ WORD  wVersion,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 5920 of file cfgmgr.c.

5923{
5925 WORD wServerVersion;
5926 CONFIGRET ret;
5927
5928 TRACE("CM_Is_Version_Available_Ex(%hu %p)\n",
5929 wVersion, hMachine);
5930
5931 if (wVersion <= 0x400)
5932 return TRUE;
5933
5934 if (hMachine != NULL)
5935 {
5936 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
5937 if (BindingHandle == NULL)
5938 return FALSE;
5939 }
5940 else
5941 {
5943 return FALSE;
5944 }
5945
5947 {
5948 ret = PNP_GetVersion(BindingHandle, &wServerVersion);
5949 }
5951 {
5953 }
5955
5956 if (ret != CR_SUCCESS)
5957 return FALSE;
5958
5959 return (wServerVersion >= wVersion);
5960}

Referenced by CM_Is_Version_Available().

◆ CM_Locate_DevNode_ExA()

CONFIGRET WINAPI CM_Locate_DevNode_ExA ( _Out_ PDEVINST  pdnDevInst,
_In_opt_ DEVINSTID_A  pDeviceID,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 6002 of file cfgmgr.c.

6007{
6008 DEVINSTID_W pDevIdW = NULL;
6010
6011 TRACE("CM_Locate_DevNode_ExA(%p %s %lx %p)\n",
6012 pdnDevInst, debugstr_a(pDeviceID), ulFlags, hMachine);
6013
6014 if (pDeviceID != NULL)
6015 {
6016 if (pSetupCaptureAndConvertAnsiArg(pDeviceID, &pDevIdW))
6017 return CR_INVALID_DEVICE_ID;
6018 }
6019
6020 ret = CM_Locate_DevNode_ExW(pdnDevInst, pDevIdW, ulFlags, hMachine);
6021
6022 if (pDevIdW != NULL)
6023 MyFree(pDevIdW);
6024
6025 return ret;
6026}
CONFIGRET WINAPI CM_Locate_DevNode_ExW(_Out_ PDEVINST pdnDevInst, _In_opt_ DEVINSTID_W pDeviceID, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:6034

Referenced by CM_Locate_DevNodeA().

◆ CM_Locate_DevNode_ExW()

CONFIGRET WINAPI CM_Locate_DevNode_ExW ( _Out_ PDEVINST  pdnDevInst,
_In_opt_ DEVINSTID_W  pDeviceID,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 6034 of file cfgmgr.c.

6039{
6040 WCHAR DeviceIdBuffer[MAX_DEVICE_ID_LEN];
6042 HSTRING_TABLE StringTable = NULL;
6044
6045 TRACE("CM_Locate_DevNode_ExW(%p %s %lx %p)\n",
6046 pdnDevInst, debugstr_w(pDeviceID), ulFlags, hMachine);
6047
6048 if (pdnDevInst == NULL)
6049 return CR_INVALID_POINTER;
6050
6051 if (ulFlags & ~CM_LOCATE_DEVNODE_BITS)
6052 return CR_INVALID_FLAG;
6053
6054 if (hMachine != NULL)
6055 {
6056 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
6057 if (BindingHandle == NULL)
6058 return CR_FAILURE;
6059
6060 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
6061 if (StringTable == 0)
6062 return CR_FAILURE;
6063 }
6064 else
6065 {
6066 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
6067 return CR_FAILURE;
6068 }
6069
6070 if (pDeviceID != NULL && lstrlenW(pDeviceID) != 0)
6071 {
6072 lstrcpyW(DeviceIdBuffer, pDeviceID);
6073
6075 {
6076 /* Validate the device ID */
6078 DeviceIdBuffer,
6079 ulFlags);
6080 }
6082 {
6084 }
6086 }
6087 else
6088 {
6090 {
6091 /* Get the root device ID */
6093 DeviceIdBuffer,
6095 }
6097 {
6099 }
6101 }
6102
6103 TRACE("DeviceIdBuffer: %s\n", debugstr_w(DeviceIdBuffer));
6104
6105 if (ret == CR_SUCCESS)
6106 {
6107 *pdnDevInst = pSetupStringTableAddString(StringTable, DeviceIdBuffer, 1);
6108 if (*pdnDevInst == -1)
6109 ret = CR_FAILURE;
6110 }
6111
6112 return ret;
6113}
DWORD WINAPI PNP_GetRootDeviceInstance(handle_t hBinding, LPWSTR pDeviceID, PNP_RPC_STRING_LEN ulLength)
Definition: rpcserver.c:813
DWORD WINAPI PNP_ValidateDeviceInstance(handle_t hBinding, LPWSTR pDeviceID, DWORD ulFlags)
Definition: rpcserver.c:770
#define CM_LOCATE_DEVNODE_BITS
Definition: cfgmgr32.h:764

Referenced by CM_Locate_DevNode_ExA(), CM_Locate_DevNodeW(), and CreateDeviceInfo().

◆ CM_Locate_DevNodeA()

CONFIGRET WINAPI CM_Locate_DevNodeA ( _Out_ PDEVINST  pdnDevInst,
_In_opt_ DEVINSTID_A  pDeviceID,
_In_ ULONG  ulFlags 
)

Definition at line 5968 of file cfgmgr.c.

5972{
5973 TRACE("CM_Locate_DevNodeA(%p %s %lx)\n",
5974 pdnDevInst, debugstr_a(pDeviceID), ulFlags);
5975
5976 return CM_Locate_DevNode_ExA(pdnDevInst, pDeviceID, ulFlags, NULL);
5977}
CONFIGRET WINAPI CM_Locate_DevNode_ExA(_Out_ PDEVINST pdnDevInst, _In_opt_ DEVINSTID_A pDeviceID, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:6002

◆ CM_Locate_DevNodeW()

CONFIGRET WINAPI CM_Locate_DevNodeW ( _Out_ PDEVINST  pdnDevInst,
_In_opt_ DEVINSTID_W  pDeviceID,
_In_ ULONG  ulFlags 
)

Definition at line 5985 of file cfgmgr.c.

5989{
5990 TRACE("CM_Locate_DevNodeW(%p %s %lx)\n",
5991 pdnDevInst, debugstr_w(pDeviceID), ulFlags);
5992
5993 return CM_Locate_DevNode_ExW(pdnDevInst, pDeviceID, ulFlags, NULL);
5994}

Referenced by CRootNode::SetupNode().

◆ CM_Merge_Range_List()

CONFIGRET WINAPI CM_Merge_Range_List ( _In_ RANGE_LIST  rlhOld1,
_In_ RANGE_LIST  rlhOld2,
_In_ RANGE_LIST  rlhNew,
_In_ ULONG  ulFlags 
)

Definition at line 6121 of file cfgmgr.c.

6126{
6127 FIXME("CM_Merge_Range_List(%p %p %p %lx)\n",
6128 rlhOld1, rlhOld2, rlhNew, ulFlags);
6129
6131}

◆ CM_Modify_Res_Des()

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 
)

Definition at line 6139 of file cfgmgr.c.

6146{
6147 TRACE("CM_Modify_Res_Des(%p %p %lx %p %lu %lx)\n",
6148 prdResDes, rdResDes, ResourceID, ResourceData,
6149 ResourceLen, ulFlags);
6150
6151 return CM_Modify_Res_Des_Ex(prdResDes, rdResDes, ResourceID, ResourceData,
6152 ResourceLen, ulFlags, NULL);
6153}
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)
Definition: cfgmgr.c:6161

◆ CM_Modify_Res_Des_Ex()

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 
)

Definition at line 6161 of file cfgmgr.c.

6169{
6170 FIXME("CM_Modify_Res_Des_Ex(%p %p %lx %p %lu %lx %p)\n",
6171 prdResDes, rdResDes, ResourceID, ResourceData,
6172 ResourceLen, ulFlags, hMachine);
6173
6175}

Referenced by CM_Modify_Res_Des().

◆ CM_Move_DevNode()

CONFIGRET WINAPI CM_Move_DevNode ( _In_ DEVINST  dnFromDevInst,
_In_ DEVINST  dnToDevInst,
_In_ ULONG  ulFlags 
)

Definition at line 6183 of file cfgmgr.c.

6187{
6188 TRACE("CM_Move_DevNode(%lx %lx %lx)\n",
6189 dnFromDevInst, dnToDevInst, ulFlags);
6190
6191 return CM_Move_DevNode_Ex(dnFromDevInst, dnToDevInst, ulFlags, NULL);
6192}
CONFIGRET WINAPI CM_Move_DevNode_Ex(_In_ DEVINST dnFromDevInst, _In_ DEVINST dnToDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:6200

◆ CM_Move_DevNode_Ex()

CONFIGRET WINAPI CM_Move_DevNode_Ex ( _In_ DEVINST  dnFromDevInst,
_In_ DEVINST  dnToDevInst,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 6200 of file cfgmgr.c.

6205{
6207 HSTRING_TABLE StringTable = NULL;
6208 LPWSTR lpFromDevInst;
6209 LPWSTR lpToDevInst;
6210 CONFIGRET ret;
6211
6212 FIXME("CM_Move_DevNode_Ex(%lx %lx %lx %p)\n",
6213 dnFromDevInst, dnToDevInst, ulFlags, hMachine);
6214
6215 if (!pSetupIsUserAdmin())
6216 return CR_ACCESS_DENIED;
6217
6218 if (dnFromDevInst == 0 || dnToDevInst == 0)
6219 return CR_INVALID_DEVNODE;
6220
6221 if (ulFlags != 0)
6222 return CR_INVALID_FLAG;
6223
6224 if (hMachine != NULL)
6225 {
6226 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
6227 if (BindingHandle == NULL)
6228 return CR_FAILURE;
6229
6230 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
6231 if (StringTable == 0)
6232 return CR_FAILURE;
6233 }
6234 else
6235 {
6236 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
6237 return CR_FAILURE;
6238 }
6239
6240 lpFromDevInst = pSetupStringTableStringFromId(StringTable, dnFromDevInst);
6241 if (lpFromDevInst == NULL)
6242 return CR_INVALID_DEVNODE;
6243
6244 lpToDevInst = pSetupStringTableStringFromId(StringTable, dnToDevInst);
6245 if (lpToDevInst == NULL)
6246 return CR_INVALID_DEVNODE;
6247
6249 {
6251 PNP_DEVINST_MOVE,
6252 ulFlags,
6253 lpFromDevInst,
6254 lpToDevInst);
6255 }
6257 {
6259 }
6261
6262 return ret;
6263}

Referenced by CM_Move_DevNode().

◆ CM_Next_Range()

CONFIGRET WINAPI CM_Next_Range ( _Inout_ PRANGE_ELEMENT  preElement,
_Out_ PDWORDLONG  pullStart,
_Out_ PDWORDLONG  pullEnd,
_In_ ULONG  ulFlags 
)

Definition at line 6271 of file cfgmgr.c.

6276{
6277 PINTERNAL_RANGE_LIST pRangeList;
6278 PINTERNAL_RANGE pRange;
6279 PLIST_ENTRY ListEntry;
6281
6282 FIXME("CM_Next_Range(%p %p %p %lx)\n",
6283 preElement, pullStart, pullEnd, ulFlags);
6284
6285 pRange = (PINTERNAL_RANGE)preElement;
6286
6287 if (pRange == NULL || pRange->pRangeList == NULL)
6288 return CR_FAILURE;
6289
6290 if (pullStart == NULL || pullEnd == NULL)
6291 return CR_INVALID_POINTER;
6292
6293 if (ulFlags != 0)
6294 return CR_INVALID_FLAG;
6295
6296 pRangeList = pRange->pRangeList;
6297
6298 /* Lock the range list */
6299 WaitForSingleObject(pRangeList->hMutex, INFINITE);
6300
6301 /* Fail, if we reached the end of the list */
6302 if (pRange->ListEntry.Flink == &pRangeList->ListHead)
6303 {
6304 ret = CR_FAILURE;
6305 goto done;
6306 }
6307
6308 /* Get the next range */
6309 ListEntry = pRangeList->ListHead.Flink;
6310 pRange = CONTAINING_RECORD(ListEntry, INTERNAL_RANGE, ListEntry);
6311
6312 /* Return the range data */
6313 *pullStart = pRange->ullStart;
6314 *pullEnd = pRange->ullEnd;
6315 *preElement = (RANGE_ELEMENT)pRange;
6316
6317done:
6318 /* Unlock the range list */
6319 ReleaseMutex(pRangeList->hMutex);
6320
6321 return ret;
6322}
struct _INTERNAL_RANGE * PINTERNAL_RANGE

◆ CM_Open_Class_Key_ExA()

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 
)

Definition at line 6374 of file cfgmgr.c.

6382{
6383 LPWSTR pszClassNameW = NULL;
6384 CONFIGRET ret;
6385
6386 TRACE("CM_Open_Class_Key_ExA(%p %s %lx %lx %p %lx %p)\n",
6387 debugstr_guid(pClassGuid), debugstr_a(pszClassName),
6388 samDesired, Disposition, phkClass, ulFlags, hMachine);
6389
6390 if (pszClassName != NULL)
6391 {
6392 if (pSetupCaptureAndConvertAnsiArg(pszClassName, &pszClassNameW))
6393 return CR_INVALID_DATA;
6394 }
6395
6396 ret = CM_Open_Class_Key_ExW(pClassGuid, pszClassNameW, samDesired,
6397 Disposition, phkClass, ulFlags, hMachine);
6398
6399 if (pszClassNameW != NULL)
6400 MyFree(pszClassNameW);
6401
6402 return ret;
6403}
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)
Definition: cfgmgr.c:6411
_In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Reserved_ ULONG _In_opt_ PUNICODE_STRING _In_ ULONG _Out_opt_ PULONG Disposition
Definition: cmfuncs.h:56

Referenced by CM_Open_Class_KeyA().

◆ CM_Open_Class_Key_ExW()

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 
)

Definition at line 6411 of file cfgmgr.c.

6419{
6420 WCHAR szKeyName[MAX_PATH];
6421 LPWSTR lpGuidString;
6422 DWORD dwDisposition;
6423 DWORD dwError;
6424 HKEY hKey;
6425
6426 TRACE("CM_Open_Class_Key_ExW(%p %s %lx %lx %p %lx %p)\n",
6427 debugstr_guid(pClassGuid), debugstr_w(pszClassName),
6428 samDesired, Disposition, phkClass, ulFlags, hMachine);
6429
6430 /* Check Disposition and ulFlags */
6432 (ulFlags & ~CM_OPEN_CLASS_KEY_BITS))
6433 return CR_INVALID_FLAG;
6434
6435 /* Check phkClass */
6436 if (phkClass == NULL)
6437 return CR_INVALID_POINTER;
6438
6439 *phkClass = NULL;
6440
6441 if (ulFlags == CM_OPEN_CLASS_KEY_INTERFACE &&
6442 pszClassName != NULL)
6443 return CR_INVALID_DATA;
6444
6445 if (hMachine == NULL)
6446 {
6448 }
6449 else
6450 {
6451 if (RegConnectRegistryW(((PMACHINE_INFO)hMachine)->szMachineName,
6453 &hKey))
6454 return CR_REGISTRY_ERROR;
6455 }
6456
6457 if (ulFlags & CM_OPEN_CLASS_KEY_INTERFACE)
6458 {
6459 lstrcpyW(szKeyName, DeviceClasses);
6460 }
6461 else
6462 {
6463 lstrcpyW(szKeyName, ControlClass);
6464 }
6465
6466 if (pClassGuid != NULL)
6467 {
6468 if (UuidToStringW((UUID*)pClassGuid, &lpGuidString) != RPC_S_OK)
6469 {
6471 return CR_INVALID_DATA;
6472 }
6473
6474 lstrcatW(szKeyName, BackslashOpenBrace);
6475 lstrcatW(szKeyName, lpGuidString);
6476 lstrcatW(szKeyName, CloseBrace);
6477 }
6478
6480 {
6481 dwError = RegCreateKeyExW(hKey, szKeyName, 0, NULL, 0, samDesired,
6482 NULL, phkClass, &dwDisposition);
6483 }
6484 else
6485 {
6486 dwError = RegOpenKeyExW(hKey, szKeyName, 0, samDesired, phkClass);
6487 }
6488
6490
6491 if (pClassGuid != NULL)
6492 RpcStringFreeW(&lpGuidString);
6493
6494 if (dwError != ERROR_SUCCESS)
6495 {
6496 *phkClass = NULL;
6498 }
6499
6500 if (pszClassName != NULL)
6501 {
6502 RegSetValueExW(*phkClass, Class, 0, REG_SZ, (LPBYTE)pszClassName,
6503 (lstrlenW(pszClassName) + 1) * sizeof(WCHAR));
6504 }
6505
6506 return CR_SUCCESS;
6507}
#define RegCloseKey(hKey)
Definition: registry.h:49
#define CM_OPEN_CLASS_KEY_INTERFACE
Definition: cfgmgr32.h:773
#define RegDisposition_Bits
Definition: cfgmgr32.h:611
#define CM_OPEN_CLASS_KEY_BITS
Definition: cfgmgr32.h:774
#define RegDisposition_OpenAlways
Definition: cfgmgr32.h:609
#define CR_NO_SUCH_REGISTRY_KEY
Definition: cfgmgr32.h:892
#define CR_REGISTRY_ERROR
Definition: cfgmgr32.h:875
static const WCHAR ControlClass[]
Definition: cfgmgr.c:44
static const WCHAR BackslashOpenBrace[]
Definition: cfgmgr.c:40
static const WCHAR DeviceClasses[]
Definition: cfgmgr.c:49
static const WCHAR CloseBrace[]
Definition: cfgmgr.c:41
#define ERROR_SUCCESS
Definition: deptool.c:10
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
LONG WINAPI RegConnectRegistryW(LPCWSTR lpMachineName, HKEY hKey, PHKEY phkResult)
Definition: reg.c:874
#define MAX_PATH
Definition: compat.h:34
FxAutoRegKey hKey
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
RPC_STATUS WINAPI UuidToStringW(UUID *Uuid, RPC_WSTR *StringUuid)
Definition: rpcrt4_main.c:540
RPC_STATUS WINAPI RpcStringFreeW(RPC_WSTR *String)
Definition: rpcrt4_main.c:175
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by CM_Open_Class_Key_ExA(), CM_Open_Class_KeyW(), and SetupDiBuildClassInfoListExW().

◆ CM_Open_Class_KeyA()

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 
)

Definition at line 6330 of file cfgmgr.c.

6337{
6338 TRACE("CM_Open_Class_KeyA(%p %s %lx %lx %p %lx)\n",
6339 debugstr_guid(pClassGuid), debugstr_a(pszClassName),
6340 samDesired, Disposition, phkClass, ulFlags);
6341
6342 return CM_Open_Class_Key_ExA(pClassGuid, pszClassName, samDesired,
6343 Disposition, phkClass, ulFlags, NULL);
6344}
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)
Definition: cfgmgr.c:6374

◆ CM_Open_Class_KeyW()

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 
)

Definition at line 6352 of file cfgmgr.c.

6359{
6360 TRACE("CM_Open_Class_KeyW(%p %s %lx %lx %p %lx)\n",
6361 debugstr_guid(pClassGuid), debugstr_w(pszClassName),
6362 samDesired, Disposition, phkClass, ulFlags);
6363
6364 return CM_Open_Class_Key_ExW(pClassGuid, pszClassName, samDesired,
6365 Disposition, phkClass, ulFlags, NULL);
6366}

◆ CM_Open_DevNode_Key()

CONFIGRET WINAPI CM_Open_DevNode_Key ( _In_ DEVINST  dnDevNode,
_In_ REGSAM  samDesired,
_In_ ULONG  ulHardwareProfile,
_In_ REGDISPOSITION  Disposition,
_Out_ PHKEY  phkDevice,
_In_ ULONG  ulFlags 
)

Definition at line 6515 of file cfgmgr.c.

6522{
6523 TRACE("CM_Open_DevNode_Key(%lx %lx %lu %lx %p %lx)\n",
6524 dnDevNode, samDesired, ulHardwareProfile, Disposition, phkDevice, ulFlags);
6525
6526 return CM_Open_DevNode_Key_Ex(dnDevNode, samDesired, ulHardwareProfile,
6527 Disposition, phkDevice, ulFlags, NULL);
6528}
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)
Definition: cfgmgr.c:6536

◆ CM_Open_DevNode_Key_Ex()

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 
)

Definition at line 6536 of file cfgmgr.c.

6544{
6546 HSTRING_TABLE StringTable = NULL;
6547 LPWSTR pszDevInst, pszKeyPath = NULL, pszInstancePath = NULL;
6548 LONG lError;
6549 DWORD dwDisposition;
6550 HKEY hRootKey = NULL;
6552
6553 TRACE("CM_Open_DevNode_Key_Ex(%lx %lx %lu %lx %p %lx %p)\n",
6554 dnDevNode, samDesired, ulHardwareProfile, Disposition, phkDevice, ulFlags, hMachine);
6555
6556 if (phkDevice == NULL)
6557 return CR_INVALID_POINTER;
6558
6559 *phkDevice = NULL;
6560
6561 if (dnDevNode == 0)
6562 return CR_INVALID_DEVNODE;
6563
6564 if (ulFlags & ~CM_REGISTRY_BITS)
6565 return CR_INVALID_FLAG;
6566
6568 return CR_INVALID_DATA;
6569
6570 if (hMachine != NULL)
6571 {
6572 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
6573 if (BindingHandle == NULL)
6574 return CR_FAILURE;
6575
6576 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
6577 if (StringTable == 0)
6578 return CR_FAILURE;
6579 }
6580 else
6581 {
6582 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
6583 return CR_FAILURE;
6584 }
6585
6586 pszDevInst = pSetupStringTableStringFromId(StringTable, dnDevNode);
6587 if (pszDevInst == NULL)
6588 return CR_INVALID_DEVNODE;
6589
6590 TRACE("pszDevInst: %S\n", pszDevInst);
6591
6592 pszKeyPath = MyMalloc(512 * sizeof(WCHAR));
6593 if (pszKeyPath == NULL)
6594 {
6596 goto done;
6597 }
6598
6599 pszInstancePath = MyMalloc(512 * sizeof(WCHAR));
6600 if (pszInstancePath == NULL)
6601 {
6603 goto done;
6604 }
6605
6607 pszDevInst,
6608 pszKeyPath,
6609 pszInstancePath,
6610 ulHardwareProfile,
6611 ulFlags);
6612 if (ret != CR_SUCCESS)
6613 goto done;
6614
6615 TRACE("pszKeyPath: %S\n", pszKeyPath);
6616 TRACE("pszInstancePath: %S\n", pszInstancePath);
6617
6618 wcscat(pszKeyPath, L"\\");
6619 wcscat(pszKeyPath, pszInstancePath);
6620
6621 TRACE("pszKeyPath: %S\n", pszKeyPath);
6622
6623 if (hMachine == NULL)
6624 {
6625 hRootKey = HKEY_LOCAL_MACHINE;
6626 }
6627 else
6628 {
6629 if (RegConnectRegistryW(((PMACHINE_INFO)hMachine)->szMachineName,
6631 &hRootKey))
6632 {
6634 goto done;
6635 }
6636 }
6637
6639 {
6640 lError = RegCreateKeyExW(hRootKey,
6641 pszKeyPath,
6642 0,
6643 NULL,
6644 0,
6645 samDesired,
6646 NULL,
6647 phkDevice,
6648 &dwDisposition);
6649 }
6650 else
6651 {
6652 lError = RegOpenKeyExW(hRootKey,
6653 pszKeyPath,
6654 0,
6655 samDesired,
6656 phkDevice);
6657 }
6658
6659 if (lError != ERROR_SUCCESS)
6660 {
6661 *phkDevice = NULL;
6663 }
6664
6665done:
6666 if ((hRootKey != NULL) && (hRootKey != HKEY_LOCAL_MACHINE))
6667 RegCloseKey(hRootKey);
6668
6669 if (pszInstancePath != NULL)
6670 MyFree(pszInstancePath);
6671
6672 if (pszKeyPath != NULL)
6673 MyFree(pszKeyPath);
6674
6675 return ret;
6676}
long LONG
Definition: pedump.c:60
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)

Referenced by CM_Open_DevNode_Key().

◆ CM_Query_And_Remove_SubTree_ExA()

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 
)

Definition at line 6724 of file cfgmgr.c.

6731{
6732 LPWSTR lpLocalVetoName;
6733 CONFIGRET ret;
6734
6735 TRACE("CM_Query_And_Remove_SubTree_ExA(%lx %p %p %lu %lx %p)\n",
6736 dnAncestor, pVetoType, pszVetoName, ulNameLength,
6737 ulFlags, hMachine);
6738
6739 if (pszVetoName == NULL && ulNameLength == 0)
6740 return CR_INVALID_POINTER;
6741
6742 lpLocalVetoName = HeapAlloc(GetProcessHeap(), 0, ulNameLength * sizeof(WCHAR));
6743 if (lpLocalVetoName == NULL)
6744 return CR_OUT_OF_MEMORY;
6745
6746 ret = CM_Query_And_Remove_SubTree_ExW(dnAncestor, pVetoType, lpLocalVetoName,
6747 ulNameLength, ulFlags, hMachine);
6748 if (ret == CR_REMOVE_VETOED)
6749 {
6751 0,
6752 lpLocalVetoName,
6753 ulNameLength,
6754 pszVetoName,
6755 ulNameLength,
6756 NULL,
6757 NULL) == 0)
6758 ret = CR_FAILURE;
6759 }
6760
6761 HeapFree(GetProcessHeap(), 0, lpLocalVetoName);
6762
6763 return ret;
6764}
#define CR_REMOVE_VETOED
Definition: cfgmgr32.h:869
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)
Definition: cfgmgr.c:6772

Referenced by CM_Query_And_Remove_SubTreeA().

◆ CM_Query_And_Remove_SubTree_ExW()

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 
)

Definition at line 6772 of file cfgmgr.c.

6779{
6781 HSTRING_TABLE StringTable = NULL;
6782 LPWSTR lpDevInst;
6783 CONFIGRET ret;
6784
6785 TRACE("CM_Query_And_Remove_SubTree_ExW(%lx %p %p %lu %lx %p)\n",
6786 dnAncestor, pVetoType, pszVetoName, ulNameLength,
6787 ulFlags, hMachine);
6788
6789 if (dnAncestor == 0)
6790 return CR_INVALID_DEVNODE;
6791
6792 if (ulFlags & ~CM_REMOVE_BITS)
6793 return CR_INVALID_FLAG;
6794
6795 if (pszVetoName == NULL && ulNameLength == 0)
6796 return CR_INVALID_POINTER;
6797
6798 if (hMachine != NULL)
6799 {
6800 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
6801 if (BindingHandle == NULL)
6802 return CR_FAILURE;
6803
6804 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
6805 if (StringTable == 0)
6806 return CR_FAILURE;
6807 }
6808 else
6809 {
6810 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
6811 return CR_FAILURE;
6812 }
6813
6814 lpDevInst = pSetupStringTableStringFromId(StringTable, dnAncestor);
6815 if (lpDevInst == NULL)
6816 return CR_INVALID_DEVNODE;
6817
6819 {
6821 lpDevInst,
6822 pVetoType,
6823 pszVetoName,
6824 ulNameLength,
6825 ulFlags);
6826 }
6828 {
6830 }
6832
6833 return ret;
6834}
DWORD WINAPI PNP_QueryRemove(handle_t hBinding, LPWSTR pszDeviceID, PPNP_VETO_TYPE pVetoType, LPWSTR pszVetoName, DWORD ulNameLength, DWORD ulFlags)
Definition: rpcserver.c:3760
#define CM_REMOVE_BITS
Definition: cfgmgr32.h:780

Referenced by CM_Query_And_Remove_SubTree_ExA(), and CM_Query_And_Remove_SubTreeW().

◆ CM_Query_And_Remove_SubTreeA()

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 
)

Definition at line 6684 of file cfgmgr.c.

6690{
6691 TRACE("CM_Query_And_Remove_SubTreeA(%lx %p %p %lu %lx)\n",
6692 dnAncestor, pVetoType, pszVetoName, ulNameLength, ulFlags);
6693
6694 return CM_Query_And_Remove_SubTree_ExA(dnAncestor, pVetoType, pszVetoName,
6695 ulNameLength, ulFlags, NULL);
6696}
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)
Definition: cfgmgr.c:6724

◆ CM_Query_And_Remove_SubTreeW()

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 
)

Definition at line 6704 of file cfgmgr.c.

6710{
6711 TRACE("CM_Query_And_Remove_SubTreeW(%lx %p %p %lu %lx)\n",
6712 dnAncestor, pVetoType, pszVetoName, ulNameLength, ulFlags);
6713
6714 return CM_Query_And_Remove_SubTree_ExW(dnAncestor, pVetoType, pszVetoName,
6715 ulNameLength, ulFlags, NULL);
6716}

◆ CM_Query_Arbitrator_Free_Data()

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 
)

Definition at line 6842 of file cfgmgr.c.

6848{
6849 TRACE("CM_Query_Arbitrator_Free_Data(%p %lu %lx %lu 0x%08lx)\n",
6850 pData, DataLen, dnDevInst, ResourceID, ulFlags);
6851
6852 return CM_Query_Arbitrator_Free_Data_Ex(pData, DataLen, dnDevInst,
6853 ResourceID, ulFlags, NULL);
6854}
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)
Definition: cfgmgr.c:6862
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830

◆ CM_Query_Arbitrator_Free_Data_Ex()

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 
)

Definition at line 6862 of file cfgmgr.c.

6869{
6871 HSTRING_TABLE StringTable = NULL;
6872 LPWSTR lpDevInst;
6873 CONFIGRET ret;
6874
6875 TRACE("CM_Query_Arbitrator_Free_Data_Ex(%p %lu %lx %lu 0x%08lx %p)\n",
6876 pData, DataLen, dnDevInst, ResourceID, ulFlags, hMachine);
6877
6878 if (pData == NULL || DataLen == 0)
6879 return CR_INVALID_POINTER;
6880
6881 if (dnDevInst == 0)
6882 return CR_INVALID_DEVINST;
6883
6884 if (ulFlags & ~CM_QUERY_ARBITRATOR_BITS)
6885 return CR_INVALID_FLAG;
6886
6887 if (hMachine != NULL)
6888 {
6889 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
6890 if (BindingHandle == NULL)
6891 return CR_FAILURE;
6892
6893 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
6894 if (StringTable == 0)
6895 return CR_FAILURE;
6896 }
6897 else
6898 {
6899 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
6900 return CR_FAILURE;
6901 }
6902
6903 lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
6904 if (lpDevInst == NULL)
6905 return CR_INVALID_DEVNODE;
6906
6908 {
6910 pData,
6911 DataLen,
6912 lpDevInst,
6913 ResourceID,
6914 ulFlags);
6915 }
6917 {
6919 }
6921
6922 return ret;
6923}
DWORD WINAPI PNP_QueryArbitratorFreeData(handle_t hBinding, BYTE *pData, DWORD DataLen, LPWSTR pDeviceID, RESOURCEID ResourceID, DWORD ulFlags)
Definition: rpcserver.c:4667
#define CM_QUERY_ARBITRATOR_BITS
Definition: cfgmgr32.h:832

Referenced by CM_Query_Arbitrator_Free_Data().

◆ CM_Query_Arbitrator_Free_Size()

CONFIGRET WINAPI CM_Query_Arbitrator_Free_Size ( _Out_ PULONG  pulSize,
_In_ DEVINST  dnDevInst,
_In_ RESOURCEID  ResourceID,
_In_ ULONG  ulFlags 
)

Definition at line 6931 of file cfgmgr.c.

6936{
6937 TRACE("CM_Query_Arbitrator_Free_Size(%p %lu %lx 0x%08lx)\n",
6938 pulSize, dnDevInst,ResourceID, ulFlags);
6939
6940 return CM_Query_Arbitrator_Free_Size_Ex(pulSize, dnDevInst, ResourceID,
6941 ulFlags, NULL);
6942}
CONFIGRET WINAPI CM_Query_Arbitrator_Free_Size_Ex(_Out_ PULONG pulSize, _In_ DEVINST dnDevInst, _In_ RESOURCEID ResourceID, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:6950

◆ CM_Query_Arbitrator_Free_Size_Ex()

CONFIGRET WINAPI CM_Query_Arbitrator_Free_Size_Ex ( _Out_ PULONG  pulSize,
_In_ DEVINST  dnDevInst,
_In_ RESOURCEID  ResourceID,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 6950 of file cfgmgr.c.

6956{
6958 HSTRING_TABLE StringTable = NULL;
6959 LPWSTR lpDevInst;
6960 CONFIGRET ret;
6961
6962 TRACE("CM_Query_Arbitrator_Free_Size_Ex(%p %lu %lx 0x%08lx %p)\n",
6963 pulSize, dnDevInst,ResourceID, ulFlags, hMachine);
6964
6965 if (pulSize == NULL)
6966 return CR_INVALID_POINTER;
6967
6968 if (dnDevInst == 0)
6969 return CR_INVALID_DEVINST;
6970
6971 if (ulFlags & ~CM_QUERY_ARBITRATOR_BITS)
6972 return CR_INVALID_FLAG;
6973
6974 if (hMachine != NULL)
6975 {
6976 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
6977 if (BindingHandle == NULL)
6978 return CR_FAILURE;
6979
6980 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
6981 if (StringTable == 0)
6982 return CR_FAILURE;
6983 }
6984 else
6985 {
6986 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
6987 return CR_FAILURE;
6988 }
6989
6990 lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
6991 if (lpDevInst == NULL)
6992 return CR_INVALID_DEVNODE;
6993
6995 {
6997 pulSize,
6998 lpDevInst,
6999 ResourceID,
7000 ulFlags);
7001 }
7003 {
7005 }
7007
7008 return ret;
7009}
DWORD WINAPI PNP_QueryArbitratorFreeSize(handle_t hBinding, DWORD *pulSize, LPWSTR pDeviceID, RESOURCEID ResourceID, DWORD ulFlags)
Definition: rpcserver.c:4682

Referenced by CM_Query_Arbitrator_Free_Size().

◆ CM_Query_Remove_SubTree()

CONFIGRET WINAPI CM_Query_Remove_SubTree ( _In_ DEVINST  dnAncestor,
_In_ ULONG  ulFlags 
)

Definition at line 7019 of file cfgmgr.c.

7022{
7023 TRACE("CM_Query_Remove_SubTree(%lx %lx)\n",
7024 dnAncestor, ulFlags);
7025
7027}

◆ CM_Query_Remove_SubTree_Ex()

CONFIGRET WINAPI CM_Query_Remove_SubTree_Ex ( _In_ DEVINST  dnAncestor,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 7037 of file cfgmgr.c.

7041{
7042 TRACE("CM_Query_Remove_SubTree_Ex(%lx %lx %p)\n",
7043 dnAncestor, ulFlags, hMachine);
7044
7046}

◆ CM_Query_Resource_Conflict_List()

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 
)

Definition at line 7054 of file cfgmgr.c.

7062{
7064 HSTRING_TABLE StringTable = NULL;
7065 PPNP_CONFLICT_LIST pConflictBuffer = NULL;
7066 PCONFLICT_DATA pConflictData = NULL;
7067 ULONG ulBufferLength;
7068 LPWSTR lpDevInst;
7069 CONFIGRET ret;
7070
7071 FIXME("CM_Query_Resource_Conflict_List(%p %lx %lu %p %lu %lx %p)\n",
7072 pclConflictList, dnDevInst, ResourceID, ResourceData,
7073 ResourceLen, ulFlags, hMachine);
7074
7075 if (dnDevInst == 0)
7076 return CR_INVALID_DEVNODE;
7077
7078 if (ulFlags & ~CM_RESDES_WIDTH_BITS)
7079 return CR_INVALID_FLAG;
7080
7081 if (pclConflictList == NULL ||
7082 ResourceData == NULL ||
7083 ResourceLen == 0)
7084 return CR_INVALID_POINTER;
7085
7086 if (ResourceID == 0)
7087 return CR_INVALID_RESOURCEID;
7088
7089 *pclConflictList = 0;
7090
7091 if (hMachine != NULL)
7092 {
7093 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
7094 if (BindingHandle == NULL)
7095 return CR_FAILURE;
7096
7097 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
7098 if (StringTable == 0)
7099 return CR_FAILURE;
7100 }
7101 else
7102 {
7103 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
7104 return CR_FAILURE;
7105 }
7106
7107 lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
7108 if (lpDevInst == NULL)
7109 return CR_INVALID_DEVNODE;
7110
7111 pConflictData = MyMalloc(sizeof(CONFLICT_DATA));
7112 if (pConflictData == NULL)
7113 {
7115 goto done;
7116 }
7117
7118 ulBufferLength = sizeof(PNP_CONFLICT_LIST) +
7119 sizeof(PNP_CONFLICT_STRINGS) +
7120 (sizeof(wchar_t) * 200);
7121 pConflictBuffer = MyMalloc(ulBufferLength);
7122 if (pConflictBuffer == NULL)
7123 {
7125 goto done;
7126 }
7127
7129 {
7131 lpDevInst,
7132 ResourceID,
7133 (PBYTE)ResourceData,
7134 ResourceLen,
7135 (PBYTE)pConflictBuffer,
7136 ulBufferLength,
7137 ulFlags);
7138 }
7140 {
7142 }
7144
7145 if (ret != CR_SUCCESS)
7146 goto done;
7147
7148 pConflictData->ulMagic = CONFLICT_MAGIC;
7149 pConflictData->pConflictList = pConflictBuffer;
7150
7151 *pclConflictList = (CONFLICT_LIST)pConflictData;
7152
7153done:
7154 if (ret != CR_SUCCESS)
7155 {
7156 if (pConflictBuffer != NULL)
7157 MyFree(pConflictBuffer);
7158
7159 if (pConflictData != NULL)
7160 MyFree(pConflictData);
7161 }
7162
7163 return ret;
7164}
DWORD WINAPI PNP_QueryResConfList(handle_t hBinding, LPWSTR pDeviceID, RESOURCEID ResourceID, BYTE *ResourceData, PNP_RPC_BUFFER_SIZE ResourceLen, BYTE *Buffer, PNP_RPC_BUFFER_SIZE BufferLen, DWORD ulFlags)
Definition: rpcserver.c:4637
ULONG_PTR CONFLICT_LIST
Definition: cfgmgr32.h:111
#define CR_INVALID_RESOURCEID
Definition: cfgmgr32.h:855
#define CM_RESDES_WIDTH_BITS
Definition: cfgmgr32.h:402
#define CONFLICT_MAGIC
Definition: cfgmgr.c:117
BYTE * PBYTE
Definition: pedump.c:66
struct _PNP_CONFLICT_LIST PNP_CONFLICT_LIST
ULONG ulMagic
Definition: cfgmgr.c:113
#define wchar_t
Definition: wchar.h:102

◆ CM_Reenumerate_DevNode()

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

Definition at line 7172 of file cfgmgr.c.

7175{
7176 TRACE("CM_Reenumerate_DevNode(%lx %lx)\n",
7177 dnDevInst, ulFlags);
7178
7179 return CM_Reenumerate_DevNode_Ex(dnDevInst, ulFlags, NULL);
7180}
CONFIGRET WINAPI CM_Reenumerate_DevNode_Ex(_In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:7187

◆ CM_Reenumerate_DevNode_Ex()

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

Definition at line 7187 of file cfgmgr.c.

7191{
7193 HSTRING_TABLE StringTable = NULL;
7194 LPWSTR lpDevInst;
7195 CONFIGRET ret;
7196
7197 FIXME("CM_Reenumerate_DevNode_Ex(%lx %lx %p)\n",
7198 dnDevInst, ulFlags, hMachine);
7199
7200 if (dnDevInst == 0)
7201 return CR_INVALID_DEVNODE;
7202
7203 if (ulFlags & ~CM_REENUMERATE_BITS)
7204 return CR_INVALID_FLAG;
7205
7206 if (hMachine != NULL)
7207 {
7208 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
7209 if (BindingHandle == NULL)
7210 return CR_FAILURE;
7211
7212 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
7213 if (StringTable == 0)
7214 return CR_FAILURE;
7215 }
7216 else
7217 {
7218 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
7219 return CR_FAILURE;
7220 }
7221
7222 lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
7223 if (lpDevInst == NULL)
7224 return CR_INVALID_DEVNODE;
7225
7227 {
7229 PNP_DEVINST_REENUMERATE,
7230 ulFlags,
7231 lpDevInst,
7232 NULL);
7233 }
7235 {
7237 }
7239
7240 return ret;
7241}
#define CM_REENUMERATE_BITS
Definition: cfgmgr32.h:793

Referenced by CM_Reenumerate_DevNode().

◆ CM_Register_Device_Driver()

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

Definition at line 7249 of file cfgmgr.c.

7252{
7253 TRACE("CM_Register_Device_Driver(%lx 0x%08lx)\n",
7254 dnDevInst, ulFlags);
7255
7256 return CM_Register_Device_Driver_Ex(dnDevInst, ulFlags, NULL);
7257}
CONFIGRET WINAPI CM_Register_Device_Driver_Ex(_In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:7265

◆ CM_Register_Device_Driver_Ex()

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

Definition at line 7265 of file cfgmgr.c.

7269{
7271 HSTRING_TABLE StringTable = NULL;
7272 LPWSTR lpDevInst;
7273 CONFIGRET ret;
7274
7275 TRACE("CM_Register_Device_Driver_Ex(%lx 0x%08lx %p)\n",
7276 dnDevInst, ulFlags, hMachine);
7277
7278 if (dnDevInst == 0)
7279 return CR_INVALID_DEVNODE;
7280
7281 if (ulFlags & ~CM_REGISTER_DEVICE_DRIVER_BITS)
7282 return CR_INVALID_FLAG;
7283
7284 if (hMachine != NULL)
7285 {
7286 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
7287 if (BindingHandle == NULL)
7288 return CR_FAILURE;
7289
7290 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
7291 if (StringTable == 0)
7292 return CR_FAILURE;
7293 }
7294 else
7295 {
7296 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
7297 return CR_FAILURE;
7298 }
7299
7300 lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
7301 if (lpDevInst == NULL)
7302 return CR_INVALID_DEVNODE;
7303
7305 {
7307 lpDevInst,
7308 ulFlags);
7309 }
7311 {
7313 }
7315
7316 return ret;
7317}
DWORD WINAPI PNP_RegisterDriver(handle_t hBinding, LPWSTR pszDeviceID, DWORD ulFlags)
Definition: rpcserver.c:3737
#define CM_REGISTER_DEVICE_DRIVER_BITS
Definition: cfgmgr32.h:798

Referenced by CM_Register_Device_Driver().

◆ CM_Register_Device_Interface_ExA()

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 
)

Definition at line 7371 of file cfgmgr.c.

7379{
7380 LPWSTR pszReferenceW = NULL;
7381 LPWSTR pszDeviceInterfaceW;
7382 ULONG ulLength;
7383 CONFIGRET ret;
7384
7385 TRACE("CM_Register_Device_Interface_ExA(%lx %s %s %p %p %lx %p)\n",
7386 dnDevInst, debugstr_guid(InterfaceClassGuid), debugstr_a(pszReference),
7387 pszDeviceInterface, pulLength, ulFlags, hMachine);
7388
7389 if (pulLength == NULL || pszDeviceInterface == NULL)
7390 return CR_INVALID_POINTER;
7391
7392 if (pszReference != NULL)
7393 {
7394 if (pSetupCaptureAndConvertAnsiArg(pszReference, &pszReferenceW))
7395 return CR_INVALID_DATA;
7396 }
7397
7398 ulLength = *pulLength;
7399
7400 pszDeviceInterfaceW = HeapAlloc(GetProcessHeap(), 0, ulLength * sizeof(WCHAR));
7401 if (pszDeviceInterfaceW == NULL)
7402 {
7404 goto Done;
7405 }
7406
7409 pszReferenceW,
7410 pszDeviceInterfaceW,
7411 &ulLength,
7412 ulFlags,
7413 hMachine);
7414 if (ret == CR_SUCCESS)
7415 {
7417 0,
7418 pszDeviceInterfaceW,
7419 ulLength,
7420 pszDeviceInterface,
7421 *pulLength,
7422 NULL,
7423 NULL) == 0)
7424 ret = CR_FAILURE;
7425 }
7426
7427 *pulLength = ulLength;
7428
7429Done:
7430 if (pszDeviceInterfaceW != NULL)
7431 HeapFree(GetProcessHeap(), 0, pszDeviceInterfaceW);
7432
7433 if (pszReferenceW != NULL)
7434 MyFree(pszReferenceW);
7435
7436 return ret;
7437}
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)
Definition: cfgmgr.c:7445

Referenced by CM_Register_Device_InterfaceA().

◆ CM_Register_Device_Interface_ExW()

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 
)

Definition at line 7445 of file cfgmgr.c.

7453{
7455 HSTRING_TABLE StringTable = NULL;
7456 LPWSTR lpDevInst;
7457 ULONG ulTransferLength;
7458 CONFIGRET ret;
7459
7460 TRACE("CM_Register_Device_Interface_ExW(%lx %s %s %p %p %lx %p)\n",
7461 dnDevInst, debugstr_guid(InterfaceClassGuid), debugstr_w(pszReference),
7462 pszDeviceInterface, pulLength, ulFlags, hMachine);
7463
7464 if (dnDevInst == 0)
7465 return CR_INVALID_DEVNODE;
7466
7467 if (InterfaceClassGuid == NULL ||
7468 pszDeviceInterface == NULL ||
7469 pulLength == NULL)
7470 return CR_INVALID_POINTER;
7471
7472 if (ulFlags != 0)
7473 return CR_INVALID_FLAG;
7474
7475 if (hMachine != NULL)
7476 {
7477 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
7478 if (BindingHandle == NULL)
7479 return CR_FAILURE;
7480
7481 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
7482 if (StringTable == 0)
7483 return CR_FAILURE;
7484 }
7485 else
7486 {
7487 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
7488 return CR_FAILURE;
7489 }
7490
7491 lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
7492 if (lpDevInst == NULL)
7493 return CR_INVALID_DEVNODE;
7494
7495 ulTransferLength = *pulLength;
7496
7498 {
7500 lpDevInst,
7502 (LPWSTR)pszReference,
7503 pszDeviceInterface,
7504 pulLength,
7505 &ulTransferLength,
7506 0);
7507 }
7509 {
7511 }
7513
7514 return ret;
7515}
DWORD WINAPI PNP_RegisterDeviceClassAssociation(handle_t hBinding, LPWSTR pszDeviceID, GUID *InterfaceGuid, LPWSTR pszReference, LPWSTR pszSymLink, PNP_RPC_STRING_LEN *pulLength, PNP_RPC_STRING_LEN *pulTransferLen, DWORD ulFlags)
Definition: rpcserver.c:2699

Referenced by CM_Register_Device_Interface_ExA(), and CM_Register_Device_InterfaceW().

◆ CM_Register_Device_InterfaceA()

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 
)

Definition at line 7325 of file cfgmgr.c.

7332{
7333 TRACE("CM_Register_Device_InterfaceA(%lx %s %s %p %p %lx)\n",
7335 pszReference, pszDeviceInterface, pulLength, ulFlags);
7336
7338 pszReference, pszDeviceInterface,
7339 pulLength, ulFlags, NULL);
7340}
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)
Definition: cfgmgr.c:7371

◆ CM_Register_Device_InterfaceW()

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 
)

Definition at line 7348 of file cfgmgr.c.

7355{
7356 TRACE("CM_Register_Device_InterfaceW(%lx %s %s %p %p %lx)\n",
7358 debugstr_w(pszReference), pszDeviceInterface, pulLength, ulFlags);
7359
7361 pszReference, pszDeviceInterface,
7362 pulLength, ulFlags, NULL);
7363}

◆ CM_Remove_SubTree()

CONFIGRET WINAPI CM_Remove_SubTree ( _In_ DEVINST  dnAncestor,
_In_ ULONG  ulFlags 
)

Definition at line 7525 of file cfgmgr.c.

7528{
7529 TRACE("CM_Remove_SubTree(%lx %lx)\n",
7530 dnAncestor, ulFlags);
7531
7533}

◆ CM_Remove_SubTree_Ex()

CONFIGRET WINAPI CM_Remove_SubTree_Ex ( _In_ DEVINST  dnAncestor,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 7543 of file cfgmgr.c.

7547{
7548 TRACE("CM_Remove_SubTree_Ex(%lx %lx %p)\n",
7549 dnAncestor, ulFlags, hMachine);
7550
7552}

◆ CM_Request_Device_Eject_ExA()

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 
)

Definition at line 7600 of file cfgmgr.c.

7607{
7608 LPWSTR lpLocalVetoName = NULL;
7609 CONFIGRET ret;
7610
7611 TRACE("CM_Request_Device_Eject_ExA(%lx %p %p %lu %lx %p)\n",
7612 dnDevInst, pVetoType, pszVetoName, ulNameLength, ulFlags, hMachine);
7613
7614 if (ulNameLength != 0)
7615 {
7616 if (pszVetoName == NULL)
7617 return CR_INVALID_POINTER;
7618
7619 lpLocalVetoName = HeapAlloc(GetProcessHeap(), 0, ulNameLength * sizeof(WCHAR));
7620 if (lpLocalVetoName == NULL)
7621 return CR_OUT_OF_MEMORY;
7622 }
7623
7624 ret = CM_Request_Device_Eject_ExW(dnDevInst, pVetoType, lpLocalVetoName,
7625 ulNameLength, ulFlags, hMachine);
7626 if (ret == CR_REMOVE_VETOED && ulNameLength != 0)
7627 {
7629 0,
7630 lpLocalVetoName,
7631 ulNameLength,
7632 pszVetoName,
7633 ulNameLength,
7634 NULL,
7635 NULL) == 0)
7636 ret = CR_FAILURE;
7637 }
7638
7639 HeapFree(GetProcessHeap(), 0, lpLocalVetoName);
7640
7641 return ret;
7642}
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)
Definition: cfgmgr.c:7650

Referenced by CM_Request_Device_EjectA().

◆ CM_Request_Device_Eject_ExW()

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 
)

Definition at line 7650 of file cfgmgr.c.

7657{
7659 HSTRING_TABLE StringTable = NULL;
7660 LPWSTR lpDevInst;
7661 CONFIGRET ret;
7662
7663 TRACE("CM_Request_Device_Eject_ExW(%lx %p %p %lu %lx %p)\n",
7664 dnDevInst, pVetoType, pszVetoName, ulNameLength, ulFlags, hMachine);
7665
7666 if (dnDevInst == 0)
7667 return CR_INVALID_DEVNODE;
7668
7669 if (ulFlags != 0)
7670 return CR_INVALID_FLAG;
7671
7672 if (pszVetoName == NULL && ulNameLength != 0)
7673 return CR_INVALID_POINTER;
7674
7675 /* Windows 2003 SP2 ignores pszVetoName when ulNameLength is zero
7676 * and behaves like when pszVetoName is NULL */
7677 if (ulNameLength == 0)
7678 pszVetoName = NULL;
7679
7680 if (hMachine != NULL)
7681 {
7682 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
7683 if (BindingHandle == NULL)
7684 return CR_FAILURE;
7685
7686 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
7687 if (StringTable == 0)
7688 return CR_FAILURE;
7689 }
7690 else
7691 {
7692 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
7693 return CR_FAILURE;
7694 }
7695
7696 lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
7697 if (lpDevInst == NULL)
7698 return CR_INVALID_DEVNODE;
7699
7701 {
7703 lpDevInst,
7704 pVetoType,
7705 pszVetoName,
7706 ulNameLength,
7707 ulFlags);
7708 }
7710 {
7712 }
7714
7715 return ret;
7716}
DWORD WINAPI PNP_RequestDeviceEject(handle_t hBinding, LPWSTR pszDeviceID, PPNP_VETO_TYPE pVetoType, LPWSTR pszVetoName, DWORD ulNameLength, DWORD ulFlags)
Definition: rpcserver.c:3809

Referenced by CM_Request_Device_Eject_ExA(), and CM_Request_Device_EjectW().

◆ CM_Request_Device_EjectA()

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 
)

Definition at line 7560 of file cfgmgr.c.

7566{
7567 TRACE("CM_Request_Device_EjectA(%lx %p %p %lu %lx)\n",
7568 dnDevInst, pVetoType, pszVetoName, ulNameLength, ulFlags);
7569
7570 return CM_Request_Device_Eject_ExA(dnDevInst, pVetoType, pszVetoName,
7571 ulNameLength, ulFlags, NULL);
7572}
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)
Definition: cfgmgr.c:7600

◆ CM_Request_Device_EjectW()

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 
)

Definition at line 7580 of file cfgmgr.c.

7586{
7587 TRACE("CM_Request_Device_EjectW(%lx %p %p %lu %lx)\n",
7588 dnDevInst, pVetoType, pszVetoName, ulNameLength, ulFlags);
7589
7590 return CM_Request_Device_Eject_ExW(dnDevInst, pVetoType, pszVetoName,
7591 ulNameLength, ulFlags, NULL);
7592}

Referenced by SafeRemoveDevice().

◆ CM_Request_Eject_PC()

CONFIGRET WINAPI CM_Request_Eject_PC ( VOID  )

Definition at line 7724 of file cfgmgr.c.

7725{
7726 TRACE("CM_Request_Eject_PC()\n");
7727
7729}
CONFIGRET WINAPI CM_Request_Eject_PC_Ex(_In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:7737

◆ CM_Request_Eject_PC_Ex()

CONFIGRET WINAPI CM_Request_Eject_PC_Ex ( _In_opt_ HMACHINE  hMachine)

Definition at line 7737 of file cfgmgr.c.

7739{
7741 CONFIGRET ret;
7742
7743 TRACE("CM_Request_Eject_PC_Ex(%p)\n", hMachine);
7744
7745 if (hMachine != NULL)
7746 {
7747 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
7748 if (BindingHandle == NULL)
7749 return CR_FAILURE;
7750 }
7751 else
7752 {
7754 return CR_FAILURE;
7755 }
7756
7758 {
7760 }
7762 {
7764 }
7766
7767 return ret;
7768}
DWORD WINAPI PNP_RequestEjectPC(handle_t hBinding)
Definition: rpcserver.c:3913

Referenced by CM_Request_Eject_PC().

◆ CM_Run_Detection()

CONFIGRET WINAPI CM_Run_Detection ( _In_ ULONG  ulFlags)

Definition at line 7776 of file cfgmgr.c.

7778{
7779 TRACE("CM_Run_Detection(%lx)\n", ulFlags);
7780
7781 return CM_Run_Detection_Ex(ulFlags, NULL);
7782}
CONFIGRET WINAPI CM_Run_Detection_Ex(_In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:7790

◆ CM_Run_Detection_Ex()

CONFIGRET WINAPI CM_Run_Detection_Ex ( _In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 7790 of file cfgmgr.c.

7793{
7795 CONFIGRET ret;
7796
7797 TRACE("CM_Run_Detection_Ex(%lx %p)\n",
7798 ulFlags, hMachine);
7799
7800 if (!pSetupIsUserAdmin())
7801 return CR_ACCESS_DENIED;
7802
7803 if (ulFlags & ~CM_DETECT_BITS)
7804 return CR_INVALID_FLAG;
7805
7806 if (hMachine != NULL)
7807 {
7808 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
7809 if (BindingHandle == NULL)
7810 return CR_FAILURE;
7811 }
7812 else
7813 {
7815 return CR_FAILURE;
7816 }
7817
7819 {
7821 ulFlags);
7822 }
7824 {
7826 }
7828
7829 return ret;
7830}
CONFIGRET WINAPI PNP_RunDetection(handle_t hBinding, DWORD ulFlags)
Definition: rpcserver.c:4699
#define CM_DETECT_BITS
Definition: cfgmgr32.h:646

Referenced by CM_Run_Detection().

◆ CM_Set_Class_Registry_PropertyA()

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 
)

Definition at line 7838 of file cfgmgr.c.

7845{
7846 FIXME("CM_Set_Class_Registry_PropertyA(%p %lx %p %lu %lx %p)\n",
7847 ClassGuid, ulProperty, Buffer, ulLength, ulFlags, hMachine);
7848
7850}

◆ CM_Set_Class_Registry_PropertyW()

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 
)

Definition at line 7858 of file cfgmgr.c.

7865{
7866 FIXME("CM_Set_Class_Registry_PropertyW(%p %lx %p %lu %lx %p)\n",
7867 ClassGuid, ulProperty, Buffer, ulLength, ulFlags, hMachine);
7868
7870}

◆ CM_Set_DevNode_Problem()

CONFIGRET WINAPI CM_Set_DevNode_Problem ( _In_ DEVINST  dnDevInst,
_In_ ULONG  ulProblem,
_In_ ULONG  ulFlags 
)

Definition at line 7878 of file cfgmgr.c.

7882{
7883 TRACE("CM_Set_DevNode_Problem(%lx %lx %lx)\n",
7884 dnDevInst, ulProblem, ulFlags);
7885
7886 return CM_Set_DevNode_Problem_Ex(dnDevInst, ulProblem, ulFlags, NULL);
7887}
CONFIGRET WINAPI CM_Set_DevNode_Problem_Ex(_In_ DEVINST dnDevInst, _In_ ULONG ulProblem, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:7895

Referenced by SetFailedInstall().

◆ CM_Set_DevNode_Problem_Ex()

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

Definition at line 7895 of file cfgmgr.c.

7900{
7902 HSTRING_TABLE StringTable = NULL;
7903 LPWSTR lpDevInst;
7904 CONFIGRET ret;
7905
7906 TRACE("CM_Set_DevNode_Problem_Ex(%lx %lx %lx %p)\n",
7907 dnDevInst, ulProblem, ulFlags, hMachine);
7908
7909 if (dnDevInst == 0)
7910 return CR_INVALID_DEVNODE;
7911
7912 if (ulFlags & ~CM_SET_DEVNODE_PROBLEM_BITS)
7913 return CR_INVALID_FLAG;
7914
7915 if (hMachine != NULL)
7916 {
7917 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
7918 if (BindingHandle == NULL)
7919 return CR_FAILURE;
7920
7921 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
7922 if (StringTable == 0)
7923 return CR_FAILURE;
7924 }
7925 else
7926 {
7927 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
7928 return CR_FAILURE;
7929 }
7930
7931 lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
7932 if (lpDevInst == NULL)
7933 return CR_INVALID_DEVNODE;
7934
7936 {
7938 lpDevInst,
7939 ulProblem,
7940 ulFlags);
7941 }
7943 {
7945 }
7947
7948 return ret;
7949}
DWORD WINAPI PNP_SetDeviceProblem(handle_t hBinding, LPWSTR pDeviceID, DWORD ulProblem, DWORD ulFlags)
Definition: rpcserver.c:3492
#define CM_SET_DEVNODE_PROBLEM_BITS
Definition: cfgmgr32.h:808

Referenced by CM_Set_DevNode_Problem().

◆ CM_Set_DevNode_Registry_Property_ExA()

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 
)

Definition at line 7999 of file cfgmgr.c.

8006{
8009 ULONG ulType;
8010
8011 FIXME("CM_Set_DevNode_Registry_Property_ExA(%lx %lu %p %lx %lx %p)\n",
8012 dnDevInst, ulProperty, Buffer, ulLength, ulFlags, hMachine);
8013
8014 if (Buffer == NULL && ulLength != 0)
8015 return CR_INVALID_POINTER;
8016
8017 if (ulProperty < CM_DRP_MIN || ulProperty > CM_DRP_MAX)
8018 return CR_INVALID_PROPERTY;
8019
8020 if (Buffer == NULL)
8021 {
8023 ulProperty,
8024 NULL,
8025 0,
8026 ulFlags,
8027 hMachine);
8028 }
8029 else
8030 {
8031 /* Get property type */
8032 ulType = GetRegistryPropertyType(ulProperty);
8033
8034 /* Allocate buffer if needed */
8035 if (ulType == REG_SZ ||
8037 {
8038 lpBuffer = MyMalloc(ulLength * sizeof(WCHAR));
8039 if (lpBuffer == NULL)
8040 {
8042 }
8043 else
8044 {
8046 ulLength, lpBuffer, ulLength))
8047 {
8049 ret = CR_FAILURE;
8050 }
8051 else
8052 {
8054 ulProperty,
8055 lpBuffer,
8056 ulLength * sizeof(WCHAR),
8057 ulFlags,
8058 hMachine);
8060 }
8061 }
8062 }
8063 else
8064 {
8066 ulProperty,
8067 Buffer,
8068 ulLength,
8069 ulFlags,
8070 hMachine);
8071 }
8072
8074 }
8075
8076 return ret;
8077}
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)
Definition: cfgmgr.c:8085
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:175
#define MultiByteToWideChar
Definition: compat.h:110

Referenced by CM_Set_DevNode_Registry_PropertyA().

◆ CM_Set_DevNode_Registry_Property_ExW()

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 
)

Definition at line 8085 of file cfgmgr.c.

8092{
8094 HSTRING_TABLE StringTable = NULL;
8095 LPWSTR lpDevInst;
8096 ULONG ulType;
8097 CONFIGRET ret;
8098
8099 TRACE("CM_Set_DevNode_Registry_Property_ExW(%lx %lu %p %lx %lx %p)\n",
8100 dnDevInst, ulProperty, Buffer, ulLength, ulFlags, hMachine);
8101
8102 if (dnDevInst == 0)
8103 return CR_INVALID_DEVNODE;
8104
8105 if (ulProperty < CM_DRP_MIN || ulProperty > CM_DRP_MAX)
8106 return CR_INVALID_PROPERTY;
8107
8108 if (Buffer != NULL && ulLength == 0)
8109 return CR_INVALID_POINTER;
8110
8111 if (ulFlags != 0)
8112 return CR_INVALID_FLAG;
8113
8114 if (hMachine != NULL)
8115 {
8116 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
8117 if (BindingHandle == NULL)
8118 return CR_FAILURE;
8119
8120 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
8121 if (StringTable == 0)
8122 return CR_FAILURE;
8123 }
8124 else
8125 {
8126 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
8127 return CR_FAILURE;
8128 }
8129
8130 lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
8131 if (lpDevInst == NULL)
8132 return CR_INVALID_DEVNODE;
8133
8134 /* Get property type */
8135 ulType = GetRegistryPropertyType(ulProperty);
8136
8138 {
8140 lpDevInst,
8141 ulProperty,
8142 ulType,
8143 (BYTE *)Buffer,
8144 ulLength,
8145 ulFlags);
8146 }
8148 {
8150 }
8152
8153 return ret;
8154}
DWORD WINAPI PNP_SetDeviceRegProp(handle_t hBinding, LPWSTR pDeviceId, DWORD ulProperty, DWORD ulDataType, BYTE *Buffer, PNP_PROP_SIZE ulLength, DWORD ulFlags)
Definition: rpcserver.c:2115
unsigned char BYTE
Definition: xxhash.c:193

Referenced by CM_Set_DevNode_Registry_Property_ExA(), and CM_Set_DevNode_Registry_PropertyW().

◆ CM_Set_DevNode_Registry_PropertyA()

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 
)

Definition at line 7957 of file cfgmgr.c.

7963{
7964 TRACE("CM_Set_DevNode_Registry_PropertyA(%lx %lu %p %lx %lx)\n",
7965 dnDevInst, ulProperty, Buffer, ulLength, ulFlags);
7966
7967 return CM_Set_DevNode_Registry_Property_ExA(dnDevInst, ulProperty,
7968 Buffer, ulLength,
7969 ulFlags, NULL);
7970}
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)
Definition: cfgmgr.c:7999

◆ CM_Set_DevNode_Registry_PropertyW()

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 
)

Definition at line 7978 of file cfgmgr.c.

7984{
7985 TRACE("CM_Set_DevNode_Registry_PropertyW(%lx %lu %p %lx %lx)\n",
7986 dnDevInst, ulProperty, Buffer, ulLength, ulFlags);
7987
7988 return CM_Set_DevNode_Registry_Property_ExW(dnDevInst, ulProperty,
7989 Buffer, ulLength,
7990 ulFlags, NULL);
7991}

◆ CM_Set_HW_Prof()

CONFIGRET WINAPI CM_Set_HW_Prof ( _In_ ULONG  ulHardwareProfile,
_In_ ULONG  ulFlags 
)

Definition at line 8162 of file cfgmgr.c.

8165{
8166 TRACE("CM_Set_HW_Prof(%lu %lx)\n",
8167 ulHardwareProfile, ulFlags);
8168
8169 return CM_Set_HW_Prof_Ex(ulHardwareProfile, ulFlags, NULL);
8170}
CONFIGRET WINAPI CM_Set_HW_Prof_Ex(_In_ ULONG ulHardwareProfile, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:8178

◆ CM_Set_HW_Prof_Ex()

CONFIGRET WINAPI CM_Set_HW_Prof_Ex ( _In_ ULONG  ulHardwareProfile,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 8178 of file cfgmgr.c.

8182{
8184 CONFIGRET ret;
8185
8186 TRACE("CM_Set_HW_Prof_Ex(%lu %lx %p)\n",
8187 ulHardwareProfile, ulFlags, hMachine);
8188
8189 if (!pSetupIsUserAdmin())
8190 return CR_ACCESS_DENIED;
8191
8192 if (ulFlags != 0)
8193 return CR_INVALID_FLAG;
8194
8195 if (hMachine != NULL)
8196 {
8197 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
8198 if (BindingHandle == NULL)
8199 return CR_FAILURE;
8200 }
8201 else
8202 {
8204 return CR_FAILURE;
8205 }
8206
8208 {
8209 ret = PNP_SetHwProf(BindingHandle, ulHardwareProfile, ulFlags);
8210 }
8212 {
8214 }
8216
8217 return ret;
8218}
DWORD WINAPI PNP_SetHwProf(handle_t hBinding, DWORD ulHardwareProfile, DWORD ulFlags)
Definition: rpcserver.c:4655

Referenced by CM_Set_HW_Prof().

◆ CM_Set_HW_Prof_Flags_ExA()

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 
)

Definition at line 8264 of file cfgmgr.c.

8270{
8271 DEVINSTID_W pszDevIdW = NULL;
8273
8274 TRACE("CM_Set_HW_Prof_Flags_ExA(%s %lu %lu %lx %p)\n",
8275 debugstr_a(szDevInstName), ulConfig, ulValue, ulFlags, hMachine);
8276
8277 if (szDevInstName != NULL)
8278 {
8279 if (pSetupCaptureAndConvertAnsiArg(szDevInstName, &pszDevIdW))
8280 return CR_INVALID_DEVICE_ID;
8281 }
8282
8283 ret = CM_Set_HW_Prof_Flags_ExW(pszDevIdW, ulConfig, ulValue,
8284 ulFlags, hMachine);
8285
8286 if (pszDevIdW != NULL)
8287 MyFree(pszDevIdW);
8288
8289 return ret;
8290}
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)
Definition: cfgmgr.c:8298

Referenced by CM_Set_HW_Prof_FlagsA().

◆ CM_Set_HW_Prof_Flags_ExW()

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 
)

Definition at line 8298 of file cfgmgr.c.

8304{
8306 CONFIGRET ret;
8307
8308 FIXME("CM_Set_HW_Prof_Flags_ExW(%s %lu %lu %lx %p)\n",
8309 debugstr_w(szDevInstName), ulConfig, ulValue, ulFlags, hMachine);
8310
8311 if (szDevInstName == NULL)
8312 return CR_INVALID_POINTER;
8313
8314 if (ulFlags & ~ CM_SET_HW_PROF_FLAGS_BITS)
8315 return CR_INVALID_FLAG;
8316
8317 /* FIXME: Check whether szDevInstName is valid */
8318
8319 if (hMachine != NULL)
8320 {
8321 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
8322 if (BindingHandle == NULL)
8323 return CR_FAILURE;
8324 }
8325 else
8326 {
8328 return CR_FAILURE;
8329 }
8330
8332 {
8333 ret = PNP_HwProfFlags(BindingHandle, PNP_SET_HWPROFFLAGS, szDevInstName,
8334 ulConfig, &ulValue, NULL, NULL, 0, 0);
8335 }
8337 {
8339 }
8341
8342 return ret;
8343}
#define CM_SET_HW_PROF_FLAGS_BITS
Definition: cfgmgr32.h:816

Referenced by CM_Set_HW_Prof_Flags_ExA(), and CM_Set_HW_Prof_FlagsW().

◆ CM_Set_HW_Prof_FlagsA()

CONFIGRET WINAPI CM_Set_HW_Prof_FlagsA ( _In_ DEVINSTID_A  szDevInstName,
_In_ ULONG  ulConfig,
_In_ ULONG  ulValue,
_In_ ULONG  ulFlags 
)

Definition at line 8226 of file cfgmgr.c.

8231{
8232 TRACE("CM_Set_HW_Prof_FlagsA(%s %lu %lu %lx)\n",
8233 debugstr_a(szDevInstName), ulConfig, ulValue, ulFlags);
8234
8235 return CM_Set_HW_Prof_Flags_ExA(szDevInstName, ulConfig, ulValue,
8236 ulFlags, NULL);
8237}
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)
Definition: cfgmgr.c:8264

◆ CM_Set_HW_Prof_FlagsW()

CONFIGRET WINAPI CM_Set_HW_Prof_FlagsW ( _In_ DEVINSTID_W  szDevInstName,
_In_ ULONG  ulConfig,
_In_ ULONG  ulValue,
_In_ ULONG  ulFlags 
)

Definition at line 8245 of file cfgmgr.c.

8250{
8251 TRACE("CM_Set_HW_Prof_FlagsW(%s %lu %lu %lx)\n",
8252 debugstr_w(szDevInstName), ulConfig, ulValue, ulFlags);
8253
8254 return CM_Set_HW_Prof_Flags_ExW(szDevInstName, ulConfig, ulValue,
8255 ulFlags, NULL);
8256}

◆ CM_Setup_DevNode()

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

Definition at line 8351 of file cfgmgr.c.

8354{
8355 TRACE("CM_Setup_DevNode(%lx %lx)\n",
8356 dnDevInst, ulFlags);
8357
8358 return CM_Setup_DevNode_Ex(dnDevInst, ulFlags, NULL);
8359}
CONFIGRET WINAPI CM_Setup_DevNode_Ex(_In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:8367

◆ CM_Setup_DevNode_Ex()

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

Definition at line 8367 of file cfgmgr.c.

8371{
8373 HSTRING_TABLE StringTable = NULL;
8374 LPWSTR lpDevInst;
8375 CONFIGRET ret;
8376
8377 FIXME("CM_Setup_DevNode_Ex(%lx %lx %p)\n",
8378 dnDevInst, ulFlags, hMachine);
8379
8380 if (!pSetupIsUserAdmin())
8381 return CR_ACCESS_DENIED;
8382
8383 if (dnDevInst == 0)
8384 return CR_INVALID_DEVNODE;
8385
8386 if (ulFlags & ~CM_SETUP_BITS)
8387 return CR_INVALID_FLAG;
8388
8389 if (hMachine != NULL)
8390 {
8391 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
8392 if (BindingHandle == NULL)
8393 return CR_FAILURE;
8394
8395 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
8396 if (StringTable == 0)
8397 return CR_FAILURE;
8398 }
8399 else
8400 {
8401 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
8402 return CR_FAILURE;
8403 }
8404
8405 lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
8406 if (lpDevInst == NULL)
8407 return CR_INVALID_DEVNODE;
8408
8410 {
8412 PNP_DEVINST_SETUP,
8413 ulFlags,
8414 lpDevInst,
8415 NULL);
8416 }
8418 {
8420 }
8422
8423 return ret;
8424}
#define CM_SETUP_BITS
Definition: cfgmgr32.h:828

Referenced by CM_Setup_DevNode().

◆ CM_Test_Range_Available()

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

Definition at line 8432 of file cfgmgr.c.

8437{
8438 PINTERNAL_RANGE_LIST pRangeList;
8439 PINTERNAL_RANGE pRange;
8440 PLIST_ENTRY ListEntry;
8442
8443 FIXME("CM_Test_Range_Available(%I64u %I64u %p %lx)\n",
8444 ullStartValue, ullEndValue, rlh, ulFlags);
8445
8446 pRangeList = (PINTERNAL_RANGE_LIST)rlh;
8447
8448 if (!IsValidRangeList(pRangeList))
8449 return CR_INVALID_RANGE_LIST;
8450
8451 if (ulFlags != 0)
8452 return CR_INVALID_FLAG;
8453
8454 if (ullStartValue > ullEndValue)
8455 return CR_INVALID_RANGE;
8456
8457 /* Lock the range list */
8458 WaitForSingleObject(pRangeList->hMutex, INFINITE);
8459
8460 /* Check the ranges */
8461 ListEntry = &pRangeList->ListHead;
8462 while (ListEntry->Flink == &pRangeList->ListHead)
8463 {
8464 pRange = CONTAINING_RECORD(ListEntry, INTERNAL_RANGE, ListEntry);
8465
8466 /* Check if the start value is within the current range */
8467 if ((ullStartValue >= pRange->ullStart) && (ullStartValue <= pRange->ullEnd))
8468 {
8469 ret = CR_FAILURE;
8470 break;
8471 }
8472
8473 /* Check if the end value is within the current range */
8474 if ((ullEndValue >= pRange->ullStart) && (ullEndValue <= pRange->ullEnd))
8475 {
8476 ret = CR_FAILURE;
8477 break;
8478 }
8479
8480 /* Check if the current range lies inside of the start-end interval */
8481 if ((ullStartValue <= pRange->ullStart) && (ullEndValue >= pRange->ullEnd))
8482 {
8483 ret = CR_FAILURE;
8484 break;
8485 }
8486
8487 ListEntry = ListEntry->Flink;
8488 }
8489
8490 /* Unlock the range list */
8491 ReleaseMutex(pRangeList->hMutex);
8492
8493 return ret;
8494}

◆ CM_Uninstall_DevNode()

CONFIGRET WINAPI CM_Uninstall_DevNode ( _In_ DEVINST  dnPhantom,
_In_ ULONG  ulFlags 
)

Definition at line 8502 of file cfgmgr.c.

8505{
8506 TRACE("CM_Uninstall_DevNode(%lx %lx)\n",
8507 dnPhantom, ulFlags);
8508
8509 return CM_Uninstall_DevNode_Ex(dnPhantom, ulFlags, NULL);
8510}
CONFIGRET WINAPI CM_Uninstall_DevNode_Ex(_In_ DEVINST dnPhantom, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:8518

◆ CM_Uninstall_DevNode_Ex()

CONFIGRET WINAPI CM_Uninstall_DevNode_Ex ( _In_ DEVINST  dnPhantom,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 8518 of file cfgmgr.c.

8522{
8524 HSTRING_TABLE StringTable = NULL;
8525 LPWSTR lpDevInst;
8526 CONFIGRET ret;
8527
8528 TRACE("CM_Uninstall_DevNode_Ex(%lx %lx %p)\n",
8529 dnPhantom, ulFlags, hMachine);
8530
8531 if (dnPhantom == 0)
8532 return CR_INVALID_DEVNODE;
8533
8534 if (ulFlags != 0)
8535 return CR_INVALID_FLAG;
8536
8537 if (hMachine != NULL)
8538 {
8539 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
8540 if (BindingHandle == NULL)
8541 return CR_FAILURE;
8542
8543 StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
8544 if (StringTable == 0)
8545 return CR_FAILURE;
8546 }
8547 else
8548 {
8549 if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
8550 return CR_FAILURE;
8551 }
8552
8553 lpDevInst = pSetupStringTableStringFromId(StringTable, dnPhantom);
8554 if (lpDevInst == NULL)
8555 return CR_INVALID_DEVNODE;
8556
8558 {
8560 lpDevInst,
8561 ulFlags);
8562 }
8564 {
8566 }
8568
8569 return ret;
8570}
DWORD WINAPI PNP_UninstallDevInst(handle_t hBinding, LPWSTR pDeviceID, DWORD ulFlags)
Definition: rpcserver.c:3575

Referenced by CM_Uninstall_DevNode().

◆ CM_Unregister_Device_Interface_ExA()

CONFIGRET WINAPI CM_Unregister_Device_Interface_ExA ( _In_ LPCSTR  pszDeviceInterface,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 8612 of file cfgmgr.c.

8616{
8617 LPWSTR pszDeviceInterfaceW = NULL;
8618 CONFIGRET ret;
8619
8620 TRACE("CM_Unregister_Device_Interface_ExA(%s %lx %p)\n",
8621 debugstr_a(pszDeviceInterface), ulFlags, hMachine);
8622
8623 if (pszDeviceInterface == NULL)
8624 return CR_INVALID_POINTER;
8625
8626 if (pSetupCaptureAndConvertAnsiArg(pszDeviceInterface, &pszDeviceInterfaceW))
8627 return CR_INVALID_DATA;
8628
8629 ret = CM_Unregister_Device_Interface_ExW(pszDeviceInterfaceW,
8630 ulFlags, hMachine);
8631
8632 if (pszDeviceInterfaceW != NULL)
8633 MyFree(pszDeviceInterfaceW);
8634
8635 return ret;
8636}
CONFIGRET WINAPI CM_Unregister_Device_Interface_ExW(_In_ LPCWSTR pszDeviceInterface, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:8644

Referenced by CM_Unregister_Device_InterfaceA().

◆ CM_Unregister_Device_Interface_ExW()

CONFIGRET WINAPI CM_Unregister_Device_Interface_ExW ( _In_ LPCWSTR  pszDeviceInterface,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 8644 of file cfgmgr.c.

8648{
8650 CONFIGRET ret;
8651
8652 TRACE("CM_Unregister_Device_Interface_ExW(%s %lx %p)\n",
8653 debugstr_w(pszDeviceInterface), ulFlags, hMachine);
8654
8655 if (pszDeviceInterface == NULL)
8656 return CR_INVALID_POINTER;
8657
8658 if (ulFlags != 0)
8659 return CR_INVALID_FLAG;
8660
8661 if (hMachine != NULL)
8662 {
8663 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
8664 if (BindingHandle == NULL)
8665 return CR_FAILURE;
8666 }
8667 else
8668 {
8670 return CR_FAILURE;
8671 }
8672
8674 {
8676 (LPWSTR)pszDeviceInterface,
8677 ulFlags);
8678 }
8680 {
8682 }
8684
8685 return ret;
8686}
DWORD WINAPI PNP_UnregisterDeviceClassAssociation(handle_t hBinding, LPWSTR pszInterfaceDevice, DWORD ulFlags)
Definition: rpcserver.c:2717

Referenced by CM_Unregister_Device_Interface_ExA(), and CM_Unregister_Device_InterfaceW().

◆ CM_Unregister_Device_InterfaceA()

CONFIGRET WINAPI CM_Unregister_Device_InterfaceA ( _In_ LPCSTR  pszDeviceInterface,
_In_ ULONG  ulFlags 
)

Definition at line 8578 of file cfgmgr.c.

8581{
8582 TRACE("CM_Unregister_Device_InterfaceA(%s %lx)\n",
8583 debugstr_a(pszDeviceInterface), ulFlags);
8584
8585 return CM_Unregister_Device_Interface_ExA(pszDeviceInterface,
8586 ulFlags, NULL);
8587}
CONFIGRET WINAPI CM_Unregister_Device_Interface_ExA(_In_ LPCSTR pszDeviceInterface, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:8612

◆ CM_Unregister_Device_InterfaceW()

CONFIGRET WINAPI CM_Unregister_Device_InterfaceW ( _In_ LPCWSTR  pszDeviceInterface,
_In_ ULONG  ulFlags 
)

Definition at line 8595 of file cfgmgr.c.

8598{
8599 TRACE("CM_Unregister_Device_InterfaceW(%s %lx)\n",
8600 debugstr_w(pszDeviceInterface), ulFlags);
8601
8602 return CM_Unregister_Device_Interface_ExW(pszDeviceInterface,
8603 ulFlags, NULL);
8604}

◆ CMP_GetBlockedDriverInfo()

CONFIGRET WINAPI CMP_GetBlockedDriverInfo ( _Out_opt_ LPWSTR  pszNames,
_Inout_ PULONG  pulLength,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 501 of file cfgmgr.c.

506{
508 ULONG ulTransferLength;
510
511 TRACE("CMP_GetBlockedDriverInfo(%p %p %lx %p)\n",
512 pszNames, pulLength, ulFlags, hMachine);
513
514 if (hMachine != NULL)
515 {
516 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
517 if (BindingHandle == NULL)
518 return CR_FAILURE;
519 }
520 else
521 {
523 return CR_FAILURE;
524 }
525
526 ulTransferLength = *pulLength;
527
529 {
531 (PBYTE)pszNames,
532 &ulTransferLength,
533 pulLength,
534 ulFlags);
535 }
537 {
539 }
541
542 return ret;
543}
DWORD WINAPI PNP_GetBlockedDriverInfo(handle_t hBinding, BYTE *Buffer, PNP_RPC_BUFFER_SIZE *pulTransferLen, PNP_RPC_BUFFER_SIZE *pulLength, DWORD ulFlags)
Definition: rpcserver.c:4940

◆ CMP_GetServerSideDeviceInstallFlags()

CONFIGRET WINAPI CMP_GetServerSideDeviceInstallFlags ( _Out_ PULONG  pulSSDIFlags,
_In_ ULONG  ulFlags,
_In_opt_ HMACHINE  hMachine 
)

Definition at line 551 of file cfgmgr.c.

555{
558
559 TRACE("CMP_GetServerSideDeviceInstallFlags(%p %lx %p)\n",
560 pulSSDIFlags, ulFlags, hMachine);
561
562 if (pulSSDIFlags == NULL)
563 return CR_INVALID_POINTER;
564
565 if (ulFlags != 0)
566 return CR_INVALID_FLAG;
567
568 if (hMachine != NULL)
569 {
570 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
571 if (BindingHandle == NULL)
572 return CR_FAILURE;
573 }
574 else
575 {
577 return CR_FAILURE;
578 }
579
581 {
583 pulSSDIFlags,
584 ulFlags);
585 }
587 {
589 }
591
592 return ret;
593}
DWORD WINAPI PNP_GetServerSideDeviceInstallFlags(handle_t hBinding, DWORD *pulSSDIFlags, DWORD ulFlags)
Definition: rpcserver.c:4955

◆ CMP_Init_Detection()

CONFIGRET WINAPI CMP_Init_Detection ( _In_ ULONG  ulMagic)

Definition at line 601 of file cfgmgr.c.

603{
606
607 TRACE("CMP_Init_Detection(%lu)\n", ulMagic);
608
609 if (ulMagic != CMP_MAGIC)
610 return CR_INVALID_DATA;
611
613 return CR_FAILURE;
614
616 {
618 }
620 {
622 }
624
625 return ret;
626}
DWORD WINAPI PNP_InitDetection(handle_t hBinding)
Definition: rpcserver.c:700
#define CMP_MAGIC
Definition: userinit.c:29

◆ CMP_RegisterNotification()

CONFIGRET WINAPI CMP_RegisterNotification ( _In_ HANDLE  hRecipient,
_In_ LPVOID  lpvNotificationFilter,
_In_ ULONG  ulFlags,
_Out_ PHDEVNOTIFY  phDevNotify 
)

Definition at line 634 of file cfgmgr.c.

639{
641 PNOTIFY_DATA pNotifyData;
642 WCHAR szNameBuffer[256];
643 INT nLength;
644 DWORD ulUnknown9 = 0;
645 DWORD dwError;
647
648 FIXME("CMP_RegisterNotification(%p %p %lu %p)\n",
649 hRecipient, lpvNotificationFilter, ulFlags, phDevNotify);
650
651 if ((hRecipient == NULL) ||
652 (lpvNotificationFilter == NULL) ||
653 (phDevNotify == NULL))
654 return CR_INVALID_POINTER;
655
656 if (ulFlags & ~0x7)
657 return CR_INVALID_FLAG;
658
659 if (((PDEV_BROADCAST_HDR)lpvNotificationFilter)->dbch_size < sizeof(DEV_BROADCAST_HDR))
660 return CR_INVALID_DATA;
661
663 return CR_FAILURE;
664
665 pNotifyData = HeapAlloc(GetProcessHeap(),
667 sizeof(NOTIFY_DATA));
668 if (pNotifyData == NULL)
669 return CR_OUT_OF_MEMORY;
670
671 pNotifyData->ulMagic = NOTIFY_MAGIC;
672 pNotifyData->hNotifyHandle = NULL;
673
674 ZeroMemory(szNameBuffer, sizeof(szNameBuffer));
675
676 if ((ulFlags & DEVICE_NOTIFY_SERVICE_HANDLE) == DEVICE_NOTIFY_WINDOW_HANDLE)
677 {
678 FIXME("Register a window\n");
679
680 nLength = GetWindowTextW((HWND)hRecipient,
681 szNameBuffer,
682 ARRAYSIZE(szNameBuffer));
683 if (nLength == 0)
684 {
685 szNameBuffer[0] = UNICODE_NULL;
686 }
687
688 FIXME("Register window: %S\n", szNameBuffer);
689 }
690 else if ((ulFlags & DEVICE_NOTIFY_SERVICE_HANDLE) == DEVICE_NOTIFY_SERVICE_HANDLE)
691 {
692 FIXME("Register a service\n");
693
694 dwError = I_ScPnPGetServiceName((SERVICE_STATUS_HANDLE)hRecipient,
695 szNameBuffer,
696 ARRAYSIZE(szNameBuffer));
697 if (dwError != ERROR_SUCCESS)
698 {
699 HeapFree(GetProcessHeap(), 0, pNotifyData);
700 return CR_INVALID_DATA;
701 }
702
703 FIXME("Register service: %S\n", szNameBuffer);
704 }
705
707 {
709 (DWORD_PTR)hRecipient,
710 szNameBuffer,
711 (BYTE*)lpvNotificationFilter,
712 ((DEV_BROADCAST_HDR*)lpvNotificationFilter)->dbch_size,
713 ulFlags,
714 &pNotifyData->hNotifyHandle,
716 &ulUnknown9); /* ??? */
717 }
719 {
721 }
723
724 if (ret == CR_SUCCESS)
725 {
726 TRACE("hNotifyHandle: %p\n", pNotifyData->hNotifyHandle);
727 *phDevNotify = (HDEVNOTIFY)pNotifyData;
728 }
729 else
730 {
731 HeapFree(GetProcessHeap(), 0, pNotifyData);
732
733 *phDevNotify = (HDEVNOTIFY)NULL;
734 }
735
736 return ret;
737}
static SERVICE_STATUS_HANDLE(WINAPI *pRegisterServiceCtrlHandlerExA)(LPCSTR
DWORD WINAPI PNP_RegisterNotification(handle_t hBinding, DWORD_PTR hRecipient, LPWSTR pszName, BYTE *pNotificationFilter, DWORD ulNotificationFilterSize, DWORD ulFlags, PNP_NOTIFY_HANDLE *pNotifyHandle, DWORD ulProcessId, DWORD *pulUnknown9)
Definition: rpcserver.c:4710
#define NOTIFY_MAGIC
Definition: cfgmgr.c:91
DWORD WINAPI I_ScPnPGetServiceName(IN SERVICE_STATUS_HANDLE hServiceStatus, OUT LPWSTR lpServiceName, IN DWORD cchServiceName)
Definition: sctrl.c:869
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
ULONG ulMagic
Definition: cfgmgr.c:87
PVOID hNotifyHandle
Definition: cfgmgr.c:88
uint32_t DWORD_PTR
Definition: typedefs.h:65
int32_t INT
Definition: typedefs.h:58
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1384
#define ZeroMemory
Definition: winbase.h:1737
DWORD WINAPI GetCurrentProcessId(void)
Definition: proc.c:1158
_In_ DWORD nLength
Definition: wincon.h:473

◆ CMP_Report_LogOn()

CONFIGRET WINAPI CMP_Report_LogOn ( _In_ DWORD  dwMagic,
_In_ DWORD  dwProcessId 
)

Definition at line 745 of file cfgmgr.c.

748{
751 BOOL bAdmin;
752 DWORD i;
753
754 TRACE("CMP_Report_LogOn(%lu %lu)\n", dwMagic, dwProcessId);
755
756 if (dwMagic != CMP_MAGIC)
757 return CR_INVALID_DATA;
758
760 return CR_FAILURE;
761
762 bAdmin = pSetupIsUserAdmin();
763
764 for (i = 0; i < 30; i++)
765 {
767 {
769 bAdmin,
770 dwProcessId);
771 }
773 {
775 }
777
778 if (ret == CR_SUCCESS)
779 break;
780
781 Sleep(5000);
782 }
783
784 return ret;
785}
DWORD WINAPI PNP_ReportLogOn(handle_t hBinding, BOOL Admin, DWORD ProcessId)
Definition: rpcserver.c:715
unsigned int BOOL
Definition: ntddk_ex.h:94
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790

Referenced by NotifyLogon().

◆ CMP_UnregisterNotification()

CONFIGRET WINAPI CMP_UnregisterNotification ( _In_ HDEVNOTIFY  hDevNotify)

Definition at line 793 of file cfgmgr.c.

795{
797 PNOTIFY_DATA pNotifyData;
799
800 TRACE("CMP_UnregisterNotification(%p)\n", hDevNotify);
801
802 pNotifyData = (PNOTIFY_DATA)hDevNotify;
803
804 if ((pNotifyData == NULL) ||
805 (pNotifyData->ulMagic != NOTIFY_MAGIC))
806 return CR_INVALID_POINTER;
807
809 return CR_FAILURE;
810
812 {
814 &pNotifyData->hNotifyHandle);
815 }
817 {
819 }
821
822 if (ret == CR_SUCCESS)
823 {
824 pNotifyData->hNotifyHandle = NULL;
825 HeapFree(GetProcessHeap(), 0, pNotifyData);
826 }
827
828 return ret;
829}
DWORD WINAPI PNP_UnregisterNotification(handle_t hBinding, PNP_NOTIFY_HANDLE *pNotifyHandle)
Definition: rpcserver.c:4801
struct _NOTIFY_DATA * PNOTIFY_DATA

◆ CMP_WaitNoPendingInstallEvents()

DWORD WINAPI CMP_WaitNoPendingInstallEvents ( _In_ DWORD  dwTimeout)

Definition at line 837 of file cfgmgr.c.

839{
841 DWORD ret;
842
843 TRACE("CMP_WaitNoPendingInstallEvents(%lu)\n", dwTimeout);
844
845 hEvent = OpenEventW(SYNCHRONIZE, FALSE, L"Global\\PnP_No_Pending_Install_Events");
846 if (hEvent == NULL)
847 return WAIT_FAILED;
848
851 return ret;
852}
static HANDLE hEvent
Definition: comm.c:54
#define SYNCHRONIZE
Definition: nt_native.h:61
HANDLE WINAPI DECLSPEC_HOTPATCH OpenEventW(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN LPCWSTR lpName)
Definition: synch.c:682
#define WAIT_FAILED
Definition: winbase.h:439
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD dwTimeout
Definition: wincrypt.h:6081

Referenced by CommonInstall().

◆ CMP_WaitServicesAvailable()

CONFIGRET WINAPI CMP_WaitServicesAvailable ( _In_opt_ HMACHINE  hMachine)

Definition at line 860 of file cfgmgr.c.

862{
866
867 TRACE("CMP_WaitServicesAvailable(%p)\n", hMachine);
868
869 if (hMachine != NULL)
870 {
871 BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
872 if (BindingHandle == NULL)
873 return CR_FAILURE;
874 }
875 else
876 {
878 return CR_FAILURE;
879 }
880
882 {
884 }
886 {
888 }
890
891 return ret;
892}

◆ GetDeviceInstanceKeyPath()

static CONFIGRET GetDeviceInstanceKeyPath ( _In_ RPC_BINDING_HANDLE  BindingHandle,
_In_ PWSTR  pszDeviceInst,
_Out_ PWSTR  pszKeyPath,
_Out_ PWSTR  pszInstancePath,
_In_ ULONG  ulHardwareProfile,
_In_ ULONG  ulFlags 
)
static

Definition at line 235 of file cfgmgr.c.

242{
243 PWSTR pszBuffer = NULL;
244 ULONG ulType = 0;
245 ULONG ulTransferLength, ulLength;
247
248 TRACE("GetDeviceInstanceKeyPath()\n");
249
250 /* Allocate a buffer for the device id */
251 pszBuffer = MyMalloc(300 * sizeof(WCHAR));
252 if (pszBuffer == NULL)
253 {
254 ERR("MyMalloc() failed\n");
255 return CR_OUT_OF_MEMORY;
256 }
257
258 if (ulFlags & CM_REGISTRY_SOFTWARE)
259 {
260 /* Software Key Path */
261
262 ulTransferLength = 300 * sizeof(WCHAR);
263 ulLength = 300 * sizeof(WCHAR);
264
266 {
268 pszDeviceInst,
270 &ulType,
271 (PVOID)pszBuffer,
272 &ulTransferLength,
273 &ulLength,
274 0);
275 }
277 {
279 }
281
282 if (ret != CR_SUCCESS)
283 {
285 {
287 pszDeviceInst,
288 (PVOID)pszBuffer,
289 300);
290 }
292 {
294 }
296
297 if (ret != CR_SUCCESS)
298 {
299 goto done;
300 }
301 }
302
303 TRACE("szBuffer: %S\n", pszBuffer);
304
305 SplitDeviceInstanceId(pszBuffer,
306 pszBuffer,
307 pszInstancePath);
308
309 TRACE("szBuffer: %S\n", pszBuffer);
310
311 if (ulFlags & CM_REGISTRY_CONFIG)
312 {
313 if (ulHardwareProfile == 0)
314 {
315 wsprintfW(pszKeyPath,
316 L"%s\\%s\\%s\\%s",
317 L"System\\CurrentControlSet\\Hardware Profiles",
318 L"Current",
319 L"System\\CurrentControlSet\\Control\\Class",
320 pszBuffer);
321 }
322 else
323 {
324 wsprintfW(pszKeyPath,
325 L"%s\\%04lu\\%s\\%s",
326 L"System\\CurrentControlSet\\Hardware Profiles",
327 ulHardwareProfile,
328 L"System\\CurrentControlSet\\Control\\Class",
329 pszBuffer);
330 }
331 }
332 else
333 {
334 wsprintfW(pszKeyPath,
335 L"%s\\%s",
336 L"System\\CurrentControlSet\\Control\\Class",
337 pszBuffer);
338 }
339 }
340 else
341 {
342 /* Hardware Key Path */
343
344 if (ulFlags & CM_REGISTRY_CONFIG)
345 {
346 SplitDeviceInstanceId(pszDeviceInst,
347 pszBuffer,
348 pszInstancePath);
349
350 if (ulHardwareProfile == 0)
351 {
352 wsprintfW(pszKeyPath,
353 L"%s\\%s\\%s\\%s",
354 L"System\\CurrentControlSet\\Hardware Profiles",
355 L"Current",
356 L"System\\CurrentControlSet\\Enum",
357 pszBuffer);
358 }
359 else
360 {
361 wsprintfW(pszKeyPath,
362 L"%s\\%04lu\\%s\\%s",
363 L"System\\CurrentControlSet\\Hardware Profiles",
364 ulHardwareProfile,
365 L"System\\CurrentControlSet\\Enum",
366 pszBuffer);
367 }
368 }
369 else if (ulFlags & CM_REGISTRY_USER)
370 {
371 wsprintfW(pszKeyPath,
372 L"%s\\%s",
373 L"System\\CurrentControlSet\\Enum",
374 pszDeviceInst);
375
376 wcscpy(pszInstancePath,
377 L"Device Parameters");
378 }
379 else
380 {
381 SplitDeviceInstanceId(pszDeviceInst,
382 pszBuffer,
383 pszInstancePath);
384
385 wsprintfW(pszKeyPath,
386 L"%s\\%s",
387 L"System\\CurrentControlSet\\Enum",
388 pszBuffer);
389 }
390 }
391
392done:
393 if (pszBuffer != NULL)
394 MyFree(pszBuffer);
395
396 return ret;
397}
DWORD WINAPI PNP_GetClassInstance(handle_t hBinding, LPWSTR pDeviceId, LPWSTR pszClassInstance, PNP_RPC_STRING_LEN ulLength)
Definition: rpcserver.c:2257
#define ERR(fmt,...)
Definition: precomp.h:57
#define CM_DRP_DRIVER
Definition: cfgmgr32.h:685
#define CM_REGISTRY_SOFTWARE
Definition: cfgmgr32.h:801
static VOID SplitDeviceInstanceId(_In_ PWSTR pszDeviceInstanceId, _Out_ PWSTR pszDeviceId, _Out_ PWSTR pszInstanceId)
Definition: cfgmgr.c:209
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)

Referenced by CM_Delete_DevNode_Key_Ex(), and CM_Open_DevNode_Key_Ex().

◆ GetRegistryPropertyType()

static ULONG GetRegistryPropertyType ( _In_ ULONG  ulProperty)
static

Definition at line 156 of file cfgmgr.c.

158{
159 switch (ulProperty)
160 {
162 case CM_DRP_SERVICE:
163 case CM_DRP_CLASS:
164 case CM_DRP_CLASSGUID:
165 case CM_DRP_DRIVER:
166 case CM_DRP_MFG:
173 return REG_SZ;
174
179 return REG_MULTI_SZ;
180
183 case CM_DRP_UI_NUMBER:
185 case CM_DRP_BUSNUMBER:
186 case CM_DRP_DEVTYPE:
187 case CM_DRP_EXCLUSIVE:
189 case CM_DRP_ADDRESS:
194 return REG_DWORD;
195
197 case CM_DRP_SECURITY:
199 default:
200 return REG_BINARY;
201 }
202
203 return REG_NONE;
204}
#define CM_DRP_BUSNUMBER
Definition: cfgmgr32.h:703
#define CM_DRP_LOCATION_INFORMATION
Definition: cfgmgr32.h:689
#define CM_DRP_CONFIGFLAGS
Definition: cfgmgr32.h:686
#define CM_DRP_SECURITY_SDS
Definition: cfgmgr32.h:707
#define CM_DRP_REMOVAL_POLICY
Definition: cfgmgr32.h:719
#define CM_DRP_ENUMERATOR_NAME
Definition: cfgmgr32.h:704
#define CM_DRP_REMOVAL_POLICY_HW_DEFAULT
Definition: cfgmgr32.h:720
#define CM_DRP_BUSTYPEGUID
Definition: cfgmgr32.h:701
#define CM_DRP_LOWERFILTERS
Definition: cfgmgr32.h:697
#define CM_DRP_SECURITY
Definition: cfgmgr32.h:705
#define CM_DRP_MFG
Definition: cfgmgr32.h:687
#define CM_DRP_EXCLUSIVE
Definition: cfgmgr32.h:711
#define CM_DRP_REMOVAL_POLICY_OVERRIDE
Definition: cfgmgr32.h:721
#define CM_DRP_CAPABILITIES
Definition: cfgmgr32.h:691
#define CM_DRP_UPPERFILTERS
Definition: cfgmgr32.h:693
#define CM_DRP_CLASSGUID
Definition: cfgmgr32.h:684
#define CM_DRP_COMPATIBLEIDS
Definition: cfgmgr32.h:678
#define CM_DRP_DEVICEDESC
Definition: cfgmgr32.h:676
#define CM_DRP_CLASS
Definition: cfgmgr32.h:683
#define CM_DRP_LEGACYBUSTYPE
Definition: cfgmgr32.h:702
#define CM_DRP_PHYSICAL_DEVICE_OBJECT_NAME
Definition: cfgmgr32.h:690
#define CM_DRP_DEVTYPE
Definition: cfgmgr32.h:709
#define CM_DRP_FRIENDLYNAME
Definition: cfgmgr32.h:688
#define CM_DRP_INSTALL_STATE
Definition: cfgmgr32.h:722
#define CM_DRP_UI_NUMBER
Definition: cfgmgr32.h:692
#define CM_DRP_CHARACTERISTICS
Definition: cfgmgr32.h:713
#define CM_DRP_UI_NUMBER_DESC_FORMAT
Definition: cfgmgr32.h:716
#define CM_DRP_ADDRESS
Definition: cfgmgr32.h:715
#define CM_DRP_DEVICE_POWER_DATA
Definition: cfgmgr32.h:718
#define CM_DRP_HARDWAREID
Definition: cfgmgr32.h:677
#define CM_DRP_SERVICE
Definition: cfgmgr32.h:680
#define REG_BINARY
Definition: nt_native.h:1496
#define REG_DWORD
Definition: sdbapi.c:596

Referenced by CM_Get_Class_Registry_PropertyA(), CM_Set_DevNode_Registry_Property_ExA(), and CM_Set_DevNode_Registry_Property_ExW().

◆ GuidToString()

static BOOL GuidToString ( _In_ LPGUID  Guid,
_Out_ LPWSTR  String 
)
static

Definition at line 124 of file cfgmgr.c.

127{
128 LPWSTR lpString;
129
130 if (UuidToStringW(Guid, &lpString) != RPC_S_OK)
131 return FALSE;
132
133 lstrcpyW(&String[1], lpString);
134
135 String[0] = '{';
136 String[MAX_GUID_STRING_LEN - 2] = '}';
138
139 RpcStringFreeW(&lpString);
140
141 return TRUE;
142}
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2433
_Must_inspect_result_ _In_ WDFOBJECT _In_ CONST GUID * Guid
Definition: wdfobject.h:762

Referenced by CM_Delete_Class_Key_Ex(), CM_Get_Class_Key_Name_ExW(), and CM_Get_Class_Name_ExW().

◆ I_ScPnPGetServiceName()

DWORD WINAPI I_ScPnPGetServiceName ( IN SERVICE_STATUS_HANDLE  hServiceStatus,
OUT LPWSTR  lpServiceName,
IN DWORD  cchServiceName 
)

Definition at line 869 of file sctrl.c.

872{
873 DWORD i;
874
875 TRACE("I_ScPnPGetServiceName(%lu %p %lu)\n",
876 hServiceStatus, lpServiceName, cchServiceName);
877
878 for (i = 0; i < dwActiveServiceCount; i++)
879 {
881 {
882 wcscpy(lpServiceName, lpActiveServices[i].ServiceName.Buffer);
883 return ERROR_SUCCESS;
884 }
885 }
886
888}
static WCHAR ServiceName[]
Definition: browser.c:19
static DWORD dwActiveServiceCount
Definition: sctrl.c:60
static PACTIVE_SERVICE lpActiveServices
Definition: sctrl.c:61
SERVICE_STATUS_HANDLE hServiceStatus
Definition: main.c:10
#define ERROR_SERVICE_NOT_IN_EXE
Definition: winerror.h:634

Referenced by CMP_RegisterNotification().

◆ IsValidConflictData()

BOOL IsValidConflictData ( _In_opt_ PCONFLICT_DATA  pConflictData)

Definition at line 473 of file cfgmgr.c.

475{
476 BOOL bValid = TRUE;
477
478 if (pConflictData == NULL)
479 return FALSE;
480
482 {
483 if (pConflictData->ulMagic != CONFLICT_MAGIC)
484 bValid = FALSE;
485 }
487 {
488 bValid = FALSE;
489 }
490 _SEH2_END;
491
492 return bValid;
493}
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:66
#define _SEH2_END
Definition: pseh2_64.h:155
#define _SEH2_TRY
Definition: pseh2_64.h:55

Referenced by CM_Free_Resource_Conflict_Handle(), and CM_Get_Resource_Conflict_Count().

◆ IsValidLogConf()

BOOL IsValidLogConf ( _In_opt_ PLOG_CONF_INFO  pLogConfInfo)

Definition at line 425 of file cfgmgr.c.

427{
428 BOOL bValid = TRUE;
429
430 if (pLogConfInfo == NULL)
431 return FALSE;
432
434 {
435 if (pLogConfInfo->ulMagic != LOG_CONF_MAGIC)
436 bValid = FALSE;
437 }
439 {
440 bValid = FALSE;
441 }
442 _SEH2_END;
443
444 return bValid;
445}

Referenced by CM_Free_Log_Conf_Ex(), CM_Free_Log_Conf_Handle(), CM_Get_Log_Conf_Priority_Ex(), CM_Get_Next_Log_Conf_Ex(), and CM_Get_Next_Res_Des_Ex().

◆ IsValidRangeList()

BOOL IsValidRangeList ( _In_opt_ PINTERNAL_RANGE_LIST  pRangeList)

Definition at line 401 of file cfgmgr.c.

403{
404 BOOL bValid = TRUE;
405
406 if (pRangeList == NULL)
407 return FALSE;
408
410 {
411 if (pRangeList->ulMagic != RANGE_LIST_MAGIC)
412 bValid = FALSE;
413 }
415 {
416 bValid = FALSE;
417 }
418 _SEH2_END;
419
420 return bValid;
421}

Referenced by CM_Add_Range(), CM_Dup_Range_List(), CM_First_Range(), CM_Free_Range_List(), and CM_Test_Range_Available().

◆ IsValidResDes()

BOOL IsValidResDes ( _In_opt_ PRES_DES_INFO  pResDesInfo)

Definition at line 449 of file cfgmgr.c.

451{
452 BOOL bValid = TRUE;
453
454 if (pResDesInfo == NULL)
455 return FALSE;
456
458 {
459 if (pResDesInfo->ulMagic != RES_DES_MAGIC)
460 bValid = FALSE;
461 }
463 {
464 bValid = FALSE;
465 }
466 _SEH2_END;
467
468 return bValid;
469}
#define RES_DES_MAGIC
Definition: cfgmgr.c:83

Referenced by CM_Free_Res_Des_Handle(), and CM_Get_Next_Res_Des_Ex().

◆ RpcStatusToCmStatus()

static CONFIGRET RpcStatusToCmStatus ( _In_ RPC_STATUS  Status)
static

Definition at line 147 of file cfgmgr.c.

149{
150 return CR_FAILURE;
151}

Referenced by CM_Add_Empty_Log_Conf_Ex(), CM_Add_ID_ExW(), CM_Create_DevNode_ExW(), CM_Delete_Class_Key_Ex(), CM_Delete_DevNode_Key_Ex(), CM_Disable_DevNode_Ex(), CM_Enable_DevNode_Ex(), CM_Enumerate_Classes_Ex(), CM_Enumerate_Enumerators_ExW(), CM_Free_Log_Conf_Ex(), CM_Get_Child_Ex(), CM_Get_Class_Name_ExW(), CM_Get_Class_Registry_PropertyW(), CM_Get_Depth_Ex(), CM_Get_Device_ID_List_ExW(), CM_Get_Device_ID_List_Size_ExW(), CM_Get_Device_Interface_Alias_ExW(), CM_Get_Device_Interface_List_ExW(), CM_Get_Device_Interface_List_Size_ExW(), CM_Get_DevNode_Custom_Property_ExW(), CM_Get_DevNode_Registry_Property_ExW(), CM_Get_DevNode_Status_Ex(), CM_Get_First_Log_Conf_Ex(), CM_Get_Global_State_Ex(), CM_Get_Hardware_Profile_Info_ExW(), CM_Get_HW_Prof_Flags_ExW(), CM_Get_Log_Conf_Priority_Ex(), CM_Get_Next_Log_Conf_Ex(), CM_Get_Next_Res_Des_Ex(), CM_Get_Parent_Ex(), CM_Get_Sibling_Ex(), CM_Get_Version_Ex(), CM_Is_Dock_Station_Present_Ex(), CM_Is_Version_Available_Ex(), CM_Locate_DevNode_ExW(), CM_Move_DevNode_Ex(), CM_Query_And_Remove_SubTree_ExW(), CM_Query_Arbitrator_Free_Data_Ex(), CM_Query_Arbitrator_Free_Size_Ex(), CM_Query_Resource_Conflict_List(), CM_Reenumerate_DevNode_Ex(), CM_Register_Device_Driver_Ex(), CM_Register_Device_Interface_ExW(), CM_Request_Device_Eject_ExW(), CM_Request_Eject_PC_Ex(), CM_Run_Detection_Ex(), CM_Set_DevNode_Problem_Ex(), CM_Set_DevNode_Registry_Property_ExW(), CM_Set_HW_Prof_Ex(), CM_Set_HW_Prof_Flags_ExW(), CM_Setup_DevNode_Ex(), CM_Uninstall_DevNode_Ex(), CM_Unregister_Device_Interface_ExW(), CMP_GetBlockedDriverInfo(), CMP_GetServerSideDeviceInstallFlags(), CMP_Init_Detection(), CMP_RegisterNotification(), CMP_Report_LogOn(), CMP_UnregisterNotification(), CMP_WaitServicesAvailable(), and GetDeviceInstanceKeyPath().

◆ SplitDeviceInstanceId()

static VOID SplitDeviceInstanceId ( _In_ PWSTR  pszDeviceInstanceId,
_Out_ PWSTR  pszDeviceId,
_Out_ PWSTR  pszInstanceId 
)
static

Definition at line 209 of file cfgmgr.c.

213{
214 PWCHAR ptr;
215
216 wcscpy(pszDeviceId, pszDeviceInstanceId);
217
218 ptr = wcschr(pszDeviceId, L'\\');
219 if (ptr != NULL)
220 {
221 *ptr = UNICODE_NULL;
222 ptr++;
223
224 wcscpy(pszInstanceId, ptr);
225 }
226 else
227 {
228 *pszInstanceId = UNICODE_NULL;
229 }
230}
#define wcschr
Definition: compat.h:17
static PVOID ptr
Definition: dispmode.c:27

Referenced by GetDeviceInstanceKeyPath().

Variable Documentation

◆ BackslashOpenBrace

const WCHAR BackslashOpenBrace[] = {'\\', '{', 0}
static

Definition at line 40 of file cfgmgr.c.

Referenced by CM_Open_Class_Key_ExW().

◆ Class

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

Definition at line 42 of file cfgmgr.c.

◆ CloseBrace

const WCHAR CloseBrace[] = {'}', 0}
static

Definition at line 41 of file cfgmgr.c.

Referenced by CM_Open_Class_Key_ExW().

◆ ControlClass

const WCHAR ControlClass[]
static
Initial value:
= {'S','y','s','t','e','m','\\',
'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\',
'C','o','n','t','r','o','l','\\',
'C','l','a','s','s',0}

Definition at line 44 of file cfgmgr.c.

Referenced by BeginFile(), CM_Open_Class_Key_ExW(), and PiControlSyncDeviceAction().

◆ DeviceClasses

const WCHAR DeviceClasses[]
static
Initial value:
= {'S','y','s','t','e','m','\\',
'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\',
'C','o','n','t','r','o','l','\\',
'D','e','v','i','c','e','C','l','a','s','s','e','s',0}

Definition at line 49 of file cfgmgr.c.

Referenced by CM_Open_Class_Key_ExW().