Author: cgutman
Date: Mon Jun 8 06:23:47 2009
New Revision: 41346
URL:
http://svn.reactos.org/svn/reactos?rev=41346&view=rev
Log:
- Fix our handler checks
- Now XP's intermediate miniport drivers can load on ROS's NDIS
- More work still needs to be done to get them working though
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 Jun 8 06:23:47
2009
@@ -2345,14 +2345,32 @@
/* Check if mandatory MiniportXxx functions are specified */
if ((!MiniportCharacteristics->HaltHandler) ||
- (!MiniportCharacteristics->InitializeHandler)||
- (!MiniportCharacteristics->QueryInformationHandler) ||
- (!MiniportCharacteristics->ResetHandler) ||
- (!MiniportCharacteristics->SetInformationHandler))
+ (!MiniportCharacteristics->InitializeHandler)||
+ (!MiniportCharacteristics->ResetHandler))
{
NDIS_DbgPrint(MIN_TRACE, ("Bad miniport characteristics.\n"));
return NDIS_STATUS_BAD_CHARACTERISTICS;
}
+
+ if (MiniportCharacteristics->MajorNdisVersion < 0x05)
+ {
+ if ((!MiniportCharacteristics->QueryInformationHandler) ||
+ (!MiniportCharacteristics->SetInformationHandler))
+ {
+ NDIS_DbgPrint(MIN_TRACE, ("Bad miniport characteristics.
(Set/Query)\n"));
+ return NDIS_STATUS_BAD_CHARACTERISTICS;
+ }
+ }
+ else
+ {
+ if (((!MiniportCharacteristics->QueryInformationHandler) ||
+ (!MiniportCharacteristics->SetInformationHandler)) &&
+ (!MiniportCharacteristics->CoRequestHandler))
+ {
+ NDIS_DbgPrint(MIN_TRACE, ("Bad miniport characteristics.
(Set/Query)\n"));
+ return NDIS_STATUS_BAD_CHARACTERISTICS;
+ }
+ }
if (MiniportCharacteristics->MajorNdisVersion == 0x03)
{
@@ -2362,13 +2380,25 @@
return NDIS_STATUS_BAD_CHARACTERISTICS;
}
}
- else if (MiniportCharacteristics->MajorNdisVersion >= 0x04)
- {
- /* NDIS 4.0+ */
+ else if (MiniportCharacteristics->MajorNdisVersion == 0x04)
+ {
+ /* NDIS 4.0 */
if ((!MiniportCharacteristics->SendHandler) &&
(!MiniportCharacteristics->SendPacketsHandler))
{
NDIS_DbgPrint(MIN_TRACE, ("Bad miniport characteristics. (NDIS
4.0)\n"));
+ return NDIS_STATUS_BAD_CHARACTERISTICS;
+ }
+ }
+ else if (MiniportCharacteristics->MajorNdisVersion == 0x05)
+ {
+ /* TODO: Add more checks here */
+
+ if ((!MiniportCharacteristics->SendHandler) &&
+ (!MiniportCharacteristics->SendPacketsHandler) &&
+ (!MiniportCharacteristics->CoSendPacketsHandler))
+ {
+ NDIS_DbgPrint(MIN_TRACE, ("Bad miniport characteristics. (NDIS
5.0)\n"));
return NDIS_STATUS_BAD_CHARACTERISTICS;
}
}