| 1226 | } |
| 1227 | |
| 1228 | Result APT_ReceiveParameter(NS_APPID appID, void* buffer, size_t bufferSize, NS_APPID* sender, APT_Command* command, size_t* actualSize, Handle* parameter) |
| 1229 | { |
| 1230 | u32 cmdbuf[16]; |
| 1231 | cmdbuf[0]=IPC_MakeHeader(0xD,2,0); // 0xD0080 |
| 1232 | cmdbuf[1]=appID; |
| 1233 | cmdbuf[2]=bufferSize; |
| 1234 | |
| 1235 | u32 saved_threadstorage[2]; |
| 1236 | u32* staticbufs = getThreadStaticBuffers(); |
| 1237 | saved_threadstorage[0]=staticbufs[0]; |
| 1238 | saved_threadstorage[1]=staticbufs[1]; |
| 1239 | staticbufs[0]=IPC_Desc_StaticBuffer(cmdbuf[2],0); |
| 1240 | staticbufs[1]=(u32)buffer; |
| 1241 | |
| 1242 | Result ret = aptSendCommand(cmdbuf); |
| 1243 | staticbufs[0]=saved_threadstorage[0]; |
| 1244 | staticbufs[1]=saved_threadstorage[1]; |
| 1245 | |
| 1246 | if (R_SUCCEEDED(ret)) |
| 1247 | { |
| 1248 | if (sender) *sender =cmdbuf[2]; |
| 1249 | if (command) *command =cmdbuf[3]; |
| 1250 | if (actualSize) *actualSize=cmdbuf[4]; |
| 1251 | if (parameter) *parameter =cmdbuf[6]; |
| 1252 | else if (cmdbuf[6]) svcCloseHandle(cmdbuf[6]); |
| 1253 | } |
| 1254 | |
| 1255 | return ret; |
| 1256 | } |
| 1257 | |
| 1258 | Result APT_SendParameter(NS_APPID source, NS_APPID dest, APT_Command command, const void* buffer, u32 bufferSize, Handle parameter) |
| 1259 | { |
no test coverage detected