From: Mark S. Edwards [marke@muttsnuts.com] Sent: Thursday, October 26, 2000 12:34 PM To: NT Developers Interest List Subject: [ntdev] Re: TDI Question Justin, It's a long time since I did a TDI filter, so my memory is a bit rusty. But I created my own context which included storage to save the upper level context passed down to me and the address of the upper event handler. I then created my own receive event handler for the lower layer and passed my own context pointer in. When the handler triggered I could retrieve the upper level context from my own context record and proceed with the receive. If the upper level decides to follow this up with an Irp to retrieve the data, it becomes a multi-phase sequence that more or less requires your own intermediate context to store all the relevant information. HTH, Mark At 09:18 26/10/2000 -0700, justin white wrote: >Thank you very much for the assistance, > >When you receive an event notification, there are two context values >received with it. > >The one context (known as the TdiEventContext in the MSDN) is used to >store information specific for that event, as setup by the client. > >The other context (Known as the ConnectionContext in the MSDN) is supposed >to be the Connection Context which was created by a previous call to >ZwCreateFile in order to create a connection endpoint. This context value >(or FileObject) is then supposed to be passed to the ClientEventHandlers, >so that the Clients can recognize that particular connection. > >The ConnectionContext is however merely passed as a type >CONNECTION_CONTEXT to the event handlers, which is defined as a type >PVOID. My question is therefore, what does this ConnectionContext mean to >the client, and how can i use it to associate this Event Handler with a >particular connection endpoint. Perhaps I am looking at the inappropriate >variables, but this seems to be the only one relating back to the original >connection end-point. > >Essentially, what I am attempting to do is associate the address and >connection end-point so that I can establish on-the-fly (in the Receive >handler) what received data is associated with what transmitted data on an >valid 'connection'. > >Thanks in advance >Justin. > > > > > > Thanks, > > I have found that the TDI filtering is quite messy. I also save the > original address object in my event handler and so can easily get to it > when my event is called. Unfortunately the ConnectionContext receive in > the call does not correlate to any other context I 'see' previously (like > from a TDI_CONNECT for instance). This also leads to my next question, > why is TDI_ASSOCIATE_ADDRESS not always called. According to the TDI > spec, it should be called. > > > > On Thu, 26 October 2000, "Thomas F. Divine" wrote: > > > > > > > > Justin, > > > > > > Unfortunately, filtering TDI is fairly messy. In addition, there are no > > > standard reference samples that we can talk to. PCAUSA licenses some, but > > > that doesn't help you. > > > > > > From reading your previous messages it appears that at least one of your > > > problems seems to be how to relate the ConnectionContext in an Event > > > callback to something meaningful. > > > > > > The steps that work for us include: > > > > > > 1.) Filter creation of address objects. Create a structure in the TDI > filter > > > to track each created address object. > > > 2.) Filter SetEvent calls on each address object. In this filter we > save the > > > original caller's EventHandler and EventContext and replace both with our > > > own proxies. This info is saved in our address object tracking structure. > > > 3.) When an event callback is made it goes to our hook. There we > lookup our > > > proxy EventContext to find the unfiltered EventContext, the unfiltered > > > EventHandler and, or course, the address object. > > > > > > Hope this helps a little. > > > > > > Regards, > > > > > > Thomas F. Divine > > > > > > PCAUSA - Toolkits & Resources For Network Software Developers > > > NDIS Protocol - TDI Client - Windows 95 Redirector > > > > > > > > > ----- Original Message ----- > > > From: justin white > > > To: NT Developers Interest List > > > Sent: Thursday, October 26, 2000 3:39 AM > > > Subject: [ntdev] TDI Question > > > > > > > > > > Hi All, > > > > > > > > Please can someone give me some information on how to associate the > > > Address File Object and the Connection Endpoint file Object, which are > > > created when a connection is requested at the TDI layer. I am not > building a > > > snoop or anything of the sort but need to be able to intercept data > at the > > > tdi level. > > > > > > > > your help would really be appreciated. > > > > > > > > Thanks > > > > Justin > > > > > > > > > > > > > > > > > > > --- > > > You are currently subscribed to ntdev as: > justinmarkwhite.com@namezero.com > > > To unsubscribe send a blank email to leave-ntdev-247T@lists.osr.com > > > > > > _______________________________________ > > Click here to get your free domain name > > and personal portal from NAMEzero(TM): > > http://www.namezero.com > > > > --- > > You are currently subscribed to ntdev as: justinmarkwhite.com@namezero.com > > To unsubscribe send a blank email to leave-ntdev-247T@lists.osr.com > > >_______________________________________ >Click here to get your free domain name >and personal portal from NAMEzero(TM): >http://www.namezero.com > >--- >You are currently subscribed to ntdev as: marke@muttsnuts.com >To unsubscribe send a blank email to leave-ntdev-247T@lists.osr.com --- You are currently subscribed to ntdev as: GlennEverhart@FirstUSA.com To unsubscribe send a blank email to leave-ntdev-247T@lists.osr.com