Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- AnnotationComponentManager.cs
- IList.cs
- List.cs
- Subtree.cs
- _ListenerResponseStream.cs
- NavigationPropertyEmitter.cs
- UIElement3D.cs
- BitmapEffectInput.cs
- Executor.cs
- Array.cs
- HWStack.cs
- ImageFormat.cs
- LicenseProviderAttribute.cs
- RelationshipSet.cs
- CatalogZone.cs
- WinInet.cs
- StorageModelBuildProvider.cs
- Application.cs
- DataPagerCommandEventArgs.cs
- SHA512Managed.cs
- ExpressionBuilderCollection.cs
- XmlQueryTypeFactory.cs
- RectConverter.cs
- ListComponentEditor.cs
- ByteFacetDescriptionElement.cs
- XmlReflectionImporter.cs
- DataGridViewCellStyleConverter.cs
- NullRuntimeConfig.cs
- ProxyWebPartManager.cs
- RoutingTable.cs
- UIElementAutomationPeer.cs
- EntityModelBuildProvider.cs
- DependentList.cs
- TdsRecordBufferSetter.cs
- TextSelection.cs
- CreateUserWizardStep.cs
- CachedFontFace.cs
- WeakReference.cs
- RegexCompilationInfo.cs
- OleDbDataReader.cs
- TextRangeEdit.cs
- ContextConfiguration.cs
- StringSorter.cs
- MouseButton.cs
- DependencyProperty.cs
- RawUIStateInputReport.cs
- PolicyImporterElementCollection.cs
- Int32Animation.cs
- baseshape.cs
- EngineSite.cs
- SamlAuthorizationDecisionStatement.cs
- BoundField.cs
- IndicShape.cs
- HttpProfileBase.cs
- SqlBulkCopyColumnMappingCollection.cs
- TablePattern.cs
- AmbientValueAttribute.cs
- WindowsMenu.cs
- Set.cs
- InheritanceContextHelper.cs
- ConfigXmlCDataSection.cs
- OrderByQueryOptionExpression.cs
- GetPageNumberCompletedEventArgs.cs
- PtsPage.cs
- RegistrationProxy.cs
- RowUpdatingEventArgs.cs
- SafeHandles.cs
- DocumentsTrace.cs
- Queue.cs
- WebControlsSection.cs
- SqlDataSourceParameterParser.cs
- _DigestClient.cs
- Rect.cs
- RemoteDebugger.cs
- UnmanagedMemoryStreamWrapper.cs
- Stack.cs
- DtdParser.cs
- x509utils.cs
- TextElement.cs
- UpDownBase.cs
- X509Extension.cs
- DbConnectionPool.cs
- SelectionProviderWrapper.cs
- MenuCommand.cs
- followingquery.cs
- CompareValidator.cs
- BufferedGraphics.cs
- NamedPipeChannelFactory.cs
- PackagingUtilities.cs
- ITreeGenerator.cs
- AdornerLayer.cs
- Atom10FormatterFactory.cs
- ValidateNames.cs
- AutomationElementCollection.cs
- SettingsPropertyValueCollection.cs
- CompositeControl.cs
- ModuleBuilder.cs
- OleDbReferenceCollection.cs
- TypeValidationEventArgs.cs
- ComponentDispatcher.cs