Tech Support > Microsoft Windows > Drivers > Problem with NdisTimers
Problem with NdisTimers
Posted by turambar on June 13th, 2008


Hello,

I try to use NdisTimers to execute periodic functions on a Virtual
Miniport driver that I'm programming, using netvmini in the WDM package.

On my MPInitialize function, I initialize the timers by using
NdisInitializeTimer like this:

NdisInitializeTimer(
&Adapter->DeviceTimer,
(PNDIS_TIMER_FUNCTION)DeviceTimerFonction,
(PVOID)Adapter);

The definition of DeviceTimerFonction is :

VOID
DeviceTimerFonction(
IN PVOID SystemSpecific1,
IN PVOID FunctionContext,
IN PVOID SystemSpecific2,
IN PVOID SystemSpecific3);

Then, whenever I want to make this function periodic, it never starts.
The NdisSetTimer can be in the MPInitialize, in another function, even
in the MPSendPackets, it seems that my DeviceTimerFonction is never called.

I call NdisSetTimer like this :
NdisSetTimer(&Adapter->DeviceTimer, 100);

Is there something that I have forgot ?


Posted by Thomas F. Divine on June 13th, 2008


Have you set a breakpoint in your timer function? I would expect it to be
called once.

Thomas F. Divine

"turambar <n-nospam@free.fr>"
<turambarnnospamfreefr@discussions.microsoft.com > wrote in message
news:CA35ADC0-305B-4D4A-8D84-8BD95A174D75@microsoft.com...

Posted by turambar on June 13th, 2008


"Thomas F. Divine" wrote:

There is no breakpoint in the function, for now it only uses DBGPRINT for a
debug message which tells us that the function is started/finished and
another call to NdisSetTimer(&Adapter->DeviceTimer, 100); for the next launch.

Posted by turambar on June 13th, 2008



I forgot to tell but of course, the DBGPRINT does not appear on the debug
output...

Posted by Thomas F. Divine on June 13th, 2008


Try using NdisMinitializeTimer instead.

Thomas F. Divine

"turambar <n-nospam@free.fr>"
<turambarnnospamfreefr@discussions.microsoft.com > wrote in message
news:CA35ADC0-305B-4D4A-8D84-8BD95A174D75@microsoft.com...

Posted by turambar on June 13th, 2008




"Thomas F. Divine" wrote:

I tried to but there is the same problem. If I call the DeviceTimerFonction
alone, it's well started. If I use NdisMSetTimer or NdisMSetPeriodicTimer,
nothing happends

I tried with 10, 100 or 1000 for the timeout parameter

Posted by Thomas F. Divine on June 13th, 2008


Works for me. Sorry, but I don't have any further thoughts.

Thomas F. Divine

"turambar <n-nospam@free.fr>"
<turambarnnospamfreefr@discussions.microsoft.com > wrote in message
news:0D80506F-FDCF-4931-B785-70E579D906E5@microsoft.com...