Author: cgutman
Date: Tue Jun 22 05:37:31 2010
New Revision: 47825
URL: http://svn.reactos.org/svn/reactos?rev=47825&view=rev
Log:
[NDIS]
- Dequeue the timer earlier so the timer queue will be in a valid state if any timers are modified during the miniport's timer callback
Modified:
trunk/reactos/drivers/network/ndis/ndis/time.c
Modified: trunk/reactos/drivers/network/ndis/ndis/time.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
==============================================================================
--- trunk/reactos/drivers/network/ndis/ndis/time.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/ndis/ndis/time.c [iso-8859-1] Tue Jun 22 05:37:31 2010
@@ -170,19 +170,19 @@
{
PNDIS_MINIPORT_TIMER Timer = DeferredContext;
+ /* Only dequeue if the timer has a period of 0 */
+ if (!Timer->Timer.Period)
+ {
+ KeAcquireSpinLockAtDpcLevel(&Timer->Miniport->Lock);
+ /* If someone already dequeued it, something is wrong (borked timer implementation?) */
+ if (!DequeueMiniportTimer(Timer)) ASSERT(FALSE);
+ KeReleaseSpinLockFromDpcLevel(&Timer->Miniport->Lock);
+ }
+
Timer->MiniportTimerFunction(Dpc,
Timer->MiniportTimerContext,
SystemArgument1,
SystemArgument2);
-
- /* Only dequeue if the timer has a period of 0 */
- if (!Timer->Timer.Period)
- {
- KeAcquireSpinLockAtDpcLevel(&Timer->Miniport->Lock);
- /* If someone already dequeued it, something is wrong (borked timer implementation?) */
- if (!DequeueMiniportTimer(Timer)) ASSERT(FALSE);
- KeReleaseSpinLockFromDpcLevel(&Timer->Miniport->Lock);
- }
}