Retrieves the code object for the host of specified guest code.


func SecCodeCopyHost(_ guest: SecCode, _ flags: SecCSFlags, _ host: UnsafeMutablePointer<SecCode?>) -> OSStatus



A valid code object representing code running on the system as the guest of other code.


Optional flags; see SecCSFlags for possible values. Pass defaultFlags for standard behavior.


On return, the code object of the host of the code specified in the guest parameter.

Return Value


Host code acts as the supervisor and controller of its guest code and is the ultimate authority on the dynamic validity and status of its guests.

See Also

Guest Management

func SecHostSelectGuest(SecGuestRef, SecCSFlags) -> OSStatus

Makes the calling thread the proxy for a specified guest.

func SecHostSelectedGuest(SecCSFlags, UnsafeMutablePointer<SecGuestRef>) -> OSStatus

Retrieves the handle for the guest currently selected for the calling thread.

func SecHostSetHostingPort(mach_port_t, SecCSFlags) -> OSStatus

Tells code signing services that the calling code will directly respond to hosting inquiries over the given port.

func SecCodeMapMemory(SecStaticCode, SecCSFlags) -> OSStatus

Asks the kernel to accept the signing information currently attached to a code object and uses it to validate memory page-ins.