Hi All,
The follwoing method will be called when I receive TDI_SET_EVENT IRP in my filter driver. I will be associating my ReceiveHandler Address to addressFile->ReceiveHandler. But my Receive handler was never called. Please can anybody tell me why?.
Should I have to do something more for my Receive handler to be called.
ULONG
TdiSetEventHandler(
IN PIRP Irp
)
{
NTSTATUS rc=STATUS_SUCCESS;
ULONG nRet=0;
KIRQL oldirql;
PTDI_REQUEST_KERNEL_SET_EVENT parameters;
PIO_STACK_LOCATION irpSp;
PTP_ADDRESS address;
PTP_ADDRESS_FILE addressFile;
NTSTATUS status;
irpSp = IoGetCurrentIrpStackLocation (Irp);
addressFile = irpSp->FileObject->FsContext;
address = addressFile->Address;
ACQUIRE_SPIN_LOCK (&address->SpinLock, &oldirql);
parameters = (PTDI_REQUEST_KERNEL_SET_EVENT)&irpSp->Parameters;
switch (parameters->EventType)
{
case TDI_EVENT_RECEIVE:
KdPrint((“TDI_EVENT_RECEIVE\n”));
if (parameters->EventHandler == NULL)
{
KdPrint((“Event Handler is Null”));
}
else
{
KdPrint((“Event Handler is not Null”));
DefaultHandler=parameters->EventHandler;
addressFile->ReceiveHandler = (PTDI_IND_RECEIVE)MyReceiveHandler;
addressFile->ReceiveHandlerContext = parameters->EventContext;
addressFile->RegisteredReceiveHandler = TRUE;
}
nRet=0;
break;
default:
nRet=1;
break;
} /* switch */
RELEASE_SPIN_LOCK (&address->SpinLock, oldirql);
return nRet;
} /* TdiSetEventHandler */
Regards
Gopikrishna.B.