Multiple srv:pm bugfixes
This commit is contained in:
parent
4ceebb8b44
commit
b86b40888a
@ -35,7 +35,7 @@ Result SRVPM_PublishToAll(u32 notificationId);
|
|||||||
* @param count Number of services within the service access control data.
|
* @param count Number of services within the service access control data.
|
||||||
* @param serviceAccessControlList Service Access Control list.
|
* @param serviceAccessControlList Service Access Control list.
|
||||||
*/
|
*/
|
||||||
Result SRVPM_RegisterProcess(u32 pid, u32 count, char (*serviceAccessControlList)[8]);
|
Result SRVPM_RegisterProcess(u32 pid, u32 count, const char (*serviceAccessControlList)[8]);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Unregisters a process with SRV.
|
* @brief Unregisters a process with SRV.
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include <3ds/ipc.h>
|
#include <3ds/ipc.h>
|
||||||
#include <3ds/os.h>
|
#include <3ds/os.h>
|
||||||
|
|
||||||
#define IS_PRE_7X (osGetFirmVersion() >= SYSTEM_VERSION(2, 39, 4))
|
#define IS_PRE_7X (osGetFirmVersion() < SYSTEM_VERSION(2, 39, 4))
|
||||||
|
|
||||||
static Handle srvPmHandle;
|
static Handle srvPmHandle;
|
||||||
static int srvPmRefCount;
|
static int srvPmRefCount;
|
||||||
@ -38,7 +38,8 @@ void srvPmExit(void)
|
|||||||
{
|
{
|
||||||
if (*srvGetSessionHandle() != 0) srvExit();
|
if (*srvGetSessionHandle() != 0) srvExit();
|
||||||
if (AtomicDecrement(&srvPmRefCount)) return;
|
if (AtomicDecrement(&srvPmRefCount)) return;
|
||||||
svcCloseHandle(srvPmHandle);
|
if(srvPmHandle != 0) svcCloseHandle(srvPmHandle);
|
||||||
|
srvPmHandle = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle *srvPmGetSessionHandle(void)
|
Handle *srvPmGetSessionHandle(void)
|
||||||
@ -78,13 +79,13 @@ Result SRVPM_PublishToAll(u32 notificationId)
|
|||||||
return srvPmSendCommand(cmdbuf);
|
return srvPmSendCommand(cmdbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result SRVPM_RegisterProcess(u32 pid, u32 count, char (*serviceAccessControlList)[8])
|
Result SRVPM_RegisterProcess(u32 pid, u32 count, const char (*serviceAccessControlList)[8])
|
||||||
{
|
{
|
||||||
u32 *cmdbuf = getThreadCommandBuffer();
|
u32 *cmdbuf = getThreadCommandBuffer();
|
||||||
|
|
||||||
cmdbuf[0] = IPC_MakeHeader(0x3,2,2); // 0x30082
|
cmdbuf[0] = IPC_MakeHeader(0x3,2,2); // 0x30082
|
||||||
cmdbuf[1] = pid;
|
cmdbuf[1] = pid;
|
||||||
cmdbuf[2] = count;
|
cmdbuf[2] = count*2;
|
||||||
cmdbuf[3] = IPC_Desc_StaticBuffer(count*8,0);
|
cmdbuf[3] = IPC_Desc_StaticBuffer(count*8,0);
|
||||||
cmdbuf[4] = (u32)serviceAccessControlList;
|
cmdbuf[4] = (u32)serviceAccessControlList;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user