From 55af98d1a3158b7a8b061d2162050902b80782a9 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Fri, 21 Sep 2018 09:23:30 +0300 Subject: [PATCH] opcservices: Update content stream position on Read(). Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- dlls/opcservices/package.c | 2 ++ dlls/opcservices/tests/opcservices.c | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/dlls/opcservices/package.c b/dlls/opcservices/package.c index fb07d4db783..5534fe6783c 100644 --- a/dlls/opcservices/package.c +++ b/dlls/opcservices/package.c @@ -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; } diff --git a/dlls/opcservices/tests/opcservices.c b/dlls/opcservices/tests/opcservices.c index 2ef56771740..6bb0c54c62f 100644 --- a/dlls/opcservices/tests/opcservices.c +++ b/dlls/opcservices/tests/opcservices.c @@ -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);