Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Services / Monitoring / system / Diagnosticts / processwaithandle.cs / 1305376 / processwaithandle.cs
using System; using System.Threading; using Microsoft.Win32; using Microsoft.Win32.SafeHandles; using System.Runtime.InteropServices; using System.Runtime.Versioning; namespace System.Diagnostics { internal class ProcessWaitHandle : WaitHandle { [ResourceExposure(ResourceScope.None)] [ResourceConsumption(ResourceScope.Machine, ResourceScope.Machine)] internal ProcessWaitHandle( SafeProcessHandle processHandle): base() { SafeWaitHandle waitHandle = null; bool succeeded = NativeMethods.DuplicateHandle( new HandleRef(this, NativeMethods.GetCurrentProcess()), processHandle, new HandleRef(this, NativeMethods.GetCurrentProcess()), out waitHandle, 0, false, NativeMethods.DUPLICATE_SAME_ACCESS); if (!succeeded) { Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error()); } this.SafeWaitHandle = waitHandle; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using System; using System.Threading; using Microsoft.Win32; using Microsoft.Win32.SafeHandles; using System.Runtime.InteropServices; using System.Runtime.Versioning; namespace System.Diagnostics { internal class ProcessWaitHandle : WaitHandle { [ResourceExposure(ResourceScope.None)] [ResourceConsumption(ResourceScope.Machine, ResourceScope.Machine)] internal ProcessWaitHandle( SafeProcessHandle processHandle): base() { SafeWaitHandle waitHandle = null; bool succeeded = NativeMethods.DuplicateHandle( new HandleRef(this, NativeMethods.GetCurrentProcess()), processHandle, new HandleRef(this, NativeMethods.GetCurrentProcess()), out waitHandle, 0, false, NativeMethods.DUPLICATE_SAME_ACCESS); if (!succeeded) { Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error()); } this.SafeWaitHandle = waitHandle; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- NonVisualControlAttribute.cs
- WebBrowserPermission.cs
- IndexedString.cs
- SamlConditions.cs
- TimeSpanSecondsConverter.cs
- VersionPair.cs
- DataGridView.cs
- EditorZone.cs
- AtlasWeb.Designer.cs
- CollectionView.cs
- ListViewTableCell.cs
- storepermission.cs
- ControlParameter.cs
- TopClause.cs
- HtmlGenericControl.cs
- DataBoundControlActionList.cs
- TreeNodeEventArgs.cs
- CompareInfo.cs
- TextElementEnumerator.cs
- UDPClient.cs
- ProcessThread.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- BaseValidator.cs
- AsymmetricSignatureDeformatter.cs
- Item.cs
- arc.cs
- ProxyAttribute.cs
- LabelEditEvent.cs
- DateTimeValueSerializerContext.cs
- CompiledQueryCacheEntry.cs
- SyndicationElementExtensionCollection.cs
- OleDbConnection.cs
- DataGridViewColumnDividerDoubleClickEventArgs.cs
- LeaseManager.cs
- PostBackOptions.cs
- DataGridViewCellStateChangedEventArgs.cs
- ResourceContainer.cs
- WindowsAuthenticationEventArgs.cs
- DefaultWorkflowTransactionService.cs
- SoapAttributes.cs
- Icon.cs
- ChooseAction.cs
- SiteMap.cs
- IncrementalHitTester.cs
- DataGridViewCellParsingEventArgs.cs
- OdbcEnvironmentHandle.cs
- IpcClientChannel.cs
- StatusBarPanelClickEvent.cs
- ObjectSet.cs
- EdmToObjectNamespaceMap.cs
- ResourceDescriptionAttribute.cs
- XmlSerializationReader.cs
- WorkflowRuntimeService.cs
- ConfigXmlComment.cs
- IdentifierCollection.cs
- SpecialFolderEnumConverter.cs
- TreeViewItemAutomationPeer.cs
- SystemIcmpV4Statistics.cs
- TextServicesCompartmentContext.cs
- ListBindableAttribute.cs
- SqlTriggerContext.cs
- StringValidatorAttribute.cs
- DrawingContextWalker.cs
- ColumnProvider.cs
- DatePickerTextBox.cs
- ColumnWidthChangingEvent.cs
- DocumentReference.cs
- CodeLinePragma.cs
- ImmutablePropertyDescriptorGridEntry.cs
- SessionPageStatePersister.cs
- OperatorExpressions.cs
- ValidationEventArgs.cs
- ITreeGenerator.cs
- ManifestSignedXml.cs
- XmlHierarchyData.cs
- AliasedSlot.cs
- SessionEndedEventArgs.cs
- WindowsStatic.cs
- ContextMenuStrip.cs
- ImageFormatConverter.cs
- PrintPreviewDialog.cs
- _SslSessionsCache.cs
- RecognizerBase.cs
- XsltFunctions.cs
- HtmlInputCheckBox.cs
- CannotUnloadAppDomainException.cs
- FlowLayoutSettings.cs
- ColorAnimation.cs
- DocumentOrderQuery.cs
- ElementMarkupObject.cs
- DataGridViewAdvancedBorderStyle.cs
- ProtocolElementCollection.cs
- XmlUtil.cs
- GeometryCollection.cs
- ScrollChrome.cs
- SerializationInfoEnumerator.cs
- BrowserCapabilitiesCompiler.cs
- ManagementExtension.cs
- CTreeGenerator.cs
- DataGridColumnEventArgs.cs