summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Dobell <benjamin.dobell+git@glassechidna.com.au>2015-02-20 17:38:07 +0100
committerBenjamin Dobell <benjamin.dobell+git@glassechidna.com.au>2015-02-20 17:50:55 +0100
commitfae5f627a092ca3b3c79d0da050e6ff41c67f53f (patch)
tree63c00b9d69a8c74770a9946df01a5bbe483b7a1e
parentFixed incorrect method arguments causing PIT transfers to fail (diff)
downloadHeimdall-fae5f627a092ca3b3c79d0da050e6ff41c67f53f.tar
Heimdall-fae5f627a092ca3b3c79d0da050e6ff41c67f53f.tar.gz
Heimdall-fae5f627a092ca3b3c79d0da050e6ff41c67f53f.tar.bz2
Heimdall-fae5f627a092ca3b3c79d0da050e6ff41c67f53f.tar.lz
Heimdall-fae5f627a092ca3b3c79d0da050e6ff41c67f53f.tar.xz
Heimdall-fae5f627a092ca3b3c79d0da050e6ff41c67f53f.tar.zst
Heimdall-fae5f627a092ca3b3c79d0da050e6ff41c67f53f.zip
-rw-r--r--heimdall/source/BridgeManager.cpp8
1 files changed, 8 insertions, 0 deletions
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);