diff --git a/lib/driver/MSWindows/aspi32.c b/lib/driver/MSWindows/aspi32.c index d1416fee..8ef84cb8 100644 --- a/lib/driver/MSWindows/aspi32.c +++ b/lib/driver/MSWindows/aspi32.c @@ -1,5 +1,5 @@ /* - Copyright (C) 2004, 2005, 2008, 2009 Rocky Bernstein + Copyright (C) 2004, 2005, 2008, 2009, 2010 Rocky Bernstein This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -155,7 +155,7 @@ have_aspi( HMODULE *hASPI, *hASPI = LoadLibrary( "wnaspi32.dll" ); if( *hASPI == NULL ) { - cdio_debug("Unable to load ASPI DLL"); + cdio_warn("Unable to load ASPI DLL"); return false; } diff --git a/lib/driver/MSWindows/win32.c b/lib/driver/MSWindows/win32.c index d79641cc..79b39e4f 100644 --- a/lib/driver/MSWindows/win32.c +++ b/lib/driver/MSWindows/win32.c @@ -1,7 +1,6 @@ /* - $Id: win32.c,v 1.37 2008/04/21 18:30:21 karl Exp $ - - Copyright (C) 2003, 2004, 2005, 2006, 2008 Rocky Bernstein + Copyright (C) 2003, 2004, 2005, 2006, 2008, 2010 + Rocky Bernstein This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -646,6 +645,23 @@ eject_media_win32 (void *p_user_data) return open_close_media_win32(psz_drive, MCI_SET_DOOR_OPEN); } +static bool +is_mmc_supported(void *user_data) +{ + _img_private_t *env = user_data; + switch (env->access_mode) { + case _AM_NONE: + return false; + case _AM_IOCTL: + case _AM_ASPI: + case _AM_MMC_RDWR: + case _AM_MMC_RDWR_EXCL: + return true; + } + /* Not reached. */ + return false; +} + /*! Return the value associated with the key "arg". */ @@ -669,6 +685,8 @@ get_arg_win32 (void *p_user_data, const char key[]) case _AM_NONE: return "no access method"; } + } else if (!strcmp (key, "mmc-supported?")) { + return is_mmc_supported(p_user_data) ? "true" : "false"; } return NULL; } diff --git a/test/driver/win32.c b/test/driver/win32.c index d45b46ba..b7c069a0 100644 --- a/test/driver/win32.c +++ b/test/driver/win32.c @@ -1,5 +1,5 @@ /* -*- C -*- - Copyright (C) 2009 Rocky Bernstein + Copyright (C) 2009, 2010 Rocky Bernstein This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -81,13 +81,23 @@ main(int argc, const char *argv[]) p_cdio = cdio_open_am_win32(ppsz_drives[0], "ioctl"); if (p_cdio) { const char *psz_access_mode = cdio_get_arg(p_cdio, "access-mode"); + const char *psz_response = cdio_get_arg(p_cdio, "mmc-supported?"); if (0 != strncmp(psz_access_mode, "ioctl", strlen("ioctl"))) { fprintf(stderr, "Got %s; Should get back %s, the access mode requested.\n", psz_access_mode, "ioctl"); - exit(2); + exit(3); } + + if ( psz_response == NULL || + ((0 != strncmp("true", psz_response, sizeof("true")))) ) { + fprintf(stderr, + "cdio_get_arg(\"mmc-supported?\") should return \"true\"; got: %s.\n", + psz_response); + exit(4); + } + } cdio_destroy(p_cdio);