Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,9 +220,9 @@ 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)
Copy link
Member

Choose a reason for hiding this comment

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

I guess this has to stay in SetEnvironmentVariable?

// [ActiveIssue("https://github.com/dotnet/runtime/issues/30566")]

Copy link
Member

Choose a reason for hiding this comment

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

actually I think that should be removed

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

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, I thought setting per-user env vars worked, but only for the current process. So these two tests ought to pass, as it's all in the same process. You've made them skip though?

if (target == EnvironmentVariableTarget.User && PlatformDetection.IsWindowsNanoServer)
{
// Windows Nano Server does not have full per-user registry hives
lookForSetValue = false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ public class SetEnvironmentVariable

internal static bool IsSupportedTarget(EnvironmentVariableTarget target)
{
// [ActiveIssue("https://github.com/dotnet/runtime/issues/30566")]
if (target == EnvironmentVariableTarget.User && PlatformDetection.IsWindowsNanoServer)
{
// Windows Nano Server does not have full per-user registry hives
return false;
}

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