//////////////////////// \brief SysEndpointInfo (endpoint, info) Get endpoint information \param endpoint Endpoint handle \param info Pointer to endpoint info struct \return 0 on success, negative error code on failure ////////////////////////
| 2506 | /// \return 0 on success, negative error code on failure |
| 2507 | ///////////////////////////// |
| 2508 | long SysEndpointInfo(regs64_t* r){ |
| 2509 | process_t* currentProcess = Scheduler::GetCurrentProcess(); |
| 2510 | |
| 2511 | MessageEndpointInfo* info = reinterpret_cast<MessageEndpointInfo*>(SC_ARG1(r)); |
| 2512 | |
| 2513 | if(!Memory::CheckUsermodePointer(SC_ARG1(r), sizeof(MessageEndpointInfo), currentProcess->addressSpace)){ |
| 2514 | return -EFAULT; // Data greater than 8 and invalid pointer |
| 2515 | } |
| 2516 | |
| 2517 | Handle* endpHandle; |
| 2518 | if(Scheduler::FindHandle(currentProcess, SC_ARG0(r), &endpHandle)){ |
| 2519 | Log::Warning("SysEndpointQueue: Invalid handle ID %d", SC_ARG0(r)); |
| 2520 | return -EINVAL; |
| 2521 | } |
| 2522 | |
| 2523 | if(!endpHandle->ko->IsType(MessageEndpoint::TypeID())){ |
| 2524 | Log::Warning("SysEndpointQueue: Invalid handle type (ID %d)", SC_ARG0(r)); |
| 2525 | return -EINVAL; |
| 2526 | } |
| 2527 | |
| 2528 | MessageEndpoint* endpoint = reinterpret_cast<MessageEndpoint*>(endpHandle->ko.get()); |
| 2529 | |
| 2530 | *info = { .msgSize = endpoint->GetMaxMessageSize() }; |
| 2531 | return 0; |
| 2532 | } |
| 2533 | |
| 2534 | ///////////////////////////// |
| 2535 | /// \brief SysKernelObjectWaitOne (object) |
nothing calls this directly
no test coverage detected