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
- odbcmetadatafactory.cs
- DynamicValidatorEventArgs.cs
- ProcessManager.cs
- CopyOnWriteList.cs
- SecurityContext.cs
- IPCCacheManager.cs
- LabelLiteral.cs
- _Rfc2616CacheValidators.cs
- DispatcherEventArgs.cs
- XPathBinder.cs
- KnownBoxes.cs
- StackSpiller.cs
- CodeConstructor.cs
- RangeValuePattern.cs
- ListViewGroup.cs
- PersonalizationState.cs
- PropertyGridCommands.cs
- UniqueEventHelper.cs
- StorageEntityTypeMapping.cs
- TypeDescriptionProvider.cs
- ApplicationManager.cs
- XPathNodeList.cs
- AppearanceEditorPart.cs
- CollectionBuilder.cs
- LongMinMaxAggregationOperator.cs
- DataGridViewColumnEventArgs.cs
- QueryCacheEntry.cs
- Configuration.cs
- DataContractJsonSerializer.cs
- ObjectAnimationUsingKeyFrames.cs
- XmlMapping.cs
- SerializationException.cs
- HideDisabledControlAdapter.cs
- XmlSchemaAny.cs
- AssemblyBuilder.cs
- IgnoreFileBuildProvider.cs
- CommonRemoteMemoryBlock.cs
- TransactionBridge.cs
- WindowsSidIdentity.cs
- SerializationInfoEnumerator.cs
- LockCookie.cs
- ResourceContainer.cs
- RawMouseInputReport.cs
- WindowsListBox.cs
- ipaddressinformationcollection.cs
- BitmapMetadata.cs
- OutputCacheProfileCollection.cs
- TickBar.cs
- EdmValidator.cs
- UInt64.cs
- SqlCacheDependency.cs
- ReadingWritingEntityEventArgs.cs
- LayoutManager.cs
- ConfigurationStrings.cs
- ObjectFullSpanRewriter.cs
- ValueChangedEventManager.cs
- HttpPostedFileWrapper.cs
- safelink.cs
- UIElement3D.cs
- ListViewHitTestInfo.cs
- DataListCommandEventArgs.cs
- ParagraphResult.cs
- RequestCachePolicy.cs
- Internal.cs
- PointConverter.cs
- ValidationEventArgs.cs
- MasterPage.cs
- ParserStreamGeometryContext.cs
- CodeCommentStatementCollection.cs
- XmlILModule.cs
- RegularExpressionValidator.cs
- RIPEMD160Managed.cs
- ObjectQueryProvider.cs
- StatusBarAutomationPeer.cs
- AccessViolationException.cs
- TreeNodeMouseHoverEvent.cs
- ReadOnlyAttribute.cs
- ProcessHost.cs
- OpenFileDialog.cs
- IndependentAnimationStorage.cs
- ClientProxyGenerator.cs
- ExecutionScope.cs
- SiteMapPath.cs
- CFGGrammar.cs
- XmlnsCache.cs
- FullTextLine.cs
- NativeMethods.cs
- FullTextState.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- TableLayoutPanel.cs
- HttpStreamFormatter.cs
- DocumentGridPage.cs
- LocatorPart.cs
- Path.cs
- PrimitiveXmlSerializers.cs
- ArgumentDirectionHelper.cs
- EntityDataSourceUtil.cs
- AxWrapperGen.cs
- DodSequenceMerge.cs
- GeometryCollection.cs