Author: cgutman
Date: Thu Sep 13 01:04:21 2012
New Revision: 57289
URL:
http://svn.reactos.org/svn/reactos?rev=57289&view=rev
Log:
[NDIS]
- 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
Modified:
trunk/reactos/drivers/network/ndis/ndis/config.c
trunk/reactos/drivers/network/ndis/ndis/io.c
trunk/reactos/drivers/network/ndis/ndis/miniport.c
Modified: trunk/reactos/drivers/network/ndis/ndis/config.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
==============================================================================
--- trunk/reactos/drivers/network/ndis/ndis/config.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/ndis/ndis/config.c [iso-8859-1] Thu Sep 13 01:04:21
2012
@@ -658,13 +658,15 @@
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 @@
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));
Modified: trunk/reactos/drivers/network/ndis/ndis/io.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
==============================================================================
--- trunk/reactos/drivers/network/ndis/ndis/io.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/ndis/ndis/io.c [iso-8859-1] Thu Sep 13 01:04:21 2012
@@ -65,7 +65,8 @@
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,
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] Thu Sep 13 01:04:21
2012
@@ -2161,6 +2161,10 @@
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);
@@ -2187,9 +2191,6 @@
EthDeleteFilter(Adapter->NdisMiniportBlock.EthDB);
Adapter->NdisMiniportBlock.EthDB = NULL;
}
-
- Adapter->NdisMiniportBlock.OldPnPDeviceState =
Adapter->NdisMiniportBlock.PnPDeviceState;
- Adapter->NdisMiniportBlock.PnPDeviceState = NdisPnPDeviceStopped;
return STATUS_SUCCESS;
}