Is it really supposed to be so?
Why don't you just use KeAcquireSpinlock, which would save you the current IRQL level?
For me it looks like a hack.
WBR, Aleksey Bragin.
On Sep 28, 2008, at 11:58 PM, cgutman@svn.reactos.org wrote:
Author: cgutman Date: Sun Sep 28 14:58:09 2008 New Revision: 36580
URL: http://svn.reactos.org/svn/reactos?rev=36580&view=rev Log:
- Raise IRQL to DISPATCH_LEVEL before using
KeAcquireSpinLockAtDpcLevel/KeReleaseSpinLockFromDpcLevel
Modified: branches/aicom-network-fixes/drivers/network/ndis/ndis/protocol.c
Modified: branches/aicom-network-fixes/drivers/network/ndis/ndis/ protocol.c URL: http://svn.reactos.org/svn/reactos/branches/aicom-network- fixes/drivers/network/ndis/ndis/protocol.c? rev=36580&r1=36579&r2=36580&view=diff ====================================================================== ======== --- branches/aicom-network-fixes/drivers/network/ndis/ndis/ protocol.c [iso-8859-1] (original) +++ branches/aicom-network-fixes/drivers/network/ndis/ndis/ protocol.c [iso-8859-1] Sun Sep 28 14:58:09 2008 @@ -67,6 +67,7 @@ { UINT BufferedLength; UINT PacketLength;
KIRQL OldIrql;
NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
@@ -75,6 +76,8 @@ #endif
NdisQueryPacket(Packet, NULL, NULL, NULL, &PacketLength);
KeRaiseIrql(DISPATCH_LEVEL, &OldIrql);
NDIS_DbgPrint(MAX_TRACE, ("acquiring miniport block lock\n")); KeAcquireSpinLockAtDpcLevel(&Adapter->NdisMiniportBlock.Lock);
@@ -102,6 +105,8 @@ Adapter->NdisMiniportBlock.IndicatedPacket [KeGetCurrentProcessorNumber()] = NULL; } KeReleaseSpinLockFromDpcLevel(&Adapter->NdisMiniportBlock.Lock);
KeLowerIrql(OldIrql);
return STATUS_SUCCESS;
}