Kernel: Centralize error definitions in errors.h

This commit is contained in:
Yuri Kunde Schlesner 2017-05-21 00:11:36 -07:00
parent 743d18f0e4
commit 2cdb40d709
23 changed files with 178 additions and 132 deletions

View file

@ -24,9 +24,7 @@ void InitializeSession(Service::Interface* self) {
if (translation != IPC::CallingPidDesc()) {
cmd_buff[0] = IPC::MakeHeader(0, 0x1, 0); // 0x40
cmd_buff[1] = ResultCode(ErrorDescription::OS_InvalidBufferDescriptor, ErrorModule::OS,
ErrorSummary::WrongArgument, ErrorLevel::Permanent)
.raw;
cmd_buff[1] = IPC::ERR_INVALID_BUFFER_DESCRIPTOR.raw;
LOG_ERROR(Service_BOSS, "The translation was invalid, translation=0x%08X", translation);
return;
}

View file

@ -289,9 +289,7 @@ static void WriteProcessPipe(Service::Interface* self) {
"size=0x%X, buffer=0x%08X",
cmd_buff[3], pipe_index, size, buffer);
cmd_buff[0] = IPC::MakeHeader(0, 1, 0);
cmd_buff[1] = ResultCode(ErrorDescription::OS_InvalidBufferDescriptor, ErrorModule::OS,
ErrorSummary::WrongArgument, ErrorLevel::Permanent)
.raw;
cmd_buff[1] = IPC::ERR_INVALID_BUFFER_DESCRIPTOR.raw;
return;
}

View file

@ -801,9 +801,7 @@ static void InitializeWithSdkVersion(Service::Interface* self) {
cmd_buff[1] = RESULT_SUCCESS.raw;
} else {
LOG_ERROR(Service_FS, "ProcessId Header must be 0x20");
cmd_buff[1] = ResultCode(ErrorDescription::OS_InvalidBufferDescriptor, ErrorModule::OS,
ErrorSummary::WrongArgument, ErrorLevel::Permanent)
.raw;
cmd_buff[1] = IPC::ERR_INVALID_BUFFER_DESCRIPTOR.raw;
}
}

View file

@ -267,8 +267,7 @@ static void InitializeIrNopShared(Interface* self) {
shared_memory = Kernel::g_handle_table.Get<Kernel::SharedMemory>(handle);
if (!shared_memory) {
LOG_CRITICAL(Service_IR, "invalid shared memory handle 0x%08X", handle);
rb.Push(ResultCode(ErrorDescription::InvalidHandle, ErrorModule::OS,
ErrorSummary::WrongArgument, ErrorLevel::Permanent));
rb.Push(IPC::ERR_INVALID_HANDLE);
return;
}
shared_memory->name = "IR_USER: shared memory";

View file

@ -30,9 +30,7 @@ static void RegisterClient(Interface* self) {
if (cmd_buff[1] != IPC::CallingPidDesc()) {
cmd_buff[0] = IPC::MakeHeader(0x0, 0x1, 0); // 0x40
cmd_buff[1] = ResultCode(ErrorDescription::OS_InvalidBufferDescriptor, ErrorModule::OS,
ErrorSummary::WrongArgument, ErrorLevel::Permanent)
.raw;
cmd_buff[1] = IPC::ERR_INVALID_BUFFER_DESCRIPTOR.raw;
return;
}
cmd_buff[0] = IPC::MakeHeader(0x1, 0x1, 0); // 0x10040