Essentially, if a user holds down the next track key on our keyboard by the
time the timer callback is trigger, the driver will interpret it as a
fast-forward event. This same chunk of code is used in a different driver,
as in, the timer creation and starting sequence, and works as expected for
what that’s worth.
EVT_WDF_TIMER EvtMultimediaKeyTimerFunc;
…
WDF_TIMER_CONFIG_INIT(&timerConfig,EvtMultimediaKeyTimerFunc);
WDF_OBJECT_ATTRIBUTES_INIT(&timerAttributes);
timerAttributes.ParentObject = device;
status = WdfTimerCreate(&timerConfig,
&timerAttributes,
&pFilterExt->KeyMultimediaHoldTimer
);
if (!NT_SUCCESS(status))
{
KdPrintEx((DPFLTR_IHVDRIVER_ID, DPFLTR_ERROR_LEVEL, “*** [%s:%d]
WdfTimerCreate failed 0x%x\n”, FILE, LINE, status));
goto Cleanup;
}
…
case HID_USAGE_KEYBOARD_F9:
KdPrintEx((DPFLTR_IHVDRIVER_ID, DPFLTR_TRACE_LEVEL, “Next Track key
pressed\n”));
pFilterExt->MultimediaKey = CONSUMER_USAGE_NEXT_TRACK;
BOOLEAN ret = WdfTimerStart(pFilterExt->KeyMultimediaHoldTimer,
WDF_REL_TIMEOUT_IN_MS(KEY_REPEAT_START));
if (!ret)
{
KdPrintEx((DPFLTR_IHVDRIVER_ID, DPFLTR_TRACE_LEVEL, “TIMER DIDNT
START!!!\n”));
}
pHIDReport[KeyIndex] = 0;
bReturn = TRUE;
break;
On Mon, Sep 10, 2018 at 11:57 AM xxxxx@probo.com wrote:
> xxxxx@gmail.com wrote:
> >
> > This doesn’t appear to be the case from what I’m seeing when looking
> > at my kdprintf output. I trigger the routine that eventually calls on
> > WdfTimerStart with a 500ms period, where it was never called once
> > before, and it just returns false.
>
> That’s exactly what it’s supposed to do. “False” means “your routine is
> not already pending.”
>
>
> > My callback that I setup in Device Add with my timer is never called
> > upon.
>
> Perhaps you should post the code.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list online at: <
> http://www.osronline.com/showlists.cfm?list=ntdev>
>
> MONTHLY seminars on crash dump analysis, WDF, Windows internals and
> software drivers!
> Details at http:
>
> To unsubscribe, visit the List Server section of OSR Online at <
> http://www.osronline.com/page.cfm?name=ListServer>
></http:>