From 323f0816f4feb4685010f41aa1d67c3f2f3976cc Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Tue, 11 Mar 2014 23:01:24 +0100 Subject: [PATCH] Add missing types and methods --- .../MemoryMappedViewStream.cs | 7 +++ .../EventAttribute.cs | 48 ++++++++++++++++++ .../EventCommand.cs | 42 ++++++++++++++++ .../EventCommandEventArgs.cs | 27 +++++++++- .../EventKeywords.cs | 47 +++++++++++++++++ .../System.Diagnostics.Tracing/EventLevel.cs | 44 ++++++++++++++++ .../System.Diagnostics.Tracing/EventSource.cs | 21 ++++++++ .../EventSourceAttribute.cs | 50 +++++++++++++++++++ .../NonEventAttribute.cs | 39 +++++++++++++++ .../corlib/System.Diagnostics/Debugger.cs | 6 +++ .../ComInterfaceType.cs | 5 +- .../System.Runtime.InteropServices/Marshal.cs | 7 +++ mcs/class/corlib/corlib.dll.sources | 6 +++ 13 files changed, 347 insertions(+), 2 deletions(-) create mode 100644 mcs/class/corlib/System.Diagnostics.Tracing/EventAttribute.cs create mode 100644 mcs/class/corlib/System.Diagnostics.Tracing/EventCommand.cs create mode 100644 mcs/class/corlib/System.Diagnostics.Tracing/EventKeywords.cs create mode 100644 mcs/class/corlib/System.Diagnostics.Tracing/EventLevel.cs create mode 100644 mcs/class/corlib/System.Diagnostics.Tracing/EventSourceAttribute.cs create mode 100644 mcs/class/corlib/System.Diagnostics.Tracing/NonEventAttribute.cs diff --git a/mcs/class/System.Core/System.IO.MemoryMappedFiles/MemoryMappedViewStream.cs b/mcs/class/System.Core/System.IO.MemoryMappedFiles/MemoryMappedViewStream.cs index aefda1bb70ff6..0f6aa75dc4203 100644 --- a/mcs/class/System.Core/System.IO.MemoryMappedFiles/MemoryMappedViewStream.cs +++ b/mcs/class/System.Core/System.IO.MemoryMappedFiles/MemoryMappedViewStream.cs @@ -30,6 +30,7 @@ using System; using System.IO; +using Microsoft.Win32.SafeHandles; namespace System.IO.MemoryMappedFiles { @@ -45,6 +46,12 @@ public sealed class MemoryMappedViewStream : UnmanagedMemoryStream { CreateStream (fd, offset, size, access); } + public SafeMemoryMappedViewHandle SafeMemoryMappedViewHandle { + get { + throw new NotImplementedException (); + } + } + unsafe void CreateStream (int fd, long offset, long size, MemoryMappedFileAccess access) { int offset_diff; diff --git a/mcs/class/corlib/System.Diagnostics.Tracing/EventAttribute.cs b/mcs/class/corlib/System.Diagnostics.Tracing/EventAttribute.cs new file mode 100644 index 0000000000000..c22ddf445a34e --- /dev/null +++ b/mcs/class/corlib/System.Diagnostics.Tracing/EventAttribute.cs @@ -0,0 +1,48 @@ +// +// EventAttribute.cs +// +// Authors: +// Marek Safar +// +// 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. +// + +#if NET_4_5 + +namespace System.Diagnostics.Tracing +{ + [AttributeUsageAttribute (AttributeTargets.Method)] + public sealed class EventAttribute : Attribute + { + public EventAttribute (int eventId) + { + EventId = eventId; + } + + public int EventId { + get; private set; + } + + } +} + +#endif diff --git a/mcs/class/corlib/System.Diagnostics.Tracing/EventCommand.cs b/mcs/class/corlib/System.Diagnostics.Tracing/EventCommand.cs new file mode 100644 index 0000000000000..26f665e560a8b --- /dev/null +++ b/mcs/class/corlib/System.Diagnostics.Tracing/EventCommand.cs @@ -0,0 +1,42 @@ +// +// EventCommand.cs +// +// Authors: +// Marek Safar +// +// 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. +// + +#if NET_4_5 + +namespace System.Diagnostics.Tracing +{ + public enum EventCommand + { + Update, + SendManifest = -1, + Enable = -2, + Disable = -3 + } +} + +#endif diff --git a/mcs/class/corlib/System.Diagnostics.Tracing/EventCommandEventArgs.cs b/mcs/class/corlib/System.Diagnostics.Tracing/EventCommandEventArgs.cs index b64e52273eff5..e195c64f415bc 100644 --- a/mcs/class/corlib/System.Diagnostics.Tracing/EventCommandEventArgs.cs +++ b/mcs/class/corlib/System.Diagnostics.Tracing/EventCommandEventArgs.cs @@ -1,5 +1,5 @@ // -// EventCommandEventArgs.cs.cs +// EventCommandEventArgs.cs // // Authors: // Marek Safar @@ -28,6 +28,8 @@ #if NET_4_5 +using System.Collections.Generic; + namespace System.Diagnostics.Tracing { public class EventCommandEventArgs : EventArgs @@ -35,6 +37,29 @@ public class EventCommandEventArgs : EventArgs private EventCommandEventArgs () { } + + public IDictionary Arguments { + get { + throw new NotImplementedException (); + } + } + + public EventCommand Command { + get { + throw new NotImplementedException (); + } + } + + public bool DisableEvent (int eventId) + { + return true; + } + + public bool EnableEvent (int eventId) + { + return true; + } + } } diff --git a/mcs/class/corlib/System.Diagnostics.Tracing/EventKeywords.cs b/mcs/class/corlib/System.Diagnostics.Tracing/EventKeywords.cs new file mode 100644 index 0000000000000..3322d78929fd9 --- /dev/null +++ b/mcs/class/corlib/System.Diagnostics.Tracing/EventKeywords.cs @@ -0,0 +1,47 @@ +// +// EventKeywords.cs +// +// Authors: +// Marek Safar +// +// 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. +// + +#if NET_4_5 + +namespace System.Diagnostics.Tracing +{ + [Flags] + public enum EventKeywords : long + { + None, + WdiContext = 0x2000000000000, + WdiDiagnostic = 0x4000000000000, + Sqm = 0x8000000000000, + AuditFailure = 0x10000000000000, + AuditSuccess = 0x20000000000000, + CorrelationHint = 0x10000000000000, + EventLogClassic = 0x80000000000000 + } +} + +#endif diff --git a/mcs/class/corlib/System.Diagnostics.Tracing/EventLevel.cs b/mcs/class/corlib/System.Diagnostics.Tracing/EventLevel.cs new file mode 100644 index 0000000000000..4a0608331751c --- /dev/null +++ b/mcs/class/corlib/System.Diagnostics.Tracing/EventLevel.cs @@ -0,0 +1,44 @@ +// +// EventLevel.cs +// +// Authors: +// Marek Safar +// +// 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. +// + +#if NET_4_5 + +namespace System.Diagnostics.Tracing +{ + public enum EventLevel + { + LogAlways, + Critical, + Error, + Warning, + Informational, + Verbose + } +} + +#endif diff --git a/mcs/class/corlib/System.Diagnostics.Tracing/EventSource.cs b/mcs/class/corlib/System.Diagnostics.Tracing/EventSource.cs index aaf65a258318a..cfa4bcaba5dee 100644 --- a/mcs/class/corlib/System.Diagnostics.Tracing/EventSource.cs +++ b/mcs/class/corlib/System.Diagnostics.Tracing/EventSource.cs @@ -45,6 +45,11 @@ public bool IsEnabled () return false; } + public bool IsEnabled (EventLevel level, EventKeywords keywords) + { + return false; + } + public void Dispose () { Dispose (true); @@ -54,9 +59,25 @@ protected virtual void Dispose (bool disposing) { } + protected virtual void OnEventCommand (EventCommandEventArgs command) + { + } + + 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, int arg3) { } + + protected void WriteEvent (int eventId, string arg1, int arg2, int arg3) + { + } } } diff --git a/mcs/class/corlib/System.Diagnostics.Tracing/EventSourceAttribute.cs b/mcs/class/corlib/System.Diagnostics.Tracing/EventSourceAttribute.cs new file mode 100644 index 0000000000000..0bc0faef9f598 --- /dev/null +++ b/mcs/class/corlib/System.Diagnostics.Tracing/EventSourceAttribute.cs @@ -0,0 +1,50 @@ +// +// EventSourceAttribute.cs +// +// Authors: +// Marek Safar +// +// 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. +// + +#if NET_4_5 + +namespace System.Diagnostics.Tracing +{ + [AttributeUsageAttribute (AttributeTargets.Class)] + public sealed class EventSourceAttribute : Attribute + { + public string Guid { + get; set; + } + + public string LocalizationResources { + get; set; + } + + public string Name { + get; set; + } + } +} + +#endif diff --git a/mcs/class/corlib/System.Diagnostics.Tracing/NonEventAttribute.cs b/mcs/class/corlib/System.Diagnostics.Tracing/NonEventAttribute.cs new file mode 100644 index 0000000000000..914315a0f9e35 --- /dev/null +++ b/mcs/class/corlib/System.Diagnostics.Tracing/NonEventAttribute.cs @@ -0,0 +1,39 @@ +// +// NonEventAttribute.cs +// +// Authors: +// Marek Safar +// +// 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. +// + +#if NET_4_5 + +namespace System.Diagnostics.Tracing +{ + [AttributeUsageAttribute (AttributeTargets.Method)] + public sealed class NonEventAttribute : Attribute + { + } +} + +#endif diff --git a/mcs/class/corlib/System.Diagnostics/Debugger.cs b/mcs/class/corlib/System.Diagnostics/Debugger.cs index d7b3544dfe5a9..9e0fdd00b6776 100644 --- a/mcs/class/corlib/System.Diagnostics/Debugger.cs +++ b/mcs/class/corlib/System.Diagnostics/Debugger.cs @@ -104,6 +104,12 @@ public static bool Launch() [MethodImplAttribute(MethodImplOptions.InternalCall)] public static extern void Log(int level, string category, string message); +#if NET_4_0 + public static void NotifyOfCrossThreadDependency () + { + } +#endif + #if NET_4_0 [ObsoleteAttribute("Call the static methods directly on this type", true)] #endif diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ComInterfaceType.cs b/mcs/class/corlib/System.Runtime.InteropServices/ComInterfaceType.cs index 627640763e7f2..82a0b58b449fe 100644 --- a/mcs/class/corlib/System.Runtime.InteropServices/ComInterfaceType.cs +++ b/mcs/class/corlib/System.Runtime.InteropServices/ComInterfaceType.cs @@ -37,6 +37,9 @@ public enum ComInterfaceType { InterfaceIsDual = 0, InterfaceIsIUnknown = 1, - InterfaceIsIDispatch = 2, + InterfaceIsIDispatch = 2, +#if NET_4_5 + InterfaceIsIInspectable = 3 +#endif } } diff --git a/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs b/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs index 83665f71cfdb0..e339f94955ad4 100644 --- a/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs +++ b/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs @@ -581,6 +581,13 @@ public static Type GetTypeForITypeInfo (IntPtr piTypeInfo) throw new NotImplementedException (); } +#if NET_4_5 + public static Type GetTypeFromCLSID (Guid clsid) + { + throw new NotImplementedException (); + } +#endif + #if !FULL_AOT_RUNTIME [Obsolete] [MonoTODO] diff --git a/mcs/class/corlib/corlib.dll.sources b/mcs/class/corlib/corlib.dll.sources index 53e6e76d7aed5..4b74bca92ecb6 100644 --- a/mcs/class/corlib/corlib.dll.sources +++ b/mcs/class/corlib/corlib.dll.sources @@ -360,8 +360,14 @@ System.Diagnostics.Contracts/ContractShouldAssertException.cs System.Diagnostics.Contracts/ContractVerificationAttribute.cs System.Diagnostics.Contracts/PureAttribute.cs System.Diagnostics.Contracts.Internal/ContractHelper.cs +System.Diagnostics.Tracing/EventAttribute.cs +System.Diagnostics.Tracing/EventCommand.cs +System.Diagnostics.Tracing/EventKeywords.cs +System.Diagnostics.Tracing/EventLevel.cs System.Diagnostics.Tracing/EventSource.cs +System.Diagnostics.Tracing/EventSourceAttribute.cs System.Diagnostics.Tracing/EventCommandEventArgs.cs +System.Diagnostics.Tracing/NonEventAttribute.cs System.Diagnostics.SymbolStore/ISymbolBinder.cs System.Diagnostics.SymbolStore/ISymbolBinder1.cs System.Diagnostics.SymbolStore/ISymbolDocument.cs