You've already forked linux-packaging-mono
Imported Upstream version 4.3.2.467
Former-commit-id: 9c2cb47f45fa221e661ab616387c9cda183f283d
This commit is contained in:
@@ -82,5 +82,20 @@ using System.Runtime.InteropServices;
|
||||
#endif
|
||||
[assembly: InternalsVisibleTo ("System.Numerics, PublicKey=00000000000000000400000000000000")]
|
||||
|
||||
[assembly: Guid ("BED7F4EA-1A96-11D2-8F08-00A0C9A6186D")]
|
||||
#if MONOTOUCH
|
||||
#if MONOTOUCH_TV
|
||||
[assembly: InternalsVisibleTo ("Xamarin.TVOS, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]
|
||||
#elif MONOTOUCH_WATCH
|
||||
[assembly: InternalsVisibleTo ("Xamarin.WatchOS, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]
|
||||
#else
|
||||
[assembly: InternalsVisibleTo ("monotouch, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]
|
||||
[assembly: InternalsVisibleTo ("Xamarin.iOS, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if XAMMAC || XAMMAC_4_5
|
||||
[assembly: InternalsVisibleTo ("XamMac, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]
|
||||
[assembly: InternalsVisibleTo ("Xamarin.Mac, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]
|
||||
#endif
|
||||
|
||||
[assembly: Guid ("BED7F4EA-1A96-11D2-8F08-00A0C9A6186D")]
|
||||
|
@@ -37,17 +37,31 @@ RESOURCE_FILES = \
|
||||
|
||||
REFERENCE_SOURCES_FLAGS = -d:FEATURE_PAL,GENERICS_WORK,FEATURE_LIST_PREDICATES,FEATURE_SERIALIZATION,FEATURE_ASCII,FEATURE_LATIN1,FEATURE_UTF7,FEATURE_UTF32,MONO_HYBRID_ENCODING_SUPPORT,FEATURE_ASYNC_IO,NEW_EXPERIMENTAL_ASYNC_IO,FEATURE_UTF32,FEATURE_EXCEPTIONDISPATCHINFO,FEATURE_CORRUPTING_EXCEPTIONS,FEATURE_EXCEPTION_NOTIFICATIONS,FEATURE_STRONGNAME_MIGRATION,FEATURE_USE_LCID,FEATURE_FUSION,FEATURE_CRYPTO,FEATURE_X509_SECURESTRINGS,FEATURE_SYNCHRONIZATIONCONTEXT,FEATURE_SYNCHRONIZATIONCONTEXT_WAIT
|
||||
|
||||
MOBILE_STATIC := $(filter mobile_static monotouch monotouch_runtime monotouch_watch, $(PROFILE))
|
||||
|
||||
ifndef MOBILE_STATIC
|
||||
REFERENCE_SOURCES_FLAGS += -d:FEATURE_REMOTING,MONO_COM,FEATURE_COMINTEROP,FEATURE_ROLE_BASED_SECURITY
|
||||
endif
|
||||
|
||||
LOCAL_MCS_FLAGS = -unsafe -nostdlib -nowarn:612,618 -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC $(REFERENCE_SOURCES_FLAGS)
|
||||
ifndef NO_THREAD_ABORT
|
||||
REFERENCE_SOURCES_FLAGS += -d:MONO_FEATURE_THREAD_ABORT
|
||||
TEST_MCS_FLAGS += -d:MONO_FEATURE_THREAD_ABORT
|
||||
endif
|
||||
|
||||
ifndef NO_THREAD_SUSPEND_RESUME
|
||||
REFERENCE_SOURCES_FLAGS += -d:MONO_FEATURE_THREAD_SUSPEND_RESUME
|
||||
TEST_MCS_FLAGS += -d:MONO_FEATURE_THREAD_SUSPEND_RESUME
|
||||
endif
|
||||
|
||||
ifndef NO_MULTIPLE_APPDOMAINS
|
||||
REFERENCE_SOURCES_FLAGS += -d:MONO_FEATURE_MULTIPLE_APPDOMAINS
|
||||
TEST_MCS_FLAGS += -d:MONO_FEATURE_MULTIPLE_APPDOMAINS
|
||||
endif
|
||||
|
||||
WARNING_ABOUT_DISABLED_WARNING=1635
|
||||
LOCAL_MCS_FLAGS = -unsafe -nostdlib -nowarn:612,618,$(WARNING_ABOUT_DISABLED_WARNING) -d:INSIDE_CORLIB,MONO_CULTURE_DATA -d:LIBC $(REFERENCE_SOURCES_FLAGS)
|
||||
DEFAULT_REFERENCES =
|
||||
|
||||
# System.IO/DirectoryInfoTest.cs needs Mono.Posix
|
||||
TEST_MCS_FLAGS = -debug -nowarn:168,219,618,672 -unsafe -r:Mono.Posix.dll -r:System.Core.dll \
|
||||
TEST_MCS_FLAGS += -debug -nowarn:168,219,618,672 -unsafe -r:Mono.Posix.dll -r:System.Core.dll -r:System.dll \
|
||||
-define:MONO_DATACONVERTER_STATIC_METHODS $(TEST_RESX_RESOURCES:%=-resource:%)
|
||||
|
||||
EXTRA_DISTFILES = \
|
||||
|
@@ -59,7 +59,10 @@ namespace Mono {
|
||||
[MethodImplAttribute (MethodImplOptions.InternalCall)]
|
||||
static extern string GetNativeStackTrace (Exception exception);
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.InternalCall)]
|
||||
public static extern bool SetGCAllowSynchronousMajor (bool flag);
|
||||
public static bool SetGCAllowSynchronousMajor (bool flag)
|
||||
{
|
||||
// No longer used
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
5
mcs/class/corlib/ReferenceSources/AppContextSwitches.cs
Normal file
5
mcs/class/corlib/ReferenceSources/AppContextSwitches.cs
Normal file
@@ -0,0 +1,5 @@
|
||||
namespace System {
|
||||
static class AppContextSwitches {
|
||||
public const bool ThrowExceptionIfDisposedCancellationTokenSource = true;
|
||||
}
|
||||
}
|
@@ -3,5 +3,6 @@ namespace System
|
||||
static class Array_ReferenceSources
|
||||
{
|
||||
internal const int MaxArrayLength = 0X7FEFFFFF;
|
||||
internal const int MaxByteArrayLength = 0x7FFFFFC7;
|
||||
}
|
||||
}
|
@@ -64,6 +64,44 @@ namespace System
|
||||
}
|
||||
}
|
||||
|
||||
[CLSCompliantAttribute (false)]
|
||||
public static unsafe void MemoryCopy (void* source, void* destination, long destinationSizeInBytes, long sourceBytesToCopy)
|
||||
{
|
||||
if (sourceBytesToCopy > destinationSizeInBytes) {
|
||||
ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.sourceBytesToCopy);
|
||||
}
|
||||
|
||||
var src = (byte*)source;
|
||||
var dst = (byte*)destination;
|
||||
while (sourceBytesToCopy > int.MaxValue) {
|
||||
Memcpy (dst, src, int.MaxValue);
|
||||
sourceBytesToCopy -= int.MaxValue;
|
||||
src += int.MaxValue;
|
||||
dst += int.MaxValue;
|
||||
}
|
||||
|
||||
memcpy1 (dst, src, (int) sourceBytesToCopy);
|
||||
}
|
||||
|
||||
[CLSCompliantAttribute (false)]
|
||||
public static unsafe void MemoryCopy (void* source, void* destination, ulong destinationSizeInBytes, ulong sourceBytesToCopy)
|
||||
{
|
||||
if (sourceBytesToCopy > destinationSizeInBytes) {
|
||||
ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.sourceBytesToCopy);
|
||||
}
|
||||
|
||||
var src = (byte*)source;
|
||||
var dst = (byte*)destination;
|
||||
while (sourceBytesToCopy > int.MaxValue) {
|
||||
Memcpy (dst, src, int.MaxValue);
|
||||
sourceBytesToCopy -= int.MaxValue;
|
||||
src += int.MaxValue;
|
||||
dst += int.MaxValue;
|
||||
}
|
||||
|
||||
Memcpy (dst, src, (int) sourceBytesToCopy);
|
||||
}
|
||||
|
||||
internal static unsafe void memcpy4 (byte *dest, byte *src, int size) {
|
||||
/*while (size >= 32) {
|
||||
// using long is better than int and slower than double
|
||||
|
@@ -33,10 +33,8 @@ namespace System {
|
||||
[System.Security.SecurityCritical]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
[SuppressUnmanagedCodeSecurity]
|
||||
internal static bool CheckThrowUnobservedTaskExceptions()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
[MethodImplAttribute(MethodImplOptions.InternalCall)]
|
||||
extern internal static bool CheckThrowUnobservedTaskExceptions();
|
||||
|
||||
} // internal class CLRConfig
|
||||
|
||||
|
@@ -16,7 +16,7 @@ namespace System.Runtime.CompilerServices {
|
||||
|
||||
static internal long UnsafeEnumCastLong<T>(T val) where T : struct
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
return Array.UnsafeMov<T, long> (val);
|
||||
}
|
||||
}
|
||||
}
|
@@ -43,6 +43,8 @@ namespace System
|
||||
{
|
||||
partial class RuntimeType
|
||||
{
|
||||
internal Object GenericCache;
|
||||
|
||||
internal virtual MonoCMethod GetDefaultConstructor ()
|
||||
{
|
||||
// TODO: Requires MonoType
|
||||
|
File diff suppressed because one or more lines are too long
@@ -10,5 +10,10 @@ namespace Microsoft.Win32
|
||||
{
|
||||
return "Error " + hr;
|
||||
}
|
||||
|
||||
public class SECURITY_ATTRIBUTES
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@@ -41,6 +41,9 @@ namespace System.Diagnostics.Tracing
|
||||
get; private set;
|
||||
}
|
||||
|
||||
public EventLevel Level { get; set; }
|
||||
public EventKeywords Keywords { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,45 +0,0 @@
|
||||
//
|
||||
// EventKeywords.cs
|
||||
//
|
||||
// Authors:
|
||||
// Marek Safar <marek.safar@gmail.com>
|
||||
//
|
||||
// Copyright (C) 2014 Xamarin Inc (http://www.xamarin.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
|
||||
namespace System.Diagnostics.Tracing
|
||||
{
|
||||
[Flags]
|
||||
public enum EventKeywords : long
|
||||
{
|
||||
None,
|
||||
WdiContext = 0x2000000000000,
|
||||
WdiDiagnostic = 0x4000000000000,
|
||||
Sqm = 0x8000000000000,
|
||||
AuditFailure = 0x10000000000000,
|
||||
AuditSuccess = 0x20000000000000,
|
||||
CorrelationHint = 0x10000000000000,
|
||||
EventLogClassic = 0x80000000000000
|
||||
}
|
||||
}
|
||||
|
@@ -33,12 +33,68 @@ namespace System.Diagnostics.Tracing
|
||||
{
|
||||
protected EventSource ()
|
||||
{
|
||||
this.Name = this.GetType().Name;
|
||||
}
|
||||
|
||||
protected EventSource (bool throwOnEventWriteErrors)
|
||||
: this ()
|
||||
{
|
||||
}
|
||||
|
||||
protected EventSource (EventSourceSettings settings)
|
||||
: this ()
|
||||
{
|
||||
this.Settings = settings;
|
||||
}
|
||||
|
||||
protected EventSource (EventSourceSettings settings, params string[] traits)
|
||||
: this (settings)
|
||||
{
|
||||
}
|
||||
|
||||
public EventSource (string eventSourceName)
|
||||
{
|
||||
this.Name = eventSourceName;
|
||||
}
|
||||
|
||||
public EventSource (string eventSourceName, EventSourceSettings config)
|
||||
: this (eventSourceName)
|
||||
{
|
||||
this.Settings = config;
|
||||
}
|
||||
|
||||
public EventSource (string eventSourceName, EventSourceSettings config, params string[] traits)
|
||||
: this (eventSourceName, config)
|
||||
{
|
||||
}
|
||||
|
||||
public Exception ConstructionException
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public static Guid CurrentThreadActivityId
|
||||
{
|
||||
get { return Guid.Empty; }
|
||||
}
|
||||
|
||||
public Guid Guid
|
||||
{
|
||||
get { return Guid.Empty; }
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public EventSourceSettings Settings
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public bool IsEnabled ()
|
||||
{
|
||||
return false;
|
||||
@@ -49,24 +105,66 @@ namespace System.Diagnostics.Tracing
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool IsEnabled (EventLevel level, EventKeywords keywords, EventChannel channel)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public void Dispose ()
|
||||
{
|
||||
Dispose (true);
|
||||
}
|
||||
|
||||
public string GetTrait (string key)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public void Write (string eventName)
|
||||
{
|
||||
}
|
||||
|
||||
public void Write<T> (string eventName, T data)
|
||||
{
|
||||
}
|
||||
|
||||
public void Write<T> (string eventName, EventSourceOptions options, T data)
|
||||
{
|
||||
}
|
||||
|
||||
public void Write<T> (string eventName, ref EventSourceOptions options, ref T data)
|
||||
{
|
||||
}
|
||||
|
||||
public void Write<T> (string eventName, ref EventSourceOptions options, ref Guid activityId, ref Guid relatedActivityId, ref T data)
|
||||
{
|
||||
}
|
||||
|
||||
protected virtual void Dispose (bool disposing)
|
||||
{
|
||||
{
|
||||
}
|
||||
|
||||
protected virtual void OnEventCommand (EventCommandEventArgs command)
|
||||
{
|
||||
}
|
||||
|
||||
protected void WriteEvent (int eventId)
|
||||
{
|
||||
}
|
||||
|
||||
protected void WriteEvent (int eventId, byte[] arg1)
|
||||
{
|
||||
}
|
||||
|
||||
protected void WriteEvent (int eventId, int arg1)
|
||||
{
|
||||
}
|
||||
|
||||
protected void WriteEvent (int eventId, string arg1)
|
||||
{
|
||||
}
|
||||
|
||||
protected void WriteEvent (int eventId, string arg1, int arg2)
|
||||
protected void WriteEvent (int eventId, int arg1, int arg2)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -74,9 +172,53 @@ namespace System.Diagnostics.Tracing
|
||||
{
|
||||
}
|
||||
|
||||
protected void WriteEvent (int eventId, int arg1, string arg2)
|
||||
{
|
||||
}
|
||||
|
||||
protected void WriteEvent (int eventId, long arg1)
|
||||
{
|
||||
}
|
||||
|
||||
protected void WriteEvent (int eventId, long arg1, byte[] arg2)
|
||||
{
|
||||
}
|
||||
|
||||
protected void WriteEvent (int eventId, long arg1, long arg2)
|
||||
{
|
||||
}
|
||||
|
||||
protected void WriteEvent (int eventId, long arg1, long arg2, long arg3)
|
||||
{
|
||||
}
|
||||
|
||||
protected void WriteEvent (int eventId, long arg1, string arg2)
|
||||
{
|
||||
}
|
||||
|
||||
protected void WriteEvent (int eventId, params object[] args)
|
||||
{
|
||||
}
|
||||
|
||||
protected void WriteEvent (int eventId, string arg1, int arg2)
|
||||
{
|
||||
}
|
||||
|
||||
protected void WriteEvent (int eventId, string arg1, int arg2, int arg3)
|
||||
{
|
||||
}
|
||||
|
||||
protected void WriteEvent (int eventId, string arg1, long arg2)
|
||||
{
|
||||
}
|
||||
|
||||
protected void WriteEvent (int eventId, string arg1, string arg2)
|
||||
{
|
||||
}
|
||||
|
||||
protected void WriteEvent (int eventId, string arg1, string arg2, string arg3)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,10 +1,10 @@
|
||||
//
|
||||
// System.Reflection/ExceptionHandlingClauseOptions.cs
|
||||
// EventSourceSettings.cs
|
||||
//
|
||||
// Author:
|
||||
// Zoltan Varga (vargaz@gmail.com)
|
||||
// Authors:
|
||||
// Frederik Carlier <frederik.carlier@quamotion.mobi>
|
||||
//
|
||||
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
|
||||
// Copyright (C) 2015 Quamotion (http://quamotion.mobi)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
@@ -13,10 +13,10 @@
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
@@ -27,18 +27,15 @@
|
||||
//
|
||||
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace System.Reflection {
|
||||
|
||||
[ComVisible (true)]
|
||||
namespace System.Diagnostics.Tracing
|
||||
{
|
||||
[Flags]
|
||||
public enum ExceptionHandlingClauseOptions {
|
||||
Clause = 0x0,
|
||||
Filter = 0x1,
|
||||
Finally = 0x2,
|
||||
Fault = 0x4
|
||||
public enum EventSourceSettings
|
||||
{
|
||||
Default = 0,
|
||||
ThrowOnEventWriteErrors = 1,
|
||||
EtwManifestEventFormat = 4,
|
||||
EtwSelfDescribingEventFormat = 8
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -149,6 +149,10 @@ namespace System.Diagnostics {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
internal StackTrace (StackFrame[] frames) {
|
||||
this.frames = frames;
|
||||
}
|
||||
|
||||
public virtual int FrameCount {
|
||||
get {
|
||||
return (frames == null) ? 0 : frames.Length;
|
||||
|
@@ -143,9 +143,12 @@ namespace System.Globalization
|
||||
|
||||
var locale_name = get_current_locale_name ();
|
||||
CultureInfo ci = null;
|
||||
try {
|
||||
ci = CreateSpecificCulture (locale_name);
|
||||
} catch {
|
||||
|
||||
if (locale_name != null) {
|
||||
try {
|
||||
ci = CreateSpecificCulture (locale_name);
|
||||
} catch {
|
||||
}
|
||||
}
|
||||
|
||||
if (ci == null) {
|
||||
|
@@ -73,12 +73,12 @@ namespace System.IO
|
||||
: this (handle, access, ownsHandle, bufferSize, isAsync, false) {}
|
||||
|
||||
[SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
|
||||
internal FileStream (IntPtr handle, FileAccess access, bool ownsHandle, int bufferSize, bool isAsync, bool isZeroSize)
|
||||
internal FileStream (IntPtr handle, FileAccess access, bool ownsHandle, int bufferSize, bool isAsync, bool isConsoleWrapper)
|
||||
{
|
||||
if (handle == MonoIO.InvalidHandle)
|
||||
throw new ArgumentException ("handle", Locale.GetText ("Invalid."));
|
||||
|
||||
Init (new SafeFileHandle (handle, false), access, ownsHandle, bufferSize, isAsync, isZeroSize);
|
||||
Init (new SafeFileHandle (handle, false), access, ownsHandle, bufferSize, isAsync, isConsoleWrapper);
|
||||
}
|
||||
|
||||
// construct from filename
|
||||
@@ -113,7 +113,6 @@ namespace System.IO
|
||||
{
|
||||
}
|
||||
|
||||
#if !NET_2_1
|
||||
public FileStream (SafeFileHandle handle, FileAccess access)
|
||||
:this(handle, access, DefaultBufferSize, false)
|
||||
{
|
||||
@@ -130,6 +129,7 @@ namespace System.IO
|
||||
Init (handle, access, false, bufferSize, isAsync, false);
|
||||
}
|
||||
|
||||
#if !MOBILE
|
||||
[MonoLimitation ("This ignores the rights parameter")]
|
||||
public FileStream (string path, FileMode mode,
|
||||
FileSystemRights rights, FileShare share,
|
||||
@@ -291,10 +291,14 @@ namespace System.IO
|
||||
}
|
||||
}
|
||||
|
||||
private void Init (SafeFileHandle safeHandle, FileAccess access, bool ownsHandle, int bufferSize, bool isAsync, bool isZeroSize)
|
||||
private void Init (SafeFileHandle safeHandle, FileAccess access, bool ownsHandle, int bufferSize, bool isAsync, bool isConsoleWrapper)
|
||||
{
|
||||
if (!isConsoleWrapper && safeHandle.IsInvalid)
|
||||
throw new ArgumentException(Environment.GetResourceString("Arg_InvalidHandle"), "handle");
|
||||
if (access < FileAccess.Read || access > FileAccess.ReadWrite)
|
||||
throw new ArgumentOutOfRangeException ("access");
|
||||
if (!isConsoleWrapper && bufferSize <= 0)
|
||||
throw new ArgumentOutOfRangeException("bufferSize", Environment.GetResourceString("ArgumentOutOfRange_NeedPosNum"));
|
||||
|
||||
MonoIOError error;
|
||||
MonoFileType ftype = MonoIO.GetFileType (safeHandle, out error);
|
||||
@@ -411,10 +415,8 @@ namespace System.IO
|
||||
return ret;
|
||||
}
|
||||
set {
|
||||
if(value < 0) {
|
||||
throw new ArgumentOutOfRangeException("Attempt to set the position to a negative value");
|
||||
}
|
||||
|
||||
if (value < 0) throw new ArgumentOutOfRangeException("value", Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
|
||||
|
||||
Seek (value, SeekOrigin.Begin);
|
||||
}
|
||||
}
|
||||
|
@@ -51,6 +51,8 @@ namespace System.IO
|
||||
public static readonly IntPtr
|
||||
InvalidHandle = (IntPtr)(-1L);
|
||||
|
||||
static bool dump_handles = Environment.GetEnvironmentVariable ("MONO_DUMP_HANDLES_ON_ERROR_TOO_MANY_OPEN_FILES") != null;
|
||||
|
||||
// error methods
|
||||
public static Exception GetException (MonoIOError error)
|
||||
{
|
||||
@@ -89,6 +91,8 @@ namespace System.IO
|
||||
return new FileNotFoundException (message, path);
|
||||
|
||||
case MonoIOError.ERROR_TOO_MANY_OPEN_FILES:
|
||||
if (dump_handles)
|
||||
DumpHandles ();
|
||||
return new IOException ("Too many open files", unchecked((int)0x80070000) | (int)error);
|
||||
|
||||
case MonoIOError.ERROR_PATH_NOT_FOUND:
|
||||
@@ -572,11 +576,11 @@ namespace System.IO
|
||||
// pipe handles
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.InternalCall)]
|
||||
public extern static bool CreatePipe (out IntPtr read_handle, out IntPtr write_handle);
|
||||
public extern static bool CreatePipe (out IntPtr read_handle, out IntPtr write_handle, out MonoIOError error);
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.InternalCall)]
|
||||
public extern static bool DuplicateHandle (IntPtr source_process_handle, IntPtr source_handle,
|
||||
IntPtr target_process_handle, out IntPtr target_handle, int access, int inherit, int options);
|
||||
IntPtr target_process_handle, out IntPtr target_handle, int access, int inherit, int options, out MonoIOError error);
|
||||
|
||||
// path characters
|
||||
|
||||
@@ -601,7 +605,7 @@ namespace System.IO
|
||||
}
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.InternalCall)]
|
||||
public extern static int GetTempPath(out string path);
|
||||
extern static void DumpHandles ();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -289,6 +289,7 @@ namespace System.IO {
|
||||
return fullpath;
|
||||
}
|
||||
|
||||
#if !MOBILE
|
||||
// http://msdn.microsoft.com/en-us/library/windows/desktop/aa364963%28v=vs.85%29.aspx
|
||||
[DllImport("Kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
private static extern int GetFullPathName(string path, int numBufferChars, StringBuilder buffer, ref IntPtr lpFilePartOrNull);
|
||||
@@ -341,6 +342,7 @@ namespace System.IO {
|
||||
}
|
||||
return path;
|
||||
}
|
||||
#endif
|
||||
|
||||
// insecure - do not call directly
|
||||
internal static string InsecureGetFullPath (string path)
|
||||
@@ -352,11 +354,11 @@ namespace System.IO {
|
||||
string msg = Locale.GetText ("The specified path is not of a legal form (empty).");
|
||||
throw new ArgumentException (msg);
|
||||
}
|
||||
|
||||
#if !MOBILE
|
||||
// adjust for drives, i.e. a special case for windows
|
||||
if (Environment.IsRunningOnWindows)
|
||||
path = WindowsDriveAdjustment (path);
|
||||
|
||||
#endif
|
||||
// if the supplied path ends with a separator...
|
||||
char end = path [path.Length - 1];
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user