virtual file system with mount mgr if?

Dear All,

I have a virtual file system driver. This FSD is not envolved in the
storage stack. After loading my FSD, it creates a device object of type
FILE_DEVICE_FILE_SYSTEM and creates a symbolic link to this device. All
file i/o is directed to this device and directly handled there.

Now I want to integrate this file system with Mount Manager. Is this
possible with this design? If not, what would be the correct approach to
implement such a virtual file system?

Does Mount Manager rely only on the documented interfaces or does it
presume that my device is a plug and play storage device?

Trying to implement the Mount Manager interface, I’m running into several
problems:

  • IoRegisterDeviceInterface() takes a PDO. I don’t have a real PDO.

  • The device interface functions are declared in ntddk.h, but I am
    required to use ntifs.h

Any tips or pointers to samples are welcome. The W2K RAM DISK sample would
be close to mine, but of course it is a storage device and moreover it
does not implement the Mount Manager interface.

I am talking about W2K and XP.

Thanks,
Detlef.

BTW: I am going to implement mount manager, because the DefineDosDevice
stuff seems not to work correctly on XP. At least explorer is not
correctly updated.

If the only problem that you have is updating the Explorer then you just
need to send
notification message (as I understood you have a user mode component) after
you have
created your disk. Here is the function that I use for that purpose:

//
// Broadcast system message (device arrival)
//
void BroadcastDeviceArrival( char cDrv )
{
DEV_BROADCAST_VOLUME hdr;

hdr.dbcv_size = sizeof hdr;
hdr.dbcv_devicetype = DBT_DEVTYP_VOLUME;
hdr.dbcv_reserved = 0;
hdr.dbcv_unitmask = 1 << (cDrv-‘A’);
hdr.dbcv_flags = 0;

::SendMessage( HWND_BROADCAST, WM_DEVICECHANGE, DBT_DEVICEARRIVAL,
(LPARAM)&hdr);
}

Hope this helps,

Vladimir

-----Original Message-----
From: xxxxx@gmx.de [mailto:xxxxx@gmx.de]
Sent: Wednesday, March 13, 2002 5:22 AM
To: File Systems Developers
Subject: [ntfsd] virtual file system with mount mgr if?

Dear All,

I have a virtual file system driver. This FSD is not envolved in the
storage stack. After loading my FSD, it creates a device object of type
FILE_DEVICE_FILE_SYSTEM and creates a symbolic link to this device. All
file i/o is directed to this device and directly handled there.

Now I want to integrate this file system with Mount Manager. Is this
possible with this design? If not, what would be the correct approach to
implement such a virtual file system?

Does Mount Manager rely only on the documented interfaces or does it
presume that my device is a plug and play storage device?

Trying to implement the Mount Manager interface, I’m running into several
problems:

  • IoRegisterDeviceInterface() takes a PDO. I don’t have a real PDO.

  • The device interface functions are declared in ntddk.h, but I am
    required to use ntifs.h

Any tips or pointers to samples are welcome. The W2K RAM DISK sample would
be close to mine, but of course it is a storage device and moreover it
does not implement the Mount Manager interface.

I am talking about W2K and XP.

Thanks,
Detlef.

BTW: I am going to implement mount manager, because the DefineDosDevice
stuff seems not to work correctly on XP. At least explorer is not
correctly updated.


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

Thanks, Vladimir.

After changing my code so that it sends this broadcast after using
DefineDosDevice(), everything worked fine.
However: After removing the broadcast, it still worked! I figured out that
DefineDosDevice() indeed does everything which is necessary to update the
UI. My problem was that my remove drive letter function looked like that:

DefineDosDevice() to remove the drive letter
DefineDosDevice() to create
DefineDosDevice() to remove it again

This probably caused the UI update problems. Now I start to like XP :slight_smile:

While this removes some pressure from my schedule, I’m still interested in
any ideas concerning the other questions.

Thanks,
Detlef.


If the only problem that you have is updating the Explorer then you just
need to send
notification message (as I understood you have a user mode component)
after
you have
created your disk. Here is the function that I use for that purpose:

//
// Broadcast system message (device arrival)
//
void BroadcastDeviceArrival( char cDrv )
{
DEV_BROADCAST_VOLUME hdr;

hdr.dbcv_size = sizeof hdr;
hdr.dbcv_devicetype = DBT_DEVTYP_VOLUME;
hdr.dbcv_reserved = 0;
hdr.dbcv_unitmask = 1 << (cDrv-‘A’);
hdr.dbcv_flags = 0;

::SendMessage( HWND_BROADCAST, WM_DEVICECHANGE, DBT_DEVICEARRIVAL,
(LPARAM)&hdr);
}

Hope this helps,

Vladimir

-----Original Message-----
From: xxxxx@gmx.de [mailto:xxxxx@gmx.de]
Sent: Wednesday, March 13, 2002 5:22 AM
To: File Systems Developers
Subject: [ntfsd] virtual file system with mount mgr if?

Dear All,

I have a virtual file system driver. This FSD is not envolved in the
storage stack. After loading my FSD, it creates a device object of type
FILE_DEVICE_FILE_SYSTEM and creates a symbolic link to this device. All
file i/o is directed to this device and directly handled there.

Now I want to integrate this file system with Mount Manager. Is this
possible with this design? If not, what would be the correct approach to
implement such a virtual file system?

Does Mount Manager rely only on the documented interfaces or does it
presume that my device is a plug and play storage device?

Trying to implement the Mount Manager interface, I’m running into several
problems:

  • IoRegisterDeviceInterface() takes a PDO. I don’t have a real PDO.

  • The device interface functions are declared in ntddk.h, but I am
    required to use ntifs.h

Any tips or pointers to samples are welcome. The W2K RAM DISK sample would
be close to mine, but of course it is a storage device and moreover it
does not implement the Mount Manager interface.

I am talking about W2K and XP.

Thanks,
Detlef.

BTW: I am going to implement mount manager, because the DefineDosDevice
stuff seems not to work correctly on XP. At least explorer is not
correctly updated.

Hi,
I have some similar problem.
I am creating a cd-rom emulator and mounting the image file
to a virtual drive.

All the addition and removal of the virtual drives are working
perfect with the broadcast messages.
But the volume label gets updated only if I open the explorer,
refresh that particular namespace and open a new instance.

Is there any solution for this?

Thanks in advance.

Regards,
Sathish.

----- Original Message -----
From:
To: “File Systems Developers”
Sent: Thursday, March 14, 2002 4:01 PM
Subject: [ntfsd] Re: virtual file system with mount mgr if?

> Thanks, Vladimir.
>
> After changing my code so that it sends this broadcast after using
> DefineDosDevice(), everything worked fine.
> However: After removing the broadcast, it still worked! I figured out that
> DefineDosDevice() indeed does everything which is necessary to update the
> UI. My problem was that my remove drive letter function looked like that:
>
> DefineDosDevice() to remove the drive letter
> DefineDosDevice() to create
> DefineDosDevice() to remove it again
>
> This probably caused the UI update problems. Now I start to like XP :slight_smile:
>
> While this removes some pressure from my schedule, I’m still interested in
> any ideas concerning the other questions.
>
> Thanks,
> Detlef.
>
> --------------
>
> If the only problem that you have is updating the Explorer then you just
> need to send
> notification message (as I understood you have a user mode component)
> after
> you have
> created your disk. Here is the function that I use for that purpose:
>
> //
> // Broadcast system message (device arrival)
> //
> void BroadcastDeviceArrival( char cDrv )
> {
> DEV_BROADCAST_VOLUME hdr;
>
> hdr.dbcv_size = sizeof hdr;
> hdr.dbcv_devicetype = DBT_DEVTYP_VOLUME;
> hdr.dbcv_reserved = 0;
> hdr.dbcv_unitmask = 1 << (cDrv-‘A’);
> hdr.dbcv_flags = 0;
>
> ::SendMessage( HWND_BROADCAST, WM_DEVICECHANGE, DBT_DEVICEARRIVAL,
> (LPARAM)&hdr);
> }
>
> Hope this helps,
>
> Vladimir
>
> -----Original Message-----
> From: xxxxx@gmx.de [mailto:xxxxx@gmx.de]
> Sent: Wednesday, March 13, 2002 5:22 AM
> To: File Systems Developers
> Subject: [ntfsd] virtual file system with mount mgr if?
>
>
> Dear All,
>
> I have a virtual file system driver. This FSD is not envolved in the
> storage stack. After loading my FSD, it creates a device object of type
> FILE_DEVICE_FILE_SYSTEM and creates a symbolic link to this device. All
> file i/o is directed to this device and directly handled there.
>
> Now I want to integrate this file system with Mount Manager. Is this
> possible with this design? If not, what would be the correct approach to
> implement such a virtual file system?
>
> Does Mount Manager rely only on the documented interfaces or does it
> presume that my device is a plug and play storage device?
>
> Trying to implement the Mount Manager interface, I’m running into several
> problems:
>
> - IoRegisterDeviceInterface() takes a PDO. I don’t have a real PDO.
>
> - The device interface functions are declared in ntddk.h, but I am
> required to use ntifs.h
>
> Any tips or pointers to samples are welcome. The W2K RAM DISK sample would
> be close to mine, but of course it is a storage device and moreover it
> does not implement the Mount Manager interface.
>
> I am talking about W2K and XP.
>
> Thanks,
> Detlef.
>
> BTW: I am going to implement mount manager, because the DefineDosDevice
> stuff seems not to work correctly on XP. At least explorer is not
> correctly updated.
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@srasys.co.in
> To unsubscribe send a blank email to %%email.unsub%%
>
>

> Now I want to integrate this file system with Mount Manager. Is this

possible with this design?

No, you will need a fake disk volume device object for it.
Also note that all other FSDs - FASTFAT and NTFS - will also try to mount to your fake disk, just return wrong metadata to them.

Max