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
- ISFClipboardData.cs
- DataTableReaderListener.cs
- DatatypeImplementation.cs
- RowType.cs
- ProviderCollection.cs
- ModelItemKeyValuePair.cs
- PermissionSet.cs
- AttributeQuery.cs
- ReachDocumentReferenceSerializer.cs
- BackoffTimeoutHelper.cs
- BitmapEffectGroup.cs
- SafeCryptHandles.cs
- DependencySource.cs
- CodeDelegateCreateExpression.cs
- ReplyAdapterChannelListener.cs
- MetadataFile.cs
- LazyInitializer.cs
- DataList.cs
- GridViewColumnHeaderAutomationPeer.cs
- OledbConnectionStringbuilder.cs
- WindowVisualStateTracker.cs
- GradientSpreadMethodValidation.cs
- CfgParser.cs
- Section.cs
- RelativeSource.cs
- StateInitialization.cs
- StylusPointCollection.cs
- XmlSignatureManifest.cs
- FillBehavior.cs
- PathFigureCollectionValueSerializer.cs
- ParagraphVisual.cs
- TakeQueryOptionExpression.cs
- HttpTransportSecurity.cs
- ParentControlDesigner.cs
- ExternalException.cs
- DeclaredTypeValidator.cs
- QilTypeChecker.cs
- CodeGenerator.cs
- CellParagraph.cs
- StickyNote.cs
- DefaultValueAttribute.cs
- ComponentFactoryHelpers.cs
- Int32Animation.cs
- SqlProviderUtilities.cs
- TrackPoint.cs
- CompositeCollectionView.cs
- MouseOverProperty.cs
- ListParaClient.cs
- EdmMember.cs
- Process.cs
- SqlFlattener.cs
- WebBrowserPermission.cs
- ProvidePropertyAttribute.cs
- DayRenderEvent.cs
- ProxyWebPartManagerDesigner.cs
- ProcessHost.cs
- SectionXmlInfo.cs
- PublishLicense.cs
- OciEnlistContext.cs
- ServiceModelSecurityTokenRequirement.cs
- RewritingSimplifier.cs
- XmlUTF8TextWriter.cs
- ProtocolViolationException.cs
- DataSourceExpressionCollection.cs
- NumberFormatter.cs
- ListView.cs
- XmlSchemaAnnotated.cs
- PageThemeCodeDomTreeGenerator.cs
- Function.cs
- IndexedDataBuffer.cs
- X509RawDataKeyIdentifierClause.cs
- ChangePassword.cs
- CheckableControlBaseAdapter.cs
- Viewport2DVisual3D.cs
- ListViewItemMouseHoverEvent.cs
- CssClassPropertyAttribute.cs
- WebPartHelpVerb.cs
- TransformConverter.cs
- ToolStripItem.cs
- MenuCommand.cs
- SafeThemeHandle.cs
- COSERVERINFO.cs
- CipherData.cs
- DetailsViewCommandEventArgs.cs
- DeclarativeCatalogPart.cs
- ServiceThrottlingBehavior.cs
- LowerCaseStringConverter.cs
- Panel.cs
- DocumentViewerBase.cs
- ReferenceConverter.cs
- DateTimeFormat.cs
- ObjectIDGenerator.cs
- MediaSystem.cs
- EditorPart.cs
- Input.cs
- ColorConvertedBitmap.cs
- OleDbConnection.cs
- XhtmlConformanceSection.cs
- ListBoxItemAutomationPeer.cs
- ArrangedElementCollection.cs