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…