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

Go to the source code of this file.

Classes

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

Macros

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

Typedefs

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

Functions

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

Variables

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

Macro Definition Documentation

◆ CONFLICT_MAGIC

#define CONFLICT_MAGIC   0x11225588

Definition at line 106 of file cfgmgr.c.

◆ LOG_CONF_MAGIC

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

Definition at line 71 of file cfgmgr.c.

◆ NOTIFY_MAGIC

#define NOTIFY_MAGIC   0x44556677

Definition at line 80 of file cfgmgr.c.

◆ RANGE_LIST_MAGIC

#define RANGE_LIST_MAGIC   0x33445566

Definition at line 98 of file cfgmgr.c.

Typedef Documentation

◆ CONFLICT_DATA

◆ INTERNAL_RANGE

◆ INTERNAL_RANGE_LIST

◆ LOG_CONF_INFO

◆ MACHINE_INFO

◆ NOTIFY_DATA

◆ PCONFLICT_DATA

◆ PINTERNAL_RANGE

◆ PINTERNAL_RANGE_LIST

◆ PLOG_CONF_INFO

◆ PMACHINE_INFO

◆ PNOTIFY_DATA

Function Documentation

◆ CM_Add_Empty_Log_Conf()

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

Definition at line 860 of file cfgmgr.c.

865 {
866  TRACE("CM_Add_Empty_Log_Conf(%p %p %lu %lx)\n",
867  plcLogConf, dnDevInst, Priority, ulFlags);
868 
869  return CM_Add_Empty_Log_Conf_Ex(plcLogConf, dnDevInst, Priority,
870  ulFlags, NULL);
871 }
#define TRACE(s)
Definition: solgame.cpp:4
_In_ WDFINTERRUPT _In_ WDF_INTERRUPT_POLICY _In_ WDF_INTERRUPT_PRIORITY Priority
Definition: wdfinterrupt.h:651
#define NULL
Definition: types.h:112
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:879

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

885 {
887  HSTRING_TABLE StringTable = NULL;
888  ULONG ulLogConfTag = 0;
889  LPWSTR lpDevInst;
890  PLOG_CONF_INFO pLogConfInfo;
892 
893  FIXME("CM_Add_Empty_Log_Conf_Ex(%p %p %lu %lx %p)\n",
894  plcLogConf, dnDevInst, Priority, ulFlags, hMachine);
895 
896  if (!pSetupIsUserAdmin())
897  return CR_ACCESS_DENIED;
898 
899  if (plcLogConf == NULL)
900  return CR_INVALID_POINTER;
901 
902  if (dnDevInst == 0)
903  return CR_INVALID_DEVINST;
904 
905  if (Priority > 0xFFFF)
906  return CR_INVALID_PRIORITY;
907 
908  if (ulFlags & ~(LOG_CONF_BITS | PRIORITY_BIT))
909  return CR_INVALID_FLAG;
910 
911  if (hMachine != NULL)
912  {
913  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
914  if (BindingHandle == NULL)
915  return CR_FAILURE;
916 
917  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
918  if (StringTable == 0)
919  return CR_FAILURE;
920  }
921  else
922  {
923  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
924  return CR_FAILURE;
925  }
926 
927  lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
928  if (lpDevInst == NULL)
929  return CR_INVALID_DEVNODE;
930 
932  {
934  &ulLogConfTag, ulFlags);
935  }
937  {
939  }
940  RpcEndExcept;
941 
942  if (ret == CR_SUCCESS)
943  {
944  pLogConfInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(LOG_CONF_INFO));
945  if (pLogConfInfo == NULL)
946  {
948  }
949  else
950  {
951  pLogConfInfo->ulMagic = LOG_CONF_MAGIC;
952  pLogConfInfo->dnDevInst = dnDevInst;
953  pLogConfInfo->ulType = ulFlags;
954  pLogConfInfo->ulTag = ulLogConfTag;
955 
956  *plcLogConf = (LOG_CONF)pLogConfInfo;
957 
958  ret = CR_SUCCESS;
959  }
960  }
961 
962  return ret;
963 }
#define RpcEndExcept
Definition: rpc.h:128
#define CR_INVALID_DEVINST
Definition: cfgmgr32.h:848
ULONG ulMagic
Definition: cfgmgr.c:65
ULONG ulType
Definition: cfgmgr.c:67
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
struct _MACHINE_INFO * PMACHINE_INFO
#define PRIORITY_BIT
Definition: cfgmgr32.h:607
_In_ ULONG _Out_ HANDLE * BindingHandle
Definition: tdikrnl.h:1146
ULONG ulTag
Definition: cfgmgr.c:68
#define CR_ACCESS_DENIED
Definition: cfgmgr32.h:897
BOOL PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle, HSTRING_TABLE *StringTable)
Definition: rpc.c:66
#define FIXME(fmt,...)
Definition: debug.h:111
#define RpcTryExcept
Definition: rpc.h:126
#define CR_SUCCESS
Definition: cfgmgr32.h:842
DWORD_PTR LOG_CONF
Definition: cfgmgr32.h:90
#define CR_OUT_OF_MEMORY
Definition: cfgmgr32.h:844
#define RpcExceptionCode()
Definition: rpc.h:132
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define CR_FAILURE
Definition: cfgmgr32.h:865
DWORD WINAPI PNP_AddEmptyLogConf(handle_t hBinding, LPWSTR pDeviceID, DWORD ulPriority, DWORD *pulLogConfTag, DWORD ulFlags)
Definition: rpcserver.c:3939
_In_ WDFINTERRUPT _In_ WDF_INTERRUPT_POLICY _In_ WDF_INTERRUPT_PRIORITY Priority
Definition: wdfinterrupt.h:651
int ret
#define CR_INVALID_DEVNODE
Definition: cfgmgr32.h:847
#define LOG_CONF_BITS
Definition: cfgmgr32.h:603
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:136
#define NULL
Definition: types.h:112
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
#define CR_INVALID_PRIORITY
Definition: cfgmgr32.h:885
unsigned int ULONG
Definition: retypes.h:1
#define LOG_CONF_MAGIC
Definition: cfgmgr.c:71
BOOL WINAPI pSetupIsUserAdmin(VOID)
Definition: misc.c:1817
WCHAR * LPWSTR
Definition: xmlstorage.h:184
DEVINST dnDevInst
Definition: cfgmgr.c:66
LPWSTR WINAPI pSetupStringTableStringFromId(HSTRING_TABLE hStringTable, DWORD dwId)
Definition: stringtable.c:722
#define RpcExcept(expr)
Definition: rpc.h:127

Referenced by CM_Add_Empty_Log_Conf().

◆ CM_Add_ID_ExA()

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

Definition at line 1005 of file cfgmgr.c.

1010 {
1011  PWSTR pszIDW;
1012  CONFIGRET ret;
1013 
1014  TRACE("CM_Add_ID_ExA(%p %s %lx %p)\n",
1015  dnDevInst, debugstr_a(pszID), ulFlags, hMachine);
1016 
1017  if (pSetupCaptureAndConvertAnsiArg(pszID, &pszIDW))
1018  return CR_INVALID_DATA;
1019 
1020  ret = CM_Add_ID_ExW(dnDevInst, pszIDW, ulFlags, hMachine);
1021 
1022  MyFree(pszIDW);
1023 
1024  return ret;
1025 }
uint16_t * PWSTR
Definition: typedefs.h:56
DWORD WINAPI pSetupCaptureAndConvertAnsiArg(LPCSTR pSrc, LPWSTR *pDst)
Definition: misc.c:574
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
#define CR_INVALID_DATA
Definition: cfgmgr32.h:877
int ret
CONFIGRET WINAPI CM_Add_ID_ExW(_In_ DEVINST dnDevInst, _In_ PWSTR pszID, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:1033
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
VOID WINAPI MyFree(LPVOID lpMem)
Definition: misc.c:128

Referenced by CM_Add_IDA().

◆ CM_Add_ID_ExW()

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

Definition at line 1033 of file cfgmgr.c.

1038 {
1040  HSTRING_TABLE StringTable = NULL;
1041  LPWSTR lpDevInst;
1042  CONFIGRET ret;
1043 
1044  TRACE("CM_Add_ID_ExW(%p %s %lx %p)\n",
1045  dnDevInst, debugstr_w(pszID), ulFlags, hMachine);
1046 
1047  if (!pSetupIsUserAdmin())
1048  return CR_ACCESS_DENIED;
1049 
1050  if (dnDevInst == 0)
1051  return CR_INVALID_DEVINST;
1052 
1053  if (pszID == NULL)
1054  return CR_INVALID_POINTER;
1055 
1056  if (ulFlags & ~CM_ADD_ID_BITS)
1057  return CR_INVALID_FLAG;
1058 
1059  if (hMachine != NULL)
1060  {
1061  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1062  if (BindingHandle == NULL)
1063  return CR_FAILURE;
1064 
1065  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
1066  if (StringTable == 0)
1067  return CR_FAILURE;
1068  }
1069  else
1070  {
1071  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
1072  return CR_FAILURE;
1073  }
1074 
1075  lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
1076  if (lpDevInst == NULL)
1077  return CR_INVALID_DEVNODE;
1078 
1079  RpcTryExcept
1080  {
1082  lpDevInst,
1083  pszID,
1084  ulFlags);
1085  }
1087  {
1089  }
1090  RpcEndExcept;
1091 
1092  return ret;
1093 }
#define CM_ADD_ID_BITS
Definition: cfgmgr32.h:616
#define RpcEndExcept
Definition: rpc.h:128
#define CR_INVALID_DEVINST
Definition: cfgmgr32.h:848
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
struct _MACHINE_INFO * PMACHINE_INFO
_In_ ULONG _Out_ HANDLE * BindingHandle
Definition: tdikrnl.h:1146
#define CR_ACCESS_DENIED
Definition: cfgmgr32.h:897
BOOL PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle, HSTRING_TABLE *StringTable)
Definition: rpc.c:66
#define debugstr_w
Definition: kernel32.h:32
#define RpcTryExcept
Definition: rpc.h:126
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define CR_FAILURE
Definition: cfgmgr32.h:865
int ret
#define CR_INVALID_DEVNODE
Definition: cfgmgr32.h:847
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:136
#define NULL
Definition: types.h:112
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
BOOL WINAPI pSetupIsUserAdmin(VOID)
Definition: misc.c:1817
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LPWSTR WINAPI pSetupStringTableStringFromId(HSTRING_TABLE hStringTable, DWORD dwId)
Definition: stringtable.c:722
#define RpcExcept(expr)
Definition: rpc.h:127
DWORD WINAPI PNP_AddID(handle_t hBinding, LPWSTR pszDeviceID, LPWSTR pszID, DWORD ulFlags)
Definition: rpcserver.c:3405

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

975 {
976  TRACE("CM_Add_IDA(%p %s %lx)\n",
977  dnDevInst, debugstr_a(pszID), ulFlags);
978 
979  return CM_Add_ID_ExA(dnDevInst, pszID, ulFlags, NULL);
980 }
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
#define NULL
Definition: types.h:112
CONFIGRET WINAPI CM_Add_ID_ExA(_In_ DEVINST dnDevInst, _In_ PSTR pszID, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:1005

◆ CM_Add_IDW()

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

Definition at line 988 of file cfgmgr.c.

992 {
993  TRACE("CM_Add_IDW(%p %s %lx)\n",
994  dnDevInst, debugstr_w(pszID), ulFlags);
995 
996  return CM_Add_ID_ExW(dnDevInst, pszID, ulFlags, NULL);
997 }
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
CONFIGRET WINAPI CM_Add_ID_ExW(_In_ DEVINST dnDevInst, _In_ PWSTR pszID, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:1033
#define NULL
Definition: types.h:112

◆ CM_Add_Range()

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

Definition at line 1101 of file cfgmgr.c.

1106 {
1107  PINTERNAL_RANGE_LIST pRangeList;
1108  PINTERNAL_RANGE pRange;
1110 
1111  FIXME("CM_Add_Range(%I64u %I64u %p %lx)\n",
1112  ullStartValue, ullEndValue, rlh, ulFlags);
1113 
1114  pRangeList = (PINTERNAL_RANGE_LIST)rlh;
1115 
1116  if (!IsValidRangeList(pRangeList))
1117  return CR_INVALID_RANGE_LIST;
1118 
1119  if (ulFlags & ~CM_ADD_RANGE_BITS)
1120  return CR_INVALID_FLAG;
1121 
1122  if (ullEndValue < ullStartValue)
1123  return CR_INVALID_RANGE;
1124 
1125  /* Lock the range list */
1126  WaitForSingleObject(pRangeList->hMutex, INFINITE);
1127 
1128  /* Allocate the new range */
1129  pRange = HeapAlloc(GetProcessHeap(), 0, sizeof(INTERNAL_RANGE));
1130  if (pRange == NULL)
1131  {
1133  goto done;
1134  }
1135 
1136  pRange->pRangeList = pRangeList;
1137  pRange->ullStart = ullStartValue;
1138  pRange->ullEnd = ullEndValue;
1139 
1140  /* Insert the range */
1141  if (IsListEmpty(&pRangeList->ListHead))
1142  {
1143  InsertTailList(&pRangeList->ListHead, &pRange->ListEntry);
1144  }
1145  else
1146  {
1147  HeapFree(GetProcessHeap(), 0, pRange);
1148  UNIMPLEMENTED;
1149  }
1150 
1151 done:
1152  /* Unlock the range list */
1153  ReleaseMutex(pRangeList->hMutex);
1154 
1155  return ret;
1156 }
#define CR_INVALID_RANGE
Definition: cfgmgr32.h:864
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
BOOL IsValidRangeList(_In_opt_ PINTERNAL_RANGE_LIST pRangeList)
Definition: cfgmgr.c:390
struct _INTERNAL_RANGE_LIST * pRangeList
Definition: cfgmgr.c:86
#define InsertTailList(ListHead, Entry)
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define FIXME(fmt,...)
Definition: debug.h:111
#define CR_SUCCESS
Definition: cfgmgr32.h:842
struct _INTERNAL_RANGE_LIST * PINTERNAL_RANGE_LIST
#define CR_OUT_OF_MEMORY
Definition: cfgmgr32.h:844
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
DWORDLONG ullStart
Definition: cfgmgr.c:87
LIST_ENTRY ListEntry
Definition: cfgmgr.c:85
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseMutex(IN HANDLE hMutex)
Definition: synch.c:618
int ret
DWORDLONG ullEnd
Definition: cfgmgr.c:88
#define NULL
Definition: types.h:112
#define CR_INVALID_RANGE_LIST
Definition: cfgmgr32.h:863
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
LIST_ENTRY ListHead
Definition: cfgmgr.c:95
#define UNIMPLEMENTED
Definition: debug.h:115
#define INFINITE
Definition: serial.h:102
#define CM_ADD_RANGE_BITS
Definition: cfgmgr32.h:594
#define HeapFree(x, y, z)
Definition: compat.h:594

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

1171 {
1172  TRACE("CM_Add_Res_Des(%p %p %lu %p %lu %lx)\n",
1173  prdResDes, lcLogConf, ResourceID, ResourceData, ResourceLen, ulFlags);
1174 
1175  return CM_Add_Res_Des_Ex(prdResDes, lcLogConf, ResourceID, ResourceData,
1176  ResourceLen, ulFlags, NULL);
1177 }
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:1185
#define TRACE(s)
Definition: solgame.cpp:4
#define NULL
Definition: types.h:112

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

1193 {
1194  FIXME("CM_Add_Res_Des_Ex(%p %p %lu %p %lu %lx %p)\n",
1195  prdResDes, lcLogConf, ResourceID,
1196  ResourceData, ResourceLen, ulFlags, hMachine);
1197 
1198  return CR_CALL_NOT_IMPLEMENTED;
1199 }
#define FIXME(fmt,...)
Definition: debug.h:111
#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 1207 of file cfgmgr.c.

1210 {
1211  PWSTR pServerNameW;
1212  CONFIGRET ret;
1213 
1214  TRACE("CM_Connect_MachineA(%s %p)\n",
1215  debugstr_a(UNCServerName), phMachine);
1216 
1217  if (UNCServerName == NULL || *UNCServerName == 0)
1218  return CM_Connect_MachineW(NULL, phMachine);
1219 
1220  if (pSetupCaptureAndConvertAnsiArg(UNCServerName, &pServerNameW))
1221  return CR_INVALID_DATA;
1222 
1223  ret = CM_Connect_MachineW(pServerNameW, phMachine);
1224 
1225  MyFree(pServerNameW);
1226 
1227  return ret;
1228 }
uint16_t * PWSTR
Definition: typedefs.h:56
DWORD WINAPI pSetupCaptureAndConvertAnsiArg(LPCSTR pSrc, LPWSTR *pDst)
Definition: misc.c:574
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
CONFIGRET WINAPI CM_Connect_MachineW(_In_opt_ PCWSTR UNCServerName, _Out_ PHMACHINE phMachine)
Definition: cfgmgr.c:1236
#define CR_INVALID_DATA
Definition: cfgmgr32.h:877
int ret
#define NULL
Definition: types.h:112
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
VOID WINAPI MyFree(LPVOID lpMem)
Definition: misc.c:128

◆ CM_Connect_MachineW()

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

Definition at line 1236 of file cfgmgr.c.

1239 {
1240  PMACHINE_INFO pMachine;
1241 
1242  TRACE("CM_Connect_MachineW(%s %p)\n",
1243  debugstr_w(UNCServerName), phMachine);
1244 
1245  if (phMachine == NULL)
1246  return CR_INVALID_POINTER;
1247 
1248  *phMachine = NULL;
1249 
1250  pMachine = HeapAlloc(GetProcessHeap(), 0, sizeof(MACHINE_INFO));
1251  if (pMachine == NULL)
1252  return CR_OUT_OF_MEMORY;
1253 
1254  if (UNCServerName == NULL || *UNCServerName == 0)
1255  {
1256  pMachine->bLocal = TRUE;
1257 
1258  /* FIXME: store the computers name in pMachine->szMachineName */
1259 
1260  if (!PnpGetLocalHandles(&pMachine->BindingHandle,
1261  &pMachine->StringTable))
1262  {
1263  HeapFree(GetProcessHeap(), 0, pMachine);
1264  return CR_FAILURE;
1265  }
1266  }
1267  else
1268  {
1269  pMachine->bLocal = FALSE;
1270  if (wcslen(UNCServerName) >= SP_MAX_MACHINENAME_LENGTH - 1)
1271  {
1272  HeapFree(GetProcessHeap(), 0, pMachine);
1273  return CR_INVALID_MACHINENAME;
1274  }
1275  lstrcpyW(pMachine->szMachineName, UNCServerName);
1276 
1278  if (pMachine->StringTable == NULL)
1279  {
1280  HeapFree(GetProcessHeap(), 0, pMachine);
1281  return CR_FAILURE;
1282  }
1283 
1284  pSetupStringTableAddString(pMachine->StringTable, L"PLT", 1);
1285 
1286  if (!PnpBindRpc(UNCServerName, &pMachine->BindingHandle))
1287  {
1289  HeapFree(GetProcessHeap(), 0, pMachine);
1290  return CR_INVALID_MACHINENAME;
1291  }
1292  }
1293 
1294  *phMachine = (PHMACHINE)pMachine;
1295 
1296  return CR_SUCCESS;
1297 }
#define SP_MAX_MACHINENAME_LENGTH
Definition: setupapi.h:27
HSTRING_TABLE WINAPI pSetupStringTableInitialize(VOID)
Definition: stringtable.c:54
#define TRUE
Definition: types.h:120
RPC_STATUS PnpBindRpc(LPCWSTR pszMachine, RPC_BINDING_HANDLE *BindingHandle)
Definition: rpc.c:28
BOOL PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle, HSTRING_TABLE *StringTable)
Definition: rpc.c:66
#define FALSE
Definition: types.h:117
#define debugstr_w
Definition: kernel32.h:32
#define CR_SUCCESS
Definition: cfgmgr32.h:842
RPC_BINDING_HANDLE BindingHandle
Definition: cfgmgr.c:57
#define CR_OUT_OF_MEMORY
Definition: cfgmgr32.h:844
DWORD WINAPI pSetupStringTableAddString(HSTRING_TABLE hStringTable, LPWSTR lpString, DWORD dwFlags)
Definition: stringtable.c:196
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
WCHAR szMachineName[SP_MAX_MACHINENAME_LENGTH]
Definition: cfgmgr.c:56
#define CR_FAILURE
Definition: cfgmgr32.h:865
static const WCHAR L[]
Definition: oid.c:1250
#define CR_INVALID_MACHINENAME
Definition: cfgmgr32.h:893
HMACHINE * PHMACHINE
Definition: cfgmgr32.h:109
VOID WINAPI pSetupStringTableDestroy(HSTRING_TABLE hStringTable)
Definition: stringtable.c:145
#define lstrcpyW
Definition: compat.h:608
#define NULL
Definition: types.h:112
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
BOOL bLocal
Definition: cfgmgr.c:59
#define HeapFree(x, y, z)
Definition: compat.h:594
HSTRING_TABLE StringTable
Definition: cfgmgr.c:58

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

1349 {
1350  DEVINSTID_W pDeviceIDW;
1351  CONFIGRET ret;
1352 
1353  TRACE("CM_Create_DevNode_ExA(%p %s %p %lx %p)\n",
1354  pdnDevInst, debugstr_a(pDeviceID), dnParent, ulFlags, hMachine);
1355 
1356  if (pSetupCaptureAndConvertAnsiArg(pDeviceID, &pDeviceIDW))
1357  return CR_INVALID_DATA;
1358 
1359  ret = CM_Create_DevNode_ExW(pdnDevInst, pDeviceIDW, dnParent, ulFlags,
1360  hMachine);
1361 
1362  MyFree(pDeviceIDW);
1363 
1364  return ret;
1365 }
_Null_terminated_ WCHAR * DEVINSTID_W
Definition: cfgmgr32.h:80
DWORD WINAPI pSetupCaptureAndConvertAnsiArg(LPCSTR pSrc, LPWSTR *pDst)
Definition: misc.c:574
CONFIGRET WINAPI CM_Create_DevNode_ExW(_Out_ PDEVINST pdnDevInst, _In_ DEVINSTID_W pDeviceID, _In_ DEVINST dnParent, _In_ ULONG ulFlags, _In_opt_ HANDLE hMachine)
Definition: cfgmgr.c:1373
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
#define CR_INVALID_DATA
Definition: cfgmgr32.h:877
int ret
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
VOID WINAPI MyFree(LPVOID lpMem)
Definition: misc.c:128

Referenced by CM_Create_DevNodeA().

◆ CM_Create_DevNode_ExW()

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

Definition at line 1373 of file cfgmgr.c.

1379 {
1381  HSTRING_TABLE StringTable = NULL;
1382  LPWSTR lpParentDevInst;
1384  WCHAR szLocalDeviceID[MAX_DEVICE_ID_LEN];
1385 
1386  TRACE("CM_Create_DevNode_ExW(%p %s %p %lx %p)\n",
1387  pdnDevInst, debugstr_w(pDeviceID), dnParent, ulFlags, hMachine);
1388 
1389  if (!pSetupIsUserAdmin())
1390  return CR_ACCESS_DENIED;
1391 
1392  if (pdnDevInst == NULL)
1393  return CR_INVALID_POINTER;
1394 
1395  if (pDeviceID == NULL || wcslen(pDeviceID) == 0 || wcslen(pDeviceID) >= MAX_DEVICE_ID_LEN)
1396  return CR_INVALID_DEVICE_ID;
1397 
1398  if (dnParent == 0)
1399  return CR_INVALID_DEVNODE;
1400 
1401  if (ulFlags & ~CM_CREATE_DEVNODE_BITS)
1402  return CR_INVALID_FLAG;
1403 
1404  if (hMachine != NULL)
1405  {
1406  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1407  if (BindingHandle == NULL)
1408  return CR_FAILURE;
1409 
1410  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
1411  if (StringTable == 0)
1412  return CR_FAILURE;
1413  }
1414  else
1415  {
1416  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
1417  return CR_FAILURE;
1418  }
1419 
1420  lpParentDevInst = pSetupStringTableStringFromId(StringTable, dnParent);
1421  if (lpParentDevInst == NULL)
1422  return CR_INVALID_DEVNODE;
1423 
1424  wcscpy(szLocalDeviceID, pDeviceID);
1425 
1426  RpcTryExcept
1427  {
1429  szLocalDeviceID,
1430  lpParentDevInst,
1432  ulFlags);
1433  }
1435  {
1437  }
1438  RpcEndExcept;
1439 
1440  if (ret == CR_SUCCESS)
1441  {
1442  /* If CM_CREATE_DEVINST_GENERATE_ID was passed in, PNP_CreateDevInst
1443  * will return the generated device ID in szLocalDeviceID */
1444  *pdnDevInst = pSetupStringTableAddString(StringTable, szLocalDeviceID, 1);
1445  if (*pdnDevInst == 0)
1447  }
1448 
1449  return ret;
1450 }
#define RpcEndExcept
Definition: rpc.h:128
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
DWORD WINAPI PNP_CreateDevInst(handle_t hBinding, LPWSTR pszDeviceID, LPWSTR pszParentDeviceID, PNP_RPC_STRING_LEN ulLength, DWORD ulFlags)
Definition: rpcserver.c:2939
struct _MACHINE_INFO * PMACHINE_INFO
_In_ ULONG _Out_ HANDLE * BindingHandle
Definition: tdikrnl.h:1146
#define CR_ACCESS_DENIED
Definition: cfgmgr32.h:897
#define CR_INVALID_DEVICE_ID
Definition: cfgmgr32.h:876
BOOL PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle, HSTRING_TABLE *StringTable)
Definition: rpc.c:66
#define debugstr_w
Definition: kernel32.h:32
#define RpcTryExcept
Definition: rpc.h:126
#define CR_SUCCESS
Definition: cfgmgr32.h:842
#define CM_CREATE_DEVNODE_BITS
Definition: cfgmgr32.h:624
#define RpcExceptionCode()
Definition: rpc.h:132
DWORD WINAPI pSetupStringTableAddString(HSTRING_TABLE hStringTable, LPWSTR lpString, DWORD dwFlags)
Definition: stringtable.c:196
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define CR_FAILURE
Definition: cfgmgr32.h:865
#define MAX_DEVICE_ID_LEN
Definition: devaction.c:40
int ret
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define CR_INVALID_DEVNODE
Definition: cfgmgr32.h:847
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:136
#define CR_NO_SUCH_DEVNODE
Definition: cfgmgr32.h:857
#define NULL
Definition: types.h:112
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
BOOL WINAPI pSetupIsUserAdmin(VOID)
Definition: misc.c:1817
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LPWSTR WINAPI pSetupStringTableStringFromId(HSTRING_TABLE hStringTable, DWORD dwId)
Definition: stringtable.c:722
#define RpcExcept(expr)
Definition: rpc.h:127

Referenced by CM_Create_DevNode_ExA(), and CM_Create_DevNodeW().

◆ CM_Create_DevNodeA()

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

Definition at line 1305 of file cfgmgr.c.

1310 {
1311  TRACE("CM_Create_DevNodeA(%p %s %p %lx)\n",
1312  pdnDevInst, debugstr_a(pDeviceID), dnParent, ulFlags);
1313 
1314  return CM_Create_DevNode_ExA(pdnDevInst, pDeviceID, dnParent,
1315  ulFlags, NULL);
1316 }
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
#define NULL
Definition: types.h:112
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:1343

◆ CM_Create_DevNodeW()

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

Definition at line 1324 of file cfgmgr.c.

1329 {
1330  TRACE("CM_Create_DevNodeW(%p %s %p %lx)\n",
1331  pdnDevInst, debugstr_w(pDeviceID), dnParent, ulFlags);
1332 
1333  return CM_Create_DevNode_ExW(pdnDevInst, pDeviceID, dnParent,
1334  ulFlags, NULL);
1335 }
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:1373
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
#define NULL
Definition: types.h:112

◆ CM_Create_Range_List()

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

Definition at line 1458 of file cfgmgr.c.

1461 {
1462  PINTERNAL_RANGE_LIST pRangeList = NULL;
1463 
1464  FIXME("CM_Create_Range_List(%p %lx)\n",
1465  prlh, ulFlags);
1466 
1467  if (ulFlags != 0)
1468  return CR_INVALID_FLAG;
1469 
1470  if (prlh == NULL)
1471  return CR_INVALID_POINTER;
1472 
1473  /* Allocate the range list */
1475  if (pRangeList == NULL)
1476  return CR_OUT_OF_MEMORY;
1477 
1478  /* Set the magic value */
1479  pRangeList->ulMagic = RANGE_LIST_MAGIC;
1480 
1481  /* Initialize the mutex for synchonized access */
1482  pRangeList->hMutex = CreateMutex(NULL, FALSE, NULL);
1483  if (pRangeList->hMutex == NULL)
1484  {
1485  HeapFree(GetProcessHeap(), 0, pRangeList);
1486  return CR_FAILURE;
1487  }
1488 
1489  InitializeListHead(&pRangeList->ListHead);
1490 
1491  *prlh = (RANGE_LIST)pRangeList;
1492 
1493  return CR_SUCCESS;
1494 }
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
#define FALSE
Definition: types.h:117
#define FIXME(fmt,...)
Definition: debug.h:111
#define CR_SUCCESS
Definition: cfgmgr32.h:842
#define CR_OUT_OF_MEMORY
Definition: cfgmgr32.h:844
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define CreateMutex
Definition: winbase.h:3612
#define CR_FAILURE
Definition: cfgmgr32.h:865
#define RANGE_LIST_MAGIC
Definition: cfgmgr.c:98
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define NULL
Definition: types.h:112
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
LIST_ENTRY ListHead
Definition: cfgmgr.c:95
DWORD_PTR RANGE_LIST
Definition: cfgmgr32.h:102
#define HeapFree(x, y, z)
Definition: compat.h:594

◆ CM_Delete_Class_Key()

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

Definition at line 1502 of file cfgmgr.c.

1505 {
1506  TRACE("CM_Delete_Class_Key(%p %lx)\n",
1507  ClassGuid, ulFlags);
1508 
1509  return CM_Delete_Class_Key_Ex(ClassGuid, ulFlags, NULL);
1510 }
CONFIGRET WINAPI CM_Delete_Class_Key_Ex(_In_ LPGUID ClassGuid, _In_ ULONG ulFlags, _In_opt_ HANDLE hMachine)
Definition: cfgmgr.c:1518
#define TRACE(s)
Definition: solgame.cpp:4
#define NULL
Definition: types.h:112

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

1522 {
1523  WCHAR szGuidString[MAX_GUID_STRING_LEN];
1525  CONFIGRET ret;
1526 
1527  TRACE("CM_Delete_Class_Key_Ex(%p %lx %p)\n",
1528  ClassGuid, ulFlags, hMachine);
1529 
1530  if (ClassGuid == NULL)
1531  return CR_INVALID_POINTER;
1532 
1533  if (ulFlags & ~CM_DELETE_CLASS_BITS)
1534  return CR_INVALID_FLAG;
1535 
1536  if (!GuidToString(ClassGuid, szGuidString))
1537  return CR_INVALID_DATA;
1538 
1539  if (hMachine != NULL)
1540  {
1541  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1542  if (BindingHandle == NULL)
1543  return CR_FAILURE;
1544  }
1545  else
1546  {
1548  return CR_FAILURE;
1549  }
1550 
1551  RpcTryExcept
1552  {
1554  szGuidString,
1555  ulFlags);
1556  }
1558  {
1560  }
1561  RpcEndExcept;
1562 
1563  return ret;
1564 }
#define RpcEndExcept
Definition: rpc.h:128
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
struct _MACHINE_INFO * PMACHINE_INFO
_In_ ULONG _Out_ HANDLE * BindingHandle
Definition: tdikrnl.h:1146
BOOL PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle, HSTRING_TABLE *StringTable)
Definition: rpc.c:66
#define RpcTryExcept
Definition: rpc.h:126
#define CM_DELETE_CLASS_BITS
Definition: cfgmgr32.h:639
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_GUID_STRING_LEN
Definition: apphelp.c:29
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define CR_FAILURE
Definition: cfgmgr32.h:865
#define CR_INVALID_DATA
Definition: cfgmgr32.h:877
int ret
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:136
static BOOL GuidToString(_In_ LPGUID Guid, _Out_ LPWSTR String)
Definition: cfgmgr.c:113
#define NULL
Definition: types.h:112
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
DWORD WINAPI PNP_DeleteClassKey(handle_t hBinding, LPWSTR pszClassGuid, DWORD ulFlags)
Definition: rpcserver.c:2428
#define RpcExcept(expr)
Definition: rpc.h:127

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

1576 {
1577  TRACE("CM_Delete_DevNode_Key(%p %lu %lx)\n",
1578  dnDevInst, ulHardwareProfile, ulFlags);
1579 
1580  return CM_Delete_DevNode_Key_Ex(dnDevInst, ulHardwareProfile, ulFlags,
1581  NULL);
1582 }
CONFIGRET WINAPI CM_Delete_DevNode_Key_Ex(_In_ DEVINST dnDevInst, _In_ ULONG ulHardwareProfile, _In_ ULONG ulFlags, _In_opt_ HANDLE hMachine)
Definition: cfgmgr.c:1590
#define TRACE(s)
Definition: solgame.cpp:4
#define NULL
Definition: types.h:112

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

1595 {
1597  HSTRING_TABLE StringTable = NULL;
1598  PWSTR pszDevInst, pszKeyPath = NULL, pszInstancePath = NULL;
1599  CONFIGRET ret;
1600 
1601  FIXME("CM_Delete_DevNode_Key_Ex(%p %lu %lx %p)\n",
1602  dnDevInst, ulHardwareProfile, ulFlags, hMachine);
1603 
1604  if (dnDevInst == 0)
1605  return CR_INVALID_DEVINST;
1606 
1607  if (ulFlags & ~CM_REGISTRY_BITS)
1608  return CR_INVALID_FLAG;
1609 
1610  if ((ulFlags & CM_REGISTRY_USER) && (ulFlags & CM_REGISTRY_CONFIG))
1611  return CR_INVALID_FLAG;
1612 
1613  if (hMachine != NULL)
1614  {
1615  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1616  if (BindingHandle == NULL)
1617  return CR_FAILURE;
1618 
1619  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
1620  if (StringTable == 0)
1621  return CR_FAILURE;
1622  }
1623  else
1624  {
1625  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
1626  return CR_FAILURE;
1627  }
1628 
1629  pszDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
1630  if (pszDevInst == NULL)
1631  return CR_INVALID_DEVNODE;
1632 
1633  TRACE("pszDevInst: %S\n", pszDevInst);
1634 
1635  pszKeyPath = MyMalloc(512 * sizeof(WCHAR));
1636  if (pszKeyPath == NULL)
1637  {
1639  goto done;
1640  }
1641 
1642  pszInstancePath = MyMalloc(512 * sizeof(WCHAR));
1643  if (pszInstancePath == NULL)
1644  {
1646  goto done;
1647  }
1648 
1650  pszDevInst,
1651  pszKeyPath,
1652  pszInstancePath,
1653  ulHardwareProfile,
1654  ulFlags);
1655  if (ret != CR_SUCCESS)
1656  goto done;
1657 
1658  TRACE("pszKeyPath: %S\n", pszKeyPath);
1659  TRACE("pszInstancePath: %S\n", pszInstancePath);
1660 
1661  if (ulFlags & CM_REGISTRY_USER)
1662  {
1663  FIXME("The CM_REGISTRY_USER flag is not supported yet!\n");
1664  }
1665  else
1666  {
1667 #if 0
1668  if (!pSetupIsUserAdmin())
1669  {
1671  goto done;
1672  }
1673 #endif
1674 
1675  if (!(ulFlags & CM_REGISTRY_CONFIG))
1676  ulHardwareProfile = 0;
1677 
1678  RpcTryExcept
1679  {
1681  pszDevInst,
1682  pszKeyPath,
1683  pszInstancePath,
1684  ulHardwareProfile);
1685  }
1687  {
1689  }
1690  RpcEndExcept;
1691  }
1692 
1693 done:
1694  if (pszInstancePath != NULL)
1695  MyFree(pszInstancePath);
1696 
1697  if (pszKeyPath != NULL)
1698  MyFree(pszKeyPath);
1699 
1700  return ret;
1701 }
#define RpcEndExcept
Definition: rpc.h:128
#define CR_INVALID_DEVINST
Definition: cfgmgr32.h:848
DWORD WINAPI PNP_DeleteRegistryKey(handle_t hBinding, LPWSTR pszDeviceID, LPWSTR pszParentKey, LPWSTR pszChildKey, DWORD ulFlags)
Definition: rpcserver.c:2310
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
uint16_t * PWSTR
Definition: typedefs.h:56
static CONFIGRET GetDeviceInstanceKeyPath(_In_ RPC_BINDING_HANDLE BindingHandle, _In_ PWSTR pszDeviceInst, _Out_ PWSTR pszKeyPath, _Out_ PWSTR pszInstancePath, _In_ ULONG ulHardwareProfile, _In_ ULONG ulFlags)
Definition: cfgmgr.c:224
struct _MACHINE_INFO * PMACHINE_INFO
_In_ ULONG _Out_ HANDLE * BindingHandle
Definition: tdikrnl.h:1146
#define CM_REGISTRY_BITS
Definition: cfgmgr32.h:804
#define CR_ACCESS_DENIED
Definition: cfgmgr32.h:897
BOOL PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle, HSTRING_TABLE *StringTable)
Definition: rpc.c:66
#define FIXME(fmt,...)
Definition: debug.h:111
#define RpcTryExcept
Definition: rpc.h:126
#define CM_REGISTRY_CONFIG
Definition: cfgmgr32.h:803
#define CR_SUCCESS
Definition: cfgmgr32.h:842
#define CR_OUT_OF_MEMORY
Definition: cfgmgr32.h:844
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define CR_FAILURE
Definition: cfgmgr32.h:865
int ret
#define CR_INVALID_DEVNODE
Definition: cfgmgr32.h:847
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:136
#define NULL
Definition: types.h:112
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
LPVOID WINAPI MyMalloc(DWORD dwSize)
Definition: misc.c:147
#define CM_REGISTRY_USER
Definition: cfgmgr32.h:802
BOOL WINAPI pSetupIsUserAdmin(VOID)
Definition: misc.c:1817
VOID WINAPI MyFree(LPVOID lpMem)
Definition: misc.c:128
LPWSTR WINAPI pSetupStringTableStringFromId(HSTRING_TABLE hStringTable, DWORD dwId)
Definition: stringtable.c:722
#define RpcExcept(expr)
Definition: rpc.h:127

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

1714 {
1715  FIXME("CM_Delete_Range(%I64u %I64u %p %lx)\n",
1716  ullStartValue, ullEndValue, rlh, ulFlags);
1717 
1718  return CR_CALL_NOT_IMPLEMENTED;
1719 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898

◆ CM_Detect_Resource_Conflict()

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

Definition at line 1727 of file cfgmgr.c.

1734 {
1735  TRACE("CM_Detect_Resource_Conflict(%p %lu %p %lu %p 0x%lx)\n",
1736  dnDevInst, ResourceID, ResourceData, ResourceLen,
1737  pbConflictDetected, ulFlags);
1738 
1739  return CM_Detect_Resource_Conflict_Ex(dnDevInst,
1740  ResourceID,
1741  ResourceData,
1742  ResourceLen,
1743  pbConflictDetected,
1744  ulFlags,
1745  NULL);
1746 }
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:1754
#define TRACE(s)
Definition: solgame.cpp:4
#define NULL
Definition: types.h:112

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

1762 {
1763  FIXME("CM_Detect_Resource_Conflict_Ex(%p %lu %p %lu %p 0x%lx %p)\n",
1764  dnDevInst, ResourceID, ResourceData, ResourceLen,
1765  pbConflictDetected, ulFlags, hMachine);
1766 
1767  return CR_CALL_NOT_IMPLEMENTED;
1768 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898

Referenced by CM_Detect_Resource_Conflict().

◆ CM_Disable_DevNode()

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

Definition at line 1776 of file cfgmgr.c.

1779 {
1780  TRACE("CM_Disable_DevNode(%p %lx)\n",
1781  dnDevInst, ulFlags);
1782 
1783  return CM_Disable_DevNode_Ex(dnDevInst, ulFlags, NULL);
1784 }
#define TRACE(s)
Definition: solgame.cpp:4
#define NULL
Definition: types.h:112
CONFIGRET WINAPI CM_Disable_DevNode_Ex(_In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:1792

◆ CM_Disable_DevNode_Ex()

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

Definition at line 1792 of file cfgmgr.c.

1796 {
1798  HSTRING_TABLE StringTable = NULL;
1799  LPWSTR lpDevInst;
1800  CONFIGRET ret;
1801 
1802  TRACE("CM_Disable_DevNode_Ex(%p %lx %p)\n",
1803  dnDevInst, ulFlags, hMachine);
1804 
1805  if (!pSetupIsUserAdmin())
1806  return CR_ACCESS_DENIED;
1807 
1808  if (dnDevInst == 0)
1809  return CR_INVALID_DEVINST;
1810 
1811  if (ulFlags != 0)
1812  return CR_INVALID_FLAG;
1813 
1814  if (hMachine != NULL)
1815  {
1816  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1817  if (BindingHandle == NULL)
1818  return CR_FAILURE;
1819 
1820  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
1821  if (StringTable == 0)
1822  return CR_FAILURE;
1823  }
1824  else
1825  {
1826  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
1827  return CR_FAILURE;
1828  }
1829 
1830  lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
1831  if (lpDevInst == NULL)
1832  return CR_INVALID_DEVNODE;
1833 
1834  RpcTryExcept
1835  {
1837  lpDevInst,
1838  NULL,
1839  NULL,
1840  0,
1841  ulFlags);
1842  }
1844  {
1846  }
1847  RpcEndExcept;
1848 
1849  return ret;
1850 }
#define RpcEndExcept
Definition: rpc.h:128
#define CR_INVALID_DEVINST
Definition: cfgmgr32.h:848
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
struct _MACHINE_INFO * PMACHINE_INFO
_In_ ULONG _Out_ HANDLE * BindingHandle
Definition: tdikrnl.h:1146
#define CR_ACCESS_DENIED
Definition: cfgmgr32.h:897
BOOL PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle, HSTRING_TABLE *StringTable)
Definition: rpc.c:66
#define RpcTryExcept
Definition: rpc.h:126
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define CR_FAILURE
Definition: cfgmgr32.h:865
DWORD WINAPI PNP_DisableDevInst(handle_t hBinding, LPWSTR pDeviceID, PPNP_VETO_TYPE pVetoType, LPWSTR pszVetoName, DWORD ulNameLength, DWORD ulFlags)
Definition: rpcserver.c:3320
int ret
#define CR_INVALID_DEVNODE
Definition: cfgmgr32.h:847
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:136
#define NULL
Definition: types.h:112
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
BOOL WINAPI pSetupIsUserAdmin(VOID)
Definition: misc.c:1817
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LPWSTR WINAPI pSetupStringTableStringFromId(HSTRING_TABLE hStringTable, DWORD dwId)
Definition: stringtable.c:722
#define RpcExcept(expr)
Definition: rpc.h:127

Referenced by CM_Disable_DevNode(), and StopDevice().

◆ CM_Disconnect_Machine()

CONFIGRET WINAPI CM_Disconnect_Machine ( _In_opt_ HMACHINE  hMachine)

Definition at line 1858 of file cfgmgr.c.

1860 {
1861  PMACHINE_INFO pMachine;
1862 
1863  TRACE("CM_Disconnect_Machine(%p)\n", hMachine);
1864 
1865  pMachine = (PMACHINE_INFO)hMachine;
1866  if (pMachine == NULL)
1867  return CR_SUCCESS;
1868 
1869  if (pMachine->bLocal == FALSE)
1870  {
1871  if (pMachine->StringTable != NULL)
1873 
1874  if (!PnpUnbindRpc(pMachine->BindingHandle))
1875  return CR_ACCESS_DENIED;
1876  }
1877 
1878  HeapFree(GetProcessHeap(), 0, pMachine);
1879 
1880  return CR_SUCCESS;
1881 }
struct _MACHINE_INFO * PMACHINE_INFO
#define CR_ACCESS_DENIED
Definition: cfgmgr32.h:897
RPC_STATUS PnpUnbindRpc(RPC_BINDING_HANDLE *BindingHandle)
Definition: rpc.c:53
#define FALSE
Definition: types.h:117
#define CR_SUCCESS
Definition: cfgmgr32.h:842
RPC_BINDING_HANDLE BindingHandle
Definition: cfgmgr.c:57
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
VOID WINAPI pSetupStringTableDestroy(HSTRING_TABLE hStringTable)
Definition: stringtable.c:145
#define NULL
Definition: types.h:112
BOOL bLocal
Definition: cfgmgr.c:59
#define HeapFree(x, y, z)
Definition: compat.h:594
HSTRING_TABLE StringTable
Definition: cfgmgr.c:58

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

1893 {
1894  FIXME("CM_Dup_Range_List(%p %p %lx)\n",
1895  rlhOld, rlhNew, ulFlags);
1896 
1897  return CR_CALL_NOT_IMPLEMENTED;
1898 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898

◆ CM_Enable_DevNode()

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

Definition at line 1906 of file cfgmgr.c.

1909 {
1910  TRACE("CM_Enable_DevNode(%p %lx)\n",
1911  dnDevInst, ulFlags);
1912 
1913  return CM_Enable_DevNode_Ex(dnDevInst, ulFlags, NULL);
1914 }
#define TRACE(s)
Definition: solgame.cpp:4
#define NULL
Definition: types.h:112
CONFIGRET WINAPI CM_Enable_DevNode_Ex(_In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:1922

◆ CM_Enable_DevNode_Ex()

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

Definition at line 1922 of file cfgmgr.c.

1926 {
1928  HSTRING_TABLE StringTable = NULL;
1929  LPWSTR lpDevInst;
1930  CONFIGRET ret;
1931 
1932  TRACE("CM_Enable_DevNode_Ex(%p %lx %p)\n",
1933  dnDevInst, ulFlags, hMachine);
1934 
1935  if (!pSetupIsUserAdmin())
1936  return CR_ACCESS_DENIED;
1937 
1938  if (dnDevInst == 0)
1939  return CR_INVALID_DEVINST;
1940 
1941  if (ulFlags != 0)
1942  return CR_INVALID_FLAG;
1943 
1944  if (hMachine != NULL)
1945  {
1946  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1947  if (BindingHandle == NULL)
1948  return CR_FAILURE;
1949 
1950  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
1951  if (StringTable == 0)
1952  return CR_FAILURE;
1953  }
1954  else
1955  {
1956  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
1957  return CR_FAILURE;
1958  }
1959 
1960  lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
1961  if (lpDevInst == NULL)
1962  return CR_INVALID_DEVNODE;
1963 
1964  RpcTryExcept
1965  {
1967  PNP_DEVINST_ENABLE,
1968  ulFlags,
1969  lpDevInst,
1970  NULL);
1971  }
1973  {
1975  }
1976  RpcEndExcept;
1977 
1978  return ret;
1979 }
#define RpcEndExcept
Definition: rpc.h:128
#define CR_INVALID_DEVINST
Definition: cfgmgr32.h:848
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
struct _MACHINE_INFO * PMACHINE_INFO
_In_ ULONG _Out_ HANDLE * BindingHandle
Definition: tdikrnl.h:1146
#define CR_ACCESS_DENIED
Definition: cfgmgr32.h:897
BOOL PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle, HSTRING_TABLE *StringTable)
Definition: rpc.c:66
#define RpcTryExcept
Definition: rpc.h:126
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define CR_FAILURE
Definition: cfgmgr32.h:865
DWORD WINAPI PNP_DeviceInstanceAction(handle_t hBinding, DWORD ulMajorAction, DWORD ulMinorAction, LPWSTR pszDeviceInstance1, LPWSTR pszDeviceInstance2)
Definition: rpcserver.c:3144
int ret
#define CR_INVALID_DEVNODE
Definition: cfgmgr32.h:847
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:136
#define NULL
Definition: types.h:112
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
BOOL WINAPI pSetupIsUserAdmin(VOID)
Definition: misc.c:1817
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LPWSTR WINAPI pSetupStringTableStringFromId(HSTRING_TABLE hStringTable, DWORD dwId)
Definition: stringtable.c:722
#define RpcExcept(expr)
Definition: rpc.h:127

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

◆ CM_Enumerate_Classes()

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

Definition at line 1987 of file cfgmgr.c.

1991 {
1992  TRACE("CM_Enumerate_Classes(%lx %p %lx)\n",
1993  ulClassIndex, ClassGuid, ulFlags);
1994 
1995  return CM_Enumerate_Classes_Ex(ulClassIndex, ClassGuid, ulFlags, NULL);
1996 }
CONFIGRET WINAPI CM_Enumerate_Classes_Ex(_In_ ULONG ulClassIndex, _Out_ LPGUID ClassGuid, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2004
#define TRACE(s)
Definition: solgame.cpp:4
#define NULL
Definition: types.h:112

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

2009 {
2010  WCHAR szBuffer[MAX_GUID_STRING_LEN];
2013  ULONG ulLength = MAX_GUID_STRING_LEN;
2014 
2015  TRACE("CM_Enumerate_Classes_Ex(%lx %p %lx %p)\n",
2016  ulClassIndex, ClassGuid, ulFlags, hMachine);
2017 
2018  if (ClassGuid == NULL)
2019  return CR_INVALID_POINTER;
2020 
2021  if (ulFlags != 0)
2022  return CR_INVALID_FLAG;
2023 
2024  if (hMachine != NULL)
2025  {
2026  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2027  if (BindingHandle == NULL)
2028  return CR_FAILURE;
2029  }
2030  else
2031  {
2033  return CR_FAILURE;
2034  }
2035 
2036  RpcTryExcept
2037  {
2039  PNP_CLASS_SUBKEYS,
2040  ulClassIndex,
2041  szBuffer,
2043  &ulLength,
2044  ulFlags);
2045  }
2047  {
2049  }
2050  RpcEndExcept;
2051 
2052  if (ret == CR_SUCCESS)
2053  {
2054  /* Remove the {} */
2055  szBuffer[MAX_GUID_STRING_LEN - 2] = UNICODE_NULL;
2056 
2057  /* Convert the buffer to a GUID */
2058  if (UuidFromStringW(&szBuffer[1], ClassGuid) != RPC_S_OK)
2059  return CR_FAILURE;
2060  }
2061 
2062  return ret;
2063 }
#define RpcEndExcept
Definition: rpc.h:128
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
struct _MACHINE_INFO * PMACHINE_INFO
_In_ ULONG _Out_ HANDLE * BindingHandle
Definition: tdikrnl.h:1146
BOOL PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle, HSTRING_TABLE *StringTable)
Definition: rpc.c:66
#define UNICODE_NULL
RPC_STATUS WINAPI UuidFromStringW(RPC_WSTR s, UUID *uuid)
Definition: rpcrt4_main.c:612
#define RpcTryExcept
Definition: rpc.h:126
#define CR_SUCCESS
Definition: cfgmgr32.h:842
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:801
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_GUID_STRING_LEN
Definition: apphelp.c:29
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define CR_FAILURE
Definition: cfgmgr32.h:865
int ret
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:136
#define NULL
Definition: types.h:112
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
unsigned int ULONG
Definition: retypes.h:1
#define RPC_S_OK
Definition: rpcnterr.h:22
#define RpcExcept(expr)
Definition: rpc.h:127

Referenced by CM_Enumerate_Classes(), 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 2109 of file cfgmgr.c.

2115 {
2116  WCHAR szBuffer[MAX_DEVICE_ID_LEN];
2117  ULONG ulOrigLength;
2118  ULONG ulLength;
2120 
2121  TRACE("CM_Enumerate_Enumerators_ExA(%lu %p %p %lx %p)\n",
2122  ulEnumIndex, Buffer, pulLength, ulFlags, hMachine);
2123 
2124  if (Buffer == NULL || pulLength == NULL)
2125  return CR_INVALID_POINTER;
2126 
2127  if (ulFlags != 0)
2128  return CR_INVALID_FLAG;
2129 
2130  ulOrigLength = *pulLength;
2131  *pulLength = 0;
2132 
2133  ulLength = MAX_DEVICE_ID_LEN;
2134  ret = CM_Enumerate_Enumerators_ExW(ulEnumIndex, szBuffer, &ulLength,
2135  ulFlags, hMachine);
2136  if (ret == CR_SUCCESS)
2137  {
2139  0,
2140  szBuffer,
2141  ulLength,
2142  Buffer,
2143  ulOrigLength,
2144  NULL,
2145  NULL) == 0)
2146  ret = CR_FAILURE;
2147  else
2148  *pulLength = lstrlenA(Buffer) + 1;
2149  }
2150 
2151  return ret;
2152 }
#define WideCharToMultiByte
Definition: compat.h:111
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
#define CP_ACP
Definition: compat.h:109
#define CR_SUCCESS
Definition: cfgmgr32.h:842
Definition: bufpool.h:45
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define CR_FAILURE
Definition: cfgmgr32.h:865
#define MAX_DEVICE_ID_LEN
Definition: devaction.c:40
int ret
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
CONFIGRET WINAPI CM_Enumerate_Enumerators_ExW(_In_ ULONG ulEnumIndex, _Out_writes_(*pulLength) PWCHAR Buffer, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2160
#define NULL
Definition: types.h:112
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
unsigned int ULONG
Definition: retypes.h:1

Referenced by CM_Enumerate_EnumeratorsA().

◆ CM_Enumerate_Enumerators_ExW()

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

Definition at line 2160 of file cfgmgr.c.

2166 {
2168  CONFIGRET ret;
2169 
2170  TRACE("CM_Enumerate_Enumerators_ExW(%lu %p %p %lx %p)\n",
2171  ulEnumIndex, Buffer, pulLength, ulFlags, hMachine);
2172 
2173  if (Buffer == NULL || pulLength == NULL)
2174  return CR_INVALID_POINTER;
2175 
2176  if (ulFlags != 0)
2177  return CR_INVALID_FLAG;
2178 
2179  *Buffer = UNICODE_NULL;
2180 
2181  if (hMachine != NULL)
2182  {
2183  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2184  if (BindingHandle == NULL)
2185  return CR_FAILURE;
2186  }
2187  else
2188  {
2190  return CR_FAILURE;
2191  }
2192 
2193  RpcTryExcept
2194  {
2196  PNP_ENUMERATOR_SUBKEYS,
2197  ulEnumIndex,
2198  Buffer,
2199  *pulLength,
2200  pulLength,
2201  ulFlags);
2202  }
2204  {
2206  }
2207  RpcEndExcept;
2208 
2209  return ret;
2210 }
#define RpcEndExcept
Definition: rpc.h:128
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
struct _MACHINE_INFO * PMACHINE_INFO
_In_ ULONG _Out_ HANDLE * BindingHandle
Definition: tdikrnl.h:1146
BOOL PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle, HSTRING_TABLE *StringTable)
Definition: rpc.c:66
#define UNICODE_NULL
#define RpcTryExcept
Definition: rpc.h:126
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:801
Definition: bufpool.h:45
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define CR_FAILURE
Definition: cfgmgr32.h:865
int ret
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:136
#define NULL
Definition: types.h:112
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
#define RpcExcept(expr)
Definition: rpc.h:127

Referenced by CM_Enumerate_Enumerators_ExA(), and CM_Enumerate_EnumeratorsW().

◆ CM_Enumerate_EnumeratorsA()

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

Definition at line 2071 of file cfgmgr.c.

2076 {
2077  TRACE("CM_Enumerate_EnumeratorsA(%lu %p %p %lx)\n",
2078  ulEnumIndex, Buffer, pulLength, ulFlags);
2079 
2080  return CM_Enumerate_Enumerators_ExA(ulEnumIndex, Buffer, pulLength,
2081  ulFlags, NULL);
2082 }
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:2109
Definition: bufpool.h:45
#define TRACE(s)
Definition: solgame.cpp:4
#define NULL
Definition: types.h:112

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

2095 {
2096  TRACE("CM_Enumerate_EnumeratorsW(%lu %p %p %lx)\n",
2097  ulEnumIndex, Buffer, pulLength, ulFlags);
2098 
2099  return CM_Enumerate_Enumerators_ExW(ulEnumIndex, Buffer, pulLength,
2100  ulFlags, NULL);
2101 }
Definition: bufpool.h:45
#define TRACE(s)
Definition: solgame.cpp:4
CONFIGRET WINAPI CM_Enumerate_Enumerators_ExW(_In_ ULONG ulEnumIndex, _Out_writes_(*pulLength) PWCHAR Buffer, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2160
#define NULL
Definition: types.h:112

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

2226 {
2227  FIXME("CM_Find_Range(%p %I64u %lu %I64u %I64u %p %lx)\n",
2228  pullStart, ullStart, ulLength, ullAlignment, ullEnd, rlh, ulFlags);
2229 
2230  return CR_CALL_NOT_IMPLEMENTED;
2231 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898

◆ CM_First_Range()

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

Definition at line 2239 of file cfgmgr.c.

2245 {
2246  PINTERNAL_RANGE_LIST pRangeList;
2247  PINTERNAL_RANGE pRange;
2248  PLIST_ENTRY ListEntry;
2250 
2251  FIXME("CM_First_Range(%p %p %p %p %lx)\n",
2252  rlh, pullStart, pullEnd, preElement, ulFlags);
2253 
2254  pRangeList = (PINTERNAL_RANGE_LIST)rlh;
2255 
2256  if (!IsValidRangeList(pRangeList))
2257  return CR_INVALID_RANGE_LIST;
2258 
2259  if (pullStart == NULL || pullEnd == NULL || preElement == NULL)
2260  return CR_INVALID_POINTER;
2261 
2262  if (ulFlags != 0)
2263  return CR_INVALID_FLAG;
2264 
2265  /* Lock the range list */
2266  WaitForSingleObject(pRangeList->hMutex, INFINITE);
2267 
2268  /* Fail, if the list is empty */
2269  if (IsListEmpty(&pRangeList->ListHead))
2270  {
2271  ret = CR_FAILURE;
2272  goto done;
2273  }
2274 
2275  /* Get the first range */
2276  ListEntry = pRangeList->ListHead.Flink;
2277  pRange = CONTAINING_RECORD(ListEntry, INTERNAL_RANGE, ListEntry);
2278 
2279  /* Return the range data */
2280  *pullStart = pRange->ullStart;
2281  *pullEnd = pRange->ullEnd;
2282  *preElement = (RANGE_ELEMENT)pRange;
2283 
2284 done:
2285  /* Unlock the range list */
2286  ReleaseMutex(pRangeList->hMutex);
2287 
2288  return ret;
2289 }
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
BOOL IsValidRangeList(_In_opt_ PINTERNAL_RANGE_LIST pRangeList)
Definition: cfgmgr.c:390
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define FIXME(fmt,...)
Definition: debug.h:111
#define CR_SUCCESS
Definition: cfgmgr32.h:842
struct _INTERNAL_RANGE_LIST * PINTERNAL_RANGE_LIST
DWORD_PTR RANGE_ELEMENT
Definition: cfgmgr32.h:105
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
DWORDLONG ullStart
Definition: cfgmgr.c:87
#define CR_FAILURE
Definition: cfgmgr32.h:865
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseMutex(IN HANDLE hMutex)
Definition: synch.c:618
int ret
DWORDLONG ullEnd
Definition: cfgmgr.c:88
Definition: typedefs.h:119
#define NULL
Definition: types.h:112
#define CR_INVALID_RANGE_LIST
Definition: cfgmgr32.h:863
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
LIST_ENTRY ListHead
Definition: cfgmgr.c:95
#define INFINITE
Definition: serial.h:102

◆ CM_Free_Log_Conf()

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

Definition at line 2297 of file cfgmgr.c.

2300 {
2301  TRACE("CM_Free_Log_Conf(%lx %lx)\n",
2302  lcLogConfToBeFreed, ulFlags);
2303 
2304  return CM_Free_Log_Conf_Ex(lcLogConfToBeFreed, ulFlags, NULL);
2305 }
CONFIGRET WINAPI CM_Free_Log_Conf_Ex(_In_ LOG_CONF lcLogConfToBeFreed, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2313
#define TRACE(s)
Definition: solgame.cpp:4
#define NULL
Definition: types.h:112

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

2317 {
2319  HSTRING_TABLE StringTable = NULL;
2320  LPWSTR lpDevInst;
2321  PLOG_CONF_INFO pLogConfInfo;
2322  CONFIGRET ret;
2323 
2324  TRACE("CM_Free_Log_Conf_Ex(%lx %lx %p)\n",
2325  lcLogConfToBeFreed, ulFlags, hMachine);
2326 
2327  if (!pSetupIsUserAdmin())
2328  return CR_ACCESS_DENIED;
2329 
2330  pLogConfInfo = (PLOG_CONF_INFO)lcLogConfToBeFreed;
2331  if (!IsValidLogConf(pLogConfInfo))
2332  return CR_INVALID_LOG_CONF;
2333 
2334  if (ulFlags != 0)
2335  return CR_INVALID_FLAG;
2336 
2337  if (hMachine != NULL)
2338  {
2339  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2340  if (BindingHandle == NULL)
2341  return CR_FAILURE;
2342 
2343  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
2344  if (StringTable == 0)
2345  return CR_FAILURE;
2346  }
2347  else
2348  {
2349  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
2350  return CR_FAILURE;
2351  }
2352 
2353  lpDevInst = pSetupStringTableStringFromId(StringTable, pLogConfInfo->dnDevInst);
2354  if (lpDevInst == NULL)
2355  return CR_INVALID_DEVNODE;
2356 
2357  RpcTryExcept
2358  {
2360  lpDevInst,
2361  pLogConfInfo->ulType,
2362  pLogConfInfo->ulTag,
2363  0);
2364  }
2366  {
2368  }
2369  RpcEndExcept;
2370 
2371  return ret;
2372 }
#define RpcEndExcept
Definition: rpc.h:128
ULONG ulType
Definition: cfgmgr.c:67
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
struct _MACHINE_INFO * PMACHINE_INFO
_In_ ULONG _Out_ HANDLE * BindingHandle
Definition: tdikrnl.h:1146
ULONG ulTag
Definition: cfgmgr.c:68
#define CR_ACCESS_DENIED
Definition: cfgmgr32.h:897
struct _LOG_CONF_INFO * PLOG_CONF_INFO
BOOL PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle, HSTRING_TABLE *StringTable)
Definition: rpc.c:66
DWORD WINAPI PNP_FreeLogConf(handle_t hBinding, LPWSTR pDeviceID, DWORD ulLogConfType, DWORD ulLogConfTag, DWORD ulFlags)
Definition: rpcserver.c:3954
#define RpcTryExcept
Definition: rpc.h:126
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define CR_INVALID_LOG_CONF
Definition: cfgmgr32.h:850
#define CR_FAILURE
Definition: cfgmgr32.h:865
int ret
#define CR_INVALID_DEVNODE
Definition: cfgmgr32.h:847
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:136
#define NULL
Definition: types.h:112
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
BOOL WINAPI pSetupIsUserAdmin(VOID)
Definition: misc.c:1817
WCHAR * LPWSTR
Definition: xmlstorage.h:184
DEVINST dnDevInst
Definition: cfgmgr.c:66
LPWSTR WINAPI pSetupStringTableStringFromId(HSTRING_TABLE hStringTable, DWORD dwId)
Definition: stringtable.c:722
#define RpcExcept(expr)
Definition: rpc.h:127
BOOL IsValidLogConf(_In_opt_ PLOG_CONF_INFO pLogConfInfo)
Definition: cfgmgr.c:414

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

2382 {
2383  PLOG_CONF_INFO pLogConfInfo;
2384 
2385  TRACE("CM_Free_Log_Conf_Handle(%lx)\n", lcLogConf);
2386 
2387  pLogConfInfo = (PLOG_CONF_INFO)lcLogConf;
2388  if (!IsValidLogConf(pLogConfInfo))
2389  return CR_INVALID_LOG_CONF;
2390 
2391  HeapFree(GetProcessHeap(), 0, pLogConfInfo);
2392 
2393  return CR_SUCCESS;
2394 }
struct _LOG_CONF_INFO * PLOG_CONF_INFO
#define CR_SUCCESS
Definition: cfgmgr32.h:842
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
#define CR_INVALID_LOG_CONF
Definition: cfgmgr32.h:850
#define HeapFree(x, y, z)
Definition: compat.h:594
BOOL IsValidLogConf(_In_opt_ PLOG_CONF_INFO pLogConfInfo)
Definition: cfgmgr.c:414

◆ CM_Free_Range_List()

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

Definition at line 2402 of file cfgmgr.c.

2405 {
2406  PINTERNAL_RANGE_LIST pRangeList;
2407  PINTERNAL_RANGE pRange;
2408  PLIST_ENTRY ListEntry;
2409 
2410  FIXME("CM_Free_Range_List(%p %lx)\n",
2411  RangeList, ulFlags);
2412 
2413  pRangeList = (PINTERNAL_RANGE_LIST)RangeList;
2414 
2415  if (!IsValidRangeList(pRangeList))
2416  return CR_INVALID_RANGE_LIST;
2417 
2418  if (ulFlags != 0)
2419  return CR_INVALID_FLAG;
2420 
2421  /* Lock the range list */
2422  WaitForSingleObject(pRangeList->hMutex, INFINITE);
2423 
2424  /* Free the list of ranges */
2425  while (!IsListEmpty(&pRangeList->ListHead))
2426  {
2427  ListEntry = RemoveHeadList(&pRangeList->ListHead);
2428  pRange = CONTAINING_RECORD(ListEntry, INTERNAL_RANGE, ListEntry);
2429  HeapFree(GetProcessHeap(), 0, pRange);
2430  }
2431 
2432  /* Unlock the range list */
2433  ReleaseMutex(pRangeList->hMutex);
2434 
2435  /* Close the mutex */
2436  CloseHandle(pRangeList->hMutex);
2437 
2438  /* Free the range list */
2439  HeapFree(GetProcessHeap(), 0, pRangeList);
2440 
2441  return CR_SUCCESS;
2442 }
#define CloseHandle
Definition: compat.h:598
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
BOOL IsValidRangeList(_In_opt_ PINTERNAL_RANGE_LIST pRangeList)
Definition: cfgmgr.c:390
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define FIXME(fmt,...)
Definition: debug.h:111
#define CR_SUCCESS
Definition: cfgmgr32.h:842
struct _INTERNAL_RANGE_LIST * PINTERNAL_RANGE_LIST
FORCEINLINE PLIST_ENTRY RemoveHeadList(_Inout_ PLIST_ENTRY ListHead)
Definition: rtlfuncs.h:128
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define GetProcessHeap()
Definition: compat.h:595
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseMutex(IN HANDLE hMutex)
Definition: synch.c:618
Definition: typedefs.h:119
#define CR_INVALID_RANGE_LIST
Definition: cfgmgr32.h:863
LIST_ENTRY ListHead
Definition: cfgmgr.c:95
#define INFINITE
Definition: serial.h:102
#define HeapFree(x, y, z)
Definition: compat.h:594

◆ CM_Free_Res_Des()

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

Definition at line 2450 of file cfgmgr.c.

2454 {
2455  TRACE("CM_Free_Res_Des(%p %p %lx)\n",
2456  prdResDes, rdResDes, ulFlags);
2457 
2458  return CM_Free_Res_Des_Ex(prdResDes, rdResDes, ulFlags, NULL);
2459 }
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:2467
#define TRACE(s)
Definition: solgame.cpp:4
#define NULL
Definition: types.h:112

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

2472 {
2473  FIXME("CM_Free_Res_Des_Ex(%p %p %lx %p)\n",
2474  prdResDes, rdResDes, ulFlags, hMachine);
2475 
2476  return CR_CALL_NOT_IMPLEMENTED;
2477 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898

Referenced by CM_Free_Res_Des().

◆ CM_Free_Res_Des_Handle()

CONFIGRET WINAPI CM_Free_Res_Des_Handle ( _In_ RES_DES  rdResDes)

Definition at line 2485 of file cfgmgr.c.

2487 {
2488  FIXME("CM_Free_Res_Des_Handle(%p)\n", rdResDes);
2489 
2490  return CR_CALL_NOT_IMPLEMENTED;
2491 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898

◆ CM_Free_Resource_Conflict_Handle()

CONFIGRET WINAPI CM_Free_Resource_Conflict_Handle ( _In_ CONFLICT_LIST  clConflictList)

Definition at line 2499 of file cfgmgr.c.

2501 {
2502  PCONFLICT_DATA pConflictData;
2503 
2504  FIXME("CM_Free_Resource_Conflict_Handle(%p)\n",
2505  clConflictList);
2506 
2507  pConflictData = (PCONFLICT_DATA)clConflictList;
2508  if (!IsValidConflictData(pConflictData))
2509  return CR_INVALID_CONFLICT_LIST;
2510 
2511  if (pConflictData->pConflictList != NULL)
2512  MyFree(pConflictData->pConflictList);
2513 
2514  MyFree(pConflictData);
2515 
2516  return CR_SUCCESS;
2517 }
BOOL IsValidConflictData(_In_opt_ PCONFLICT_DATA pConflictData)
Definition: cfgmgr.c:438
PPNP_CONFLICT_LIST pConflictList
Definition: cfgmgr.c:103
#define FIXME(fmt,...)
Definition: debug.h:111
#define CR_SUCCESS
Definition: cfgmgr32.h:842
#define CR_INVALID_CONFLICT_LIST
Definition: cfgmgr32.h:903
#define NULL
Definition: types.h:112
struct _CONFLICT_DATA * PCONFLICT_DATA
VOID WINAPI MyFree(LPVOID lpMem)
Definition: misc.c:128

◆ CM_Get_Child()

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

Definition at line 2525 of file cfgmgr.c.

2529 {
2530  TRACE("CM_Get_Child(%p %p %lx)\n",
2531  pdnDevInst, dnDevInst, ulFlags);
2532 
2533  return CM_Get_Child_Ex(pdnDevInst, dnDevInst, ulFlags, NULL);
2534 }
#define TRACE(s)
Definition: solgame.cpp:4
CONFIGRET WINAPI CM_Get_Child_Ex(_Out_ PDEVINST pdnDevInst, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2542
#define NULL
Definition: types.h:112

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

◆ CM_Get_Child_Ex()

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

Definition at line 2542 of file cfgmgr.c.

2547 {
2548  WCHAR szRelatedDevInst[MAX_DEVICE_ID_LEN];
2550  HSTRING_TABLE StringTable = NULL;
2551  LPWSTR lpDevInst;
2552  DWORD dwIndex, dwLength = MAX_DEVICE_ID_LEN;
2553  CONFIGRET ret;
2554 
2555  TRACE("CM_Get_Child_Ex(%p %lx %lx %p)\n",
2556  pdnDevInst, dnDevInst, ulFlags, hMachine);
2557 
2558  if (pdnDevInst == NULL)
2559  return CR_INVALID_POINTER;
2560 
2561  if (dnDevInst == 0)
2562  return CR_INVALID_DEVINST;
2563 
2564  if (ulFlags != 0)
2565  return CR_INVALID_FLAG;
2566 
2567  *pdnDevInst = -1;
2568 
2569  if (hMachine != NULL)
2570  {
2571  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2572  if (BindingHandle == NULL)
2573  return CR_FAILURE;
2574 
2575  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
2576  if (StringTable == 0)
2577  return CR_FAILURE;
2578  }
2579  else
2580  {
2581  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
2582  return CR_FAILURE;
2583  }
2584 
2585  lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
2586  if (lpDevInst == NULL)
2587  return CR_INVALID_DEVNODE;
2588 
2589  RpcTryExcept
2590  {
2592  PNP_GET_CHILD_DEVICE_INSTANCE,
2593  lpDevInst,
2594  szRelatedDevInst,
2595  &dwLength,
2596  0);
2597  }
2599  {
2601  }
2602  RpcEndExcept;
2603 
2604  if (ret != CR_SUCCESS)
2605  return ret;
2606 
2607  TRACE("szRelatedDevInst: %s\n", debugstr_w(szRelatedDevInst));
2608 
2609  dwIndex = pSetupStringTableAddString(StringTable, szRelatedDevInst, 1);
2610  if (dwIndex == -1)
2611  return CR_FAILURE;
2612 
2613  *pdnDevInst = dwIndex;
2614 
2615  return CR_SUCCESS;
2616 }
#define RpcEndExcept
Definition: rpc.h:128
#define CR_INVALID_DEVINST
Definition: cfgmgr32.h:848
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
struct _MACHINE_INFO * PMACHINE_INFO
_In_ ULONG _Out_ HANDLE * BindingHandle
Definition: tdikrnl.h:1146
BOOL PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle, HSTRING_TABLE *StringTable)
Definition: rpc.c:66
#define debugstr_w
Definition: kernel32.h:32
#define RpcTryExcept
Definition: rpc.h:126
#define CR_SUCCESS
Definition: cfgmgr32.h:842
#define RpcExceptionCode()
Definition: rpc.h:132
DWORD WINAPI pSetupStringTableAddString(HSTRING_TABLE hStringTable, LPWSTR lpString, DWORD dwFlags)
Definition: stringtable.c:196
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
static DWORD DWORD * dwLength
Definition: fusion.c:85
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define CR_FAILURE
Definition: cfgmgr32.h:865
unsigned long DWORD
Definition: ntddk_ex.h:95
#define MAX_DEVICE_ID_LEN
Definition: devaction.c:40
int ret
#define CR_INVALID_DEVNODE
Definition: cfgmgr32.h:847
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:136
#define NULL
Definition: types.h:112
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LPWSTR WINAPI pSetupStringTableStringFromId(HSTRING_TABLE hStringTable, DWORD dwId)
Definition: stringtable.c:722
#define RpcExcept(expr)
Definition: rpc.h:127
DWORD WINAPI PNP_GetRelatedDeviceInstance(handle_t hBinding, DWORD ulRelationship, LPWSTR pDeviceID, LPWSTR pRelatedDeviceId, PNP_RPC_STRING_LEN *pulLength, DWORD ulFlags)
Definition: rpcserver.c:750

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

2668 {
2669  WCHAR szBuffer[MAX_GUID_STRING_LEN];
2671  ULONG ulLength;
2672  ULONG ulOrigLength;
2673 
2674  TRACE("CM_Get_Class_Key_Name_ExA(%p %p %p %lx %p)\n",
2675  ClassGuid, pszKeyName, pulLength, ulFlags, hMachine);
2676 
2677  if (ClassGuid == NULL || pszKeyName == NULL || pulLength == NULL)
2678  return CR_INVALID_POINTER;
2679 
2680  ulOrigLength = *pulLength;
2681  *pulLength = 0;
2682 
2683  ulLength = MAX_GUID_STRING_LEN;
2684  ret = CM_Get_Class_Key_Name_ExW(ClassGuid, szBuffer, &ulLength,
2685  ulFlags, hMachine);
2686  if (ret == CR_SUCCESS)
2687  {
2689  0,
2690  szBuffer,
2691  ulLength,
2692  pszKeyName,
2693  ulOrigLength,
2694  NULL,
2695  NULL) == 0)
2696  ret = CR_FAILURE;
2697  else
2698  *pulLength = lstrlenA(pszKeyName) + 1;
2699  }
2700 
2701  return CR_SUCCESS;
2702 }
#define WideCharToMultiByte
Definition: compat.h:111
#define CP_ACP
Definition: compat.h:109
#define CR_SUCCESS
Definition: cfgmgr32.h:842
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_GUID_STRING_LEN
Definition: apphelp.c:29
#define CR_FAILURE
Definition: cfgmgr32.h:865
int ret
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
#define NULL
Definition: types.h:112
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
unsigned int ULONG
Definition: retypes.h:1
CONFIGRET WINAPI CM_Get_Class_Key_Name_ExW(_In_ LPGUID ClassGuid, _Out_writes_opt_(*pulLength) LPWSTR pszKeyName, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2710

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

2716 {
2717  TRACE("CM_Get_Class_Key_Name_ExW(%p %p %p %lx %p)\n",
2718  ClassGuid, pszKeyName, pulLength, ulFlags, hMachine);
2719 
2720  if (ClassGuid == NULL || pszKeyName == NULL || pulLength == NULL)
2721  return CR_INVALID_POINTER;
2722 
2723  if (ulFlags != 0)
2724  return CR_INVALID_FLAG;
2725 
2726  if (*pulLength < MAX_GUID_STRING_LEN)
2727  {
2728  *pulLength = 0;
2729  return CR_BUFFER_SMALL;
2730  }
2731 
2732  if (!GuidToString(ClassGuid, pszKeyName))
2733  return CR_INVALID_DATA;
2734 
2735  *pulLength = MAX_GUID_STRING_LEN;
2736 
2737  return CR_SUCCESS;
2738 }
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
#define CR_SUCCESS
Definition: cfgmgr32.h:842
#define TRACE(s)
Definition: solgame.cpp:4
#define MAX_GUID_STRING_LEN
Definition: apphelp.c:29
#define CR_BUFFER_SMALL
Definition: cfgmgr32.h:872
#define CR_INVALID_DATA
Definition: cfgmgr32.h:877
static BOOL GuidToString(_In_ LPGUID Guid, _Out_ LPWSTR String)
Definition: cfgmgr.c:113
#define NULL
Definition: types.h:112
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845

Referenced by CM_Get_Class_Key_Name_ExA(), and CM_Get_Class_Key_NameW().

◆ CM_Get_Class_Key_NameA()

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

Definition at line 2624 of file cfgmgr.c.

2629 {
2630  TRACE("CM_Get_Class_Key_NameA(%p %p %p %lx)\n",
2631  ClassGuid, pszKeyName, pulLength, ulFlags);
2632 
2633  return CM_Get_Class_Key_Name_ExA(ClassGuid, pszKeyName, pulLength,
2634  ulFlags, NULL);
2635 }
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:2662
#define TRACE(s)
Definition: solgame.cpp:4
#define NULL
Definition: types.h:112

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

2648 {
2649  TRACE("CM_Get_Class_Key_NameW(%p %p %p %lx)\n",
2650  ClassGuid, pszKeyName, pulLength, ulFlags);
2651 
2652  return CM_Get_Class_Key_Name_ExW(ClassGuid, pszKeyName, pulLength,
2653  ulFlags, NULL);
2654 }
#define TRACE(s)
Definition: solgame.cpp:4
#define NULL
Definition: types.h:112
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:2710

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

2790 {
2791  WCHAR szBuffer[MAX_CLASS_NAME_LEN];
2793  ULONG ulLength;
2794  ULONG ulOrigLength;
2795 
2796  TRACE("CM_Get_Class_Name_ExA(%p %p %p %lx %p)\n",
2797  ClassGuid, Buffer, pulLength, ulFlags, hMachine);
2798 
2799  if (ClassGuid == NULL || Buffer == NULL || pulLength == NULL)
2800  return CR_INVALID_POINTER;
2801 
2802  ulOrigLength = *pulLength;
2803  *pulLength = 0;
2804 
2805  ulLength = MAX_CLASS_NAME_LEN;
2806  ret = CM_Get_Class_Name_ExW(ClassGuid, szBuffer, &ulLength,
2807  ulFlags, hMachine);
2808  if (ret == CR_SUCCESS)
2809  {
2811  0,
2812  szBuffer,
2813  ulLength,
2814  Buffer,
2815  ulOrigLength,
2816  NULL,
2817  NULL) == 0)
2818  ret = CR_FAILURE;
2819  else
2820  *pulLength = lstrlenA(Buffer) + 1;
2821  }
2822 
2823  return ret;
2824 }
#define WideCharToMultiByte
Definition: compat.h:111
#define CP_ACP
Definition: compat.h:109
#define CR_SUCCESS
Definition: cfgmgr32.h:842
Definition: bufpool.h:45
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define CR_FAILURE
Definition: cfgmgr32.h:865
int ret
CONFIGRET WINAPI CM_Get_Class_Name_ExW(_In_ LPGUID ClassGuid, _Out_writes_opt_(*pulLength) PWCHAR Buffer, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2832
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
#define NULL
Definition: types.h:112
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
unsigned int ULONG
Definition: retypes.h:1
#define MAX_CLASS_NAME_LEN
Definition: cfgmgr32.h:52

Referenced by CM_Get_Class_NameA().

◆ CM_Get_Class_Name_ExW()

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

Definition at line 2832 of file cfgmgr.c.

2838 {
2839  WCHAR szGuidString[MAX_GUID_STRING_LEN];
2841  CONFIGRET ret;
2842 
2843  TRACE("CM_Get_Class_Name_ExW(%p %p %p %lx %p\n",
2844  ClassGuid, Buffer, pulLength, ulFlags, hMachine);
2845 
2846  if (ClassGuid == NULL || Buffer == NULL || pulLength == NULL)
2847  return CR_INVALID_POINTER;
2848 
2849  if (ulFlags != 0)
2850  return CR_INVALID_FLAG;
2851 
2852  if (!GuidToString(ClassGuid, szGuidString))
2853  return CR_INVALID_DATA;
2854 
2855  TRACE("Guid %s\n", debugstr_w(szGuidString));
2856 
2857  if (hMachine != NULL)
2858  {
2859  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2860  if (BindingHandle == NULL)
2861  return CR_FAILURE;
2862  }
2863  else
2864  {
2866  return CR_FAILURE;
2867  }
2868 
2869  RpcTryExcept
2870  {
2872  szGuidString,
2873  Buffer,
2874  pulLength,
2875  ulFlags);
2876  }
2878  {
2880  }
2881  RpcEndExcept;
2882 
2883  return ret;
2884 }
#define RpcEndExcept
Definition: rpc.h:128
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
struct _MACHINE_INFO * PMACHINE_INFO
_In_ ULONG _Out_ HANDLE * BindingHandle
Definition: tdikrnl.h:1146
BOOL PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle, HSTRING_TABLE *StringTable)
Definition: rpc.c:66
#define debugstr_w
Definition: kernel32.h:32
#define RpcTryExcept
Definition: rpc.h:126
Definition: bufpool.h:45
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_GUID_STRING_LEN
Definition: apphelp.c:29
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define CR_FAILURE
Definition: cfgmgr32.h:865
#define CR_INVALID_DATA
Definition: cfgmgr32.h:877
int ret
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:136
DWORD WINAPI PNP_GetClassName(handle_t hBinding, LPWSTR pszClassGuid, LPWSTR Buffer, PNP_RPC_STRING_LEN *pulLength, DWORD ulFlags)
Definition: rpcserver.c:2370
static BOOL GuidToString(_In_ LPGUID Guid, _Out_ LPWSTR String)
Definition: cfgmgr.c:113
#define NULL
Definition: types.h:112
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
#define RpcExcept(expr)
Definition: rpc.h:127

Referenced by CM_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 2746 of file cfgmgr.c.

2751 {
2752  TRACE("CM_Get_Class_NameA(%p %p %p %lx)\n",
2753  ClassGuid, Buffer, pulLength, ulFlags);
2754 
2755  return CM_Get_Class_Name_ExA(ClassGuid, Buffer, pulLength, ulFlags,
2756  NULL);
2757 }
Definition: bufpool.h:45
#define TRACE(s)
Definition: solgame.cpp:4
CONFIGRET WINAPI CM_Get_Class_Name_ExA(_In_ LPGUID ClassGuid, _Out_writes_opt_(*pulLength) PCHAR Buffer, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2784
#define NULL
Definition: types.h:112

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

2770 {
2771  TRACE("CM_Get_Class_NameW(%p %p %p %lx)\n",
2772  ClassGuid, Buffer, pulLength, ulFlags);
2773 
2774  return CM_Get_Class_Name_ExW(ClassGuid, Buffer, pulLength, ulFlags,
2775  NULL);
2776 }
Definition: bufpool.h:45
#define TRACE(s)
Definition: solgame.cpp:4
CONFIGRET WINAPI CM_Get_Class_Name_ExW(_In_ LPGUID ClassGuid, _Out_writes_opt_(*pulLength) PWCHAR Buffer, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2832
#define NULL
Definition: types.h:112

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

2900 {
2901  PWSTR BufferW = NULL;
2902  ULONG ulLength = 0;
2903  ULONG ulType;
2904  CONFIGRET ret;
2905 
2906  TRACE("CM_Get_Class_Registry_PropertyA(%p %lu %p %p %p %lx %p)\n",
2907  ClassGuid, ulProperty, pulRegDataType, Buffer, pulLength,
2908  ulFlags, hMachine);
2909 
2910  if (pulLength == NULL)
2911  return CR_INVALID_POINTER;
2912 
2913  if (ulProperty < CM_CRP_MIN || ulProperty > CM_CRP_MAX)
2914  return CR_INVALID_PROPERTY;
2915 
2916  ulType = GetRegistryPropertyType(ulProperty);
2917  if (ulType == REG_SZ || ulType == REG_MULTI_SZ)
2918  {
2919  /* Get the required buffer size */
2920  ret = CM_Get_Class_Registry_PropertyW(ClassGuid, ulProperty, pulRegDataType,
2921  NULL, &ulLength, ulFlags, hMachine);
2922  if (ret != CR_BUFFER_SMALL)
2923  return ret;
2924 
2925  /* Allocate the unicode buffer */
2926  BufferW = HeapAlloc(GetProcessHeap(), 0, ulLength);
2927  if (BufferW == NULL)
2928  return CR_OUT_OF_MEMORY;
2929 
2930  /* Get the property */
2931  ret = CM_Get_Class_Registry_PropertyW(ClassGuid, ulProperty, pulRegDataType,
2932  BufferW, &ulLength, ulFlags, hMachine);
2933  if (ret != CR_SUCCESS)
2934  {
2935  HeapFree(GetProcessHeap(), 0, BufferW);
2936  return ret;
2937  }
2938 
2939  /* Do W->A conversion */
2940  *pulLength = WideCharToMultiByte(CP_ACP,
2941  0,
2942  BufferW,
2943  ulLength,
2944  Buffer,
2945  *pulLength,
2946  NULL,
2947  NULL);
2948 
2949  /* Release the unicode buffer */
2950  HeapFree(GetProcessHeap(), 0, BufferW);
2951 
2952  if (*pulLength == 0)
2953  ret = CR_FAILURE;
2954  }
2955  else
2956  {
2957  /* Get the property */
2958  ret = CM_Get_Class_Registry_PropertyW(ClassGuid, ulProperty, pulRegDataType,
2959  Buffer, pulLength, ulFlags, hMachine);
2960  }
2961 
2962  return ret;
2963 }
#define WideCharToMultiByte
Definition: compat.h:111
CONFIGRET WINAPI CM_Get_Class_Registry_PropertyW(LPGUID ClassGuid, ULONG ulProperty, PULONG pulRegDataType, PVOID Buffer, PULONG pulLength, ULONG ulFlags, HMACHINE hMachine)
Definition: cfgmgr.c:2971
uint16_t * PWSTR
Definition: typedefs.h:56
#define CP_ACP
Definition: compat.h:109
#define REG_MULTI_SZ
Definition: nt_native.h:1501
#define CR_SUCCESS
Definition: cfgmgr32.h:842
#define CR_INVALID_PROPERTY
Definition: cfgmgr32.h:899
#define CR_OUT_OF_MEMORY
Definition: cfgmgr32.h:844
Definition: bufpool.h:45
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define CR_BUFFER_SMALL
Definition: cfgmgr32.h:872
#define CR_FAILURE
Definition: cfgmgr32.h:865
int ret
#define CM_CRP_MAX
Definition: cfgmgr32.h:733
#define NULL
Definition: types.h:112
static ULONG GetRegistryPropertyType(_In_ ULONG ulProperty)
Definition: cfgmgr.c:145
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
_In_z_ PCWSTR _In_ ULONG ulType
Definition: ntuser.h:37
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
unsigned int ULONG
Definition: retypes.h:1
#define HeapFree(x, y, z)
Definition: compat.h:594
#define REG_SZ
Definition: layer.c:22

◆ CM_Get_Class_Registry_PropertyW()

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

Definition at line 2971 of file cfgmgr.c.

2979 {
2981  WCHAR szGuidString[PNP_MAX_GUID_STRING_LEN + 1];
2982  ULONG ulType = 0;
2983  ULONG ulTransferLength = 0;
2984  CONFIGRET ret;
2985 
2986  TRACE("CM_Get_Class_Registry_PropertyW(%p %lu %p %p %p %lx %p)\n",
2987  ClassGuid, ulProperty, pulRegDataType, Buffer, pulLength,
2988  ulFlags, hMachine);
2989 
2990  if (ClassGuid == NULL || pulLength == NULL)
2991  return CR_INVALID_POINTER;
2992 
2993  if (ulFlags != 0)
2994  return CR_INVALID_FLAG;
2995 
2996  if (pSetupStringFromGuid(ClassGuid,
2997  szGuidString,
2999  return CR_INVALID_DATA;
3000 
3001  if (ulProperty < CM_CRP_MIN || ulProperty > CM_CRP_MAX)
3002  return CR_INVALID_PROPERTY;
3003 
3004  if (hMachine != NULL)
3005  {
3006  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
3007  if (BindingHandle == NULL)
3008  return CR_FAILURE;
3009  }
3010  else
3011  {
3013  return CR_FAILURE;
3014  }
3015 
3016  ulTransferLength = *pulLength;
3017 
3018  RpcTryExcept
3019  {
3021  szGuidString,
3022  ulProperty,
3023  &ulType,
3024  Buffer,
3025  &ulTransferLength,
3026  pulLength,
3027  ulFlags);
3028  }
3030  {
3032  }
3033  RpcEndExcept;
3034 
3035  if (ret == CR_SUCCESS)
3036  {
3037  if (pulRegDataType != NULL)
3038  *pulRegDataType = ulType;
3039  }
3040 
3041  return ret;
3042 }
#define RpcEndExcept
Definition: rpc.h:128
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
struct _MACHINE_INFO * PMACHINE_INFO
_In_ ULONG _Out_ HANDLE * BindingHandle
Definition: tdikrnl.h:1146
BOOL PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle, HSTRING_TABLE *StringTable)
Definition: rpc.c:66
#define RpcTryExcept
Definition: rpc.h:126
#define CR_SUCCESS
Definition: cfgmgr32.h:842
const unsigned long PNP_MAX_GUID_STRING_LEN
Definition: pnp.idl:9
#define CR_INVALID_PROPERTY
Definition: cfgmgr32.h:899
Definition: bufpool.h:45
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define CR_FAILURE
Definition: cfgmgr32.h:865
DWORD WINAPI pSetupStringFromGuid(LPGUID lpGUID, PWSTR pString, DWORD dwStringLen)
Definition: misc.c:1775
#define CR_INVALID_DATA
Definition: cfgmgr32.h:877
int ret
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:136
#define CM_CRP_MAX
Definition: cfgmgr32.h:733
#define NULL
Definition: types.h:112
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
_In_z_ PCWSTR _In_ ULONG ulType
Definition: ntuser.h:37
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:2603
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
unsigned int ULONG
Definition: retypes.h:1
#define RpcExcept(expr)
Definition: rpc.h:127

Referenced by CM_Get_Class_Registry_PropertyA().

◆ CM_Get_Depth()

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

Definition at line 3050 of file cfgmgr.c.

3054 {
3055  TRACE("CM_Get_Depth(%p %lx %lx)\n",
3056  pulDepth, dnDevInst, ulFlags);
3057 
3058  return CM_Get_Depth_Ex(pulDepth, dnDevInst, ulFlags, NULL);
3059 }
#define TRACE(s)
Definition: solgame.cpp:4
CONFIGRET WINAPI CM_Get_Depth_Ex(_Out_ PULONG pulDepth, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:3067
#define NULL
Definition: types.h:112

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

3072 {
3074  HSTRING_TABLE StringTable = NULL;
3075  LPWSTR lpDevInst;
3076  CONFIGRET ret;
3077 
3078