- NdisReadConfiguration should return NdisParameterInteger for requests for NdisParameterHexInteger
- Assert that conversion to integer from string does not fail
- Always trigger the ISR function if MiniportInitialize or MiniportHalt is executing

CORE-6064 #comment Please try to replicate with DEBUG_ULTRA turned on in NDIS

svn path=/trunk/; revision=57289
This commit is contained in:
Cameron Gutman
2012-09-13 01:04:21 +00:00
parent b0e977ad99
commit d96bde2a80
3 changed files with 15 additions and 10 deletions
+9 -6
View File
@@ -658,13 +658,15 @@ NdisReadConfiguration(
str.Length = str.MaximumLength = (USHORT)KeyInformation->DataLength;
str.Buffer = (PWCHAR)KeyInformation->Data;
if (Base != 0 && IsValidNumericString(&str, Base) &&
((*Status = RtlUnicodeStringToInteger(&str, Base,
&(*ParameterValue)->ParameterData.IntegerData)) == STATUS_SUCCESS))
if (Base != 0 && IsValidNumericString(&str, Base))
{
*Status = RtlUnicodeStringToInteger(&str, Base, &(*ParameterValue)->ParameterData.IntegerData);
ASSERT(*Status == STATUS_SUCCESS);
NDIS_DbgPrint(MAX_TRACE, ("NdisParameter(Hex)Integer\n"));
(*ParameterValue)->ParameterType = ParameterType;
/* MSDN documents that this is returned for all integers, regardless of the ParameterType passed in */
(*ParameterValue)->ParameterType = NdisParameterInteger;
}
else
{
@@ -697,8 +699,9 @@ NdisReadConfiguration(
ExFreePool(KeyInformation);
return;
}
if ((*ParameterValue)->ParameterType != ParameterType)
if (((*ParameterValue)->ParameterType != ParameterType) &&
!((ParameterType == NdisParameterHexInteger) && ((*ParameterValue)->ParameterType == NdisParameterInteger)))
{
NDIS_DbgPrint(MIN_TRACE, ("Parameter type mismatch! (Requested: %d | Received: %d)\n",
ParameterType, (*ParameterValue)->ParameterType));
+2 -1
View File
@@ -65,7 +65,8 @@ BOOLEAN NTAPI ServiceRoutine(
NDIS_DbgPrint(MAX_TRACE, ("Called. Interrupt (0x%X)\n", NdisInterrupt));
if (NdisInterrupt->IsrRequested) {
/* FIXME: This probably isn't the right check for MiniportInitialize, but we need to see what Windows uses here */
if ((NdisMiniportBlock->PnPDeviceState != NdisPnPDeviceStarted) || (NdisInterrupt->IsrRequested)) {
NDIS_DbgPrint(MAX_TRACE, ("Calling MiniportISR\n"));
(*NdisMiniportBlock->DriverHandle->MiniportCharacteristics.ISRHandler)(
&InterruptRecognized,
+4 -3
View File
@@ -2161,6 +2161,10 @@ NdisIPnPStopDevice(
KeCancelTimer(&Adapter->NdisMiniportBlock.WakeUpDpcTimer.Timer);
/* Set this here so MiniportISR will be forced to run for interrupts generated in MiniportHalt */
Adapter->NdisMiniportBlock.OldPnPDeviceState = Adapter->NdisMiniportBlock.PnPDeviceState;
Adapter->NdisMiniportBlock.PnPDeviceState = NdisPnPDeviceStopped;
(*Adapter->NdisMiniportBlock.DriverHandle->MiniportCharacteristics.HaltHandler)(Adapter);
IoSetDeviceInterfaceState(&Adapter->NdisMiniportBlock.SymbolicLinkName, FALSE);
@@ -2188,9 +2192,6 @@ NdisIPnPStopDevice(
Adapter->NdisMiniportBlock.EthDB = NULL;
}
Adapter->NdisMiniportBlock.OldPnPDeviceState = Adapter->NdisMiniportBlock.PnPDeviceState;
Adapter->NdisMiniportBlock.PnPDeviceState = NdisPnPDeviceStopped;
return STATUS_SUCCESS;
}