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

# hv_vmx_vcpu_write_shadow_vmcs(_:_:_:)

Set the value of a shadow VMCS field of a vCPU.

## Declaration

```swift
func hv_vmx_vcpu_write_shadow_vmcs(_ vcpu: hv_vcpuid_t, _ field: UInt32, _ value: UInt64) -> hv_return_t
```

## Parameters

- `vcpu`: The vCPU ID.
- `field`: The ID of the shadow VMCS field to write.
- `value`: The value of the shadow VMCS field to write.

## 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_set_shadow_access(_:_:_:)](hypervisor/hv_vmx_vcpu_set_shadow_access(_:_:_:).md)
- [hv_shadow_flags_t](hypervisor/hv_shadow_flags_t.md)
- [Shadow Permissions](hypervisor/3567083-shadow_permissions-enum.md)
