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
- OdbcConnectionString.cs
- ProgressBar.cs
- Themes.cs
- SessionEndingEventArgs.cs
- RegexTree.cs
- CorrelationManager.cs
- ParenthesizePropertyNameAttribute.cs
- HandledMouseEvent.cs
- SystemFonts.cs
- FlowchartDesigner.xaml.cs
- DataListItemEventArgs.cs
- ProviderConnectionPoint.cs
- SoundPlayer.cs
- NumberFormatter.cs
- ChtmlTextWriter.cs
- IDReferencePropertyAttribute.cs
- XmlFormatWriterGenerator.cs
- FlowLayoutSettings.cs
- XmlSchemaCompilationSettings.cs
- RequestCache.cs
- XmlAnyElementAttribute.cs
- streamingZipPartStream.cs
- HttpContext.cs
- XmlCountingReader.cs
- HttpContextBase.cs
- DataSetMappper.cs
- DataSourceHelper.cs
- ThicknessConverter.cs
- DataGridViewCell.cs
- IgnoreFlushAndCloseStream.cs
- OrderByBuilder.cs
- DynamicPhysicalDiscoSearcher.cs
- log.cs
- ImpersonationContext.cs
- OdbcDataAdapter.cs
- BamlRecords.cs
- Icon.cs
- NumberFormatInfo.cs
- SessionPageStatePersister.cs
- ContainerUtilities.cs
- StreamResourceInfo.cs
- PointCollectionValueSerializer.cs
- UInt64Converter.cs
- CaseStatement.cs
- SystemFonts.cs
- ChtmlPhoneCallAdapter.cs
- XmlException.cs
- PointAnimationBase.cs
- PartialCachingControl.cs
- PixelFormats.cs
- SqlServices.cs
- FontUnitConverter.cs
- WebPermission.cs
- SSmlParser.cs
- CreateUserWizard.cs
- XmlSchemaRedefine.cs
- WindowsRichEditRange.cs
- IPAddress.cs
- SkipStoryboardToFill.cs
- ObjectIDGenerator.cs
- DateBoldEvent.cs
- RequestBringIntoViewEventArgs.cs
- ObjectHandle.cs
- WriteableBitmap.cs
- SmtpFailedRecipientsException.cs
- SkewTransform.cs
- CodeMemberProperty.cs
- ReaderWriterLock.cs
- SafeBitVector32.cs
- EditorZone.cs
- MatrixConverter.cs
- CustomCategoryAttribute.cs
- Marshal.cs
- ClientOptions.cs
- GACMembershipCondition.cs
- XmlSubtreeReader.cs
- StringComparer.cs
- XmlnsDefinitionAttribute.cs
- WebConfigurationFileMap.cs
- NamespaceTable.cs
- DataGridViewCheckBoxColumn.cs
- ReflectionUtil.cs
- ClusterRegistryConfigurationProvider.cs
- UITypeEditor.cs
- HMACSHA384.cs
- Utils.cs
- LocatorPartList.cs
- ReliabilityContractAttribute.cs
- SchemaTableColumn.cs
- CacheSection.cs
- XmlCodeExporter.cs
- WindowsFormsSectionHandler.cs
- Translator.cs
- TemplateBindingExpression.cs
- IMembershipProvider.cs
- TemplateInstanceAttribute.cs
- ConnectionStringsExpressionBuilder.cs
- LogLogRecordEnumerator.cs
- XPathSelectionIterator.cs
- SqlClientMetaDataCollectionNames.cs