Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- Point.cs
- WebSysDisplayNameAttribute.cs
- LinqDataSourceDeleteEventArgs.cs
- HttpApplication.cs
- LocalValueEnumerator.cs
- BindableAttribute.cs
- ContainerTracking.cs
- EncryptedType.cs
- NamespaceListProperty.cs
- DesignBindingEditor.cs
- CounterSample.cs
- PublisherIdentityPermission.cs
- TableItemProviderWrapper.cs
- MatrixTransform3D.cs
- VisualBasicSettings.cs
- SqlDataSourceSelectingEventArgs.cs
- Transactions.cs
- GetImportFileNameRequest.cs
- XmlQueryCardinality.cs
- ListViewItem.cs
- Calendar.cs
- FillBehavior.cs
- DataObjectFieldAttribute.cs
- WinCategoryAttribute.cs
- ColorAnimation.cs
- WorkflowService.cs
- IItemContainerGenerator.cs
- DrawingState.cs
- CodeDelegateCreateExpression.cs
- _UriTypeConverter.cs
- GridViewCommandEventArgs.cs
- ReaderWriterLock.cs
- GifBitmapDecoder.cs
- TriggerActionCollection.cs
- RequestResizeEvent.cs
- CharEnumerator.cs
- XmlWrappingReader.cs
- XhtmlCssHandler.cs
- DBConnection.cs
- QilScopedVisitor.cs
- xmlsaver.cs
- SimpleWorkerRequest.cs
- ChangeProcessor.cs
- DataGridViewSelectedCellCollection.cs
- _ContextAwareResult.cs
- UniqueIdentifierService.cs
- Rect3D.cs
- _SslStream.cs
- ContractDescription.cs
- HighlightComponent.cs
- WebConfigurationHost.cs
- KeyboardEventArgs.cs
- CardSpaceShim.cs
- CommonDialog.cs
- TextDpi.cs
- PseudoWebRequest.cs
- WorkflowView.cs
- ProviderCollection.cs
- XPathSelectionIterator.cs
- XmlSchemaSimpleContentExtension.cs
- ObjectConverter.cs
- StylusButtonEventArgs.cs
- SpeakInfo.cs
- CodePrimitiveExpression.cs
- ConfigXmlElement.cs
- ToolStripDropDownButton.cs
- Italic.cs
- LineVisual.cs
- Stylesheet.cs
- HtmlHead.cs
- PreservationFileWriter.cs
- ManipulationInertiaStartingEventArgs.cs
- PropertySegmentSerializer.cs
- PropertyIDSet.cs
- GridViewRowPresenter.cs
- Margins.cs
- CachedFontFace.cs
- IndentedWriter.cs
- SizeAnimationClockResource.cs
- DataBinder.cs
- PrintDialogException.cs
- AudioFormatConverter.cs
- HttpApplicationFactory.cs
- DefaultTraceListener.cs
- ControlBuilder.cs
- Tablet.cs
- PenContexts.cs
- MethodBuilderInstantiation.cs
- TrackBarRenderer.cs
- SlipBehavior.cs
- KerberosReceiverSecurityToken.cs
- SymmetricAlgorithm.cs
- Utils.cs
- LayoutTableCell.cs
- SQLByteStorage.cs
- MenuItemAutomationPeer.cs
- PageRanges.cs
- EdmScalarPropertyAttribute.cs
- Debugger.cs
- IConvertible.cs