Skip to content

Make NativeWindow.CreateHandle reentrant - #3035

Merged
RussKie merged 2 commits into
dotnet:masterfrom
weltkante:ReentrantCreateWindow
Apr 9, 2020
Merged

RussKie merged 2 commits into
dotnet:masterfrom
weltkante:ReentrantCreateWindow

Conversation

@weltkante

@weltkante weltkante commented Apr 3, 2020 •

Copy link
Copy Markdown
Contributor

Fixes #2979

Proposed changes

  • Make NativeWindow.CreateWindow reentrant

Customer Impact

  • Creating a control may execute user code, if such user code creates additional controls this causes reentrancy which under some conditions can lead to an exception because NativeWindow.CreateWindow isn't prepared for this case.

Regression?

  • No

Risk

  • Fixes a data structure corruption, probably not going to get worse

Test methodology

Microsoft Reviewers: Open in CodeFlow

@weltkante
weltkante requested a review from a team as a code owner April 3, 2020 05:48
@ghost ghost assigned weltkante Apr 3, 2020
@weltkante
weltkante force-pushed the ReentrantCreateWindow branch from d337158 to ce925ca Compare April 3, 2020 05:56
@RussKie

RussKie commented Apr 8, 2020

Copy link
Copy Markdown
Contributor

I swear I tried the same fix and it didn't work. So clearly your fix is superior 😎

@RussKie RussKie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍 with a little nit.

Co-Authored-By: Igor Velikorossov <[email protected]>
@RussKie
RussKie merged commit e1cfc96 into dotnet:master Apr 9, 2020
@ghost ghost added this to the 5.0 milestone Apr 9, 2020
modHandle,
cp.Param);
// Older versions of Windows AV rather than returning E_OUTOFMEMORY.
// Catch this and then we re-throw an out of memory error.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

would be interesting if this is still the case in our supported versions

@weltkante
weltkante deleted the ReentrantCreateWindow branch April 29, 2020 17:54
@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.

NullReferenceException is thrown when creating a control in an MDI child form

3 participants