Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not use an array for a pointer field that doesn't actually refer to an array #907

Merged
merged 1 commit into from
Apr 7, 2023

Conversation

AArnott
Copy link
Member

@AArnott AArnott commented Apr 7, 2023

The old behavior was breaking interop for the PROCESS_BASIC_INFORMATION struct's PEB* PebBaseAddress field. When this field was changed to a PEB[], the struct became a 'managed' type (in interop terms) yet the CLR's interop layer has no information about array length, etc. and marshaling would fail.

It turned out this "small" change led to a series of test failures due to other latent bugs that only manifest when we changed the mixture of how structs (with their managed and unmanaged variants) interact, leading to this surprisingly large set of changes.

Fixes #904

…o an array

The old behavior was breaking interop for the `PROCESS_BASIC_INFORMATION` struct's `PEB* PebBaseAddress` field. When this field was changed to a `PEB[]`, the struct became a 'managed' type (in interop terms) yet the CLR's interop layer has no information about array length, etc. and marshaling would fail.

It turned out this "small" change led to a series of test failures due to other latent bugs that only manifest when we changed the mixture of how structs (with their managed and unmanaged variants) interact, leading to this surprisingly large set of changes.

Fixes #904
@AArnott AArnott enabled auto-merge April 7, 2023 15:42
@AArnott AArnott merged commit aaafe7c into main Apr 7, 2023
@AArnott AArnott deleted the fix904 branch April 7, 2023 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PROCESS_BASIC_INFORMATION incorrectly generated?
1 participant