Skip to content

Commit

Permalink
Ignore SendMessageTimeout failures on Windows Nano Server
Browse files Browse the repository at this point in the history
  • Loading branch information
jkotas committed Jan 2, 2023
1 parent a08cfcb commit 75ce5d0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ private static void SetEnvironmentVariableFromRegistry(string variable, string?
{
IntPtr unused;
IntPtr r = Interop.User32.SendMessageTimeout(new IntPtr(Interop.User32.HWND_BROADCAST), Interop.User32.WM_SETTINGCHANGE, IntPtr.Zero, (IntPtr)lParam, 0, 1000, &unused);
Debug.Assert(r != IntPtr.Zero, $"SetEnvironmentVariable failed: {Marshal.GetLastPInvokeError()}");

// SendMessageTimeout message is a empty stub on Windows Nano Server that fails with both result and last error 0.
Debug.Assert(r != IntPtr.Zero || Marshal.GetLastPInvokeError() == 0, $"SetEnvironmentVariable failed: {Marshal.GetLastPInvokeError()}");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,6 @@ public void EnumerateEnvironmentVariables(EnvironmentVariableTarget target)
bool lookForSetValue = (target == EnvironmentVariableTarget.Process)
|| (PlatformDetection.IsWindows && PlatformDetection.IsPrivilegedProcess);

// [ActiveIssue("https://github.com/dotnet/runtime/issues/30566")]
if (PlatformDetection.IsWindowsNanoServer && target == EnvironmentVariableTarget.User)
{
lookForSetValue = false;
}

string key = $"EnumerateEnvironmentVariables ({target})";
string value = Path.GetRandomFileName();

Expand Down
4 changes: 0 additions & 4 deletions src/libraries/tests.proj
Original file line number Diff line number Diff line change
Expand Up @@ -425,10 +425,6 @@
<!-- https://github.com/dotnet/runtime/issues/72908 -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Reflection.MetadataLoadContext\tests\System.Reflection.MetadataLoadContext.Tests.csproj" />

<!-- https://github.com/dotnet/runtime/issues/30566 -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime.Extensions\tests\System.Runtime.Extensions.Tests.csproj"
Condition="'$(RuntimeConfiguration)' == 'checked' and '$(TargetOS)' == 'windows'" />

<!-- Test needs to copy .so file: https://github.com/dotnet/runtime/issues/72987 -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.IO.Ports\tests\System.IO.Ports.Tests.csproj"
Condition="'$(TargetOS)' != 'windows'" />
Expand Down

0 comments on commit 75ce5d0

Please sign in to comment.