MCPcopy Create free account
hub / github.com/devkitPro/libctru / bossInit

Function bossInit

libctru/source/services/boss.c:18–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16static Result bossipc_InitializeSession(u64 programID);
17
18Result bossInit(u64 programID, bool force_user)
19{
20 Result res=0;
21 Handle envhandle=0;
22 Handle handle=0;
23
24 if (AtomicPostIncrement(&bossRefCount)) return 0;
25
26 res = -1;
27
28 if(!force_user)
29 {
30 res = srvGetServiceHandle(&handle, "boss:P");
31 envhandle = envGetHandle("boss:P");
32 bossPriv = 1;
33 }
34
35 if (R_FAILED(res))
36 {
37 bossPriv = 0;
38 res = srvGetServiceHandle(&handle, "boss:U");
39 envhandle = envGetHandle("boss:U");
40 }
41
42 if (R_FAILED(res)) AtomicDecrement(&bossRefCount);
43
44 if (R_SUCCEEDED(res))
45 {
46 bossHandle = handle;
47
48 if(envhandle==0)res = bossipc_InitializeSession(programID);
49
50 if (R_FAILED(res))bossExit();
51 }
52
53 return res;
54}
55
56Result bossReinit(u64 programID)
57{

Callers

nothing calls this directly

Calls 4

srvGetServiceHandleFunction · 0.85
envGetHandleFunction · 0.85
bossExitFunction · 0.85

Tested by

no test coverage detected