Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- TextFragmentEngine.cs
- SelectionEditor.cs
- HTMLTextWriter.cs
- SamlNameIdentifierClaimResource.cs
- HttpStaticObjectsCollectionWrapper.cs
- CookieHandler.cs
- SafeLibraryHandle.cs
- NativeWindow.cs
- ListViewHitTestInfo.cs
- Hex.cs
- ClientSideProviderDescription.cs
- XmlNode.cs
- RegionIterator.cs
- Vector3DAnimation.cs
- ObjectCacheSettings.cs
- MasterPage.cs
- StaticResourceExtension.cs
- Cursors.cs
- LogWriteRestartAreaAsyncResult.cs
- FlowDocument.cs
- ClientSettings.cs
- FieldTemplateUserControl.cs
- HttpValueCollection.cs
- PlacementWorkspace.cs
- HtmlInputReset.cs
- UnmanagedMemoryStream.cs
- TransactionProtocolConverter.cs
- RenderContext.cs
- Comparer.cs
- SortableBindingList.cs
- SiteMapPath.cs
- LogWriteRestartAreaState.cs
- ContractValidationHelper.cs
- DesignerVerb.cs
- Helper.cs
- CriticalHandle.cs
- PropertyTabAttribute.cs
- ChtmlTextWriter.cs
- MethodRental.cs
- FrameworkElementFactory.cs
- ActivationArguments.cs
- WindowsAuthenticationModule.cs
- HandlerFactoryCache.cs
- IssuerInformation.cs
- SelectedDatesCollection.cs
- QueryableDataSource.cs
- IRCollection.cs
- Run.cs
- PermissionToken.cs
- XmlSerializerAssemblyAttribute.cs
- CodeTypeOfExpression.cs
- HistoryEventArgs.cs
- DataServiceBehavior.cs
- ViewStateChangedEventArgs.cs
- UserPersonalizationStateInfo.cs
- InputLangChangeEvent.cs
- AttributeUsageAttribute.cs
- RawAppCommandInputReport.cs
- StoreContentChangedEventArgs.cs
- FileSystemInfo.cs
- ProfilePropertyNameValidator.cs
- GlobalProxySelection.cs
- HwndHost.cs
- DbConnectionPoolCounters.cs
- ParentQuery.cs
- CaseInsensitiveHashCodeProvider.cs
- WsatConfiguration.cs
- Trace.cs
- XmlUtilWriter.cs
- XsdBuilder.cs
- DetailsViewDeletedEventArgs.cs
- XsdBuildProvider.cs
- DynamicObjectAccessor.cs
- Marshal.cs
- StructureChangedEventArgs.cs
- PersistenceTask.cs
- TextTreeFixupNode.cs
- XsltLibrary.cs
- PinnedBufferMemoryStream.cs
- BamlRecordWriter.cs
- ZoneMembershipCondition.cs
- InputReport.cs
- RichTextBoxConstants.cs
- SoapIgnoreAttribute.cs
- ResourceManager.cs
- MsdtcWrapper.cs
- SHA256.cs
- DrawingGroupDrawingContext.cs
- DataGridViewRowHeightInfoNeededEventArgs.cs
- DataGridViewComboBoxColumn.cs
- SeparatorAutomationPeer.cs
- MDIClient.cs
- SchemaElementLookUpTable.cs
- CatalogPartCollection.cs
- WindowClosedEventArgs.cs
- FormatVersion.cs
- XmlNodeList.cs
- RepeaterItemEventArgs.cs
- NetNamedPipeSecurityMode.cs
- CharEnumerator.cs