Virtual drive in windows NT/2K

Hi All.

I’m trying to write virtual disk driver on windows NT/2k.
Actually, my source code is based on MS ramdisk and FileDisk.

But I can’t use such built-in utilities as chkdsk, defrag.
Windows NT/2K disk manager also does not recognize newly-mounted driver.

Would you please help me get it done?

I Appreciate in advance.


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

I had this problem with my driver also. I had always used the ramdisk method
of assigning a drive letter and it is not the correct way of doing it. I
never did figure out how to get the disk utilities to work with my device
for things like chkdsk or defrag or format. But I was able to get it to show
up in the disk manager by registering myself with the mount manager. Refer
to Supporting Mount Manager Requests in a Storage Class Driver -
http://www.osr.com/ddk/03class_5mp3.htm

Basically you have to first register the MOUNTDEV_MOUNTED_DEVICE_GUID device
interface in your driver. The mount manager will then send you these three
IOCTLs which you must handle:
IOCTL_MOUNTDEV_QUERY_DEVICE_NAME
IOCTL_MOUNTDEV_QUERY_UNIQUE_ID
IOCTL_MOUNTDEV_QUERY_SUGGESTED_LINK_NAME

After doing this you should have your disk viewable in the disk manager.

Brian

----- Original Message -----
From:
To: “NT Developers Interest List”
Sent: Friday, June 01, 2001 9:00 PM
Subject: [ntdev] Virtual drive in windows NT/2K

> Hi All.
>
> I’m trying to write virtual disk driver on windows NT/2k.
> Actually, my source code is based on MS ramdisk and FileDisk.
>
> But I can’t use such built-in utilities as chkdsk, defrag.
> Windows NT/2K disk manager also does not recognize newly-mounted driver.
>
> Would you please help me get it done?
>
> I Appreciate in advance.
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@sginet.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hi,

You need to write either SCSI miniport or SCSI port driver. Check the
archive: this topic is discussed here every 2-3 months.

Anton

P.S. Or you can try just to license the code from the people who wrote it a
long time ago.


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You have to support some IOCTL_DISK codes. There is the list of all IOCTLs
from our virtual disk driver which can be formated, chksdked and hopefully
defragged:

IOCTL_DISK_CHECK_VERIFY:
IOCTL_STORAGE_CHECK_VERIFY:
IOCTL_DISK_IS_WRITABLE:
IOCTL_DISK_FORMAT_TRACKS_EX:
IOCTL_DISK_FORMAT_TRACKS:
IOCTL_DISK_GET_MEDIA_TYPES:
IOCTL_DISK_GET_DRIVE_GEOMETRY:
IOCTL_STORAGE_GET_MEDIA_TYPES:
IOCTL_DISK_GET_PARTITION_INFO:
IOCTL_DISK_SET_PARTITION_INFO:
IOCTL_DISK_GET_DRIVE_LAYOUT:
IOCTL_DISK_VERIFY:
IOCTL_DISK_INTERNAL_SET_VERIFY:
IOCTL_DISK_INTERNAL_CLEAR_VERIFY:
IOCTL_DISK_MEDIA_REMOVAL:
IOCTL_STORAGE_MEDIA_REMOVAL:
IOCTL_DISK_EJECT_MEDIA:
IOCTL_STORAGE_EJECT_MEDIA:

Best regards,

Michal Vodicka
Veridicom
(RKK - Skytale)
[WWW: http://www.veridicom.com , http://www.skytale.com]


From: xxxxx@jungsoft.com[SMTP:xxxxx@jungsoft.com]
Reply To: NT Developers Interest List
Sent: Friday, June 01, 2001 4:00 AM
To: NT Developers Interest List
Subject: [ntdev] Virtual drive in windows NT/2K

Hi All.

I’m trying to write virtual disk driver on windows NT/2k.
Actually, my source code is based on MS ramdisk and FileDisk.

But I can’t use such built-in utilities as chkdsk, defrag.
Windows NT/2K disk manager also does not recognize newly-mounted driver.

Would you please help me get it done?

I Appreciate in advance.


You are currently subscribed to ntdev as: xxxxx@rkk.cz
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hi Michal.
That really helps
thank you

Actually, I’v supported some of them ,just as illustrated in Ramdisk
sample.

So that’s why my virtual drive could not be formatted, chkdsked,
right?

Anyway, You mean I have to implement actual format or chkdsk routine in my
driver with those i/o control codes?

Is there another way to get it done?

I’ll wait for your message
Thanks so much.


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> ----------

From: xxxxx@jungsoft.com[SMTP:xxxxx@jungsoft.com]
Reply To: NT Developers Interest List
Sent: Monday, June 11, 2001 2:00 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Virtual drive in windows NT/2K

Actually, I’v supported some of them ,just as illustrated in Ramdisk
sample.

So that’s why my virtual drive could not be formatted, chkdsked,
right?

Yes, RamDisk doesn’t support all necessary codes. To see what you need to
implement add one debug print to your IOCTL handler which displays all
received IOCTL codes. Try format your drive and you’ll see necessary codes.

Anyway, You mean I have to implement actual format or chkdsk routine in
my
driver with those i/o control codes?

Not really. You have to return proper status and the actual implementation
is on you. You can just return success status to format IOCTLs and do
nothing. It isn’t quite correct but would work. Or you can clear requested
sectors or fill them with some char. System contains real chkdsk and format
code which reads and write sectors/tracks from your drives and wants some
information about drive geometry from your driver.

Is there another way to get it done?

IMHO no. Anyway, above is easy enough.

Best regards,

Michal Vodicka
Veridicom
(RKK - Skytale)
[WWW: http://www.veridicom.com , http://www.skytale.com]


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hi Michal.

I’ve tried to implement some i/o control code.
But as you know, didn’t work on windows 2000.

Would you please check my code, if you are able to get a break for a
while?
The alignment of text is not good though.

case IOCTL_DISK_CHECK_VERIFY:

status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;

break;

case IOCTL_STORAGE_CHECK_VERIFY:

status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;

break;

case IOCTL_DISK_FORMAT_TRACKS:

if(io_stack->Parameters.DeviceIoControl.InputBufferLength <
sizeof(FORMAT_PARAMETERS))
{
status = STATUS_INVALID_PARAMETER;
Irp->IoStatus.Information = 0;
break;
}

status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;

break;

case IOCTL_DISK_FORMAT_TRACKS_EX:

if(io_stack->Parameters.DeviceIoControl.InputBufferLength <
sizeof(FORMAT_EX_PARAMETERS))
{
status = STATUS_INVALID_PARAMETER;
Irp->IoStatus.Information = 0;
break;
}

status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;

break;

case IOCTL_STORAGE_GET_MEDIA_TYPES_EX:
{
PGET_MEDIA_TYPES mediaTypes = Irp->AssociatedIrp.SystemBuffer;
PDEVICE_MEDIA_INFO mediaInfo = &mediaTypes->MediaInfo[0];

if(io_stack->Parameters.DeviceIoControl.OutputBufferLength <
sizeof(GET_MEDIA_TYPES))
{
status = STATUS_BUFFER_TOO_SMALL;
Irp->IoStatus.Information = 0;

break;
}

mediaTypes->DeviceType = FILE_DEVICE_DISK;
mediaTypes->MediaInfoCount = 1;

mediaInfo->DeviceSpecific.DiskInfo.Cylinders.QuadPart =
device_extension->disk_geometry.Cylinders.QuadPart;
mediaInfo->DeviceSpecific.DiskInfo.TracksPerCylinder =
device_extension->disk_geometry.TracksPerCylinder;
mediaInfo->DeviceSpecific.DiskInfo.SectorsPerTrack =
device_extension->disk_geometry.SectorsPerTrack;
mediaInfo->DeviceSpecific.DiskInfo.BytesPerSector =
device_extension->disk_geometry.BytesPerSector;
mediaInfo->DeviceSpecific.RemovableDiskInfo.NumberMediaSides = 1;

mediaInfo->DeviceSpecific.DiskInfo.MediaCharacteristics =
(MEDIA_CURRENTLY_MOUNTED | MEDIA_READ_WRITE);

mediaInfo->DeviceSpecific.DiskInfo.MediaType = FixedMedia;

status = STATUS_SUCCESS;
Irp->IoStatus.Information = sizeof(DEVICE_MEDIA_INFO);

break;
}

case IOCTL_DISK_GET_DRIVE_LAYOUT:
{
PDRIVE_LAYOUT_INFORMATION DriveLayout =
(PDRIVE_LAYOUT_INFORMATION)Irp->AssociatedIrp.SystemBuffer;
ULONG TotalSize = 0;
NTSTATUS Status;

DriveLayout = (PDRIVE_LAYOUT_INFORMATION)
Irp->AssociatedIrp.SystemBuffer;

DriveLayout->PartitionCount = 1;
DriveLayout->Signature = 0;

DriveLayout->PartitionEntry->BootIndicator = FALSE;
DriveLayout->PartitionEntry->RecognizedPartition = TRUE;
DriveLayout->PartitionEntry->RewritePartition = FALSE;
DriveLayout->PartitionEntry->PartitionNumber = 0;
DriveLayout->PartitionEntry->StartingOffset.QuadPart = (ULONGLONG) 0;
DriveLayout->PartitionEntry->PartitionLength.QuadPart =
Extension->partition_information.PartitionLength.QuadPart;
DriveLayout->PartitionEntry->HiddenSectors = 0;

DriveLayout->PartitionEntry->PartitionType = 0;

Irp->IoStatus.Information = sizeof(PDRIVE_LAYOUT_INFORMATION);

break;
}

case IOCTL_DISK_SET_DRIVE_LAYOUT:

status = STATUS_SUCCESS;
Irp->IoStatus.Information =
io_stack->Parameters.DeviceIoControl.InputBufferLength;

break;

case IOCTL_DISK_GET_MEDIA_TYPES:

status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;

break;

case IOCTL_DISK_INTERNAL_SET_VERIFY:

status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;

break;

case IOCTL_DISK_INTERNAL_CLEAR_VERIFY:

status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;

break;

case IOCTL_STORAGE_MEDIA_REMOVAL:

status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;

break;

case IOCTL_STORAGE_EJECT_MEDIA:

status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;

break;

case IOCTL_STORAGE_GET_MEDIA_TYPES:

status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;

break;

case IOCTL_DISK_MEDIA_REMOVAL:

status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;

break;


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Basically, your implementation of IOCTL_DISK/STORAGE_CHECK_VERIFY is
insufficient. Please read DDK docs how to implement it and don’t forget to
check SL_OVERRIDE_VERIFY_VOLUME flag. It was necessary for NT4 but w2k
fastfat implementation makes it even more important. Also, your
implementation of drive layout and media types IOCTLs is suspicious, real
media geometry must be supplied. Read docs, examine DDK examples and debug;
this is the only way how to make functional driver of any type. Also, I
believe there are some examples of this driver type on the 'Net, search this
list archives for more info.

Best regards,

Michal Vodicka
Veridicom
(RKK - Skytale)
[WWW: http://www.veridicom.com , http://www.skytale.com]


From: xxxxx@jungsoft.com[SMTP:xxxxx@jungsoft.com]
Reply To: NT Developers Interest List
Sent: Tuesday, June 12, 2001 8:42 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Virtual drive in windows NT/2K

Hi Michal.

I’ve tried to implement some i/o control code.
But as you know, didn’t work on windows 2000.

Would you please check my code, if you are able to get a break for a
while?
The alignment of text is not good though.

case IOCTL_DISK_CHECK_VERIFY:

status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;

break;

case IOCTL_STORAGE_CHECK_VERIFY:

status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;

break;

case IOCTL_DISK_FORMAT_TRACKS:

if(io_stack->Parameters.DeviceIoControl.InputBufferLength <
sizeof(FORMAT_PARAMETERS))
{
status = STATUS_INVALID_PARAMETER;
Irp->IoStatus.Information = 0;
break;
}

status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;

break;

case IOCTL_DISK_FORMAT_TRACKS_EX:

if(io_stack->Parameters.DeviceIoControl.InputBufferLength <
sizeof(FORMAT_EX_PARAMETERS))
{
status = STATUS_INVALID_PARAMETER;
Irp->IoStatus.Information = 0;
break;
}

status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;

break;

case IOCTL_STORAGE_GET_MEDIA_TYPES_EX:
{
PGET_MEDIA_TYPES mediaTypes =
Irp->AssociatedIrp.SystemBuffer;
PDEVICE_MEDIA_INFO mediaInfo = &mediaTypes->MediaInfo[0];

if(io_stack->Parameters.DeviceIoControl.OutputBufferLength <

sizeof(GET_MEDIA_TYPES))
{
status = STATUS_BUFFER_TOO_SMALL;
Irp->IoStatus.Information = 0;

break;
}

mediaTypes->DeviceType = FILE_DEVICE_DISK;
mediaTypes->MediaInfoCount = 1;

mediaInfo->DeviceSpecific.DiskInfo.Cylinders.QuadPart =
device_extension->disk_geometry.Cylinders.QuadPart;

mediaInfo->DeviceSpecific.DiskInfo.TracksPerCylinder =
device_extension->disk_geometry.TracksPerCylinder;

mediaInfo->DeviceSpecific.DiskInfo.SectorsPerTrack =
device_extension->disk_geometry.SectorsPerTrack;

mediaInfo->DeviceSpecific.DiskInfo.BytesPerSector =
device_extension->disk_geometry.BytesPerSector;

mediaInfo->DeviceSpecific.RemovableDiskInfo.NumberMediaSides = 1;

mediaInfo->DeviceSpecific.DiskInfo.MediaCharacteristics =
(MEDIA_CURRENTLY_MOUNTED | MEDIA_READ_WRITE);

mediaInfo->DeviceSpecific.DiskInfo.MediaType
= FixedMedia;

status = STATUS_SUCCESS;
Irp->IoStatus.Information =
sizeof(DEVICE_MEDIA_INFO);

break;
}

case IOCTL_DISK_GET_DRIVE_LAYOUT:
{
PDRIVE_LAYOUT_INFORMATION DriveLayout

(PDRIVE_LAYOUT_INFORMATION)Irp->AssociatedIrp.SystemBuffer;
ULONG TotalSize = 0;
NTSTATUS Status;

DriveLayout = (PDRIVE_LAYOUT_INFORMATION)
Irp->AssociatedIrp.SystemBuffer;

DriveLayout->PartitionCount = 1;
DriveLayout->Signature = 0;

DriveLayout->PartitionEntry->BootIndicator =
FALSE;

DriveLayout->PartitionEntry->RecognizedPartition = TRUE;

DriveLayout->PartitionEntry->RewritePartition = FALSE;
DriveLayout->PartitionEntry->PartitionNumber
= 0;

DriveLayout->PartitionEntry->StartingOffset.QuadPart = (ULONGLONG) 0;

DriveLayout->PartitionEntry->PartitionLength.QuadPart =
Extension->partition_information.PartitionLength.QuadPart;
DriveLayout->PartitionEntry->HiddenSectors =
0;

DriveLayout->PartitionEntry->PartitionType =
0;

Irp->IoStatus.Information =
sizeof(PDRIVE_LAYOUT_INFORMATION);

break;
}

case IOCTL_DISK_SET_DRIVE_LAYOUT:

status = STATUS_SUCCESS;
Irp->IoStatus.Information =
io_stack->Parameters.DeviceIoControl.InputBufferLength;

break;

case IOCTL_DISK_GET_MEDIA_TYPES:

status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;

break;

case IOCTL_DISK_INTERNAL_SET_VERIFY:

status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;

break;

case IOCTL_DISK_INTERNAL_CLEAR_VERIFY:

status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;

break;

case IOCTL_STORAGE_MEDIA_REMOVAL:

status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;

break;

case IOCTL_STORAGE_EJECT_MEDIA:

status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;

break;

case IOCTL_STORAGE_GET_MEDIA_TYPES:

status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;

break;

case IOCTL_DISK_MEDIA_REMOVAL:

status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;

break;


You are currently subscribed to ntdev as: xxxxx@rkk.cz
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hi Michal.

I implemented some of i/o control codes you suggested.
However, it isn’t necessary to support all of them on NT 4.0.

I just did some as follwing.

IOCTL_DISK_GET_DRIVE_GEOMETRY
IOCTL_DISK_GET_PARTITION_INFO
IOCTL_DISK_IS_WRITABLE
IOCTL_DISK_SET_PARTITION_INFO
IOCTL_DISK_VERIFY
IOCTL_DISK_CHECK_VERIFY (this was not completely implemented as you
suggested about SL_OVERRIDE_VERIFY_VOLUME flag)

Be more specific about SL_OVERRIDE_VERIFY_VOLUME, please.

works well on windows NT. virtual volume can be formatted(to any file
system) , chkdsked.

But On 2K, virtual volume can not be formatted to Fat, Fat32.
Also Chkdsk from context menu does not work for virtual volume.

explain to me please.

Is is possible to direct these to already mounted volume?
I mean Using IoGetDeviceObjectPointer() IoBuildDeviceIoControlRequest()
IoCallDriver(),


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> ----------

From: xxxxx@jungsoft.com[SMTP:xxxxx@jungsoft.com]
Reply To: NT Developers Interest List
Sent: Friday, June 22, 2001 12:25 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Virtual drive in windows NT/2K

Hi Michal.

I implemented some of i/o control codes you suggested.
However, it isn’t necessary to support all of them on NT 4.0.

Sure, I posted a list of all IOCTLs we implemented and didn’t check which
are necessary for your purpose.

I just did some as follwing.

IOCTL_DISK_GET_DRIVE_GEOMETRY
IOCTL_DISK_GET_PARTITION_INFO
IOCTL_DISK_IS_WRITABLE
IOCTL_DISK_SET_PARTITION_INFO
IOCTL_DISK_VERIFY
IOCTL_DISK_CHECK_VERIFY (this was not completely implemented as you
suggested about SL_OVERRIDE_VERIFY_VOLUME flag)

Be more specific about SL_OVERRIDE_VERIFY_VOLUME, please.

Search DDK docs for it, I believe it is described enough there (note it
isn’t in the index). Basically, this flag forces you to process IRP even if
your volume is in uncertain state (media changed) and DO_VERIFY_VOLUME flag
is set. Note this flag is important for all IRPs, not only for check verify.
If you fail to implement it correctly, system may not recognize volume
change which can lead to data corruption.

works well on windows NT. virtual volume can be formatted(to any file
system) , chkdsked.

But On 2K, virtual volume can not be formatted to Fat, Fat32.

Yes, I also had this problem when started testing our NT4 driver on w2k.
FastFat driver was changed and volume verification must be implemented more
precisely. If you have IFS kit and FastFat sources, it really helps.

Note things really changed on XP. They kindly changed all media geometry
IOCTLs. Currently, I battle with Mount Manager which doesn’t want to
recognize my volumes. They work normally but can’t be seen in exploder
volumes list. Strangely enough, there are users who want it :).

Also Chkdsk from context menu does not work for virtual volume.

Sorry, I never noticed something like this (maybe because never use exploder
and context menu :).

explain to me please.

Is is possible to direct these to already mounted volume?
I mean Using IoGetDeviceObjectPointer() IoBuildDeviceIoControlRequest()
IoCallDriver(),

They are devices as others but I’m not sure if they aren’t opened
exclusively by FS. Try it. What do you want to do?

Best regards,

Michal Vodicka
Veridicom
(RKK - Skytale)
[WWW: http://www.veridicom.com , http://www.skytale.com]


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

thanks so much, Michal.

Your explanation was much too helpful.
And I’ve found the right information in DDK documents.

Some changes were made.
Actually, this time I created device object as removable media (so far
fixed media) Then, my virtual volume can be formatted to fat ,fat32 as well
as ntfs.

why did that happen?

And one more.

When I implement IOCTL_DISK_CHECK_VERIFY, how can I determine whether the
media changed or not?

DDK docs say that if output buffer provided, the buffer must be filled out
with media change count.

What ma I supposed to do about this?
I can not determine the media change.

And is it necessary to register my device object with
IoRegisterDeviceInterface() using guid on windows 2k?

Thank you Have a nice weekend.


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> ----------

From: xxxxx@jungsoft.com[SMTP:xxxxx@jungsoft.com]
Reply To: NT Developers Interest List
Sent: Saturday, June 23, 2001 12:25 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Virtual drive in windows NT/2K

Actually, this time I created device object as removable media (so far
fixed media) Then, my virtual volume can be formatted to fat ,fat32 as
well
as ntfs.

why did that happen?

I don’t know, our driver always used removable media because they are really
removable :slight_smile: Maybe FastFat has different expectations for fixed media.

And one more.

When I implement IOCTL_DISK_CHECK_VERIFY, how can I determine whether the
media changed or not?

Hmm, who else but your driver should know if media was changed? I don’t know
how you store data for your drives; we’re using files and when a file is
assigned to a volume, media changed. It is the same as if you change CD or
diskette, driver doesn’t check if medium was reused or not, it only informs
FS about change event and FS makes this decision.

DDK docs say that if output buffer provided, the buffer must be filled out

with media change count.

What ma I supposed to do about this?

Simply a counter of media change count for given device. One variable in
device extension.

I can not determine the media change.

See above, only you can :slight_smile:

And is it necessary to register my device object with
IoRegisterDeviceInterface() using guid on windows 2k?

No. At least our driver works without it on w2k. Volumes can’t be mounted to
reparse points but who cares. Unfortunatelly, the situation seems different
on XP and it may be necessary to do it if drives should be visible in
exploder. I’m not sure, still trying to avoid it.

Best regards,

Michal Vodicka
Veridicom
(RKK - Skytale)
[WWW: http://www.veridicom.com , http://www.skytale.com]


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

thanks so much Michal

At long last, I finally got what you mean.

If I always assume that there is no media change, it is not necessary to
check that flags, right?

Because if I get IOCTL_DISK_CHECK_VERIFY before a file representing a
volume created, I always return STATUS_NO_MEDIA_IN_DEVICE.

Is that correct assumption?

I appreicate your reply as quick as lightning.


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hi Michal

One important question

Did you support IOCTL_SCSI_XX codes?
Chkdsk issued IOCTL_SCSI_PASS_THROUGH.
it was 0x4d008

Maybe, I think I have to implement these codes in order for chkdsk to work
on 2K.

How did you handle these problems?


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> ----------

From: xxxxx@jungsoft.com[SMTP:xxxxx@jungsoft.com]
Reply To: NT Developers Interest List
Sent: Friday, June 22, 2001 4:00 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Virtual drive in windows NT/2K

If I always assume that there is no media change, it is not necessary to
check that flags, right?

Because if I get IOCTL_DISK_CHECK_VERIFY before a file representing a
volume created, I always return STATUS_NO_MEDIA_IN_DEVICE.

Is that correct assumption?

It might be correct but I’m not quite sure. Try it. There is a transition
from no media state and FastFat tries to check if media was changed. Maybe
it doesn’t if there was nothing previously. Anyway, you couln’t use files on
removable media and exchange files. Are you sure you won’t need it later?

Best regards,

Michal Vodicka
Veridicom
(RKK - Skytale)
[WWW: http://www.veridicom.com , http://www.skytale.com]


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> ----------

From: xxxxx@jungsoft.com[SMTP:xxxxx@jungsoft.com]
Reply To: NT Developers Interest List
Sent: Monday, June 25, 2001 4:26 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Virtual drive in windows NT/2K

Did you support IOCTL_SCSI_XX codes?

No.

Chkdsk issued IOCTL_SCSI_PASS_THROUGH.
it was 0x4d008

Isn’t it 0x4d0008 instead? In this case it is mount manager request and you
can ignore it on w2k.

Maybe, I think I have to implement these codes in order for chkdsk to work

on 2K.

How did you handle these problems?

I have no problem on w2k and still trying to solve XP.

Best regards,

Michal Vodicka
Veridicom
(RKK - Skytale)
[WWW: http://www.veridicom.com , http://www.skytale.com]


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Michal Vodicka wrote:

> ----------
> From: xxxxx@jungsoft.com[SMTP:xxxxx@jungsoft.com]
> Reply To: NT Developers Interest List
> Sent: Friday, June 22, 2001 4:00 AM
> To: NT Developers Interest List
> Subject: [ntdev] RE: Virtual drive in windows NT/2K
>
> If I always assume that there is no media change, it is not necessary to
> check that flags, right?
>
> Because if I get IOCTL_DISK_CHECK_VERIFY before a file representing a
> volume created, I always return STATUS_NO_MEDIA_IN_DEVICE.
>
> Is that correct assumption?
>
It might be correct but I’m not quite sure. Try it. There is a transition
from no media state and FastFat tries to check if media was changed. Maybe
it doesn’t if there was nothing previously. Anyway, you couln’t use files on
removable media and exchange files. Are you sure you won’t need it later?

Best regards,

Michal Vodicka
Veridicom
(RKK - Skytale)
[WWW: http://www.veridicom.com , http://www.skytale.com]


You are currently subscribed to ntdev as: xxxxx@home.nl
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hi

I only know the CDRom version and there you should return success and
return the change count. IF the change count doesn’t change NT assumes
the media didn’t change. Otherwise it might start a remount or so.

Jos


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com