libstrat: 0 -> ResultSuccess

This commit is contained in:
Michael Scire 2019-03-28 22:37:39 -07:00
parent 492975c110
commit 5a3583d79d
9 changed files with 15 additions and 16 deletions

View File

@ -123,7 +123,7 @@ static IEvent *CreateSystemEvent(F f, bool autoclear = false) {
template <bool a = false> template <bool a = false>
static IEvent *CreateWriteOnlySystemEvent() { static IEvent *CreateWriteOnlySystemEvent() {
return CreateSystemEvent([](u64 timeout) { std::abort(); return 0; }, a); return CreateSystemEvent([](u64 timeout) -> Result { std::abort(); }, a);
} }
template <class F> template <class F>

View File

@ -383,7 +383,7 @@ struct Validator {
return ResultKernelConnectionClosed; return ResultKernelConnectionClosed;
} }
return 0; return ResultSuccess;
} }
}; };

View File

@ -170,7 +170,7 @@ class ServiceSession : public IWaitable
ctx.cmd_type = (IpcCommandType)(*(u16 *)(armGetTls())); ctx.cmd_type = (IpcCommandType)(*(u16 *)(armGetTls()));
ctx.rc = 0; ctx.rc = ResultSuccess;
/* Parse based on command type. */ /* Parse based on command type. */
switch (ctx.cmd_type) { switch (ctx.cmd_type) {
@ -222,7 +222,7 @@ class ServiceSession : public IWaitable
ctx.rc = this->Reply(); ctx.rc = this->Reply();
if (ctx.rc == ResultKernelTimedOut) { if (ctx.rc == ResultKernelTimedOut) {
ctx.rc = 0x0; ctx.rc = ResultSuccess;
} }
this->CleanupResponse(&ctx); this->CleanupResponse(&ctx);
@ -295,7 +295,7 @@ class ServiceSession : public IWaitable
/* Return the object id. */ /* Return the object id. */
object_id.SetValue(reserved_id); object_id.SetValue(reserved_id);
return 0; return ResultSuccess;
} }
Result CopyFromCurrentDomain(Out<MovedHandle> out_h, u32 id) { Result CopyFromCurrentDomain(Out<MovedHandle> out_h, u32 id) {
@ -318,7 +318,7 @@ class ServiceSession : public IWaitable
this->session->GetSessionManager()->AddSession(server_h, std::move(object->Clone())); this->session->GetSessionManager()->AddSession(server_h, std::move(object->Clone()));
out_h.SetValue(client_h); out_h.SetValue(client_h);
return 0; return ResultSuccess;
} }
void CloneCurrentObject(Out<MovedHandle> out_h) { void CloneCurrentObject(Out<MovedHandle> out_h) {

View File

@ -35,7 +35,6 @@ class IWaitable {
virtual Result HandleDeferred() { virtual Result HandleDeferred() {
/* By default, HandleDeferred panics, because object shouldn't be deferrable. */ /* By default, HandleDeferred panics, because object shouldn't be deferrable. */
std::abort(); std::abort();
return 0;
} }
bool IsSignaled() { bool IsSignaled() {

View File

@ -96,7 +96,7 @@ class MitmServer : public IWaitable {
smMitMExit(); smMitMExit();
this->GetSessionManager()->AddWaitable(new MitmSession(session_h, client_pid, forward_service, std::make_shared<T>(forward_service, client_pid))); this->GetSessionManager()->AddWaitable(new MitmSession(session_h, client_pid, forward_service, std::make_shared<T>(forward_service, client_pid)));
return 0; return ResultSuccess;
} }
}; };

View File

@ -241,7 +241,7 @@ class MitmSession final : public ServiceSession {
/* Return the object id. */ /* Return the object id. */
object_id.SetValue(expected_id); object_id.SetValue(expected_id);
return 0; return ResultSuccess;
} }
Result CopyFromCurrentDomain(Out<MovedHandle> out_h, u32 id) { Result CopyFromCurrentDomain(Out<MovedHandle> out_h, u32 id) {
@ -293,7 +293,7 @@ class MitmSession final : public ServiceSession {
} else { } else {
this->session->GetSessionManager()->AddSession(server_h, std::move(object->Clone())); this->session->GetSessionManager()->AddSession(server_h, std::move(object->Clone()));
} }
return 0; return ResultSuccess;
} }
void CloneCurrentObject(Out<MovedHandle> out_h) { void CloneCurrentObject(Out<MovedHandle> out_h) {

View File

@ -54,7 +54,7 @@ class IServer : public IWaitable {
} }
this->GetSessionManager()->AddSession(session_h, std::move(ServiceObjectHolder(std::move(std::make_shared<T>())))); this->GetSessionManager()->AddSession(session_h, std::move(ServiceObjectHolder(std::move(std::make_shared<T>()))));
return 0; return ResultSuccess;
} }
}; };

View File

@ -356,7 +356,7 @@ class WaitableManager : public SessionManagerBase {
if (this->domain_objects[i].owner == nullptr) { if (this->domain_objects[i].owner == nullptr) {
this->domain_objects[i].owner = domain; this->domain_objects[i].owner = domain;
*out_object_id = i+1; *out_object_id = i+1;
return 0; return ResultSuccess;
} }
} }
return ResultServiceFrameworkOutOfDomainEntries; return ResultServiceFrameworkOutOfDomainEntries;
@ -369,7 +369,7 @@ class WaitableManager : public SessionManagerBase {
} }
if (this->domain_objects[object_id-1].owner == nullptr) { if (this->domain_objects[object_id-1].owner == nullptr) {
this->domain_objects[object_id-1].owner = domain; this->domain_objects[object_id-1].owner = domain;
return 0; return ResultSuccess;
} }
return ResultServiceFrameworkOutOfDomainEntries; return ResultServiceFrameworkOutOfDomainEntries;
} }
@ -403,7 +403,7 @@ class WaitableManager : public SessionManagerBase {
if (this->domain_objects[object_id-1].owner == domain) { if (this->domain_objects[object_id-1].owner == domain) {
this->domain_objects[object_id-1].obj_holder.Reset(); this->domain_objects[object_id-1].obj_holder.Reset();
this->domain_objects[object_id-1].owner = nullptr; this->domain_objects[object_id-1].owner = nullptr;
return 0x0; return ResultSuccess;
} }
return ResultHipcDomainObjectNotFound; return ResultHipcDomainObjectNotFound;
} }
@ -416,7 +416,7 @@ class WaitableManager : public SessionManagerBase {
if (this->domain_objects[object_id-1].owner != nullptr) { if (this->domain_objects[object_id-1].owner != nullptr) {
this->domain_objects[object_id-1].obj_holder.Reset(); this->domain_objects[object_id-1].obj_holder.Reset();
this->domain_objects[object_id-1].owner = nullptr; this->domain_objects[object_id-1].owner = nullptr;
return 0x0; return ResultSuccess;
} }
return ResultHipcDomainObjectNotFound; return ResultHipcDomainObjectNotFound;
} }

View File

@ -28,7 +28,7 @@ Result MitmQueryUtils::GetAssociatedTidForPid(u64 pid, u64 *tid) {
for (unsigned int i = 0; i < g_known_pids.size(); i++) { for (unsigned int i = 0; i < g_known_pids.size(); i++) {
if (g_known_pids[i] == pid) { if (g_known_pids[i] == pid) {
*tid = g_known_tids[i]; *tid = g_known_tids[i];
rc = 0x0; rc = ResultSuccess;
break; break;
} }
} }