network redirector - integration with user mode service

I’m still getting my head around IFS development, so forgive me for
what could quite possibly be an inane question.

I am attempting to write a network redirector will transport over
tcp/ip as to redirect a ftp like protocol into a mapped volume. I’d
like to know if there was a good way to put a bulk of the
transaction/networking code into a user mode service that is in some
way “callable” by the driver. I know there are ways to communicate
between kernel->user mode using events and whatnot - but my question
is more “is this ia good idea.” It would certainly save me a lot of
trouble if I could code all the relatively complex network code in
user space and be able to call up from the driver. I have seen
projects do something similar to this using a CIFS loopback server
(i.e. pc-afs), but I’d like to avoid implementing a CIFS server and
then just translating the calls. I’m just an independent dev doing
this for a learning experience and attempting to make something cool,
so I’m not put off by what i know will be a very hard task. More than
anything i’d like to learn how this is done, and do it the “Right” way
without doing way more work than necessary (like translating a big
networking library that uses sockets into TDI calls if I don’t need
to).

Thanks.
-Jeff

Well there are a couple of sockets libraries for the kernel if you can
afford them. You might take a look at OSR’s KSOCKS
http://www.osr.com/toolkits_ksocks.shtml or StorageCraft’s KSockets
http://www.storagecraft.com/products/ksockets.html.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting

“Jeff Mancuso” wrote in message news:xxxxx@ntfsd…
> I’m still getting my head around IFS development, so forgive me for
> what could quite possibly be an inane question.
>
> I am attempting to write a network redirector will transport over
> tcp/ip as to redirect a ftp like protocol into a mapped volume. I’d
> like to know if there was a good way to put a bulk of the
> transaction/networking code into a user mode service that is in some
> way “callable” by the driver. I know there are ways to communicate
> between kernel->user mode using events and whatnot - but my question
> is more “is this ia good idea.” It would certainly save me a lot of
> trouble if I could code all the relatively complex network code in
> user space and be able to call up from the driver. I have seen
> projects do something similar to this using a CIFS loopback server
> (i.e. pc-afs), but I’d like to avoid implementing a CIFS server and
> then just translating the calls. I’m just an independent dev doing
> this for a learning experience and attempting to make something cool,
> so I’m not put off by what i know will be a very hard task. More than
> anything i’d like to learn how this is done, and do it the “Right” way
> without doing way more work than necessary (like translating a big
> networking library that uses sockets into TDI calls if I don’t need
> to).
>
> Thanks.
> -Jeff
>

I have seen those – but I’m more interested in a solution that
doesn’t require any 3rd party libs.

Any comments on general interaction between kernel->user mode being an
appropriate/inappropiate method would be useful.

Thanks.
-Jeff

On Thu, 15 Jul 2004 16:21:21 -0400, Don Burn wrote:
> Well there are a couple of sockets libraries for the kernel if you can
> afford them. You might take a look at OSR’s KSOCKS
> http://www.osr.com/toolkits_ksocks.shtml or StorageCraft’s KSockets
> http://www.storagecraft.com/products/ksockets.html.
>
> –
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
>
> “Jeff Mancuso” wrote in message news:xxxxx@ntfsd…
>
>
> > I’m still getting my head around IFS development, so forgive me for
> > what could quite possibly be an inane question.
> >
> > I am attempting to write a network redirector will transport over
> > tcp/ip as to redirect a ftp like protocol into a mapped volume. I’d
> > like to know if there was a good way to put a bulk of the
> > transaction/networking code into a user mode service that is in some
> > way “callable” by the driver. I know there are ways to communicate
> > between kernel->user mode using events and whatnot - but my question
> > is more “is this ia good idea.” It would certainly save me a lot of
> > trouble if I could code all the relatively complex network code in
> > user space and be able to call up from the driver. I have seen
> > projects do something similar to this using a CIFS loopback server
> > (i.e. pc-afs), but I’d like to avoid implementing a CIFS server and
> > then just translating the calls. I’m just an independent dev doing
> > this for a learning experience and attempting to make something cool,
> > so I’m not put off by what i know will be a very hard task. More than
> > anything i’d like to learn how this is done, and do it the “Right” way
> > without doing way more work than necessary (like translating a big
> > networking library that uses sockets into TDI calls if I don’t need
> > to).
> >
> > Thanks.
> > -Jeff
> >
>
>
> —
> Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@gmail.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

> Any comments on general interaction between kernel->user mode

being an
appropriate/inappropiate method would be useful.

You may use LPC - this facility is well usable for connecting
between kernel and user mode, for two kernel modes or for two
user modes as well. However, LPC is not documented, you have to
find the necessary function prototypes and usages.

Look for NtConnectPort/ZwConnectPort function, maybe you can find
something which helps you.

About the usage - LPC is often used by the NT kernel itself (e.g.
EFS uses it for contacting LSASS and decrypting files), so
although undocumented, I think you may use it until MS does not
create a completely new kernel (which would require new drivers
anyway).

L.


Hrajte s n?mi o 1000 K? ka?d? den! P?ipojte se p?es VOLN? a
tipujte teplotu na vybran?m m?st? v ?esk? republice. U?ijte si
l?to s VOLN? na str?nk?ch http://soutez.volny.cz.

> About the usage - LPC is often used by the NT kernel itself (e.g.

EFS uses it for contacting LSASS and decrypting files),

More so.

Se Rm code in the kernel uses LPC to communicate the logoff and audit events to
LSA.

SRV uses KSECDD for CHAP crypto, which communicates to user-mode LSA.
RDR/MRXSMB uses the same KSECDD and again for CHAP crypto, which also
communicates to user-mode LSA for the operations which involve the current
user’s password.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

The process debugging uses LPC too. There may be more examples of
it, maybe not necessary to enumerate them all. I think this is
strong reason enough saying that if you can find the LPC function
prototypes, you can use them.

L.


Nejlevnejsi nabidka vysokorychlostniho internetu ADSL na trhu!
VOLNY ADSL 512/128kbit/s. Jiz za 549Kc bez DPH mesicne! Vice na
http://adsl.volny.cz