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


func SecHostSelectedGuest(_ flags: SecCSFlags, _ guestRef: UnsafeMutablePointer<SecGuestRef>) -> OSStatus



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


On return, the guest code object of the current selected guest for the calling thread. If no guest is active on this thread (that is, the thread is acting for the host), the value returned is kSecNoGuest.

Return Value


This function may be called in either dynamic hosting mode or proxy hosting mode. If the host has more than one guest, it can set a different selected guest for each thread.

See Also

Guest Management

func SecCodeCopyHost(SecCode, SecCSFlags, UnsafeMutablePointer<SecCode?>) -> OSStatus

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

func SecHostSelectGuest(SecGuestRef, SecCSFlags) -> OSStatus

Makes the calling thread the proxy for a specified guest.

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.