Stream_Write_UINT32(out, OutputBufferSize); /** OutputBufferSize */
Stream_Seek(out, OutputBufferSize);
- if (!pdev->isChannelClosed(pdev))
- callback->channel->Write(callback->channel, Stream_GetPosition(out), Stream_Buffer(out),
- NULL);
+ stream_write_and_free(callback->plugin, callback->channel, out);
}
}
LIBUSB_ENDPOINT_IN | LIBUSB_REQUEST_TYPE_VENDOR | Recipient,
bMS_Vendorcode, (InterfaceNumber << 8) | Ms_PageIndex,
Ms_featureDescIndex, Buffer, *BufferSize, Timeout);
- *BufferSize = error;
+ log_libusb_result(pdev->urbdrc->log, WLOG_DEBUG, "libusb_control_transfer", error);
+
+ if (error >= 0)
+ *BufferSize = error;
}
if (error < 0)
pos = Stream_GetPosition(s);
if (write)
{
- length = Stream_GetPosition(s);
+ length = pos;
Stream_SetPosition(s, 0);
}
else
WLog_Print(log, WLOG_DEBUG,
"[%-5s] %s [%08" PRIx32 "] InterfaceId=%08" PRIx32 ", MessageId=%08" PRIx32
- ", FunctionId=%08" PRIx32 ", length=%" PRIdz,
+ ", FunctionId=%08" PRIx32 ", length=%" PRIuz,
type, call_to_string(client, InterfaceId, FunctionId), FunctionId, InterfaceId,
MessageId, FunctionId, length);
#if defined(WITH_DEBUG_URBDRC)