Problem with TDI

Hi there,

I am facing a big problem here, would appreciate if someone could help
out.

I have a filter driver for the FS. In this, I basically block the Irp
and ask the TDI to do some network functions for me. The problem is
that sometimes it works fine for a long time and sometimes it just hangs
in the call to the TDI.

The point it exactly hangs is when I have allocated an event (from
non-paged pool) and passed it to the TDI, then I wait for the request to
get over and the TDI to signal back, it is at this point that it just
hangs. Meaning I just keep waiting in my KeWaitForSingleObject()
routine.

I have been trying to debug this thing for the past 1 week and cant get
through.

Any help is much appreciated,

thanks in advance,
Almas

Are you in PASSIVE_MODE? Check. You can not call the KeWaitXxx() unless you
are at passive.

Jamey

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Almas Khan
Sent: Saturday, May 06, 2000 8:24 AM
To: File Systems Developers
Subject: [ntfsd] Problem with TDI

Hi there,

I am facing a big problem here, would appreciate if someone could help
out.

I have a filter driver for the FS. In this, I basically block the Irp
and ask the TDI to do some network functions for me. The problem is
that sometimes it works fine for a long time and sometimes it just hangs
in the call to the TDI.

The point it exactly hangs is when I have allocated an event (from
non-paged pool) and passed it to the TDI, then I wait for the request to
get over and the TDI to signal back, it is at this point that it just
hangs. Meaning I just keep waiting in my KeWaitForSingleObject()
routine.

I have been trying to debug this thing for the past 1 week and cant get
through.

Any help is much appreciated,

thanks in advance,
Almas


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)

Thanks for the reply!

Yes I did check and it is at PASSIVE_LEVEL. I also take care that I dont call
the TDI simultaneously.

The biggest reason for my frustration is that it executes the same commands
from the same place for some time and then it just hangs. I have looked at the
resources that I allocate for it. The event etc are all local for that function
(which does the actual TDI calling) and I deallocate whatever I have allocated
within the function, so I dont think that it is running out of resources.
Neither my completion routine gets called nor is this event set, so I am always
in my wait.

Almas

Jamey Kirby wrote:

Are you in PASSIVE_MODE? Check. You can not call the KeWaitXxx() unless you
are at passive.

Jamey

> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of Almas Khan
> Sent: Saturday, May 06, 2000 8:24 AM
> To: File Systems Developers
> Subject: [ntfsd] Problem with TDI
>
>
> Hi there,
>
> I am facing a big problem here, would appreciate if someone could help
> out.
>
> I have a filter driver for the FS. In this, I basically block the Irp
> and ask the TDI to do some network functions for me. The problem is
> that sometimes it works fine for a long time and sometimes it just hangs
> in the call to the TDI.
>
> The point it exactly hangs is when I have allocated an event (from
> non-paged pool) and passed it to the TDI, then I wait for the request to
> get over and the TDI to signal back, it is at this point that it just
> hangs. Meaning I just keep waiting in my KeWaitForSingleObject()
> routine.
>
> I have been trying to debug this thing for the past 1 week and cant get
> through.
>
> Any help is much appreciated,
>
> thanks in advance,
> Almas
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to $subst(‘Email.Unsub’)
>


You are currently subscribed to ntfsd as: xxxxx@krdl.org.sg
To unsubscribe send a blank email to $subst(‘Email.Unsub’)

Haave your tried it with Driver Verifier?

Just grasping at straws…

Jamey

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Almas Khan
Sent: Sunday, May 07, 2000 1:05 AM
To: File Systems Developers
Subject: [ntfsd] RE: Problem with TDI

Thanks for the reply!

Yes I did check and it is at PASSIVE_LEVEL. I also take care that
I dont call
the TDI simultaneously.

The biggest reason for my frustration is that it executes the
same commands
from the same place for some time and then it just hangs. I have
looked at the
resources that I allocate for it. The event etc are all local for
that function
(which does the actual TDI calling) and I deallocate whatever I
have allocated
within the function, so I dont think that it is running out of resources.
Neither my completion routine gets called nor is this event set,
so I am always
in my wait.

Almas

Jamey Kirby wrote:

> Are you in PASSIVE_MODE? Check. You can not call the
KeWaitXxx() unless you
> are at passive.
>
> Jamey
>
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com]On Behalf Of Almas Khan
> > Sent: Saturday, May 06, 2000 8:24 AM
> > To: File Systems Developers
> > Subject: [ntfsd] Problem with TDI
> >
> >
> > Hi there,
> >
> > I am facing a big problem here, would appreciate if someone could help
> > out.
> >
> > I have a filter driver for the FS. In this, I basically block the Irp
> > and ask the TDI to do some network functions for me. The problem is
> > that sometimes it works fine for a long time and sometimes it
just hangs
> > in the call to the TDI.
> >
> > The point it exactly hangs is when I have allocated an event (from
> > non-paged pool) and passed it to the TDI, then I wait for the
request to
> > get over and the TDI to signal back, it is at this point that it just
> > hangs. Meaning I just keep waiting in my KeWaitForSingleObject()
> > routine.
> >
> > I have been trying to debug this thing for the past 1 week
and cant get
> > through.
> >
> > Any help is much appreciated,
> >
> > thanks in advance,
> > Almas
> >
> >
> > —
> > You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> > To unsubscribe send a blank email to $subst(‘Email.Unsub’)
> >
>
> —
> You are currently subscribed to ntfsd as: xxxxx@krdl.org.sg
> To unsubscribe send a blank email to $subst(‘Email.Unsub’)


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)

Hi,
This problem might be for the following reasons.

  1. Check out for the IRQL level at the receving
    thread.
    If it is > than PASSIVE_LEVEL then it can hang.
  2. Other might be the problem with the initialization
    the event object.Check for the event initialization.I
    think it might be an initialization issue.
    3.Might be the synchronization problem.This is a
    guess!!! like your receving thread which is
    sleeping(waiting) at the event to happen is not
    getting synchronised.Are your thread also acquiring
    any object lock before going to sleep.
    If it is acquring any lock while going to sleep(using
    KeWait…),then it might be the problem of your thread
    atomically waking and acquiring the lock.

Hope it helps.
Gurpreet

— Almas Khan wrote:
> Hi there,
>
> I am facing a big problem here, would appreciate if
> someone could help
> out.
>
> I have a filter driver for the FS. In this, I
> basically block the Irp
> and ask the TDI to do some network functions for
> me. The problem is
> that sometimes it works fine for a long time and
> sometimes it just hangs
> in the call to the TDI.
>
> The point it exactly hangs is when I have allocated
> an event (from
> non-paged pool) and passed it to the TDI, then I
> wait for the request to
> get over and the TDI to signal back, it is at this
> point that it just
> hangs. Meaning I just keep waiting in my
> KeWaitForSingleObject()
> routine.
>
> I have been trying to debug this thing for the past
> 1 week and cant get
> through.
>
> Any help is much appreciated,
>
> thanks in advance,
> Almas
>
>
> —
> You are currently subscribed to ntfsd as:
> xxxxx@yahoo.com
> To unsubscribe send a blank email to
> $subst(‘Email.Unsub’)
>

__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/

From where do I get the driver verifier?

Just for your info. I dont have the IFS kit, if you get the driver verifier
there.

thanks,
Almas

Jamey Kirby wrote:

Haave your tried it with Driver Verifier?

Just grasping at straws…

Jamey

> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of Almas Khan
> Sent: Sunday, May 07, 2000 1:05 AM
> To: File Systems Developers
> Subject: [ntfsd] RE: Problem with TDI
>
>
> Thanks for the reply!
>
> Yes I did check and it is at PASSIVE_LEVEL. I also take care that
> I dont call
> the TDI simultaneously.
>
> The biggest reason for my frustration is that it executes the
> same commands
> from the same place for some time and then it just hangs. I have
> looked at the
> resources that I allocate for it. The event etc are all local for
> that function
> (which does the actual TDI calling) and I deallocate whatever I
> have allocated
> within the function, so I dont think that it is running out of resources.
> Neither my completion routine gets called nor is this event set,
> so I am always
> in my wait.
>
> Almas
>
> Jamey Kirby wrote:
>
> > Are you in PASSIVE_MODE? Check. You can not call the
> KeWaitXxx() unless you
> > are at passive.
> >
> > Jamey
> >
> > > -----Original Message-----
> > > From: xxxxx@lists.osr.com
> > > [mailto:xxxxx@lists.osr.com]On Behalf Of Almas Khan
> > > Sent: Saturday, May 06, 2000 8:24 AM
> > > To: File Systems Developers
> > > Subject: [ntfsd] Problem with TDI
> > >
> > >
> > > Hi there,
> > >
> > > I am facing a big problem here, would appreciate if someone could help
> > > out.
> > >
> > > I have a filter driver for the FS. In this, I basically block the Irp
> > > and ask the TDI to do some network functions for me. The problem is
> > > that sometimes it works fine for a long time and sometimes it
> just hangs
> > > in the call to the TDI.
> > >
> > > The point it exactly hangs is when I have allocated an event (from
> > > non-paged pool) and passed it to the TDI, then I wait for the
> request to
> > > get over and the TDI to signal back, it is at this point that it just
> > > hangs. Meaning I just keep waiting in my KeWaitForSingleObject()
> > > routine.
> > >
> > > I have been trying to debug this thing for the past 1 week
> and cant get
> > > through.
> > >
> > > Any help is much appreciated,
> > >
> > > thanks in advance,
> > > Almas
> > >
> > >
> > > —
> > > You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> > > To unsubscribe send a blank email to $subst(‘Email.Unsub’)
> > >
> >
> > —
> > You are currently subscribed to ntfsd as: xxxxx@krdl.org.sg
> > To unsubscribe send a blank email to $subst(‘Email.Unsub’)
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to $subst(‘Email.Unsub’)
>


You are currently subscribed to ntfsd as: xxxxx@krdl.org.sg
To unsubscribe send a blank email to $subst(‘Email.Unsub’)

It is part of WIndows 2000.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Almas Khan
Sent: Monday, May 08, 2000 2:17 AM
To: File Systems Developers
Subject: [ntfsd] RE: Problem with TDI

From where do I get the driver verifier?

Just for your info. I dont have the IFS kit, if you get the
driver verifier
there.

thanks,
Almas

Jamey Kirby wrote:

> Haave your tried it with Driver Verifier?
>
> Just grasping at straws…
>
> Jamey
>
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com]On Behalf Of Almas Khan
> > Sent: Sunday, May 07, 2000 1:05 AM
> > To: File Systems Developers
> > Subject: [ntfsd] RE: Problem with TDI
> >
> >
> > Thanks for the reply!
> >
> > Yes I did check and it is at PASSIVE_LEVEL. I also take care that
> > I dont call
> > the TDI simultaneously.
> >
> > The biggest reason for my frustration is that it executes the
> > same commands
> > from the same place for some time and then it just hangs. I have
> > looked at the
> > resources that I allocate for it. The event etc are all local for
> > that function
> > (which does the actual TDI calling) and I deallocate whatever I
> > have allocated
> > within the function, so I dont think that it is running out
of resources.
> > Neither my completion routine gets called nor is this event set,
> > so I am always
> > in my wait.
> >
> > Almas
> >
> > Jamey Kirby wrote:
> >
> > > Are you in PASSIVE_MODE? Check. You can not call the
> > KeWaitXxx() unless you
> > > are at passive.
> > >
> > > Jamey
> > >
> > > > -----Original Message-----
> > > > From: xxxxx@lists.osr.com
> > > > [mailto:xxxxx@lists.osr.com]On Behalf Of Almas Khan
> > > > Sent: Saturday, May 06, 2000 8:24 AM
> > > > To: File Systems Developers
> > > > Subject: [ntfsd] Problem with TDI
> > > >
> > > >
> > > > Hi there,
> > > >
> > > > I am facing a big problem here, would appreciate if
someone could help
> > > > out.
> > > >
> > > > I have a filter driver for the FS. In this, I basically
block the Irp
> > > > and ask the TDI to do some network functions for me. The
problem is
> > > > that sometimes it works fine for a long time and sometimes it
> > just hangs
> > > > in the call to the TDI.
> > > >
> > > > The point it exactly hangs is when I have allocated an event (from
> > > > non-paged pool) and passed it to the TDI, then I wait for the
> > request to
> > > > get over and the TDI to signal back, it is at this point
that it just
> > > > hangs. Meaning I just keep waiting in my KeWaitForSingleObject()
> > > > routine.
> > > >
> > > > I have been trying to debug this thing for the past 1 week
> > and cant get
> > > > through.
> > > >
> > > > Any help is much appreciated,
> > > >
> > > > thanks in advance,
> > > > Almas
> > > >
> > > >
> > > > —
> > > > You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> > > > To unsubscribe send a blank email to
$subst(‘Email.Unsub’)
> > > >
> > >
> > > —
> > > You are currently subscribed to ntfsd as: xxxxx@krdl.org.sg
> > > To unsubscribe send a blank email to $subst(‘Email.Unsub’)
> >
> >
> > —
> > You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> > To unsubscribe send a blank email to $subst(‘Email.Unsub’)
> >
>
> —
> You are currently subscribed to ntfsd as: xxxxx@krdl.org.sg
> To unsubscribe send a blank email to $subst(‘Email.Unsub’)


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)

Strictly speaking, you can call KeWaitForSingleObject and
KeWaitForMultipleObjects at APC_LEVEL as well as PASSIVE_LEVEL. Note,
however, that if you are waiting for I/O completion, doing so at APC_LEVEL
is generally a bad idea, since it is the delivery of the APC that actually
sets the event - and at APC_LEVEL the APC cannot be delivered (and hence the
wait cannot be satisfied.)

This is a common problem when dealing with the TDI drivers, for instance -
you cannot normally call TDI at APC_LEVEL because if the IRP is posted there
is no way to process the I/O completion (which is finished in the original
thread context via an APC.)

The symptoms of such a call are exactly as you describe - the thread hangs
waiting for the event. The event cannot be signalled because the APC cannot
be delivered. The I/O, however, is done.

Regards,

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com

-----Original Message-----
From: Jamey Kirby [mailto:xxxxx@storagecraft.com]
Sent: Saturday, May 06, 2000 4:21 PM
To: File Systems Developers
Subject: [ntfsd] RE: Problem with TDI

Are you in PASSIVE_MODE? Check. You can not call the KeWaitXxx() unless you
are at passive.

Jamey

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Almas Khan
Sent: Saturday, May 06, 2000 8:24 AM
To: File Systems Developers
Subject: [ntfsd] Problem with TDI

Hi there,

I am facing a big problem here, would appreciate if someone could help
out.

I have a filter driver for the FS. In this, I basically block the Irp
and ask the TDI to do some network functions for me. The problem is
that sometimes it works fine for a long time and sometimes it just hangs
in the call to the TDI.

The point it exactly hangs is when I have allocated an event (from
non-paged pool) and passed it to the TDI, then I wait for the request to
get over and the TDI to signal back, it is at this point that it just
hangs. Meaning I just keep waiting in my KeWaitForSingleObject()
routine.

I have been trying to debug this thing for the past 1 week and cant get
through.

Any help is much appreciated,

thanks in advance,
Almas


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)


You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)

> however, that if you are waiting for I/O completion, doing so at APC_LEVEL

is generally a bad idea, since it is the delivery of the APC that actually
sets the event - and at APC_LEVEL the APC cannot be delivered (and hence
the
wait cannot be satisfied.)

Not necessary, this depends of mechanism of signaling IO completion one
uses.
IopCompleteRequest is blocked by APC_LEVEL - so, Irp->UserEvent will
not be signaled.
But if one registers a completion routine which will signal the event - than
all
is OK, because APC_LEVEL does not block the completion routines - it
blocks only the code which is executed after IRP stack will be unwound
completely.

Max