mcuee / libusbk

libusbk official github repo
74 stars 36 forks source link

Implement LUsb0_ControlTransfer for libusb0 #15

Closed qmfrederik closed 4 years ago

qmfrederik commented 5 years ago

It appears the message format which libusb0.sys expects for control messages is different from what is currently implemented.

This PR ports part of libusb0.dll's native usb_control_msg and integrates it in libusbK as LUsb0_ControlTransfer.

I've tested this locally and it appears to work, although feedback is welcome.

tormodvolden commented 2 years ago

What was the reason for special-casing SET_CONFIGURATION? Was it possibly the zero-length issue in https://github.com/mcuee/libusb-win32/pull/22 which is now fixed in libusb-win32 1.2.7.2? Of course no rush to tidy this up but would be good to know the details.

EDIT: I think I get the idea, I see it is a separate IOCTL so no relation to that control transfer IOCTL issue. In libusb0.sys it is dealt with in libusb-win32/libusb/src/driver/set_configuration.c and maybe it is the request.timeout that is missing in libusbk/libusbK/src/lusbk_bknd_libusbk.c?