1 //------------------------------------------------------------------------------
2 // <copyright file="PathUtil.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
5 //------------------------------------------------------------------------------
7 namespace System.Web.Util {
10 using System.Security.Permissions;
12 internal static class PathUtil {
14 private static string _system32Path = GetSystem32Path();
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);
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);