Skip to content
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

Conversation

vladimir-krestov
Copy link
Contributor

@vladimir-krestov vladimir-krestov commented Feb 26, 2020

Fixes #2912
Related issue #2475

MonthCalendarAccessibleObject gets incorrect SYSTEMTIME info when sending Windows messages due to incorrect MCGRIDINFO definition.

Proposed changes

  • Edit MCGRIDINFO to avoid SYSTEMTIME value errors

Customer Impact

  • A user can use a correct MonthCalendar without exceptions

Regression?

Risk

  • Minimal

Screenshots

Before

  • Incorrect SYSTEMTIME value
    image

After

  • Correct SYSTEMTIME value
    image

Test methodology

  • CTI
  • Manual UI testing
  • Unit testing

Accessibility testing

  • Using Inspect and Narrator tools

Test environment(s)

  • .NET Core SDK: 5.0.0-alpha.1.20072.3
  • Microsoft Windows [Version 10.0.18363.592]
Microsoft Reviewers: Open in CodeFlow

@vladimir-krestov vladimir-krestov requested a review from a team as a code owner February 26, 2020 09:07
@vladimir-krestov vladimir-krestov added the waiting-for-testing The PR is awaiting manual testing by the primary team; no action is yet required from the author(s) label Feb 26, 2020
@vladimir-krestov vladimir-krestov changed the title [Accessibility] Fixing MonthCalendar AccessibleObject WIP: [Accessibility] Fixing MonthCalendar AccessibleObject Feb 26, 2020
@codecov
Copy link

codecov bot commented Feb 26, 2020

Codecov Report

Merging #2911 into master will decrease coverage by 0.00311%.
The diff coverage is 100.00000%.

@@                 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     
Flag Coverage Δ
#Debug 62.14455% <100.00000%> (-0.00311%) ⬇️
#production 33.33637% <100.00000%> (-0.00556%) ⬇️
#test 98.97490% <ø> (ø)

@vladimir-krestov vladimir-krestov force-pushed the dev/v-vlkres/MonthCalendarNullReferenceException branch from 2fb6c37 to ce30b1a Compare February 26, 2020 12:30
@vladimir-krestov
Copy link
Contributor Author

@RussKie, @weltkante, @hughbe, please confirm and I'll give these changes to testing.

weltkante
weltkante previously approved these changes Feb 26, 2020
Copy link
Contributor

@weltkante weltkante left a 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.

@weltkante
Copy link
Contributor

The interop fix would probably also fix #2912

@merriemcgaw merriemcgaw linked an issue Mar 6, 2020 that may be closed by this pull request
@vladimir-krestov vladimir-krestov changed the title WIP: [Accessibility] Fixing MonthCalendar AccessibleObject WIP: Fixing MCGRIDINFO definition Mar 10, 2020
@vladimir-krestov
Copy link
Contributor Author

vladimir-krestov commented Mar 10, 2020

Adding unit tests...
Changes for DateTimePicker.cs and MonthCalendar.MonthCalendarAccessibleObject.cs in first commit will be added in another PR.

Copy link
Member

@RussKie RussKie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vladimir-krestov
Copy link
Contributor Author

Added sizeof unit tests like PRINTDLGWTests
Added Marshal unit tests as @weltkante said #2911 (comment)

/cc @RussKie

@vladimir-krestov vladimir-krestov added the waiting-review This item is waiting on review by one or more members of team label Mar 13, 2020
@vladimir-krestov
Copy link
Contributor Author

The changes from the first commit have been added in PR #2975

@vladimir-krestov vladimir-krestov force-pushed the dev/v-vlkres/MonthCalendarNullReferenceException branch from 5c1ba42 to 0b3d075 Compare March 14, 2020 08:25
@vladimir-krestov
Copy link
Contributor Author

Testing the fix for #2912 and #2475 in progress...

@RussKie RussKie removed the waiting-review This item is waiting on review by one or more members of team label Mar 16, 2020
Comment on lines 22 to 23
[ConditionalFact(nameof(Is32bit))]
public unsafe void MCGRIDINFO_x32_Marshal_Size()
{
Assert.Equal(84, Marshal.SizeOf<MCGRIDINFO>());
}
Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

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

Comment on lines 13 to 14
public static bool Is32bit => IntPtr.Size == 4;
public static bool Is64bit => IntPtr.Size == 8;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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.

@RussKie
Copy link
Member

RussKie commented Mar 16, 2020 via email

@vladimir-krestov
Copy link
Contributor Author

Testers approved that Issue #2912 has been fixed. ✔️
Related Issue #2475 will be fixed by PR #2975.

@vladimir-krestov vladimir-krestov added 📫 waiting-approval and removed waiting-for-testing The PR is awaiting manual testing by the primary team; no action is yet required from the author(s) labels Mar 16, 2020
RussKie
RussKie previously approved these changes Mar 19, 2020
to get correct data from WinAPI messages
Fixes Issue dotnet#2912
Related Issue dotnet#2475
Related PR dotnet#2975
@vladimir-krestov vladimir-krestov force-pushed the dev/v-vlkres/MonthCalendarNullReferenceException branch from 16ea82a to 8c3830f Compare March 23, 2020 19:58
@vladimir-krestov vladimir-krestov changed the title WIP: Fixing MCGRIDINFO definition Fixing MCGRIDINFO definition Mar 23, 2020
@vladimir-krestov
Copy link
Contributor Author

PR is ready.
/cc @RussKie

@RussKie RussKie merged commit e75f8af into dotnet:master Mar 24, 2020
@ghost ghost added this to the 5.0 milestone Mar 24, 2020
vladimir-krestov added a commit to vladimir-krestov/winforms that referenced this pull request Apr 6, 2020
against incorrect parameters of methods to avoid exception throwing
Related Issues dotnet#2912 and dotnet#2475
Related PR dotnet#2911
RussKie pushed a commit that referenced this pull request Apr 13, 2020
Add protection for MonthCalendarAccessibleObject against incorrect parameters of methods to avoid exception throwing

Related Issues #2912 and #2475
Related PR #2911
vladimir-krestov added a commit to vladimir-krestov/winforms that referenced this pull request May 12, 2020
against incorrect parameters of methods to avoid exception throwing
Related Issues dotnet#2912 and dotnet#2475
Related PR dotnet#2911
@vladimir-krestov vladimir-krestov deleted the dev/v-vlkres/MonthCalendarNullReferenceException branch November 4, 2020 07:37
@ghost ghost locked as resolved and limited conversation to collaborators Feb 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

An exception occurred when MonthCalendar switched dates
5 participants