It must have been something to do with a KEVENT object that I used
in the system thread that caused the connection to stay open. Now that I
ONLY connected in the system thread (no KEVENT in it) -> then when the
system thread terminated -> the connection closed… (not that I wanted it
to close, meaning that I would expect it to stay open until I send a close
command).
Any help would be appreciated, Dashut Alon.
-----Original Message-----
From: Alon Dashut [mailto:xxxxx@AppStream.co.il]
Sent: Tuesday, July 31, 2001 5:36 PM
To: NT Developers Interest List
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@AppStream.co.il
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