"Michael Stefaniuc" mstefani@redhat.de wrote:
Changelog: Michael Stefaniuc mstefani@redhat.com
- add missing LeaveCriticalSection's in error path.
Michael, I'm just curious, how hard it would be to adapt your SMATCH script for finding EnterCriticalSection/LeaveCriticalSection pair matching to do a similar work with wine_tsx11_lock/wine_tsx11_unlock, GDI_GetObjPtr/GDI_ReleaseObj, DC_GetDC[Ptr|Update]/GDI_ReleaseObj, USER_Lock/USER_Unlock, WIN_GetPtr/WIN_ReleasePtr, WIN_FindWndPtr/ WIN_ReleaseWndPtr and some other internal Wine locks?
On Sun, Feb 23, 2003 at 11:39:33AM +0800, Dmitry Timoshkov wrote:
Michael, I'm just curious, how hard it would be to adapt your SMATCH script for finding EnterCriticalSection/LeaveCriticalSection pair matching to do a similar work with wine_tsx11_lock/wine_tsx11_unlock, GDI_GetObjPtr/GDI_ReleaseObj, DC_GetDC[Ptr|Update]/GDI_ReleaseObj, USER_Lock/USER_Unlock, WIN_GetPtr/WIN_ReleasePtr, WIN_FindWndPtr/ WIN_ReleaseWndPtr and some other internal Wine locks?
Not hard at all, I've created a new script http://people.redhat.com/mstefani/wine/smatch/wine_locks.pl that takes care of locks of the form: lock(this); do_something(); unlock(this); and put all of the above locking pairs into it. To add a new locking pair all that's needed is to add an entry for it in the %locks hash.
Running wine_locks.pl requires this patch http://people.redhat.com/mstefani/wine/smatch/smatch.pm.diff for smatch.pm because it treats every ARGV entry as filename (i'll contact the smatch author to find a solution that dosn't require this hack).
Besides some NOTABUG's in the CriticalSection locking i found only this: wine/windows/win.c 104 127 create_window_handle(31) 1 USER_Lock not released I'm not sure if it's a bug or not.
bye michael