diff --git a/libraries/libstratosphere/include/stratosphere/tma/tma_i_htcs_manager.hpp b/libraries/libstratosphere/include/stratosphere/tma/tma_i_htcs_manager.hpp index 066a1c597..18201335e 100644 --- a/libraries/libstratosphere/include/stratosphere/tma/tma_i_htcs_manager.hpp +++ b/libraries/libstratosphere/include/stratosphere/tma/tma_i_htcs_manager.hpp @@ -38,6 +38,6 @@ AMS_SF_METHOD_INFO(C, H, 100, Result, RegisterProcessId, (const sf::ClientProcessId &client_pid), (client_pid)) \ AMS_SF_METHOD_INFO(C, H, 101, Result, MonitorManager, (const sf::ClientProcessId &client_pid), (client_pid)) \ AMS_SF_METHOD_INFO(C, H, 130, Result, StartSelect, (sf::Out out_task_id, sf::OutCopyHandle out_event, const sf::InMapAliasArray &read_handles, const sf::InMapAliasArray &write_handles, const sf::InMapAliasArray &exception_handles, s64 tv_sec, s64 tv_usec), (out_task_id, out_event, read_handles, write_handles, exception_handles, tv_sec, tv_usec)) \ - AMS_SF_METHOD_INFO(C, H, 131, Result, EndSelect, (sf::Out out_err, sf::Out out_res, const sf::OutMapAliasArray &read_handles, const sf::OutMapAliasArray &write_handles, const sf::OutMapAliasArray &exception_handles, u32 task_id), (out_err, out_res, read_handles, write_handles, exception_handles, task_id)) + AMS_SF_METHOD_INFO(C, H, 131, Result, EndSelect, (sf::Out out_err, sf::Out out_count, const sf::OutMapAliasArray &read_handles, const sf::OutMapAliasArray &write_handles, const sf::OutMapAliasArray &exception_handles, u32 task_id), (out_err, out_count, read_handles, write_handles, exception_handles, task_id)) AMS_SF_DEFINE_INTERFACE(ams::tma, IHtcsManager, AMS_TMA_I_HTCS_MANAGER_INTERFACE_INFO) diff --git a/libraries/libstratosphere/source/htcs/impl/htcs_manager.cpp b/libraries/libstratosphere/source/htcs/impl/htcs_manager.cpp index d6c6360ea..42dadd090 100644 --- a/libraries/libstratosphere/source/htcs/impl/htcs_manager.cpp +++ b/libraries/libstratosphere/source/htcs/impl/htcs_manager.cpp @@ -16,6 +16,7 @@ #include #include "htcs_manager.hpp" #include "htcs_manager_impl.hpp" +#include "htcs_util.hpp" namespace ams::htcs::impl { @@ -36,4 +37,362 @@ namespace ams::htcs::impl { return m_impl->IsServiceAvailable(); } + void HtcsManager::Socket(s32 *out_err, s32 *out_desc, bool enable_disconnection_emulation) { + /* Invoke our implementation. */ + s32 err, desc; + const Result result = m_impl->CreateSocket(std::addressof(err), std::addressof(desc), enable_disconnection_emulation); + + /* Set output. */ + if (R_SUCCEEDED(result)) { + *out_err = err; + if (out_err == 0) { + *out_desc = desc; + } else { + *out_desc = -1; + } + } else { + *out_err = ConvertResultToErrorCode(result); + *out_desc = -1; + } + } + + void HtcsManager::Close(s32 *out_err, s32 *out_res, s32 desc) { + /* Invoke our implementation. */ + s32 err; + const Result result = m_impl->DestroySocket(std::addressof(err), desc); + + /* Set output. */ + *out_err = ConvertResultToErrorCode(result); + if (R_SUCCEEDED(result)) { + *out_res = 0; + } else { + *out_res = -1; + } + } + + void HtcsManager::Connect(s32 *out_err, s32 *out_res, const SockAddrHtcs &address, s32 desc) { + /* Invoke our implementation. */ + s32 err; + const Result result = m_impl->Connect(std::addressof(err), desc, address); + + /* Set output. */ + if (R_SUCCEEDED(result)) { + *out_err = err; + if (out_err == 0) { + *out_res = 0; + } else { + *out_res = -1; + } + } else { + *out_err = ConvertResultToErrorCode(result); + *out_res = -1; + } + } + + void HtcsManager::Bind(s32 *out_err, s32 *out_res, const SockAddrHtcs &address, s32 desc) { + /* Invoke our implementation. */ + s32 err; + const Result result = m_impl->Bind(std::addressof(err), desc, address); + + /* Set output. */ + if (R_SUCCEEDED(result)) { + *out_err = err; + if (out_err == 0) { + *out_res = 0; + } else { + *out_res = -1; + } + } else { + *out_err = ConvertResultToErrorCode(result); + *out_res = -1; + } + } + + void HtcsManager::Listen(s32 *out_err, s32 *out_res, s32 backlog_count, s32 desc) { + /* Invoke our implementation. */ + s32 err; + const Result result = m_impl->Listen(std::addressof(err), desc, backlog_count); + + /* Set output. */ + if (R_SUCCEEDED(result)) { + *out_err = err; + if (out_err == 0) { + *out_res = 0; + } else { + *out_res = -1; + } + } else { + *out_err = ConvertResultToErrorCode(result); + *out_res = -1; + } + } + + void HtcsManager::Recv(s32 *out_err, s64 *out_size, char *buffer, size_t size, s32 flags, s32 desc) { + /* Invoke our implementation. */ + s32 err; + s64 recv_size; + const Result result = m_impl->Recv(std::addressof(err), std::addressof(recv_size), buffer, size, desc, flags); + + /* Set output. */ + if (R_SUCCEEDED(result)) { + *out_err = err; + if (out_err == 0) { + *out_size = recv_size; + } else { + *out_size = -1; + } + } else { + *out_err = ConvertResultToErrorCode(result); + *out_size = -1; + } + } + + void HtcsManager::Send(s32 *out_err, s64 *out_size, const char *buffer, size_t size, s32 flags, s32 desc) { + /* Invoke our implementation. */ + s32 err; + s64 send_size; + const Result result = m_impl->Send(std::addressof(err), std::addressof(send_size), buffer, size, desc, flags); + + /* Set output. */ + if (R_SUCCEEDED(result)) { + *out_err = err; + if (out_err == 0) { + *out_size = send_size; + } else { + *out_size = -1; + } + } else { + *out_err = ConvertResultToErrorCode(result); + *out_size = -1; + } + } + + void HtcsManager::Shutdown(s32 *out_err, s32 *out_res, s32 how, s32 desc) { + /* Invoke our implementation. */ + s32 err; + const Result result = m_impl->Shutdown(std::addressof(err), desc, how); + + /* Set output. */ + if (R_SUCCEEDED(result)) { + *out_err = err; + if (out_err == 0) { + *out_res = 0; + } else { + *out_res = -1; + } + } else { + if (htcs::ResultInvalidHandle::Includes(result)) { + *out_err = HTCS_ENOTCONN; + } else { + *out_err = ConvertResultToErrorCode(result); + } + *out_res = -1; + } + } + + void HtcsManager::Fcntl(s32 *out_err, s32 *out_res, s32 command, s32 value, s32 desc) { + /* Invoke our implementation. */ + s32 err, res; + const Result result = m_impl->Fcntl(std::addressof(err), std::addressof(res), desc, command, value); + + /* Set output. */ + if (R_SUCCEEDED(result)) { + *out_err = err; + *out_res = res; + } else { + *out_err = ConvertResultToErrorCode(result); + *out_res = -1; + } + } + + Result HtcsManager::AcceptStart(u32 *out_task_id, Handle *out_handle, s32 desc) { + return m_impl->AcceptStart(out_task_id, out_handle, desc); + } + + void HtcsManager::AcceptResults(s32 *out_err, s32 *out_desc, SockAddrHtcs *out_address, u32 task_id, s32 desc) { + /* Invoke our implementation. */ + s32 err; + const Result result = m_impl->AcceptResults(std::addressof(err), out_desc, out_address, task_id, desc); + + /* Set output. */ + if (R_SUCCEEDED(result)) { + *out_err = err; + } else { + if (htc::ResultCancelled::Includes(result)) { + *out_err = HTCS_ENETDOWN; + } else if (htc::ResultUnknown2033::Includes(result)) { + *out_err = HTCS_EINTR; + } else { + *out_err = ConvertResultToErrorCode(result); + } + } + } + + Result HtcsManager::RecvStart(u32 *out_task_id, Handle *out_handle, s64 size, s32 desc, s32 flags) { + return m_impl->RecvStart(out_task_id, out_handle, size, desc, flags); + } + + void HtcsManager::RecvResults(s32 *out_err, s64 *out_size, char *buffer, s64 buffer_size, u32 task_id, s32 desc) { + /* Invoke our implementation. */ + s32 err; + s64 size; + const Result result = m_impl->RecvResults(std::addressof(err), std::addressof(size), buffer, buffer_size, task_id, desc); + + /* Set output. */ + if (R_SUCCEEDED(result)) { + *out_err = err; + if (err == 0) { + *out_size = size; + } else { + *out_size = -1; + } + } else { + if (htc::ResultUnknown2033::Includes(result)) { + *out_err = HTCS_EINTR; + } else { + *out_err = ConvertResultToErrorCode(result); + } + *out_size = -1; + } + } + + Result HtcsManager::SendStart(u32 *out_task_id, Handle *out_handle, const char *buffer, s64 size, s32 desc, s32 flags) { + return m_impl->SendStart(out_task_id, out_handle, buffer, size, desc, flags); + } + + Result HtcsManager::SendLargeStart(u32 *out_task_id, Handle *out_handle, const char **buffers, const s64 *sizes, s32 count, s32 desc, s32 flags) { + return m_impl->SendLargeStart(out_task_id, out_handle, buffers, sizes, count, desc, flags); + } + + void HtcsManager::SendResults(s32 *out_err, s64 *out_size, u32 task_id, s32 desc) { + /* Invoke our implementation. */ + s32 err; + s64 size; + const Result result = m_impl->SendResults(std::addressof(err), std::addressof(size), task_id, desc); + + /* Set output. */ + if (R_SUCCEEDED(result)) { + *out_err = err; + if (err == 0) { + *out_size = size; + } else { + *out_size = -1; + } + } else { + if (htc::ResultUnknown2033::Includes(result)) { + *out_err = HTCS_EINTR; + } else { + *out_err = ConvertResultToErrorCode(result); + } + *out_size = -1; + } + } + + Result HtcsManager::StartSend(u32 *out_task_id, Handle *out_handle, s32 desc, s64 size, s32 flags) { + return m_impl->StartSend(out_task_id, out_handle, desc, size, flags); + } + + Result HtcsManager::ContinueSend(s64 *out_size, const char *buffer, s64 buffer_size, u32 task_id, s32 desc) { + /* Invoke our implementation. */ + s64 size; + R_TRY_CATCH(m_impl->ContinueSend(std::addressof(size), buffer, buffer_size, task_id, desc)) { + R_CONVERT(htclow::ResultInvalidChannelState, tma::ResultUnknown()) + R_CONVERT(htc::ResultUnknown2021, tma::ResultUnknown()) + } R_END_TRY_CATCH; + + /* Set output. */ + *out_size = size; + return ResultSuccess(); + } + + void HtcsManager::EndSend(s32 *out_err, s64 *out_size, u32 task_id, s32 desc) { + /* Invoke our implementation. */ + s32 err; + s64 size; + const Result result = m_impl->EndSend(std::addressof(err), std::addressof(size), task_id, desc); + + /* Set output. */ + if (R_SUCCEEDED(result)) { + *out_err = err; + if (err == 0) { + *out_size = size; + } else { + *out_size = -1; + } + } else { + if (htc::ResultUnknown2033::Includes(result)) { + *out_err = HTCS_EINTR; + } else { + *out_err = ConvertResultToErrorCode(result); + } + *out_size = -1; + } + } + + Result HtcsManager::StartRecv(u32 *out_task_id, Handle *out_handle, s64 size, s32 desc, s32 flags) { + return m_impl->StartRecv(out_task_id, out_handle, size, desc, flags); + } + + void HtcsManager::EndRecv(s32 *out_err, s64 *out_size, char *buffer, s64 buffer_size, u32 task_id, s32 desc) { + /* Invoke our implementation. */ + s32 err; + s64 size; + const Result result = m_impl->EndRecv(std::addressof(err), std::addressof(size), buffer, buffer_size, task_id, desc); + + /* Set output. */ + if (R_SUCCEEDED(result)) { + *out_err = err; + if (err == 0) { + *out_size = size; + } else { + *out_size = -1; + } + } else { + if (htc::ResultCancelled::Includes(result) || htc::ResultUnknown2033::Includes(result)) { + *out_err = 0; + } else { + *out_err = ConvertResultToErrorCode(result); + } + *out_size = -1; + } + } + + Result HtcsManager::StartSelect(u32 *out_task_id, Handle *out_handle, Span read_handles, Span write_handles, Span exception_handles, s64 tv_sec, s64 tv_usec) { + /* Invoke our implementation. */ + R_TRY_CATCH(m_impl->StartSelect(out_task_id, out_handle, read_handles, write_handles, exception_handles, tv_sec, tv_usec)) { + R_CONVERT(htc::ResultUnknown2021, tma::ResultUnknown()) + } R_END_TRY_CATCH; + + return ResultSuccess(); + } + + Result HtcsManager::EndSelect(s32 *out_err, s32 *out_count, Span read_handles, Span write_handles, Span exception_handles, u32 task_id) { + /* Invoke our implementation. */ + s32 err, res; + const Result result = m_impl->EndSelect(std::addressof(err), std::addressof(res), read_handles, write_handles, exception_handles, task_id); + + /* Set output. */ + if (R_SUCCEEDED(result) && res == 0) { + *out_err = err; + if (err == 0) { + const auto num_read = std::count_if(read_handles.begin(), read_handles.end(), [](int handle) { return handle != 0; }); + const auto num_write = std::count_if(write_handles.begin(), write_handles.end(), [](int handle) { return handle != 0; }); + const auto num_exception = std::count_if(exception_handles.begin(), exception_handles.end(), [](int handle) { return handle != 0; }); + *out_count = num_read + num_write + num_exception; + } else { + *out_count = -1; + } + } else { + if (R_SUCCEEDED(result)) { + *out_err = 0; + *out_count = 0; + } else { + *out_err = ConvertResultToErrorCode(err); + *out_count = -1; + } + } + + return ResultSuccess(); + } + } diff --git a/libraries/libstratosphere/source/htcs/impl/htcs_manager.hpp b/libraries/libstratosphere/source/htcs/impl/htcs_manager.hpp index 4fcb48984..de2f44ca2 100644 --- a/libraries/libstratosphere/source/htcs/impl/htcs_manager.hpp +++ b/libraries/libstratosphere/source/htcs/impl/htcs_manager.hpp @@ -61,7 +61,7 @@ namespace ams::htcs::impl { void EndRecv(s32 *out_err, s64 *out_size, char *buffer, s64 buffer_size, u32 task_id, s32 desc); Result StartSelect(u32 *out_task_id, Handle *out_handle, Span read_handles, Span write_handles, Span exception_handles, s64 tv_sec, s64 tv_usec); - Result EndSelect(s32 *out_err, s32 *out_res, Span read_handles, Span write_handles, Span exception_handles, u32 task_id); + Result EndSelect(s32 *out_err, s32 *out_count, Span read_handles, Span write_handles, Span exception_handles, u32 task_id); }; } diff --git a/libraries/libstratosphere/source/htcs/impl/htcs_manager_impl.hpp b/libraries/libstratosphere/source/htcs/impl/htcs_manager_impl.hpp index 38c0916ec..a2875fbbc 100644 --- a/libraries/libstratosphere/source/htcs/impl/htcs_manager_impl.hpp +++ b/libraries/libstratosphere/source/htcs/impl/htcs_manager_impl.hpp @@ -41,6 +41,36 @@ namespace ams::htcs::impl { os::EventType *GetServiceAvailabilityEvent(); bool IsServiceAvailable(); + public: + Result CreateSocket(s32 *out_err, s32 *out_desc, bool enable_disconnection_emulation); + Result DestroySocket(s32 *out_err, s32 desc); + Result Connect(s32 *out_err, s32 desc, const SockAddrHtcs &address); + Result Bind(s32 *out_err, s32 desc, const SockAddrHtcs &address); + Result Listen(s32 *out_err, s32 desc, s32 backlog_count); + Result Recv(s32 *out_err, s64 *out_size, char *buffer, size_t size, s32 desc, s32 flags); + Result Send(s32 *out_err, s64 *out_size, const char *buffer, size_t size, s32 desc, s32 flags); + Result Shutdown(s32 *out_err, s32 desc, s32 how); + Result Fcntl(s32 *out_err, s32 *out_res, s32 desc, s32 command, s32 value); + + Result AcceptStart(u32 *out_task_id, Handle *out_handle, s32 desc); + Result AcceptResults(s32 *out_err, s32 *out_desc, SockAddrHtcs *out_address, u32 task_id, s32 desc); + + Result RecvStart(u32 *out_task_id, Handle *out_handle, s64 size, s32 desc, s32 flags); + Result RecvResults(s32 *out_err, s64 *out_size, char *buffer, s64 buffer_size, u32 task_id, s32 desc); + + Result SendStart(u32 *out_task_id, Handle *out_handle, const char *buffer, s64 size, s32 desc, s32 flags); + Result SendLargeStart(u32 *out_task_id, Handle *out_handle, const char **buffers, const s64 *sizes, s32 count, s32 desc, s32 flags); + Result SendResults(s32 *out_err, s64 *out_size, u32 task_id, s32 desc); + + Result StartSend(u32 *out_task_id, Handle *out_handle, s32 desc, s64 size, s32 flags); + Result ContinueSend(s64 *out_size, const char *buffer, s64 buffer_size, u32 task_id, s32 desc); + Result EndSend(s32 *out_err, s64 *out_size, u32 task_id, s32 desc); + + Result StartRecv(u32 *out_task_id, Handle *out_handle, s64 size, s32 desc, s32 flags); + Result EndRecv(s32 *out_err, s64 *out_size, char *buffer, s64 buffer_size, u32 task_id, s32 desc); + + Result StartSelect(u32 *out_task_id, Handle *out_handle, Span read_handles, Span write_handles, Span exception_handles, s64 tv_sec, s64 tv_usec); + Result EndSelect(s32 *out_err, s32 *out_res, Span read_handles, Span write_handles, Span exception_handles, u32 task_id); }; } diff --git a/libraries/libstratosphere/source/htcs/impl/htcs_util.cpp b/libraries/libstratosphere/source/htcs/impl/htcs_util.cpp new file mode 100644 index 000000000..448648c8d --- /dev/null +++ b/libraries/libstratosphere/source/htcs/impl/htcs_util.cpp @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2018-2020 Atmosphère-NX + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include +#include "htcs_util.hpp" + +namespace ams::htcs::impl { + + s32 ConvertResultToErrorCode(const Result result) { + /* Convert success. */ + if (R_SUCCEEDED(result)) { + return 0; + } + + R_TRY_CATCH(result) { + R_CATCH(htclow::ResultNonBlockingReceiveFailed) { return HTCS_EWOULDBLOCK; } + R_CATCH(htcs::ResultInvalidHandle) { return HTCS_EBADF; } + R_CATCH(htc::ResultUnknown2001) { return HTCS_EINVAL; } + R_CATCH(htc::ResultUnknown2101) { return HTCS_EMFILE; } + R_CATCH(htc::ResultUnknown2021) { return HTCS_EINTR; } + R_CATCH(htc::ResultInvalidTaskId) { return HTCS_EINTR; } + R_CATCH(htc::ResultCancelled) { return HTCS_EINTR; } + R_CATCH(htc::ResultUnknown2033) { return HTCS_ENETDOWN; } + R_CATCH(htclow::ResultConnectionFailure) { return HTCS_ENETDOWN; } + R_CATCH(htclow::ResultChannelNotExist) { return HTCS_ENOTCONN; } + R_CATCH_ALL() { return HTCS_EUNKNOWN; } + } R_END_TRY_CATCH_WITH_ABORT_UNLESS; + + __builtin_unreachable(); + } + +} diff --git a/libraries/libstratosphere/source/htcs/impl/htcs_util.hpp b/libraries/libstratosphere/source/htcs/impl/htcs_util.hpp new file mode 100644 index 000000000..9f7684cfe --- /dev/null +++ b/libraries/libstratosphere/source/htcs/impl/htcs_util.hpp @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2018-2020 Atmosphère-NX + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once +#include + +namespace ams::htcs::impl { + + s32 ConvertResultToErrorCode(const Result result); + +} diff --git a/libraries/libstratosphere/source/htcs/server/htcs_manager_service_object.cpp b/libraries/libstratosphere/source/htcs/server/htcs_manager_service_object.cpp index 7eb2ef215..d0c6a6bb0 100644 --- a/libraries/libstratosphere/source/htcs/server/htcs_manager_service_object.cpp +++ b/libraries/libstratosphere/source/htcs/server/htcs_manager_service_object.cpp @@ -82,12 +82,12 @@ namespace ams::htcs::server { return manager->StartSelect(out_task_id.GetPointer(), out_event.GetHandlePointer(), read_handles.ToSpan(), write_handles.ToSpan(), exception_handles.ToSpan(), tv_sec, tv_usec); } - Result ManagerServiceObject::EndSelect(sf::Out out_err, sf::Out out_res, const sf::OutMapAliasArray &read_handles, const sf::OutMapAliasArray &write_handles, const sf::OutMapAliasArray &exception_handles, u32 task_id) { + Result ManagerServiceObject::EndSelect(sf::Out out_err, sf::Out out_count, const sf::OutMapAliasArray &read_handles, const sf::OutMapAliasArray &write_handles, const sf::OutMapAliasArray &exception_handles, u32 task_id) { /* Get the htcs manager. */ auto *manager = impl::HtcsManagerHolder::GetHtcsManager(); /* End the select. */ - return manager->EndSelect(out_err.GetPointer(), out_res.GetPointer(), read_handles.ToSpan(), write_handles.ToSpan(), exception_handles.ToSpan(), task_id); + return manager->EndSelect(out_err.GetPointer(), out_count.GetPointer(), read_handles.ToSpan(), write_handles.ToSpan(), exception_handles.ToSpan(), task_id); } } diff --git a/libraries/libstratosphere/source/htcs/server/htcs_manager_service_object.hpp b/libraries/libstratosphere/source/htcs/server/htcs_manager_service_object.hpp index 43e62d5b1..44e9bf2ef 100644 --- a/libraries/libstratosphere/source/htcs/server/htcs_manager_service_object.hpp +++ b/libraries/libstratosphere/source/htcs/server/htcs_manager_service_object.hpp @@ -37,7 +37,7 @@ namespace ams::htcs::server { Result RegisterProcessId(const sf::ClientProcessId &client_pid); Result MonitorManager(const sf::ClientProcessId &client_pid); Result StartSelect(sf::Out out_task_id, sf::OutCopyHandle out_event, const sf::InMapAliasArray &read_handles, const sf::InMapAliasArray &write_handles, const sf::InMapAliasArray &exception_handles, s64 tv_sec, s64 tv_usec); - Result EndSelect(sf::Out out_err, sf::Out out_res, const sf::OutMapAliasArray &read_handles, const sf::OutMapAliasArray &write_handles, const sf::OutMapAliasArray &exception_handles, u32 task_id); + Result EndSelect(sf::Out out_err, sf::Out out_count, const sf::OutMapAliasArray &read_handles, const sf::OutMapAliasArray &write_handles, const sf::OutMapAliasArray &exception_handles, u32 task_id); }; static_assert(tma::IsIHtcsManager); diff --git a/libraries/libvapours/include/vapours/results.hpp b/libraries/libvapours/include/vapours/results.hpp index 29bfbc250..406e1ec24 100644 --- a/libraries/libvapours/include/vapours/results.hpp +++ b/libraries/libvapours/include/vapours/results.hpp @@ -62,6 +62,7 @@ #include #include #include +#include #include #include #include diff --git a/libraries/libvapours/include/vapours/results/htc_results.hpp b/libraries/libvapours/include/vapours/results/htc_results.hpp index 3025aacbc..8ff7ee0f9 100644 --- a/libraries/libvapours/include/vapours/results/htc_results.hpp +++ b/libraries/libvapours/include/vapours/results/htc_results.hpp @@ -28,9 +28,13 @@ namespace ams::htc { R_DEFINE_ERROR_RESULT(Unknown, 1023); + R_DEFINE_ERROR_RESULT(Unknown2001, 2001); R_DEFINE_ERROR_RESULT(InvalidTaskId, 2003); R_DEFINE_ERROR_RESULT(InvalidSize, 2011); + R_DEFINE_ERROR_RESULT(Unknown2021, 2021); + R_DEFINE_ERROR_RESULT(Unknown2033, 2033); + R_DEFINE_ERROR_RESULT(Unknown2101, 2101); R_DEFINE_ERROR_RESULT(OutOfRpcTask, 2102); R_DEFINE_ERROR_RESULT(InvalidCategory, 2123); diff --git a/libraries/libvapours/include/vapours/results/htcs_results.hpp b/libraries/libvapours/include/vapours/results/htcs_results.hpp index 68c9e7f60..de4c6206e 100644 --- a/libraries/libvapours/include/vapours/results/htcs_results.hpp +++ b/libraries/libvapours/include/vapours/results/htcs_results.hpp @@ -20,6 +20,8 @@ namespace ams::htcs { R_DEFINE_NAMESPACE_RESULT_MODULE(4); + R_DEFINE_ERROR_RESULT(InvalidHandle, 9); + R_DEFINE_ERROR_RESULT(InvalidSize, 2014); } diff --git a/libraries/libvapours/include/vapours/results/tma_results.hpp b/libraries/libvapours/include/vapours/results/tma_results.hpp new file mode 100644 index 000000000..649051940 --- /dev/null +++ b/libraries/libvapours/include/vapours/results/tma_results.hpp @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2018-2020 Atmosphère-NX + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once +#include + +namespace ams::tma { + + R_DEFINE_NAMESPACE_RESULT_MODULE(12); + + R_DEFINE_ERROR_RESULT(Unknown, 1); + +}