microsoft / microsoft/wdkmetadata

Inconsistent alignment of `CM_PARTIAL_RESOURCE_DESCRIPTOR` structure

Open
#65 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Summary

The CM_PARTIAL_RESOURCE_DESCRIPTOR structure is currently missing the #[repr(C, packed(4))] attribute, which is necessary to ensure 4-byte alignment on x86_64 targets. This issue leads to the CM_PARTIAL_RESOURCE_LIST structure having a size of 32 bytes instead of the expected 28 bytes.

In wdm.h of the WDK, the definition of CM_PARTIAL_RESOURCE_DESCRIPTOR is currently preceded by a

#include "pshpack4.h"

directive, which ensures the correct alignment.

Crate manifest
[dependencies.windows]
version = "0.54.0"
features = ["Wdk", "Wdk_System", "Wdk_System_SystemServices"]
Crate code

No response

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.

Research direction

Start by comparing the generated CM_PARTIAL_RESOURCE_DESCRIPTOR and CM_PARTIAL_RESOURCE_LIST definitions with the corresponding declaration in wdm.h, including the nearby pshpack4.h directive. Verify the resulting CM_PARTIAL_RESOURCE_LIST size against the expected 28 bytes on x86_64; done means the generated structure has the required 4-byte alignment and the size is corrected.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, rust
Domain
operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.