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
{{ message }}
Repository navigation
PAINTSTRUCT rgbReserved field is missing size #215
Granted the Clr doesn't support statically sized arrays like C/C++. However, as I understand from looking at other examples, this information can be represented using NativeTypeInfoAttribute.SizeConst (along with LPArray as the UnmanagedType). I expect it would look something like this:
Granted the Clr doesn't support statically sized arrays like C/C++.
It does, actually. C# as a language has only limited support so when "decompiling" the metadata to C# you don't see it, but indeed the metadata does reflect the 32-byte fixed length of the inline array:
When reading the metadata, be sure to use a parser that recognizes this.
I've found this this size information is available in the C# MetadataReader via the ArrayShape struct associated with the field type. However, it seems odd that this information is not reported by ILSpy, maybe an issue should be filed for ILSpy to report ArrayShape information? Then again, since ILSpy decompiles to C#, there's no way to represent this information in the language, so it might have to be in the form of a comment in the decompiled code? Does this seem like a reasonable course or maybe it's not a big deal? I could be missing something here so let me know if I am.
The screenshot I included above comes from ILSpy.
But yes, in C# decompiler mode, it could only express it as a code comment. Feel free to file a request against ILSpy separately.
Activity
helloworld-window, workaround microsoft/win32metadata#215
AArnott commentedon Feb 9, 2021
It does, actually. C# as a language has only limited support so when "decompiling" the metadata to C# you don't see it, but indeed the metadata does reflect the 32-byte fixed length of the inline array:
When reading the metadata, be sure to use a parser that recognizes this.
marler8997 commentedon Feb 9, 2021
I stand corrected. Thanks for the info.
remove issue 215 workaround
marler8997 commentedon Feb 9, 2021
I've found this this size information is available in the C# MetadataReader via the
ArrayShapestruct associated with the field type. However, it seems odd that this information is not reported by ILSpy, maybe an issue should be filed for ILSpy to reportArrayShapeinformation? Then again, since ILSpy decompiles to C#, there's no way to represent this information in the language, so it might have to be in the form of a comment in the decompiled code? Does this seem like a reasonable course or maybe it's not a big deal? I could be missing something here so let me know if I am.AArnott commentedon Feb 9, 2021
The screenshot I included above comes from ILSpy.
But yes, in C# decompiler mode, it could only express it as a code comment. Feel free to file a request against ILSpy separately.
marler8997 commentedon Feb 9, 2021
Oh I didn't know ILSpy had different decompile modes. Thanks for that.