Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- ContentElement.cs
- SecurityAlgorithmSuiteConverter.cs
- ContextMenu.cs
- XPathDocumentBuilder.cs
- TrackBarRenderer.cs
- ToolboxItemAttribute.cs
- WindowsTreeView.cs
- FilterElement.cs
- RuntimeCompatibilityAttribute.cs
- dsa.cs
- SapiAttributeParser.cs
- WorkflowInstance.cs
- SharedPersonalizationStateInfo.cs
- SourceLineInfo.cs
- XPathMessageFilter.cs
- CategoryNameCollection.cs
- PriorityQueue.cs
- ContainerActivationHelper.cs
- WebPartUtil.cs
- XamlTemplateSerializer.cs
- DocumentViewer.cs
- TargetParameterCountException.cs
- Rotation3DKeyFrameCollection.cs
- WebSysDefaultValueAttribute.cs
- HttpsChannelListener.cs
- NamespaceDecl.cs
- SizeFConverter.cs
- Expression.cs
- PenThread.cs
- DataServiceRequestException.cs
- ItemCheckEvent.cs
- Int16Animation.cs
- IIS7WorkerRequest.cs
- Freezable.cs
- EdmPropertyAttribute.cs
- InvalidAsynchronousStateException.cs
- ConfigXmlAttribute.cs
- IdentityHolder.cs
- XmlProcessingInstruction.cs
- MenuStrip.cs
- cryptoapiTransform.cs
- PropertyCondition.cs
- PersistenceTask.cs
- SystemTcpConnection.cs
- SoapTypeAttribute.cs
- PageHandlerFactory.cs
- SqlMultiplexer.cs
- CustomWebEventKey.cs
- ITextView.cs
- RoleManagerSection.cs
- TemplateBindingExpression.cs
- InvalidAsynchronousStateException.cs
- HttpApplication.cs
- CodeThrowExceptionStatement.cs
- CompModHelpers.cs
- UnsafeNetInfoNativeMethods.cs
- Page.cs
- CommonProperties.cs
- SystemUdpStatistics.cs
- ParameterToken.cs
- Int64.cs
- DataGridViewRowsAddedEventArgs.cs
- ToolZoneDesigner.cs
- BrushConverter.cs
- OperationCanceledException.cs
- FileUpload.cs
- PrintDialogException.cs
- AvTraceFormat.cs
- DataServiceHostFactory.cs
- GridViewUpdateEventArgs.cs
- ReadOnlyNameValueCollection.cs
- UnionQueryOperator.cs
- FileLoadException.cs
- WorkflowServiceHostFactory.cs
- DataConnectionHelper.cs
- Graph.cs
- Rotation3D.cs
- PermissionSetTriple.cs
- LinqToSqlWrapper.cs
- RSAPKCS1SignatureFormatter.cs
- TypedAsyncResult.cs
- PartialCachingAttribute.cs
- CollectionConverter.cs
- XmlChoiceIdentifierAttribute.cs
- ToggleButtonAutomationPeer.cs
- PathFigureCollectionConverter.cs
- XsltFunctions.cs
- XhtmlBasicPanelAdapter.cs
- ToolboxService.cs
- XmlSchemaChoice.cs
- ManagedFilter.cs
- XPathException.cs
- MediaEntryAttribute.cs
- HttpProfileBase.cs
- ParseHttpDate.cs
- NumericUpDownAcceleration.cs
- EditorBrowsableAttribute.cs
- TextElementCollection.cs
- NavigationCommands.cs
- IdentityManager.cs