Just creating a DO and registering it won’t work, at least from my
implementations over the past decade. You need to have a bus driver,
look at the toaster example, and the PDO needs to register with Mnt Mgr.
Pete
–
Kernel Drivers
Windows File System and Device Driver Consulting
www.KernelDrivers.com http:</http:>
866.263.9295
------ Original Message ------
From: xxxxx@gmail.com
To: “Windows File Systems Devs Interest List”
Sent: 1/6/2016 1:12:19 PM
Subject: RE:[ntfsd] Virtual disk is not getting any I/O request
>This is what i am doing after disk creation so that mount manager can
>send device request to my file system for this disk. I was using
>commneted code earlier to access disk directly from explore. so that i
>can see I/O request. I also tried file spy but that also not showing
>any IO request.
>
>And with IoRegisterDeviceInterface im getting Invalid device request.
>
>PWUFS_DISK_EXTENSION ptrDiskExtension =
>ptrDeviceObject->DeviceExtension;
> RtlZeroMemory(ptrDiskExtension,
>sizeof(WUFS_DISK_EXTENSION));
> ptrDiskExtension->Id = WUFS_VIRTUAL_DISK;
> RtlCopyMemory(ptrDiskExtension->MagicId, WUFS_MAGIC_ID,
>sizeof(UCHAR)* 10);
> UNICODE_STRING diskGlobalName;
> UNICODE_STRING guidStr;
> GUID ptrGuid;
> RtlInitUnicodeString(&guidStr,
>L"{53F5630D-B6BF-11D0-94F2-00A0C91EFB8B}");
> RtlGUIDFromString(&guidStr, &ptrGuid);
> // RtlInitUnicodeString(&diskGlobalName,
>WUFS_VIRTUAL_DISK_SYMBOLIC);
> // status = IoCreateSymbolicLink(&diskGlobalName,
>&diskName);
>
> status = IoRegisterDeviceInterface(ptrDeviceObject,&ptrGuid,
>NULL, &diskGlobalName);
>
>—
>NTFSD is sponsored by OSR
>
>
>MONTHLY seminars on crash dump analysis, WDF, Windows internals and
>software drivers!
>Details at http:
>
>To unsubscribe, visit the List Server section of OSR Online at
>http:</http:></http:>
In addition to this, in order to have a drive letter assigned to your
device automatically you need to integrate with Mnt Mgr. Assigning a
drive letter manually will result in issues where the drive is not
recognized by some system components. So while Mnt Mgr integration is
not strictly necessary, it is required if you want a drive to play
nicely with other system components.
Pete
–
Kernel Drivers
Windows File System and Device Driver Consulting
www.KernelDrivers.com http:</http:>
866.263.9295
------ Original Message ------
From: “Scott Noone”
To: “Windows File Systems Devs Interest List”
Sent: 1/6/2016 1:33:53 PM
Subject: Re:[ntfsd] Virtual disk is not getting any I/O request
>Mount Manager integration is not strictly necessary. It is only
>required if you want a driver letter to be automatically assigned to
>you.
>
>The mount process (i.e. FS recognition) is triggered on first open
>requiring data access to any device object with a VPB. You need to make
>sure that you create your device object with an appropriate DeviceType:
>
>* FILE_DEVICE_DISK
>* FILE_DEVICE_VIRTUAL_DISK
>* FILE_DEVICE_CD_ROM
>* FILE_DEVICE_TAPE (my personal favorite!)
>
>These all result in the I/O Manager allocating a VPB for your device
>object. When an application then tries to open that device by name
>(using a driver letter, symbolic link, native name, etc.) the I/O
>Manager triggers mount processing for the appropriate file system type
>(disk, CDROM, or tape).
>
>Sooo what device type are you using for your virtual disk device
>object? Also, what device type is your FS control device that you
>registered with IoRegisterFileSystem?
>
>-scott
>OSR
>@OSRDrivers
>
>wrote in message news:xxxxx@ntfsd…
>
>This is what i am doing after disk creation so that mount manager can
>send device request to my file system for this disk. I was using
>commneted code earlier to access disk directly from explore. so that i
>can see I/O request. I also tried file spy but that also not showing
>any IO request.
>
>And with IoRegisterDeviceInterface im getting Invalid device request.
>
>PWUFS_DISK_EXTENSION ptrDiskExtension =
>ptrDeviceObject->DeviceExtension;
> RtlZeroMemory(ptrDiskExtension, sizeof(WUFS_DISK_EXTENSION));
> ptrDiskExtension->Id = WUFS_VIRTUAL_DISK;
> RtlCopyMemory(ptrDiskExtension->MagicId, WUFS_MAGIC_ID,
>sizeof(UCHAR)* 10);
> UNICODE_STRING diskGlobalName;
> UNICODE_STRING guidStr;
> GUID ptrGuid;
> RtlInitUnicodeString(&guidStr,
>L"{53F5630D-B6BF-11D0-94F2-00A0C91EFB8B}");
> RtlGUIDFromString(&guidStr, &ptrGuid);
> // RtlInitUnicodeString(&diskGlobalName, WUFS_VIRTUAL_DISK_SYMBOLIC);
> // status = IoCreateSymbolicLink(&diskGlobalName, &diskName);
>
>status = IoRegisterDeviceInterface(ptrDeviceObject,&ptrGuid, NULL,
>&diskGlobalName);
>
>—
>NTFSD is sponsored by OSR
>
>
>MONTHLY seminars on crash dump analysis, WDF, Windows internals and
>software drivers!
>Details at http:
>
>To unsubscribe, visit the List Server section of OSR Online at
>http:</http:></http:>
You are right Peter. But here scenario is different this is a virtual disk created using the follwoing code.
UNICODE_STRING diskName;
RtlInitUnicodeString(&diskName, WUFS_VIRTUAL_DISK_NAME);
PDEVICE_OBJECT ptrDeviceObject;
status = IoCreateDeviceSecure(ptrHostExtension->PtrDriverObject,
sizeof(WUFS_DISK_EXTENSION),
&diskName,
FILE_DEVICE_VIRTUAL_DISK,
0,
FALSE,
&SDDL_DEVOBJ_SYS_ALL_ADM_RWX_WORLD_RW_RES_R,
0,
&ptrDeviceObject);
if (!status)
{
PWUFS_DISK_EXTENSION ptrDiskExtension = ptrDeviceObject->DeviceExtension;
RtlZeroMemory(ptrDiskExtension, sizeof(WUFS_DISK_EXTENSION));
ptrDiskExtension->Id = WUFS_VIRTUAL_DISK;
RtlCopyMemory(ptrDiskExtension->MagicId, WUFS_MAGIC_ID, sizeof(UCHAR)* 10);
UNICODE_STRING diskGlobalName;
RtlInitUnicodeString(&diskGlobalName, WUFS_VIRTUAL_DISK_SYMBOLIC);
status = IoCreateSymbolicLink(&diskGlobalName, &diskName);
///SendArrivalCommand(&diskName);
DebugWriteLine(“DISK_CREATE:Gloabl link creation status %wZ”, &diskGlobalName);
DebugWriteLine(“DISK_CREATE:Register result Result %x”, status);
}
else
{
DebugWriteLine(“DISK_CREATE:Creation failed %x”, status);
}
As per documentation whenever at first open file request mount request will be sent for to all file system registered. which is not happening here. Even no IOCTL ,no open file request is arriving at disk.even though i’m accessing symbolic link. And thing that i’m want to say it is not expected behavior for a disk which has no mounted file system.
I am using following code to create disk.
status = IoCreateDeviceSecure(ptrHostExtension->PtrDriverObject,
sizeof(WUFS_DISK_EXTENSION),
&diskName,
FILE_DEVICE_VIRTUAL_DISK,
0,
FALSE,
&SDDL_DEVOBJ_SYS_ALL_ADM_RWX_WORLD_RW_RES_R,
0,
&ptrDeviceObject);
and to create file syetm im using following code
status=IoCreateDevice(DriverObject,
sizeof(WUFS_HOST_EXTENTION),
&DeviceName,
FILE_DEVICE_DISK_FILE_SYSTEM,
0,
FALSE,
&PtrHostDevice);status=IoCreateDevice(DriverObject,
sizeof(WUFS_HOST_EXTENTION),
&DeviceName,
FILE_DEVICE_DISK_FILE_SYSTEM,
0,
FALSE,
&PtrHostDevice);
and registered it as file system
IoRegisterFileSystem(PtrHostDevice);
I think everything is right here…is it?
On Wed, 6 Jan 2016, xxxxx@gmail.com wrote:
I am using following code to create disk.
&SDDL_DEVOBJ_SYS_ALL_ADM_RWX_WORLD_RW_RES_R,
I use
RtlInitUnicodeString(&sddl,
_T(“D:P(A;;GA;;;SY)(A;;GA;;;BA)(A;;GA;;;BU)”));
instead.
Bo Branten
I resolved issue somewhat.I found that there is missing flag DO_INITIALIZE_DEVICE. Now i can receive request on my disk.