Skip to content

Fix Environment.UserInteractive on Windows#1234

Merged
danmoseley merged 17 commits into
dotnet:masterfrom
danmoseley:Environment.UserInteractive
Jan 4, 2020
Merged

Fix Environment.UserInteractive on Windows#1234
danmoseley merged 17 commits into
dotnet:masterfrom
danmoseley:Environment.UserInteractive

Conversation

@danmoseley

Copy link
Copy Markdown
Member

Fix #770

Comment thread src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft/Win32/SystemEvents.cs Outdated
Comment thread src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems Outdated
Comment thread src/libraries/System.Private.CoreLib/src/System/Environment.Windows.cs Outdated
Comment thread src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft/Win32/SystemEvents.cs Outdated
Comment thread src/libraries/System.Private.CoreLib/src/System/Environment.Windows.cs Outdated
@danmoseley danmoseley force-pushed the Environment.UserInteractive branch from 67406aa to e6ea75b Compare January 2, 2020 20:36
Comment thread src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft/Win32/SystemEvents.cs Outdated
Comment thread src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft/Win32/SystemEvents.cs Outdated
@jkotas

jkotas commented Jan 3, 2020

Copy link
Copy Markdown
Member

Build break ... LGTM otherwise.

Comment thread src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj Outdated
Comment thread src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems Outdated
@danmoseley

Copy link
Copy Markdown
Member Author

All failures are from the bad ARM legs.

Comment thread src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems Outdated
Comment thread src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems Outdated
Comment thread src/libraries/System.Private.CoreLib/src/System/Environment.Windows.cs Outdated
danmoseley and others added 5 commits January 3, 2020 14:26
…b.Shared.projitems

Co-Authored-By: Jan Kotas <jkotas@microsoft.com>
…b.Shared.projitems

Co-Authored-By: Jan Kotas <jkotas@microsoft.com>
…b.Shared.projitems

Co-Authored-By: Jan Kotas <jkotas@microsoft.com>
@danmoseley danmoseley requested a review from jkotas January 4, 2020 00:43
@danmoseley

Copy link
Copy Markdown
Member Author

Any more feedback? I can't merge without dismissing your review -- not sure of the protocol

CI is fine, except for an unrelated bug I logged.

uint dummy = 0;
if (Interop.User32.GetUserObjectInformationW(handle, Interop.User32.UOI_FLAGS, &flags, (uint)sizeof(Interop.User32.USEROBJECTFLAGS), ref dummy))
{
return ((flags.dwFlags & Interop.User32.WSF_VISIBLE) == 0);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It looks like you forgot to invert this logic. Also, should we add back the static property like we had in desktop?
https://referencesource.microsoft.com/#mscorlib/system/environment.cs,1435

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ack - thank you @ericstj !

Re the static, @jkotas pointed out that there may be a way to change a process to/from interactive - although I didn't do it successfully myself. See mention here #770 (comment) I saw no reason to cache the value.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok, I'll make the simple fix for now. FWIW I'm now able to reproduce the test failure, so I can confirm fail/then-fix.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That would explain #1724 also. I was not albe to run the service controller tests locally because of #1262. I tested locally by hand instead, and apparently did so before I made this mistake.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Comments crossed. Great, I was about to do it, but apparently you've already got those tests working so you can verify it as well. thanks

@ghost ghost locked as resolved and limited conversation to collaborators Dec 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Should we revise implementation of Environment.UserInteractive?

4 participants