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
- EncodingInfo.cs
- SplineKeyFrames.cs
- SslStream.cs
- FilterEventArgs.cs
- ListChangedEventArgs.cs
- XmlObjectSerializerWriteContext.cs
- Mutex.cs
- X509AsymmetricSecurityKey.cs
- PropertyGroupDescription.cs
- X509Utils.cs
- OdbcFactory.cs
- shaperfactoryquerycachekey.cs
- AssemblyAttributesGoHere.cs
- MailAddressCollection.cs
- SqlDataSourceRefreshSchemaForm.cs
- ComplexPropertyEntry.cs
- DynamicFilter.cs
- TaskHelper.cs
- HighContrastHelper.cs
- WSHttpBinding.cs
- HtmlGenericControl.cs
- PKCS1MaskGenerationMethod.cs
- QuaternionAnimation.cs
- AttributeEmitter.cs
- SecurityPolicySection.cs
- NamedPipeProcessProtocolHandler.cs
- EpmContentDeSerializerBase.cs
- OrCondition.cs
- CodeBinaryOperatorExpression.cs
- Parser.cs
- Ray3DHitTestResult.cs
- XmlSerializerSection.cs
- PropertyChangeTracker.cs
- OverloadGroupAttribute.cs
- _ChunkParse.cs
- AncillaryOps.cs
- ToolboxControl.cs
- ListDesigner.cs
- DataGridDetailsPresenterAutomationPeer.cs
- DataObjectSettingDataEventArgs.cs
- DataChangedEventManager.cs
- XmlILOptimizerVisitor.cs
- FileDataSourceCache.cs
- UInt16.cs
- StorageModelBuildProvider.cs
- TextTreeTextElementNode.cs
- ApplicationManager.cs
- OleDbConnectionFactory.cs
- SelectionRange.cs
- SignedXml.cs
- Transactions.cs
- HttpBrowserCapabilitiesWrapper.cs
- Collection.cs
- PasswordBox.cs
- OutOfMemoryException.cs
- PackageDigitalSignature.cs
- EventPropertyMap.cs
- GridErrorDlg.cs
- JoinElimination.cs
- HitTestFilterBehavior.cs
- Context.cs
- RequiredAttributeAttribute.cs
- EntryIndex.cs
- TextTreeUndoUnit.cs
- CreateUserErrorEventArgs.cs
- MyContact.cs
- QueryCacheKey.cs
- PathFigureCollection.cs
- X509CertificateCollection.cs
- Int32Animation.cs
- ListDictionaryInternal.cs
- RijndaelManagedTransform.cs
- CommentEmitter.cs
- NullableDecimalAverageAggregationOperator.cs
- StickyNoteHelper.cs
- XMLSyntaxException.cs
- ReturnType.cs
- ActivityMarkupSerializer.cs
- PropertyTabAttribute.cs
- ToolStripTextBox.cs
- RowCache.cs
- PageCodeDomTreeGenerator.cs
- WsatAdminException.cs
- FacetDescriptionElement.cs
- QueryOutputWriter.cs
- WorkflowViewService.cs
- SrgsRulesCollection.cs
- TemplatedAdorner.cs
- SizeChangedInfo.cs
- SwitchLevelAttribute.cs
- ActivitySurrogateSelector.cs
- BaseAutoFormat.cs
- SQLInt32.cs
- LinqDataSourceView.cs
- DependencyPropertyKind.cs
- NumberAction.cs
- HTMLTagNameToTypeMapper.cs
- BevelBitmapEffect.cs
- JavaScriptObjectDeserializer.cs
- GridViewRowCollection.cs