Author: cgutman
Date: Thu Jul 9 20:47:11 2009
New Revision: 41833
URL:
http://svn.reactos.org/svn/reactos?rev=41833&view=rev
Log:
- Implement IOCTL_AFD_SET_INFO
- We currently disregard the value of BlockingMode so this causes no behavior change
Modified:
trunk/reactos/drivers/network/afd/afd/info.c
trunk/reactos/drivers/network/afd/afd/main.c
trunk/reactos/drivers/network/afd/include/afd.h
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] Thu Jul 9 20:47:11 2009
@@ -67,6 +67,35 @@
AFD_DbgPrint(MID_TRACE,("Returning %x\n", Status));
return UnlockAndMaybeComplete( FCB, Status, Irp, 0 );
+}
+
+NTSTATUS NTAPI
+AfdSetInfo( PDEVICE_OBJECT DeviceObject, PIRP Irp,
+ PIO_STACK_LOCATION IrpSp ) {
+ NTSTATUS Status = STATUS_SUCCESS;
+ PAFD_INFO InfoReq = IrpSp->Parameters.DeviceIoControl.Type3InputBuffer;
+ PFILE_OBJECT FileObject = IrpSp->FileObject;
+ PAFD_FCB FCB = FileObject->FsContext;
+
+ if (!SocketAcquireStateLock(FCB)) return LostSocket(Irp);
+
+ _SEH2_TRY {
+ switch (InfoReq->InformationClass) {
+ case AFD_INFO_BLOCKING_MODE:
+ AFD_DbgPrint(MID_TRACE,("Blocking mode set to %d\n",
InfoReq->Information.Ulong));
+ FCB->BlockingMode = InfoReq->Information.Ulong;
+ break;
+ default:
+ AFD_DbgPrint(MIN_TRACE,("Unknown request %d\n",
InfoReq->InformationClass));
+ break;
+ }
+ } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) {
+ Status = STATUS_INVALID_PARAMETER;
+ } _SEH2_END;
+
+ AFD_DbgPrint(MID_TRACE,("Returning %x\n", Status));
+
+ return UnlockAndMaybeComplete(FCB, Status, Irp, 0);
}
NTSTATUS NTAPI
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] Thu Jul 9 20:47:11 2009
@@ -422,6 +422,9 @@
case IOCTL_AFD_GET_INFO:
return AfdGetInfo( DeviceObject, Irp, IrpSp );
+ case IOCTL_AFD_SET_INFO:
+ return AfdSetInfo( DeviceObject, Irp, IrpSp );
+
case IOCTL_AFD_GET_CONTEXT:
return AfdGetContext( DeviceObject, Irp, IrpSp );
@@ -445,10 +448,6 @@
case IOCTL_AFD_GET_TDI_HANDLES:
AFD_DbgPrint(MIN_TRACE, ("IOCTL_AFD_GET_TDI_HANDLES\n"));
- break;
-
- case IOCTL_AFD_SET_INFO:
- AFD_DbgPrint(MIN_TRACE, ("IOCTL_AFD_SET_INFO\n"));
break;
case IOCTL_AFD_SET_CONNECT_DATA:
Modified: trunk/reactos/drivers/network/afd/include/afd.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/includ…
==============================================================================
--- trunk/reactos/drivers/network/afd/include/afd.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/include/afd.h [iso-8859-1] Thu Jul 9 20:47:11 2009
@@ -178,7 +178,7 @@
typedef struct _AFD_FCB {
BOOLEAN Locked, Critical, Overread;
- UINT State, Flags;
+ UINT State, Flags, BlockingMode;
KIRQL OldIrql;
UINT LockCount;
PVOID CurrentThread;
@@ -237,6 +237,10 @@
PIO_STACK_LOCATION IrpSp );
NTSTATUS NTAPI
+AfdSetInfo( PDEVICE_OBJECT DeviceObject, PIRP Irp,
+ PIO_STACK_LOCATION IrpSp );
+
+NTSTATUS NTAPI
AfdGetSockName( PDEVICE_OBJECT DeviceObject, PIRP Irp,
PIO_STACK_LOCATION IrpSp );