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
- DeviceContext2.cs
- SqlNode.cs
- Normalization.cs
- SupportedAddressingMode.cs
- TextDecorationLocationValidation.cs
- FrameworkContentElementAutomationPeer.cs
- CompilerState.cs
- DecimalKeyFrameCollection.cs
- MonitorWrapper.cs
- RegexCode.cs
- UnsafeNativeMethods.cs
- BitmapSourceSafeMILHandle.cs
- RewritingSimplifier.cs
- RuleProcessor.cs
- xmlformatgeneratorstatics.cs
- TypeBuilderInstantiation.cs
- UInt32Storage.cs
- SiblingIterators.cs
- SoapEnumAttribute.cs
- ToolTip.cs
- StyleHelper.cs
- DomainUpDown.cs
- WindowsSpinner.cs
- HtmlPhoneCallAdapter.cs
- AutoGeneratedFieldProperties.cs
- SqlLiftIndependentRowExpressions.cs
- XmlnsCache.cs
- BinaryParser.cs
- PrivilegedConfigurationManager.cs
- DatagridviewDisplayedBandsData.cs
- CompiledXpathExpr.cs
- OutputCacheProfileCollection.cs
- DataGridComponentEditor.cs
- FixedSOMContainer.cs
- SamlAuthenticationClaimResource.cs
- FrameworkPropertyMetadata.cs
- Function.cs
- WebResponse.cs
- HyperLinkField.cs
- DistributedTransactionPermission.cs
- DropShadowBitmapEffect.cs
- ContainerParagraph.cs
- FieldNameLookup.cs
- ToolStripGripRenderEventArgs.cs
- LineServicesCallbacks.cs
- ISO2022Encoding.cs
- XmlToDatasetMap.cs
- TableAutomationPeer.cs
- TreeSet.cs
- MenuBase.cs
- PackUriHelper.cs
- EventLogQuery.cs
- WebServiceTypeData.cs
- CapabilitiesAssignment.cs
- XmlValidatingReaderImpl.cs
- MenuItemCollection.cs
- KnowledgeBase.cs
- Panel.cs
- DataSetMappper.cs
- DesignerCategoryAttribute.cs
- EasingFunctionBase.cs
- EditorBrowsableAttribute.cs
- DesignerResources.cs
- RijndaelManagedTransform.cs
- WebConfigurationFileMap.cs
- SystemColorTracker.cs
- ObjectHandle.cs
- MouseGestureConverter.cs
- RawStylusInputReport.cs
- GridViewRowPresenterBase.cs
- QilReplaceVisitor.cs
- EncryptedPackageFilter.cs
- HuffCodec.cs
- XPathExpr.cs
- CdpEqualityComparer.cs
- GridViewColumn.cs
- RNGCryptoServiceProvider.cs
- OperationAbortedException.cs
- SystemNetHelpers.cs
- ClassHandlersStore.cs
- UtilityExtension.cs
- FormsAuthenticationUser.cs
- HtmlSelect.cs
- SqlDataSourceCommandEventArgs.cs
- RequestBringIntoViewEventArgs.cs
- RoutedCommand.cs
- HtmlUtf8RawTextWriter.cs
- AssociationTypeEmitter.cs
- ISCIIEncoding.cs
- DataServiceContext.cs
- Expressions.cs
- GAC.cs
- QueryStringHandler.cs
- TrueReadOnlyCollection.cs
- PropertyTabAttribute.cs
- StandardToolWindows.cs
- DocumentOrderQuery.cs
- UrlPropertyAttribute.cs
- DependencyPropertyAttribute.cs
- AccessKeyManager.cs