[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.sdk

how to write a "hard drive" driver

Lloyd Dupont

11/3/2003 12:52:00 AM

I'm writting a C# network application, which could expose its data as a file
system.
I was thinking to have one back-end which would install itself as a
hard-drive on the client's computer, I would host the .NET runtime in my
driver, which has to be written in C, I suppose ?

could some one gives me some direction on how to implement the driver ?
I mean which function should I implement ?
which function should I look in the MSDN library to find some usefull
documentation ?
any tip, which would get me started on this ?
how to install it later on ?


8 Answers

Maxim S. Shatskih

11/3/2003 1:20:00 AM

0

> I'm writting a C# network application, which could expose its data as a file
> system.
> I was thinking to have one back-end which would install itself as a
> hard-drive on the client's computer, I would host the .NET runtime in my
> driver, which has to be written in C, I suppose ?

Forget-forget-forget about hosting the .NET runtime in the kernel :-)

Write a helper user service is C, which will host the .NET runtime and call the
necessary methods from there.

The driver will also be necessary, for instance, here at SCI we have such a
framework for sale.

Without purchasing the pre-created packages, you will end with at least 6
months of coding and debugging the file system driver.

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


Ivan Brugiolo [MS]

11/3/2003 1:26:00 AM

0

> I was thinking to have one back-end which would install itself as a
> hard-drive on the client's computer, I would host the .NET runtime in my
> driver, which has to be written in C, I suppose ?

There is no supported way to host the CLR Runtime
(mscoree.dll / mscorwks.dll / mscorlib.dll) in a device driver,
being it a file system driver or any other driver.

if you want to build a file system driver with a network "back-end",
such as it's already done today with DFS and the CIFS in
Windows(NT/2000/XP/2003)
you may want to consider purchasing the IFS Kit.
BTW, I don't expect the file system driver to take less than a year to
build,
given the overall level of familiarity you seem to have with the system.
Getting something CLR-ish to integrate with your file system driver may be
a complete challenge on it's own, since you will have to bridge
an application hosting the runtime with your driver.

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cp...


Kirk Ferdmann

11/3/2003 1:43:00 AM

0

"Lloyd Dupont" <net.galador@ld> wrote in message
news:u27CkSaoDHA.1632@TK2MSFTNGP10.phx.gbl...
> I'm writting a C# network application, which could expose its data as a
file
> system.
> I was thinking to have one back-end which would install itself as a
> hard-drive on the client's computer, I would host the .NET runtime in my
> driver, which has to be written in C, I suppose ?

It don't think it's feasible given all the dependencies on things that are
not available in kernel mode.

> could some one gives me some direction on how to implement the driver ?

Since you're talking about FS driver you will have to start by getting
yourself a copy of IFS kit (cost about $1000). Documentation is included in
the kit. This will take you a few man-years to get implemented.

Alternatively consider using shell namespace extensions. They are documented
in MSDN. And being completely user-mode beast they should integrate with
..NET fairly easy. Not to mention that they are much easier to implement.

-Kirk


Lloyd Dupont

11/3/2003 2:16:00 AM

0

Well, reading all of you writing a file system driver seems to be quite a
daunting task.
this being a personnal project I plan to release commercially one day, I
think I will postpone the "hard-drive" back end.

2 question remaining though:
- about this shell extension, could you give me one function name, I could
start search for ?
- How could it be that writting a driver is so hard ?
I just want to provide a bunch of function, I would guess about ten ?
the 4 basic C file IO function (open(), close(), read() write()) and maybe a
a few others ...

integrate won't be hard, I could always having 2 process which talk through
socket/pipe/shared memory ...

"Kirk Ferdmann" <kirk_ferdmann@nospam.hotmail.com> wrote in message
news:0bidnffH1skZLDiiRVn-sA@comcast.com...
> "Lloyd Dupont" <net.galador@ld> wrote in message
> news:u27CkSaoDHA.1632@TK2MSFTNGP10.phx.gbl...
> > I'm writting a C# network application, which could expose its data as a
> file
> > system.
> > I was thinking to have one back-end which would install itself as a
> > hard-drive on the client's computer, I would host the .NET runtime in my
> > driver, which has to be written in C, I suppose ?
>
> It don't think it's feasible given all the dependencies on things that are
> not available in kernel mode.
>
> > could some one gives me some direction on how to implement the driver ?
>
> Since you're talking about FS driver you will have to start by getting
> yourself a copy of IFS kit (cost about $1000). Documentation is included
in
> the kit. This will take you a few man-years to get implemented.
>
> Alternatively consider using shell namespace extensions. They are
documented
> in MSDN. And being completely user-mode beast they should integrate with
> .NET fairly easy. Not to mention that they are much easier to implement.
>
> -Kirk
>
>


Lloyd Dupont

11/3/2003 2:49:00 AM

0

oh...
great ...
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xpehelp/html/_component_shell_namespace_exte...

shell namespace extension seems the way to go.
thanks for that ;-)

"Kirk Ferdmann" <kirk_ferdmann@nospam.hotmail.com> wrote in message
news:0bidnffH1skZLDiiRVn-sA@comcast.com...
> "Lloyd Dupont" <net.galador@ld> wrote in message
> news:u27CkSaoDHA.1632@TK2MSFTNGP10.phx.gbl...
> > I'm writting a C# network application, which could expose its data as a
> file
> > system.
> > I was thinking to have one back-end which would install itself as a
> > hard-drive on the client's computer, I would host the .NET runtime in my
> > driver, which has to be written in C, I suppose ?
>
> It don't think it's feasible given all the dependencies on things that are
> not available in kernel mode.
>
> > could some one gives me some direction on how to implement the driver ?
>
> Since you're talking about FS driver you will have to start by getting
> yourself a copy of IFS kit (cost about $1000). Documentation is included
in
> the kit. This will take you a few man-years to get implemented.
>
> Alternatively consider using shell namespace extensions. They are
documented
> in MSDN. And being completely user-mode beast they should integrate with
> .NET fairly easy. Not to mention that they are much easier to implement.
>
> -Kirk
>
>


Kirk Ferdmann

11/3/2003 2:59:00 AM

0

"Lloyd Dupont" <net.galador@ld> wrote in message
news:OMbVTBboDHA.392@TK2MSFTNGP11.phx.gbl...
> 2 question remaining though:
> - about this shell extension, could you give me one function name, I could
> start search for ?

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/programmersguide/shell_adv/namespaceextension/nam...

> - How could it be that writting a driver is so hard ?
> I just want to provide a bunch of function, I would guess about ten ?
> the 4 basic C file IO function (open(), close(), read() write()) and maybe
a
> a few others ...

A driver is not something that exists in total isolation. Those
open/close/read/write communicate to the OS not to the driver directly. So
you have to play by the rules of the OS inside your driver. Those rules for
FSDs are rather complex. Besides the subject is barely documented outside of
IFS kit.

-Kirk


Lloyd Dupont

11/3/2003 4:13:00 AM

0

thanks for that ;-)

"Kirk Ferdmann" <kirk_ferdmann@nospam.hotmail.com> wrote in message
news:98mdnTXXvYT2XjiiRVn-iA@comcast.com...
> "Lloyd Dupont" <net.galador@ld> wrote in message
> news:OMbVTBboDHA.392@TK2MSFTNGP11.phx.gbl...
> > 2 question remaining though:
> > - about this shell extension, could you give me one function name, I
could
> > start search for ?
>
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/programmersguide/shell_adv/namespaceextension/nam...
>
> > - How could it be that writting a driver is so hard ?
> > I just want to provide a bunch of function, I would guess about ten ?
> > the 4 basic C file IO function (open(), close(), read() write()) and
maybe
> a
> > a few others ...
>
> A driver is not something that exists in total isolation. Those
> open/close/read/write communicate to the OS not to the driver directly. So
> you have to play by the rules of the OS inside your driver. Those rules
for
> FSDs are rather complex. Besides the subject is barely documented outside
of
> IFS kit.
>
> -Kirk
>
>


Paul Russell

11/3/2003 10:19:00 AM

0

You should take a peek at the DDK and there is plenty of materials out there
on IFS to do the work. But unless you understand kernel concepts and
principles you will end up taking quite a bit of time and be unsatisfied
with the results.

--

Paul.


"Lloyd Dupont" <net.galador@ld> wrote in message
news:OMbVTBboDHA.392@TK2MSFTNGP11.phx.gbl...
> Well, reading all of you writing a file system driver seems to be quite a
> daunting task.
> this being a personnal project I plan to release commercially one day, I
> think I will postpone the "hard-drive" back end.
>
> 2 question remaining though:
> - about this shell extension, could you give me one function name, I could
> start search for ?
> - How could it be that writting a driver is so hard ?
> I just want to provide a bunch of function, I would guess about ten ?
> the 4 basic C file IO function (open(), close(), read() write()) and maybe
a
> a few others ...
>
> integrate won't be hard, I could always having 2 process which talk
through
> socket/pipe/shared memory ...
>
> "Kirk Ferdmann" <kirk_ferdmann@nospam.hotmail.com> wrote in message
> news:0bidnffH1skZLDiiRVn-sA@comcast.com...
> > "Lloyd Dupont" <net.galador@ld> wrote in message
> > news:u27CkSaoDHA.1632@TK2MSFTNGP10.phx.gbl...
> > > I'm writting a C# network application, which could expose its data as
a
> > file
> > > system.
> > > I was thinking to have one back-end which would install itself as a
> > > hard-drive on the client's computer, I would host the .NET runtime in
my
> > > driver, which has to be written in C, I suppose ?
> >
> > It don't think it's feasible given all the dependencies on things that
are
> > not available in kernel mode.
> >
> > > could some one gives me some direction on how to implement the driver
?
> >
> > Since you're talking about FS driver you will have to start by getting
> > yourself a copy of IFS kit (cost about $1000). Documentation is included
> in
> > the kit. This will take you a few man-years to get implemented.
> >
> > Alternatively consider using shell namespace extensions. They are
> documented
> > in MSDN. And being completely user-mode beast they should integrate with
> > .NET fairly easy. Not to mention that they are much easier to implement.
> >
> > -Kirk
> >
> >
>
>