ntdll: Always set a valid SUB_Q_HEADER AudioStatus for CD-ROMs.

Michael Stefaniuc mstefani at redhat.de
Tue Sep 11 17:17:50 CDT 2012


Broken CD-ROMs aka "copy protected" by not following the standard will
give an invalid CD sub-channel audio status; Linux happily passes that
on to the application.

---
The educational game at hand requires the CD to run. It is a mixed mode CD with
audio tracks but trying to access them makes the DVD drive blink wildly and
basically lock up until the CD is ejected.

The struct cdrom_subchnl.cdsc_audiostatus returned is 0x0A which is invalid:
    95.846:0024:trace:cdrom:CDROM_ReadQChannel status=0A !
All valid audio status except AUDIO_STATUS_NOT_SUPPORTED will make the
program continue. The program is not happy with uninitialized memory nor
the invalid status 0x0A.



 dlls/ntdll/cdrom.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/dlls/ntdll/cdrom.c b/dlls/ntdll/cdrom.c
index 87e0695..ea7f01a 100644
--- a/dlls/ntdll/cdrom.c
+++ b/dlls/ntdll/cdrom.c
@@ -924,7 +924,7 @@ static NTSTATUS CDROM_ReadQChannel(int dev, int fd, const CDROM_SUB_Q_DATA_FORMA
         break;
     default:
 	TRACE("status=%02X !\n", sc.cdsc_audiostatus);
-        break;
+        hdr->AudioStatus = AUDIO_STATUS_NO_STATUS;
     }
     switch (fmt->Format)
     {
@@ -1035,6 +1035,7 @@ static NTSTATUS CDROM_ReadQChannel(int dev, int fd, const CDROM_SUB_Q_DATA_FORMA
         break;
     default:
 	TRACE("status=%02X !\n", sc.header.audio_status);
+        hdr->AudioStatus = AUDIO_STATUS_NO_STATUS;
     }
     switch (fmt->Format)
     {
-- 
1.7.6.5



More information about the wine-patches mailing list