shlwapi: Test and fix the behaviour of the CopyTo method for file sizes not multiple of the internal buffer size, on SHCreateStreamOnFileEx-returned IStreams.

David Quintana (gigaherz) gigaherz at gmail.com
Sun Oct 20 13:53:04 CDT 2013


When using the IStream::CopyTo method with a file source that is not a
multiple of the internal buffer size, and specifying a length that's
more than the file length, the method would exit the copy early,
discarding the last partial buffer. This results in invalid behaviour,
where the number of bytes read does not match the number of bytes
written.

The patch adds a test for this behaviour, and fixes the implementation
to handle it correctly.

The changes were tested under Xubuntu running on VMware Workstation 10.

---
 dlls/shlwapi/istream.c       |   4 +-
 dlls/shlwapi/tests/istream.c | 102 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 105 insertions(+), 1 deletion(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-shlwapi-Test-and-fix-the-behaviour-of-the-CopyTo-met.patch
Type: application/octet-stream
Size: 4612 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20131020/8d70305d/attachment-0001.obj>


More information about the wine-patches mailing list