Fix IFile and IFileSystem IPC

This commit is contained in:
Alex Barney 2019-05-30 14:13:08 -05:00
parent 24ee4f4d66
commit d50164a50b
2 changed files with 13 additions and 7 deletions

View file

@ -31,12 +31,14 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
Path = LibHac.Fs.PathTools.Normalize(path);
}
// Read(u32, u64 offset, u64 size) -> (u64 out_size, buffer<u8, 0x46, 0> out_buf)
// Read(u32 readOption, u64 offset, u64 size) -> (u64 out_size, buffer<u8, 0x46, 0> out_buf)
public long Read(ServiceCtx context)
{
long position = context.Request.ReceiveBuff[0].Position;
long zero = context.RequestData.ReadInt64();
int readOption = context.RequestData.ReadInt32();
context.RequestData.BaseStream.Position += 4;
long offset = context.RequestData.ReadInt64();
long size = context.RequestData.ReadInt64();
@ -51,12 +53,14 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
return 0;
}
// Write(u32, u64 offset, u64 size, buffer<u8, 0x45, 0>)
// Write(u32 writeOption, u64 offset, u64 size, buffer<u8, 0x45, 0>)
public long Write(ServiceCtx context)
{
long position = context.Request.SendBuff[0].Position;
long zero = context.RequestData.ReadInt64();
int writeOption = context.RequestData.ReadInt32();
context.RequestData.BaseStream.Position += 4;
long offset = context.RequestData.ReadInt64();
long size = context.RequestData.ReadInt64();

View file

@ -45,12 +45,14 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
_provider = provider;
}
// CreateFile(u32 mode, u64 size, buffer<bytes<0x301>, 0x19, 0x301> path)
// CreateFile(u32 createOption, u64 size, buffer<bytes<0x301>, 0x19, 0x301> path)
public long CreateFile(ServiceCtx context)
{
string name = ReadUtf8String(context);
int mode = context.RequestData.ReadInt32();
int createOption = context.RequestData.ReadInt32();
context.RequestData.BaseStream.Position += 4;
long size = context.RequestData.ReadInt64();
if (name == null)
@ -70,7 +72,7 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
try
{
_provider.CreateFile(name, size, (CreateFileOptions)mode);
_provider.CreateFile(name, size, (CreateFileOptions)createOption);
}
catch (DirectoryNotFoundException)
{