Fix Environment.UserInteractive on Windows#1234
Conversation
src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft/Win32/SystemEvents.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Environment.Windows.cs
Outdated
Show resolved
Hide resolved
src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft/Win32/SystemEvents.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Environment.Windows.cs
Outdated
Show resolved
Hide resolved
67406aa to
e6ea75b
Compare
...s.ServiceController/tests/System.ServiceProcess.ServiceController.TestService/TestService.cs
Outdated
Show resolved
Hide resolved
src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft/Win32/SystemEvents.cs
Outdated
Show resolved
Hide resolved
src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft/Win32/SystemEvents.cs
Outdated
Show resolved
Hide resolved
|
Build break ... LGTM otherwise. |
src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems
Outdated
Show resolved
Hide resolved
|
All failures are from the bad ARM legs. |
src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Environment.Windows.cs
Outdated
Show resolved
Hide resolved
…b.Shared.projitems Co-Authored-By: Jan Kotas <[email protected]>
…b.Shared.projitems Co-Authored-By: Jan Kotas <[email protected]>
…b.Shared.projitems Co-Authored-By: Jan Kotas <[email protected]>
…osemsft/runtime into Environment.UserInteractive
|
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); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
Fix #770