- Fix some epic fail in NdisMRegisterMiniport
authorCameron Gutman <aicommander@gmail.com>
Fri, 5 Feb 2010 08:33:48 +0000 (08:33 +0000)
committerCameron Gutman <aicommander@gmail.com>
Fri, 5 Feb 2010 08:33:48 +0000 (08:33 +0000)
 - We were checking to see if there were valid NDIS 5.1-specific characteristics if 5.1 was specified as the version but we didn't actually copy them into our local buffer
 - Now NdisCancelPackets will actually do something if the miniport implements a MiniportCancelSendPackets handler and PnP event notifications will get through to the miniport if it implements a MiniportPnPEventNotify handler

svn path=/branches/aicom-network-branch/; revision=45437

drivers/network/ndis/ndis/miniport.c

index 2a0c1b6..1fc3e41 100644 (file)
@@ -2325,7 +2325,20 @@ NdisMRegisterMiniport(
         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 minor miniport characteristics version.\n"));
+             return NDIS_STATUS_BAD_VERSION;
+        }
         break;
 
       default: