- 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

svn path=/trunk/; revision=41346
This commit is contained in:
Cameron Gutman 2009-06-08 02:23:47 +00:00
parent f088b72ab8
commit 3f12788efc

View file

@ -2345,15 +2345,33 @@ NdisMRegisterMiniport(
/* 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)
{
if (!MiniportCharacteristics->SendHandler)
@ -2362,9 +2380,9 @@ NdisMRegisterMiniport(
return NDIS_STATUS_BAD_CHARACTERISTICS;
}
}
else if (MiniportCharacteristics->MajorNdisVersion >= 0x04)
else if (MiniportCharacteristics->MajorNdisVersion == 0x04)
{
/* NDIS 4.0+ */
/* NDIS 4.0 */
if ((!MiniportCharacteristics->SendHandler) &&
(!MiniportCharacteristics->SendPacketsHandler))
{
@ -2372,6 +2390,18 @@ NdisMRegisterMiniport(
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;
}
}
/* TODO: verify NDIS5 and NDIS5.1 */