Author: cgutman
Date: Tue Sep 2 21:12:35 2008
New Revision: 35891
URL:
http://svn.reactos.org/svn/reactos?rev=35891&view=rev
Log:
- Merge aicom-network-fixes up to r35889
Modified:
trunk/reactos/drivers/network/ndis/ndis/buffer.c
trunk/reactos/drivers/network/ndis/ndis/config.c
trunk/reactos/drivers/network/ndis/ndis/efilter.c
trunk/reactos/drivers/network/ndis/ndis/hardware.c
trunk/reactos/drivers/network/ndis/ndis/io.c
trunk/reactos/drivers/network/ndis/ndis/miniport.c
trunk/reactos/drivers/network/ndis/ndis/protocol.c
Modified: trunk/reactos/drivers/network/ndis/ndis/buffer.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
==============================================================================
--- trunk/reactos/drivers/network/ndis/ndis/buffer.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/ndis/ndis/buffer.c [iso-8859-1] Tue Sep 2 21:12:35
2008
@@ -408,6 +408,8 @@
NDIS_DbgPrint(MAX_TRACE, ("Status (0x%X) Packet (0x%X) PoolHandle
(0x%X).\n",
Status, Packet, PoolHandle));
+ *Packet = NULL;
+
if (Pool == NULL)
{
*Status = NDIS_STATUS_FAILURE;
@@ -487,6 +489,8 @@
NDIS_DbgPrint(MAX_TRACE, ("Status (0x%X) PoolHandle (0x%X) "
"NumberOfDescriptors (%d) ProtocolReservedLength (%d).\n",
Status, PoolHandle, NumberOfDescriptors, ProtocolReservedLength));
+
+ *PoolHandle = NULL;
if (NumberOfDescriptors > 0xffff)
{
@@ -528,8 +532,9 @@
*Status = NDIS_STATUS_SUCCESS;
*PoolHandle = (PNDIS_HANDLE)Pool;
- } else
+ } else {
*Status = NDIS_STATUS_RESOURCES;
+ }
}
}
@@ -705,6 +710,7 @@
* PoolHandle = Handle returned by NdisAllocatePacketPool
*/
{
+ *Status = NDIS_STATUS_FAILURE;
}
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] Tue Sep 2 21:12:35
2008
@@ -193,13 +193,14 @@
NDIS_DbgPrint(MAX_TRACE, ("Called\n"));
+ *ConfigurationHandle = NULL;
+
*Status = ZwDuplicateObject(NtCurrentProcess(), RootKeyHandle,
NtCurrentProcess(), &KeyHandle, 0, 0,
DUPLICATE_SAME_ACCESS);
if(!NT_SUCCESS(*Status))
{
NDIS_DbgPrint(MID_TRACE, ("Failed to open registry configuration for this
miniport\n"));
- *ConfigurationHandle = NULL;
*Status = NDIS_STATUS_FAILURE;
return;
}
@@ -743,7 +744,8 @@
if(!MiniportResource)
{
NDIS_DbgPrint(MIN_TRACE,("Insufficient resources.\n"));
- *Status = NDIS_STATUS_FAILURE;
+ ExFreePool(IntArray);
+ *Status = NDIS_STATUS_RESOURCES;
return;
}
@@ -797,6 +799,8 @@
NDIS_HANDLE RegKeyHandle;
PMINIPORT_CONFIGURATION_CONTEXT ConfigurationContext;
+ *KeyHandle = NULL;
+
*Status = ZwEnumerateKey(ConfigurationHandle, Index, KeyBasicInformation, NULL, 0,
&KeyInformationLength);
if(*Status != STATUS_BUFFER_TOO_SMALL && *Status != STATUS_BUFFER_OVERFLOW
&& *Status != STATUS_SUCCESS)
{
@@ -885,6 +889,8 @@
OBJECT_ATTRIBUTES KeyAttributes;
NDIS_HANDLE RegKeyHandle;
+ *KeyHandle = NULL;
+
InitializeObjectAttributes(&KeyAttributes, KeyName, OBJ_CASE_INSENSITIVE,
ConfigurationHandle, 0);
*Status = ZwOpenKey(&RegKeyHandle, KEY_ALL_ACCESS, &KeyAttributes);
Modified: trunk/reactos/drivers/network/ndis/ndis/efilter.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
==============================================================================
--- trunk/reactos/drivers/network/ndis/ndis/efilter.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/ndis/ndis/efilter.c [iso-8859-1] Tue Sep 2 21:12:35
2008
@@ -44,6 +44,7 @@
*Filter = (PETH_FILTER)NewFilter;
return TRUE;
}
+ *Filter = NULL;
return FALSE;
}
Modified: trunk/reactos/drivers/network/ndis/ndis/hardware.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
==============================================================================
--- trunk/reactos/drivers/network/ndis/ndis/hardware.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/ndis/ndis/hardware.c [iso-8859-1] Tue Sep 2 21:12:35
2008
@@ -125,7 +125,7 @@
&MiniportBlock->AllocatedResources->List[0].PartialResourceList,
ResourceListSize);
*BufferSize = ResourceListSize;
- *Status = STATUS_SUCCESS;
+ *Status = NDIS_STATUS_SUCCESS;
}
else
{
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] Tue Sep 2 21:12:35 2008
@@ -841,6 +841,8 @@
PNDIS_MINIPORT_BLOCK Adapter = (PNDIS_MINIPORT_BLOCK)MiniportAdapterHandle;
ULONG AddressSpace = 1; /* FIXME The HAL handles this wrong atm */
+ *PortOffset = 0;
+
NDIS_DbgPrint(MAX_TRACE, ("Called - InitialPort 0x%x, NumberOfPorts 0x%x\n",
InitialPort, NumberOfPorts));
memset(&PortAddress, 0, sizeof(PortAddress));
@@ -878,7 +880,6 @@
NDIS_DbgPrint(MAX_TRACE, ("calling MmMapIoSpace\n"));
- *PortOffset = 0;
*PortOffset = MmMapIoSpace(TranslatedAddress, NumberOfPorts, MmNonCached);
NDIS_DbgPrint(MAX_TRACE, ("Returning 0x%x for port range\n", *PortOffset));
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] Tue Sep 2 21:12:35
2008
@@ -562,13 +562,6 @@
/* FIXME: Wait in pending case! */
- /* XXX is status_pending part of success macro? */
- if ((NT_SUCCESS(NdisStatus)) || (NdisStatus == NDIS_STATUS_PENDING))
- {
- NDIS_DbgPrint(DEBUG_MINIPORT, ("Miniport returned status (0x%X).\n",
NdisStatus));
- return NdisStatus;
- }
-
return NdisStatus;
}
@@ -1017,6 +1010,7 @@
RegistryPath = ExAllocatePool(PagedPool, sizeof(UNICODE_STRING));
if(!RegistryPath)
{
+ ExFreePool(Miniport);
NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
return;
}
@@ -1028,6 +1022,8 @@
if(!RegistryBuffer)
{
NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
+ ExFreePool(Miniport);
+ ExFreePool(RegistryPath);
return;
}
@@ -1424,6 +1420,7 @@
{
NDIS_DbgPrint(MIN_TRACE, ("MiniportInitialize() failed for an
adapter.\n"));
ExInterlockedRemoveEntryList( &Adapter->ListEntry, &AdapterListLock );
+ if (NdisStatus == NDIS_STATUS_SUCCESS) NdisStatus = NDIS_STATUS_FAILURE;
return (NTSTATUS)NdisStatus;
}
@@ -1466,6 +1463,7 @@
Adapter->LookaheadBuffer = NULL;
}
ExInterlockedRemoveEntryList( &Adapter->ListEntry, &AdapterListLock );
+ if (NdisStatus == NDIS_STATUS_SUCCESS) NdisStatus = NDIS_STATUS_FAILURE;
return (NTSTATUS)NdisStatus;
}
Modified: trunk/reactos/drivers/network/ndis/ndis/protocol.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
==============================================================================
--- trunk/reactos/drivers/network/ndis/ndis/protocol.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/ndis/ndis/protocol.c [iso-8859-1] Tue Sep 2 21:12:35
2008
@@ -674,6 +674,8 @@
NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
+ *NdisProtocolHandle = NULL;
+
/* first validate the PROTOCOL_CHARACTERISTICS */
switch (ProtocolCharacteristics->MajorNdisVersion)
{