ReactOS  0.4.14-dev-77-gd9e7c48
cfgmgr.c File Reference
#include "setupapi_private.h"
#include <dbt.h>
#include <pnp_c.h>
#include <winsvc.h>
#include "rpc_private.h"
Include dependency graph for cfgmgr.c:

Go to the source code of this file.

Classes

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

Macros

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

Typedefs

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

Functions

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

Variables

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

Macro Definition Documentation

◆ CONFLICT_MAGIC

#define CONFLICT_MAGIC   0x11225588

Definition at line 103 of file cfgmgr.c.

◆ LOG_CONF_MAGIC

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

Definition at line 68 of file cfgmgr.c.

◆ NOTIFY_MAGIC

#define NOTIFY_MAGIC   0x44556677

Definition at line 77 of file cfgmgr.c.

◆ RANGE_LIST_MAGIC

#define RANGE_LIST_MAGIC   0x33445566

Definition at line 95 of file cfgmgr.c.

Typedef Documentation

◆ CONFLICT_DATA

◆ INTERNAL_RANGE

◆ INTERNAL_RANGE_LIST

◆ LOG_CONF_INFO

◆ MACHINE_INFO

◆ NOTIFY_DATA

◆ PCONFLICT_DATA

◆ PINTERNAL_RANGE

◆ PINTERNAL_RANGE_LIST

◆ PLOG_CONF_INFO

◆ PMACHINE_INFO

◆ PNOTIFY_DATA

Function Documentation

◆ CM_Add_Empty_Log_Conf()

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

Definition at line 857 of file cfgmgr.c.

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

◆ CM_Add_Empty_Log_Conf_Ex()

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

Definition at line 876 of file cfgmgr.c.

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

Referenced by CM_Add_Empty_Log_Conf().

◆ CM_Add_ID_ExA()

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

Definition at line 1002 of file cfgmgr.c.

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

Referenced by CM_Add_IDA().

◆ CM_Add_ID_ExW()

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

Definition at line 1030 of file cfgmgr.c.

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

Referenced by CM_Add_ID_ExA(), and CM_Add_IDW().

◆ CM_Add_IDA()

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

Definition at line 968 of file cfgmgr.c.

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

◆ CM_Add_IDW()

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

Definition at line 985 of file cfgmgr.c.

989 {
990  TRACE("CM_Add_IDW(%p %s %lx)\n",
991  dnDevInst, debugstr_w(pszID), ulFlags);
992 
993  return CM_Add_ID_ExW(dnDevInst, pszID, ulFlags, NULL);
994 }
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
CONFIGRET WINAPI CM_Add_ID_ExW(_In_ DEVINST dnDevInst, _In_ PWSTR pszID, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:1030

◆ CM_Add_Range()

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

Definition at line 1098 of file cfgmgr.c.

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

1168 {
1169  TRACE("CM_Add_Res_Des(%p %p %lu %p %lu %lx)\n",
1170  prdResDes, lcLogConf, ResourceID, ResourceData, ResourceLen, ulFlags);
1171 
1172  return CM_Add_Res_Des_Ex(prdResDes, lcLogConf, ResourceID, ResourceData,
1173  ResourceLen, ulFlags, NULL);
1174 }
CONFIGRET WINAPI CM_Add_Res_Des_Ex(_Out_opt_ PRES_DES prdResDes, _In_ LOG_CONF lcLogConf, _In_ RESOURCEID ResourceID, _In_reads_bytes_(ResourceLen) PCVOID ResourceData, _In_ ULONG ResourceLen, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:1182
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4

◆ CM_Add_Res_Des_Ex()

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

Definition at line 1182 of file cfgmgr.c.

1190 {
1191  FIXME("CM_Add_Res_Des_Ex(%p %p %lu %p %lu %lx %p)\n",
1192  prdResDes, lcLogConf, ResourceID,
1193  ResourceData, ResourceLen, ulFlags, hMachine);
1194 
1195  return CR_CALL_NOT_IMPLEMENTED;
1196 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define CR_CALL_NOT_IMPLEMENTED
Definition: cfgmgr32.h:898

Referenced by CM_Add_Res_Des().

◆ CM_Connect_MachineA()

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

Definition at line 1204 of file cfgmgr.c.

1207 {
1208  PWSTR pServerNameW;
1209  CONFIGRET ret;
1210 
1211  TRACE("CM_Connect_MachineA(%s %p)\n",
1212  debugstr_a(UNCServerName), phMachine);
1213 
1214  if (UNCServerName == NULL || *UNCServerName == 0)
1215  return CM_Connect_MachineW(NULL, phMachine);
1216 
1217  if (pSetupCaptureAndConvertAnsiArg(UNCServerName, &pServerNameW))
1218  return CR_INVALID_DATA;
1219 
1220  ret = CM_Connect_MachineW(pServerNameW, phMachine);
1221 
1222  MyFree(pServerNameW);
1223 
1224  return ret;
1225 }
uint16_t * PWSTR
Definition: typedefs.h: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:1233
#define CR_INVALID_DATA
Definition: cfgmgr32.h:877
int ret
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
VOID WINAPI MyFree(LPVOID lpMem)
Definition: misc.c:128

◆ CM_Connect_MachineW()

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

Definition at line 1233 of file cfgmgr.c.

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

Referenced by CM_Connect_MachineA(), and SetupDiCreateDeviceInfoListExW().

◆ CM_Create_DevNode_ExA()

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

Definition at line 1340 of file cfgmgr.c.

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

Referenced by CM_Create_DevNodeA().

◆ CM_Create_DevNode_ExW()

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

Definition at line 1370 of file cfgmgr.c.

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

Referenced by CM_Create_DevNode_ExA(), and CM_Create_DevNodeW().

◆ CM_Create_DevNodeA()

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

Definition at line 1302 of file cfgmgr.c.

1307 {
1308  TRACE("CM_Create_DevNodeA(%p %s %p %lx)\n",
1309  pdnDevInst, debugstr_a(pDeviceID), dnParent, ulFlags);
1310 
1311  return CM_Create_DevNode_ExA(pdnDevInst, pDeviceID, dnParent,
1312  ulFlags, NULL);
1313 }
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
CONFIGRET WINAPI CM_Create_DevNode_ExA(_Out_ PDEVINST pdnDevInst, _In_ DEVINSTID_A pDeviceID, _In_ DEVINST dnParent, _In_ ULONG ulFlags, _In_opt_ HANDLE hMachine)
Definition: cfgmgr.c:1340

◆ CM_Create_DevNodeW()

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

Definition at line 1321 of file cfgmgr.c.

1326 {
1327  TRACE("CM_Create_DevNodeW(%p %s %p %lx)\n",
1328  pdnDevInst, debugstr_w(pDeviceID), dnParent, ulFlags);
1329 
1330  return CM_Create_DevNode_ExW(pdnDevInst, pDeviceID, dnParent,
1331  ulFlags, NULL);
1332 }
CONFIGRET WINAPI CM_Create_DevNode_ExW(_Out_ PDEVINST pdnDevInst, _In_ DEVINSTID_W pDeviceID, _In_ DEVINST dnParent, _In_ ULONG ulFlags, _In_opt_ HANDLE hMachine)
Definition: cfgmgr.c:1370
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4

◆ CM_Create_Range_List()

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

Definition at line 1455 of file cfgmgr.c.

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

◆ CM_Delete_Class_Key()

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

Definition at line 1499 of file cfgmgr.c.

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

◆ CM_Delete_Class_Key_Ex()

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

Definition at line 1515 of file cfgmgr.c.

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

Referenced by CM_Delete_Class_Key().

◆ CM_Delete_DevNode_Key()

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

Definition at line 1569 of file cfgmgr.c.

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

◆ CM_Delete_DevNode_Key_Ex()

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

Definition at line 1587 of file cfgmgr.c.

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

Referenced by CM_Delete_DevNode_Key().

◆ CM_Delete_Range()

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

Definition at line 1706 of file cfgmgr.c.

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

◆ CM_Detect_Resource_Conflict()

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

Definition at line 1724 of file cfgmgr.c.

1731 {
1732  TRACE("CM_Detect_Resource_Conflict(%p %lu %p %lu %p 0x%lx)\n",
1733  dnDevInst, ResourceID, ResourceData, ResourceLen,
1734  pbConflictDetected, ulFlags);
1735 
1736  return CM_Detect_Resource_Conflict_Ex(dnDevInst,
1737  ResourceID,
1738  ResourceData,
1739  ResourceLen,
1740  pbConflictDetected,
1741  ulFlags,
1742  NULL);
1743 }
smooth NULL
Definition: ftsmooth.c:416
CONFIGRET WINAPI CM_Detect_Resource_Conflict_Ex(_In_ DEVINST dnDevInst, _In_ RESOURCEID ResourceID, _In_reads_bytes_(ResourceLen) PCVOID ResourceData, _In_ ULONG ResourceLen, _Out_ PBOOL pbConflictDetected, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:1751
#define TRACE(s)
Definition: solgame.cpp:4

◆ CM_Detect_Resource_Conflict_Ex()

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

Definition at line 1751 of file cfgmgr.c.

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

Referenced by CM_Detect_Resource_Conflict().

◆ CM_Disable_DevNode()

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

Definition at line 1773 of file cfgmgr.c.

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

◆ CM_Disable_DevNode_Ex()

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

Definition at line 1789 of file cfgmgr.c.

1793 {
1795  HSTRING_TABLE StringTable = NULL;
1796  LPWSTR lpDevInst;
1797  CONFIGRET ret;
1798 
1799  FIXME("CM_Disable_DevNode_Ex(%p %lx %p)\n",
1800  dnDevInst, ulFlags, hMachine);
1801 
1802  if (!pSetupIsUserAdmin())
1803  return CR_ACCESS_DENIED;
1804 
1805  if (dnDevInst == 0)
1806  return CR_INVALID_DEVINST;
1807 
1808  if (ulFlags != 0)
1809  return CR_INVALID_FLAG;
1810 
1811  if (hMachine != NULL)
1812  {
1813  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1814  if (BindingHandle == NULL)
1815  return CR_FAILURE;
1816 
1817  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
1818  if (StringTable == 0)
1819  return CR_FAILURE;
1820  }
1821  else
1822  {
1823  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
1824  return CR_FAILURE;
1825  }
1826 
1827  lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
1828  if (lpDevInst == NULL)
1829  return CR_INVALID_DEVNODE;
1830 
1831  RpcTryExcept
1832  {
1834  PNP_DEVINST_DISABLE,
1835  ulFlags,
1836  lpDevInst,
1837  NULL);
1838  }
1840  {
1842  }
1843  RpcEndExcept;
1844 
1845  return ret;
1846 }
#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:133
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
BOOL WINAPI pSetupIsUserAdmin(VOID)
Definition: misc.c:1817
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LPWSTR WINAPI pSetupStringTableStringFromId(HSTRING_TABLE hStringTable, DWORD dwId)
Definition: stringtable.c:722
DWORD WINAPI PNP_DeviceInstanceAction(handle_t hBinding, DWORD ulAction, DWORD ulFlags, LPWSTR pszDeviceInstance1, LPWSTR pszDeviceInstance2)
Definition: rpcserver.c:2667
#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 1854 of file cfgmgr.c.

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

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

◆ CM_Dup_Range_List()

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

Definition at line 1885 of file cfgmgr.c.

1889 {
1890  FIXME("CM_Dup_Range_List(%p %p %lx)\n",
1891  rlhOld, rlhNew, ulFlags);
1892 
1893  return CR_CALL_NOT_IMPLEMENTED;
1894 }
#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 1902 of file cfgmgr.c.

1905 {
1906  TRACE("CM_Enable_DevNode(%p %lx)\n",
1907  dnDevInst, ulFlags);
1908 
1909  return CM_Enable_DevNode_Ex(dnDevInst, ulFlags, NULL);
1910 }
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:1918

◆ CM_Enable_DevNode_Ex()

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

Definition at line 1918 of file cfgmgr.c.

1922 {
1924  HSTRING_TABLE StringTable = NULL;
1925  LPWSTR lpDevInst;
1926  CONFIGRET ret;
1927 
1928  TRACE("CM_Enable_DevNode_Ex(%p %lx %p)\n",
1929  dnDevInst, ulFlags, hMachine);
1930 
1931  if (!pSetupIsUserAdmin())
1932  return CR_ACCESS_DENIED;
1933 
1934  if (dnDevInst == 0)
1935  return CR_INVALID_DEVINST;
1936 
1937  if (ulFlags != 0)
1938  return CR_INVALID_FLAG;
1939 
1940  if (hMachine != NULL)
1941  {
1942  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
1943  if (BindingHandle == NULL)
1944  return CR_FAILURE;
1945 
1946  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
1947  if (StringTable == 0)
1948  return CR_FAILURE;
1949  }
1950  else
1951  {
1952  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
1953  return CR_FAILURE;
1954  }
1955 
1956  lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
1957  if (lpDevInst == NULL)
1958  return CR_INVALID_DEVNODE;
1959 
1960  RpcTryExcept
1961  {
1963  PNP_DEVINST_ENABLE,
1964  ulFlags,
1965  lpDevInst,
1966  NULL);
1967  }
1969  {
1971  }
1972  RpcEndExcept;
1973 
1974  return ret;
1975 }
#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:133
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
BOOL WINAPI pSetupIsUserAdmin(VOID)
Definition: misc.c:1817
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LPWSTR WINAPI pSetupStringTableStringFromId(HSTRING_TABLE hStringTable, DWORD dwId)
Definition: stringtable.c:722
DWORD WINAPI PNP_DeviceInstanceAction(handle_t hBinding, DWORD ulAction, DWORD ulFlags, LPWSTR pszDeviceInstance1, LPWSTR pszDeviceInstance2)
Definition: rpcserver.c:2667
#define RpcExcept(expr)
Definition: rpc.h:127

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

◆ CM_Enumerate_Classes()

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

Definition at line 1983 of file cfgmgr.c.

1987 {
1988  TRACE("CM_Enumerate_Classes(%lx %p %lx)\n",
1989  ulClassIndex, ClassGuid, ulFlags);
1990 
1991  return CM_Enumerate_Classes_Ex(ulClassIndex, ClassGuid, ulFlags, NULL);
1992 }
CONFIGRET WINAPI CM_Enumerate_Classes_Ex(_In_ ULONG ulClassIndex, _Out_ LPGUID ClassGuid, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2000
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 2000 of file cfgmgr.c.

2005 {
2006  WCHAR szBuffer[MAX_GUID_STRING_LEN];
2009  ULONG ulLength = MAX_GUID_STRING_LEN;
2010 
2011  TRACE("CM_Enumerate_Classes_Ex(%lx %p %lx %p)\n",
2012  ulClassIndex, ClassGuid, ulFlags, hMachine);
2013 
2014  if (ClassGuid == NULL)
2015  return CR_INVALID_POINTER;
2016 
2017  if (ulFlags != 0)
2018  return CR_INVALID_FLAG;
2019 
2020  if (hMachine != NULL)
2021  {
2022  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2023  if (BindingHandle == NULL)
2024  return CR_FAILURE;
2025  }
2026  else
2027  {
2029  return CR_FAILURE;
2030  }
2031 
2032  RpcTryExcept
2033  {
2035  PNP_CLASS_SUBKEYS,
2036  ulClassIndex,
2037  szBuffer,
2039  &ulLength,
2040  ulFlags);
2041  }
2043  {
2045  }
2046  RpcEndExcept;
2047 
2048  if (ret == CR_SUCCESS)
2049  {
2050  /* Remove the {} */
2051  szBuffer[MAX_GUID_STRING_LEN - 2] = UNICODE_NULL;
2052 
2053  /* Convert the buffer to a GUID */
2054  if (UuidFromStringW(&szBuffer[1], ClassGuid) != RPC_S_OK)
2055  return CR_FAILURE;
2056  }
2057 
2058  return ret;
2059 }
#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:473
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_GUID_STRING_LEN
Definition: apphelp.c:29
#define CR_FAILURE
Definition: cfgmgr32.h:865
int ret
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:133
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
unsigned int ULONG
Definition: retypes.h:1
#define RPC_S_OK
Definition: rpcnterr.h:22
#define RpcExcept(expr)
Definition: rpc.h:127

Referenced by CM_Enumerate_Classes().

◆ CM_Enumerate_Enumerators_ExA()

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

Definition at line 2105 of file cfgmgr.c.

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

2162 {
2164  CONFIGRET ret;
2165 
2166  TRACE("CM_Enumerate_Enumerators_ExW(%lu %p %p %lx %p)\n",
2167  ulEnumIndex, Buffer, pulLength, ulFlags, hMachine);
2168 
2169  if (Buffer == NULL || pulLength == NULL)
2170  return CR_INVALID_POINTER;
2171 
2172  if (ulFlags != 0)
2173  return CR_INVALID_FLAG;
2174 
2175  *Buffer = UNICODE_NULL;
2176 
2177  if (hMachine != NULL)
2178  {
2179  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2180  if (BindingHandle == NULL)
2181  return CR_FAILURE;
2182  }
2183  else
2184  {
2186  return CR_FAILURE;
2187  }
2188 
2189  RpcTryExcept
2190  {
2192  PNP_ENUMERATOR_SUBKEYS,
2193  ulEnumIndex,
2194  Buffer,
2195  *pulLength,
2196  pulLength,
2197  ulFlags);
2198  }
2200  {
2202  }
2203  RpcEndExcept;
2204 
2205  return ret;
2206 }
#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:473
Definition: bufpool.h:45
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define CR_FAILURE
Definition: cfgmgr32.h:865
int ret
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:133
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
#define RpcExcept(expr)
Definition: rpc.h:127

Referenced by CM_Enumerate_Enumerators_ExA(), and CM_Enumerate_EnumeratorsW().

◆ CM_Enumerate_EnumeratorsA()

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

Definition at line 2067 of file cfgmgr.c.

2072 {
2073  TRACE("CM_Enumerate_EnumeratorsA(%lu %p %p %lx)\n",
2074  ulEnumIndex, Buffer, pulLength, ulFlags);
2075 
2076  return CM_Enumerate_Enumerators_ExA(ulEnumIndex, Buffer, pulLength,
2077  ulFlags, NULL);
2078 }
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:2105
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 2086 of file cfgmgr.c.

2091 {
2092  TRACE("CM_Enumerate_EnumeratorsW(%lu %p %p %lx)\n",
2093  ulEnumIndex, Buffer, pulLength, ulFlags);
2094 
2095  return CM_Enumerate_Enumerators_ExW(ulEnumIndex, Buffer, pulLength,
2096  ulFlags, NULL);
2097 }
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:2156

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

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

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

◆ CM_Free_Log_Conf()

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

Definition at line 2293 of file cfgmgr.c.

2296 {
2297  TRACE("CM_Free_Log_Conf(%lx %lx)\n",
2298  lcLogConfToBeFreed, ulFlags);
2299 
2300  return CM_Free_Log_Conf_Ex(lcLogConfToBeFreed, ulFlags, NULL);
2301 }
CONFIGRET WINAPI CM_Free_Log_Conf_Ex(_In_ LOG_CONF lcLogConfToBeFreed, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:2309
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 2309 of file cfgmgr.c.

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

Referenced by CM_Free_Log_Conf().

◆ CM_Free_Log_Conf_Handle()

CONFIGRET WINAPI CM_Free_Log_Conf_Handle ( _In_ LOG_CONF  lcLogConf)

Definition at line 2373 of file cfgmgr.c.

2375 {
2376  PLOG_CONF_INFO pLogConfInfo;
2377 
2378  TRACE("CM_Free_Log_Conf_Handle(%lx)\n", lcLogConf);
2379 
2380  pLogConfInfo = (PLOG_CONF_INFO)lcLogConf;
2381  if (!IsValidLogConf(pLogConfInfo))
2382  return CR_INVALID_LOG_CONF;
2383 
2384  HeapFree(GetProcessHeap(), 0, pLogConfInfo);
2385 
2386  return CR_SUCCESS;
2387 }
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:411

◆ CM_Free_Range_List()

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

Definition at line 2395 of file cfgmgr.c.

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

2447 {
2448  TRACE("CM_Free_Res_Des(%p %p %lx)\n",
2449  prdResDes, rdResDes, ulFlags);
2450 
2451  return CM_Free_Res_Des_Ex(prdResDes, rdResDes, ulFlags, NULL);
2452 }
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:2460
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 2460 of file cfgmgr.c.

2465 {
2466  FIXME("CM_Free_Res_Des_Ex(%p %p %lx %p)\n",
2467  prdResDes, rdResDes, ulFlags, hMachine);
2468 
2469  return CR_CALL_NOT_IMPLEMENTED;
2470 }
#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 2478 of file cfgmgr.c.

2480 {
2481  FIXME("CM_Free_Res_Des_Handle(%p)\n", rdResDes);
2482 
2483  return CR_CALL_NOT_IMPLEMENTED;
2484 }
#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 2492 of file cfgmgr.c.

2494 {
2495  PCONFLICT_DATA pConflictData;
2496 
2497  FIXME("CM_Free_Resource_Conflict_Handle(%p)\n",
2498  clConflictList);
2499 
2500  pConflictData = (PCONFLICT_DATA)clConflictList;
2501  if (!IsValidConflictData(pConflictData))
2502  return CR_INVALID_CONFLICT_LIST;
2503 
2504  if (pConflictData->pConflictList != NULL)
2505  MyFree(pConflictData->pConflictList);
2506 
2507  MyFree(pConflictData);
2508 
2509  return CR_SUCCESS;
2510 }
BOOL IsValidConflictData(_In_opt_ PCONFLICT_DATA pConflictData)
Definition: cfgmgr.c:435
PPNP_CONFLICT_LIST pConflictList
Definition: cfgmgr.c:100
#define FIXME(fmt,...)
Definition: debug.h:110
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
#define CR_INVALID_CONFLICT_LIST
Definition: cfgmgr32.h:903
struct _CONFLICT_DATA * PCONFLICT_DATA
VOID WINAPI MyFree(LPVOID lpMem)
Definition: misc.c:128

◆ CM_Get_Child()

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

Definition at line 2518 of file cfgmgr.c.

2522 {
2523  TRACE("CM_Get_Child(%p %p %lx)\n",
2524  pdnDevInst, dnDevInst, ulFlags);
2525 
2526  return CM_Get_Child_Ex(pdnDevInst, dnDevInst, ulFlags, NULL);
2527 }
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:2535

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

2540 {
2541  WCHAR szRelatedDevInst[MAX_DEVICE_ID_LEN];
2543  HSTRING_TABLE StringTable = NULL;
2544  LPWSTR lpDevInst;
2545  DWORD dwIndex, dwLength = MAX_DEVICE_ID_LEN;
2546  CONFIGRET ret;
2547 
2548  TRACE("CM_Get_Child_Ex(%p %lx %lx %p)\n",
2549  pdnDevInst, dnDevInst, ulFlags, hMachine);
2550 
2551  if (pdnDevInst == NULL)
2552  return CR_INVALID_POINTER;
2553 
2554  if (dnDevInst == 0)
2555  return CR_INVALID_DEVINST;
2556 
2557  if (ulFlags != 0)
2558  return CR_INVALID_FLAG;
2559 
2560  *pdnDevInst = -1;
2561 
2562  if (hMachine != NULL)
2563  {
2564  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
2565  if (BindingHandle == NULL)
2566  return CR_FAILURE;
2567 
2568  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
2569  if (StringTable == 0)
2570  return CR_FAILURE;
2571  }
2572  else
2573  {
2574  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
2575  return CR_FAILURE;
2576  }
2577 
2578  lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
2579  if (lpDevInst == NULL)
2580  return CR_INVALID_DEVNODE;
2581 
2582  RpcTryExcept
2583  {
2585  PNP_GET_CHILD_DEVICE_INSTANCE,
2586  lpDevInst,
2587  szRelatedDevInst,
2588  &dwLength,
2589  0);
2590  }
2592  {
2594  }
2595  RpcEndExcept;
2596 
2597  if (ret != CR_SUCCESS)
2598  return ret;
2599 
2600  TRACE("szRelatedDevInst: %s\n", debugstr_w(szRelatedDevInst));
2601 
2602  dwIndex = pSetupStringTableAddString(StringTable, szRelatedDevInst, 1);
2603  if (dwIndex == -1)
2604  return CR_FAILURE;
2605 
2606  *pdnDevInst = dwIndex;
2607 
2608  return CR_SUCCESS;
2609 }
#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:133
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LPWSTR WINAPI pSetupStringTableStringFromId(HSTRING_TABLE hStringTable, DWORD dwId)
Definition: stringtable.c:722
#define RpcExcept(expr)
Definition: rpc.h:127
DWORD WINAPI PNP_GetRelatedDeviceInstance(handle_t hBinding, DWORD ulRelationship, LPWSTR pDeviceID, LPWSTR pRelatedDeviceId, PNP_RPC_STRING_LEN *pulLength, DWORD ulFlags)
Definition: rpcserver.c:425

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

2661 {
2662  WCHAR szBuffer[MAX_GUID_STRING_LEN];
2664  ULONG ulLength;
2665  ULONG ulOrigLength;
2666 
2667  TRACE("CM_Get_Class_Key_Name_ExA(%p %p %p %lx %p)\n",
2668  ClassGuid, pszKeyName, pulLength, ulFlags, hMachine);
2669 
2670  if (ClassGuid == NULL || pszKeyName == NULL || pulLength == NULL)
2671  return CR_INVALID_POINTER;
2672 
2673  ulOrigLength = *pulLength;
2674  *pulLength = 0;
2675 
2676  ulLength = MAX_GUID_STRING_LEN;
2677  ret = CM_Get_Class_Key_Name_ExW(ClassGuid, szBuffer, &ulLength,
2678  ulFlags, hMachine);
2679  if (ret == CR_SUCCESS)
2680  {
2682  0,
2683  szBuffer,
2684  ulLength,
2685  pszKeyName,
2686  ulOrigLength,
2687  NULL,
2688  NULL) == 0)
2689  ret = CR_FAILURE;
2690  else
2691  *pulLength = lstrlenA(pszKeyName) + 1;
2692  }
2693 
2694  return CR_SUCCESS;
2695 }
#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:2703

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

2709 {
2710  TRACE("CM_Get_Class_Key_Name_ExW(%p %p %p %lx %p)\n",
2711  ClassGuid, pszKeyName, pulLength, ulFlags, hMachine);
2712 
2713  if (ClassGuid == NULL || pszKeyName == NULL || pulLength == NULL)
2714  return CR_INVALID_POINTER;
2715 
2716  if (ulFlags != 0)
2717  return CR_INVALID_FLAG;
2718 
2719  if (*pulLength < MAX_GUID_STRING_LEN)
2720  {
2721  *pulLength = 0;
2722  return CR_BUFFER_SMALL;
2723  }
2724 
2725  if (!GuidToString(ClassGuid, pszKeyName))
2726  return CR_INVALID_DATA;
2727 
2728  *pulLength = MAX_GUID_STRING_LEN;
2729 
2730  return CR_SUCCESS;
2731 }
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
#define CR_SUCCESS
Definition: cfgmgr32.h:842
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define MAX_GUID_STRING_LEN
Definition: apphelp.c:29
#define CR_BUFFER_SMALL
Definition: cfgmgr32.h:872
#define CR_INVALID_DATA
Definition: cfgmgr32.h:877
static BOOL GuidToString(_In_ LPGUID Guid, _Out_ LPWSTR String)
Definition: cfgmgr.c:110
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845

Referenced by CM_Get_Class_Key_Name_ExA(), and CM_Get_Class_Key_NameW().

◆ CM_Get_Class_Key_NameA()

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

Definition at line 2617 of file cfgmgr.c.

2622 {
2623  TRACE("CM_Get_Class_Key_NameA(%p %p %p %lx)\n",
2624  ClassGuid, pszKeyName, pulLength, ulFlags);
2625 
2626  return CM_Get_Class_Key_Name_ExA(ClassGuid, pszKeyName, pulLength,
2627  ulFlags, NULL);
2628 }
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:2655
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 2636 of file cfgmgr.c.

2641 {
2642  TRACE("CM_Get_Class_Key_NameW(%p %p %p %lx)\n",
2643  ClassGuid, pszKeyName, pulLength, ulFlags);
2644 
2645  return CM_Get_Class_Key_Name_ExW(ClassGuid, pszKeyName, pulLength,
2646  ulFlags, NULL);
2647 }
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:2703

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

2783 {
2784  WCHAR szBuffer[MAX_CLASS_NAME_LEN];
2786  ULONG ulLength;
2787  ULONG ulOrigLength;
2788 
2789  TRACE("CM_Get_Class_Name_ExA(%p %p %p %lx %p)\n",
2790  ClassGuid, Buffer, pulLength, ulFlags, hMachine);
2791 
2792  if (ClassGuid == NULL || Buffer == NULL || pulLength == NULL)
2793  return CR_INVALID_POINTER;
2794 
2795  ulOrigLength = *pulLength;
2796  *pulLength = 0;
2797 
2798  ulLength = MAX_CLASS_NAME_LEN;
2799  ret = CM_Get_Class_Name_ExW(ClassGuid, szBuffer, &ulLength,
2800  ulFlags, hMachine);
2801  if (ret == CR_SUCCESS)
2802  {
2804  0,
2805  szBuffer,
2806  ulLength,
2807  Buffer,
2808  ulOrigLength,
2809  NULL,
2810  NULL) == 0)
2811  ret = CR_FAILURE;
2812  else
2813  *pulLength = lstrlenA(Buffer) + 1;
2814  }
2815 
2816  return ret;
2817 }
#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:2825
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 2825 of file cfgmgr.c.

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

Referenced by CM_Get_Class_Name_ExA(), and CM_Get_Class_NameW().

◆ CM_Get_Class_NameA()

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

Definition at line 2739 of file cfgmgr.c.

2744 {
2745  TRACE("CM_Get_Class_NameA(%p %p %p %lx)\n",
2746  ClassGuid, Buffer, pulLength, ulFlags);
2747 
2748  return CM_Get_Class_Name_ExA(ClassGuid, Buffer, pulLength, ulFlags,
2749  NULL);
2750 }
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:2777

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

2763 {
2764  TRACE("CM_Get_Class_NameW(%p %p %p %lx)\n",
2765  ClassGuid, Buffer, pulLength, ulFlags);
2766 
2767  return CM_Get_Class_Name_ExW(ClassGuid, Buffer, pulLength, ulFlags,
2768  NULL);
2769 }
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:2825

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

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

2972 {
2974  WCHAR szGuidString[PNP_MAX_GUID_STRING_LEN + 1];
2975  ULONG ulType = 0;
2976  ULONG ulTransferLength = 0;
2977  CONFIGRET ret;
2978 
2979  TRACE("CM_Get_Class_Registry_PropertyW(%p %lu %p %p %p %lx %p)\n",
2980  ClassGuid, ulProperty, pulRegDataType, Buffer, pulLength,
2981  ulFlags, hMachine);
2982 
2983  if (ClassGuid == NULL || pulLength == NULL)
2984  return CR_INVALID_POINTER;
2985 
2986  if (ulFlags != 0)
2987  return CR_INVALID_FLAG;
2988 
2989  if (pSetupStringFromGuid(ClassGuid,
2990  szGuidString,
2992  return CR_INVALID_DATA;
2993 
2994  if (ulProperty < CM_CRP_MIN || ulProperty > CM_CRP_MAX)
2995  return CR_INVALID_PROPERTY;
2996 
2997  if (hMachine != NULL)
2998  {
2999  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
3000  if (BindingHandle == NULL)
3001  return CR_FAILURE;
3002  }
3003  else
3004  {
3006  return CR_FAILURE;
3007  }
3008 
3009  ulTransferLength = *pulLength;
3010 
3011  RpcTryExcept
3012  {
3014  szGuidString,
3015  ulProperty,
3016  &ulType,
3017  Buffer,
3018  &ulTransferLength,
3019  pulLength,
3020  ulFlags);
3021  }
3023  {
3025  }
3026  RpcEndExcept;
3027 
3028  if (ret == CR_SUCCESS)
3029  {
3030  if (pulRegDataType != NULL)
3031  *pulRegDataType = ulType;
3032  }
3033 
3034  return ret;
3035 }
#define RpcEndExcept
Definition: rpc.h:128
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
struct _MACHINE_INFO * PMACHINE_INFO
_In_ ULONG _Out_ HANDLE * BindingHandle
Definition: tdikrnl.h:1146
BOOL PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle, HSTRING_TABLE *StringTable)
Definition: rpc.c:66
#define RpcTryExcept
Definition: rpc.h:126
#define CR_SUCCESS
Definition: cfgmgr32.h:842
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
const unsigned long PNP_MAX_GUID_STRING_LEN
Definition: pnp.idl:9
smooth NULL
Definition: ftsmooth.c:416
#define CR_INVALID_PROPERTY
Definition: cfgmgr32.h:899
Definition: bufpool.h:45
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define CR_FAILURE
Definition: cfgmgr32.h:865
DWORD WINAPI pSetupStringFromGuid(LPGUID lpGUID, PWSTR pString, DWORD dwStringLen)
Definition: misc.c:1775
#define CR_INVALID_DATA
Definition: cfgmgr32.h:877
int ret
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:133
#define CM_CRP_MAX
Definition: cfgmgr32.h:733
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
_In_z_ PCWSTR _In_ ULONG ulType
Definition: ntuser.h:36
DWORD WINAPI PNP_GetClassRegProp(handle_t hBinding, LPWSTR pszClassGuid, DWORD ulProperty, DWORD *pulRegDataType, BYTE *Buffer, PNP_RPC_STRING_LEN *pulTransferLen, PNP_RPC_STRING_LEN *pulLength, DWORD ulFlags)
Definition: rpcserver.c:2196
#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 3043 of file cfgmgr.c.

3047 {
3048  TRACE("CM_Get_Depth(%p %lx %lx)\n",
3049  pulDepth, dnDevInst, ulFlags);
3050 
3051  return CM_Get_Depth_Ex(pulDepth, dnDevInst, ulFlags, NULL);
3052 }
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:3060

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

3065 {
3067  HSTRING_TABLE StringTable = NULL;
3068  LPWSTR lpDevInst;
3069  CONFIGRET ret;
3070 
3071  TRACE("CM_Get_Depth_Ex(%p %lx %lx %p)\n",
3072  pulDepth, dnDevInst, ulFlags, hMachine);
3073 
3074  if (pulDepth == NULL)
3075  return CR_INVALID_POINTER;
3076 
3077  if (dnDevInst == 0)
3078  return CR_INVALID_DEVINST;
3079 
3080  if (ulFlags != 0)
3081  return CR_INVALID_FLAG;
3082 
3083  if (hMachine != NULL)
3084  {
3085  BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
3086  if (BindingHandle == NULL)
3087  return CR_FAILURE;
3088 
3089  StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
3090  if (StringTable == 0)
3091  return CR_FAILURE;
3092  }
3093  else
3094  {
3095  if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
3096  return CR_FAILURE;
3097  }
3098 
3099  lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
3100  if (lpDevInst == NULL)
3101  return CR_INVALID_DEVNODE;
3102 
3103  RpcTryExcept
3104  {
3106  lpDevInst,
3107  pulDepth,
3108  ulFlags);
3109  }
3111  {
3113  }
3114  RpcEndExcept;
3115 
3116  return ret;
3117 }
#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:1337
#define CR_INVALID_FLAG
Definition: cfgmgr32.h:846
struct _MACHINE_INFO * PMACHINE_INFO
_In_ ULONG _Out_ HANDLE * BindingHandle
Definition: tdikrnl.h:1146
BOOL PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle, HSTRING_TABLE *StringTable)
Definition: rpc.c:66
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
#define TRACE(s)
Definition: solgame.cpp:4
#define CR_FAILURE
Definition: cfgmgr32.h:865
int ret
#define CR_INVALID_DEVNODE
Definition: cfgmgr32.h:847
static CONFIGRET RpcStatusToCmStatus(_In_ RPC_STATUS Status)
Definition: cfgmgr.c:133
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define CR_INVALID_POINTER
Definition: cfgmgr32.h:845
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LPWSTR WINAPI pSetupStringTableStringFromId(HSTRING_TABLE hStringTable, DWORD dwId)
Definition: stringtable.c:722
#define RpcExcept(expr)
Definition: rpc.h:127

Referenced by CM_Get_Depth().

◆ CM_Get_De