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
- DataGridViewEditingControlShowingEventArgs.cs
- BitSet.cs
- GenericTextProperties.cs
- XmlSchemaImporter.cs
- KeyFrames.cs
- ThrowHelper.cs
- ImageSourceConverter.cs
- ExtentCqlBlock.cs
- DbProviderFactoriesConfigurationHandler.cs
- IDQuery.cs
- GeneratedContractType.cs
- Rule.cs
- CustomActivityDesigner.cs
- GPRECTF.cs
- WebServiceClientProxyGenerator.cs
- ParallelQuery.cs
- Variant.cs
- XamlSerializerUtil.cs
- XmlDomTextWriter.cs
- Bezier.cs
- FontNamesConverter.cs
- IgnoreSectionHandler.cs
- ContextProperty.cs
- InternalPermissions.cs
- AmbientValueAttribute.cs
- Boolean.cs
- ToolStripOverflowButton.cs
- DefaultValidator.cs
- WebBrowserContainer.cs
- MediaScriptCommandRoutedEventArgs.cs
- BooleanAnimationUsingKeyFrames.cs
- WindowsTokenRoleProvider.cs
- coordinatorscratchpad.cs
- XmlMtomReader.cs
- ping.cs
- InvokeBinder.cs
- SystemTcpConnection.cs
- RightsManagementEncryptionTransform.cs
- XsdBuildProvider.cs
- EmptyEnumerator.cs
- BulletDecorator.cs
- DataRowView.cs
- ServicePoint.cs
- DataSourceView.cs
- MsmqOutputChannel.cs
- QuaternionAnimation.cs
- ScriptResourceInfo.cs
- ChildDocumentBlock.cs
- JoinSymbol.cs
- RouteItem.cs
- TraceRecords.cs
- TimeEnumHelper.cs
- IsolationInterop.cs
- AsyncStreamReader.cs
- WindowHideOrCloseTracker.cs
- BitStream.cs
- DetailsViewUpdatedEventArgs.cs
- SessionKeyExpiredException.cs
- BooleanSwitch.cs
- Attachment.cs
- AudienceUriMode.cs
- AutoFocusStyle.xaml.cs
- Baml2006ReaderSettings.cs
- TypeSource.cs
- QuaternionConverter.cs
- ImmutablePropertyDescriptorGridEntry.cs
- WebPartTransformerCollection.cs
- ExceptionList.cs
- ConstNode.cs
- WebServiceClientProxyGenerator.cs
- BindingManagerDataErrorEventArgs.cs
- RayHitTestParameters.cs
- LocatorGroup.cs
- CommandTreeTypeHelper.cs
- DataListCommandEventArgs.cs
- SystemParameters.cs
- OleDbSchemaGuid.cs
- TextureBrush.cs
- MarkerProperties.cs
- DefaultValueAttribute.cs
- SyndicationItemFormatter.cs
- QuaternionAnimation.cs
- WebPartManager.cs
- SingleConverter.cs
- TextDpi.cs
- XmlProcessingInstruction.cs
- FixedSchema.cs
- EpmCustomContentDeSerializer.cs
- RenderContext.cs
- PatternMatcher.cs
- ReflectionUtil.cs
- ConstraintConverter.cs
- EntryWrittenEventArgs.cs
- RandomNumberGenerator.cs
- ModelPropertyCollectionImpl.cs
- ComponentEditorPage.cs
- CodeObject.cs
- DataGridTextBoxColumn.cs
- FormParameter.cs
- DPAPIProtectedConfigurationProvider.cs