mscorlib(4.0.0.0) API with additions
Config.cs
4 
6 {
7  internal static class Config
8  {
9  private static volatile string m_machineConfig;
10 
11  private static volatile string m_userConfig;
12 
13  internal static string MachineDirectory
14  {
15  [SecurityCritical]
16  get
17  {
18  GetFileLocales();
19  return m_machineConfig;
20  }
21  }
22 
23  internal static string UserDirectory
24  {
25  [SecurityCritical]
26  get
27  {
28  GetFileLocales();
29  return m_userConfig;
30  }
31  }
32 
33  [SecurityCritical]
34  private static void GetFileLocales()
35  {
36  if (m_machineConfig == null)
37  {
38  string s = null;
39  GetMachineDirectory(JitHelpers.GetStringHandleOnStack(ref s));
40  m_machineConfig = s;
41  }
42  if (m_userConfig == null)
43  {
44  string s2 = null;
45  GetUserDirectory(JitHelpers.GetStringHandleOnStack(ref s2));
46  m_userConfig = s2;
47  }
48  }
49 
50  [DllImport("QCall", CharSet = CharSet.Unicode)]
51  [SecurityCritical]
52  [SuppressUnmanagedCodeSecurity]
53  internal static extern int SaveDataByte(string path, [In] byte[] data, int length);
54 
55  [DllImport("QCall", CharSet = CharSet.Unicode)]
56  [SecurityCritical]
57  [SuppressUnmanagedCodeSecurity]
58  internal static extern bool RecoverData(ConfigId id);
59 
60  [DllImport("QCall", CharSet = CharSet.Unicode)]
61  [SecurityCritical]
62  [SuppressUnmanagedCodeSecurity]
63  internal static extern void SetQuickCache(ConfigId id, QuickCacheEntryType quickCacheFlags);
64 
65  [DllImport("QCall", CharSet = CharSet.Unicode)]
66  [SecurityCritical]
67  [SuppressUnmanagedCodeSecurity]
68  private static extern bool GetCacheEntry(ConfigId id, int numKey, [In] byte[] key, int keyLength, ObjectHandleOnStack retData);
69 
70  [SecurityCritical]
71  internal static bool GetCacheEntry(ConfigId id, int numKey, byte[] key, out byte[] data)
72  {
73  byte[] o = null;
74  bool cacheEntry = GetCacheEntry(id, numKey, key, key.Length, JitHelpers.GetObjectHandleOnStack(ref o));
75  data = o;
76  return cacheEntry;
77  }
78 
79  [DllImport("QCall", CharSet = CharSet.Unicode)]
80  [SecurityCritical]
81  [SuppressUnmanagedCodeSecurity]
82  private static extern void AddCacheEntry(ConfigId id, int numKey, [In] byte[] key, int keyLength, byte[] data, int dataLength);
83 
84  [SecurityCritical]
85  internal static void AddCacheEntry(ConfigId id, int numKey, byte[] key, byte[] data)
86  {
87  AddCacheEntry(id, numKey, key, key.Length, data, data.Length);
88  }
89 
90  [DllImport("QCall", CharSet = CharSet.Unicode)]
91  [SecurityCritical]
92  [SuppressUnmanagedCodeSecurity]
93  internal static extern void ResetCacheData(ConfigId id);
94 
95  [DllImport("QCall", CharSet = CharSet.Unicode)]
96  [SecurityCritical]
97  [SuppressUnmanagedCodeSecurity]
98  private static extern void GetMachineDirectory(StringHandleOnStack retDirectory);
99 
100  [DllImport("QCall", CharSet = CharSet.Unicode)]
101  [SecurityCritical]
102  [SuppressUnmanagedCodeSecurity]
103  private static extern void GetUserDirectory(StringHandleOnStack retDirectory);
104 
105  [DllImport("QCall", CharSet = CharSet.Unicode)]
106  [SecurityCritical]
107  [SuppressUnmanagedCodeSecurity]
108  internal static extern bool WriteToEventLog(string message);
109  }
110 }
Definition: __Canon.cs:3
CharSet
Dictates which character set marshaled strings should use.
Definition: CharSet.cs:7