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
- ControlIdConverter.cs
- ThemeableAttribute.cs
- _ContextAwareResult.cs
- Double.cs
- KernelTypeValidation.cs
- TickBar.cs
- StorageEntityContainerMapping.cs
- SqlMethodCallConverter.cs
- XamlSerializationHelper.cs
- RequestCachePolicy.cs
- Stack.cs
- Oid.cs
- PenLineJoinValidation.cs
- ApplicationInfo.cs
- MatrixStack.cs
- TextEditorParagraphs.cs
- EdmSchemaAttribute.cs
- TextServicesLoader.cs
- ServicePointManager.cs
- RegexStringValidator.cs
- DataSvcMapFile.cs
- ElementMarkupObject.cs
- RuntimeHandles.cs
- CodeAttributeDeclaration.cs
- BitmapMetadataEnumerator.cs
- ElementInit.cs
- ReferenceService.cs
- DurableInstanceManager.cs
- _StreamFramer.cs
- GridViewColumnHeaderAutomationPeer.cs
- TrackingMemoryStream.cs
- AssemblyResourceLoader.cs
- LabelEditEvent.cs
- TransferRequestHandler.cs
- FlowLayoutPanelDesigner.cs
- SingleSelectRootGridEntry.cs
- SynchronizedDispatch.cs
- Range.cs
- NotImplementedException.cs
- XsdDataContractImporter.cs
- ConvertersCollection.cs
- InfiniteTimeSpanConverter.cs
- ImageBrush.cs
- ListViewUpdateEventArgs.cs
- IgnoreSectionHandler.cs
- DataListItemCollection.cs
- CharacterBuffer.cs
- NodeCounter.cs
- XmlEntityReference.cs
- CodePageEncoding.cs
- RegexMatchCollection.cs
- UnsafeMethods.cs
- XmlIlVisitor.cs
- RemotingServices.cs
- sqlpipe.cs
- ReflectionHelper.cs
- TextWriter.cs
- NeutralResourcesLanguageAttribute.cs
- RegionIterator.cs
- SerializationFieldInfo.cs
- SqlCharStream.cs
- Sql8ConformanceChecker.cs
- TextTreePropertyUndoUnit.cs
- MergeFilterQuery.cs
- Metadata.cs
- CollectionDataContract.cs
- BevelBitmapEffect.cs
- InputProcessorProfiles.cs
- DataProtectionSecurityStateEncoder.cs
- WmlControlAdapter.cs
- TrayIconDesigner.cs
- HybridObjectCache.cs
- ProjectionPruner.cs
- LongTypeConverter.cs
- SimpleBitVector32.cs
- StrokeCollectionDefaultValueFactory.cs
- AssemblyBuilderData.cs
- DifferencingCollection.cs
- Crc32.cs
- XhtmlBasicPageAdapter.cs
- ComponentGuaranteesAttribute.cs
- DateTimeSerializationSection.cs
- PathSegmentCollection.cs
- localization.cs
- ToolBarOverflowPanel.cs
- WebBrowserNavigatingEventHandler.cs
- DataSourceViewSchemaConverter.cs
- ToggleButtonAutomationPeer.cs
- SemaphoreFullException.cs
- DBConnection.cs
- DesignConnection.cs
- FlowDocumentPaginator.cs
- BindingExpressionBase.cs
- GenericWebPart.cs
- DataError.cs
- SrgsOneOf.cs
- ExtendedPropertiesHandler.cs
- StyleHelper.cs
- DataGridPageChangedEventArgs.cs
- ProviderSettings.cs