Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Shared / MS / Internal / securitycriticaldata.cs / 1 / securitycriticaldata.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // Description: // This is a helper class to facilate the storage of Security critical data ( aka "Plutonium") // It's primary purpose is to do put a [SecurityCritical] on all access to the data. // // What is "critical data" ? This is any data created that required an Assert for it's creation. // As an example - the creation of an HwndWrapper during Dispatcher.Attach. // // History: // 10/25/04 : marka 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 DRT using MS.Internal.Drt; #else #error Attempt to use FriendAccessAllowedAttribute from an unknown assembly. using MS.Internal.YourAssemblyName; #endif namespace MS.Internal { [FriendAccessAllowed] internal struct SecurityCriticalData{ /// /// Critical - as this accesses _value which is Critical. /// Safe - as the caller already got the critical value. /// [SecurityCritical, SecurityTreatAsSafe] internal SecurityCriticalData(T value) { _value = value; } //// Critical "by definition" - this class is intended only to store critical data. // internal T Value { [SecurityCritical] get { return _value; } } ////// Critical - by definition as this is a wrapper for Critical data. /// [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 Security critical data ( aka "Plutonium") // It's primary purpose is to do put a [SecurityCritical] on all access to the data. // // What is "critical data" ? This is any data created that required an Assert for it's creation. // As an example - the creation of an HwndWrapper during Dispatcher.Attach. // // History: // 10/25/04 : marka 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 DRT using MS.Internal.Drt; #else #error Attempt to use FriendAccessAllowedAttribute from an unknown assembly. using MS.Internal.YourAssemblyName; #endif namespace MS.Internal { [FriendAccessAllowed] internal struct SecurityCriticalData{ /// /// Critical - as this accesses _value which is Critical. /// Safe - as the caller already got the critical value. /// [SecurityCritical, SecurityTreatAsSafe] internal SecurityCriticalData(T value) { _value = value; } //// Critical "by definition" - this class is intended only to store critical data. // internal T Value { [SecurityCritical] get { return _value; } } ////// Critical - by definition as this is a wrapper for Critical data. /// [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
- PoisonMessageException.cs
- ControlDesigner.cs
- Viewport2DVisual3D.cs
- RSAOAEPKeyExchangeFormatter.cs
- PassportIdentity.cs
- MiniAssembly.cs
- FrameworkRichTextComposition.cs
- InvalidPrinterException.cs
- EncodingDataItem.cs
- Rfc2898DeriveBytes.cs
- ObjectPersistData.cs
- ChtmlSelectionListAdapter.cs
- DocumentApplicationDocumentViewer.cs
- Internal.cs
- ForeignKeyConstraint.cs
- DefaultBindingPropertyAttribute.cs
- ParsedAttributeCollection.cs
- FileSystemEventArgs.cs
- QilXmlWriter.cs
- CollectionEditVerbManager.cs
- GeometryModel3D.cs
- MemberDescriptor.cs
- CatalogPartCollection.cs
- TreeNodeConverter.cs
- RewritingValidator.cs
- listitem.cs
- WebPartActionVerb.cs
- EntityCodeGenerator.cs
- PreviewPageInfo.cs
- GeometryValueSerializer.cs
- FileReservationCollection.cs
- RenderingBiasValidation.cs
- Timer.cs
- XPathNode.cs
- CacheSection.cs
- JulianCalendar.cs
- LoginView.cs
- LedgerEntryCollection.cs
- StackSpiller.Temps.cs
- DataGridViewDataErrorEventArgs.cs
- BindingCollectionElement.cs
- SortDescription.cs
- KeyedCollection.cs
- EntityTypeEmitter.cs
- DynamicValidatorEventArgs.cs
- RecordManager.cs
- KoreanCalendar.cs
- MethodAccessException.cs
- MLangCodePageEncoding.cs
- ParagraphResult.cs
- XmlAnyElementAttribute.cs
- AssemblyGen.cs
- DesignBinding.cs
- XmlName.cs
- ConfigurationSection.cs
- ExtenderControl.cs
- SocketInformation.cs
- VisualBasicValue.cs
- ImportedNamespaceContextItem.cs
- ImageUrlEditor.cs
- Pen.cs
- PersonalizationProviderCollection.cs
- WebSysDisplayNameAttribute.cs
- MetadataUtil.cs
- UnsignedPublishLicense.cs
- TimeSpanSecondsConverter.cs
- DataRow.cs
- Stroke2.cs
- Int64Converter.cs
- CrossAppDomainChannel.cs
- ReferencedType.cs
- CodeSubDirectory.cs
- ConstructorNeedsTagAttribute.cs
- TextSelectionHighlightLayer.cs
- CompilerResults.cs
- BinaryMessageEncodingElement.cs
- ValidateNames.cs
- XPathNodeHelper.cs
- WebSysDefaultValueAttribute.cs
- HwndHostAutomationPeer.cs
- propertyentry.cs
- SchemaAttDef.cs
- ParallelLoopState.cs
- ContainerVisual.cs
- FusionWrap.cs
- UnicastIPAddressInformationCollection.cs
- DesignerActionItem.cs
- unsafeIndexingFilterStream.cs
- ListenerBinder.cs
- CharacterString.cs
- RelationshipSet.cs
- SpecularMaterial.cs
- ListBoxDesigner.cs
- FontDialog.cs
- PolicyManager.cs
- TableRowGroup.cs
- StorageRoot.cs
- DefaultCommandConverter.cs
- UIElement3DAutomationPeer.cs
- MemberInfoSerializationHolder.cs