-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Fixing MCGRIDINFO definition #2911
Fixing MCGRIDINFO definition #2911
Conversation
src/System.Windows.Forms.Primitives/src/Interop/User32/Interop.SendMessageW.cs
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #2911 +/- ##
===================================================
- Coverage 62.14766% 62.14455% -0.00311%
===================================================
Files 1257 1257
Lines 449428 449428
Branches 39227 39227
===================================================
- Hits 279309 279295 -14
- Misses 164638 164661 +23
+ Partials 5481 5472 -9
|
src/System.Windows.Forms.Primitives/src/Interop/User32/Interop.SendMessageW.cs
Outdated
Show resolved
Hide resolved
2fb6c37
to
ce30b1a
Compare
@RussKie, @weltkante, @hughbe, please confirm and I'll give these changes to testing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I'm concerned the root cause for the interop bug has been identified and will be fixed, I have no further concerns regarding the PR.
src/System.Windows.Forms.Primitives/src/Interop/ComCtl32/Interop.MCGRIDINFO.cs
Show resolved
Hide resolved
The interop fix would probably also fix #2912 |
Adding unit tests... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Please add tests similar to https://github.com/dotnet/winforms/blob/master/src/System.Windows.Forms.Primitives/tests/Interop/Richedit/EDITSTREAMTests.cs, or better yet like this: https://github.com/dotnet/winforms/blob/master/src/System.Windows.Forms.Primitives/tests/Interop/Comdlg32/PRINTDLGWTests.cs
Added /cc @RussKie |
The changes from the first commit have been added in PR #2975 |
5c1ba42
to
0b3d075
Compare
[ConditionalFact(nameof(Is32bit))] | ||
public unsafe void MCGRIDINFO_x32_Marshal_Size() | ||
{ | ||
Assert.Equal(84, Marshal.SizeOf<MCGRIDINFO>()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just FYI: there is no pressing need to test the classic marshaller, since it shouldn't be used it for blittable structs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean I need to remove this?
Can I keep it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since this struct actually contains bools and this particular layout difference was cause of a regression I think there is some value to test both in order to prevent future regressions
public static bool Is32bit => IntPtr.Size == 4; | ||
public static bool Is64bit => IntPtr.Size == 8; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move these out to src/Common/tests/, and update https://github.com/dotnet/winforms/blob/master/src/System.Windows.Forms.Primitives/tests/Interop/Comdlg32/PRINTDLGWTests.cs as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RussKie, I moved these to the new ArchitectureDetection
class and updated MCGRIDINFOTests
and PRINTDLGWTests
tests. Please check if I made it correctly.
👍
|
to get correct data from WinAPI messages Fixes Issue dotnet#2912 Related Issue dotnet#2475 Related PR dotnet#2975
16ea82a
to
8c3830f
Compare
PR is ready. |
against incorrect parameters of methods to avoid exception throwing Related Issues dotnet#2912 and dotnet#2475 Related PR dotnet#2911
against incorrect parameters of methods to avoid exception throwing Related Issues dotnet#2912 and dotnet#2475 Related PR dotnet#2911
Fixes #2912
Related issue #2475
MonthCalendarAccessibleObject
gets incorrectSYSTEMTIME
info when sending Windows messages due to incorrectMCGRIDINFO
definition.Proposed changes
Customer Impact
Regression?
Risk
Screenshots
Before
After
Test methodology
Accessibility testing
Test environment(s)
Microsoft Reviewers: Open in CodeFlow