Cursor patches

H. Verbeet hverbeet at gmail.com
Fri Jul 21 10:00:18 CDT 2006


On 07/07/06, Robert Shearman <rob at codeweavers.com> wrote:
> However, I did find two things that I think need consideration or
> improvement:
>
>  From 01_server_cursoricon.diff.txt:
>
> > +/* Destroy a cursor */
> > +DECL_HANDLER(destroy_cursor)
> > +{
> > +    unsigned int i;
> > +    cursor_t *cursor = free_user_handle( req->handle );
> > +
> > +    if (!cursor) return;
> > +
> > +    for (i = 0; i < cursor->num_frames; ++i)
> > +    {
> > +        if (cursor->frames[i].bits) free( cursor->frames[i].bits );
> > +    }
> > +
> > +    free( cursor->frames );
> > +}
>
>
> This appears to be the only place where a cursor is destroyed. Thus, a
> bad application could end up wineserver to leak memory. I think you need
> to investigate when Windows frees cursors that have not had
> DestroyCursor called on them. My guess is that it frees them on process
> destruction.
>
>
>  From 09_user_ani_cursor.diff.txt:
>
> > --- a/dlls/user/Makefile.in
> > +++ b/dlls/user/Makefile.in
> > @@ -6,7 +6,7 @@ VPATH     = @srcdir@
> >  MODULE    = user32.dll
> >  IMPORTLIB = libuser32.$(IMPLIBEXT)
> >  IMPORTS   = gdi32 advapi32 kernel32 ntdll
> > -DELAYIMPORTS = imm32
> > +DELAYIMPORTS = imm32 winmm
> >  EXTRALIBS = $(LIBUNICODE)
> >
> >  SPEC_SRCS16 = \
>
>
> I'm not sure it is acceptable to import winmm from user32, even if it is
> a delay import.
>
> --
> Rob Shearman
>
>
Attached is a slightly updated version of the patchset. I got rid of
the winmm import, and it should now destroy cursors / icons when the
process is destroyed. The changes are in parts 1 & 9, the rest should
be pretty much unchanged.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cursor_patches_20060721.tar.bz2
Type: application/x-bzip2
Size: 16318 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20060721/5e2399f6/cursor_patches_20060721.tar.bin


More information about the wine-devel mailing list