Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Shared / MS / Internal / securitycriticaldata.cs / 1305600 / 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
- InvalidPipelineStoreException.cs
- IUnknownConstantAttribute.cs
- DeadCharTextComposition.cs
- UxThemeWrapper.cs
- EncryptionUtility.cs
- TableRow.cs
- PageSettings.cs
- GridViewCommandEventArgs.cs
- BaseWebProxyFinder.cs
- List.cs
- GridViewCellAutomationPeer.cs
- ColumnCollection.cs
- PersistenceIOParticipant.cs
- SendActivityDesigner.cs
- TextFormatterHost.cs
- bindurihelper.cs
- DataViewManagerListItemTypeDescriptor.cs
- PenThreadWorker.cs
- HitTestParameters3D.cs
- XslTransform.cs
- EmptyCollection.cs
- NameValueCollection.cs
- HttpModuleActionCollection.cs
- ListControl.cs
- DrawingServices.cs
- StringFunctions.cs
- ImageEditor.cs
- FlatButtonAppearance.cs
- XmlBoundElement.cs
- TargetException.cs
- RightsManagementPermission.cs
- StringStorage.cs
- BitmapEffectInputConnector.cs
- ExtensionQuery.cs
- XPathAncestorIterator.cs
- ConditionalExpression.cs
- EllipseGeometry.cs
- ImageMapEventArgs.cs
- CodeDomLocalizationProvider.cs
- BitVec.cs
- DiscreteKeyFrames.cs
- VectorAnimationUsingKeyFrames.cs
- PageTrueTypeFont.cs
- BinarySerializer.cs
- EntityParameter.cs
- PenContext.cs
- ConsoleKeyInfo.cs
- MonitorWrapper.cs
- TreeNodeCollection.cs
- HMACSHA384.cs
- SessionState.cs
- RequestSecurityTokenResponse.cs
- SatelliteContractVersionAttribute.cs
- HMACSHA256.cs
- NavigationEventArgs.cs
- CroppedBitmap.cs
- HScrollProperties.cs
- PriorityItem.cs
- ManagementNamedValueCollection.cs
- MethodBuilderInstantiation.cs
- DictionaryGlobals.cs
- clipboard.cs
- OleDbRowUpdatingEvent.cs
- EventRouteFactory.cs
- Int64KeyFrameCollection.cs
- SynchronizedPool.cs
- Visitor.cs
- SelectedGridItemChangedEvent.cs
- PrinterUnitConvert.cs
- DesignerTextBoxAdapter.cs
- FocusTracker.cs
- SecurityStandardsManager.cs
- UnitySerializationHolder.cs
- SpnegoTokenAuthenticator.cs
- ExpressionNormalizer.cs
- CompilerError.cs
- CompilerErrorCollection.cs
- ReversePositionQuery.cs
- QueryContinueDragEvent.cs
- InfoCardAsymmetricCrypto.cs
- LocalsItemDescription.cs
- MetabaseReader.cs
- CustomExpression.cs
- SecureConversationServiceElement.cs
- CodeStatement.cs
- EntityDataSourceValidationException.cs
- RuleSettings.cs
- BezierSegment.cs
- PropertyHelper.cs
- SqlEnums.cs
- PageBuildProvider.cs
- TextPointerBase.cs
- UnsafeNativeMethods.cs
- MiniMapControl.xaml.cs
- DragDrop.cs
- TypeDescriptionProvider.cs
- Parser.cs
- DrawToolTipEventArgs.cs
- SetStateEventArgs.cs
- EntityDataSourceWrapperCollection.cs