Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Shared / MS / Internal / securitycriticaldata.cs / 1305600 / 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
- DependencyPropertyChangedEventArgs.cs
- AvtEvent.cs
- DBSchemaTable.cs
- EditCommandColumn.cs
- WebPartCollection.cs
- TransformGroup.cs
- Avt.cs
- FakeModelPropertyImpl.cs
- CollaborationHelperFunctions.cs
- XPathAncestorIterator.cs
- KeyInfo.cs
- XmlQueryStaticData.cs
- ProviderUtil.cs
- ConfigXmlWhitespace.cs
- WindowsStatic.cs
- FormViewPageEventArgs.cs
- SafeHGlobalHandleCritical.cs
- WizardPanel.cs
- TextStore.cs
- IgnoreSection.cs
- MessageSecurityVersionConverter.cs
- ControlBuilderAttribute.cs
- XsdBuildProvider.cs
- SafeRegistryHandle.cs
- SQLByte.cs
- WebServiceData.cs
- EntityDataSourceWrapperPropertyDescriptor.cs
- CombinedGeometry.cs
- XmlAttribute.cs
- DatePickerAutomationPeer.cs
- WindowsGraphics2.cs
- PeerNameRegistration.cs
- Pair.cs
- PassportIdentity.cs
- InheritanceContextHelper.cs
- ALinqExpressionVisitor.cs
- ToolStripRenderer.cs
- ReferencedAssemblyResolver.cs
- SerializeAbsoluteContext.cs
- DataGridViewCellStateChangedEventArgs.cs
- ReadOnlyHierarchicalDataSource.cs
- ParallelTimeline.cs
- CodeExporter.cs
- TextServicesCompartmentContext.cs
- ETagAttribute.cs
- StringArrayConverter.cs
- DesignerDataParameter.cs
- CodeDirectoryCompiler.cs
- TransformerTypeCollection.cs
- ChannelDemuxer.cs
- ButtonBaseAutomationPeer.cs
- OracleConnection.cs
- UrlPath.cs
- DesignTimeSiteMapProvider.cs
- Rule.cs
- ApplicationManager.cs
- StorageEntitySetMapping.cs
- DataSourceCacheDurationConverter.cs
- PersonalizableAttribute.cs
- Transform3D.cs
- EntryIndex.cs
- SymbolDocumentInfo.cs
- DesignerActionTextItem.cs
- RenamedEventArgs.cs
- FormViewUpdatedEventArgs.cs
- isolationinterop.cs
- RequestQueryProcessor.cs
- GridItem.cs
- OdbcErrorCollection.cs
- SnapshotChangeTrackingStrategy.cs
- InvokeCompletedEventArgs.cs
- ReadOnlyDataSource.cs
- RenameRuleObjectDialog.cs
- Int16Storage.cs
- EmptyEnumerable.cs
- PerspectiveCamera.cs
- WaitForChangedResult.cs
- DataServiceRequestOfT.cs
- WorkflowMessageEventHandler.cs
- ImageMap.cs
- HostingPreferredMapPath.cs
- LogSwitch.cs
- NativeMethods.cs
- URI.cs
- CodeTypeDelegate.cs
- CacheSection.cs
- SpecialNameAttribute.cs
- mediaclock.cs
- TrackingProfileDeserializationException.cs
- DispatcherFrame.cs
- SmiEventStream.cs
- FacetChecker.cs
- ProjectionCamera.cs
- QueueProcessor.cs
- ProgressChangedEventArgs.cs
- GridViewColumnHeaderAutomationPeer.cs
- DynamicUpdateCommand.cs
- HttpAsyncResult.cs
- TextEditorContextMenu.cs
- HttpRequest.cs