Closer to having RW access working

This commit is contained in:
R. Bernstein
2009-12-31 23:58:01 -05:00
parent b609aab0eb
commit 4819e7e0c4
2 changed files with 27 additions and 6 deletions

View File

@@ -227,6 +227,10 @@ str_to_access_mode_win32(const char *psz_access_mode)
#else #else
return _AM_ASPI; return _AM_ASPI;
#endif #endif
} else if (!strcmp(psz_access_mode, "MMC_RDWR")) {
return _AM_MMC_RDWR;
} else if (!strcmp(psz_access_mode, "MMC_RDWR_EXCL")) {
return _AM_MMC_RDWR_EXCL;
} else { } else {
cdio_warn ("unknown access type: %s. Default used instead.", cdio_warn ("unknown access type: %s. Default used instead.",
psz_access_mode); psz_access_mode);
@@ -315,10 +319,17 @@ init_win32 (void *p_user_data)
p_env->b_ioctl_init = false; p_env->b_ioctl_init = false;
if ( _AM_IOCTL == p_env->access_mode ) { switch (p_env->access_mode) {
case _AM_IOCTL:
case _AM_MMC_RDWR:
case _AM_MMC_RDWR_EXCL:
b_ret = init_win32ioctl(p_env); b_ret = init_win32ioctl(p_env);
} else { break;
case _AM_ASPI:
b_ret = init_aspi(p_env); b_ret = init_aspi(p_env);
break;
default:
return 0;
} }
/* It looks like get_media_changed_mmc will always /* It looks like get_media_changed_mmc will always
@@ -646,11 +657,19 @@ get_arg_win32 (void *p_user_data, const char key[])
if (!strcmp (key, "source")) { if (!strcmp (key, "source")) {
return p_env->gen.source_name; return p_env->gen.source_name;
} else if (!strcmp (key, "access-mode")) { } else if (!strcmp (key, "access-mode")) {
if (p_env->hASPI) switch (p_env->access_mode) {
case _AM_IOCTL:
return "IOCTL";
case _AM_ASPI:
return "ASPI"; return "ASPI";
else case _AM_MMC_RDWR:
return "ioctl"; return "MMC_RDWR";
} case _AM_MMC_RDWR_EXCL:
return "MMC_RDWR_EXCL";
case _AM_NONE:
return "no access method";
}
}
return NULL; return NULL;
} }

View File

@@ -32,6 +32,8 @@ typedef enum {
_AM_NONE, _AM_NONE,
_AM_IOCTL, _AM_IOCTL,
_AM_ASPI, _AM_ASPI,
_AM_MMC_RDWR,
_AM_MMC_RDWR_EXCL,
} access_mode_t; } access_mode_t;
typedef struct { typedef struct {