Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Shared / MS / Internal / securitycriticaldataClass.cs / 1305600 / securitycriticaldataClass.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // Description: // This is a helper struct 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. // The current implementation requires the consumer to use the data member only if IsValid is true // // History: // 10/25/05 : akaza 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 class SecurityCriticalDataClass{ /// /// Critical - as this accesses _value which is Critical. /// Safe - as the caller already got the critical value. /// [SecurityCritical, SecurityTreatAsSafe] internal SecurityCriticalDataClass(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 struct 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. // The current implementation requires the consumer to use the data member only if IsValid is true // // History: // 10/25/05 : akaza 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 class SecurityCriticalDataClass{ /// /// Critical - as this accesses _value which is Critical. /// Safe - as the caller already got the critical value. /// [SecurityCritical, SecurityTreatAsSafe] internal SecurityCriticalDataClass(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
- VisualTarget.cs
- MailDefinition.cs
- SerializableAttribute.cs
- UnsafeNativeMethods.cs
- ModifierKeysValueSerializer.cs
- ObjectViewFactory.cs
- FixedPage.cs
- ClientUrlResolverWrapper.cs
- RemotingConfigParser.cs
- XmlDownloadManager.cs
- WinEventQueueItem.cs
- BuildManager.cs
- WebPartMovingEventArgs.cs
- SchemaCompiler.cs
- InheritedPropertyChangedEventArgs.cs
- NameTable.cs
- NativeMethods.cs
- StrongNameUtility.cs
- TimeSpanConverter.cs
- TypeHelpers.cs
- webeventbuffer.cs
- CodeLinePragma.cs
- DictionarySectionHandler.cs
- FormatterConverter.cs
- TextTreeTextNode.cs
- NGCPageContentSerializerAsync.cs
- XamlPointCollectionSerializer.cs
- TripleDES.cs
- ValueQuery.cs
- InvalidComObjectException.cs
- SQLByte.cs
- UshortList2.cs
- nulltextcontainer.cs
- SecurityKeyIdentifier.cs
- Part.cs
- RequestBringIntoViewEventArgs.cs
- CompiledQuery.cs
- Bits.cs
- NetCodeGroup.cs
- X500Name.cs
- TrackBar.cs
- XdrBuilder.cs
- Button.cs
- CompositeKey.cs
- CommandDevice.cs
- XmlSchemaChoice.cs
- LineMetrics.cs
- UIElementIsland.cs
- State.cs
- WebBrowserHelper.cs
- ActivityTrace.cs
- X509CertificateCollection.cs
- CombinedGeometry.cs
- WebPartHelpVerb.cs
- HtmlControl.cs
- XmlSchemaSimpleTypeUnion.cs
- InkCanvasSelectionAdorner.cs
- HashCodeCombiner.cs
- VerifyHashRequest.cs
- DataBinder.cs
- NoneExcludedImageIndexConverter.cs
- ContextMenu.cs
- WindowExtensionMethods.cs
- Pair.cs
- RequestCache.cs
- ConnectionPointConverter.cs
- ImageAttributes.cs
- XmlNamedNodeMap.cs
- PngBitmapDecoder.cs
- SafeNativeMethodsOther.cs
- ToolBarButtonClickEvent.cs
- ResourcesGenerator.cs
- Bookmark.cs
- RuntimeConfigLKG.cs
- LinkTarget.cs
- LogStore.cs
- DbTypeMap.cs
- DefaultTraceListener.cs
- MimeBasePart.cs
- safelinkcollection.cs
- HtmlTernaryTree.cs
- DataServiceConfiguration.cs
- SplitContainer.cs
- DataSource.cs
- MsmqChannelFactoryBase.cs
- BamlLocalizationDictionary.cs
- PartitionedDataSource.cs
- FamilyTypeface.cs
- XmlSchemaSimpleTypeUnion.cs
- IApplicationTrustManager.cs
- Message.cs
- XmlEncoding.cs
- ButtonStandardAdapter.cs
- BypassElement.cs
- ListDictionary.cs
- _Win32.cs
- OutputCacheSettings.cs
- StringComparer.cs
- Clause.cs
- baseaxisquery.cs