---
title: "hv_vmx_vcpu_set_shadow_access(_:_:_:)"
framework: Hypervisor
role: symbol
role_heading: Function
platforms: [macOS 10.15+]
path: "hypervisor/hv_vmx_vcpu_set_shadow_access(_:_:_:)"
---

# hv_vmx_vcpu_set_shadow_access(_:_:_:)

Set the access permissions of a shadow VMCS field of a vCPU.

## Declaration

```swift
func hv_vmx_vcpu_set_shadow_access(_ vcpu: hv_vcpuid_t, _ field: UInt32, _ flags: hv_shadow_flags_t) -> hv_return_t
```

## Parameters

- `vcpu`: The vCPU ID.
- `field`: The ID of the shadow VMCS field.
- `flags`: The new READ, WRITE permissions for the shadow VMCS field.

## Return Value

Return Value HV_SUCCESS if the operation was successful, otherwise an error code specified in hv_return_t.

## Discussion

Discussion important: This function must be called by the owning thread.

## See Also

### Shadow fields

- [hv_vmx_vcpu_read_shadow_vmcs(_:_:_:)](hypervisor/hv_vmx_vcpu_read_shadow_vmcs(_:_:_:).md)
- [hv_vmx_vcpu_write_shadow_vmcs(_:_:_:)](hypervisor/hv_vmx_vcpu_write_shadow_vmcs(_:_:_:).md)
- [hv_shadow_flags_t](hypervisor/hv_shadow_flags_t.md)
- [Shadow Permissions](hypervisor/3567083-shadow_permissions-enum.md)
