Merge pull request #2964 from ludovic-henry/sgen-monocontext
[mono.git] / mcs / class / referencesource / System.Web / Util / PathUtil.cs
1 //------------------------------------------------------------------------------
2 // <copyright file="PathUtil.cs" company="Microsoft">
3 //     Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>
5 //------------------------------------------------------------------------------
6
7 namespace System.Web.Util {
8     using System;
9     using System.IO;
10     using System.Security.Permissions;
11
12     internal static class PathUtil {
13
14         private static string _system32Path = GetSystem32Path();
15
16         [FileIOPermission(SecurityAction.Assert, Unrestricted = true)] // we don't leak this path anywhere
17         private static string GetSystem32Path() {
18             return Environment.GetFolderPath(Environment.SpecialFolder.System);
19         }
20
21         // Gets the full path to a file in the SYSTEM32 folder (which is correct for both 32-bit and 64-bit architectures).
22         // Example: "foo.dll" -> "C:\Windows\System32\foo.dll"
23         internal static string GetSystemDllFullPath(string filename) {
24             return Path.Combine(_system32Path, filename);
25         }
26
27     }
28 }