Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Krell <jaykrell@microsoft.com>2019-07-24 17:50:39 +0300
committerAlexander Köplinger <alex.koeplinger@outlook.com>2019-07-24 17:50:39 +0300
commitf68c52c0891975c5489169830d94443469fa3d45 (patch)
treeb5f9ea975830d397b947ba5f27803c096330b0a1 /mcs/class/System
parent57a6ebbf1ab30f2ea4aa98c60be5da428c3eaed0 (diff)
[Coop] Convert System.Diagnostics.{FileVersionInfo,Process}. (#15789)
Diffstat (limited to 'mcs/class/System')
-rw-r--r--mcs/class/System/System.Diagnostics/FileVersionInfo.cs8
-rw-r--r--mcs/class/System/System.Diagnostics/Process.cs8
2 files changed, 11 insertions, 5 deletions
diff --git a/mcs/class/System/System.Diagnostics/FileVersionInfo.cs b/mcs/class/System/System.Diagnostics/FileVersionInfo.cs
index d84cd0a8c56..bc041f6ff5e 100644
--- a/mcs/class/System/System.Diagnostics/FileVersionInfo.cs
+++ b/mcs/class/System/System.Diagnostics/FileVersionInfo.cs
@@ -274,7 +274,13 @@ namespace System.Diagnostics {
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern void GetVersionInfo_internal(string fileName);
+ private unsafe extern void GetVersionInfo_icall (char *fileName, int fileName_length);
+
+ private unsafe void GetVersionInfo_internal (string fileName)
+ {
+ fixed (char* fixed_filename = fileName)
+ GetVersionInfo_icall (fixed_filename, fileName?.Length ?? 0);
+ }
public static FileVersionInfo GetVersionInfo (string fileName)
{
diff --git a/mcs/class/System/System.Diagnostics/Process.cs b/mcs/class/System/System.Diagnostics/Process.cs
index 2069265a5da..d82325d790e 100644
--- a/mcs/class/System/System.Diagnostics/Process.cs
+++ b/mcs/class/System/System.Diagnostics/Process.cs
@@ -141,14 +141,14 @@ namespace System.Diagnostics
* element 0.
*/
[MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern ProcessModule[] GetModules_internal(IntPtr handle);
+ private extern ProcessModule[] GetModules_icall (IntPtr handle);
ProcessModule[] GetModules_internal (SafeProcessHandle handle)
{
bool release = false;
try {
handle.DangerousAddRef (ref release);
- return GetModules_internal (handle.DangerousGetHandle ());
+ return GetModules_icall (handle.DangerousGetHandle ());
} finally {
if (release)
handle.DangerousRelease ();
@@ -323,14 +323,14 @@ namespace System.Diagnostics
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static string ProcessName_internal(IntPtr handle);
+ private extern static string ProcessName_icall (IntPtr handle);
static string ProcessName_internal(SafeProcessHandle handle)
{
bool release = false;
try {
handle.DangerousAddRef (ref release);
- return ProcessName_internal (handle.DangerousGetHandle ());
+ return ProcessName_icall (handle.DangerousGetHandle ());
} finally {
if (release)
handle.DangerousRelease ();