Commit 17a64c44 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

windowscodecs: Add a test to show that metadata reader may not rewind the stream…

windowscodecs: Add a test to show that metadata reader may not rewind the stream after loading the data.
parent 3b89ffa2
...@@ -142,6 +142,8 @@ static void load_stream(IUnknown *reader, const char *data, int data_size) ...@@ -142,6 +142,8 @@ static void load_stream(IUnknown *reader, const char *data, int data_size)
HRESULT hr; HRESULT hr;
IWICPersistStream *persist; IWICPersistStream *persist;
IStream *stream; IStream *stream;
LARGE_INTEGER pos;
ULARGE_INTEGER cur_pos;
stream = create_stream(data, data_size); stream = create_stream(data, data_size);
if (!stream) if (!stream)
...@@ -158,6 +160,13 @@ static void load_stream(IUnknown *reader, const char *data, int data_size) ...@@ -158,6 +160,13 @@ static void load_stream(IUnknown *reader, const char *data, int data_size)
IWICPersistStream_Release(persist); IWICPersistStream_Release(persist);
} }
pos.QuadPart = 0;
hr = IStream_Seek(stream, pos, SEEK_CUR, &cur_pos);
ok(hr == S_OK, "IStream_Seek error %#x\n", hr);
/* IFD metadata reader doesn't rewind the stream to the start */
ok(cur_pos.QuadPart == 0 || cur_pos.QuadPart <= data_size,
"current stream pos is at %x/%x, data size %x\n", cur_pos.u.LowPart, cur_pos.u.HighPart, data_size);
IStream_Release(stream); IStream_Release(stream);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment