[PATCH 6/6] winebus.sys: Remove the now useless get_string callback.

Rémi Bernon rbernon at codeweavers.com
Mon Sep 13 06:01:49 CDT 2021


Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
 dlls/winebus.sys/bus_iohid.c    | 27 --------------
 dlls/winebus.sys/bus_sdl.c      | 19 ----------
 dlls/winebus.sys/bus_udev.c     | 65 ---------------------------------
 dlls/winebus.sys/main.c         | 15 --------
 dlls/winebus.sys/unix_private.h |  1 -
 dlls/winebus.sys/unixlib.c      | 20 ----------
 dlls/winebus.sys/unixlib.h      |  9 -----
 7 files changed, 156 deletions(-)

diff --git a/dlls/winebus.sys/bus_iohid.c b/dlls/winebus.sys/bus_iohid.c
index d80c7b3aad5..18e318f7789 100644
--- a/dlls/winebus.sys/bus_iohid.c
+++ b/dlls/winebus.sys/bus_iohid.c
@@ -184,32 +184,6 @@ static NTSTATUS iohid_device_get_report_descriptor(struct unix_device *iface, BY
     return STATUS_SUCCESS;
 }
 
-static NTSTATUS iohid_device_get_string(struct unix_device *iface, DWORD index, WCHAR *buffer, DWORD length)
-{
-    struct platform_private *private = impl_from_unix_device(iface);
-    CFStringRef str;
-    switch (index)
-    {
-        default:
-            ERR("Unknown string index\n");
-            return STATUS_NOT_IMPLEMENTED;
-    }
-
-    if (str)
-    {
-        if (length < CFStringGetLength(str) + 1)
-            return STATUS_BUFFER_TOO_SMALL;
-        CFStringToWSTR(str, buffer, length);
-    }
-    else
-    {
-        if (!length) return STATUS_BUFFER_TOO_SMALL;
-        buffer[0] = 0;
-    }
-
-    return STATUS_SUCCESS;
-}
-
 static void iohid_device_set_output_report(struct unix_device *iface, HID_XFER_PACKET *packet, IO_STATUS_BLOCK *io)
 {
     IOReturn result;
@@ -273,7 +247,6 @@ static const struct unix_device_vtbl iohid_device_vtbl =
     iohid_device_compare,
     iohid_device_start,
     iohid_device_get_report_descriptor,
-    iohid_device_get_string,
     iohid_device_set_output_report,
     iohid_device_get_feature_report,
     iohid_device_set_feature_report,
diff --git a/dlls/winebus.sys/bus_sdl.c b/dlls/winebus.sys/bus_sdl.c
index 78c22f0e139..8d6df3e1f13 100644
--- a/dlls/winebus.sys/bus_sdl.c
+++ b/dlls/winebus.sys/bus_sdl.c
@@ -515,24 +515,6 @@ static NTSTATUS sdl_device_get_reportdescriptor(struct unix_device *iface, BYTE
     return STATUS_SUCCESS;
 }
 
-static NTSTATUS sdl_device_get_string(struct unix_device *iface, DWORD index, WCHAR *buffer, DWORD length)
-{
-    const char* str = NULL;
-
-    switch (index)
-    {
-        default:
-            ERR("Unhandled string index %i\n", index);
-    }
-
-    if (str && str[0])
-        MultiByteToWideChar(CP_ACP, 0, str, -1, buffer, length);
-    else
-        buffer[0] = 0;
-
-    return STATUS_SUCCESS;
-}
-
 static void sdl_device_set_output_report(struct unix_device *iface, HID_XFER_PACKET *packet, IO_STATUS_BLOCK *io)
 {
     struct platform_private *ext = impl_from_unix_device(iface);
@@ -598,7 +580,6 @@ static const struct unix_device_vtbl sdl_device_vtbl =
     sdl_device_compare,
     sdl_device_start,
     sdl_device_get_reportdescriptor,
-    sdl_device_get_string,
     sdl_device_set_output_report,
     sdl_device_get_feature_report,
     sdl_device_set_feature_report,
diff --git a/dlls/winebus.sys/bus_udev.c b/dlls/winebus.sys/bus_udev.c
index 6cfd4e7fb38..3010e50ce98 100644
--- a/dlls/winebus.sys/bus_udev.c
+++ b/dlls/winebus.sys/bus_udev.c
@@ -641,54 +641,6 @@ static NTSTATUS hidraw_device_get_report_descriptor(struct unix_device *iface, B
 #endif
 }
 
-static NTSTATUS hidraw_device_get_string(struct unix_device *iface, DWORD index, WCHAR *buffer, DWORD length)
-{
-    struct udev_device *usbdev;
-    struct platform_private *private = impl_from_unix_device(iface);
-    WCHAR *str = NULL;
-
-    usbdev = udev_device_get_parent_with_subsystem_devtype(private->udev_device, "usb", "usb_device");
-    if (usbdev)
-    {
-        switch (index)
-        {
-            default:
-                ERR("Unhandled string index %08x\n", index);
-                return STATUS_NOT_IMPLEMENTED;
-        }
-    }
-    else
-    {
-#ifdef HAVE_LINUX_HIDRAW_H
-        switch (index)
-        {
-            default:
-                ERR("Unhandled string index %08x\n", index);
-                return STATUS_NOT_IMPLEMENTED;
-        }
-#else
-        return STATUS_NOT_IMPLEMENTED;
-#endif
-    }
-
-    if (!str)
-    {
-        if (!length) return STATUS_BUFFER_TOO_SMALL;
-        buffer[0] = 0;
-        return STATUS_SUCCESS;
-    }
-
-    if (length <= strlenW(str))
-    {
-        HeapFree(GetProcessHeap(), 0, str);
-        return STATUS_BUFFER_TOO_SMALL;
-    }
-
-    strcpyW(buffer, str);
-    HeapFree(GetProcessHeap(), 0, str);
-    return STATUS_SUCCESS;
-}
-
 static DWORD CALLBACK device_report_thread(void *args)
 {
     DEVICE_OBJECT *device = (DEVICE_OBJECT*)args;
@@ -829,7 +781,6 @@ static const struct unix_device_vtbl hidraw_device_vtbl =
     udev_device_compare,
     hidraw_device_start,
     hidraw_device_get_report_descriptor,
-    hidraw_device_get_string,
     hidraw_device_set_output_report,
     hidraw_device_get_feature_report,
     hidraw_device_set_feature_report,
@@ -914,21 +865,6 @@ static NTSTATUS lnxev_device_get_report_descriptor(struct unix_device *iface, BY
     return STATUS_SUCCESS;
 }
 
-static NTSTATUS lnxev_device_get_string(struct unix_device *iface, DWORD index, WCHAR *buffer, DWORD length)
-{
-    char str[255];
-
-    str[0] = 0;
-    switch (index)
-    {
-        default:
-            ERR("Unhandled string index %i\n", index);
-    }
-
-    MultiByteToWideChar(CP_ACP, 0, str, -1, buffer, length);
-    return STATUS_SUCCESS;
-}
-
 static DWORD CALLBACK lnxev_device_report_thread(void *args)
 {
     DEVICE_OBJECT *device = (DEVICE_OBJECT*)args;
@@ -985,7 +921,6 @@ static const struct unix_device_vtbl lnxev_device_vtbl =
     udev_device_compare,
     lnxev_device_start,
     lnxev_device_get_report_descriptor,
-    lnxev_device_get_string,
     lnxev_device_set_output_report,
     lnxev_device_get_feature_report,
     lnxev_device_set_feature_report,
diff --git a/dlls/winebus.sys/main.c b/dlls/winebus.sys/main.c
index 79367989c63..c6d7859dcfa 100644
--- a/dlls/winebus.sys/main.c
+++ b/dlls/winebus.sys/main.c
@@ -181,19 +181,6 @@ static NTSTATUS unix_device_get_report_descriptor(DEVICE_OBJECT *device, BYTE *b
     return winebus_call(device_get_report_descriptor, &params);
 }
 
-static NTSTATUS unix_device_get_string(DEVICE_OBJECT *device, DWORD index, WCHAR *buffer, DWORD length)
-{
-    struct device_extension *ext = (struct device_extension *)device->DeviceExtension;
-    struct device_string_params params =
-    {
-        .iface = ext->unix_device,
-        .index = index,
-        .buffer = buffer,
-        .length = length,
-    };
-    return winebus_call(device_get_string, &params);
-}
-
 static void unix_device_set_output_report(DEVICE_OBJECT *device, HID_XFER_PACKET *packet, IO_STATUS_BLOCK *io)
 {
     struct device_extension *ext = (struct device_extension *)device->DeviceExtension;
@@ -942,8 +929,6 @@ static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp)
             TRACE("IOCTL_HID_GET_STRING[%08x]\n", index);
 
             irp->IoStatus.Status = hid_get_device_string(device, index, (WCHAR *)irp->UserBuffer, buffer_len);
-            if (irp->IoStatus.Status != STATUS_SUCCESS)
-                irp->IoStatus.Status = unix_device_get_string(device, index, (WCHAR *)irp->UserBuffer, buffer_len / sizeof(WCHAR));
             if (irp->IoStatus.Status == STATUS_SUCCESS)
                 irp->IoStatus.Information = (strlenW((WCHAR *)irp->UserBuffer) + 1) * sizeof(WCHAR);
             break;
diff --git a/dlls/winebus.sys/unix_private.h b/dlls/winebus.sys/unix_private.h
index 5cf999fff86..767c9335114 100644
--- a/dlls/winebus.sys/unix_private.h
+++ b/dlls/winebus.sys/unix_private.h
@@ -35,7 +35,6 @@ struct unix_device_vtbl
     int (*compare)(struct unix_device *iface, void *platform_dev);
     NTSTATUS (*start)(struct unix_device *iface, DEVICE_OBJECT *device);
     NTSTATUS (*get_report_descriptor)(struct unix_device *iface, BYTE *buffer, DWORD length, DWORD *out_length);
-    NTSTATUS (*get_string)(struct unix_device *iface, DWORD index, WCHAR *buffer, DWORD length);
     void (*set_output_report)(struct unix_device *iface, HID_XFER_PACKET *packet, IO_STATUS_BLOCK *io);
     void (*get_feature_report)(struct unix_device *iface, HID_XFER_PACKET *packet, IO_STATUS_BLOCK *io);
     void (*set_feature_report)(struct unix_device *iface, HID_XFER_PACKET *packet, IO_STATUS_BLOCK *io);
diff --git a/dlls/winebus.sys/unixlib.c b/dlls/winebus.sys/unixlib.c
index dc0f3e4e608..67efb794e4f 100644
--- a/dlls/winebus.sys/unixlib.c
+++ b/dlls/winebus.sys/unixlib.c
@@ -69,11 +69,6 @@ static NTSTATUS mouse_get_report_descriptor(struct unix_device *iface, BYTE *buf
     return STATUS_SUCCESS;
 }
 
-static NTSTATUS mouse_get_string(struct unix_device *iface, DWORD index, WCHAR *buffer, DWORD length)
-{
-    return STATUS_NOT_IMPLEMENTED;
-}
-
 static void mouse_set_output_report(struct unix_device *iface, HID_XFER_PACKET *packet, IO_STATUS_BLOCK *io)
 {
     FIXME("id %u, stub!\n", packet->reportId);
@@ -101,7 +96,6 @@ static const struct unix_device_vtbl mouse_vtbl =
     mouse_compare,
     mouse_start,
     mouse_get_report_descriptor,
-    mouse_get_string,
     mouse_set_output_report,
     mouse_get_feature_report,
     mouse_set_feature_report,
@@ -158,11 +152,6 @@ static NTSTATUS keyboard_get_report_descriptor(struct unix_device *iface, BYTE *
     return STATUS_SUCCESS;
 }
 
-static NTSTATUS keyboard_get_string(struct unix_device *iface, DWORD index, WCHAR *buffer, DWORD length)
-{
-    return STATUS_NOT_IMPLEMENTED;
-}
-
 static void keyboard_set_output_report(struct unix_device *iface, HID_XFER_PACKET *packet, IO_STATUS_BLOCK *io)
 {
     FIXME("id %u, stub!\n", packet->reportId);
@@ -190,7 +179,6 @@ static const struct unix_device_vtbl keyboard_vtbl =
     keyboard_compare,
     keyboard_start,
     keyboard_get_report_descriptor,
-    keyboard_get_string,
     keyboard_set_output_report,
     keyboard_get_feature_report,
     keyboard_set_feature_report,
@@ -243,13 +231,6 @@ static NTSTATUS unix_device_get_report_descriptor(void *args)
     return iface->vtbl->get_report_descriptor(iface, params->buffer, params->length, params->out_length);
 }
 
-static NTSTATUS unix_device_get_string(void *args)
-{
-    struct device_string_params *params = args;
-    struct unix_device *iface = params->iface;
-    return iface->vtbl->get_string(iface, params->index, params->buffer, params->length);
-}
-
 static NTSTATUS unix_device_set_output_report(void *args)
 {
     struct device_report_params *params = args;
@@ -291,7 +272,6 @@ const unixlib_entry_t __wine_unix_call_funcs[] =
     unix_device_compare,
     unix_device_start,
     unix_device_get_report_descriptor,
-    unix_device_get_string,
     unix_device_set_output_report,
     unix_device_get_feature_report,
     unix_device_set_feature_report,
diff --git a/dlls/winebus.sys/unixlib.h b/dlls/winebus.sys/unixlib.h
index 164a7984938..12df5d8bd5b 100644
--- a/dlls/winebus.sys/unixlib.h
+++ b/dlls/winebus.sys/unixlib.h
@@ -118,14 +118,6 @@ struct device_descriptor_params
     DWORD *out_length;
 };
 
-struct device_string_params
-{
-    struct unix_device *iface;
-    DWORD index;
-    WCHAR *buffer;
-    DWORD length;
-};
-
 struct device_report_params
 {
     struct unix_device *iface;
@@ -150,7 +142,6 @@ enum unix_funcs
     device_compare,
     device_start,
     device_get_report_descriptor,
-    device_get_string,
     device_set_output_report,
     device_get_feature_report,
     device_set_feature_report,
-- 
2.33.0




More information about the wine-devel mailing list