Skip to content
This repository has been archived by the owner on Sep 21, 2021. It is now read-only.

Commit

Permalink
add fsp_srv_open_bis_filesystem
Browse files Browse the repository at this point in the history
  • Loading branch information
misson20000 committed Jun 15, 2018
1 parent 0f8e993 commit 2ac0f1f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/libtransistor/ipc/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ result_t fsp_srv_open_data_file_system_by_current_process(ifilesystem_t *out_unk
// result_t fsp_srv_mount_content7(ifilesystem_t *out_unk2, applicationid in_tid, uint32_t in_ncaType);
// result_t fsp_srv_mount_content(ifilesystem_t *out_contentFs, applicationid in_tid, uint32_t in_flag, const uint8_t in_path[0x301]);
// result_t fsp_srv_open_data_file_system_by_application_id(ifilesystem_t *out_dataFiles, applicationid in_tid);
// result_t fsp_srv_mount_bis(ifilesystem_t *out_Bis, partition in_partitionID, const uint8_t in_path[0x301]);
result_t fsp_srv_open_bis_filesystem(ifilesystem_t *fs, uint32_t partition_id, const char *path);
// result_t fsp_srv_open_bis_partition(ipc_object_t *out_BisPartition, partition in_partitionID);
result_t fsp_srv_invalidate_bis_cache();
result_t fsp_srv_open_host_file_system_impl(ifilesystem_t *out_unk1, const uint8_t in_path[0x301]);
Expand Down
23 changes: 22 additions & 1 deletion lib/ipc/fs.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include<libtransistor/types.h>
#include<libtransistor/svc.h>
#include<libtransistor/ipc.h>
#include<libtransistor/ipc_helpers.h>
#include<libtransistor/err.h>
#include<libtransistor/util.h>
#include<libtransistor/ipc/sm.h>
Expand Down Expand Up @@ -88,7 +89,27 @@ result_t fsp_srv_open_data_file_system_by_current_process(ifilesystem_t *out_unk

// result_t fsp_srv_open_data_file_system_by_application_id(ifilesystem_t *out_dataFiles, applicationid in_tid);

// result_t fsp_srv_mount_bis(ifilesystem_t *out_Bis, partition in_partitionID, const uint8_t in_path[0x301]);
result_t fsp_srv_open_bis_filesystem(ifilesystem_t *fs, uint32_t partition_id, const char *in_path) {
result_t res;

char path[0x301];
memset(path, 0, sizeof(path));
strncpy(path, in_path, sizeof(path)-1);

ipc_buffer_t buffers[] = {
ipc_make_buffer(path, 0x301, 0x19)
};

ipc_request_t rq = ipc_make_request(11);
ipc_msg_set_buffers(rq, buffers, buffer_ptrs);
ipc_msg_raw_data_from_value(rq, partition_id);

ipc_response_fmt_t rs = ipc_default_response_fmt;
rs.objects = fs;
rs.num_objects = 1;

return ipc_send(fsp_srv_object, &rq, &rs);
}

// result_t fsp_srv_open_bis_partition(ipc_object_t *out_BisPartition, partition in_partitionID);

Expand Down

0 comments on commit 2ac0f1f

Please sign in to comment.