mirror of
https://github.com/Lime3DS/Lime3DS
synced 2024-12-25 08:32:48 -06:00
HLE/FS: Use IPCHelper in DeleteFile.
This commit is contained in:
parent
e9a70ce2fc
commit
a6c69bfca0
1 changed files with 8 additions and 7 deletions
|
@ -170,19 +170,20 @@ static void OpenFileDirectly(Service::Interface* self) {
|
||||||
* 1 : Result of function, 0 on success, otherwise error code
|
* 1 : Result of function, 0 on success, otherwise error code
|
||||||
*/
|
*/
|
||||||
static void DeleteFile(Service::Interface* self) {
|
static void DeleteFile(Service::Interface* self) {
|
||||||
u32* cmd_buff = Kernel::GetCommandBuffer();
|
IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x804, 5, 2);
|
||||||
|
rp.Skip(1, false); // TransactionId
|
||||||
ArchiveHandle archive_handle = MakeArchiveHandle(cmd_buff[2], cmd_buff[3]);
|
ArchiveHandle archive_handle = rp.PopRaw<ArchiveHandle>();
|
||||||
auto filename_type = static_cast<FileSys::LowPathType>(cmd_buff[4]);
|
auto filename_type = rp.PopEnum<FileSys::LowPathType>();
|
||||||
u32 filename_size = cmd_buff[5];
|
u32 filename_size = rp.Pop<u32>();
|
||||||
u32 filename_ptr = cmd_buff[7];
|
u32 filename_ptr = rp.PopStaticBuffer(nullptr);
|
||||||
|
|
||||||
FileSys::Path file_path(filename_type, filename_size, filename_ptr);
|
FileSys::Path file_path(filename_type, filename_size, filename_ptr);
|
||||||
|
|
||||||
LOG_DEBUG(Service_FS, "type=%u size=%u data=%s", static_cast<u32>(filename_type), filename_size,
|
LOG_DEBUG(Service_FS, "type=%u size=%u data=%s", static_cast<u32>(filename_type), filename_size,
|
||||||
file_path.DebugStr().c_str());
|
file_path.DebugStr().c_str());
|
||||||
|
|
||||||
cmd_buff[1] = DeleteFileFromArchive(archive_handle, file_path).raw;
|
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||||
|
rb.Push(DeleteFileFromArchive(archive_handle, file_path));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue