mirror of
https://github.com/switchbrew/libnx.git
synced 2025-07-04 10:32:15 +02:00
Improved ns:vm handling on unsupported firmware versions
Signed-off-by: Adubbz <Adubbz@users.noreply.github.com>
This commit is contained in:
parent
ed48407d18
commit
57168f2e79
@ -119,6 +119,9 @@ Result nsGetApplicationControlData(u8 flag, u64 titleID, NsApplicationControlDat
|
|||||||
|
|
||||||
Result nsvmInitialize(void)
|
Result nsvmInitialize(void)
|
||||||
{
|
{
|
||||||
|
if (!kernelAbove300())
|
||||||
|
return 0;
|
||||||
|
|
||||||
atomicIncrement64(&g_nsvmRefCnt);
|
atomicIncrement64(&g_nsvmRefCnt);
|
||||||
|
|
||||||
if (serviceIsActive(&g_nsvmSrv))
|
if (serviceIsActive(&g_nsvmSrv))
|
||||||
@ -129,6 +132,9 @@ Result nsvmInitialize(void)
|
|||||||
|
|
||||||
void nsvmExit(void)
|
void nsvmExit(void)
|
||||||
{
|
{
|
||||||
|
if (!kernelAbove300())
|
||||||
|
return;
|
||||||
|
|
||||||
if (atomicDecrement64(&g_nsvmRefCnt) == 0) {
|
if (atomicDecrement64(&g_nsvmRefCnt) == 0) {
|
||||||
serviceClose(&g_nsvmSrv);
|
serviceClose(&g_nsvmSrv);
|
||||||
}
|
}
|
||||||
@ -175,6 +181,9 @@ Result nsvmNeedsUpdateVulnerability(u8 *out) {
|
|||||||
|
|
||||||
Result nsvmGetSafeSystemVersion(u16 *out)
|
Result nsvmGetSafeSystemVersion(u16 *out)
|
||||||
{
|
{
|
||||||
|
if (!kernelAbove300())
|
||||||
|
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||||
|
|
||||||
IpcCommand c;
|
IpcCommand c;
|
||||||
ipcInitialize(&c);
|
ipcInitialize(&c);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user