News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

MsgWaitForMultipleObjects

Started by TNick, June 17, 2006, 12:41:51 PM

Previous topic - Next topic

TNick

I don't understand the return value: <<WAIT_OBJECT_0 + nCount>> for this function. I read Win32SDK Help, and it say: "Input of the type specified in the dwWakeMask parameter is available in the thread's input queue."

Please, someone, tell me when will this function return this value?

Casper

Casper says ...

You need to read more, it says ...

QuoteThe WaitForMultipleObjects function returns when one of the following occurs:

·   Either any one or all of the specified objects are in the signaled state.
·   The time-out interval elapses.

Don't use INFINITE, by the way or it will wait forever.  In the topic you were reading in the help file you should have clicked the WaitForMultipleObjects link near the top to take you to that topic.


TNick

I read an example file for using DirectX in wich WaitForMultipleObjects was used, with INFINITE, for a single object. There, this function was used to get an MediaEvent. After the function returns, the result is tested against WAIT_OBJECT_0 and WAIT_OBJECT_0 +1. I only try to understand the statements ...


... like this:

    invoke   MsgWaitForMultipleObjects,1,addr event,FALSE,INFINITE,QS_ALLINPUT
       test eax,eax            ; WAIT_OBJECT_0
       jz pump_media_event

                    dec eax                 ; WAIT_OBJECT_0+1
       jz pump_message

       jmp pump

and yes, I AM reading more.

Casper

Good job, reading is monumental.

Casper