Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions MarathonRecomp/kernel/io/file_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,20 @@ FileHandle* XCreateFileA
{
#ifdef _WIN32
GuestThread::SetLastError(GetLastError());
#else
switch (errno)
{
case EACCES:
GuestThread::SetLastError(ERROR_ACCESS_DENIED);
break;
case EEXIST:
GuestThread::SetLastError(ERROR_FILE_EXISTS);
break;
case ENOENT:
default: // Use ERROR_PATH_NOT_FOUND as a catch-all for other errors.
GuestThread::SetLastError(ERROR_PATH_NOT_FOUND);
break;
}
#endif
return GetInvalidKernelObject<FileHandle>();
}
Expand Down
2 changes: 2 additions & 0 deletions MarathonRecomp/kernel/xdm.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
#define ERROR_NO_SUCH_USER 0x525
#define ERROR_SUCCESS 0x0
#define ERROR_PATH_NOT_FOUND 0x3
#define ERROR_ACCESS_DENIED 0x5
#define ERROR_FILE_EXISTS 0x50
#define ERROR_BAD_ARGUMENTS 0xA0
#define ERROR_DEVICE_NOT_CONNECTED 0x48F
#define PAGE_READWRITE 0x04
Expand Down
Loading