Re: Mounting on a directory
- From: "Maxim S. Shatskih" <maxim@xxxxxxxxxxxxxxxx>
- Date: Tue, 11 Jul 2006 05:50:14 +0400
1) You must have a PnP PDO. The one way to create it is
IoReportDetectedDevice with all NULLs as hardware resource arguments.
2) Register MOUNTDEV_MOUNTED_DEVICE_GUID on this PDO.
3) Handle the IOCTL_MOUNTDEV_xxx requests, especially the "query ID" one.
--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@xxxxxxxxxxxxxxxx
http://www.storagecraft.com
"Bob" <Bob@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:F0D76D10-86D3-44B3-A1A3-DE4397BE83E9@xxxxxxxxxxxxxxxx
I have a virtual disk driver that runs on XP.
It currently creates a named device object with
a drive letter. The virtual disk can be formatted
and used via the drive letter. I would like to
add the capability to 'mount' the virtual disk
on a directory (a nested mount). The mountvol
utility requires a 'Volume GUID' in order to mount
(set the reparse point).
Questions:
1) Can I simply write a program to issue the
FSCTL_SET_REPARSE_POINT with my device's symlink
instead of the Volume-GUID symlink as the reparse
data? Or does the IO manager look at the reparse
data for a mount point and require a Volume GUID?
2) If I need a Volume-GUID, what's the correct process?
I've tried the following but do not get the mount
manager IOCTL's sent to my driver.
a) Create a device object based on a request
from user space via IoCreateDevice() as FILE_DEVICE_DISK.
b) Create a symlink to it based on it's name.
c) In a backgroud system thread:
1) Call IoReportDetectedDevice
Status = IoReportDetectedDevice(
Globals.DriverObject,
InterfaceTypeUndefined,
0,
0,
NULL,
NULL,
FALSE,
&PnPDeviceObject); (Set to NULL)
2) Attach my device object to the newly created PnP Device object.
3) Register as a disk
Status = IoRegisterDeviceInterface(
PnPDeviceObject,
&GUID_DEVINTERFACE_DISK,
NULL,
&DeviceExtension->DiskGuidName);
The GUID returned was:
\??\ROOT#myvol#0000#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}
4) Enable the interface
5) Register as a Volume device
Status = IoRegisterDeviceInterface(
PnPDeviceObject,
&MOUNTDEV_MOUNTED_DEVICE_GUID,
NULL,
&DeviceExtension->VolumeGuidName);
The GUID returned was:
\??\ROOT#myvol#0000#{53f5630d-b6bf-11d0-94f2-00a0c91efb8b}
6) Enable the interface
A short time later I get the following two debug messages:
CreateTargetEntry() RegisterDeviceNotification() failed. Win32 Error:1066
DmServerServiceHandlerEx() CreateTargetEntry() failed: 1066.
The only IOCTL I get from the mount manager is
IOCTL_MOUNTDEV_QUERY_DEVICE_NAME to which I respond with
my device name (e.g. \Device\MyVol\test_vol).
What am I doing wrong?
Thanks in advance,
-bob
.
- References:
- Mounting on a directory
- From: Bob
- Mounting on a directory
- Prev by Date: Re: How do I install NDIS intermediate mode driver ?
- Next by Date: Re: Problem with KMDF 1.1 driver installation
- Previous by thread: Re: Mounting on a directory
- Next by thread: Creating a NetworkBridge in Windows XP programmatically
- Index(es):
Relevant Pages
|