Re: How to find out last interrupt time by Michel
Michel
Mon Jun 11 19:34:11 CDT 2007
Did you try this code *outside* of a driver, so in an application? Does
it work? Are you sure GWES is ready when your driver calls this function
(see IsAPIReady API)?
If you've checked the above:
Looking at MSDN it says for dwWakeMask:
"Specifies input types for which an input event object handle will be
*added to the array of object handles*. This parameter can be any
combination of the following values. "
So, I guess you don't need to create an event in HANDLE h. I've never
used this API before, and the docs are quite unclear about this, but you
may try the following:
HANDLE h;
DWORD dwResult = MsgWaitForMultipleObjects(0, &h, FALSE, 10000, QS_KEY);
And if that doesn't work, then maybe:
HANDLE h[2] = {NULL};
h[0] = CreateEvent(0, TRUE, FALSE, 0);
DWORD dwResult = MsgWaitForMultipleObjects(1, h, FALSE, 10000, QS_KEY);
Michel Verhagen, eMVP
EmbeddedFusion
www.EmbeddedFusion.com
mverhagen at embeddedfusion dot com
shiju wrote:
> Hi,
> Thanks for your info. I have come across a better solution to suit my
> need. But has problems. I wrote a small driver and call
> MsgWaitForMultipleObjects() function to get the key press event. But
> when this function is called in the driver, I get an NK.exe
> exception(First-chance exception in NK.exe. 0xc000001c:Invalid System
> Service). Below is the syntax I used for the function.
>
> DWORD DwResult;
> HANDLE h = CreateEvent(0, TRUE, FALSE, 0);
> DwResult = MSgWaitForMultipleObjects(1, &h, FALSE,10000, QS_KEY);
>
> Is the above syntax wrong to get the keypad events.
>
> Thanks,
> Shiju
> Josh Chang wrote:
>> Hi shiju,
>> You may call "GetTickCount" either in your Keyboard driver where
>> the interrupt invoked or simply in the syst