You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"❌ DON'T Use [MarshalAs(UnmanagedType.LPStruct)] for anything other than ref GUID parameters."
This does not make sense, when reading the paragraph above that says "place either a ref keyword or a [MarshalAs(UnmanagedType.LPStruct)] attribute on the GUID parameter declaration"
Paragraph above current wording
"GUIDs are usable directly in signatures. Many Windows APIs take GUID& type aliases like REFIID. When the method signature contains a reference parameter, place either a ref keyword or a [MarshalAs(UnmanagedType.LPStruct)] attribute on the GUID parameter declaration."
s341507
changed the title
GUID interop ref vs [MarshalAs(UnmanagedType.LPStruct)] is confusing
GUID interop: ref vs [MarshalAs(UnmanagedType.LPStruct)] is confusing
Apr 11, 2025
Type of issue
Typo
Description
Current wording
"❌ DON'T Use
[MarshalAs(UnmanagedType.LPStruct)]
for anything other thanref
GUID parameters."This does not make sense, when reading the paragraph above that says "place either a
ref
keyword or a[MarshalAs(UnmanagedType.LPStruct)]
attribute on the GUID parameter declaration"Paragraph above current wording
"GUIDs are usable directly in signatures. Many Windows APIs take
GUID&
type aliases likeREFIID
. When the method signature contains a reference parameter, place either aref
keyword or a[MarshalAs(UnmanagedType.LPStruct)]
attribute on the GUID parameter declaration."Page URL
https://learn.microsoft.com/en-us/dotnet/standard/native-interop/best-practices#guids
Content source URL
https://github.com/dotnet/docs/blob/main/docs/standard/native-interop/best-practices.md
Document Version Independent Id
e58f3d16-8083-0efe-0057-e21dbebb262f
Platform Id
87721c9b-7c82-1598-5dfd-21d35f0beec8
Article author
@jkoritzinsky
Metadata
Related Issues
The text was updated successfully, but these errors were encountered: