[PATCH] windowscodecs: Implement WICCreateBitmapFromSection.

Alexandre Julliard julliard at winehq.org
Fri Mar 16 09:44:42 CDT 2018


Hans Leidekker <hans at codeweavers.com> writes:

> On Thu, 2018-03-15 at 23:00 +0800, Dmitry Timoshkov wrote:
>> Hans Leidekker <hans at codeweavers.com> wrote:
>> 
>> > On Thu, 2018-03-15 at 22:40 +0800, Dmitry Timoshkov wrote:
>> > > Hans Leidekker <hans at codeweavers.com> wrote:
>> > > 
>> > > > > +    buffer = MapViewOfFile(section, access, 0, offset, 0);
>> > > > > +    if (!buffer) return HRESULT_FROM_WIN32(GetLastError());
>> > > > 
>> > > > MapViewOfFile wants a multiple of the allocation granularity for the
>> > > > offset. Does WICCreateBitmapFromSectionEx have the same constraint?
>> > > 
>> > > I would be very much surprised if it doesn't, a passed in section
>> > > handle implies using MapViewOfFile to access the bitmap bits.
>> > 
>> > It could also map at the base and store the offset.
>> 
>> At the moment I'm not well enough prepared to write a test case, but
>> feel free to write one. I'd still assume based on syntax similarity
>> of MapViewOfFile and WICCreateBitmapFromSection that the latter is
>> modelled around the former one.
>
> How about this? I'm including a modified version of your implementation
> that passes the test.

I'd suggest doing it the same way CreateDIBSection does, to avoid
mapping the entire file.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list