Take a look at the platform SDK: Base Services->Hardware->Device Input and Output->Device Input and Output Reference->Device Input and Output Control Codes->IOCTL_STORAGE_CHECK_VERIFY.
This is untested, but is a possibility to see if it has a CD loaded or not.