POINTER_ALIGNMENT not applied to Rust structs

Open
#60 6 comments 0 reactions 1 assignee View on GitHub

@tannergooding is already working on this.

Since Jan 22, 2024.

Assessment

This issue has not been assessed yet.

Description

bug
Summary

POINTER_ALIGNMENT is not applied to the rust structs for example.

pub struct IO_STACK_LOCATION_0_4 {
    pub OutputBufferLength: u32,
    pub InputBufferLength: u32,
    pub IoControlCode: u32,
    pub Type3InputBuffer: *mut ::core::ffi::c_void,
}

file: libs/sys/src/Windows/Wdk/Foundation/mod.rs

This struct has length 24 bytes in rust. But the C version has more padding with the InputBufferLength and IoControlCode

struct {
    ULONG OutputBufferLength;
    ULONG POINTER_ALIGNMENT InputBufferLength;
    ULONG POINTER_ALIGNMENT IoControlCode;
    PVOID Type3InputBuffer;
} DeviceIoControl;

file: C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\km\wdm.h

Crate manifest

No response

Crate code

No response

Dominant language
C++
Stars
110
Forks
15
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/wdkmetadata

All issues in microsoft/wdkmetadata

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.