Skip to content

Commit

Permalink
Remove large-transfers, as the concept is fundamentally broken
Browse files Browse the repository at this point in the history
  • Loading branch information
dontech committed Jan 1, 2024
1 parent a512023 commit 5beec48
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1,136 deletions.
7 changes: 3 additions & 4 deletions libusb/src/driver/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,16 @@
// calls the transfer function and returns NTSTATUS
#define TRANSFER_IOCTL_EXECUTE() \
if (transfer_buffer_length > (ULONG)(maxTransferSize)) \
/* split large transfers */ \
return large_transfer(dev, irp, \
/* capped transfer */ \
return transfer(dev, irp, \
usbdDirection, \
urbFunction, \
pipe_info, \
request->endpoint.packet_size, \
maxTransferSize, \
request->endpoint.transfer_flags, \
request->endpoint.iso_start_frame_latency, \
transfer_buffer_mdl, \
transfer_buffer_length); \
maxTransferSize); \

This comment has been minimized.

Copy link
@sonatique

sonatique Jan 2, 2024

I didn't understand what will happen with data above maxTransferSize, in the case of an OUT transfer: I think some data will never get transferred, right?

else \
/* normal transfer */ \
return transfer(dev, irp, \
Expand Down
12 changes: 0 additions & 12 deletions libusb/src/driver/libusb_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -350,18 +350,6 @@ NTSTATUS transfer(libusb_device_t* dev,
IN PMDL mdlAddress,
IN int totalLength);

NTSTATUS large_transfer(IN libusb_device_t* dev,
IN PIRP irp,
IN int direction,
IN int urbFunction,
IN libusb_endpoint_t* endpoint,
IN int packetSize,
IN int maxTransferSize,
IN int transferFlags,
IN int isoLatency,
IN PMDL mdlAddress,
IN int totalLength);

ULONG get_current_frame(IN PDEVICE_EXTENSION dev, IN PIRP Irp);

PVOID allocate_pool(SIZE_T bytes);
Expand Down
Loading

0 comments on commit 5beec48

Please sign in to comment.