From fae5f627a092ca3b3c79d0da050e6ff41c67f53f Mon Sep 17 00:00:00 2001 From: Benjamin Dobell Date: Sat, 21 Feb 2015 03:38:07 +1100 Subject: Implemented hack to make WinUSB play nice with empty receive transfers --- heimdall/source/BridgeManager.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/heimdall/source/BridgeManager.cpp b/heimdall/source/BridgeManager.cpp index 1065795..b7bff3d 100644 --- a/heimdall/source/BridgeManager.cpp +++ b/heimdall/source/BridgeManager.cpp @@ -650,6 +650,14 @@ bool BridgeManager::SendBulkTransfer(unsigned char *data, int length, int timeou int BridgeManager::ReceiveBulkTransfer(unsigned char *data, int length, int timeout, bool retry) const { + if (data == nullptr) + { + // HACK: It seems WinUSB ignores us when we try to read with length zero. + static unsigned char dummyData; + data = &dummyData; + length = 1; + } + int dataTransferred; int result = libusb_bulk_transfer(deviceHandle, inEndpoint, data, length, &dataTransferred, timeout); -- cgit v1.1