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
- WorkflowRequestContext.cs
- SQLBinaryStorage.cs
- HttpCacheVary.cs
- Graphics.cs
- PathSegmentCollection.cs
- SqlConnectionStringBuilder.cs
- CursorInteropHelper.cs
- HttpVersion.cs
- XmlCharCheckingReader.cs
- ContainerSelectorGlyph.cs
- DBConnectionString.cs
- DataGridViewRowContextMenuStripNeededEventArgs.cs
- Fonts.cs
- NamespaceDecl.cs
- Light.cs
- XmlWrappingWriter.cs
- ManipulationBoundaryFeedbackEventArgs.cs
- TextLineResult.cs
- TransactionFlowBindingElement.cs
- SByteStorage.cs
- BitmapEffectDrawingContextState.cs
- XmlParserContext.cs
- MenuItemCollectionEditorDialog.cs
- MouseActionConverter.cs
- AesCryptoServiceProvider.cs
- BindingMAnagerBase.cs
- Schema.cs
- TdsEnums.cs
- AutomationProperties.cs
- OracleSqlParser.cs
- SessionState.cs
- DateTimeOffsetStorage.cs
- AttachmentCollection.cs
- AssociationSetMetadata.cs
- TypeReference.cs
- ConfigurationSection.cs
- SafeNativeMethods.cs
- DataRowChangeEvent.cs
- IconConverter.cs
- ContentIterators.cs
- ManagedCodeMarkers.cs
- ChannelOptions.cs
- WpfXamlType.cs
- CodeSubDirectoriesCollection.cs
- EntitySqlQueryCacheKey.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- AutomationPropertyInfo.cs
- DataGridViewColumnHeaderCell.cs
- DependencyPropertyKind.cs
- XmlSerializationWriter.cs
- RecipientInfo.cs
- BinaryObjectReader.cs
- TcpAppDomainProtocolHandler.cs
- RepeaterItemCollection.cs
- Control.cs
- TemplatePagerField.cs
- TextServicesContext.cs
- RoutedEventArgs.cs
- WindowsTooltip.cs
- ApplicationSecurityInfo.cs
- TabRenderer.cs
- XPathExpr.cs
- UnhandledExceptionEventArgs.cs
- TextServicesCompartmentContext.cs
- SettingsPropertyIsReadOnlyException.cs
- Button.cs
- TextTreeExtractElementUndoUnit.cs
- ControlPersister.cs
- XmlSchemaSimpleTypeUnion.cs
- Package.cs
- ZipIOLocalFileHeader.cs
- HMACSHA384.cs
- PassportAuthentication.cs
- LinearGradientBrush.cs
- NameValueConfigurationCollection.cs
- PeerNameRecord.cs
- SoapEnvelopeProcessingElement.cs
- Typography.cs
- BitmapEffectGroup.cs
- ScrollChangedEventArgs.cs
- InstanceKey.cs
- DbParameterCollectionHelper.cs
- SharedDp.cs
- UnknownBitmapEncoder.cs
- IsolatedStorage.cs
- FileDialogCustomPlacesCollection.cs
- ToolStripItemRenderEventArgs.cs
- SchemaElementLookUpTable.cs
- XmlSchemas.cs
- DataGridItemCollection.cs
- VectorCollectionValueSerializer.cs
- ProjectionCamera.cs
- recordstatefactory.cs
- FunctionUpdateCommand.cs
- _ListenerResponseStream.cs
- ScriptingAuthenticationServiceSection.cs
- ActiveDocumentEvent.cs
- CharUnicodeInfo.cs
- ASCIIEncoding.cs
- SocketAddress.cs