opcservices: Update content stream position on Read().

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2018-09-21 09:23:30 +03:00 committed by Alexandre Julliard
parent 8479238fec
commit 55af98d1a3
2 changed files with 7 additions and 0 deletions

View File

@ -560,6 +560,8 @@ static HRESULT WINAPI opc_content_stream_Read(IStream *iface, void *buff, ULONG
if (*num_read)
memcpy(buff, stream->content->data + stream->pos.QuadPart, *num_read);
stream->pos.QuadPart += *num_read;
return S_OK;
}

View File

@ -159,6 +159,11 @@ static void test_package(void)
ok(hr == S_OK, "Failed to read content, hr %#x.\n", hr);
ok(!memcmp(buff, "abc", 3), "Unexpected content.\n");
move.QuadPart = 0;
hr = IStream_Seek(stream2, move, STREAM_SEEK_CUR, &pos);
ok(SUCCEEDED(hr), "Seek failed, hr %#x.\n", hr);
ok(pos.QuadPart == 3, "Unexpected position.\n");
IStream_Release(stream);
IStream_Release(stream2);