You've already forked linux-packaging-mono
Imported Upstream version 6.4.0.137
Former-commit-id: 943baa9f16a098c33e129777827f3a9d20da00d6
This commit is contained in:
parent
e9207cf623
commit
ef583813eb
@@ -126,8 +126,22 @@ namespace System.Diagnostics {
|
||||
}
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.InternalCall)]
|
||||
static extern IntPtr GetImpl (string category, string counter,
|
||||
string instance, out PerformanceCounterType ctype, out bool custom);
|
||||
static private unsafe extern IntPtr GetImpl_icall (char *category, int category_length,
|
||||
char *counter, int counter_length, char *instance, int instance_length,
|
||||
out PerformanceCounterType ctype, out bool custom);
|
||||
|
||||
static unsafe IntPtr GetImpl (string category, string counter,
|
||||
string instance, out PerformanceCounterType ctype, out bool custom)
|
||||
{
|
||||
fixed (char* fixed_category = category,
|
||||
fixed_counter = counter,
|
||||
fixed_instance = instance) {
|
||||
return GetImpl_icall (fixed_category, category?.Length ?? 0,
|
||||
fixed_counter, counter?.Length ?? 0,
|
||||
fixed_instance, instance?.Length ?? 0,
|
||||
out ctype, out custom);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.InternalCall)]
|
||||
static extern bool GetSample (IntPtr impl, bool only_value, out CounterSample sample);
|
||||
|
@@ -41,30 +41,82 @@ namespace System.Diagnostics
|
||||
private PerformanceCounterCategoryType type = PerformanceCounterCategoryType.Unknown;
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.InternalCall)]
|
||||
static extern bool CategoryDelete (string name);
|
||||
private static unsafe extern bool CategoryDelete_icall (char* name, int name_length);
|
||||
|
||||
static unsafe bool CategoryDelete (string name)
|
||||
{
|
||||
fixed (char* fixed_name = name)
|
||||
return CategoryDelete_icall (fixed_name, name?.Length ?? 0);
|
||||
}
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.InternalCall)]
|
||||
static extern string CategoryHelpInternal (string category);
|
||||
private unsafe static extern string CategoryHelp_icall (char* category, int category_length);
|
||||
|
||||
static unsafe string CategoryHelpInternal (string category)
|
||||
{
|
||||
fixed (char* fixed_category = category)
|
||||
return CategoryHelp_icall (fixed_category, category?.Length ?? 0);
|
||||
}
|
||||
|
||||
/* this icall allows a null counter and it will just search for the category */
|
||||
[MethodImplAttribute (MethodImplOptions.InternalCall)]
|
||||
static extern bool CounterCategoryExists (string counter, string category);
|
||||
private static unsafe extern bool CounterCategoryExists_icall (char* counter, int counter_length,
|
||||
char* category, int category_length);
|
||||
|
||||
static unsafe bool CounterCategoryExists (string counter, string category)
|
||||
{
|
||||
fixed (char* fixed_counter = counter,
|
||||
fixed_category = category)
|
||||
return CounterCategoryExists_icall (fixed_counter, counter?.Length ?? 0,
|
||||
fixed_category, category?.Length ?? 0);
|
||||
}
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.InternalCall)]
|
||||
static extern bool Create (string categoryName, string categoryHelp,
|
||||
static private unsafe extern bool Create_icall (char* categoryName, int categoryName_length,
|
||||
char* categoryHelp, int categoryHelp_length,
|
||||
PerformanceCounterCategoryType categoryType, CounterCreationData[] items);
|
||||
|
||||
static unsafe bool Create (string categoryName, string categoryHelp,
|
||||
PerformanceCounterCategoryType categoryType, CounterCreationData[] items)
|
||||
{
|
||||
fixed (char* fixed_categoryName = categoryName,
|
||||
fixed_categoryHelp = categoryHelp)
|
||||
return Create_icall (fixed_categoryName, categoryName?.Length ?? 0,
|
||||
fixed_categoryHelp, categoryHelp?.Length ?? 0, categoryType, items);
|
||||
}
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.InternalCall)]
|
||||
static extern bool InstanceExistsInternal (string instance, string category);
|
||||
static private unsafe extern bool InstanceExistsInternal_icall (char* instance, int instance_length,
|
||||
char* category, int category_length);
|
||||
|
||||
static unsafe bool InstanceExistsInternal (string instance, string category)
|
||||
{
|
||||
fixed (char* fixed_instance = instance,
|
||||
fixed_category = category)
|
||||
return InstanceExistsInternal_icall (fixed_instance, instance?.Length ?? 0,
|
||||
fixed_category, category?.Length ?? 0);
|
||||
}
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.InternalCall)]
|
||||
static extern string[] GetCategoryNames ();
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.InternalCall)]
|
||||
static extern string[] GetCounterNames (string category);
|
||||
static private unsafe extern string[] GetCounterNames_icall (char* category, int category_length);
|
||||
|
||||
static unsafe string[] GetCounterNames (string category)
|
||||
{
|
||||
fixed (char* fixed_category = category)
|
||||
return GetCounterNames_icall (fixed_category, category?.Length ?? 0);
|
||||
}
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.InternalCall)]
|
||||
static extern string[] GetInstanceNames (string category);
|
||||
static private unsafe extern string[] GetInstanceNames_icall (char* category, int category_length);
|
||||
|
||||
static unsafe string[] GetInstanceNames (string category)
|
||||
{
|
||||
fixed (char* fixed_category = category)
|
||||
return GetInstanceNames_icall (fixed_category, category?.Length ?? 0);
|
||||
}
|
||||
|
||||
static void CheckCategory (string categoryName) {
|
||||
if (categoryName == null)
|
||||
|
@@ -42,6 +42,7 @@ using System.Runtime.InteropServices;
|
||||
using System.Runtime.Remoting.Messaging;
|
||||
using System.Security.Permissions;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Security;
|
||||
using System.Threading;
|
||||
using Microsoft.Win32;
|
||||
@@ -127,6 +128,15 @@ namespace System.Diagnostics
|
||||
}
|
||||
}
|
||||
|
||||
private static void AppendArguments (StringBuilder stringBuilder, Collection<string> argumentList)
|
||||
{
|
||||
if (argumentList.Count > 0) {
|
||||
foreach (string argument in argumentList) {
|
||||
PasteArguments.AppendArgument (stringBuilder, argument);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Returns the list of process modules. The main module is
|
||||
* element 0.
|
||||
*/
|
||||
@@ -782,9 +792,9 @@ namespace System.Diagnostics
|
||||
MonoIO.Close (stdin_read, out error);
|
||||
|
||||
#if MOBILE
|
||||
var stdinEncoding = Encoding.Default;
|
||||
var stdinEncoding = startInfo.StandardInputEncoding ?? Encoding.Default;
|
||||
#else
|
||||
var stdinEncoding = Console.InputEncoding;
|
||||
var stdinEncoding = startInfo.StandardInputEncoding ?? Console.InputEncoding;
|
||||
#endif
|
||||
standardInput = new StreamWriter (new FileStream (stdin_write, FileAccess.Write, true, 8192), stdinEncoding) {
|
||||
AutoFlush = true
|
||||
|
@@ -31,6 +31,7 @@
|
||||
|
||||
using Microsoft.Win32;
|
||||
using System.Collections;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.Specialized;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
@@ -48,6 +49,19 @@ namespace System.Diagnostics
|
||||
get { return (environmentVariables != null); }
|
||||
}
|
||||
|
||||
Collection<string> _argumentList;
|
||||
|
||||
public Collection<string> ArgumentList {
|
||||
get {
|
||||
if (_argumentList == null) {
|
||||
_argumentList = new Collection<string>();
|
||||
}
|
||||
return _argumentList;
|
||||
}
|
||||
}
|
||||
|
||||
public Encoding StandardInputEncoding { get; set; }
|
||||
|
||||
static readonly string [] empty = new string [0];
|
||||
|
||||
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden), Browsable (false)]
|
||||
|
Reference in New Issue
Block a user