https://bugs.winehq.org/show_bug.cgi?id=40311
Bug ID: 40311 Summary: Processing of 'DeviceIoControl' calls doesn't corresponds to specification Product: Wine Version: unspecified Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: ntoskrnl Assignee: wine-bugs@winehq.org Reporter: ugnenko@mail.ru Distribution: ---
As described in specification 'Buffer Descriptions for I/O Control Codes' for 'METHOD_IN_DIRECT' or 'METHOD_OUT_DIRECT' transfer types the data buffer, to which points the pointer passed as 'lpOutputBuffer' argument into 'DeviceIoControl', must be accessible from driver. In other words, when in control code is specified 'METHOD_IN_DIRECT' tranfer type, the 'lpOutputBuffer' buffer may be used as the additional buffer of data that driver may transfer to device. This feature is used in software and drivers for Hantek Oscilloscopes. The pointer 'lpOutputBuffer' and argument 'nOutBufferSize', which are passed to 'DeviceIoControl' function, must are used as corresponding values for fields 'StartVa', 'ByteOffset' and 'ByteCount' in 'irp->MdlAddress' structure.
But Wine allocates new output buffer that are passed to 'IoBuildDeviceIoControlRequest' (see function 'dispatch_ioctl' in source file 'dlls/ntoskrnl.exe/ntoskrnl.c'). Thus data stored in output buffer aren't available for driver.
Specification: https://msdn.microsoft.com/en-us/library/windows/hardware/ff540663(v=vs.85)....