Hello,
Thank you for your question and reaching out.
First you should read out MAXIMUM_TRANSFER_SIZE. For sending, WinUSB "divides the buffer into appropriately sized chunks, if necessary" (source).
Also check the remarks of WinUsb_ReadPipe:
If the data returned by the device is greater than a maximum transfer length, WinUSB divides the request into smaller requests of maximum transfer length and submits them serially. If the transfer length is not a multiple of the endpoint's maximum packet size (retrievable through the WINUSB_PIPE_INFORMATION structure's MaximumPacketSize member), WinUSB increases the size of the transfer to the next multiple of MaximumPacketSize.
USB packet size does not factor into the transfer for a read request. If the device responds with a packet that is too large for the client buffer, the behavior of the read request corresponds to the type of policy set on the pipe. If policy type for the pipe is ALLOW_PARTIAL_READS, WinUSB adds the remaining data to the beginning of the next transfer. If ALLOW_PARTIAL_READS is not set, the read request fails. For more information about policy types, see WinUSB Functions for Pipe Policy Modification.
Check your settings and whether the last Byte is send with a second transfer. You also should test how many bytes have been actually written / read.
Please have a look on below Microsoft threads.
If the reply was helpful, please don’t forget to upvote or accept as answer.