diff options
| -rw-r--r-- | src/core/hle/kernel/server_session.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/server_session.h | 7 | ||||
| -rw-r--r-- | src/core/hle/service/sm/controller.cpp | 2 |
3 files changed, 8 insertions, 3 deletions
diff --git a/src/core/hle/kernel/server_session.cpp b/src/core/hle/kernel/server_session.cpp index d09ca5992..51a1ec160 100644 --- a/src/core/hle/kernel/server_session.cpp +++ b/src/core/hle/kernel/server_session.cpp | |||
| @@ -152,7 +152,7 @@ ResultCode ServerSession::HandleSyncRequest(SharedPtr<Thread> thread) { | |||
| 152 | // Handle scenario when ConvertToDomain command was issued, as we must do the conversion at the | 152 | // Handle scenario when ConvertToDomain command was issued, as we must do the conversion at the |
| 153 | // end of the command such that only commands following this one are handled as domains | 153 | // end of the command such that only commands following this one are handled as domains |
| 154 | if (convert_to_domain) { | 154 | if (convert_to_domain) { |
| 155 | ASSERT_MSG(domain_request_handlers.empty(), "already a domain"); | 155 | ASSERT_MSG(IsSession(), "ServerSession is already a domain instance."); |
| 156 | domain_request_handlers = {hle_handler}; | 156 | domain_request_handlers = {hle_handler}; |
| 157 | convert_to_domain = false; | 157 | convert_to_domain = false; |
| 158 | } | 158 | } |
diff --git a/src/core/hle/kernel/server_session.h b/src/core/hle/kernel/server_session.h index 2bce54fee..1a88e66b9 100644 --- a/src/core/hle/kernel/server_session.h +++ b/src/core/hle/kernel/server_session.h | |||
| @@ -97,7 +97,12 @@ public: | |||
| 97 | 97 | ||
| 98 | /// Returns true if the session has been converted to a domain, otherwise False | 98 | /// Returns true if the session has been converted to a domain, otherwise False |
| 99 | bool IsDomain() const { | 99 | bool IsDomain() const { |
| 100 | return !domain_request_handlers.empty(); | 100 | return !IsSession(); |
| 101 | } | ||
| 102 | |||
| 103 | /// Returns true if this session has not been converted to a domain, otherwise false. | ||
| 104 | bool IsSession() const { | ||
| 105 | return domain_request_handlers.empty(); | ||
| 101 | } | 106 | } |
| 102 | 107 | ||
| 103 | /// Converts the session to a domain at the end of the current command | 108 | /// Converts the session to a domain at the end of the current command |
diff --git a/src/core/hle/service/sm/controller.cpp b/src/core/hle/service/sm/controller.cpp index 518a0cc46..ae8cd9eeb 100644 --- a/src/core/hle/service/sm/controller.cpp +++ b/src/core/hle/service/sm/controller.cpp | |||
| @@ -10,7 +10,7 @@ | |||
| 10 | namespace Service::SM { | 10 | namespace Service::SM { |
| 11 | 11 | ||
| 12 | void Controller::ConvertSessionToDomain(Kernel::HLERequestContext& ctx) { | 12 | void Controller::ConvertSessionToDomain(Kernel::HLERequestContext& ctx) { |
| 13 | ASSERT_MSG(!ctx.Session()->IsDomain(), "session is alread a domain"); | 13 | ASSERT_MSG(ctx.Session()->IsSession(), "Session is already a domain"); |
| 14 | ctx.Session()->ConvertToDomain(); | 14 | ctx.Session()->ConvertToDomain(); |
| 15 | 15 | ||
| 16 | IPC::ResponseBuilder rb{ctx, 3}; | 16 | IPC::ResponseBuilder rb{ctx, 3}; |