Re: [1/5] windowscodecs: Implement IWICStream::InitializeFromIStream. (try 2)
Józef Kucia <joseph.kucia(a)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? -- Dmitry.
On Tue, May 29, 2012 at 12:07 PM, Dmitry Timoshkov <dmitry(a)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(a)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. -- Dmitry.
On Tue, May 29, 2012 at 12:29 PM, Dmitry Timoshkov <dmitry(a)baikal.ru> wrote:
Józef Kucia <joseph.kucia(a)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(a)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.
participants (3)
-
Dmitry Timoshkov -
Józef Kucia -
Vincent Povirk