-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit to port System.Diagnostics.Process
Commit migrated from dotnet/corefx@fb83ed2
- Loading branch information
1 parent
b6543ce
commit 4a000ea
Showing
26 changed files
with
6,872 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 2013 | ||
VisualStudioVersion = 12.0.30723.0 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Diagnostics.Process", "System.Diagnostics.Process\src\System.Diagnostics.Process.csproj", "{63634289-90D7-4947-8BF3-DBBE98D76C85}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{63634289-90D7-4947-8BF3-DBBE98D76C85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{63634289-90D7-4947-8BF3-DBBE98D76C85}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{63634289-90D7-4947-8BF3-DBBE98D76C85}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{63634289-90D7-4947-8BF3-DBBE98D76C85}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
470 changes: 470 additions & 0 deletions
470
src/libraries/System.Diagnostics.Process/src/Interop/Interop.Manual.cs
Large diffs are not rendered by default.
Oops, something went wrong.
57 changes: 57 additions & 0 deletions
57
...libraries/System.Diagnostics.Process/src/Microsoft/Win32/SafeHandles/SafeProcessHandle.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
/*============================================================ | ||
** | ||
** Class: SafeProcessHandle | ||
** | ||
** A wrapper for a process handle | ||
** | ||
** | ||
===========================================================*/ | ||
|
||
using System; | ||
using System.Diagnostics; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace Microsoft.Win32.SafeHandles | ||
{ | ||
[System.Security.SecurityCriticalAttribute] | ||
public sealed class SafeProcessHandle : SafeHandle | ||
{ | ||
internal static SafeProcessHandle InvalidHandle = new SafeProcessHandle(IntPtr.Zero); | ||
|
||
internal SafeProcessHandle() : base(IntPtr.Zero, true) { } | ||
|
||
internal SafeProcessHandle(IntPtr handle) | ||
: base(IntPtr.Zero, true) | ||
{ | ||
SetHandle(handle); | ||
} | ||
|
||
public SafeProcessHandle(IntPtr handle, bool ownsHandle) | ||
: base(IntPtr.Zero, ownsHandle) | ||
{ | ||
SetHandle(handle); | ||
} | ||
|
||
internal void InitialSetHandle(IntPtr h) | ||
{ | ||
Debug.Assert(IsInvalid, "Safe handle should only be set once"); | ||
base.handle = h; | ||
} | ||
|
||
public override bool IsInvalid | ||
{ | ||
[System.Security.SecurityCritical] | ||
get | ||
{ return handle == new IntPtr(0) || handle == new IntPtr(-1); } | ||
} | ||
|
||
[System.Security.SecurityCritical] | ||
override protected bool ReleaseHandle() | ||
{ | ||
return Interop.mincore.CloseHandle(handle); | ||
} | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
src/libraries/System.Diagnostics.Process/src/Microsoft/Win32/SafeHandles/SafeThreadHandle.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
/*============================================================ | ||
** | ||
** Class: SafeThreadHandle | ||
** | ||
** | ||
** A wrapper for a thread handle | ||
** | ||
** | ||
===========================================================*/ | ||
|
||
using System; | ||
using System.Diagnostics; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace Microsoft.Win32.SafeHandles | ||
{ | ||
internal sealed class SafeThreadHandle : SafeHandle | ||
{ | ||
internal SafeThreadHandle() | ||
: base(IntPtr.Zero, true) | ||
{ | ||
} | ||
|
||
internal void InitialSetHandle(IntPtr h) | ||
{ | ||
Debug.Assert(IsInvalid, "Safe handle should only be set once"); | ||
base.SetHandle(h); | ||
} | ||
|
||
public override bool IsInvalid | ||
{ | ||
[System.Security.SecurityCritical] | ||
get | ||
{ return handle == new IntPtr(0) || handle == new IntPtr(-1); } | ||
} | ||
|
||
override protected bool ReleaseHandle() | ||
{ | ||
return Interop.mincore.CloseHandle(handle); | ||
} | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
src/libraries/System.Diagnostics.Process/src/Microsoft/Win32/SafeHandles/SafeTokenHandle.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
/*============================================================ | ||
** | ||
** Class: SafeTokenHandle | ||
** | ||
** A wrapper for a process handle | ||
** | ||
** | ||
===========================================================*/ | ||
|
||
using System; | ||
using System.Diagnostics; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace Microsoft.Win32.SafeHandles | ||
{ | ||
[System.Security.SecurityCriticalAttribute] | ||
internal sealed class SafeTokenHandle : SafeHandle | ||
{ | ||
internal static SafeTokenHandle InvalidHandle = new SafeTokenHandle(IntPtr.Zero); | ||
|
||
internal SafeTokenHandle() : base(IntPtr.Zero, true) { } | ||
|
||
internal SafeTokenHandle(IntPtr handle) | ||
: base(IntPtr.Zero, true) | ||
{ | ||
SetHandle(handle); | ||
} | ||
|
||
public SafeTokenHandle(IntPtr handle, bool ownsHandle) | ||
: base(IntPtr.Zero, ownsHandle) | ||
{ | ||
SetHandle(handle); | ||
} | ||
|
||
internal void InitialSetHandle(IntPtr h) | ||
{ | ||
Debug.Assert(IsInvalid, "Safe handle should only be set once"); | ||
base.handle = h; | ||
} | ||
|
||
public override bool IsInvalid | ||
{ | ||
[System.Security.SecurityCritical] | ||
get | ||
{ return handle == new IntPtr(0) || handle == new IntPtr(-1); } | ||
} | ||
|
||
[System.Security.SecurityCritical] | ||
override protected bool ReleaseHandle() | ||
{ | ||
return Interop.mincore.CloseHandle(handle); | ||
} | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
src/libraries/System.Diagnostics.Process/src/Properties/AssemblyInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using System; | ||
using System.Reflection; | ||
using System.Resources; | ||
using System.Runtime.InteropServices; | ||
|
||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
[assembly: AssemblyCopyright("\x00a9 Microsoft Corporation. All rights reserved.")] | ||
[assembly: AssemblyCompany("Microsoft Corporation")] | ||
[assembly: AssemblyFileVersion("999.999.999.0")] | ||
[assembly: AssemblyInformationalVersion("999.999.999.0")] | ||
[assembly: AssemblyVersion("999.999.999.0")] | ||
[assembly: AssemblyTitle("System.Diagnostics.Process")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyProduct("System.Diagnostics.Process")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
[assembly: NeutralResourcesLanguageAttribute("en-US")] | ||
|
||
// Setting ComVisible to false makes the types in this assembly not visible | ||
// to COM components. If you need to access a type in this assembly from | ||
// COM, set the ComVisible attribute to true on that type. | ||
[assembly: ComVisible(false)] | ||
[assembly: CLSCompliant(true)] |
Oops, something went wrong.