http://bugs.winehq.org/show_bug.cgi?id=59512 Bug ID: 59512 Summary: HID devices report wrong DeviceType causing GetFileType() to return FILE_TYPE_DISK Product: Wine Version: 11.4 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: hid Assignee: wine-bugs@list.winehq.org Reporter: Robert-Gerigk@online.de Distribution: --- Created attachment 80536 --> http://bugs.winehq.org/attachment.cgi?id=80536 test program HID device handles return incorrect values for GetFileType() and NtQueryVolumeInformationFile(FileFsDeviceInformation). Windows behavior (tested on Windows 11): - GetFileType() returns FILE_TYPE_UNKNOWN (0) - DeviceType = FILE_DEVICE_UNKNOWN (0x22) - Characteristics = FILE_AUTOGENERATED_DEVICE_NAME (0x80) Wine behavior (Wine 11.4): - GetFileType() returns FILE_TYPE_DISK (1) - DeviceType = 0x00000000 - Characteristics = 0x00000000 Root cause: hidclass.sys creates child PDOs with DeviceType=0 and no IRP_MJ_QUERY_VOLUME_INFORMATION handler. GetFileType() maps DeviceType 0 to its default case, returning FILE_TYPE_DISK. This breaks .NET applications that use FileStream on HID device handles (e.g. KNX automation software ETS6), because FileStream treats FILE_TYPE_DISK handles as seekable files and fails when trying to seek on a HID device. Tested with MDT KNX USB Interface (VID 16D0, PID 0491). Windows 11 output of hid_filetype_test.exe (attached to this ticket): === HID GetFileType / DeviceType Test === HID GUID: {4D1E55B2-F16F-11CF-88CB-001111000030} Device 0: \\?\hid#msft1234#5&149340ea&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} GetFileType: FILE_TYPE_UNKNOWN (0) NtQueryVolumeInformationFile(FileFsDeviceInformation): Status: 0x00000000 DeviceType: 0x00000022 Characteristics: 0x00000080 ... Device 5: \\?\hid#vid_16d0&pid_0491#6&2b4efaa3&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} GetFileType: FILE_TYPE_UNKNOWN (0) NtQueryVolumeInformationFile(FileFsDeviceInformation): Status: 0x00000000 DeviceType: 0x00000022 Characteristics: 0x00000080 HID: VID=16D0 PID=0491 Ver=513 Caps: UsagePage=0xFF00 Usage=0x0001 InLen=64 OutLen=64 Product: KNX-USB Inteface ... --- 10 device(s) opened, all report identical values --- Wine 11.4 output of same executable: === HID GetFileType / DeviceType Test === Device 0: \\?\hid#vid_16d0&pid_0491&mi_00#...#{4d1e55b2-f16f-11cf-88cb-001111000030} GetFileType: FILE_TYPE_DISK (1) NtQueryVolumeInformationFile(FileFsDeviceInformation): Status: 0x00000000 DeviceType: 0x00000000 Characteristics: 0x00000000 HID: VID=16D0 PID=0491 Ver=513 Caps: UsagePage=0xFF00 Usage=0x0001 InLen=64 OutLen=64 Product: KNX-USB Inteface --- 3 device(s) opened, all report identical values --- I have a patch ready (test + fix) and will submit a merge request once confirmed. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.