Re: TDI connection - weird behavior - PROBLEM UNDERST- OOD!.

It so happens that when opening file handles using the ‘ZwXxxFile()’
functions, you get a handle that is valid for the process that opened it
ONLY (completely WinNT related). Most TDI operations do not require this
handle. But for operations that require this handle -> like: the releasing
of the TDI Connection Object and the TDI Address Object (both require the
use of ‘ZwCloseFile()’), you need a valid handle -> which can only be that
same handle received from the same process that did the opening (getting:
the TDI Connection Object and the TDI Address Object in the first place).

Bottom line: You can’t have one process open a file using ‘ZwOpenFile()’ and
receive a handle, and then have another different process close
(ZwCloseFile) that file using the same handle.

Dashut Alon.

-----Original Message-----
From: javad_p [mailto:xxxxx@yahoo.com]
Sent: Sunday, August 05, 2001 12:30 PM
To: NT Developers Interest List
Subject: [ntdev] Re: TDI connection - weird behavior.

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: 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