I repost this since I got no answers.
Has anyone ever had problems with using named Volume
Device Object? And if you did, how did you design your
file system driver so that you would be able to mount
your file system driver with unnamed VDO?
Any comments would be greatly appreciated.
Regards,
-Jeff
Hi everybody,
I have a virtual file system driver (which is we do
not talk to the disk; instead, we store everything in
a backing store that resides somewhere else on the
system on an NTFS or FAT volumes) that worked just
fine until the introduction of a new Filter Manager
with sp1 Windows 2003 Server. The problem is that a
long time ago when my file system driver was written
the designers did not follow the rule that VDO should
not be named. New filter manager enforces this rule
and when it finds a named VDO it thinks it is a CDO
instead and blue screen follows pretty soon after
that.
In DriverEntry() we create two device objects, both of
them named and a symbolic link. Later on, in a
user-mode piece of our file system we make a call to
CreateFile() providing the name of a symbolic link and
then I get a handle to our driver (which is really a
handle to CDO) that I can use for issuing
DeviceIoControl calls.
Now, because of the problem above I can no longer get
a CDO handle with the mechanism described above.
Neal Christiansen suggested me the following way to
solve the problem:
“Your current design should work (you have a file
system that directly talks to the backing file) but
you do need to provide at least a stub of a storage
stack drive that will respond to the proper PNP events
and correctly register with the mount manager. It
would be this device that is named and then
everything will work properly.”
So now here is my question to you guys. Has anyone
else run into this problem before. And if you did,
could you tell me what did you do and how did you go
about implementing storage stack driver. May be, you
have a stub storage stack driver that I can borrow?
Here is the code snippet from our DriverEntry()
DriverEntry()
////////////////////////////////////////////////////////////////////////
//**********************************************************************
// create a named device object representing the file
system driver
//**********************************************************************
//NTCS_FSD_NAME
// =L"\Device\InterwovenFilesys\InterwovenFilesys"
RtlInitUnicodeString(&DriverDeviceName,
NTCS_FSD_NAME);
//**********************************************************************
// Start with a directory in the NT Object Name Space.
// we must be careful to specify the type of file
system that we are …
//**********************************************************************
//NTCS_FSD_DRV_DIR = L"\Device\InterwovenFilesys"
if (!NT_SUCCESS(RC =
NTCSFsdCreateDirectory(
NTCS_FSD_DRV_DIR,
&(NTCSFsdGlobalData.DirectoryHandle),
TRUE))) {
try_return(RC);
}
if (!NT_SUCCESS(RC =
IoCreateDevice( DriverObject,
0,
&DriverDeviceName,
NTCS_FSD_TYPE,
NTCS_FSD_CHARACTERISTICS, FALSE,
&(NTCSFsdGlobalData.NTCSFsdDeviceObject)))) {
try_return(RC);
}
//NTCS_FSD_DOS_NAME=L"\DosDevices\InterwovenFilesys"
RtlInitUnicodeString(&SymbolicLinkName,
NTCS_FSD_DOS_NAME);
//**********************************************************************
// create a symbolic link to the device object created
above
//**********************************************************************
if (!NT_SUCCESS(RC = IoCreateSymbolicLink(
&SymbolicLinkName,
&DriverDeviceName))) {
try_return(RC);
}
//**********************************************************************
// Do the separate File System access object eg by
Drive Letter (Z:) will use
//**********************************************************************
//NTCS_FSD_FS_NAME=L"\Device\InterwovenFilesys\InterwovenPseudoVCB"
RtlInitUnicodeString(&DriverDeviceName,
NTCS_FSD_FS_NAME);
//**********************************************************************
// Create second device and symbolic link
//**********************************************************************
if (!NT_SUCCESS(RC = IoCreateDevice(
DriverObject,
0,
&DriverDeviceName,
NTCS_FSD_TYPE,
NTCS_FSD_CHARACTERISTICS,
FALSE,
&(NTCSFsdGlobalData.NTCSFsdFsDeviceObject)))) {
try_return(RC);
}
CreatedSymbolicLink = TRUE;
//**********************************************************************
// initialize the CORE at this point; once the CORE
initialization returns
// success, we are committed.
//**********************************************************************
RC = CORE_INIT(RegistryPath, &PtrCoreGlobalData);
try_return(RC);
}
InitializedCore = TRUE;
NTCSFsdGlobalData.PtrCoreGlobalData =
PtrCoreGlobalData;
//**********************************************************************
// for disk-based file systems, the following is
required to receive mount requests
//**********************************************************************
IoRegisterFileSystem(NTCSFsdGlobalData.NTCSFsdFsDeviceObject);
Discover Yahoo!
Get on-the-go sports scores, stock quotes, news and more. Check it out!
http://discover.yahoo.com/mobile.html