File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -113,6 +113,20 @@ FileHandle* XCreateFileA
113113 {
114114#ifdef _WIN32
115115 GuestThread::SetLastError (GetLastError ());
116+ #else
117+ switch (errno)
118+ {
119+ case EACCES :
120+ GuestThread::SetLastError (ERROR_ACCESS_DENIED );
121+ break ;
122+ case EEXIST :
123+ GuestThread::SetLastError (ERROR_FILE_EXISTS );
124+ break ;
125+ case ENOENT :
126+ default : // Use ERROR_PATH_NOT_FOUND as a catch-all for other errors.
127+ GuestThread::SetLastError (ERROR_PATH_NOT_FOUND );
128+ break ;
129+ }
116130#endif
117131 return GetInvalidKernelObject<FileHandle>();
118132 }
Original file line number Diff line number Diff line change 3838#define ERROR_NO_SUCH_USER 0x525
3939#define ERROR_SUCCESS 0x0
4040#define ERROR_PATH_NOT_FOUND 0x3
41+ #define ERROR_ACCESS_DENIED 0x5
42+ #define ERROR_FILE_EXISTS 0x50
4143#define ERROR_BAD_ARGUMENTS 0xA0
4244#define ERROR_DEVICE_NOT_CONNECTED 0x48F
4345#define PAGE_READWRITE 0x04
You can’t perform that action at this time.
0 commit comments