Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / tx / System / Transactions / Oletx / CoTaskMemHandle.cs / 1305376 / CoTaskMemHandle.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.Transactions.Oletx { using System; using System.Runtime.ConstrainedExecution; using System.Runtime.InteropServices; using System.Security; internal sealed class CoTaskMemHandle : SafeHandle { // FXCop is complaining because we don't have any callers to the constructor. But they are created by COMInterop when we use them // as "out" parameters to calls to the proxy shim interfaces. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] public CoTaskMemHandle() : base(IntPtr.Zero, true) { } public override bool IsInvalid { get { return IsClosed || this.handle == IntPtr.Zero; } } /* [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] [DllImport("ole32.dll", EntryPoint="CoTaskMemAlloc"), SuppressUnmanagedCodeSecurity] public static extern CoTaskMemHandle Alloc(IntPtr size); */ [DllImport("ole32.dll"), SuppressUnmanagedCodeSecurity, ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] private static extern void CoTaskMemFree(IntPtr ptr); override protected bool ReleaseHandle() { CoTaskMemFree(this.handle); return true; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- BaseProcessor.cs
- ValidationErrorCollection.cs
- RequestReplyCorrelator.cs
- RegistryPermission.cs
- InstanceLockTracking.cs
- EntityClassGenerator.cs
- _LocalDataStoreMgr.cs
- SafeMILHandle.cs
- ListViewPagedDataSource.cs
- FunctionDefinition.cs
- Model3DGroup.cs
- CodePageEncoding.cs
- ParseChildrenAsPropertiesAttribute.cs
- InheritablePropertyChangeInfo.cs
- InfoCardTraceRecord.cs
- CqlIdentifiers.cs
- WeakReference.cs
- NameValueFileSectionHandler.cs
- ReadOnlyDataSourceView.cs
- WindowsGraphics.cs
- OutputScope.cs
- TemplateControl.cs
- WebPartChrome.cs
- TableLayoutRowStyleCollection.cs
- DataGridViewRowPrePaintEventArgs.cs
- MSG.cs
- UseLicense.cs
- Event.cs
- XXXOnTypeBuilderInstantiation.cs
- ContentElement.cs
- HostingEnvironmentException.cs
- FileSystemEnumerable.cs
- TrackBarRenderer.cs
- XPathSelfQuery.cs
- XmlSchemaSimpleTypeRestriction.cs
- TrustSection.cs
- HebrewCalendar.cs
- XamlToRtfWriter.cs
- ConstraintConverter.cs
- UIElementParaClient.cs
- FormsAuthenticationUserCollection.cs
- pingexception.cs
- cryptoapiTransform.cs
- MachineKeyConverter.cs
- DataControlFieldHeaderCell.cs
- ParserExtension.cs
- ActivityDesignerAccessibleObject.cs
- CompilationUnit.cs
- WebPartCatalogCloseVerb.cs
- EmptyReadOnlyDictionaryInternal.cs
- shaperfactory.cs
- DialogResultConverter.cs
- ModelService.cs
- EntityException.cs
- Style.cs
- ConnectionStringsExpressionBuilder.cs
- ScrollProperties.cs
- OverrideMode.cs
- DataGridViewButtonColumn.cs
- DetailsViewPagerRow.cs
- HtmlImage.cs
- StyleXamlParser.cs
- XsdBuilder.cs
- MediaPlayer.cs
- QfeChecker.cs
- DocumentPageTextView.cs
- PerformanceCounterPermissionAttribute.cs
- TableLayoutStyleCollection.cs
- KeyedHashAlgorithm.cs
- XmlSerializerAssemblyAttribute.cs
- Overlapped.cs
- TableNameAttribute.cs
- UdpDiscoveryEndpoint.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- ETagAttribute.cs
- IxmlLineInfo.cs
- AsyncContentLoadedEventArgs.cs
- SpeechRecognitionEngine.cs
- NotImplementedException.cs
- EntityCollection.cs
- AmbientEnvironment.cs
- ProtocolsConfigurationHandler.cs
- Tokenizer.cs
- WrappedReader.cs
- ConstantExpression.cs
- DocumentReferenceCollection.cs
- CatalogPartCollection.cs
- DiagnosticTraceSource.cs
- BuildManager.cs
- IPipelineRuntime.cs
- VsPropertyGrid.cs
- Color.cs
- StatementContext.cs
- DataControlFieldHeaderCell.cs
- ParameterCollection.cs
- AccessDataSourceView.cs
- ResXBuildProvider.cs
- DbConnectionClosed.cs
- WebBrowserNavigatingEventHandler.cs
- DynamicAttribute.cs