Here are 2 small patches. Both apply on top of the patch I sent yesterday which started this thread. 1) fixes a bug that I discovered myself, 2) Adds TRACES to several functions to simplify debugging. 2) Is not meant for applying to CVS!!! However, Lawson it would be nice if you produce a new trace with these two patches applied. start your app with --debugmsg trace+file,trace+thread,trace+comm. Regards, Martin -- Martin Wilck Phone: +49 5251 8 15113 Fujitsu Siemens Computers Fax: +49 5251 8 20409 Heinz-Nixdorf-Ring 1 mailto:Martin.Wilck@Fujitsu-Siemens.com D-33106 Paderborn http://www.fujitsu-siemens.com/primergy
ChangeLog: scheduler/synchro.c: Fix a bug in 009-async_private.diff (Overlapped completion scheduled twice). diff -ruX diffignore CVS/wine/scheduler/synchro.c MW/wine/scheduler/synchro.c --- CVS/wine/scheduler/synchro.c Fri Jan 11 10:51:11 2002 +++ MW/wine/scheduler/synchro.c Fri Jan 11 11:03:40 2002 @@ -132,15 +132,10 @@ } else ovp_status = ovp->ops->get_status (ovp); - if( ovp_status == STATUS_PENDING ) - { - ovp->func(ovp); - register_async (ovp); - ovp_status = ovp->ops->get_status (ovp); - } + if( ovp_status == STATUS_PENDING ) ovp->func(ovp); - if( ovp_status != STATUS_PENDING ) - finish_async(ovp); + /* This will destroy all but PENDING requests */ + register_async (ovp); }
A hack that adds tracing to async request handlers. files/file.c: some more TRACEs scheduler/synchro.c: Add TRACEs. Uses debug channel "thread" (FIXME??) Only in CVS/wine/: 011a.diff diff -ruX diffignore MW/wine/files/file.c CVS/wine/files/file.c --- MW/wine/files/file.c Fri Jan 11 16:15:28 2002 +++ CVS/wine/files/file.c Fri Jan 11 16:14:23 2002 @@ -1444,6 +1444,7 @@ static VOID CALLBACK FILE_OverlappedComplete(DWORD status, DWORD count, LPOVERLAPPED ov) { + TRACE ("status %ld, count %ld, ov %p\n", status, count, ov); NtSetEvent(ov->hEvent,NULL); } diff -ruX diffignore MW/wine/scheduler/synchro.c CVS/wine/scheduler/synchro.c --- MW/wine/scheduler/synchro.c Fri Jan 11 16:15:44 2002 +++ CVS/wine/scheduler/synchro.c Fri Jan 11 16:18:46 2002 @@ -16,7 +16,9 @@ #include "thread.h" #include "winerror.h" #include "wine/server.h" +#include "debugtools.h" +DEFAULT_DEBUG_CHANNEL(thread); /*********************************************************************** * get_timeout @@ -46,6 +48,9 @@ BOOL ret; DWORD status = ovp->ops->get_status (ovp); + TRACE( "ovp %p, status %ld, handle %d, type %d, func %p\n", + ovp, status, ovp->handle, ovp->type, ovp->func ); + /* STATUS_USER_APC means this is a new request */ /* STATUS_PENDING means this request is rescheduled (IO incomplete) */ @@ -76,6 +81,7 @@ if (ret) ovp->ops->set_status ( ovp, GetLastError() ); + TRACE ("ret %d, status %ld\n", ret, ovp->ops->get_status (ovp)); if ( ovp->ops->get_status (ovp) != STATUS_PENDING ) finish_async (ovp); @@ -90,6 +96,8 @@ */ void finish_async(async_private *ovp) { + TRACE ("ovp %p\n", ovp); + /* remove it from the active list */ if(ovp->prev) ovp->prev->next = ovp->next; @@ -118,7 +126,7 @@ async_private *ovp = NULL; DWORD ovp_status; - /* fprintf(stderr,"overlapped %p status %x\n",overlapped,status); */ + TRACE ("asp %p, status %ld\n", asp, status); for( ovp = NtCurrentTeb()->pending_list; ovp && ovp != asp; ovp = ovp->next ); @@ -131,6 +139,8 @@ ovp->ops->set_status (ovp, status); } else ovp_status = ovp->ops->get_status (ovp); + + TRACE ("-->found: status %ld\n", ovp_status); if( ovp_status == STATUS_PENDING ) ovp->func(ovp);