| Previous | Next |
| ERROR_FILE_LEVEL_TRIM_NOT_SUPPORTED | ERROR_INVALID_FIELD_IN_PARAMETER_LIST |
ERROR_OFFSET_ALIGNMENT_VIOLATION
The requested offset violates alignment requirements
ERROR_OFFSET_ALIGNMENT_VIOLATION occurs when an I/O command uses an offset that is not aligned to the device’s required granularity. Direct and unbuffered I/O paths expose this requirement more often than buffered file access.
Checks
- Query logical and physical sector alignment.
- Validate the file offset, transfer length, and buffer address together.
- Account for partition and storage-stack alignment offsets.
- Do not assume a fixed 512-byte sector size.
Fix
Round or split requests according to the reported alignment contract, using an aligned buffer when required. Preserve unaffected bytes during read-modify-write handling.
References
Looking for a different code? Search another status or error code.
