LockRect Problem

Stefan Dösinger stefandoesinger at gmx.at
Mon Mar 12 11:22:07 CDT 2007


Am Montag 12 März 2007 06:04 schrieb Erich Hoover:
> I'm looking into a problem that causes Supreme Commander to segfault (Bug
> #7643 <http://bugs.winehq.org/show_bug.cgi?id=7643>) and I believe I may
> have run into a problem with IWineD3DSurfaceImpl_LockRect.  I believe the
>
> problem is a typo in the line:
> > This->resource.allocatedMemory = HeapAlloc(GetProcessHeap() ,0 , This->
> > resource.size + 4);
>
> I think that the allocated memory should be the size of the resource
> multiplied by 4 (instead of adding 4).  With the current allocation, for
> some textures, the operation to calculate the pBits location returns a
> memory address that is past the end of the allocated memory. So, after this
No, it should definitly be + 4. This->resource.size is supposed to contain the 
full surface. The + 4 is because old applications use DWORD-Aligned access to 
palettized textures and write up to 3 bytes beyond the surface.

So either the size calculation is broken, or something in LockRect
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20070312/f0f1ef0e/attachment.pgp


More information about the wine-devel mailing list