TDI query informatin

I want to query information about FileObject, I receive during TDI_CONNECT.
I do the following :

IO_STATUS_BLOCK ioStatus;
KEVENT MyEvent;

KeInitializeEvent(&MyEvent,NotificationEvent,FALSE);
pMyIrp = TdiBuildInternalDeviceControlIrp(TDI_QUERY_INFORMATION,
pDevObj,
FileObject,
NULL,
NULL);

MyAddress = ExAllocatePoolWithTag(NonPagedPool, 1000, COMMON_TAG);

MyMdl = IoAllocateMdl(MyAddress,
500,
FALSE,
FALSE,
NULL);

TdiBuildQueryInformation(pMyIrp,
pDevObj,
FileObject,
NULL,
NULL,
TDI_QUERY_CONNECTION_INFO,
MyMdl);

pMyIrp->UserEvent = &MyEvent;
pMyIrp->UserIosb = &ioStatus;

Status = IoCallDriver(LowerDeviceObject , pMyIrp);
//--------------------------------------------------------------------------

the last line results in a Page Fault …
what am I doing wrong ?
help me please !!

Thanks in advance.


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Seems basically OK.

In my TDI sample code (which works):

1.) I use IoAllocateIrp instead of TdiBuildInternalDeviceControlIrp.
2.) I probe and lock the MDL pages. OTOH, that shouldn’t be necessary in
your case because you allocated from a non-paged pool.

Sorry I can’t be more helpful. The call does work…

Regards,

Thomas F. Divine

PCAUSA - Tools & Resources For Network Software Developers
NDIS Protocol/Intermediate/Hooking - TDI Client/Filter
http: - http:

“foxgen” wrote in message news:xxxxx@ntdev…
>
> I want to query information about FileObject, I receive during
TDI_CONNECT.
> I do the following :
>
> IO_STATUS_BLOCK ioStatus;
> KEVENT MyEvent;
> …
>
> KeInitializeEvent(&MyEvent,NotificationEvent,FALSE);
> pMyIrp = TdiBuildInternalDeviceControlIrp(TDI_QUERY_INFORMATION,
> pDevObj,
> FileObject,
> NULL,
> NULL);
>
> MyAddress = ExAllocatePoolWithTag(NonPagedPool, 1000, COMMON_TAG);
>
> MyMdl = IoAllocateMdl(MyAddress,
> 500,
> FALSE,
> FALSE,
> NULL);
>
> TdiBuildQueryInformation(pMyIrp,
> pDevObj,
> FileObject,
> NULL,
> NULL,
> TDI_QUERY_CONNECTION_INFO,
> MyMdl);
>
> pMyIrp->UserEvent = &MyEvent;
> pMyIrp->UserIosb = &ioStatus;
>
> Status = IoCallDriver(LowerDeviceObject , pMyIrp);
>
//--------------------------------------------------------------------------
> ------
>
> the last line results in a Page Fault …
> what am I doing wrong ?
> help me please !!
>
> Thanks in advance.
>
>
>
>
> —
> You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
> To unsubscribe send a blank email to
leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com</http:></http:>

To be more specific I can write, that the last 2 functions in stack are :
ntoskrnl!KiIpiServiceRoutine + 168F
ntoskrnl!KeSetEvent + 006F

I wonder, what could this mean ?

Seems basically OK.

In my TDI sample code (which works):

1.) I use IoAllocateIrp instead of TdiBuildInternalDeviceControlIrp.
2.) I probe and lock the MDL pages. OTOH, that shouldn’t be necessary in
your case because you allocated from a non-paged pool.

Sorry I can’t be more helpful. The call does work…

Regards,

Thomas F. Divine

PCAUSA - Tools & Resources For Network Software Developers
NDIS Protocol/Intermediate/Hooking - TDI Client/Filter
http: - http:
>
> “foxgen” wrote in message news:xxxxx@ntdev…
> >
> > I want to query information about FileObject, I receive during
> TDI_CONNECT.
> > I do the following :
> >
> > IO_STATUS_BLOCK ioStatus;
> > KEVENT MyEvent;
> > …
> >
> > KeInitializeEvent(&MyEvent,NotificationEvent,FALSE);
> > pMyIrp = TdiBuildInternalDeviceControlIrp(TDI_QUERY_INFORMATION,
> > pDevObj,
> > FileObject,
> > NULL,
> > NULL);
> >
> > MyAddress = ExAllocatePoolWithTag(NonPagedPool, 1000, COMMON_TAG);
> >
> > MyMdl = IoAllocateMdl(MyAddress,
> > 500,
> > FALSE,
> > FALSE,
> > NULL);
> >
> > TdiBuildQueryInformation(pMyIrp,
> > pDevObj,
> > FileObject,
> > NULL,
> > NULL,
> > TDI_QUERY_CONNECTION_INFO,
> > MyMdl);
> >
> > pMyIrp->UserEvent = &MyEvent;
> > pMyIrp->UserIosb = &ioStatus;
> >
> > Status = IoCallDriver(LowerDeviceObject , pMyIrp);
> >
>
//--------------------------------------------------------------------------
> > ------
> >
> > the last line results in a Page Fault …
> > what am I doing wrong ?
> > help me please !!
> >
> > Thanks in advance.
> >
> >
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@yandex.ru
> > To unsubscribe send a blank email to
> leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
> >
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@yandex.ru
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com</http:></http:>