Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / clr / src / BCL / System / Security / Util / Config.cs / 1 / 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; using System.Runtime.Serialization.Formatters.Binary; using System.Threading; using System.Runtime.CompilerServices; // 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; private static void GetFileLocales() { if (m_machineConfig == null) m_machineConfig = _GetMachineDirectory(); if (m_userConfig == null) m_userConfig = _GetUserDirectory(); } internal static string MachineDirectory { get { GetFileLocales(); return m_machineConfig; } } internal static string UserDirectory { get { GetFileLocales(); return m_userConfig; } } [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern bool SaveDataByte(string path, byte[] data, int offset, int length); [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern bool RecoverData(ConfigId id); [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern void SetQuickCache(ConfigId id, QuickCacheEntryType quickCacheFlags); [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern bool GetCacheEntry(ConfigId id, int numKey, char[] key, out byte[] data); [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern void AddCacheEntry(ConfigId id, int numKey, char[] key, byte[] data); [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern void ResetCacheData(ConfigId id); [MethodImplAttribute(MethodImplOptions.InternalCall)] private static extern string _GetMachineDirectory(); [MethodImplAttribute(MethodImplOptions.InternalCall)] private static extern string _GetUserDirectory(); [MethodImplAttribute(MethodImplOptions.InternalCall)] 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; using System.Runtime.Serialization.Formatters.Binary; using System.Threading; using System.Runtime.CompilerServices; // 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; private static void GetFileLocales() { if (m_machineConfig == null) m_machineConfig = _GetMachineDirectory(); if (m_userConfig == null) m_userConfig = _GetUserDirectory(); } internal static string MachineDirectory { get { GetFileLocales(); return m_machineConfig; } } internal static string UserDirectory { get { GetFileLocales(); return m_userConfig; } } [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern bool SaveDataByte(string path, byte[] data, int offset, int length); [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern bool RecoverData(ConfigId id); [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern void SetQuickCache(ConfigId id, QuickCacheEntryType quickCacheFlags); [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern bool GetCacheEntry(ConfigId id, int numKey, char[] key, out byte[] data); [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern void AddCacheEntry(ConfigId id, int numKey, char[] key, byte[] data); [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern void ResetCacheData(ConfigId id); [MethodImplAttribute(MethodImplOptions.InternalCall)] private static extern string _GetMachineDirectory(); [MethodImplAttribute(MethodImplOptions.InternalCall)] private static extern string _GetUserDirectory(); [MethodImplAttribute(MethodImplOptions.InternalCall)] 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
- LZCodec.cs
- LineServices.cs
- Transform3DCollection.cs
- EditBehavior.cs
- Control.cs
- ClientSponsor.cs
- ProcessStartInfo.cs
- RangeContentEnumerator.cs
- CalendarButtonAutomationPeer.cs
- CodeChecksumPragma.cs
- ScriptManagerProxy.cs
- GPPOINTF.cs
- TemplateControlParser.cs
- SQLStringStorage.cs
- FacetEnabledSchemaElement.cs
- XmlHierarchicalEnumerable.cs
- SqlProfileProvider.cs
- FaultImportOptions.cs
- SqlDataSourceDesigner.cs
- XmlExpressionDumper.cs
- WindowsProgressbar.cs
- TargetInvocationException.cs
- TextEffect.cs
- TransportContext.cs
- Variant.cs
- PenLineJoinValidation.cs
- DataBoundControlAdapter.cs
- DataGridCellAutomationPeer.cs
- ObjectQuery_EntitySqlExtensions.cs
- DataGridColumnCollection.cs
- SafeRegistryHandle.cs
- SmiGettersStream.cs
- RegexMatch.cs
- ImageFormatConverter.cs
- ToolStripSplitButton.cs
- RightsManagementPermission.cs
- FixedPageStructure.cs
- PointAnimationUsingKeyFrames.cs
- ThicknessAnimationUsingKeyFrames.cs
- GlobalizationSection.cs
- ConcurrentDictionary.cs
- WSSecureConversationDec2005.cs
- ToolBarButton.cs
- EventLogTraceListener.cs
- ISO2022Encoding.cs
- PageParserFilter.cs
- SafeCryptContextHandle.cs
- GridItemPatternIdentifiers.cs
- _IPv6Address.cs
- TimelineCollection.cs
- ConfigurationSectionGroup.cs
- basevalidator.cs
- FrameworkElementAutomationPeer.cs
- HtmlForm.cs
- PathParser.cs
- CollectionCodeDomSerializer.cs
- AutomationEventArgs.cs
- Timer.cs
- ContentControl.cs
- TraceLog.cs
- DataGridItem.cs
- TextPattern.cs
- contentDescriptor.cs
- GAC.cs
- SelectionPatternIdentifiers.cs
- LoaderAllocator.cs
- TypeUtil.cs
- MemberJoinTreeNode.cs
- DataGridViewTopLeftHeaderCell.cs
- Root.cs
- AuthorizationRule.cs
- EntityDataSourceViewSchema.cs
- CustomWebEventKey.cs
- CreateRefExpr.cs
- BatchWriter.cs
- StylusPointPropertyInfo.cs
- OperationResponse.cs
- ValidationErrorEventArgs.cs
- ProcessModelSection.cs
- TraceHandlerErrorFormatter.cs
- DataGridViewCellValueEventArgs.cs
- ISAPIWorkerRequest.cs
- RectangleConverter.cs
- SqlUserDefinedAggregateAttribute.cs
- DirectoryLocalQuery.cs
- ColorComboBox.cs
- FlowDocumentScrollViewer.cs
- ListViewItem.cs
- TimelineClockCollection.cs
- ObjectHandle.cs
- ExpressionBindings.cs
- OrderByLifter.cs
- XmlMtomWriter.cs
- FullTextState.cs
- PageCodeDomTreeGenerator.cs
- DataGridViewCellValidatingEventArgs.cs
- GeneralTransform3D.cs
- PathParser.cs
- DesignerPerfEventProvider.cs
- WebEventTraceProvider.cs