| Previous | Next |
| ERROR_ENCLAVE_NOT_TERMINATED | ERROR_EA_ACCESS_DENIED |
ERROR_ENCLAVE_VIOLATION
An attempt was made to access protected memory in violation of its secure access policy.
ERROR_ENCLAVE_VIOLATION is Win32 error 815 (0x32F) and belongs to enclave memory protection.
Where the result appears
- Trusted code reading or writing outside its permitted enclave pages.
- Host code dereferencing an enclave pointer with the wrong access path.
- An enclave call using a stale or unvalidated buffer.
- Protection changes that conflict with enclave page policy.
Likely causes
- an address lies outside the enclave or outside an allowed page range.
- page permissions do not permit the attempted read, write, or execute operation.
- pointer validation failed across the enclave boundary.
- a use-after-free or corrupted offset targeted protected memory.
Troubleshooting steps
- Record faulting instruction and address from a dump or debugger.
- Record enclave base, size, page type, and protection map.
- Record input pointer validation and marshaling lengths.
- Record thread call stack across the trusted/untrusted transition.
- Record recent enclave page additions, protection changes, or termination.
What to verify
Verify whether an address lies outside the enclave or outside an allowed page range. Check faulting instruction and address from a dump or debugger together with enclave base, size, page type, and protection map.
Handling, retry, and recovery
Treat the result as a security and correctness fault, not a transient access denial. Stop the operation, preserve a dump where policy allows, validate every boundary pointer, and correct the page or marshaling contract before rerunning.
Difference from nearby codes
Unlike ERROR_ENCLAVE_NOT_TERMINATED, this code concerns an access that violated the enclave security boundary rather than incomplete cleanup.
Practical example
Trusted code computes an offset from untrusted input without checking overflow.
References
- Microsoft: System Error Codes (500–999) — reference for error 815.
- Microsoft: Enclaves — reference for error 815.
- Microsoft: Enclave functions — reference for error 815.
Looking for a different code? Search another status or error code.
