Author: tkreuzer
Date: Thu Feb 20 21:41:33 2014
New Revision: 62272
URL:
http://svn.reactos.org/svn/reactos?rev=62272&view=rev
Log:
[AfD]
In AfdBindSocket, open a usermode handle and return that to the caller, instead of
returning the kernel mode handle.
Modified:
trunk/reactos/drivers/network/afd/afd/bind.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] Thu Feb 20 21:41:33 2014
@@ -77,6 +77,7 @@
PFILE_OBJECT FileObject = IrpSp->FileObject;
PAFD_FCB FCB = FileObject->FsContext;
PAFD_BIND_DATA BindReq;
+ HANDLE UserHandle;
UNREFERENCED_PARAMETER(DeviceObject);
@@ -99,9 +100,20 @@
AFD_DbgPrint(MID_TRACE,("FCB->Flags %x\n", FCB->Flags));
if (NT_SUCCESS(Status))
- FCB->State = SOCKET_STATE_BOUND;
+ {
+ UserHandle = NULL;
+ Status = ObOpenObjectByPointer(FCB->AddressFile.Object,
+ 0,
+ NULL,
+ MAXIMUM_ALLOWED,
+ IoFileObjectType,
+ Irp->RequestorMode,
+ &UserHandle);
+ if (NT_SUCCESS(Status))
+ FCB->State = SOCKET_STATE_BOUND;
+ }
/* MSAFD relies on us returning the address file handle in the IOSB */
return UnlockAndMaybeComplete( FCB, Status, Irp,
- (ULONG_PTR)FCB->AddressFile.Handle );
+ (ULONG_PTR)UserHandle);
}