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

Go to the source code of this file.

Classes

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

Macros

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

Typedefs

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

Functions

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

Variables

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

Macro Definition Documentation

◆ CONFLICT_MAGIC

#define CONFLICT_MAGIC   0x11225588

Definition at line 106 of file cfgmgr.c.

◆ LOG_CONF_MAGIC

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

Definition at line 71 of file cfgmgr.c.

◆ NOTIFY_MAGIC

#define NOTIFY_MAGIC   0x44556677

Definition at line 80 of file cfgmgr.c.

◆ RANGE_LIST_MAGIC

#define RANGE_LIST_MAGIC   0x33445566

Definition at line 98 of file cfgmgr.c.

Typedef Documentation

◆ CONFLICT_DATA

◆ INTERNAL_RANGE

◆ INTERNAL_RANGE_LIST

◆ LOG_CONF_INFO

◆ MACHINE_INFO

◆ NOTIFY_DATA

◆ PCONFLICT_DATA

◆ PINTERNAL_RANGE

◆ PINTERNAL_RANGE_LIST

◆ PLOG_CONF_INFO

◆ PMACHINE_INFO

◆ PNOTIFY_DATA

Function Documentation

◆ CM_Add_Empty_Log_Conf()

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

Definition at line 865 of file cfgmgr.c.

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

◆ CM_Add_Empty_Log_Conf_Ex()

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

Definition at line 884 of file cfgmgr.c.

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

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

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

Referenced by CM_Add_ID_ExA(), and CM_Add_IDW().

◆ CM_Add_IDA()

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

Definition at line 976 of file cfgmgr.c.

980 {
981  TRACE("CM_Add_IDA(%p %s %lx)\n",
982  dnDevInst, debugstr_a(pszID), ulFlags);
983 
984  return CM_Add_ID_ExA(dnDevInst, pszID, ulFlags, NULL);
985 }
#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:1010

◆ CM_Add_IDW()

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

Definition at line 993 of file cfgmgr.c.

997 {
998  TRACE("CM_Add_IDW(%p %s %lx)\n",
999  dnDevInst, debugstr_w(pszID), ulFlags);
1000 
1001  return CM_Add_ID_ExW(dnDevInst, pszID, ulFlags, NULL);
1002 }
#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:1038
#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 1106 of file cfgmgr.c.

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

1176 {
1177  TRACE("CM_Add_Res_Des(%p %p %lu %p %lu %lx)\n",
1178  prdResDes, lcLogConf, ResourceID, ResourceData, ResourceLen, ulFlags);
1179 
1180  return CM_Add_Res_Des_Ex(prdResDes, lcLogConf, ResourceID, ResourceData,
1181  ResourceLen, ulFlags, NULL);
1182 }
CONFIGRET WINAPI CM_Add_Res_Des_Ex(_Out_opt_ PRES_DES prdResDes, _In_ LOG_CONF lcLogConf, _In_ RESOURCEID ResourceID, _In_reads_bytes_(ResourceLen) PCVOID ResourceData, _In_ ULONG ResourceLen, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:1190
#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 1190 of file cfgmgr.c.

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

1215 {
1216  PWSTR pServerNameW;
1217  CONFIGRET ret;
1218 
1219  TRACE("CM_Connect_MachineA(%s %p)\n",
1220  debugstr_a(UNCServerName), phMachine);
1221 
1222  if (UNCServerName == NULL || *UNCServerName == 0)
1223  return CM_Connect_MachineW(NULL, phMachine);
1224 
1225  if (pSetupCaptureAndConvertAnsiArg(UNCServerName, &pServerNameW))
1226  return CR_INVALID_DATA;
1227 
1228  ret = CM_Connect_MachineW(pServerNameW, phMachine);
1229 
1230  MyFree(pServerNameW);
1231 
1232  return ret;
1233 }
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:1241
#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 1241 of file cfgmgr.c.

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

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

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

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

◆ CM_Create_DevNodeW()

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

Definition at line 1329 of file cfgmgr.c.

1334 {
1335  TRACE("CM_Create_DevNodeW(%p %s %p %lx)\n",
1336  pdnDevInst, debugstr_w(pDeviceID), dnParent, ulFlags);
1337 
1338  return CM_Create_DevNode_ExW(pdnDevInst, pDeviceID, dnParent,
1339  ulFlags, NULL);
1340 }
CONFIGRET WINAPI CM_Create_DevNode_ExW(_Out_ PDEVINST pdnDevInst, _In_ DEVINSTID_W pDeviceID, _In_ DEVINST dnParent, _In_ ULONG ulFlags, _In_opt_ HANDLE hMachine)
Definition: cfgmgr.c:1378
#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 1463 of file cfgmgr.c.

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

1510 {
1511  TRACE("CM_Delete_Class_Key(%p %lx)\n",
1512  ClassGuid, ulFlags);
1513 
1514  return CM_Delete_Class_Key_Ex(ClassGuid, ulFlags, NULL);
1515 }
CONFIGRET WINAPI CM_Delete_Class_Key_Ex(_In_ LPGUID ClassGuid, _In_ ULONG ulFlags, _In_opt_ HANDLE hMachine)
Definition: cfgmgr.c:1523
#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 1523 of file cfgmgr.c.

1527 {
1528  WCHAR szGuidString[MAX_GUID_STRING_LEN];
1530  CONFIGRET ret;
1531 
1532  TRACE("CM_Delete_Class_Key_Ex(%p %lx %p)\n",
1533  ClassGuid, ulFlags, hMachine);
1534 
1535  if (ClassGuid == NULL)
1536  return CR_INVALID_POINTER;
1537 
1538  if (ulFlags & ~CM_DELETE_CLASS_BITS)
1539  return CR_INVALID_FLAG;
1540 
1541  if (!GuidToString(ClassGuid, szGuidString))
1542  return CR_INVALID_DATA;
1543 
1544  if (hMachine != NULL)
1545  {
1546  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1547  if (BindingHandle == NULL)
1548  return CR_FAILURE;
1549  }
1550  else
1551  {
1553  return CR_FAILURE;
1554  }
1555 
1556  RpcTryExcept
1557  {
1559  szGuidString,
1560  ulFlags);
1561  }
1563  {
1565  }
1566  RpcEndExcept;
1567 
1568  return ret;
1569 }
#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:2478
#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 1577 of file cfgmgr.c.

1581 {
1582  TRACE("CM_Delete_DevNode_Key(%p %lu %lx)\n",
1583  dnDevInst, ulHardwareProfile, ulFlags);
1584 
1585  return CM_Delete_DevNode_Key_Ex(dnDevInst, ulHardwareProfile, ulFlags,
1586  NULL);
1587 }
CONFIGRET WINAPI CM_Delete_DevNode_Key_Ex(_In_ DEVINST dnDevInst, _In_ ULONG ulHardwareProfile, _In_ ULONG ulFlags, _In_opt_ HANDLE hMachine)
Definition: cfgmgr.c:1595
#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 1595 of file cfgmgr.c.

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

1719 {
1720  FIXME("CM_Delete_Range(%I64u %I64u %p %lx)\n",
1721  ullStartValue, ullEndValue, rlh, ulFlags);
1722 
1723  return CR_CALL_NOT_IMPLEMENTED;
1724 }
#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 1732 of file cfgmgr.c.

1739 {
1740  TRACE("CM_Detect_Resource_Conflict(%p %lu %p %lu %p 0x%lx)\n",
1741  dnDevInst, ResourceID, ResourceData, ResourceLen,
1742  pbConflictDetected, ulFlags);
1743 
1744  return CM_Detect_Resource_Conflict_Ex(dnDevInst,
1745  ResourceID,
1746  ResourceData,
1747  ResourceLen,
1748  pbConflictDetected,
1749  ulFlags,
1750  NULL);
1751 }
CONFIGRET WINAPI CM_Detect_Resource_Conflict_Ex(_In_ DEVINST dnDevInst, _In_ RESOURCEID ResourceID, _In_reads_bytes_(ResourceLen) PCVOID ResourceData, _In_ ULONG ResourceLen, _Out_ PBOOL pbConflictDetected, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:1759
#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 1759 of file cfgmgr.c.

1767 {
1768  FIXME("CM_Detect_Resource_Conflict_Ex(%p %lu %p %lu %p 0x%lx %p)\n",
1769  dnDevInst, ResourceID, ResourceData, ResourceLen,
1770  pbConflictDetected, ulFlags, hMachine);
1771 
1772  return CR_CALL_NOT_IMPLEMENTED;
1773 }
#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 1781 of file cfgmgr.c.

1784 {
1785  TRACE("CM_Disable_DevNode(%p %lx)\n",
1786  dnDevInst, ulFlags);
1787 
1788  return CM_Disable_DevNode_Ex(dnDevInst, ulFlags, NULL);
1789 }
#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:1797

◆ CM_Disable_DevNode_Ex()

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

Definition at line 1797 of file cfgmgr.c.

1801 {
1803  HSTRING_TABLE StringTable = NULL;
1804  LPWSTR lpDevInst;
1805  CONFIGRET ret;
1806 
1807  TRACE("CM_Disable_DevNode_Ex(%p %lx %p)\n",
1808  dnDevInst, ulFlags, hMachine);
1809 
1810  if (!pSetupIsUserAdmin())
1811  return CR_ACCESS_DENIED;
1812 
1813  if (dnDevInst == 0)
1814  return CR_INVALID_DEVINST;
1815 
1816  if (ulFlags != 0)
1817  return CR_INVALID_FLAG;
1818 
1819  if (hMachine != NULL)
1820  {
1821  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1822  if (BindingHandle == NULL)
1823  return CR_FAILURE;
1824 
1825  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
1826  if (StringTable == 0)
1827  return CR_FAILURE;
1828  }
1829  else
1830  {
1831  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
1832  return CR_FAILURE;
1833  }
1834 
1835  lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
1836  if (lpDevInst == NULL)
1837  return CR_INVALID_DEVNODE;
1838 
1839  RpcTryExcept
1840  {
1842  lpDevInst,
1843  NULL,
1844  NULL,
1845  0,
1846  ulFlags);
1847  }
1849  {
1851  }
1852  RpcEndExcept;
1853 
1854  return ret;
1855 }
#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:3468
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 1863 of file cfgmgr.c.

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

1898 {
1899  FIXME("CM_Dup_Range_List(%p %p %lx)\n",
1900  rlhOld, rlhNew, ulFlags);
1901 
1902  return CR_CALL_NOT_IMPLEMENTED;
1903 }
#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 1911 of file cfgmgr.c.

1914 {
1915  TRACE("CM_Enable_DevNode(%p %lx)\n",
1916  dnDevInst, ulFlags);
1917 
1918  return CM_Enable_DevNode_Ex(dnDevInst, ulFlags, NULL);
1919 }
#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:1927

◆ CM_Enable_DevNode_Ex()

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

Definition at line 1927 of file cfgmgr.c.

1931 {
1933  HSTRING_TABLE StringTable = NULL;
1934  LPWSTR lpDevInst;
1935  CONFIGRET ret;
1936 
1937  TRACE("CM_Enable_DevNode_Ex(%p %lx %p)\n",
1938  dnDevInst, ulFlags, hMachine);
1939 
1940  if (!pSetupIsUserAdmin())
1941  return CR_ACCESS_DENIED;
1942 
1943  if (dnDevInst == 0)
1944  return CR_INVALID_DEVINST;
1945 
1946  if (ulFlags != 0)
1947  return CR_INVALID_FLAG;
1948 
1949  if (hMachine != NULL)
1950  {
1951  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1952  if (BindingHandle == NULL)
1953  return CR_FAILURE;
1954 
1955  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
1956  if (StringTable == 0)
1957  return CR_FAILURE;
1958  }
1959  else
1960  {
1961  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
1962  return CR_FAILURE;
1963  }
1964 
1965  lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
1966  if (lpDevInst == NULL)
1967  return CR_INVALID_DEVNODE;
1968 
1969  RpcTryExcept
1970  {
1972  PNP_DEVINST_ENABLE,
1973  ulFlags,
1974  lpDevInst,
1975  NULL);
1976  }
1978  {
1980  }
1981  RpcEndExcept;
1982 
1983  return ret;
1984 }
#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:3292
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 1992 of file cfgmgr.c.

1996 {
1997  TRACE("CM_Enumerate_Classes(%lx %p %lx)\n",
1998  ulClassIndex, ClassGuid, ulFlags);
1999 
2000  return CM_Enumerate_Classes_Ex(ulClassIndex, ClassGuid, ulFlags, NULL);
2001 }
CONFIGRET WINAPI CM_Enumerate_Classes_Ex(_In_ ULONG ulClassIndex, _Out_ LPGUID ClassGuid, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2009
#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 2009 of file cfgmgr.c.

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

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

2171 {
2173  CONFIGRET ret;
2174 
2175  TRACE("CM_Enumerate_Enumerators_ExW(%lu %p %p %lx %p)\n",
2176  ulEnumIndex, Buffer, pulLength, ulFlags, hMachine);
2177 
2178  if (Buffer == NULL || pulLength == NULL)
2179  return CR_INVALID_POINTER;
2180 
2181  if (ulFlags != 0)
2182  return CR_INVALID_FLAG;
2183 
2184  *Buffer = UNICODE_NULL;
2185 
2186  if (hMachine != NULL)
2187  {
2188  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2189  if (BindingHandle == NULL)
2190  return CR_FAILURE;
2191  }
2192  else
2193  {
2195  return CR_FAILURE;
2196  }
2197 
2198  RpcTryExcept
2199  {
2201  PNP_ENUMERATOR_SUBKEYS,
2202  ulEnumIndex,
2203  Buffer,
2204  *pulLength,
2205  pulLength,
2206  ulFlags);
2207  }
2209  {
2211  }
2212  RpcEndExcept;
2213 
2214  return ret;
2215 }
#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:851
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 2076 of file cfgmgr.c.

2081 {
2082  TRACE("CM_Enumerate_EnumeratorsA(%lu %p %p %lx)\n",
2083  ulEnumIndex, Buffer, pulLength, ulFlags);
2084 
2085  return CM_Enumerate_Enumerators_ExA(ulEnumIndex, Buffer, pulLength,
2086  ulFlags, NULL);
2087 }
CONFIGRET WINAPI CM_Enumerate_Enumerators_ExA(_In_ ULONG ulEnumIndex, _Out_writes_(*pulLength) PCHAR Buffer, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2114
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 2095 of file cfgmgr.c.

2100 {
2101  TRACE("CM_Enumerate_EnumeratorsW(%lu %p %p %lx)\n",
2102  ulEnumIndex, Buffer, pulLength, ulFlags);
2103 
2104  return CM_Enumerate_Enumerators_ExW(ulEnumIndex, Buffer, pulLength,
2105  ulFlags, NULL);
2106 }
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:2165
#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 2223 of file cfgmgr.c.

2231 {
2232  FIXME("CM_Find_Range(%p %I64u %lu %I64u %I64u %p %lx)\n",
2233  pullStart, ullStart, ulLength, ullAlignment, ullEnd, rlh, ulFlags);
2234 
2235  return CR_CALL_NOT_IMPLEMENTED;
2236 }
#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 2244 of file cfgmgr.c.

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

2305 {
2306  TRACE("CM_Free_Log_Conf(%lx %lx)\n",
2307  lcLogConfToBeFreed, ulFlags);
2308 
2309  return CM_Free_Log_Conf_Ex(lcLogConfToBeFreed, ulFlags, NULL);
2310 }
CONFIGRET WINAPI CM_Free_Log_Conf_Ex(_In_ LOG_CONF lcLogConfToBeFreed, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2318
#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 2318 of file cfgmgr.c.

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

2387 {
2388  PLOG_CONF_INFO pLogConfInfo;
2389 
2390  TRACE("CM_Free_Log_Conf_Handle(%lx)\n", lcLogConf);
2391 
2392  pLogConfInfo = (PLOG_CONF_INFO)lcLogConf;
2393  if (!IsValidLogConf(pLogConfInfo))
2394  return CR_INVALID_LOG_CONF;
2395 
2396  HeapFree(GetProcessHeap(), 0, pLogConfInfo);
2397 
2398  return CR_SUCCESS;
2399 }
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 2407 of file cfgmgr.c.

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

2459 {
2460  TRACE("CM_Free_Res_Des(%p %p %lx)\n",
2461  prdResDes, rdResDes, ulFlags);
2462 
2463  return CM_Free_Res_Des_Ex(prdResDes, rdResDes, ulFlags, NULL);
2464 }
CONFIGRET WINAPI CM_Free_Res_Des_Ex(_Out_ PRES_DES prdResDes, _In_ RES_DES rdResDes, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2472
#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 2472 of file cfgmgr.c.

2477 {
2478  FIXME("CM_Free_Res_Des_Ex(%p %p %lx %p)\n",
2479  prdResDes, rdResDes, ulFlags, hMachine);
2480 
2481  return CR_CALL_NOT_IMPLEMENTED;
2482 }
#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 2490 of file cfgmgr.c.

2492 {
2493  FIXME("CM_Free_Res_Des_Handle(%p)\n", rdResDes);
2494 
2495  return CR_CALL_NOT_IMPLEMENTED;
2496 }
#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 2504 of file cfgmgr.c.

2506 {
2507  PCONFLICT_DATA pConflictData;
2508 
2509  FIXME("CM_Free_Resource_Conflict_Handle(%p)\n",
2510  clConflictList);
2511 
2512  pConflictData = (PCONFLICT_DATA)clConflictList;
2513  if (!IsValidConflictData(pConflictData))
2514  return CR_INVALID_CONFLICT_LIST;
2515 
2516  if (pConflictData->pConflictList != NULL)
2517  MyFree(pConflictData->pConflictList);
2518 
2519  MyFree(pConflictData);
2520 
2521  return CR_SUCCESS;
2522 }
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 2530 of file cfgmgr.c.

2534 {
2535  TRACE("CM_Get_Child(%p %p %lx)\n",
2536  pdnDevInst, dnDevInst, ulFlags);
2537 
2538  return CM_Get_Child_Ex(pdnDevInst, dnDevInst, ulFlags, NULL);
2539 }
#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:2547
#define NULL
Definition: types.h:112

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

◆ CM_Get_Child_Ex()

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

Definition at line 2547 of file cfgmgr.c.

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

Referenced by CM_Get_Child().

◆ CM_Get_Class_Key_Name_ExA()

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

Definition at line 2667 of file cfgmgr.c.

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

Referenced by CM_Get_Class_Key_NameA().

◆ CM_Get_Class_Key_Name_ExW()

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

Definition at line 2715 of file cfgmgr.c.

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

2634 {
2635  TRACE("CM_Get_Class_Key_NameA(%p %p %p %lx)\n",
2636  ClassGuid, pszKeyName, pulLength, ulFlags);
2637 
2638  return CM_Get_Class_Key_Name_ExA(ClassGuid, pszKeyName, pulLength,
2639  ulFlags, NULL);
2640 }
CONFIGRET WINAPI CM_Get_Class_Key_Name_ExA(_In_ LPGUID ClassGuid, _Out_writes_opt_(*pulLength) LPSTR pszKeyName, _Inout_ PULONG pulLength, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2667
#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 2648 of file cfgmgr.c.

2653 {
2654  TRACE("CM_Get_Class_Key_NameW(%p %p %p %lx)\n",
2655  ClassGuid, pszKeyName, pulLength, ulFlags);
2656 
2657  return CM_Get_Class_Key_Name_ExW(ClassGuid, pszKeyName, pulLength,
2658  ulFlags, NULL);
2659 }
#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:2715

◆ CM_Get_Class_Name_ExA()

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

Definition at line 2789 of file cfgmgr.c.

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

2843 {
2844  WCHAR szGuidString[MAX_GUID_STRING_LEN];
2846  CONFIGRET ret;
2847 
2848  TRACE("CM_Get_Class_Name_ExW(%p %p %p %lx %p\n",
2849  ClassGuid, Buffer, pulLength, ulFlags, hMachine);
2850 
2851  if (ClassGuid == NULL || Buffer == NULL || pulLength == NULL)
2852  return CR_INVALID_POINTER;
2853 
2854  if (ulFlags != 0)
2855  return CR_INVALID_FLAG;
2856 
2857  if (!GuidToString(ClassGuid, szGuidString))
2858  return CR_INVALID_DATA;
2859 
2860  TRACE("Guid %s\n", debugstr_w(szGuidString));
2861 
2862  if (hMachine != NULL)
2863  {
2864  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2865  if (BindingHandle == NULL)
2866  return CR_FAILURE;
2867  }
2868  else
2869  {
2871  return CR_FAILURE;
2872  }
2873 
2874  RpcTryExcept
2875  {
2877  szGuidString,
2878  Buffer,
2879  pulLength,
2880  ulFlags);
2881  }
2883  {
2885  }
2886  RpcEndExcept;
2887 
2888  return ret;
2889 }
#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:2420
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 2751 of file cfgmgr.c.

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

2775 {
2776  TRACE("CM_Get_Class_NameW(%p %p %p %lx)\n",
2777  ClassGuid, Buffer, pulLength, ulFlags);
2778 
2779  return CM_Get_Class_Name_ExW(ClassGuid, Buffer, pulLength, ulFlags,
2780  NULL);
2781 }
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:2837
#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 2897 of file cfgmgr.c.

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

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

3059 {
3060  TRACE("CM_Get_Depth(%p %lx %lx)\n",
3061  pulDepth, dnDevInst, ulFlags);
3062 
3063  return CM_Get_Depth_Ex(pulDepth, dnDevInst,