---
title: SecHostSetGuestStatus
framework: security
role: symbol
role_heading: Function
path: security/sechostsetgueststatus
---

# SecHostSetGuestStatus

Updates the status and attributes of a particular guest.

## Declaration

```occ
OSStatus SecHostSetGuestStatus(SecGuestRef guestRef, uint32_t status, CFDictionaryRef attributes, SecCSFlags flags);
```

## Parameters

- `guestRef`: The guest code object of the code on whose behalf this thread is acting.
- `status`: A new set of code status flags for the guest (see doc://com.apple.security/documentation/Security/SecCodeStatus. The host must enforce the restrictions on changes to guest status: the doc://com.apple.security/documentation/Security/SecCodeStatus/valid bit can only be cleared and the doc://com.apple.security/documentation/Security/SecCodeStatus/hard and doc://com.apple.security/documentation/Security/SecCodeStatus/kill flags can only be set. Pass the previous guest status to indicate that no change is desired.
- `attributes`: A key-value dictionary of attributes that can be used to identify this particular guest among all of the caller’s guests. If you include this dictionary, it completely replaces earlier-specified attributes. Pass NULL for this parameter if you do not want to change the attributes for this guest. Although you can specify any key-value pairs in this attributes dictionary, the keys in doc://com.apple.security/documentation/Security/guest-attribute-dictionary-keys are conventionally used for this purpose.
- `flags`: Optional flags; see doc://com.apple.security/documentation/Security/SecCSFlags for possible values. Pass kSecCSDefaultFlags for standard behavior.

## Return Value

Return Value A result code. See Code Signing Services Result Codes.

## Discussion

Discussion This function must be called by a host acting in proxy mode every time the status of a guest changes so that Code Signing Services can update the information cache for that guest. The specified guest must have been created using the SecHostCreateGuest function.
