| 148 | } |
| 149 | |
| 150 | Result aptSendCommand(u32* aptcmdbuf) |
| 151 | { |
| 152 | Handle aptuHandle; |
| 153 | |
| 154 | if (aptLockHandle) svcWaitSynchronization(aptLockHandle, U64_MAX); |
| 155 | Result res = aptGetServiceHandle(&aptuHandle); |
| 156 | if (R_SUCCEEDED(res)) |
| 157 | { |
| 158 | u32* cmdbuf = getThreadCommandBuffer(); |
| 159 | memcpy(cmdbuf, aptcmdbuf, 4*countPrmWords(aptcmdbuf[0])); |
| 160 | res = svcSendSyncRequest(aptuHandle); |
| 161 | if (R_SUCCEEDED(res)) |
| 162 | { |
| 163 | memcpy(aptcmdbuf, cmdbuf, 4*countPrmWords(cmdbuf[0])); |
| 164 | res = aptcmdbuf[1]; |
| 165 | } |
| 166 | svcCloseHandle(aptuHandle); |
| 167 | } |
| 168 | if (aptLockHandle) svcReleaseMutex(aptLockHandle); |
| 169 | return res; |
| 170 | } |
| 171 | |
| 172 | static void aptInitCaptureInfo(aptCaptureBufInfo* capinfo, const GSPGPU_CaptureInfo* gspcapinfo) |
| 173 | { |
no test coverage detected