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
- CloudCollection.cs
- BaseAsyncResult.cs
- SingleKeyFrameCollection.cs
- FileVersion.cs
- Binding.cs
- Model3DCollection.cs
- WebPartMinimizeVerb.cs
- SizeConverter.cs
- RelatedImageListAttribute.cs
- CodeBlockBuilder.cs
- InstalledFontCollection.cs
- PointHitTestParameters.cs
- OleAutBinder.cs
- ConfigurationManagerHelperFactory.cs
- ProfileService.cs
- SplineKeyFrames.cs
- ChameleonKey.cs
- SafeNativeMethods.cs
- EntityCommandExecutionException.cs
- AnimationClockResource.cs
- Normalization.cs
- SessionState.cs
- HideDisabledControlAdapter.cs
- FormsAuthenticationTicket.cs
- LayoutInformation.cs
- BoundPropertyEntry.cs
- MarkupObject.cs
- OdbcConnectionOpen.cs
- DataObjectSettingDataEventArgs.cs
- ErrorWrapper.cs
- RSAPKCS1SignatureDeformatter.cs
- ObjectDataSourceChooseTypePanel.cs
- DataGridViewColumnEventArgs.cs
- LazyTextWriterCreator.cs
- DataGridViewCellValidatingEventArgs.cs
- IPGlobalProperties.cs
- cryptoapiTransform.cs
- XhtmlBasicLabelAdapter.cs
- WebPartsPersonalization.cs
- AccessKeyManager.cs
- TypeValidationEventArgs.cs
- MenuAdapter.cs
- SqlReorderer.cs
- ClientUtils.cs
- ExpandCollapseProviderWrapper.cs
- TraceUtils.cs
- PropertyEmitter.cs
- UpDownEvent.cs
- AlphaSortedEnumConverter.cs
- RTLAwareMessageBox.cs
- EncodingDataItem.cs
- OleDbCommand.cs
- FlowPanelDesigner.cs
- XmlLinkedNode.cs
- UmAlQuraCalendar.cs
- DeadCharTextComposition.cs
- BaseValidator.cs
- PersistenceProviderElement.cs
- NotSupportedException.cs
- EncoderExceptionFallback.cs
- GridViewPageEventArgs.cs
- followingquery.cs
- RegexParser.cs
- ModelChangedEventArgsImpl.cs
- wgx_exports.cs
- Cursors.cs
- ThemeDirectoryCompiler.cs
- ActivitySurrogateSelector.cs
- HitTestDrawingContextWalker.cs
- ArgumentValueSerializer.cs
- Composition.cs
- XPathMultyIterator.cs
- XmlIlTypeHelper.cs
- regiisutil.cs
- RegexInterpreter.cs
- HttpConfigurationContext.cs
- ToolStripMenuItem.cs
- OutgoingWebRequestContext.cs
- UnsafeNativeMethods.cs
- KeyNotFoundException.cs
- Error.cs
- DriveInfo.cs
- CapabilitiesState.cs
- Predicate.cs
- FixedFindEngine.cs
- HtmlUtf8RawTextWriter.cs
- ExpressionCopier.cs
- TraceContextEventArgs.cs
- SetterBaseCollection.cs
- PictureBox.cs
- CustomTokenProvider.cs
- StickyNote.cs
- ResponseStream.cs
- GAC.cs
- XmlCharCheckingReader.cs
- TraceEventCache.cs
- ColorBlend.cs
- Pens.cs
- Image.cs
- LocalBuilder.cs