Something weird. From my test program I use a DeviceIoControl to open a
connection using TDI. Everything works fine - meaning, the connection is
established.
But when the DeviceIoControl ends, the connection closes - or rather - falls
down. The disconnection doesn’t go through any of my disconnect routines (or
the TdiDisconnect callback handler). So as long as the DeviceIoControl
hasn’t finished - say - I put a small sleep after the connection phase ->
then the connect stays.
I’ve tried a new approach: For the same DeviceIoControl, I created a system
thread (‘PsCreateSystemThread()’), and from this thread I connected to the
remote server. Although the thread terminated (by calling
‘PsTerminateSystemThread()’ at the end of the thread routine), the
connection STAYED open! and didn’t close -> like I wanted.
My question is: I don’t want to create a system thread for every connect
that I have to do. What’s wrong here? I have a feeling that this has to do
with ‘ZwCreateFile()’ since it might have a “context” problem between user
and kernel (thread), but I’m just guessing here. I use ‘ZwCreateFile()’ when
creating TDI’s “Address Object” and for creating TDI’s “Connection Object”.
Dashut Alon.
**************************************************************************************************
The contents of this email and any attachments are confidential.
It is intended for the named recipient(s) only.
If you have received this email in error please notify the system manager or the
sender immediately and do not disclose the contents to any one or make copies.
** Our security system’s scanned this email for viruses, vandals and malicious content
**
**************************************************************************************************
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
> and kernel (thread), but I’m just guessing here. I use ‘ZwCreateFile()’
when
creating TDI’s “Address Object” and for creating TDI’s “Connection
Object”.
Why not always call ZwCreateFile for TDI file objects from the system thread
using a work item?
I used this approach - worked fine.
Max
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
I missed the beginning of this message,
but I always like spinning off a new thread for each TDI call. Helps clear
up the thread context issues… If you are worried about the overhead of
creating and destroying threads, you could always create a “worker thread
queue.”
----- Original Message -----
From: “Maxim S. Shatskih”
To: “NT Developers Interest List”
Sent: Tuesday, July 31, 2001 11:52 AM
Subject: [ntdev] Re: TDI connection - weird behavior.
> > and kernel (thread), but I’m just guessing here. I use ‘ZwCreateFile()’
> when
> > creating TDI’s “Address Object” and for creating TDI’s “Connection
> Object”.
>
> Why not always call ZwCreateFile for TDI file objects from the system
thread
> using a work item?
> I used this approach - worked fine.
>
> Max
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@silcom.com
> 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
> I missed the beginning of this message,
but I always like spinning off a new thread for each TDI call. Helps clear
up the thread context issues… If you are worried about the overhead of
Thread context is irrelevant for all calls except the file object creations.
Max
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
Please send me your source for check.
-----Original Message-----
From: Alon Dashut
To: NT Developers Interest List
Date: ?á?á???, 11 ?ã??ì ?á?æáì, 1422 07:14 ???
Subject: [ntdev] TDI connection - weird behavior.
>Something weird. From my test program I use a DeviceIoControl to open a
>connection using TDI. Everything works fine - meaning, the connection is
>established.
>But when the DeviceIoControl ends, the connection closes - or rather -
falls
>down. The disconnection doesn’t go through any of my disconnect routines
(or
>the TdiDisconnect callback handler). So as long as the DeviceIoControl
>hasn’t finished - say - I put a small sleep after the connection phase ->
>then the connect stays.
>
>I’ve tried a new approach: For the same DeviceIoControl, I created a system
>thread (‘PsCreateSystemThread()’), and from this thread I connected to the
>remote server. Although the thread terminated (by calling
>‘PsTerminateSystemThread()’ at the end of the thread routine), the
>connection STAYED open! and didn’t close -> like I wanted.
>
>My question is: I don’t want to create a system thread for every connect
>that I have to do. What’s wrong here? I have a feeling that this has to do
>with ‘ZwCreateFile()’ since it might have a “context” problem between user
>and kernel (thread), but I’m just guessing here. I use ‘ZwCreateFile()’
when
>creating TDI’s “Address Object” and for creating TDI’s “Connection
Object”.
>
> Dashut Alon.
> ****************************************************
>The contents of this email and any attachments are confidential.
>It is intended for the named recipient(s) only.
>If you have received this email in error please notify the system manager
or the
>sender immediately and do not disclose the contents to any one or make
copies.
>
> Our security system’s scanned this email for viruses, vandals and
malicious content
>
> ****************************************************
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@yahoo.com
>To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.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