[Bug 24823] Miranda IM crashes with a modern contact list plugin

wine-bugs at winehq.org wine-bugs at winehq.org
Sun Jul 10 15:37:55 CDT 2011


http://bugs.winehq.org/show_bug.cgi?id=24823

--- Comment #7 from Nikolay Sivov <bunglehead at gmail.com> 2011-07-10 15:37:55 CDT ---
(In reply to comment #6)
> 
> Ping :)

Found some time just now. Actually it seems like miranda code is not so clean
in first place but it doesn't matter running on windows for some reason.

I checked 0.9.24 sources snapshot. Looking into
plugins/modernb/modern_xptheme.cpp I found this:

--- lines 136-151
XPTHANDLE xpt_AddThemeHandle(HWND hwnd, LPCWSTR className)
{
    XPTHANDLE res = NULL;
    xptcheck NULL;
    xptlock();
    {
        XPTObject* xptObject=(XPTObject*)mir_alloc(sizeof(XPTObject));
        xptObject->lpcwClassObject=className;
        xptObject->hOwnerWindow=hwnd;
        _sttXptReloadThemeData(xptObject);
        li.List_InsertPtr(xptObjectList, (void*)xptObject);
        res=(XPTHANDLE)xptObject;
    }
    xptunlock();
    return res;
}
---

mir_alloc happens to be malloc wrapper (with extra heap checks), so it doesn't
initialize memory. After allocation xptObject->hThemeHandle field is
uninitialized and after that _sttXptReloadThemeData() frees is with
CloseThemeData().

So adding another line like xptObject->hThemeHandle = NULL; should help with
that problem, and it's probably a case to convince developers to add a fix
upstream. Anyway if I'm right and CloseThemeData() operates on handles and
performs a table lookup to check passed handle validity we need this to be
fixed in wine by adding handle tables.

To summarize:
- please check that custom build of miranda with mentioned one line change
fixes a problem. If it does try to get it accepted to miranda tree;
- keep bug open anyway and test for this particular case CloseThemeData(0x1) in
windows to see what happens.

I don't have much time these days, but will post here if I find something.

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list