Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Security / Util / Config.cs / 1305376 / Config.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== //[....] // // // Config.cs // namespace System.Security.Util { using System; using System.Security.Util; using System.Security.Policy; using System.Security.Permissions; using System.Collections; using System.IO; using System.Reflection; using System.Globalization; using System.Text; #if FEATURE_SERIALIZATION using System.Runtime.Serialization.Formatters.Binary; #endif // FEATURE_SERIALIZATION using System.Threading; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; // Duplicated in vm\COMSecurityConfig.h [Serializable] [Flags] internal enum QuickCacheEntryType { FullTrustZoneMyComputer = 0x1000000, FullTrustZoneIntranet = 0x2000000, FullTrustZoneInternet = 0x4000000, FullTrustZoneTrusted = 0x8000000, FullTrustZoneUntrusted = 0x10000000, FullTrustAll = 0x20000000, } internal static class Config { private static string m_machineConfig; private static string m_userConfig; [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [ResourceConsumption(ResourceScope.Machine, ResourceScope.Machine)] private static void GetFileLocales() { if (m_machineConfig == null) { string machineConfig = null; GetMachineDirectory(JitHelpers.GetStringHandleOnStack(ref machineConfig)); m_machineConfig = machineConfig; } if (m_userConfig == null) { string userConfig = null; GetUserDirectory(JitHelpers.GetStringHandleOnStack(ref userConfig)); m_userConfig = userConfig; } } internal static string MachineDirectory { [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.Machine)] get { GetFileLocales(); return m_machineConfig; } } internal static string UserDirectory { [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.Machine)] get { GetFileLocales(); return m_userConfig; } } #if FEATURE_CAS_POLICY [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.Machine)] [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode), SuppressUnmanagedCodeSecurity] internal static extern int SaveDataByte(string path, [In] byte[] data, int length); [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode), SuppressUnmanagedCodeSecurity] internal static extern bool RecoverData(ConfigId id); [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode), SuppressUnmanagedCodeSecurity] internal static extern void SetQuickCache(ConfigId id, QuickCacheEntryType quickCacheFlags); [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode), SuppressUnmanagedCodeSecurity] private static extern bool GetCacheEntry(ConfigId id, int numKey, [In] byte[] key, int keyLength, ObjectHandleOnStack retData); [System.Security.SecurityCritical] // auto-generated internal static bool GetCacheEntry(ConfigId id, int numKey, byte[] key, out byte[] data) { byte[] retData = null; bool ret = GetCacheEntry(id, numKey, key, key.Length, JitHelpers.GetObjectHandleOnStack(ref retData)); data = retData; return ret; } [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode), SuppressUnmanagedCodeSecurity] private static extern void AddCacheEntry(ConfigId id, int numKey, [In] byte[] key, int keyLength, byte[] data, int dataLength); [System.Security.SecurityCritical] // auto-generated internal static void AddCacheEntry(ConfigId id, int numKey, byte[] key, byte[] data) { AddCacheEntry(id, numKey, key, key.Length, data, data.Length); } [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode), SuppressUnmanagedCodeSecurity] internal static extern void ResetCacheData(ConfigId id); #endif [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.Machine)] [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode), SuppressUnmanagedCodeSecurity] private static extern void GetMachineDirectory(StringHandleOnStack retDirectory); [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.Machine)] [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode), SuppressUnmanagedCodeSecurity] private static extern void GetUserDirectory(StringHandleOnStack retDirectory); [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode), SuppressUnmanagedCodeSecurity] internal static extern bool WriteToEventLog(string message); } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== //[....] // // // Config.cs // namespace System.Security.Util { using System; using System.Security.Util; using System.Security.Policy; using System.Security.Permissions; using System.Collections; using System.IO; using System.Reflection; using System.Globalization; using System.Text; #if FEATURE_SERIALIZATION using System.Runtime.Serialization.Formatters.Binary; #endif // FEATURE_SERIALIZATION using System.Threading; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; // Duplicated in vm\COMSecurityConfig.h [Serializable] [Flags] internal enum QuickCacheEntryType { FullTrustZoneMyComputer = 0x1000000, FullTrustZoneIntranet = 0x2000000, FullTrustZoneInternet = 0x4000000, FullTrustZoneTrusted = 0x8000000, FullTrustZoneUntrusted = 0x10000000, FullTrustAll = 0x20000000, } internal static class Config { private static string m_machineConfig; private static string m_userConfig; [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [ResourceConsumption(ResourceScope.Machine, ResourceScope.Machine)] private static void GetFileLocales() { if (m_machineConfig == null) { string machineConfig = null; GetMachineDirectory(JitHelpers.GetStringHandleOnStack(ref machineConfig)); m_machineConfig = machineConfig; } if (m_userConfig == null) { string userConfig = null; GetUserDirectory(JitHelpers.GetStringHandleOnStack(ref userConfig)); m_userConfig = userConfig; } } internal static string MachineDirectory { [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.Machine)] get { GetFileLocales(); return m_machineConfig; } } internal static string UserDirectory { [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.Machine)] get { GetFileLocales(); return m_userConfig; } } #if FEATURE_CAS_POLICY [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.Machine)] [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode), SuppressUnmanagedCodeSecurity] internal static extern int SaveDataByte(string path, [In] byte[] data, int length); [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode), SuppressUnmanagedCodeSecurity] internal static extern bool RecoverData(ConfigId id); [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode), SuppressUnmanagedCodeSecurity] internal static extern void SetQuickCache(ConfigId id, QuickCacheEntryType quickCacheFlags); [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode), SuppressUnmanagedCodeSecurity] private static extern bool GetCacheEntry(ConfigId id, int numKey, [In] byte[] key, int keyLength, ObjectHandleOnStack retData); [System.Security.SecurityCritical] // auto-generated internal static bool GetCacheEntry(ConfigId id, int numKey, byte[] key, out byte[] data) { byte[] retData = null; bool ret = GetCacheEntry(id, numKey, key, key.Length, JitHelpers.GetObjectHandleOnStack(ref retData)); data = retData; return ret; } [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode), SuppressUnmanagedCodeSecurity] private static extern void AddCacheEntry(ConfigId id, int numKey, [In] byte[] key, int keyLength, byte[] data, int dataLength); [System.Security.SecurityCritical] // auto-generated internal static void AddCacheEntry(ConfigId id, int numKey, byte[] key, byte[] data) { AddCacheEntry(id, numKey, key, key.Length, data, data.Length); } [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode), SuppressUnmanagedCodeSecurity] internal static extern void ResetCacheData(ConfigId id); #endif [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.Machine)] [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode), SuppressUnmanagedCodeSecurity] private static extern void GetMachineDirectory(StringHandleOnStack retDirectory); [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.Machine)] [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode), SuppressUnmanagedCodeSecurity] private static extern void GetUserDirectory(StringHandleOnStack retDirectory); [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode), SuppressUnmanagedCodeSecurity] internal static extern bool WriteToEventLog(string message); } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PopupEventArgs.cs
- shaperfactoryquerycacheentry.cs
- UIElement3D.cs
- MailAddressCollection.cs
- SafeNativeMethods.cs
- RegistryPermission.cs
- DeviceSpecificDialogCachedState.cs
- BinaryConverter.cs
- DecoderNLS.cs
- DockPattern.cs
- CFStream.cs
- precedingquery.cs
- ListViewAutomationPeer.cs
- DocumentSequence.cs
- SingleResultAttribute.cs
- MediaCommands.cs
- ByteAnimationUsingKeyFrames.cs
- ResourceContainer.cs
- FormattedTextSymbols.cs
- GeometryDrawing.cs
- BitmapEffectInputConnector.cs
- OperationSelectorBehavior.cs
- Image.cs
- WrappedKeySecurityTokenParameters.cs
- DataBinder.cs
- XmlSchemaComplexContent.cs
- DateTimeValueSerializer.cs
- SharedPerformanceCounter.cs
- ParameterSubsegment.cs
- validationstate.cs
- Domain.cs
- XmlSchemaAttribute.cs
- PageCodeDomTreeGenerator.cs
- PropertyRecord.cs
- ISCIIEncoding.cs
- SpAudioStreamWrapper.cs
- BitmapFrameDecode.cs
- DesignerActionHeaderItem.cs
- CharacterMetrics.cs
- HttpVersion.cs
- SystemWebSectionGroup.cs
- OciHandle.cs
- ShapingWorkspace.cs
- BindingSource.cs
- WindowsListViewSubItem.cs
- EntityDataSource.cs
- InfoCardXmlSerializer.cs
- ScriptingScriptResourceHandlerSection.cs
- shaperfactory.cs
- PersonalizableAttribute.cs
- Propagator.cs
- WebPartZoneBase.cs
- CodeStatement.cs
- RestHandlerFactory.cs
- SelectManyQueryOperator.cs
- SQLInt64.cs
- DispatchChannelSink.cs
- MinimizableAttributeTypeConverter.cs
- SelectionPatternIdentifiers.cs
- UIElement3D.cs
- ExtendedProtectionPolicyTypeConverter.cs
- AssemblyCache.cs
- Margins.cs
- RowTypeElement.cs
- CommandCollectionEditor.cs
- Int64AnimationBase.cs
- AttachmentService.cs
- DataControlFieldCell.cs
- XmlSchemaImporter.cs
- ProfileService.cs
- SoapHeaders.cs
- Marshal.cs
- XmlSchemaProviderAttribute.cs
- FlowPanelDesigner.cs
- BaseTreeIterator.cs
- DataQuery.cs
- DrawListViewColumnHeaderEventArgs.cs
- EdmScalarPropertyAttribute.cs
- PolicyManager.cs
- StateMachineExecutionState.cs
- Message.cs
- SqlTriggerContext.cs
- Set.cs
- Funcletizer.cs
- StatusBarDrawItemEvent.cs
- OpacityConverter.cs
- GridViewCellAutomationPeer.cs
- SrgsElementList.cs
- iisPickupDirectory.cs
- DispatcherObject.cs
- XmlAttributes.cs
- WindowsScrollBar.cs
- DataBoundControlParameterTarget.cs
- CustomValidator.cs
- RepeaterItem.cs
- DataGridAddNewRow.cs
- SqlGatherProducedAliases.cs
- XmlSchemaAll.cs
- PeerChannelListener.cs
- AutomationAttributeInfo.cs