Author: cgutman
Date: Tue Oct 14 19:32:36 2008
New Revision: 36756
URL:
http://svn.reactos.org/svn/reactos?rev=36756&view=rev
Log:
- Merge aicom-network-fixes up to r36755
Modified:
trunk/reactos/drivers/network/ndis/ndis/protocol.c
trunk/reactos/drivers/network/tcpip/tcpip/main.c
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 Oct 14 19:32:36
2008
@@ -614,7 +614,7 @@
if (CharacteristicsLength < MinSize)
{
- NDIS_DbgPrint(DEBUG_PROTOCOL, ("Bad protocol characteristics.\n"));
+ NDIS_DbgPrint(MIN_TRACE, ("Bad protocol characteristics.\n"));
*Status = NDIS_STATUS_BAD_CHARACTERISTICS;
return;
}
@@ -680,7 +680,7 @@
if(!NT_SUCCESS(NtStatus))
{
- NDIS_DbgPrint(MID_TRACE, ("Unable to open protocol configuration\n"));
+ NDIS_DbgPrint(MIN_TRACE, ("Unable to open protocol configuration\n"));
ExFreePool(Protocol);
*Status = NDIS_STATUS_FAILURE;
return;
@@ -698,7 +698,7 @@
NtStatus = ZwQueryValueKey(DriverKeyHandle, &ValueName,
KeyValuePartialInformation, NULL, 0, &ResultLength);
if(NtStatus != STATUS_BUFFER_OVERFLOW && NtStatus != STATUS_BUFFER_TOO_SMALL
&& NtStatus != STATUS_SUCCESS)
{
- NDIS_DbgPrint(MID_TRACE, ("Unable to query the Bind value for
size\n"));
+ NDIS_DbgPrint(MIN_TRACE, ("Unable to query the Bind value for
size\n"));
ZwClose(DriverKeyHandle);
ExFreePool(Protocol);
*Status = NDIS_STATUS_FAILURE;
@@ -800,6 +800,7 @@
}
else if(*Status != NDIS_STATUS_PENDING)
{
+ NDIS_DbgPrint(MIN_TRACE, ("ProtocolBindAdapter failed with status
0x%x\n", *Status));
ExFreePool(Protocol);
ExFreePool(KeyInformation);
*NdisProtocolHandle = NULL;
Modified: trunk/reactos/drivers/network/tcpip/tcpip/main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
==============================================================================
--- trunk/reactos/drivers/network/tcpip/tcpip/main.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/tcpip/main.c [iso-8859-1] Tue Oct 14 19:32:36 2008
@@ -686,7 +686,8 @@
FILE_DEVICE_NETWORK, 0, FALSE, &RawIPDeviceObject);
if (!NT_SUCCESS(Status)) {
TI_DbgPrint(MIN_TRACE, ("Failed to create RawIP device object. Status
(0x%X).\n", Status));
- TiUnload(DriverObject);
+ ChewShutdown();
+ IoDeleteDevice(IPDeviceObject);
return Status;
}
@@ -695,7 +696,9 @@
FILE_DEVICE_NETWORK, 0, FALSE, &UDPDeviceObject);
if (!NT_SUCCESS(Status)) {
TI_DbgPrint(MIN_TRACE, ("Failed to create UDP device object. Status
(0x%X).\n", Status));
- TiUnload(DriverObject);
+ ChewShutdown();
+ IoDeleteDevice(IPDeviceObject);
+ IoDeleteDevice(RawIPDeviceObject);
return Status;
}
@@ -704,7 +707,10 @@
FILE_DEVICE_NETWORK, 0, FALSE, &TCPDeviceObject);
if (!NT_SUCCESS(Status)) {
TI_DbgPrint(MIN_TRACE, ("Failed to create TCP device object. Status
(0x%X).\n", Status));
- TiUnload(DriverObject);
+ ChewShutdown();
+ IoDeleteDevice(IPDeviceObject);
+ IoDeleteDevice(RawIPDeviceObject);
+ IoDeleteDevice(UDPDeviceObject);
return Status;
}
@@ -713,7 +719,11 @@
EntityList = ExAllocatePool(NonPagedPool, sizeof(TDIEntityID) * MAX_TDI_ENTITIES );
if (!EntityList) {
TI_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
- TiUnload(DriverObject);
+ ChewShutdown();
+ IoDeleteDevice(IPDeviceObject);
+ IoDeleteDevice(RawIPDeviceObject);
+ IoDeleteDevice(UDPDeviceObject);
+ IoDeleteDevice(TCPDeviceObject);
return STATUS_INSUFFICIENT_RESOURCES;
}
@@ -733,14 +743,25 @@
/* Allocate NDIS packet descriptors */
NdisAllocatePacketPool(&NdisStatus, &GlobalPacketPool, 100,
sizeof(PACKET_CONTEXT));
if (NdisStatus != NDIS_STATUS_SUCCESS) {
- TiUnload(DriverObject);
+ ChewShutdown();
+ IoDeleteDevice(IPDeviceObject);
+ IoDeleteDevice(RawIPDeviceObject);
+ IoDeleteDevice(UDPDeviceObject);
+ IoDeleteDevice(TCPDeviceObject);
+ ExFreePool(EntityList);
return STATUS_INSUFFICIENT_RESOURCES;
}
/* Allocate NDIS buffer descriptors */
NdisAllocateBufferPool(&NdisStatus, &GlobalBufferPool, 100);
if (NdisStatus != NDIS_STATUS_SUCCESS) {
- TiUnload(DriverObject);
+ ChewShutdown();
+ IoDeleteDevice(IPDeviceObject);
+ IoDeleteDevice(RawIPDeviceObject);
+ IoDeleteDevice(UDPDeviceObject);
+ IoDeleteDevice(TCPDeviceObject);
+ ExFreePool(EntityList);
+ NdisFreePacketPool(GlobalPacketPool);
return STATUS_INSUFFICIENT_RESOURCES;
}
@@ -762,19 +783,46 @@
/* Initialize transport level protocol subsystems */
Status = RawIPStartup();
if( !NT_SUCCESS(Status) ) {
- TiUnload(DriverObject);
+ ChewShutdown();
+ IoDeleteDevice(IPDeviceObject);
+ IoDeleteDevice(RawIPDeviceObject);
+ IoDeleteDevice(UDPDeviceObject);
+ IoDeleteDevice(TCPDeviceObject);
+ ExFreePool(EntityList);
+ NdisFreePacketPool(GlobalPacketPool);
+ NdisFreeBufferPool(GlobalBufferPool);
+ IPShutdown();
return Status;
}
Status = UDPStartup();
if( !NT_SUCCESS(Status) ) {
- TiUnload(DriverObject);
+ ChewShutdown();
+ IoDeleteDevice(IPDeviceObject);
+ IoDeleteDevice(RawIPDeviceObject);
+ IoDeleteDevice(UDPDeviceObject);
+ IoDeleteDevice(TCPDeviceObject);
+ ExFreePool(EntityList);
+ NdisFreePacketPool(GlobalPacketPool);
+ NdisFreeBufferPool(GlobalBufferPool);
+ IPShutdown();
+ RawIPShutdown();
return Status;
}
Status = TCPStartup();
if( !NT_SUCCESS(Status) ) {
- TiUnload(DriverObject);
+ ChewShutdown();
+ IoDeleteDevice(IPDeviceObject);
+ IoDeleteDevice(RawIPDeviceObject);
+ IoDeleteDevice(UDPDeviceObject);
+ IoDeleteDevice(TCPDeviceObject);
+ ExFreePool(EntityList);
+ NdisFreePacketPool(GlobalPacketPool);
+ NdisFreeBufferPool(GlobalBufferPool);
+ IPShutdown();
+ RawIPShutdown();
+ UDPShutdown();
return Status;
}
@@ -794,15 +842,41 @@
NULL,
0,
NULL);
- TiUnload(DriverObject);
+ ChewShutdown();
+ IoDeleteDevice(IPDeviceObject);
+ IoDeleteDevice(RawIPDeviceObject);
+ IoDeleteDevice(UDPDeviceObject);
+ IoDeleteDevice(TCPDeviceObject);
+ ExFreePool(EntityList);
+ NdisFreePacketPool(GlobalPacketPool);
+ NdisFreeBufferPool(GlobalBufferPool);
+ IPShutdown();
+ RawIPShutdown();
+ UDPShutdown();
+ TCPShutdown();
+ LANShutdown();
return Status;
}
/* Open loopback adapter */
- if (!NT_SUCCESS(LoopRegisterAdapter(NULL, NULL))) {
+ Status = LoopRegisterAdapter(NULL, NULL);
+ if (!NT_SUCCESS(Status)) {
TI_DbgPrint(MIN_TRACE, ("Failed to create loopback adapter. Status
(0x%X).\n", Status));
- TiUnload(DriverObject);
- return STATUS_INSUFFICIENT_RESOURCES;
+ ChewShutdown();
+ IoDeleteDevice(IPDeviceObject);
+ IoDeleteDevice(RawIPDeviceObject);
+ IoDeleteDevice(UDPDeviceObject);
+ IoDeleteDevice(TCPDeviceObject);
+ ExFreePool(EntityList);
+ NdisFreePacketPool(GlobalPacketPool);
+ NdisFreeBufferPool(GlobalBufferPool);
+ IPShutdown();
+ RawIPShutdown();
+ UDPShutdown();
+ TCPShutdown();
+ LANShutdown();
+ LANUnregisterProtocol();
+ return Status;
}
/* Use direct I/O */