mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 20:42:44 +02:00
pgl: add pglTerminateProcess
This commit is contained in:
parent
27b34533ac
commit
02e4aad9dc
@ -64,6 +64,7 @@ extern "C" {
|
|||||||
#include "switch/services/pcv.h"
|
#include "switch/services/pcv.h"
|
||||||
#include "switch/services/clkrst.h"
|
#include "switch/services/clkrst.h"
|
||||||
#include "switch/services/fan.h"
|
#include "switch/services/fan.h"
|
||||||
|
#include "switch/services/pgl.h"
|
||||||
#include "switch/services/psm.h"
|
#include "switch/services/psm.h"
|
||||||
#include "switch/services/spsm.h"
|
#include "switch/services/spsm.h"
|
||||||
//#include "switch/services/bsd.h" Use <sys/socket.h> instead
|
//#include "switch/services/bsd.h" Use <sys/socket.h> instead
|
||||||
|
20
nx/include/switch/services/pgl.h
Normal file
20
nx/include/switch/services/pgl.h
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
/**
|
||||||
|
* @file pgl.h
|
||||||
|
* @brief PGL service IPC wrapper.
|
||||||
|
* @author SciresM
|
||||||
|
* @copyright libnx Authors
|
||||||
|
*/
|
||||||
|
#pragma once
|
||||||
|
#include "../types.h"
|
||||||
|
#include "../sf/service.h"
|
||||||
|
|
||||||
|
/// Initialize pgl.
|
||||||
|
Result pglInitialize(void);
|
||||||
|
|
||||||
|
/// Exit pgl.
|
||||||
|
void pglExit(void);
|
||||||
|
|
||||||
|
/// Gets the Service object for the actual pgl service session.
|
||||||
|
Service* pglGetServiceSession(void);
|
||||||
|
|
||||||
|
Result pglTerminateProcess(u64 pid);
|
30
nx/source/services/pgl.c
Normal file
30
nx/source/services/pgl.c
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
#define NX_SERVICE_ASSUME_NON_DOMAIN
|
||||||
|
#include "service_guard.h"
|
||||||
|
#include "services/pgl.h"
|
||||||
|
#include "runtime/hosversion.h"
|
||||||
|
|
||||||
|
static Service g_pglSrv;
|
||||||
|
|
||||||
|
NX_GENERATE_SERVICE_GUARD(pgl);
|
||||||
|
|
||||||
|
Result _pglInitialize(void) {
|
||||||
|
if (hosversionBefore(10,0,0))
|
||||||
|
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||||
|
return smGetService(&g_pglSrv, "pgl");
|
||||||
|
}
|
||||||
|
|
||||||
|
void _pglCleanup(void) {
|
||||||
|
serviceClose(&g_pglSrv);
|
||||||
|
}
|
||||||
|
|
||||||
|
Service* pglGetServiceSession(void) {
|
||||||
|
return &g_pglSrv;
|
||||||
|
}
|
||||||
|
|
||||||
|
static Result _pglCmdInU64(Service* srv, u32 cmd_id, u64 inval) {
|
||||||
|
return serviceDispatchIn(srv, cmd_id, inval);
|
||||||
|
}
|
||||||
|
|
||||||
|
Result pglTerminateProcess(u64 pid) {
|
||||||
|
return _pglCmdInU64(&g_pglSrv, 1, pid);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user