diff --git a/lib/MSWindows/aspi32.c b/lib/MSWindows/aspi32.c index fa33b302..a78316a6 100644 --- a/lib/MSWindows/aspi32.c +++ b/lib/MSWindows/aspi32.c @@ -1,5 +1,5 @@ /* - $Id: aspi32.c,v 1.28 2004/07/17 15:31:00 rocky Exp $ + $Id: aspi32.c,v 1.29 2004/07/18 06:51:49 rocky Exp $ Copyright (C) 2004 Rocky Bernstein @@ -27,7 +27,7 @@ # include "config.h" #endif -static const char _rcsid[] = "$Id: aspi32.c,v 1.28 2004/07/17 15:31:00 rocky Exp $"; +static const char _rcsid[] = "$Id: aspi32.c,v 1.29 2004/07/18 06:51:49 rocky Exp $"; #include #include @@ -730,11 +730,13 @@ init_cdtext_aspi (_img_private_t *env) Return the the kind of drive capabilities of device. */ -cdio_drive_cap_t -get_drive_cap_aspi (const _img_private_t *env) +void +get_drive_cap_aspi (const _img_private_t *env, + cdio_drive_read_cap_t *p_read_cap, + cdio_drive_write_cap_t *p_write_cap, + cdio_drive_misc_cap_t *p_misc_cap) { uint8_t scsi_cdb[10] = { 0, }; - int32_t i_drivetype = CDIO_DRIVE_CAP_CD_AUDIO | CDIO_DRIVE_CAP_UNKNOWN; uint8_t buf[256] = { 0, }; /* Set up passthrough command */ @@ -746,13 +748,14 @@ get_drive_cap_aspi (const _img_private_t *env) if (!scsi_passthrough_aspi(env, scsi_cdb, sizeof(scsi_cdb), buf, sizeof(buf))) { - return i_drivetype; + *p_read_cap = CDIO_DRIVE_CAP_UNKNOWN; + *p_write_cap = CDIO_DRIVE_CAP_UNKNOWN; + *p_misc_cap = CDIO_DRIVE_CAP_UNKNOWN; } else { BYTE *p; int lenData = ((unsigned int)buf[0] << 8) + buf[1]; BYTE *pMax = buf + 256; - i_drivetype = 0; /* set to first sense mask, and then walk through the masks */ p = buf + 8; while( (p < &(buf[2+lenData])) && (p < pMax) ) { @@ -767,14 +770,13 @@ get_drive_cap_aspi (const _img_private_t *env) /* Don't handle these yet. */ break; case CDIO_MMC_CAPABILITIES_PAGE: - i_drivetype |= cdio_get_drive_cap_mmc(p); + cdio_get_drive_cap_mmc(p, p_read_cap, p_write_cap, p_misc_cap); break; default: ; } p += (p[1] + 2); } } - return i_drivetype; } /*! diff --git a/lib/MSWindows/aspi32.h b/lib/MSWindows/aspi32.h index e07161e4..3c6f6976 100644 --- a/lib/MSWindows/aspi32.h +++ b/lib/MSWindows/aspi32.h @@ -1,6 +1,6 @@ /* Win32 aspi specific */ /* - $Id: aspi32.h,v 1.8 2004/07/17 09:12:21 rocky Exp $ + $Id: aspi32.h,v 1.9 2004/07/18 06:51:49 rocky Exp $ Copyright (C) 2003, 2004 Rocky Bernstein @@ -172,7 +172,10 @@ SRB_HAInquiry; string when done with it. */ -cdio_drive_cap_t get_drive_cap_aspi (const _img_private_t *env); +void get_drive_cap_aspi (const _img_private_t *env, + cdio_drive_read_cap_t *p_read_cap, + cdio_drive_write_cap_t *p_write_cap, + cdio_drive_misc_cap_t *p_misc_cap); /*! Return the the kind of drive capabilities of device. diff --git a/lib/MSWindows/win32.c b/lib/MSWindows/win32.c index 8839537d..b7fb1302 100644 --- a/lib/MSWindows/win32.c +++ b/lib/MSWindows/win32.c @@ -1,5 +1,5 @@ /* - $Id: win32.c,v 1.24 2004/07/17 10:05:54 rocky Exp $ + $Id: win32.c,v 1.25 2004/07/18 06:51:49 rocky Exp $ Copyright (C) 2003, 2004 Rocky Bernstein @@ -26,7 +26,7 @@ # include "config.h" #endif -static const char _rcsid[] = "$Id: win32.c,v 1.24 2004/07/17 10:05:54 rocky Exp $"; +static const char _rcsid[] = "$Id: win32.c,v 1.25 2004/07/18 06:51:49 rocky Exp $"; #include #include @@ -107,16 +107,20 @@ cdio_is_cdrom(const char drive_letter) { string when done with it. */ -static cdio_drive_cap_t -_cdio_get_drive_cap (const void *env) { +static void +_cdio_get_drive_cap (const void *env, + cdio_drive_read_cap_t *p_read_cap, + cdio_drive_write_cap_t *p_write_cap, + cdio_drive_misc_cap_t *p_misc_cap) +{ const _img_private_t *_obj = env; if (_obj->hASPI) { /* A safe guess */ - return get_drive_cap_aspi (env); + get_drive_cap_aspi (env, p_read_cap, p_write_cap, p_misc_cap); } else { - return get_drive_cap_win32ioctl (env); + get_drive_cap_win32ioctl (env, p_read_cap, p_write_cap, p_misc_cap); } } diff --git a/lib/MSWindows/win32.h b/lib/MSWindows/win32.h index a3f0503f..6ffb2a29 100644 --- a/lib/MSWindows/win32.h +++ b/lib/MSWindows/win32.h @@ -1,5 +1,5 @@ /* - $Id: win32.h,v 1.12 2004/07/17 10:05:54 rocky Exp $ + $Id: win32.h,v 1.13 2004/07/18 06:51:49 rocky Exp $ Copyright (C) 2004 Rocky Bernstein @@ -120,7 +120,10 @@ bool init_cdtext_win32ioctl (_img_private_t *env); string when done with it. */ -cdio_drive_cap_t get_drive_cap_aspi (const _img_private_t *env); +void get_drive_cap_aspi (const _img_private_t *env, + cdio_drive_read_cap_t *p_read_cap, + cdio_drive_write_cap_t *p_write_cap, + cdio_drive_misc_cap_t *p_misc_cap); /*! Return the the kind of drive capabilities of device. @@ -129,7 +132,10 @@ cdio_drive_cap_t get_drive_cap_aspi (const _img_private_t *env); string when done with it. */ -cdio_drive_cap_t get_drive_cap_win32ioctl (const _img_private_t *env); +void get_drive_cap_win32ioctl (const _img_private_t *env, + cdio_drive_read_cap_t *p_read_cap, + cdio_drive_write_cap_t *p_write_cap, + cdio_drive_misc_cap_t *p_misc_cap); /*! Get the format (XA, DATA, AUDIO) of a track. diff --git a/lib/MSWindows/win32_ioctl.c b/lib/MSWindows/win32_ioctl.c index fdbde04e..13273680 100644 --- a/lib/MSWindows/win32_ioctl.c +++ b/lib/MSWindows/win32_ioctl.c @@ -1,5 +1,5 @@ /* - $Id: win32_ioctl.c,v 1.17 2004/07/17 15:31:00 rocky Exp $ + $Id: win32_ioctl.c,v 1.18 2004/07/18 06:51:49 rocky Exp $ Copyright (C) 2004 Rocky Bernstein @@ -26,7 +26,7 @@ # include "config.h" #endif -static const char _rcsid[] = "$Id: win32_ioctl.c,v 1.17 2004/07/17 15:31:00 rocky Exp $"; +static const char _rcsid[] = "$Id: win32_ioctl.c,v 1.18 2004/07/18 06:51:49 rocky Exp $"; #include #include @@ -514,10 +514,12 @@ get_track_format_win32ioctl(const _img_private_t *env, track_t i_track) string when done with it. */ -cdio_drive_cap_t -get_drive_cap_win32ioctl (const _img_private_t *env) +void +get_drive_cap_win32ioctl (const _img_private_t *env, + cdio_drive_read_cap_t *p_read_cap, + cdio_drive_write_cap_t *p_write_cap, + cdio_drive_misc_cap_t *p_misc_cap) { - int32_t i_drivetype = 0; SCSI_PASS_THROUGH_WITH_BUFFERS sptwb; ULONG returned = 0; ULONG length; @@ -559,16 +561,17 @@ get_drive_cap_win32ioctl (const _img_private_t *env) &sptwb, length, &returned, - FALSE) ) - { - unsigned int n=sptwb.DataBuf[3]+4; - /* Reader? */ - i_drivetype |= cdio_get_drive_cap_mmc(&(sptwb.DataBuf[n])); - return i_drivetype; - } else { - i_drivetype = CDIO_DRIVE_CAP_CD_AUDIO | CDIO_DRIVE_CAP_UNKNOWN; - } - return CDIO_DRIVE_CAP_ERROR; + FALSE) ) { + unsigned int n=sptwb.DataBuf[3]+4; + /* Reader? */ + cdio_get_drive_cap_mmc(&(sptwb.DataBuf[n]), p_read_cap, + p_write_cap, p_misc_cap); + } else { + *p_read_cap = CDIO_DRIVE_CAP_UNKNOWN; + *p_write_cap = CDIO_DRIVE_CAP_UNKNOWN; + *p_misc_cap = CDIO_DRIVE_CAP_UNKNOWN; + } + return; } #endif /*HAVE_WIN32_CDROM*/