| 16 | static Result bossipc_InitializeSession(u64 programID); |
| 17 | |
| 18 | Result 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 | |
| 56 | Result bossReinit(u64 programID) |
| 57 | { |
nothing calls this directly
no test coverage detected