@ -20,8 +20,9 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
// Namespace FS_User
// Namespace FS_User
using Kernel : : SharedPtr ;
using Kernel : : ClientSession ;
using Kernel : : ServerSession ;
using Kernel : : ServerSession ;
using Kernel : : SharedPtr ;
namespace Service {
namespace Service {
namespace FS {
namespace FS {
@ -79,11 +80,11 @@ static void OpenFile(Service::Interface* self) {
rb . Push ( file_res . Code ( ) ) ;
rb . Push ( file_res . Code ( ) ) ;
if ( file_res . Succeeded ( ) ) {
if ( file_res . Succeeded ( ) ) {
std : : shared_ptr < File > file = * file_res ;
std : : shared_ptr < File > file = * file_res ;
auto sessions = ServerSession : : CreateSessionPair ( file - > GetName ( ) , file );
auto sessions = ServerSession : : CreateSessionPair ( file - > GetName ( ) );
file - > ClientConnected ( std : : get < Kernel: : SharedPtr< Kernel : : ServerSession > > ( sessions ) ) ;
file - > ClientConnected ( std : : get < SharedPtr< ServerSession > > ( sessions ) ) ;
rb . PushMoveHandles ( Kernel : : g_handle_table
. Create ( std : : get < Kernel : : SharedPtr < Kernel : : ClientSession > > ( sessions ) )
rb . PushMoveHandles (
. MoveFrom ( ) ) ;
Kernel : : g_handle_table . Create ( std : : get < SharedPtr < ClientSession > > ( sessions ) ) . MoveFrom ( ) ) ;
} else {
} else {
rb . PushMoveHandles ( 0 ) ;
rb . PushMoveHandles ( 0 ) ;
LOG_ERROR ( Service_FS , " failed to get a handle for file %s " , file_path . DebugStr ( ) . c_str ( ) ) ;
LOG_ERROR ( Service_FS , " failed to get a handle for file %s " , file_path . DebugStr ( ) . c_str ( ) ) ;
@ -145,11 +146,11 @@ static void OpenFileDirectly(Service::Interface* self) {
cmd_buff [ 1 ] = file_res . Code ( ) . raw ;
cmd_buff [ 1 ] = file_res . Code ( ) . raw ;
if ( file_res . Succeeded ( ) ) {
if ( file_res . Succeeded ( ) ) {
std : : shared_ptr < File > file = * file_res ;
std : : shared_ptr < File > file = * file_res ;
auto sessions = ServerSession : : CreateSessionPair ( file - > GetName ( ) , file );
auto sessions = ServerSession : : CreateSessionPair ( file - > GetName ( ) );
file - > ClientConnected ( std : : get < Kernel: : SharedPtr< Kernel : : ServerSession > > ( sessions ) ) ;
file - > ClientConnected ( std : : get < SharedPtr< ServerSession > > ( sessions ) ) ;
cmd_buff [ 3 ] = Kernel : : g_handle_table
. Create ( std : : get < Kernel : : SharedPtr < Kernel : : ClientSession > > ( sessions ) )
cmd_buff [ 3 ] =
. MoveFrom ( ) ;
Kernel : : g_handle_table . Create ( std : : get < SharedPtr < ClientSession > > ( sessions ) ) . MoveFrom ( ) ;
} else {
} else {
cmd_buff [ 3 ] = 0 ;
cmd_buff [ 3 ] = 0 ;
LOG_ERROR ( Service_FS , " failed to get a handle for file %s mode=%u attributes=%u " ,
LOG_ERROR ( Service_FS , " failed to get a handle for file %s mode=%u attributes=%u " ,
@ -412,11 +413,11 @@ static void OpenDirectory(Service::Interface* self) {
cmd_buff [ 1 ] = dir_res . Code ( ) . raw ;
cmd_buff [ 1 ] = dir_res . Code ( ) . raw ;
if ( dir_res . Succeeded ( ) ) {
if ( dir_res . Succeeded ( ) ) {
std : : shared_ptr < Directory > directory = * dir_res ;
std : : shared_ptr < Directory > directory = * dir_res ;
auto sessions = ServerSession : : CreateSessionPair ( directory - > GetName ( ) , directory );
auto sessions = ServerSession : : CreateSessionPair ( directory - > GetName ( ) );
directory - > ClientConnected ( std : : get < Kernel: : SharedPtr< Kernel : : ServerSession > > ( sessions ) ) ;
directory - > ClientConnected ( std : : get < SharedPtr< ServerSession > > ( sessions ) ) ;
cmd_buff [ 3 ] = Kernel : : g_handle_table
. Create ( std : : get < Kernel : : SharedPtr < Kernel : : ClientSession > > ( sessions ) )
cmd_buff [ 3 ] =
. MoveFrom ( ) ;
Kernel : : g_handle_table . Create ( std : : get < SharedPtr < ClientSession > > ( sessions ) ) . MoveFrom ( ) ;
} else {
} else {
LOG_ERROR ( Service_FS , " failed to get a handle for directory type=%d size=%d data=%s " ,
LOG_ERROR ( Service_FS , " failed to get a handle for directory type=%d size=%d data=%s " ,
dirname_type , dirname_size , dir_path . DebugStr ( ) . c_str ( ) ) ;
dirname_type , dirname_size , dir_path . DebugStr ( ) . c_str ( ) ) ;