Author: cgutman
Date: Mon Dec 6 04:39:57 2010
New Revision: 49961
URL:
http://svn.reactos.org/svn/reactos?rev=49961&view=rev
Log:
[NDIS]
- Add a missing spin lock release in a failure case
- Fix incomplete copying of NDIS 5.1 miniport characteristics
Modified:
trunk/reactos/drivers/network/ndis/ndis/miniport.c
Modified: trunk/reactos/drivers/network/ndis/ndis/miniport.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
==============================================================================
--- trunk/reactos/drivers/network/ndis/ndis/miniport.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/ndis/ndis/miniport.c [iso-8859-1] Mon Dec 6 04:39:57
2010
@@ -316,6 +316,7 @@
if (!LookAheadBuffer)
{
NDIS_DbgPrint(MIN_TRACE, ("Failed to allocate lookahead
buffer!\n"));
+ KeReleaseSpinLock(&Adapter->NdisMiniportBlock.Lock, OldIrql);
return;
}
@@ -2454,7 +2455,20 @@
break;
case 0x05:
- MinSize = sizeof(NDIS50_MINIPORT_CHARACTERISTICS);
+ switch (MiniportCharacteristics->MinorNdisVersion)
+ {
+ case 0x00:
+ MinSize = sizeof(NDIS50_MINIPORT_CHARACTERISTICS);
+ break;
+
+ case 0x01:
+ MinSize = sizeof(NDIS51_MINIPORT_CHARACTERISTICS);
+ break;
+
+ default:
+ NDIS_DbgPrint(MIN_TRACE, ("Bad 5.x minor characteristics
version.\n"));
+ return NDIS_STATUS_BAD_VERSION;
+ }
break;
default:
@@ -2531,8 +2545,6 @@
return NDIS_STATUS_BAD_CHARACTERISTICS;
}
}
-
- /* TODO: verify NDIS5 and NDIS5.1 */
RtlCopyMemory(&Miniport->MiniportCharacteristics, MiniportCharacteristics,
MinSize);