7878#define windows_error (loglevel ,i_err ) { \
7979 char error_msg[80]; \
8080 long int count; \
81- count = FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM, \
81+ count = FormatMessageA (FORMAT_MESSAGE_FROM_SYSTEM, \
8282 NULL, i_err, MAKELANGID(LANG_NEUTRAL, \
8383 SUBLANG_DEFAULT), \
8484 error_msg, sizeof(error_msg), NULL); \
@@ -377,7 +377,7 @@ close_tray_win32ioctl (const char *psz_win32_drive)
377377 dw_access_flags = GENERIC_READ |GENERIC_WRITE ; /* add gen write on W2k/XP */
378378 else dw_access_flags = GENERIC_READ ;
379379
380- h_device_handle = CreateFile ( psz_win32_drive ,
380+ h_device_handle = CreateFileA ( psz_win32_drive ,
381381 dw_access_flags ,
382382 FILE_SHARE_READ | FILE_SHARE_WRITE ,
383383 NULL ,
@@ -471,7 +471,7 @@ set_scsi_tuple_win32ioctl(_img_private_t *env)
471471 Return DRIVER_OP_SUCCESS if command completed successfully.
472472 */
473473#ifdef USE_PASSTHROUGH_DIRECT
474- int
474+ driver_return_code_t
475475run_mmc_cmd_win32ioctl ( void * p_user_data ,
476476 unsigned int u_timeout_ms ,
477477 unsigned int u_cdb , const mmc_cdb_t * p_cdb ,
@@ -568,7 +568,7 @@ run_mmc_cmd_win32ioctl( void *p_user_data,
568568 return rc ;
569569}
570570#else
571- int
571+ driver_return_code_t
572572run_mmc_cmd_win32ioctl ( void * p_user_data ,
573573 unsigned int u_timeout_ms ,
574574 unsigned int u_cdb , const mmc_cdb_t * p_cdb ,
@@ -791,7 +791,7 @@ is_cdrom_win32ioctl(const char c_drive_letter)
791791 sz_win32_drive [2 ]= '\\' ;
792792 sz_win32_drive [3 ]= '\0' ;
793793
794- uDriveType = GetDriveType (sz_win32_drive );
794+ uDriveType = GetDriveTypeA (sz_win32_drive );
795795
796796 switch (uDriveType ) {
797797 case DRIVE_CDROM : {
@@ -839,7 +839,7 @@ read_audio_sectors_win32ioctl (_img_private_t *p_env, void *data, lsn_t lsn,
839839 Reads a single raw sector using the DeviceIoControl method into
840840 data starting from lsn. Returns 0 if no error.
841841 */
842- static int
842+ static driver_return_code_t
843843read_raw_sector (_img_private_t * p_env , void * p_buf , lsn_t lsn )
844844{
845845 mmc_cdb_t cdb = {{0 , }};
@@ -861,7 +861,7 @@ read_raw_sector (_img_private_t *p_env, void *p_buf, lsn_t lsn)
861861 Reads a single mode2 sector using the DeviceIoControl method into
862862 data starting from lsn. Returns 0 if no error.
863863 */
864- int
864+ driver_return_code_t
865865read_mode2_sector_win32ioctl (_img_private_t * p_env , void * p_data ,
866866 lsn_t lsn , bool b_form2 )
867867{
@@ -882,7 +882,7 @@ read_mode2_sector_win32ioctl (_img_private_t *p_env, void *p_data,
882882 Reads a single mode2 sector using the DeviceIoControl method into
883883 data starting from lsn. Returns 0 if no error.
884884 */
885- int
885+ driver_return_code_t
886886read_mode1_sector_win32ioctl (_img_private_t * env , void * data ,
887887 lsn_t lsn , bool b_form2 )
888888{
@@ -962,7 +962,7 @@ init_win32ioctl (_img_private_t *env)
962962 "\\\\.\\%c:" ,
963963 env -> gen .source_name [len - 2 ] );
964964
965- env -> h_device_handle = CreateFile ( psz_win32_drive ,
965+ env -> h_device_handle = CreateFileA ( psz_win32_drive ,
966966 dw_access_flags ,
967967 FILE_SHARE_READ | FILE_SHARE_WRITE ,
968968 NULL ,
@@ -974,7 +974,7 @@ init_win32ioctl (_img_private_t *env)
974974 {
975975 /* No good. try toggle write. */
976976 dw_access_flags ^= GENERIC_WRITE ;
977- env -> h_device_handle = CreateFile ( psz_win32_drive ,
977+ env -> h_device_handle = CreateFileA ( psz_win32_drive ,
978978 dw_access_flags ,
979979 FILE_SHARE_READ ,
980980 NULL ,
0 commit comments