10 messages in net.java.dev.jna.usersRe: Kernel32 Waking Hibernating Machine
FromSent OnAttachments
Dale...@coats.comApr 24, 2008 6:34 pm 
Dale...@coats.comApr 28, 2008 5:01 pm 
Timothy WallApr 29, 2008 10:13 am 
Dale...@coats.comApr 30, 2008 9:24 am 
Dale...@coats.comApr 30, 2008 10:10 am 
Timothy WallMay 1, 2008 5:58 am 
Dale...@coats.comMay 1, 2008 7:37 am 
Timothy WallMay 1, 2008 8:07 am 
Timothy WallMay 1, 2008 8:35 am 
Dale...@coats.comMay 1, 2008 10:12 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: Kernel32 Waking Hibernating MachineActions...
From:Dale...@coats.com (Dale@coats.com)
Date:Apr 28, 2008 5:01:25 pm
List:net.java.dev.jna.users

This same technique works when coded in C language, so I think it must be something different in the way JNA handles it.

HANDLE htimer = kernel32.CreateWaitableTimer(null, true, "MyWaitableTimer"); boolean setTimerResult = kernel32.SetWaitableTimer(htimer, pDueTime, 0L,null, null, true); int waitResult = kernel32.WaitForSingleObject(htimer,Integer.MAX_VALUE);

The last line, above, appropriately blocks execution, even in the JNA version, then continues after the timer fires, when the machine is awake. The difference is that if the machine is sleeping, only the C version wakes the machine when the timer fires, the JNA version does not.

Anybody have any clues, or am I outta luck?

--Dale--