Author: cgutman
Date: Sat Jul 16 16:57:07 2011
New Revision: 52697
URL:
http://svn.reactos.org/svn/reactos?rev=52697&view=rev
Log:
[AFD]
- Debugging overhaul
Modified:
trunk/reactos/drivers/network/afd/afd/bind.c
trunk/reactos/drivers/network/afd/afd/connect.c
trunk/reactos/drivers/network/afd/afd/context.c
trunk/reactos/drivers/network/afd/afd/info.c
trunk/reactos/drivers/network/afd/afd/listen.c
trunk/reactos/drivers/network/afd/afd/lock.c
trunk/reactos/drivers/network/afd/afd/main.c
trunk/reactos/drivers/network/afd/afd/read.c
trunk/reactos/drivers/network/afd/afd/select.c
trunk/reactos/drivers/network/afd/afd/tdi.c
trunk/reactos/drivers/network/afd/afd/tdiconn.c
trunk/reactos/drivers/network/afd/afd/write.c
Modified: trunk/reactos/drivers/network/afd/afd/bind.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/bi…
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/bind.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/bind.c [iso-8859-1] Sat Jul 16 16:57:07 2011
@@ -20,11 +20,11 @@
FCB->LocalAddress->Address[0].AddressType));
if( !FCB->TdiDeviceName.Length || !FCB->TdiDeviceName.Buffer ) {
- AFD_DbgPrint(MID_TRACE,("Null Device\n"));
+ AFD_DbgPrint(MIN_TRACE,("Null Device\n"));
return STATUS_NO_SUCH_DEVICE;
}
if( !FCB->LocalAddress ) {
- AFD_DbgPrint(MID_TRACE,("No local address\n"));
+ AFD_DbgPrint(MIN_TRACE,("No local address\n"));
return STATUS_INVALID_PARAMETER;
}
Modified: trunk/reactos/drivers/network/afd/afd/connect.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/co…
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/connect.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/connect.c [iso-8859-1] Sat Jul 16 16:57:07 2011
@@ -23,7 +23,10 @@
if (!SocketAcquireStateLock(FCB)) return LostSocket(Irp);
if (FCB->ConnectOptionsSize == 0)
+ {
+ AFD_DbgPrint(MIN_TRACE,("Invalid parameter\n"));
return UnlockAndMaybeComplete(FCB, STATUS_INVALID_PARAMETER, Irp, 0);
+ }
ASSERT(FCB->ConnectOptions);
@@ -60,7 +63,8 @@
}
FCB->ConnectOptions = ExAllocatePool(PagedPool, ConnectOptionsSize);
- if (!FCB->ConnectOptions) return UnlockAndMaybeComplete(FCB, STATUS_NO_MEMORY,
Irp, 0);
+ if (!FCB->ConnectOptions)
+ return UnlockAndMaybeComplete(FCB, STATUS_NO_MEMORY, Irp, 0);
RtlCopyMemory(FCB->ConnectOptions,
ConnectOptions,
@@ -87,7 +91,10 @@
return UnlockAndMaybeComplete(FCB, STATUS_NO_MEMORY, Irp, 0);
if (BufferSize < sizeof(UINT))
+ {
+ AFD_DbgPrint(MIN_TRACE,("Buffer too small\n"));
return UnlockAndMaybeComplete(FCB, STATUS_BUFFER_TOO_SMALL, Irp, 0);
+ }
if (FCB->ConnectOptions)
{
@@ -115,7 +122,10 @@
if (!SocketAcquireStateLock(FCB)) return LostSocket(Irp);
if (FCB->ConnectDataSize == 0)
+ {
+ AFD_DbgPrint(MIN_TRACE,("Invalid parameter\n"));
return UnlockAndMaybeComplete(FCB, STATUS_INVALID_PARAMETER, Irp, 0);
+ }
ASSERT(FCB->ConnectData);
@@ -179,7 +189,10 @@
return UnlockAndMaybeComplete(FCB, STATUS_NO_MEMORY, Irp, 0);
if (BufferSize < sizeof(UINT))
+ {
+ AFD_DbgPrint(MIN_TRACE,("Buffer too small\n"));
return UnlockAndMaybeComplete(FCB, STATUS_BUFFER_TOO_SMALL, Irp, 0);
+ }
if (FCB->ConnectData)
{
@@ -201,7 +214,7 @@
NTSTATUS Status;
if( !FCB->TdiDeviceName.Length || !FCB->TdiDeviceName.Buffer ) {
- AFD_DbgPrint(MID_TRACE,("Null Device\n"));
+ AFD_DbgPrint(MIN_TRACE,("Null Device\n"));
return STATUS_NO_SUCH_DEVICE;
}
@@ -501,7 +514,7 @@
break;
default:
- AFD_DbgPrint(MID_TRACE,("Inappropriate socket state %d for connect\n",
+ AFD_DbgPrint(MIN_TRACE,("Inappropriate socket state %d for connect\n",
FCB->State));
break;
}
Modified: trunk/reactos/drivers/network/afd/afd/context.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/co…
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/context.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/context.c [iso-8859-1] Sat Jul 16 16:57:07 2011
@@ -46,7 +46,10 @@
if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp );
if (IrpSp->Parameters.DeviceIoControl.OutputBufferLength < sizeof(ULONG))
+ {
+ AFD_DbgPrint(MIN_TRACE,("Buffer too small\n"));
return UnlockAndMaybeComplete(FCB, STATUS_BUFFER_TOO_SMALL, Irp, sizeof(ULONG));
+ }
RtlCopyMemory(Irp->UserBuffer,
&FCB->ContextSize,
Modified: trunk/reactos/drivers/network/afd/afd/info.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/in…
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/info.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/info.c [iso-8859-1] Sat Jul 16 16:57:07 2011
@@ -88,13 +88,13 @@
break;
default:
- AFD_DbgPrint(MID_TRACE,("Unknown info id %x\n",
+ AFD_DbgPrint(MIN_TRACE,("Unknown info id %x\n",
InfoReq->InformationClass));
Status = STATUS_INVALID_PARAMETER;
break;
}
} _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) {
- AFD_DbgPrint(MID_TRACE,("Exception executing GetInfo\n"));
+ AFD_DbgPrint(MIN_TRACE,("Exception executing GetInfo\n"));
Status = STATUS_INVALID_PARAMETER;
} _SEH2_END;
@@ -183,6 +183,7 @@
break;
}
} _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) {
+ AFD_DbgPrint(MIN_TRACE,("Exception executing SetInfo\n"));
Status = STATUS_INVALID_PARAMETER;
} _SEH2_END;
@@ -245,6 +246,7 @@
if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp );
if (FCB->RemoteAddress == NULL || FCB->Connection.Object == NULL) {
+ AFD_DbgPrint(MIN_TRACE,("Invalid parameter\n"));
return UnlockAndMaybeComplete( FCB, STATUS_INVALID_PARAMETER, Irp, 0 );
}
@@ -279,7 +281,10 @@
if (IrpSp->Parameters.DeviceIoControl.OutputBufferLength >=
TaLengthOfTransportAddress(ConnInfo->RemoteAddress))
RtlCopyMemory(Irp->UserBuffer, ConnInfo->RemoteAddress,
TaLengthOfTransportAddress(ConnInfo->RemoteAddress));
else
+ {
Status = STATUS_BUFFER_TOO_SMALL;
+ AFD_DbgPrint(MIN_TRACE,("Buffer too small\n"));
+ }
}
}
}
Modified: trunk/reactos/drivers/network/afd/afd/listen.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/li…
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/listen.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/listen.c [iso-8859-1] Sat Jul 16 16:57:07 2011
@@ -61,15 +61,6 @@
Qelt->ConnInfo->RemoteAddress );
IPAddr = (PTA_IP_ADDRESS)&ListenReceive->Address;
-
- if( !IPAddr ) {
- if( Irp->MdlAddress ) UnlockRequest( Irp, IoGetCurrentIrpStackLocation( Irp ) );
- Irp->IoStatus.Status = STATUS_NO_MEMORY;
- Irp->IoStatus.Information = 0;
- (void)IoSetCancelRoutine(Irp, NULL);
- IoCompleteRequest( Irp, IO_NETWORK_INCREMENT );
- return STATUS_NO_MEMORY;
- }
AFD_DbgPrint(MID_TRACE,("IPAddr->TAAddressCount %d\n",
IPAddr->TAAddressCount));
@@ -236,7 +227,7 @@
if( FCB->State != SOCKET_STATE_BOUND ) {
Status = STATUS_INVALID_PARAMETER;
- AFD_DbgPrint(MID_TRACE,("Could not listen an unbound socket\n"));
+ AFD_DbgPrint(MIN_TRACE,("Could not listen an unbound socket\n"));
return UnlockAndMaybeComplete( FCB, Status, Irp, 0 );
}
@@ -316,7 +307,7 @@
SocketStateUnlock( FCB );
return Status;
} else if (FCB->NonBlocking) {
- AFD_DbgPrint(MID_TRACE,("No connection ready on a non-blocking
socket\n"));
+ AFD_DbgPrint(MIN_TRACE,("No connection ready on a non-blocking
socket\n"));
return UnlockAndMaybeComplete(FCB, STATUS_CANT_WAIT, Irp, 0);
} else {
@@ -388,6 +379,8 @@
return Status;
}
}
+
+ AFD_DbgPrint(MIN_TRACE,("No connection waiting\n"));
return UnlockAndMaybeComplete( FCB, STATUS_UNSUCCESSFUL, Irp, 0 );
}
Modified: trunk/reactos/drivers/network/afd/afd/lock.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/lo…
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/lock.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/lock.c [iso-8859-1] Sat Jul 16 16:57:07 2011
@@ -48,6 +48,7 @@
} _SEH2_END;
if( LockFailed ) {
+ AFD_DbgPrint(MIN_TRACE,("Failed to lock pages\n"));
IoFreeMdl( Irp->MdlAddress );
Irp->MdlAddress = NULL;
return NULL;
@@ -74,6 +75,7 @@
} _SEH2_END;
if( LockFailed ) {
+ AFD_DbgPrint(MIN_TRACE,("Failed to lock pages\n"));
IoFreeMdl( Irp->MdlAddress );
Irp->MdlAddress = NULL;
return NULL;
@@ -166,6 +168,7 @@
AFD_DbgPrint(MID_TRACE,("MmProbeAndLock finished\n"));
if( LockFailed ) {
+ AFD_DbgPrint(MIN_TRACE,("Failed to lock pages\n"));
IoFreeMdl( MapBuf[i].Mdl );
MapBuf[i].Mdl = NULL;
ExFreePool( NewBuf );
@@ -227,7 +230,10 @@
}
if( !NT_SUCCESS(Status) )
+ {
+ AFD_DbgPrint(MIN_TRACE,("Failed to reference handles (0x%x)\n",
Status));
FileObjects[i].Handle = 0;
+ }
}
if( !NT_SUCCESS(Status) ) {
Modified: trunk/reactos/drivers/network/afd/afd/main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/ma…
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/main.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/main.c [iso-8859-1] Sat Jul 16 16:57:07 2011
@@ -21,7 +21,7 @@
/* See debug.h for debug/trace constants */
//DWORD DebugTraceLevel = DEBUG_ULTRA;
-DWORD DebugTraceLevel = 0;
+DWORD DebugTraceLevel = MIN_TRACE;
#endif /* DBG */
@@ -52,7 +52,10 @@
if (!SocketAcquireStateLock(FCB)) return LostSocket(Irp);
if (FCB->DisconnectOptionsSize == 0)
+ {
+ AFD_DbgPrint(MIN_TRACE,("Invalid parameter\n"));
return UnlockAndMaybeComplete(FCB, STATUS_INVALID_PARAMETER, Irp, 0);
+ }
ASSERT(FCB->DisconnectOptions);
@@ -116,7 +119,10 @@
return UnlockAndMaybeComplete(FCB, STATUS_NO_MEMORY, Irp, 0);
if (BufferSize < sizeof(UINT))
+ {
+ AFD_DbgPrint(MIN_TRACE,("Buffer too small\n"));
return UnlockAndMaybeComplete(FCB, STATUS_BUFFER_TOO_SMALL, Irp, 0);
+ }
if (FCB->DisconnectOptions)
{
@@ -144,7 +150,10 @@
if (!SocketAcquireStateLock(FCB)) return LostSocket(Irp);
if (FCB->DisconnectDataSize == 0)
+ {
+ AFD_DbgPrint(MIN_TRACE,("Invalid parameter\n"));
return UnlockAndMaybeComplete(FCB, STATUS_INVALID_PARAMETER, Irp, 0);
+ }
ASSERT(FCB->DisconnectData);
@@ -208,7 +217,10 @@
return UnlockAndMaybeComplete(FCB, STATUS_NO_MEMORY, Irp, 0);
if (BufferSize < sizeof(UINT))
+ {
+ AFD_DbgPrint(MIN_TRACE,("Buffer too small\n"));
return UnlockAndMaybeComplete(FCB, STATUS_BUFFER_TOO_SMALL, Irp, 0);
+ }
if (FCB->DisconnectData)
{
@@ -241,7 +253,10 @@
if (IrpSp->Parameters.DeviceIoControl.InputBufferLength < sizeof(ULONG) ||
IrpSp->Parameters.DeviceIoControl.OutputBufferLength <
sizeof(*HandleData))
+ {
+ AFD_DbgPrint(MIN_TRACE,("Buffer too small\n"));
return UnlockAndMaybeComplete(FCB, STATUS_BUFFER_TOO_SMALL, Irp, 0);
+ }
if ((*HandleFlags) & AFD_ADDRESS_HANDLE)
HandleData->TdiAddressHandle = FCB->AddressFile.Handle;
@@ -675,8 +690,11 @@
if (!(FCB->Flags & AFD_ENDPOINT_CONNECTIONLESS))
{
if( !FCB->ConnectCallInfo )
+ {
+ AFD_DbgPrint(MIN_TRACE,("Invalid parameter\n"));
return UnlockAndMaybeComplete( FCB, STATUS_INVALID_PARAMETER,
Irp, 0 );
+ }
if (FCB->DisconnectPending)
{
@@ -730,7 +748,10 @@
if (!(Flags & TDI_DISCONNECT_RELEASE))
{
if (!FCB->RemoteAddress)
+ {
+ AFD_DbgPrint(MIN_TRACE,("Invalid parameter\n"));
return UnlockAndMaybeComplete(FCB, STATUS_INVALID_PARAMETER, Irp, 0);
+ }
ExFreePool(FCB->RemoteAddress);
Modified: trunk/reactos/drivers/network/afd/afd/read.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/re…
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/read.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/read.c [iso-8859-1] Sat Jul 16 16:57:07 2011
@@ -362,7 +362,7 @@
if( DatagramRecv->Address->TAAddressCount != 1 ) {
AFD_DbgPrint
- (MID_TRACE,
+ (MIN_TRACE,
("Wierd address count %d\n",
DatagramRecv->Address->TAAddressCount));
}
@@ -443,7 +443,7 @@
if( !(FCB->Flags & AFD_ENDPOINT_CONNECTIONLESS) &&
FCB->State != SOCKET_STATE_CONNECTED &&
FCB->State != SOCKET_STATE_CONNECTING ) {
- AFD_DbgPrint(MID_TRACE,("Called recv on wrong kind of socket (s%x)\n",
+ AFD_DbgPrint(MIN_TRACE,("Called recv on wrong kind of socket (s%x)\n",
FCB->State));
return UnlockAndMaybeComplete( FCB, STATUS_INVALID_PARAMETER,
Irp, 0 );
@@ -486,6 +486,8 @@
FCB->PollState &= ~AFD_EVENT_RECEIVE;
UnlockBuffers( RecvReq->BufferArray, RecvReq->BufferCount, FALSE
);
+
+ AFD_DbgPrint(MIN_TRACE,("Partial datagram not read\n"));
return UnlockAndMaybeComplete
( FCB, Status, Irp, Irp->IoStatus.Information );
@@ -513,7 +515,7 @@
( FCB, Status, Irp, Irp->IoStatus.Information );
}
} else if( (RecvReq->AfdFlags & AFD_IMMEDIATE) || (FCB->NonBlocking) )
{
- AFD_DbgPrint(MID_TRACE,("Nonblocking\n"));
+ AFD_DbgPrint(MIN_TRACE,("Nonblocking\n"));
Status = STATUS_CANT_WAIT;
FCB->PollState &= ~AFD_EVENT_RECEIVE;
UnlockBuffers( RecvReq->BufferArray, RecvReq->BufferCount, FALSE );
@@ -536,7 +538,7 @@
if( Status == STATUS_PENDING &&
((RecvReq->AfdFlags & AFD_IMMEDIATE) || (FCB->NonBlocking)) ) {
- AFD_DbgPrint(MID_TRACE,("Nonblocking\n"));
+ AFD_DbgPrint(MIN_TRACE,("Nonblocking\n"));
Status = STATUS_CANT_WAIT;
TotalBytesCopied = 0;
RemoveEntryList( &Irp->Tail.Overlay.ListEntry );
@@ -660,6 +662,7 @@
UnlockBuffers( RecvReq->BufferArray, RecvReq->BufferCount,
CheckUnlockExtraBuffers(FCB, NextIrpSp) );
if ( NextIrp->MdlAddress ) UnlockRequest( NextIrp,
IoGetCurrentIrpStackLocation( NextIrp ) );
(void)IoSetCancelRoutine(NextIrp, NULL);
+ AFD_DbgPrint(MIN_TRACE,("Partial datagram failed\n"));
IoCompleteRequest( NextIrp, IO_NETWORK_INCREMENT );
} else {
AFD_DbgPrint(MID_TRACE,("Satisfying\n"));
@@ -723,8 +726,11 @@
/* Check that the socket is bound */
if( FCB->State != SOCKET_STATE_BOUND )
+ {
+ AFD_DbgPrint(MIN_TRACE,("Invalid socket state\n"));
return UnlockAndMaybeComplete
( FCB, STATUS_INVALID_PARAMETER, Irp, 0 );
+ }
if( !(RecvReq = LockRequest( Irp, IrpSp )) )
return UnlockAndMaybeComplete
( FCB, STATUS_NO_MEMORY, Irp, 0 );
@@ -761,6 +767,8 @@
FCB->PollState &= ~AFD_EVENT_RECEIVE;
UnlockBuffers( RecvReq->BufferArray, RecvReq->BufferCount, TRUE );
+
+ AFD_DbgPrint(MIN_TRACE,("Partial datagram failed\n"));
return UnlockAndMaybeComplete
( FCB, Status, Irp, Irp->IoStatus.Information );
@@ -788,7 +796,7 @@
( FCB, Status, Irp, Irp->IoStatus.Information );
}
} else if( (RecvReq->AfdFlags & AFD_IMMEDIATE) || (FCB->NonBlocking) ) {
- AFD_DbgPrint(MID_TRACE,("Nonblocking\n"));
+ AFD_DbgPrint(MIN_TRACE,("Nonblocking\n"));
Status = STATUS_CANT_WAIT;
FCB->PollState &= ~AFD_EVENT_RECEIVE;
UnlockBuffers( RecvReq->BufferArray, RecvReq->BufferCount, TRUE );
Modified: trunk/reactos/drivers/network/afd/afd/select.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/se…
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/select.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/select.c [iso-8859-1] Sat Jul 16 16:57:07 2011
@@ -293,7 +293,10 @@
NULL );
if( !NT_SUCCESS(Status) )
+ {
+ AFD_DbgPrint(MIN_TRACE,("Failed reference event (0x%x)\n", Status));
FCB->EventSelect = NULL;
+ }
else
FCB->EventSelectTriggers = EventSelectInfo->Events;
} else {
Modified: trunk/reactos/drivers/network/afd/afd/tdi.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/td…
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/tdi.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/tdi.c [iso-8859-1] Sat Jul 16 16:57:07 2011
@@ -30,7 +30,7 @@
return;
}
- AFD_DbgPrint(MIN_TRACE, ("Displaying buffer at (0x%X) Size (%d).\n",
Buffer, Size));
+ AFD_DbgPrint(MID_TRACE, ("Displaying buffer at (0x%X) Size (%d).\n",
Buffer, Size));
p = (PCHAR)Buffer;
for (i = 0; i < Size; i++) {
@@ -236,6 +236,7 @@
if (!NT_SUCCESS(Status))
{
+ AFD_DbgPrint(MIN_TRACE,("Failed to lock pages\n"));
IoFreeMdl(Mdl);
ExFreePool(Buffer);
return Status;
@@ -1005,9 +1006,9 @@
}
_SEH2_TRY {
- AFD_DbgPrint(MIN_TRACE, ("probe and lock\n"));
+ AFD_DbgPrint(MID_TRACE, ("probe and lock\n"));
MmProbeAndLockPages(Mdl, (*Irp)->RequestorMode, IoModifyAccess);
- AFD_DbgPrint(MIN_TRACE, ("probe and lock done\n"));
+ AFD_DbgPrint(MID_TRACE, ("probe and lock done\n"));
} _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) {
AFD_DbgPrint(MIN_TRACE, ("MmProbeAndLockPages() failed.\n"));
IoFreeMdl(Mdl);
Modified: trunk/reactos/drivers/network/afd/afd/tdiconn.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/td…
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/tdiconn.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/tdiconn.c [iso-8859-1] Sat Jul 16 16:57:07 2011
@@ -170,7 +170,10 @@
TdiAddressSize = TaLengthOfTransportAddressByType(Type);
if (!TdiAddressSize)
+ {
+ AFD_DbgPrint(MIN_TRACE,("Invalid parameter\n"));
return STATUS_INVALID_PARAMETER;
+ }
RtlZeroMemory(ConnInfo,
sizeof(TDI_CONNECTION_INFORMATION) +
@@ -203,6 +206,7 @@
TdiAddressSize = TaLengthOfTransportAddressByType(Type);
if (!TdiAddressSize) {
+ AFD_DbgPrint(MIN_TRACE,("Invalid parameter\n"));
*ConnectionInfo = NULL;
return STATUS_INVALID_PARAMETER;
}
Modified: trunk/reactos/drivers/network/afd/afd/write.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/wr…
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/write.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/write.c [iso-8859-1] Sat Jul 16 16:57:07 2011
@@ -299,8 +299,11 @@
/* Check that the socket is bound */
if( FCB->State != SOCKET_STATE_BOUND || !FCB->RemoteAddress )
+ {
+ AFD_DbgPrint(MIN_TRACE,("Invalid parameter\n"));
return UnlockAndMaybeComplete( FCB, STATUS_INVALID_PARAMETER, Irp,
0 );
+ }
if( !(SendReq = LockRequest( Irp, IrpSp )) )
return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, Irp, 0 );
@@ -349,12 +352,14 @@
if (FCB->DisconnectPending && (FCB->DisconnectFlags &
TDI_DISCONNECT_RELEASE))
{
+ AFD_DbgPrint(MIN_TRACE,("No more sends\n"));
/* We're pending a send shutdown so don't accept anymore sends */
return UnlockAndMaybeComplete(FCB, STATUS_FILE_CLOSED, Irp, 0);
}
if (FCB->PollState & (AFD_EVENT_CLOSE | AFD_EVENT_DISCONNECT))
{
+ AFD_DbgPrint(MIN_TRACE,("No more sends\n"));
if (FCB->PollStatus[FD_CLOSE_BIT] == STATUS_SUCCESS)
{
/* This is a local send shutdown or a graceful remote disconnect */
@@ -385,7 +390,7 @@
if( FCB->State != SOCKET_STATE_CONNECTED ) {
if( (SendReq->AfdFlags & AFD_IMMEDIATE) || (FCB->NonBlocking) ) {
- AFD_DbgPrint(MID_TRACE,("Nonblocking\n"));
+ AFD_DbgPrint(MIN_TRACE,("Nonblocking\n"));
UnlockBuffers( SendReq->BufferArray, SendReq->BufferCount, FALSE );
return UnlockAndMaybeComplete
( FCB, STATUS_CANT_WAIT, Irp, 0 );
@@ -476,7 +481,7 @@
{
FCB->PollState &= ~AFD_EVENT_SEND;
if( (SendReq->AfdFlags & AFD_IMMEDIATE) || (FCB->NonBlocking) ) {
- AFD_DbgPrint(MID_TRACE,("Nonblocking\n"));
+ AFD_DbgPrint(MIN_TRACE,("Nonblocking\n"));
UnlockBuffers( SendReq->BufferArray, SendReq->BufferCount, FALSE );
return UnlockAndMaybeComplete
( FCB, STATUS_CANT_WAIT, Irp, 0 );
@@ -503,8 +508,11 @@
/* Check that the socket is bound */
if( FCB->State != SOCKET_STATE_BOUND &&
FCB->State != SOCKET_STATE_CREATED)
+ {
+ AFD_DbgPrint(MIN_TRACE,("Invalid socket state\n"));
return UnlockAndMaybeComplete
( FCB, STATUS_INVALID_PARAMETER, Irp, 0 );
+ }
if( !(SendReq = LockRequest( Irp, IrpSp )) )
return UnlockAndMaybeComplete
( FCB, STATUS_NO_MEMORY, Irp, 0 );