Just to elaborate, starting from Microsoft Windows XP, Win32 contains quite a few CDROM commands. But most of them are really wrappers to the raw CDROM commands which can be found in SCSI3 MMC doc. You can get a draft version from:
www.t10.org and click on 'SCSI-3 Standards Architecture'
I suggest you read up on this first. You will need to know how to work with raw commands to understand what's happening. This isn't all, you will also need to be able to work with Win32 DeviceIOControl with SCSI_PASS_THROUGH (SPT) or SCSI_PASS_THROUGH_DIRECT (SPTD) codes, or with WinASPI32 interface.
There is a limited C2 info command which works on some drives. But you won't find detailed error commands in there as they are kept under wraps by manufactuers. The source code mentioned contains the special raw commands for some of the newer Plextor drives.