ReactOS  0.4.13-dev-455-g28ed234
cfgmgr.c File Reference
#include "setupapi_private.h"
#include <dbt.h>
#include <pnp_c.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

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_ DEVNODE dnDevNode, _In_ ULONG ulHardwareProfile, _In_ ULONG ulFlags)
 
CONFIGRET WINAPI CM_Delete_DevNode_Key_Ex (_In_ DEVNODE dnDevNode, _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 95 of file cfgmgr.c.

◆ LOG_CONF_MAGIC

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

Definition at line 60 of file cfgmgr.c.

◆ NOTIFY_MAGIC

#define NOTIFY_MAGIC   0x44556677

Definition at line 69 of file cfgmgr.c.

◆ RANGE_LIST_MAGIC

#define RANGE_LIST_MAGIC   0x33445566

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

824 {
825  TRACE("CM_Add_Empty_Log_Conf(%p %p %lu %lx)\n",
826  plcLogConf, dnDevInst, Priority, ulFlags);
827 
828  return CM_Add_Empty_Log_Conf_Ex(plcLogConf, dnDevInst, Priority,
829  ulFlags, NULL);
830 }
_In_ KPRIORITY Priority
Definition: kefuncs.h:516
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:838

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

844 {
846  HSTRING_TABLE StringTable = NULL;
847  ULONG ulLogConfTag = 0;
848  LPWSTR lpDevInst;
849  PLOG_CONF_INFO pLogConfInfo;
851 
852  FIXME("CM_Add_Empty_Log_Conf_Ex(%p %p %lu %lx %p)\n",
853  plcLogConf, dnDevInst, Priority, ulFlags, hMachine);
854 
855  if (!pSetupIsUserAdmin())
856  return CR_ACCESS_DENIED;
857 
858  if (plcLogConf == NULL)
859  return CR_INVALID_POINTER;
860 
861  if (dnDevInst == 0)
862  return CR_INVALID_DEVINST;
863 
864  if (Priority > 0xFFFF)
865  return CR_INVALID_PRIORITY;
866 
867  if (ulFlags & ~(LOG_CONF_BITS | PRIORITY_BIT))
868  return CR_INVALID_FLAG;
869 
870  if (hMachine != NULL)
871  {
872  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
873  if (BindingHandle == NULL)
874  return CR_FAILURE;
875 
876  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
877  if (StringTable == 0)
878  return CR_FAILURE;
879  }
880  else
881  {
882  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
883  return CR_FAILURE;
884  }
885 
886  lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
887  if (lpDevInst == NULL)
888  return CR_INVALID_DEVNODE;
889 
891  {
893  &ulLogConfTag, ulFlags);
894  }
896  {
898  }
899  RpcEndExcept;
900 
901  if (ret == CR_SUCCESS)
902  {
903  pLogConfInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(LOG_CONF_INFO));
904  if (pLogConfInfo == NULL)
905  {
907  }
908  else
909  {
910  pLogConfInfo->ulMagic = LOG_CONF_MAGIC;
911  pLogConfInfo->dnDevInst = dnDevInst;
912  pLogConfInfo->ulFlags = ulFlags;
913  pLogConfInfo->ulTag = ulLogConfTag;
914 
915  *plcLogConf = (LOG_CONF)pLogConfInfo;
916 
917  ret = CR_SUCCESS;
918  }
919  }
920 
921  return ret;
922 }
#define RpcEndExcept
Definition: rpc.h:128
#define CR_INVALID_DEVINST
Definition: cfgmgr32.h:848
ULONG ulMagic
Definition: cfgmgr.c:54
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
_In_ KPRIORITY Priority
Definition: kefuncs.h:516
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:57
#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:395
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:3246
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:125
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:60
BOOL WINAPI pSetupIsUserAdmin(VOID)
Definition: misc.c:1817
WCHAR * LPWSTR
Definition: xmlstorage.h:184
DEVINST dnDevInst
Definition: cfgmgr.c:55
ULONG ulFlags
Definition: cfgmgr.c:56
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 964 of file cfgmgr.c.

969 {
970  PWSTR pszIDW;
971  CONFIGRET ret;
972 
973  TRACE("CM_Add_ID_ExA(%p %s %lx %p)\n",
974  dnDevInst, debugstr_a(pszID), ulFlags, hMachine);
975 
976  if (pSetupCaptureAndConvertAnsiArg(pszID, &pszIDW))
977  return CR_INVALID_DATA;
978 
979  ret = CM_Add_ID_ExW(dnDevInst, pszIDW, ulFlags, hMachine);
980 
981  MyFree(pszIDW);
982 
983  return ret;
984 }
uint16_t * PWSTR
Definition: typedefs.h:54
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:992
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 992 of file cfgmgr.c.

997 {
999  HSTRING_TABLE StringTable = NULL;
1000  LPWSTR lpDevInst;
1001  CONFIGRET ret;
1002 
1003  TRACE("CM_Add_ID_ExW(%p %s %lx %p)\n",
1004  dnDevInst, debugstr_w(pszID), ulFlags, hMachine);
1005 
1006  if (!pSetupIsUserAdmin())
1007  return CR_ACCESS_DENIED;
1008 
1009  if (dnDevInst == 0)
1010  return CR_INVALID_DEVINST;
1011 
1012  if (pszID == NULL)
1013  return CR_INVALID_POINTER;
1014 
1015  if (ulFlags & ~CM_ADD_ID_BITS)
1016  return CR_INVALID_FLAG;
1017 
1018  if (hMachine != NULL)
1019  {
1020  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1021  if (BindingHandle == NULL)
1022  return CR_FAILURE;
1023 
1024  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
1025  if (StringTable == 0)
1026  return CR_FAILURE;
1027  }
1028  else
1029  {
1030  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
1031  return CR_FAILURE;
1032  }
1033 
1034  lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
1035  if (lpDevInst == NULL)
1036  return CR_INVALID_DEVNODE;
1037 
1038  RpcTryExcept
1039  {
1041  lpDevInst,
1042  pszID,
1043  ulFlags);
1044  }
1046  {
1048  }
1049  RpcEndExcept;
1050 
1051  return ret;
1052 }
#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:125
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:2810

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

934 {
935  TRACE("CM_Add_IDA(%p %s %lx)\n",
936  dnDevInst, debugstr_a(pszID), ulFlags);
937 
938  return CM_Add_ID_ExA(dnDevInst, pszID, ulFlags, NULL);
939 }
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:964

◆ CM_Add_IDW()

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

Definition at line 947 of file cfgmgr.c.

951 {
952  TRACE("CM_Add_IDW(%p %s %lx)\n",
953  dnDevInst, debugstr_w(pszID), ulFlags);
954 
955  return CM_Add_ID_ExW(dnDevInst, pszID, ulFlags, NULL);
956 }
#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:992

◆ CM_Add_Range()

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

Definition at line 1060 of file cfgmgr.c.

1065 {
1066  PINTERNAL_RANGE_LIST pRangeList;
1067  PINTERNAL_RANGE pRange;
1069 
1070  FIXME("CM_Add_Range(%I64u %I64u %p %lx)\n",
1071  ullStartValue, ullEndValue, rlh, ulFlags);
1072 
1073  pRangeList = (PINTERNAL_RANGE_LIST)rlh;
1074 
1075  if (!IsValidRangeList(pRangeList))
1076  return CR_INVALID_RANGE_LIST;
1077 
1078  if (ulFlags & ~CM_ADD_RANGE_BITS)
1079  return CR_INVALID_FLAG;
1080 
1081  if (ullEndValue < ullStartValue)
1082  return CR_INVALID_RANGE;
1083 
1084  /* Lock the range list */
1085  WaitForSingleObject(pRangeList->hMutex, INFINITE);
1086 
1087  /* Allocate the new range */
1088  pRange = HeapAlloc(GetProcessHeap(), 0, sizeof(INTERNAL_RANGE));
1089  if (pRange == NULL)
1090  {
1092  goto done;
1093  }
1094 
1095  pRange->pRangeList = pRangeList;
1096  pRange->ullStart = ullStartValue;
1097  pRange->ullEnd = ullEndValue;
1098 
1099  /* Insert the range */
1100  if (IsListEmpty(&pRangeList->ListHead))
1101  {
1102  InsertTailList(&pRangeList->ListHead, &pRange->ListEntry);
1103  }
1104  else
1105  {
1106  HeapFree(GetProcessHeap(), 0, pRange);
1107  UNIMPLEMENTED;
1108  }
1109 
1110 done:
1111  /* Unlock the range list */
1112  ReleaseMutex(pRangeList->hMutex);
1113 
1114  return ret;
1115 }
#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:379
struct _INTERNAL_RANGE_LIST * pRangeList
Definition: cfgmgr.c:75
#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:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
DWORDLONG ullStart
Definition: cfgmgr.c:76
LIST_ENTRY ListEntry
Definition: cfgmgr.c:74
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseMutex(IN HANDLE hMutex)
Definition: synch.c:564
int ret
DWORDLONG ullEnd
Definition: cfgmgr.c:77
#define CR_INVALID_RANGE_LIST
Definition: cfgmgr32.h:863
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
LIST_ENTRY ListHead
Definition: cfgmgr.c:84
#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:394

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

1130 {
1131  TRACE("CM_Add_Res_Des(%p %p %lu %p %lu %lx)\n",
1132  prdResDes, lcLogConf, ResourceID, ResourceData, ResourceLen, ulFlags);
1133 
1134  return CM_Add_Res_Des_Ex(prdResDes, lcLogConf, ResourceID, ResourceData,
1135  ResourceLen, ulFlags, NULL);
1136 }
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:1144
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 1144 of file cfgmgr.c.

1152 {
1153  FIXME("CM_Add_Res_Des_Ex(%p %p %lu %p %lu %lx %p)\n",
1154  prdResDes, lcLogConf, ResourceID,
1155  ResourceData, ResourceLen, ulFlags, hMachine);
1156 
1157  return CR_CALL_NOT_IMPLEMENTED;
1158 }
#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 1166 of file cfgmgr.c.

1169 {
1170  PWSTR pServerNameW;
1171  CONFIGRET ret;
1172 
1173  TRACE("CM_Connect_MachineA(%s %p)\n",
1174  debugstr_a(UNCServerName), phMachine);
1175 
1176  if (UNCServerName == NULL || *UNCServerName == 0)
1177  return CM_Connect_MachineW(NULL, phMachine);
1178 
1179  if (pSetupCaptureAndConvertAnsiArg(UNCServerName, &pServerNameW))
1180  return CR_INVALID_DATA;
1181 
1182  ret = CM_Connect_MachineW(pServerNameW, phMachine);
1183 
1184  MyFree(pServerNameW);
1185 
1186  return ret;
1187 }
uint16_t * PWSTR
Definition: typedefs.h:54
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:1195
#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 1195 of file cfgmgr.c.

1198 {
1199  PMACHINE_INFO pMachine;
1200 
1201  TRACE("CM_Connect_MachineW(%s %p)\n",
1202  debugstr_w(UNCServerName), phMachine);
1203 
1204  if (phMachine == NULL)
1205  return CR_INVALID_POINTER;
1206 
1207  *phMachine = NULL;
1208 
1209  pMachine = HeapAlloc(GetProcessHeap(), 0, sizeof(MACHINE_INFO));
1210  if (pMachine == NULL)
1211  return CR_OUT_OF_MEMORY;
1212 
1213  if (UNCServerName == NULL || *UNCServerName == 0)
1214  {
1215  pMachine->bLocal = TRUE;
1216 
1217  /* FIXME: store the computers name in pMachine->szMachineName */
1218 
1219  if (!PnpGetLocalHandles(&pMachine->BindingHandle,
1220  &pMachine->StringTable))
1221  {
1222  HeapFree(GetProcessHeap(), 0, pMachine);
1223  return CR_FAILURE;
1224  }
1225  }
1226  else
1227  {
1228  pMachine->bLocal = FALSE;
1229  if (wcslen(UNCServerName) >= SP_MAX_MACHINENAME_LENGTH - 1)
1230  {
1231  HeapFree(GetProcessHeap(), 0, pMachine);
1232  return CR_INVALID_MACHINENAME;
1233  }
1234  lstrcpyW(pMachine->szMachineName, UNCServerName);
1235 
1237  if (pMachine->StringTable == NULL)
1238  {
1239  HeapFree(GetProcessHeap(), 0, pMachine);
1240  return CR_FAILURE;
1241  }
1242 
1243  pSetupStringTableAddString(pMachine->StringTable, L"PLT", 1);
1244 
1245  if (!PnpBindRpc(UNCServerName, &pMachine->BindingHandle))
1246  {
1248  HeapFree(GetProcessHeap(), 0, pMachine);
1249  return CR_INVALID_MACHINENAME;
1250  }
1251  }
1252 
1253  *phMachine = (PHMACHINE)pMachine;
1254 
1255  return CR_SUCCESS;
1256 }
#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:46
#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:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
WCHAR szMachineName[SP_MAX_MACHINENAME_LENGTH]
Definition: cfgmgr.c:45
#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:406
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
BOOL bLocal
Definition: cfgmgr.c:48
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define HeapFree(x, y, z)
Definition: compat.h:394
HSTRING_TABLE StringTable
Definition: cfgmgr.c:47

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

1308 {
1309  DEVINSTID_W pDeviceIDW;
1310  CONFIGRET ret;
1311 
1312  TRACE("CM_Create_DevNode_ExA(%p %s %p %lx %p)\n",
1313  pdnDevInst, debugstr_a(pDeviceID), dnParent, ulFlags, hMachine);
1314 
1315  if (pSetupCaptureAndConvertAnsiArg(pDeviceID, &pDeviceIDW))
1316  return CR_INVALID_DATA;
1317 
1318  ret = CM_Create_DevNode_ExW(pdnDevInst, pDeviceIDW, dnParent, ulFlags,
1319  hMachine);
1320 
1321  MyFree(pDeviceIDW);
1322 
1323  return ret;
1324 }
_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:1332
#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 1332 of file cfgmgr.c.

1338 {
1340  HSTRING_TABLE StringTable = NULL;
1341  LPWSTR lpParentDevInst;
1343  WCHAR szLocalDeviceID[MAX_DEVICE_ID_LEN];
1344 
1345  TRACE("CM_Create_DevNode_ExW(%p %s %p %lx %p)\n",
1346  pdnDevInst, debugstr_w(pDeviceID), dnParent, ulFlags, hMachine);
1347 
1348  if (!pSetupIsUserAdmin())
1349  return CR_ACCESS_DENIED;
1350 
1351  if (pdnDevInst == NULL)
1352  return CR_INVALID_POINTER;
1353 
1354  if (pDeviceID == NULL || wcslen(pDeviceID) == 0 || wcslen(pDeviceID) >= MAX_DEVICE_ID_LEN)
1355  return CR_INVALID_DEVICE_ID;
1356 
1357  if (dnParent == 0)
1358  return CR_INVALID_DEVNODE;
1359 
1360  if (ulFlags & ~CM_CREATE_DEVNODE_BITS)
1361  return CR_INVALID_FLAG;
1362 
1363  if (hMachine != NULL)
1364  {
1365  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1366  if (BindingHandle == NULL)
1367  return CR_FAILURE;
1368 
1369  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
1370  if (StringTable == 0)
1371  return CR_FAILURE;
1372  }
1373  else
1374  {
1375  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
1376  return CR_FAILURE;
1377  }
1378 
1379  lpParentDevInst = pSetupStringTableStringFromId(StringTable, dnParent);
1380  if (lpParentDevInst == NULL)
1381  return CR_INVALID_DEVNODE;
1382 
1383  wcscpy(szLocalDeviceID, pDeviceID);
1384 
1385  RpcTryExcept
1386  {
1388  szLocalDeviceID,
1389  lpParentDevInst,
1391  ulFlags);
1392  }
1394  {
1396  }
1397  RpcEndExcept;
1398 
1399  if (ret == CR_SUCCESS)
1400  {
1401  /* If CM_CREATE_DEVINST_GENERATE_ID was passed in, PNP_CreateDevInst
1402  * will return the generated device ID in szLocalDeviceID */
1403  *pdnDevInst = pSetupStringTableAddString(StringTable, szLocalDeviceID, 1);
1404  if (*pdnDevInst == 0)
1406  }
1407 
1408  return ret;
1409 }
#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:2493
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:125
#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 1264 of file cfgmgr.c.

1269 {
1270  TRACE("CM_Create_DevNodeA(%p %s %p %lx)\n",
1271  pdnDevInst, debugstr_a(pDeviceID), dnParent, ulFlags);
1272 
1273  return CM_Create_DevNode_ExA(pdnDevInst, pDeviceID, dnParent,
1274  ulFlags, NULL);
1275 }
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:1302

◆ CM_Create_DevNodeW()

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

Definition at line 1283 of file cfgmgr.c.

1288 {
1289  TRACE("CM_Create_DevNodeW(%p %s %p %lx)\n",
1290  pdnDevInst, debugstr_w(pDeviceID), dnParent, ulFlags);
1291 
1292  return CM_Create_DevNode_ExW(pdnDevInst, pDeviceID, dnParent,
1293  ulFlags, NULL);
1294 }
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:1332
#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 1417 of file cfgmgr.c.

1420 {
1421  PINTERNAL_RANGE_LIST pRangeList = NULL;
1422 
1423  FIXME("CM_Create_Range_List(%p %lx)\n",
1424  prlh, ulFlags);
1425 
1426  if (ulFlags != 0)
1427  return CR_INVALID_FLAG;
1428 
1429  if (prlh == NULL)
1430  return CR_INVALID_POINTER;
1431 
1432  /* Allocate the range list */
1434  if (pRangeList == NULL)
1435  return CR_OUT_OF_MEMORY;
1436 
1437  /* Set the magic value */
1438  pRangeList->ulMagic = RANGE_LIST_MAGIC;
1439 
1440  /* Initialize the mutex for synchonized access */
1441  pRangeList->hMutex = CreateMutex(NULL, FALSE, NULL);
1442  if (pRangeList->hMutex == NULL)
1443  {
1444  HeapFree(GetProcessHeap(), 0, pRangeList);
1445  return CR_FAILURE;
1446  }
1447 
1448  InitializeListHead(&pRangeList->ListHead);
1449 
1450  *prlh = (RANGE_LIST)pRangeList;
1451 
1452  return CR_SUCCESS;
1453 }
#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:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define CreateMutex
Definition: winbase.h:3570
#define CR_FAILURE
Definition: cfgmgr32.h:865
#define RANGE_LIST_MAGIC
Definition: cfgmgr.c:87
#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:84
DWORD_PTR RANGE_LIST
Definition: cfgmgr32.h:102
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ CM_Delete_Class_Key()

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

Definition at line 1461 of file cfgmgr.c.

1464 {
1465  TRACE("CM_Delete_Class_Key(%p %lx)\n",
1466  ClassGuid, ulFlags);
1467 
1468  return CM_Delete_Class_Key_Ex(ClassGuid, ulFlags, NULL);
1469 }
CONFIGRET WINAPI CM_Delete_Class_Key_Ex(_In_ LPGUID ClassGuid, _In_ ULONG ulFlags, _In_opt_ HANDLE hMachine)
Definition: cfgmgr.c:1477
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 1477 of file cfgmgr.c.

1481 {
1482  WCHAR szGuidString[MAX_GUID_STRING_LEN];
1484  CONFIGRET ret;
1485 
1486  TRACE("CM_Delete_Class_Key_Ex(%p %lx %p)\n",
1487  ClassGuid, ulFlags, hMachine);
1488 
1489  if (ClassGuid == NULL)
1490  return CR_INVALID_POINTER;
1491 
1492  if (ulFlags & ~CM_DELETE_CLASS_BITS)
1493  return CR_INVALID_FLAG;
1494 
1495  if (!GuidToString(ClassGuid, szGuidString))
1496  return CR_INVALID_DATA;
1497 
1498  if (hMachine != NULL)
1499  {
1500  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1501  if (BindingHandle == NULL)
1502  return CR_FAILURE;
1503  }
1504  else
1505  {
1507  return CR_FAILURE;
1508  }
1509 
1510  RpcTryExcept
1511  {
1513  szGuidString,
1514  ulFlags);
1515  }
1517  {
1519  }
1520  RpcEndExcept;
1521 
1522  return ret;
1523 }
#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:125
static BOOL GuidToString(_In_ LPGUID Guid, _Out_ LPWSTR String)
Definition: cfgmgr.c:102
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:1997
#define RpcExcept(expr)
Definition: rpc.h:127

Referenced by CM_Delete_Class_Key().

◆ CM_Delete_DevNode_Key()

CONFIGRET WINAPI CM_Delete_DevNode_Key ( _In_ DEVNODE  dnDevNode,
_In_ ULONG  ulHardwareProfile,
_In_ ULONG  ulFlags 
)

Definition at line 1531 of file cfgmgr.c.

1535 {
1536  TRACE("CM_Delete_DevNode_Key(%p %lu %lx)\n",
1537  dnDevNode, ulHardwareProfile, ulFlags);
1538 
1539  return CM_Delete_DevNode_Key_Ex(dnDevNode, ulHardwareProfile, ulFlags,
1540  NULL);
1541 }
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
CONFIGRET WINAPI CM_Delete_DevNode_Key_Ex(_In_ DEVNODE dnDevNode, _In_ ULONG ulHardwareProfile, _In_ ULONG ulFlags, _In_opt_ HANDLE hMachine)
Definition: cfgmgr.c:1549

◆ CM_Delete_DevNode_Key_Ex()

CONFIGRET WINAPI CM_Delete_DevNode_Key_Ex ( _In_ DEVNODE  dnDevNode,
_In_ ULONG  ulHardwareProfile,
_In_ ULONG  ulFlags,
_In_opt_ HANDLE  hMachine 
)

Definition at line 1549 of file cfgmgr.c.

1554 {
1555  FIXME("CM_Delete_DevNode_Key_Ex(%p %lu %lx %p)\n",
1556  dnDevNode, ulHardwareProfile, ulFlags, hMachine);
1557 
1558  return CR_CALL_NOT_IMPLEMENTED;
1559 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898

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

1572 {
1573  FIXME("CM_Delete_Range(%I64u %I64u %p %lx)\n",
1574  ullStartValue, ullEndValue, rlh, ulFlags);
1575 
1576  return CR_CALL_NOT_IMPLEMENTED;
1577 }
#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 1585 of file cfgmgr.c.

1592 {
1593  TRACE("CM_Detect_Resource_Conflict(%p %lu %p %lu %p 0x%lx)\n",
1594  dnDevInst, ResourceID, ResourceData, ResourceLen,
1595  pbConflictDetected, ulFlags);
1596 
1597  return CM_Detect_Resource_Conflict_Ex(dnDevInst,
1598  ResourceID,
1599  ResourceData,
1600  ResourceLen,
1601  pbConflictDetected,
1602  ulFlags,
1603  NULL);
1604 }
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:1612
#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 1612 of file cfgmgr.c.

1620 {
1621  FIXME("CM_Detect_Resource_Conflict_Ex(%p %lu %p %lu %p 0x%lx %p)\n",
1622  dnDevInst, ResourceID, ResourceData, ResourceLen,
1623  pbConflictDetected, ulFlags, hMachine);
1624 
1625  return CR_CALL_NOT_IMPLEMENTED;
1626 }
#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 1634 of file cfgmgr.c.

1637 {
1638  TRACE("CM_Disable_DevNode(%p %lx)\n",
1639  dnDevInst, ulFlags);
1640 
1641  return CM_Disable_DevNode_Ex(dnDevInst, ulFlags, NULL);
1642 }
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:1650

◆ CM_Disable_DevNode_Ex()

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

Definition at line 1650 of file cfgmgr.c.

1654 {
1656  HSTRING_TABLE StringTable = NULL;
1657  LPWSTR lpDevInst;
1658  CONFIGRET ret;
1659 
1660  FIXME("CM_Disable_DevNode_Ex(%p %lx %p)\n",
1661  dnDevInst, ulFlags, hMachine);
1662 
1663  if (!pSetupIsUserAdmin())
1664  return CR_ACCESS_DENIED;
1665 
1666  if (dnDevInst == 0)
1667  return CR_INVALID_DEVINST;
1668 
1669  if (ulFlags != 0)
1670  return CR_INVALID_FLAG;
1671 
1672  if (hMachine != NULL)
1673  {
1674  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1675  if (BindingHandle == NULL)
1676  return CR_FAILURE;
1677 
1678  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
1679  if (StringTable == 0)
1680  return CR_FAILURE;
1681  }
1682  else
1683  {
1684  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
1685  return CR_FAILURE;
1686  }
1687 
1688  lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
1689  if (lpDevInst == NULL)
1690  return CR_INVALID_DEVNODE;
1691 
1692  RpcTryExcept
1693  {
1695  PNP_DEVINST_DISABLE,
1696  ulFlags,
1697  lpDevInst,
1698  NULL);
1699  }
1701  {
1703  }
1704  RpcEndExcept;
1705 
1706  return ret;
1707 }
#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 FIXME(fmt,...)
Definition: debug.h:110
#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 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:125
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
DWORD WINAPI PNP_DeviceInstanceAction(handle_t hBinding, DWORD ulAction, DWORD ulFlags, LPWSTR pszDeviceInstance1, LPWSTR pszDeviceInstance2)
Definition: rpcserver.c:2632
#define RpcExcept(expr)
Definition: rpc.h:127

Referenced by CM_Disable_DevNode().

◆ CM_Disconnect_Machine()

CONFIGRET WINAPI CM_Disconnect_Machine ( _In_opt_ HMACHINE  hMachine)

Definition at line 1715 of file cfgmgr.c.

1717 {
1718  PMACHINE_INFO pMachine;
1719 
1720  TRACE("CM_Disconnect_Machine(%p)\n", hMachine);
1721 
1722  pMachine = (PMACHINE_INFO)hMachine;
1723  if (pMachine == NULL)
1724  return CR_SUCCESS;
1725 
1726  if (pMachine->bLocal == FALSE)
1727  {
1728  if (pMachine->StringTable != NULL)
1730 
1731  if (!PnpUnbindRpc(pMachine->BindingHandle))
1732  return CR_ACCESS_DENIED;
1733  }
1734 
1735  HeapFree(GetProcessHeap(), 0, pMachine);
1736 
1737  return CR_SUCCESS;
1738 }
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:46
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
VOID WINAPI pSetupStringTableDestroy(HSTRING_TABLE hStringTable)
Definition: stringtable.c:145
BOOL bLocal
Definition: cfgmgr.c:48
#define HeapFree(x, y, z)
Definition: compat.h:394
HSTRING_TABLE StringTable
Definition: cfgmgr.c:47

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

1750 {
1751  FIXME("CM_Dup_Range_List(%p %p %lx)\n",
1752  rlhOld, rlhNew, ulFlags);
1753 
1754  return CR_CALL_NOT_IMPLEMENTED;
1755 }
#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 1763 of file cfgmgr.c.

1766 {
1767  TRACE("CM_Enable_DevNode(%p %lx)\n",
1768  dnDevInst, ulFlags);
1769 
1770  return CM_Enable_DevNode_Ex(dnDevInst, ulFlags, NULL);
1771 }
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:1779

◆ CM_Enable_DevNode_Ex()

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

Definition at line 1779 of file cfgmgr.c.

1783 {
1785  HSTRING_TABLE StringTable = NULL;
1786  LPWSTR lpDevInst;
1787  CONFIGRET ret;
1788 
1789  TRACE("CM_Enable_DevNode_Ex(%p %lx %p)\n",
1790  dnDevInst, ulFlags, hMachine);
1791 
1792  if (!pSetupIsUserAdmin())
1793  return CR_ACCESS_DENIED;
1794 
1795  if (dnDevInst == 0)
1796  return CR_INVALID_DEVINST;
1797 
1798  if (ulFlags != 0)
1799  return CR_INVALID_FLAG;
1800 
1801  if (hMachine != NULL)
1802  {
1803  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1804  if (BindingHandle == NULL)
1805  return CR_FAILURE;
1806 
1807  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
1808  if (StringTable == 0)
1809  return CR_FAILURE;
1810  }
1811  else
1812  {
1813  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
1814  return CR_FAILURE;
1815  }
1816 
1817  lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
1818  if (lpDevInst == NULL)
1819  return CR_INVALID_DEVNODE;
1820 
1821  RpcTryExcept
1822  {
1824  PNP_DEVINST_ENABLE,
1825  ulFlags,
1826  lpDevInst,
1827  NULL);
1828  }
1830  {
1832  }
1833  RpcEndExcept;
1834 
1835  return ret;
1836 }
#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
int ret
#define CR_INVALID_DEVNODE
Definition: cfgmgr32.h:847
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:125
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
DWORD WINAPI PNP_DeviceInstanceAction(handle_t hBinding, DWORD ulAction, DWORD ulFlags, LPWSTR pszDeviceInstance1, LPWSTR pszDeviceInstance2)
Definition: rpcserver.c:2632
#define RpcExcept(expr)
Definition: rpc.h:127

Referenced by CM_Enable_DevNode(), and ResetDevice().

◆ CM_Enumerate_Classes()

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

Definition at line 1844 of file cfgmgr.c.

1848 {
1849  TRACE("CM_Enumerate_Classes(%lx %p %lx)\n",
1850  ulClassIndex, ClassGuid, ulFlags);
1851 
1852  return CM_Enumerate_Classes_Ex(ulClassIndex, ClassGuid, ulFlags, NULL);
1853 }
CONFIGRET WINAPI CM_Enumerate_Classes_Ex(_In_ ULONG ulClassIndex, _Out_ LPGUID ClassGuid, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:1861
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 1861 of file cfgmgr.c.

1866 {
1867  WCHAR szBuffer[MAX_GUID_STRING_LEN];
1870  ULONG ulLength = MAX_GUID_STRING_LEN;
1871 
1872  TRACE("CM_Enumerate_Classes_Ex(%lx %p %lx %p)\n",
1873  ulClassIndex, ClassGuid, ulFlags, hMachine);
1874 
1875  if (ClassGuid == NULL)
1876  return CR_INVALID_POINTER;
1877 
1878  if (ulFlags != 0)
1879  return CR_INVALID_FLAG;
1880 
1881  if (hMachine != NULL)
1882  {
1883  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1884  if (BindingHandle == NULL)
1885  return CR_FAILURE;
1886  }
1887  else
1888  {
1890  return CR_FAILURE;
1891  }
1892 
1893  RpcTryExcept
1894  {
1896  PNP_CLASS_SUBKEYS,
1897  ulClassIndex,
1898  szBuffer,
1900  &ulLength,
1901  ulFlags);
1902  }
1904  {
1906  }
1907  RpcEndExcept;
1908 
1909  if (ret == CR_SUCCESS)
1910  {
1911  /* Remove the {} */
1912  szBuffer[MAX_GUID_STRING_LEN - 2] = UNICODE_NULL;
1913 
1914  /* Convert the buffer to a GUID */
1915  if (UuidFromStringW(&szBuffer[1], ClassGuid) != RPC_S_OK)
1916  return CR_FAILURE;
1917  }
1918 
1919  return ret;
1920 }
#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:615
#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:438
#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:125
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 1966 of file cfgmgr.c.

1972 {
1973  WCHAR szBuffer[MAX_DEVICE_ID_LEN];
1974  ULONG ulOrigLength;
1975  ULONG ulLength;
1977 
1978  TRACE("CM_Enumerate_Enumerators_ExA(%lu %p %p %lx %p)\n",
1979  ulEnumIndex, Buffer, pulLength, ulFlags, hMachine);
1980 
1981  if (Buffer == NULL || pulLength == NULL)
1982  return CR_INVALID_POINTER;
1983 
1984  if (ulFlags != 0)
1985  return CR_INVALID_FLAG;
1986 
1987  ulOrigLength = *pulLength;
1988  *pulLength = 0;
1989 
1990  ulLength = MAX_DEVICE_ID_LEN;
1991  ret = CM_Enumerate_Enumerators_ExW(ulEnumIndex, szBuffer, &ulLength,
1992  ulFlags, hMachine);
1993  if (ret == CR_SUCCESS)
1994  {
1996  0,
1997  szBuffer,
1998  ulLength,
1999  Buffer,
2000  ulOrigLength,
2001  NULL,
2002  NULL) == 0)
2003  ret = CR_FAILURE;
2004  else
2005  *pulLength = lstrlenA(Buffer) + 1;
2006  }
2007 
2008  return ret;
2009 }
#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:2017
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 2017 of file cfgmgr.c.

2023 {
2025  CONFIGRET ret;
2026 
2027  TRACE("CM_Enumerate_Enumerators_ExW(%lu %p %p %lx %p)\n",
2028  ulEnumIndex, Buffer, pulLength, ulFlags, hMachine);
2029 
2030  if (Buffer == NULL || pulLength == NULL)
2031  return CR_INVALID_POINTER;
2032 
2033  if (ulFlags != 0)
2034  return CR_INVALID_FLAG;
2035 
2036  *Buffer = UNICODE_NULL;
2037 
2038  if (hMachine != NULL)
2039  {
2040  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2041  if (BindingHandle == NULL)
2042  return CR_FAILURE;
2043  }
2044  else
2045  {
2047  return CR_FAILURE;
2048  }
2049 
2050  RpcTryExcept
2051  {
2053  PNP_ENUMERATOR_SUBKEYS,
2054  ulEnumIndex,
2055  Buffer,
2056  *pulLength,
2057  pulLength,
2058  ulFlags);
2059  }
2061  {
2063  }
2064  RpcEndExcept;
2065 
2066  return ret;
2067 }
#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:438
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:125
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 1928 of file cfgmgr.c.

1933 {
1934  TRACE("CM_Enumerate_EnumeratorsA(%lu %p %p %lx)\n",
1935  ulEnumIndex, Buffer, pulLength, ulFlags);
1936 
1937  return CM_Enumerate_Enumerators_ExA(ulEnumIndex, Buffer, pulLength,
1938  ulFlags, NULL);
1939 }
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:1966
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 1947 of file cfgmgr.c.

1952 {
1953  TRACE("CM_Enumerate_EnumeratorsW(%lu %p %p %lx)\n",
1954  ulEnumIndex, Buffer, pulLength, ulFlags);
1955 
1956  return CM_Enumerate_Enumerators_ExW(ulEnumIndex, Buffer, pulLength,
1957  ulFlags, NULL);
1958 }
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:2017

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

2083 {
2084  FIXME("CM_Find_Range(%p %I64u %lu %I64u %I64u %p %lx)\n",
2085  pullStart, ullStart, ulLength, ullAlignment, ullEnd, rlh, ulFlags);
2086 
2087  return CR_CALL_NOT_IMPLEMENTED;
2088 }
#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 2096 of file cfgmgr.c.

2102 {
2103  PINTERNAL_RANGE_LIST pRangeList;
2104  PINTERNAL_RANGE pRange;
2105  PLIST_ENTRY ListEntry;
2107 
2108  FIXME("CM_First_Range(%p %p %p %p %lx)\n",
2109  rlh, pullStart, pullEnd, preElement, ulFlags);
2110 
2111  pRangeList = (PINTERNAL_RANGE_LIST)rlh;
2112 
2113  if (!IsValidRangeList(pRangeList))
2114  return CR_INVALID_RANGE_LIST;
2115 
2116  if (pullStart == NULL || pullEnd == NULL || preElement == NULL)
2117  return CR_INVALID_POINTER;
2118 
2119  if (ulFlags != 0)
2120  return CR_INVALID_FLAG;
2121 
2122  /* Lock the range list */
2123  WaitForSingleObject(pRangeList->hMutex, INFINITE);
2124 
2125  /* Fail, if the list is empty */
2126  if (IsListEmpty(&pRangeList->ListHead))
2127  {
2128  ret = CR_FAILURE;
2129  goto done;
2130  }
2131 
2132  /* Get the first range */
2133  ListEntry = pRangeList->ListHead.Flink;
2134  pRange = CONTAINING_RECORD(ListEntry, INTERNAL_RANGE, ListEntry);
2135 
2136  /* Return the range data */
2137  *pullStart = pRange->ullStart;
2138  *pullEnd = pRange->ullEnd;
2139  *preElement = (RANGE_ELEMENT)pRange;
2140 
2141 done:
2142  /* Unlock the range list */
2143  ReleaseMutex(pRangeList->hMutex);
2144 
2145  return ret;
2146 }
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
BOOL IsValidRangeList(_In_opt_ PINTERNAL_RANGE_LIST pRangeList)
Definition: cfgmgr.c:379
_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:119
DWORDLONG ullStart
Definition: cfgmgr.c:76
#define CR_FAILURE
Definition: cfgmgr32.h:865
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseMutex(IN HANDLE hMutex)
Definition: synch.c:564
int ret
DWORDLONG ullEnd
Definition: cfgmgr.c:77
Definition: typedefs.h:117
#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:84
#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 2154 of file cfgmgr.c.

2157 {
2158  TRACE("CM_Free_Log_Conf(%lx %lx)\n",
2159  lcLogConfToBeFreed, ulFlags);
2160 
2161  return CM_Free_Log_Conf_Ex(lcLogConfToBeFreed, ulFlags, NULL);
2162 }
CONFIGRET WINAPI CM_Free_Log_Conf_Ex(_In_ LOG_CONF lcLogConfToBeFreed, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2170
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 2170 of file cfgmgr.c.

2174 {
2176  HSTRING_TABLE StringTable = NULL;
2177  LPWSTR lpDevInst;
2178  PLOG_CONF_INFO pLogConfInfo;
2179  CONFIGRET ret;
2180 
2181  TRACE("CM_Free_Log_Conf_Ex(%lx %lx %p)\n",
2182  lcLogConfToBeFreed, ulFlags, hMachine);
2183 
2184  if (!pSetupIsUserAdmin())
2185  return CR_ACCESS_DENIED;
2186 
2187  pLogConfInfo = (PLOG_CONF_INFO)lcLogConfToBeFreed;
2188  if (!IsValidLogConf(pLogConfInfo))
2189  return CR_INVALID_LOG_CONF;
2190 
2191  if (ulFlags != 0)
2192  return CR_INVALID_FLAG;
2193 
2194  if (hMachine != NULL)
2195  {
2196  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2197  if (BindingHandle == NULL)
2198  return CR_FAILURE;
2199 
2200  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
2201  if (StringTable == 0)
2202  return CR_FAILURE;
2203  }
2204  else
2205  {
2206  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
2207  return CR_FAILURE;
2208  }
2209 
2210  lpDevInst = pSetupStringTableStringFromId(StringTable, pLogConfInfo->dnDevInst);
2211  if (lpDevInst == NULL)
2212  return CR_INVALID_DEVNODE;
2213 
2214  RpcTryExcept
2215  {
2216  ret = PNP_FreeLogConf(BindingHandle, lpDevInst, pLogConfInfo->ulFlags,
2217  pLogConfInfo->ulTag, 0);
2218  }
2220  {
2222  }
2223  RpcEndExcept;
2224 
2225  return ret;
2226 }
#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:57
#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:3261
#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:125
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:55
ULONG ulFlags
Definition: cfgmgr.c:56
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:403

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

2236 {
2237  PLOG_CONF_INFO pLogConfInfo;
2238 
2239  TRACE("CM_Free_Log_Conf_Handle(%lx)\n", lcLogConf);
2240 
2241  pLogConfInfo = (PLOG_CONF_INFO)lcLogConf;
2242  if (!IsValidLogConf(pLogConfInfo))
2243  return CR_INVALID_LOG_CONF;
2244 
2245  HeapFree(GetProcessHeap(), 0, pLogConfInfo);
2246 
2247  return CR_SUCCESS;
2248 }
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:395
#define CR_INVALID_LOG_CONF
Definition: cfgmgr32.h:850
#define HeapFree(x, y, z)
Definition: compat.h:394
BOOL IsValidLogConf(_In_opt_ PLOG_CONF_INFO pLogConfInfo)
Definition: cfgmgr.c:403

◆ CM_Free_Range_List()

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

Definition at line 2256 of file cfgmgr.c.

2259 {
2260  PINTERNAL_RANGE_LIST pRangeList;
2261  PINTERNAL_RANGE pRange;
2262  PLIST_ENTRY ListEntry;
2263 
2264  FIXME("CM_Free_Range_List(%p %lx)\n",
2265  RangeList, ulFlags);
2266 
2267  pRangeList = (PINTERNAL_RANGE_LIST)RangeList;
2268 
2269  if (!IsValidRangeList(pRangeList))
2270  return CR_INVALID_RANGE_LIST;
2271 
2272  if (ulFlags != 0)
2273  return CR_INVALID_FLAG;
2274 
2275  /* Lock the range list */
2276  WaitForSingleObject(pRangeList->hMutex, INFINITE);
2277 
2278  /* Free the list of ranges */
2279  while (!IsListEmpty(&pRangeList->ListHead))
2280  {
2281  ListEntry = RemoveHeadList(&pRangeList->ListHead);
2282  pRange = CONTAINING_RECORD(ListEntry, INTERNAL_RANGE, ListEntry);
2283  HeapFree(GetProcessHeap(), 0, pRange);
2284  }
2285 
2286  /* Unlock the range list */
2287  ReleaseMutex(pRangeList->hMutex);
2288 
2289  /* Close the mutex */
2290  CloseHandle(pRangeList->hMutex);
2291 
2292  /* Free the range list */
2293  HeapFree(GetProcessHeap(), 0, pRangeList);
2294 
2295  return CR_SUCCESS;
2296 }
#define CloseHandle
Definition: compat.h:398
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
BOOL IsValidRangeList(_In_opt_ PINTERNAL_RANGE_LIST pRangeList)
Definition: cfgmgr.c:379
_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:395
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseMutex(IN HANDLE hMutex)
Definition: synch.c:564
Definition: typedefs.h:117
#define CR_INVALID_RANGE_LIST
Definition: cfgmgr32.h:863
LIST_ENTRY ListHead
Definition: cfgmgr.c:84
#define INFINITE
Definition: serial.h:102
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ CM_Free_Res_Des()

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

Definition at line 2304 of file cfgmgr.c.

2308 {
2309  TRACE("CM_Free_Res_Des(%p %p %lx)\n",
2310  prdResDes, rdResDes, ulFlags);
2311 
2312  return CM_Free_Res_Des_Ex(prdResDes, rdResDes, ulFlags, NULL);
2313 }
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:2321
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 2321 of file cfgmgr.c.

2326 {
2327  FIXME("CM_Free_Res_Des_Ex(%p %p %lx %p)\n",
2328  prdResDes, rdResDes, ulFlags, hMachine);
2329 
2330  return CR_CALL_NOT_IMPLEMENTED;
2331 }
#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 2339 of file cfgmgr.c.

2341 {
2342  FIXME("CM_Free_Res_Des_Handle(%p)\n", rdResDes);
2343 
2344  return CR_CALL_NOT_IMPLEMENTED;
2345 }
#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 2353 of file cfgmgr.c.

2355 {
2356  PCONFLICT_DATA pConflictData;
2357 
2358  FIXME("CM_Free_Resource_Conflict_Handle(%p)\n",
2359  clConflictList);
2360 
2361  pConflictData = (PCONFLICT_DATA)clConflictList;
2362  if (!IsValidConflictData(pConflictData))
2363  return CR_INVALID_CONFLICT_LIST;
2364 
2365  if (pConflictData->pConflictList != NULL)
2366  MyFree(pConflictData->pConflictList);
2367 
2368  MyFree(pConflictData);
2369 
2370  return CR_SUCCESS;
2371 }
BOOL IsValidConflictData(_In_opt_ PCONFLICT_DATA pConflictData)
Definition: cfgmgr.c:427
PPNP_CONFLICT_LIST pConflictList
Definition: cfgmgr.c:92
#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 2379 of file cfgmgr.c.

2383 {
2384  TRACE("CM_Get_Child(%p %p %lx)\n",
2385  pdnDevInst, dnDevInst, ulFlags);
2386 
2387  return CM_Get_Child_Ex(pdnDevInst, dnDevInst, ulFlags, NULL);
2388 }
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:2396

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

2401 {
2402  WCHAR szRelatedDevInst[MAX_DEVICE_ID_LEN];
2404  HSTRING_TABLE StringTable = NULL;
2405  LPWSTR lpDevInst;
2406  DWORD dwIndex, dwLength = MAX_DEVICE_ID_LEN;
2407  CONFIGRET ret;
2408 
2409  TRACE("CM_Get_Child_Ex(%p %lx %lx %p)\n",
2410  pdnDevInst, dnDevInst, ulFlags, hMachine);
2411 
2412  if (pdnDevInst == NULL)
2413  return CR_INVALID_POINTER;
2414 
2415  if (dnDevInst == 0)
2416  return CR_INVALID_DEVINST;
2417 
2418  if (ulFlags != 0)
2419  return CR_INVALID_FLAG;
2420 
2421  *pdnDevInst = -1;
2422 
2423  if (hMachine != NULL)
2424  {
2425  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2426  if (BindingHandle == NULL)
2427  return CR_FAILURE;
2428 
2429  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
2430  if (StringTable == 0)
2431  return CR_FAILURE;
2432  }
2433  else
2434  {
2435  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
2436  return CR_FAILURE;
2437  }
2438 
2439  lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
2440  if (lpDevInst == NULL)
2441  return CR_INVALID_DEVNODE;
2442 
2443  RpcTryExcept
2444  {
2446  PNP_GET_CHILD_DEVICE_INSTANCE,
2447  lpDevInst,
2448  szRelatedDevInst,
2449  &dwLength,
2450  0);
2451  }
2453  {
2455  }
2456  RpcEndExcept;
2457 
2458  if (ret != CR_SUCCESS)
2459  return ret;
2460 
2461  TRACE("szRelatedDevInst: %s\n", debugstr_w(szRelatedDevInst));
2462 
2463  dwIndex = pSetupStringTableAddString(StringTable, szRelatedDevInst, 1);
2464  if (dwIndex == -1)
2465  return CR_FAILURE;
2466 
2467  *pdnDevInst = dwIndex;
2468 
2469  return CR_SUCCESS;
2470 }
#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:83
#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:125
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:390

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

2522 {
2523  WCHAR szBuffer[MAX_GUID_STRING_LEN];
2525  ULONG ulLength;
2526  ULONG ulOrigLength;
2527 
2528  TRACE("CM_Get_Class_Key_Name_ExA(%p %p %p %lx %p)\n",
2529  ClassGuid, pszKeyName, pulLength, ulFlags, hMachine);
2530 
2531  if (ClassGuid == NULL || pszKeyName == NULL || pulLength == NULL)
2532  return CR_INVALID_POINTER;
2533 
2534  ulOrigLength = *pulLength;
2535  *pulLength = 0;
2536 
2537  ulLength = MAX_GUID_STRING_LEN;
2538  ret = CM_Get_Class_Key_Name_ExW(ClassGuid, szBuffer, &ulLength,
2539  ulFlags, hMachine);
2540  if (ret == CR_SUCCESS)
2541  {
2543  0,
2544  szBuffer,
2545  ulLength,
2546  pszKeyName,
2547  ulOrigLength,
2548  NULL,
2549  NULL) == 0)
2550  ret = CR_FAILURE;
2551  else
2552  *pulLength = lstrlenA(pszKeyName) + 1;
2553  }
2554 
2555  return CR_SUCCESS;
2556 }
#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:2564

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

2570 {
2571  TRACE("CM_Get_Class_Key_Name_ExW(%p %p %p %lx %p)\n",
2572  ClassGuid, pszKeyName, pulLength, ulFlags, hMachine);
2573 
2574  if (ClassGuid == NULL || pszKeyName == NULL || pulLength == NULL)
2575  return CR_INVALID_POINTER;
2576 
2577  if (ulFlags != 0)
2578  return CR_INVALID_FLAG;
2579 
2580  if (*pulLength < MAX_GUID_STRING_LEN)
2581  {
2582  *pulLength = 0;
2583  return CR_BUFFER_SMALL;
2584  }
2585 
2586  if (!GuidToString(ClassGuid, pszKeyName))
2587  return CR_INVALID_DATA;
2588 
2589  *pulLength = MAX_GUID_STRING_LEN;
2590 
2591  return CR_SUCCESS;
2592 }
#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:102
#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 2478 of file cfgmgr.c.

2483 {
2484  TRACE("CM_Get_Class_Key_NameA(%p %p %p %lx)\n",
2485  ClassGuid, pszKeyName, pulLength, ulFlags);
2486 
2487  return CM_Get_Class_Key_Name_ExA(ClassGuid, pszKeyName, pulLength,
2488  ulFlags, NULL);
2489 }
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:2516
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 2497 of file cfgmgr.c.

2502 {
2503  TRACE("CM_Get_Class_Key_NameW(%p %p %p %lx)\n",
2504  ClassGuid, pszKeyName, pulLength, ulFlags);
2505 
2506  return CM_Get_Class_Key_Name_ExW(ClassGuid, pszKeyName, pulLength,
2507  ulFlags, NULL);
2508 }
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:2564

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

2644 {
2645  WCHAR szBuffer[MAX_CLASS_NAME_LEN];
2647  ULONG ulLength;
2648  ULONG ulOrigLength;
2649 
2650  TRACE("CM_Get_Class_Name_ExA(%p %p %p %lx %p)\n",
2651  ClassGuid, Buffer, pulLength, ulFlags, hMachine);
2652 
2653  if (ClassGuid == NULL || Buffer == NULL || pulLength == NULL)
2654  return CR_INVALID_POINTER;
2655 
2656  ulOrigLength = *pulLength;
2657  *pulLength = 0;
2658 
2659  ulLength = MAX_CLASS_NAME_LEN;
2660  ret = CM_Get_Class_Name_ExW(ClassGuid, szBuffer, &ulLength,
2661  ulFlags, hMachine);
2662  if (ret == CR_SUCCESS)
2663  {
2665  0,
2666  szBuffer,
2667  ulLength,
2668  Buffer,
2669  ulOrigLength,
2670  NULL,
2671  NULL) == 0)
2672  ret = CR_FAILURE;
2673  else
2674  *pulLength = lstrlenA(Buffer) + 1;
2675  }
2676 
2677  return ret;
2678 }
#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:2686
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 2686 of file cfgmgr.c.

2692 {
2693  WCHAR szGuidString[MAX_GUID_STRING_LEN];
2695  CONFIGRET ret;
2696 
2697  TRACE("CM_Get_Class_Name_ExW(%p %p %p %lx %p\n",
2698  ClassGuid, Buffer, pulLength, ulFlags, hMachine);
2699 
2700  if (ClassGuid == NULL || Buffer == NULL || pulLength == NULL)
2701  return CR_INVALID_POINTER;
2702 
2703  if (ulFlags != 0)
2704  return CR_INVALID_FLAG;
2705 
2706  if (!GuidToString(ClassGuid, szGuidString))
2707  return CR_INVALID_DATA;
2708 
2709  TRACE("Guid %s\n", debugstr_w(szGuidString));
2710 
2711  if (hMachine != NULL)
2712  {
2713  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2714  if (BindingHandle == NULL)
2715  return CR_FAILURE;
2716  }
2717  else
2718  {
2720  return CR_FAILURE;
2721  }
2722 
2723  RpcTryExcept
2724  {
2726  szGuidString,
2727  Buffer,
2728  pulLength,
2729  ulFlags);
2730  }
2732  {
2734  }
2735  RpcEndExcept;
2736 
2737  return ret;
2738 }
#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:125
DWORD WINAPI PNP_GetClassName(handle_t hBinding, LPWSTR pszClassGuid, LPWSTR Buffer, PNP_RPC_STRING_LEN *pulLength, DWORD ulFlags)
Definition: rpcserver.c:1940
static BOOL GuidToString(_In_ LPGUID Guid, _Out_ LPWSTR String)
Definition: cfgmgr.c:102
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 2600 of file cfgmgr.c.

2605 {
2606  TRACE("CM_Get_Class_NameA(%p %p %p %lx)\n",
2607  ClassGuid, Buffer, pulLength, ulFlags);
2608 
2609  return CM_Get_Class_Name_ExA(ClassGuid, Buffer, pulLength, ulFlags,
2610  NULL);
2611 }
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:2638

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

2624 {
2625  TRACE("CM_Get_Class_NameW(%p %p %p %lx)\n",
2626  ClassGuid, Buffer, pulLength, ulFlags);
2627 
2628  return CM_Get_Class_Name_ExW(ClassGuid, Buffer, pulLength, ulFlags,
2629  NULL);
2630 }
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:2686

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

2754 {
2755  PWSTR BufferW = NULL;
2756  ULONG ulLength = 0;
2757  ULONG ulType;
2758  CONFIGRET ret;
2759 
2760  TRACE("CM_Get_Class_Registry_PropertyA(%p %lu %p %p %p %lx %p)\n",
2761  ClassGuid, ulProperty, pulRegDataType, Buffer, pulLength,
2762  ulFlags, hMachine);
2763 
2764  if (pulLength == NULL)
2765  return CR_INVALID_POINTER;
2766 
2767  if (ulProperty < CM_CRP_MIN || ulProperty > CM_CRP_MAX)
2768  return CR_INVALID_PROPERTY;
2769 
2770  ulType = GetRegistryPropertyType(ulProperty);
2771  if (ulType == REG_SZ || ulType == REG_MULTI_SZ)
2772  {
2773  /* Get the required buffer size */
2774  ret = CM_Get_Class_Registry_PropertyW(ClassGuid, ulProperty, pulRegDataType,
2775  NULL, &ulLength, ulFlags, hMachine);
2776  if (ret != CR_BUFFER_SMALL)
2777  return ret;
2778 
2779  /* Allocate the unicode buffer */
2780  BufferW = HeapAlloc(GetProcessHeap(), 0, ulLength);
2781  if (BufferW == NULL)
2782  return CR_OUT_OF_MEMORY;
2783 
2784  /* Get the property */
2785  ret = CM_Get_Class_Registry_PropertyW(ClassGuid, ulProperty, pulRegDataType,
2786  BufferW, &ulLength, ulFlags, hMachine);
2787  if (ret != CR_SUCCESS)
2788  {
2789  HeapFree(GetProcessHeap(), 0, BufferW);
2790  return ret;
2791  }
2792 
2793  /* Do W->A conversion */
2794  *pulLength = WideCharToMultiByte(CP_ACP,
2795  0,
2796  BufferW,
2797  lstrlenW(BufferW) + 1,
2798  Buffer,
2799  *pulLength,
2800  NULL,
2801  NULL);
2802 
2803  /* Release the unicode buffer */
2804  HeapFree(GetProcessHeap(), 0, BufferW);
2805 
2806  if (*pulLength == 0)
2807  ret = CR_FAILURE;
2808  }
2809  else
2810  {
2811  /* Get the property */
2812  ret = CM_Get_Class_Registry_PropertyW(ClassGuid, ulProperty, pulRegDataType,
2813  Buffer, pulLength, ulFlags, hMachine);
2814  }
2815 
2816  return ret;
2817 }
#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:2825
uint16_t * PWSTR
Definition: typedefs.h:54
#define CP_ACP
Definition: compat.h:99
#define lstrlenW
Definition: compat.h:407
#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:395
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:134
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:394
#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 2825 of file cfgmgr.c.

2833 {
2835  WCHAR szGuidString[PNP_MAX_GUID_STRING_LEN + 1];
2836  ULONG ulType = 0;
2837  ULONG ulTransferLength = 0;
2838  CONFIGRET ret;
2839 
2840  TRACE("CM_Get_Class_Registry_PropertyW(%p %lu %p %p %p %lx %p)\n",
2841  ClassGuid, ulProperty, pulRegDataType, Buffer, pulLength,
2842  ulFlags, hMachine);
2843 
2844  if (ClassGuid == NULL || pulLength == NULL)
2845  return CR_INVALID_POINTER;
2846 
2847  if (ulFlags != 0)
2848  return CR_INVALID_FLAG;
2849 
2850  if (pSetupStringFromGuid(ClassGuid,
2851  szGuidString,
2853  return CR_INVALID_DATA;
2854 
2855  if (ulProperty < CM_CRP_MIN || ulProperty > CM_CRP_MAX)
2856  return CR_INVALID_PROPERTY;
2857 
2858  if (hMachine != NULL)
2859  {
2860  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2861  if (BindingHandle == NULL)
2862  return CR_FAILURE;
2863  }
2864  else
2865  {
2867  return CR_FAILURE;
2868  }
2869 
2870  ulTransferLength = *pulLength;
2871 
2872  RpcTryExcept
2873  {
2875  szGuidString,
2876  ulProperty,
2877  &ulType,
2878  Buffer,
2879  &ulTransferLength,
2880  pulLength,
2881  ulFlags);
2882  }
2884  {
2886  }
2887  RpcEndExcept;
2888 
2889  if (ret == CR_SUCCESS)
2890  {
2891  if (pulRegDataType != NULL)
2892  *pulRegDataType = ulType;
2893  }
2894 
2895  return ret;
2896 }
#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:125
#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:2161
#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 2904 of file cfgmgr.c.

2908 {
2909  TRACE("CM_Get_Depth(%p %lx %lx)\n",
2910  pulDepth, dnDevInst, ulFlags);
2911 
2912  return CM_Get_Depth_Ex(pulDepth, dnDevInst, ulFlags, NULL);
2913 }
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:2921

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

2926 {
2928  HSTRING_TABLE StringTable = NULL;
2929  LPWSTR lpDevInst;
2930  CONFIGRET ret;
2931 
2932  TRACE("CM_Get_Depth_Ex(%p %lx %lx %p)\n",
2933  pulDepth, dnDevInst, ulFlags, hMachine);
2934 
2935  if (pulDepth == NULL)
2936  return CR_INVALID_POINTER;
2937 
2938  if (dnDevInst == 0)
2939  return CR_INVALID_DEVINST;
2940 
2941  if (ulFlags != 0)
2942  return CR_INVALID_FLAG;
2943 
2944  if (hMachine != NULL)
2945  {
2946  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2947  if (BindingHandle == NULL)
2948  return CR_FAILURE;
2949 
2950  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
2951  if (StringTable == 0)
2952  return CR_FAILURE;
2953  }
2954  else
2955  {
2956  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
2957  return CR_FAILURE;
2958  }
2959 
2960  lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
2961  if (lpDevInst == NULL)
2962  return CR_INVALID_DEVNODE;
2963 
2964  RpcTryExcept
2965  {
2967  lpDevInst,
2968  pulDepth,
2969  ulFlags);
2970  }
2972  {
2974  }
2975  RpcEndExcept;
2976 
2977  return ret;
2978 }
#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:1302
#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:125
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().

◆ CM_Get_Device_ID_ExA()

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

Definition at line 3544 of file cfgmgr.c.

3550 {
3551  WCHAR szBufferW[MAX_DEVICE_ID_LEN];
3553 
3554  TRACE("CM_Get_Device_ID_ExA(%lx %p %lu %lx %p)\n",
3555  dnDevInst, Buffer, BufferLen, ulFlags, hMachine);
3556 
3557  if (Buffer == NULL)
3558  return CR_INVALID_POINTER;
3559 
3560  ret = CM_Get_Device_ID_ExW(dnDevInst,
3561  szBufferW,
3563  ulFlags,
3564  hMachine);
3565  if (ret == CR_SUCCESS)
3566  {
3568  0,
3569  szBufferW,
3570  lstrlenW(szBufferW) + 1,
3571  Buffer,
3572  BufferLen,
3573  NULL,
3574  NULL) == 0)
3575  ret = CR_FAILURE;
3576  }
3577 
3578  return ret;
3579 }
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
#define MAX_DEVICE_ID_LEN
Definition: pnpmgr.c:28
#define lstrlenW
Definition: compat.h:407
CONFIGRET WINAPI CM_Get_Device_ID_ExW(_In_ DEVINST dnDevInst, _Out_writes_(BufferLen) PWCHAR Buffer, _In_ ULONG BufferLen, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:3587
#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
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845

Referenced by CM_Get_Device_IDA().

◆ CM_Get_Device_ID_ExW()

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

Definition at line 3587 of file cfgmgr.c.

3593 {
3594  HSTRING_TABLE StringTable = NULL;
3595 
3596  TRACE("CM_Get_Device_ID_ExW(%lx %p %lu %lx %p)\n",
3597  dnDevInst, Buffer, BufferLen, ulFlags, hMachine);
3598 
3599  if (dnDevInst == 0)
3600  return CR_INVALID_DEVINST;
3601 
3602  if (Buffer == NULL)
3603  return CR_INVALID_POINTER;
3604 
3605  if (ulFlags != 0)
3606  return CR_INVALID_FLAG;
3607 
3608  if (hMachine != NULL)
3609  {
3610  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
3611  if (StringTable == NULL)
3612  return CR_FAILURE;
3613  }
3614  else
3615  {
3616  if (!PnpGetLocalHandles(NULL, &StringTable))
3617  return CR_FAILURE;
3618  }
3619 
3620  if (!pSetupStringTableStringFromIdEx(StringTable,
3621  dnDevInst,
3622  Buffer,
3623  &BufferLen))
3624  return CR_FAILURE;
3625 
3626  return CR_SUCCESS;
3627 }
BOOL WINAPI pSetupStringTableStringFromIdEx(HSTRING_TABLE hStringTable, DWORD dwId, LPWSTR lpBuffer, LPDWORD lpBufferLength)
Definition: stringtable.c:760
#define CR_INVALID_DEVINST
Definition: cfgmgr32.h:848
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
struct _MACHINE_INFO * PMACHINE_INFO
BOOL PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle, HSTRING_TABLE *StringTable)
Definition: rpc.c:66
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define TRACE(s)
Definition: solgame.cpp:4
#define CR_FAILURE
Definition: cfgmgr32.h:865
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845

Referenced by CM_Get_Device_ID_ExA(), and CM_Get_Device_IDW().

◆ CM_Get_Device_ID_List_ExA()

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

Definition at line 3673 of file cfgmgr.c.

3679 {
3680  LPWSTR BufferW = NULL;
3681  LPWSTR pszFilterW = NULL;
3683 
3684  TRACE("CM_Get_Device_ID_List_ExA(%p %p %lu %lx %p)\n",
3685  pszFilter, Buffer, BufferLen, ulFlags, hMachine);
3686 
3687  BufferW = MyMalloc(BufferLen * sizeof(WCHAR));
3688  if (BufferW == NULL)
3689  return CR_OUT_OF_MEMORY;
3690 
3691