Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- MimeWriter.cs
- BezierSegment.cs
- LineSegment.cs
- ContentDesigner.cs
- ReadContentAsBinaryHelper.cs
- MessageDirection.cs
- ContentType.cs
- AssemblyCache.cs
- DictionaryChange.cs
- DocumentPageView.cs
- FacetValueContainer.cs
- HandleCollector.cs
- DrawListViewColumnHeaderEventArgs.cs
- MimePart.cs
- ArrangedElementCollection.cs
- SchemaNames.cs
- EventLogConfiguration.cs
- WebPartConnectionsConfigureVerb.cs
- LinkLabel.cs
- FontCacheUtil.cs
- ListViewCancelEventArgs.cs
- UpdateException.cs
- UIElement.cs
- ManagementClass.cs
- DataControlFieldCollection.cs
- WorkerRequest.cs
- FontCacheLogic.cs
- TextTrailingCharacterEllipsis.cs
- XmlValidatingReader.cs
- VSWCFServiceContractGenerator.cs
- QilFactory.cs
- KeyboardEventArgs.cs
- BitmapPalettes.cs
- CodeCommentStatementCollection.cs
- BinaryUtilClasses.cs
- Brushes.cs
- CodeCommentStatementCollection.cs
- mansign.cs
- SkinIDTypeConverter.cs
- DateTimeOffsetStorage.cs
- XmlBoundElement.cs
- XmlSignificantWhitespace.cs
- FlowPosition.cs
- HttpRequestWrapper.cs
- ObjectDataSourceEventArgs.cs
- _ProxyRegBlob.cs
- XPathBuilder.cs
- TypographyProperties.cs
- ServiceInstanceProvider.cs
- FamilyCollection.cs
- DispatcherExceptionEventArgs.cs
- HtmlWindow.cs
- PropertyDescriptor.cs
- NameValueCollection.cs
- StartUpEventArgs.cs
- UIElementPropertyUndoUnit.cs
- OSFeature.cs
- Codec.cs
- AttributeCollection.cs
- _NegoStream.cs
- PopupControlService.cs
- CorrelationToken.cs
- TemporaryBitmapFile.cs
- CrossContextChannel.cs
- SEHException.cs
- FileClassifier.cs
- FlowLayoutPanel.cs
- DockAndAnchorLayout.cs
- TextAnchor.cs
- PropertyIDSet.cs
- UrlAuthFailedErrorFormatter.cs
- DeferredTextReference.cs
- Condition.cs
- VisualCollection.cs
- EventDescriptorCollection.cs
- InheritanceAttribute.cs
- filewebresponse.cs
- SchemaImporterExtensionElementCollection.cs
- ParameterToken.cs
- CustomPopupPlacement.cs
- TypeTypeConverter.cs
- HtmlLiteralTextAdapter.cs
- OpenTypeLayout.cs
- WebPartDisplayModeCollection.cs
- GeneralTransform3DGroup.cs
- SemanticBasicElement.cs
- NativeRecognizer.cs
- ModifierKeysValueSerializer.cs
- WebHttpEndpoint.cs
- HTMLTextWriter.cs
- Error.cs
- GradientStopCollection.cs
- KnownBoxes.cs
- AdPostCacheSubstitution.cs
- OleDbConnection.cs
- ViewStateChangedEventArgs.cs
- Registry.cs
- Error.cs
- AppDomain.cs
- TargetConverter.cs