microsoft / microsoft/win32metadata

Absent alignment requirements for the CONTEXT struct

Open
#1,044 34 comments 4 reactions 2 assignees Claimed by @tannergooding View on GitHub
bug rust
Dominant language
C++
Stars
1.5k
Forks
149
Avg merge
5d 16h
Merged PRs (30d)
4

Description

### Which crate is this about?

windows, windows-sys

### Crate version

_No response_

### Summary

According to the definition in the Windows.h, the CONTEXT struct must be aligned by 16 bytes, but it is not neither in windows_rs, nor in windows_sys (it's just a #[repr(C)] here).
It causes an ERROR_NOACCESS errors in the GetThreadContext()/SetThreadContext() functions.

### Toolchain version/configuration

_No response_

### Reproducible example

_No response_

### Crate manifest

_No response_

### Expected behavior

_No response_

### Actual behavior

_No response_

### Additional comments

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.