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 ComboBox handlers and accessibility object initialization #2449

Conversation

@M-Lipin
Copy link
Member

M-Lipin commented Nov 28, 2019

Adding IsHandleCreated checks to prevent accessing AccessibleObject properties and calls to UIAutomation which may lead to application crash/hung.

Fixes #2432

Proposed changes

  • Adding IsHandleCreated checks to prevent accessing AccessibleObject properties for not fully initialized control.
  • Fixed the reference to child list window to prevent NullReferenceException on child control recreating.

Customer Impact

  • Customers will not experience application crash/hung in some cases when ComboBox control is being reinitialized while application/form lifecycle.

Regression?

  • Yes

Risk

  • Minimal

Screenshots

Before

Exception and application hung.

NullReferenceException and application crash:

System.NullReferenceException: Object reference not set to an instance of an object.
   at System.Windows.Forms.ComboBox.WmParentNotify(Message& m)
   at System.Windows.Forms.ComboBox.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

After

No exception.

Test methodology

  • Manual testing.
  • Automation tests.

Test environment(s)

.NET Core SDK (reflecting any global.json):
Version: 5.0.100-alpha1-015763
Commit: 0d0c902b77

Runtime Environment:
OS Name: Windows
OS Version: 10.0.18363
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\5.0.100-alpha1-015763\

Host (useful for support):
Version: 5.0.0-alpha.1.19564.1
Commit: c77948d92a

.NET Core SDKs installed:
3.1.100-preview3-014645 [C:\Program Files\dotnet\sdk]
5.0.100-alpha1-015763 [C:\Program Files\dotnet\sdk]

Microsoft Reviewers: Open in CodeFlow
…should be childDropDown to prevent NullReferenceException on control reinitialization.

Adding IsHandleCreated checks to prevent accessing AccessibleObject properties and calls to UIAutomation which may lead to application crash/hung.
@M-Lipin M-Lipin requested a review from dotnet/dotnet-winforms as a code owner Nov 28, 2019
@M-Lipin M-Lipin self-assigned this Nov 28, 2019
… more clear and simple.
@RussKie
RussKie approved these changes Dec 5, 2019
@RussKie RussKie merged commit defaaa7 into dotnet:master Dec 5, 2019
5 checks passed
5 checks passed
WIP Ready for review
Details
dotnet-winforms CI #20191204.4 succeeded
Details
dotnet-winforms CI (Build Windows Debug) Build Windows Debug succeeded
Details
dotnet-winforms CI (Build Windows Release) Build Windows Release succeeded
Details
license/cla All CLA requirements met.
Details
@msftbot msftbot bot added this to the 5.0 milestone Dec 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.