From: Ludovic Henry Date: Thu, 17 Aug 2017 17:03:40 +0000 (+0200) Subject: [w32error] Add ENODEV -> ERROR_DEV_NOT_EXIST error translation (#5385) X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=mono.git;a=commitdiff_plain;h=91288cad6a6c093ee1ca9b072219144c8bac9f75 [w32error] Add ENODEV -> ERROR_DEV_NOT_EXIST error translation (#5385) Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=58738 --- diff --git a/mcs/class/System/ReferenceSources/Win32Exception.cs b/mcs/class/System/ReferenceSources/Win32Exception.cs index d5b1e3863d6..a18b9fba8f6 100644 --- a/mcs/class/System/ReferenceSources/Win32Exception.cs +++ b/mcs/class/System/ReferenceSources/Win32Exception.cs @@ -46,6 +46,7 @@ namespace System.ComponentModel case 32: /* ERROR_SHARING_VIOLATION */ return "Sharing violation"; case 33: /* ERROR_LOCK_VIOLATION */ return "Lock violation"; case 50: /* ERROR_NOT_SUPPORTED */ return "Operation not supported"; + case 55: /* ERROR_DEV_NOT_EXIST */ return "Device does not exist"; case 87: /* ERROR_INVALID_PARAMETER */ return "Invalid parameter"; case 120: /* ERROR_CALL_NOT_IMPLEMENTED */ return "Call not implemented"; case 123: /* ERROR_INVALID_NAME */ return "Invalid name"; @@ -143,7 +144,6 @@ namespace System.ComponentModel case 52: /* ERROR_DUP_NAME */ return "Duplicate name"; case 53: /* ERROR_BAD_NETPATH */ return "Bad netpath"; case 54: /* ERROR_NETWORK_BUSY */ return "Network busy"; - case 55: /* ERROR_DEV_NOT_EXIST */ return "Device does not exist"; case 56: /* ERROR_TOO_MANY_CMDS */ return "Too many commands"; case 57: /* ERROR_ADAP_HDW_ERR */ return "ADAP HDW error"; case 58: /* ERROR_BAD_NET_RESP */ return "Bad net response"; diff --git a/mono/metadata/w32error-unix.c b/mono/metadata/w32error-unix.c index df41473dfe8..d25681126a4 100644 --- a/mono/metadata/w32error-unix.c +++ b/mono/metadata/w32error-unix.c @@ -66,6 +66,9 @@ mono_w32error_unix_to_win32 (guint32 error) case EINTR: return ERROR_IO_PENDING; /* best match I could find */ case EPIPE: return ERROR_WRITE_FAULT; case ELOOP: return ERROR_CANT_RESOLVE_FILENAME; +#ifdef ENODEV + case ENODEV: return ERROR_DEV_NOT_EXIST; +#endif default: g_error ("%s: unknown error (%d) \"%s\"", __FILE__, error, g_strerror (error)); diff --git a/mono/metadata/w32error.h b/mono/metadata/w32error.h index bd42451469f..e66f920b42a 100644 --- a/mono/metadata/w32error.h +++ b/mono/metadata/w32error.h @@ -31,6 +31,7 @@ #define ERROR_LOCK_VIOLATION 33 #define ERROR_HANDLE_DISK_FULL 39 #define ERROR_NOT_SUPPORTED 50 +#define ERROR_DEV_NOT_EXIST 55 #define ERROR_FILE_EXISTS 80 #define ERROR_CANNOT_MAKE 82 #define ERROR_INVALID_PARAMETER 87