How to monitor CDROM and Floppy?

Hi, everyone:

I am using IFS kit 2003 SP1 for developping file system filtering driver.

Does anyone know how to detect CDROM/Floppy insert and eject action?

Hi Jian!!

refer to the documentation on IRP_MJ_PNP.
Filter the IRP_MJ_PNP requests and check out the Minor Function codes:
IRP_MN_CANCEL_REMOVE_DEVICE
IRP_MN_QUERY_REMOVE_DEVICE
IRP_MN_REMOVE_DEVICE
IRP_MN_START_DEVICE
IRP_MN_SURPRISE_REMOVAL

i think that should be helpful…

^Happy Filtering^
Ayush Gupta
Calsoft Pvt. Ltd.

In case of CDROM, the CD is mounted after it is inserted.
I think u can check for the IRP_MJ_MOUNT_VOLUME request.

^Happy Filtering^
Ayush Gupta
Calsoft Pvt. Ltd.

Hi, ayush:

Thanks for your help.

But the problem is that sometimes it can get IRP_MJ_MOUNT_VOLUME in the filter’s pre or post callback, but sometimes cannot, and can get on some machine, but cannot get on other machines,
which puzzles me a lot.

ya!
Many a times when u remove a cd from the tray, it so happens that in explorer u can see the icon / folders of the cd. I think it happens since the explorer as far as i think caches the info. If it is not able to refresh it, the volume dismount requests does not come.
Similar thing goes for the mounting too. Many a times, the volume is mounted on first access to the cd.
Read the topic “Mounting a Volume” in the IFS docs.
that would clarify your doubts.
i think u should try out filtering the IRP_MJ_PNP requests. i dunno much about PNP but u should try it out.

Ayush Gupta
Calsoft Pvt. Ltd.

Much better idea would be to ping device PDO with TEST_UNIT_READY (0x00) or GET_EVENT_STATUS_NOTIFICATION (0x4A) CDBs
and watch response changes from “no media” -> “fully ready”. At least Windows and Linux auto-mounters do exactly this…

Regards,
Anton A. Kolomyeytsev

CEO, Rocket Division Software

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.com
Sent: Wednesday, December 20, 2006 11:38 AM
To: Windows File Systems Devs Interest List
Subject: RE:[ntfsd] How to monitor CDROM and Floppy?

In case of CDROM, the CD is mounted after it is inserted.
I think u can check for the IRP_MJ_MOUNT_VOLUME request.

^Happy Filtering^
Ayush Gupta
Calsoft Pvt. Ltd.


Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@rocketdivision.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

> Many a times when u remove a cd from the tray, it so happens that in

explorer u can see the icon / folders of the cd. I think it happens since
the explorer as far as i think caches the info. If it is not able to
refresh it, the volume dismount requests does not come.

If AUTOPLAY is on, the cdrom.sys set the event in a signal state when the
media is changed.


Slava Imameyev, xxxxx@hotmail.com

wrote in message news:xxxxx@ntfsd…
> ya!
> Many a times when u remove a cd from the tray, it so happens that in
> explorer u can see the icon / folders of the cd. I think it happens since
> the explorer as far as i think caches the info. If it is not able to
> refresh it, the volume dismount requests does not come.
> Similar thing goes for the mounting too. Many a times, the volume is
> mounted on first access to the cd.
> Read the topic “Mounting a Volume” in the IFS docs.
> that would clarify your doubts.
> i think u should try out filtering the IRP_MJ_PNP requests. i dunno much
> about PNP but u should try it out.
>
> Ayush Gupta
> Calsoft Pvt. Ltd.
>

> Much better idea would be to ping device PDO with TEST_UNIT_READY (0x00)

or GET_EVENT_STATUS_NOTIFICATION (0x4A)

Yes, the cdrom.sys uses GET_EVENT_STATUS_NOTIFICATION if possible and
polling with TEST_UNIT_READY otherwise.


Slava Imameyev, xxxxx@hotmail.com

“Anton A. Kolomyeytsev” wrote in message
news:xxxxx@ntfsd…
Much better idea would be to ping device PDO with TEST_UNIT_READY (0x00) or
GET_EVENT_STATUS_NOTIFICATION (0x4A) CDBs
and watch response changes from “no media” -> “fully ready”. At least
Windows and Linux auto-mounters do exactly this…

Regards,
Anton A. Kolomyeytsev

CEO, Rocket Division Software

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.com
Sent: Wednesday, December 20, 2006 11:38 AM
To: Windows File Systems Devs Interest List
Subject: RE:[ntfsd] How to monitor CDROM and Floppy?

In case of CDROM, the CD is mounted after it is inserted.
I think u can check for the IRP_MJ_MOUNT_VOLUME request.

^Happy Filtering^
Ayush Gupta
Calsoft Pvt. Ltd.


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@rocketdivision.com
To unsubscribe send a blank email to xxxxx@lists.osr.com