Józef Kucia joseph.kucia@gmail.com wrote:
- offset.QuadPart = 0;
- size.u.LowPart = 0xffffffff;
- size.u.HighPart = 0xffffffff;
- return IWICStream_InitializeFromIStreamRegion(iface, pIStream, offset, size);
What prevents you from discovering correct stream size?
On Tue, May 29, 2012 at 12:07 PM, Dmitry Timoshkov dmitry@baikal.ru wrote:
What prevents you from discovering correct stream size?
A stream can grow its memory. For example, IStream returned by CreateStreamOnHGlobal do this.
Józef Kucia joseph.kucia@gmail.com wrote:
What prevents you from discovering correct stream size?
A stream can grow its memory. For example, IStream returned by CreateStreamOnHGlobal do this.
I don't think you need to worry about that unless you have a test case or an app that depends on this.
On Tue, May 29, 2012 at 12:29 PM, Dmitry Timoshkov dmitry@baikal.ru wrote:
Józef Kucia joseph.kucia@gmail.com wrote:
A stream can grow its memory. For example, IStream returned by CreateStreamOnHGlobal do this.
I don't think you need to worry about that unless you have a test case or an app that depends on this.
That's what native does. See the attached unit tests.
- offset.QuadPart = 0;
- size.u.LowPart = 0xffffffff;
- size.u.HighPart = 0xffffffff;
- return IWICStream_InitializeFromIStreamRegion(iface, pIStream, offset, size);
What prevents you from discovering correct stream size?
The size passed to InitializeFromIStreamRegion is an upper limit. If the underlying stream is smaller, the appropriate size will still be reported from Read, Stat, and Seek.
BTW, the patch looks good to me.
On Tue, May 29, 2012 at 8:07 AM, Vincent Povirk madewokherd@gmail.com wrote:
- offset.QuadPart = 0;
- size.u.LowPart = 0xffffffff;
- size.u.HighPart = 0xffffffff;
- return IWICStream_InitializeFromIStreamRegion(iface, pIStream, offset, size);
What prevents you from discovering correct stream size?
The size passed to InitializeFromIStreamRegion is an upper limit. If the underlying stream is smaller, the appropriate size will still be reported from Read, Stat, and Seek.