Author: cgutman
Date: Mon Jul 12 22:56:37 2010
New Revision: 48020
URL:
http://svn.reactos.org/svn/reactos?rev=48020&view=rev
Log:
[AFD]
- Implement IOCTL_AFD_GET_TDI_HANDLES
Modified:
trunk/reactos/drivers/network/afd/afd/main.c
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] Mon Jul 12 22:56:37 2010
@@ -209,6 +209,30 @@
if (!FCB->DisconnectData) return UnlockAndMaybeComplete(FCB, STATUS_NO_MEMORY,
Irp, 0);
FCB->DisconnectDataSize = *DisconnectDataSize;
+
+ return UnlockAndMaybeComplete(FCB, STATUS_SUCCESS, Irp, 0);
+}
+
+static NTSTATUS NTAPI
+AfdGetTdiHandles(PDEVICE_OBJECT DeviceObject, PIRP Irp,
+ PIO_STACK_LOCATION IrpSp)
+{
+ PFILE_OBJECT FileObject = IrpSp->FileObject;
+ PAFD_FCB FCB = FileObject->FsContext;
+ PULONG HandleFlags = IrpSp->Parameters.DeviceIoControl.Type3InputBuffer;
+ PAFD_TDI_HANDLE_DATA HandleData = Irp->UserBuffer;
+
+ if (!SocketAcquireStateLock(FCB)) return LostSocket(Irp);
+
+ if (IrpSp->Parameters.DeviceIoControl.InputBufferLength < sizeof(ULONG) ||
+ IrpSp->Parameters.DeviceIoControl.OutputBufferLength <
sizeof(*HandleData))
+ return UnlockAndMaybeComplete(FCB, STATUS_BUFFER_TOO_SMALL, Irp, 0);
+
+ if ((*HandleFlags) & AFD_ADDRESS_HANDLE)
+ HandleData->TdiAddressHandle = FCB->AddressFile.Handle;
+
+ if ((*HandleFlags) & AFD_CONNECTION_HANDLE)
+ HandleData->TdiConnectionHandle = FCB->Connection.Handle;
return UnlockAndMaybeComplete(FCB, STATUS_SUCCESS, Irp, 0);
}
@@ -694,8 +718,7 @@
return AfdSetDisconnectOptionsSize(DeviceObject, Irp, IrpSp);
case IOCTL_AFD_GET_TDI_HANDLES:
- DbgPrint("IOCTL_AFD_GET_TDI_HANDLES is UNIMPLEMENTED!\n");
- break;
+ return AfdGetTdiHandles(DeviceObject, Irp, IrpSp);
case IOCTL_AFD_DEFER_ACCEPT:
DbgPrint("IOCTL_AFD_DEFER_ACCEPT is UNIMPLEMENTED!\n");