Re: Waitable Timers



Are you calling OpenWaitableTimer in the same process? If different process,
is it running under the same user login? If the same process, what's the
point of using named objects?

By the way, AVOID using casts on callback function pointers. It may hide
your errors.

"Gary" <debugger@xxxxxxxxxxxxxxxx> wrote in message
news:%Ufpf.3$cL4.103@xxxxxxxxxxxxxxxxxx
> Hello Experts,
> Am doing the following :
>
> tmr = CreateWaitableTimer(NULL,TRUE,timername);
> /* The handle value in tmr looks fine. Now.... */
> retopen = OpenWaitableTimer(NULL, FALSE, timername);
>
> The value of retopen is NULL handle. Why is that ???
> At that time
> LastErrorValue: 5 ( Invalid Handle )
> LastStatusValue: c0000022 ( Access Denied )
>
>
> Now when I do a :
> SetWaitableTimer( tmr, &liDueTime,0, (PTIMERAPCROUTINE)func1,NULL, 0);
>
> The above goes fine with no issues. But then again, if I used that handle
> to do a WaitForMultipleObjectsEx() on the timer handle, then also I fail
> with the same above errors. The above happens even if I used un-named
> timers too.
>
> Please let me know what would I be missing on.
>
> Thanks,
> Gary.
>


.