Commit d5b4232a authored by Alexandre Julliard's avatar Alexandre Julliard

Added set_win32_error() for error codes that don't have an NT status

equivalent.
parent 36002739
......@@ -454,16 +454,16 @@ void file_set_error(void)
case EROFS: set_error( STATUS_MEDIA_WRITE_PROTECTED ); break;
case EBUSY: set_error( STATUS_FILE_LOCK_CONFLICT ); break;
case ENOENT: set_error( STATUS_NO_SUCH_FILE ); break;
case EISDIR: set_error( 0xc0010000 | ERROR_CANNOT_MAKE /* FIXME */ ); break;
case EISDIR: set_win32_error( ERROR_CANNOT_MAKE ); break;
case ENFILE:
case EMFILE: set_error( STATUS_NO_MORE_FILES ); break;
case EEXIST: set_error( STATUS_OBJECT_NAME_COLLISION ); break;
case EINVAL: set_error( STATUS_INVALID_PARAMETER ); break;
case ESPIPE: set_error( 0xc0010000 | ERROR_SEEK /* FIXME */ ); break;
case ESPIPE: set_win32_error( ERROR_SEEK ); break;
case ENOTEMPTY: set_error( STATUS_DIRECTORY_NOT_EMPTY ); break;
case EIO: set_error( STATUS_ACCESS_VIOLATION ); break;
case EOVERFLOW: set_error( STATUS_INVALID_PARAMETER ); break;
default: perror("file_set_error"); set_error( ERROR_UNKNOWN /* FIXME */ ); break;
default: perror("file_set_error"); set_win32_error( ERROR_UNKNOWN ); break;
}
}
......
......@@ -144,7 +144,8 @@ extern unsigned int global_error; /* global error code for when no thread is cu
static inline unsigned int get_error(void) { return current ? current->error : global_error; }
static inline void set_error( unsigned int err ) { global_error = err; if (current) current->error = err; }
static inline void clear_error(void) { set_error(0); }
static inline void clear_error(void) { set_error(0); }
static inline void set_win32_error( unsigned int err ) { set_error( 0xc0010000 | err ); }
static inline thread_id_t get_thread_id( struct thread *thread ) { return thread->id; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment