win32_ioctl.c: minor comment or function name changes.
aspi32.c: use length definitions better.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
$Id: aspi32.c,v 1.50 2004/10/27 01:16:39 rocky Exp $
|
$Id: aspi32.c,v 1.51 2004/11/07 06:36:53 rocky Exp $
|
||||||
|
|
||||||
Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
|
Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
# include "config.h"
|
# include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const char _rcsid[] = "$Id: aspi32.c,v 1.50 2004/10/27 01:16:39 rocky Exp $";
|
static const char _rcsid[] = "$Id: aspi32.c,v 1.51 2004/11/07 06:36:53 rocky Exp $";
|
||||||
|
|
||||||
#include <cdio/cdio.h>
|
#include <cdio/cdio.h>
|
||||||
#include <cdio/sector.h>
|
#include <cdio/sector.h>
|
||||||
@@ -682,8 +682,7 @@ read_toc_aspi (_img_private_t *p_env)
|
|||||||
int i, i_toclength;
|
int i, i_toclength;
|
||||||
unsigned char *p_fulltoc;
|
unsigned char *p_fulltoc;
|
||||||
|
|
||||||
i_toclength = 4 /* header */ + tocheader[0] +
|
i_toclength = 4 /* header */ + CDIO_MMC_GET_LEN16(tocheader);
|
||||||
((unsigned int) tocheader[1] << 8);
|
|
||||||
|
|
||||||
p_fulltoc = malloc( i_toclength );
|
p_fulltoc = malloc( i_toclength );
|
||||||
|
|
||||||
@@ -704,10 +703,8 @@ read_toc_aspi (_img_private_t *p_env)
|
|||||||
|
|
||||||
for( i = 0 ; i <= p_env->gen.i_tracks ; i++ ) {
|
for( i = 0 ; i <= p_env->gen.i_tracks ; i++ ) {
|
||||||
int i_index = 8 + 8 * i;
|
int i_index = 8 + 8 * i;
|
||||||
p_env->tocent[ i ].start_lsn = ((int)p_fulltoc[ i_index ] << 24) +
|
unsigned char *p = &(p_fulltoc[ i_index ]);
|
||||||
((int)p_fulltoc[ i_index+1 ] << 16) +
|
p_env->tocent[ i ].start_lsn = CDIO_GET_LEN_32(p);
|
||||||
((int)p_fulltoc[ i_index+2 ] << 8) +
|
|
||||||
(int)p_fulltoc[ i_index+3 ];
|
|
||||||
p_env->tocent[ i ].Control = (UCHAR)p_fulltoc[ 1 + 8 * i ];
|
p_env->tocent[ i ].Control = (UCHAR)p_fulltoc[ 1 + 8 * i ];
|
||||||
|
|
||||||
cdio_debug( "p_sectors: %i %lu",
|
cdio_debug( "p_sectors: %i %lu",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
$Id: win32_ioctl.c,v 1.42 2004/11/07 06:22:49 rocky Exp $
|
$Id: win32_ioctl.c,v 1.43 2004/11/07 06:36:53 rocky Exp $
|
||||||
|
|
||||||
Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
|
Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
# include "config.h"
|
# include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const char _rcsid[] = "$Id: win32_ioctl.c,v 1.42 2004/11/07 06:22:49 rocky Exp $";
|
static const char _rcsid[] = "$Id: win32_ioctl.c,v 1.43 2004/11/07 06:36:53 rocky Exp $";
|
||||||
|
|
||||||
#ifdef HAVE_WIN32_CDROM
|
#ifdef HAVE_WIN32_CDROM
|
||||||
|
|
||||||
@@ -548,7 +548,7 @@ init_win32ioctl (_img_private_t *env)
|
|||||||
false if an error.
|
false if an error.
|
||||||
*/
|
*/
|
||||||
static bool
|
static bool
|
||||||
read_toc_win32mmc (_img_private_t *p_env)
|
read_fulltoc_win32mmc (_img_private_t *p_env)
|
||||||
{
|
{
|
||||||
scsi_mmc_cdb_t cdb = {{0, }};
|
scsi_mmc_cdb_t cdb = {{0, }};
|
||||||
CDROM_TOC_FULL cdrom_toc_full;
|
CDROM_TOC_FULL cdrom_toc_full;
|
||||||
@@ -648,9 +648,10 @@ read_toc_win32ioctl (_img_private_t *p_env)
|
|||||||
|
|
||||||
if ( ! p_env ) return false;
|
if ( ! p_env ) return false;
|
||||||
|
|
||||||
if ( read_toc_win32mmc(p_env) ) return true;
|
if ( read_fulltoc_win32mmc(p_env) ) return true;
|
||||||
|
|
||||||
/* No SCSI MMC READ_TOC (FULTOC) read via DeviceIoControl as fallback */
|
/* SCSI-MMC READ_TOC (FULTOC) read failed. Try reading TOC via
|
||||||
|
DeviceIoControl instead */
|
||||||
if( DeviceIoControl( p_env->h_device_handle,
|
if( DeviceIoControl( p_env->h_device_handle,
|
||||||
IOCTL_CDROM_READ_TOC,
|
IOCTL_CDROM_READ_TOC,
|
||||||
NULL, 0, &cdrom_toc, sizeof(CDROM_TOC),
|
NULL, 0, &cdrom_toc, sizeof(CDROM_TOC),
|
||||||
|
|||||||
Reference in New Issue
Block a user