microsoft / wdkmetadata

Tooling to generate metadata for Win32 APIs in the Windows Driver Kit (WDK).
Other
96 stars 10 forks source link

Inconsistent alignment of `CM_PARTIAL_RESOURCE_DESCRIPTOR` structure #65

Open a2x opened 7 months ago

a2x commented 7 months ago

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

kennykerr commented 7 months ago

The alignment comes from metadata. Will transfer to the WDK metadata repo for consideration.