Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- RectangleF.cs
- RunClient.cs
- ProfilePropertyNameValidator.cs
- EntitySetBase.cs
- DataControlReference.cs
- AsnEncodedData.cs
- InfoCardRSAPKCS1SignatureFormatter.cs
- MimePart.cs
- DatatypeImplementation.cs
- ExecutionContext.cs
- PathGradientBrush.cs
- GridViewCellAutomationPeer.cs
- ControlEvent.cs
- ImageCodecInfoPrivate.cs
- BitmapEffectState.cs
- XmlSchemas.cs
- SamlAuthenticationClaimResource.cs
- FlowLayoutSettings.cs
- XmlDictionaryReaderQuotas.cs
- PnrpPermission.cs
- SystemIcmpV6Statistics.cs
- Debug.cs
- SplineKeyFrames.cs
- ColorPalette.cs
- DataGridViewColumnHeaderCell.cs
- ClipboardProcessor.cs
- ExceptionRoutedEventArgs.cs
- TraceEventCache.cs
- DataGridTable.cs
- RightNameExpirationInfoPair.cs
- ProcessModelInfo.cs
- FormViewInsertedEventArgs.cs
- DriveInfo.cs
- EntityContainer.cs
- EnumUnknown.cs
- DataGridRow.cs
- ContractCodeDomInfo.cs
- AsyncContentLoadedEventArgs.cs
- DataSourceProvider.cs
- EmbeddedObject.cs
- ConvertTextFrag.cs
- RIPEMD160Managed.cs
- ListParaClient.cs
- URI.cs
- PeerCollaborationPermission.cs
- GestureRecognitionResult.cs
- ServiceModelEnhancedConfigurationElementCollection.cs
- DiscoveryEndpointElement.cs
- ManagementClass.cs
- ColumnWidthChangedEvent.cs
- TdsParser.cs
- DLinqColumnProvider.cs
- OptimizedTemplateContentHelper.cs
- TypeConverterAttribute.cs
- SimpleHandlerBuildProvider.cs
- KernelTypeValidation.cs
- WindowClosedEventArgs.cs
- DetailsViewDeletedEventArgs.cs
- JavaScriptSerializer.cs
- OpenTypeCommon.cs
- EntityViewContainer.cs
- PageWrapper.cs
- SponsorHelper.cs
- NavigationProperty.cs
- ConfigDefinitionUpdates.cs
- Action.cs
- EncryptedXml.cs
- TypeExtension.cs
- PtsContext.cs
- WebCategoryAttribute.cs
- FilteredReadOnlyMetadataCollection.cs
- PathSegmentCollection.cs
- ResourceDescriptionAttribute.cs
- CompositeTypefaceMetrics.cs
- querybuilder.cs
- Int64KeyFrameCollection.cs
- ColumnBinding.cs
- RSAProtectedConfigurationProvider.cs
- WebDisplayNameAttribute.cs
- DecimalStorage.cs
- DependsOnAttribute.cs
- SubclassTypeValidatorAttribute.cs
- StackBuilderSink.cs
- TimeSpanValidator.cs
- FileNotFoundException.cs
- UserInitiatedNavigationPermission.cs
- Model3DCollection.cs
- TableProviderWrapper.cs
- SelectionHighlightInfo.cs
- CompiledAction.cs
- SettingsSection.cs
- DrawingVisual.cs
- SoapBinding.cs
- ReadOnlyHierarchicalDataSourceView.cs
- ToolboxItemImageConverter.cs
- CDSCollectionETWBCLProvider.cs
- OperationSelectorBehavior.cs
- Path.cs
- SynchronizedPool.cs
- WebServiceMethodData.cs