mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-06-01 15:28:21 -04:00
strat: use svc:: over ::svc
This commit is contained in:
parent
77fe5cf6f5
commit
6f680fe63b
47 changed files with 557 additions and 563 deletions
|
@ -22,7 +22,7 @@ namespace ams::fssystem {
|
|||
|
||||
fs::fsa::IFileSystem *GetExternalCodeFileSystem(ncm::ProgramId program_id);
|
||||
|
||||
Result CreateExternalCode(Handle *out, ncm::ProgramId program_id);
|
||||
Result CreateExternalCode(os::NativeHandle *out, ncm::ProgramId program_id);
|
||||
void DestroyExternalCode(ncm::ProgramId program_id);
|
||||
|
||||
}
|
||||
|
|
|
@ -152,7 +152,7 @@ namespace ams::fssystem {
|
|||
NX_INLINE Result RetryFinitelyForTargetLocked(F f) {
|
||||
/* Retry up to 10 times, 100ms between retries. */
|
||||
constexpr s32 MaxRetryCount = 10;
|
||||
constexpr u64 RetryWaitTime = 100'000'000ul;
|
||||
constexpr TimeSpan RetryWaitTime = TimeSpan::FromMilliSeconds(100);
|
||||
|
||||
s32 remaining_retries = MaxRetryCount;
|
||||
while (true) {
|
||||
|
@ -161,7 +161,7 @@ namespace ams::fssystem {
|
|||
R_UNLESS(remaining_retries > 0, fs::ResultTargetLocked());
|
||||
|
||||
remaining_retries--;
|
||||
svcSleepThread(RetryWaitTime);
|
||||
os::SleepThread(RetryWaitTime);
|
||||
continue;
|
||||
}
|
||||
} R_END_TRY_CATCH;
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
namespace ams::map {
|
||||
|
||||
/* Public API. */
|
||||
Result GetProcessAddressSpaceInfo(AddressSpaceInfo *out, Handle process_h);
|
||||
Result GetProcessAddressSpaceInfo(AddressSpaceInfo *out, os::NativeHandle process_h);
|
||||
Result LocateMappableSpace(uintptr_t *out_address, size_t size);
|
||||
Result MapCodeMemoryInProcess(MappedCodeMemory &out_mcm, Handle process_handle, uintptr_t base_address, size_t size);
|
||||
bool CanAddGuardRegionsInProcess(Handle process_handle, uintptr_t address, size_t size);
|
||||
Result MapCodeMemoryInProcess(MappedCodeMemory &out_mcm, os::NativeHandle process_handle, uintptr_t base_address, size_t size);
|
||||
bool CanAddGuardRegionsInProcess(os::NativeHandle process_handle, uintptr_t address, size_t size);
|
||||
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
#pragma once
|
||||
#include <vapours.hpp>
|
||||
#include <stratosphere/os/os_native_handle.hpp>
|
||||
|
||||
namespace ams::map {
|
||||
|
||||
|
@ -41,19 +42,19 @@ namespace ams::map {
|
|||
|
||||
class AutoCloseMap {
|
||||
private:
|
||||
Handle process_handle;
|
||||
os::NativeHandle process_handle;
|
||||
Result result;
|
||||
void *mapped_address;
|
||||
uintptr_t mapped_address;
|
||||
uintptr_t base_address;
|
||||
size_t size;
|
||||
public:
|
||||
AutoCloseMap(uintptr_t mp, Handle p_h, uintptr_t ba, size_t sz) : process_handle(p_h), mapped_address(reinterpret_cast<void *>(mp)), base_address(ba), size(sz) {
|
||||
this->result = svcMapProcessMemory(this->mapped_address, this->process_handle, this->base_address, this->size);
|
||||
AutoCloseMap(uintptr_t mp, os::NativeHandle p_h, uintptr_t ba, size_t sz) : process_handle(p_h), mapped_address(mp), base_address(ba), size(sz) {
|
||||
this->result = svc::MapProcessMemory(this->mapped_address, this->process_handle, this->base_address, this->size);
|
||||
}
|
||||
|
||||
~AutoCloseMap() {
|
||||
if (this->process_handle != INVALID_HANDLE && R_SUCCEEDED(this->result)) {
|
||||
R_ABORT_UNLESS(svcUnmapProcessMemory(this->mapped_address, this->process_handle, this->base_address, this->size));
|
||||
if (this->process_handle != os::InvalidNativeHandle && R_SUCCEEDED(this->result)) {
|
||||
R_ABORT_UNLESS(svc::UnmapProcessMemory(this->mapped_address, this->process_handle, this->base_address, this->size));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -66,7 +67,7 @@ namespace ams::map {
|
|||
}
|
||||
|
||||
void Invalidate() {
|
||||
this->process_handle = INVALID_HANDLE;
|
||||
this->process_handle = os::InvalidNativeHandle;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -78,17 +79,17 @@ namespace ams::map {
|
|||
uintptr_t src_address;
|
||||
size_t size;
|
||||
public:
|
||||
MappedCodeMemory(Result init_res) : process_handle(INVALID_HANDLE), result(init_res), dst_address(0), src_address(0), size(0) {
|
||||
MappedCodeMemory(Result init_res) : process_handle(os::InvalidNativeHandle), result(init_res), dst_address(0), src_address(0), size(0) {
|
||||
/* ... */
|
||||
}
|
||||
|
||||
MappedCodeMemory(Handle p_h, uintptr_t dst, uintptr_t src, size_t sz) : process_handle(p_h), dst_address(dst), src_address(src), size(sz) {
|
||||
this->result = svcMapProcessCodeMemory(this->process_handle, this->dst_address, this->src_address, this->size);
|
||||
this->result = svc::MapProcessCodeMemory(this->process_handle, this->dst_address, this->src_address, this->size);
|
||||
}
|
||||
|
||||
~MappedCodeMemory() {
|
||||
if (this->process_handle != INVALID_HANDLE && R_SUCCEEDED(this->result) && this->size > 0) {
|
||||
R_ABORT_UNLESS(svcUnmapProcessCodeMemory(this->process_handle, this->dst_address, this->src_address, this->size));
|
||||
if (this->process_handle != os::InvalidNativeHandle && R_SUCCEEDED(this->result) && this->size > 0) {
|
||||
R_ABORT_UNLESS(svc::UnmapProcessCodeMemory(this->process_handle, this->dst_address, this->src_address, this->size));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -105,7 +106,7 @@ namespace ams::map {
|
|||
}
|
||||
|
||||
void Invalidate() {
|
||||
this->process_handle = INVALID_HANDLE;
|
||||
this->process_handle = os::InvalidNativeHandle;
|
||||
}
|
||||
|
||||
MappedCodeMemory &operator=(MappedCodeMemory &&o) {
|
||||
|
|
|
@ -26,8 +26,8 @@ namespace ams::pm::dmnt {
|
|||
Result StartProcess(os::ProcessId process_id);
|
||||
Result GetProcessId(os::ProcessId *out_process_id, const ncm::ProgramId program_id);
|
||||
Result GetApplicationProcessId(os::ProcessId *out_process_id);
|
||||
Result HookToCreateApplicationProcess(Handle *out_handle);
|
||||
Result AtmosphereGetProcessInfo(Handle *out_handle, ncm::ProgramLocation *out_loc, cfg::OverrideStatus *out_status, os::ProcessId process_id);
|
||||
Result HookToCreateApplicationProcess(os::NativeHandle *out_handle);
|
||||
Result AtmosphereGetProcessInfo(os::NativeHandle *out_handle, ncm::ProgramLocation *out_loc, cfg::OverrideStatus *out_status, os::ProcessId process_id);
|
||||
Result AtmosphereGetCurrentLimitInfo(u64 *out_current_value, u64 *out_limit_value, ResourceLimitGroup group, LimitableResource resource);
|
||||
|
||||
}
|
||||
|
|
|
@ -28,13 +28,13 @@ namespace ams::sf::hipc {
|
|||
NeedsRetry,
|
||||
};
|
||||
|
||||
void AttachMultiWaitHolderForAccept(os::MultiWaitHolderType *holder, Handle port);
|
||||
void AttachMultiWaitHolderForReply(os::MultiWaitHolderType *holder, Handle request);
|
||||
void AttachMultiWaitHolderForAccept(os::MultiWaitHolderType *holder, os::NativeHandle port);
|
||||
void AttachMultiWaitHolderForReply(os::MultiWaitHolderType *holder, os::NativeHandle request);
|
||||
|
||||
Result Receive(ReceiveResult *out_recv_result, Handle session_handle, const cmif::PointerAndSize &message_buffer);
|
||||
Result Receive(bool *out_closed, Handle session_handle, const cmif::PointerAndSize &message_buffer);
|
||||
Result Reply(Handle session_handle, const cmif::PointerAndSize &message_buffer);
|
||||
Result Receive(ReceiveResult *out_recv_result, os::NativeHandle session_handle, const cmif::PointerAndSize &message_buffer);
|
||||
Result Receive(bool *out_closed, os::NativeHandle session_handle, const cmif::PointerAndSize &message_buffer);
|
||||
Result Reply(os::NativeHandle session_handle, const cmif::PointerAndSize &message_buffer);
|
||||
|
||||
Result CreateSession(Handle *out_server_handle, Handle *out_client_handle);
|
||||
Result CreateSession(os::NativeHandle *out_server_handle, os::NativeHandle *out_client_handle);
|
||||
|
||||
}
|
||||
|
|
|
@ -49,11 +49,11 @@ namespace ams::sf::hipc {
|
|||
cmif::PointerAndSize pointer_buffer;
|
||||
cmif::PointerAndSize saved_message;
|
||||
std::shared_ptr<::Service> forward_service;
|
||||
Handle session_handle;
|
||||
os::NativeHandle session_handle;
|
||||
bool is_closed;
|
||||
bool has_received;
|
||||
public:
|
||||
ServerSession(Handle h, cmif::ServiceObjectHolder &&obj) : srv_obj_holder(std::move(obj)), session_handle(h) {
|
||||
ServerSession(os::NativeHandle h, cmif::ServiceObjectHolder &&obj) : srv_obj_holder(std::move(obj)), session_handle(h) {
|
||||
hipc::AttachMultiWaitHolderForReply(this, h);
|
||||
this->is_closed = false;
|
||||
this->has_received = false;
|
||||
|
@ -61,7 +61,7 @@ namespace ams::sf::hipc {
|
|||
AMS_ABORT_UNLESS(!this->IsMitmSession());
|
||||
}
|
||||
|
||||
ServerSession(Handle h, cmif::ServiceObjectHolder &&obj, std::shared_ptr<::Service> &&fsrv) : srv_obj_holder(std::move(obj)), session_handle(h) {
|
||||
ServerSession(os::NativeHandle h, cmif::ServiceObjectHolder &&obj, std::shared_ptr<::Service> &&fsrv) : srv_obj_holder(std::move(obj)), session_handle(h) {
|
||||
hipc::AttachMultiWaitHolderForReply(this, h);
|
||||
this->is_closed = false;
|
||||
this->has_received = false;
|
||||
|
@ -117,55 +117,55 @@ namespace ams::sf::hipc {
|
|||
|
||||
Result ReceiveRequestImpl(ServerSession *session, const cmif::PointerAndSize &message);
|
||||
void CloseSessionImpl(ServerSession *session);
|
||||
Result RegisterSessionImpl(ServerSession *session_memory, Handle session_handle, cmif::ServiceObjectHolder &&obj);
|
||||
Result AcceptSessionImpl(ServerSession *session_memory, Handle port_handle, cmif::ServiceObjectHolder &&obj);
|
||||
Result RegisterMitmSessionImpl(ServerSession *session_memory, Handle mitm_session_handle, cmif::ServiceObjectHolder &&obj, std::shared_ptr<::Service> &&fsrv);
|
||||
Result AcceptMitmSessionImpl(ServerSession *session_memory, Handle mitm_port_handle, cmif::ServiceObjectHolder &&obj, std::shared_ptr<::Service> &&fsrv);
|
||||
Result RegisterSessionImpl(ServerSession *session_memory, os::NativeHandle session_handle, cmif::ServiceObjectHolder &&obj);
|
||||
Result AcceptSessionImpl(ServerSession *session_memory, os::NativeHandle port_handle, cmif::ServiceObjectHolder &&obj);
|
||||
Result RegisterMitmSessionImpl(ServerSession *session_memory, os::NativeHandle mitm_session_handle, cmif::ServiceObjectHolder &&obj, std::shared_ptr<::Service> &&fsrv);
|
||||
Result AcceptMitmSessionImpl(ServerSession *session_memory, os::NativeHandle mitm_port_handle, cmif::ServiceObjectHolder &&obj, std::shared_ptr<::Service> &&fsrv);
|
||||
|
||||
Result ReceiveRequest(ServerSession *session, const cmif::PointerAndSize &message) {
|
||||
return this->ReceiveRequestImpl(session, message);
|
||||
}
|
||||
|
||||
Result RegisterSession(ServerSession **out, Handle session_handle, cmif::ServiceObjectHolder &&obj) {
|
||||
Result RegisterSession(ServerSession **out, os::NativeHandle session_handle, cmif::ServiceObjectHolder &&obj) {
|
||||
auto ctor = [&](ServerSession *session_memory) -> Result {
|
||||
return this->RegisterSessionImpl(session_memory, session_handle, std::forward<cmif::ServiceObjectHolder>(obj));
|
||||
};
|
||||
return this->CreateSessionImpl(out, ctor);
|
||||
}
|
||||
|
||||
Result AcceptSession(ServerSession **out, Handle port_handle, cmif::ServiceObjectHolder &&obj) {
|
||||
Result AcceptSession(ServerSession **out, os::NativeHandle port_handle, cmif::ServiceObjectHolder &&obj) {
|
||||
auto ctor = [&](ServerSession *session_memory) -> Result {
|
||||
return this->AcceptSessionImpl(session_memory, port_handle, std::forward<cmif::ServiceObjectHolder>(obj));
|
||||
};
|
||||
return this->CreateSessionImpl(out, ctor);
|
||||
}
|
||||
|
||||
Result RegisterMitmSession(ServerSession **out, Handle mitm_session_handle, cmif::ServiceObjectHolder &&obj, std::shared_ptr<::Service> &&fsrv) {
|
||||
Result RegisterMitmSession(ServerSession **out, os::NativeHandle mitm_session_handle, cmif::ServiceObjectHolder &&obj, std::shared_ptr<::Service> &&fsrv) {
|
||||
auto ctor = [&](ServerSession *session_memory) -> Result {
|
||||
return this->RegisterMitmSessionImpl(session_memory, mitm_session_handle, std::forward<cmif::ServiceObjectHolder>(obj), std::forward<std::shared_ptr<::Service>>(fsrv));
|
||||
};
|
||||
return this->CreateSessionImpl(out, ctor);
|
||||
}
|
||||
|
||||
Result AcceptMitmSession(ServerSession **out, Handle mitm_port_handle, cmif::ServiceObjectHolder &&obj, std::shared_ptr<::Service> &&fsrv) {
|
||||
Result AcceptMitmSession(ServerSession **out, os::NativeHandle mitm_port_handle, cmif::ServiceObjectHolder &&obj, std::shared_ptr<::Service> &&fsrv) {
|
||||
auto ctor = [&](ServerSession *session_memory) -> Result {
|
||||
return this->AcceptMitmSessionImpl(session_memory, mitm_port_handle, std::forward<cmif::ServiceObjectHolder>(obj), std::forward<std::shared_ptr<::Service>>(fsrv));
|
||||
};
|
||||
return this->CreateSessionImpl(out, ctor);
|
||||
}
|
||||
public:
|
||||
Result RegisterSession(Handle session_handle, cmif::ServiceObjectHolder &&obj);
|
||||
Result AcceptSession(Handle port_handle, cmif::ServiceObjectHolder &&obj);
|
||||
Result RegisterMitmSession(Handle session_handle, cmif::ServiceObjectHolder &&obj, std::shared_ptr<::Service> &&fsrv);
|
||||
Result AcceptMitmSession(Handle mitm_port_handle, cmif::ServiceObjectHolder &&obj, std::shared_ptr<::Service> &&fsrv);
|
||||
Result RegisterSession(os::NativeHandle session_handle, cmif::ServiceObjectHolder &&obj);
|
||||
Result AcceptSession(os::NativeHandle port_handle, cmif::ServiceObjectHolder &&obj);
|
||||
Result RegisterMitmSession(os::NativeHandle session_handle, cmif::ServiceObjectHolder &&obj, std::shared_ptr<::Service> &&fsrv);
|
||||
Result AcceptMitmSession(os::NativeHandle mitm_port_handle, cmif::ServiceObjectHolder &&obj, std::shared_ptr<::Service> &&fsrv);
|
||||
|
||||
template<typename Interface>
|
||||
Result AcceptSession(Handle port_handle, SharedPointer<Interface> obj) {
|
||||
Result AcceptSession(os::NativeHandle port_handle, SharedPointer<Interface> obj) {
|
||||
return this->AcceptSession(port_handle, cmif::ServiceObjectHolder(std::move(obj)));
|
||||
}
|
||||
|
||||
template<typename Interface>
|
||||
Result AcceptMitmSession(Handle mitm_port_handle, SharedPointer<Interface> obj, std::shared_ptr<::Service> &&fsrv) {
|
||||
Result AcceptMitmSession(os::NativeHandle mitm_port_handle, SharedPointer<Interface> obj, std::shared_ptr<::Service> &&fsrv) {
|
||||
return this->AcceptMitmSession(mitm_port_handle, cmif::ServiceObjectHolder(std::move(obj)), std::forward<std::shared_ptr<::Service>>(fsrv));
|
||||
}
|
||||
|
||||
|
|
|
@ -837,12 +837,12 @@ namespace ams::sf::impl {
|
|||
private:
|
||||
template<size_t Index>
|
||||
NX_CONSTEXPR void SetOutObjectImpl(const HipcRequest &response, hipc::ServerSessionManager *manager, cmif::ServiceObjectHolder &&object) {
|
||||
/* If no object, write INVALID_HANDLE. This is what official software does. */
|
||||
/* If no object, write os::InvalidNativeHandle. This is what official software does. */
|
||||
if (!object) {
|
||||
response.move_handles[Index] = INVALID_HANDLE;
|
||||
response.move_handles[Index] = os::InvalidNativeHandle;
|
||||
return;
|
||||
}
|
||||
Handle server_handle, client_handle;
|
||||
os::NativeHandle server_handle, client_handle;
|
||||
R_ABORT_UNLESS(sf::hipc::CreateSession(&server_handle, &client_handle));
|
||||
R_ABORT_UNLESS(manager->RegisterSession(server_handle, std::move(object)));
|
||||
response.move_handles[Index] = client_handle;
|
||||
|
|
|
@ -28,17 +28,17 @@ namespace ams::sf {
|
|||
|
||||
template<u32 Attribute>
|
||||
struct InHandle : public InHandleTag {
|
||||
::Handle handle;
|
||||
os::NativeHandle handle;
|
||||
|
||||
constexpr InHandle() : handle(INVALID_HANDLE) { /* ... */ }
|
||||
constexpr InHandle(::Handle h) : handle(h) { /* ... */ }
|
||||
constexpr InHandle() : handle(os::InvalidNativeHandle) { /* ... */ }
|
||||
constexpr InHandle(os::NativeHandle h) : handle(h) { /* ... */ }
|
||||
constexpr InHandle(const InHandle &o) : handle(o.handle) { /* ... */ }
|
||||
|
||||
constexpr void operator=(const ::Handle &h) { this->handle = h; }
|
||||
constexpr void operator=(const os::NativeHandle &h) { this->handle = h; }
|
||||
constexpr void operator=(const InHandle &o) { this->handle = o.handle; }
|
||||
|
||||
constexpr /* TODO: explicit? */ operator ::Handle() const { return this->handle; }
|
||||
constexpr ::Handle GetValue() const { return this->handle; }
|
||||
constexpr /* TODO: explicit? */ operator os::NativeHandle() const { return this->handle; }
|
||||
constexpr os::NativeHandle GetValue() const { return this->handle; }
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
|
@ -49,7 +49,7 @@ namespace ams::sf {
|
|||
public:
|
||||
constexpr OutHandleImpl(T *p) : ptr(p) { /* ... */ }
|
||||
|
||||
constexpr void SetValue(const Handle &value) {
|
||||
constexpr void SetValue(const os::NativeHandle &value) {
|
||||
*this->ptr = value;
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ namespace ams::sf {
|
|||
return this->ptr;
|
||||
}
|
||||
|
||||
constexpr Handle *GetHandlePointer() const {
|
||||
constexpr os::NativeHandle *GetHandlePointer() const {
|
||||
return &this->ptr->handle;
|
||||
}
|
||||
|
||||
|
@ -83,8 +83,8 @@ namespace ams::sf {
|
|||
using MoveHandle = typename impl::InHandle<SfOutHandleAttr_HipcMove>;
|
||||
using CopyHandle = typename impl::InHandle<SfOutHandleAttr_HipcCopy>;
|
||||
|
||||
static_assert(sizeof(MoveHandle) == sizeof(::Handle), "sizeof(MoveHandle)");
|
||||
static_assert(sizeof(CopyHandle) == sizeof(::Handle), "sizeof(CopyHandle)");
|
||||
static_assert(sizeof(MoveHandle) == sizeof(os::NativeHandle), "sizeof(MoveHandle)");
|
||||
static_assert(sizeof(CopyHandle) == sizeof(os::NativeHandle), "sizeof(CopyHandle)");
|
||||
|
||||
template<>
|
||||
class IsOutForceEnabled<MoveHandle> : public std::true_type{};
|
||||
|
@ -99,7 +99,7 @@ namespace ams::sf {
|
|||
public:
|
||||
constexpr Out<T>(T *p) : Base(p) { /* ... */ }
|
||||
|
||||
constexpr void SetValue(const Handle &value) {
|
||||
constexpr void SetValue(const os::NativeHandle &value) {
|
||||
Base::SetValue(value);
|
||||
}
|
||||
|
||||
|
@ -115,7 +115,7 @@ namespace ams::sf {
|
|||
return Base::GetPointer();
|
||||
}
|
||||
|
||||
constexpr Handle *GetHandlePointer() const {
|
||||
constexpr os::NativeHandle *GetHandlePointer() const {
|
||||
return Base::GetHandlePointer();
|
||||
}
|
||||
|
||||
|
@ -139,7 +139,7 @@ namespace ams::sf {
|
|||
constexpr Out<T>(T *p) : Base(p), m_managed(nullptr) { /* ... */ }
|
||||
constexpr Out<T>(T *p, bool *m) : Base(p), m_managed(m) { /* ... */ }
|
||||
|
||||
constexpr void SetValue(const Handle &value) {
|
||||
constexpr void SetValue(const os::NativeHandle &value) {
|
||||
Base::SetValue(value);
|
||||
}
|
||||
|
||||
|
@ -160,7 +160,7 @@ namespace ams::sf {
|
|||
return Base::GetPointer();
|
||||
}
|
||||
|
||||
constexpr Handle *GetHandlePointer() const {
|
||||
constexpr os::NativeHandle *GetHandlePointer() const {
|
||||
return Base::GetHandlePointer();
|
||||
}
|
||||
|
||||
|
|
|
@ -390,6 +390,10 @@
|
|||
return ::svcContinueDebugEvent(debug_handle, flags, const_cast<u64 *>(thread_ids.GetPointerUnsafe()), num_thread_ids);
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result LegacyContinueDebugEvent(::ams::svc::Handle debug_handle, uint32_t flags, uint64_t thread_id) {
|
||||
return ::svcLegacyContinueDebugEvent(debug_handle, flags, thread_id);
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Result GetProcessList(int32_t *out_num_processes, ::ams::svc::UserPointer<uint64_t *> out_process_ids, int32_t max_out_count) {
|
||||
return ::svcGetProcessList(out_num_processes, out_process_ids.GetPointerUnsafe(), max_out_count);
|
||||
}
|
||||
|
|
|
@ -27,17 +27,17 @@ namespace ams::tipc {
|
|||
|
||||
template<u32 Attribute>
|
||||
struct InHandle : public InHandleTag {
|
||||
::Handle handle;
|
||||
os::NativeHandle handle;
|
||||
|
||||
constexpr InHandle() : handle(INVALID_HANDLE) { /* ... */ }
|
||||
constexpr InHandle(::Handle h) : handle(h) { /* ... */ }
|
||||
constexpr InHandle() : handle(os::InvalidNativeHandle) { /* ... */ }
|
||||
constexpr InHandle(os::NativeHandle h) : handle(h) { /* ... */ }
|
||||
constexpr InHandle(const InHandle &o) : handle(o.handle) { /* ... */ }
|
||||
|
||||
constexpr void operator=(const ::Handle &h) { this->handle = h; }
|
||||
constexpr void operator=(const os::NativeHandle &h) { this->handle = h; }
|
||||
constexpr void operator=(const InHandle &o) { this->handle = o.handle; }
|
||||
|
||||
constexpr /* TODO: explicit? */ operator ::Handle() const { return this->handle; }
|
||||
constexpr ::Handle GetValue() const { return this->handle; }
|
||||
constexpr /* TODO: explicit? */ operator os::NativeHandle() const { return this->handle; }
|
||||
constexpr os::NativeHandle GetValue() const { return this->handle; }
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
|
@ -48,7 +48,7 @@ namespace ams::tipc {
|
|||
public:
|
||||
constexpr OutHandleImpl(T *p) : ptr(p) { /* ... */ }
|
||||
|
||||
constexpr void SetValue(const Handle &value) {
|
||||
constexpr void SetValue(const os::NativeHandle &value) {
|
||||
*this->ptr = value;
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ namespace ams::tipc {
|
|||
return this->ptr;
|
||||
}
|
||||
|
||||
constexpr Handle *GetHandlePointer() const {
|
||||
constexpr os::NativeHandle *GetHandlePointer() const {
|
||||
return &this->ptr->handle;
|
||||
}
|
||||
|
||||
|
@ -82,8 +82,8 @@ namespace ams::tipc {
|
|||
using MoveHandle = typename impl::InHandle<SfOutHandleAttr_HipcMove>;
|
||||
using CopyHandle = typename impl::InHandle<SfOutHandleAttr_HipcCopy>;
|
||||
|
||||
static_assert(sizeof(MoveHandle) == sizeof(::Handle), "sizeof(MoveHandle)");
|
||||
static_assert(sizeof(CopyHandle) == sizeof(::Handle), "sizeof(CopyHandle)");
|
||||
static_assert(sizeof(MoveHandle) == sizeof(os::NativeHandle), "sizeof(MoveHandle)");
|
||||
static_assert(sizeof(CopyHandle) == sizeof(os::NativeHandle), "sizeof(CopyHandle)");
|
||||
|
||||
template<>
|
||||
class IsOutForceEnabled<MoveHandle> : public std::true_type{};
|
||||
|
@ -98,7 +98,7 @@ namespace ams::tipc {
|
|||
public:
|
||||
constexpr Out<T>(T *p) : Base(p) { /* ... */ }
|
||||
|
||||
constexpr void SetValue(const Handle &value) {
|
||||
constexpr void SetValue(const os::NativeHandle &value) {
|
||||
Base::SetValue(value);
|
||||
}
|
||||
|
||||
|
@ -114,7 +114,7 @@ namespace ams::tipc {
|
|||
return Base::GetPointer();
|
||||
}
|
||||
|
||||
constexpr Handle *GetHandlePointer() const {
|
||||
constexpr os::NativeHandle *GetHandlePointer() const {
|
||||
return Base::GetHandlePointer();
|
||||
}
|
||||
|
||||
|
@ -135,7 +135,7 @@ namespace ams::tipc {
|
|||
public:
|
||||
constexpr Out<T>(T *p) : Base(p) { /* ... */ }
|
||||
|
||||
constexpr void SetValue(const Handle &value) {
|
||||
constexpr void SetValue(const os::NativeHandle &value) {
|
||||
Base::SetValue(value);
|
||||
}
|
||||
|
||||
|
@ -151,7 +151,7 @@ namespace ams::tipc {
|
|||
return Base::GetPointer();
|
||||
}
|
||||
|
||||
constexpr Handle *GetHandlePointer() const {
|
||||
constexpr os::NativeHandle *GetHandlePointer() const {
|
||||
return Base::GetHandlePointer();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue