destroy

Number0x24
Signature(handle) -> 0 or -err
Grouphandles
Since1.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

RegisterNameDescription
r0handleHandle of the object to destroy

Returns

0 on success.

Errors

CodeCondition
ERR_BADHANDLEHandle names no live entry
ERR_BADTYPEHandle is a REPLY type, which destroy refuses
ERR_BUSYObject is still mapped somewhere
ERR_DEADPort/ntfn owner is dead, and the handle was cleaned up
ERR_NOPERMCalling process does not own the port/ntfn

See also