mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 20:42:44 +02:00
Add detectMesosphere()
This commit is contained in:
parent
970d982e57
commit
eecf2a9d32
@ -6,6 +6,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
#include "../types.h"
|
||||
#include "../result.h"
|
||||
#include "svc.h"
|
||||
|
||||
/// Returns true if the process has a debugger attached.
|
||||
@ -14,3 +15,10 @@ NX_INLINE bool detectDebugger(void) {
|
||||
Result rc = svcGetInfo(&tmp, InfoType_DebuggerAttached, INVALID_HANDLE, 0);
|
||||
return R_SUCCEEDED(rc) && tmp != 0;
|
||||
}
|
||||
|
||||
/// Returns true if the underlying kernel is Mesosphère.
|
||||
NX_INLINE bool detectMesosphere(void) {
|
||||
u64 dummy = 0;
|
||||
Result rc = svcGetInfo(&dummy, 65000, INVALID_HANDLE, 0); // InfoType_MesosphereMeta
|
||||
return R_SUCCEEDED(rc);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user