SMATCH: missing LeaveCriticalSection in error path

Michael Stefaniuc mstefani at
Sun Feb 23 15:09:26 CST 2003

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
that takes care of locks of the form:
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 requires this patch
for because it treats every ARGV entry as filename (i'll
contact the smatch author to find a solution that dosn't require this

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
I'm not sure if it's a bug or not.


Michael Stefaniuc               Tel.: +49-711-96437-199
System Administration           Fax.: +49-711-96437-111
Red Hat GmbH                    Email: mstefani at
Hauptstaetterstr. 58  
D-70178 Stuttgart
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url :

More information about the wine-devel mailing list