Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / Log / System / IO / Log / CoTaskMemHandle.cs / 1305376 / CoTaskMemHandle.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.IO.Log { using System; using System.Runtime.InteropServices; using System.Runtime.ConstrainedExecution; using System.Runtime.Versioning; using System.Security; internal sealed class CoTaskMemHandle : SafeHandle { public CoTaskMemHandle() : base(IntPtr.Zero, true) { } public override bool IsInvalid { get { return IsClosed || this.handle == IntPtr.Zero; } } [DllImport("ole32.dll"), SuppressUnmanagedCodeSecurity, ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] [ResourceExposure(ResourceScope.None)] 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. //------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.IO.Log { using System; using System.Runtime.InteropServices; using System.Runtime.ConstrainedExecution; using System.Runtime.Versioning; using System.Security; internal sealed class CoTaskMemHandle : SafeHandle { public CoTaskMemHandle() : base(IntPtr.Zero, true) { } public override bool IsInvalid { get { return IsClosed || this.handle == IntPtr.Zero; } } [DllImport("ole32.dll"), SuppressUnmanagedCodeSecurity, ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] [ResourceExposure(ResourceScope.None)] 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
- OdbcCommandBuilder.cs
- Contracts.cs
- MarkedHighlightComponent.cs
- IndependentAnimationStorage.cs
- ConfigXmlElement.cs
- precedingsibling.cs
- TableRowGroup.cs
- SqlBulkCopyColumnMapping.cs
- CallInfo.cs
- TypeConverterAttribute.cs
- TreeNode.cs
- Opcode.cs
- TextServicesCompartmentEventSink.cs
- SHA1CryptoServiceProvider.cs
- EventHandlersStore.cs
- ExpandoClass.cs
- DependencyPropertyKind.cs
- SyndicationLink.cs
- InputManager.cs
- KeyProperty.cs
- FormsIdentity.cs
- QueryCacheManager.cs
- ScriptRegistrationManager.cs
- IsolationInterop.cs
- DataGridRowEventArgs.cs
- RSAPKCS1SignatureFormatter.cs
- ResourceAssociationType.cs
- TextTreeRootTextBlock.cs
- SecureStringHasher.cs
- TrustSection.cs
- Activation.cs
- RequestNavigateEventArgs.cs
- PaintValueEventArgs.cs
- QilGeneratorEnv.cs
- ToolBarButton.cs
- DrawListViewSubItemEventArgs.cs
- IRCollection.cs
- NonVisualControlAttribute.cs
- TextEncodedRawTextWriter.cs
- DocumentsTrace.cs
- DBConnectionString.cs
- AuthenticatingEventArgs.cs
- RawMouseInputReport.cs
- StateDesigner.cs
- TypeUtil.cs
- ObjectDataProvider.cs
- Constraint.cs
- RemoteEndpointMessageProperty.cs
- Fonts.cs
- ActiveXMessageFormatter.cs
- DataRecordInfo.cs
- CustomErrorCollection.cs
- ActionFrame.cs
- WebPartManagerInternals.cs
- HandlerWithFactory.cs
- ViewStateModeByIdAttribute.cs
- SaveFileDialog.cs
- ShaderRenderModeValidation.cs
- PingReply.cs
- Vector3DAnimation.cs
- ClusterRegistryConfigurationProvider.cs
- sapiproxy.cs
- TaskFormBase.cs
- Clipboard.cs
- ScrollContentPresenter.cs
- SBCSCodePageEncoding.cs
- SerialReceived.cs
- ItemContainerGenerator.cs
- DataGridViewCellCollection.cs
- JsonGlobals.cs
- XPathDocument.cs
- NavigationCommands.cs
- MsmqIntegrationReceiveParameters.cs
- WorkflowTransactionService.cs
- DtrList.cs
- AspNetCompatibilityRequirementsMode.cs
- ToolStripItemImageRenderEventArgs.cs
- ObjectRef.cs
- MonthChangedEventArgs.cs
- CookieProtection.cs
- TextServicesContext.cs
- SqlErrorCollection.cs
- XmlHierarchicalEnumerable.cs
- WindowVisualStateTracker.cs
- DbParameterCollection.cs
- Logging.cs
- UnauthorizedAccessException.cs
- SecurityException.cs
- CalendarItem.cs
- ListGeneralPage.cs
- BinaryObjectReader.cs
- CssTextWriter.cs
- FilteredReadOnlyMetadataCollection.cs
- XslAst.cs
- EdmComplexPropertyAttribute.cs
- Util.cs
- MdiWindowListItemConverter.cs
- AssertUtility.cs
- XmlArrayAttribute.cs
- StrokeIntersection.cs