Re[2]: HOW CAN I MAKE 2 CONECTION IN MINIFILTER THROUGH FltCreateCommunicationPort

I do not quite follow you in your explanation. Are you unable to
determine which thread is opening a port? Or are you having failures
when trying to open the port more than once?

Pete


Kernel Drivers
Windows File System and Device Driver Consulting
www.KernelDrivers.com http:</http:>
866.263.9295

------ Original Message ------
From: xxxxx@gmail.com
To: “Windows File Systems Devs Interest List”
Sent: 5/6/2015 1:10:42 AM
Subject: RE:[ntfsd] HOW CAN I MAKE 2 CONECTION IN MINIFILTER THROUGH
FltCreateCommunicationPort

>Hello Peter,
> Actually i’m not able to connect lpcontext of
>FilterConnectCommunicationPort() and context of CreateThread() how
>shall i make bith work togther.
>
>As you have told me to use different lpcontext to differentiate port
>connection of FilterConnectCommunicationPort() but am not able to link
>both beacuse my threads
>are doing context functionality so how can i join
>FilterConnectCommunicationPort() context with each thread context
>functionality.
>
>
>—
>NTFSD is sponsored by OSR
>
>OSR is hiring!! Info at http://www.osr.com/careers
>
>For our schedule of debugging and file system seminars visit:
>http://www.osr.com/seminars
>
>To unsubscribe, visit the List Server section of OSR Online at
>http://www.osronline.com/page.cfm?name=ListServer

Hi Vivek,

So basically you have multiple user mode clients (let’s call them “foo” and
“bar”) and you want your filter to know which one of these clients is
trying to connect. So you can pass in a pointer to “foo” from the foo
client and “bar” from the bar client. Now, in the driver you have your
callback for ConnectNotifyCallback() for your communication port and in
that callback you can check what the ConnectionContext is (should be either
“foo” or “bar”) and so you know who is connecting. Then you set up a
context structure and return a pointer to it as your ConnectionPortCookie
(could be anything that you need to know per client… you might not need to
differentiate between clients at this point so feel free to set the
ConnectionPortCookie to void) and then you’ll get that structure (the
cookie) in your DisconnectNotifyCallback and MessageNotifyCallback routines.

Does this make sense ?

Thanks,
Alex.

On Wed, May 6, 2015 at 12:10 AM, wrote:

> Hello Peter,
> Actually i’m not able to connect lpcontext of
> FilterConnectCommunicationPort() and context of CreateThread() how shall i
> make bith work togther.
>
> As you have told me to use different lpcontext to differentiate port
> connection of FilterConnectCommunicationPort() but am not able to link both
> beacuse my threads
> are doing context functionality so how can i join
> FilterConnectCommunicationPort() context with each thread context
> functionality.
>
>
> —
> NTFSD is sponsored by OSR
>
> OSR is hiring!! Info at http://www.osr.com/careers
>
> For our schedule of debugging and file system seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>