From: Stephen Toub Date: Wed, 30 Jan 2019 17:18:01 +0000 (-0500) Subject: Adapt corert to Environment moving from corefx X-Git-Tag: submit/tizen/20210909.063632~11030^2~2643 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3e9b2e92ab999c778ededafb669880881e35637c;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Adapt corert to Environment moving from corefx Signed-off-by: dotnet-bot Commit migrated from https://github.com/dotnet/coreclr/commit/c44cedb3c30f04c34693c14838891d7f87398e28 --- diff --git a/src/libraries/System.Private.CoreLib/src/System/Environment.WinRT.cs b/src/libraries/System.Private.CoreLib/src/System/Environment.WinRT.cs index 72d66c4..a8e3dbc 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Environment.WinRT.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Environment.WinRT.cs @@ -3,14 +3,22 @@ // See the LICENSE file in the project root for more information. using System.IO; +using Internal.Runtime.Augments; namespace System { public static partial class Environment { public static string UserName => "Windows User"; + public static string UserDomainName => "Windows Domain"; - private static string GetFolderPathCore(SpecialFolder folder, SpecialFolderOption option) => - WinRTFolderPaths.GetFolderPath(folder, option); + + private static string GetFolderPathCore(SpecialFolder folder, SpecialFolderOption option) + { + WinRTInteropCallbacks callbacks = WinRTInterop.UnsafeCallbacks; + return callbacks != null && callbacks.IsAppxModel() ? + callbacks.GetFolderPath(folder, option) : + null; + } } }