Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / SMDiagnostics / System / ServiceModel / Diagnostics / Utility.cs / 1305376 / Utility.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.ServiceModel.Diagnostics { using System.Runtime; using System.Runtime.CompilerServices; using System.Runtime.ConstrainedExecution; using System.Diagnostics; using System.Threading; using System.Runtime.InteropServices; using System.Security; using System.Security.Permissions; using System.Diagnostics.CodeAnalysis; class Utility { ExceptionUtility exceptionUtility; [Obsolete("For SMDiagnostics.dll use only. Call DiagnosticUtility.Utility instead")] internal Utility(ExceptionUtility exceptionUtility) { this.exceptionUtility = exceptionUtility; } // Call this when a p/invoke with an 'out SafeHandle' parameter returns an error. This will safely clean up the handle. internal static void CloseInvalidOutSafeHandle(SafeHandle handle) { // Workaround for 64-bit CLR bug VSWhidbey 546830 - sometimes invalid SafeHandles come back null. if (handle != null) { #pragma warning disable 618 AssertUtility.DebugAssert(handle.IsInvalid, "CloseInvalidOutSafeHandle called with a valid handle!"); #pragma warning restore 618 // Calls SuppressFinalize. handle.SetHandleAsInvalid(); } } // Copy of the above for CriticalHandles. internal static void CloseInvalidOutCriticalHandle(CriticalHandle handle) { if (handle != null) { #pragma warning disable 618 AssertUtility.DebugAssert(handle.IsInvalid, "CloseInvalidOutCriticalHandle called with a valid handle!"); #pragma warning restore 618 handle.SetHandleAsInvalid(); } } internal Guid CreateGuid(string guidString) { return Fx.CreateGuid(guidString); } internal bool TryCreateGuid(string guidString, out Guid result) { return Fx.TryCreateGuid(guidString, out result); } internal byte[] AllocateByteArray(int size) { return Fx.AllocateByteArray(size); } internal char[] AllocateCharArray(int size) { return Fx.AllocateCharArray(size); } } } // 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
- AssemblyInfo.cs
- HotSpotCollection.cs
- MILUtilities.cs
- Control.cs
- ConfigXmlAttribute.cs
- _ListenerResponseStream.cs
- WindowsIPAddress.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- DataGridRelationshipRow.cs
- FrugalMap.cs
- Vector.cs
- PipelineModuleStepContainer.cs
- COM2AboutBoxPropertyDescriptor.cs
- XmlSchemaObjectTable.cs
- CounterSample.cs
- CodeSnippetExpression.cs
- EtwProvider.cs
- DynamicActionMessageFilter.cs
- DrawingGroup.cs
- EventRecord.cs
- XmlWellformedWriterHelpers.cs
- ConsumerConnectionPointCollection.cs
- RenderDataDrawingContext.cs
- ExpressionBindingCollection.cs
- RegexNode.cs
- RuntimeConfigLKG.cs
- UidPropertyAttribute.cs
- SiteMapNode.cs
- StatusBarAutomationPeer.cs
- StorageEntitySetMapping.cs
- ElementsClipboardData.cs
- EntityParameter.cs
- RtType.cs
- DesignerActionHeaderItem.cs
- DataGridViewAutoSizeModeEventArgs.cs
- LoginName.cs
- WebPartVerbCollection.cs
- PropertyDescriptorComparer.cs
- RequestBringIntoViewEventArgs.cs
- EdgeModeValidation.cs
- CompiledELinqQueryState.cs
- MetadataUtilsSmi.cs
- LostFocusEventManager.cs
- TextOutput.cs
- precedingsibling.cs
- METAHEADER.cs
- RtfControls.cs
- ConfigurationManagerInternalFactory.cs
- Baml6Assembly.cs
- MeasurementDCInfo.cs
- HtmlInputButton.cs
- SingleConverter.cs
- HttpProfileBase.cs
- SimpleBitVector32.cs
- GenericEnumConverter.cs
- WebPartsSection.cs
- Model3DGroup.cs
- CategoryGridEntry.cs
- ExceptionDetail.cs
- SoapSchemaMember.cs
- TaskFileService.cs
- TextEditorDragDrop.cs
- ForeignConstraint.cs
- DetailsViewRow.cs
- CollectionViewSource.cs
- ChtmlTextBoxAdapter.cs
- EntityAdapter.cs
- ZipIOBlockManager.cs
- LayoutExceptionEventArgs.cs
- ResumeStoryboard.cs
- ValidationRuleCollection.cs
- AsyncResult.cs
- DataGridView.cs
- metadatamappinghashervisitor.hashsourcebuilder.cs
- DoubleUtil.cs
- WebServiceFault.cs
- RootProfilePropertySettingsCollection.cs
- FontNamesConverter.cs
- Currency.cs
- PropertyMetadata.cs
- CodeSnippetStatement.cs
- JulianCalendar.cs
- EntityDesignerBuildProvider.cs
- DataDesignUtil.cs
- SizeKeyFrameCollection.cs
- ObjectListShowCommandsEventArgs.cs
- ServiceHttpHandlerFactory.cs
- ListControl.cs
- StorageRoot.cs
- WebAdminConfigurationHelper.cs
- AssemblyCache.cs
- PrintControllerWithStatusDialog.cs
- Image.cs
- WebRequest.cs
- XsltSettings.cs
- WebEventCodes.cs
- WebEventTraceProvider.cs
- UnSafeCharBuffer.cs
- ScrollViewerAutomationPeer.cs
- Size.cs