WFS: Implement CREATE_OPEN along with OPEN.
This commit is contained in:
parent
ef3232cd74
commit
dca70844a6
|
@ -184,9 +184,12 @@ IPCCommandResult WFSSRV::IOCtl(const IOCtlRequest& request)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case IOCTL_WFS_CREATE_OPEN:
|
||||||
case IOCTL_WFS_OPEN:
|
case IOCTL_WFS_OPEN:
|
||||||
{
|
{
|
||||||
u32 mode = Memory::Read_U32(request.buffer_in);
|
const char* ioctl_name =
|
||||||
|
request.request == IOCTL_WFS_OPEN ? "IOCTL_WFS_OPEN" : "IOCTL_WFS_CREATE_OPEN";
|
||||||
|
u32 mode = request.request == IOCTL_WFS_OPEN ? Memory::Read_U32(request.buffer_in) : 2;
|
||||||
u16 path_len = Memory::Read_U16(request.buffer_in + 0x20);
|
u16 path_len = Memory::Read_U16(request.buffer_in + 0x20);
|
||||||
std::string path = Memory::GetString(request.buffer_in + 0x22, path_len);
|
std::string path = Memory::GetString(request.buffer_in + 0x22, path_len);
|
||||||
|
|
||||||
|
@ -201,14 +204,21 @@ IPCCommandResult WFSSRV::IOCtl(const IOCtlRequest& request)
|
||||||
|
|
||||||
if (!fd_obj->Open())
|
if (!fd_obj->Open())
|
||||||
{
|
{
|
||||||
ERROR_LOG(IOS_WFS, "IOCTL_WFS_OPEN(%s, %d): error opening file", path.c_str(), mode);
|
ERROR_LOG(IOS_WFS, "%s(%s, %d): error opening file", ioctl_name, path.c_str(), mode);
|
||||||
ReleaseFileDescriptor(fd);
|
ReleaseFileDescriptor(fd);
|
||||||
return_error_code = WFS_ENOENT;
|
return_error_code = WFS_ENOENT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
INFO_LOG(IOS_WFS, "IOCTL_WFS_OPEN(%s, %d) -> %d", path.c_str(), mode, fd);
|
INFO_LOG(IOS_WFS, "%s(%s, %d) -> %d", ioctl_name, path.c_str(), mode, fd);
|
||||||
Memory::Write_U16(fd, request.buffer_out + 0x14);
|
if (request.request == IOCTL_WFS_OPEN)
|
||||||
|
{
|
||||||
|
Memory::Write_U16(fd, request.buffer_out + 0x14);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Memory::Write_U16(fd, request.buffer_out);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,6 +60,7 @@ private:
|
||||||
IOCTL_WFS_GETCWD = 0x13,
|
IOCTL_WFS_GETCWD = 0x13,
|
||||||
IOCTL_WFS_DELETE = 0x15,
|
IOCTL_WFS_DELETE = 0x15,
|
||||||
IOCTL_WFS_GET_ATTRIBUTES = 0x17,
|
IOCTL_WFS_GET_ATTRIBUTES = 0x17,
|
||||||
|
IOCTL_WFS_CREATE_OPEN = 0x19,
|
||||||
IOCTL_WFS_OPEN = 0x1A,
|
IOCTL_WFS_OPEN = 0x1A,
|
||||||
IOCTL_WFS_GET_SIZE = 0x1B,
|
IOCTL_WFS_GET_SIZE = 0x1B,
|
||||||
IOCTL_WFS_CLOSE = 0x1E,
|
IOCTL_WFS_CLOSE = 0x1E,
|
||||||
|
|
Loading…
Reference in New Issue