ReactOS  0.4.14-dev-1296-g56aa513
cfgmgr.c File Reference
#include "setupapi_private.h"
#include <dbt.h>
#include <pnp_c.h>
#include <winsvc.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 Backslash [] = {'\\', 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 103 of file cfgmgr.c.

◆ LOG_CONF_MAGIC

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

Definition at line 68 of file cfgmgr.c.

◆ NOTIFY_MAGIC

#define NOTIFY_MAGIC   0x44556677

Definition at line 77 of file cfgmgr.c.

◆ RANGE_LIST_MAGIC

#define RANGE_LIST_MAGIC   0x33445566

Definition at line 95 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 857 of file cfgmgr.c.

862 {
863  TRACE("CM_Add_Empty_Log_Conf(%p %p %lu %lx)\n",
864  plcLogConf, dnDevInst, Priority, ulFlags);
865 
866  return CM_Add_Empty_Log_Conf_Ex(plcLogConf, dnDevInst, Priority,
867  ulFlags, NULL);
868 }
_In_ KPRIORITY Priority
Definition: kefuncs.h:503
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
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:876

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

882 {
884  HSTRING_TABLE StringTable = NULL;
885  ULONG ulLogConfTag = 0;
886  LPWSTR lpDevInst;
887  PLOG_CONF_INFO pLogConfInfo;
889 
890  FIXME("CM_Add_Empty_Log_Conf_Ex(%p %p %lu %lx %p)\n",
891  plcLogConf, dnDevInst, Priority, ulFlags, hMachine);
892 
893  if (!pSetupIsUserAdmin())
894  return CR_ACCESS_DENIED;
895 
896  if (plcLogConf == NULL)
897  return CR_INVALID_POINTER;
898 
899  if (dnDevInst == 0)
900  return CR_INVALID_DEVINST;
901 
902  if (Priority > 0xFFFF)
903  return CR_INVALID_PRIORITY;
904 
905  if (ulFlags & ~(LOG_CONF_BITS | PRIORITY_BIT))
906  return CR_INVALID_FLAG;
907 
908  if (hMachine != NULL)
909  {
910  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
911  if (BindingHandle == NULL)
912  return CR_FAILURE;
913 
914  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
915  if (StringTable == 0)
916  return CR_FAILURE;
917  }
918  else
919  {
920  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
921  return CR_FAILURE;
922  }
923 
924  lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
925  if (lpDevInst == NULL)
926  return CR_INVALID_DEVNODE;
927 
929  {
931  &ulLogConfTag, ulFlags);
932  }
934  {
936  }
937  RpcEndExcept;
938 
939  if (ret == CR_SUCCESS)
940  {
941  pLogConfInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(LOG_CONF_INFO));
942  if (pLogConfInfo == NULL)
943  {
945  }
946  else
947  {
948  pLogConfInfo->ulMagic = LOG_CONF_MAGIC;
949  pLogConfInfo->dnDevInst = dnDevInst;
950  pLogConfInfo->ulFlags = ulFlags;
951  pLogConfInfo->ulTag = ulLogConfTag;
952 
953  *plcLogConf = (LOG_CONF)pLogConfInfo;
954 
955  ret = CR_SUCCESS;
956  }
957  }
958 
959  return ret;
960 }
#define RpcEndExcept
Definition: rpc.h:128
#define CR_INVALID_DEVINST
Definition: cfgmgr32.h:848
ULONG ulMagic
Definition: cfgmgr.c:62
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
_In_ KPRIORITY Priority
Definition: kefuncs.h:503
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:65
#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:110
#define RpcTryExcept
Definition: rpc.h:126
#define CR_SUCCESS
Definition: cfgmgr32.h:842
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
DWORD_PTR LOG_CONF
Definition: cfgmgr32.h:90
smooth NULL
Definition: ftsmooth.c:416
#define CR_OUT_OF_MEMORY
Definition: cfgmgr32.h:844
#define RpcExceptionCode()
Definition: rpc.h:132
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#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:3698
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:133
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:68
BOOL WINAPI pSetupIsUserAdmin(VOID)
Definition: misc.c:1817
WCHAR * LPWSTR
Definition: xmlstorage.h:184
DEVINST dnDevInst
Definition: cfgmgr.c:63
ULONG ulFlags
Definition: cfgmgr.c:64
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 1002 of file cfgmgr.c.

1007 {
1008  PWSTR pszIDW;
1009  CONFIGRET ret;
1010 
1011  TRACE("CM_Add_ID_ExA(%p %s %lx %p)\n",
1012  dnDevInst, debugstr_a(pszID), ulFlags, hMachine);
1013 
1014  if (pSetupCaptureAndConvertAnsiArg(pszID, &pszIDW))
1015  return CR_INVALID_DATA;
1016 
1017  ret = CM_Add_ID_ExW(dnDevInst, pszIDW, ulFlags, hMachine);
1018 
1019  MyFree(pszIDW);
1020 
1021  return ret;
1022 }
uint16_t * PWSTR
Definition: typedefs.h:55
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:1030
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 1030 of file cfgmgr.c.

1035 {
1037  HSTRING_TABLE StringTable = NULL;
1038  LPWSTR lpDevInst;
1039  CONFIGRET ret;
1040 
1041  TRACE("CM_Add_ID_ExW(%p %s %lx %p)\n",
1042  dnDevInst, debugstr_w(pszID), ulFlags, hMachine);
1043 
1044  if (!pSetupIsUserAdmin())
1045  return CR_ACCESS_DENIED;
1046 
1047  if (dnDevInst == 0)
1048  return CR_INVALID_DEVINST;
1049 
1050  if (pszID == NULL)
1051  return CR_INVALID_POINTER;
1052 
1053  if (ulFlags & ~CM_ADD_ID_BITS)
1054  return CR_INVALID_FLAG;
1055 
1056  if (hMachine != NULL)
1057  {
1058  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1059  if (BindingHandle == NULL)
1060  return CR_FAILURE;
1061 
1062  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
1063  if (StringTable == 0)
1064  return CR_FAILURE;
1065  }
1066  else
1067  {
1068  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
1069  return CR_FAILURE;
1070  }
1071 
1072  lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
1073  if (lpDevInst == NULL)
1074  return CR_INVALID_DEVNODE;
1075 
1076  RpcTryExcept
1077  {
1079  lpDevInst,
1080  pszID,
1081  ulFlags);
1082  }
1084  {
1086  }
1087  RpcEndExcept;
1088 
1089  return ret;
1090 }
#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 EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#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:133
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:3164

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

972 {
973  TRACE("CM_Add_IDA(%p %s %lx)\n",
974  dnDevInst, debugstr_a(pszID), ulFlags);
975 
976  return CM_Add_ID_ExA(dnDevInst, pszID, ulFlags, NULL);
977 }
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
CONFIGRET WINAPI CM_Add_ID_ExA(_In_ DEVINST dnDevInst, _In_ PSTR pszID, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:1002

◆ CM_Add_IDW()

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

Definition at line 985 of file cfgmgr.c.

989 {
990  TRACE("CM_Add_IDW(%p %s %lx)\n",
991  dnDevInst, debugstr_w(pszID), ulFlags);
992 
993  return CM_Add_ID_ExW(dnDevInst, pszID, ulFlags, NULL);
994 }
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
#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:1030

◆ CM_Add_Range()

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

Definition at line 1098 of file cfgmgr.c.

1103 {
1104  PINTERNAL_RANGE_LIST pRangeList;
1105  PINTERNAL_RANGE pRange;
1107 
1108  FIXME("CM_Add_Range(%I64u %I64u %p %lx)\n",
1109  ullStartValue, ullEndValue, rlh, ulFlags);
1110 
1111  pRangeList = (PINTERNAL_RANGE_LIST)rlh;
1112 
1113  if (!IsValidRangeList(pRangeList))
1114  return CR_INVALID_RANGE_LIST;
1115 
1116  if (ulFlags & ~CM_ADD_RANGE_BITS)
1117  return CR_INVALID_FLAG;
1118 
1119  if (ullEndValue < ullStartValue)
1120  return CR_INVALID_RANGE;
1121 
1122  /* Lock the range list */
1123  WaitForSingleObject(pRangeList->hMutex, INFINITE);
1124 
1125  /* Allocate the new range */
1126  pRange = HeapAlloc(GetProcessHeap(), 0, sizeof(INTERNAL_RANGE));
1127  if (pRange == NULL)
1128  {
1130  goto done;
1131  }
1132 
1133  pRange->pRangeList = pRangeList;
1134  pRange->ullStart = ullStartValue;
1135  pRange->ullEnd = ullEndValue;
1136 
1137  /* Insert the range */
1138  if (IsListEmpty(&pRangeList->ListHead))
1139  {
1140  InsertTailList(&pRangeList->ListHead, &pRange->ListEntry);
1141  }
1142  else
1143  {
1144  HeapFree(GetProcessHeap(), 0, pRange);
1145  UNIMPLEMENTED;
1146  }
1147 
1148 done:
1149  /* Unlock the range list */
1150  ReleaseMutex(pRangeList->hMutex);
1151 
1152  return ret;
1153 }
#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:387
struct _INTERNAL_RANGE_LIST * pRangeList
Definition: cfgmgr.c:83
#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:110
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
struct _INTERNAL_RANGE_LIST * PINTERNAL_RANGE_LIST
#define CR_OUT_OF_MEMORY
Definition: cfgmgr32.h:844
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
DWORDLONG ullStart
Definition: cfgmgr.c:84
LIST_ENTRY ListEntry
Definition: cfgmgr.c:82
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseMutex(IN HANDLE hMutex)
Definition: synch.c:618
int ret
DWORDLONG ullEnd
Definition: cfgmgr.c:85
#define CR_INVALID_RANGE_LIST
Definition: cfgmgr32.h:863
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
LIST_ENTRY ListHead
Definition: cfgmgr.c:92
#define UNIMPLEMENTED
Definition: debug.h:114
#define INFINITE
Definition: serial.h:102
#define CM_ADD_RANGE_BITS
Definition: cfgmgr32.h:594
#define HeapFree(x, y, z)
Definition: compat.h:402

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

1168 {
1169  TRACE("CM_Add_Res_Des(%p %p %lu %p %lu %lx)\n",
1170  prdResDes, lcLogConf, ResourceID, ResourceData, ResourceLen, ulFlags);
1171 
1172  return CM_Add_Res_Des_Ex(prdResDes, lcLogConf, ResourceID, ResourceData,
1173  ResourceLen, ulFlags, NULL);
1174 }
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:1182
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4

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

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

1207 {
1208  PWSTR pServerNameW;
1209  CONFIGRET ret;
1210 
1211  TRACE("CM_Connect_MachineA(%s %p)\n",
1212  debugstr_a(UNCServerName), phMachine);
1213 
1214  if (UNCServerName == NULL || *UNCServerName == 0)
1215  return CM_Connect_MachineW(NULL, phMachine);
1216 
1217  if (pSetupCaptureAndConvertAnsiArg(UNCServerName, &pServerNameW))
1218  return CR_INVALID_DATA;
1219 
1220  ret = CM_Connect_MachineW(pServerNameW, phMachine);
1221 
1222  MyFree(pServerNameW);
1223 
1224  return ret;
1225 }
uint16_t * PWSTR
Definition: typedefs.h:55
DWORD WINAPI pSetupCaptureAndConvertAnsiArg(LPCSTR pSrc, LPWSTR *pDst)
Definition: misc.c:574
smooth NULL
Definition: ftsmooth.c:416
#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:1233
#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

◆ CM_Connect_MachineW()

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

Definition at line 1233 of file cfgmgr.c.

1236 {
1237  PMACHINE_INFO pMachine;
1238 
1239  TRACE("CM_Connect_MachineW(%s %p)\n",
1240  debugstr_w(UNCServerName), phMachine);
1241 
1242  if (phMachine == NULL)
1243  return CR_INVALID_POINTER;
1244 
1245  *phMachine = NULL;
1246 
1247  pMachine = HeapAlloc(GetProcessHeap(), 0, sizeof(MACHINE_INFO));
1248  if (pMachine == NULL)
1249  return CR_OUT_OF_MEMORY;
1250 
1251  if (UNCServerName == NULL || *UNCServerName == 0)
1252  {
1253  pMachine->bLocal = TRUE;
1254 
1255  /* FIXME: store the computers name in pMachine->szMachineName */
1256 
1257  if (!PnpGetLocalHandles(&pMachine->BindingHandle,
1258  &pMachine->StringTable))
1259  {
1260  HeapFree(GetProcessHeap(), 0, pMachine);
1261  return CR_FAILURE;
1262  }
1263  }
1264  else
1265  {
1266  pMachine->bLocal = FALSE;
1267  if (wcslen(UNCServerName) >= SP_MAX_MACHINENAME_LENGTH - 1)
1268  {
1269  HeapFree(GetProcessHeap(), 0, pMachine);
1270  return CR_INVALID_MACHINENAME;
1271  }
1272  lstrcpyW(pMachine->szMachineName, UNCServerName);
1273 
1275  if (pMachine->StringTable == NULL)
1276  {
1277  HeapFree(GetProcessHeap(), 0, pMachine);
1278  return CR_FAILURE;
1279  }
1280 
1281  pSetupStringTableAddString(pMachine->StringTable, L"PLT", 1);
1282 
1283  if (!PnpBindRpc(UNCServerName, &pMachine->BindingHandle))
1284  {
1286  HeapFree(GetProcessHeap(), 0, pMachine);
1287  return CR_INVALID_MACHINENAME;
1288  }
1289  }
1290 
1291  *phMachine = (PHMACHINE)pMachine;
1292 
1293  return CR_SUCCESS;
1294 }
#define SP_MAX_MACHINENAME_LENGTH
Definition: setupapi.h:27
#define TRUE
Definition: types.h:120
HSTRING_TABLE WINAPI pSetupStringTableInitialize(VOID)
Definition: stringtable.c:54
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 debugstr_w
Definition: kernel32.h:32
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
RPC_BINDING_HANDLE BindingHandle
Definition: cfgmgr.c:54
#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:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
WCHAR szMachineName[SP_MAX_MACHINENAME_LENGTH]
Definition: cfgmgr.c:53
#define CR_FAILURE
Definition: cfgmgr32.h:865
static const WCHAR L[]
Definition: oid.c:1250
#define CR_INVALID_MACHINENAME
Definition: cfgmgr32.h:893
HMACHINE * PHMACHINE
Definition: cfgmgr32.h:109
VOID WINAPI pSetupStringTableDestroy(HSTRING_TABLE hStringTable)
Definition: stringtable.c:145
#define lstrcpyW
Definition: compat.h:414
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
BOOL bLocal
Definition: cfgmgr.c:56
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define HeapFree(x, y, z)
Definition: compat.h:402
HSTRING_TABLE StringTable
Definition: cfgmgr.c:55

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

1346 {
1347  DEVINSTID_W pDeviceIDW;
1348  CONFIGRET ret;
1349 
1350  TRACE("CM_Create_DevNode_ExA(%p %s %p %lx %p)\n",
1351  pdnDevInst, debugstr_a(pDeviceID), dnParent, ulFlags, hMachine);
1352 
1353  if (pSetupCaptureAndConvertAnsiArg(pDeviceID, &pDeviceIDW))
1354  return CR_INVALID_DATA;
1355 
1356  ret = CM_Create_DevNode_ExW(pdnDevInst, pDeviceIDW, dnParent, ulFlags,
1357  hMachine);
1358 
1359  MyFree(pDeviceIDW);
1360 
1361  return ret;
1362 }
_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:1370
#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 1370 of file cfgmgr.c.

1376 {
1378  HSTRING_TABLE StringTable = NULL;
1379  LPWSTR lpParentDevInst;
1381  WCHAR szLocalDeviceID[MAX_DEVICE_ID_LEN];
1382 
1383  TRACE("CM_Create_DevNode_ExW(%p %s %p %lx %p)\n",
1384  pdnDevInst, debugstr_w(pDeviceID), dnParent, ulFlags, hMachine);
1385 
1386  if (!pSetupIsUserAdmin())
1387  return CR_ACCESS_DENIED;
1388 
1389  if (pdnDevInst == NULL)
1390  return CR_INVALID_POINTER;
1391 
1392  if (pDeviceID == NULL || wcslen(pDeviceID) == 0 || wcslen(pDeviceID) >= MAX_DEVICE_ID_LEN)
1393  return CR_INVALID_DEVICE_ID;
1394 
1395  if (dnParent == 0)
1396  return CR_INVALID_DEVNODE;
1397 
1398  if (ulFlags & ~CM_CREATE_DEVNODE_BITS)
1399  return CR_INVALID_FLAG;
1400 
1401  if (hMachine != NULL)
1402  {
1403  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1404  if (BindingHandle == NULL)
1405  return CR_FAILURE;
1406 
1407  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
1408  if (StringTable == 0)
1409  return CR_FAILURE;
1410  }
1411  else
1412  {
1413  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
1414  return CR_FAILURE;
1415  }
1416 
1417  lpParentDevInst = pSetupStringTableStringFromId(StringTable, dnParent);
1418  if (lpParentDevInst == NULL)
1419  return CR_INVALID_DEVNODE;
1420 
1421  wcscpy(szLocalDeviceID, pDeviceID);
1422 
1423  RpcTryExcept
1424  {
1426  szLocalDeviceID,
1427  lpParentDevInst,
1429  ulFlags);
1430  }
1432  {
1434  }
1435  RpcEndExcept;
1436 
1437  if (ret == CR_SUCCESS)
1438  {
1439  /* If CM_CREATE_DEVINST_GENERATE_ID was passed in, PNP_CreateDevInst
1440  * will return the generated device ID in szLocalDeviceID */
1441  *pdnDevInst = pSetupStringTableAddString(StringTable, szLocalDeviceID, 1);
1442  if (*pdnDevInst == 0)
1444  }
1445 
1446  return ret;
1447 }
#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:2797
struct _MACHINE_INFO * PMACHINE_INFO
#define MAX_DEVICE_ID_LEN
Definition: pnpmgr.c:28
_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 EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#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 CR_FAILURE
Definition: cfgmgr32.h:865
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:133
#define CR_NO_SUCH_DEVNODE
Definition: cfgmgr32.h:857
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
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#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 1302 of file cfgmgr.c.

1307 {
1308  TRACE("CM_Create_DevNodeA(%p %s %p %lx)\n",
1309  pdnDevInst, debugstr_a(pDeviceID), dnParent, ulFlags);
1310 
1311  return CM_Create_DevNode_ExA(pdnDevInst, pDeviceID, dnParent,
1312  ulFlags, NULL);
1313 }
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
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:1340

◆ CM_Create_DevNodeW()

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

Definition at line 1321 of file cfgmgr.c.

1326 {
1327  TRACE("CM_Create_DevNodeW(%p %s %p %lx)\n",
1328  pdnDevInst, debugstr_w(pDeviceID), dnParent, ulFlags);
1329 
1330  return CM_Create_DevNode_ExW(pdnDevInst, pDeviceID, dnParent,
1331  ulFlags, NULL);
1332 }
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:1370
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4

◆ CM_Create_Range_List()

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

Definition at line 1455 of file cfgmgr.c.

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

◆ CM_Delete_Class_Key()

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

Definition at line 1499 of file cfgmgr.c.

1502 {
1503  TRACE("CM_Delete_Class_Key(%p %lx)\n",
1504  ClassGuid, ulFlags);
1505 
1506  return CM_Delete_Class_Key_Ex(ClassGuid, ulFlags, NULL);
1507 }
CONFIGRET WINAPI CM_Delete_Class_Key_Ex(_In_ LPGUID ClassGuid, _In_ ULONG ulFlags, _In_opt_ HANDLE hMachine)
Definition: cfgmgr.c:1515
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4

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

1519 {
1520  WCHAR szGuidString[MAX_GUID_STRING_LEN];
1522  CONFIGRET ret;
1523 
1524  TRACE("CM_Delete_Class_Key_Ex(%p %lx %p)\n",
1525  ClassGuid, ulFlags, hMachine);
1526 
1527  if (ClassGuid == NULL)
1528  return CR_INVALID_POINTER;
1529 
1530  if (ulFlags & ~CM_DELETE_CLASS_BITS)
1531  return CR_INVALID_FLAG;
1532 
1533  if (!GuidToString(ClassGuid, szGuidString))
1534  return CR_INVALID_DATA;
1535 
1536  if (hMachine != NULL)
1537  {
1538  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1539  if (BindingHandle == NULL)
1540  return CR_FAILURE;
1541  }
1542  else
1543  {
1545  return CR_FAILURE;
1546  }
1547 
1548  RpcTryExcept
1549  {
1551  szGuidString,
1552  ulFlags);
1553  }
1555  {
1557  }
1558  RpcEndExcept;
1559 
1560  return ret;
1561 }
#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 EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#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 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:133
static BOOL GuidToString(_In_ LPGUID Guid, _Out_ LPWSTR String)
Definition: cfgmgr.c:110
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:2290
#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 1569 of file cfgmgr.c.

1573 {
1574  TRACE("CM_Delete_DevNode_Key(%p %lu %lx)\n",
1575  dnDevInst, ulHardwareProfile, ulFlags);
1576 
1577  return CM_Delete_DevNode_Key_Ex(dnDevInst, ulHardwareProfile, ulFlags,
1578  NULL);
1579 }
CONFIGRET WINAPI CM_Delete_DevNode_Key_Ex(_In_ DEVINST dnDevInst, _In_ ULONG ulHardwareProfile, _In_ ULONG ulFlags, _In_opt_ HANDLE hMachine)
Definition: cfgmgr.c:1587
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4

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

1592 {
1594  HSTRING_TABLE StringTable = NULL;
1595  PWSTR pszDevInst, pszKeyPath = NULL, pszInstancePath = NULL;
1596  CONFIGRET ret;
1597 
1598  FIXME("CM_Delete_DevNode_Key_Ex(%p %lu %lx %p)\n",
1599  dnDevInst, ulHardwareProfile, ulFlags, hMachine);
1600 
1601  if (dnDevInst == 0)
1602  return CR_INVALID_DEVINST;
1603 
1604  if (ulFlags & ~CM_REGISTRY_BITS)
1605  return CR_INVALID_FLAG;
1606 
1607  if ((ulFlags & CM_REGISTRY_USER) && (ulFlags & CM_REGISTRY_CONFIG))
1608  return CR_INVALID_FLAG;
1609 
1610  if (hMachine != NULL)
1611  {
1612  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1613  if (BindingHandle == NULL)
1614  return CR_FAILURE;
1615 
1616  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
1617  if (StringTable == 0)
1618  return CR_FAILURE;
1619  }
1620  else
1621  {
1622  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
1623  return CR_FAILURE;
1624  }
1625 
1626  pszDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
1627  if (pszDevInst == NULL)
1628  return CR_INVALID_DEVNODE;
1629 
1630  TRACE("pszDevInst: %S\n", pszDevInst);
1631 
1632  pszKeyPath = MyMalloc(512 * sizeof(WCHAR));
1633  if (pszKeyPath == NULL)
1634  {
1636  goto done;
1637  }
1638 
1639  pszInstancePath = MyMalloc(512 * sizeof(WCHAR));
1640  if (pszInstancePath == NULL)
1641  {
1643  goto done;
1644  }
1645 
1647  pszDevInst,
1648  pszKeyPath,
1649  pszInstancePath,
1650  ulHardwareProfile,
1651  ulFlags);
1652  if (ret != CR_SUCCESS)
1653  goto done;
1654 
1655  TRACE("pszKeyPath: %S\n", pszKeyPath);
1656  TRACE("pszInstancePath: %S\n", pszInstancePath);
1657 
1658  if (ulFlags & CM_REGISTRY_USER)
1659  {
1660  FIXME("The CM_REGISTRY_USER flag is not supported yet!\n");
1661  }
1662  else
1663  {
1664 #if 0
1665  if (!pSetupIsUserAdmin())
1666  {
1668  goto done;
1669  }
1670 #endif
1671 
1672  if (!(ulFlags & CM_REGISTRY_CONFIG))
1673  ulHardwareProfile = 0;
1674 
1675  RpcTryExcept
1676  {
1678  pszDevInst,
1679  pszKeyPath,
1680  pszInstancePath,
1681  ulHardwareProfile);
1682  }
1684  {
1686  }
1687  RpcEndExcept;
1688  }
1689 
1690 done:
1691  if (pszInstancePath != NULL)
1692  MyFree(pszInstancePath);
1693 
1694  if (pszKeyPath != NULL)
1695  MyFree(pszKeyPath);
1696 
1697  return ret;
1698 }
#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:2172
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
uint16_t * PWSTR
Definition: typedefs.h:55
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:221
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:110
#define RpcTryExcept
Definition: rpc.h:126
#define CM_REGISTRY_CONFIG
Definition: cfgmgr32.h:803
#define CR_SUCCESS
Definition: cfgmgr32.h:842
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#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 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:133
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 1706 of file cfgmgr.c.

1711 {
1712  FIXME("CM_Delete_Range(%I64u %I64u %p %lx)\n",
1713  ullStartValue, ullEndValue, rlh, ulFlags);
1714 
1715  return CR_CALL_NOT_IMPLEMENTED;
1716 }
#define FIXME(fmt,...)
Definition: debug.h:110
#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 1724 of file cfgmgr.c.

1731 {
1732  TRACE("CM_Detect_Resource_Conflict(%p %lu %p %lu %p 0x%lx)\n",
1733  dnDevInst, ResourceID, ResourceData, ResourceLen,
1734  pbConflictDetected, ulFlags);
1735 
1736  return CM_Detect_Resource_Conflict_Ex(dnDevInst,
1737  ResourceID,
1738  ResourceData,
1739  ResourceLen,
1740  pbConflictDetected,
1741  ulFlags,
1742  NULL);
1743 }
smooth NULL
Definition: ftsmooth.c:416
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:1751
#define TRACE(s)
Definition: solgame.cpp:4

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

1759 {
1760  FIXME("CM_Detect_Resource_Conflict_Ex(%p %lu %p %lu %p 0x%lx %p)\n",
1761  dnDevInst, ResourceID, ResourceData, ResourceLen,
1762  pbConflictDetected, ulFlags, hMachine);
1763 
1764  return CR_CALL_NOT_IMPLEMENTED;
1765 }
#define FIXME(fmt,...)
Definition: debug.h:110
#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 1773 of file cfgmgr.c.

1776 {
1777  TRACE("CM_Disable_DevNode(%p %lx)\n",
1778  dnDevInst, ulFlags);
1779 
1780  return CM_Disable_DevNode_Ex(dnDevInst, ulFlags, NULL);
1781 }
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
CONFIGRET WINAPI CM_Disable_DevNode_Ex(_In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:1789

◆ CM_Disable_DevNode_Ex()

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

Definition at line 1789 of file cfgmgr.c.

1793 {
1795  HSTRING_TABLE StringTable = NULL;
1796  LPWSTR lpDevInst;
1797  CONFIGRET ret;
1798 
1799  TRACE("CM_Disable_DevNode_Ex(%p %lx %p)\n",
1800  dnDevInst, ulFlags, hMachine);
1801 
1802  if (!pSetupIsUserAdmin())
1803  return CR_ACCESS_DENIED;
1804 
1805  if (dnDevInst == 0)
1806  return CR_INVALID_DEVINST;
1807 
1808  if (ulFlags != 0)
1809  return CR_INVALID_FLAG;
1810 
1811  if (hMachine != NULL)
1812  {
1813  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1814  if (BindingHandle == NULL)
1815  return CR_FAILURE;
1816 
1817  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
1818  if (StringTable == 0)
1819  return CR_FAILURE;
1820  }
1821  else
1822  {
1823  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
1824  return CR_FAILURE;
1825  }
1826 
1827  lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
1828  if (lpDevInst == NULL)
1829  return CR_INVALID_DEVNODE;
1830 
1831  RpcTryExcept
1832  {
1834  lpDevInst,
1835  NULL,
1836  NULL,
1837  0,
1838  ulFlags);
1839  }
1841  {
1843  }
1844  RpcEndExcept;
1845 
1846  return ret;
1847 }
#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 EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#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:3079
int ret
#define CR_INVALID_DEVNODE
Definition: cfgmgr32.h:847
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:133
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 1855 of file cfgmgr.c.

1857 {
1858  PMACHINE_INFO pMachine;
1859 
1860  TRACE("CM_Disconnect_Machine(%p)\n", hMachine);
1861 
1862  pMachine = (PMACHINE_INFO)hMachine;
1863  if (pMachine == NULL)
1864  return CR_SUCCESS;
1865 
1866  if (pMachine->bLocal == FALSE)
1867  {
1868  if (pMachine->StringTable != NULL)
1870 
1871  if (!PnpUnbindRpc(pMachine->BindingHandle))
1872  return CR_ACCESS_DENIED;
1873  }
1874 
1875  HeapFree(GetProcessHeap(), 0, pMachine);
1876 
1877  return CR_SUCCESS;
1878 }
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 CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
RPC_BINDING_HANDLE BindingHandle
Definition: cfgmgr.c:54
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
VOID WINAPI pSetupStringTableDestroy(HSTRING_TABLE hStringTable)
Definition: stringtable.c:145
BOOL bLocal
Definition: cfgmgr.c:56
#define HeapFree(x, y, z)
Definition: compat.h:402
HSTRING_TABLE StringTable
Definition: cfgmgr.c:55

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

◆ CM_Dup_Range_List()

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

Definition at line 1886 of file cfgmgr.c.

1890 {
1891  FIXME("CM_Dup_Range_List(%p %p %lx)\n",
1892  rlhOld, rlhNew, ulFlags);
1893 
1894  return CR_CALL_NOT_IMPLEMENTED;
1895 }
#define FIXME(fmt,...)
Definition: debug.h:110
#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 1903 of file cfgmgr.c.

1906 {
1907  TRACE("CM_Enable_DevNode(%p %lx)\n",
1908  dnDevInst, ulFlags);
1909 
1910  return CM_Enable_DevNode_Ex(dnDevInst, ulFlags, NULL);
1911 }
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
CONFIGRET WINAPI CM_Enable_DevNode_Ex(_In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:1919

◆ CM_Enable_DevNode_Ex()

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

Definition at line 1919 of file cfgmgr.c.

1923 {
1925  HSTRING_TABLE StringTable = NULL;
1926  LPWSTR lpDevInst;
1927  CONFIGRET ret;
1928 
1929  TRACE("CM_Enable_DevNode_Ex(%p %lx %p)\n",
1930  dnDevInst, ulFlags, hMachine);
1931 
1932  if (!pSetupIsUserAdmin())
1933  return CR_ACCESS_DENIED;
1934 
1935  if (dnDevInst == 0)
1936  return CR_INVALID_DEVINST;
1937 
1938  if (ulFlags != 0)
1939  return CR_INVALID_FLAG;
1940 
1941  if (hMachine != NULL)
1942  {
1943  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1944  if (BindingHandle == NULL)
1945  return CR_FAILURE;
1946 
1947  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
1948  if (StringTable == 0)
1949  return CR_FAILURE;
1950  }
1951  else
1952  {
1953  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
1954  return CR_FAILURE;
1955  }
1956 
1957  lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
1958  if (lpDevInst == NULL)
1959  return CR_INVALID_DEVNODE;
1960 
1961  RpcTryExcept
1962  {
1964  PNP_DEVINST_ENABLE,
1965  ulFlags,
1966  lpDevInst,
1967  NULL);
1968  }
1970  {
1972  }
1973  RpcEndExcept;
1974 
1975  return ret;
1976 }
#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 EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#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:2997
int ret
#define CR_INVALID_DEVNODE
Definition: cfgmgr32.h:847
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:133
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 1984 of file cfgmgr.c.

1988 {
1989  TRACE("CM_Enumerate_Classes(%lx %p %lx)\n",
1990  ulClassIndex, ClassGuid, ulFlags);
1991 
1992  return CM_Enumerate_Classes_Ex(ulClassIndex, ClassGuid, ulFlags, NULL);
1993 }
CONFIGRET WINAPI CM_Enumerate_Classes_Ex(_In_ ULONG ulClassIndex, _Out_ LPGUID ClassGuid, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2001
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4

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

2006 {
2007  WCHAR szBuffer[MAX_GUID_STRING_LEN];
2010  ULONG ulLength = MAX_GUID_STRING_LEN;
2011 
2012  TRACE("CM_Enumerate_Classes_Ex(%lx %p %lx %p)\n",
2013  ulClassIndex, ClassGuid, ulFlags, hMachine);
2014 
2015  if (ClassGuid == NULL)
2016  return CR_INVALID_POINTER;
2017 
2018  if (ulFlags != 0)
2019  return CR_INVALID_FLAG;
2020 
2021  if (hMachine != NULL)
2022  {
2023  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2024  if (BindingHandle == NULL)
2025  return CR_FAILURE;
2026  }
2027  else
2028  {
2030  return CR_FAILURE;
2031  }
2032 
2033  RpcTryExcept
2034  {
2036  PNP_CLASS_SUBKEYS,
2037  ulClassIndex,
2038  szBuffer,
2040  &ulLength,
2041  ulFlags);
2042  }
2044  {
2046  }
2047  RpcEndExcept;
2048 
2049  if (ret == CR_SUCCESS)
2050  {
2051  /* Remove the {} */
2052  szBuffer[MAX_GUID_STRING_LEN - 2] = UNICODE_NULL;
2053 
2054  /* Convert the buffer to a GUID */
2055  if (UuidFromStringW(&szBuffer[1], ClassGuid) != RPC_S_OK)
2056  return CR_FAILURE;
2057  }
2058 
2059  return ret;
2060 }
#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
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
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:676
#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 CR_FAILURE
Definition: cfgmgr32.h:865
int ret
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:133
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().

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

2112 {
2113  WCHAR szBuffer[MAX_DEVICE_ID_LEN];
2114  ULONG ulOrigLength;
2115  ULONG ulLength;
2117 
2118  TRACE("CM_Enumerate_Enumerators_ExA(%lu %p %p %lx %p)\n",
2119  ulEnumIndex, Buffer, pulLength, ulFlags, hMachine);
2120 
2121  if (Buffer == NULL || pulLength == NULL)
2122  return CR_INVALID_POINTER;
2123 
2124  if (ulFlags != 0)
2125  return CR_INVALID_FLAG;
2126 
2127  ulOrigLength = *pulLength;
2128  *pulLength = 0;
2129 
2130  ulLength = MAX_DEVICE_ID_LEN;
2131  ret = CM_Enumerate_Enumerators_ExW(ulEnumIndex, szBuffer, &ulLength,
2132  ulFlags, hMachine);
2133  if (ret == CR_SUCCESS)
2134  {
2136  0,
2137  szBuffer,
2138  ulLength,
2139  Buffer,
2140  ulOrigLength,
2141  NULL,
2142  NULL) == 0)
2143  ret = CR_FAILURE;
2144  else
2145  *pulLength = lstrlenA(Buffer) + 1;
2146  }
2147 
2148  return ret;
2149 }
#define WideCharToMultiByte
Definition: compat.h:101
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
#define CP_ACP
Definition: compat.h:99
#define MAX_DEVICE_ID_LEN
Definition: pnpmgr.c:28
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
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
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:2157
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 2157 of file cfgmgr.c.

2163 {
2165  CONFIGRET ret;
2166 
2167  TRACE("CM_Enumerate_Enumerators_ExW(%lu %p %p %lx %p)\n",
2168  ulEnumIndex, Buffer, pulLength, ulFlags, hMachine);
2169 
2170  if (Buffer == NULL || pulLength == NULL)
2171  return CR_INVALID_POINTER;
2172 
2173  if (ulFlags != 0)
2174  return CR_INVALID_FLAG;
2175 
2176  *Buffer = UNICODE_NULL;
2177 
2178  if (hMachine != NULL)
2179  {
2180  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2181  if (BindingHandle == NULL)
2182  return CR_FAILURE;
2183  }
2184  else
2185  {
2187  return CR_FAILURE;
2188  }
2189 
2190  RpcTryExcept
2191  {
2193  PNP_ENUMERATOR_SUBKEYS,
2194  ulEnumIndex,
2195  Buffer,
2196  *pulLength,
2197  pulLength,
2198  ulFlags);
2199  }
2201  {
2203  }
2204  RpcEndExcept;
2205 
2206  return ret;
2207 }
#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
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
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:676
Definition: bufpool.h:45
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define CR_FAILURE
Definition: cfgmgr32.h:865
int ret
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:133
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 2068 of file cfgmgr.c.

2073 {
2074  TRACE("CM_Enumerate_EnumeratorsA(%lu %p %p %lx)\n",
2075  ulEnumIndex, Buffer, pulLength, ulFlags);
2076 
2077  return CM_Enumerate_Enumerators_ExA(ulEnumIndex, Buffer, pulLength,
2078  ulFlags, NULL);
2079 }
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:2106
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define TRACE(s)
Definition: solgame.cpp:4

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

2092 {
2093  TRACE("CM_Enumerate_EnumeratorsW(%lu %p %p %lx)\n",
2094  ulEnumIndex, Buffer, pulLength, ulFlags);
2095 
2096  return CM_Enumerate_Enumerators_ExW(ulEnumIndex, Buffer, pulLength,
2097  ulFlags, NULL);
2098 }
smooth NULL
Definition: ftsmooth.c:416
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:2157

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

2223 {
2224  FIXME("CM_Find_Range(%p %I64u %lu %I64u %I64u %p %lx)\n",
2225  pullStart, ullStart, ulLength, ullAlignment, ullEnd, rlh, ulFlags);
2226 
2227  return CR_CALL_NOT_IMPLEMENTED;
2228 }
#define FIXME(fmt,...)
Definition: debug.h:110
#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 2236 of file cfgmgr.c.

2242 {
2243  PINTERNAL_RANGE_LIST pRangeList;
2244  PINTERNAL_RANGE pRange;
2245  PLIST_ENTRY ListEntry;
2247 
2248  FIXME("CM_First_Range(%p %p %p %p %lx)\n",
2249  rlh, pullStart, pullEnd, preElement, ulFlags);
2250 
2251  pRangeList = (PINTERNAL_RANGE_LIST)rlh;
2252 
2253  if (!IsValidRangeList(pRangeList))
2254  return CR_INVALID_RANGE_LIST;
2255 
2256  if (pullStart == NULL || pullEnd == NULL || preElement == NULL)
2257  return CR_INVALID_POINTER;
2258 
2259  if (ulFlags != 0)
2260  return CR_INVALID_FLAG;
2261 
2262  /* Lock the range list */
2263  WaitForSingleObject(pRangeList->hMutex, INFINITE);
2264 
2265  /* Fail, if the list is empty */
2266  if (IsListEmpty(&pRangeList->ListHead))
2267  {
2268  ret = CR_FAILURE;
2269  goto done;
2270  }
2271 
2272  /* Get the first range */
2273  ListEntry = pRangeList->ListHead.Flink;
2274  pRange = CONTAINING_RECORD(ListEntry, INTERNAL_RANGE, ListEntry);
2275 
2276  /* Return the range data */
2277  *pullStart = pRange->ullStart;
2278  *pullEnd = pRange->ullEnd;
2279  *preElement = (RANGE_ELEMENT)pRange;
2280 
2281 done:
2282  /* Unlock the range list */
2283  ReleaseMutex(pRangeList->hMutex);
2284 
2285  return ret;
2286 }
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
BOOL IsValidRangeList(_In_opt_ PINTERNAL_RANGE_LIST pRangeList)
Definition: cfgmgr.c:387
_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:110
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
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:120
DWORDLONG ullStart
Definition: cfgmgr.c:84
#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:85
Definition: typedefs.h:118
#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:92
#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 2294 of file cfgmgr.c.

2297 {
2298  TRACE("CM_Free_Log_Conf(%lx %lx)\n",
2299  lcLogConfToBeFreed, ulFlags);
2300 
2301  return CM_Free_Log_Conf_Ex(lcLogConfToBeFreed, ulFlags, NULL);
2302 }
CONFIGRET WINAPI CM_Free_Log_Conf_Ex(_In_ LOG_CONF lcLogConfToBeFreed, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2310
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4

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

2314 {
2316  HSTRING_TABLE StringTable = NULL;
2317  LPWSTR lpDevInst;
2318  PLOG_CONF_INFO pLogConfInfo;
2319  CONFIGRET ret;
2320 
2321  TRACE("CM_Free_Log_Conf_Ex(%lx %lx %p)\n",
2322  lcLogConfToBeFreed, ulFlags, hMachine);
2323 
2324  if (!pSetupIsUserAdmin())
2325  return CR_ACCESS_DENIED;
2326 
2327  pLogConfInfo = (PLOG_CONF_INFO)lcLogConfToBeFreed;
2328  if (!IsValidLogConf(pLogConfInfo))
2329  return CR_INVALID_LOG_CONF;
2330 
2331  if (ulFlags != 0)
2332  return CR_INVALID_FLAG;
2333 
2334  if (hMachine != NULL)
2335  {
2336  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2337  if (BindingHandle == NULL)
2338  return CR_FAILURE;
2339 
2340  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
2341  if (StringTable == 0)
2342  return CR_FAILURE;
2343  }
2344  else
2345  {
2346  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
2347  return CR_FAILURE;
2348  }
2349 
2350  lpDevInst = pSetupStringTableStringFromId(StringTable, pLogConfInfo->dnDevInst);
2351  if (lpDevInst == NULL)
2352  return CR_INVALID_DEVNODE;
2353 
2354  RpcTryExcept
2355  {
2356  ret = PNP_FreeLogConf(BindingHandle, lpDevInst, pLogConfInfo->ulFlags,
2357  pLogConfInfo->ulTag, 0);
2358  }
2360  {
2362  }
2363  RpcEndExcept;
2364 
2365  return ret;
2366 }
#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
ULONG ulTag
Definition: cfgmgr.c:65
#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:3713
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#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:133
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:63
ULONG ulFlags
Definition: cfgmgr.c:64
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:411

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

2376 {
2377  PLOG_CONF_INFO pLogConfInfo;
2378 
2379  TRACE("CM_Free_Log_Conf_Handle(%lx)\n", lcLogConf);
2380 
2381  pLogConfInfo = (PLOG_CONF_INFO)lcLogConf;
2382  if (!IsValidLogConf(pLogConfInfo))
2383  return CR_INVALID_LOG_CONF;
2384 
2385  HeapFree(GetProcessHeap(), 0, pLogConfInfo);
2386 
2387  return CR_SUCCESS;
2388 }
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:403
#define CR_INVALID_LOG_CONF
Definition: cfgmgr32.h:850
#define HeapFree(x, y, z)
Definition: compat.h:402
BOOL IsValidLogConf(_In_opt_ PLOG_CONF_INFO pLogConfInfo)
Definition: cfgmgr.c:411

◆ CM_Free_Range_List()

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

Definition at line 2396 of file cfgmgr.c.

2399 {
2400  PINTERNAL_RANGE_LIST pRangeList;
2401  PINTERNAL_RANGE pRange;
2402  PLIST_ENTRY ListEntry;
2403 
2404  FIXME("CM_Free_Range_List(%p %lx)\n",
2405  RangeList, ulFlags);
2406 
2407  pRangeList = (PINTERNAL_RANGE_LIST)RangeList;
2408 
2409  if (!IsValidRangeList(pRangeList))
2410  return CR_INVALID_RANGE_LIST;
2411 
2412  if (ulFlags != 0)
2413  return CR_INVALID_FLAG;
2414 
2415  /* Lock the range list */
2416  WaitForSingleObject(pRangeList->hMutex, INFINITE);
2417 
2418  /* Free the list of ranges */
2419  while (!IsListEmpty(&pRangeList->ListHead))
2420  {
2421  ListEntry = RemoveHeadList(&pRangeList->ListHead);
2422  pRange = CONTAINING_RECORD(ListEntry, INTERNAL_RANGE, ListEntry);
2423  HeapFree(GetProcessHeap(), 0, pRange);
2424  }
2425 
2426  /* Unlock the range list */
2427  ReleaseMutex(pRangeList->hMutex);
2428 
2429  /* Close the mutex */
2430  CloseHandle(pRangeList->hMutex);
2431 
2432  /* Free the range list */
2433  HeapFree(GetProcessHeap(), 0, pRangeList);
2434 
2435  return CR_SUCCESS;
2436 }
#define CloseHandle
Definition: compat.h:406
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
BOOL IsValidRangeList(_In_opt_ PINTERNAL_RANGE_LIST pRangeList)
Definition: cfgmgr.c:387
_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:110
#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:403
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseMutex(IN HANDLE hMutex)
Definition: synch.c:618
Definition: typedefs.h:118
#define CR_INVALID_RANGE_LIST
Definition: cfgmgr32.h:863
LIST_ENTRY ListHead
Definition: cfgmgr.c:92
#define INFINITE
Definition: serial.h:102
#define HeapFree(x, y, z)
Definition: compat.h:402

◆ CM_Free_Res_Des()

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

Definition at line 2444 of file cfgmgr.c.

2448 {
2449  TRACE("CM_Free_Res_Des(%p %p %lx)\n",
2450  prdResDes, rdResDes, ulFlags);
2451 
2452  return CM_Free_Res_Des_Ex(prdResDes, rdResDes, ulFlags, NULL);
2453 }
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:2461
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4

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

2466 {
2467  FIXME("CM_Free_Res_Des_Ex(%p %p %lx %p)\n",
2468  prdResDes, rdResDes, ulFlags, hMachine);
2469 
2470  return CR_CALL_NOT_IMPLEMENTED;
2471 }
#define FIXME(fmt,...)
Definition: debug.h:110
#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 2479 of file cfgmgr.c.

2481 {
2482  FIXME("CM_Free_Res_Des_Handle(%p)\n", rdResDes);
2483 
2484  return CR_CALL_NOT_IMPLEMENTED;
2485 }
#define FIXME(fmt,...)
Definition: debug.h:110
#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 2493 of file cfgmgr.c.

2495 {
2496  PCONFLICT_DATA pConflictData;
2497 
2498  FIXME("CM_Free_Resource_Conflict_Handle(%p)\n",
2499  clConflictList);
2500 
2501  pConflictData = (PCONFLICT_DATA)clConflictList;
2502  if (!IsValidConflictData(pConflictData))
2503  return CR_INVALID_CONFLICT_LIST;
2504 
2505  if (pConflictData->pConflictList != NULL)
2506  MyFree(pConflictData->pConflictList);
2507 
2508  MyFree(pConflictData);
2509 
2510  return CR_SUCCESS;
2511 }
BOOL IsValidConflictData(_In_opt_ PCONFLICT_DATA pConflictData)
Definition: cfgmgr.c:435
PPNP_CONFLICT_LIST pConflictList
Definition: cfgmgr.c:100
#define FIXME(fmt,...)
Definition: debug.h:110
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
#define CR_INVALID_CONFLICT_LIST
Definition: cfgmgr32.h:903
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 2519 of file cfgmgr.c.

2523 {
2524  TRACE("CM_Get_Child(%p %p %lx)\n",
2525  pdnDevInst, dnDevInst, ulFlags);
2526 
2527  return CM_Get_Child_Ex(pdnDevInst, dnDevInst, ulFlags, NULL);
2528 }
smooth NULL
Definition: ftsmooth.c:416
#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:2536

Referenced by CDeviceView::GetChildDevice().

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

2541 {
2542  WCHAR szRelatedDevInst[MAX_DEVICE_ID_LEN];
2544  HSTRING_TABLE StringTable = NULL;
2545  LPWSTR lpDevInst;
2546  DWORD dwIndex, dwLength = MAX_DEVICE_ID_LEN;
2547  CONFIGRET ret;
2548 
2549  TRACE("CM_Get_Child_Ex(%p %lx %lx %p)\n",
2550  pdnDevInst, dnDevInst, ulFlags, hMachine);
2551 
2552  if (pdnDevInst == NULL)
2553  return CR_INVALID_POINTER;
2554 
2555  if (dnDevInst == 0)
2556  return CR_INVALID_DEVINST;
2557 
2558  if (ulFlags != 0)
2559  return CR_INVALID_FLAG;
2560 
2561  *pdnDevInst = -1;
2562 
2563  if (hMachine != NULL)
2564  {
2565  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2566  if (BindingHandle == NULL)
2567  return CR_FAILURE;
2568 
2569  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
2570  if (StringTable == 0)
2571  return CR_FAILURE;
2572  }
2573  else
2574  {
2575  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
2576  return CR_FAILURE;
2577  }
2578 
2579  lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
2580  if (lpDevInst == NULL)
2581  return CR_INVALID_DEVNODE;
2582 
2583  RpcTryExcept
2584  {
2586  PNP_GET_CHILD_DEVICE_INSTANCE,
2587  lpDevInst,
2588  szRelatedDevInst,
2589  &dwLength,
2590  0);
2591  }
2593  {
2595  }
2596  RpcEndExcept;
2597 
2598  if (ret != CR_SUCCESS)
2599  return ret;
2600 
2601  TRACE("szRelatedDevInst: %s\n", debugstr_w(szRelatedDevInst));
2602 
2603  dwIndex = pSetupStringTableAddString(StringTable, szRelatedDevInst, 1);
2604  if (dwIndex == -1)
2605  return CR_FAILURE;
2606 
2607  *pdnDevInst = dwIndex;
2608 
2609  return CR_SUCCESS;
2610 }
#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 MAX_DEVICE_ID_LEN
Definition: pnpmgr.c:28
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 EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#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 CR_FAILURE
Definition: cfgmgr32.h:865
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
#define CR_INVALID_DEVNODE
Definition: cfgmgr32.h:847
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:133
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:625

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

2662 {
2663  WCHAR szBuffer[MAX_GUID_STRING_LEN];
2665  ULONG ulLength;
2666  ULONG ulOrigLength;
2667 
2668  TRACE("CM_Get_Class_Key_Name_ExA(%p %p %p %lx %p)\n",
2669  ClassGuid, pszKeyName, pulLength, ulFlags, hMachine);
2670 
2671  if (ClassGuid == NULL || pszKeyName == NULL || pulLength == NULL)
2672  return CR_INVALID_POINTER;
2673 
2674  ulOrigLength = *pulLength;
2675  *pulLength = 0;
2676 
2677  ulLength = MAX_GUID_STRING_LEN;
2678  ret = CM_Get_Class_Key_Name_ExW(ClassGuid, szBuffer, &ulLength,
2679  ulFlags, hMachine);
2680  if (ret == CR_SUCCESS)
2681  {
2683  0,
2684  szBuffer,
2685  ulLength,
2686  pszKeyName,
2687  ulOrigLength,
2688  NULL,
2689  NULL) == 0)
2690  ret = CR_FAILURE;
2691  else
2692  *pulLength = lstrlenA(pszKeyName) + 1;
2693  }
2694 
2695  return CR_SUCCESS;
2696 }
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
#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
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:2704

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

2710 {
2711  TRACE("CM_Get_Class_Key_Name_ExW(%p %p %p %lx %p)\n",
2712  ClassGuid, pszKeyName, pulLength, ulFlags, hMachine);
2713 
2714  if (ClassGuid == NULL || pszKeyName == NULL || pulLength == NULL)
2715  return CR_INVALID_POINTER;
2716 
2717  if (ulFlags != 0)
2718  return CR_INVALID_FLAG;
2719 
2720  if (*pulLength < MAX_GUID_STRING_LEN)
2721  {
2722  *pulLength = 0;
2723  return CR_BUFFER_SMALL;
2724  }
2725 
2726  if (!GuidToString(ClassGuid, pszKeyName))
2727  return CR_INVALID_DATA;
2728 
2729  *pulLength = MAX_GUID_STRING_LEN;
2730 
2731  return CR_SUCCESS;
2732 }
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
#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:110
#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 2618 of file cfgmgr.c.

2623 {
2624  TRACE("CM_Get_Class_Key_NameA(%p %p %p %lx)\n",
2625  ClassGuid, pszKeyName, pulLength, ulFlags);
2626 
2627  return CM_Get_Class_Key_Name_ExA(ClassGuid, pszKeyName, pulLength,
2628  ulFlags, NULL);
2629 }
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:2656
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4

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

2642 {
2643  TRACE("CM_Get_Class_Key_NameW(%p %p %p %lx)\n",
2644  ClassGuid, pszKeyName, pulLength, ulFlags);
2645 
2646  return CM_Get_Class_Key_Name_ExW(ClassGuid, pszKeyName, pulLength,
2647  ulFlags, NULL);
2648 }
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
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:2704

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

2784 {
2785  WCHAR szBuffer[MAX_CLASS_NAME_LEN];
2787  ULONG ulLength;
2788  ULONG ulOrigLength;
2789 
2790  TRACE("CM_Get_Class_Name_ExA(%p %p %p %lx %p)\n",
2791  ClassGuid, Buffer, pulLength, ulFlags, hMachine);
2792 
2793  if (ClassGuid == NULL || Buffer == NULL || pulLength == NULL)
2794  return CR_INVALID_POINTER;
2795 
2796  ulOrigLength = *pulLength;
2797  *pulLength = 0;
2798 
2799  ulLength = MAX_CLASS_NAME_LEN;
2800  ret = CM_Get_Class_Name_ExW(ClassGuid, szBuffer, &ulLength,
2801  ulFlags, hMachine);
2802  if (ret == CR_SUCCESS)
2803  {
2805  0,
2806  szBuffer,
2807  ulLength,
2808  Buffer,
2809  ulOrigLength,
2810  NULL,
2811  NULL) == 0)
2812  ret = CR_FAILURE;
2813  else
2814  *pulLength = lstrlenA(Buffer) + 1;
2815  }
2816 
2817  return ret;
2818 }
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
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:2826
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
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 2826 of file cfgmgr.c.

2832 {
2833  WCHAR szGuidString[MAX_GUID_STRING_LEN];
2835  CONFIGRET ret;
2836 
2837  TRACE("CM_Get_Class_Name_ExW(%p %p %p %lx %p\n",
2838  ClassGuid, Buffer, pulLength, ulFlags, hMachine);
2839 
2840  if (ClassGuid == NULL || Buffer == NULL || pulLength == NULL)
2841  return CR_INVALID_POINTER;
2842 
2843  if (ulFlags != 0)
2844  return CR_INVALID_FLAG;
2845 
2846  if (!GuidToString(ClassGuid, szGuidString))
2847  return CR_INVALID_DATA;
2848 
2849  TRACE("Guid %s\n", debugstr_w(szGuidString));
2850 
2851  if (hMachine != NULL)
2852  {
2853  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2854  if (BindingHandle == NULL)
2855  return CR_FAILURE;
2856  }
2857  else
2858  {
2860  return CR_FAILURE;
2861  }
2862 
2863  RpcTryExcept
2864  {
2866  szGuidString,
2867  Buffer,
2868  pulLength,
2869  ulFlags);
2870  }
2872  {
2874  }
2875  RpcEndExcept;
2876 
2877  return ret;
2878 }
#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
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
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 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:133
DWORD WINAPI PNP_GetClassName(handle_t hBinding, LPWSTR pszClassGuid, LPWSTR Buffer, PNP_RPC_STRING_LEN *pulLength, DWORD ulFlags)
Definition: rpcserver.c:2232
static BOOL GuidToString(_In_ LPGUID Guid, _Out_ LPWSTR String)
Definition: cfgmgr.c:110
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 2740 of file cfgmgr.c.

2745 {
2746  TRACE("CM_Get_Class_NameA(%p %p %p %lx)\n",
2747  ClassGuid, Buffer, pulLength, ulFlags);
2748 
2749  return CM_Get_Class_Name_ExA(ClassGuid, Buffer, pulLength, ulFlags,
2750  NULL);
2751 }
smooth NULL
Definition: ftsmooth.c:416
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:2778

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

2764 {
2765  TRACE("CM_Get_Class_NameW(%p %p %p %lx)\n",
2766  ClassGuid, Buffer, pulLength, ulFlags);
2767 
2768  return CM_Get_Class_Name_ExW(ClassGuid, Buffer, pulLength, ulFlags,
2769  NULL);
2770 }
smooth NULL
Definition: ftsmooth.c:416
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:2826

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

2894 {
2895  PWSTR BufferW = NULL;
2896  ULONG ulLength = 0;
2897  ULONG ulType;
2898  CONFIGRET ret;
2899 
2900  TRACE("CM_Get_Class_Registry_PropertyA(%p %lu %p %p %p %lx %p)\n",
2901  ClassGuid, ulProperty, pulRegDataType, Buffer, pulLength,
2902  ulFlags, hMachine);
2903 
2904  if (pulLength == NULL)
2905  return CR_INVALID_POINTER;
2906 
2907  if (ulProperty < CM_CRP_MIN || ulProperty > CM_CRP_MAX)
2908  return CR_INVALID_PROPERTY;
2909 
2910  ulType = GetRegistryPropertyType(ulProperty);
2911  if (ulType == REG_SZ || ulType == REG_MULTI_SZ)
2912  {
2913  /* Get the required buffer size */
2914  ret = CM_Get_Class_Registry_PropertyW(ClassGuid, ulProperty, pulRegDataType,
2915  NULL, &ulLength, ulFlags, hMachine);
2916  if (ret != CR_BUFFER_SMALL)
2917  return ret;
2918 
2919  /* Allocate the unicode buffer */
2920  BufferW = HeapAlloc(GetProcessHeap(), 0, ulLength);
2921  if (BufferW == NULL)
2922  return CR_OUT_OF_MEMORY;
2923 
2924  /* Get the property */
2925  ret = CM_Get_Class_Registry_PropertyW(ClassGuid, ulProperty, pulRegDataType,
2926  BufferW, &ulLength, ulFlags, hMachine);
2927  if (ret != CR_SUCCESS)
2928  {
2929  HeapFree(GetProcessHeap(), 0, BufferW);
2930  return ret;
2931  }
2932 
2933  /* Do W->A conversion */
2934  *pulLength = WideCharToMultiByte(CP_ACP,
2935  0,
2936  BufferW,
2937  lstrlenW(BufferW) + 1,
2938  Buffer,
2939  *pulLength,
2940  NULL,
2941  NULL);
2942 
2943  /* Release the unicode buffer */
2944  HeapFree(GetProcessHeap(), 0, BufferW);
2945 
2946  if (*pulLength == 0)
2947  ret = CR_FAILURE;
2948  }
2949  else
2950  {
2951  /* Get the property */
2952  ret = CM_Get_Class_Registry_PropertyW(ClassGuid, ulProperty, pulRegDataType,
2953  Buffer, pulLength, ulFlags, hMachine);
2954  }
2955 
2956  return ret;
2957 }
#define WideCharToMultiByte
Definition: compat.h:101
CONFIGRET WINAPI CM_Get_Class_Registry_PropertyW(LPGUID ClassGuid, ULONG ulProperty, PULONG pulRegDataType, PVOID Buffer, PULONG pulLength, ULONG ulFlags, HMACHINE hMachine)
Definition: cfgmgr.c:2965
uint16_t * PWSTR
Definition: typedefs.h:55
#define CP_ACP
Definition: compat.h:99
#define lstrlenW
Definition: compat.h:415
#define REG_MULTI_SZ
Definition: nt_native.h:1501
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
#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:403
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
static ULONG GetRegistryPropertyType(_In_ ULONG ulProperty)
Definition: cfgmgr.c:142
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
_In_z_ PCWSTR _In_ ULONG ulType
Definition: ntuser.h:36
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
unsigned int ULONG
Definition: retypes.h:1
#define HeapFree(x, y, z)
Definition: compat.h:402
#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 2965 of file cfgmgr.c.

2973 {
2975  WCHAR szGuidString[PNP_MAX_GUID_STRING_LEN + 1];
2976  ULONG ulType = 0;
2977  ULONG ulTransferLength = 0;
2978  CONFIGRET ret;
2979 
2980  TRACE("CM_Get_Class_Registry_PropertyW(%p %lu %p %p %p %lx %p)\n",
2981  ClassGuid, ulProperty, pulRegDataType, Buffer, pulLength,
2982  ulFlags, hMachine);
2983 
2984  if (ClassGuid == NULL || pulLength == NULL)
2985  return CR_INVALID_POINTER;
2986 
2987  if (ulFlags != 0)
2988  return CR_INVALID_FLAG;
2989 
2990  if (pSetupStringFromGuid(ClassGuid,
2991  szGuidString,
2993  return CR_INVALID_DATA;
2994 
2995  if (ulProperty < CM_CRP_MIN || ulProperty > CM_CRP_MAX)
2996  return CR_INVALID_PROPERTY;
2997 
2998  if (hMachine != NULL)
2999  {
3000  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
3001  if (BindingHandle == NULL)
3002  return CR_FAILURE;
3003  }
3004  else
3005  {
3007  return CR_FAILURE;
3008  }
3009 
3010  ulTransferLength = *pulLength;
3011 
3012  RpcTryExcept
3013  {
3015  szGuidString,
3016  ulProperty,
3017  &ulType,
3018  Buffer,
3019  &ulTransferLength,
3020  pulLength,
3021  ulFlags);
3022  }
3024  {
3026  }
3027  RpcEndExcept;
3028 
3029  if (ret == CR_SUCCESS)
3030  {
3031  if (pulRegDataType != NULL)
3032  *pulRegDataType = ulType;
3033  }
3034 
3035  return ret;
3036 }
#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
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
const unsigned long PNP_MAX_GUID_STRING_LEN
Definition: pnp.idl:9
smooth NULL
Definition: ftsmooth.c:416
#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 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:133
#define CM_CRP_MAX
Definition: cfgmgr32.h:733
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
_In_z_ PCWSTR _In_ ULONG ulType
Definition: ntuser.h:36
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:2465
#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 3044 of file cfgmgr.c.

3048 {
3049  TRACE("CM_Get_Depth(%p %lx %lx)\n",
3050  pulDepth, dnDevInst, ulFlags);
3051 
3052  return CM_Get_Depth_Ex(pulDepth, dnDevInst, ulFlags, NULL);
3053 }
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
CONFIGRET WINAPI CM_Get_Depth_Ex(_Out_ PULONG pulDepth, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:3061

◆ CM_Get_Depth_Ex()

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

Definition at line 3061 of file cfgmgr.c.

3066 {
3068  HSTRING_TABLE StringTable = NULL;
3069  LPWSTR lpDevInst;
3070  CONFIGRET ret;
3071 
3072  TRACE("CM_Get_Depth_Ex(%p %lx %lx %p)\n",
3073  pulDepth, dnDevInst, ulFlags, hMachine);
3074 
3075  if (pulDepth == NULL)
3076  return CR_INVALID_POINTER;
3077 
3078  if (dnDevInst == 0)
3079  return CR_INVALID_DEVINST;
3080 
3081  if (ulFlags != 0)
3082  return CR_INVALID_FLAG;
3083 
3084  if (hMachine != NULL)
3085  {
3086  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
3087  if (BindingHandle == NULL)
3088  return CR_FAILURE;
3089 
3090  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
3091  if (StringTable == 0)
3092  return CR_FAILURE;
3093  }
3094  else
3095  {
3096  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
3097  return CR_FAILURE;
3098  }
3099 
3100  lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
3101  if (lpDevInst == NULL)
3102  return CR_INVALID_DEVNODE;
3103 
3104  RpcTryExcept
3105  {
3107  lpDevInst,
3108  pulDepth,
3109  ulFlags);
3110  }
3112  {
3114  }
3115  RpcEndExcept;
3116 
3117  return ret;
3118 }
#define RpcEndExcept
Definition: rpc.h:128
#define CR_INVALID_DEVINST
Definition: cfgmgr32.h:848
DWORD WINAPI PNP_GetDepth(handle_t hBinding, LPWSTR pszDeviceID, DWORD *pulDepth, DWORD ulFlags)
Definition: rpcserver.c:1543
#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 EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#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:133
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

Referenced by CM_Get_Depth().