| Previous | Next |
| STATUS_REPLY_MESSAGE_MISMATCH | STATUS_IMAGE_CHECKSUM_MISMATCH |
STATUS_MAPPED_ALIGNMENT
The view begins at an unsupported alignment
File-view offsets must be multiples of the system allocation granularity, which is typically larger than the hardware page size. A caller that wants data beginning at an arbitrary file offset must round the mapping offset down and add a delta to the pointer used for the desired bytes.
Use 64-bit arithmetic for the aligned offset, delta, and expanded view length. Aligning the pointer upward or using page size instead of allocation granularity can either miss the requested data or still fail. The returned view base, not the adjusted data pointer, must be saved for unmapping.
What to inspect
- Read dwAllocationGranularity with GetSystemInfo on the running system.
- Round the file offset down and include the prefix delta in the mapped length.
- Retain both the mapping base for cleanup and the adjusted pointer for data access.
References
- Microsoft: Mapping a view at a file offset
- Microsoft: Creating a file view
- Microsoft: MapViewOfFile
- Microsoft Open Specifications: NTSTATUS values
Looking for a different code? Search another status or error code.
