Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Shared / MS / Internal / SecurityCriticalDataForSet.cs / 1 / SecurityCriticalDataForSet.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // Description: // This is a helper class to facilate the storage of data that's Critical for set. // The data itself is not information disclosure but the value controls a critical // operation. // // For example a filepath variable might control what part of the file system the // code gets access to. // // History: // 01/30/05 : [....] Created. // //--------------------------------------------------------------------------- using System ; using System.Security ; #if WINDOWS_BASE using MS.Internal.WindowsBase; #elif PRESENTATION_CORE using MS.Internal.PresentationCore; #elif PRESENTATIONFRAMEWORK using MS.Internal.PresentationFramework; #elif PRESENTATIONUI using MS.Internal.PresentationUI; #elif DRT using MS.Internal.Drt; #else #error Attempt to use FriendAccessAllowedAttribute from an unknown assembly. using MS.Internal.YourAssemblyName; #endif namespace MS.Internal { [FriendAccessAllowed] // Built into Base, also used by Core and Framework. [Serializable] internal struct SecurityCriticalDataForSet{ /// /// Critical - "by definition" - this class is intended only for data that's /// Critical for setting. /// [SecurityCritical] internal SecurityCriticalDataForSet(T value) { _value = value; } ////// Critical - Setter is Critical "by definition" - this class is intended only /// for data that's Critical for setting. /// Safe - get is safe by definition. /// Not Safe - set is not safe by definition. /// internal T Value { #if DEBUG [System.Diagnostics.DebuggerStepThrough] #endif [SecurityCritical, SecurityTreatAsSafe] get { return _value; } #if DEBUG [System.Diagnostics.DebuggerStepThrough] #endif [SecurityCritical] set { _value = value; } } ////// Critical - by definition as this data is Critical for set. /// > [SecurityCritical] private T _value; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // Description: // This is a helper class to facilate the storage of data that's Critical for set. // The data itself is not information disclosure but the value controls a critical // operation. // // For example a filepath variable might control what part of the file system the // code gets access to. // // History: // 01/30/05 : [....] Created. // //--------------------------------------------------------------------------- using System ; using System.Security ; #if WINDOWS_BASE using MS.Internal.WindowsBase; #elif PRESENTATION_CORE using MS.Internal.PresentationCore; #elif PRESENTATIONFRAMEWORK using MS.Internal.PresentationFramework; #elif PRESENTATIONUI using MS.Internal.PresentationUI; #elif DRT using MS.Internal.Drt; #else #error Attempt to use FriendAccessAllowedAttribute from an unknown assembly. using MS.Internal.YourAssemblyName; #endif namespace MS.Internal { [FriendAccessAllowed] // Built into Base, also used by Core and Framework. [Serializable] internal struct SecurityCriticalDataForSet{ /// /// Critical - "by definition" - this class is intended only for data that's /// Critical for setting. /// [SecurityCritical] internal SecurityCriticalDataForSet(T value) { _value = value; } ////// Critical - Setter is Critical "by definition" - this class is intended only /// for data that's Critical for setting. /// Safe - get is safe by definition. /// Not Safe - set is not safe by definition. /// internal T Value { #if DEBUG [System.Diagnostics.DebuggerStepThrough] #endif [SecurityCritical, SecurityTreatAsSafe] get { return _value; } #if DEBUG [System.Diagnostics.DebuggerStepThrough] #endif [SecurityCritical] set { _value = value; } } ////// Critical - by definition as this data is Critical for set. /// > [SecurityCritical] private T _value; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SqlClientWrapperSmiStreamChars.cs
- StringHandle.cs
- DesignerSerializerAttribute.cs
- InkCanvasFeedbackAdorner.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- ContractTypeNameCollection.cs
- PolygonHotSpot.cs
- SharedStatics.cs
- ToolStripDropTargetManager.cs
- DocumentViewerBaseAutomationPeer.cs
- MobileUserControl.cs
- ControlBuilderAttribute.cs
- ArraySortHelper.cs
- OleDbMetaDataFactory.cs
- BevelBitmapEffect.cs
- ResourcePool.cs
- DiagnosticTrace.cs
- CryptoStream.cs
- EdgeProfileValidation.cs
- EventMappingSettingsCollection.cs
- PassportAuthentication.cs
- Token.cs
- XmlExtensionFunction.cs
- RequestNavigateEventArgs.cs
- EraserBehavior.cs
- StyleCollection.cs
- ServicePoint.cs
- EntityDesignerDataSourceView.cs
- PropertyInfo.cs
- MergeFilterQuery.cs
- Mutex.cs
- NativeCompoundFileAPIs.cs
- BuildProvidersCompiler.cs
- NotifyParentPropertyAttribute.cs
- Simplifier.cs
- StyleBamlRecordReader.cs
- BitmapDownload.cs
- Shape.cs
- RadioButtonFlatAdapter.cs
- EdmToObjectNamespaceMap.cs
- MULTI_QI.cs
- SimpleType.cs
- TCPClient.cs
- FixedTextContainer.cs
- SqlBulkCopyColumnMappingCollection.cs
- OneToOneMappingSerializer.cs
- MobileListItem.cs
- InputLangChangeRequestEvent.cs
- EntityDataSourceDesigner.cs
- ListViewUpdateEventArgs.cs
- ScriptComponentDescriptor.cs
- SettingsAttributeDictionary.cs
- DomNameTable.cs
- FileDialog_Vista.cs
- DynamicVirtualDiscoSearcher.cs
- compensatingcollection.cs
- PathSegmentCollection.cs
- CollectionTypeElement.cs
- XmlNamespaceMappingCollection.cs
- EditorZone.cs
- ComboBox.cs
- ServicesExceptionNotHandledEventArgs.cs
- SQLInt32.cs
- ProtocolElementCollection.cs
- ApplicationContext.cs
- HttpWebResponse.cs
- WeakHashtable.cs
- StateRuntime.cs
- NullRuntimeConfig.cs
- RelatedPropertyManager.cs
- initElementDictionary.cs
- ColumnResizeAdorner.cs
- DocumentPage.cs
- SettingsProviderCollection.cs
- UnsafeNativeMethodsCLR.cs
- SecurityContextSecurityToken.cs
- ObfuscateAssemblyAttribute.cs
- XmlSignatureManifest.cs
- MetadataCollection.cs
- VScrollBar.cs
- Token.cs
- ProtocolsConfiguration.cs
- ReplacementText.cs
- SqlCachedBuffer.cs
- PersonalizationAdministration.cs
- MetadataItemCollectionFactory.cs
- SHA512CryptoServiceProvider.cs
- XmlSchemaComplexType.cs
- EventHandlersStore.cs
- JsonMessageEncoderFactory.cs
- CompoundFileStorageReference.cs
- LookupNode.cs
- GetUserPreferenceRequest.cs
- GridItem.cs
- EventLogPermissionEntry.cs
- TemplateContent.cs
- WebPartExportVerb.cs
- SerializerDescriptor.cs
- CustomDictionarySources.cs
- RepeaterCommandEventArgs.cs