//////////////////////// \brief SysKernelObjectDestroy (object) Destroy a KernelObject \param object (handle_t) Object to destroy \return negative error code on failure ////////////////////////
| 2604 | /// \return negative error code on failure |
| 2605 | ///////////////////////////// |
| 2606 | long SysKernelObjectDestroy(regs64_t* r){ |
| 2607 | process_t* currentProcess = Scheduler::GetCurrentProcess(); |
| 2608 | |
| 2609 | Handle* h; |
| 2610 | if(Scheduler::FindHandle(currentProcess, SC_ARG0(r), &h)){ |
| 2611 | Log::Warning("SysKernelObjectDestroy: Invalid handle ID %d", SC_ARG0(r)); |
| 2612 | |
| 2613 | IF_DEBUG(debugLevelSyscalls >= DebugLevelVerbose, { |
| 2614 | Log::Info("Process %s (PID: %d), Stack Trace:", currentProcess->name, currentProcess->pid); |
| 2615 | Log::Info("%x", r->rip); |
| 2616 | UserPrintStackTrace(r->rbp, currentProcess->addressSpace); |
| 2617 | }); |
| 2618 | return -EINVAL; |
| 2619 | } |
| 2620 | |
| 2621 | h->ko->Destroy(); |
| 2622 | |
| 2623 | Scheduler::DestroyHandle(currentProcess, SC_ARG0(r)); |
| 2624 | return 0; |
| 2625 | } |
| 2626 | |
| 2627 | syscall_t syscalls[]{ |
| 2628 | SysDebug, |
nothing calls this directly
no test coverage detected