destroy
| Number | 0x24 |
|---|---|
| Signature | (handle) -> 0 or -err |
| Group | handles |
| Since | 1.0 |
Destroy the object behind a handle. Dispatches on the handle’s type, so it replaces the old per-type destroy calls.
Pitfalls
Unmap a shared-memory or device region with memunmap before destroying its handle, or you get ERR_BUSY. Same goes for task handles, if the process is still running while destroy is called, you get ERR_BUSY.
Arguments
| Register | Name | Description |
|---|---|---|
r0 | handle | Handle of the object to destroy |
Returns
0 on success.
Errors
| Code | Condition |
|---|---|
ERR_BADHANDLE | Handle names no live entry |
ERR_BADTYPE | Handle is a REPLY type, which destroy refuses |
ERR_BUSY | Object is still mapped somewhere |
ERR_DEAD | Port/ntfn owner is dead, and the handle was cleaned up |
ERR_NOPERM | Calling process does not own the port/ntfn |