Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / Microsoft / Win32 / SafeHandles / safePerfProviderHandle.cs / 1305376 / safePerfProviderHandle.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace Microsoft.Win32.SafeHandles { using System; using System.Threading; using System.Diagnostics; using Microsoft.Win32; using Microsoft.Win32.SafeHandles; //// #pragma warning disable 618 // Have not migrated to v4 transparency yet [System.Security.SecurityCritical(System.Security.SecurityCriticalScope.Everything)] #pragma warning restore 618 internal sealed class SafePerfProviderHandle : SafeHandleZeroOrMinusOneIsInvalid { private SafePerfProviderHandle() : base(true) {} protected override bool ReleaseHandle() { IntPtr tempProviderHandle = handle; if (Interlocked.Exchange(ref handle, IntPtr.Zero) != IntPtr.Zero) { uint Status = UnsafeNativeMethods.PerfStopProvider(tempProviderHandle); Debug.Assert(Status == (uint)UnsafeNativeMethods.ERROR_SUCCESS, "PerfStopProvider() fails"); // ERROR_INVALID_PARAMETER } 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
- DataControlImageButton.cs
- ServiceContractViewControl.Designer.cs
- EncoderReplacementFallback.cs
- _WebProxyDataBuilder.cs
- CursorConverter.cs
- SqlCacheDependencyDatabaseCollection.cs
- X500Name.cs
- ArrangedElement.cs
- PopupRootAutomationPeer.cs
- EmbossBitmapEffect.cs
- TcpPortSharing.cs
- ErrorEventArgs.cs
- DbSource.cs
- EUCJPEncoding.cs
- FormViewInsertedEventArgs.cs
- ResponseBodyWriter.cs
- SystemDiagnosticsSection.cs
- DataServiceQuery.cs
- HttpDebugHandler.cs
- RealProxy.cs
- RolePrincipal.cs
- TemplateGroupCollection.cs
- IDispatchConstantAttribute.cs
- SortQuery.cs
- MouseBinding.cs
- LogExtent.cs
- PasswordTextContainer.cs
- ShapeTypeface.cs
- Win32MouseDevice.cs
- LoginView.cs
- ErrorRuntimeConfig.cs
- BindingContext.cs
- DivideByZeroException.cs
- HttpResponse.cs
- HierarchicalDataTemplate.cs
- KeyedHashAlgorithm.cs
- XPathExpr.cs
- MimeTypePropertyAttribute.cs
- EntityViewGenerationAttribute.cs
- MetadataItemCollectionFactory.cs
- ClientSettingsProvider.cs
- CatalogZoneBase.cs
- XhtmlBasicCommandAdapter.cs
- MatrixTransform.cs
- CollectionView.cs
- QueryOutputWriterV1.cs
- EditingMode.cs
- KeyPressEvent.cs
- ToolStripRendererSwitcher.cs
- MenuTracker.cs
- SingleKeyFrameCollection.cs
- ImageSource.cs
- DataServiceProviderWrapper.cs
- Keywords.cs
- ExpressionPrefixAttribute.cs
- GridViewSortEventArgs.cs
- EntityDataSourceReferenceGroup.cs
- SystemResourceKey.cs
- ListViewInsertedEventArgs.cs
- NativeCompoundFileAPIs.cs
- OLEDB_Util.cs
- FixedFlowMap.cs
- ProtectedConfigurationProviderCollection.cs
- FixedSOMLineRanges.cs
- DispatchWrapper.cs
- SecurityDocument.cs
- DesignerProperties.cs
- CellTreeNode.cs
- SignatureToken.cs
- MemberMaps.cs
- IRCollection.cs
- RSAPKCS1SignatureDeformatter.cs
- XmlEventCache.cs
- CompoundFileReference.cs
- DispatcherTimer.cs
- RelatedView.cs
- PropertyPath.cs
- BuiltInExpr.cs
- AuthenticationSection.cs
- TargetConverter.cs
- ProtocolsSection.cs
- InvalidComObjectException.cs
- DataGridViewColumnStateChangedEventArgs.cs
- HtmlAnchor.cs
- DiscoveryClientElement.cs
- FrameworkElementAutomationPeer.cs
- DataSourceHelper.cs
- AccessDataSourceView.cs
- RepeaterItem.cs
- iisPickupDirectory.cs
- WindowsGraphics.cs
- ExtensibleClassFactory.cs
- XXXInfos.cs
- ProcessHostServerConfig.cs
- CaseExpr.cs
- ChildDocumentBlock.cs
- NullableDoubleSumAggregationOperator.cs
- HttpHandlersSection.cs
- HttpWebResponse.cs
- _ScatterGatherBuffers.cs