1
0
Fork 0

HLE/FS: Use IPCHelper in DeleteDirectory.

This commit is contained in:
Subv 2017-12-09 12:50:25 -05:00
parent b631f77d11
commit 67382e46c0
1 changed files with 8 additions and 6 deletions

View File

@ -241,19 +241,21 @@ static void RenameFile(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 DeleteDirectory(Service::Interface* self) { static void DeleteDirectory(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer(); IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x806, 5, 2);
ArchiveHandle archive_handle = MakeArchiveHandle(cmd_buff[2], cmd_buff[3]); rp.Skip(1, false); // TransactionId
auto dirname_type = static_cast<FileSys::LowPathType>(cmd_buff[4]); ArchiveHandle archive_handle = rp.PopRaw<ArchiveHandle>();
u32 dirname_size = cmd_buff[5]; auto dirname_type = rp.PopEnum<FileSys::LowPathType>();
u32 dirname_ptr = cmd_buff[7]; u32 dirname_size = rp.Pop<u32>();
u32 dirname_ptr = rp.PopStaticBuffer(nullptr);
FileSys::Path dir_path(dirname_type, dirname_size, dirname_ptr); FileSys::Path dir_path(dirname_type, dirname_size, dirname_ptr);
LOG_DEBUG(Service_FS, "type=%u size=%u data=%s", static_cast<u32>(dirname_type), dirname_size, LOG_DEBUG(Service_FS, "type=%u size=%u data=%s", static_cast<u32>(dirname_type), dirname_size,
dir_path.DebugStr().c_str()); dir_path.DebugStr().c_str());
cmd_buff[1] = DeleteDirectoryFromArchive(archive_handle, dir_path).raw; IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
rb.Push(DeleteDirectoryFromArchive(archive_handle, dir_path));
} }
/* /*