阅读:2348回复:2
tdi filter help!!
在pcausa提供的tdi filter passthru例子中,在处理TDI_ASSOCIATE_ADDRESS的时候,为什么关联的pTcpConn->tc_FileObject和
pAddrObj->ao_FileObject不同,难道他们是用不同的FileObject打开的,为什么会这样? 源代码如下: NTSTATUS TDIH_TdiAssociateAddressComplete( PDEVICE_OBJECT pDeviceObject, PIRP Irp, void* Context ) { PTDIH_DeviceExtension pTDIH_DeviceExtension = NULL; BOOLEAN CanDetachProceed = FALSE; PDEVICE_OBJECT pAssociatedDeviceObject = NULL; NTSTATUS Status = Irp->IoStatus.Status; TCPConn* pTCPConn = (TCPConn*) NULL; PIO_STACK_LOCATION IrpSp = NULL; PTDI_REQUEST_KERNEL_ASSOCIATE p; PFILE_OBJECT pFileObject = NULL; ......... ......... // // Locate TCP Connection Object // pTCPConn = TDIH_GetConnFromFileObject(IrpSp->FileObject); if (pTCPConn) { KdPrint((" Found TCPConn To Associaten")); ASSERT(!pTCPConn->tc_ao); // // Locate The Transport Address Object // p = (PTDI_REQUEST_KERNEL_ASSOCIATE) & IrpSp->Parameters; // // Obtain a referenced pointer to the file object. // ASSERT(KeGetCurrentIrql() == PASSIVE_LEVEL); :(:(:(:(:(:(:(:(:(:(:( // //!!!!!!!!为什么需要得到FileObject,直接用IrpSp->FileObject有何不妥??? // :(:(:(:(:(:(:(:(:(:(:( Status = ObReferenceObjectByHandle(p->AddressHandle, // Object Handle FILE_ANY_ACCESS, // Desired Access NULL, // Object Type KernelMode, // Processor mode (PVOID *) &pFileObject, // File Object pointer NULL // Object Handle information ); if (NT_SUCCESS(Status)) { AddrObj* pAddrObj; pAddrObj = TDIH_GetAddrObjFromFileObject(pFileObject); ASSERT(KeGetCurrentIrql() == PASSIVE_LEVEL); ObDereferenceObject(pFileObject); if (pAddrObj) { KdPrint((" Found AddrObj To Associaten")); pTCPConn->tc_ao = pAddrObj; } } } } ......... ......... return(STATUS_SUCCESS); } |
|
沙发#
发布于:2004-08-17 18:05
请帮主删除
|
|
板凳#
发布于:2004-08-20 12:23
请帮主删除 |
|