How to handle operations during EJECT

Hi All,

I want to handle some opeartions when the media from a WRITER is ejected.

when i eject the media the IRP_MJ_DEVICE_CONTROL is invoked .
But how can i determine that the IRP_MJ_DEVICE_CONTROL is for eject operation only.
As the same IRP can be called at several other instances also.

should i handle it in DEVICE CONTROL or are there any other places to handle it.

thanx for spending time at my doubt.
Pls reply with ur valuable suggestions.

thank you

Sridhar.D