Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- DetailsViewDeletedEventArgs.cs
- StringBlob.cs
- BuildProvidersCompiler.cs
- MailAddress.cs
- DynamicValueConverter.cs
- EditorAttribute.cs
- WebPartHelpVerb.cs
- ListViewDataItem.cs
- BindingSource.cs
- DetailsViewDeletedEventArgs.cs
- MenuItemBinding.cs
- _NativeSSPI.cs
- StrongNameUtility.cs
- ServiceObjectContainer.cs
- DeclarativeExpressionConditionDeclaration.cs
- SchemaMapping.cs
- FontUnit.cs
- ToolBarTray.cs
- RadioButtonPopupAdapter.cs
- MimeFormImporter.cs
- Method.cs
- CrossAppDomainChannel.cs
- XamlReaderConstants.cs
- FontDriver.cs
- XmlEncoding.cs
- DataObjectAttribute.cs
- PeerNameRecord.cs
- LayoutTableCell.cs
- DesignerUtils.cs
- RelationshipConstraintValidator.cs
- GregorianCalendar.cs
- StopStoryboard.cs
- ImageClickEventArgs.cs
- CustomErrorsSection.cs
- ConfigPathUtility.cs
- XmlTextWriter.cs
- Property.cs
- PrimitiveXmlSerializers.cs
- Int64.cs
- MediaContext.cs
- ReverseInheritProperty.cs
- ParentQuery.cs
- DesignerActionUIService.cs
- TypedDatasetGenerator.cs
- MyContact.cs
- MinMaxParagraphWidth.cs
- TypeSystemProvider.cs
- WithParamAction.cs
- XamlClipboardData.cs
- RenderData.cs
- ScriptRegistrationManager.cs
- Stack.cs
- MultiByteCodec.cs
- TextRunCacheImp.cs
- ManipulationBoundaryFeedbackEventArgs.cs
- securitycriticaldataformultiplegetandset.cs
- DataGridParentRows.cs
- SafeCryptoHandles.cs
- XamlClipboardData.cs
- FolderNameEditor.cs
- DirectoryObjectSecurity.cs
- SamlAssertionKeyIdentifierClause.cs
- XmlDictionaryReader.cs
- regiisutil.cs
- DockAndAnchorLayout.cs
- XMLDiffLoader.cs
- OracleBinary.cs
- OperationResponse.cs
- MailWebEventProvider.cs
- IntranetCredentialPolicy.cs
- DisposableCollectionWrapper.cs
- DecoderExceptionFallback.cs
- UserPreferenceChangingEventArgs.cs
- AppDomain.cs
- MergablePropertyAttribute.cs
- LoginUtil.cs
- TableDetailsCollection.cs
- DataGridViewCellMouseEventArgs.cs
- DispatcherExceptionEventArgs.cs
- HtmlTableRowCollection.cs
- BinaryParser.cs
- PointAnimationUsingPath.cs
- NamespaceEmitter.cs
- FileDialogPermission.cs
- Win32SafeHandles.cs
- ChildDocumentBlock.cs
- MappingException.cs
- AnnotationAuthorChangedEventArgs.cs
- ScalarRestriction.cs
- MenuDesigner.cs
- XsdBuilder.cs
- AdapterDictionary.cs
- UnaryNode.cs
- HtmlInputFile.cs
- ToolStripOverflow.cs
- MediaTimeline.cs
- errorpatternmatcher.cs
- _BufferOffsetSize.cs
- DrawingContextDrawingContextWalker.cs
- MobileRedirect.cs