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
- FamilyTypefaceCollection.cs
- LogArchiveSnapshot.cs
- DEREncoding.cs
- DetailsViewRow.cs
- EntityProviderFactory.cs
- DocumentApplicationState.cs
- StateManagedCollection.cs
- ValidatorCollection.cs
- XmlNodeChangedEventManager.cs
- EventWaitHandleSecurity.cs
- QilScopedVisitor.cs
- KnownTypes.cs
- RoleGroupCollection.cs
- PeerObject.cs
- MachineKeyConverter.cs
- CroppedBitmap.cs
- TwoPhaseCommit.cs
- RegexCompilationInfo.cs
- Property.cs
- RuntimeConfigLKG.cs
- ConnectionStringSettingsCollection.cs
- ColorContext.cs
- SystemFonts.cs
- AppDomainEvidenceFactory.cs
- SigningCredentials.cs
- OleDbCommand.cs
- TextEditor.cs
- WorkflowOperationBehavior.cs
- processwaithandle.cs
- WebPartsSection.cs
- XsltOutput.cs
- DbParameterCollectionHelper.cs
- SafeSecurityHelper.cs
- TextFindEngine.cs
- MergePropertyDescriptor.cs
- DesignParameter.cs
- StoreContentChangedEventArgs.cs
- Listbox.cs
- DataSourceProvider.cs
- InfoCardBaseException.cs
- DataGridViewLinkColumn.cs
- UserControl.cs
- NonBatchDirectoryCompiler.cs
- CannotUnloadAppDomainException.cs
- ProfileService.cs
- SolidColorBrush.cs
- EventListenerClientSide.cs
- HtmlTernaryTree.cs
- CommandValueSerializer.cs
- HtmlInputButton.cs
- TextEffect.cs
- ELinqQueryState.cs
- AppDomainUnloadedException.cs
- SafeNativeMethodsCLR.cs
- PrivilegedConfigurationManager.cs
- PropertyPushdownHelper.cs
- ImpersonateTokenRef.cs
- PKCS1MaskGenerationMethod.cs
- ProviderBase.cs
- Accessible.cs
- FilterElement.cs
- WebBrowserEvent.cs
- TemplatePropertyEntry.cs
- BinHexDecoder.cs
- DataTableReader.cs
- EntitySetBaseCollection.cs
- OrthographicCamera.cs
- ConfigurationElementProperty.cs
- LocationEnvironment.cs
- SimpleType.cs
- SimpleHandlerFactory.cs
- XamlStream.cs
- CodeTypeMemberCollection.cs
- ActivityExecutionFilter.cs
- PrintDialog.cs
- DrawingContext.cs
- CopyCodeAction.cs
- RepeaterItem.cs
- DashStyles.cs
- ThicknessAnimationUsingKeyFrames.cs
- ExpressionVisitorHelpers.cs
- ListViewItemCollectionEditor.cs
- SimpleType.cs
- StyleTypedPropertyAttribute.cs
- ConfigurationManagerInternal.cs
- NamedPipeProcessProtocolHandler.cs
- DiagnosticsConfigurationHandler.cs
- RegionIterator.cs
- SqlRowUpdatingEvent.cs
- _SSPIWrapper.cs
- MailMessageEventArgs.cs
- XmlElementList.cs
- XmlWriterSettings.cs
- DataService.cs
- TypeResolver.cs
- StrongName.cs
- ZipIOExtraFieldPaddingElement.cs
- IntegrationExceptionEventArgs.cs
- EntityDataSourceView.cs
- PropertyDescriptorCollection.cs