From: Rémi Bernon <rbernon@codeweavers.com> --- dlls/setupapi/devinst.c | 76 ------------------------------------- dlls/setupapi/setupapi.spec | 12 +++--- 2 files changed, 6 insertions(+), 82 deletions(-) diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index 11cdff54f14..d7b7cdbcf7c 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -853,29 +853,6 @@ static struct device *create_device(struct DeviceInfoSet *set, return device; } -static struct device *get_devnode_device(DEVINST devnode, HDEVINFO *set, SP_DEVINFO_DATA *data) -{ - WCHAR instance_id[MAX_PATH]; - - data->cbSize = sizeof(*data); - *set = NULL; - if (CM_Get_Device_IDW(devnode, instance_id, ARRAY_SIZE(instance_id), 0)) - { - WARN("device node %lu not found\n", devnode); - return NULL; - } - - *set = SetupDiCreateDeviceInfoListExW(NULL, NULL, NULL, NULL); - if (*set == INVALID_HANDLE_VALUE) return NULL; - if (!SetupDiOpenDeviceInfoW(*set, instance_id, NULL, 0, data)) - { - SetupDiDestroyDeviceInfoList(*set); - *set = NULL; - return NULL; - } - return get_device(*set, data); -} - /*********************************************************************** * SetupDiBuildClassInfoList (SETUPAPI.@) */ @@ -4685,59 +4662,6 @@ BOOL WINAPI SetupDiGetDevicePropertyW(HDEVINFO devinfo, PSP_DEVINFO_DATA device_ return !ls; } -/*********************************************************************** - * CM_Get_DevNode_Property_ExW (SETUPAPI.@) - */ -CONFIGRET WINAPI CM_Get_DevNode_Property_ExW(DEVINST devnode, const DEVPROPKEY *prop_key, DEVPROPTYPE *prop_type, - BYTE *prop_buff, ULONG *prop_buff_size, ULONG flags, HMACHINE machine) -{ - HDEVINFO set; - SP_DEVINFO_DATA data = { sizeof(data) }; - struct device *device; - LSTATUS ls; - - TRACE("%lu, %p, %p, %p, %p, %#lx, %p\n", devnode, prop_key, prop_type, prop_buff, prop_buff_size, - flags, machine); - - if (machine) - return CR_MACHINE_UNAVAILABLE; - - if (!prop_buff_size) - return CR_INVALID_POINTER; - - if (!(device = get_devnode_device(devnode, &set, &data))) - return CR_NO_SUCH_DEVINST; - - ls = get_device_property(device, set, &data, prop_key, prop_type, prop_buff, *prop_buff_size, - prop_buff_size, flags); - SetupDiDestroyDeviceInfoList(set); - switch (ls) - { - case NO_ERROR: - return CR_SUCCESS; - case ERROR_INVALID_DATA: - return CR_INVALID_DATA; - case ERROR_INVALID_USER_BUFFER: - return CR_INVALID_POINTER; - case ERROR_INVALID_FLAGS: - return CR_INVALID_FLAG; - case ERROR_INSUFFICIENT_BUFFER: - return CR_BUFFER_SMALL; - case ERROR_NOT_FOUND: - return CR_NO_SUCH_VALUE; - } - return CR_FAILURE; -} - -/*********************************************************************** - * CM_Get_DevNode_PropertyW (SETUPAPI.@) - */ -CONFIGRET WINAPI CM_Get_DevNode_PropertyW(DEVINST dev, const DEVPROPKEY *key, DEVPROPTYPE *type, - BYTE *buf, PULONG len, ULONG flags) -{ - return CM_Get_DevNode_Property_ExW(dev, key, type, buf, len, flags, NULL); -} - /*********************************************************************** * SetupDiInstallDeviceInterfaces (SETUPAPI.@) */ diff --git a/dlls/setupapi/setupapi.spec b/dlls/setupapi/setupapi.spec index 6deb5cd949b..4c47b2ffe70 100644 --- a/dlls/setupapi/setupapi.spec +++ b/dlls/setupapi/setupapi.spec @@ -67,12 +67,12 @@ @ stdcall CM_Get_Class_Registry_PropertyW(ptr long ptr ptr long long ptr) cfgmgr32.CM_Get_Class_Registry_PropertyW @ stub CM_Get_Depth @ stub CM_Get_Depth_Ex -@ stdcall CM_Get_DevNode_PropertyW(long ptr ptr ptr ptr long) -@ stdcall CM_Get_DevNode_Property_ExW(long ptr ptr ptr ptr long ptr) -@ stdcall CM_Get_DevNode_Registry_PropertyA(long long ptr ptr ptr long) -@ stdcall CM_Get_DevNode_Registry_PropertyW(long long ptr ptr ptr long) -@ stdcall CM_Get_DevNode_Registry_Property_ExA(long long ptr ptr ptr long ptr) -@ stdcall CM_Get_DevNode_Registry_Property_ExW(long long ptr ptr ptr long ptr) +@ stdcall CM_Get_DevNode_PropertyW(long ptr ptr ptr ptr long) cfgmgr32.CM_Get_DevNode_PropertyW +@ stdcall CM_Get_DevNode_Property_ExW(long ptr ptr ptr ptr long ptr) cfgmgr32.CM_Get_DevNode_Property_ExW +@ stdcall CM_Get_DevNode_Registry_PropertyA(long long ptr ptr ptr long) cfgmgr32.CM_Get_DevNode_Registry_PropertyA +@ stdcall CM_Get_DevNode_Registry_PropertyW(long long ptr ptr ptr long) cfgmgr32.CM_Get_DevNode_Registry_PropertyW +@ stdcall CM_Get_DevNode_Registry_Property_ExA(long long ptr ptr ptr long ptr) cfgmgr32.CM_Get_DevNode_Registry_Property_ExA +@ stdcall CM_Get_DevNode_Registry_Property_ExW(long long ptr ptr ptr long ptr) cfgmgr32.CM_Get_DevNode_Registry_Property_ExW @ stdcall CM_Get_DevNode_Status(ptr ptr long long) @ stdcall CM_Get_DevNode_Status_Ex(ptr ptr long long ptr) @ stdcall CM_Get_Device_IDA(ptr ptr long long) cfgmgr32.CM_Get_Device_IDA -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10584