Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Shared / MS / Internal / SecurityCriticalDataForSet.cs / 1305600 / 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 !SILVERLIGHTXAML #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; #elif SYSTEM_XAML using MS.Internal.WindowsBase; #else #error Attempt to use FriendAccessAllowedAttribute from an unknown assembly. using MS.Internal.YourAssemblyName; #endif #if SYSTEM_XAML namespace MS.Internal.Xaml #else namespace MS.Internal #endif { [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; } } #endif // 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
- RepeaterDesigner.cs
- WebEventTraceProvider.cs
- MaterialGroup.cs
- SafeEventLogReadHandle.cs
- ELinqQueryState.cs
- RegexStringValidatorAttribute.cs
- BmpBitmapDecoder.cs
- DiscoveryVersion.cs
- TransportManager.cs
- DataGridToolTip.cs
- SimpleBitVector32.cs
- ConnectorDragDropGlyph.cs
- FixedSOMPageConstructor.cs
- MouseGestureValueSerializer.cs
- RuntimeIdentifierPropertyAttribute.cs
- InstanceDataCollectionCollection.cs
- GlyphInfoList.cs
- TextBoxBase.cs
- GCHandleCookieTable.cs
- CryptoApi.cs
- sqlser.cs
- JsonFormatWriterGenerator.cs
- PresentationTraceSources.cs
- ListDictionary.cs
- SectionVisual.cs
- itemelement.cs
- FactoryMaker.cs
- LinkArea.cs
- oledbmetadatacollectionnames.cs
- TagMapInfo.cs
- Point4D.cs
- GetPageNumberCompletedEventArgs.cs
- Visual3D.cs
- elementinformation.cs
- XamlDesignerSerializationManager.cs
- VirtualPathExtension.cs
- ObjectTokenCategory.cs
- HttpInputStream.cs
- Dispatcher.cs
- MimeFormatter.cs
- MetadataPropertyCollection.cs
- TemplatedAdorner.cs
- ImmutableAssemblyCacheEntry.cs
- XmlConverter.cs
- XappLauncher.cs
- AttributeAction.cs
- Animatable.cs
- LabelDesigner.cs
- SslStreamSecurityUpgradeProvider.cs
- OraclePermission.cs
- LoginUtil.cs
- OutputScopeManager.cs
- safex509handles.cs
- AspCompat.cs
- ProxyGenerationError.cs
- Stack.cs
- WebBrowser.cs
- SQLDateTime.cs
- ProviderSettingsCollection.cs
- FunctionDetailsReader.cs
- ChtmlCommandAdapter.cs
- AssemblyName.cs
- BinHexDecoder.cs
- Calendar.cs
- Win32.cs
- FixedLineResult.cs
- ProfileServiceManager.cs
- DataGridViewToolTip.cs
- ItemsControlAutomationPeer.cs
- ResourceBinder.cs
- SliderAutomationPeer.cs
- TypeUtil.cs
- EdmComplexPropertyAttribute.cs
- HasCopySemanticsAttribute.cs
- ScrollBarRenderer.cs
- DocumentCollection.cs
- ToolStripRenderer.cs
- ExpressionVisitor.cs
- EntityDataSourceWrapperPropertyDescriptor.cs
- DirectoryRootQuery.cs
- BehaviorEditorPart.cs
- TypeDelegator.cs
- OdbcPermission.cs
- PassportAuthenticationEventArgs.cs
- LinearQuaternionKeyFrame.cs
- EmptyCollection.cs
- Events.cs
- PropertyExpression.cs
- FileCodeGroup.cs
- SoapDocumentMethodAttribute.cs
- CodeParameterDeclarationExpression.cs
- EditingContext.cs
- PageStatePersister.cs
- OrderedEnumerableRowCollection.cs
- TextElement.cs
- WebPartConnectionsCancelEventArgs.cs
- basecomparevalidator.cs
- OleDbPropertySetGuid.cs
- Margins.cs
- NetWebProxyFinder.cs