message.c:
Found a situation where MsgWaitForMultipleObjects causes a deadlock.

Call user32.426: 
MsgWaitForMultipleObjects(00000000,00000000,00000000,ffffffff,000000ff) ret=3075e9dc 
fs=008f

Think this functions is a bit outdated to like a comment shows:
      /*
       * This is a temporary solution to a big problem.
       * You see, the main thread of all Win32 programs is created as a 16 bit
       * task. This means that if you wait on an event using Win32 synchronization
       * methods, the 16 bit scheduler is stopped and things might just stop happening.
       * This implements a semi-busy loop that checks the handles to wait on and
       * also the message queue. When either one is ready, the wait function returns.
       *
       * This will all go away when the real Win32 threads are implemented for all
       * the threads of an applications. Including the main thread.
       */

Testresults windows:
timeout = -1:
When called in a console application it never returns.
When called from a GUI application it returns WAIT_OBJECT_0 (LastError is not touched)

timeout = 0x100:
When called in a console application it returns WAIT_TIMEOUT (LastError is not touched)
When called from a GUI application it returns WAIT_OBJECT_0 (LastError is not touched)

Testresults wine:
timeout = -1:
When called in a console application it never returns.
When called from a GUI application it returns WAIT_OBJECT_0 (LastError 
ERROR_INVALID_HANDLE)

timeout = 0x100:
When called in a console application it returns WAIT_TIMEOUT (LastError is not touched)
When called from a GUI application it returns WAIT_TIMEOUT (LastError 
ERROR_INVALID_HANDLE)



I wrote a small program what calls this functions some seconds after starting with
a timer. In windows the functions returns imediately (have not yet looked what event
it got from the queue) but with wine I have to move the mouse into the window to 
generate
a event.

Hmm, its a bit unclear to me what to conclude from it.
I assume one posiblity is the application calls MsgWaitForMultipleObjects and the 
functions
fails to find the right queue (the app has multiple threads) so we have a console like
behaviour.

Any Ideas how to debug?

Ciao

Juergen

PS: This accounts for some lockups with ie and office


Reply via email to