Fix IFile and IFileSystem IPC
This commit is contained in:
parent
24ee4f4d66
commit
d50164a50b
2 changed files with 13 additions and 7 deletions
|
@ -31,12 +31,14 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
|
||||||
Path = LibHac.Fs.PathTools.Normalize(path);
|
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)
|
public long Read(ServiceCtx context)
|
||||||
{
|
{
|
||||||
long position = context.Request.ReceiveBuff[0].Position;
|
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 offset = context.RequestData.ReadInt64();
|
||||||
long size = context.RequestData.ReadInt64();
|
long size = context.RequestData.ReadInt64();
|
||||||
|
|
||||||
|
@ -51,12 +53,14 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
|
||||||
return 0;
|
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)
|
public long Write(ServiceCtx context)
|
||||||
{
|
{
|
||||||
long position = context.Request.SendBuff[0].Position;
|
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 offset = context.RequestData.ReadInt64();
|
||||||
long size = context.RequestData.ReadInt64();
|
long size = context.RequestData.ReadInt64();
|
||||||
|
|
||||||
|
|
|
@ -45,12 +45,14 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
|
||||||
_provider = provider;
|
_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)
|
public long CreateFile(ServiceCtx context)
|
||||||
{
|
{
|
||||||
string name = ReadUtf8String(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();
|
long size = context.RequestData.ReadInt64();
|
||||||
|
|
||||||
if (name == null)
|
if (name == null)
|
||||||
|
@ -70,7 +72,7 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_provider.CreateFile(name, size, (CreateFileOptions)mode);
|
_provider.CreateFile(name, size, (CreateFileOptions)createOption);
|
||||||
}
|
}
|
||||||
catch (DirectoryNotFoundException)
|
catch (DirectoryNotFoundException)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue