Re: Activity timers



Hi. Thanks for reply.

According the same documentation events will be reset
by the power manager itself, so I dont need to touch
them because some other apps/drivers may be watching
for the same events.

>From the doc:

If the time-out associated with the timer expires without a reset event
being signaled, the Power Manager resets the active event and sets the
inactive event




"H. Edgar" <hedgar@xxxxxxxxxxxxxx> wrote in message
news:O4HZMDRZFHA.1088@xxxxxxxxxxxxxxxxxxxxxxx
>
> I am not sure, but according the documentation just one of this events
> will be signaled. This events are manual reset events according the
> documentation too. I think, then calling ResetEvent(Inactive) before
> calling the second Wait would be necessary. ResetEvent(Active) would be
> necessary too after the correpsonding Wait.
>
> Edgar.
>
> "voidcoder" <voidcoder@xxxxxxxxx> wrote in message
> news:OP2k2kQZFHA.2796@xxxxxxxxxxxxxxxxxxxxxxx
>> Could someone pls tell me why the following code does never
>> return from the second WaitForSingleObject call !?
>>
>> HANDLE Active = OpenEvent(EVENT_ALL_ACCESS, FALSE,
>> TEXT("PowerManager/SystemActivity_Active"));
>> HANDLE Inactive = OpenEvent(EVENT_ALL_ACCESS, FALSE,
>> TEXT("PowerManager/SystemActivity_Inactive"));
>>
>> if (WaitForSingleObject(Inactive, INFINITE) == WAIT_OBJECT_0)
>> {
>> if (WaitForSingleObject(Active, INFINITE) == WAIT_OBJECT_0) // <-
>> Stall forever
>> {
>> // Some code
>> }
>> }
>>
>> I'd like to handle Inactive-to-Active transition state using activity
>> timers but do not understand windows behaviour ... I'm able to
>> wait for "Inactive" event, howether it stalls inside the second wait for
>> "Active" event independent from the actual activity on the system.
>> Any ideas?
>>
>> Thanks.
>>
>>
>
>


.



Relevant Pages

  • Re: AVR tiny13 ADC0 syntax problem
    ... confused by atmels documentation on now to change it over from rst to ... ADC function. ... It will not override the reset signal. ...
    (comp.arch.embedded)
  • Re: Iterators and versioning
    ... " the enumerator is irrecoverably invalidated and the next call to MoveNext ... or Reset throws an InvalidOperationException." ... this behaviour so this must be seen as a documentation bug and the ... I don't see in what way they don't support it. ...
    (microsoft.public.dotnet.languages.csharp)
  • Homepage and toolbars change after restart
    ... toolbars and they reset after restart. ... I went through the MS documentation #320159 and did a ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Activity timers
    ... Then without reset, the Powermanager is setting the inactive ... Without reseting the inactive event the active event will not be signaled. ... but according the documentation just one of this events ... >>> return from the second WaitForSingleObject call!? ...
    (microsoft.public.windowsce.platbuilder)
  • Re: crazy trackpad or keyboard?
    ... > cursor intermittently jumps to another spot on the screen and of course ... You're positive you're not brushing the trackpad with your arm or thumb ... You might also want to reset the Power Manager ...
    (comp.sys.mac.portables)