-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IFELanguage.GetJMorphResult() return broken MORRSLT struct #571
Comments
@AArnott this field is typed as char in the metadata. Is this a C#/Win32 issue? From the shared code snippet, it looks like you explicitly remap it to void*. |
In <msime.h>, it is a flexible array member |
@mikebattista the OP's point is that
Looking more at the header definition, it's not clear what this should be. I agree |
Ok. Thanks. @sotteson1 can you take a look? |
It should be char[0..0], which we're using to imply a variable-length array. I'll fix it. |
I tried CsWin32 0.1.560-beta using win32metadata 10.2.163-preview but it still broken. This seems to be a matter of [StructLayout(LayoutKind.Sequential, Pack = 1)]
internal partial struct MORRSLT
{
/* ... */
internal __char_1 BLKBuff;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] // <-
internal struct __char_1
{ As well, in the previous implementation, specifying [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)] // <-
internal partial struct MORRSLT
{
/* ... */
char BLKBuff;
} |
@manju-summoner This isn't expected to work in CsWin32 until microsoft/CsWin32#387 is fixed. |
I understand. I'll wait for the fix. |
Calling
IFELanguage.GetJMorphResult()
returns a corruptedMORRSLT
because the type ofMORRSLT.BLKBuff
is not specified correctly.Replacing the type of
MORRSLT.BLKBuff
withvoid*
instead ofchar
will return correct results.Broken MORRSLT:
Correct MORRSLT:
Sample code:
https://github.com/manju-summoner/CsWin32GetJMorphResultTest/tree/master/CsWin32GetJMorphResultTest
Execution result:
The text was updated successfully, but these errors were encountered: