Q: Problem with HelloWorld-file system driver

Hello there!

I (still) have a problem to get my “Hello World”-file system driver up and
running. Slowly I’m turning mad. Any help would be greatly appreciated.

Here is what I did:

Create device as FILE_DEVICE_FILE_SYSTEM. Symbolic link “M:” to this device
(visible in explorer and dos prompt). Cache manager callbacks prepared (I
do not yet use cache manager, I don’t call any functions), Fast Io stuff
initialized (only to return FastIoIsNotPossible). Basic stuff is
implemented (create, read, cleanup, close, directory control, some queries,
…). “dir” works. I can even back up my single file with Win2000-backup.

What I CAN do is: CreateFile( M:\HelloWorld ); ReadFile(); CloseHandle() ->
contents can be read without problems. Same with “more M:HelloWorld”.

What I CANNOT do is: “more < M:HelloWorld” (input redirection). [After a
CREATE of the root directory, directly followed by CLEANUP and CLOSE] I
just get an IRP_MJ_CREATE (FileOnlyRequested=TRUE) for the file
“HelloWorld”. FCB is created, cleared, CommonFCBHeader/Resource and
PagingIoResource is pointing to new eresources, IsFastIoPossible is set to
FastIoIsQuestionable. CCB is created. status=STATUS_SUCCESS, info=1
(FILE_OPENED). pIrp->IoStatus is updated, IRP completed, success returned.
And this is all that happens. After I close the command shell (cmd.exe), I
receive the cleanup and close requests for HelloWorld.

I just don’t understand what is going on. If there would be at least a
crash or an error message. But I get nothing. I’m sure I forgot something,
but I have not the slightest idea what this could be. I’m sure there are
people out there who did a “hello world” file system driver (well, that’s
what everyone does with every new language or system), so I desperately
hope that my problem sounds familiar to someone…

Regards,
Michael

PS: I have played with the type and characteristics. After changing
FILE_DEVICE_FILE_SYSTEM to FILE_DEVICE_NETWORK_FILE_SYSTEM, I could display
the contents of my file with “type M:HelloWorld” which did not work before
the change. This doesn’t make any sense, does it?

PPS: Maybe I need to create a virtual disk (ram disk) that my file system
driver can mount? I thought that I do not need such a thing, because the
driver I’m trying to plan/develop is not physical disk based…

When you say

“Fast Io stuff initialized (only to return FastIoIsNotPossible)”

Do you mean you are failing the FastIO entry points with some failure
code, such as STATUS_UNSUCCESSFUL? Thus the system is sending a ‘normal’
Irp based request?

Also, are you setting up your SectionObject pointers within your create
routine?

Pete

Peter Scott
xxxxx@KernelDrivers.com
http://www.KernelDrivers.com

>-----Original Message-----
>From: xxxxx@lists.osr.com [mailto:bounce-ntfsd-
>xxxxx@lists.osr.com] On Behalf Of xxxxx@vogon.de
>Sent: Tuesday, August 13, 2002 4:16 AM
>To: File Systems Developers
>Subject: [ntfsd] Q: Problem with HelloWorld-file system driver
>
>
>Hello there!
>
>I (still) have a problem to get my “Hello World”-file system driver up
and
>running. Slowly I’m turning mad. Any help would be greatly
appreciated.
>
>
>Here is what I did:
>
>Create device as FILE_DEVICE_FILE_SYSTEM. Symbolic link “M:” to this
>device
>(visible in explorer and dos prompt). Cache manager callbacks prepared
(I
>do not yet use cache manager, I don’t call any functions), Fast Io
stuff
>initialized (only to return FastIoIsNotPossible). Basic stuff is
>implemented (create, read, cleanup, close, directory control, some
>queries,
>…). “dir” works. I can even back up my single file with
Win2000-backup.
>
>What I CAN do is: CreateFile( M:\HelloWorld ); ReadFile();
CloseHandle() -
>>
>contents can be read without problems. Same with “more M:HelloWorld”.
>
>What I CANNOT do is: “more < M:HelloWorld” (input redirection). [After
a
>CREATE of the root directory, directly followed by CLEANUP and CLOSE]
I
>just get an IRP_MJ_CREATE (FileOnlyRequested=TRUE) for the file
>“HelloWorld”. FCB is created, cleared, CommonFCBHeader/Resource and
>PagingIoResource is pointing to new eresources, IsFastIoPossible is
set to
>FastIoIsQuestionable. CCB is created. status=STATUS_SUCCESS, info=1
>(FILE_OPENED). pIrp->IoStatus is updated, IRP completed, success
returned.
>And this is all that happens. After I close the command shell
(cmd.exe), I
>receive the cleanup and close requests for HelloWorld.
>
>I just don’t understand what is going on. If there would be at least a
>crash or an error message. But I get nothing. I’m sure I forgot
something,
>but I have not the slightest idea what this could be. I’m sure there
are
>people out there who did a “hello world” file system driver (well,
that’s
>what everyone does with every new language or system), so I
desperately
>hope that my problem sounds familiar to someone…
>
>Regards,
>Michael
>
>
>PS: I have played with the type and characteristics. After changing
>FILE_DEVICE_FILE_SYSTEM to FILE_DEVICE_NETWORK_FILE_SYSTEM, I could
>display
>the contents of my file with “type M:HelloWorld” which did not work
before
>the change. This doesn’t make any sense, does it?
>
>PPS: Maybe I need to create a virtual disk (ram disk) that my file
system
>driver can mount? I thought that I do not need such a thing, because
the
>driver I’m trying to plan/develop is not physical disk based…
>
>
>
>
>
>—
>You are currently subscribed to ntfsd as: xxxxx@KernelDrivers.com
>To unsubscribe send a blank email to %%email.unsub%%

FILE_DEVICE_FILE_SYSTEM will not mount. It needs to be one of the other
types like FILE_DEVICE_DISK_FILE_SYSTEM. FILE_DEVICE_FILE_SYSTEM is not
part of the mount queue and you mounthandler will notbe called.

Jamey

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@vogon.de
Sent: Tuesday, August 13, 2002 3:16 AM
To: File Systems Developers
Subject: [ntfsd] Q: Problem with HelloWorld-file system driver

Hello there!

I (still) have a problem to get my “Hello World”-file system driver up
and
running. Slowly I’m turning mad. Any help would be greatly appreciated.

Here is what I did:

Create device as FILE_DEVICE_FILE_SYSTEM. Symbolic link “M:” to this
device
(visible in explorer and dos prompt). Cache manager callbacks prepared
(I
do not yet use cache manager, I don’t call any functions), Fast Io stuff
initialized (only to return FastIoIsNotPossible). Basic stuff is
implemented (create, read, cleanup, close, directory control, some
queries,
…). “dir” works. I can even back up my single file with
Win2000-backup.

What I CAN do is: CreateFile( M:\HelloWorld ); ReadFile(); CloseHandle()
->
contents can be read without problems. Same with “more M:HelloWorld”.

What I CANNOT do is: “more < M:HelloWorld” (input redirection). [After a
CREATE of the root directory, directly followed by CLEANUP and CLOSE] I
just get an IRP_MJ_CREATE (FileOnlyRequested=TRUE) for the file
“HelloWorld”. FCB is created, cleared, CommonFCBHeader/Resource and
PagingIoResource is pointing to new eresources, IsFastIoPossible is set
to
FastIoIsQuestionable. CCB is created. status=STATUS_SUCCESS, info=1
(FILE_OPENED). pIrp->IoStatus is updated, IRP completed, success
returned.
And this is all that happens. After I close the command shell (cmd.exe),
I
receive the cleanup and close requests for HelloWorld.

I just don’t understand what is going on. If there would be at least a
crash or an error message. But I get nothing. I’m sure I forgot
something,
but I have not the slightest idea what this could be. I’m sure there are
people out there who did a “hello world” file system driver (well,
that’s
what everyone does with every new language or system), so I desperately
hope that my problem sounds familiar to someone…

Regards,
Michael

PS: I have played with the type and characteristics. After changing
FILE_DEVICE_FILE_SYSTEM to FILE_DEVICE_NETWORK_FILE_SYSTEM, I could
display
the contents of my file with “type M:HelloWorld” which did not work
before
the change. This doesn’t make any sense, does it?

PPS: Maybe I need to create a virtual disk (ram disk) that my file
system
driver can mount? I thought that I do not need such a thing, because the
driver I’m trying to plan/develop is not physical disk based…


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to %%email.unsub%%

As far as I remember :slight_smile:

Jamey

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jamey Kirby
Sent: Tuesday, August 13, 2002 9:18 AM
To: File Systems Developers
Subject: [ntfsd] RE: Q: Problem with HelloWorld-file system driver

FILE_DEVICE_FILE_SYSTEM will not mount. It needs to be one of the other
types like FILE_DEVICE_DISK_FILE_SYSTEM. FILE_DEVICE_FILE_SYSTEM is not
part of the mount queue and you mounthandler will notbe called.

Jamey

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@vogon.de
Sent: Tuesday, August 13, 2002 3:16 AM
To: File Systems Developers
Subject: [ntfsd] Q: Problem with HelloWorld-file system driver

Hello there!

I (still) have a problem to get my “Hello World”-file system driver up
and
running. Slowly I’m turning mad. Any help would be greatly appreciated.

Here is what I did:

Create device as FILE_DEVICE_FILE_SYSTEM. Symbolic link “M:” to this
device
(visible in explorer and dos prompt). Cache manager callbacks prepared
(I
do not yet use cache manager, I don’t call any functions), Fast Io stuff
initialized (only to return FastIoIsNotPossible). Basic stuff is
implemented (create, read, cleanup, close, directory control, some
queries,
…). “dir” works. I can even back up my single file with
Win2000-backup.

What I CAN do is: CreateFile( M:\HelloWorld ); ReadFile(); CloseHandle()
->
contents can be read without problems. Same with “more M:HelloWorld”.

What I CANNOT do is: “more < M:HelloWorld” (input redirection). [After a
CREATE of the root directory, directly followed by CLEANUP and CLOSE] I
just get an IRP_MJ_CREATE (FileOnlyRequested=TRUE) for the file
“HelloWorld”. FCB is created, cleared, CommonFCBHeader/Resource and
PagingIoResource is pointing to new eresources, IsFastIoPossible is set
to
FastIoIsQuestionable. CCB is created. status=STATUS_SUCCESS, info=1
(FILE_OPENED). pIrp->IoStatus is updated, IRP completed, success
returned.
And this is all that happens. After I close the command shell (cmd.exe),
I
receive the cleanup and close requests for HelloWorld.

I just don’t understand what is going on. If there would be at least a
crash or an error message. But I get nothing. I’m sure I forgot
something,
but I have not the slightest idea what this could be. I’m sure there are
people out there who did a “hello world” file system driver (well,
that’s
what everyone does with every new language or system), so I desperately
hope that my problem sounds familiar to someone…

Regards,
Michael

PS: I have played with the type and characteristics. After changing
FILE_DEVICE_FILE_SYSTEM to FILE_DEVICE_NETWORK_FILE_SYSTEM, I could
display
the contents of my file with “type M:HelloWorld” which did not work
before
the change. This doesn’t make any sense, does it?

PPS: Maybe I need to create a virtual disk (ram disk) that my file
system
driver can mount? I thought that I do not need such a thing, because the
driver I’m trying to plan/develop is not physical disk based…


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to %%email.unsub%%

> Do you mean you are failing the FastIO entry points with some
failure

code, such as STATUS_UNSUCCESSFUL? Thus the system is sending a
‘normal’
Irp based request?

Just return FALSE from StartIo routines for this effect. No need of
filling the IO status block.

Max

Sorry, I meant a FALSE from the Fast IO entry points.

Pete

Peter Scott
xxxxx@KernelDrivers.com
http://www.KernelDrivers.com

>-----Original Message-----
>From: xxxxx@lists.osr.com [mailto:bounce-ntfsd-
>xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
>Sent: Tuesday, August 13, 2002 12:54 PM
>To: File Systems Developers
>Subject: [ntfsd] RE: Q: Problem with HelloWorld-file system driver
>
>> Do you mean you are failing the FastIO entry points with some
>failure
>> code, such as STATUS_UNSUCCESSFUL? Thus the system is sending a
>‘normal’
>> Irp based request?
>
>Just return FALSE from StartIo routines for this effect. No need of
>filling the IO status block.
>
> Max
>
>
>
>
>—
>You are currently subscribed to ntfsd as: xxxxx@KernelDrivers.com
>To unsubscribe send a blank email to %%email.unsub%%

Hello there!

(Sorry, it took me some time to read and check everything. I’m quite busy
with my normal work here… Thanks for the replies!)

-> Jamey:

So FILE_DEVICE_FILE_SYSTEM is the one I really need, since I do not really
want to mount on some device. I just thought that maybe I have to create a
dummy device to mount on, but probably my problem is hidden somewhere
else…

-> Max:

“StartIo”? Oh, I have never used this before, even in my V0.99
beta-nearly-completed-but-working-nonetheless-device driver :-)…

-> Pete +Max:

In VfsFastIoCheckIfPossible() I just return FALSE, just in case it ever
gets called. I receive normal IRP’s. (My problems lie somewhere in between
the IRP’s that I get…)

-> Pete:

SectionObject pointers? Yes, sur…erm…oops… minimum> Guess what I forgot to do… I was so sure that I had done it…
Sigh. How did you know? Thanks for pointing this out to me!

Regards,
Michael (again filled with hope that someday in the future, helloworld.sys
will be working fine)