On 8/27/21 7:56 PM, Zebediah Figura (she/her) wrote:
On 8/26/21 12:59 AM, Rémi Bernon wrote:
+static WCHAR *query_instance_id(DEVICE_OBJECT *device) +{ + struct device_extension *ext = ext_from_DEVICE_OBJECT(device); + struct device_state *state = ext->state; + DWORD len = wcslen(state->instance_id); + WCHAR *dst;
+ if ((dst = ExAllocatePool(PagedPool, len * sizeof(WCHAR)))) + wcscpy(dst, state->instance_id);
+ return dst; +}
+static WCHAR *query_device_id(DEVICE_OBJECT *device) +{ + struct device_extension *ext = ext_from_DEVICE_OBJECT(device); + DWORD len = wcslen(ext->device_id); + WCHAR *dst;
+ if ((dst = ExAllocatePool(PagedPool, len * sizeof(WCHAR)))) + wcscpy(dst, ext->device_id);
+ return dst; +}
Missing space for a null terminator in these two.
In general these could also be memcpy(), although that's a bit of a nitpick.
Indeed.
+static WCHAR *query_hardware_ids(DEVICE_OBJECT *device) +{ + struct device_extension *ext = (struct device_extension *)device->DeviceExtension; + DWORD len = wcslen(ext->device_id); + WCHAR *dst;
+ if ((dst = ExAllocatePool(PagedPool, (len + 2) * sizeof(WCHAR)))) + { + wcscpy(dst, ext->device_id); + dst[len + 1] = 0; + }
+ return dst; +}
+static WCHAR *query_compatible_ids(DEVICE_OBJECT *device) +{ + DWORD len = wcslen(L"WINEBUS\WINE_COMP_HID"); + WCHAR *dst;
+ if ((dst = ExAllocatePool(PagedPool, (len + 2) * sizeof(WCHAR)))) + { + wcscpy(dst, L"WINEBUS\WINE_COMP_HID"); + dst[len + 1] = 0; + }
+ return dst; +}
Same comment from last time (on a different patch?) about defining a static const WCHAR[] variable for that string.
Actually, it seems like quite a lot of feedback from https://www.winehq.org/pipermail/wine-devel/2021-August/193365.html has not been addressed, or responded to.
Indeed, I missed them somehow... sorry.