diff --git a/Makefile.am b/Makefile.am index cddaff1621..e9d6ccdcda 100644 --- a/Makefile.am +++ b/Makefile.am @@ -52,7 +52,7 @@ dist-hook: d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) distdir=$$d dist-recursive rm -rf `find $(top_distdir)/external -path '*\.git'` rm -f `find $(top_distdir)/external -path '*\.exe'` - rm -f `find $(top_distdir)/external -path '*\.dll' -not -path '*/binary-reference-assemblies/v4\.0*'` + rm -f `find $(top_distdir)/external -path '*\.dll' -not -path '*/binary-reference-assemblies/*'` cp mcs/class/lib/basic/System.Configuration.dll mcs/class/lib/monolite/ cp mcs/class/lib/basic/System.Security.dll mcs/class/lib/monolite/ # Disable this for now because it is very slow and causes wrench to timeout: diff --git a/Makefile.in b/Makefile.in index 15a5e85151..080d2f0d30 100644 --- a/Makefile.in +++ b/Makefile.in @@ -947,7 +947,7 @@ dist-hook: d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) distdir=$$d dist-recursive rm -rf `find $(top_distdir)/external -path '*\.git'` rm -f `find $(top_distdir)/external -path '*\.exe'` - rm -f `find $(top_distdir)/external -path '*\.dll' -not -path '*/binary-reference-assemblies/v4\.0*'` + rm -f `find $(top_distdir)/external -path '*\.dll' -not -path '*/binary-reference-assemblies/*'` cp mcs/class/lib/basic/System.Configuration.dll mcs/class/lib/monolite/ cp mcs/class/lib/basic/System.Security.dll mcs/class/lib/monolite/ .PHONY: get-monolite-latest diff --git a/aclocal.m4 b/aclocal.m4 index ae4bfc4914..5252a2366e 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -593,7 +593,8 @@ to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi -fi]) +fi +]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further diff --git a/config.guess b/config.guess index b79252d6b1..1f5c50c0d1 100755 --- a/config.guess +++ b/config.guess @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2013 Free Software Foundation, Inc. +# Copyright 1992-2014 Free Software Foundation, Inc. -timestamp='2013-06-10' +timestamp='2014-03-23' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -50,7 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2013 Free Software Foundation, Inc. +Copyright 1992-2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -149,7 +149,7 @@ Linux|GNU|GNU/*) LIBC=gnu #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac @@ -826,7 +826,7 @@ EOF *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; - i*:MSYS*:*) + *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) @@ -969,10 +969,10 @@ EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; - or1k:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + openrisc*:Linux:*:*) + echo or1k-unknown-linux-${LIBC} exit ;; - or32:Linux:*:*) + or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) @@ -1260,16 +1260,26 @@ EOF if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac + if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; @@ -1361,154 +1371,6 @@ EOF exit ;; esac -eval $set_cc_for_build -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - c34*) - echo c34-convex-bsd - exit ;; - c38*) - echo c38-convex-bsd - exit ;; - c4*) - echo c4-convex-bsd - exit ;; - esac -fi - cat >&2 <." version="\ GNU config.sub ($timestamp) -Copyright 1992-2013 Free Software Foundation, Inc. +Copyright 1992-2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -265,6 +265,7 @@ case $basic_machine in | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ + | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ @@ -282,8 +283,10 @@ case $basic_machine in | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ @@ -295,11 +298,11 @@ case $basic_machine in | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ - | open8 \ - | or1k | or32 \ + | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ + | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ @@ -324,7 +327,7 @@ case $basic_machine in c6x) basic_machine=tic6x-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; @@ -381,6 +384,7 @@ case $basic_machine in | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ + | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ @@ -400,8 +404,10 @@ case $basic_machine in | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ @@ -413,6 +419,7 @@ case $basic_machine in | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ + | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ @@ -822,6 +829,10 @@ case $basic_machine in basic_machine=powerpc-unknown os=-morphos ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; msdos) basic_machine=i386-pc os=-msdos @@ -1367,14 +1378,14 @@ case $os in | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1592,9 +1603,6 @@ case $basic_machine in mips*-*) os=-elf ;; - or1k-*) - os=-elf - ;; or32-*) os=-coff ;; diff --git a/configure.REMOVED.git-id b/configure.REMOVED.git-id index 6926555fd1..4937bd70da 100644 --- a/configure.REMOVED.git-id +++ b/configure.REMOVED.git-id @@ -1 +1 @@ -25aca4d9234ba9866baffb6d0b49f85530244ece \ No newline at end of file +bb398f7ae55a546fb7bf939dabfed4a3fb9730bc \ No newline at end of file diff --git a/configure.ac.REMOVED.git-id b/configure.ac.REMOVED.git-id index b55f705dfb..02bde5f4ec 100644 --- a/configure.ac.REMOVED.git-id +++ b/configure.ac.REMOVED.git-id @@ -1 +1 @@ -64b436391b7e39451d01b5d01756e5484d447684 \ No newline at end of file +01ba76eb592f8ee610b360b3614f3f6a8de954d6 \ No newline at end of file diff --git a/docs/deploy/api-style.css b/docs/deploy/api-style.css new file mode 100644 index 0000000000..910ac49e55 --- /dev/null +++ b/docs/deploy/api-style.css @@ -0,0 +1,40 @@ + h3 { + font-size: 18px; + padding-bottom: 4pt; + border-bottom: 2px solid #dddddd; + } + + .api { + border: 1px solid; + padding: 10pt; + margin: 10pt; + } + + .api-entry { + border-bottom: none; + font-size: 18px; + } + + .prototype { + border: 1px solid; + background-color: #f2f2f2; + padding: 5pt; + margin-top: 5pt; + margin-bottom: 5pt; + } + + .header { + border: 1px solid; + padding: 0 0 5pt 5pt; + margin: 10pt; + white-space: pre; + font-family: monospace; + } + + .code { + border: 1px solid; + padding: 0 0 5pt 5pt; + margin: 10pt; + white-space: pre; + font-family: monospace; + } diff --git a/docs/deploy/mono-api-assembly.html b/docs/deploy/mono-api-assembly.html new file mode 100644 index 0000000000..78d66f4f58 --- /dev/null +++ b/docs/deploy/mono-api-assembly.html @@ -0,0 +1,337 @@ + + + + mono-api-assembly.html + + + +

Assemblies

+ +

Synopsis

+ +
+#include <metadata/assembly.h> + +typedef struct _MonoImage MonoImage; +typedef struct _MonoAssembly MonoAssembly; + +MonoAssembly* mono_assembly_open (const char *filename, + MonoImageOpenStatus *status); +void mono_assembly_close (MonoAssembly *assembly); +MonoAssembly* mono_assembly_load (MonoAssemblyName *aname, + const char *basedir, + MonoImageOpenStatus *status); +MonoAssembly* mono_assembly_load_full (MonoAssemblyName *aname, + const char *basedir, + MonoImageOpenStatus *status, + gboolean refonly); +MonoAssembly* mono_assembly_loaded (MonoAssemblyName *aname); + +MonoImage* mono_assembly_get_image (MonoAssembly *assembly); +MonoAssembly* mono_assembly_get_main (void); +G_CONST_RETURN gchar * mono_assembly_getrootdir (void); +void mono_assembly_name_free (MonoAssemblyName *aname); +char* mono_stringify_assembly_name (MonoAssemblyName *aname); +gboolean mono_assembly_names_equal (MonoAssemblyName *l, + MonoAssemblyName *r); + + + + +
+ + +

Assembly Loading

+ + +
+
mono_assembly_open
+ +
MonoAssembly* +mono_assembly_open (const char *filename, MonoImageOpenStatus *status) + +
+

+Parameters +

filename:
Opens the assembly pointed out by this name
status:
where a status code can be returned
+Returns +
a pointer to the MonoAssembly if filename contains a valid + + assembly or NULL on error. Details about the error are stored in the + status variable.
+Remarks +

+ mono_assembly_open opens the PE-image pointed by filename, and + loads any external assemblies referenced by it. + + +

+
+
mono_assembly_close
+ +
void +mono_assembly_close (MonoAssembly *assembly) + +
+

+Parameters +

assembly:
the assembly to release.
+Remarks +

+ This method releases a reference to the assembly. The assembly is + only released when all the outstanding references to it are released. + +

+
+
mono_assembly_load
+ +
MonoAssembly* +mono_assembly_load (MonoAssemblyName *aname, const char *basedir, MonoImageOpenStatus *status) + +
+

+Parameters +

aname:
A MonoAssemblyName with the assembly name to load.
basedir:
A directory to look up the assembly at.
status:
a pointer to a MonoImageOpenStatus to return the status of the load operation
+Returns +
the assembly referenced by aname loaded or NULL on error. On error the + + value pointed by status is updated with an error code.
+Remarks +

+ Loads the assembly referenced by aname, if the value of basedir is not NULL, it + attempts to load the assembly from that directory before probing the standard locations. + + +

+
+
mono_assembly_load_full
+ +
MonoAssembly* +mono_assembly_load_full (MonoAssemblyName *aname, const char *basedir, MonoImageOpenStatus *status, gboolean refonly) + +
+

+Parameters +

aname:
A MonoAssemblyName with the assembly name to load.
basedir:
A directory to look up the assembly at.
status:
a pointer to a MonoImageOpenStatus to return the status of the load operation
refonly:
Whether this assembly is being opened in "reflection-only" mode.
+Returns +
the assembly referenced by aname loaded or NULL on error. On error the + + value pointed by status is updated with an error code.
+Remarks +

+ Loads the assembly referenced by aname, if the value of basedir is not NULL, it + attempts to load the assembly from that directory before probing the standard locations. + + If the assembly is being opened in reflection-only mode (refonly set to TRUE) then no + assembly binding takes place. + + +

+
+
mono_assembly_loaded
+ +
MonoAssembly* +mono_assembly_loaded (MonoAssemblyName *aname) + +
+

+Parameters +

aname:
an assembly to look for.
+Returns +
NULL If the given aname assembly has not been loaded, or a pointer to + + a MonoAssembly that matches the MonoAssemblyName specified.
+ +
+
+
mono_assembly_get_object
+ +
Prototype: mono_assembly_get_object
+

+ + +

Working with Assemblies

+ + +
+
mono_assembly_get_image
+ +
MonoImage* +mono_assembly_get_image (MonoAssembly *assembly) + +
+

+Parameters +

assembly:
The assembly to retrieve the image from
+Returns +
the MonoImage associated with this assembly. +
+ +
+
+
mono_assembly_get_main
+ +
MonoAssembly* +mono_assembly_get_main (void) + +
+

+Returns +

the assembly for the application, the first assembly that is loaded by the VM +
+ +
+
+
mono_assembly_getrootdir
+ +
G_CONST_RETURN gchar * +mono_assembly_getrootdir (void) + +
+

+Returns +

a string with the directory, this string should not be freed. +
+Remarks +

+ + Obtains the root directory used for looking up assemblies. + + + +

Assembly Names

+ +

The MonoAssemblyName contains the full identity of an + assembly (name, culture, public key, public key token, + version and any other flags). + +

These unmanaged objects represent the System.Reflection.AssemblyName + managed type. + + +

+
mono_assembly_name_free
+ +
void +mono_assembly_name_free (MonoAssemblyName *aname) + +
+

+Parameters +

aname:
assembly name to free
+Remarks +

+ + Frees the provided assembly name object. + (it does not frees the object itself, only the name members). + +

+
+
mono_stringify_assembly_name
+ +
char* +mono_stringify_assembly_name (MonoAssemblyName *aname) + +
+

+Parameters +

aname:
the assembly name.
+Returns +
a newly allocated string with a string representation of + + the assembly name.
+Remarks +

+ Convert aname into its string format. The returned string is dynamically + allocated and should be freed by the caller. + + +

+
+
mono_assembly_names_equal
+ +
gboolean +mono_assembly_names_equal (MonoAssemblyName *l, MonoAssemblyName *r) + +
+

+Parameters +

l:
first assembly
r:
second assembly.
+Returns +
TRUE if both assembly names are equal. +
+Remarks +

+ Compares two MonoAssemblyNames and returns whether they are equal. + + This compares the names, the cultures, the release version and their + public tokens. + + + +

Modules

+ +

An assembly is made up of one or more modules. + + +

+
mono_module_file_get_object
+ +
Prototype: mono_module_file_get_object
+

+ +

+
+
mono_module_get_object
+ +
Prototype: mono_module_get_object
+

+ +

+ +
\ No newline at end of file diff --git a/docs/deploy/mono-api-class.html b/docs/deploy/mono-api-class.html new file mode 100644 index 0000000000..8ae3defebf --- /dev/null +++ b/docs/deploy/mono-api-class.html @@ -0,0 +1,821 @@ + + + + mono-api-class.html + + + +

Class Operations

+ + +
+
mono_class_array_element_size
+ +
gint32 +mono_class_array_element_size (MonoClass *klass) + +
+

+Parameters +

klass:
+Returns +
the number of bytes an element of type klass + + uses when stored into an array.
+ +
+
+
mono_class_data_size
+ +
gint32 +mono_class_data_size (MonoClass *klass) + +
+

+Parameters +

klass:
a class
+Returns +
the size of the static class data +
+Remarks +

+ + +

+
+
mono_class_enum_basetype
+ +
MonoType* +mono_class_enum_basetype (MonoClass *klass) + +
+

+Parameters +

klass:
the MonoClass to act on
+Returns +
the underlying type representation for an enumeration. +
+ +
+
+
mono_class_from_generic_parameter
+ +
Prototype: mono_class_from_generic_parameter
+

+ +

+
+
mono_class_from_mono_type
+ +
Prototype: mono_class_from_mono_type
+

+ +

+
+
mono_class_from_name_case
+ +
MonoClass* +mono_class_from_name_case (MonoImage *image, const char* name_space, const char *name) + +
+

+Parameters +

image:
The MonoImage where the type is looked up in
name_space:
the type namespace
name:
the type short name.
deprecated:
use the _checked variant
+Remarks +

+ Obtains a MonoClass with a given namespace and a given name which + is located in the given MonoImage. The namespace and name + lookups are case insensitive. + +

+
+
mono_class_from_name
+ +
MonoClass* +mono_class_from_name (MonoImage *image, const char* name_space, const char *name) + +
+

+Parameters +

image:
The MonoImage where the type is looked up in
name_space:
the type namespace
name:
the type short name.
+Remarks +

+ Obtains a MonoClass with a given namespace and a given name which + is located in the given MonoImage. + + To reference nested classes, use the "/" character as a separator. + For example use "Foo/Bar" to reference the class Bar that is nested + inside Foo, like this: "class Foo { class Bar {} }". + +

+
+
mono_class_from_typeref
+ +
Prototype: mono_class_from_typeref
+

+ +

+
+
mono_class_get_byref_type
+ +
MonoType* +mono_class_get_byref_type (MonoClass *klass) + +
+

+Parameters +

klass:
the MonoClass to act on
+Remarks +

+ +

+ +

+
+
mono_class_get_element_class
+ +
MonoClass* +mono_class_get_element_class (MonoClass *klass) + +
+

+Parameters +

klass:
the MonoClass to act on
+Returns +
the element class of an array or an enumeration. +
+ +
+
+
mono_class_get_events
+ +
MonoEvent* +mono_class_get_events (MonoClass* klass, gpointer *iter) + +
+

+Parameters +

klass:
the MonoClass to act on
+Returns +
a MonoEvent* on each invocation, or NULL when no more are available. +
+Remarks +

+ This routine is an iterator routine for retrieving the properties in a class. + + You must pass a gpointer that points to zero and is treated as an opaque handle to + iterate over all of the elements. When no more values are + available, the return value is NULL. + + +

+
+
mono_class_get_event_token
+ +
Prototype: mono_class_get_event_token
+

+ +

+
+
mono_class_get_field_from_name
+ +
MonoClassField* +mono_class_get_field_from_name (MonoClass *klass, const char *name) + +
+

+Parameters +

klass:
the class to lookup the field.
name:
the field name
+Returns +
the MonoClassField pointer of the named field or NULL +
+Remarks +

+ Search the class klass and it's parents for a field with the name name. + +

+ +

+
+
mono_class_get_field
+ +
MonoClassField* +mono_class_get_field (MonoClass *class, guint32 field_token) + +
+

+Parameters +

class:
the class to lookup the field.
field_token:
the field token
+Returns +
A MonoClassField representing the type and offset of + + the field, or a NULL value if the field does not belong to this + class.
+ +
+
+
mono_class_get_fields
+ +
MonoClassField* +mono_class_get_fields (MonoClass* klass, gpointer *iter) + +
+

+Parameters +

klass:
the MonoClass to act on
+Returns +
a MonoClassField* on each iteration, or NULL when no more fields are available. +
+Remarks +

+ This routine is an iterator routine for retrieving the fields in a class. + + You must pass a gpointer that points to zero and is treated as an opaque handle to + iterate over all of the elements. When no more values are + available, the return value is NULL. + + +

+
+
mono_class_get_field_token
+ +
guint32 +mono_class_get_field_token (MonoClassField *field) + +
+

+Parameters +

field:
the field we need the token of
+Returns +
the token representing the field in the image it was loaded from. +
+Remarks +

+ Get the token of a field. Note that the tokesn is only valid for the image + the field was loaded from. Don't use this function for fields in dynamic types. + +

+ +

+
+
mono_class_get_flags
+ +
guint32 +mono_class_get_flags (MonoClass *klass) + +
+

+Parameters +

klass:
the MonoClass to act on
+Returns +
the flags from the TypeDef table. +
+Remarks +

+ The type flags from the TypeDef table from the metadata. + see the TYPE_ATTRIBUTE_* definitions on tabledefs.h for the + different values. + + +

+
+
mono_class_get_full
+ +
MonoClass* +mono_class_get_full (MonoImage *image, guint32 type_token, MonoGenericContext *context) + +
+

+Parameters +

image:
the image where the class resides
type_token:
the token for the class
context:
the generic context used to evaluate generic instantiations in
deprecated:
Functions that expose MonoGenericContext are going away in mono 4.0
+Returns +
the MonoClass that represents type_token in image +
+ +
+
+
mono_class_get_image
+ +
Prototype: mono_class_get_image
+

+ +

+
+
mono_class_get_interfaces
+ +
MonoClass* +mono_class_get_interfaces (MonoClass* klass, gpointer *iter) + +
+

+Parameters +

klass:
the MonoClass to act on
+Returns +
a Monoclass* on each invocation, or NULL when no more are available. +
+Remarks +

+ This routine is an iterator routine for retrieving the interfaces implemented by this class. + + You must pass a gpointer that points to zero and is treated as an opaque handle to + iterate over all of the elements. When no more values are + available, the return value is NULL. + + +

+
+
mono_class_get_method_from_name
+ +
MonoMethod* +mono_class_get_method_from_name (MonoClass *klass, const char *name, int param_count) + +
+

+Parameters +

klass:
where to look for the method
name:
name of the method
param_count:
number of parameters. -1 for any number.
+Remarks +

+ Obtains a MonoMethod with a given name and number of parameters. + It only works if there are no multiple signatures for any given method name. + +

+
+
mono_class_get_methods
+ +
MonoMethod* +mono_class_get_methods (MonoClass* klass, gpointer *iter) + +
+

+Parameters +

klass:
the MonoClass to act on
+Returns +
a MonoMethod on each iteration or NULL when no more methods are available. +
+Remarks +

+ This routine is an iterator routine for retrieving the fields in a class. + + You must pass a gpointer that points to zero and is treated as an opaque handle to + iterate over all of the elements. When no more values are + available, the return value is NULL. + + +

+
+
mono_class_get
+ +
Prototype: mono_class_get
+

+ +

+
+
mono_class_get_name
+ +
const char* +mono_class_get_name (MonoClass *klass) + +
+

+Parameters +

klass:
the MonoClass to act on
+Returns +
the name of the class. +
+ +
+
+
mono_class_get_namespace
+ +
const char* +mono_class_get_namespace (MonoClass *klass) + +
+

+Parameters +

klass:
the MonoClass to act on
+Returns +
the namespace of the class. +
+ +
+
+
mono_class_get_nested_types
+ +
MonoClass* +mono_class_get_nested_types (MonoClass* klass, gpointer *iter) + +
+

+Parameters +

klass:
the MonoClass to act on
+Returns +
a Monoclass* on each invocation, or NULL when no more are available. +
+Remarks +

+ This routine is an iterator routine for retrieving the nested types of a class. + This works only if klass is non-generic, or a generic type definition. + + You must pass a gpointer that points to zero and is treated as an opaque handle to + iterate over all of the elements. When no more values are + available, the return value is NULL. + + +

+
+
mono_class_get_nesting_type
+ +
Prototype: mono_class_get_nesting_type
+

+ +

+
+
mono_class_get_parent
+ +
MonoClass* +mono_class_get_parent (MonoClass *klass) + +
+

+Parameters +

klass:
the MonoClass to act on
+Returns +
the parent class for this class. +
+ +
+
+
mono_class_get_properties
+ +
MonoProperty* +mono_class_get_properties (MonoClass* klass, gpointer *iter) + +
+

+Parameters +

klass:
the MonoClass to act on
+Returns +
a MonoProperty* on each invocation, or NULL when no more are available. +
+Remarks +

+ This routine is an iterator routine for retrieving the properties in a class. + + You must pass a gpointer that points to zero and is treated as an opaque handle to + iterate over all of the elements. When no more values are + available, the return value is NULL. + + +

+
+
mono_class_get_property_from_name
+ +
Prototype: mono_class_get_property_from_name
+

+ +

+
+
mono_class_get_property_token
+ +
Prototype: mono_class_get_property_token
+

+ +

+
+
mono_class_get_rank
+ +
int +mono_class_get_rank (MonoClass *klass) + +
+

+Parameters +

klass:
the MonoClass to act on
+Returns +
the rank for the array (the number of dimensions). +
+ +
+
+
mono_class_get_type
+ +
MonoType* +mono_class_get_type (MonoClass *klass) + +
+

+Parameters +

klass:
the MonoClass to act on
+Returns +
the MonoType from the class. +
+Remarks +

+ This method returns the internal Type representation for the class. + + +

+
+
mono_class_inflate_generic_method
+ +
Prototype: mono_class_inflate_generic_method
+

+ +

+
+
mono_class_inflate_generic_type
+ +
Prototype: mono_class_inflate_generic_type
+

+ +

+
+
mono_class_init
+ +
gboolean +mono_class_init (MonoClass *class) + +
+

+Parameters +

class:
the class to initialize
+Remarks +

+ Compute the instance_size, class_size and other infos that cannot be + computed at mono_class_get() time. Also compute vtable_size if possible. + Returns TRUE on success or FALSE if there was a problem in loading + the type (incorrect assemblies, missing assemblies, methods, etc). + + LOCKING: Acquires the loader lock. + +

+
+
mono_class_instance_size
+ +
gint32 +mono_class_instance_size (MonoClass *klass) + +
+

+Parameters +

klass:
a class
+Returns +
the size of an object instance +
+Remarks +

+ + +

+
+
mono_class_is_assignable_from
+ +
gboolean +mono_class_is_assignable_from (MonoClass *klass, MonoClass *oklass) + +
+

+Parameters +

klass:
the class to be assigned to
oklass:
the source class
+Returns +
true if an instance of object oklass can be assigned to an + + instance of object klass
+ +
+
+
mono_class_is_enum
+ +
gboolean +mono_class_is_enum (MonoClass *klass) + +
+

+Parameters +

klass:
the MonoClass to act on
+Returns +
true if the MonoClass represents an enumeration. +
+ +
+
+
mono_class_is_subclass_of
+ +
gboolean +mono_class_is_subclass_of (MonoClass *klass, MonoClass *klassc, + gboolean check_interfaces) + +
+

+Parameters +

klass:
class to probe if it is a subclass of another one
klassc:
the class we suspect is the base class
check_interfaces:
whether we should perform interface checks
+Remarks +

+ This method determines whether klass is a subclass of klassc. + + If the check_interfaces flag is set, then if klassc is an interface + this method return true if the klass implements the interface or + if klass is an interface, if one of its base classes is klass. + + If check_interfaces is false then, then if klass is not an interface + then it returns true if the klass is a subclass of klassc. + + if klass is an interface and klassc is System.Object, then this function + return true. + + +

+
+
mono_class_is_valuetype
+ +
gboolean +mono_class_is_valuetype (MonoClass *klass) + +
+

+Parameters +

klass:
the MonoClass to act on
+Returns +
true if the MonoClass represents a ValueType. +
+ +
+
+
mono_class_min_align
+ +
gint32 +mono_class_min_align (MonoClass *klass) + +
+

+Parameters +

klass:
a class
+Returns +
minimm alignment requirements +
+Remarks +

+ + +

+
+
mono_class_num_events
+ +
int +mono_class_num_events (MonoClass *klass) + +
+

+Parameters +

klass:
the MonoClass to act on
+Returns +
the number of events in the class. +
+ +
+
+
mono_class_num_fields
+ +
int +mono_class_num_fields (MonoClass *klass) + +
+

+Parameters +

klass:
the MonoClass to act on
+Returns +
the number of static and instance fields in the class. +
+ +
+
+
mono_class_num_methods
+ +
int +mono_class_num_methods (MonoClass *klass) + +
+

+Parameters +

klass:
the MonoClass to act on
+Returns +
the number of methods in the class. +
+ +
+
+
mono_class_num_properties
+ +
int +mono_class_num_properties (MonoClass *klass) + +
+

+Parameters +

klass:
the MonoClass to act on
+Returns +
the number of properties in the class. +
+ +
+
+
mono_class_value_size
+ +
gint32 +mono_class_value_size (MonoClass *klass, guint32 *align) + +
+

+Parameters +

klass:
a class
+Returns +
the size of a value of kind klass +
+Remarks +

+ This function is used for value types, and return the + space and the alignment to store that kind of value object. + + +

+
+
mono_class_vtable
+ +
MonoVTable* +mono_class_vtable (MonoDomain *domain, MonoClass *class) + +
+

+Parameters +

domain:
the application domain
class:
the class to initialize
+Remarks +

+ VTables are domain specific because we create domain specific code, and + they contain the domain specific static class data. + On failure, NULL is returned, and class->exception_type is set. + +

+
+
mono_class_get_method_from_name_flags
+ +
MonoMethod* +mono_class_get_method_from_name_flags (MonoClass *klass, const char *name, int param_count, int flags) + +
+

+Parameters +

klass:
where to look for the method
name_space:
name of the method
param_count:
number of parameters. -1 for any number.
flags:
flags which must be set in the method
+Remarks +

+ Obtains a MonoMethod with a given name and number of parameters. + It only works if there are no multiple signatures for any given method name. + +

+ +
\ No newline at end of file diff --git a/docs/deploy/mono-api-codegen.html b/docs/deploy/mono-api-codegen.html new file mode 100644 index 0000000000..ef2db8fafb --- /dev/null +++ b/docs/deploy/mono-api-codegen.html @@ -0,0 +1,162 @@ + + + + mono-api-codegen.html + + + +

Code manager

+ + +
+
mono_code_manager_commit
+ +
void +mono_code_manager_commit (MonoCodeManager *cman, void *data, int size, int newsize) + +
+

+Parameters +

cman:
a code manager
data:
the pointer returned by mono_code_manager_reserve ()
size:
the size requested in the call to mono_code_manager_reserve ()
newsize:
the new size to reserve
+Remarks +

+ If we reserved too much room for a method and we didn't allocate + already from the code manager, we can get back the excess allocation + for later use in the code manager. + +

+
+
mono_code_manager_destroy
+ +
void +mono_code_manager_destroy (MonoCodeManager *cman) + +
+

+Parameters +

cman:
a code manager
+Remarks +

+ Free all the memory associated with the code manager cman. + +

+
+
mono_code_manager_foreach
+ +
void +mono_code_manager_foreach (MonoCodeManager *cman, MonoCodeManagerFunc func, void *user_data) + +
+

+Parameters +

cman:
a code manager
func:
a callback function pointer
user_data:
additional data to pass to func
+Remarks +

+ Invokes the callback func for each different chunk of memory allocated + in the code manager cman. + +

+
+
mono_code_manager_invalidate
+ +
void +mono_code_manager_invalidate (MonoCodeManager *cman) + +
+

+Parameters +

cman:
a code manager
+Remarks +

+ Fill all the memory with an invalid native code value + so that any attempt to execute code allocated in the code + manager cman will fail. This is used for debugging purposes. + +

+
+
mono_code_manager_new_dynamic
+ +
MonoCodeManager* +mono_code_manager_new_dynamic (void) + +
+

+Returns +

the new code manager +
+Remarks +

+ Creates a new code manager suitable for holding native code that can be + used for single or small methods that need to be deallocated independently + of other native code. + + +

+
+
mono_code_manager_new
+ +
MonoCodeManager* +mono_code_manager_new (void) + +
+

+Returns +

the new code manager +
+Remarks +

+ Creates a new code manager. A code manager can be used to allocate memory + suitable for storing native code that can be later executed. + A code manager allocates memory from the operating system in large chunks + (typically 64KB in size) so that many methods can be allocated inside them + close together, improving cache locality. + + +

+ +
\ No newline at end of file diff --git a/docs/deploy/mono-api-counters.html b/docs/deploy/mono-api-counters.html new file mode 100644 index 0000000000..76706d2967 --- /dev/null +++ b/docs/deploy/mono-api-counters.html @@ -0,0 +1,128 @@ + + + + mono-api-counters.html + + + +

Counters

+ +

Counters is a Mono API for flexible statistics collection + and is used to track different events inside the JIT. + +

You would typically register an address with the + mono_counters_register routine and increment the + counters from your application as you go. At the end of the + program you would call mono_counters_dump which will display + all the registered counters. + +

If you need more complicated counter computation, a + function can be provided instead of an address. In that case + the MONO_COUNTER_CALLBACK flag must be ored in the + type request. + +

The types that can be rendered are: + +

+       MONO_COUNTER_INT
+       MONO_COUNTER_UINT
+       MONO_COUNTER_WORD
+       MONO_COUNTER_LONG
+       MONO_COUNTER_ULONG
+       MONO_COUNTER_DOUBLE
+       MONO_COUNTER_STRING
+
+ +

To organize the output, you register also a section where + the counter will be displayed, or one of the following values + when you register your counter: + +

+
+       MONO_COUNTER_JIT
+       MONO_COUNTER_GC
+       MONO_COUNTER_METADATA
+       MONO_COUNTER_GENERICS
+       MONO_COUNTER_SECURITY
+
+ + +
+
mono_counters_dump
+ +
void +mono_counters_dump (int section_mask, FILE *outfile) + +
+

+Parameters +

section_mask:
The sections to dump counters for
outfile:
a FILE to dump the results to
+Remarks +

+ Displays the counts of all the enabled counters registered. + To filter by variance, you can OR one or more variance with the specific section you want. + Use MONO_COUNTER_SECTION_MASK to dump all categories of a specific variance. + +

+
+
mono_counters_enable
+ +
void +mono_counters_enable (int section_mask) + +
+

+Parameters +

section_mask:
a mask listing the sections that will be displayed
+Remarks +

+ This is used to track which counters will be displayed. + +

+ +
\ No newline at end of file diff --git a/docs/deploy/mono-api-debug.html b/docs/deploy/mono-api-debug.html new file mode 100644 index 0000000000..78b31a386d --- /dev/null +++ b/docs/deploy/mono-api-debug.html @@ -0,0 +1,180 @@ + + + + mono-api-debug.html + + + + +
+
mono_debug_il_offset_from_address
+ +
gint32 +mono_debug_il_offset_from_address (MonoMethod *method, MonoDomain *domain, guint32 native_offset) + +
+

+Remarks +

+ Compute the IL offset corresponding to NATIVE_OFFSET inside the native + code of METHOD in DOMAIN. + +

+
+
mono_debug_add_method
+ +
Prototype: mono_debug_add_method
+

+ +

+
+
mono_debug_close_mono_symbol_file
+ +
Prototype: mono_debug_close_mono_symbol_file
+

+ +

+
+
mono_debug_find_method
+ +
Prototype: mono_debug_find_method
+

+ +

+
+
mono_debug_using_mono_debugger
+ +
Prototype: mono_debug_using_mono_debugger
+

+ + +

Mono Debugger Interface

+ +

These are methods that are invoked by the debugger at + runtime. + + +

+
mono_debugger_breakpoint_callback
+ +
Prototype: mono_debugger_breakpoint_callback
+

+ +

+
+
mono_debugger_check_runtime_version
+ +
Prototype: mono_debugger_check_runtime_version
+

+ +

+
+
mono_debugger_event
+ +
Prototype: mono_debugger_event
+

+ +

+
+
mono_debugger_handle_exception
+ +
Prototype: mono_debugger_handle_exception
+

+ +

+
+
mono_debugger_insert_breakpoint_full
+ +
Prototype: mono_debugger_insert_breakpoint_full
+

+ +

+
+
mono_debugger_insert_breakpoint
+ +
Prototype: mono_debugger_insert_breakpoint
+

+ +

+
+
mono_debugger_lock
+ +
Prototype: mono_debugger_lock
+

+ +

+
+
mono_debugger_method_has_breakpoint
+ +
Prototype: mono_debugger_method_has_breakpoint
+

+ +

+
+
mono_debugger_remove_breakpoint
+ +
Prototype: mono_debugger_remove_breakpoint
+

+ +

+
+
mono_debugger_runtime_invoke
+ +
Prototype: mono_debugger_runtime_invoke
+

+ +

+
+
mono_debugger_unlock
+ +
Prototype: mono_debugger_unlock
+

+ +

+ +
\ No newline at end of file diff --git a/docs/deploy/mono-api-decimal.html b/docs/deploy/mono-api-decimal.html new file mode 100644 index 0000000000..52a9bdb862 --- /dev/null +++ b/docs/deploy/mono-api-decimal.html @@ -0,0 +1,151 @@ + + + + mono-api-decimal.html + + + +

Decimal Support

+ +

You can use the mono_decimal functions to access and + manipulate System.Decimal types from C. + + +

+
mono_decimal2double
+ +
Prototype: mono_decimal2double
+

+ +

+
+
mono_decimal2Int64
+ +
Prototype: mono_decimal2Int64
+

+ +

+
+
mono_decimal2string
+ +
Prototype: mono_decimal2string
+

+ +

+
+
mono_decimal2UInt64
+ +
Prototype: mono_decimal2UInt64
+

+ +

+
+
mono_decimalCompare
+ +
Prototype: mono_decimalCompare
+

+ +

+
+
mono_decimalDiv
+ +
Prototype: mono_decimalDiv
+

+ +

+
+
mono_decimalFloorAndTrunc
+ +
Prototype: mono_decimalFloorAndTrunc
+

+ +

+
+
mono_decimalIncr
+ +
Prototype: mono_decimalIncr
+

+ +

+
+
mono_decimalIntDiv
+ +
Prototype: mono_decimalIntDiv
+

+ +

+
+
mono_decimalMult
+ +
Prototype: mono_decimalMult
+

+ +

+
+
mono_decimalRound
+ +
Prototype: mono_decimalRound
+

+ +

+
+
mono_decimalSetExponent
+ +
Prototype: mono_decimalSetExponent
+

+ +

+
+
mono_double2decimal
+ +
Prototype: mono_double2decimal
+

+ +

+ +
\ No newline at end of file diff --git a/docs/deploy/mono-api-domains.html b/docs/deploy/mono-api-domains.html new file mode 100644 index 0000000000..3966740020 --- /dev/null +++ b/docs/deploy/mono-api-domains.html @@ -0,0 +1,307 @@ + + + + mono-api-domains.html + + + +

Application Domains

+ +

Synopsis

+ +
+#include <metadata/appdomain.h> + +/* Managed AppDomain */ +typedef struct _MonoAppDomain MonoAppDomain; + +/* Unmanaged representation */ +typedef struct _MonoDomain MonoDomain; + +/* Represents System.Runtime.Remoting.Contexts.Context */ +typedef struct _MonoAppContext MonoAppContext +MonoAssembly* mono_domain_assembly_open (MonoDomain *domain, + const char *name); + +gboolean mono_domain_finalize (MonoDomain *domain, + guint32 timeout) ; + + + +MonoDomain* mono_domain_get_by_id (gint32 domainid) ; +MonoDomain* mono_domain_get (); +gboolean mono_domain_has_type_resolve (MonoDomain *domain); + +void mono_domain_set_internal (MonoDomain *domain); +gboolean mono_domain_set (MonoDomain *domain, + gboolean force); +MonoReflectionAssembly* mono_domain_try_type_resolve (MonoDomain *domain, + char *name, + MonoObject *tb); +gboolean mono_domain_owns_vtable_slot (MonoDomain *domain, + gpointer vtable_slot); + + + +
+ +

Application domains are used to isolate multiple + applications on a single Mono virtual machine. They are + conceptually similiar to processes, the difference is that + processes are managed by the operating system, while + application domains are managed by the Mono virtual machine. + +

For more information on applications domains see the AppDomain FAQ. + +

The MonoDomain is the unmanaged representation of + the System.AppDomain + managed type, while the MonoAppDomain type represents + the managed version (MonoAppDomain has a pointer to + a MonoDomain). + + +

+
mono_domain_assembly_open
+ +
MonoAssembly* +mono_domain_assembly_open (MonoDomain *domain, const char *name) + +
+

+Parameters +

domain:
the application domain
name:
file name of the assembly
+Remarks +

+ fixme: maybe we should integrate this with mono_assembly_open ?? + +

+
+
mono_domain_create
+ +
Prototype: mono_domain_create
+

+ +

+
+
mono_domain_finalize
+ +
+gboolean +mono_domain_finalize (MonoDomain *domain, guint32 timeout) + +
+

+Parameters +

domain:
the domain to finalize
timeout:
msects to wait for the finalization to complete, -1 to wait indefinitely
+Returns +
TRUE if succeeded, FALSE if there was a timeout +
+Remarks +

+ Request finalization of all finalizable objects inside domain. Wait + timeout msecs for the finalization to complete. + + +

+
+
mono_domain_foreach
+ +
Prototype: mono_domain_foreach
+

+ +

+
+
mono_domain_free
+ +
Prototype: mono_domain_free
+

+ +

+
+
mono_domain_get_by_id
+ +
Prototype: mono_domain_get_by_id
+

+ +

+
+
mono_domain_get_id
+ +
MonoDomain* +mono_domain_get_by_id (gint32 domainid) + +
+

+Parameters +

domainid:
the ID
+Returns +
the a domain for a specific domain id. +
+ +
+
+
mono_domain_get
+ +
MonoDomain* +mono_domain_get () + +
+

+Returns +

the current domain, to obtain the root domain use + + mono_get_root_domain().
+ +
+
+
mono_domain_has_type_resolve
+ +
gboolean +mono_domain_has_type_resolve (MonoDomain *domain) + +
+

+Parameters +

domain:
application domains being looked up
+Remarks +

+ Returns true if the AppDomain.TypeResolve field has been + set. + +

+
+
mono_domain_is_unloading
+ +
Prototype: mono_domain_is_unloading
+

+ +

+
+
mono_domain_set_internal
+ +
void +mono_domain_set_internal (MonoDomain *domain) + +
+

+Parameters +

domain:
the new domain
+Remarks +

+ Sets the current domain to domain. + +

+
+
mono_domain_set
+ +
gboolean +mono_domain_set (MonoDomain *domain, gboolean force) + +
+

+Parameters +

domain:
domain
force:
force setting.
+Returns +
+ + TRUE on success; + FALSE if the domain is unloaded
+Remarks +

+ Set the current appdomain to domain. If force is set, set it even + if it is being unloaded. + + +

+
+
mono_domain_try_type_resolve
+ +
MonoReflectionAssembly* +mono_domain_try_type_resolve (MonoDomain *domain, char *name, MonoObject *tb) + +
+

+Parameters +

domain:
application domainwhere the name where the type is going to be resolved
name:
the name of the type to resolve or NULL.
tb:
A System.Reflection.Emit.TypeBuilder, used if name is NULL.
+Returns +
A MonoReflectionAssembly or NULL if not found +
+Remarks +

+ This routine invokes the internal System.AppDomain.DoTypeResolve and returns + the assembly that matches name. + + If name is null, the value of ((TypeBuilder)tb).FullName is used instead + + +

+
+
mono_domain_owns_vtable_slot
+ +
gboolean +mono_domain_owns_vtable_slot (MonoDomain *domain, gpointer vtable_slot) + +
+

+Remarks +

+ Returns whenever VTABLE_SLOT is inside a vtable which belongs to DOMAIN. + + +

Contexts

+ + +
+
mono_context_get
+ +
Prototype: mono_context_get
+

+ +

+ +
\ No newline at end of file diff --git a/docs/deploy/mono-api-dynamic-codegen.html b/docs/deploy/mono-api-dynamic-codegen.html new file mode 100644 index 0000000000..c25acd6b79 --- /dev/null +++ b/docs/deploy/mono-api-dynamic-codegen.html @@ -0,0 +1,361 @@ + + + + mono-api-dynamic-codegen.html + + + +

Dynamic Code Generation

+ +

The dynamic code generation interface inside the Mono + runtime is similar to the API exposed by + System.Reflection.Emit. + +

This interface is used by Mono internally to generate code + on the flight in a cross-platform fashion. For example, + P/Invoke marshalling in Mono is implemented in terms of this + interface, but it is also used in various other parts of the + runtime. + +

Unlike Reflection.Emit, the dynamic code generation + interface does not start with an assembly builder. The code + generation interface starts directly at the method level, + which is represented by a pointer to the MonoMethodBuilder + structure. + +

To JIT this method, the process is this: + +

    +
  • Create a MonoMethodBuilder object using + the mono_mb_new method. The method's class + is specified as the first argument. + +
  • Create the method signature, using + mono_metadata_signature_alloc. The call + takes the number of arguments that the method takes. + Then you must initialize the types for each one of the + parameters. + +
  • Emit the CIL code, using one of the + mono_mb_emit_* functions. There are some + helper routines that you can use. + +
  • Create the MonoMethod from the + MethodBuilder using + mono_mb_create_method. + +
  • Release the MonoMethodBuilder resources + using mono_mb_free. +
+ +

The result of this process is a MonoMethod which + can be called using mono_create_jit_trampoline + routine or can be passed to any other functions that require + the MonoMethod. + +

Example: + +

+MonoMethod *adder ()
+{
+    MonoMethodBuilder *mb;
+    MonoMethodSignature *sig;
+    MonoMethod *method;
+    
+    mb = mono_mb_new (mono_defaults.object_class, "adder", MONO_WRAPPER_NONE);
+
+    /* Setup method signature */
+    sig = mono_metadata_signature_alloc (2);
+    sig->ret = &mono_get_int32_class ()->byval_arg;
+    sig->params [0] = &mono_get_int32_class ()->byval_arg;
+    sig->params [1] = &mono_defaults.int32_class->byval_arg;
+
+    /* Emit CIL code */
+    mono_mb_emit_ldarg (mb, 0);
+    mono_mb_emit_ldarg (mb, 1);
+    mono_mb_emit_byte (mb, CEE_ADD);
+    mono_mb_emit_byte (mb, CEE_RET);
+
+    /* Get the method */
+    method = mono_mb_create_method (mb, sig, max_stack);
+    
+    /* Cleanup */
+    mono_mb-free (mb);
+    return method;
+}
+	
+ + +
+
mono_mb_new
+ +
Prototype: mono_mb_new
+

+ + +

The possible values for the type argument are: + +

+        MONO_WRAPPER_NONE
+        MONO_WRAPPER_DELEGATE_INVOKE
+        MONO_WRAPPER_DELEGATE_BEGIN_INVOKE
+        MONO_WRAPPER_DELEGATE_END_INVOKE
+        MONO_WRAPPER_RUNTIME_INVOKE
+        MONO_WRAPPER_NATIVE_TO_MANAGED
+        MONO_WRAPPER_MANAGED_TO_NATIVE
+        MONO_WRAPPER_REMOTING_INVOKE
+        MONO_WRAPPER_REMOTING_INVOKE_WITH_CHECK
+        MONO_WRAPPER_XDOMAIN_INVOKE
+        MONO_WRAPPER_XDOMAIN_DISPATCH
+        MONO_WRAPPER_LDFLD
+        MONO_WRAPPER_STFLD
+        MONO_WRAPPER_LDFLD_REMOTE
+        MONO_WRAPPER_STFLD_REMOTE
+        MONO_WRAPPER_SYNCHRONIZED
+        MONO_WRAPPER_DYNAMIC_METHOD
+        MONO_WRAPPER_ISINST
+        MONO_WRAPPER_CASTCLASS
+        MONO_WRAPPER_PROXY_ISINST
+        MONO_WRAPPER_STELEMREF
+        MONO_WRAPPER_UNBOX
+        MONO_WRAPPER_LDFLDA
+        MONO_WRAPPER_UNKNOWN
+
+ +

Emitting IL

+ +

Functions that can be used to generate IL on the flight, + similar in spirit to System.Reflection.Emit.ILGenerator. + + +

+
mono_mb_emit_add_to_local
+ +
Prototype: mono_mb_emit_add_to_local
+

+ +

+
+
mono_mb_emit_branch
+ +
Prototype: mono_mb_emit_branch
+

+ +

+
+
mono_mb_emit_byte
+ +
Prototype: mono_mb_emit_byte
+

+ +

+
+
mono_mb_emit_exception
+ +
Prototype: mono_mb_emit_exception
+

+ +

+
+
mono_mb_emit_i2
+ +
Prototype: mono_mb_emit_i2
+

+ +

+
+
mono_mb_emit_i4
+ +
Prototype: mono_mb_emit_i4
+

+ +

+
+
mono_mb_emit_icon
+ +
Prototype: mono_mb_emit_icon
+

+ +

+
+
mono_mb_emit_ldarg_addr
+ +
Prototype: mono_mb_emit_ldarg_addr
+

+ +

+
+
mono_mb_emit_ldarg
+ +
Prototype: mono_mb_emit_ldarg
+

+ +

+
+
mono_mb_emit_ldflda
+ +
Prototype: mono_mb_emit_ldflda
+

+ +

+
+
mono_mb_emit_ldloc_addr
+ +
Prototype: mono_mb_emit_ldloc_addr
+

+ +

+
+
mono_mb_emit_ldloc
+ +
Prototype: mono_mb_emit_ldloc
+

+ +

+
+
mono_mb_emit_ldstr
+ +
Prototype: mono_mb_emit_ldstr
+

+ +

+
+
mono_mb_emit_managed_call
+ +
Prototype: mono_mb_emit_managed_call
+

+ +

+
+
mono_mb_emit_native_call
+ +
Prototype: mono_mb_emit_native_call
+

+ +

+
+
mono_mb_emit_stloc
+ +
Prototype: mono_mb_emit_stloc
+

+ + +

Local variables and Methods

+ +
+
mono_mb_create_method
+ +
MonoMethod* +mono_mb_create_method (MonoMethodBuilder *mb, MonoMethodSignature *signature, int max_stack) + +
+

+Returns +

the newly created method. + +
+Remarks +

+ Create a MonoMethod from this method builder. + +

+
+
mono_mb_add_data
+ +
Prototype: mono_mb_add_data
+

+ +

+
+
mono_mb_add_local
+ +
Prototype: mono_mb_add_local
+

+ +

+
+
mono_mb_free
+ +
Prototype: mono_mb_free
+

+ + +

Patching Addresses

+ +
+
mono_mb_patch_addr
+ +
Prototype: mono_mb_patch_addr
+

+ +

+
+
mono_mb_patch_addr_s
+ +
Prototype: mono_mb_patch_addr_s
+

+ + +

Method Signatures

+ +
+
mono_metadata_signature_alloc
+ +
Prototype: mono_metadata_signature_alloc
+

+ +

+
+
mono_metadata_signature_dup
+ +
Prototype: mono_metadata_signature_dup
+

+ +

+ +
\ No newline at end of file diff --git a/docs/deploy/mono-api-embedding.html b/docs/deploy/mono-api-embedding.html new file mode 100644 index 0000000000..1c4cef595d --- /dev/null +++ b/docs/deploy/mono-api-embedding.html @@ -0,0 +1,428 @@ + + + + mono-api-embedding.html + + + +

Embedding Mono

+ +

The simplest way of embedding Mono is illustrated here: +

+int main (int argc, char *argv)
+{
+	/*
+	 * Load the default Mono configuration file, this is needed
+	 * if you are planning on using the dllmaps defined on the
+	 * system configuration
+	 */
+	mono_config_parse (NULL);
+
+	/*
+	 * mono_jit_init() creates a domain: each assembly is
+	 * loaded and run in a MonoDomain.
+	 */
+	MonoDomain *domain = mono_jit_init ("startup.exe");
+
+	/*
+	 * Optionally, add an internal call that your startup.exe
+	 * code can call, this will bridge startup.exe to Mono
+	 */
+	mono_add_internal_call ("Sample::GetMessage", getMessage);
+
+	/*
+	 * Open the executable, and run the Main method declared
+	 * in the executable
+	 */
+	MonoAssembly *assembly = mono_domain_assembly_open (domain, "startup.exe");
+
+	if (!assembly)
+		exit (2);
+	/*
+	 * mono_jit_exec() will run the Main() method in the assembly.
+	 * The return value needs to be looked up from
+	 * System.Environment.ExitCode.
+	 */
+	mono_jit_exec (domain, assembly, argc, argv);
+}
+
+/* The C# signature for this method is: string GetMessage () in class Sample */
+MonoString*
+getMessage ()
+{
+	return mono_string_new (mono_domain_get (), "Hello, world");
+}
+
+ + +
+
mono_jit_init
+ +
Prototype: mono_jit_init
+

+ +

+
+
mono_jit_exec
+ +
int +mono_jit_exec (MonoDomain *domain, MonoAssembly *assembly, int argc, char *argv[]) + +
+

+Parameters +

assembly:
reference to an assembly
argc:
argument count
argv:
argument vector
+Remarks +

+ Start execution of a program. + +

+
+
mono_set_dirs
+ +
void +mono_set_dirs (const char *assembly_dir, const char *config_dir) + +
+

+Parameters +

assembly_dir:
the base directory for assemblies
config_dir:
the base directory for configuration files
+Remarks +

+ This routine is used internally and by developers embedding + the runtime into their own applications. + + There are a number of cases to consider: Mono as a system-installed + package that is available on the location preconfigured or Mono in + a relocated location. + + If you are using a system-installed Mono, you can pass NULL + to both parameters. If you are not, you should compute both + directory values and call this routine. + + The values for a given PREFIX are: + + assembly_dir: PREFIX/lib + config_dir: PREFIX/etc + + Notice that embedders that use Mono in a relocated way must + compute the location at runtime, as they will be in control + of where Mono is installed. + +

+
+
mono_main
+ +
int +mono_main (int argc, char* argv[]) + +
+

+Parameters +

argc:
number of arguments in the argv array
argv:
array of strings containing the startup arguments
+Remarks +

+ Launches the Mono JIT engine and parses all the command line options + in the same way that the mono command line VM would. + +

+
+
mono_parse_default_optimizations
+ +
Prototype: mono_parse_default_optimizations
+

+ + +

+
+
mono_jit_cleanup
+ +
Prototype: mono_jit_cleanup
+

+ +

+
+
mono_set_defaults
+ +
Prototype: mono_set_defaults
+

+ + +

Internal Calls

+ +

The Mono runtime provides two mechanisms to expose C code + to the CIL universe: internal calls and native C + code. Internal calls are tightly integrated with the runtime, + and have the least overhead, as they use the same data types + that the runtime uses. + +

The other option is to use the Platform Invoke (P/Invoke) + to call C code from the CIL universe, using the standard + P/Invoke + mechanisms. + +

To register an internal call, use this call you use the + mono_add_internal_call + routine. + + +

+
mono_add_internal_call
+ +
Prototype: mono_add_internal_call
+

+ + +

P/Invoke with embedded applications

+ +

Unlike internal calls, Platform/Invoke is easier to use and + more portable. It allows you to share code with Windows and + .NET that have a different setup for internal calls to their + own runtime. + +

Usually P/Invoke declarations reference external libraries + like: + +

+	[DllImport ("opengl")]
+	void glBegin (GLEnum mode)
+	
+ +

Mono extends P/Invoke to support looking up symbols not in + an external library, but looking up those symbols into the + same address space as your program, to do this, use the + special library name "__Internal". This will direct Mono to + lookup the method in your own process. + +

There are situations where the host operating system does + not support looking up symbols on the process address space. + For situations like this you can use + the mono_dl_register_library. + +

mono_dl_register_library

+ +

Data Marshalling

+ +

Managed objects are represented as MonoObject* + types. Those objects that the runtime consumes directly have + more specific C definitions (for example strings are of type + MonoString *, delegates are of type + MonoDelegate* but they are still MonoObject + *s). + +

As of Mono 1.2.x types defined in mscorlib.dll do not have + their fields reordered in any way. But other libraries might + have their fields reordered. In these cases, Managed + structures and objects have the same layout in the C# code as + they do in the unmanaged world. + +

Structures defined outside corlib must have a specific + StructLayout definition, and have it set as sequential if you + plan on accessing these fields directly from C code. + +

Important Internal calls do not provide support for + marshalling structures. This means that any API calls that + take a structure (excluding the system types like int32, + int64, etc) must be passed as a pointer, in C# this means + passing the value as a "ref" or "out" parameter. + +

Mono Runtime Configuration

+ +

Certain features of the Mono runtime, like DLL mapping, are + available through a configuration file that is loaded at + runtime. The default Mono implementation loads the + configuration file from $sysconfig/mono/config + (typically this is /etc/mono/config). + +

See the mono-config(5) man page for more details + on what goes in this file. + +

The following APIs expose this functionality: + + +

+
mono_config_parse
+ +
void +mono_config_parse (const char *filename) +
+

+Parameters +

filename:
the filename to load the configuration variables from.
+Remarks +

+ Pass a NULL filename to parse the default config files + (or the file in the MONO_CONFIG env var). + +

+
+
mono_config_parse_memory
+ +
void +mono_config_parse_memory (const char *buffer) + +
+

+Parameters +

buffer:
a pointer to an string XML representation of the configuration
+Remarks +

+ Parses the configuration from a buffer + +

+
+
mono_get_config_dir
+ +
Prototype: mono_get_config_dir
+

+ + +

Function Pointers

+ +

To wrap a function pointer into something that the Mono + runtime can consume, you should use the mono_create_ftnptr. + This is only important if you plan on running on the IA64 + architecture. Otherwise you can just use the function + pointer address. + + +

+
mono_create_ftnptr
+ +
Prototype: mono_create_ftnptr
+

+ + +

Advanced Execution Setups

+ +

These are not recommended ways of initializing Mono, they + are done internally by mono_jit_init, but are here to explain + what happens internally. + + +

+
mono_runtime_exec_managed_code
+ +
void +mono_runtime_exec_managed_code (MonoDomain *domain, + MonoMainThreadFunc main_func, + gpointer main_args) + +
+

+Parameters +

domain:
Application domain
main_func:
function to invoke from the execution thread
main_args:
parameter to the main_func
+Remarks +

+ Launch a new thread to execute a function + + main_func is called back from the thread with main_args as the + parameter. The callback function is expected to start Main() + eventually. This function then waits for all managed threads to + finish. + It is not necesseray anymore to execute managed code in a subthread, + so this function should not be used anymore by default: just + execute the code and then call mono_thread_manage (). + +

+
+
mono_runtime_exec_main
+ +
Prototype: mono_runtime_exec_main
+

+ +

+
+
mono_init_from_assembly
+ +
MonoDomain* +mono_init_from_assembly (const char *domain_name, const char *filename) + +
+

+Parameters +

domain_name:
name to give to the initial domain
filename:
filename to load on startup
+Returns +
the initial domain. +
+Remarks +

+ Used by the runtime, users should use mono_jit_init instead. + + Creates the initial application domain and initializes the mono_defaults + structure. + This function is guaranteed to not run any IL code. + The runtime is initialized using the runtime version required by the + provided executable. The version is determined by looking at the exe + configuration file and the version PE field) + + +

+
+
mono_init
+ +
MonoDomain* +mono_init (const char *domain_name) + +
+

+Returns +

the initial domain. +
+Remarks +

+ + Creates the initial application domain and initializes the mono_defaults + structure. + This function is guaranteed to not run any IL code. + The runtime is initialized using the default runtime version. + + +

+ +
\ No newline at end of file diff --git a/docs/deploy/mono-api-exc.html b/docs/deploy/mono-api-exc.html new file mode 100644 index 0000000000..774a8a61d4 --- /dev/null +++ b/docs/deploy/mono-api-exc.html @@ -0,0 +1,694 @@ + + + + mono-api-exc.html + + + +

Exception Handling

+ +
+void mono_raise_exception (MonoException *ex) ; +void mono_unhandled_exception (MonoObject *exc); +void mono_print_unhandled_exception (MonoObject *exc); +MonoException* mono_exception_from_name_domain (MonoDomain *domain, + MonoImage *image, + ; +MonoException* mono_exception_from_name (MonoImage *image, + const char *name_space; +MonoException* mono_exception_from_name_msg (MonoImage *image, + const char *name_space; +MonoException* mono_exception_from_name_two_strings (MonoImage *image, + const char *name_space; +MonoException* mono_get_exception_appdomain_unloaded (void); +MonoException* mono_get_exception_argument (const char *arg, + const char *msg); +MonoException* mono_get_exception_argument_null (const char *arg); +MonoException* mono_get_exception_argument_out_of_range (const char *arg); +MonoException* mono_get_exception_arithmetic (); +MonoException* mono_get_exception_array_type_mismatch (); +MonoException* mono_get_exception_bad_image_format (const char *msg); +MonoException* mono_get_exception_cannot_unload_appdomain (const char *msg); + +MonoException* mono_get_exception_divide_by_zero (); +MonoException* mono_get_exception_execution_engine (const char *msg); +MonoException* mono_get_exception_file_not_found2 (const char *msg, + MonoString *fname); +MonoException* mono_get_exception_file_not_found (MonoString *fname); +MonoException* mono_get_exception_index_out_of_range (); +MonoException* mono_get_exception_invalid_cast (); +MonoException* mono_get_exception_io (const char *msg); +MonoException* mono_get_exception_missing_method (const char *class_name, + const char *member_name); +MonoException* mono_get_exception_not_implemented (const char *msg); +MonoException* mono_get_exception_null_reference (); +MonoException* mono_get_exception_overflow (); +MonoException* mono_get_exception_security (); +MonoException* mono_get_exception_serialization (const char *msg); +MonoException* mono_get_exception_stack_overflow (void); +MonoException* mono_get_exception_synchronization_lock (const char *msg); +MonoException* mono_get_exception_thread_abort (); +MonoException* mono_get_exception_thread_state (const char *msg); +MonoException* mono_get_exception_type_initialization (const gchar *type_name, + MonoException *inner); +MonoException* mono_get_exception_type_load (MonoString *class_name, + char *assembly_name); +MonoException* mono_get_exception_invalid_operation (const char *msg); +MonoException* mono_get_exception_missing_field (const char *class_name, + const char *member_name); +MonoException* mono_get_exception_not_supported (const char *msg); +MonoException* mono_get_exception_reflection_type_load (MonoArray *types, + MonoArray *exceptions); + +
+ +

Raising and Catching exceptions

+ + +
+
mono_raise_exception
+ +
void +mono_raise_exception (MonoException *ex) + +
+

+Parameters +

ex:
exception object
+Remarks +

+ Signal the runtime that the exception ex has been raised in unmanaged code. + +

+
+
mono_unhandled_exception
+ +
void +mono_unhandled_exception (MonoObject *exc) + +
+

+Parameters +

exc:
exception thrown
+Remarks +

+ This is a VM internal routine. + + We call this function when we detect an unhandled exception + in the default domain. + + It invokes the * UnhandledException event in AppDomain or prints + a warning to the console + +

+
+
mono_print_unhandled_exception
+ +
void +mono_print_unhandled_exception (MonoObject *exc) + +
+

+Parameters +

exc:
The exception
+Remarks +

+ Prints the unhandled exception. + + + +

Exception Types: General API

+ + +
+
mono_exception_from_name_domain
+ +
MonoException* +mono_exception_from_name_domain (MonoDomain *domain, MonoImage *image, + const char* name_space, const char *name) + +
+

+Parameters +

domain:
Domain where the return object will be created.
image:
the Mono image where to look for the class
name_space:
the namespace for the class
name:
class name
+Returns +
the initialized exception instance. +
+Remarks +

+ Creates an exception object of the given namespace/name class on + the given domain. + + +

+
+
mono_exception_from_name
+ +
MonoException* +mono_exception_from_name (MonoImage *image, const char *name_space, + const char *name) + +
+

+Parameters +

image:
the Mono image where to look for the class
name_space:
the namespace for the class
name:
class name
+Returns +
the initialized exception instance. +
+Remarks +

+ Creates an exception of the given namespace/name class in the + current domain. + + +

+
+
mono_exception_from_name_msg
+ +
MonoException* +mono_exception_from_name_msg (MonoImage *image, const char *name_space, + const char *name, const char *msg) + +
+

+Parameters +

image:
the Mono image where to look for the class
name_space:
the namespace for the class
name:
class name
msg:
the message to embed inside the exception
+Returns +
the initialized exception instance. +
+Remarks +

+ Creates an exception and initializes its message field. + + +

+
+
mono_exception_from_name_two_strings
+ +
MonoException* +mono_exception_from_name_two_strings (MonoImage *image, const char *name_space, + const char *name, MonoString *a1, MonoString *a2) + +
+

+Parameters +

image:
the Mono image where to look for the class
name_space:
the namespace for the class
name:
class name
a1:
first string argument to pass
a2:
second string argument to pass
+Returns +
the initialized exception instance. +
+Remarks +

+ Creates an exception from a constructor that takes two string + arguments. + + + +

Obtaining Common Exceptions

+ +

There are a number of common exceptions that are used by + the runtime, use the routines in this section to get a copy of + those exceptions. + + +

+
mono_get_exception_appdomain_unloaded
+ +
MonoException* +mono_get_exception_appdomain_unloaded (void) + +
+

+Returns +

a new instance of the System.AppDomainUnloadedException +
+ +
+
+
mono_get_exception_argument
+ +
MonoException* +mono_get_exception_argument (const char *arg, const char *msg) + +
+

+Parameters +

arg:
the name of the invalid argument.
+Returns +
a new instance of the System.ArgumentException +
+ +
+
+
mono_get_exception_argument_null
+ +
MonoException* +mono_get_exception_argument_null (const char *arg) + +
+

+Parameters +

arg:
the name of the argument that is null
+Returns +
a new instance of the System.ArgumentNullException +
+ +
+
+
mono_get_exception_argument_out_of_range
+ +
MonoException* +mono_get_exception_argument_out_of_range (const char *arg) + +
+

+Parameters +

arg:
the name of the out of range argument.
+Returns +
a new instance of the System.ArgumentOutOfRangeException +
+ +
+
+
mono_get_exception_arithmetic
+ +
MonoException* +mono_get_exception_arithmetic () + +
+

+Returns +

a new instance of the System.ArithmeticException. +
+ +
+
+
mono_get_exception_array_type_mismatch
+ +
MonoException* +mono_get_exception_array_type_mismatch () + +
+

+Returns +

a new instance of the System.ArrayTypeMismatchException +
+ +
+
+
mono_get_exception_bad_image_format
+ +
MonoException* +mono_get_exception_bad_image_format (const char *msg) + +
+

+Parameters +

msg:
an informative message for the user.
+Returns +
a new instance of the System.BadImageFormatException +
+ +
+
+
mono_get_exception_cannot_unload_appdomain
+ +
MonoException* +mono_get_exception_cannot_unload_appdomain (const char *msg) + +
+

+Parameters +

inner:
the inner exception.
+Returns +
a new instance of the System.CannotUnloadAppDomainException +
+ +
+
+
mono_get_exception_class
+ +
Prototype: mono_get_exception_class
+

+ +

+
+
mono_get_exception_divide_by_zero
+ +
MonoException* +mono_get_exception_divide_by_zero () + +
+

+Returns +

a new instance of the System.DivideByZeroException +
+ +
+
+
mono_get_exception_execution_engine
+ +
MonoException* +mono_get_exception_execution_engine (const char *msg) + +
+

+Parameters +

msg:
the message to pass to the user
+Returns +
a new instance of the System.ExecutionEngineException +
+ +
+
+
mono_get_exception_file_not_found2
+ +
MonoException* +mono_get_exception_file_not_found2 (const char *msg, MonoString *fname) + +
+

+Parameters +

msg:
an informative message for the user.
fname:
the name of the file not found.
+Returns +
a new instance of the System.IO.FileNotFoundException +
+ +
+
+
mono_get_exception_file_not_found
+ +
MonoException* +mono_get_exception_file_not_found (MonoString *fname) + +
+

+Parameters +

fname:
the name of the file not found.
+Returns +
a new instance of the System.IO.FileNotFoundException +
+ +
+
+
mono_get_exception_index_out_of_range
+ +
MonoException* +mono_get_exception_index_out_of_range () + +
+

+Returns +

a new instance of the System.IndexOutOfRangeException +
+ +
+
+
mono_get_exception_invalid_cast
+ +
MonoException* +mono_get_exception_invalid_cast () + +
+

+Returns +

a new instance of the System.InvalidCastException +
+ +
+
+
mono_get_exception_io
+ +
MonoException* +mono_get_exception_io (const char *msg) + +
+

+Parameters +

msg:
the message to present to the user
+Returns +
a new instance of the System.IO.IOException +
+ +
+
+
mono_get_exception_missing_method
+ +
MonoException* +mono_get_exception_missing_method (const char *class_name, const char *member_name) + +
+

+Parameters +

class_name:
the class where the lookup was performed.
member_name:
the name of the missing method.
+Returns +
a new instance of the System.MissingMethodException +
+ +
+
+
mono_get_exception_not_implemented
+ +
MonoException* +mono_get_exception_not_implemented (const char *msg) + +
+

+Parameters +

msg:
the message to pass to the user
+Returns +
a new instance of the System.NotImplementedException +
+ +
+
+
mono_get_exception_null_reference
+ +
MonoException* +mono_get_exception_null_reference () + +
+

+Returns +

a new instance of the System.NullReferenceException +
+ +
+
+
mono_get_exception_overflow
+ +
MonoException* +mono_get_exception_overflow () + +
+

+Returns +

a new instance of the System.OverflowException +
+ +
+
+
mono_get_exception_security
+ +
MonoException* +mono_get_exception_security () + +
+

+Returns +

a new instance of the System.Security.SecurityException +
+ +
+
+
mono_get_exception_serialization
+ +
MonoException* +mono_get_exception_serialization (const char *msg) + +
+

+Parameters +

msg:
the message to pass to the user
+Returns +
a new instance of the System.Runtime.Serialization.SerializationException +
+ +
+
+
mono_get_exception_stack_overflow
+ +
MonoException* +mono_get_exception_stack_overflow (void) + +
+

+Returns +

a new instance of the System.StackOverflowException +
+ +
+
+
mono_get_exception_synchronization_lock
+ +
MonoException* +mono_get_exception_synchronization_lock (const char *msg) + +
+

+Parameters +

inner:
the inner exception.
+Returns +
a new instance of the System.SynchronizationLockException +
+ +
+
+
mono_get_exception_thread_abort
+ +
MonoException* +mono_get_exception_thread_abort () + +
+

+Returns +

a new instance of the System.Threading.ThreadAbortException. +
+ +
+
+
mono_get_exception_thread_state
+ +
MonoException* +mono_get_exception_thread_state (const char *msg) + +
+

+Parameters +

msg:
the message to present to the user
+Returns +
a new instance of the System.Threading.ThreadStateException +
+ +
+
+
mono_get_exception_type_initialization
+ +
MonoException* +mono_get_exception_type_initialization (const gchar *type_name, MonoException *inner) + +
+

+Parameters +

type_name:
the name of the type that failed to initialize.
inner:
the inner exception.
+Returns +
a new instance of the System.TypeInitializationException +
+ +
+
+
mono_get_exception_type_load
+ +
MonoException* +mono_get_exception_type_load (MonoString *class_name, char *assembly_name) + +
+

+Parameters +

class_name:
the name of the class that could not be loaded
assembly_name:
the assembly where the class was looked up.
+Returns +
a new instance of the System.TypeLoadException. +
+ +
+
+
mono_get_exception_invalid_operation
+ +
MonoException* +mono_get_exception_invalid_operation (const char *msg) + +
+

+Parameters +

msg:
the message to pass to the user
+Returns +
a new instance of the System.InvalidOperationException +
+ +
+
+
mono_get_exception_missing_field
+ +
MonoException* +mono_get_exception_missing_field (const char *class_name, const char *member_name) + +
+

+Parameters +

class_name:
the class where the lookup was performed
member_name:
the name of the missing method.
+Returns +
a new instance of the System.MissingFieldException +
+ +
+
+
mono_get_exception_not_supported
+ +
MonoException* +mono_get_exception_not_supported (const char *msg) + +
+

+Parameters +

msg:
the message to pass to the user
+Returns +
a new instance of the System.NotSupportedException +
+ +
+ +
\ No newline at end of file diff --git a/docs/deploy/mono-api-gc.html b/docs/deploy/mono-api-gc.html new file mode 100644 index 0000000000..047b6cf092 --- /dev/null +++ b/docs/deploy/mono-api-gc.html @@ -0,0 +1,119 @@ + + + + mono-api-gc.html + + + +

Garbage Collector Interface

+ +

Public Interface

+ +

The public interface of the Mono GC is fairly limited, and + its the only one that embedders should be using: + + +

+
mono_gc_collect
+ +
void +mono_gc_collect (int generation) + +
+

+Parameters +

generation:
GC generation identifier
+Remarks +

+ Perform a garbage collection for the given generation, higher numbers + mean usually older objects. Collecting a high-numbered generation + implies collecting also the lower-numbered generations. + The maximum value for generation can be retrieved with a call to + mono_gc_max_generation(), so this function is usually called as: + + mono_gc_collect (mono_gc_max_generation ()); + +

+
+
mono_gc_max_generation
+ +
int +mono_gc_max_generation (void) + +
+

+Returns +

the maximum generation number. +
+Remarks +

+ Get the maximum generation number used by the current garbage + collector. The value will be 0 for the Boehm collector, 1 or more + for the generational collectors. + + +

+
+
mono_gc_get_heap_size
+ +
int64_t +mono_gc_get_heap_size (void) + +
+

+Returns +

the size of the heap in bytes +
+Remarks +

+ Get the amount of memory used by the garbage collector. + + +

+ +
\ No newline at end of file diff --git a/docs/deploy/mono-api-gchandle.html b/docs/deploy/mono-api-gchandle.html new file mode 100644 index 0000000000..84b9fc22dd --- /dev/null +++ b/docs/deploy/mono-api-gchandle.html @@ -0,0 +1,228 @@ + + + + mono-api-gchandle.html + + + +

GC Handles

+ +

Synopsys

+ +
+guint32 mono_gchandle_new (MonoObject *obj, + gboolean pinned); +guint32 mono_gchandle_new_weakref (MonoObject *obj, + gboolean track_resurrection); +MonoObject* mono_gchandle_get_target (guint32 gchandle); +void mono_gchandle_free (guint32 gchandle); + +
+ +

GC handles are wrappers that are used to keep references to + managed objects in the unmanaged space and preventing the + object from being disposed. + +

These are the C equivalents of the System.GCHandle + structure. + +

There are two kinds of GCHandles that can be created: + +

+ +

To retrieve the target address of an object pointed to by a + GCHandle you should use + mono_gchandle_get_target. + +

For example, consider the following C code: +

+static MonoObject* o = NULL; +
+ +

The object in `o' will *NOT* be scanned. + +

If you need to store an object in a C variable and prevent + it from being collected, you need to acquire a GC handle for + it. + +

+ guint32 handle = mono_gchandle_new (my_object, TRUE); +
+ +

TRUE means the object will be pinned, so it won't move in + memory when we'll use a moving GC. You can access the + MonoObject* referenced by a handle with: + +

+ MonoObject* obj = mono_gchandle_get_target (handle); +
+ +

When you don't need the handle anymore you need to call: + +

+ mono_gchandle_free (handle); +
+ +

Note that if you assign a new object to the C var, you need + to get a new handle, it's not enough to store a new object in + the C var. + +

So code that looked like this: + +

+ static MonoObject* o = NULL; + ... + o = mono_object_new (...); + /* use o */ + ... + /* when done to allow the GC to collect o */ + o = NULL; +
+ +

should now be changed to: + +

+ static guint32 o_handle; + ... + MonoObject *o = mono_object_new (...); + o_handle = mono_gchandle_new (o, TRUE); + /* use o or mono_gchandle_get_target (o_handle) */ + ... + /* when done to allow the GC to collect o */ + mono_gchandle_free (o_handle); +
+ + +
+
mono_gchandle_new
+ +
guint32 +mono_gchandle_new (MonoObject *obj, gboolean pinned) + +
+

+Parameters +

obj:
managed object to get a handle for
pinned:
whether the object should be pinned
+Returns +
a handle that can be used to access the object from + + unmanaged code.
+Remarks +

+ This returns a handle that wraps the object, this is used to keep a + reference to a managed object from the unmanaged world and preventing the + object from being disposed. + +

+ If pinned is false the address of the object can not be obtained, if it is + true the address of the object can be obtained. This will also pin the + object so it will not be possible by a moving garbage collector to move the + object. + +

+ +

+
+
mono_gchandle_new_weakref
+ +
guint32 +mono_gchandle_new_weakref (MonoObject *obj, gboolean track_resurrection) + +
+

+Parameters +

obj:
managed object to get a handle for
pinned:
whether the object should be pinned
+Returns +
a handle that can be used to access the object from + + unmanaged code.
+Remarks +

+ This returns a weak handle that wraps the object, this is used to + keep a reference to a managed object from the unmanaged world. + Unlike the mono_gchandle_new the object can be reclaimed by the + garbage collector. In this case the value of the GCHandle will be + set to zero. + +

+ If pinned is false the address of the object can not be obtained, if it is + true the address of the object can be obtained. This will also pin the + object so it will not be possible by a moving garbage collector to move the + object. + +

+ +

+
+
mono_gchandle_get_target
+ +
MonoObject* +mono_gchandle_get_target (guint32 gchandle) + +
+

+Parameters +

gchandle:
a GCHandle's handle.
+Remarks +

+ The handle was previously created by calling mono_gchandle_new or + mono_gchandle_new_weakref. + + Returns a pointer to the MonoObject represented by the handle or + NULL for a collected object if using a weakref handle. + +

+ +
\ No newline at end of file diff --git a/docs/deploy/mono-api-image.html b/docs/deploy/mono-api-image.html new file mode 100644 index 0000000000..cbb8f2dfa9 --- /dev/null +++ b/docs/deploy/mono-api-image.html @@ -0,0 +1,517 @@ + + + + mono-api-image.html + + + +

Image Manipulation

+ +

Images are the component of assemblies that actually hold + the CIL code and metadata + in the extended PE/COFF file. + +

Synopsis

+ +
+#include <metadata/image.h> + +typedef struct _MonoImage MonoImage; +typedef enum { + MONO_IMAGE_OK, + MONO_IMAGE_ERROR_ERRNO, + MONO_IMAGE_MISSING_ASSEMBLYREF, + MONO_IMAGE_IMAGE_INVALID +} MonoImageOpenStatus; + +MonoImage* mono_image_open (const char *fname, + MonoImageOpenStatus *status); + + + +void mono_image_close (MonoImage *image); +void mono_image_addref (MonoImage *image); + + +MonoAssembly* mono_image_get_assembly (MonoImage *image); +guint32 mono_image_get_entry_point (MonoImage *image); +const char* mono_image_get_filename (MonoImage *image); +const char* mono_image_get_name (MonoImage *image); +const char* mono_image_get_resource (MonoImage *image, + guint32 offset, + guint32 *size); + + +gboolean mono_image_is_dynamic (MonoImage *image); + +MonoImage* mono_image_loaded (const char *name); +gpointer mono_image_lookup_resource (MonoImage *image, + guint32 res_id, + guint32 lang_id, + gunichar2 *name); +const char * mono_image_strerror (MonoImageOpenStatus status); +guint32 mono_image_strong_name_position (MonoImage *image, + guint32 *size); +const char* mono_image_get_public_key (MonoImage *image, + guint32 *size); +const char* mono_image_get_strong_name (MonoImage *image, + guint32 *size); +gboolean mono_image_has_authenticode_entry (MonoImage *image); + +int mono_image_ensure_section_idx (MonoImage *image, + int section); +int mono_image_ensure_section (MonoImage *image, + const char *section); + +
+ +

Image APIs

+ +

Images are the actual elements in the runtime that contain + the actual code being executed. + + +

Opening and closing MonoImages

+ + +
+
mono_image_open
+ +
MonoImage* +mono_image_open (const char *fname, MonoImageOpenStatus *status) + +
+

+Parameters +

fname:
filename that points to the module we want to open
status:
An error condition is returned in this field
+Returns +
An open image of type %MonoImage or NULL on error. + + The caller holds a temporary reference to the returned image which should be cleared + when no longer needed by calling mono_image_close (). + if NULL, then check the value of status for details on the error
+ +
+
+
mono_image_open_full
+ +
Prototype: mono_image_open_full
+

+ +

+
+
mono_image_open_from_data
+ +
Prototype: mono_image_open_from_data
+

+ +

+
+
mono_image_open_from_data_full
+ +
Prototype: mono_image_open_from_data_full
+

+ +

+
+
mono_image_close
+ +
void +mono_image_close (MonoImage *image) + +
+

+Parameters +

image:
The image file we wish to close
+Remarks +

+ Closes an image file, deallocates all memory consumed and + unmaps all possible sections of the file + +

+
+
mono_image_addref
+ +
void +mono_image_addref (MonoImage *image) + +
+

+Parameters +

image:
The image file we wish to add a reference to
+Remarks +

+ Increases the reference count of an image. + +

+
+
mono_image_load_file_for_image
+ +
Prototype: mono_image_load_file_for_image
+

+ + +

Image Information

+ + +
+
mono_image_get_guid
+ +
Prototype: mono_image_get_guid
+

+ +

+
+
mono_image_get_assembly
+ +
MonoAssembly* +mono_image_get_assembly (MonoImage *image) + +
+

+Parameters +

image:
the MonoImage.
+Returns +
the assembly that holds this image. +
+Remarks +

+ Use this routine to get the assembly that owns this image. + + +

+
+
mono_image_get_entry_point
+ +
guint32 +mono_image_get_entry_point (MonoImage *image) + +
+

+Parameters +

image:
the image where the entry point will be looked up.
+Returns +
the token for the entry point method in the image +
+Remarks +

+ Use this routine to determine the metadata token for method that + has been flagged as the entry point. + + +

+
+
mono_image_get_filename
+ +
const char* +mono_image_get_filename (MonoImage *image) + +
+

+Parameters +

image:
a MonoImage
+Returns +
the filename. +
+Remarks +

+ Used to get the filename that hold the actual MonoImage + + +

+
+
mono_image_get_name
+ +
const char* +mono_image_get_name (MonoImage *image) + +
+

+Parameters +

name:
a MonoImage
+Returns +
the name of the assembly. +
+ +
+
+
mono_image_get_resource
+ +
const char* +mono_image_get_resource (MonoImage *image, guint32 offset, guint32 *size) + +
+

+Parameters +

image:
the image where the resource will be looked up.
offset:
The offset to add to the resource
size:
a pointer to an int where the size of the resource will be stored
+Returns +
the pointer to the resource whose offset is offset. +
+Remarks +

+ This is a low-level routine that fetches a resource from the + metadata that starts at a given offset. The size parameter is + filled with the data field as encoded in the metadata. + + +

+
+
mono_image_get_table_info
+ +
Prototype: mono_image_get_table_info
+

+ +

+
+
mono_image_get_table_rows
+ +
Prototype: mono_image_get_table_rows
+

+ +

+
+
mono_image_is_dynamic
+ +
gboolean +mono_image_is_dynamic (MonoImage *image) + +
+

+Parameters +

image:
the MonoImage
+Returns +
TRUE if the image was created dynamically, FALSE if not. +
+Remarks +

+ Determines if the given image was created dynamically through the + System.Reflection.Emit API + + +

+
+
mono_image_loaded_by_guid
+ +
Prototype: mono_image_loaded_by_guid
+

+ +

+
+
mono_image_loaded
+ +
MonoImage* +mono_image_loaded (const char *name) + +
+

+Parameters +

name:
name of the image to load
+Returns +
the loaded MonoImage, or NULL on failure. +
+Remarks +

+ This routine ensures that the given image is loaded. + + +

+
+
mono_image_lookup_resource
+ +
gpointer +mono_image_lookup_resource (MonoImage *image, guint32 res_id, guint32 lang_id, gunichar2 *name) + +
+

+Parameters +

image:
the image to look up the resource in
res_id:
A MONO_PE_RESOURCE_ID_ that represents the resource ID to lookup.
lang_id:
The language id.
name:
the resource name to lookup.
+Returns +
NULL if not found, otherwise a pointer to the in-memory representation + + of the given resource. The caller should free it using g_free () when no longer + needed.
+ +
+
+
mono_image_strerror
+ +
const char * +mono_image_strerror (MonoImageOpenStatus status) + +
+

+Parameters +

status:
an code indicating the result from a recent operation
+Returns +
a string describing the error +
+ + +

Public Keys, Strong Names and Certificates

+ + +
+
mono_image_strong_name_position
+ +
guint32 +mono_image_strong_name_position (MonoImage *image, guint32 *size) + +
+

+Parameters +

image:
a MonoImage
size:
a guint32 pointer, or NULL.
+Returns +
the position within the image file where the strong name + + is stored.
+Remarks +

+ If the image has a strong name, and size is not NULL, the value + pointed to by size will have the size of the strong name. + + +

+
+
mono_image_get_public_key
+ +
const char* +mono_image_get_public_key (MonoImage *image, guint32 *size) + +
+

+Parameters +

image:
a MonoImage
size:
a guint32 pointer, or NULL.
+Returns +
NULL if the image does not have a public key, or a pointer + + to the public key.
+Remarks +

+ This is used to obtain the public key in the image. + +

+ If the image has a public key, and size is not NULL, the value + pointed to by size will have the size of the public key. + +

+ +

+
+
mono_image_get_strong_name
+ +
const char* +mono_image_get_strong_name (MonoImage *image, guint32 *size) + +
+

+Parameters +

image:
a MonoImage
size:
a guint32 pointer, or NULL.
+Returns +
NULL if the image does not have a strong name, or a + + pointer to the public key.
+Remarks +

+ If the image has a strong name, and size is not NULL, the value + pointed to by size will have the size of the strong name. + + +

+
+
mono_image_has_authenticode_entry
+ +
gboolean +mono_image_has_authenticode_entry (MonoImage *image) + +
+

+Parameters +

image:
the MonoImage
+Returns +
TRUE if the image contains an authenticode entry in the PE + + directory.
+Remarks +

+ Use this routine to determine if the image has a Authenticode + Certificate Table. + + + +

Low-level features

+ + +
+
mono_image_rva_map
+ +
Prototype: mono_image_rva_map
+

+ +

+
+
mono_image_ensure_section_idx
+ +
int +mono_image_ensure_section_idx (MonoImage *image, int section) + +
+

+Parameters +

image:
The image we are operating on
section:
section number that we will load/map into memory
+Returns +
TRUE on success +
+Remarks +

+ This routine makes sure that we have an in-memory copy of + an image section (.text, .rsrc, .data). + + +

+ +
\ No newline at end of file diff --git a/docs/deploy/mono-api-internal.html b/docs/deploy/mono-api-internal.html new file mode 100644 index 0000000000..ddd03e3771 --- /dev/null +++ b/docs/deploy/mono-api-internal.html @@ -0,0 +1,587 @@ + + + + mono-api-internal.html + + + +

Mono Internals

+ +

This section documents some of the internal APIs used + inside Mono that developers extending or altering Mono might + want to use. + +

Marshalling functions

+ + +
+
mono_marshal_alloc
+ +
Prototype: mono_marshal_alloc
+

+ +

+
+
mono_marshal_asany
+ +
Prototype: mono_marshal_asany
+

+ +

+
+
mono_marshal_free_array
+ +
Prototype: mono_marshal_free_array
+

+ +

+
+
mono_marshal_free_asany
+ +
Prototype: mono_marshal_free_asany
+

+ +

+
+
mono_marshal_free
+ +
Prototype: mono_marshal_free
+

+ +

+
+
mono_marshal_get_castclass
+ +
Prototype: mono_marshal_get_castclass
+

+ +

+
+
mono_marshal_get_delegate_begin_invoke
+ +
Prototype: mono_marshal_get_delegate_begin_invoke
+

+ +

+
+
mono_marshal_get_delegate_end_invoke
+ +
Prototype: mono_marshal_get_delegate_end_invoke
+

+ +

+
+
mono_marshal_get_delegate_invoke
+ +
Prototype: mono_marshal_get_delegate_invoke
+

+ +

+
+
mono_marshal_get_icall_wrapper
+ +
Prototype: mono_marshal_get_icall_wrapper
+

+ +

+
+
mono_marshal_get_isinst
+ +
Prototype: mono_marshal_get_isinst
+

+ +

+
+
mono_marshal_get_ldfld_remote_wrapper
+ +
Prototype: mono_marshal_get_ldfld_remote_wrapper
+

+ +

+
+
mono_marshal_get_ldfld_wrapper
+ +
Prototype: mono_marshal_get_ldfld_wrapper
+

+ +

+
+
mono_marshal_get_managed_wrapper
+ +
Prototype: mono_marshal_get_managed_wrapper
+

+ +

+
+
mono_marshal_get_native_wrapper
+ +
MonoMethod* +mono_marshal_get_native_wrapper (MonoMethod *method, gboolean check_exceptions, gboolean aot) + +
+

+Parameters +

method:
The MonoMethod to wrap.
check_exceptions:
Whenever to check for pending exceptions
+Remarks +

+ generates IL code for the pinvoke wrapper (the generated method + calls the unmanaged code in piinfo->addr) + The wrapper info for the wrapper is a WrapperInfo structure. + +

+
+
mono_marshal_get_proxy_cancast
+ +
Prototype: mono_marshal_get_proxy_cancast
+

+ +

+
+
mono_marshal_get_ptr_to_struct
+ +
MonoMethod* +mono_marshal_get_ptr_to_struct (MonoClass *klass) + +
+

+Parameters +

klass:
+Remarks +

+ generates IL code for PtrToStructure (IntPtr src, object structure) + The wrapper info for the wrapper is a WrapperInfo structure. + +

+
+
mono_marshal_get_remoting_invoke_for_target
+ +
Prototype: mono_marshal_get_remoting_invoke_for_target
+

+ +

+
+
mono_marshal_get_remoting_invoke
+ +
Prototype: mono_marshal_get_remoting_invoke
+

+ +

+
+
mono_marshal_get_remoting_invoke_with_check
+ +
Prototype: mono_marshal_get_remoting_invoke_with_check
+

+ +

+
+
mono_marshal_get_runtime_invoke
+ +
Prototype: mono_marshal_get_runtime_invoke
+

+ +

+
+
mono_marshal_get_stelemref
+ +
Prototype: mono_marshal_get_stelemref
+

+ +

+
+
mono_marshal_get_stfld_remote_wrapper
+ +
Prototype: mono_marshal_get_stfld_remote_wrapper
+

+ +

+
+
mono_marshal_get_stfld_wrapper
+ +
Prototype: mono_marshal_get_stfld_wrapper
+

+ +

+
+
mono_marshal_get_struct_to_ptr
+ +
MonoMethod* +mono_marshal_get_struct_to_ptr (MonoClass *klass) + +
+

+Parameters +

klass:
+Remarks +

+ generates IL code for StructureToPtr (object structure, IntPtr ptr, bool fDeleteOld) + The wrapper info for the wrapper is a WrapperInfo structure. + +

+
+
mono_marshal_get_synchronized_wrapper
+ +
Prototype: mono_marshal_get_synchronized_wrapper
+

+ +

+
+
mono_marshal_get_unbox_wrapper
+ +
Prototype: mono_marshal_get_unbox_wrapper
+

+ +

+
+
mono_marshal_get_xappdomain_invoke
+ +
Prototype: mono_marshal_get_xappdomain_invoke
+

+ +

+
+
mono_marshal_load_type_info
+ +
MonoMarshalType* +mono_marshal_load_type_info (MonoClass* klass) + +
+

+Remarks +

+ Initialize klass->marshal_info using information from metadata. This function can + recursively call itself, and the caller is responsible to avoid that by calling + mono_marshal_is_loading_type_info () beforehand. + + LOCKING: Acquires the loader lock. + +

+
+
mono_marshal_method_from_wrapper
+ +
Prototype: mono_marshal_method_from_wrapper
+

+ +

+
+
mono_marshal_realloc
+ +
Prototype: mono_marshal_realloc
+

+ +

+
+
mono_marshal_set_last_error
+ +
void +mono_marshal_set_last_error (void) + +
+

+Remarks +

+ This function is invoked to set the last error value from a P/Invoke call + which has SetLastError set. + +

+
+
mono_marshal_type_size
+ +
Prototype: mono_marshal_type_size
+

+ + +

Metadata Loading Errors

+ +

The routines in this section are used to cope with errors + during metadata loading. Errors in metadata handling can + happen for many reason, and these include (this is not an + exhaustive list). + +

    +
  • An assembly referenced is missing. +
  • Fields referenced are missing. +
  • Methods referenced are missing. +
+ +

The mono_loader_set_* routines are invoked during + metadata loading to flag that an error has happened. The + class loading errros are flagged in a per-thread basis. + +

In various spots in the runtime the + mono_loader_get_last_error routine is called to check + if there was a problem, and then errors are propagated upwards + on the stack until we reach a point where an exception can be + raised and no runtime locks are held. + +

The mono_loader_error_prepare_exception takes a + MonoLoaderError structure (the value returned from + mono_loader_get_last_error), turns that into an + exception and clears the error condition from the current + thread. + + +

+
mono_loader_set_error_field_load
+ +
Prototype: mono_loader_set_error_field_load
+

+ +

+
+
mono_loader_set_error_method_load
+ +
Prototype: mono_loader_set_error_method_load
+

+ +

+
+
mono_loader_set_error_type_load
+ +
void +mono_loader_set_error_type_load (const char *class_name, const char *assembly_name) + +
+

+Remarks +

+ Set the loader error for this thread. + + +

+
+
mono_loader_get_last_error
+ +
Prototype: mono_loader_get_last_error
+

+ +

+
+
mono_loader_clear_error
+ +
void +mono_loader_clear_error (void) + +
+

+Remarks +

+ Disposes any loader error messages on this thread + +

+
+
mono_loader_error_prepare_exception
+ +
MonoException* +mono_loader_error_prepare_exception (MonoLoaderError *error) + +
+

+Parameters +

error:
The MonoLoaderError to turn into an exception
+Remarks +

+ This turns a MonoLoaderError into an exception that can be thrown + and resets the Mono Loader Error state during this process. + + + +

Metadata Loader Locking: Internals

+ +

The locking functions here are used by code in class.c and + metadata.c to lock access to the shared hashtables inside the + MonoImage. + + +

+
mono_loader_lock
+ +
void +mono_loader_lock (void) + +
+

+Remarks +

+ See docs/thread-safety.txt for the locking strategy. + +

+
+
mono_loader_unlock
+ +
Prototype: mono_loader_unlock
+

+ + +

Garbage Collector Internal Interface

+ +

The internal interface of the Mono GC is the interface used + between the runtime engine and the garbage collector. + + +

+
mono_gc_disable
+ +
Prototype: mono_gc_disable
+

+ +

+
+
mono_gc_enable
+ +
Prototype: mono_gc_enable
+

+ +

+
+
mono_gc_is_finalizer_thread
+ +
gboolean +mono_gc_is_finalizer_thread (MonoThread *thread) + +
+

+Parameters +

thread:
the thread to test.
+Remarks +

+ In Mono objects are finalized asynchronously on a separate thread. + This routine tests whether the thread argument represents the + finalization thread. + +

+ Returns true if thread is the finalization thread. + +

+
+
mono_gc_out_of_memory
+ +
Prototype: mono_gc_out_of_memory
+

+ +

+
+
mono_gc_start_world
+ +
Prototype: mono_gc_start_world
+

+ +

+
+
mono_gc_stop_world
+ +
Prototype: mono_gc_stop_world
+

+ +

+
+
mono_gc_alloc_fixed
+ +
Prototype: mono_gc_alloc_fixed
+

+ +

+
+
mono_gc_enable_events
+ +
Prototype: mono_gc_enable_events
+

+ +

+
+
mono_gc_free_fixed
+ +
Prototype: mono_gc_free_fixed
+

+ +

+
+
mono_gc_make_descr_from_bitmap
+ +
Prototype: mono_gc_make_descr_from_bitmap
+

+ + + +

+
+
mono_gc_base_init
+ +
Prototype: mono_gc_base_init
+

+ +

+
+
mono_gc_invoke_finalizers
+ +
Prototype: mono_gc_invoke_finalizers
+

+ +

+
+
mono_gc_is_gc_thread
+ +
Prototype: mono_gc_is_gc_thread
+

+ +

+
+
mono_gc_pending_finalizers
+ +
Prototype: mono_gc_pending_finalizers
+

+ +

+
+
mono_gc_register_thread
+ +
Prototype: mono_gc_register_thread
+

+ +

+ +
\ No newline at end of file diff --git a/docs/deploy/mono-api-jit.html b/docs/deploy/mono-api-jit.html new file mode 100644 index 0000000000..471c46cc84 --- /dev/null +++ b/docs/deploy/mono-api-jit.html @@ -0,0 +1,141 @@ + + + + mono-api-jit.html + + + +

Synopsis

+ +
+G_GNUC_UNUSED char * mono_pmip (void *ip); +void mono_print_method_from_ip (void *ip); + +void mono_threads_request_thread_dump (void); + + +
+ +

Useful Debugging Functions

+ +

These functions are useful when running the Mono VM inside + a debugger. + + +

+
mono_pmip
+ +
G_GNUC_UNUSED char * +mono_pmip (void *ip) + +
+

+Parameters +

ip:
an instruction pointer address
+Returns +
the name of the method at address ip. +
+Remarks +

+ This method is used from a debugger to get the name of the + method at address ip. This routine is typically invoked from + a debugger like this: + + (gdb) print mono_pmip ($pc) + + +

+
+
mono_print_method_from_ip
+ +
#ifdef __GNUC__ +/* Prevent the linker from optimizing this away in embedding setups to help debugging */ + __attribute__((used)) +#endif +void +mono_print_method_from_ip (void *ip) + +
+

+Parameters +

ip:
an instruction pointer address
+Remarks +

+ This method is used from a debugger to get the name of the + method at address ip. + + This prints the name of the method at address ip in the standard + output. Unlike mono_pmip which returns a string, this routine + prints the value on the standard output. + +

+
+
mono_print_thread_dump
+ +
Prototype: mono_print_thread_dump
+

+ +

+
+
mono_threads_request_thread_dump
+ +
void +mono_threads_request_thread_dump (void) + +
+

+Remarks +

+ Ask all threads except the current to print their stacktrace to stdout. + + +

Helper Tools For Native Ports

+ + + +
\ No newline at end of file diff --git a/docs/deploy/mono-api-jitinternal.html b/docs/deploy/mono-api-jitinternal.html new file mode 100644 index 0000000000..476c9d7f9f --- /dev/null +++ b/docs/deploy/mono-api-jitinternal.html @@ -0,0 +1,247 @@ + + + + mono-api-jitinternal.html + + + +

Notification Interface

+ +

This is an internal profiler interface. In general, users + would not be using this interface, but would be using the + profiler interface. + +

These methods must be called to notify the profiler of an + event that must be recorded. Mono's JIT engine currently + calls these routines, but if you are extending Mono in some + way these are the methods that you might invoke to notify the + profiler of an event. + + +

+
mono_profiler_load
+ +
void +mono_profiler_load (const char *desc) + +
+

+Parameters +

desc:
arguments to configure the profiler
+Remarks +

+ Invoke this method to initialize the profiler. This will drive the + loading of the internal ("default") or any external profilers. + + This routine is invoked by Mono's driver, but must be called manually + if you embed Mono into your application. + +

+
+
mono_profiler_allocation
+ +
Prototype: mono_profiler_allocation
+

+ +

+
+
mono_profiler_stat_hit
+ +
Prototype: mono_profiler_stat_hit
+

+ +

+
+
mono_profiler_thread_start
+ +
Prototype: mono_profiler_thread_start
+

+ +

+
+
mono_profiler_thread_end
+ +
Prototype: mono_profiler_thread_end
+

+ +

+
+
mono_profiler_appdomain_event
+ +
Prototype: mono_profiler_appdomain_event
+

+ +

+
+
mono_profiler_appdomain_loaded
+ +
Prototype: mono_profiler_appdomain_loaded
+

+ +

+
+
mono_profiler_assembly_event
+ +
Prototype: mono_profiler_assembly_event
+

+ +

+
+
mono_profiler_assembly_loaded
+ +
Prototype: mono_profiler_assembly_loaded
+

+ +

+
+
mono_profiler_class_event
+ +
Prototype: mono_profiler_class_event
+

+ +

+
+
mono_profiler_class_loaded
+ +
Prototype: mono_profiler_class_loaded
+

+ +

+
+
mono_profiler_code_transition
+ +
Prototype: mono_profiler_code_transition
+

+ +

+
+
mono_profiler_method_end_jit
+ +
Prototype: mono_profiler_method_end_jit
+

+ +

+
+
mono_profiler_method_enter
+ +
Prototype: mono_profiler_method_enter
+

+ +

+
+
mono_profiler_method_jit
+ +
Prototype: mono_profiler_method_jit
+

+ +

+
+
mono_profiler_method_leave
+ +
Prototype: mono_profiler_method_leave
+

+ +

+
+
mono_profiler_module_event
+ +
Prototype: mono_profiler_module_event
+

+ +

+
+
mono_profiler_module_loaded
+ +
Prototype: mono_profiler_module_loaded
+

+ +

+
+
mono_profiler_shutdown
+ +
Prototype: mono_profiler_shutdown
+

+ +

+
+
mono_profiler_startup
+ +
Prototype: mono_profiler_startup
+

+ +

+
+
mono_profiler_gc_event
+ +
Prototype: mono_profiler_gc_event
+

+ +

+
+
mono_profiler_gc_heap_resize
+ +
Prototype: mono_profiler_gc_heap_resize
+

+ +

+
+
mono_profiler_gc_event
+ +
Prototype: mono_profiler_gc_event
+

+ +

+
+
mono_profiler_gc_heap_resize
+ +
Prototype: mono_profiler_gc_heap_resize
+

+ +

+ +
\ No newline at end of file diff --git a/docs/deploy/mono-api-marshal.html b/docs/deploy/mono-api-marshal.html new file mode 100644 index 0000000000..22d1b8f898 --- /dev/null +++ b/docs/deploy/mono-api-marshal.html @@ -0,0 +1,78 @@ + + + + mono-api-marshal.html + + + + + + +
+
mono_delegate_free_ftnptr
+ +
Prototype: mono_delegate_free_ftnptr
+

+ +

+
+
mono_delegate_to_ftnptr
+ +
Prototype: mono_delegate_to_ftnptr
+

+ +

+
+
mono_ftnptr_to_delegate
+ +
Prototype: mono_ftnptr_to_delegate
+

+ +

+ +
\ No newline at end of file diff --git a/docs/deploy/mono-api-metadata.html b/docs/deploy/mono-api-metadata.html new file mode 100644 index 0000000000..39d59d5d88 --- /dev/null +++ b/docs/deploy/mono-api-metadata.html @@ -0,0 +1,1313 @@ + + + + mono-api-metadata.html + + + +

Metadata Reading

+ +

The Metadata API gives developers low-level access to the + information encoded in CLI modules: type and + methods definitions encoded in metadata as well as access to + the CIL code and embedded resources. + +

Managed developers access this information using either the + System.Reflection API or a library + like Cecil. + +

To start using the Metadata API it is necessary + to open an + assembly or a CIL image (a .dll or .exe file) using one of + the + CIL image + opening API calls. + +

Metadata Heaps

+ +

ECMA CLI images contain four heaps that store different + kinds of information, these are: + +

+ +

The ECMA file format also has an extra section called the + "#~" stream, this stream is the one that holds the metadata + tables. There is a high-level API to get access to the + contents of this API, described in the + section Metadata Tables. + + +

+
mono_metadata_guid_heap
+ +
const char * +mono_metadata_guid_heap (MonoImage *meta, guint32 index) + +
+

+Parameters +

meta:
metadata context
index:
index into the guid heap.
+Returns +
an in-memory pointer to the index in the guid heap. +
+ +
+
+
mono_metadata_string_heap
+ +
const char * +mono_metadata_string_heap (MonoImage *meta, guint32 index) + +
+

+Parameters +

meta:
metadata context
index:
index into the string heap.
+Returns +
an in-memory pointer to the index in the string heap. +
+ +
+
+
mono_metadata_blob_heap
+ +
const char * +mono_metadata_blob_heap (MonoImage *meta, guint32 index) + +
+

+Parameters +

meta:
metadata context
index:
index into the blob.
+Returns +
an in-memory pointer to the index in the Blob heap. +
+ +
+
+
mono_metadata_user_string
+ +
const char * +mono_metadata_user_string (MonoImage *meta, guint32 index) + +
+

+Parameters +

meta:
metadata context
index:
index into the user string heap.
+Returns +
an in-memory pointer to the index in the user string heap ("US"). +
+ +
+
+
mono_metadata_decode_blob_size
+ +
guint32 +mono_metadata_decode_blob_size (const char *xptr, const char **rptr) + +
+

+Parameters +

ptr:
pointer to a blob object
rptr:
the new position of the pointer
+Returns +
the size of the blob object +
+Remarks +

+ This decodes a compressed size as described by 23.1.4 (a blob or user string object) + + + + +

Metadata Tables

+ +

Metadata is encoded in a number of tables included on every + CIL image. These tables contain type definitions, member + definitions and so on, these constants are defined in the ECMA 335 + specification Partition II section 22. The following table + shows the C constants defined in the Mono runtime and how they + map to the equivalent ECMA CLI metadata table: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ ECMA CLI Table Name + + C Constant Name + + Table Schema (Array Size + Columns Constants) +
AssemblyMONO_TABLE_ASSEMBLY +Array size: +MONO_ASSEMBLY_SIZE +
    +
  • MONO_ASSEMBLY_HASH_ALG +
  • MONO_ASSEMBLY_MAJOR_VERSION +
  • MONO_ASSEMBLY_MINOR_VERSION +
  • MONO_ASSEMBLY_BUILD_NUMBER +
  • MONO_ASSEMBLY_REV_NUMBER +
  • MONO_ASSEMBLY_FLAGS +
  • MONO_ASSEMBLY_PUBLIC_KEY +
  • MONO_ASSEMBLY_NAME +
  • MONO_ASSEMBLY_CULTURE +
+
AssemblyOSMONO_TABLE_ASSEMBLYOS +Array size: +MONO_ASSEMBLYOS_SIZE +
    +
  • MONO_ASSEMBLYOS_PLATFORM +
  • MONO_ASSEMBLYOS_MAJOR_VERSION +
  • MONO_ASSEMBLYOS_MINOR_VERSION +
+
AssemblyProcessorMONO_TABLE_ASSEMBLYPROCESSORArray +size: MONO_ASSEMBLYPROCESSOR_SIZE +
    +
  • MONO_ASSEMBLY_PROCESSOR +
+
AssemblyRefMONO_TABLE_ASSEMBLYREF +Array size: +MONO_ASSEMBLYREF_SIZE +
    +
  • MONO_ASSEMBLYREF_MAJOR_VERSION +
  • MONO_ASSEMBLYREF_MINOR_VERSION +
  • MONO_ASSEMBLYREF_BUILD_NUMBER +
  • MONO_ASSEMBLYREF_REV_NUMBER +
  • MONO_ASSEMBLYREF_FLAGS +
  • MONO_ASSEMBLYREF_PUBLIC_KEY +
  • MONO_ASSEMBLYREF_NAME +
  • MONO_ASSEMBLYREF_CULTURE +
  • MONO_ASSEMBLYREF_HASH_VALUE +
+
AssemblyRefProcessorMONO_TABLE_ASSEMBLYREFPROCESSORArray +size: MONO_ASSEMBLYREFPROC_SIZE +
    +
  • MONO_ASSEMBLYREFPROC_PROCESSOR +
  • MONO_ASSEMBLYREFPROC_ASSEMBLYREF +
+
AssemblyRefOSMONO_TABLE_ASSEMBLYREFOS +Array size: +
  • MONO_ASSEMBLYREFOS_SIZE +
      +
    • MONO_ASSEMBLYREFOS_PLATFORM +
    • MONO_ASSEMBLYREFOS_MAJOR_VERSION +
    • MONO_ASSEMBLYREFOS_MINOR_VERSION +
    • MONO_ASSEMBLYREFOS_ASSEMBLYREF +
    +
  • ClassLayoutMONO_TABLE_CLASSLAYOUT +Array size: +MONO_CLASSLAYOUT_SIZE +
      +
    • MONO_CLASS_LAYOUT_PACKING_SIZE +
    • MONO_CLASS_LAYOUT_CLASS_SIZE +
    • MONO_CLASS_LAYOUT_PARENT +
    +
    ConstantMONO_TABLE_CONSTANT +Array size: +MONO_CONSTANT_SIZE +
      +
    • MONO_CONSTANT_TYPE +
    • MONO_CONSTANT_PADDING +
    • MONO_CONSTANT_PARENT +
    • MONO_CONSTANT_VALUE +
    +
    CustomAttributeMONO_TABLE_CUSTOMATTRIBUTE +Array size: +MONO_CUSTOM_ATTR_SIZE +
      +
    • MONO_CUSTOM_ATTR_PARENT +
    • MONO_CUSTOM_ATTR_TYPE +
    • MONO_CUSTOM_ATTR_VALUE +
    +
    DeclSecurityMONO_TABLE_DECLSECURITY +Array size: +MONO_DECL_SECURITY_SIZE +
      +
    • MONO_DECL_SECURITY_ACTION +
    • MONO_DECL_SECURITY_PARENT +
    • MONO_DECL_SECURITY_PERMISSIONSET +
    +
    EventMapMONO_TABLE_EVENTMAP +Array size: +MONO_EVENT_MAP_SIZE +
      +
    • MONO_EVENT_MAP_PARENT +
    • MONO_EVENT_MAP_EVENTLIST +
    +
    EventPtrMONO_TABLE_EVENT_POINTER +Array size: +MONO_EVENT_POINTER_SIZE +
      +
    • MONO_EVENT_POINTER_EVENT +
    +
    EventMONO_TABLE_EVENT +Array size: MONO_EVENT_SIZE +
      +
    • MONO_EVENT_FLAGS +
    • MONO_EVENT_NAME +
    • MONO_EVENT_TYPE +
    +
    ExportedTypeMONO_TABLE_EXPORTEDTYPE +Array size: +MONO_EXPORTEDTYPE_SIZE +
      +
    • MONO_EXP_TYPE_FLAGS +
    • MONO_EXP_TYPE_TYPEDEF +
    • MONO_EXP_TYPE_NAME +
    • MONO_EXP_TYPE_NAMESPACE +
    • MONO_EXP_TYPE_IMPLEMENTATION +
    +
    FieldMONO_TABLE_FIELD +Array size: MONO_FIELD_SIZE +
      +
    • MONO_FIELD_FLAGS +
    • MONO_FIELD_NAME +
    • MONO_FIELD_SIGNATURE +
    +
    FieldLayouttMONO_TABLE_FIELDLAYOUT +Array size: +MONO_FIELDLAYOUT_SIZE +
      +
    • MONO_FIELD_LAYOUT_OFFSET +
    • MONO_FIELD_LAYOUT_FIELD +
    +
    FieldMarshalMONO_TABLE_FIELDMARSHAL +Array size: +MONO_FIELD_MARSHAL_SIZE +
      +
    • MONO_FIELD_MARSHAL_PARENT +
    • MONO_FIELD_MARSHAL_NATIVE_TYPE +
    +
    FieldPtrMONO_TABLE_FIELD_POINTER +Array size: +MONO_FIELD_POINTER_SIZE +
      +
    • MONO_FIELD_POINTER_FIELD +
    +
    FieldRVAMONO_TABLE_FIELDRVA +Array size: +MONO_FIELDRVA_SIZE +
      +
    • MONO_FIELD_RVA_RVA +
    • MONO_FIELD_RVA_FIELD +
    +
    FileMONO_TABLE_FILE +Array size: MONO_FILE_SIZE +
      +
    • MONO_FILE_FLAGS +
    • MONO_FILE_NAME +
    • MONO_FILE_HASH_VALUE +
    +
    GenericParamMONO_TABLE_GENERICPARAM +Array size: +MONO_GENERICPARAM_SIZE +
      +
    • MONO_GENERICPARAM_NUMBER +
    • MONO_GENERICPARAM_FLAGS +
    • MONO_GENERICPARAM_OWNER +
    • MONO_GENERICPARAM_NAME +
    +
    GenericParamConstraintMONO_TABLE_GENERICPARAMCONSTRAINTArray +size: MONO_GENERICPARAMCONSTRAINT_SIZE +
      +
    • MONO_GENPARCONSTRAINT_GENERICPAR +
    • MONO_GENPARCONSTRAINT_CONSTRAINT +
    +
    ImplMapMONO_TABLE_IMPLMAP +Array size: +MONO_IMPLMAP_SIZE +
      +
    • MONO_IMPLMAP_FLAGS +
    • MONO_IMPLMAP_MEMBER +
    • MONO_IMPLMAP_NAME +
    • MONO_IMPLMAP_SCOPE +
    +
    InterfaceImplMONO_TABLE_INTERFACEIMPL +Array size: +
  • MONO_INTERFACEIMPL_SIZE +
      +
    • MONO_INTERFACEIMPL_CLASS +
    • MONO_INTERFACEIMPL_INTERFACE +
    +
  • ManifestResourceMONO_TABLE_MANIFESTRESOURCEArray +size: MONO_MANIFESTRESOURCE_SIZE +
      +
    • MONO_MANIFEST_OFFSET +
    • MONO_MANIFEST_FLAGS +
    • MONO_MANIFEST_NAME +
    • MONO_MANIFEST_IMPLEMENTATION +
    +
    MemberRefMONO_TABLE_MEMBERREF +Array size: +MONO_MEMBERREF_SIZE +
      +
    • MONO_MEMBERREF_CLASS +
    • MONO_MEMBERREF_NAME +
    • MONO_MEMBERREF_SIGNATURE +
    +
    MethodImplMONO_TABLE_METHODIMPL +Array size: +MONO_METHODIMPL_SIZE +
      +
    • MONO_METHODIMPL_CLASS +
    • MONO_METHODIMPL_BODY +
    • MONO_METHODIMPL_DECLARATION +
    +
    MethodSpecMONO_TABLE_METHODSPEC +Array size: +MONO_METHODSPEC_SIZE +
      +
    • MONO_METHODSPEC_METHOD +
    • MONO_METHODSPEC_SIGNATURE +
    +
    MethodSemanticsMONO_TABLE_METHODSEMANTICSArray +size: MONO_METHOD_SEMA_SIZE +
      +
    • MONO_METHOD_SEMA_SEMANTICS +
    • MONO_METHOD_SEMA_METHOD +
    • MONO_METHOD_SEMA_ASSOCIATION +
    +
    ModulerefMONO_TABLE_MODULEREF +Array size: +MONO_MODULEREF_SIZE +
      +
    • MONO_MODULEREF_NAME +
    +
    ModuleMONO_TABLE_MODULE +Array size: +MONO_MODULE_SIZE +
    +Columns: +
      +
    • MONO_MODULE_GENERATION +
    • MONO_MODULE_NAME +
    • MONO_MODULE_MVID +
    • MONO_MODULE_ENC +
    • MONO_MODULE_ENCBASE +
    +
    TypeRefMONO_TABLE_TYPEREF +Array size: +MONO_TYPEREF_SIZE +
      +
    • MONO_TYPEREF_SCOPE +
    • MONO_TYPEREF_NAME +
    • MONO_TYPEREF_NAMESPACE +
    +
    MethodPtrMONO_TABLE_METHOD_POINTER +Array size: +MONO_METHOD_POINTER_SIZE +
      +
    • MONO_METHOD_POINTER_METHOD +
    +
    MethodMONO_TABLE_METHOD +Array size: +MONO_METHOD_SIZE +
      +
    • MONO_METHOD_RVA +
    • MONO_METHOD_IMPLFLAGS +
    • MONO_METHOD_FLAGS +
    • MONO_METHOD_NAME +
    • MONO_METHOD_SIGNATURE +
    • MONO_METHOD_PARAMLIST +
    +
    NestedClassMONO_TABLE_NESTEDCLASS +Array size: +MONO_NESTEDCLASS_SIZE +
      +
    • MONO_NESTED_CLASS_NESTED +
    • MONO_NESTED_CLASS_ENCLOSING +
    +
    ParamPtrMONO_TABLE_PARAM_POINTER +Array size: +MONO_PARAM_POINTER_SIZE +
      +
    • MONO_PARAM_POINTER_PARAM +
    +
    ParamMONO_TABLE_PARAM +Array size: MONO_PARAM_SIZE +
      +
    • MONO_PARAM_FLAGS +
    • MONO_PARAM_SEQUENCE +
    • MONO_PARAM_NAME +
    +
    PropertyMapMONO_TABLE_PROPERTYMAP +Array size: +MONO_PROPERTY_MAP_SIZE +
      +
    • MONO_PROPERTY_MAP_PARENT +
    • MONO_PROPERTY_MAP_PROPERTY_LIST +
    +
    PropertyPtrMONO_TABLE_PROPERTY_POINTERArray +size: MONO_PROPERTY_POINTER_SIZE +
      +
    • MONO_PROPERTY_POINTER_PROPERTY +
    +
    PropertyMONO_TABLE_PROPERTY +Array size: +MONO_PROPERTY_SIZE +
      +
    • MONO_PROPERTY_FLAGS +
    • MONO_PROPERTY_NAME +
    • MONO_PROPERTY_TYPE +
    +
    StandaloneSigMONO_TABLE_STANDALONESIG +Array size: +
  • MONO_STAND_ALONE_SIGNATURE_SIZE +
      +
    • MONO_STAND_ALONE_SIGNATURE +
    +
  • TypeDefMONO_TABLE_TYPEDEF +Array size: +MONO_TYPEDEF_SIZE +
      +
    • MONO_TYPEDEF_FLAGS +
    • MONO_TYPEDEF_NAME +
    • MONO_TYPEDEF_NAMESPACE +
    • MONO_TYPEDEF_EXTENDS +
    • MONO_TYPEDEF_FIELD_LIST +
    • MONO_TYPEDEF_METHOD_LIST +
    +
    TypeSpecMONO_TABLE_TYPESPEC +Array size: +MONO_TYPESPEC_SIZE +
      +
    • MONO_TYPESPEC_SIGNATURE +
    +
    +
    + +

    Each table can contain zero or more rows, you must call the + mono_metadata_table_rows + to obtain the number of rows in a table, and then you can + extract individual row values by using + the mono_metadata_decode_row + or + the mono_metadata_decode_row_col. + When decoding rows you must provide an guint32 array large + enough to hold as many columns as the table contains. + +

    The metadata tables are stored in the MonoImage, you obtain + a pointer to the MonoTableInfo by calling + the mono_image_get_table_info + and then you can scan those tables, for example: + +

    +	/*
    +	 * Dumps a few fields from the AssemblyRef table
    +	 */
    +	void DumpAssemblyRefs (MonoImage *image)
    +	{
    +		/* Get a pointer to the AssemblyRef metadata table */
    +		MonoTableInfo *t = mono_image_get_table_info (image, MONO_TABLE_ASSEMBLYREF);
    +
    +		/* Fetch the number of rows available in the table */
    +		int rows = mono_table_info_get_rows (t);
    +		int i;
    +
    +		/* For each row, print some of its values */
    +		for (i = 0; i < rows; i++){
    +			/* Space where we extract one row from the metadata table */
    +			guint32 cols [MONO_ASSEMBLYREF_SIZE];
    +
    +			/* Extract the row into the array cols */
    +			mono_metadata_decode_row (t, i, cols, MONO_ASSEMBLYREF_SIZE);
    +
    +			fprintf (output, "%d: Version=%d.%d.%d.%d\n\tName=%s\n", i + 1,
    +                        	cols [MONO_ASSEMBLYREF_MAJOR_VERSION],
    +                        	cols [MONO_ASSEMBLYREF_MINOR_VERSION],
    +                        	cols [MONO_ASSEMBLYREF_BUILD_NUMBER],
    +                        	cols [MONO_ASSEMBLYREF_REV_NUMBER],
    +                        	mono_metadata_string_heap (image, cols [MONO_ASSEMBLYREF_NAME]));
    +		}
    +	}
    +	
    + +

    The above program shows the following output when ran on + the C# compiler: + +

    +	1: Version=1.0.5000.0
    +		Name=mscorlib
    +	2: Version=1.0.5000.0
    +		Name=System
    +	3: Version=1.0.5000.0
    +		Name=System.Xml
    +	
    + +

    + +

    Metadata Tables API

    + +

    These are the APIs for dealing with tables: + + +

    +
    mono_image_get_table_info
    + +
    Prototype: mono_image_get_table_info
    +

    + +

    +
    +
    mono_image_get_table_rows
    + +
    Prototype: mono_image_get_table_rows
    +

    + +

    +
    +
    mono_metadata_get_table
    + +
    Prototype: mono_metadata_get_table
    +

    + +

    +
    +
    mono_metadata_decode_row_col
    + +
    guint32 +mono_metadata_decode_row_col (const MonoTableInfo *t, int idx, guint col) + +
    +

    +Parameters +

    t:
    table to extract information from.
    idx:
    index for row in table.
    col:
    column in the row.
    +Remarks +

    + This function returns the value of column col from the idx + row in the table t. + +

    +
    +
    mono_metadata_decode_row
    + +
    void +mono_metadata_decode_row (const MonoTableInfo *t, int idx, guint32 *res, int res_size) + +
    +

    +Parameters +

    t:
    table to extract information from.
    idx:
    index in table.
    res:
    array of res_size cols to store the results in
    +Remarks +

    + This decompresses the metadata element idx in table t + into the guint32 res array that has res_size elements + +

    +
    +
    mono_metadata_compute_size
    + +
    Prototype: mono_metadata_compute_size
    +

    + +

    +
    +
    mono_metadata_custom_attrs_from_index
    + +
    Prototype: mono_metadata_custom_attrs_from_index
    +

    + +

    +
    +
    mono_metadata_decode_signed_value
    + +
    gint32 +mono_metadata_decode_signed_value (const char *ptr, const char **rptr) + +
    +

    +Parameters +

    ptr:
    pointer to decode from
    rptr:
    the new position of the pointer
    +Returns +
    the decoded value +
    +Remarks +

    + This routine decompresses 32-bit signed values + (not specified in the spec) + + +

    +
    +
    mono_metadata_decode_value
    + +
    guint32 +mono_metadata_decode_value (const char *_ptr, const char **rptr) + +
    +

    +Parameters +

    ptr:
    pointer to decode from
    rptr:
    the new position of the pointer
    +Returns +
    the decoded value +
    +Remarks +

    + This routine decompresses 32-bit values as specified in the "Blob and + Signature" section (22.2) + + +

    +
    +
    mono_metadata_encode_value
    + +
    Prototype: mono_metadata_encode_value
    +

    + + +

    Metadata access API

    + +

    This is the low-level API for accessing the metadata + images. + + +

    +
    mono_cli_rva_image_map
    + +
    Prototype: mono_cli_rva_image_map
    +

    + +

    +
    +
    mono_pe_file_open
    + +
    MonoImage* +mono_pe_file_open (const char *fname, MonoImageOpenStatus *status) + +
    +

    +Parameters +

    fname:
    filename that points to the module we want to open
    status:
    An error condition is returned in this field
    +Returns +
    An open image of type %MonoImage or NULL on error. if + + NULL, then check the value of status for details on the error. + This variant for mono_image_open DOES NOT SET UP CLI METADATA. + It's just a PE file loader, used for FileVersionInfo. It also does + not use the image cache.
    + +
    +
    +
    mono_metadata_events_from_typedef
    + +
    Prototype: mono_metadata_events_from_typedef
    +

    + +

    +
    +
    mono_metadata_field_info
    + +
    Prototype: mono_metadata_field_info
    +

    + +

    +
    +
    mono_metadata_free_array
    + +
    Prototype: mono_metadata_free_array
    +

    + +

    +
    +
    mono_metadata_free_marshal_spec
    + +
    Prototype: mono_metadata_free_marshal_spec
    +

    + +

    +
    +
    mono_metadata_free_mh
    + +
    Prototype: mono_metadata_free_mh
    +

    + +

    +
    +
    mono_metadata_free_type
    + +
    Prototype: mono_metadata_free_type
    +

    + +

    +
    +
    mono_metadata_get_constant_index
    + +
    Prototype: mono_metadata_get_constant_index
    +

    + +

    +
    +
    mono_metadata_get_marshal_info
    + +
    Prototype: mono_metadata_get_marshal_info
    +

    + +

    +
    +
    mono_metadata_implmap_from_method
    + +
    Prototype: mono_metadata_implmap_from_method
    +

    + +

    +
    +
    mono_metadata_interfaces_from_typedef
    + +
    Prototype: mono_metadata_interfaces_from_typedef
    +

    + +

    +
    +
    mono_metadata_locate
    + +
    const char * +mono_metadata_locate (MonoImage *meta, int table, int idx) + +
    +

    +Parameters +

    meta:
    metadata context
    table:
    table code.
    idx:
    index of element to retrieve from table.
    +Returns +
    a pointer to the idx element in the metadata table + + whose code is table.
    + +
    +
    +
    mono_metadata_locate_token
    + +
    const char * +mono_metadata_locate_token (MonoImage *meta, guint32 token) + +
    +

    +Parameters +

    meta:
    metadata context
    token:
    metadata token
    +Returns +
    a pointer to the data in the metadata represented by the + + token token.
    + +
    +
    +
    mono_metadata_methods_from_event
    + +
    Prototype: mono_metadata_methods_from_event
    +

    + +

    +
    +
    mono_metadata_methods_from_property
    + +
    Prototype: mono_metadata_methods_from_property
    +

    + +

    +
    +
    mono_metadata_nested_in_typedef
    + +
    Prototype: mono_metadata_nested_in_typedef
    +

    + +

    +
    +
    mono_metadata_nesting_typedef
    + +
    Prototype: mono_metadata_nesting_typedef
    +

    + +

    +
    +
    mono_metadata_packing_from_typedef
    + +
    Prototype: mono_metadata_packing_from_typedef
    +

    + +

    +
    +
    mono_metadata_properties_from_typedef
    + +
    Prototype: mono_metadata_properties_from_typedef
    +

    + +

    +
    +
    mono_metadata_token_from_dor
    + +
    Prototype: mono_metadata_token_from_dor
    +

    + +

    +
    +
    mono_metadata_typedef_from_field
    + +
    guint32 +mono_metadata_typedef_from_field (MonoImage *meta, guint32 index) + +
    +

    +Parameters +

    meta:
    metadata context
    index:
    FieldDef token
    +Returns +
    the 1-based index into the TypeDef table of the type that + + declared the field described by index, or 0 if not found.
    + +
    +
    +
    mono_metadata_typedef_from_method
    + +
    Prototype: mono_metadata_typedef_from_method
    +

    + +

    +
    +
    mono_metadata_type_equal
    + +
    Prototype: mono_metadata_type_equal
    +

    + +

    +
    +
    mono_metadata_type_hash
    + +
    Prototype: mono_metadata_type_hash
    +

    + +

    +
    +
    mono_metadata_declsec_from_index
    + +
    Prototype: mono_metadata_declsec_from_index
    +

    + +

    +
    +
    mono_metadata_free_method_signature
    + +
    Prototype: mono_metadata_free_method_signature
    +

    + + +

    Retrieving Objects from Tokens

    + + +
    +
    mono_metadata_parse_custom_mod
    + +
    Prototype: mono_metadata_parse_custom_mod
    +

    + +

    +
    +
    mono_metadata_parse_field_type
    + +
    MonoType* +mono_metadata_parse_field_type (MonoImage *m, short field_flags, const char *ptr, const char **rptr) + +
    +

    +Parameters +

    m:
    metadata context to extract information from
    ptr:
    pointer to the field signature
    rptr:
    pointer updated to match the end of the decoded stream
    +Returns +
    The MonoType that was extracted from ptr. +
    +Remarks +

    + Parses the field signature, and returns the type information for it. + + +

    +
    +
    mono_metadata_parse_marshal_spec
    + +
    Prototype: mono_metadata_parse_marshal_spec
    +

    + +

    +
    +
    mono_metadata_parse_method_signature_full
    + +
    Prototype: mono_metadata_parse_method_signature_full
    +

    + +

    +
    +
    mono_metadata_parse_method_signature
    + +
    Prototype: mono_metadata_parse_method_signature
    +

    + +

    +
    +
    mono_metadata_parse_mh_full
    + +
    Prototype: mono_metadata_parse_mh_full
    +

    + +

    +
    +
    mono_metadata_parse_mh
    + +
    Prototype: mono_metadata_parse_mh
    +

    + +

    +
    +
    mono_metadata_parse_param
    + +
    MonoType* +mono_metadata_parse_param (MonoImage *m, const char *ptr, const char **rptr) + +
    +

    +Parameters +

    m:
    metadata context to extract information from
    ptr:
    pointer to the param signature
    rptr:
    pointer updated to match the end of the decoded stream
    +Returns +
    The MonoType that was extracted from ptr. +
    +Remarks +

    + Parses the param signature, and returns the type information for it. + + +

    +
    +
    mono_metadata_parse_signature
    + +
    Prototype: mono_metadata_parse_signature
    +

    + +

    +
    +
    mono_metadata_parse_typedef_or_ref
    + +
    Prototype: mono_metadata_parse_typedef_or_ref
    +

    + +

    +
    +
    mono_metadata_parse_type_full
    + +
    Prototype: mono_metadata_parse_type_full
    +

    + +

    +
    +
    mono_metadata_parse_type
    + +
    static MonoType* +mono_metadata_parse_type_internal (MonoImage *m, MonoGenericContainer *container, MonoParseTypeMode mode, + short opt_attrs, gboolean transient, const char *ptr, const char **rptr) + +
    +

    +Parameters +

    m:
    metadata context
    mode:
    king of type that may be found at ptr
    opt_attrs:
    optional attributes to store in the returned type
    ptr:
    pointer to the type representation
    rptr:
    pointer updated to match the end of the decoded stream
    transient:
    whenever to allocate the result from the heap or from a mempool
    +Returns +
    a MonoType structure representing the decoded type. +
    +Remarks +

    + + Decode a compressed type description found at ptr in m. + mode can be one of MONO_PARSE_MOD_TYPE, MONO_PARSE_PARAM, MONO_PARSE_RET, + MONO_PARSE_FIELD, MONO_PARSE_LOCAL, MONO_PARSE_TYPE. + This function can be used to decode type descriptions in method signatures, + field signatures, locals signatures etc. + + To parse a generic type, `generic_container' points to the current class'es + (the `generic_container' field in the MonoClass) or the current generic method's + (stored in image->property_hash) generic container. + When we encounter any MONO_TYPE_VAR or MONO_TYPE_MVAR's, they're looked up in + this MonoGenericContainer. + + LOCKING: Acquires the loader lock. + + + +

    Generics Support

    + + +
    +
    mono_metadata_generic_class_is_valuetype
    + +
    Prototype: mono_metadata_generic_class_is_valuetype
    +

    + +

    +
    +
    mono_metadata_inflate_generic_inst
    + +
    Prototype: mono_metadata_inflate_generic_inst
    +

    + +

    +
    +
    mono_metadata_load_generic_params
    + +
    Prototype: mono_metadata_load_generic_params
    +

    + + +

    Tokens

    + + +
    +
    mono_ldtoken
    + +
    Prototype: mono_ldtoken
    +

    + +

    +
    +
    mono_ldstr
    + +
    MonoString* +mono_ldstr (MonoDomain *domain, MonoImage *image, guint32 idx) + +
    +

    +Parameters +

    domain:
    the domain where the string will be used.
    image:
    a metadata context
    idx:
    index into the user string table.
    +Returns +
    a loaded string from the image/idx combination. +
    +Remarks +

    + + Implementation for the ldstr opcode. + +

    +
    +
    mono_exception_from_token
    + +
    MonoException* +mono_exception_from_token (MonoImage *image, guint32 token) + +
    +

    +Parameters +

    image:
    the Mono image where to look for the class
    token:
    The type token of the class
    +Returns +
    the initialized exception instance. +
    +Remarks +

    + Creates an exception of the type given by token. + + + +

    OpCodes

    + + +
    +
    mono_opcode_name
    + +
    Prototype: mono_opcode_name
    +

    + +

    + +
    \ No newline at end of file diff --git a/docs/deploy/mono-api-methods.html b/docs/deploy/mono-api-methods.html new file mode 100644 index 0000000000..d8abf6ee8d --- /dev/null +++ b/docs/deploy/mono-api-methods.html @@ -0,0 +1,578 @@ + + + + mono-api-methods.html + + + +

    Methods

    + +

    Invoking Methods

    + + +
    +
    mono_runtime_invoke
    + +
    MonoObject* +mono_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject **exc) + +
    +

    +Parameters +

    method:
    method to invoke
    obJ:
    object instance
    params:
    arguments to the method
    exc:
    exception information.
    +Remarks +

    + Invokes the method represented by method on the object obj. + + obj is the 'this' pointer, it should be NULL for static + methods, a MonoObject* for object instances and a pointer to + the value type for value types. + + The params array contains the arguments to the method with the + same convention: MonoObject* pointers for object instances and + pointers to the value type otherwise. + +

    + From unmanaged code you'll usually use the + mono_runtime_invoke() variant. + + Note that this function doesn't handle virtual methods for + you, it will exec the exact method you pass: we still need to + expose a function to lookup the derived class implementation + of a virtual method (there are examples of this in the code, + though). + +

    + You can pass NULL as the exc argument if you don't want to + catch exceptions, otherwise, *exc will be set to the exception + thrown, if any. if an exception is thrown, you can't use the + MonoObject* result from the function. + +

    + If the method returns a value type, it is boxed in an object + reference. + + +If you want to invoke generic methods, you must call the method on the +"inflated" class, which you can obtain from the +mono_object_get_class() + +

    +MonoClass *clazz; +MonoMethod *method; + +clazz = mono_object_get_class (obj); + +/* + * If there are more Add methods declared, you + * may use mono_method_desc_search_in_class (clazz, ":Add(T)"), + * you must substitute ":Add(T)" with the correct type, for example + * for List<int>, you would use ":Add(int)". + */ +method = mono_class_get_method_from_name (clazz, "Add", 1); +mono_runtime_invoke (method, obj, args, &exception); +
    + + +
    +
    +
    mono_runtime_invoke_array
    + +
    MonoObject* +mono_runtime_invoke_array (MonoMethod *method, void *obj, MonoArray *params, + MonoObject **exc) + +
    +

    +Parameters +

    method:
    method to invoke
    obJ:
    object instance
    params:
    arguments to the method
    exc:
    exception information.
    +Remarks +

    + Invokes the method represented by method on the object obj. + + obj is the 'this' pointer, it should be NULL for static + methods, a MonoObject* for object instances and a pointer to + the value type for value types. + + The params array contains the arguments to the method with the + same convention: MonoObject* pointers for object instances and + pointers to the value type otherwise. The _invoke_array + variant takes a C# object[] as the params argument (MonoArray + *params): in this case the value types are boxed inside the + respective reference representation. + +

    + From unmanaged code you'll usually use the + mono_runtime_invoke() variant. + + Note that this function doesn't handle virtual methods for + you, it will exec the exact method you pass: we still need to + expose a function to lookup the derived class implementation + of a virtual method (there are examples of this in the code, + though). + +

    + You can pass NULL as the exc argument if you don't want to + catch exceptions, otherwise, *exc will be set to the exception + thrown, if any. if an exception is thrown, you can't use the + MonoObject* result from the function. + +

    + If the method returns a value type, it is boxed in an object + reference. + +

    +
    +
    mono_runtime_delegate_invoke
    + +
    MonoObject* +mono_runtime_delegate_invoke (MonoObject *delegate, void **params, MonoObject **exc) + +
    +

    +Parameters +

    delegate:
    pointer to a delegate object.
    params:
    parameters for the delegate.
    exc:
    Pointer to the exception result.
    +Remarks +

    + Invokes the delegate method delegate with the parameters provided. + + You can pass NULL as the exc argument if you don't want to + catch exceptions, otherwise, *exc will be set to the exception + thrown, if any. if an exception is thrown, you can't use the + MonoObject* result from the function. + + +

    +
    +
    mono_method_body_get_object
    + +
    Prototype: mono_method_body_get_object
    +

    + +

    +
    +
    mono_method_desc_free
    + +
    void +mono_method_desc_free (MonoMethodDesc *desc) + +
    +

    +Parameters +

    desc:
    method description to be released
    +Remarks +

    + Releases the MonoMethodDesc object desc. + +

    +
    +
    mono_method_desc_from_method
    + +
    Prototype: mono_method_desc_from_method
    +

    + +

    +
    +
    mono_method_desc_full_match
    + +
    Prototype: mono_method_desc_full_match
    +

    + +

    +
    +
    mono_method_desc_match
    + +
    Prototype: mono_method_desc_match
    +

    + +

    +
    +
    mono_method_desc_new
    + +
    MonoMethodDesc* +mono_method_desc_new (const char *name, gboolean include_namespace) + +
    +

    +Parameters +

    name:
    the method name.
    include_namespace:
    whether the name includes a namespace or not.
    +Returns +
    a parsed representation of the method description. +
    +Remarks +

    + Creates a method description for name, which conforms to the following + specification: + + [namespace.]classname:methodname[(args...)] + + in all the loaded assemblies. + + Both classname and methodname can contain '*' which matches anything. + + +

    +
    +
    mono_method_desc_search_in_class
    + +
    Prototype: mono_method_desc_search_in_class
    +

    + +

    +
    +
    mono_method_desc_search_in_image
    + +
    Prototype: mono_method_desc_search_in_image
    +

    + +

    +
    +
    mono_method_full_name
    + +
    Prototype: mono_method_full_name
    +

    + +

    +
    +
    mono_method_get_class
    + +
    Prototype: mono_method_get_class
    +

    + +

    +
    +
    mono_method_get_flags
    + +
    Prototype: mono_method_get_flags
    +

    + +

    +
    +
    mono_method_get_last_managed
    + +
    Prototype: mono_method_get_last_managed
    +

    + +

    +
    +
    mono_method_get_marshal_info
    + +
    Prototype: mono_method_get_marshal_info
    +

    + +

    +
    +
    mono_method_get_name
    + +
    Prototype: mono_method_get_name
    +

    + +

    +
    +
    mono_method_get_object
    + +
    Prototype: mono_method_get_object
    +

    + +

    +
    +
    mono_method_get_param_names
    + +
    Prototype: mono_method_get_param_names
    +

    + +

    +
    +
    mono_method_get_param_token
    + +
    Prototype: mono_method_get_param_token
    +

    + +

    +
    +
    mono_method_get_signature
    + +
    Prototype: mono_method_get_signature
    +

    + +

    +
    +
    mono_method_get_index
    + +
    Prototype: mono_method_get_index
    +

    + +

    +
    +
    mono_method_get_signature_full
    + +
    Prototype: mono_method_get_signature_full
    +

    + +

    +
    +
    mono_method_get_token
    + +
    Prototype: mono_method_get_token
    +

    + +

    +
    +
    mono_method_has_marshal_info
    + +
    Prototype: mono_method_has_marshal_info
    +

    + +

    +
    +
    mono_method_verify
    + +
    Prototype: mono_method_verify
    +

    + + +

    Method Signatures

    + + +
    +
    mono_method_signature
    + +
    MonoMethodSignature* +mono_method_signature (MonoMethod *m) + +
    +

    +Remarks +

    + Return the signature of the method M. On failure, returns NULL. + +

    +
    +
    mono_signature_explicit_this
    + +
    gboolean +mono_signature_explicit_this (MonoMethodSignature *sig) + +
    +

    +Parameters +

    sig:
    the method signature inspected
    +Returns +
    TRUE if this the method signature sig has an explicit + + instance argument. FALSE otherwise.
    + +
    +
    +
    mono_signature_get_call_conv
    + +
    guint32 +mono_signature_get_call_conv (MonoMethodSignature *sig) + +
    +

    +Parameters +

    sig:
    the method signature inspected
    +Returns +
    the call convention of the method signature sig. +
    + +
    +
    +
    mono_signature_get_desc
    + +
    Prototype: mono_signature_get_desc
    +

    + +

    +
    +
    mono_signature_get_param_count
    + +
    guint32 +mono_signature_get_param_count (MonoMethodSignature *sig) + +
    +

    +Parameters +

    sig:
    the method signature inspected
    +Returns +
    the number of parameters in the method signature sig. +
    + +
    +
    +
    mono_signature_get_params
    + +
    MonoType* +mono_signature_get_params (MonoMethodSignature *sig, gpointer *iter) + +
    +

    +Parameters +

    sig:
    the method signature inspected
    iter:
    pointer to an iterator
    +Returns +
    the next parameter type of the method signature sig, + + NULL when finished.
    +Remarks +

    + Iterates over the parameters for the method signature sig. + A void* pointer must be initualized to NULL to start the iteration + and it's address is passed to this function repeteadly until it returns + NULL. + + +

    +
    +
    mono_signature_get_return_type
    + +
    MonoType* +mono_signature_get_return_type (MonoMethodSignature *sig) + +
    +

    +Parameters +

    sig:
    the method signature inspected
    +Returns +
    the return type of the method signature sig +
    + +
    +
    +
    mono_signature_hash
    + +
    Prototype: mono_signature_hash
    +

    + +

    +
    +
    mono_signature_is_instance
    + +
    gboolean +mono_signature_is_instance (MonoMethodSignature *sig) + +
    +

    +Parameters +

    sig:
    the method signature inspected
    +Returns +
    TRUE if this the method signature sig has an implicit + + first instance argument. FALSE otherwise.
    + +
    +
    +
    mono_signature_vararg_start
    + +
    int +mono_signature_vararg_start (MonoMethodSignature *sig) + +
    +

    +Parameters +

    sig:
    the method signature inspected
    +Returns +
    the number of the first vararg parameter in the + + method signature sig. -1 if this is not a vararg signature.
    + +
    +
    +
    mono_param_get_objects
    + +
    Prototype: mono_param_get_objects
    +

    + +

    +
    +
    mono_get_method_full
    + +
    Prototype: mono_get_method_full
    +

    + +

    +
    +
    mono_get_method
    + +
    Prototype: mono_get_method
    +

    + + +

    Methods Header Operations

    + + +
    +
    mono_method_get_header
    + +
    Prototype: mono_method_get_header
    +

    + +

    +
    +
    mono_method_header_get_clauses
    + +
    Prototype: mono_method_header_get_clauses
    +

    + +

    +
    +
    mono_method_header_get_code
    + +
    Prototype: mono_method_header_get_code
    +

    + +

    +
    +
    mono_method_header_get_locals
    + +
    Prototype: mono_method_header_get_locals
    +

    + +

    + +
    \ No newline at end of file diff --git a/docs/deploy/mono-api-object.html b/docs/deploy/mono-api-object.html new file mode 100644 index 0000000000..51cdd0dcbe --- /dev/null +++ b/docs/deploy/mono-api-object.html @@ -0,0 +1,1134 @@ + + + + mono-api-object.html + + + +

    Object API

    + +

    The object API deals with all the operations shared by + objects, value + types, arrays. + +

    The object API has methods for accessing fields, properties, events, delegates. + +

    There are some advanced uses that are useful to document + here dealing with remote fields. + +

    Synopsis

    + +
    +#include <metadata/object.h> + +typedef struct MonoVTable MonoVTable; +typedef struct _MonoThreadsSync MonoThreadsSync; + +typedef struct { + MonoVTable *vtable; + MonoThreadsSync *synchronisation; +} MonoObject; + +typedef struct { + guint32 length; + guint32 lower_bound; +} MonoArrayBounds; + +typedef struct { + MonoObject obj; + /* bounds is NULL for szarrays */ + MonoArrayBounds *bounds; + /* total number of elements of the array */ + guint32 max_length; + /* we use double to ensure proper alignment on platforms that need it */ + double vector [MONO_ZERO_LEN_ARRAY]; +} MonoArray; + +MonoObject* mono_object_new (MonoDomain *domain, + MonoClass *klass); + + +MonoObject* mono_object_new_from_token (MonoDomain *domain, + MonoImage *image, + guint32 token); +MonoObject* mono_object_new_specific (MonoVTable *vtable); +MonoObject* mono_object_clone (MonoObject *obj); +MonoClass* mono_object_get_class (MonoObject *obj); +MonoDomain* mono_object_get_domain (MonoObject *obj); +MonoMethod* mono_object_get_virtual_method (MonoObject *obj, + MonoMethod *method); + +MonoObject* mono_object_isinst (MonoObject *obj, + MonoClass *klass); +gpointer mono_object_unbox (MonoObject *obj); +MonoObject* mono_object_castclass_mbyref (MonoObject *obj, + MonoClass *klass); + +guint mono_object_get_size (MonoObject* o); +MonoObject* mono_value_box (MonoDomain *domain, + MonoClass *class, + gpointer value); + + +MonoArray* mono_array_new (MonoDomain *domain, + MonoClass *eclass, + uintptr_t n); +MonoArray* mono_array_new_full (MonoDomain *domain, + MonoClass *array_class, + uintptr_t *lengths, + intptr_t *lower_bounds); +MonoArray* mono_array_new_specific (MonoVTable *vtable, + uintptr_t n); +MonoClass* mono_array_class_get (MonoClass *eclass, + guint32 rank); +MonoArray* mono_array_clone (MonoArray *array); + + +uintptr_t mono_array_length (MonoArray *array); + +char* mono_array_addr_with_size (MonoArray *array, + int size, + uintptr_t idx); + +gint32 mono_array_element_size (MonoClass *ac); + + +const char* mono_field_get_name (MonoClassField *field); +MonoClass* mono_field_get_parent (MonoClassField *field); +MonoType* mono_field_get_type (MonoClassField *field); +void mono_field_get_value (MonoObject *obj, + MonoClassField *field, + void *value); +MonoObject* mono_field_get_value_object (MonoDomain *domain, + MonoClassField *field, + MonoObject *obj); +void mono_field_set_value (MonoObject *obj, + MonoClassField *field, + void *value); +void mono_field_static_get_value (MonoVTable *vt, + MonoClassField *field, + void *value); +void mono_field_static_set_value (MonoVTable *vt, + MonoClassField *field, + void *value); + + +guint32 mono_property_get_flags (MonoProperty *prop); +MonoMethod* mono_property_get_get_method (MonoProperty *prop); + +MonoClass* mono_property_get_parent (MonoProperty *prop); +MonoMethod* mono_property_get_set_method (MonoProperty *prop); +MonoObject* mono_property_get_value (MonoProperty *prop, + void *obj, + void **params, + MonoObject **exc); +void mono_property_set_value (MonoProperty *prop, + void *obj, + void **params, + MonoObject **exc); + +MonoMethod* mono_event_get_add_method (MonoEvent *event); +guint32 mono_event_get_flags (MonoEvent *event); +const char* mono_event_get_name (MonoEvent *event); +MonoClass* mono_event_get_parent (MonoEvent *event); +MonoMethod* mono_event_get_raise_method (MonoEvent *event); +MonoMethod* mono_event_get_remove_method (MonoEvent *event); +gpointer mono_load_remote_field (MonoObject *this, + MonoClass *klass, + MonoClassField *field, + gpointer *res); +MonoObject* mono_load_remote_field_new (MonoObject *this, + MonoClass *klass, + MonoClassField *field); +void mono_store_remote_field (MonoObject *this, + MonoClass *klass, + MonoClassField *field, + gpointer val); +void mono_store_remote_field_new (MonoObject *this, + MonoClass *klass, + MonoClassField *field, + MonoObject *arg); + +
    + +

    MonoObject is the base definition for all managed objects + in the Mono runtime, it represents the System.Object + managed type. + +

    All objects that derive from System.Object + do have this base definition. Derived objects are declared + following the pattern where the parent class is the first + field of a structure definition, for example: + +

    + typedef struct { + MonoObject parent; + int my_new_field; + } MyNewObject +
    + + +

    Core Object Methods

    + + +
    +
    mono_object_new
    + +
    MonoObject* +mono_object_new (MonoDomain *domain, MonoClass *klass) + +
    +

    +Parameters +

    klass:
    the class of the object that we want to create
    +Returns +
    a newly created object whose definition is + + looked up using klass. This will not invoke any constructors, + so the consumer of this routine has to invoke any constructors on + its own to initialize the object. + +

    + It returns NULL on failure.

    + + +

    For example, if you wanted to create an object of type + System.Version, you would use a piece of code like this: + +

    +MonoClass *version_class; +MonoObject *result; + +/* Get the class from mscorlib */ +version_class = mono_class_from_name (mono_get_corlib (), + "System", "Version"); + +/* Create an object of that class */ +result = mono_object_new (mono_domain_get (), version_class); +
    + +
    +
    +
    mono_object_new_alloc_specific
    + +
    Prototype: mono_object_new_alloc_specific
    +

    + +

    +
    +
    mono_object_new_fast
    + +
    Prototype: mono_object_new_fast
    +

    + +

    +
    +
    mono_object_new_from_token
    + +
    MonoObject* +mono_object_new_from_token (MonoDomain *domain, MonoImage *image, guint32 token) + +
    +

    +Parameters +

    image:
    Context where the type_token is hosted
    token:
    a token of the type that we want to create
    +Returns +
    A newly created object whose definition is + + looked up using token in the image image
    + +
    +
    +
    mono_object_new_specific
    + +
    MonoObject* +mono_object_new_specific (MonoVTable *vtable) + +
    +

    +Parameters +

    vtable:
    the vtable of the object that we want to create
    +Returns +
    A newly created object with class and domain specified + + by vtable
    + +
    +
    +
    mono_object_clone
    + +
    MonoObject* +mono_object_clone (MonoObject *obj) + +
    +

    +Parameters +

    obj:
    the object to clone
    +Returns +
    A newly created object who is a shallow copy of obj +
    + +
    +
    +
    mono_object_get_class
    + +
    MonoClass* +mono_object_get_class (MonoObject *obj) + +
    +

    +Parameters +

    obj:
    object to query
    +Returns +
    the MonOClass of the object. +
    +Remarks +

    + + +

    +
    +
    mono_object_get_domain
    + +
    MonoDomain* +mono_object_get_domain (MonoObject *obj) + +
    +

    +Parameters +

    obj:
    object to query
    +Returns +
    the MonoDomain where the object is hosted +
    +Remarks +

    + + +

    +
    +
    mono_object_get_virtual_method
    + +
    MonoMethod* +mono_object_get_virtual_method (MonoObject *obj, MonoMethod *method) + +
    +

    +Parameters +

    obj:
    object to operate on.
    method:
    method
    +Remarks +

    + Retrieves the MonoMethod that would be called on obj if obj is passed as + the instance of a callvirt of method. + +

    +
    +
    mono_object_isinst_mbyref
    + +
    Prototype: mono_object_isinst_mbyref
    +

    + +

    +
    +
    mono_object_isinst
    + +
    MonoObject* +mono_object_isinst (MonoObject *obj, MonoClass *klass) + +
    +

    +Parameters +

    obj:
    an object
    klass:
    a pointer to a class
    +Returns +
    obj if obj is derived from klass +
    + +
    +
    +
    mono_object_unbox
    + +
    gpointer +mono_object_unbox (MonoObject *obj) + +
    +

    +Parameters +

    obj:
    object to unbox
    +Returns +
    a pointer to the start of the valuetype boxed in this + + object. + + This method will assert if the object passed is not a valuetype.
    +Remarks +

    + + +

    +
    +
    mono_object_castclass_mbyref
    + +
    MonoObject* +mono_object_castclass_mbyref (MonoObject *obj, MonoClass *klass) + +
    +

    +Parameters +

    obj:
    an object
    klass:
    a pointer to a class
    +Returns +
    obj if obj is derived from klass, throws an exception otherwise +
    + +
    +
    +
    mono_object_is_alive
    + +
    Prototype: mono_object_is_alive
    +

    + +

    +
    +
    mono_object_get_size
    + +
    guint +mono_object_get_size (MonoObject* o) + +
    +

    +Parameters +

    o:
    object to query
    +Returns +
    the size, in bytes, of o +
    +Remarks +

    + + + + +

    Value Types

    + + +
    +
    mono_value_box
    + +
    MonoObject* +mono_value_box (MonoDomain *domain, MonoClass *class, gpointer value) + +
    +

    +Parameters +

    class:
    the class of the value
    value:
    a pointer to the unboxed data
    +Returns +
    A newly created object which contains value. +
    + +
    +
    +
    mono_value_copy
    + +
    Prototype: mono_value_copy
    +

    + +

    +
    +
    mono_value_copy_array
    + +
    Prototype: mono_value_copy_array
    +

    + + + +

    Array Methods

    + +

    Use the mono_array_new_* methods to create arrays + of a given type. + +

    For example, the following code creates an array with two + elements of type System.Byte, and sets the values + 0xca and 0xfe on it: + +

    +
    +	MonoArray *CreateByteArray (MonoDomain *domain)
    +	{
    +	    MonoArray *data;
    +
    +	    data = mono_array_new (domain, mono_get_byte_class (), 2);
    +	    mono_array_set (data, guint8, 0, 0xca);
    +	    mono_array_set (data, guint8, 0, 0xfe);
    +
    +	    return data;
    +	}
    +
    +	
    + +

    Creating Arrays

    + + +
    +
    mono_array_new
    + +
    MonoArray* +mono_array_new (MonoDomain *domain, MonoClass *eclass, uintptr_t n) + +
    +

    +Parameters +

    domain:
    domain where the object is created
    eclass:
    element class
    n:
    number of array elements
    +Remarks +

    + This routine creates a new szarray with n elements of type eclass. + +

    +
    +
    mono_array_new_full
    + +
    MonoArray* +mono_array_new_full (MonoDomain *domain, MonoClass *array_class, uintptr_t *lengths, intptr_t *lower_bounds) + +
    +

    +Parameters +

    domain:
    domain where the object is created
    array_class:
    array class
    lengths:
    lengths for each dimension in the array
    lower_bounds:
    lower bounds for each dimension in the array (may be NULL)
    +Remarks +

    + This routine creates a new array objects with the given dimensions, + lower bounds and type. + +

    +
    +
    mono_array_new_specific
    + +
    MonoArray* +mono_array_new_specific (MonoVTable *vtable, uintptr_t n) + +
    +

    +Parameters +

    vtable:
    a vtable in the appropriate domain for an initialized class
    n:
    number of array elements
    +Remarks +

    + This routine is a fast alternative to mono_array_new() for code which + can be sure about the domain it operates in. + +

    +
    +
    mono_array_class_get
    + +
    MonoClass* +mono_array_class_get (MonoClass *eclass, guint32 rank) + +
    +

    +Parameters +

    element_class:
    element class
    rank:
    the dimension of the array class
    +Returns +
    a class object describing the array with element type element_type and + + dimension rank.
    + +
    +
    +
    mono_array_clone
    + +
    MonoArray* +mono_array_clone (MonoArray *array) + +
    +

    +Parameters +

    array:
    the array to clone
    +Returns +
    A newly created array who is a shallow copy of array +
    + + +

    Using Arrays

    + + +
    +
    mono_array_set
    + +
    Prototype: mono_array_set
    +

    + +

    +
    +
    mono_array_setref
    + +
    Prototype: mono_array_setref
    +

    + +

    +
    +
    mono_array_length
    + +
    uintptr_t +mono_array_length (MonoArray *array) + +
    +

    +Parameters +

    array:
    a MonoArray*
    +Remarks +

    + Returns the total number of elements in the array. This works for + both vectors and multidimensional arrays. + +

    +
    +
    mono_array_addr
    + +
    Prototype: mono_array_addr
    +

    + +

    +
    +
    mono_array_addr_with_size
    + +
    char* +mono_array_addr_with_size (MonoArray *array, int size, uintptr_t idx) + +
    +

    +Parameters +

    array:
    a MonoArray*
    size:
    size of the array elements
    idx:
    index into the array
    +Remarks +

    + Returns the address of the idx element in the array. + +

    +
    +
    mono_array_get
    + +
    Prototype: mono_array_get
    +

    + +

    +
    +
    mono_array_element_size
    + +
    gint32 +mono_array_element_size (MonoClass *ac) + +
    +

    +Parameters +

    ac:
    pointer to a #MonoArrayClass
    +Returns +
    the size of single array element. +
    + + + +

    Fields

    + + +
    +
    mono_field_from_token
    + +
    Prototype: mono_field_from_token
    +

    + +

    +
    +
    mono_field_get_flags
    + +
    Prototype: mono_field_get_flags
    +

    + +

    +
    +
    mono_field_get_name
    + +
    const char* +mono_field_get_name (MonoClassField *field) + +
    +

    +Parameters +

    field:
    the MonoClassField to act on
    +Returns +
    the name of the field. +
    + +
    +
    +
    mono_field_get_parent
    + +
    MonoClass* +mono_field_get_parent (MonoClassField *field) + +
    +

    +Parameters +

    field:
    the MonoClassField to act on
    +Returns +
    MonoClass where the field was defined. +
    + +
    +
    +
    mono_field_get_type
    + +
    MonoType* +mono_field_get_type (MonoClassField *field) + +
    +

    +Parameters +

    field:
    the MonoClassField to act on
    +Returns +
    MonoType of the field. +
    + +
    +
    +
    mono_field_get_value
    + +
    void +mono_field_get_value (MonoObject *obj, MonoClassField *field, void *value) + +
    +

    +Parameters +

    obj:
    Object instance
    field:
    MonoClassField describing the field to fetch information from
    value:
    pointer to the location where the value will be stored
    +Remarks +

    + Use this routine to get the value of the field field in the object + passed. + + The pointer provided by value must be of the field type, for reference + types this is a MonoObject*, for value types its the actual pointer to + the value type. + + For example: + int i; + mono_field_get_value (obj, int_field, &i); + +

    +
    +
    mono_field_get_value_object
    + +
    MonoObject* +mono_field_get_value_object (MonoDomain *domain, MonoClassField *field, MonoObject *obj) + +
    +

    +Parameters +

    domain:
    domain where the object will be created (if boxing)
    field:
    MonoClassField describing the field to fetch information from
    obj:
    The object instance for the field.
    +Returns +
    a new MonoObject with the value from the given field. If the + + field represents a value type, the value is boxed. +
    + +
    +
    +
    mono_field_set_value
    + +
    void +mono_field_set_value (MonoObject *obj, MonoClassField *field, void *value) + +
    +

    +Parameters +

    obj:
    Instance object
    field:
    MonoClassField describing the field to set
    value:
    The value to be set
    +Remarks +

    + Sets the value of the field described by field in the object instance obj + to the value passed in value. This method should only be used for instance + fields. For static fields, use mono_field_static_set_value. + + The value must be on the native format of the field type. + +

    +
    +
    mono_field_static_get_value
    + +
    void +mono_field_static_get_value (MonoVTable *vt, MonoClassField *field, void *value) + +
    +

    +Parameters +

    vt:
    vtable to the object
    field:
    MonoClassField describing the field to fetch information from
    value:
    where the value is returned
    +Remarks +

    + Use this routine to get the value of the static field field value. + + The pointer provided by value must be of the field type, for reference + types this is a MonoObject*, for value types its the actual pointer to + the value type. + + For example: + int i; + mono_field_static_get_value (vt, int_field, &i); + +

    +
    +
    mono_field_static_set_value
    + +
    void +mono_field_static_set_value (MonoVTable *vt, MonoClassField *field, void *value) + +
    +

    +Parameters +

    field:
    MonoClassField describing the field to set
    value:
    The value to be set
    +Remarks +

    + Sets the value of the static field described by field + to the value passed in value. + + The value must be on the native format of the field type. + +

    +
    +
    mono_field_get_object
    + +
    Prototype: mono_field_get_object
    +

    + + + +

    Properties

    + + +
    +
    mono_property_get_object
    + +
    Prototype: mono_property_get_object
    +

    + +

    +
    +
    mono_property_get_flags
    + +
    guint32 +mono_property_get_flags (MonoProperty *prop) + +
    +

    +Parameters +

    prop:
    the MonoProperty to act on.
    +Returns +
    the flags for the property. +
    +Remarks +

    + The metadata flags for a property are encoded using the + PROPERTY_ATTRIBUTE_* constants. See the tabledefs.h file for details. + + +

    +
    +
    mono_property_get_get_method
    + +
    MonoMethod* +mono_property_get_get_method (MonoProperty *prop) + +
    +

    +Parameters +

    prop:
    the MonoProperty to act on.
    +Returns +
    the setter method of the property (A MonoMethod) +
    + +
    +
    +
    mono_property_get_name
    + +
    Prototype: mono_property_get_name
    +

    + +

    +
    +
    mono_property_get_parent
    + +
    MonoClass* +mono_property_get_parent (MonoProperty *prop) + +
    +

    +Parameters +

    prop:
    the MonoProperty to act on.
    +Returns +
    the MonoClass where the property was defined. +
    + +
    +
    +
    mono_property_get_set_method
    + +
    MonoMethod* +mono_property_get_set_method (MonoProperty *prop) + +
    +

    +Parameters +

    prop:
    the MonoProperty to act on.
    +Returns +
    the setter method of the property (A MonoMethod) +
    + +
    +
    +
    mono_property_get_value
    + +
    MonoObject* +mono_property_get_value (MonoProperty *prop, void *obj, void **params, MonoObject **exc) + +
    +

    +Parameters +

    prop:
    MonoProperty to fetch
    obj:
    instance object on which to act
    params:
    parameters to pass to the propery
    exc:
    optional exception
    +Returns +
    the value from invoking the get method on the property. +
    +Remarks +

    + Invokes the property's get method with the given arguments on the + object instance obj (or NULL for static properties). + +

    + You can pass NULL as the exc argument if you don't want to + catch exceptions, otherwise, *exc will be set to the exception + thrown, if any. if an exception is thrown, you can't use the + MonoObject* result from the function. + + +

    +
    +
    mono_property_set_value
    + +
    void +mono_property_set_value (MonoProperty *prop, void *obj, void **params, MonoObject **exc) + +
    +

    +Parameters +

    prop:
    MonoProperty to set
    obj:
    instance object on which to act
    params:
    parameters to pass to the propery
    exc:
    optional exception
    +Remarks +

    + Invokes the property's set method with the given arguments on the + object instance obj (or NULL for static properties). + +

    + You can pass NULL as the exc argument if you don't want to + catch exceptions, otherwise, *exc will be set to the exception + thrown, if any. if an exception is thrown, you can't use the + MonoObject* result from the function. + + + +

    Events

    + + +
    +
    mono_event_get_object
    + +
    Prototype: mono_event_get_object
    +

    + +

    +
    +
    mono_event_get_add_method
    + +
    MonoMethod* +mono_event_get_add_method (MonoEvent *event) + +
    +

    +Parameters +

    event:
    The MonoEvent to act on.
    +Returns +
    the add' method for the event (a MonoMethod). +
    + +
    +
    +
    mono_event_get_flags
    + +
    guint32 +mono_event_get_flags (MonoEvent *event) + +
    +

    +Parameters +

    event:
    the MonoEvent to act on.
    +Returns +
    the flags for the event. +
    +Remarks +

    + The metadata flags for an event are encoded using the + EVENT_* constants. See the tabledefs.h file for details. + + +

    +
    +
    mono_event_get_name
    + +
    const char* +mono_event_get_name (MonoEvent *event) + +
    +

    +Parameters +

    event:
    the MonoEvent to act on
    +Returns +
    the name of the event. +
    + +
    +
    +
    mono_event_get_parent
    + +
    MonoClass* +mono_event_get_parent (MonoEvent *event) + +
    +

    +Parameters +

    event:
    the MonoEvent to act on.
    +Returns +
    the MonoClass where the event is defined. +
    + +
    +
    +
    mono_event_get_raise_method
    + +
    MonoMethod* +mono_event_get_raise_method (MonoEvent *event) + +
    +

    +Parameters +

    event:
    The MonoEvent to act on.
    +Returns +
    the raise method for the event (a MonoMethod). +
    + +
    +
    +
    mono_event_get_remove_method
    + +
    MonoMethod* +mono_event_get_remove_method (MonoEvent *event) + +
    +

    +Parameters +

    event:
    The MonoEvent to act on.
    +Returns +
    the remove method for the event (a MonoMethod). +
    + + + +

    Remote Fields

    + +
    +
    mono_load_remote_field
    + +
    gpointer +mono_load_remote_field (MonoObject *this, MonoClass *klass, MonoClassField *field, gpointer *res) + +
    +

    +Parameters +

    this:
    pointer to an object
    klass:
    klass of the object containing field
    field:
    the field to load
    res:
    a storage to store the result
    +Returns +
    an address pointing to the value of field. +
    +Remarks +

    + This method is called by the runtime on attempts to load fields of + transparent proxy objects. this points to such TP, klass is the class of + the object containing field. res is a storage location which can be + used to store the result. + + +

    +
    +
    mono_load_remote_field_new
    + +
    MonoObject* +mono_load_remote_field_new (MonoObject *this, MonoClass *klass, MonoClassField *field) + +
    +

    +Parameters +

    this:
    klass:
    field:
    +Remarks +

    + Missing documentation. + +

    +
    +
    mono_store_remote_field
    + +
    void +mono_store_remote_field (MonoObject *this, MonoClass *klass, MonoClassField *field, gpointer val) + +
    +

    +Parameters +

    this:
    pointer to an object
    klass:
    klass of the object containing field
    field:
    the field to load
    val:
    the value/object to store
    +Remarks +

    + This method is called by the runtime on attempts to store fields of + transparent proxy objects. this points to such TP, klass is the class of + the object containing field. val is the new value to store in field. + +

    + +
    \ No newline at end of file diff --git a/docs/deploy/mono-api-profiler.html b/docs/deploy/mono-api-profiler.html new file mode 100644 index 0000000000..c0b89c9601 --- /dev/null +++ b/docs/deploy/mono-api-profiler.html @@ -0,0 +1,268 @@ + + + + mono-api-profiler.html + + + +

    Profiling Interface

    + +

    Profiler Operation

    + +

    The following methods can be used by dynamic profiler + methods to monitor different aspects of the program. + +

    A custom profiler will have one public method defined in + the shared library which is the entry point that Mono calls at + startup, it has the following signature: + +

    +	void mono_profiler_startup (const char *desc)
    +	
    + +

    Where "desc" is the set of arguments that were passed from + the command line. This routine will call + mono_profiler_install to activate the profiler and + will install one or more filters (one of the various + mono_profiler_install_ functions). + +

    In addition, a profiler developer will typically call + mono_profiler_set_events to register which kinds of + traces should be enabled, these can be an OR-ed combination of + the following: + +

    +	MONO_PROFILE_NONE
    +        MONO_PROFILE_APPDOMAIN_EVENTS
    +        MONO_PROFILE_ASSEMBLY_EVENTS
    +        MONO_PROFILE_MODULE_EVENTS    
    +        MONO_PROFILE_CLASS_EVENTS     
    +        MONO_PROFILE_JIT_COMPILATION  
    +        MONO_PROFILE_INLINING         
    +        MONO_PROFILE_EXCEPTIONS       
    +        MONO_PROFILE_ALLOCATIONS      
    +        MONO_PROFILE_GC               
    +        MONO_PROFILE_THREADS          
    +        MONO_PROFILE_REMOTING         
    +        MONO_PROFILE_TRANSITIONS      
    +        MONO_PROFILE_ENTER_LEAVE      
    +        MONO_PROFILE_COVERAGE         
    +        MONO_PROFILE_INS_COVERAGE     
    +        MONO_PROFILE_STATISTICAL      
    +	
    + +

    Developers can change the set of monitored events at + runtime by calling mono_profiler_set_events. + + +

    +
    mono_profiler_install
    + +
    void +mono_profiler_install (MonoProfiler *prof, MonoProfileFunc callback) + +
    +

    +Parameters +

    prof:
    a MonoProfiler structure pointer, or a pointer to a derived structure.
    callback:
    the function to invoke at shutdown
    +Remarks +

    + Use mono_profiler_install to activate profiling in the Mono runtime. + Typically developers of new profilers will create a new structure whose + first field is a MonoProfiler and put any extra information that they need + to access from the various profiling callbacks there. + + +

    +
    +
    mono_profiler_install_allocation
    + +
    Prototype: mono_profiler_install_allocation
    +

    + +

    +
    +
    mono_profiler_install_appdomain
    + +
    Prototype: mono_profiler_install_appdomain
    +

    + +

    +
    +
    mono_profiler_install_assembly
    + +
    Prototype: mono_profiler_install_assembly
    +

    + +

    +
    +
    mono_profiler_install_class
    + +
    Prototype: mono_profiler_install_class
    +

    + +

    +
    +
    mono_profiler_install_coverage_filter
    + +
    Prototype: mono_profiler_install_coverage_filter
    +

    + +

    +
    +
    mono_profiler_install_enter_leave
    + +
    void +mono_profiler_install_enter_leave (MonoProfileMethodFunc enter, MonoProfileMethodFunc fleave) + +
    +

    +Parameters +

    enter:
    the routine to be called on each method entry
    fleave:
    the routine to be called each time a method returns
    +Remarks +

    + Use this routine to install routines that will be called everytime + a method enters and leaves. The routines will receive as an argument + the MonoMethod representing the method that is entering or leaving. + +

    +
    +
    mono_profiler_install_jit_compile
    + +
    void +mono_profiler_install_jit_compile (MonoProfileMethodFunc start, MonoProfileMethodResult end) + +
    +

    +Parameters +

    start:
    the routine to be called when the JIT process starts.
    end:
    the routine to be called when the JIT process ends.
    +Remarks +

    + Use this routine to install routines that will be called when JIT + compilation of a method starts and completes. + +

    +
    +
    mono_profiler_install_module
    + +
    Prototype: mono_profiler_install_module
    +

    + +

    +
    +
    mono_profiler_install_thread
    + +
    Prototype: mono_profiler_install_thread
    +

    + +

    +
    +
    mono_profiler_install_transition
    + +
    Prototype: mono_profiler_install_transition
    +

    + +

    +
    +
    mono_profiler_install_gc
    + +
    Prototype: mono_profiler_install_gc
    +

    + +

    +
    +
    mono_profiler_install_statistical
    + +
    Prototype: mono_profiler_install_statistical
    +

    + +

    +
    +
    mono_profiler_set_events
    + +
    void +mono_profiler_set_events (MonoProfileFlags events) + +
    +

    +Parameters +

    events:
    an ORed set of values made up of MONO_PROFILER_ flags
    +Remarks +

    + The events descriped in the events argument is a set of flags + that represent which profiling events must be triggered. For + example if you have registered a set of methods for tracking + JIT compilation start and end with mono_profiler_install_jit_compile, + you will want to pass the MONO_PROFILE_JIT_COMPILATION flag to + this routine. + + You can call mono_profile_set_events more than once and you can + do this at runtime to modify which methods are invoked. + +

    +
    +
    mono_profiler_get_events
    + +
    MonoProfileFlags +mono_profiler_get_events (void) + +
    +

    +Remarks +

    + Returns a list of active events that will be intercepted. + + +

    Coverage

    + +

    To support profiling modules that need to do code coverage + analysis, the following routines is provided: + + + + \ No newline at end of file diff --git a/docs/deploy/mono-api-reflection.html b/docs/deploy/mono-api-reflection.html new file mode 100644 index 0000000000..775871a1bb --- /dev/null +++ b/docs/deploy/mono-api-reflection.html @@ -0,0 +1,269 @@ + + + + mono-api-reflection.html + + + +

    Fetching Types, and Basic Reflection

    + + +
    +
    mono_reflection_get_custom_attrs_blob
    + +
    Prototype: mono_reflection_get_custom_attrs_blob
    +

    + +

    +
    +
    mono_reflection_get_custom_attrs
    + +
    Prototype: mono_reflection_get_custom_attrs
    +

    + +

    +
    +
    mono_custom_attrs_get_attr
    + +
    Prototype: mono_custom_attrs_get_attr
    +

    + +

    +
    +
    mono_reflection_get_token
    + +
    Prototype: mono_reflection_get_token
    +

    + +

    +
    +
    mono_reflection_get_type
    + +
    Prototype: mono_reflection_get_type
    +

    + +

    +
    +
    mono_reflection_parse_type
    + +
    Prototype: mono_reflection_parse_type
    +

    + +

    +
    +
    mono_reflection_type_from_name
    + +
    Prototype: mono_reflection_type_from_name
    +

    + +

    +
    +
    mono_reflection_get_custom_attrs_info
    + +
    Prototype: mono_reflection_get_custom_attrs_info
    +

    + + +

    Custom Attributes

    + + +
    +
    mono_custom_attrs_construct
    + +
    Prototype: mono_custom_attrs_construct
    +

    + +

    +
    +
    mono_custom_attrs_free
    + +
    Prototype: mono_custom_attrs_free
    +

    + +

    +
    +
    mono_custom_attrs_from_assembly
    + +
    Prototype: mono_custom_attrs_from_assembly
    +

    + +

    +
    +
    mono_custom_attrs_from_class
    + +
    Prototype: mono_custom_attrs_from_class
    +

    + +

    +
    +
    mono_custom_attrs_from_event
    + +
    Prototype: mono_custom_attrs_from_event
    +

    + +

    +
    +
    mono_custom_attrs_from_field
    + +
    Prototype: mono_custom_attrs_from_field
    +

    + +

    +
    +
    mono_custom_attrs_from_index
    + +
    MonoCustomAttrInfo* +mono_custom_attrs_from_index (MonoImage *image, guint32 idx) + +
    +

    +Returns +

    NULL if no attributes are found or if a loading error occurs. +
    + +
    +
    +
    mono_custom_attrs_from_method
    + +
    Prototype: mono_custom_attrs_from_method
    +

    + +

    +
    +
    mono_custom_attrs_from_param
    + +
    MonoCustomAttrInfo* +mono_custom_attrs_from_param (MonoMethod *method, guint32 param) + +
    +

    +Parameters +

    method:
    handle to the method that we want to retrieve custom parameter information from
    param:
    parameter number, where zero represent the return value, and one is the first parameter in the method
    +Returns +
    the custom attribute object for the specified parameter, or NULL if there are none. +
    +Remarks +

    + The result must be released with mono_custom_attrs_free(). + + +

    +
    +
    mono_custom_attrs_from_property
    + +
    Prototype: mono_custom_attrs_from_property
    +

    + +

    +
    +
    mono_custom_attrs_has_attr
    + +
    Prototype: mono_custom_attrs_has_attr
    +

    + + +

    + +
    +
    mono_module_file_get_object
    + +
    Prototype: mono_module_file_get_object
    +

    + +

    +
    +
    mono_module_get_object
    + +
    Prototype: mono_module_get_object
    +

    + +

    +
    +
    mono_method_body_get_object
    + +
    Prototype: mono_method_body_get_object
    +

    + +

    +
    +
    mono_event_get_object
    + +
    Prototype: mono_event_get_object
    +

    + +

    +
    +
    mono_assembly_get_object
    + +
    Prototype: mono_assembly_get_object
    +

    + +

    +
    +
    mono_param_get_objects
    + +
    Prototype: mono_param_get_objects
    +

    + +

    +
    +
    mono_field_get_object
    + +
    Prototype: mono_field_get_object
    +

    + +

    +
    +
    mono_property_get_object
    + +
    Prototype: mono_property_get_object
    +

    + +

    + +
    \ No newline at end of file diff --git a/docs/deploy/mono-api-security.html b/docs/deploy/mono-api-security.html new file mode 100644 index 0000000000..9643964250 --- /dev/null +++ b/docs/deploy/mono-api-security.html @@ -0,0 +1,130 @@ + + + + mono-api-security.html + + + +

    Security Manager

    + + +
    +
    mono_get_context_capture_method
    + +
    Prototype: mono_get_context_capture_method
    +

    + + +

    Declarative Security

    + + +
    +
    mono_declsec_flags_from_assembly
    + +
    Prototype: mono_declsec_flags_from_assembly
    +

    + +

    +
    +
    mono_declsec_flags_from_class
    + +
    Prototype: mono_declsec_flags_from_class
    +

    + +

    +
    +
    mono_declsec_flags_from_method
    + +
    Prototype: mono_declsec_flags_from_method
    +

    + +

    +
    +
    mono_declsec_get_assembly_action
    + +
    Prototype: mono_declsec_get_assembly_action
    +

    + +

    +
    +
    mono_declsec_get_class_action
    + +
    Prototype: mono_declsec_get_class_action
    +

    + +

    +
    +
    mono_declsec_get_demands
    + +
    Prototype: mono_declsec_get_demands
    +

    + +

    +
    +
    mono_declsec_get_inheritdemands_class
    + +
    Prototype: mono_declsec_get_inheritdemands_class
    +

    + +

    +
    +
    mono_declsec_get_inheritdemands_method
    + +
    Prototype: mono_declsec_get_inheritdemands_method
    +

    + +

    +
    +
    mono_declsec_get_linkdemands
    + +
    Prototype: mono_declsec_get_linkdemands
    +

    + +

    + +
    \ No newline at end of file diff --git a/docs/deploy/mono-api-string.html b/docs/deploy/mono-api-string.html new file mode 100644 index 0000000000..54b012b1df --- /dev/null +++ b/docs/deploy/mono-api-string.html @@ -0,0 +1,405 @@ + + + + mono-api-string.html + + + +

    Strings

    + +

    Strings representation inside the Mono runtime. + +

    Synopsis

    + +
    +#include <metadata/object.h> + +typedef struct { + MonoObject object; + gint32 length; + gunichar2 chars [0]; +} MonoString; + +MonoString* mono_string_new (MonoDomain *domain, + const char *text); +MonoString* mono_string_new_len (MonoDomain *domain, + const char *text, + guint length); +MonoString* mono_string_new_size (MonoDomain *domain, + gint32 len); +MonoString* mono_string_new_utf16 (MonoDomain *domain, + const guint16 *text, + gint32 len); +MonoString* mono_string_from_utf16 (gunichar2 *data); +mono_unichar2* mono_string_to_utf16 (MonoString *s); +char* mono_string_to_utf8 (MonoString *s); +gboolean mono_string_equal (MonoString *s1, + MonoString *s2); +guint mono_string_hash (MonoString *s); +MonoString* mono_string_intern (MonoString *str); +MonoString* mono_string_is_interned (MonoString *o); +MonoString* mono_string_new_wrapper (const char *text); +gunichar2* mono_string_chars (MonoString *s); +int mono_string_length (MonoString *s); +gunichar2* mono_unicode_from_external (const gchar *in, + gsize *bytes); + + + +
    + +

    All of the operations on strings are done on pointers to + MonoString objects, like this: + +

    + MonoString *hello = mono_string_new (mono_domain_get (), "hello, world"); +
    + +

    Strings are bound to a particular application domain, which + is why it is necessary to pass a MonoDomain argument as the + first parameter to all the constructor functions. + +

    Typically, you want to create the strings on the current + application domain, so a call to mono_domain_get() is + sufficient. + +

    Constructors

    + + +
    +
    mono_string_new
    + +
    MonoString* +mono_string_new (MonoDomain *domain, const char *text) + +
    +

    +Parameters +

    text:
    a pointer to an utf8 string
    +Returns +
    A newly created string object which contains text. +
    + +
    +
    +
    mono_string_new_len
    + +
    MonoString* +mono_string_new_len (MonoDomain *domain, const char *text, guint length) + +
    +

    +Parameters +

    text:
    a pointer to an utf8 string
    length:
    number of bytes in text to consider
    +Returns +
    A newly created string object which contains text. +
    + +
    +
    +
    mono_string_new_size
    + +
    MonoString* +mono_string_new_size (MonoDomain *domain, gint32 len) + +
    +

    +Parameters +

    text:
    a pointer to an utf16 string
    len:
    the length of the string
    +Returns +
    A newly created string object of len +
    + +
    +
    +
    mono_string_new_utf16
    + +
    MonoString* +mono_string_new_utf16 (MonoDomain *domain, const guint16 *text, gint32 len) + +
    +

    +Parameters +

    text:
    a pointer to an utf16 string
    len:
    the length of the string
    +Returns +
    A newly created string object which contains text. +
    + +
    +
    +
    mono_string_from_utf16
    + +
    MonoString* +mono_string_from_utf16 (gunichar2 *data) + +
    +

    +Parameters +

    data:
    the UTF16 string (LPWSTR) to convert
    +Returns +
    a MonoString. +
    +Remarks +

    + Converts a NULL terminated UTF16 string (LPWSTR) to a MonoString. + + + +

    Conversions

    + + +
    +
    mono_string_to_utf16
    + +
    mono_unichar2* +mono_string_to_utf16 (MonoString *s) + +
    +

    +Parameters +

    s:
    a MonoString
    +Remarks +

    + Return an null-terminated array of the utf-16 chars + contained in s. The result must be freed with g_free(). + This is a temporary helper until our string implementation + is reworked to always include the null terminating char. + +

    +
    +
    mono_string_to_utf8
    + +
    char* +mono_string_to_utf8 (MonoString *s) + +
    +

    +Parameters +

    s:
    a System.String
    +Remarks +

    + Returns the UTF8 representation for s. + The resulting buffer needs to be freed with mono_free(). + + deprecated Use mono_string_to_utf8_checked to avoid having an exception arbritraly raised. + + +

    Methods

    + + +
    +
    mono_string_equal
    + +
    gboolean +mono_string_equal (MonoString *s1, MonoString *s2) + +
    +

    +Parameters +

    s1:
    First string to compare
    s2:
    Second string to compare
    +Remarks +

    + Returns FALSE if the strings differ. + +

    +
    +
    mono_string_hash
    + +
    guint +mono_string_hash (MonoString *s) + +
    +

    +Parameters +

    s:
    the string to hash
    +Remarks +

    + Returns the hash for the string. + +

    +
    +
    mono_string_intern
    + +
    MonoString* +mono_string_intern (MonoString *str) + +
    +

    +Parameters +

    o:
    String to intern
    +Returns +
    The interned string. +
    +Remarks +

    + Interns the string passed. + +

    +
    +
    mono_string_is_interned
    + +
    MonoString* +mono_string_is_interned (MonoString *o) + +
    +

    +Parameters +

    o:
    String to probe
    +Remarks +

    + Returns whether the string has been interned. + +

    +
    +
    mono_string_new_wrapper
    + +
    MonoString* +mono_string_new_wrapper (const char *text) + +
    +

    +Parameters +

    text:
    pointer to utf8 characters.
    +Remarks +

    + Helper function to create a string object from text in the current domain. + +

    +
    +
    mono_string_chars
    + +
    gunichar2* +mono_string_chars (MonoString *s) + +
    +

    +Parameters +

    s:
    a MonoString
    +Remarks +

    + Returns a pointer to the UCS16 characters stored in the MonoString + +

    +
    +
    mono_string_length
    + +
    int +mono_string_length (MonoString *s) + +
    +

    +Parameters +

    s:
    MonoString
    +Remarks +

    + Returns the lenght in characters of the string + + + +

    Other Encodings

    + +

    These routines are used when coping with strings that come + from Mono's environment, and might be encoded in one or more + of the external encodings. + +

    For example, some file systems might historically contain a + mix of file names with both old and new encodings, typically + UTF8 for new files, and the old files would be encoded in an 8 + bit character set (ISO-8859-1 for example). + +

    These routines try a number of encodings, those specified + in the MONO_ENCODINGS environment variable and return + unicode strings that can be used internally. + +

    See the mono(1) man page for more details. + + +

    +
    mono_unicode_from_external
    + +
    gunichar2* +mono_unicode_from_external (const gchar *in, gsize *bytes) + +
    +

    +Parameters +

    in:
    pointers to the buffer.
    bytes:
    number of bytes in the string.
    +Remarks +

    + Tries to turn a NULL-terminated string into UTF16. + + First, see if it's valid UTF8, in which case just turn it directly + into UTF16. Next, run through the colon-separated encodings in + MONO_EXTERNAL_ENCODINGS and do an iconv conversion on each, + returning the first successful conversion to UTF16. If no + conversion succeeds, return NULL. + + Callers must free the returned string if not NULL. bytes holds the number + of bytes in the returned string, not including the terminator. + +

    +
    +
    mono_unicode_to_external
    + +
    gchar*mono_unicode_to_external (const gunichar2 *uni) + +
    +

    +Parameters +

    uni:
    an UTF16 string to conver to an external representation.
    +Remarks +

    + Turns NULL-terminated UTF16 into either UTF8, or the first + working item in MONO_EXTERNAL_ENCODINGS if set. If no conversions + work, then UTF8 is returned. + + Callers must free the returned string. + +

    + +
    \ No newline at end of file diff --git a/docs/deploy/mono-api-threads.html b/docs/deploy/mono-api-threads.html new file mode 100644 index 0000000000..96fa796ab2 --- /dev/null +++ b/docs/deploy/mono-api-threads.html @@ -0,0 +1,185 @@ + + + + mono-api-threads.html + + + +

    Working with threads

    + +

    Thread API

    + +
    +
    mono_thread_attach
    + +
    Prototype: mono_thread_attach
    +

    + +

    +
    +
    mono_thread_create
    + +
    Prototype: mono_thread_create
    +

    + +

    +
    +
    mono_thread_current
    + +
    Prototype: mono_thread_current
    +

    + +

    +
    +
    mono_thread_detach
    + +
    Prototype: mono_thread_detach
    +

    + +

    +
    +
    mono_thread_exit
    + +
    Prototype: mono_thread_exit
    +

    + +

    +
    +
    mono_thread_manage
    + +
    Prototype: mono_thread_manage
    +

    + +

    +
    +
    mono_thread_new_init
    + +
    Prototype: mono_thread_new_init
    +

    + +

    +
    +
    mono_threads_get_default_stacksize
    + +
    Prototype: mono_threads_get_default_stacksize
    +

    + +

    +
    +
    mono_threads_install_cleanup
    + +
    Prototype: mono_threads_install_cleanup
    +

    + +

    +
    +
    mono_threads_set_default_stacksize
    + +
    Prototype: mono_threads_set_default_stacksize
    +

    + +

    +
    +
    mono_thread_stop
    + +
    Prototype: mono_thread_stop
    +

    + + +

    +
    +
    mono_thread_get_main
    + +
    Prototype: mono_thread_get_main
    +

    + +

    +
    +
    mono_thread_set_main
    + +
    void +mono_thread_set_main (MonoThread *thread) + +
    +

    +Parameters +

    thread:
    thread to set as the main thread
    +Remarks +

    + This function can be used to instruct the runtime to treat thread + as the main thread, ie, the thread that would normally execute the Main() + method. This basically means that at the end of thread, the runtime will + wait for the existing foreground threads to quit and other such details. + +

    +
    +
    mono_pthread_key_for_tls
    + +
    Prototype: mono_pthread_key_for_tls
    +

    + + +

    Monitors

    + + +
    +
    mono_monitor_enter
    + +
    Prototype: mono_monitor_enter
    +

    + +

    +
    +
    mono_monitor_exit
    + +
    Prototype: mono_monitor_exit
    +

    + +

    + +
    \ No newline at end of file diff --git a/docs/deploy/mono-api-type.html b/docs/deploy/mono-api-type.html new file mode 100644 index 0000000000..4364e7d2d6 --- /dev/null +++ b/docs/deploy/mono-api-type.html @@ -0,0 +1,274 @@ + + + + mono-api-type.html + + + +

    Type support

    + +

    Synopsis

    + +
    +#include <metadata/metadata.h> +#include <metadata/class.h> + +typedef struct _MonoType MonoType; + + + +MonoArrayType* mono_type_get_array_type (MonoType *type); +MonoClass* mono_type_get_class (MonoType *type); + + +char* mono_type_get_name (MonoType *type); +MonoMethodSignature* mono_type_get_signature (MonoType *type); +int mono_type_get_type (MonoType *type); + +gboolean mono_type_is_byref (MonoType *type); + + +guint32 mono_type_to_unmanaged (MonoType *type, + MonoMarshalSpec *mspec, + gboolean as_field; + + + +
    + +

    The MonoType represents the unmanaged version of + System.Type. + + +

    +
    mono_type_get_object
    + +
    Prototype: mono_type_get_object
    +

    + +

    +
    +
    mono_type_create_from_typespec
    + +
    Prototype: mono_type_create_from_typespec
    +

    + +

    +
    +
    mono_type_full_name
    + +
    Prototype: mono_type_full_name
    +

    + +

    +
    +
    mono_type_get_array_type
    + +
    MonoArrayType* +mono_type_get_array_type (MonoType *type) + +
    +

    +Parameters +

    type:
    the MonoType operated on
    +Returns +
    a MonoArrayType struct describing the array type that type + + represents. The info includes details such as rank, array element type + and the sizes and bounds of multidimensional arrays.
    +Remarks +

    + It is only valid to call this function if type is a MONO_TYPE_ARRAY. + + +

    +
    +
    mono_type_get_class
    + +
    MonoClass* +mono_type_get_class (MonoType *type) + +
    +

    +Parameters +

    type:
    the MonoType operated on
    +Returns +
    the MonoClass pointer that describes the class that type represents. +
    +Remarks +

    + It is only valid to call this function if type is a MONO_TYPE_CLASS or a + MONO_TYPE_VALUETYPE. For more general functionality, use mono_class_from_mono_type (), + instead + + +

    +
    +
    mono_type_get_desc
    + +
    Prototype: mono_type_get_desc
    +

    + +

    +
    +
    mono_type_get_modifiers
    + +
    Prototype: mono_type_get_modifiers
    +

    + +

    +
    +
    mono_type_get_name
    + +
    char* +mono_type_get_name (MonoType *type) + +
    +

    +Parameters +

    type:
    a type
    +Returns +
    the string representation for type as it would be represented in IL code. +
    + +
    +
    +
    mono_type_get_signature
    + +
    MonoMethodSignature* +mono_type_get_signature (MonoType *type) + +
    +

    +Parameters +

    type:
    the MonoType operated on
    +Returns +
    the MonoMethodSignature pointer that describes the signature + + of the function pointer type represents.
    +Remarks +

    + It is only valid to call this function if type is a MONO_TYPE_FNPTR. + + +

    +
    +
    mono_type_get_type
    + +
    int +mono_type_get_type (MonoType *type) + +
    +

    +Parameters +

    type:
    the MonoType operated on
    +Returns +
    the IL type value for type. This is one of the MonoTypeEnum + + enum members like MONO_TYPE_I4 or MONO_TYPE_STRING.
    + +
    +
    +
    mono_type_get_underlying_type
    + +
    Prototype: mono_type_get_underlying_type
    +

    + +

    +
    +
    mono_type_is_byref
    + +
    gboolean +mono_type_is_byref (MonoType *type) + +
    +

    +Parameters +

    type:
    the MonoType operated on
    +Returns +
    TRUE if type represents a type passed by reference, + + FALSE otherwise.
    + +
    +
    +
    mono_type_size
    + +
    Prototype: mono_type_size
    +

    + +

    +
    +
    mono_type_stack_size
    + +
    Prototype: mono_type_stack_size
    +

    + +

    +
    +
    mono_type_to_unmanaged
    + +
    guint32 +mono_type_to_unmanaged (MonoType *type, MonoMarshalSpec *mspec, gboolean as_field, + gboolean unicode, MonoMarshalConv *conv) + +
    +

    +Returns +

    A MonoMarshalNative enumeration value (MONO_NATIVE_) value + + describing the underlying native reprensetation of the type. + +

    + In addition the value pointed by + "conv" will contain the kind of marshalling required for this + particular type one of the MONO_MARSHAL_CONV_ enumeration values.

    + +
    + +
    \ No newline at end of file diff --git a/docs/deploy/mono-api-types.html b/docs/deploy/mono-api-types.html new file mode 100644 index 0000000000..0774670f96 --- /dev/null +++ b/docs/deploy/mono-api-types.html @@ -0,0 +1,201 @@ + + + + mono-api-types.html + + + +

    Common core types

    + +

    These are accesor methods to retrieve the MonoClass + * handle for the various built-in CLI types. + + +

    +
    mono_get_object_class
    + +
    Prototype: mono_get_object_class
    +

    + +

    +
    +
    mono_get_int16_class
    + +
    Prototype: mono_get_int16_class
    +

    + +

    +
    +
    mono_get_int32_class
    + +
    Prototype: mono_get_int32_class
    +

    + +

    +
    +
    mono_get_int64_class
    + +
    Prototype: mono_get_int64_class
    +

    + +

    +
    +
    mono_get_double_class
    + +
    Prototype: mono_get_double_class
    +

    + +

    +
    +
    mono_get_enum_class
    + +
    Prototype: mono_get_enum_class
    +

    + +

    +
    +
    mono_get_intptr_class
    + +
    Prototype: mono_get_intptr_class
    +

    + +

    +
    +
    mono_get_sbyte_class
    + +
    Prototype: mono_get_sbyte_class
    +

    + +

    +
    +
    mono_get_single_class
    + +
    Prototype: mono_get_single_class
    +

    + +

    +
    +
    mono_get_string_class
    + +
    Prototype: mono_get_string_class
    +

    + +

    +
    +
    mono_get_thread_class
    + +
    Prototype: mono_get_thread_class
    +

    + +

    +
    +
    mono_get_uint16_class
    + +
    Prototype: mono_get_uint16_class
    +

    + +

    +
    +
    mono_get_uint32_class
    + +
    Prototype: mono_get_uint32_class
    +

    + +

    +
    +
    mono_get_uint64_class
    + +
    Prototype: mono_get_uint64_class
    +

    + +

    +
    +
    mono_get_uintptr_class
    + +
    Prototype: mono_get_uintptr_class
    +

    + +

    +
    +
    mono_get_void_class
    + +
    Prototype: mono_get_void_class
    +

    + +

    +
    +
    mono_get_array_class
    + +
    Prototype: mono_get_array_class
    +

    + +

    +
    +
    mono_get_boolean_class
    + +
    Prototype: mono_get_boolean_class
    +

    + +

    +
    +
    mono_get_byte_class
    + +
    Prototype: mono_get_byte_class
    +

    + +

    +
    +
    mono_get_char_class
    + +
    Prototype: mono_get_char_class
    +

    + + +

    + +
    \ No newline at end of file diff --git a/docs/deploy/mono-api-unsorted.html b/docs/deploy/mono-api-unsorted.html new file mode 100644 index 0000000000..cbf46050b6 --- /dev/null +++ b/docs/deploy/mono-api-unsorted.html @@ -0,0 +1,510 @@ + + + + mono-api-unsorted.html + + + + + + +
    +
    mono_bounded_array_class_get
    + +
    MonoClass* +mono_bounded_array_class_get (MonoClass *eclass, guint32 rank, gboolean bounded) + +
    +

    +Parameters +

    element_class:
    element class
    rank:
    the dimension of the array class
    bounded:
    whenever the array has non-zero bounds
    +Returns +
    a class object describing the array with element type element_type and + + dimension rank.
    + +
    +
    +
    mono_check_corlib_version
    + +
    const char* +mono_check_corlib_version (void) + +
    +

    +Returns +

    NULL if the runtime will work with the corlib, or a g_malloc + + allocated string with the error otherwise.
    +Remarks +

    + Checks that the corlib that is loaded matches the version of this runtime. + + +

    +
    +
    mono_compile_method
    + +
    gpointer +mono_compile_method (MonoMethod *method) + +
    +

    +Parameters +

    method:
    The method to compile.
    +Remarks +

    + This JIT-compiles the method, and returns the pointer to the native code + produced. + +

    +
    +
    mono_config_for_assembly
    + +
    Prototype: mono_config_for_assembly
    +

    + +

    +
    +
    mono_dllmap_insert
    + +
    void +mono_dllmap_insert (MonoImage *assembly, const char *dll, const char *func, const char *tdll, const char *tfunc) + +
    +

    +Parameters +

    assembly:
    if NULL, this is a global mapping, otherwise the remapping of the dynamic library will only apply to the specified assembly
    dll:
    The name of the external library, as it would be found in the DllImport declaration. If prefixed with 'i:' the matching of the library name is done without case sensitivity
    func:
    if not null, the mapping will only applied to the named function (the value of EntryPoint)
    tdll:
    The name of the library to map the specified dll if it matches.
    tfunc:
    if func is not NULL, the name of the function that replaces the invocation
    +Remarks +

    + LOCKING: Acquires the loader lock. + + This function is used to programatically add DllImport remapping in either + a specific assembly, or as a global remapping. This is done by remapping + references in a DllImport attribute from the dll library name into the tdll + name. If the dll name contains the prefix "i:", the comparison of the + library name is done without case sensitivity. + + If you pass func, this is the name of the EntryPoint in a DllImport if specified + or the name of the function as determined by DllImport. If you pass func, you + must also pass tfunc which is the name of the target function to invoke on a match. + + Example: + mono_dllmap_insert (NULL, "i:libdemo.dll", NULL, relocated_demo_path, NULL); + + The above will remap DllImport statments for "libdemo.dll" and "LIBDEMO.DLL" to + the contents of relocated_demo_path for all assemblies in the Mono process. + + NOTE: This can be called before the runtime is initialized, for example from + mono_config_parse (). + +

    +
    +
    mono_environment_exitcode_get
    + +
    Prototype: mono_environment_exitcode_get
    +

    + +

    +
    +
    mono_environment_exitcode_set
    + +
    Prototype: mono_environment_exitcode_set
    +

    + +

    +
    +
    mono_free_method
    + +
    Prototype: mono_free_method
    +

    + +

    +
    +
    mono_free_verify_list
    + +
    Prototype: mono_free_verify_list
    +

    + +

    +
    +
    mono_get_config_dir
    + +
    Prototype: mono_get_config_dir
    +

    + +

    +
    +
    mono_get_corlib
    + +
    Prototype: mono_get_corlib
    +

    + +

    +
    +
    mono_get_delegate_invoke
    + +
    MonoMethod* +mono_get_delegate_invoke (MonoClass *klass) + +
    +

    +Parameters +

    klass:
    The delegate class
    +Returns +
    the MonoMethod for the "Invoke" method in the delegate klass or NULL if klass is a broken delegate type +
    + +
    +
    +
    mono_get_method_full
    + +
    Prototype: mono_get_method_full
    +

    + +

    +
    +
    mono_get_method
    + +
    Prototype: mono_get_method
    +

    + +

    +
    +
    mono_get_root_domain
    + +
    MonoDomain* +mono_get_root_domain (void) + +
    +

    +Returns +

    the root appdomain, to obtain the current domain, use mono_domain_get () +
    +Remarks +

    + The root AppDomain is the initial domain created by the runtime when it is + initialized. Programs execute on this AppDomain, but can create new ones + later. Currently there is no unmanaged API to create new AppDomains, this + must be done from managed code. + + +

    +
    +
    mono_init_from_assembly
    + +
    MonoDomain* +mono_init_from_assembly (const char *domain_name, const char *filename) + +
    +

    +Parameters +

    domain_name:
    name to give to the initial domain
    filename:
    filename to load on startup
    +Returns +
    the initial domain. +
    +Remarks +

    + Used by the runtime, users should use mono_jit_init instead. + + Creates the initial application domain and initializes the mono_defaults + structure. + This function is guaranteed to not run any IL code. + The runtime is initialized using the runtime version required by the + provided executable. The version is determined by looking at the exe + configuration file and the version PE field) + + +

    +
    +
    mono_init
    + +
    MonoDomain* +mono_init (const char *domain_name) + +
    +

    +Returns +

    the initial domain. +
    +Remarks +

    + + Creates the initial application domain and initializes the mono_defaults + structure. + This function is guaranteed to not run any IL code. + The runtime is initialized using the default runtime version. + + +

    +
    +
    mono_init_version
    + +
    MonoDomain* +mono_init_version (const char *domain_name, const char *version) + +
    +

    +Returns +

    the initial domain. +
    +Remarks +

    + + Used by the runtime, users should use mono_jit_init instead. + +

    + Creates the initial application domain and initializes the mono_defaults + structure. + + This function is guaranteed to not run any IL code. + The runtime is initialized using the provided rutime version. + + +

    +
    +
    mono_jit_exec
    + +
    int +mono_jit_exec (MonoDomain *domain, MonoAssembly *assembly, int argc, char *argv[]) + +
    +

    +Parameters +

    assembly:
    reference to an assembly
    argc:
    argument count
    argv:
    argument vector
    +Remarks +

    + Start execution of a program. + +

    +
    +
    mono_lookup_internal_call
    + +
    Prototype: mono_lookup_internal_call
    +

    + +

    +
    +
    mono_lookup_pinvoke_call
    + +
    Prototype: mono_lookup_pinvoke_call
    +

    + +

    +
    +
    mono_main
    + +
    int +mono_main (int argc, char* argv[]) + +
    +

    +Parameters +

    argc:
    number of arguments in the argv array
    argv:
    array of strings containing the startup arguments
    +Remarks +

    + Launches the Mono JIT engine and parses all the command line options + in the same way that the mono command line VM would. + +

    +
    +
    mono_parse_default_optimizations
    + +
    Prototype: mono_parse_default_optimizations
    +

    + +

    +
    +
    mono_ptr_class_get
    + +
    Prototype: mono_ptr_class_get
    +

    + +

    +
    +
    mono_register_bundled_assemblies
    + +
    Prototype: mono_register_bundled_assemblies
    +

    + +

    +
    +
    mono_runtime_class_init
    + +
    Prototype: mono_runtime_class_init
    +

    + +

    +
    +
    mono_runtime_cleanup
    + +
    void +mono_runtime_cleanup (MonoDomain *domain) + +
    +

    +Parameters +

    domain:
    unused.
    +Remarks +

    + Internal routine. + + This must not be called while there are still running threads executing + managed code. + +

    +
    +
    mono_runtime_get_main_args
    + +
    MonoArray* +mono_runtime_get_main_args (void) + +
    +

    +Returns +

    a MonoArray with the arguments passed to the main program +
    + +
    +
    +
    mono_runtime_init
    + +
    void +mono_runtime_init (MonoDomain *domain, MonoThreadStartCB start_cb, + MonoThreadAttachCB attach_cb) + +
    +

    +Parameters +

    domain:
    domain returned by mono_init ()
    +Remarks +

    + Initialize the core AppDomain: this function will run also some + IL initialization code, so it needs the execution engine to be fully + operational. + + AppDomain.SetupInformation is set up in mono_runtime_exec_main, where + we know the entry_assembly. + + +

    +
    +
    mono_runtime_is_shutting_down
    + +
    gboolean +mono_runtime_is_shutting_down (void) + +
    +

    +Remarks +

    + Returns whether the runtime has been flagged for shutdown. + + This is consumed by the P:System.Environment.HasShutdownStarted + property. + + +

    +
    +
    mono_runtime_object_init
    + +
    Prototype: mono_runtime_object_init
    +

    + +

    +
    +
    mono_runtime_quit
    + +
    Prototype: mono_runtime_quit
    +

    + +

    +
    +
    mono_runtime_run_main
    + +
    int +mono_runtime_run_main (MonoMethod *method, int argc, char* argv[], + MonoObject **exc) + +
    +

    +Parameters +

    method:
    the method to start the application with (usually Main)
    argc:
    number of arguments from the command line
    argv:
    array of strings from the command line
    exc:
    excetption results
    +Remarks +

    + Execute a standard Main() method (argc/argv contains the + executable name). This method also sets the command line argument value + needed by System.Environment. + + +

    + +

    +
    +
    mono_table_info_get_rows
    + +
    Prototype: mono_table_info_get_rows
    +

    + +

    +
    +
    mono_upgrade_remote_class_wrapper
    + +
    Prototype: mono_upgrade_remote_class_wrapper
    +

    + +

    +
    +
    mono_verify_corlib
    + +
    Prototype: mono_verify_corlib
    +

    + +

    + +
    \ No newline at end of file diff --git a/docs/deploy/mono-api-utils.html b/docs/deploy/mono-api-utils.html new file mode 100644 index 0000000000..c0f236e038 --- /dev/null +++ b/docs/deploy/mono-api-utils.html @@ -0,0 +1,624 @@ + + + + mono-api-utils.html + + + +

    Utility Methods

    + +

    Bitsets

    + +

    MonoBitsets are a set of routines used to manipulate sets + of bits. + + +

    +
    mono_bitset_alloc_size
    + +
    Prototype: mono_bitset_alloc_size
    +

    + +

    +
    +
    mono_bitset_clear
    + +
    Prototype: mono_bitset_clear
    +

    + +

    +
    +
    mono_bitset_clear_all
    + +
    Prototype: mono_bitset_clear_all
    +

    + +

    +
    +
    mono_bitset_clone
    + +
    Prototype: mono_bitset_clone
    +

    + +

    +
    +
    mono_bitset_copyto
    + +
    Prototype: mono_bitset_copyto
    +

    + +

    +
    +
    mono_bitset_count
    + +
    Prototype: mono_bitset_count
    +

    + +

    +
    +
    mono_bitset_equal
    + +
    Prototype: mono_bitset_equal
    +

    + +

    +
    +
    mono_bitset_find_first
    + +
    Prototype: mono_bitset_find_first
    +

    + +

    +
    +
    mono_bitset_find_last
    + +
    Prototype: mono_bitset_find_last
    +

    + +

    +
    +
    mono_bitset_find_start
    + +
    Prototype: mono_bitset_find_start
    +

    + +

    +
    +
    mono_bitset_foreach
    + +
    Prototype: mono_bitset_foreach
    +

    + +

    +
    +
    mono_bitset_free
    + +
    Prototype: mono_bitset_free
    +

    + +

    +
    +
    mono_bitset_intersection
    + +
    Prototype: mono_bitset_intersection
    +

    + +

    +
    +
    mono_bitset_invert
    + +
    Prototype: mono_bitset_invert
    +

    + +

    +
    +
    mono_bitset_mem_new
    + +
    Prototype: mono_bitset_mem_new
    +

    + +

    +
    +
    mono_bitset_new
    + +
    Prototype: mono_bitset_new
    +

    + +

    +
    +
    mono_bitset_set
    + +
    Prototype: mono_bitset_set
    +

    + +

    +
    +
    mono_bitset_set_all
    + +
    Prototype: mono_bitset_set_all
    +

    + +

    +
    +
    mono_bitset_size
    + +
    Prototype: mono_bitset_size
    +

    + +

    +
    +
    mono_bitset_sub
    + +
    Prototype: mono_bitset_sub
    +

    + +

    +
    +
    mono_bitset_test
    + +
    Prototype: mono_bitset_test
    +

    + +

    +
    +
    mono_bitset_test_bulk
    + +
    Prototype: mono_bitset_test_bulk
    +

    + +

    +
    +
    mono_bitset_union
    + +
    Prototype: mono_bitset_union
    +

    + +

    +
    +
    mono_bitset_find_first_unset
    + +
    Prototype: mono_bitset_find_first_unset
    +

    + +

    +
    +
    mono_bitset_intersection_2
    + +
    Prototype: mono_bitset_intersection_2
    +

    + + +

    Hashtables

    + +

    GHashTable is used when you need to store object + references into a hashtable, objects stored in a + MonoGHashTable are properly tracked by the garbage + collector. + +

    The MonoGHashTable data type has the same API as + the GLIB. + + +

    +
    mono_g_hash_table_destroy
    + +
    Prototype: mono_g_hash_table_destroy
    +

    + +

    +
    +
    mono_g_hash_table_foreach
    + +
    Prototype: mono_g_hash_table_foreach
    +

    + +

    +
    +
    mono_g_hash_table_foreach_remove
    + +
    Prototype: mono_g_hash_table_foreach_remove
    +

    + +

    +
    +
    mono_g_hash_table_foreach_steal
    + +
    Prototype: mono_g_hash_table_foreach_steal
    +

    + +

    +
    +
    mono_g_hash_table_insert
    + +
    Prototype: mono_g_hash_table_insert
    +

    + +

    +
    +
    mono_g_hash_table_lookup
    + +
    Prototype: mono_g_hash_table_lookup
    +

    + +

    +
    +
    mono_g_hash_table_lookup_extended
    + +
    Prototype: mono_g_hash_table_lookup_extended
    +

    + +

    +
    +
    mono_g_hash_table_new
    + +
    Prototype: mono_g_hash_table_new
    +

    + +

    +
    +
    mono_g_hash_table_new_full
    + +
    Prototype: mono_g_hash_table_new_full
    +

    + +

    +
    +
    mono_g_hash_table_remap
    + +
    Prototype: mono_g_hash_table_remap
    +

    + +

    +
    +
    mono_g_hash_table_remove
    + +
    Prototype: mono_g_hash_table_remove
    +

    + +

    +
    +
    mono_g_hash_table_replace
    + +
    Prototype: mono_g_hash_table_replace
    +

    + +

    +
    +
    mono_g_hash_table_size
    + +
    Prototype: mono_g_hash_table_size
    +

    + +

    +
    +
    mono_g_hash_table_steal
    + +
    Prototype: mono_g_hash_table_steal
    +

    + + +

    SHA1 Signatures

    + + +
    +
    mono_sha1_init
    + +
    Prototype: mono_sha1_init
    +

    + +

    +
    +
    mono_sha1_update
    + +
    Prototype: mono_sha1_update
    +

    + +

    +
    +
    mono_sha1_get_digest_from_file
    + +
    Prototype: mono_sha1_get_digest_from_file
    +

    + +

    +
    +
    mono_sha1_get_digest
    + +
    Prototype: mono_sha1_get_digest
    +

    + +

    +
    +
    mono_sha1_final
    + +
    Prototype: mono_sha1_final
    +

    + + +

    MD5 Signatures

    + + +
    +
    mono_md5_init
    + +
    Prototype: mono_md5_init
    +

    + +

    +
    +
    mono_md5_update
    + +
    Prototype: mono_md5_update
    +

    + +

    +
    +
    mono_md5_get_digest_from_file
    + +
    Prototype: mono_md5_get_digest_from_file
    +

    + +

    +
    +
    mono_md5_get_digest
    + +
    Prototype: mono_md5_get_digest
    +

    + +

    +
    +
    mono_md5_final
    + +
    Prototype: mono_md5_final
    +

    + + +

    +
    +
    mono_digest_get_public_token
    + +
    Prototype: mono_digest_get_public_token
    +

    + + +

    Memory Pools

    + +

    Memory pools are a convenient way of tracking memory + allocations that are used for one specific task, they are also + faster than using the standard memory allocation procedures, + as they are designed to be used only by a single thread at a + time. + +

    MonoMemPool objects are not thread safe, which + means that you should not share the objects across multiple + threads without providing proper locking around it (unlike + malloc and free which are thread safe). + +

    When a MonoMemPool is released with + mono_mempool_destroy all of the of the memory + allocated from that memory pool with + mono_mempool_alloc and mono_mempool_alloc0 + is released. + + +

    +
    mono_mempool_new
    + +
    MonoMemPool* +mono_mempool_new (void) + +
    +

    +Returns +

    a new memory pool. +
    + +
    +
    +
    mono_mempool_destroy
    + +
    void +mono_mempool_destroy (MonoMemPool *pool) + +
    +

    +Parameters +

    pool:
    the memory pool to destroy
    +Remarks +

    + Free all memory associated with this pool. + +

    +
    +
    mono_mempool_alloc
    + +
    gpointer +mono_mempool_alloc (MonoMemPool *pool, guint size) + +
    +

    +Parameters +

    pool:
    the momory pool to use
    size:
    size of the momory block
    +Returns +
    the address of a newly allocated memory block. +
    +Remarks +

    + Allocates a new block of memory in pool. + + +

    +
    +
    mono_mempool_alloc0
    + +
    gpointer +mono_mempool_alloc0 (MonoMemPool *pool, guint size) + +
    +

    +Remarks +

    + same as mono_mempool_alloc, but fills memory with zero. + +

    +
    +
    mono_mempool_empty
    + +
    Prototype: mono_mempool_empty
    +

    + +

    +
    +
    mono_mempool_invalidate
    + +
    void +mono_mempool_invalidate (MonoMemPool *pool) + +
    +

    +Parameters +

    pool:
    the memory pool to invalidate
    +Remarks +

    + Fill the memory associated with this pool to 0x2a (42). Useful for debugging. + +

    +
    +
    mono_mempool_stats
    + +
    void +mono_mempool_stats (MonoMemPool *pool) + +
    +

    +Parameters +

    pool:
    the momory pool we need stats for
    +Remarks +

    + Print a few stats about the mempool + +

    +
    +
    mono_mempool_contains_addr
    + +
    gboolean +mono_mempool_contains_addr (MonoMemPool *pool, + gpointer addr) + +
    +

    +Remarks +

    + Determines whenever ADDR is inside the memory used by the mempool. + + +

    JIT utilities

    + + +
    +
    mono_signbit_double
    + +
    Prototype: mono_signbit_double
    +

    + +

    +
    +
    mono_signbit_float
    + +
    Prototype: mono_signbit_float
    +

    + + +

    Disassembling Generated Code

    + +

    Routines used to debug the JIT-produced code. + + +

    +
    mono_disasm_code
    + +
    Prototype: mono_disasm_code
    +

    + +

    +
    +
    mono_disasm_code_one
    + +
    Prototype: mono_disasm_code_one
    +

    + + +

    Walking the Stack

    + + +
    +
    mono_walk_stack
    + +
    Prototype: mono_walk_stack
    +

    + +

    +
    +
    mono_stack_walk_no_il
    + +
    Prototype: mono_stack_walk_no_il
    +

    + + +

    Others

    + + +
    +
    mono_escape_uri_string
    + +
    Prototype: mono_escape_uri_string
    +

    + +

    + +
    \ No newline at end of file diff --git a/docs/deploy/mono-api-vm.html b/docs/deploy/mono-api-vm.html new file mode 100644 index 0000000000..d1dc657898 --- /dev/null +++ b/docs/deploy/mono-api-vm.html @@ -0,0 +1,55 @@ + + + + mono-api-vm.html + + + + + + \ No newline at end of file diff --git a/docs/deploy/mono-api-wapi.html b/docs/deploy/mono-api-wapi.html new file mode 100644 index 0000000000..778f9f9731 --- /dev/null +++ b/docs/deploy/mono-api-wapi.html @@ -0,0 +1,1588 @@ + + + + mono-api-wapi.html + + + +

    Windows Compatibility API

    + +

    Mono implements a small subset of the Win32 API for some + file system interaction, I/O, thread and process operations. + +

    On Windows, Mono uses directly the services provided by the + operating system. On other operating system it uses its own + implementation (referred to as the "io-layer" or "wapi"). + +

    Windows Compatibility API

    + + +
    +
    BindIoCompletionCallback
    + +
    Prototype: BindIoCompletionCallback
    +

    + +

    +
    +
    CloseHandle
    + +
    gboolean CloseHandle(gpointer handle) + +
    +

    +Parameters +

    handle:
    The handle to release
    +Remarks +

    + Closes and invalidates handle, releasing any resources it + consumes. When the last handle to a temporary or non-persistent + object is closed, that object can be deleted. Closing the same + handle twice is an error. + + Return value: %TRUE on success, %FALSE otherwise. + +

    +
    +
    closesocket
    + +
    Prototype: closesocket
    +

    + +

    +
    +
    CopyFile
    + +
    gboolean CopyFile (const gunichar2 *name, const gunichar2 *dest_name, + gboolean fail_if_exists) + +
    +

    +Parameters +

    name:
    a pointer to a NULL-terminated unicode string, that names
    +Remarks +

    the file to be copied. + dest_name: a pointer to a NULL-terminated unicode string, that is the + new name for the file. + fail_if_exists: if TRUE and dest_name exists, the copy will fail. + + Copies file name to dest_name + + Return value: %TRUE on success, %FALSE otherwise. + +

    +
    +
    CreateDirectory
    + +
    gboolean CreateDirectory (const gunichar2 *name, + WapiSecurityAttributes *security) + +
    +

    +Parameters +

    name:
    a pointer to a NULL-terminated unicode string, that names
    +Remarks +

    the directory to be created. + security: ignored for now + + Creates directory name + + Return value: %TRUE on success, %FALSE otherwise. + +

    +
    +
    CreateEvent
    + +
    gpointer CreateEvent(WapiSecurityAttributes *security G_GNUC_UNUSED, + gboolean manual, gboolean initial, + const gunichar2 *name G_GNUC_UNUSED) + +
    +

    +Parameters +

    security:
    Ignored for now.
    manual:
    Specifies whether the new event handle has manual or auto
    +Remarks +

    reset behaviour. + initial: Specifies whether the new event handle is initially + signalled or not. + name:Pointer to a string specifying the name of this name, or + %NULL. Currently ignored. + + Creates a new event handle. + + An event handle is signalled with SetEvent(). If the new handle is + a manual reset event handle, it remains signalled until it is reset + with ResetEvent(). An auto reset event remains signalled until a + single thread has waited for it, at which time the event handle is + automatically reset to unsignalled. + + Return value: A new handle, or %NULL on error. + +

    +
    +
    CreateFile
    + +
    gpointer CreateFile(const gunichar2 *name, guint32 fileaccess, + guint32 sharemode, WapiSecurityAttributes *security, + guint32 createmode, guint32 attrs, + gpointer template G_GNUC_UNUSED) + +
    +

    +Parameters +

    name:
    a pointer to a NULL-terminated unicode string, that names
    +Remarks +

    the file or other object to create. + fileaccess: specifies the file access mode + sharemode: whether the file should be shared. This parameter is + currently ignored. + security: Ignored for now. + createmode: specifies whether to create a new file, whether to + overwrite an existing file, whether to truncate the file, etc. + attrs: specifies file attributes and flags. On win32 attributes + are characteristics of the file, not the handle, and are ignored + when an existing file is opened. Flags give the library hints on + how to process a file to optimise performance. + template: the handle of an open %GENERIC_READ file that specifies + attributes to apply to a newly created file, ignoring attrs. + Normally this parameter is NULL. This parameter is ignored when an + existing file is opened. + + Creates a new file handle. This only applies to normal files: + pipes are handled by CreatePipe(), and console handles are created + with GetStdHandle(). + + Return value: the new handle, or %INVALID_HANDLE_VALUE on error. + +

    +
    +
    CreateMutex
    + +
    gpointer CreateMutex(WapiSecurityAttributes *security G_GNUC_UNUSED, gboolean owned, + const gunichar2 *name) + +
    +

    +Parameters +

    security:
    Ignored for now.
    owned:
    If %TRUE, the mutex is created with the calling thread
    +Remarks +

    already owning the mutex. + name:Pointer to a string specifying the name of this mutex, or + %NULL. + + Creates a new mutex handle. A mutex is signalled when no thread + owns it. A thread acquires ownership of the mutex by waiting for + it with WaitForSingleObject() or WaitForMultipleObjects(). A + thread relinquishes ownership with ReleaseMutex(). + + A thread that owns a mutex can specify the same mutex in repeated + wait function calls without blocking. The thread must call + ReleaseMutex() an equal number of times to release the mutex. + + Return value: A new handle, or %NULL on error. + +

    +
    +
    CreatePipe
    + +
    Prototype: CreatePipe
    +

    + +

    +
    +
    CreateProcess
    + +
    Prototype: CreateProcess
    +

    + +

    +
    +
    CreateProcessWithLogonW
    + +
    Prototype: CreateProcessWithLogonW
    +

    + +

    +
    +
    CreateSemaphore
    + +
    gpointer CreateSemaphore(WapiSecurityAttributes *security G_GNUC_UNUSED, gint32 initial, gint32 max, const gunichar2 *name) + +
    +

    +Parameters +

    security:
    Ignored for now.
    initial:
    The initial count for the semaphore. The value must be
    +Remarks +

    greater than or equal to zero, and less than or equal to max. + max: The maximum count for this semaphore. The value must be + greater than zero. + name: Pointer to a string specifying the name of this semaphore, + or %NULL. Currently ignored. + + Creates a new semaphore handle. A semaphore is signalled when its + count is greater than zero, and unsignalled otherwise. The count + is decreased by one whenever a wait function releases a thread that + was waiting for the semaphore. The count is increased by calling + ReleaseSemaphore(). + + Return value: a new handle, or NULL + +

    +
    +
    CreateThread
    + +
    Prototype: CreateThread
    +

    + +

    +
    +
    DeleteCriticalSection
    + +
    Prototype: DeleteCriticalSection
    +

    + +

    +
    +
    DeleteFile
    + +
    gboolean DeleteFile(const gunichar2 *name) + +
    +

    +Parameters +

    name:
    a pointer to a NULL-terminated unicode string, that names
    +Remarks +

    the file to be deleted. + + Deletes file name. + + Return value: %TRUE on success, %FALSE otherwise. + +

    +
    +
    DuplicateHandle
    + +
    Prototype: DuplicateHandle
    +

    + +

    +
    +
    EnterCriticalSection
    + +
    Prototype: EnterCriticalSection
    +

    + +

    +
    +
    EnumProcesses
    + +
    Prototype: EnumProcesses
    +

    + +

    +
    +
    EnumProcessModules
    + +
    Prototype: EnumProcessModules
    +

    + +

    +
    +
    errno_to_WSA
    + +
    Prototype: errno_to_WSA
    +

    + +

    +
    +
    ExitThread
    + +
    Prototype: ExitThread
    +

    + +

    +
    +
    FileTimeToSystemTime
    + +
    gboolean FileTimeToSystemTime(const WapiFileTime *file_time, + WapiSystemTime *system_time) + +
    +

    +Parameters +

    file_time:
    Points to a %WapiFileTime structure that contains the
    +Remarks +

    number of ticks to convert. + system_time: Points to a %WapiSystemTime structure to receive the + broken-out time. + + Converts a tick count into broken-out time values. + + Return value: %TRUE on success, %FALSE otherwise. + +

    +
    +
    FindClose
    + +
    gboolean FindClose (gpointer handle) + +
    +

    +Parameters +

    wapi_handle:
    the find handle to close.
    +Remarks +

    + Closes find handle wapi_handle + + Return value: %TRUE on success, %FALSE otherwise. + +

    +
    +
    FindFirstFile
    + +
    Prototype: FindFirstFile
    +

    + +

    +
    +
    FindNextFile
    + +
    Prototype: FindNextFile
    +

    + +

    +
    +
    FlushFileBuffers
    + +
    gboolean FlushFileBuffers(gpointer handle) + +
    +

    +Parameters +

    handle:
    Handle to open file. The handle must have
    +Remarks +

    %GENERIC_WRITE access. + + Flushes buffers of the file and causes all unwritten data to + be written. + + Return value: %TRUE on success, %FALSE otherwise. + +

    +
    +
    FormatMessage
    + +
    Prototype: FormatMessage
    +

    + +

    +
    +
    GetCurrentDirectory
    + +
    extern guint32 GetCurrentDirectory (guint32 length, gunichar2 *buffer) + +
    +

    +Parameters +

    length:
    size of the buffer
    buffer:
    pointer to buffer that recieves path
    +Remarks +

    + Retrieves the current directory for the current process. + + Return value: number of characters in buffer on success, zero on failure + +

    +
    +
    GetCurrentProcess
    + +
    Prototype: GetCurrentProcess
    +

    + +

    +
    +
    GetCurrentProcessId
    + +
    Prototype: GetCurrentProcessId
    +

    + +

    +
    +
    GetCurrentThread
    + +
    Prototype: GetCurrentThread
    +

    + +

    +
    +
    GetCurrentThreadId
    + +
    gsize +GetCurrentThreadId (void) + +
    +

    +Remarks +

    + Looks up the thread ID of the current thread. This ID can be + passed to OpenThread() to create a new handle on this thread. + + Return value: the thread ID. NB this is defined as DWORD (ie 32 + bit) in the MS API, but we need to cope with 64 bit IDs for s390x + and amd64. This doesn't really break the API, it just embraces and + extends it on 64bit platforms :) + +

    +
    +
    GetDiskFreeSpaceEx
    + +
    Prototype: GetDiskFreeSpaceEx
    +

    + +

    +
    +
    GetDriveType
    + +
    Prototype: GetDriveType
    +

    + +

    +
    +
    GetExitCodeProcess
    + +
    Prototype: GetExitCodeProcess
    +

    + +

    +
    +
    GetExitCodeThread
    + +
    Prototype: GetExitCodeThread
    +

    + +

    +
    +
    GetFileAttributesEx
    + +
    gboolean GetFileAttributesEx (const gunichar2 *name, WapiGetFileExInfoLevels level, gpointer info) + +
    +

    +Parameters +

    name:
    a pointer to a NULL-terminated unicode filename.
    level:
    must be GetFileExInfoStandard
    info:
    pointer to a WapiFileAttributesData structure
    +Remarks +

    + Gets attributes, size and filetimes for name; + + Return value: %TRUE on success, %FALSE on failure + +

    +
    +
    GetFileAttributes
    + +
    guint32 GetFileAttributes (const gunichar2 *name) + +
    +

    +Parameters +

    name:
    a pointer to a NULL-terminated unicode filename.
    +Remarks +

    + Gets the attributes for name; + + Return value: %INVALID_FILE_ATTRIBUTES on failure + +

    +
    +
    GetFileSize
    + +
    guint32 GetFileSize(gpointer handle, guint32 *highsize) + +
    +

    +Parameters +

    handle:
    The file handle to query. The handle must have
    +Remarks +

    %GENERIC_READ or %GENERIC_WRITE access. + highsize: If non-%NULL, the high 32 bits of the file size are + stored here. + + Retrieves the size of the file handle. + + If the library is compiled without large file support, highsize + has its value set to zero on a successful return. + + Return value: On success, the low 32 bits of the file size. If + highsize is non-%NULL then the high 32 bits of the file size are + stored here. On failure %INVALID_FILE_SIZE is returned. + +

    +
    +
    GetFileTime
    + +
    gboolean GetFileTime(gpointer handle, WapiFileTime *create_time, + WapiFileTime *last_access, WapiFileTime *last_write) + +
    +

    +Parameters +

    handle:
    The file handle to query. The handle must have
    +Remarks +

    %GENERIC_READ access. + create_time: Points to a %WapiFileTime structure to receive the + number of ticks since the epoch that file was created. May be + %NULL. + last_access: Points to a %WapiFileTime structure to receive the + number of ticks since the epoch when file was last accessed. May be + %NULL. + last_write: Points to a %WapiFileTime structure to receive the + number of ticks since the epoch when file was last written to. May + be %NULL. + + Finds the number of ticks since the epoch that the file referenced + by handle was created, last accessed and last modified. A tick is + a 100 nanosecond interval. The epoch is Midnight, January 1 1601 + GMT. + + Create time isn't recorded on POSIX file systems or reported by + stat(2), so that time is guessed by returning the oldest of the + other times. + + Return value: %TRUE on success, %FALSE otherwise. + +

    +
    +
    GetFileType
    + +
    WapiFileType GetFileType(gpointer handle) + +
    +

    +Parameters +

    handle:
    The file handle to test.
    +Remarks +

    + Finds the type of file handle. + + Return value: %FILE_TYPE_UNKNOWN - the type of the file handle is + unknown. %FILE_TYPE_DISK - handle is a disk file. + %FILE_TYPE_CHAR - handle is a character device, such as a console. + %FILE_TYPE_PIPE - handle is a named or anonymous pipe. + +

    +
    +
    GetFileVersionInfo
    + +
    Prototype: GetFileVersionInfo
    +

    + +

    +
    +
    GetFileVersionInfoSize
    + +
    Prototype: GetFileVersionInfoSize
    +

    + +

    +
    +
    GetLastError
    + +
    guint32 GetLastError(void) + +
    +

    +Remarks +

    + Retrieves the last error that occurred in the calling thread. + + Return value: The error code for the last error that happened on + the calling thread. + +

    +
    +
    GetLogicalDriveStrings
    + +
    Prototype: GetLogicalDriveStrings
    +

    + +

    +
    +
    GetModuleBaseName
    + +
    Prototype: GetModuleBaseName
    +

    + +

    +
    +
    GetModuleFileNameEx
    + +
    Prototype: GetModuleFileNameEx
    +

    + +

    +
    +
    GetModuleInformation
    + +
    Prototype: GetModuleInformation
    +

    + +

    +
    +
    GetPriorityClass
    + +
    Prototype: GetPriorityClass
    +

    + +

    +
    +
    GetProcessId
    + +
    Prototype: GetProcessId
    +

    + +

    +
    +
    GetProcessTimes
    + +
    Prototype: GetProcessTimes
    +

    + +

    +
    +
    GetProcessWorkingSetSize
    + +
    Prototype: GetProcessWorkingSetSize
    +

    + +

    +
    +
    GetStdHandle
    + +
    +static mono_mutex_t stdhandle_mutex; + +gpointer GetStdHandle(WapiStdHandle stdhandle) + +
    +

    +Parameters +

    stdhandle:
    specifies the file descriptor
    +Remarks +

    + Returns a handle for stdin, stdout, or stderr. Always returns the + same handle for the same stdhandle. + + Return value: the handle, or %INVALID_HANDLE_VALUE on error + +

    +
    +
    GetSystemInfo
    + +
    Prototype: GetSystemInfo
    +

    + +

    +
    +
    GetTempPath
    + +
    Prototype: GetTempPath
    +

    + +

    +
    +
    GetThreadContext
    + +
    Prototype: GetThreadContext
    +

    + +

    +
    +
    GetTickCount
    + +
    Prototype: GetTickCount
    +

    + +

    +
    +
    ImpersonateLoggedOnUser
    + +
    Prototype: ImpersonateLoggedOnUser
    +

    + +

    +
    +
    InitializeCriticalSectionAndSpinCount
    + +
    Prototype: InitializeCriticalSectionAndSpinCount
    +

    + +

    +
    +
    InitializeCriticalSection
    + +
    Prototype: InitializeCriticalSection
    +

    + +

    +
    +
    ioctlsocket
    + +
    Prototype: ioctlsocket
    +

    + +

    +
    +
    LeaveCriticalSection
    + +
    Prototype: LeaveCriticalSection
    +

    + +

    +
    +
    LockFile
    + +
    Prototype: LockFile
    +

    + +

    +
    +
    MoveFile
    + +
    gboolean MoveFile (const gunichar2 *name, const gunichar2 *dest_name) + +
    +

    +Parameters +

    name:
    a pointer to a NULL-terminated unicode string, that names
    +Remarks +

    the file to be moved. + dest_name: a pointer to a NULL-terminated unicode string, that is the + new name for the file. + + Renames file name to dest_name. + MoveFile sets ERROR_ALREADY_EXISTS if the destination exists, except + when it is the same file as the source. In that case it silently succeeds. + + Return value: %TRUE on success, %FALSE otherwise. + +

    +
    +
    OpenEvent
    + +
    Prototype: OpenEvent
    +

    + +

    +
    +
    OpenMutex
    + +
    Prototype: OpenMutex
    +

    + +

    +
    +
    OpenProcess
    + +
    Prototype: OpenProcess
    +

    + +

    +
    +
    OpenSemaphore
    + +
    Prototype: OpenSemaphore
    +

    + +

    +
    +
    OpenThread
    + +
    Prototype: OpenThread
    +

    + +

    +
    +
    PulseEvent
    + +
    gboolean PulseEvent(gpointer handle) + +
    +

    +Parameters +

    handle:
    The event handle.
    +Remarks +

    + Sets the event handle handle to the signalled state, and then + resets it to unsignalled after informing any waiting threads. + + If handle is a manual reset event, all waiting threads that can be + released immediately are released. handle is then reset. If + handle is an auto reset event, one waiting thread is released even + if multiple threads are waiting. + + Return value: %TRUE on success, %FALSE otherwise. (Currently only + ever returns %TRUE). + +

    +
    +
    QueryPerformanceCounter
    + +
    Prototype: QueryPerformanceCounter
    +

    + +

    +
    +
    QueryPerformanceFrequency
    + +
    Prototype: QueryPerformanceFrequency
    +

    + +

    +
    +
    QueueUserAPC
    + +
    Prototype: QueueUserAPC
    +

    + +

    +
    +
    ReadFile
    + +
    gboolean ReadFile(gpointer handle, gpointer buffer, guint32 numbytes, + guint32 *bytesread, WapiOverlapped *overlapped) + +
    +

    +Parameters +

    handle:
    The file handle to read from. The handle must have
    +Remarks +

    %GENERIC_READ access. + buffer: The buffer to store read data in + numbytes: The maximum number of bytes to read + bytesread: The actual number of bytes read is stored here. This + value can be zero if the handle is positioned at the end of the + file. + overlapped: points to a required %WapiOverlapped structure if + handle has the %FILE_FLAG_OVERLAPPED option set, should be NULL + otherwise. + + If handle does not have the %FILE_FLAG_OVERLAPPED option set, this + function reads up to numbytes bytes from the file from the current + file position, and stores them in buffer. If there are not enough + bytes left in the file, just the amount available will be read. + The actual number of bytes read is stored in bytesread. + + If handle has the %FILE_FLAG_OVERLAPPED option set, the current + file position is ignored and the read position is taken from data + in the overlapped structure. + + Return value: %TRUE if the read succeeds (even if no bytes were + read due to an attempt to read past the end of the file), %FALSE on + error. + +

    +
    +
    ReleaseMutex
    + +
    gboolean ReleaseMutex(gpointer handle) + +
    +

    +Parameters +

    handle:
    The mutex handle.
    +Remarks +

    + Releases ownership if the mutex handle handle. + + Return value: %TRUE on success, %FALSE otherwise. This function + fails if the calling thread does not own the mutex handle. + +

    +
    +
    ReleaseSemaphore
    + +
    gboolean ReleaseSemaphore(gpointer handle, gint32 count, gint32 *prevcount) + +
    +

    +Parameters +

    handle:
    The semaphore handle to release.
    count:
    The amount by which the semaphore's count should be
    +Remarks +

    increased. + prevcount: Pointer to a location to store the previous count of + the semaphore, or %NULL. + + Increases the count of semaphore handle by count. + + Return value: %TRUE on success, %FALSE otherwise. + +

    +
    +
    RemoveDirectory
    + +
    gboolean RemoveDirectory (const gunichar2 *name) + +
    +

    +Parameters +

    name:
    a pointer to a NULL-terminated unicode string, that names
    +Remarks +

    the directory to be removed. + + Removes directory name + + Return value: %TRUE on success, %FALSE otherwise. + +

    +
    +
    ReplaceFile
    + +
    Prototype: ReplaceFile
    +

    + +

    +
    +
    ResetEvent
    + +
    gboolean ResetEvent(gpointer handle) + +
    +

    +Parameters +

    handle:
    The event handle.
    +Remarks +

    + Resets the event handle handle to the unsignalled state. + + Return value: %TRUE on success, %FALSE otherwise. (Currently only + ever returns %TRUE). + +

    +
    +
    ResumeThread
    + +
    Prototype: ResumeThread
    +

    + +

    +
    +
    RevertToSelf
    + +
    Prototype: RevertToSelf
    +

    + +

    +
    +
    SetCriticalSectionSpinCount
    + +
    Prototype: SetCriticalSectionSpinCount
    +

    + +

    +
    +
    SetCurrentDirectory
    + +
    extern gboolean SetCurrentDirectory (const gunichar2 *path) + +
    +

    +Parameters +

    path:
    path to new directory
    +Remarks +

    + Changes the directory path for the current process. + + Return value: %TRUE on success, %FALSE on failure. + +

    +
    +
    SetEndOfFile
    + +
    gboolean SetEndOfFile(gpointer handle) + +
    +

    +Parameters +

    handle:
    The file handle to set. The handle must have
    +Remarks +

    %GENERIC_WRITE access. + + Moves the end-of-file position to the current position of the file + pointer. This function is used to truncate or extend a file. + + Return value: %TRUE on success, %FALSE otherwise. + +

    +
    +
    SetEvent
    + +
    gboolean SetEvent(gpointer handle) + +
    +

    +Parameters +

    handle:
    The event handle
    +Remarks +

    + Sets the event handle handle to the signalled state. + + If handle is a manual reset event, it remains signalled until it + is reset with ResetEvent(). An auto reset event remains signalled + until a single thread has waited for it, at which time handle is + automatically reset to unsignalled. + + Return value: %TRUE on success, %FALSE otherwise. (Currently only + ever returns %TRUE). + +

    +
    +
    SetFileAttributes
    + +
    extern gboolean SetFileAttributes (const gunichar2 *name, guint32 attrs) + +
    +

    +Parameters +

    name:
    name of file
    attrs:
    attributes to set
    +Remarks +

    + Changes the attributes on a named file. + + Return value: %TRUE on success, %FALSE on failure. + +

    +
    +
    SetFilePointer
    + +
    guint32 SetFilePointer(gpointer handle, gint32 movedistance, + gint32 *highmovedistance, WapiSeekMethod method) + +
    +

    +Parameters +

    handle:
    The file handle to set. The handle must have
    +Remarks +

    %GENERIC_READ or %GENERIC_WRITE access. + movedistance: Low 32 bits of a signed value that specifies the + number of bytes to move the file pointer. + highmovedistance: Pointer to the high 32 bits of a signed value + that specifies the number of bytes to move the file pointer, or + %NULL. + method: The starting point for the file pointer move. + + Sets the file pointer of an open file. + + The distance to move the file pointer is calculated from + movedistance and highmovedistance: If highmovedistance is %NULL, + movedistance is the 32-bit signed value; otherwise, movedistance + is the low 32 bits and highmovedistance a pointer to the high 32 + bits of a 64 bit signed value. A positive distance moves the file + pointer forward from the position specified by method; a negative + distance moves the file pointer backward. + + If the library is compiled without large file support, + highmovedistance is ignored and its value is set to zero on a + successful return. + + Return value: On success, the low 32 bits of the new file pointer. + If highmovedistance is not %NULL, the high 32 bits of the new file + pointer are stored there. On failure, %INVALID_SET_FILE_POINTER. + +

    +
    +
    SetFileTime
    + +
    gboolean SetFileTime(gpointer handle, const WapiFileTime *create_time, + const WapiFileTime *last_access, + const WapiFileTime *last_write) + +
    +

    +Parameters +

    handle:
    The file handle to set. The handle must have
    +Remarks +

    %GENERIC_WRITE access. + create_time: Points to a %WapiFileTime structure that contains the + number of ticks since the epoch that the file was created. May be + %NULL. + last_access: Points to a %WapiFileTime structure that contains the + number of ticks since the epoch when the file was last accessed. + May be %NULL. + last_write: Points to a %WapiFileTime structure that contains the + number of ticks since the epoch when the file was last written to. + May be %NULL. + + Sets the number of ticks since the epoch that the file referenced + by handle was created, last accessed or last modified. A tick is + a 100 nanosecond interval. The epoch is Midnight, January 1 1601 + GMT. + + Create time isn't recorded on POSIX file systems, and is ignored. + + Return value: %TRUE on success, %FALSE otherwise. + +

    +
    +
    SetLastError
    + +
    void SetLastError(guint32 code) + +
    +

    +Parameters +

    code:
    The error code.
    +Remarks +

    + Sets the error code in the calling thread. + +

    +
    +
    SetPriorityClass
    + +
    Prototype: SetPriorityClass
    +

    + +

    +
    +
    SetProcessWorkingSetSize
    + +
    Prototype: SetProcessWorkingSetSize
    +

    + +

    +
    +
    ShellExecuteEx
    + +
    Prototype: ShellExecuteEx
    +

    + +

    +
    +
    SignalObjectAndWait
    + +
    guint32 SignalObjectAndWait(gpointer signal_handle, gpointer wait, + guint32 timeout, gboolean alertable) + +
    +

    +Parameters +

    signal_handle:
    An object to signal
    wait:
    An object to wait for
    timeout:
    The maximum time in milliseconds to wait for
    alertable:
    Specifies whether the function returnes when the system
    +Remarks +

    queues an I/O completion routine or an APC for the calling thread. + + Atomically signals signal and waits for wait to become signalled, + or timeout ms elapses. If timeout is zero, the object's state is + tested and the function returns immediately. If timeout is + %INFINITE, the function waits forever. + + signal can be a semaphore, mutex or event object. + + If alertable is %TRUE and the system queues an I/O completion + routine or an APC for the calling thread, the function returns and + the thread calls the completion routine or APC function. If + %FALSE, the function does not return, and the thread does not call + the completion routine or APC function. A completion routine is + queued when the ReadFileEx() or WriteFileEx() function in which it + was specified has completed. The calling thread is the thread that + initiated the read or write operation. An APC is queued when + QueueUserAPC() is called. Currently completion routines and APC + functions are not supported. + + Return value: %WAIT_ABANDONED - wait is a mutex that was not + released by the owning thread when it exited. Ownershop of the + mutex object is granted to the calling thread and the mutex is set + to nonsignalled. %WAIT_IO_COMPLETION - the wait was ended by one + or more user-mode asynchronous procedure calls queued to the + thread. %WAIT_OBJECT_0 - The state of wait is signalled. + %WAIT_TIMEOUT - The timeout interval elapsed and wait's state is + still not signalled. %WAIT_FAILED - an error occurred. + +

    +
    +
    SleepEx
    + +
    guint32 +SleepEx (guint32 ms, gboolean alertable) + +
    +

    +Parameters +

    ms:
    The time in milliseconds to suspend for
    alertable:
    if TRUE, the wait can be interrupted by an APC call
    +Remarks +

    + Suspends execution of the current thread for ms milliseconds. A + value of zero causes the thread to relinquish its time slice. A + value of %INFINITE causes an infinite delay. + +

    +
    +
    Sleep
    + +
    Prototype: Sleep
    +

    + +

    +
    +
    SuspendThread
    + +
    Prototype: SuspendThread
    +

    + +

    +
    +
    TerminateProcess
    + +
    Prototype: TerminateProcess
    +

    + +

    +
    +
    TlsAlloc
    + +
    Prototype: TlsAlloc
    +

    + +

    +
    +
    TlsFree
    + +
    Prototype: TlsFree
    +

    + +

    +
    +
    TlsGetValue
    + +
    Prototype: TlsGetValue
    +

    + +

    +
    +
    TlsSetValue
    + +
    Prototype: TlsSetValue
    +

    + +

    +
    +
    TransmitFile
    + +
    Prototype: TransmitFile
    +

    + +

    +
    +
    TryEnterCriticalSection
    + +
    Prototype: TryEnterCriticalSection
    +

    + +

    +
    +
    UnlockFile
    + +
    Prototype: UnlockFile
    +

    + +

    +
    +
    VerLanguageName
    + +
    Prototype: VerLanguageName
    +

    + +

    +
    +
    VerQueryValue
    + +
    Prototype: VerQueryValue
    +

    + +

    +
    +
    WaitForInputIdle
    + +
    guint32 WaitForInputIdle(gpointer handle, guint32 timeout) + +
    +

    +Parameters +

    handle:
    a handle to the process to wait for
    timeout:
    the maximum time in milliseconds to wait for
    +Remarks +

    + This function returns when either handle process is waiting + for input, or timeout ms elapses. If timeout is zero, the + process state is tested and the function returns immediately. + If timeout is %INFINITE, the function waits forever. + + Return value: 0 - handle process is waiting for input. + %WAIT_TIMEOUT - The timeout interval elapsed and + handle process is not waiting for input. %WAIT_FAILED - an error + occurred. + +

    +
    +
    WaitForMultipleObjectsEx
    + +
    guint32 WaitForMultipleObjectsEx(guint32 numobjects, gpointer *handles, + gboolean waitall, guint32 timeout, + gboolean alertable) + +
    +

    +Parameters +

    numobjects:
    The number of objects in handles. The maximum allowed
    +Remarks +

    is %MAXIMUM_WAIT_OBJECTS. + handles: An array of object handles. Duplicates are not allowed. + waitall: If %TRUE, this function waits until all of the handles + are signalled. If %FALSE, this function returns when any object is + signalled. + timeout: The maximum time in milliseconds to wait for. + alertable: if TRUE, the wait can be interrupted by an APC call + +

    + This function returns when either one or more of handles is + signalled, or timeout ms elapses. If timeout is zero, the state + of each item of handles is tested and the function returns + immediately. If timeout is %INFINITE, the function waits forever. + + Return value: %WAIT_OBJECT_0 to %WAIT_OBJECT_0 + numobjects - 1 - + if waitall is %TRUE, indicates that all objects are signalled. If + waitall is %FALSE, the return value minus %WAIT_OBJECT_0 indicates + the first index into handles of the objects that are signalled. + %WAIT_ABANDONED_0 to %WAIT_ABANDONED_0 + numobjects - 1 - if + waitall is %TRUE, indicates that all objects are signalled, and at + least one object is an abandoned mutex object (See + WaitForSingleObject() for a description of abandoned mutexes.) If + waitall is %FALSE, the return value minus %WAIT_ABANDONED_0 + indicates the first index into handles of an abandoned mutex. + %WAIT_TIMEOUT - The timeout interval elapsed and no objects in + handles are signalled. %WAIT_FAILED - an error occurred. + %WAIT_IO_COMPLETION - the wait was ended by an APC. + +

    +
    +
    WaitForMultipleObjects
    + +
    Prototype: WaitForMultipleObjects
    +

    + +

    +
    +
    WaitForSingleObjectEx
    + +
    guint32 WaitForSingleObjectEx(gpointer handle, guint32 timeout, + gboolean alertable) + +
    +

    +Parameters +

    handle:
    an object to wait for
    timeout:
    the maximum time in milliseconds to wait for
    alertable:
    if TRUE, the wait can be interrupted by an APC call
    +Remarks +

    + This function returns when either handle is signalled, or timeout + ms elapses. If timeout is zero, the object's state is tested and + the function returns immediately. If timeout is %INFINITE, the + function waits forever. + + Return value: %WAIT_ABANDONED - handle is a mutex that was not + released by the owning thread when it exited. Ownership of the + mutex object is granted to the calling thread and the mutex is set + to nonsignalled. %WAIT_OBJECT_0 - The state of handle is + signalled. %WAIT_TIMEOUT - The timeout interval elapsed and + handle's state is still not signalled. %WAIT_FAILED - an error + occurred. %WAIT_IO_COMPLETION - the wait was ended by an APC. + +

    +
    +
    WaitForSingleObject
    + +
    Prototype: WaitForSingleObject
    +

    + +

    +
    +
    WriteFile
    + +
    gboolean WriteFile(gpointer handle, gconstpointer buffer, guint32 numbytes, + guint32 *byteswritten, WapiOverlapped *overlapped) + +
    +

    +Parameters +

    handle:
    The file handle to write to. The handle must have
    +Remarks +

    %GENERIC_WRITE access. + buffer: The buffer to read data from. + numbytes: The maximum number of bytes to write. + byteswritten: The actual number of bytes written is stored here. + If the handle is positioned at the file end, the length of the file + is extended. This parameter may be %NULL. + overlapped: points to a required %WapiOverlapped structure if + handle has the %FILE_FLAG_OVERLAPPED option set, should be NULL + otherwise. + + If handle does not have the %FILE_FLAG_OVERLAPPED option set, this + function writes up to numbytes bytes from buffer to the file at + the current file position. If handle is positioned at the end of + the file, the file is extended. The actual number of bytes written + is stored in byteswritten. + + If handle has the %FILE_FLAG_OVERLAPPED option set, the current + file position is ignored and the write position is taken from data + in the overlapped structure. + + Return value: %TRUE if the write succeeds, %FALSE on error. + +

    +
    +
    WSACleanup
    + +
    Prototype: WSACleanup
    +

    + +

    +
    +
    WSAGetLastError
    + +
    Prototype: WSAGetLastError
    +

    + +

    +
    +
    WSAIoctl
    + +
    Prototype: WSAIoctl
    +

    + +

    +
    +
    WSARecv
    + +
    Prototype: WSARecv
    +

    + +

    +
    +
    WSASend
    + +
    Prototype: WSASend
    +

    + +

    +
    +
    WSASetLastError
    + +
    Prototype: WSASetLastError
    +

    + +

    +
    +
    WSAStartup
    + +
    Prototype: WSAStartup
    +

    + + +

    Extended APIs

    + +

    The extended APIs provide access to a few internals of the + WAPI stack that are not exposed through the standard Win32 + APIs. + + +

    +
    mono_once
    + +
    Prototype: mono_once
    +

    + +

    +
    +
    wapi_clear_interruption
    + +
    Prototype: wapi_clear_interruption
    +

    + +

    +
    +
    wapi_current_thread_desc
    + +
    Prototype: wapi_current_thread_desc
    +

    + +

    +
    +
    wapi_interrupt_thread
    + +
    Prototype: wapi_interrupt_thread
    +

    + +

    +
    +
    wapi_self_interrupt
    + +
    Prototype: wapi_self_interrupt
    +

    + +

    +
    +
    wapi_thread_clear_wait_handle
    + +
    void +wapi_thread_clear_wait_handle (gpointer handle) + +
    +

    +Remarks +

    + Clear the wait handle of the current thread. + +

    + +
    \ No newline at end of file diff --git a/eglib/aclocal.m4 b/eglib/aclocal.m4 index e5ba722dbb..4109da3641 100644 --- a/eglib/aclocal.m4 +++ b/eglib/aclocal.m4 @@ -573,7 +573,8 @@ to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi -fi]) +fi +]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further diff --git a/eglib/configure.REMOVED.git-id b/eglib/configure.REMOVED.git-id index 27c8e4e8e6..fa4fb32adc 100644 --- a/eglib/configure.REMOVED.git-id +++ b/eglib/configure.REMOVED.git-id @@ -1 +1 @@ -f63e8c4f995b49470fb7c4bd1f34dac0e85ad20c \ No newline at end of file +065fbf260bfbda470af4db973c37f1d93ec4fc4c \ No newline at end of file diff --git a/external/binary-reference-assemblies/v2.0/Accessibility.dll b/external/binary-reference-assemblies/v2.0/Accessibility.dll new file mode 100644 index 0000000000..cc876c0b5a Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/Accessibility.dll differ diff --git a/external/binary-reference-assemblies/v2.0/Commons.Xml.Relaxng.dll.REMOVED.git-id b/external/binary-reference-assemblies/v2.0/Commons.Xml.Relaxng.dll.REMOVED.git-id new file mode 100644 index 0000000000..b8c83dae64 --- /dev/null +++ b/external/binary-reference-assemblies/v2.0/Commons.Xml.Relaxng.dll.REMOVED.git-id @@ -0,0 +1 @@ +1c737e92fc50c2860741582b2b2c7b7eb05e6503 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v2.0/CustomMarshalers.dll b/external/binary-reference-assemblies/v2.0/CustomMarshalers.dll new file mode 100644 index 0000000000..7e4f56756a Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/CustomMarshalers.dll differ diff --git a/external/binary-reference-assemblies/v2.0/I18N.CJK.dll.REMOVED.git-id b/external/binary-reference-assemblies/v2.0/I18N.CJK.dll.REMOVED.git-id new file mode 100644 index 0000000000..9af12d1910 --- /dev/null +++ b/external/binary-reference-assemblies/v2.0/I18N.CJK.dll.REMOVED.git-id @@ -0,0 +1 @@ +95c141cb1bf7ba0bb408fb0500979ff86e936078 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v2.0/I18N.MidEast.dll b/external/binary-reference-assemblies/v2.0/I18N.MidEast.dll new file mode 100644 index 0000000000..8c9f087cd3 Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/I18N.MidEast.dll differ diff --git a/external/binary-reference-assemblies/v2.0/I18N.Other.dll b/external/binary-reference-assemblies/v2.0/I18N.Other.dll new file mode 100644 index 0000000000..ebf62db1a6 Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/I18N.Other.dll differ diff --git a/external/binary-reference-assemblies/v2.0/I18N.Rare.dll b/external/binary-reference-assemblies/v2.0/I18N.Rare.dll new file mode 100644 index 0000000000..0ecca38c33 Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/I18N.Rare.dll differ diff --git a/external/binary-reference-assemblies/v2.0/I18N.West.dll b/external/binary-reference-assemblies/v2.0/I18N.West.dll new file mode 100644 index 0000000000..b4ff0eb831 Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/I18N.West.dll differ diff --git a/external/binary-reference-assemblies/v2.0/I18N.dll b/external/binary-reference-assemblies/v2.0/I18N.dll new file mode 100644 index 0000000000..711a39dc10 Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/I18N.dll differ diff --git a/external/binary-reference-assemblies/v2.0/IBM.Data.DB2.dll b/external/binary-reference-assemblies/v2.0/IBM.Data.DB2.dll new file mode 100644 index 0000000000..5da4f0356b Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/IBM.Data.DB2.dll differ diff --git a/external/binary-reference-assemblies/v2.0/ICSharpCode.SharpZipLib.dll b/external/binary-reference-assemblies/v2.0/ICSharpCode.SharpZipLib.dll new file mode 100644 index 0000000000..d610312fa0 Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/ICSharpCode.SharpZipLib.dll differ diff --git a/external/binary-reference-assemblies/v2.0/Microsoft.Build.Engine.dll.REMOVED.git-id b/external/binary-reference-assemblies/v2.0/Microsoft.Build.Engine.dll.REMOVED.git-id new file mode 100644 index 0000000000..78caad0872 --- /dev/null +++ b/external/binary-reference-assemblies/v2.0/Microsoft.Build.Engine.dll.REMOVED.git-id @@ -0,0 +1 @@ +0a13f25c2b539d3eb3130747fa5b9c592c865adc \ No newline at end of file diff --git a/external/binary-reference-assemblies/v2.0/Microsoft.Build.Framework.dll b/external/binary-reference-assemblies/v2.0/Microsoft.Build.Framework.dll new file mode 100644 index 0000000000..3cb0f44195 Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/Microsoft.Build.Framework.dll differ diff --git a/external/binary-reference-assemblies/v2.0/Microsoft.Build.Tasks.dll.REMOVED.git-id b/external/binary-reference-assemblies/v2.0/Microsoft.Build.Tasks.dll.REMOVED.git-id new file mode 100644 index 0000000000..cf947de6ab --- /dev/null +++ b/external/binary-reference-assemblies/v2.0/Microsoft.Build.Tasks.dll.REMOVED.git-id @@ -0,0 +1 @@ +fdc1308d76495ef02a4abc4008cf85738253a5e9 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v2.0/Microsoft.Build.Utilities.dll b/external/binary-reference-assemblies/v2.0/Microsoft.Build.Utilities.dll new file mode 100644 index 0000000000..fafd047069 Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/Microsoft.Build.Utilities.dll differ diff --git a/external/binary-reference-assemblies/v2.0/Microsoft.VisualBasic.dll.REMOVED.git-id b/external/binary-reference-assemblies/v2.0/Microsoft.VisualBasic.dll.REMOVED.git-id new file mode 100644 index 0000000000..76d3501bae --- /dev/null +++ b/external/binary-reference-assemblies/v2.0/Microsoft.VisualBasic.dll.REMOVED.git-id @@ -0,0 +1 @@ +553b666cbda33a40eefd4491c08219ab0a7e9899 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v2.0/Microsoft.VisualC.dll b/external/binary-reference-assemblies/v2.0/Microsoft.VisualC.dll new file mode 100644 index 0000000000..7a582aeaef Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/Microsoft.VisualC.dll differ diff --git a/external/binary-reference-assemblies/v2.0/Mono.C5.dll.REMOVED.git-id b/external/binary-reference-assemblies/v2.0/Mono.C5.dll.REMOVED.git-id new file mode 100644 index 0000000000..70cd46e50a --- /dev/null +++ b/external/binary-reference-assemblies/v2.0/Mono.C5.dll.REMOVED.git-id @@ -0,0 +1 @@ +16dad5828c68a7cdff0f803b3b7b94d6202f8a15 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v2.0/Mono.CSharp.dll.REMOVED.git-id b/external/binary-reference-assemblies/v2.0/Mono.CSharp.dll.REMOVED.git-id new file mode 100644 index 0000000000..e9b5f3ae75 --- /dev/null +++ b/external/binary-reference-assemblies/v2.0/Mono.CSharp.dll.REMOVED.git-id @@ -0,0 +1 @@ +0bac21a97d3e8234ce88c419fb2b697b9fd8a2ec \ No newline at end of file diff --git a/external/binary-reference-assemblies/v2.0/Mono.Cairo.dll b/external/binary-reference-assemblies/v2.0/Mono.Cairo.dll new file mode 100644 index 0000000000..d3e03c4371 Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/Mono.Cairo.dll differ diff --git a/external/binary-reference-assemblies/v2.0/Mono.CompilerServices.SymbolWriter.dll b/external/binary-reference-assemblies/v2.0/Mono.CompilerServices.SymbolWriter.dll new file mode 100644 index 0000000000..0771ccd910 Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/Mono.CompilerServices.SymbolWriter.dll differ diff --git a/external/binary-reference-assemblies/v2.0/Mono.Data.Sqlite.dll.REMOVED.git-id b/external/binary-reference-assemblies/v2.0/Mono.Data.Sqlite.dll.REMOVED.git-id new file mode 100644 index 0000000000..67b25d183e --- /dev/null +++ b/external/binary-reference-assemblies/v2.0/Mono.Data.Sqlite.dll.REMOVED.git-id @@ -0,0 +1 @@ +1380d4e2e907807e9e558a5d0741622020a9eacb \ No newline at end of file diff --git a/external/binary-reference-assemblies/v2.0/Mono.Data.Tds.dll b/external/binary-reference-assemblies/v2.0/Mono.Data.Tds.dll new file mode 100644 index 0000000000..2e0aad8323 Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/Mono.Data.Tds.dll differ diff --git a/external/binary-reference-assemblies/v2.0/Mono.Debugger.Soft.dll b/external/binary-reference-assemblies/v2.0/Mono.Debugger.Soft.dll new file mode 100644 index 0000000000..2a8c77e5d5 Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/Mono.Debugger.Soft.dll differ diff --git a/external/binary-reference-assemblies/v2.0/Mono.Http.dll b/external/binary-reference-assemblies/v2.0/Mono.Http.dll new file mode 100644 index 0000000000..613fd73189 Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/Mono.Http.dll differ diff --git a/external/binary-reference-assemblies/v2.0/Mono.Management.dll b/external/binary-reference-assemblies/v2.0/Mono.Management.dll new file mode 100644 index 0000000000..f786ccbc3f Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/Mono.Management.dll differ diff --git a/external/binary-reference-assemblies/v2.0/Mono.Messaging.RabbitMQ.dll b/external/binary-reference-assemblies/v2.0/Mono.Messaging.RabbitMQ.dll new file mode 100644 index 0000000000..ade3e5a8b0 Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/Mono.Messaging.RabbitMQ.dll differ diff --git a/external/binary-reference-assemblies/v2.0/Mono.Messaging.dll b/external/binary-reference-assemblies/v2.0/Mono.Messaging.dll new file mode 100644 index 0000000000..683fe6e673 Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/Mono.Messaging.dll differ diff --git a/external/binary-reference-assemblies/v2.0/Mono.Posix.dll.REMOVED.git-id b/external/binary-reference-assemblies/v2.0/Mono.Posix.dll.REMOVED.git-id new file mode 100644 index 0000000000..2883e320d1 --- /dev/null +++ b/external/binary-reference-assemblies/v2.0/Mono.Posix.dll.REMOVED.git-id @@ -0,0 +1 @@ +bcf28daab3d3aabaf3bd8384fbc64a72b56b3670 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v2.0/Mono.Security.Win32.dll b/external/binary-reference-assemblies/v2.0/Mono.Security.Win32.dll new file mode 100644 index 0000000000..ef4988f391 Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/Mono.Security.Win32.dll differ diff --git a/external/binary-reference-assemblies/v2.0/Mono.Security.dll.REMOVED.git-id b/external/binary-reference-assemblies/v2.0/Mono.Security.dll.REMOVED.git-id new file mode 100644 index 0000000000..b097b353f7 --- /dev/null +++ b/external/binary-reference-assemblies/v2.0/Mono.Security.dll.REMOVED.git-id @@ -0,0 +1 @@ +b31b85489f721ceed592dd1feaffc1e7a72ca1ce \ No newline at end of file diff --git a/external/binary-reference-assemblies/v2.0/Mono.Simd.dll b/external/binary-reference-assemblies/v2.0/Mono.Simd.dll new file mode 100644 index 0000000000..c05c880f5f Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/Mono.Simd.dll differ diff --git a/external/binary-reference-assemblies/v2.0/Mono.Tasklets.dll b/external/binary-reference-assemblies/v2.0/Mono.Tasklets.dll new file mode 100644 index 0000000000..efecfe5481 Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/Mono.Tasklets.dll differ diff --git a/external/binary-reference-assemblies/v2.0/Mono.WebBrowser.dll.REMOVED.git-id b/external/binary-reference-assemblies/v2.0/Mono.WebBrowser.dll.REMOVED.git-id new file mode 100644 index 0000000000..cf627698e0 --- /dev/null +++ b/external/binary-reference-assemblies/v2.0/Mono.WebBrowser.dll.REMOVED.git-id @@ -0,0 +1 @@ +5908f2354983941412b03188e9223e5bb69aeb72 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v2.0/Mono.XBuild.Tasks.dll b/external/binary-reference-assemblies/v2.0/Mono.XBuild.Tasks.dll new file mode 100644 index 0000000000..ea58e747a0 Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/Mono.XBuild.Tasks.dll differ diff --git a/external/binary-reference-assemblies/v2.0/Novell.Directory.Ldap.dll.REMOVED.git-id b/external/binary-reference-assemblies/v2.0/Novell.Directory.Ldap.dll.REMOVED.git-id new file mode 100644 index 0000000000..91f547a1ca --- /dev/null +++ b/external/binary-reference-assemblies/v2.0/Novell.Directory.Ldap.dll.REMOVED.git-id @@ -0,0 +1 @@ +85f2c42bb50f6ec544ef78847bedac7e47e55912 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v2.0/Npgsql.dll.REMOVED.git-id b/external/binary-reference-assemblies/v2.0/Npgsql.dll.REMOVED.git-id new file mode 100644 index 0000000000..3b41827f3e --- /dev/null +++ b/external/binary-reference-assemblies/v2.0/Npgsql.dll.REMOVED.git-id @@ -0,0 +1 @@ +b24e83fc55c2db856ee389b0d154679d9274402d \ No newline at end of file diff --git a/external/binary-reference-assemblies/v2.0/PEAPI.dll b/external/binary-reference-assemblies/v2.0/PEAPI.dll new file mode 100644 index 0000000000..70bc75770b Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/PEAPI.dll differ diff --git a/external/binary-reference-assemblies/v2.0/RabbitMQ.Client.dll.REMOVED.git-id b/external/binary-reference-assemblies/v2.0/RabbitMQ.Client.dll.REMOVED.git-id new file mode 100644 index 0000000000..5bb1cd2c97 --- /dev/null +++ b/external/binary-reference-assemblies/v2.0/RabbitMQ.Client.dll.REMOVED.git-id @@ -0,0 +1 @@ +721567a04477d387c00a736b9b0b1b222ad8e6c3 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v2.0/System.ComponentModel.DataAnnotations.dll b/external/binary-reference-assemblies/v2.0/System.ComponentModel.DataAnnotations.dll new file mode 100644 index 0000000000..fd50d511c8 Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/System.ComponentModel.DataAnnotations.dll differ diff --git a/external/binary-reference-assemblies/v2.0/System.Configuration.Install.dll b/external/binary-reference-assemblies/v2.0/System.Configuration.Install.dll new file mode 100644 index 0000000000..34687940a5 Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/System.Configuration.Install.dll differ diff --git a/external/binary-reference-assemblies/v2.0/System.Configuration.dll b/external/binary-reference-assemblies/v2.0/System.Configuration.dll new file mode 100644 index 0000000000..bb8e4b6ab7 Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/System.Configuration.dll differ diff --git a/external/binary-reference-assemblies/v2.0/System.Core.dll.REMOVED.git-id b/external/binary-reference-assemblies/v2.0/System.Core.dll.REMOVED.git-id new file mode 100644 index 0000000000..94f1b99507 --- /dev/null +++ b/external/binary-reference-assemblies/v2.0/System.Core.dll.REMOVED.git-id @@ -0,0 +1 @@ +0b05e733bebabb5cfb18d760512137d0c42fe89e \ No newline at end of file diff --git a/external/binary-reference-assemblies/v2.0/System.Data.DataSetExtensions.dll b/external/binary-reference-assemblies/v2.0/System.Data.DataSetExtensions.dll new file mode 100644 index 0000000000..985bb9ebc6 Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/System.Data.DataSetExtensions.dll differ diff --git a/external/binary-reference-assemblies/v2.0/System.Data.Linq.dll.REMOVED.git-id b/external/binary-reference-assemblies/v2.0/System.Data.Linq.dll.REMOVED.git-id new file mode 100644 index 0000000000..8a23e1a0bb --- /dev/null +++ b/external/binary-reference-assemblies/v2.0/System.Data.Linq.dll.REMOVED.git-id @@ -0,0 +1 @@ +49c192eea0c192d2e782b9cf5887ca423cee0aa7 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v2.0/System.Data.OracleClient.dll.REMOVED.git-id b/external/binary-reference-assemblies/v2.0/System.Data.OracleClient.dll.REMOVED.git-id new file mode 100644 index 0000000000..21660ddace --- /dev/null +++ b/external/binary-reference-assemblies/v2.0/System.Data.OracleClient.dll.REMOVED.git-id @@ -0,0 +1 @@ +f7d03d7b5ac6c7a09eabec7041e24472206157a6 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v2.0/System.Data.Services.Client.dll.REMOVED.git-id b/external/binary-reference-assemblies/v2.0/System.Data.Services.Client.dll.REMOVED.git-id new file mode 100644 index 0000000000..6e4cde6883 --- /dev/null +++ b/external/binary-reference-assemblies/v2.0/System.Data.Services.Client.dll.REMOVED.git-id @@ -0,0 +1 @@ +6b42f3931a6cff0cecd6d15e320678ad4e01349e \ No newline at end of file diff --git a/external/binary-reference-assemblies/v2.0/System.Data.Services.dll b/external/binary-reference-assemblies/v2.0/System.Data.Services.dll new file mode 100644 index 0000000000..03d93262d8 Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/System.Data.Services.dll differ diff --git a/external/binary-reference-assemblies/v2.0/System.Data.dll.REMOVED.git-id b/external/binary-reference-assemblies/v2.0/System.Data.dll.REMOVED.git-id new file mode 100644 index 0000000000..6dc7b0a9b0 --- /dev/null +++ b/external/binary-reference-assemblies/v2.0/System.Data.dll.REMOVED.git-id @@ -0,0 +1 @@ +4850c64dfca079e14274c554439117efaff6047f \ No newline at end of file diff --git a/external/binary-reference-assemblies/v2.0/System.Design.dll.REMOVED.git-id b/external/binary-reference-assemblies/v2.0/System.Design.dll.REMOVED.git-id new file mode 100644 index 0000000000..d544bf383a --- /dev/null +++ b/external/binary-reference-assemblies/v2.0/System.Design.dll.REMOVED.git-id @@ -0,0 +1 @@ +d36feba9dacf4fd825eadce42700f598509ee412 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v2.0/System.DirectoryServices.Protocols.dll b/external/binary-reference-assemblies/v2.0/System.DirectoryServices.Protocols.dll new file mode 100644 index 0000000000..4420b7e053 Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/System.DirectoryServices.Protocols.dll differ diff --git a/external/binary-reference-assemblies/v2.0/System.DirectoryServices.dll b/external/binary-reference-assemblies/v2.0/System.DirectoryServices.dll new file mode 100644 index 0000000000..f99150aa80 Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/System.DirectoryServices.dll differ diff --git a/external/binary-reference-assemblies/v2.0/System.Drawing.Design.dll b/external/binary-reference-assemblies/v2.0/System.Drawing.Design.dll new file mode 100644 index 0000000000..aae8eaf72f Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/System.Drawing.Design.dll differ diff --git a/external/binary-reference-assemblies/v2.0/System.Drawing.dll.REMOVED.git-id b/external/binary-reference-assemblies/v2.0/System.Drawing.dll.REMOVED.git-id new file mode 100644 index 0000000000..bd6f64abfd --- /dev/null +++ b/external/binary-reference-assemblies/v2.0/System.Drawing.dll.REMOVED.git-id @@ -0,0 +1 @@ +e4ea6d7d720ab1b7c9adbb34c3f4d5332e15cd11 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v2.0/System.EnterpriseServices.dll b/external/binary-reference-assemblies/v2.0/System.EnterpriseServices.dll new file mode 100644 index 0000000000..ec5ed8fd30 Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/System.EnterpriseServices.dll differ diff --git a/external/binary-reference-assemblies/v2.0/System.IdentityModel.Selectors.dll b/external/binary-reference-assemblies/v2.0/System.IdentityModel.Selectors.dll new file mode 100644 index 0000000000..fb67875d3f Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/System.IdentityModel.Selectors.dll differ diff --git a/external/binary-reference-assemblies/v2.0/System.IdentityModel.dll b/external/binary-reference-assemblies/v2.0/System.IdentityModel.dll new file mode 100644 index 0000000000..7218f95cc1 Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/System.IdentityModel.dll differ diff --git a/external/binary-reference-assemblies/v2.0/System.Json.dll b/external/binary-reference-assemblies/v2.0/System.Json.dll new file mode 100644 index 0000000000..5fb77aefc2 Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/System.Json.dll differ diff --git a/external/binary-reference-assemblies/v2.0/System.Management.dll b/external/binary-reference-assemblies/v2.0/System.Management.dll new file mode 100644 index 0000000000..a12c124192 Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/System.Management.dll differ diff --git a/external/binary-reference-assemblies/v2.0/System.Messaging.dll b/external/binary-reference-assemblies/v2.0/System.Messaging.dll new file mode 100644 index 0000000000..8070268a7b Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/System.Messaging.dll differ diff --git a/external/binary-reference-assemblies/v2.0/System.Net.dll b/external/binary-reference-assemblies/v2.0/System.Net.dll new file mode 100644 index 0000000000..f0fe864b6f Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/System.Net.dll differ diff --git a/external/binary-reference-assemblies/v2.0/System.Runtime.Remoting.dll b/external/binary-reference-assemblies/v2.0/System.Runtime.Remoting.dll new file mode 100644 index 0000000000..59709066dc Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/System.Runtime.Remoting.dll differ diff --git a/external/binary-reference-assemblies/v2.0/System.Runtime.Serialization.Formatters.Soap.dll b/external/binary-reference-assemblies/v2.0/System.Runtime.Serialization.Formatters.Soap.dll new file mode 100644 index 0000000000..6aeb662691 Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/System.Runtime.Serialization.Formatters.Soap.dll differ diff --git a/external/binary-reference-assemblies/v2.0/System.Runtime.Serialization.dll.REMOVED.git-id b/external/binary-reference-assemblies/v2.0/System.Runtime.Serialization.dll.REMOVED.git-id new file mode 100644 index 0000000000..86dbe0c1d5 --- /dev/null +++ b/external/binary-reference-assemblies/v2.0/System.Runtime.Serialization.dll.REMOVED.git-id @@ -0,0 +1 @@ +706732666fdd36f1f36c850c5ee4ffbd758672ba \ No newline at end of file diff --git a/external/binary-reference-assemblies/v2.0/System.Security.dll b/external/binary-reference-assemblies/v2.0/System.Security.dll new file mode 100644 index 0000000000..9402d3a414 Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/System.Security.dll differ diff --git a/external/binary-reference-assemblies/v2.0/System.ServiceModel.Web.dll.REMOVED.git-id b/external/binary-reference-assemblies/v2.0/System.ServiceModel.Web.dll.REMOVED.git-id new file mode 100644 index 0000000000..e18caeb973 --- /dev/null +++ b/external/binary-reference-assemblies/v2.0/System.ServiceModel.Web.dll.REMOVED.git-id @@ -0,0 +1 @@ +40da0a3530d9e4d1f9bc0d29dfd9cf3b35c452b6 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v2.0/System.ServiceModel.dll.REMOVED.git-id b/external/binary-reference-assemblies/v2.0/System.ServiceModel.dll.REMOVED.git-id new file mode 100644 index 0000000000..333a34fd26 --- /dev/null +++ b/external/binary-reference-assemblies/v2.0/System.ServiceModel.dll.REMOVED.git-id @@ -0,0 +1 @@ +8929a0a02c4d892656ace6045d3f9cd4e60d1532 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v2.0/System.ServiceProcess.dll b/external/binary-reference-assemblies/v2.0/System.ServiceProcess.dll new file mode 100644 index 0000000000..543bb3f75a Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/System.ServiceProcess.dll differ diff --git a/external/binary-reference-assemblies/v2.0/System.Transactions.dll b/external/binary-reference-assemblies/v2.0/System.Transactions.dll new file mode 100644 index 0000000000..b8f270fc20 Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/System.Transactions.dll differ diff --git a/external/binary-reference-assemblies/v2.0/System.Web.Abstractions.dll b/external/binary-reference-assemblies/v2.0/System.Web.Abstractions.dll new file mode 100644 index 0000000000..e24914639e Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/System.Web.Abstractions.dll differ diff --git a/external/binary-reference-assemblies/v2.0/System.Web.DynamicData.dll b/external/binary-reference-assemblies/v2.0/System.Web.DynamicData.dll new file mode 100644 index 0000000000..2b3a439222 Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/System.Web.DynamicData.dll differ diff --git a/external/binary-reference-assemblies/v2.0/System.Web.Extensions.Design.dll b/external/binary-reference-assemblies/v2.0/System.Web.Extensions.Design.dll new file mode 100644 index 0000000000..7766640189 Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/System.Web.Extensions.Design.dll differ diff --git a/external/binary-reference-assemblies/v2.0/System.Web.Extensions.dll.REMOVED.git-id b/external/binary-reference-assemblies/v2.0/System.Web.Extensions.dll.REMOVED.git-id new file mode 100644 index 0000000000..a956aa1977 --- /dev/null +++ b/external/binary-reference-assemblies/v2.0/System.Web.Extensions.dll.REMOVED.git-id @@ -0,0 +1 @@ +ab0b53d73d93ac94483adc27bb38d2157c06df07 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v2.0/System.Web.Mvc.dll.REMOVED.git-id b/external/binary-reference-assemblies/v2.0/System.Web.Mvc.dll.REMOVED.git-id new file mode 100644 index 0000000000..7b3461b9c0 --- /dev/null +++ b/external/binary-reference-assemblies/v2.0/System.Web.Mvc.dll.REMOVED.git-id @@ -0,0 +1 @@ +5b5efc13ef7c032da44a1c78afdd788b4cb630b7 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v2.0/System.Web.Routing.dll b/external/binary-reference-assemblies/v2.0/System.Web.Routing.dll new file mode 100644 index 0000000000..4aa16e7629 Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/System.Web.Routing.dll differ diff --git a/external/binary-reference-assemblies/v2.0/System.Web.Services.dll.REMOVED.git-id b/external/binary-reference-assemblies/v2.0/System.Web.Services.dll.REMOVED.git-id new file mode 100644 index 0000000000..42623bf604 --- /dev/null +++ b/external/binary-reference-assemblies/v2.0/System.Web.Services.dll.REMOVED.git-id @@ -0,0 +1 @@ +7b92ccfce244406aafc846ccb31ac497344268b4 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v2.0/System.Web.dll.REMOVED.git-id b/external/binary-reference-assemblies/v2.0/System.Web.dll.REMOVED.git-id new file mode 100644 index 0000000000..7cad0f7557 --- /dev/null +++ b/external/binary-reference-assemblies/v2.0/System.Web.dll.REMOVED.git-id @@ -0,0 +1 @@ +db3815913740028a3b2ae6567fb6c6258eca5a8a \ No newline at end of file diff --git a/external/binary-reference-assemblies/v2.0/System.Windows.Forms.dll.REMOVED.git-id b/external/binary-reference-assemblies/v2.0/System.Windows.Forms.dll.REMOVED.git-id new file mode 100644 index 0000000000..5602970297 --- /dev/null +++ b/external/binary-reference-assemblies/v2.0/System.Windows.Forms.dll.REMOVED.git-id @@ -0,0 +1 @@ +a2c31de92dbeeae2fd5bf0e965fc9757bd6dc2c2 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v2.0/System.Xml.Linq.dll b/external/binary-reference-assemblies/v2.0/System.Xml.Linq.dll new file mode 100644 index 0000000000..b3f64eb49b Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/System.Xml.Linq.dll differ diff --git a/external/binary-reference-assemblies/v2.0/System.Xml.dll.REMOVED.git-id b/external/binary-reference-assemblies/v2.0/System.Xml.dll.REMOVED.git-id new file mode 100644 index 0000000000..933b7f3a4d --- /dev/null +++ b/external/binary-reference-assemblies/v2.0/System.Xml.dll.REMOVED.git-id @@ -0,0 +1 @@ +8762927cc651ef1be84b725fe1faae53ee0a183c \ No newline at end of file diff --git a/external/binary-reference-assemblies/v2.0/System.dll.REMOVED.git-id b/external/binary-reference-assemblies/v2.0/System.dll.REMOVED.git-id new file mode 100644 index 0000000000..130cf4ffea --- /dev/null +++ b/external/binary-reference-assemblies/v2.0/System.dll.REMOVED.git-id @@ -0,0 +1 @@ +b501a8217faa7e35c257e93e84a6f6e2384f0b2c \ No newline at end of file diff --git a/external/binary-reference-assemblies/v2.0/WindowsBase.dll.REMOVED.git-id b/external/binary-reference-assemblies/v2.0/WindowsBase.dll.REMOVED.git-id new file mode 100644 index 0000000000..9bd85663ca --- /dev/null +++ b/external/binary-reference-assemblies/v2.0/WindowsBase.dll.REMOVED.git-id @@ -0,0 +1 @@ +379309c6162ea0d3c014ea0dce82cb7debaabc19 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v2.0/cscompmgd.dll b/external/binary-reference-assemblies/v2.0/cscompmgd.dll new file mode 100644 index 0000000000..4ef10eed0f Binary files /dev/null and b/external/binary-reference-assemblies/v2.0/cscompmgd.dll differ diff --git a/external/binary-reference-assemblies/v2.0/mscorlib.dll.REMOVED.git-id b/external/binary-reference-assemblies/v2.0/mscorlib.dll.REMOVED.git-id new file mode 100644 index 0000000000..f6868abd88 --- /dev/null +++ b/external/binary-reference-assemblies/v2.0/mscorlib.dll.REMOVED.git-id @@ -0,0 +1 @@ +59dd95b829daf7b8ab669fa4cccb078a506f94c1 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v3.5/Microsoft.Build.Engine.dll.REMOVED.git-id b/external/binary-reference-assemblies/v3.5/Microsoft.Build.Engine.dll.REMOVED.git-id new file mode 100644 index 0000000000..7c38c9ec8a --- /dev/null +++ b/external/binary-reference-assemblies/v3.5/Microsoft.Build.Engine.dll.REMOVED.git-id @@ -0,0 +1 @@ +e730b44be44647f05262e5b8b33e1046d2820267 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v3.5/Microsoft.Build.Framework.dll b/external/binary-reference-assemblies/v3.5/Microsoft.Build.Framework.dll new file mode 100644 index 0000000000..06c10f25cb Binary files /dev/null and b/external/binary-reference-assemblies/v3.5/Microsoft.Build.Framework.dll differ diff --git a/external/binary-reference-assemblies/v3.5/Microsoft.Build.Tasks.v3.5.dll.REMOVED.git-id b/external/binary-reference-assemblies/v3.5/Microsoft.Build.Tasks.v3.5.dll.REMOVED.git-id new file mode 100644 index 0000000000..3c0bf96d84 --- /dev/null +++ b/external/binary-reference-assemblies/v3.5/Microsoft.Build.Tasks.v3.5.dll.REMOVED.git-id @@ -0,0 +1 @@ +14b5919ca4040ce8244ec366466e056475c45af6 \ No newline at end of file diff --git a/external/binary-reference-assemblies/v3.5/Microsoft.Build.Utilities.v3.5.dll b/external/binary-reference-assemblies/v3.5/Microsoft.Build.Utilities.v3.5.dll new file mode 100644 index 0000000000..099e6a0187 Binary files /dev/null and b/external/binary-reference-assemblies/v3.5/Microsoft.Build.Utilities.v3.5.dll differ diff --git a/external/binary-reference-assemblies/v3.5/Mono.XBuild.Tasks.dll b/external/binary-reference-assemblies/v3.5/Mono.XBuild.Tasks.dll new file mode 100644 index 0000000000..022097ea55 Binary files /dev/null and b/external/binary-reference-assemblies/v3.5/Mono.XBuild.Tasks.dll differ diff --git a/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/Activity.cs b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/Activity.cs new file mode 100644 index 0000000000..0eb47eb188 --- /dev/null +++ b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/Activity.cs @@ -0,0 +1,52 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace System.ServiceModel.Diagnostics +{ + using System.Runtime.Diagnostics; + + class Activity : IDisposable + { + protected Guid parentId; + Guid currentId; + bool mustDispose = false; + + protected Activity(Guid activityId, Guid parentId) + { + this.currentId = activityId; + this.parentId = parentId; + this.mustDispose = true; + DiagnosticTraceBase.ActivityId = this.currentId; + } + + internal static Activity CreateActivity(Guid activityId) + { + Activity retval = null; + if (activityId != Guid.Empty) + { + Guid currentActivityId = DiagnosticTraceBase.ActivityId; + if (activityId != currentActivityId) + { + retval = new Activity(activityId, currentActivityId); + } + } + return retval; + } + + public virtual void Dispose() + { + if (this.mustDispose) + { + this.mustDispose = false; + DiagnosticTraceBase.ActivityId = this.parentId; + } + GC.SuppressFinalize(this); + } + + protected Guid Id + { + get { return this.currentId; } + } + } +} diff --git a/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/DiagnosticStrings.cs b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/DiagnosticStrings.cs new file mode 100644 index 0000000000..d68490ff2b --- /dev/null +++ b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/DiagnosticStrings.cs @@ -0,0 +1,46 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace System.ServiceModel.Diagnostics +{ + static class DiagnosticStrings + { + internal const string DiagnosticsNamespace = "http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics"; + + internal const string ActivityIdName = "E2ETrace.ActivityID"; + internal const string ActivityId = "ActivityId"; + internal const string AppDomain = "AppDomain"; + internal const string DataTag = "Data"; + internal const string DataItemsTag = "DataItems"; + internal const string DeflateCookieAfterDeflatingTag = "AfterDeflating"; + internal const string DeflateCookieOriginalSizeTag = "OriginalSize"; + internal const string DescriptionTag = "Description"; + internal const string EventLogTag = "EventLog"; + internal const string ExceptionTag = "Exception"; + internal const string ExceptionTypeTag = "ExceptionType"; + internal const string ExceptionStringTag = "ExceptionString"; + internal const string ExtendedDataTag = "ExtendedData"; + internal const string HeaderTag = "Header"; + internal const string InnerExceptionTag = "InnerException"; + internal const string KeyTag = "Key"; + internal const string MessageTag = "Message"; + internal const string NameTag = "Name"; + internal const string NamespaceTag = "xmlns"; + internal const string NativeErrorCodeTag = "NativeErrorCode"; + internal const string ProcessId = "ProcessId"; + internal const string ProcessName = "ProcessName"; + internal const string RoleTag = "Role"; + internal const string SeverityTag = "Severity"; + internal const string SourceTag = "Source"; + internal const string StackTraceTag = "StackTrace"; + internal const string TraceCodeTag = "TraceIdentifier"; + internal const string TraceRecordTag = "TraceRecord"; + internal const string ValueTag = "Value"; + + internal static string[][] HeadersPaths = { + new string[] { DiagnosticStrings.TraceRecordTag, DiagnosticStrings.ExtendedDataTag, "MessageHeaders", "Security" }, + new string[] { DiagnosticStrings.TraceRecordTag, DiagnosticStrings.ExtendedDataTag, "MessageHeaders", "IssuedTokens" } }; + internal static string[] PiiList = new string[] { "BinarySecret", "Entropy", "Password", "Nonce", "Username", "BinarySecurityToken", "NameIdentifier", "SubjectLocality", "AttributeValue" }; + } +} diff --git a/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/DiagnosticTraceSource.cs b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/DiagnosticTraceSource.cs new file mode 100644 index 0000000000..25913b8424 --- /dev/null +++ b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/DiagnosticTraceSource.cs @@ -0,0 +1,55 @@ +//----------------------------------------------------------------------------- +// Copyright (c) Microsoft Corporation. All rights reserved. +//----------------------------------------------------------------------------- +namespace System.ServiceModel.Diagnostics +{ + using System.Diagnostics; + + class DiagnosticTraceSource : PiiTraceSource + { + const string PropagateActivityValue = "propagateActivity"; + internal DiagnosticTraceSource(string name, string eventSourceName) + : base(name, eventSourceName) + { + } + + internal DiagnosticTraceSource(string name, string eventSourceName, SourceLevels level) + : base(name, eventSourceName, level) + { + } + + protected override string[] GetSupportedAttributes() + { + string[] baseAttributes = base.GetSupportedAttributes(); + string[] supportedAttributes = new string[baseAttributes.Length + 1]; + for (int i = 0; i < baseAttributes.Length; i++) + { + supportedAttributes[i] = baseAttributes[i]; + } + supportedAttributes[baseAttributes.Length] = DiagnosticTraceSource.PropagateActivityValue; + + return supportedAttributes; + } + + internal bool PropagateActivity + { + get + { + bool retval = false; + string attributeValue = this.Attributes[DiagnosticTraceSource.PropagateActivityValue]; + if (!string.IsNullOrEmpty(attributeValue)) + { + if (!bool.TryParse(attributeValue, out retval)) + { + retval = false; + } + } + return retval; + } + set + { + this.Attributes[DiagnosticTraceSource.PropagateActivityValue] = value.ToString(); + } + } + } +} diff --git a/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/DiagnosticsTraceCode.cs b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/DiagnosticsTraceCode.cs new file mode 100644 index 0000000000..08709d0e89 --- /dev/null +++ b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/DiagnosticsTraceCode.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace System.ServiceModel.Diagnostics +{ + static class DiagnosticsTraceCode + { + // Diagnostic trace codes + public const int Diagnostics = 0X20000; + public const int AppDomainUnload = DiagnosticsTraceCode.Diagnostics | 0X0001; // + public const int EventLog = DiagnosticsTraceCode.Diagnostics | 0X0002; // + public const int ThrowingException = DiagnosticsTraceCode.Diagnostics | 0X0003; // + public const int TraceHandledException = DiagnosticsTraceCode.Diagnostics | 0X0004; // + public const int UnhandledException = DiagnosticsTraceCode.Diagnostics | 0X0005; // + public const int TraceTruncatedQuotaExceeded = DiagnosticsTraceCode.Diagnostics | 0X000C; // + } +} diff --git a/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/EncodingFallbackAwareXmlTextWriter.cs b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/EncodingFallbackAwareXmlTextWriter.cs new file mode 100644 index 0000000000..dcb5d10825 --- /dev/null +++ b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/EncodingFallbackAwareXmlTextWriter.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace System.ServiceModel.Diagnostics +{ + using System.Xml; + using System.Text; + using System.IO; + + class EncodingFallbackAwareXmlTextWriter : XmlTextWriter + { + Encoding encoding; + + internal EncodingFallbackAwareXmlTextWriter(TextWriter writer) + : base(writer) + { + this.encoding = writer.Encoding; + } + + public override void WriteString(string value) + { + if (!string.IsNullOrEmpty(value) && + ContainsInvalidXmlChar(value)) + { + byte[] blob = encoding.GetBytes(value); + value = encoding.GetString(blob); + } + base.WriteString(value); + } + + bool ContainsInvalidXmlChar(string value) + { + if (string.IsNullOrEmpty(value)) + { + return false; + } + + int i = 0; + int len = value.Length; + + while (i < len) + { + if (XmlConvert.IsXmlChar(value[i])) + { + i++; + continue; + } + + if (i + 1 < len && + XmlConvert.IsXmlSurrogatePair(value[i + 1], value[i])) + { + i += 2; + continue; + } + + return true; + } + + return false; + } + } +} diff --git a/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/EventLogCategory.cs b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/EventLogCategory.cs new file mode 100644 index 0000000000..11bca18653 --- /dev/null +++ b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/EventLogCategory.cs @@ -0,0 +1,28 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace System.ServiceModel.Diagnostics +{ + // + + [Obsolete("This has been replaced by System.Runtime.Diagnostics.EventLogCategory")] + enum EventLogCategory : ushort + { + ServiceAuthorization = 1, // reserved + MessageAuthentication, // reserved + ObjectAccess, // reserved + Tracing, + WebHost, + FailFast, + MessageLogging, + PerformanceCounter, + Wmi, + ComPlus, + StateMachine, + Wsat, + SharingService, + ListenerAdapter + } + +} diff --git a/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/EventLogEventId.cs b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/EventLogEventId.cs new file mode 100644 index 0000000000..3fe96971ff --- /dev/null +++ b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/EventLogEventId.cs @@ -0,0 +1,100 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace System.ServiceModel.Diagnostics +{ + // + + [Obsolete("This has been replaced by System.Runtime.Diagnostics.EventLogEventId")] + enum EventLogEventId : uint + { + // EventIDs from shared Diagnostics and Reliability code + FailedToSetupTracing = 0xC0010064, + FailedToInitializeTraceSource, + FailFast, + FailFastException, + FailedToTraceEvent, + FailedToTraceEventWithException, + InvariantAssertionFailed, + PiiLoggingOn, + PiiLoggingNotAllowed, + + // ServiceModel EventIDs + WebHostUnhandledException = 0xC0020001, + WebHostHttpError, + WebHostFailedToProcessRequest, + WebHostFailedToListen, + FailedToLogMessage, + RemovedBadFilter, + FailedToCreateMessageLoggingTraceSource, + MessageLoggingOn, + MessageLoggingOff, + FailedToLoadPerformanceCounter, + FailedToRemovePerformanceCounter, + WmiGetObjectFailed, + WmiPutInstanceFailed, + WmiDeleteInstanceFailed, + WmiCreateInstanceFailed, + WmiExecQueryFailed, + WmiExecMethodFailed, + WmiRegistrationFailed, + WmiUnregistrationFailed, + WmiAdminTypeMismatch, + WmiPropertyMissing, + ComPlusServiceHostStartingServiceError, + ComPlusDllHostInitializerStartingError, + ComPlusTLBImportError, + ComPlusInvokingMethodFailed, + ComPlusInstanceCreationError, + ComPlusInvokingMethodFailedMismatchedTransactions, + + // TransactionBridge + UnhandledStateMachineExceptionRecordDescription = 0xC0030001, + FatalUnexpectedStateMachineEvent, + ParticipantRecoveryLogEntryCorrupt, + CoordinatorRecoveryLogEntryCorrupt, + CoordinatorRecoveryLogEntryCreationFailure, + ParticipantRecoveryLogEntryCreationFailure, + ProtocolInitializationFailure, + ProtocolStartFailure, + ProtocolRecoveryBeginningFailure, + ProtocolRecoveryCompleteFailure, + TransactionBridgeRecoveryFailure, + ProtocolStopFailure, + NonFatalUnexpectedStateMachineEvent, + PerformanceCounterInitializationFailure, + ProtocolRecoveryComplete, + ProtocolStopped, + ThumbPrintNotFound, + ThumbPrintNotValidated, + SslNoPrivateKey, + SslNoAccessiblePrivateKey, + MissingNecessaryKeyUsage, + MissingNecessaryEnhancedKeyUsage, + + // SMSvcHost + StartErrorPublish = 0xC0040001, + BindingError, + LAFailedToListenForApp, + UnknownListenerAdapterError, + WasDisconnected, + WasConnectionTimedout, + ServiceStartFailed, + MessageQueueDuplicatedSocketLeak, + MessageQueueDuplicatedPipeLeak, + SharingUnhandledException, + + // SecurityAudit + ServiceAuthorizationSuccess = 0x40060001, + ServiceAuthorizationFailure = 0xC0060002, + MessageAuthenticationSuccess = 0x40060003, + MessageAuthenticationFailure = 0xC0060004, + SecurityNegotiationSuccess = 0x40060005, + SecurityNegotiationFailure = 0xC0060006, + TransportAuthenticationSuccess = 0x40060007, + TransportAuthenticationFailure = 0xC0060008, + ImpersonationSuccess = 0x40060009, + ImpersonationFailure = 0xC006000A + } +} diff --git a/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/EventLogger.cs b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/EventLogger.cs new file mode 100644 index 0000000000..4c98c78fbf --- /dev/null +++ b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/EventLogger.cs @@ -0,0 +1,60 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace System.ServiceModel.Diagnostics +{ + using System.Diagnostics; + using System.Security; + using System.Security.Permissions; + using System.Security.Principal; + + // + [Obsolete("This has been replaced by System.Runtime.Diagnostics.EventLogger")] + class EventLogger + { + System.Runtime.Diagnostics.EventLogger innerEventLogger; + + EventLogger() + { + } + + [Obsolete("For SMDiagnostics.dll use only. Call DiagnosticUtility.EventLog instead")] + internal EventLogger(string eventLogSourceName, object diagnosticTrace) + { + this.innerEventLogger = new System.Runtime.Diagnostics.EventLogger(eventLogSourceName, (System.Runtime.Diagnostics.DiagnosticTraceBase)diagnosticTrace); + } + + [System.Runtime.Fx.Tag.SecurityNote(Critical = "Calling SecurityCritical method/property")] + [SecurityCritical] + internal static EventLogger UnsafeCreateEventLogger(string eventLogSourceName, object diagnosticTrace) + { + EventLogger logger = new EventLogger(); + logger.innerEventLogger = System.Runtime.Diagnostics.EventLogger.UnsafeCreateEventLogger(eventLogSourceName, (System.Runtime.Diagnostics.DiagnosticTraceBase)diagnosticTrace); + return logger; + } + + internal void LogEvent(TraceEventType type, EventLogCategory category, EventLogEventId eventId, bool shouldTrace, params string[] values) + { + this.innerEventLogger.LogEvent(type, (ushort)category, (uint)eventId, shouldTrace, values); + } + + [System.Runtime.Fx.Tag.SecurityNote(Critical = "Calling SecurityCritical method/property")] + [SecurityCritical] + internal void UnsafeLogEvent(TraceEventType type, EventLogCategory category, EventLogEventId eventId, bool shouldTrace, params string[] values) + { + this.innerEventLogger.UnsafeLogEvent(type, (ushort)category, (uint)eventId, + shouldTrace, values); + } + + internal void LogEvent(TraceEventType type, EventLogCategory category, EventLogEventId eventId, params string[] values) + { + this.innerEventLogger.LogEvent(type, (ushort)category, (uint)eventId, values); + } + + internal static string NormalizeEventLogParameter(string param) + { + return System.Runtime.Diagnostics.EventLogger.NormalizeEventLogParameter(param); + } + } +} diff --git a/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/ExceptionUtility.cs b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/ExceptionUtility.cs new file mode 100644 index 0000000000..61cfc52ac5 --- /dev/null +++ b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/ExceptionUtility.cs @@ -0,0 +1,273 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace System.ServiceModel.Diagnostics +{ + using System; + using System.Diagnostics; + using System.Runtime; + using System.Runtime.ConstrainedExecution; + using System.Runtime.Diagnostics; + using System.Runtime.InteropServices; + using System.Threading; + using System.Runtime.Serialization; + using System.Reflection; + using System.Runtime.CompilerServices; + using System.Collections; + using System.Xml; + + class ExceptionUtility + { + const string ExceptionStackAsStringKey = "System.ServiceModel.Diagnostics.ExceptionUtility.ExceptionStackAsString"; + + // This field should be only used for debug build. + internal static ExceptionUtility mainInstance; + + LegacyDiagnosticTrace diagnosticTrace; + ExceptionTrace exceptionTrace; + string name; + string eventSourceName; + + [ThreadStatic] + static Guid activityId; + + [ThreadStatic] + static bool useStaticActivityId; + + [Obsolete("For SMDiagnostics.dll use only. Call DiagnosticUtility.ExceptionUtility instead")] + internal ExceptionUtility(string name, string eventSourceName, object diagnosticTrace, object exceptionTrace) + { + this.diagnosticTrace = (LegacyDiagnosticTrace)diagnosticTrace; + this.exceptionTrace = (ExceptionTrace)exceptionTrace; + this.name = name; + this.eventSourceName = eventSourceName; + } + + [Obsolete("For SMDiagnostics.dll use only. Call DiagnosticUtility.ExceptionUtility instead")] + [MethodImpl(MethodImplOptions.NoInlining)] +#pragma warning disable 56500 + internal void TraceFailFast(string message) + { + System.Runtime.Diagnostics.EventLogger logger = null; + try + { +#pragma warning disable 618 + logger = new System.Runtime.Diagnostics.EventLogger(this.eventSourceName, this.diagnosticTrace); +#pragma warning restore 618 + } + finally + { +#pragma warning disable 618 + TraceFailFast(message, logger); +#pragma warning restore 618 + } + } + + // Fail-- Event Log entry will be generated. + // To force a Watson on a dev machine, do the following: + // 1. Set \HKLM\SOFTWARE\Microsoft\PCHealth\ErrorReporting ForceQueueMode = 0 + // 2. In the command environment, set COMPLUS_DbgJitDebugLaunchSetting=0 + [Obsolete("For SMDiagnostics.dll use only. Call DiagnosticUtility.ExceptionUtility instead")] + [MethodImpl(MethodImplOptions.NoInlining)] + internal static void TraceFailFast(string message, System.Runtime.Diagnostics.EventLogger logger) + { + try + { + if (logger != null) + { + string stackTrace = null; + try + { + stackTrace = new StackTrace().ToString(); + } + catch (Exception exception) + { + stackTrace = exception.Message; + } + finally + { + logger.LogEvent(TraceEventType.Critical, + (ushort)EventLogCategory.FailFast, + (uint)EventLogEventId.FailFast, + message, + stackTrace); + } + } + } + catch (Exception e) + { + if (logger != null) + { + logger.LogEvent(TraceEventType.Critical, + (ushort)EventLogCategory.FailFast, + (uint)EventLogEventId.FailFastException, + e.ToString()); + } + throw; + } + } +#pragma warning restore 56500 + + [Obsolete("For SMDiagnostics.dll use only. Call DiagnosticUtility.ExceptionUtility instead")] + internal void TraceFailFastException(Exception exception) + { + TraceFailFast(exception == null ? null : exception.ToString()); + } + + internal Exception ThrowHelper(Exception exception, TraceEventType eventType, TraceRecord extendedData) + { +#pragma warning disable 618 + bool shouldTrace = (this.diagnosticTrace != null && this.diagnosticTrace.ShouldTrace(eventType)); +#pragma warning restore 618 + if (shouldTrace) + { + using (ExceptionUtility.useStaticActivityId ? Activity.CreateActivity(ExceptionUtility.activityId) : null) + { + this.diagnosticTrace.TraceEvent(eventType, DiagnosticsTraceCode.ThrowingException, LegacyDiagnosticTrace.GenerateMsdnTraceCode("System.ServiceModel.Diagnostics", "ThrowingException"), TraceSR.GetString(TraceSR.ThrowingException), extendedData, exception, null); + } + + IDictionary data = exception.Data; + if (data != null && !data.IsReadOnly && !data.IsFixedSize) + { + object existingString = data[ExceptionStackAsStringKey]; + string stackString = existingString == null ? "" : existingString as string; + if (stackString != null) + { + string stack = exception.StackTrace; + if (!string.IsNullOrEmpty(stack)) + { + stackString = string.Concat(stackString, stackString.Length == 0 ? "" : Environment.NewLine, "throw", Environment.NewLine, stack, Environment.NewLine, "catch", Environment.NewLine); + data[ExceptionStackAsStringKey] = stackString; + } + } + } + } + + // Trace using ETW as well. + exceptionTrace.TraceEtwException(exception, eventType); + + return exception; + } + + internal Exception ThrowHelper(Exception exception, TraceEventType eventType) + { + return this.ThrowHelper(exception, eventType, null); + } + + internal ArgumentException ThrowHelperArgument(string message) + { + return (ArgumentException)this.ThrowHelperError(new ArgumentException(message)); + } + + internal ArgumentException ThrowHelperArgument(string paramName, string message) + { + return (ArgumentException)this.ThrowHelperError(new ArgumentException(message, paramName)); + } + + internal ArgumentNullException ThrowHelperArgumentNull(string paramName) + { + return (ArgumentNullException)this.ThrowHelperError(new ArgumentNullException(paramName)); + } + + internal ArgumentNullException ThrowHelperArgumentNull(string paramName, string message) + { + return (ArgumentNullException)this.ThrowHelperError(new ArgumentNullException(paramName, message)); + } + + internal ArgumentException ThrowHelperArgumentNullOrEmptyString(string arg) + { + return (ArgumentException)this.ThrowHelperError(new ArgumentException(TraceSR.GetString(TraceSR.StringNullOrEmpty), arg)); + } + + internal Exception ThrowHelperFatal(string message, Exception innerException) + { + return this.ThrowHelperError(new FatalException(message, innerException)); + } + + internal Exception ThrowHelperInternal(bool fatal) + { + return fatal ? Fx.AssertAndThrowFatal("Fatal InternalException should never be thrown.") : Fx.AssertAndThrow("InternalException should never be thrown."); + } + + internal Exception ThrowHelperInvalidOperation(string message) + { + return ThrowHelperError(new InvalidOperationException(message)); + } + + internal Exception ThrowHelperCallback(string message, Exception innerException) + { + return this.ThrowHelperCritical(new CallbackException(message, innerException)); + } + + internal Exception ThrowHelperCallback(Exception innerException) + { + return this.ThrowHelperCallback(TraceSR.GetString(TraceSR.GenericCallbackException), innerException); + } + + internal Exception ThrowHelperCritical(Exception exception) + { + return this.ThrowHelper(exception, TraceEventType.Critical); + } + + internal Exception ThrowHelperError(Exception exception) + { + return this.ThrowHelper(exception, TraceEventType.Error); + } + + internal Exception ThrowHelperWarning(Exception exception) + { + return this.ThrowHelper(exception, TraceEventType.Warning); + } + + internal Exception ThrowHelperXml(XmlReader reader, string message) + { + return this.ThrowHelperXml(reader, message, null); + } + + internal Exception ThrowHelperXml(XmlReader reader, string message, Exception inner) + { + IXmlLineInfo lineInfo = reader as IXmlLineInfo; + return this.ThrowHelperError(new XmlException( + message, + inner, + (null != lineInfo) ? lineInfo.LineNumber : 0, + (null != lineInfo) ? lineInfo.LinePosition : 0)); + } + + internal void DiagnosticTraceHandledException(Exception exception, TraceEventType eventType) + { +#pragma warning disable 618 + bool shouldTrace = (this.diagnosticTrace != null && this.diagnosticTrace.ShouldTrace(eventType)); +#pragma warning restore 618 + if (shouldTrace) + { + using (ExceptionUtility.useStaticActivityId ? Activity.CreateActivity(ExceptionUtility.activityId) : null) + { + this.diagnosticTrace.TraceEvent(eventType, DiagnosticsTraceCode.TraceHandledException, LegacyDiagnosticTrace.GenerateMsdnTraceCode("System.ServiceModel.Diagnostics", "TraceHandledException"), TraceSR.GetString(TraceSR.TraceHandledException), null, exception, null); + } + } + } + + // On a single thread, these functions will complete just fine + // and don't need to worry about locking issues because the effected + // variables are ThreadStatic. + internal static void UseActivityId(Guid activityId) + { + ExceptionUtility.activityId = activityId; + ExceptionUtility.useStaticActivityId = true; + } + + internal static void ClearActivityId() + { + ExceptionUtility.useStaticActivityId = false; + ExceptionUtility.activityId = Guid.Empty; + } + + [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] + internal static bool IsInfrastructureException(Exception exception) + { + return exception != null && (exception is ThreadAbortException || exception is AppDomainUnloadedException); + } + } +} diff --git a/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/LegacyDiagnosticTrace.cs b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/LegacyDiagnosticTrace.cs new file mode 100644 index 0000000000..86ad22c037 --- /dev/null +++ b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/LegacyDiagnosticTrace.cs @@ -0,0 +1,308 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace System.ServiceModel.Diagnostics +{ + using System.Collections.Generic; + using System.ComponentModel; + using System.Configuration; + using System.Diagnostics; + using System.Globalization; + using System.Runtime; + using System.Runtime.Diagnostics; + using System.Security; + using System.Security.Permissions; + using System.Text; + using System.Xml; + using System.Diagnostics.CodeAnalysis; + + class LegacyDiagnosticTrace : DiagnosticTraceBase + { + const int MaxTraceSize = 65535; + bool shouldUseActivity = false; + TraceSourceKind traceSourceType = TraceSourceKind.PiiTraceSource; + const string subType = ""; + const string version = "1"; + const int traceFailureLogThreshold = 1; + const SourceLevels DefaultLevel = SourceLevels.Off; + static object classLockObject = new object(); + + protected override void OnSetLevel(SourceLevels level) + { + if (this.TraceSource != null) + { + if (this.TraceSource.Switch.Level != SourceLevels.Off && + level == SourceLevels.Off) + { + TraceSource temp = this.TraceSource; + this.CreateTraceSource(); + temp.Close(); + } + this.shouldUseActivity = (level & SourceLevels.ActivityTracing) != 0; + } + } + + [Obsolete("For SMDiagnostics.dll use only. Call DiagnosticUtility.ShouldUseActivity instead")] + internal bool ShouldUseActivity + { + get { return this.shouldUseActivity; } + } + +#pragma warning disable 56500 + [Obsolete("For SMDiagnostics.dll use only. Never 'new' this type up unless you are DiagnosticUtility.")] + [Fx.Tag.SecurityNote(Critical = "Sets eventSourceName.")] + [SecurityCritical] + [SuppressMessage(FxCop.Category.Usage, FxCop.Rule.DoNotCallOverridableMethodsInConstructors, + Justification = "LegacyDiagnosticTrace is an internal class without derived classes")] + internal LegacyDiagnosticTrace(TraceSourceKind sourceType, string traceSourceName, string eventSourceName) + : base(traceSourceName) + { + this.traceSourceType = sourceType; + this.EventSourceName = eventSourceName; + + try + { + this.CreateTraceSource(); + this.AddDomainEventHandlersForCleanup(); + } + catch (ConfigurationErrorsException) + { + throw; + } + catch (Exception e) + { + if (Fx.IsFatal(e)) + { + throw; + } + System.Runtime.Diagnostics.EventLogger logger = new System.Runtime.Diagnostics.EventLogger(this.EventSourceName, null); + logger.LogEvent(TraceEventType.Error, (ushort)System.Runtime.Diagnostics.EventLogCategory.Tracing, (uint)System.Runtime.Diagnostics.EventLogEventId.FailedToSetupTracing, false, + e.ToString()); + } + } +#pragma warning restore 56500 + + [SecuritySafeCritical] + void CreateTraceSource() + { + PiiTraceSource tempSource = null; + if (this.traceSourceType == TraceSourceKind.PiiTraceSource) + { + tempSource = new PiiTraceSource(this.TraceSourceName, this.EventSourceName, LegacyDiagnosticTrace.DefaultLevel); + } + else + { + tempSource = new DiagnosticTraceSource(this.TraceSourceName, this.EventSourceName, LegacyDiagnosticTrace.DefaultLevel); + } + + SetTraceSource(tempSource); + } + +#pragma warning disable 56500 + internal void TraceEvent(TraceEventType type, int code, string msdnTraceCode, string description, TraceRecord trace, Exception exception, object source) + { +#pragma warning disable 618 + Fx.Assert(exception == null || type <= TraceEventType.Information, "Exceptions should be traced at Information or higher"); + Fx.Assert(!string.IsNullOrEmpty(description), "All TraceCodes should have a description"); +#pragma warning restore 618 + TraceXPathNavigator navigator = null; + try + { +#pragma warning disable 618 + if (this.TraceSource != null && this.HaveListeners) +#pragma warning restore 618 + { + try + { + BuildTrace(type, msdnTraceCode, description, trace, exception, source, out navigator); + } + catch (PlainXmlWriter.MaxSizeExceededException) + { + StringTraceRecord codeTraceRecord = new StringTraceRecord("TruncatedTraceId", msdnTraceCode); + this.TraceEvent(type, DiagnosticsTraceCode.TraceTruncatedQuotaExceeded, LegacyDiagnosticTrace.GenerateMsdnTraceCode("System.ServiceModel.Diagnostics", "TraceTruncatedQuotaExceeded"), TraceSR.GetString(TraceSR.TraceCodeTraceTruncatedQuotaExceeded), codeTraceRecord, null, null); + } + this.TraceSource.TraceData(type, code, navigator); + if (this.CalledShutdown) + { + this.TraceSource.Flush(); + } + // Must have been a successful trace. + this.LastFailure = DateTime.MinValue; + } + } + catch (Exception e) + { + if (Fx.IsFatal(e)) + { + throw; + } + LogTraceFailure(navigator == null ? string.Empty : navigator.ToString(), e); + } + } +#pragma warning restore 56500 + + internal void TraceEvent(TraceEventType type, int code, string msdnTraceCode, string description, TraceRecord trace, Exception exception, Guid activityId, object source) + { +#pragma warning disable 618 + using ((this.ShouldUseActivity && Guid.Empty != activityId) ? Activity.CreateActivity(activityId) : null) +#pragma warning restore 618 + { + this.TraceEvent(type, code, msdnTraceCode, description, trace, exception, source); + } + } + + // helper for standardized trace code generation + static internal string GenerateMsdnTraceCode(string traceSource, string traceCodeString) + { + return string.Format(CultureInfo.InvariantCulture, + "http://msdn.microsoft.com/{0}/library/{1}.{2}.aspx", + CultureInfo.CurrentCulture.Name, + traceSource, traceCodeString); + } + +#pragma warning disable 56500 + internal void TraceTransfer(Guid newId) + { +#pragma warning disable 618 + if (this.ShouldUseActivity) +#pragma warning restore 618 + { + Guid oldId = LegacyDiagnosticTrace.ActivityId; + if (newId != oldId) + { +#pragma warning disable 618 + if (this.HaveListeners) +#pragma warning restore 618 + { + try + { + this.TraceSource.TraceTransfer(0, null, newId); + } + catch (Exception e) + { + if (Fx.IsFatal(e)) + { + throw; + } + LogTraceFailure(null, e); + } + } + } + } + } + + protected override void OnShutdownTracing() + { + if (null != this.TraceSource) + { +#pragma warning disable 618 + if (this.Level != SourceLevels.Off) + { + if (this.ShouldTrace(TraceEventType.Information)) +#pragma warning restore 618 + { + Dictionary values = new Dictionary(3); + values["AppDomain.FriendlyName"] = AppDomain.CurrentDomain.FriendlyName; + values["ProcessName"] = DiagnosticTraceBase.ProcessName; + values["ProcessId"] = DiagnosticTraceBase.ProcessId.ToString(CultureInfo.CurrentCulture); + this.TraceEvent(TraceEventType.Information, DiagnosticsTraceCode.AppDomainUnload, LegacyDiagnosticTrace.GenerateMsdnTraceCode("System.ServiceModel.Diagnostics", "AppDomainUnload"), TraceSR.GetString(TraceSR.TraceCodeAppDomainUnload), + new DictionaryTraceRecord(values), null, null); + } + this.TraceSource.Flush(); + } + } + } + + protected override void OnUnhandledException(Exception exception) + { + TraceEvent(TraceEventType.Critical, DiagnosticsTraceCode.UnhandledException, "UnhandledException", TraceSR.GetString(TraceSR.UnhandledException), null, exception, null); + } + + public bool ShouldLogPii + { + get + { + PiiTraceSource traceSource = this.TraceSource as PiiTraceSource; + if (traceSource != null) + { + return traceSource.ShouldLogPii; + } + + return false; + } + + set + { + PiiTraceSource traceSource = this.TraceSource as PiiTraceSource; + if (traceSource != null) + { + traceSource.ShouldLogPii = value; + } + } + } + + void BuildTrace(TraceEventType type, string msdnTraceCode, string description, TraceRecord trace, + Exception exception, object source, out TraceXPathNavigator navigator) + { + PlainXmlWriter xmlWriter = new PlainXmlWriter(LegacyDiagnosticTrace.MaxTraceSize); + navigator = xmlWriter.Navigator; + + this.BuildTrace(xmlWriter, type, msdnTraceCode, description, trace, exception, source); + + if (!ShouldLogPii) + { + navigator.RemovePii(DiagnosticStrings.HeadersPaths); + } + } + + void BuildTrace(PlainXmlWriter xml, TraceEventType type, string msdnTraceCode, string description, + TraceRecord trace, Exception exception, object source) + { + xml.WriteStartElement(DiagnosticStrings.TraceRecordTag); + xml.WriteAttributeString(DiagnosticStrings.NamespaceTag, LegacyDiagnosticTrace.TraceRecordVersion); + xml.WriteAttributeString(DiagnosticStrings.SeverityTag, DiagnosticTraceBase.LookupSeverity(type)); + + xml.WriteElementString(DiagnosticStrings.TraceCodeTag, msdnTraceCode); + xml.WriteElementString(DiagnosticStrings.DescriptionTag, description); + xml.WriteElementString(DiagnosticStrings.AppDomain, DiagnosticTraceBase.AppDomainFriendlyName); + + if (source != null) + { + xml.WriteElementString(DiagnosticStrings.SourceTag, CreateSourceString(source)); + } + + if (trace != null) + { + xml.WriteStartElement(DiagnosticStrings.ExtendedDataTag); + xml.WriteAttributeString(DiagnosticStrings.NamespaceTag, trace.EventId); + + trace.WriteTo(xml); + + xml.WriteEndElement(); + } + + if (exception != null) + { + xml.WriteStartElement(DiagnosticStrings.ExceptionTag); + AddExceptionToTraceString(xml, exception); + xml.WriteEndElement(); + } + + xml.WriteEndElement(); + } + + public override bool IsEnabled() + { + return true; + } + + public override void TraceEventLogEvent(TraceEventType type, TraceRecord traceRecord) + { + TraceEvent(type, + DiagnosticsTraceCode.EventLog, LegacyDiagnosticTrace.GenerateMsdnTraceCode("System.ServiceModel.Diagnostics", "EventLog"), + TraceSR.GetString(TraceSR.TraceCodeEventLog), + traceRecord, null, null); + } + } +} diff --git a/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/MachineSettingsSection.cs b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/MachineSettingsSection.cs new file mode 100644 index 0000000000..58ba6b4d26 --- /dev/null +++ b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/MachineSettingsSection.cs @@ -0,0 +1,55 @@ +//------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------------------------ + +namespace System.ServiceModel.Configuration +{ + using System.Configuration; + + internal class MachineSettingsSection : ConfigurationSection + { + static bool enableLoggingKnownPii; + static bool hasInitialized = false; + static object syncRoot = new object(); + + const string enableLoggingKnownPiiKey = "enableLoggingKnownPii"; + ConfigurationPropertyCollection properties; + + protected override ConfigurationPropertyCollection Properties + { + get + { + if (this.properties == null) + { + ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); + properties.Add(new ConfigurationProperty(MachineSettingsSection.enableLoggingKnownPiiKey, typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + this.properties = properties; + } + return this.properties; + } + } + + public static bool EnableLoggingKnownPii + { + get + { + if (!hasInitialized) + { + lock (syncRoot) + { + if (!hasInitialized) + { + MachineSettingsSection machineSettingsSection = (MachineSettingsSection)ConfigurationManager.GetSection("system.serviceModel/machineSettings"); + enableLoggingKnownPii = (bool)machineSettingsSection[MachineSettingsSection.enableLoggingKnownPiiKey]; + hasInitialized = true; + } + } + } + + return enableLoggingKnownPii; + } + } + } +} + + diff --git a/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/NativeMethods.cs b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/NativeMethods.cs new file mode 100644 index 0000000000..bbcf4395c8 --- /dev/null +++ b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/NativeMethods.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace System.ServiceModel.Diagnostics +{ + using System.Runtime; + using System.Runtime.InteropServices; + using System.Runtime.Versioning; + using System.Security; + + static class NativeMethods + { + const string ADVAPI32 = "advapi32.dll"; + + [DllImport(ADVAPI32, CharSet = System.Runtime.InteropServices.CharSet.Unicode, SetLastError = true)] + [ResourceExposure(ResourceScope.Machine)] + [Fx.Tag.SecurityNote(Critical = "Returns security critical type SafeEventLogWriteHandle.")] + [SecurityCritical] + internal static extern SafeEventLogWriteHandle RegisterEventSource(string uncServerName, string sourceName); + } +} diff --git a/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/PiiTraceSource.cs b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/PiiTraceSource.cs new file mode 100644 index 0000000000..d48db147a0 --- /dev/null +++ b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/PiiTraceSource.cs @@ -0,0 +1,108 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace System.ServiceModel.Diagnostics +{ + using System.Configuration; + using System.Diagnostics; + using System.Runtime; + using System.Runtime.Diagnostics; + using System.ServiceModel.Configuration; + + class PiiTraceSource : TraceSource + { + string eventSourceName = String.Empty; + internal const string LogPii = "logKnownPii"; + bool shouldLogPii = false; + bool initialized = false; + object localSyncObject = new object(); + + internal PiiTraceSource(string name, string eventSourceName) + : base(name) + { +#pragma warning disable 618 + Fx.Assert(!String.IsNullOrEmpty(eventSourceName), "Event log source name must be valid"); +#pragma warning restore 618 + this.eventSourceName = eventSourceName; + } + + internal PiiTraceSource(string name, string eventSourceName, SourceLevels levels) + : base(name, levels) + { +#pragma warning disable 618 + Fx.Assert(!String.IsNullOrEmpty(eventSourceName), "Event log source name must be valid"); +#pragma warning restore 618 + this.eventSourceName = eventSourceName; + } + + void Initialize() + { + if (!this.initialized) + { + lock (localSyncObject) + { + if (!this.initialized) + { + string attributeValue = this.Attributes[PiiTraceSource.LogPii]; + bool shouldLogPii = false; + if (!string.IsNullOrEmpty(attributeValue)) + { + if (!bool.TryParse(attributeValue, out shouldLogPii)) + { + shouldLogPii = false; + } + } + + if (shouldLogPii) + { +#pragma warning disable 618 + System.Runtime.Diagnostics.EventLogger logger = new System.Runtime.Diagnostics.EventLogger(this.eventSourceName, null); +#pragma warning restore 618 + if (MachineSettingsSection.EnableLoggingKnownPii) + { + logger.LogEvent(TraceEventType.Information, + (ushort)System.Runtime.Diagnostics.EventLogCategory.MessageLogging, + (uint)System.Runtime.Diagnostics.EventLogEventId.PiiLoggingOn, + false); + this.shouldLogPii = true; + } + else + { + logger.LogEvent(TraceEventType.Error, + (ushort)System.Runtime.Diagnostics.EventLogCategory.MessageLogging, + (uint)System.Runtime.Diagnostics.EventLogEventId.PiiLoggingNotAllowed, + false); + } + } + this.initialized = true; + } + } + } + } + + protected override string[] GetSupportedAttributes() + { + return new string[] { PiiTraceSource.LogPii }; + } + + internal bool ShouldLogPii + { + get + { + // ShouldLogPii is called very frequently, don't call Initialize unless we have to. + if (!this.initialized) + { + Initialize(); + } + return this.shouldLogPii; + } + set + { + // If you call this, you know what you're doing + this.initialized = true; + this.shouldLogPii = value; + } + } + } +} diff --git a/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/PlainXmlWriter.cs b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/PlainXmlWriter.cs new file mode 100644 index 0000000000..2811856c9d --- /dev/null +++ b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/PlainXmlWriter.cs @@ -0,0 +1,220 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace System.ServiceModel.Diagnostics +{ + using System.Xml; + using System.Runtime; + using System.Diagnostics; + + /// + /// Very basic performance-oriented XmlWriter implementation. No validation/encoding is made. + /// Namespaces are not supported + /// Minimal formatting support + /// + internal class PlainXmlWriter : XmlWriter + { + internal class MaxSizeExceededException : Exception + { + } + + TraceXPathNavigator navigator; + bool writingAttribute = false; + string currentAttributeName; + string currentAttributePrefix; + string currentAttributeNs; + string currentAttributeText = string.Empty; + + public PlainXmlWriter() + : this(-1) //no quota + { + } + + public PlainXmlWriter(int maxSize) + { + this.navigator = new TraceXPathNavigator(maxSize); + } + + public TraceXPathNavigator Navigator + { + get + { + return this.navigator; + } + } + + public override void WriteStartDocument() { } + public override void WriteStartDocument(bool standalone) { } + public override void WriteDocType(string name, string pubid, string sysid, string subset) { } + public override void WriteEndDocument() { } + + public override string LookupPrefix(string ns) + { + return this.navigator.LookupPrefix(ns); + } + + public override WriteState WriteState + { + get { return this.navigator.WriteState; } + } + + public override XmlSpace XmlSpace + { + get { return XmlSpace.Default; } + } + + public override string XmlLang + { + get { return string.Empty; } + } + + public override void WriteValue(object value) + { + this.navigator.AddText(value.ToString()); + } + + public override void WriteValue(string value) + { + this.navigator.AddText(value); + } + + public override void WriteBase64(byte[] buffer, int offset, int count) { } + + public override void WriteStartElement(string prefix, string localName, string ns) + { +#pragma warning disable 618 + Fx.Assert(!String.IsNullOrEmpty(localName), ""); +#pragma warning restore 618 + if (String.IsNullOrEmpty(localName)) + { + throw new ArgumentNullException("localName"); + } + + this.navigator.AddElement(prefix, localName, ns); + } + + public override void WriteFullEndElement() + { + WriteEndElement(); + } + + public override void WriteEndElement() + { + this.navigator.CloseElement(); + } + + public override void WriteStartAttribute(string prefix, string localName, string ns) + { +#pragma warning disable 618 + Fx.Assert(!this.writingAttribute, ""); +#pragma warning restore 618 + if (this.writingAttribute) + { + throw new InvalidOperationException(); + } + + this.currentAttributeName = localName; + this.currentAttributePrefix = prefix; + this.currentAttributeNs = ns; + this.currentAttributeText = string.Empty; + this.writingAttribute = true; + } + + public override void WriteEndAttribute() + { +#pragma warning disable 618 + Fx.Assert(this.writingAttribute, ""); +#pragma warning restore 618 + if (!this.writingAttribute) + { + throw new InvalidOperationException(); + } + this.navigator.AddAttribute(this.currentAttributeName, this.currentAttributeText, this.currentAttributeNs, this.currentAttributePrefix); + this.writingAttribute = false; + } + + public override void WriteCData(string text) + { + this.WriteRaw(""); + } + + public override void WriteComment(string text) + { + this.navigator.AddComment(text); + } + + public override void WriteProcessingInstruction(string name, string text) + { + this.navigator.AddProcessingInstruction(name, text); + } + + public override void WriteEntityRef(string name) + { + } + + public override void WriteCharEntity(char ch) + { + } + + public override void WriteSurrogateCharEntity(char lowChar, char highChar) + { + } + + public override void WriteWhitespace(string ws) + { + } + + public override void WriteString(string text) + { + if (this.writingAttribute) + { + currentAttributeText += text; + } + else + { + this.WriteValue(text); + } + } + + public override void WriteChars(Char[] buffer, int index, int count) + { + // Exceptions being thrown as per data found at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemxmlxmlwriterclasswritecharstopic.asp + if (buffer == null) + { + throw new ArgumentNullException("buffer"); + } + if (index < 0) + { + throw new ArgumentOutOfRangeException("index"); + } + if (count < 0) + { + throw new ArgumentOutOfRangeException("count"); + } + if ((buffer.Length - index) < count) + { + throw new ArgumentException(TraceSR.GetString(TraceSR.WriteCharsInvalidContent)); + } + this.WriteString(new string(buffer, index, count)); + } + + public override void WriteRaw(String data) + { + this.WriteString(data); + } + + public override void WriteRaw(Char[] buffer, int index, int count) + { + this.WriteChars(buffer, index, count); + } + + public override void Close() + { + } + + public override void Flush() + { + } + } +} diff --git a/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/SafeEventLogWriteHandle.cs b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/SafeEventLogWriteHandle.cs new file mode 100644 index 0000000000..4ca93463db --- /dev/null +++ b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/SafeEventLogWriteHandle.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace System.ServiceModel.Diagnostics +{ + using Microsoft.Win32.SafeHandles; + using System.Runtime.InteropServices; + using System.Runtime.Versioning; + using System.Globalization; + using System.Diagnostics; + using System.Security; + using System.Runtime; + + [Fx.Tag.SecurityNote(Critical = "Usage of SafeHandleZeroOrMinusOneIsInvalid, which is protected by a LinkDemand and InheritanceDemand")] + [SecurityCritical] + sealed class SafeEventLogWriteHandle : SafeHandleZeroOrMinusOneIsInvalid + { + // Note: RegisterEventSource returns 0 on failure + [Fx.Tag.SecurityNote(Critical = "Usage of SafeHandleZeroOrMinusOneIsInvalid, which is protected by a LinkDemand and InheritanceDemand")] + [SecurityCritical] + SafeEventLogWriteHandle() : base(true) { } + + [ResourceConsumption(ResourceScope.Machine)] + [Fx.Tag.SecurityNote(Critical = "Usage of SafeHandleZeroOrMinusOneIsInvalid, which is protected by a LinkDemand and InheritanceDemand")] + [SecurityCritical] + internal static SafeEventLogWriteHandle RegisterEventSource(string uncServerName, string sourceName) + { + SafeEventLogWriteHandle retval = NativeMethods.RegisterEventSource(uncServerName, sourceName); + int error = Marshal.GetLastWin32Error(); + if (retval.IsInvalid) + { + Debug.Print("SafeEventLogWriteHandle::RegisterEventSource[" + uncServerName + ", " + sourceName + "] Failed. Last Error: " + + error.ToString(CultureInfo.InvariantCulture)); + } + return retval; + } + + [DllImport("advapi32", SetLastError = true)] + [ResourceExposure(ResourceScope.None)] + private static extern bool DeregisterEventSource(IntPtr hEventLog); + +#pragma warning disable 56523 + [Fx.Tag.SecurityNote(Critical = "Usage of SafeHandleZeroOrMinusOneIsInvalid, which is protected by a LinkDemand and InheritanceDemand")] + [SecurityCritical] + override protected bool ReleaseHandle() + { + return DeregisterEventSource(this.handle); + } +#pragma warning restore 56523 + + } +} diff --git a/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/TraceSourceKind.cs b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/TraceSourceKind.cs new file mode 100644 index 0000000000..97ccaa01f2 --- /dev/null +++ b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/TraceSourceKind.cs @@ -0,0 +1,12 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace System.ServiceModel.Diagnostics +{ + enum TraceSourceKind + { + DiagnosticTraceSource, + PiiTraceSource + } +} diff --git a/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/TraceXPathNavigator.cs b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/TraceXPathNavigator.cs new file mode 100644 index 0000000000..9ebdcfe056 --- /dev/null +++ b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/TraceXPathNavigator.cs @@ -0,0 +1,982 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace System.ServiceModel.Diagnostics +{ + using System.Collections.Generic; + using System.Diagnostics; + using System.Xml; + using System.Xml.XPath; + using System.Globalization; + using System.Text; + using System.IO; + using System.Runtime; + + // We have to put something here so that when this item appears in the + // debugger, ToString() isn't called. Calling ToString() can cause bad behavior. + [DebuggerDisplay("")] + class TraceXPathNavigator : XPathNavigator + { + const int UnlimitedSize = -1; + ElementNode root = null; + TraceNode current = null; + bool closed = false; + XPathNodeType state = XPathNodeType.Element; + int maxSize; + long currentSize; + + public TraceXPathNavigator(int maxSize) + { + this.maxSize = maxSize; + this.currentSize = 0; + } + + interface IMeasurable + { + int Size { get; } + } + + class TraceNode + { + protected TraceNode(XPathNodeType nodeType, ElementNode parent) + { + this.nodeType = nodeType; + this.parent = parent; + } + + internal XPathNodeType NodeType + { + get { return this.nodeType; } + } + + XPathNodeType nodeType; + internal ElementNode parent; + } + + class CommentNode : TraceNode, IMeasurable + { + internal CommentNode(string text, ElementNode parent) + : base(XPathNodeType.Comment, parent) + { + this.nodeValue = text; + } + + internal string nodeValue; + + public int Size + { + get + { + return this.nodeValue.Length + 8; // + } + } + } + + class ElementNode : TraceNode, IMeasurable + { + int attributeIndex = 0; + int elementIndex = 0; + + internal string name; + internal string prefix; + internal string xmlns; + internal List childNodes = new List(); + internal List attributes = new List(); + internal TextNode text; + internal bool movedToText = false; + + internal ElementNode(string name, string prefix, ElementNode parent, string xmlns) + : base(XPathNodeType.Element, parent) + { + this.name = name; + this.prefix = prefix; + this.xmlns = xmlns; + } + + internal void Add(TraceNode node) + { + this.childNodes.Add(node); + } + + //This method returns all subnodes with the given path of local names. Namespaces are ignored. + //For all path elements but the last one, the first match is taken. For the last path element, all matches are returned. + internal IEnumerable FindSubnodes(string[] headersPath) + { +#pragma warning disable 618 + Fx.Assert(null != headersPath, "Headers path should not be null"); + Fx.Assert(headersPath.Length > 0, "There should be more than one item in the headersPath array."); +#pragma warning restore 618 + + if (null == headersPath) + { + throw new ArgumentNullException("headersPath"); + } + ElementNode node = this; + if (String.CompareOrdinal(node.name, headersPath[0]) != 0) + { + node = null; + } + int i = 0; + while (null != node && ++i < headersPath.Length) + { +#pragma warning disable 618 + Fx.Assert(null != headersPath[i], "None of the elements in headersPath should be null."); +#pragma warning restore 618 + ElementNode subNode = null; + if (null != node.childNodes) + { + foreach (TraceNode child in node.childNodes) + { + if (child.NodeType == XPathNodeType.Element) + { + ElementNode childNode = child as ElementNode; + if (null != childNode && 0 == String.CompareOrdinal(childNode.name, headersPath[i])) + { + if (headersPath.Length == i + 1) + { + yield return childNode; + } + else + { + subNode = childNode; + break; + } + } + } + } + } + + node = subNode; + } + } + + internal TraceNode MoveToNext() + { + TraceNode retval = null; + if ((this.elementIndex + 1) < this.childNodes.Count) + { + ++this.elementIndex; + retval = this.childNodes[this.elementIndex]; + } + return retval; + } + + internal bool MoveToFirstAttribute() + { + this.attributeIndex = 0; + return null != this.attributes && this.attributes.Count > 0; + } + + internal bool MoveToNextAttribute() + { + bool retval = false; + if ((this.attributeIndex + 1) < this.attributes.Count) + { + ++this.attributeIndex; + retval = true; + } + return retval; + } + + internal void Reset() + { + this.attributeIndex = 0; + this.elementIndex = 0; + this.movedToText = false; + if (null != this.childNodes) + { + foreach (TraceNode node in this.childNodes) + { + if (node.NodeType == XPathNodeType.Element) + { + ElementNode child = node as ElementNode; + if (child != null) + { + child.Reset(); + } + } + } + } + } + + internal AttributeNode CurrentAttribute + { + get + { + return this.attributes[this.attributeIndex]; + } + } + + public int Size + { + get + { + int size = 2 * this.name.Length + 6; //upper bound + if (!string.IsNullOrEmpty(this.prefix)) + { + size += this.prefix.Length + 1; + } + if (!string.IsNullOrEmpty(this.xmlns)) + { + size += this.xmlns.Length + 9; // xmlns="xmlns" + } + return size; + } + } + } + + class AttributeNode : IMeasurable + { + internal AttributeNode(string name, string prefix, string value, string xmlns) + { + this.name = name; + this.prefix = prefix; + this.nodeValue = value; + this.xmlns = xmlns; + } + + internal string name; + internal string nodeValue; + internal string prefix; + internal string xmlns; + + public int Size + { + get + { + int size = this.name.Length + this.nodeValue.Length + 5; + + if (!string.IsNullOrEmpty(this.prefix)) + { + size += this.prefix.Length + 1; + } + + if (!string.IsNullOrEmpty(this.xmlns)) + { + size += this.xmlns.Length + 9; //upper bound + } + + return size; + } + } + } + + class ProcessingInstructionNode : TraceNode, IMeasurable + { + internal ProcessingInstructionNode(string name, string text, ElementNode parent) + : + base(XPathNodeType.ProcessingInstruction, parent) + { + this.name = name; + this.text = text; + } + + internal string name; + internal string text; + + public int Size + { + get + { + return this.name.Length + this.text.Length + 12; // + } + } + } + + class TextNode : IMeasurable + { + internal TextNode(string value) + { + this.nodeValue = value; + } + internal string nodeValue; + + public int Size + { + get + { + return this.nodeValue.Length; + } + } + } + + internal void AddElement(string prefix, string name, string xmlns) + { + if (this.closed) + { +#pragma warning disable 618 + Fx.Assert("Cannot add data to a closed document"); +#pragma warning restore 618 + throw new InvalidOperationException(); + } + else + { + ElementNode node = new ElementNode(name, prefix, this.CurrentElement, xmlns); + if (this.current == null) + { + this.VerifySize(node); + this.root = node; + this.current = this.root; + } + else if (!this.closed) + { + this.VerifySize(node); + this.CurrentElement.Add(node); + this.current = node; + } + } + } + + internal void AddProcessingInstruction(string name, string text) + { + if (this.current == null) + { + return; + } + else + { + ProcessingInstructionNode node = new ProcessingInstructionNode(name, text, this.CurrentElement); + this.VerifySize(node); + this.CurrentElement.Add(node); + } + } + + internal void AddText(string value) + { + if (this.closed) + { +#pragma warning disable 618 + Fx.Assert("Cannot add data to a closed document"); +#pragma warning restore 618 + throw new InvalidOperationException(); + } + if (this.current == null) + { + return; + } + else + { + if (this.CurrentElement.text == null) + { + TextNode node = new TextNode(value); + this.VerifySize(node); + this.CurrentElement.text = node; + } + else if (!string.IsNullOrEmpty(value)) + { + this.VerifySize(value); + this.CurrentElement.text.nodeValue += value; + } + } + } + + internal void AddAttribute(string name, string value, string xmlns, string prefix) + { + if (this.closed) + { +#pragma warning disable 618 + Fx.Assert("Cannot add data to a closed document"); +#pragma warning restore 618 + throw new InvalidOperationException(); + } + if (this.current == null) + { +#pragma warning disable 618 + Fx.Assert("Operation is invalid on an empty document"); +#pragma warning restore 618 + throw new InvalidOperationException(); + } + AttributeNode node = new AttributeNode(name, prefix, value, xmlns); + this.VerifySize(node); + this.CurrentElement.attributes.Add(node); + } + + internal void AddComment(string text) + { + if (this.closed) + { +#pragma warning disable 618 + Fx.Assert("Cannot add data to a closed document"); +#pragma warning restore 618 + throw new InvalidOperationException(); + } + if (this.current == null) + { +#pragma warning disable 618 + Fx.Assert("Operation is invalid on an empty document"); +#pragma warning restore 618 + throw new InvalidOperationException(); + } + CommentNode node = new CommentNode(text, this.CurrentElement); + this.VerifySize(node); + this.CurrentElement.Add(node); + } + + internal void CloseElement() + { + if (this.closed) + { +#pragma warning disable 618 + Fx.Assert("The document is already closed."); +#pragma warning restore 618 + throw new InvalidOperationException(); + } + else + { + this.current = this.CurrentElement.parent; + if (this.current == null) + { + this.closed = true; + } + } + } + + public override string BaseURI + { + get { return String.Empty; } + } + + public override XPathNavigator Clone() + { + return this; + } + + public override bool IsEmptyElement + { + get + { + bool retval = true; + if (this.current != null) + { + retval = this.CurrentElement.text != null || this.CurrentElement.childNodes.Count > 0; + } + return retval; + } + } + + public override bool IsSamePosition(XPathNavigator other) + { + return false; + } + + [DebuggerDisplay("")] + public override string LocalName + { + get { return this.Name; } + } + + public override string LookupPrefix(string ns) + { + return this.LookupPrefix(ns, this.CurrentElement); + } + + string LookupPrefix(string ns, ElementNode node) + { + string retval = null; + if (string.Compare(ns, node.xmlns, StringComparison.Ordinal) == 0) + { + retval = node.prefix; + } + else + { + foreach (AttributeNode attributeNode in node.attributes) + { + if (string.Compare("xmlns", attributeNode.prefix, StringComparison.Ordinal) == 0) + { + if (string.Compare(ns, attributeNode.nodeValue, StringComparison.Ordinal) == 0) + { + retval = attributeNode.name; + break; + } + } + } + } + + if (string.IsNullOrEmpty(retval) && node.parent != null) + { + retval = LookupPrefix(ns, node.parent); + } + return retval; + } + + public override bool MoveTo(XPathNavigator other) + { + return false; + } + + public override bool MoveToFirstAttribute() + { + if (this.current == null) + { +#pragma warning disable 618 + Fx.Assert("Operation is invalid on an empty document"); +#pragma warning restore 618 + throw new InvalidOperationException(); + } + bool retval = this.CurrentElement.MoveToFirstAttribute(); + if (retval) + { + this.state = XPathNodeType.Attribute; + } + return retval; + } + + public override bool MoveToFirstChild() + { + if (this.current == null) + { +#pragma warning disable 618 + Fx.Assert("Operation is invalid on an empty document"); +#pragma warning restore 618 + throw new InvalidOperationException(); + } + bool retval = false; + if (null != this.CurrentElement.childNodes && this.CurrentElement.childNodes.Count > 0) + { + this.current = this.CurrentElement.childNodes[0]; + this.state = this.current.NodeType; + retval = true; + } + else if ((null == this.CurrentElement.childNodes || this.CurrentElement.childNodes.Count == 0) && this.CurrentElement.text != null) + { + this.state = XPathNodeType.Text; + this.CurrentElement.movedToText = true; + retval = true; + } + return retval; + } + + public override bool MoveToFirstNamespace(XPathNamespaceScope namespaceScope) + { + return false; + } + + public override bool MoveToId(string id) + { + return false; + } + + public override bool MoveToNext() + { + if (this.current == null) + { +#pragma warning disable 618 + Fx.Assert("Operation is invalid on an empty document"); +#pragma warning restore 618 + throw new InvalidOperationException(); + } + bool retval = false; + if (this.state != XPathNodeType.Text) + { + ElementNode parent = this.current.parent; + if (parent != null) + { + TraceNode temp = parent.MoveToNext(); + if (temp == null && parent.text != null && !parent.movedToText) + { + this.state = XPathNodeType.Text; + parent.movedToText = true; + this.current = parent; + retval = true; + } + else if (temp != null) + { + this.state = temp.NodeType; + retval = true; + this.current = temp; + } + } + } + return retval; + } + + public override bool MoveToNextAttribute() + { + if (this.current == null) + { +#pragma warning disable 618 + Fx.Assert("Operation is invalid on an empty document"); +#pragma warning restore 618 + throw new InvalidOperationException(); + } + bool retval = this.CurrentElement.MoveToNextAttribute(); + if (retval) + { + this.state = XPathNodeType.Attribute; + } + return retval; + } + + public override bool MoveToNextNamespace(XPathNamespaceScope namespaceScope) + { + return false; + } + + public override bool MoveToParent() + { + if (this.current == null) + { +#pragma warning disable 618 + Fx.Assert("Operation is invalid on an empty document"); +#pragma warning restore 618 + throw new InvalidOperationException(); + } + bool retval = false; + switch (this.state) + { + case XPathNodeType.Comment: + case XPathNodeType.Element: + case XPathNodeType.ProcessingInstruction: + if (this.current.parent != null) + { + this.current = this.current.parent; + this.state = this.current.NodeType; + retval = true; + } + break; + case XPathNodeType.Attribute: + this.state = XPathNodeType.Element; + retval = true; + break; + case XPathNodeType.Text: + this.state = XPathNodeType.Element; + retval = true; + break; + case XPathNodeType.Namespace: + this.state = XPathNodeType.Element; + retval = true; + break; + } + return retval; + } + + public override bool MoveToPrevious() + { + return false; + } + + public override void MoveToRoot() + { + this.current = this.root; + this.state = XPathNodeType.Element; + this.root.Reset(); + } + + [DebuggerDisplay("")] + public override string Name + { + get + { + string retval = String.Empty; + if (this.current == null) + { +#pragma warning disable 618 + Fx.Assert("Operation is invalid on an empty document"); +#pragma warning restore 618 + } + else + { + switch (this.state) + { + case XPathNodeType.Attribute: + retval = this.CurrentElement.CurrentAttribute.name; + break; + case XPathNodeType.Element: + retval = this.CurrentElement.name; + break; + case XPathNodeType.ProcessingInstruction: + retval = this.CurrentProcessingInstruction.name; + break; + } + } + return retval; + } + } + + public override System.Xml.XmlNameTable NameTable + { + get { return null; } + } + + [DebuggerDisplay("")] + public override string NamespaceURI + { + get + { + string retval = String.Empty; + if (this.current == null) + { +#pragma warning disable 618 + Fx.Assert("Operation is invalid on an empty document"); +#pragma warning restore 618 + } + else + { + switch (this.state) + { + case XPathNodeType.Element: + retval = this.CurrentElement.xmlns; + break; + case XPathNodeType.Attribute: + retval = this.CurrentElement.CurrentAttribute.xmlns; + break; + case XPathNodeType.Namespace: + retval = null; + break; + } + } + return retval; + } + } + + [DebuggerDisplay("")] + public override XPathNodeType NodeType + { + get { return this.state; } + } + + [DebuggerDisplay("")] + public override string Prefix + { + get + { + string retval = String.Empty; + if (this.current == null) + { +#pragma warning disable 618 + Fx.Assert("Operation is invalid on an empty document"); +#pragma warning restore 618 + } + else + { + switch (this.state) + { + case XPathNodeType.Element: + retval = this.CurrentElement.prefix; + break; + case XPathNodeType.Attribute: + retval = this.CurrentElement.CurrentAttribute.prefix; + break; + case XPathNodeType.Namespace: + retval = null; + break; + } + } + return retval; + } + } + + CommentNode CurrentComment + { + get { return this.current as CommentNode; } + } + + ElementNode CurrentElement + { + get { return this.current as ElementNode; } + } + + ProcessingInstructionNode CurrentProcessingInstruction + { + get { return this.current as ProcessingInstructionNode; } + } + + [DebuggerDisplay("")] + public override string Value + { + get + { + string retval = String.Empty; + if (this.current == null) + { +#pragma warning disable 618 + Fx.Assert("Operation is invalid on an empty document"); +#pragma warning restore 618 + } + else + { + switch (this.state) + { + case XPathNodeType.Text: + retval = this.CurrentElement.text.nodeValue; + break; + case XPathNodeType.Attribute: + retval = this.CurrentElement.CurrentAttribute.nodeValue; + break; + case XPathNodeType.Comment: + retval = this.CurrentComment.nodeValue; + break; + case XPathNodeType.ProcessingInstruction: + retval = this.CurrentProcessingInstruction.text; + break; + } + } + return retval; + } + } + + internal WriteState WriteState + { + get + { + WriteState retval = WriteState.Error; + if (this.current == null) + { + retval = WriteState.Start; + } + else if (this.closed) + { + retval = WriteState.Closed; + } + else + { + switch (this.state) + { + case XPathNodeType.Attribute: + retval = WriteState.Attribute; + break; + case XPathNodeType.Element: + retval = WriteState.Element; + break; + case XPathNodeType.Text: + retval = WriteState.Content; + break; + case XPathNodeType.Comment: + retval = WriteState.Content; + break; + } + } + return retval; + } + } + + public override string ToString() + { + this.MoveToRoot(); + StringBuilder sb = new StringBuilder(); + EncodingFallbackAwareXmlTextWriter writer = new EncodingFallbackAwareXmlTextWriter(new StringWriter(sb, CultureInfo.CurrentCulture)); + writer.WriteNode(this, false); + return sb.ToString(); + } + + void VerifySize(IMeasurable node) + { + this.VerifySize(node.Size); + } + + void VerifySize(string node) + { + this.VerifySize(node.Length); + } + + void VerifySize(int nodeSize) + { + if (this.maxSize != TraceXPathNavigator.UnlimitedSize) + { + if (this.currentSize + nodeSize > this.maxSize) + { + throw new PlainXmlWriter.MaxSizeExceededException(); + } + } + this.currentSize += nodeSize; + } + + public void RemovePii(string[][] paths) + { +#pragma warning disable 618 + Fx.Assert(null != paths, ""); +#pragma warning restore 618 + if (paths == null) + { + throw new ArgumentNullException("paths"); + } + + foreach (string[] path in paths) + { + RemovePii(path); + } + } + + public void RemovePii(string[] path) + { + RemovePii(path, DiagnosticStrings.PiiList); + } + + public void RemovePii(string[] headersPath, string[] piiList) + { +#pragma warning disable 618 + Fx.Assert(null != this.root, ""); + if (this.root == null) + { + throw new InvalidOperationException(); + } + foreach (ElementNode node in this.root.FindSubnodes(headersPath)) + { + Fx.Assert(null != node, ""); + MaskSubnodes(node, piiList); + } + } +#pragma warning restore 618 + + static void MaskElement(ElementNode element) + { + if (null != element) + { + element.childNodes.Clear(); + element.Add(new CommentNode("Removed", element)); + element.text = null; + element.attributes = null; + } + } + + static void MaskSubnodes(ElementNode element, string[] elementNames) + { + MaskSubnodes(element, elementNames, false); + } + + static void MaskSubnodes(ElementNode element, string[] elementNames, bool processNodeItself) + { +#pragma warning disable 618 + Fx.Assert(null != elementNames, ""); +#pragma warning restore 618 + if (elementNames == null) + { + throw new ArgumentNullException("elementNames"); + } + + if (null != element) + { + bool recurse = true; + if (processNodeItself) + { + foreach (string elementName in elementNames) + { +#pragma warning disable 618 + Fx.Assert(!String.IsNullOrEmpty(elementName), ""); +#pragma warning restore 618 + if (0 == String.CompareOrdinal(elementName, element.name)) + { + MaskElement(element); + recurse = false; + break; + } + } + } + if (recurse) + { + if (null != element.childNodes) + { + foreach (ElementNode subNode in element.childNodes) + { +#pragma warning disable 618 + Fx.Assert(null != subNode, ""); +#pragma warning restore 618 + MaskSubnodes(subNode, elementNames, true); + } + } + } + } + } + } +} diff --git a/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/Utility.cs b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/Utility.cs new file mode 100644 index 0000000000..71fd837a35 --- /dev/null +++ b/external/referencesource/SMDiagnostics/System/ServiceModel/Diagnostics/Utility.cs @@ -0,0 +1,77 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace System.ServiceModel.Diagnostics +{ + using System.Runtime; + using System.Runtime.CompilerServices; + using System.Runtime.ConstrainedExecution; + using System.Diagnostics; + using System.Threading; + using System.Runtime.InteropServices; + using System.Security; + using System.Security.Permissions; + using System.Diagnostics.CodeAnalysis; + + class Utility + { + ExceptionUtility exceptionUtility; + + [Obsolete("For SMDiagnostics.dll use only. Call DiagnosticUtility.Utility instead")] + internal Utility(ExceptionUtility exceptionUtility) + { + this.exceptionUtility = exceptionUtility; + } + + // Call this when a p/invoke with an 'out SafeHandle' parameter returns an error. This will safely clean up the handle. + [SuppressMessage(FxCop.Category.Security, FxCop.Rule.TransparentMethodsMustNotReferenceCriticalCode)] // we got APTCA approval with no requirement to fix this transparency warning + internal static void CloseInvalidOutSafeHandle(SafeHandle handle) + { + // Workaround for 64-bit CLR bug VSWhidbey 546830 - sometimes invalid SafeHandles come back null. + if (handle != null) + { +#pragma warning disable 618 + Fx.Assert(handle.IsInvalid, "CloseInvalidOutSafeHandle called with a valid handle!"); +#pragma warning restore 618 + + // Calls SuppressFinalize. + handle.SetHandleAsInvalid(); + } + } + + // Copy of the above for CriticalHandles. + [SuppressMessage(FxCop.Category.Security, FxCop.Rule.TransparentMethodsMustNotReferenceCriticalCode)] // we got APTCA approval with no requirement to fix this transparency warning. plus, the callers of this method are not supported in partial trust. + internal static void CloseInvalidOutCriticalHandle(CriticalHandle handle) + { + if (handle != null) + { +#pragma warning disable 618 + Fx.Assert(handle.IsInvalid, "CloseInvalidOutCriticalHandle called with a valid handle!"); +#pragma warning restore 618 + + handle.SetHandleAsInvalid(); + } + } + + internal Guid CreateGuid(string guidString) + { + return Fx.CreateGuid(guidString); + } + + internal bool TryCreateGuid(string guidString, out Guid result) + { + return Fx.TryCreateGuid(guidString, out result); + } + + internal byte[] AllocateByteArray(int size) + { + return Fx.AllocateByteArray(size); + } + + internal char[] AllocateCharArray(int size) + { + return Fx.AllocateCharArray(size); + } + } +} diff --git a/external/referencesource/System.Xml.Linq/System/Xml/Linq/XLinq.cs.REMOVED.git-id b/external/referencesource/System.Xml.Linq/System/Xml/Linq/XLinq.cs.REMOVED.git-id index 645d955afc..24178fbd04 100644 --- a/external/referencesource/System.Xml.Linq/System/Xml/Linq/XLinq.cs.REMOVED.git-id +++ b/external/referencesource/System.Xml.Linq/System/Xml/Linq/XLinq.cs.REMOVED.git-id @@ -1 +1 @@ -3ee2f5565bb7e628ec1aac3722fc4af9fb183d65 \ No newline at end of file +e97b80db7069570f425752085bf7ab1db42cb12d \ No newline at end of file diff --git a/external/referencesource/System/compmod/system/componentmodel/CategoryAttribute.cs b/external/referencesource/System/compmod/system/componentmodel/CategoryAttribute.cs index 96097a83e7..3394efdb52 100644 --- a/external/referencesource/System/compmod/system/componentmodel/CategoryAttribute.cs +++ b/external/referencesource/System/compmod/system/componentmodel/CategoryAttribute.cs @@ -314,8 +314,10 @@ namespace System.ComponentModel { case "Config": return "PropertyCategoryConfig"; } -#endif + return value; +#else return (string)SR.GetObject("PropertyCategory" + value); +#endif #else bool usedFallback; string localizedString = SR.GetString("PropertyCategory" + value, out usedFallback); diff --git a/external/referencesource/System/compmod/system/diagnostics/AssertSection.cs b/external/referencesource/System/compmod/system/diagnostics/AssertSection.cs index a98f6d4e55..8efde6f9ab 100644 --- a/external/referencesource/System/compmod/system/diagnostics/AssertSection.cs +++ b/external/referencesource/System/compmod/system/diagnostics/AssertSection.cs @@ -4,6 +4,7 @@ // //------------------------------------------------------------------------------ +#if CONFIGURATION_DEP using System.Configuration; namespace System.Diagnostics { @@ -41,3 +42,4 @@ namespace System.Diagnostics { } } +#endif diff --git a/external/referencesource/System/compmod/system/diagnostics/DefaultTraceListener.cs b/external/referencesource/System/compmod/system/diagnostics/DefaultTraceListener.cs index 25daba9c59..cd1a421dd9 100644 --- a/external/referencesource/System/compmod/system/diagnostics/DefaultTraceListener.cs +++ b/external/referencesource/System/compmod/system/diagnostics/DefaultTraceListener.cs @@ -111,8 +111,10 @@ namespace System.Diagnostics { [ResourceConsumption(ResourceScope.Machine, ResourceScope.Machine)] private void InitializeSettings() { // don't use the property setters here to avoid infinite recursion. +#if CONFIGURATION_DEP assertUIEnabled = DiagnosticsConfiguration.AssertUIEnabled; logFileName = DiagnosticsConfiguration.LogFileName; +#endif settingsInitialized = true; } diff --git a/external/referencesource/System/compmod/system/diagnostics/DiagnosticsConfiguration.cs b/external/referencesource/System/compmod/system/diagnostics/DiagnosticsConfiguration.cs index 43b34530b2..5b5c81384b 100644 --- a/external/referencesource/System/compmod/system/diagnostics/DiagnosticsConfiguration.cs +++ b/external/referencesource/System/compmod/system/diagnostics/DiagnosticsConfiguration.cs @@ -4,6 +4,7 @@ // //------------------------------------------------------------------------------ +#if CONFIGURATION_DEP namespace System.Diagnostics { using System; using System.Reflection; @@ -255,3 +256,4 @@ namespace System.Diagnostics { } } +#endif diff --git a/external/referencesource/System/compmod/system/diagnostics/FilterElement.cs b/external/referencesource/System/compmod/system/diagnostics/FilterElement.cs index 6b01e8a7f3..2e16969383 100644 --- a/external/referencesource/System/compmod/system/diagnostics/FilterElement.cs +++ b/external/referencesource/System/compmod/system/diagnostics/FilterElement.cs @@ -3,6 +3,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // //------------------------------------------------------------------------------ +#if CONFIGURATION_DEP using System.Configuration; using System; @@ -29,4 +30,4 @@ namespace System.Diagnostics { } } - +#endif diff --git a/external/referencesource/System/compmod/system/diagnostics/ListenerElementsCollection.cs b/external/referencesource/System/compmod/system/diagnostics/ListenerElementsCollection.cs index 810c3c2c4b..37dc9b8e1a 100644 --- a/external/referencesource/System/compmod/system/diagnostics/ListenerElementsCollection.cs +++ b/external/referencesource/System/compmod/system/diagnostics/ListenerElementsCollection.cs @@ -3,6 +3,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // //------------------------------------------------------------------------------ +#if CONFIGURATION_DEP using System.Configuration; using System; using System.Reflection; @@ -372,3 +373,4 @@ namespace System.Diagnostics { } } +#endif diff --git a/external/referencesource/System/compmod/system/diagnostics/PerfCounterSection.cs b/external/referencesource/System/compmod/system/diagnostics/PerfCounterSection.cs index 7a4ae062ba..8d75870edc 100644 --- a/external/referencesource/System/compmod/system/diagnostics/PerfCounterSection.cs +++ b/external/referencesource/System/compmod/system/diagnostics/PerfCounterSection.cs @@ -4,6 +4,7 @@ // //------------------------------------------------------------------------------ +#if CONFIGURATION_DEP using System.Configuration; namespace System.Diagnostics { @@ -31,3 +32,4 @@ namespace System.Diagnostics { } } +#endif diff --git a/external/referencesource/System/compmod/system/diagnostics/SourceElementsCollection.cs b/external/referencesource/System/compmod/system/diagnostics/SourceElementsCollection.cs index a8a606a0ea..834430a775 100644 --- a/external/referencesource/System/compmod/system/diagnostics/SourceElementsCollection.cs +++ b/external/referencesource/System/compmod/system/diagnostics/SourceElementsCollection.cs @@ -3,6 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // //------------------------------------------------------------------------------ + +#if CONFIGURATION_DEP using System.Configuration; using System.Collections; using System.Collections.Specialized; @@ -185,3 +187,4 @@ namespace System.Diagnostics { } +#endif diff --git a/external/referencesource/System/compmod/system/diagnostics/Switch.cs b/external/referencesource/System/compmod/system/diagnostics/Switch.cs index 471abb488c..f019ee54f5 100644 --- a/external/referencesource/System/compmod/system/diagnostics/Switch.cs +++ b/external/referencesource/System/compmod/system/diagnostics/Switch.cs @@ -6,6 +6,9 @@ /* */ +#if !CONFIGURATION_DEP +using SwitchElementsCollection = System.Object; +#endif namespace System.Diagnostics { using System; @@ -19,7 +22,9 @@ namespace System.Diagnostics { using System.Collections.Specialized; using System.Globalization; using System.Configuration; +#if XML_DEP using System.Xml.Serialization; +#endif using System.Diagnostics.CodeAnalysis; /// @@ -97,7 +102,9 @@ namespace System.Diagnostics { } } +#if XML_DEP [XmlIgnore] +#endif public StringDictionary Attributes { get { Initialize(); @@ -164,6 +171,7 @@ namespace System.Diagnostics { set { Initialize(); switchValueString = value; +#if CONFIGURATION_DEP try { OnValueChanged(); } @@ -176,6 +184,9 @@ namespace System.Diagnostics { catch (OverflowException e) { throw new ConfigurationErrorsException(SR.GetString(SR.BadConfigSwitchValue, DisplayName), e); } +#else + OnValueChanged(); +#endif } } @@ -204,6 +215,7 @@ namespace System.Diagnostics { } } +#if CONFIGURATION_DEP if (switchSettings != null) { SwitchElement mySettings = switchSettings[displayName]; if (mySettings != null) { @@ -231,11 +243,14 @@ namespace System.Diagnostics { OnValueChanged(); } } else { +#endif // We don't use the property here because we don't want to catch exceptions // and rethrow them as ConfigurationException. In this case there's no config. switchValueString = defaultValue; OnValueChanged(); +#if CONFIGURATION_DEP } +#endif initialized = true; initializing = false; @@ -249,11 +264,13 @@ namespace System.Diagnostics { if (switchSettings != null) return true; +#if CONFIGURATION_DEP if (!DiagnosticsConfiguration.CanInitialize()) return false; // This hashtable is case-insensitive. switchSettings = DiagnosticsConfiguration.SwitchSettings; +#endif return true; } diff --git a/external/referencesource/System/compmod/system/diagnostics/SwitchElementsCollection.cs b/external/referencesource/System/compmod/system/diagnostics/SwitchElementsCollection.cs index 414b03e338..cbe85945bb 100644 --- a/external/referencesource/System/compmod/system/diagnostics/SwitchElementsCollection.cs +++ b/external/referencesource/System/compmod/system/diagnostics/SwitchElementsCollection.cs @@ -3,6 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // //------------------------------------------------------------------------------ + +#if CONFIGURATION_DEP using System.Configuration; using System.Collections; using System.Collections.Specialized; @@ -136,3 +138,4 @@ namespace System.Diagnostics { } } +#endif diff --git a/external/referencesource/System/compmod/system/diagnostics/SystemDiagnosticsSection.cs b/external/referencesource/System/compmod/system/diagnostics/SystemDiagnosticsSection.cs index 29c47a8d2e..48e4d775c0 100644 --- a/external/referencesource/System/compmod/system/diagnostics/SystemDiagnosticsSection.cs +++ b/external/referencesource/System/compmod/system/diagnostics/SystemDiagnosticsSection.cs @@ -3,6 +3,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // //------------------------------------------------------------------------------ +#if CONFIGURATION_DEP using System.Configuration; namespace System.Diagnostics { @@ -79,3 +80,4 @@ namespace System.Diagnostics { } } +#endif diff --git a/external/referencesource/System/compmod/system/diagnostics/Trace.cs b/external/referencesource/System/compmod/system/diagnostics/Trace.cs index 3e09ae8a39..9d9a20aac1 100644 --- a/external/referencesource/System/compmod/system/diagnostics/Trace.cs +++ b/external/referencesource/System/compmod/system/diagnostics/Trace.cs @@ -163,7 +163,9 @@ namespace System.Diagnostics { } public static void Refresh() { +#if CONFIGURATION_DEP DiagnosticsConfiguration.Refresh(); +#endif Switch.RefreshAll(); TraceSource.RefreshAll(); TraceInternal.Refresh(); diff --git a/external/referencesource/System/compmod/system/diagnostics/TraceInternal.cs b/external/referencesource/System/compmod/system/diagnostics/TraceInternal.cs index 12e6571063..6890780312 100644 --- a/external/referencesource/System/compmod/system/diagnostics/TraceInternal.cs +++ b/external/referencesource/System/compmod/system/diagnostics/TraceInternal.cs @@ -34,11 +34,13 @@ namespace System.Diagnostics { if (listeners == null) { // We only need to check that the main section exists. Everything else will get // created for us if it doesn't exist already. +#if CONFIGURATION_DEP SystemDiagnosticsSection configSectionSav = DiagnosticsConfiguration.SystemDiagnosticsSection; if (configSectionSav != null) { listeners = configSectionSav.Trace.Listeners.GetRuntimeObject(); } else { +#endif // If machine.config was deleted the code will get to here // supply at least something to prevent the world from coming to // an abrupt end. @@ -47,7 +49,9 @@ namespace System.Diagnostics { defaultListener.IndentLevel = indentLevel; defaultListener.IndentSize = indentSize; listeners.Add(defaultListener); +#if CONFIGURATION_DEP } +#endif } } } @@ -269,6 +273,7 @@ namespace System.Diagnostics { } private static void InitializeSettings() { +#if CONFIGURATION_DEP // we want to redo this logic exactly once if the last time we entered the config // system was still initializing. (ASURT 111941, VSWhidbey 149552) if (!settingsInitialized || (defaultInitialized && DiagnosticsConfiguration.IsInitialized())) { @@ -289,6 +294,7 @@ namespace System.Diagnostics { } } } +#endif } // This method refreshes all the data from the configuration file, so that updated to the configuration file are mirrored diff --git a/external/referencesource/System/compmod/system/diagnostics/TraceSection.cs b/external/referencesource/System/compmod/system/diagnostics/TraceSection.cs index 3641201e78..722470c434 100644 --- a/external/referencesource/System/compmod/system/diagnostics/TraceSection.cs +++ b/external/referencesource/System/compmod/system/diagnostics/TraceSection.cs @@ -4,6 +4,7 @@ // //------------------------------------------------------------------------------ +#if CONFIGURATION_DEP using System.Configuration; namespace System.Diagnostics { @@ -58,3 +59,4 @@ namespace System.Diagnostics { } } +#endif diff --git a/external/referencesource/System/compmod/system/diagnostics/TraceSource.cs b/external/referencesource/System/compmod/system/diagnostics/TraceSource.cs index a9abcaf3e2..f5fae9ab41 100644 --- a/external/referencesource/System/compmod/system/diagnostics/TraceSource.cs +++ b/external/referencesource/System/compmod/system/diagnostics/TraceSource.cs @@ -74,6 +74,7 @@ namespace System.Diagnostics { if (_initCalled) return; +#if CONFIGURATION_DEP SourceElementsCollection sourceElements = DiagnosticsConfiguration.Sources; if (sourceElements != null) { @@ -99,6 +100,7 @@ namespace System.Diagnostics { NoConfigInit(); } else +#endif NoConfigInit(); _initCalled = true; @@ -173,6 +175,7 @@ namespace System.Diagnostics { return; } +#if CONFIGURATION_DEP SourceElementsCollection sources = DiagnosticsConfiguration.Sources; if (sources != null) { @@ -233,6 +236,7 @@ namespace System.Diagnostics { attributes = null; } } +#endif } [Conditional("TRACE")] diff --git a/external/referencesource/System/compmod/system/diagnostics/TypedElement.cs b/external/referencesource/System/compmod/system/diagnostics/TypedElement.cs index 1128db6a9d..6d93c1d1de 100644 --- a/external/referencesource/System/compmod/system/diagnostics/TypedElement.cs +++ b/external/referencesource/System/compmod/system/diagnostics/TypedElement.cs @@ -3,6 +3,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // //------------------------------------------------------------------------------ +#if CONFIGURATION_DEP using System.Configuration; using System; using System.Reflection; @@ -10,7 +11,11 @@ using System.Globalization; namespace System.Diagnostics { internal class TypedElement : ConfigurationElement { +#if BOOTSTRAP_BASIC + protected static readonly ConfigurationProperty _propTypeName = new ConfigurationProperty("type", typeof(string), String.Empty, ConfigurationPropertyOptions.IsRequired); +#else protected static readonly ConfigurationProperty _propTypeName = new ConfigurationProperty("type", typeof(string), String.Empty, ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsTypeStringTransformationRequired); +#endif protected static readonly ConfigurationProperty _propInitData = new ConfigurationProperty("initializeData", typeof(string), String.Empty, ConfigurationPropertyOptions.None); protected ConfigurationPropertyCollection _properties; @@ -62,3 +67,4 @@ namespace System.Diagnostics { } } +#endif diff --git a/external/referencesource/System/compmod/system/diagnostics/XmlWriterTraceListener.cs b/external/referencesource/System/compmod/system/diagnostics/XmlWriterTraceListener.cs index 93a2e71024..535d839ea2 100644 --- a/external/referencesource/System/compmod/system/diagnostics/XmlWriterTraceListener.cs +++ b/external/referencesource/System/compmod/system/diagnostics/XmlWriterTraceListener.cs @@ -3,7 +3,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // //------------------------------------------------------------------------------ - +#if XML_DEP using System; using System.Text; using System.Xml; @@ -335,3 +335,4 @@ namespace System.Diagnostics { } } } +#endif diff --git a/external/referencesource/System/compmod/system/diagnostics/traceutils.cs b/external/referencesource/System/compmod/system/diagnostics/traceutils.cs index d7a641a219..ee765e8dc4 100644 --- a/external/referencesource/System/compmod/system/diagnostics/traceutils.cs +++ b/external/referencesource/System/compmod/system/diagnostics/traceutils.cs @@ -19,6 +19,7 @@ namespace System.Diagnostics { [ResourceConsumption(ResourceScope.Machine, ResourceScope.Machine)] internal static object GetRuntimeObject(string className, Type baseType, string initializeData) { Object newObject = null; +#if CONFIGURATION_DEP Type objectType = null; if (className.Length == 0) { @@ -106,20 +107,27 @@ namespace System.Diagnostics { else throw new ConfigurationErrorsException(SR.GetString(SR.Could_not_create_type_instance, className)); } +#endif return newObject; } +#if !MOBILE // Our own tracelisteners that needs extra config validation internal static bool IsOwnedTL(Type type) { return (typeof(EventLogTraceListener) == type || IsOwnedTextWriterTL(type)); } internal static bool IsOwnedTextWriterTL(Type type) { +#if XML_DEP return (typeof(XmlWriterTraceListener) == type) || (typeof(DelimitedListTraceListener) == type) || (typeof(TextWriterTraceListener) == type); +#else + return false; +#endif } +#endif private static object ConvertToBaseTypeOrEnum(string value, Type type) { if (type.IsEnum) @@ -129,6 +137,7 @@ namespace System.Diagnostics { } internal static void VerifyAttributes(IDictionary attributes, String[] supportedAttributes, object parent) { +#if CONFIGURATION_DEP foreach (string key in attributes.Keys) { bool found = false; if (supportedAttributes != null) { @@ -140,6 +149,7 @@ namespace System.Diagnostics { if (!found) throw new ConfigurationErrorsException(SR.GetString(SR.AttributeNotSupported, key, parent.GetType().FullName)); } +#endif } } diff --git a/external/referencesource/System/misc/PrivilegedConfigurationManager.cs b/external/referencesource/System/misc/PrivilegedConfigurationManager.cs index 63e04f244b..ec8920a6ac 100644 --- a/external/referencesource/System/misc/PrivilegedConfigurationManager.cs +++ b/external/referencesource/System/misc/PrivilegedConfigurationManager.cs @@ -3,7 +3,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // //------------------------------------------------------------------------------ - +#if CONFIGURATION_DEP namespace System.Configuration { @@ -25,3 +25,4 @@ namespace System.Configuration { } } } +#endif diff --git a/external/referencesource/System/services/timers/system/timers/Timer.cs b/external/referencesource/System/services/timers/system/timers/Timer.cs index 475a30e90a..122d79c94b 100644 --- a/external/referencesource/System/services/timers/system/timers/Timer.cs +++ b/external/referencesource/System/services/timers/system/timers/Timer.cs @@ -62,12 +62,7 @@ namespace System.Timers { if (interval <= 0) throw new ArgumentException(SR.GetString(SR.InvalidParameter, "interval", interval)); - double roundedInterval = Math.Ceiling(interval); - if (roundedInterval > Int32.MaxValue || roundedInterval <= 0) { - throw new ArgumentException(SR.GetString(SR.InvalidParameter, "interval", interval)); - } - - this.interval = (int) roundedInterval; + this.interval = CalculateRoundedInterval(interval, true); } /// @@ -128,7 +123,7 @@ namespace System.Timers { throw new ObjectDisposedException(GetType().Name); } - int i = (int)Math.Ceiling(interval); + int i = CalculateRoundedInterval(interval); cookie = new Object(); timer = new System.Threading.Timer(callback, cookie, i, autoReset? i:Timeout.Infinite); } @@ -141,9 +136,19 @@ namespace System.Timers { } } + private static int CalculateRoundedInterval(double interval, bool argumentCheck = false) { + double roundedInterval = Math.Ceiling(interval); + if (roundedInterval > Int32.MaxValue || roundedInterval <= 0) { + if (argumentCheck) + throw new ArgumentException(SR.GetString(SR.InvalidParameter, "interval", interval)); + + throw new ArgumentOutOfRangeException(SR.GetString(SR.InvalidParameter, "interval", interval)); + } + return (int)roundedInterval; + } private void UpdateTimer() { - int i = (int)Math.Ceiling(interval); + int i = CalculateRoundedInterval(interval); timer.Change(i, autoReset? i :Timeout.Infinite ); } diff --git a/external/referencesource/mscorlib/system/activator.cs b/external/referencesource/mscorlib/system/activator.cs index 0cc2b39e43..9ce777065f 100644 --- a/external/referencesource/mscorlib/system/activator.cs +++ b/external/referencesource/mscorlib/system/activator.cs @@ -19,7 +19,7 @@ namespace System { using System.Runtime.Remoting; #if FEATURE_REMOTING using System.Runtime.Remoting.Activation; - using Message = System.Runtime.Remoting.Messaging.Message; +// using Message = System.Runtime.Remoting.Messaging.Message; #endif using System.Security; using CultureInfo = System.Globalization.CultureInfo; @@ -74,10 +74,10 @@ namespace System { if ((object)type == null) throw new ArgumentNullException("type"); Contract.EndContractBlock(); - +#if !FULL_AOT_RUNTIME if (type is System.Reflection.Emit.TypeBuilder) throw new NotSupportedException(Environment.GetResourceString("NotSupported_CreateInstanceWithTypeBuilder")); - +#endif // If they didn't specify a lookup, then we will provide the default lookup. if ((bindingAttr & (BindingFlags) LookupMask) == 0) bindingAttr |= Activator.ConstructorDefault; @@ -110,7 +110,7 @@ namespace System { static public Object CreateInstance(Type type, params Object[] args) { -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage) && type != null) { FrameworkEventSource.Log.ActivatorCreateInstance(type.GetFullNameForEtw()); @@ -138,7 +138,7 @@ namespace System { static public Object CreateInstance(Type type) { -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage) && type != null) { FrameworkEventSource.Log.ActivatorCreateInstance(type.GetFullNameForEtw()); @@ -157,6 +157,10 @@ namespace System { static public ObjectHandle CreateInstance(String assemblyName, String typeName) { +#if MONO + if(assemblyName == null) + assemblyName = Assembly.GetCallingAssembly ().GetName ().Name; +#endif StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; return CreateInstance(assemblyName, typeName, @@ -177,6 +181,10 @@ namespace System { Object[] activationAttributes) { +#if MONO + if(assemblyName == null) + assemblyName = Assembly.GetCallingAssembly ().GetName ().Name; +#endif StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; return CreateInstance(assemblyName, typeName, @@ -210,7 +218,7 @@ namespace System { static public T CreateInstance() { RuntimeType rt = typeof(T) as RuntimeType; -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage) && rt != null) { FrameworkEventSource.Log.ActivatorCreateInstanceT(rt.GetFullNameForEtw()); @@ -280,6 +288,10 @@ namespace System { Object[] activationAttributes, Evidence securityInfo) { +#if MONO + if(assemblyName == null) + assemblyName = Assembly.GetCallingAssembly ().GetName ().Name; +#endif StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; return CreateInstance(assemblyName, typeName, @@ -304,6 +316,10 @@ namespace System { CultureInfo culture, object[] activationAttributes) { +#if MONO + if(assemblyName == null) + assemblyName = Assembly.GetCallingAssembly ().GetName ().Name; +#endif StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; return CreateInstance(assemblyName, typeName, @@ -335,7 +351,6 @@ namespace System { throw new NotSupportedException(Environment.GetResourceString("NotSupported_RequiresCasPolicyImplicit")); } #endif // FEATURE_CAS_POLICY - Type type = null; Assembly assembly = null; if (assemblyString == null) { @@ -611,7 +626,7 @@ namespace System { activationAttributes, null); } -#if FEATURE_COMINTEROP +#if FEATURE_COMINTEROP || MONO_COM #if FEATURE_CLICKONCE [System.Security.SecuritySafeCritical] // auto-generated diff --git a/external/referencesource/mscorlib/system/attribute.cs b/external/referencesource/mscorlib/system/attribute.cs index f7a74323c8..2149c8295c 100644 --- a/external/referencesource/mscorlib/system/attribute.cs +++ b/external/referencesource/mscorlib/system/attribute.cs @@ -20,10 +20,101 @@ namespace System { [ClassInterface(ClassInterfaceType.None)] [ComDefaultInterface(typeof(_Attribute))] [System.Runtime.InteropServices.ComVisible(true)] - public abstract class Attribute : _Attribute + public abstract partial class Attribute : _Attribute { #region Private Statics +#if MONO + static Attribute[] InternalGetCustomAttributes (PropertyInfo element, Type type, bool inherit) + { + return (Attribute []) MonoCustomAttrs.GetCustomAttributes (element, type, inherit); + } + static Attribute[] InternalGetCustomAttributes (EventInfo element, Type type, bool inherit) + { + return (Attribute []) MonoCustomAttrs.GetCustomAttributes (element, type, inherit); + } + + static Attribute[] InternalParamGetCustomAttributes (ParameterInfo parameter, Type attributeType, bool inherit) + { + if (parameter.Member.MemberType != MemberTypes.Method) + return null; + + var method = (MethodInfo) parameter.Member; + var definition = method.GetBaseDefinition (); + + if (method == definition) + return (Attribute []) parameter.GetCustomAttributes (typeof(Attribute), inherit); + + var types = new List (); + var custom_attributes = new List (); + + if (attributeType == null) + attributeType = typeof (Attribute); + + while (true) { + var param = method.GetParametersInternal () [parameter.Position]; + var param_attributes = (Attribute []) param.GetCustomAttributes (attributeType, false); + foreach (var param_attribute in param_attributes) { + var param_type = param_attribute.GetType (); + if (types.Contains (param_type)) + continue; + + types.Add (param_type); + custom_attributes.Add (param_attribute); + } + + var base_method = method.GetBaseMethod (); + if (base_method == method) + break; + + method = base_method; + } + + var attributes = (Attribute []) Array.CreateInstance (attributeType, custom_attributes.Count); + custom_attributes.CopyTo (attributes, 0); + + return attributes; + } + + static bool InternalIsDefined (PropertyInfo element, Type attributeType, bool inherit) + { + return MonoCustomAttrs.IsDefined (element, attributeType, inherit); + } + + static bool InternalIsDefined (EventInfo element, Type attributeType, bool inherit) + { + return MonoCustomAttrs.IsDefined (element, attributeType, inherit); + } + + static bool InternalParamIsDefined (ParameterInfo parameter, Type attributeType, bool inherit) + { + if (parameter.IsDefined (attributeType, inherit)) + return true; + + if (!inherit) + return false; + + var member = parameter.Member; + if (member.MemberType != MemberTypes.Method) + return false; + + var method = ((MethodInfo) member).GetBaseMethod (); + + while (true) { + var param = method.GetParametersInternal () [parameter.Position]; + if (param.IsDefined (attributeType, false)) + return true; + + var base_method = method.GetBaseMethod (); + if (base_method == method) + break; + + method = base_method; + } + + return false; + } +#else #region PropertyInfo private static Attribute[] InternalGetCustomAttributes(PropertyInfo element, Type type, bool inherit) { @@ -414,7 +505,7 @@ namespace System { return (Attribute[])Array.UnsafeCreateInstance(elementType, elementCount); } #endregion - +#endif #endregion #region Public Statics diff --git a/external/referencesource/mscorlib/system/defaultbinder.cs b/external/referencesource/mscorlib/system/defaultbinder.cs index 3d578ce5f6..af63a7c52b 100644 --- a/external/referencesource/mscorlib/system/defaultbinder.cs +++ b/external/referencesource/mscorlib/system/defaultbinder.cs @@ -19,7 +19,7 @@ namespace System { using CultureInfo = System.Globalization.CultureInfo; //Marked serializable even though it has no state. [Serializable] - internal class DefaultBinder : Binder + internal partial class DefaultBinder : Binder { // This method is passed a set of methods and must choose the best // fit. The methods all have the same number of arguments and the object @@ -1097,7 +1097,7 @@ namespace System { return methWithDeepestHierarchy; } - +#if !MONO // CanConvertPrimitive // This will determine if the source can be converted to the target type [System.Security.SecurityCritical] // auto-generated @@ -1112,7 +1112,7 @@ namespace System { [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] static internal extern bool CanConvertPrimitiveObjectToType(Object source,RuntimeType type); - +#endif // This method will sort the vars array into the mapping order stored // in the paramOrder array. private static void ReorderParams(int[] paramOrder,Object[] vars) diff --git a/external/referencesource/mscorlib/system/enum.cs b/external/referencesource/mscorlib/system/enum.cs index 211d188df8..79395bc6ae 100644 --- a/external/referencesource/mscorlib/system/enum.cs +++ b/external/referencesource/mscorlib/system/enum.cs @@ -66,13 +66,17 @@ namespace System if (getValues || getNames) { +#if MONO + if (!GetEnumValuesAndNames (enumType, out values, out names)) + Array.Sort (values, names, System.Collections.Generic.Comparer.Default); +#else GetEnumValuesAndNames( enumType.GetTypeHandleInternal(), JitHelpers.GetObjectHandleOnStack(ref values), JitHelpers.GetObjectHandleOnStack(ref names), getValues, getNames); - +#endif if (getValues) hashEntry.values = values; @@ -283,12 +287,16 @@ namespace System [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern RuntimeType InternalGetUnderlyingType(RuntimeType enumType); +#if MONO + [MethodImplAttribute(MethodImplOptions.InternalCall)] + private static extern bool GetEnumValuesAndNames (RuntimeType enumType, out ulong[] values, out string[] names); +#else [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] [System.Security.SuppressUnmanagedCodeSecurity] private static extern void GetEnumValuesAndNames(RuntimeTypeHandle enumType, ObjectHandleOnStack values, ObjectHandleOnStack names, bool getValues, bool getNames); - +#endif [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] @@ -421,7 +429,7 @@ namespace System parseResult.SetFailure(ParseFailureKind.Argument, "Arg_MustContainEnumInfo", null); return false; } -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.EnumTryParseEnum(rtType.GetFullNameForEtw(), value); @@ -525,7 +533,7 @@ namespace System throw new ArgumentNullException("enumType"); Contract.Ensures(Contract.Result() != null); Contract.EndContractBlock(); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.EnumGetUnderlyingType(enumType.GetFullNameForEtw()); @@ -542,7 +550,7 @@ namespace System throw new ArgumentNullException("enumType"); Contract.Ensures(Contract.Result() != null); Contract.EndContractBlock(); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.EnumGetValues(enumType.GetFullNameForEtw()); @@ -569,7 +577,7 @@ namespace System throw new ArgumentNullException("enumType"); Contract.EndContractBlock(); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.EnumGetName(enumType.GetFullNameForEtw()); @@ -586,7 +594,7 @@ namespace System Contract.Ensures(Contract.Result() != null); Contract.EndContractBlock(); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.EnumGetNames(enumType.GetFullNameForEtw()); @@ -668,7 +676,7 @@ namespace System if (enumType == null) throw new ArgumentNullException("enumType"); Contract.EndContractBlock(); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.EnumIsDefined(enumType.GetFullNameForEtw()); @@ -696,7 +704,7 @@ namespace System RuntimeType rtType = enumType as RuntimeType; if (rtType == null) throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), "enumType"); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.BeginEnumFormat(rtType.GetFullNameForEtw()); @@ -726,7 +734,7 @@ namespace System // all acceptable format string are of length 1 throw new FormatException(Environment.GetResourceString("Format_InvalidEnumFormatSpecification")); } -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.EndEnumFormat(rtType.GetFullNameForEtw()); @@ -771,10 +779,18 @@ namespace System } #endregion +#if MONO + [MethodImplAttribute (MethodImplOptions.InternalCall)] + extern object get_value (); +#endif + #region Private Methods [System.Security.SecuritySafeCritical] internal unsafe Object GetValue() { +#if MONO + return get_value (); +#else fixed (void* pValue = &JitHelpers.GetPinningHelper(this).m_data) { switch (InternalGetCorElementType()) @@ -812,6 +828,7 @@ namespace System return null; } } +#endif } [System.Security.SecurityCritical] // auto-generated @@ -822,19 +839,31 @@ namespace System [System.Security.SecuritySafeCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] +#if MONO + private extern int get_hashcode (); +#else private extern CorElementType InternalGetCorElementType(); - +#endif #endregion #region Object Overrides +#if MONO + public override bool Equals (object obj) + { + return DefaultEquals (this, obj); + } +#else [System.Security.SecuritySafeCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] public extern override bool Equals(Object obj); - +#endif [System.Security.SecuritySafeCritical] public override unsafe int GetHashCode() { +#if MONO + return get_hashcode (); +#else // Avoid boxing by inlining GetValue() // return GetValue().GetHashCode(); @@ -875,6 +904,7 @@ namespace System return 0; } } +#endif } public override String ToString() @@ -1138,7 +1168,7 @@ namespace System RuntimeType rtType = enumType as RuntimeType; if (rtType == null) throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), "enumType"); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.EnumToObject(enumType.GetFullNameForEtw()); @@ -1159,7 +1189,7 @@ namespace System RuntimeType rtType = enumType as RuntimeType; if (rtType == null) throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), "enumType"); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.EnumToObject(enumType.GetFullNameForEtw()); @@ -1180,7 +1210,7 @@ namespace System RuntimeType rtType = enumType as RuntimeType; if (rtType == null) throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), "enumType"); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.EnumToObject(enumType.GetFullNameForEtw()); @@ -1201,7 +1231,7 @@ namespace System RuntimeType rtType = enumType as RuntimeType; if (rtType == null) throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), "enumType"); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.EnumToObject(enumType.GetFullNameForEtw()); @@ -1223,7 +1253,7 @@ namespace System RuntimeType rtType = enumType as RuntimeType; if (rtType == null) throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), "enumType"); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.EnumToObject(enumType.GetFullNameForEtw()); @@ -1245,7 +1275,7 @@ namespace System RuntimeType rtType = enumType as RuntimeType; if (rtType == null) throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), "enumType"); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.EnumToObject(enumType.GetFullNameForEtw()); @@ -1266,7 +1296,7 @@ namespace System RuntimeType rtType = enumType as RuntimeType; if (rtType == null) throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), "enumType"); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.EnumToObject(enumType.GetFullNameForEtw()); @@ -1288,7 +1318,7 @@ namespace System RuntimeType rtType = enumType as RuntimeType; if (rtType == null) throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), "enumType"); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.EnumToObject(enumType.GetFullNameForEtw()); diff --git a/external/referencesource/mscorlib/system/globalization/charunicodeinfo.cs b/external/referencesource/mscorlib/system/globalization/charunicodeinfo.cs index d8efc782de..22a4a01507 100644 --- a/external/referencesource/mscorlib/system/globalization/charunicodeinfo.cs +++ b/external/referencesource/mscorlib/system/globalization/charunicodeinfo.cs @@ -109,6 +109,54 @@ namespace System.Globalization { internal sbyte digit; } + unsafe private static int EndianSwap(int value) + { + if (!BitConverter.IsLittleEndian) { + byte *ptr = (byte *) &value; + int res; + byte *buf = (byte *) &res; + int t = sizeof(int) - 1; + + for (int i = 0; i < sizeof(int); i++) + buf[t-i] = ptr[i]; + + return(res); + } else + return(value); + } + + unsafe private static uint EndianSwap(uint value) + { + if (!BitConverter.IsLittleEndian) { + byte *ptr = (byte *) &value; + uint res; + byte *buf = (byte *) &res; + uint t = sizeof(uint) - 1; + + for (uint i = 0; i < sizeof(uint); i++) + buf[t-i] = ptr[i]; + + return(res); + } else + return(value); + } + + unsafe private static ushort EndianSwap(ushort value) + { + if (!BitConverter.IsLittleEndian) { + byte *ptr = (byte *) &value; + ushort res; + byte *buf = (byte *) &res; + ushort t = sizeof(ushort) - 1; + + for (ushort i = 0; i < sizeof(ushort); i++) + buf[t-i] = ptr[i]; + + return(res); + } else + return(value); + } + //We need to allocate the underlying table that provides us with the information that we //use. We allocate this once in the class initializer and then we don't need to worry @@ -125,11 +173,11 @@ namespace System.Globalization { UnicodeDataHeader* mainHeader = (UnicodeDataHeader*)pDataTable; // Set up the native pointer to different part of the tables. - s_pCategoryLevel1Index = (ushort*) (pDataTable + mainHeader->OffsetToCategoriesIndex); - s_pCategoriesValue = (byte*) (pDataTable + mainHeader->OffsetToCategoriesValue); - s_pNumericLevel1Index = (ushort*) (pDataTable + mainHeader->OffsetToNumbericIndex); - s_pNumericValues = (byte*) (pDataTable + mainHeader->OffsetToNumbericValue); - s_pDigitValues = (DigitValues*) (pDataTable + mainHeader->OffsetToDigitValue); + s_pCategoryLevel1Index = (ushort*) (pDataTable + EndianSwap(mainHeader->OffsetToCategoriesIndex)); + s_pCategoriesValue = (byte*) (pDataTable + EndianSwap(mainHeader->OffsetToCategoriesValue)); + s_pNumericLevel1Index = (ushort*) (pDataTable + EndianSwap(mainHeader->OffsetToNumbericIndex)); + s_pNumericValues = (byte*) (pDataTable + EndianSwap(mainHeader->OffsetToNumbericValue)); + s_pDigitValues = (DigitValues*) (pDataTable + EndianSwap(mainHeader->OffsetToDigitValue)); return true; } @@ -254,11 +302,11 @@ namespace System.Globalization { internal unsafe static double InternalGetNumericValue(int ch) { Contract.Assert(ch >= 0 && ch <= 0x10ffff, "ch is not in valid Unicode range."); // Get the level 2 item from the highest 12 bit (8 - 19) of ch. - ushort index = s_pNumericLevel1Index[ch >> 8]; + ushort index = EndianSwap(s_pNumericLevel1Index[ch >> 8]); // Get the level 2 WORD offset from the 4 - 7 bit of ch. This provides the base offset of the level 3 table. // The offset is referred to an float item in m_pNumericFloatData. // Note that & has the lower precedence than addition, so don't forget the parathesis. - index = s_pNumericLevel1Index[index + ((ch >> 4) & 0x000f)]; + index = EndianSwap(s_pNumericLevel1Index[index + ((ch >> 4) & 0x000f)]); byte* pBytePtr = (byte*)&(s_pNumericLevel1Index[index]); // Get the result from the 0 -3 bit of ch. #if WIN64 @@ -448,12 +496,13 @@ namespace System.Globalization { [System.Security.SecuritySafeCritical] // auto-generated internal unsafe static byte InternalGetCategoryValue(int ch, int offset) { + Contract.Assert(ch >= 0 && ch <= 0x10ffff, "ch is not in valid Unicode range."); // Get the level 2 item from the highest 12 bit (8 - 19) of ch. - ushort index = s_pCategoryLevel1Index[ch >> 8]; + ushort index = EndianSwap(s_pCategoryLevel1Index[ch >> 8]); // Get the level 2 WORD offset from the 4 - 7 bit of ch. This provides the base offset of the level 3 table. // Note that & has the lower precedence than addition, so don't forget the parathesis. - index = s_pCategoryLevel1Index[index + ((ch >> 4) & 0x000f)]; + index = EndianSwap(s_pCategoryLevel1Index[index + ((ch >> 4) & 0x000f)]); byte* pBytePtr = (byte*)&(s_pCategoryLevel1Index[index]); // Get the result from the 0 -3 bit of ch. byte valueIndex = pBytePtr[(ch & 0x000f)]; diff --git a/external/referencesource/mscorlib/system/reflection/RuntimeReflectionExtensions.cs b/external/referencesource/mscorlib/system/reflection/RuntimeReflectionExtensions.cs index 5ca184889c..a960d20d00 100644 --- a/external/referencesource/mscorlib/system/reflection/RuntimeReflectionExtensions.cs +++ b/external/referencesource/mscorlib/system/reflection/RuntimeReflectionExtensions.cs @@ -23,14 +23,14 @@ namespace System.Reflection public static IEnumerable GetRuntimeProperties(this Type type) { CheckAndThrow(type); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.BeginGetRuntimeProperties(type.GetFullNameForEtw()); } #endif IEnumerable properties = type.GetProperties(everything); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.EndGetRuntimeProperties(type.GetFullNameForEtw()); @@ -41,14 +41,14 @@ namespace System.Reflection public static IEnumerable GetRuntimeEvents(this Type type) { CheckAndThrow(type); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.BeginGetRuntimeEvents(type.GetFullNameForEtw()); } #endif IEnumerable events = type.GetEvents(everything); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.EndGetRuntimeEvents(type.GetFullNameForEtw()); @@ -60,14 +60,14 @@ namespace System.Reflection public static IEnumerable GetRuntimeMethods(this Type type) { CheckAndThrow(type); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.BeginGetRuntimeMethods(type.GetFullNameForEtw()); } #endif IEnumerable methods = type.GetMethods(everything); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.EndGetRuntimeMethods(type.GetFullNameForEtw()); @@ -79,14 +79,14 @@ namespace System.Reflection public static IEnumerable GetRuntimeFields(this Type type) { CheckAndThrow(type); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.BeginGetRuntimeFields(type.GetFullNameForEtw()); } #endif IEnumerable fields = type.GetFields(everything); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.EndGetRuntimeFields(type.GetFullNameForEtw()); @@ -99,7 +99,7 @@ namespace System.Reflection public static PropertyInfo GetRuntimeProperty(this Type type, string name) { CheckAndThrow(type); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.BeginGetRuntimeProperty(type.GetFullNameForEtw(), name != null ? name : ""); @@ -107,7 +107,7 @@ namespace System.Reflection #endif PropertyInfo pi = type.GetProperty(name); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.EndGetRuntimeProperty(type.GetFullNameForEtw(), pi != null ? pi.GetFullNameForEtw() : ""); @@ -119,14 +119,14 @@ namespace System.Reflection public static EventInfo GetRuntimeEvent(this Type type, string name) { CheckAndThrow(type); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.BeginGetRuntimeEvent(type.GetFullNameForEtw(), name != null ? name : ""); } #endif EventInfo ei = type.GetEvent(name); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.EndGetRuntimeEvent(type.GetFullNameForEtw(), ei != null ? ei.GetFullNameForEtw() : ""); @@ -138,14 +138,14 @@ namespace System.Reflection public static MethodInfo GetRuntimeMethod(this Type type, string name, Type[] parameters) { CheckAndThrow(type); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.BeginGetRuntimeMethod(type.GetFullNameForEtw(), name != null ? name : ""); } #endif MethodInfo mi = type.GetMethod(name, parameters); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.EndGetRuntimeMethod(type.GetFullNameForEtw(), mi != null ? mi.GetFullNameForEtw() : ""); @@ -157,14 +157,14 @@ namespace System.Reflection public static FieldInfo GetRuntimeField(this Type type, string name) { CheckAndThrow(type); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.BeginGetRuntimeField(type.GetFullNameForEtw(), name != null ? name : ""); } #endif FieldInfo fi = type.GetField(name); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.EndGetRuntimeField(type.GetFullNameForEtw(), fi != null ? fi.GetFullNameForEtw() : ""); diff --git a/external/referencesource/mscorlib/system/reflection/assemblyattributes.cs b/external/referencesource/mscorlib/system/reflection/assemblyattributes.cs index ea72bf396c..f803e4a9d1 100644 --- a/external/referencesource/mscorlib/system/reflection/assemblyattributes.cs +++ b/external/referencesource/mscorlib/system/reflection/assemblyattributes.cs @@ -388,7 +388,7 @@ namespace System.Reflection { } #endif -#if FEATURE_CORECLR || !FEATURE_PAL +#if FEATURE_CORECLR || !FEATURE_PAL || MONO [AttributeUsage (AttributeTargets.Assembly, Inherited=false)] [System.Runtime.InteropServices.ComVisible(true)] public sealed class AssemblyKeyNameAttribute : Attribute diff --git a/external/referencesource/mscorlib/system/reflection/introspectionextensions.cs b/external/referencesource/mscorlib/system/reflection/introspectionextensions.cs index 066750f705..b8c7c3e24d 100644 --- a/external/referencesource/mscorlib/system/reflection/introspectionextensions.cs +++ b/external/referencesource/mscorlib/system/reflection/introspectionextensions.cs @@ -30,7 +30,7 @@ namespace System.Reflection if(rcType==null){ return null; }else{ -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.IntrospectionExtensionsGetTypeInfo(type.GetFullNameForEtw()); diff --git a/external/referencesource/mscorlib/system/reflection/memberinfo.cs b/external/referencesource/mscorlib/system/reflection/memberinfo.cs index df988a8600..75b57f437c 100644 --- a/external/referencesource/mscorlib/system/reflection/memberinfo.cs +++ b/external/referencesource/mscorlib/system/reflection/memberinfo.cs @@ -62,7 +62,14 @@ namespace System.Reflection throw new NotImplementedException(); } +#if MONO + public virtual extern int MetadataToken { + [System.Runtime.CompilerServices.MethodImplAttribute (System.Runtime.CompilerServices.MethodImplOptions.InternalCall)] + get; + } +#else public virtual int MetadataToken { get { throw new InvalidOperationException(); } } +#endif public virtual Module Module { diff --git a/external/referencesource/mscorlib/system/reflection/methodbase.cs b/external/referencesource/mscorlib/system/reflection/methodbase.cs index cba403ac50..3673c55072 100644 --- a/external/referencesource/mscorlib/system/reflection/methodbase.cs +++ b/external/referencesource/mscorlib/system/reflection/methodbase.cs @@ -57,7 +57,7 @@ namespace System.Reflection [PermissionSetAttribute(SecurityAction.InheritanceDemand, Name = "FullTrust")] #pragma warning restore 618 [System.Runtime.InteropServices.ComVisible(true)] - public abstract class MethodBase : MemberInfo, _MethodBase + public abstract partial class MethodBase : MemberInfo, _MethodBase { #region Static Members public static MethodBase GetMethodFromHandle(RuntimeMethodHandle handle) @@ -65,18 +65,24 @@ namespace System.Reflection if (handle.IsNullHandle()) throw new ArgumentException(Environment.GetResourceString("Argument_InvalidHandle")); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.BeginGetMethodFromHandle(); } #endif +#if MONO + MethodBase m = GetMethodFromHandleInternalType (handle.Value, IntPtr.Zero); + if (m == null) + throw new ArgumentException ("The handle is invalid."); +#else MethodBase m = RuntimeType.GetMethodBase(handle.GetMethodInfo()); +#endif Type declaringType = m.DeclaringType; -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage) && declaringType != null) { FrameworkEventSource.Log.EndGetMethodFromHandle(declaringType.GetFullNameForEtw(), m.GetFullNameForEtw()); @@ -97,16 +103,22 @@ namespace System.Reflection if (handle.IsNullHandle()) throw new ArgumentException(Environment.GetResourceString("Argument_InvalidHandle")); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.BeginGetMethodFromHandle(); } #endif +#if MONO + MethodBase m = GetMethodFromHandleInternalType (handle.Value, declaringType.Value); + if (m == null) + throw new ArgumentException ("The handle is invalid."); +#else MethodBase m = RuntimeType.GetMethodBase(declaringType.GetRuntimeType(), handle.GetMethodInfo()); +#endif -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage) && declaringType != null && m != null) { FrameworkEventSource.Log.EndGetMethodFromHandle(declaringType.GetRuntimeType().GetFullNameForEtw(), m.GetFullNameForEtw()); @@ -116,6 +128,10 @@ namespace System.Reflection return m; } +#if MONO + [MethodImplAttribute (MethodImplOptions.InternalCall)] + public extern static MethodBase GetCurrentMethod (); +#else [System.Security.DynamicSecurityMethod] // Specify DynamicSecurityMethod attribute to prevent inlining of the caller. [MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable public static MethodBase GetCurrentMethod() @@ -123,6 +139,7 @@ namespace System.Reflection StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; return RuntimeMethodInfo.InternalGetCurrentMethod(ref stackMark); } +#endif #endregion #region Constructor @@ -382,7 +399,7 @@ namespace System.Reflection return parameterTypes; } - +#if !MONO [System.Security.SecuritySafeCritical] internal Object[] CheckArguments(Object[] parameters, Binder binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig) @@ -409,6 +426,7 @@ namespace System.Reflection return copyOfParameters; } +#endif #endregion void _MethodBase.GetTypeInfoCount(out uint pcTInfo) diff --git a/external/referencesource/mscorlib/system/reflection/typeattributes.cs b/external/referencesource/mscorlib/system/reflection/typeattributes.cs index d498a106d1..10412e6f2c 100644 --- a/external/referencesource/mscorlib/system/reflection/typeattributes.cs +++ b/external/referencesource/mscorlib/system/reflection/typeattributes.cs @@ -44,7 +44,7 @@ namespace System.Reflection { // Implementation attributes. Import = 0x00001000, // Class / interface is imported Serializable = 0x00002000, // The class is Serializable. -#if FEATURE_COMINTEROP +#if FEATURE_COMINTEROP || MONO_COM [ComVisible(false)] WindowsRuntime = 0x00004000, // Type is a Windows Runtime type. #endif // FEATURE_COMINTEROP diff --git a/external/referencesource/mscorlib/system/reflection/typeinfo.cs b/external/referencesource/mscorlib/system/reflection/typeinfo.cs index f19a10df4c..ea69908464 100644 --- a/external/referencesource/mscorlib/system/reflection/typeinfo.cs +++ b/external/referencesource/mscorlib/system/reflection/typeinfo.cs @@ -85,14 +85,14 @@ namespace System.Reflection public virtual EventInfo GetDeclaredEvent(String name) { -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.BeginGetRuntimeEvent(GetFullNameForEtw(), name != null ? name : ""); } #endif EventInfo ei = GetEvent(name, Type.DeclaredOnlyLookup); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.EndGetRuntimeEvent(GetFullNameForEtw(), ei != null ? ei.GetFullNameForEtw() : ""); @@ -102,14 +102,14 @@ namespace System.Reflection } public virtual FieldInfo GetDeclaredField(String name) { -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.BeginGetRuntimeField(GetFullNameForEtw(), name != null ? name : ""); } #endif FieldInfo fi = GetField(name, Type.DeclaredOnlyLookup); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.EndGetRuntimeField(GetFullNameForEtw(), fi != null ? fi.GetFullNameForEtw() : ""); @@ -119,14 +119,14 @@ namespace System.Reflection } public virtual MethodInfo GetDeclaredMethod(String name) { -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.BeginGetRuntimeMethod(GetFullNameForEtw(), name != null ? name : ""); } #endif MethodInfo mi = GetMethod(name, Type.DeclaredOnlyLookup); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.EndGetRuntimeMethod(GetFullNameForEtw(), mi != null ? mi.GetFullNameForEtw() : ""); @@ -137,7 +137,7 @@ namespace System.Reflection public virtual IEnumerable GetDeclaredMethods(String name) { -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.BeginGetRuntimeMethods(GetFullNameForEtw()); @@ -150,7 +150,7 @@ namespace System.Reflection yield return method; } -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.EndGetRuntimeMethods(GetFullNameForEtw()); @@ -168,14 +168,14 @@ namespace System.Reflection } public virtual PropertyInfo GetDeclaredProperty(String name) { -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.BeginGetRuntimeProperty(GetFullNameForEtw(), name != null ? name : ""); } #endif PropertyInfo pi = GetProperty(name, Type.DeclaredOnlyLookup); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.EndGetRuntimeProperty(GetFullNameForEtw(), pi != null ? pi.GetFullNameForEtw() : ""); @@ -194,14 +194,14 @@ namespace System.Reflection { get { -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.BeginGetRuntimeConstructors(GetFullNameForEtw()); } #endif IEnumerable constructors = GetConstructors(Type.DeclaredOnlyLookup); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.EndGetRuntimeConstructors(GetFullNameForEtw()); @@ -215,14 +215,14 @@ namespace System.Reflection { get { -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.BeginGetRuntimeEvents(GetFullNameForEtw()); } #endif IEnumerable events = GetEvents(Type.DeclaredOnlyLookup); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.EndGetRuntimeEvents(GetFullNameForEtw()); @@ -236,14 +236,14 @@ namespace System.Reflection { get { -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.BeginGetRuntimeFields(GetFullNameForEtw()); } #endif IEnumerable fields = GetFields(Type.DeclaredOnlyLookup); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.EndGetRuntimeFields(GetFullNameForEtw()); @@ -257,14 +257,14 @@ namespace System.Reflection { get { -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.BeginGetRuntimeMembers(GetFullNameForEtw()); } #endif IEnumerable members = GetMembers(Type.DeclaredOnlyLookup); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.EndGetRuntimeMembers(GetFullNameForEtw()); @@ -278,14 +278,14 @@ namespace System.Reflection { get { -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.BeginGetRuntimeMethods(GetFullNameForEtw()); } #endif IEnumerable methods = GetMethods(Type.DeclaredOnlyLookup); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.EndGetRuntimeMethods(GetFullNameForEtw()); @@ -308,14 +308,14 @@ namespace System.Reflection { get { -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.BeginGetRuntimeProperties(GetFullNameForEtw()); } #endif IEnumerable properties = GetProperties(Type.DeclaredOnlyLookup); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage)) { FrameworkEventSource.Log.EndGetRuntimeProperties(GetFullNameForEtw()); diff --git a/external/referencesource/mscorlib/system/resources/manifestbasedresourcegroveler.cs b/external/referencesource/mscorlib/system/resources/manifestbasedresourcegroveler.cs index 0b469000cc..9453aa60f8 100644 --- a/external/referencesource/mscorlib/system/resources/manifestbasedresourcegroveler.cs +++ b/external/referencesource/mscorlib/system/resources/manifestbasedresourcegroveler.cs @@ -255,9 +255,14 @@ namespace System.Resources { Contract.Assert(a != null, "assembly != null"); string cultureName = null; short fallback = 0; + +#if MONO + if (GetNeutralResourcesLanguageAttribute(a, ref cultureName, ref fallback)) { +#else if (GetNeutralResourcesLanguageAttribute(((RuntimeAssembly)a).GetNativeHandle(), JitHelpers.GetStringHandleOnStack(ref cultureName), out fallback)) { +#endif if ((UltimateResourceFallbackLocation)fallback < UltimateResourceFallbackLocation.MainAssembly || (UltimateResourceFallbackLocation)fallback > UltimateResourceFallbackLocation.Satellite) { throw new ArgumentException(Environment.GetResourceString("Arg_InvalidNeutralResourcesLanguage_FallbackLoc", fallback)); } @@ -718,11 +723,24 @@ namespace System.Resources { throw new MissingManifestResourceException(Environment.GetResourceString("MissingManifestResource_NoNeutralAsm", resName, _mediator.MainAssembly.GetSimpleName())); } +#if MONO + static bool GetNeutralResourcesLanguageAttribute (Assembly assembly, ref string cultureName, ref short fallbackLocation) + { + var ca = assembly.GetCustomAttribute (); + if (ca == null) + return false; + + cultureName = ca.CultureName; + fallbackLocation = (short) ca.Location; + return true; + } +#else [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] [System.Security.SecurityCritical] // Our security team doesn't yet allow safe-critical P/Invoke methods. [ResourceExposure(ResourceScope.None)] [System.Security.SuppressUnmanagedCodeSecurity] [return: MarshalAs(UnmanagedType.Bool)] internal static extern bool GetNeutralResourcesLanguageAttribute(RuntimeAssembly assemblyHandle, StringHandleOnStack cultureName, out short fallbackLocation); +#endif } } diff --git a/external/referencesource/mscorlib/system/resources/resourcemanager.cs b/external/referencesource/mscorlib/system/resources/resourcemanager.cs index 6173b5ba13..758f36b734 100644 --- a/external/referencesource/mscorlib/system/resources/resourcemanager.cs +++ b/external/referencesource/mscorlib/system/resources/resourcemanager.cs @@ -516,9 +516,10 @@ namespace System.Resources { _neutralResourcesCulture = ManifestBasedResourceGroveler.GetNeutralResourcesLanguage(MainAssembly, ref _fallbackLoc); -#if !FEATURE_CORECLR && !MONO // PAL doesn't support eventing, and we don't compile event providers for coreclr +#if !FEATURE_CORECLR // PAL doesn't support eventing, and we don't compile event providers for coreclr if (_bUsingModernResourceManagement == false) { +#if !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled()) { CultureInfo culture = CultureInfo.InvariantCulture; String defaultResName = GetResourceFileName(culture); @@ -533,7 +534,7 @@ namespace System.Resources { FrameworkEventSource.Log.ResourceManagerNeutralResourcesNotFound(BaseNameField, MainAssembly, outputResName); } } - +#endif #pragma warning disable 618 ResourceSets = new Hashtable(); // for backward compatibility #pragma warning restore 618 diff --git a/external/referencesource/mscorlib/system/resources/resourcewriter.cs b/external/referencesource/mscorlib/system/resources/resourcewriter.cs index 56b84ac25a..76be430183 100644 --- a/external/referencesource/mscorlib/system/resources/resourcewriter.cs +++ b/external/referencesource/mscorlib/system/resources/resourcewriter.cs @@ -94,7 +94,7 @@ namespace System.Resources { private const int AverageValueSize = 40; private Dictionary _resourceList; - private Stream _output; + internal Stream _output; private Dictionary _caseInsensitiveDups; private Dictionary _preserializedData; private const int _DefaultBufferSize = 4096; diff --git a/external/referencesource/mscorlib/system/rttype.cs.REMOVED.git-id b/external/referencesource/mscorlib/system/rttype.cs.REMOVED.git-id index c0f93dfd60..ef4c63d776 100644 --- a/external/referencesource/mscorlib/system/rttype.cs.REMOVED.git-id +++ b/external/referencesource/mscorlib/system/rttype.cs.REMOVED.git-id @@ -1 +1 @@ -80740fd95865cd9fb6a9642e3b5690f0d62be948 \ No newline at end of file +f132cbc0e367fdac450e2d7468a29528524afb99 \ No newline at end of file diff --git a/external/referencesource/mscorlib/system/runtime/serialization/formatters/binary/binaryformatterwriter.cs b/external/referencesource/mscorlib/system/runtime/serialization/formatters/binary/binaryformatterwriter.cs index 2ad05e8d83..28ef1f0810 100644 --- a/external/referencesource/mscorlib/system/runtime/serialization/formatters/binary/binaryformatterwriter.cs +++ b/external/referencesource/mscorlib/system/runtime/serialization/formatters/binary/binaryformatterwriter.cs @@ -407,7 +407,7 @@ namespace System.Runtime.Serialization.Formatters.Binary { int numArrayItems = Math.Min(chunkSize/typeLength, array.Length-arrayOffset); int bufferUsed = numArrayItems*typeLength; Buffer.InternalBlockCopy(array, arrayOffset*typeLength, byteBuffer, 0, bufferUsed); -#if BIGENDIAN +if (!BitConverter.IsLittleEndian) { // we know that we are writing a primitive type, so just do a simple swap for (int i = 0; i < bufferUsed; i += typeLength) { @@ -418,7 +418,7 @@ namespace System.Runtime.Serialization.Formatters.Binary { byteBuffer[i + typeLength-1 - j] = tmp; } } -#endif +} WriteBytes(byteBuffer, 0, bufferUsed); arrayOffset += numArrayItems; } diff --git a/external/referencesource/mscorlib/system/runtime/serialization/formatters/binary/binaryobjectreader.cs b/external/referencesource/mscorlib/system/runtime/serialization/formatters/binary/binaryobjectreader.cs index 0b5710be1c..7ab66c338e 100644 --- a/external/referencesource/mscorlib/system/runtime/serialization/formatters/binary/binaryobjectreader.cs +++ b/external/referencesource/mscorlib/system/runtime/serialization/formatters/binary/binaryobjectreader.cs @@ -158,12 +158,12 @@ namespace System.Runtime.Serialization.Formatters.Binary { bIsCrossAppDomain = isCrossAppDomain; #endif bSimpleAssembly = (formatterEnums.FEassemblyFormat == FormatterAssemblyStyle.Simple); - +#if !MONO if (fCheck) { CodeAccessPermission.Demand(PermissionType.SecuritySerialization); } - +#endif this.handler = handler; Contract.Assert(!bFullDeserialization, "we just set bFullDeserialization to false"); @@ -244,12 +244,12 @@ namespace System.Runtime.Serialization.Formatters.Binary { bIsCrossAppDomain = isCrossAppDomain; #endif bSimpleAssembly = (formatterEnums.FEassemblyFormat == FormatterAssemblyStyle.Simple); - +#if !MONO if (fCheck) { CodeAccessPermission.Demand(PermissionType.SecuritySerialization); } - +#endif this.handler = handler; @@ -1504,9 +1504,10 @@ namespace System.Runtime.Serialization.Formatters.Binary { if ( !FormatterServices.UnsafeTypeForwardersIsEnabled() && sourceAssembly != destAssembly ) { // we have a type forward to attribute ! - +#if !DISABLE_CAS_USE // we can try to see if the dest assembly has less permissionSet if (!destAssembly.PermissionSet.IsSubsetOf(sourceAssembly.PermissionSet)) +#endif { // let us try to see if typeforwardedfrom is there @@ -1521,17 +1522,20 @@ namespace System.Runtime.Serialization.Formatters.Binary { typeFowardedFromAssembly = Assembly.Load(typeInfo.AssemblyString); } catch { } - +#if !DISABLE_CAS_USE if (typeFowardedFromAssembly != sourceAssembly) { // throw security exception throw new SecurityException() { Demanded = sourceAssembly.PermissionSet }; } +#endif } else { +#if !DISABLE_CAS_USE // throw security exception throw new SecurityException() { Demanded = sourceAssembly.PermissionSet }; +#endif } } } diff --git a/external/referencesource/mscorlib/system/runtime/serialization/formatters/binary/binaryobjectwriter.cs b/external/referencesource/mscorlib/system/runtime/serialization/formatters/binary/binaryobjectwriter.cs index 12699da145..bce52fc45d 100644 --- a/external/referencesource/mscorlib/system/runtime/serialization/formatters/binary/binaryobjectwriter.cs +++ b/external/referencesource/mscorlib/system/runtime/serialization/formatters/binary/binaryobjectwriter.cs @@ -85,12 +85,12 @@ namespace System.Runtime.Serialization.Formatters.Binary Contract.EndContractBlock(); SerTrace.Log(this, "Serialize Entry 2 ", graph, ((headers == null) ? " no headers " : "headers ")); - +#if !MONO if (fCheck) { CodeAccessPermission.Demand(PermissionType.SecuritySerialization); } - +#endif this.serWriter = serWriter; this.headers = inHeaders; diff --git a/external/referencesource/mscorlib/system/runtime/serialization/formatters/binary/binaryparser.cs b/external/referencesource/mscorlib/system/runtime/serialization/formatters/binary/binaryparser.cs index 04241bfaa6..cab446c645 100644 --- a/external/referencesource/mscorlib/system/runtime/serialization/formatters/binary/binaryparser.cs +++ b/external/referencesource/mscorlib/system/runtime/serialization/formatters/binary/binaryparser.cs @@ -1031,7 +1031,7 @@ namespace System.Runtime.Serialization.Formatters.Binary { int numArrayItems = Math.Min(chunkSize/typeLength, array.Length-arrayOffset); int bufferUsed = numArrayItems*typeLength; ReadBytes(byteBuffer, 0, bufferUsed); -#if BIGENDIAN +if (!BitConverter.IsLittleEndian) { // we know that we are reading a primitive type, so just do a simple swap for (int i = 0; i < bufferUsed; i += typeLength) { @@ -1042,7 +1042,7 @@ namespace System.Runtime.Serialization.Formatters.Binary { byteBuffer[i + typeLength - 1 - j] = tmp; } } -#endif +} Buffer.InternalBlockCopy(byteBuffer, 0, array, arrayOffset*typeLength, bufferUsed); arrayOffset += numArrayItems; } diff --git a/external/referencesource/mscorlib/system/runtime/serialization/formatterservices.cs b/external/referencesource/mscorlib/system/runtime/serialization/formatterservices.cs index cf2cdac776..f4521515a0 100644 --- a/external/referencesource/mscorlib/system/runtime/serialization/formatterservices.cs +++ b/external/referencesource/mscorlib/system/runtime/serialization/formatterservices.cs @@ -294,6 +294,17 @@ namespace System.Runtime.Serialization { } } +#if MONO + private static Object nativeGetUninitializedObject(RuntimeType type) + { + return System.Runtime.Remoting.Activation.ActivationServices.AllocateUninitializedClassInstance (type); + } + + private static Object nativeGetSafeUninitializedObject(RuntimeType type) + { + return System.Runtime.Remoting.Activation.ActivationServices.AllocateUninitializedClassInstance (type); + } +#else [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] @@ -303,11 +314,19 @@ namespace System.Runtime.Serialization { [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] private static extern Object nativeGetUninitializedObject(RuntimeType type); +#endif #if FEATURE_SERIALIZATION +#if MONO + static bool GetEnableUnsafeTypeForwarders () + { + return false; + } +#else [System.Security.SecurityCritical] [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] private static extern bool GetEnableUnsafeTypeForwarders(); +#endif [SecuritySafeCritical] internal static bool UnsafeTypeForwardersIsEnabled() diff --git a/external/referencesource/mscorlib/system/runtime/serialization/objectclonehelper.cs b/external/referencesource/mscorlib/system/runtime/serialization/objectclonehelper.cs index 2ab12c782e..fa47f3bff4 100644 --- a/external/referencesource/mscorlib/system/runtime/serialization/objectclonehelper.cs +++ b/external/referencesource/mscorlib/system/runtime/serialization/objectclonehelper.cs @@ -53,6 +53,7 @@ namespace System.Runtime.Serialization } else if (RemotingServices.IsTransparentProxy(serObj) || serObj is MarshalByRefObject) { +#if !MONO // We can only try to smuggle objref's for actual CLR objects // or for RemotingProxy's. if (!RemotingServices.IsTransparentProxy(serObj) || @@ -78,7 +79,7 @@ namespace System.Runtime.Serialization retObj = objRef; } } - +#endif if (retObj == null) { // Deal with the non-smugglable remoting objects diff --git a/external/referencesource/mscorlib/system/runtime/serialization/objectmanager.cs b/external/referencesource/mscorlib/system/runtime/serialization/objectmanager.cs index d27cdb8710..8d53544a06 100644 --- a/external/referencesource/mscorlib/system/runtime/serialization/objectmanager.cs +++ b/external/referencesource/mscorlib/system/runtime/serialization/objectmanager.cs @@ -53,7 +53,9 @@ namespace System.Runtime.Serialization { [System.Security.SecurityCritical] // auto-generated internal ObjectManager(ISurrogateSelector selector, StreamingContext context, bool checkSecurity, bool isCrossAppDomain) { if (checkSecurity) { +#if !MONO CodeAccessPermission.Demand(PermissionType.SecuritySerialization); +#endif } m_objects = new ObjectHolder[DefaultInitialSize]; m_selector = selector; diff --git a/external/referencesource/mscorlib/system/runtime/serialization/serializationinfo.cs b/external/referencesource/mscorlib/system/runtime/serialization/serializationinfo.cs index 0a530d39e9..75965dfa42 100644 --- a/external/referencesource/mscorlib/system/runtime/serialization/serializationinfo.cs +++ b/external/referencesource/mscorlib/system/runtime/serialization/serializationinfo.cs @@ -184,7 +184,9 @@ namespace System.Runtime.Serialization { if (!IsAssemblyNameAssignmentSafe(originalAssemblyName, newAssemblyName)) { +#if !MONO CodeAccessPermission.Demand(PermissionType.SecuritySerialization); +#endif } } diff --git a/external/referencesource/mscorlib/system/text/stringbuilder.cs b/external/referencesource/mscorlib/system/text/stringbuilder.cs index 4c7b67c310..a87a9a9cb3 100644 --- a/external/referencesource/mscorlib/system/text/stringbuilder.cs +++ b/external/referencesource/mscorlib/system/text/stringbuilder.cs @@ -16,6 +16,7 @@ namespace System.Text { using System.Text; using System.Runtime; using System.Runtime.Serialization; + using System.Runtime.InteropServices; using System; using System.Runtime.CompilerServices; using System.Runtime.Versioning; @@ -43,6 +44,7 @@ namespace System.Text { // [System.Runtime.InteropServices.ComVisible(true)] [Serializable] + [StructLayout (LayoutKind.Sequential)] public sealed class StringBuilder : ISerializable { // A StringBuilder is internally represented as a linked list of blocks each of which holds // a chunk of the string. It turns out string as a whole can also be represented as just a chunk, diff --git a/external/referencesource/mscorlib/system/text/unicodeencoding.cs b/external/referencesource/mscorlib/system/text/unicodeencoding.cs index f6830ec5a3..a5124cf0eb 100644 --- a/external/referencesource/mscorlib/system/text/unicodeencoding.cs +++ b/external/referencesource/mscorlib/system/text/unicodeencoding.cs @@ -29,6 +29,9 @@ namespace System.Text // Unicode version 2.0 character size in bytes public const int CharSize = 2; + // endianness-based bit pattern mask. + static readonly ulong highLowPatternMask = ((ulong) 0xd800d800d800d800 | (BitConverter.IsLittleEndian ? (ulong) 0x0400000004000000 : (ulong) 0x0000040000000400)); + public UnicodeEncoding() : this(false, true) @@ -533,11 +536,7 @@ namespace System.Text // If they happen to be high/low/high/low, we may as well continue. Check the next // bit to see if its set (low) or not (high) in the right pattern -#if BIGENDIAN - if (((0xfc00fc00fc00fc00 & *longChars) ^ 0xd800dc00d800dc00) != 0) -#else - if (((0xfc00fc00fc00fc00 & *longChars) ^ 0xdc00d800dc00d800) != 0) -#endif + if (((0xfc00fc00fc00fc00 & *longChars) ^ highLowPatternMask) != 0) { // Either there weren't 4 surrogates, or the 0x0400 bit was set when a high // was hoped for or the 0x0400 bit wasn't set where a low was hoped for. @@ -823,11 +822,7 @@ namespace System.Text // If they happen to be high/low/high/low, we may as well continue. Check the next // bit to see if its set (low) or not (high) in the right pattern -#if BIGENDIAN - if (((0xfc00fc00fc00fc00 & *longChars) ^ 0xd800dc00d800dc00) != 0) -#else - if (((0xfc00fc00fc00fc00 & *longChars) ^ 0xdc00d800dc00d800) != 0) -#endif + if (((0xfc00fc00fc00fc00 & *longChars) ^ highLowPatternMask) != 0) { // Either there weren't 4 surrogates, or the 0x0400 bit was set when a high // was hoped for or the 0x0400 bit wasn't set where a low was hoped for. @@ -1228,11 +1223,7 @@ namespace System.Text // If they happen to be high/low/high/low, we may as well continue. Check the next // bit to see if its set (low) or not (high) in the right pattern -#if BIGENDIAN - if (((0xfc00fc00fc00fc00 & *longBytes) ^ 0xd800dc00d800dc00) != 0) -#else - if (((0xfc00fc00fc00fc00 & *longBytes) ^ 0xdc00d800dc00d800) != 0) -#endif + if (((0xfc00fc00fc00fc00 & *longBytes) ^ highLowPatternMask) != 0) { // Either there weren't 4 surrogates, or the 0x0400 bit was set when a high // was hoped for or the 0x0400 bit wasn't set where a low was hoped for. @@ -1560,11 +1551,7 @@ namespace System.Text // If they happen to be high/low/high/low, we may as well continue. Check the next // bit to see if its set (low) or not (high) in the right pattern -#if BIGENDIAN - if (((0xfc00fc00fc00fc00 & *longBytes) ^ 0xd800dc00d800dc00) != 0) -#else - if (((0xfc00fc00fc00fc00 & *longBytes) ^ 0xdc00d800dc00d800) != 0) -#endif + if (((0xfc00fc00fc00fc00 & *longBytes) ^ highLowPatternMask) != 0) { // Either there weren't 4 surrogates, or the 0x0400 bit was set when a high // was hoped for or the 0x0400 bit wasn't set where a low was hoped for. diff --git a/external/referencesource/mscorlib/system/threading/threadpool.cs b/external/referencesource/mscorlib/system/threading/threadpool.cs index f299f9be5f..e9d047441c 100644 --- a/external/referencesource/mscorlib/system/threading/threadpool.cs +++ b/external/referencesource/mscorlib/system/threading/threadpool.cs @@ -62,122 +62,6 @@ namespace System.Threading [CLSCompliant(false)] [System.Runtime.InteropServices.ComVisible(true)] unsafe public delegate void IOCompletionCallback(uint errorCode, uint numBytes, NativeOverlapped* pOVERLAP); - - - [System.Runtime.InteropServices.ComVisible(true)] -#if FEATURE_REMOTING - public sealed class RegisteredWaitHandle : MarshalByRefObject -#else // FEATURE_REMOTING - public sealed class RegisteredWaitHandle -#endif // FEATURE_REMOTING - { - // Microsoft ThreadPool - private Microsoft.RegisteredWaitHandleSafe internalRegisteredWait; - - // Mono ThreadPool - private WaitHandle _waitObject; - private WaitOrTimerCallback _callback; - private object _state; - private WaitHandle _finalEvent; - private ManualResetEvent _cancelEvent; - private TimeSpan _timeout; - private int _callsInProcess; - private bool _executeOnlyOnce; - private bool _unregistered; - - internal RegisteredWaitHandle() - { - Contract.Assert (Microsoft.ThreadPool.UseMicrosoftThreadPool); - internalRegisteredWait = new Microsoft.RegisteredWaitHandleSafe(); - } - - internal RegisteredWaitHandle (WaitHandle waitObject, WaitOrTimerCallback callback, object state, TimeSpan timeout, bool executeOnlyOnce) - { - Contract.Assert (!Microsoft.ThreadPool.UseMicrosoftThreadPool); - _waitObject = waitObject; - _callback = callback; - _state = state; - _timeout = timeout; - _executeOnlyOnce = executeOnlyOnce; - _finalEvent = null; - _cancelEvent = new ManualResetEvent (false); - _callsInProcess = 0; - _unregistered = false; - } - - internal void SetHandle(IntPtr handle) - { - Contract.Assert (Microsoft.ThreadPool.UseMicrosoftThreadPool); - internalRegisteredWait.SetHandle(handle); - } - - [System.Security.SecurityCritical] // auto-generated - internal void SetWaitObject(WaitHandle waitObject) - { - Contract.Assert (Microsoft.ThreadPool.UseMicrosoftThreadPool); - internalRegisteredWait.SetWaitObject(waitObject); - } - - internal void Wait (object state) - { - Contract.Assert (!Microsoft.ThreadPool.UseMicrosoftThreadPool); - - try { - WaitHandle[] waits = new WaitHandle[] {_waitObject, _cancelEvent}; - do { - int signal = WaitHandle.WaitAny (waits, _timeout, false); - if (!_unregistered) { - lock (this) { _callsInProcess++; } - ThreadPool.QueueUserWorkItem (new WaitCallback (DoCallBack), (signal == WaitHandle.WaitTimeout)); - } - } while (!_unregistered && !_executeOnlyOnce); - } catch { - } - - lock (this) { - _unregistered = true; - if (_callsInProcess == 0 && _finalEvent != null) - NativeEventCalls.SetEvent_internal (_finalEvent.Handle); - } - } - - private void DoCallBack (object timedOut) - { - Contract.Assert (!Microsoft.ThreadPool.UseMicrosoftThreadPool); - - if (_callback != null) { - try { - _callback (_state, (bool)timedOut); - } catch { - } - } - - lock (this) { - _callsInProcess--; - if (_unregistered && _callsInProcess == 0 && _finalEvent != null) - NativeEventCalls.SetEvent_internal (_finalEvent.Handle); - } - } - - [System.Security.SecuritySafeCritical] // auto-generated - [System.Runtime.InteropServices.ComVisible(true)] - // This is the only public method on this class - public bool Unregister(WaitHandle waitObject) - { - if (Microsoft.ThreadPool.UseMicrosoftThreadPool) { - return internalRegisteredWait.Unregister(waitObject); - } else { - lock (this) { - if (_unregistered) - return false; - _finalEvent = waitObject; - _unregistered = true; - _cancelEvent.Set(); - return true; - } - } - } - } } namespace System.Threading.Microsoft @@ -1089,6 +973,7 @@ namespace System.Threading.Microsoft } } +#if !MONO internal sealed class RegisteredWaitHandleSafe : CriticalFinalizerObject { private static IntPtr InvalidHandle @@ -1267,6 +1152,42 @@ namespace System.Threading.Microsoft private static extern bool UnregisterWaitNative(IntPtr handle, SafeHandle waitObject); } + [System.Runtime.InteropServices.ComVisible(true)] +#if FEATURE_REMOTING + public sealed class RegisteredWaitHandle : MarshalByRefObject { +#else // FEATURE_REMOTING + public sealed class RegisteredWaitHandle { +#endif // FEATURE_REMOTING + private RegisteredWaitHandleSafe internalRegisteredWait; + + internal RegisteredWaitHandle() + { + internalRegisteredWait = new RegisteredWaitHandleSafe(); + } + + internal void SetHandle(IntPtr handle) + { + internalRegisteredWait.SetHandle(handle); + } + + [System.Security.SecurityCritical] // auto-generated + internal void SetWaitObject(WaitHandle waitObject) + { + internalRegisteredWait.SetWaitObject(waitObject); + } + + [System.Security.SecuritySafeCritical] // auto-generated + [System.Runtime.InteropServices.ComVisible(true)] + // This is the only public method on this class + public bool Unregister( + WaitHandle waitObject // object to be notified when all callbacks to delegates have completed + ) + { + return internalRegisteredWait.Unregister(waitObject); + } + } +#endif // !MONO + // // This type is necessary because VS 2010's debugger looks for a method named _ThreadPoolWaitCallbacck.PerformWaitCallback // on the stack to determine if a thread is a ThreadPool thread or not. We have a better way to do this for .NET 4.5, but @@ -1540,6 +1461,7 @@ namespace System.Threading.Microsoft bool compressStack ) { +#if !MONO #if FEATURE_REMOTING if (RemotingServices.IsTransparentProxy(waitObject)) throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_WaitOnTransparentProxy")); @@ -1569,6 +1491,19 @@ namespace System.Threading.Microsoft throw new ArgumentNullException("WaitOrTimerCallback"); } return registeredWaitHandle; +#else + if (waitObject == null) + throw new ArgumentNullException ("waitObject"); + if (callBack == null) + throw new ArgumentNullException ("callBack"); + if (millisecondsTimeOutInterval != Timeout.UnsignedInfinite && millisecondsTimeOutInterval > Int32.MaxValue) + throw new NotSupportedException ("Timeout is too big. Maximum is Int32.MaxValue"); + + RegisteredWaitHandle waiter = new RegisteredWaitHandle (waitObject, callBack, state, new TimeSpan (0, 0, 0, 0, (int) millisecondsTimeOutInterval), executeOnlyOnce); + QueueUserWorkItem (new WaitCallback (waiter.Wait), null); + + return waiter; +#endif } @@ -1586,7 +1521,7 @@ namespace System.Threading.Microsoft throw new ArgumentOutOfRangeException("millisecondsTimeOutInterval", Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1")); Contract.EndContractBlock(); StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; - return RegisterWaitForSingleObject(waitObject,callBack,state,(UInt32)millisecondsTimeOutInterval,executeOnlyOnce,ref stackMark,true); + return RegisterWaitForSingleObject(waitObject,callBack,state,millisecondsTimeOutInterval == Timeout.Infinite ? Timeout.UnsignedInfinite : (UInt32)millisecondsTimeOutInterval,executeOnlyOnce,ref stackMark,true); } [System.Security.SecurityCritical] // auto-generated_required @@ -1603,7 +1538,7 @@ namespace System.Threading.Microsoft throw new ArgumentOutOfRangeException("millisecondsTimeOutInterval", Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1")); Contract.EndContractBlock(); StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; - return RegisterWaitForSingleObject(waitObject,callBack,state,(UInt32)millisecondsTimeOutInterval,executeOnlyOnce,ref stackMark,false); + return RegisterWaitForSingleObject(waitObject,callBack,state,millisecondsTimeOutInterval == Timeout.Infinite ? Timeout.UnsignedInfinite : (UInt32)millisecondsTimeOutInterval,executeOnlyOnce,ref stackMark,false); } [System.Security.SecuritySafeCritical] // auto-generated @@ -1620,7 +1555,7 @@ namespace System.Threading.Microsoft throw new ArgumentOutOfRangeException("millisecondsTimeOutInterval", Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1")); Contract.EndContractBlock(); StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; - return RegisterWaitForSingleObject(waitObject,callBack,state,(UInt32)millisecondsTimeOutInterval,executeOnlyOnce,ref stackMark,true); + return RegisterWaitForSingleObject(waitObject,callBack,state,millisecondsTimeOutInterval == Timeout.Infinite ? Timeout.UnsignedInfinite : (UInt32)millisecondsTimeOutInterval,executeOnlyOnce,ref stackMark,true); } [System.Security.SecurityCritical] // auto-generated_required @@ -1637,7 +1572,7 @@ namespace System.Threading.Microsoft throw new ArgumentOutOfRangeException("millisecondsTimeOutInterval", Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1")); Contract.EndContractBlock(); StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; - return RegisterWaitForSingleObject(waitObject,callBack,state,(UInt32)millisecondsTimeOutInterval,executeOnlyOnce,ref stackMark,false); + return RegisterWaitForSingleObject(waitObject,callBack,state,millisecondsTimeOutInterval == Timeout.Infinite ? Timeout.UnsignedInfinite : (UInt32)millisecondsTimeOutInterval,executeOnlyOnce,ref stackMark,false); } [System.Security.SecuritySafeCritical] // auto-generated diff --git a/external/referencesource/mscorlib/system/type.cs b/external/referencesource/mscorlib/system/type.cs index 38d9d6abff..10a135f1ba 100644 --- a/external/referencesource/mscorlib/system/type.cs +++ b/external/referencesource/mscorlib/system/type.cs @@ -39,7 +39,7 @@ namespace System { #if CONTRACTS_FULL [ContractClass(typeof(TypeContracts))] #endif - public abstract class Type : MemberInfo, _Type, IReflect + public abstract partial class Type : MemberInfo, _Type, IReflect { // // System.Type is appdomain agile type. Appdomain agile types cannot have precise static constructors. Make @@ -94,7 +94,7 @@ namespace System { { return base.GetType(); } - +#if !MONO [MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable public static Type GetType(String typeName, bool throwOnError, bool ignoreCase) { StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; @@ -106,7 +106,7 @@ namespace System { StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; Type t = RuntimeType.GetType(typeName, throwOnError, false, false, ref stackMark); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage) && t != null) { FrameworkEventSource.Log.TypeGetType(t.GetFullNameForEtw()); @@ -120,7 +120,7 @@ namespace System { StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; Type t = RuntimeType.GetType(typeName, false, false, false, ref stackMark); -#if !FEATURE_CORECLR +#if !FEATURE_CORECLR && !MONO if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage) && t != null) { FrameworkEventSource.Log.TypeGetType(t.GetFullNameForEtw()); @@ -129,7 +129,7 @@ namespace System { return t; } - +#endif #if !FEATURE_CORECLR [MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable public static Type GetType( @@ -164,21 +164,21 @@ namespace System { return TypeNameParser.GetType(typeName, assemblyResolver, typeResolver, throwOnError, ignoreCase, ref stackMark); } #endif //!FEATURE_CORECLR - +#if !MONO [MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable public static Type ReflectionOnlyGetType(String typeName, bool throwIfNotFound, bool ignoreCase) { StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; return RuntimeType.GetType(typeName, throwIfNotFound, ignoreCase, true /*reflectionOnly*/, ref stackMark); } - +#endif public virtual Type MakePointerType() { throw new NotSupportedException(); } public virtual StructLayoutAttribute StructLayoutAttribute { get { throw new NotSupportedException(); } } public virtual Type MakeByRefType() { throw new NotSupportedException(); } public virtual Type MakeArrayType() { throw new NotSupportedException(); } public virtual Type MakeArrayType(int rank) { throw new NotSupportedException(); } -#if FEATURE_COMINTEROP +#if FEATURE_COMINTEROP || MONO_COM //////////////////////////////////////////////////////////////////////////////// // This will return a class based upon the progID. This is provided for // COM classic support. Program ID's are not used in COM+ because they @@ -341,11 +341,18 @@ namespace System { return InvokeMember(name,invokeAttr,binder,target,args,null,null,null); } - +#if MONO + // Workaround for JIT bug with bad VTable lookup + // + // MemberInfo mi = typeof (System.DBNull); + // System.Console.WriteLine (mi.Module); + // + public override abstract Module Module { get; } +#else // Module Property associated with a class. // _Type.Module public new abstract Module Module { get; } - +#endif // Assembly Property associated with a class. public abstract Assembly Assembly { [Pure] @@ -377,7 +384,7 @@ namespace System { return new RuntimeTypeHandle((RuntimeType)o.GetType()); } - +#if !MONO // Given a class handle, this will return the class for that handle. [System.Security.SecurityCritical] [ResourceExposure(ResourceScope.None)] @@ -389,7 +396,7 @@ namespace System { [ResourceExposure(ResourceScope.None)] [MethodImpl(MethodImplOptions.InternalCall)] public static extern Type GetTypeFromHandle(RuntimeTypeHandle handle); - +#endif // Return the fully qualified name. The name does contain the namespace. public abstract String FullName { @@ -1008,10 +1015,13 @@ namespace System { [Pure] get { +#if !MONO + // .NET has unmanaged version of exactly same managed + // code bellow RuntimeType rt = this as RuntimeType; if (rt != null) return RuntimeTypeHandle.IsVisible(rt); - +#endif if (IsGenericParameter) return true; @@ -1284,7 +1294,7 @@ namespace System { get {return IsCOMObjectImpl();} } -#if FEATURE_COMINTEROP +#if FEATURE_COMINTEROP || MONO_COM internal bool IsWindowsRuntimeObject { [Pure] get { return IsWindowsRuntimeObjectImpl(); } @@ -1351,7 +1361,7 @@ namespace System { // Protected routine to determine if this class represents a COM object abstract protected bool IsCOMObjectImpl(); -#if FEATURE_COMINTEROP +#if FEATURE_COMINTEROP || MONO_COM // Protected routine to determine if this class represents a Windows Runtime object virtual internal bool IsWindowsRuntimeObjectImpl() { throw new NotImplementedException(); @@ -1854,6 +1864,17 @@ namespace System { return (Object.ReferenceEquals(this.UnderlyingSystemType, o.UnderlyingSystemType)); } +#if MONO + public static bool operator == (Type left, Type right) + { + return object.ReferenceEquals (left, right); + } + + public static bool operator != (Type left, Type right) + { + return !object.ReferenceEquals (left, right); + } +#else #if !FEATURE_CORECLR [System.Security.SecuritySafeCritical] [Pure] @@ -1867,6 +1888,7 @@ namespace System { [MethodImplAttribute(MethodImplOptions.InternalCall)] public static extern bool operator !=(Type left, Type right); #endif // !FEATURE_CORECLR +#endif #if !FEATURE_CORECLR [TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] diff --git a/external/referencesource/mscorlib/system/typedreference.cs b/external/referencesource/mscorlib/system/typedreference.cs index a20f71a387..e8191ede61 100644 --- a/external/referencesource/mscorlib/system/typedreference.cs +++ b/external/referencesource/mscorlib/system/typedreference.cs @@ -20,6 +20,9 @@ namespace System { [System.Runtime.InteropServices.ComVisible(true)] public struct TypedReference { +#if MONO + RuntimeTypeHandle type; +#endif private IntPtr Value; private IntPtr Type; @@ -61,6 +64,9 @@ namespace System { targetType = fieldType; } +#if MONO + return MakeTypedReferenceInternal (target, flds); +#else TypedReference result = new TypedReference (); // reference to TypedReference is banned, so have to pass result as pointer @@ -69,14 +75,18 @@ namespace System { InternalMakeTypedReference(&result, target, fields, targetType); } return result; +#endif } [System.Security.SecurityCritical] // auto-generated [ResourceExposure(ResourceScope.None)] [MethodImplAttribute(MethodImplOptions.InternalCall)] +#if MONO + extern static TypedReference MakeTypedReferenceInternal (object target, FieldInfo[] fields); +#else // reference to TypedReference is banned, so have to pass result as pointer private unsafe static extern void InternalMakeTypedReference(void* result, Object target, IntPtr[] flds, RuntimeType lastFieldType); - +#endif public override int GetHashCode() { if (Type == IntPtr.Zero) @@ -124,7 +134,11 @@ namespace System { [CLSCompliant(false)] public unsafe static void SetTypedReference(TypedReference target, Object value) { +#if MONO + throw new NotImplementedException ("SetTypedReference"); +#else InternalSetTypedReference(&target, value); +#endif } [System.Security.SecurityCritical] // auto-generated diff --git a/libgc/aclocal.m4 b/libgc/aclocal.m4 index 7e11aa8638..da7bbe754a 100644 --- a/libgc/aclocal.m4 +++ b/libgc/aclocal.m4 @@ -593,7 +593,8 @@ to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi -fi]) +fi +]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further diff --git a/libgc/config.guess b/libgc/config.guess index b79252d6b1..1f5c50c0d1 100755 --- a/libgc/config.guess +++ b/libgc/config.guess @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2013 Free Software Foundation, Inc. +# Copyright 1992-2014 Free Software Foundation, Inc. -timestamp='2013-06-10' +timestamp='2014-03-23' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -50,7 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2013 Free Software Foundation, Inc. +Copyright 1992-2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -149,7 +149,7 @@ Linux|GNU|GNU/*) LIBC=gnu #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac @@ -826,7 +826,7 @@ EOF *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; - i*:MSYS*:*) + *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) @@ -969,10 +969,10 @@ EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; - or1k:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + openrisc*:Linux:*:*) + echo or1k-unknown-linux-${LIBC} exit ;; - or32:Linux:*:*) + or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) @@ -1260,16 +1260,26 @@ EOF if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac + if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; @@ -1361,154 +1371,6 @@ EOF exit ;; esac -eval $set_cc_for_build -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - c34*) - echo c34-convex-bsd - exit ;; - c38*) - echo c38-convex-bsd - exit ;; - c4*) - echo c4-convex-bsd - exit ;; - esac -fi - cat >&2 <." version="\ GNU config.sub ($timestamp) -Copyright 1992-2013 Free Software Foundation, Inc. +Copyright 1992-2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -265,6 +265,7 @@ case $basic_machine in | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ + | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ @@ -282,8 +283,10 @@ case $basic_machine in | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ @@ -295,11 +298,11 @@ case $basic_machine in | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ - | open8 \ - | or1k | or32 \ + | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ + | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ @@ -324,7 +327,7 @@ case $basic_machine in c6x) basic_machine=tic6x-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; @@ -381,6 +384,7 @@ case $basic_machine in | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ + | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ @@ -400,8 +404,10 @@ case $basic_machine in | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ @@ -413,6 +419,7 @@ case $basic_machine in | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ + | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ @@ -822,6 +829,10 @@ case $basic_machine in basic_machine=powerpc-unknown os=-morphos ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; msdos) basic_machine=i386-pc os=-msdos @@ -1367,14 +1378,14 @@ case $os in | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1592,9 +1603,6 @@ case $basic_machine in mips*-*) os=-elf ;; - or1k-*) - os=-elf - ;; or32-*) os=-coff ;; diff --git a/libgc/configure.REMOVED.git-id b/libgc/configure.REMOVED.git-id index 3a004f6aeb..0e440265b3 100644 --- a/libgc/configure.REMOVED.git-id +++ b/libgc/configure.REMOVED.git-id @@ -1 +1 @@ -2f526024d2da61894c7ed648a1207722cbb90688 \ No newline at end of file +822f530520cc4202fc04a4668b77b1de1215fdff \ No newline at end of file diff --git a/libgc/ltmain.sh.REMOVED.git-id b/libgc/ltmain.sh.REMOVED.git-id index a456f5251e..f6476aa89a 100644 --- a/libgc/ltmain.sh.REMOVED.git-id +++ b/libgc/ltmain.sh.REMOVED.git-id @@ -1 +1 @@ -a356acafa4548959e97355d1e8044b7201661754 \ No newline at end of file +bffda54187af4d101157c43c6c6d26dd735e51d3 \ No newline at end of file diff --git a/ltmain.sh.REMOVED.git-id b/ltmain.sh.REMOVED.git-id index a456f5251e..f6476aa89a 100644 --- a/ltmain.sh.REMOVED.git-id +++ b/ltmain.sh.REMOVED.git-id @@ -1 +1 @@ -a356acafa4548959e97355d1e8044b7201661754 \ No newline at end of file +bffda54187af4d101157c43c6c6d26dd735e51d3 \ No newline at end of file diff --git a/mcs/Makefile b/mcs/Makefile index cbcfdcc3e0..b94a7c82d6 100644 --- a/mcs/Makefile +++ b/mcs/Makefile @@ -12,7 +12,7 @@ monotouch_runtime_SUBDIRS := build class xammac_SUBDIRS := build class mobile_SUBDIRS := build class mobile_static_SUBDIRS := build class -net_4_0_SUBDIRS := build class +binary_reference_assemblies_SUBDIRS := build class net_4_5_SUBDIRS := build mcs class nunit24 ilasm tools tests errors docs xbuild_12_SUBDIRS := build class tools/xbuild xbuild_14_SUBDIRS := build class tools/xbuild @@ -30,7 +30,7 @@ dir-check: # fun specialty targets -PROFILES = net_4_5 net_4_0 xbuild_12 xbuild_14 +PROFILES = net_4_5 binary_reference_assemblies xbuild_12 xbuild_14 .PHONY: all-profiles $(STD_TARGETS:=-profiles) all-profiles $(STD_TARGETS:=-profiles): %-profiles: profiles-do--% @@ -51,7 +51,7 @@ profiles-do--run-test: _boot_ = all clean install $(_boot_:%=profile-do--xbuild_14--%): profile-do--xbuild_14--%: profile-do--net_4_5--% $(_boot_:%=profile-do--xbuild_12--%): profile-do--xbuild_12--%: profile-do--net_4_5--% -$(_boot_:%=profile-do--net_4_0--%): profile-do--net_4_0--%: profile-do--build--% +$(_boot_:%=profile-do--binary_reference_assemblies--%): profile-do--binary_reference_assemblies--%: profile-do--build--% $(_boot_:%=profile-do--net_4_5--%): profile-do--net_4_5--%: profile-do--build--% $(_boot_:%=profile-do--monodroid--%): profile-do--monodroid--%: profile-do--build--% $(_boot_:%=profile-do--monotouch--%): profile-do--monotouch--%: profile-do--build--% diff --git a/mcs/build/Makefile b/mcs/build/Makefile index 8ca1e7c7fa..e6d2d0a68a 100644 --- a/mcs/build/Makefile +++ b/mcs/build/Makefile @@ -18,7 +18,7 @@ PLATFORMS = darwin linux win32 PROFILES = \ basic \ build \ - net_4_0 \ + binary_reference_assemblies \ net_4_5 \ xbuild_12 \ xbuild_14 diff --git a/mcs/build/common/Consts.cs b/mcs/build/common/Consts.cs index d2aecf4c57..c63ff16cc1 100644 --- a/mcs/build/common/Consts.cs +++ b/mcs/build/common/Consts.cs @@ -34,7 +34,7 @@ static class Consts // Use these assembly version constants to make code more maintainable. // - public const string MonoVersion = "4.0.0.0"; + public const string MonoVersion = "4.0.1.0"; public const string MonoCompany = "Mono development team"; public const string MonoProduct = "Mono Common Language Infrastructure"; public const string MonoCopyright = "(c) Various Mono authors"; diff --git a/mcs/build/profiles/binary_reference_assemblies.make b/mcs/build/profiles/binary_reference_assemblies.make new file mode 100644 index 0000000000..d50e674b98 --- /dev/null +++ b/mcs/build/profiles/binary_reference_assemblies.make @@ -0,0 +1,7 @@ +# -*- makefile -*- + +profile-check: + @: + +NO_BUILD = yes +NO_TEST = yes diff --git a/mcs/build/profiles/net_4_0.make b/mcs/build/profiles/net_4_0.make deleted file mode 100644 index 83e22c4dcb..0000000000 --- a/mcs/build/profiles/net_4_0.make +++ /dev/null @@ -1,12 +0,0 @@ -# -*- makefile -*- - -profile-check: - @: - -FRAMEWORK_VERSION = 4.0 -XBUILD_VERSION = 4.0 - -LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION) - -NO_BUILD = yes -NO_TEST = yes diff --git a/mcs/class/Makefile b/mcs/class/Makefile index 8200c5d5e5..2eb6c03954 100644 --- a/mcs/class/Makefile +++ b/mcs/class/Makefile @@ -217,7 +217,7 @@ monotouch_runtime_SUBDIRS := $(monotouch_runtime_dirs) mobile_static_SUBDIRS := $(mobile_static_dirs) mobile_SUBDIRS := $(mobile_dynamic_dirs) xammac_SUBDIRS := $(xammac_dirs) -net_4_0_SUBDIRS := reference-assemblies +binary_reference_assemblies_SUBDIRS := reference-assemblies net_4_5_SUBDIRS := $(net_4_5_dirs) $(xbuild_4_0_dirs) aot-compiler xbuild_12_SUBDIRS := $(xbuild_4_0_dirs) xbuild_14_SUBDIRS := $(xbuild_4_0_dirs) diff --git a/mcs/class/System.Net.Http/System.Net.Http.Headers/HttpHeaders.cs b/mcs/class/System.Net.Http/System.Net.Http.Headers/HttpHeaders.cs index d8a60be17a..a114aa0ffe 100644 --- a/mcs/class/System.Net.Http/System.Net.Http.Headers/HttpHeaders.cs +++ b/mcs/class/System.Net.Http/System.Net.Http.Headers/HttpHeaders.cs @@ -350,10 +350,17 @@ namespace System.Net.Http.Headers sb.Append (entry.Key); sb.Append (": "); + string separator = ","; + HeaderInfo headerInfo; + if (known_headers.TryGetValue (entry.Key, out headerInfo) && headerInfo.AllowsMany) + separator = headerInfo.Separator; + bool first = true; foreach (var v in entry.Value) { - if (!first) - sb.Append (", "); + if (!first) { + sb.Append (separator); + sb.Append (" "); + } sb.Append (v); first = false; diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/HttpHeadersTest.cs b/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/HttpHeadersTest.cs index cae4a65c82..9839d46734 100644 --- a/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/HttpHeadersTest.cs +++ b/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/HttpHeadersTest.cs @@ -147,5 +147,13 @@ namespace MonoTests.System.Net.Http.Headers Assert.AreEqual ("aa: v, v\r\nx: v\r\n", headers.ToString ()); } + + [Test] + public void ToString_DifferentSeparator () + { + headers.Add ("User-Agent", "MyApp/1.0.0.0 (iOS; 7.1.2; fr_FR) (Apple; iPhone3,1)"); + + Assert.AreEqual ("User-Agent: MyApp/1.0.0.0 (iOS; 7.1.2; fr_FR) (Apple; iPhone3,1)\r\n", headers.ToString ()); + } } } diff --git a/mcs/class/corlib/System.Runtime.InteropServices/DefaultDllImportSearchPathsAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/DefaultDllImportSearchPathsAttribute.cs new file mode 100644 index 0000000000..863a1f0fed --- /dev/null +++ b/mcs/class/corlib/System.Runtime.InteropServices/DefaultDllImportSearchPathsAttribute.cs @@ -0,0 +1,42 @@ +// +// DefaultDllImportSearchPathsAttribute.cs +// +// Authors: +// Marek Safar +// +// Copyright (C) 2015 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.Runtime.InteropServices +{ + [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Method, AllowMultiple = false)] + [System.Runtime.InteropServices.ComVisible (false)] + public sealed class DefaultDllImportSearchPathsAttribute : Attribute + { + public DefaultDllImportSearchPathsAttribute(DllImportSearchPath paths) + { + Paths = paths; + } + + public DllImportSearchPath Paths { get; private set; } + } +} \ No newline at end of file diff --git a/mcs/class/corlib/System.Runtime.InteropServices/DllImportSearchPath.cs b/mcs/class/corlib/System.Runtime.InteropServices/DllImportSearchPath.cs new file mode 100644 index 0000000000..9bfa505ceb --- /dev/null +++ b/mcs/class/corlib/System.Runtime.InteropServices/DllImportSearchPath.cs @@ -0,0 +1,42 @@ +// +// DllImportSearchPath.cs +// +// Authors: +// Marek Safar +// +// Copyright (C) 2015 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.Runtime.InteropServices +{ + [Flags] + public enum DllImportSearchPath + { + UseDllDirectoryForDependencies = 0x100, + ApplicationDirectory = 0x200, + UserDirectories = 0x400, + System32 = 0x800, + SafeDirectories = 0x1000, + AssemblyDirectory = 0x2, + LegacyBehavior = 0x0 + } +} \ No newline at end of file diff --git a/mcs/class/corlib/System/TimeZoneInfo.cs b/mcs/class/corlib/System/TimeZoneInfo.cs index 5562b8bf49..e6765bcb71 100644 --- a/mcs/class/corlib/System/TimeZoneInfo.cs +++ b/mcs/class/corlib/System/TimeZoneInfo.cs @@ -229,6 +229,18 @@ namespace System } #endif + private static bool TryAddTicks (DateTime date, long ticks, out DateTime result, DateTimeKind kind = DateTimeKind.Unspecified) + { + var resultTicks = date.Ticks + ticks; + if (resultTicks < DateTime.MinValue.Ticks || resultTicks > DateTime.MaxValue.Ticks) { + result = default (DateTime); + return false; + } + + result = new DateTime (resultTicks, kind); + return true; + } + public static void ClearCachedData () { local = null; @@ -276,17 +288,13 @@ namespace System { if (destinationTimeZone == null) throw new ArgumentNullException("destinationTimeZone"); - + var utcDateTime = dateTimeOffset.UtcDateTime; - AdjustmentRule rule = destinationTimeZone.GetApplicableRule (utcDateTime); - - if (rule != null && destinationTimeZone.IsDaylightSavingTime(utcDateTime)) { - var offset = destinationTimeZone.BaseUtcOffset + rule.DaylightDelta; - return new DateTimeOffset(DateTime.SpecifyKind(utcDateTime, DateTimeKind.Unspecified) + offset, offset); - } - else { - return new DateTimeOffset(DateTime.SpecifyKind(utcDateTime, DateTimeKind.Unspecified) + destinationTimeZone.BaseUtcOffset, destinationTimeZone.BaseUtcOffset); - } + + bool isDst; + var utcOffset = destinationTimeZone.GetUtcOffset(utcDateTime, out isDst); + + return new DateTimeOffset(DateTime.SpecifyKind(utcDateTime, DateTimeKind.Unspecified) + utcOffset, utcOffset); } public static DateTime ConvertTimeBySystemTimeZoneId (DateTime dateTime, string destinationTimeZoneId) @@ -311,19 +319,16 @@ namespace System if (this == TimeZoneInfo.Utc) return DateTime.SpecifyKind (dateTime, DateTimeKind.Utc); - - //FIXME: do not rely on DateTime implementation ! - if (this == TimeZoneInfo.Local) - { - return dateTime.ToLocalTime (); - } + var utcOffset = GetUtcOffset (dateTime); - AdjustmentRule rule = GetApplicableRule (dateTime); - if (rule != null && IsDaylightSavingTime (DateTime.SpecifyKind (dateTime, DateTimeKind.Utc))) - return DateTime.SpecifyKind (dateTime + BaseUtcOffset + rule.DaylightDelta , DateTimeKind.Unspecified); - else - return DateTime.SpecifyKind (dateTime + BaseUtcOffset, DateTimeKind.Unspecified); + var kind = (this == TimeZoneInfo.Local)? DateTimeKind.Local : DateTimeKind.Unspecified; + + DateTime result; + if (!TryAddTicks (dateTime, utcOffset.Ticks, out result, kind)) + return DateTime.SpecifyKind (DateTime.MaxValue, kind); + + return result; } public static DateTime ConvertTimeFromUtc (DateTime dateTime, TimeZoneInfo destinationTimeZone) @@ -371,22 +376,14 @@ namespace System if (dateTime.Kind == DateTimeKind.Utc) return dateTime; - if (sourceTimeZone.IsAmbiguousTime (dateTime) || !sourceTimeZone.IsDaylightSavingTime (dateTime)) { - var ticks = dateTime.Ticks - sourceTimeZone.BaseUtcOffset.Ticks; - if (ticks < DateTime.MinValue.Ticks) - ticks = DateTime.MinValue.Ticks; - else if (ticks > DateTime.MaxValue.Ticks) - ticks = DateTime.MaxValue.Ticks; + bool isDst; + var utcOffset = sourceTimeZone.GetUtcOffset (dateTime, out isDst); - return new DateTime (ticks, DateTimeKind.Utc); - } - - AdjustmentRule rule = sourceTimeZone.GetApplicableRule (dateTime); - if (rule != null) - return DateTime.SpecifyKind (dateTime - sourceTimeZone.BaseUtcOffset - rule.DaylightDelta, DateTimeKind.Utc); - else - return DateTime.SpecifyKind (dateTime - sourceTimeZone.BaseUtcOffset, DateTimeKind.Utc); - + DateTime utcDateTime; + if (!TryAddTicks (dateTime, -utcOffset.Ticks, out utcDateTime, DateTimeKind.Utc)) + return DateTime.SpecifyKind (DateTime.MinValue, DateTimeKind.Utc); + + return utcDateTime; } static internal TimeSpan GetDateTimeNowUtcOffsetFromUtc(DateTime time, out Boolean isAmbiguousLocalDst) @@ -722,23 +719,22 @@ namespace System tz = TimeZoneInfo.Local; bool isTzDst; - var tzOffset = GetUtcOffset (dateTime, tz, out isTzDst); + var tzOffset = GetUtcOffsetHelper (dateTime, tz, out isTzDst); if (tz == this) { isDST = isTzDst; return tzOffset; } - var utcTicks = dateTime.Ticks - tzOffset.Ticks; - if (utcTicks < 0 || utcTicks > DateTime.MaxValue.Ticks) + DateTime utcDateTime; + if (!TryAddTicks (dateTime, -tzOffset.Ticks, out utcDateTime, DateTimeKind.Utc)) return BaseUtcOffset; - var utcDateTime = new DateTime (utcTicks, DateTimeKind.Utc); - - return GetUtcOffset (utcDateTime, this, out isDST); + return GetUtcOffsetHelper (utcDateTime, this, out isDST); } - private static TimeSpan GetUtcOffset (DateTime dateTime, TimeZoneInfo tz, out bool isDST) + // This is an helper method used by the method above, do not use this on its own. + private static TimeSpan GetUtcOffsetHelper (DateTime dateTime, TimeZoneInfo tz, out bool isDST) { if (dateTime.Kind == DateTimeKind.Local && tz != TimeZoneInfo.Local) throw new Exception (); @@ -762,20 +758,16 @@ namespace System return tz.BaseUtcOffset; } - var stdTicks = dateTime.Ticks - tz.BaseUtcOffset.Ticks; - if (stdTicks < 0 || stdTicks > DateTime.MaxValue.Ticks) + DateTime stdUtcDateTime; + if (!TryAddTicks (dateTime, -tz.BaseUtcOffset.Ticks, out stdUtcDateTime, DateTimeKind.Utc)) return tz.BaseUtcOffset; - var stdUtcDateTime = new DateTime (stdTicks, DateTimeKind.Utc); var tzRule = tz.GetApplicableRule (stdUtcDateTime); DateTime dstUtcDateTime = DateTime.MinValue; if (tzRule != null) { - var dstTicks = stdUtcDateTime.Ticks - tzRule.DaylightDelta.Ticks; - if (dstTicks < 0 || dstTicks > DateTime.MaxValue.Ticks) + if (!TryAddTicks (stdUtcDateTime, -tzRule.DaylightDelta.Ticks, out dstUtcDateTime, DateTimeKind.Utc)) return tz.BaseUtcOffset; - - dstUtcDateTime = new DateTime (dstTicks, DateTimeKind.Utc); } if (tzRule != null && tz.IsInDST (tzRule, stdUtcDateTime) && tz.IsInDST (tzRule, dstUtcDateTime)) { @@ -889,6 +881,23 @@ namespace System throw new NotImplementedException (); } + public bool IsInvalidTime (DateTime dateTime) + { + if (dateTime.Kind == DateTimeKind.Utc) + return false; + if (dateTime.Kind == DateTimeKind.Local && this != Local) + return false; + + AdjustmentRule rule = GetApplicableRule (dateTime); + if (rule != null) { + DateTime tpoint = TransitionPoint (rule.DaylightTransitionStart, dateTime.Year); + if (dateTime >= tpoint && dateTime < tpoint + rule.DaylightDelta) + return true; + } + + return false; + } + void IDeserializationCallback.OnDeserialization (object sender) { try { @@ -1019,10 +1028,13 @@ namespace System //Applicable rules are in standard time DateTime date = dateTime; - if (dateTime.Kind == DateTimeKind.Local && this != TimeZoneInfo.Local) - date = date.ToUniversalTime () + BaseUtcOffset; - else if (dateTime.Kind == DateTimeKind.Utc && this != TimeZoneInfo.Utc) - date = date + BaseUtcOffset; + if (dateTime.Kind == DateTimeKind.Local && this != TimeZoneInfo.Local) { + if (!TryAddTicks (date.ToUniversalTime (), BaseUtcOffset.Ticks, out date)) + return null; + } else if (dateTime.Kind == DateTimeKind.Utc && this != TimeZoneInfo.Utc) { + if (!TryAddTicks (date, BaseUtcOffset.Ticks, out date)) + return null; + } // get the date component of the datetime date = date.Date; @@ -1051,19 +1063,13 @@ namespace System DateTime date = dateTime; if (dateTime.Kind == DateTimeKind.Local && this != TimeZoneInfo.Local) { - var ticks = date.ToUniversalTime ().Ticks + BaseUtcOffset.Ticks; - if (ticks < DateTime.MinValue.Ticks || ticks > DateTime.MaxValue.Ticks) + if (!TryAddTicks (date.ToUniversalTime (), BaseUtcOffset.Ticks, out date, DateTimeKind.Utc)) return false; - - date = new DateTime (ticks, DateTimeKind.Utc); } if (dateTime.Kind != DateTimeKind.Utc) { - var ticks = date.Ticks - BaseUtcOffset.Ticks; - if (ticks < DateTime.MinValue.Ticks || ticks > DateTime.MaxValue.Ticks) + if (!TryAddTicks (date, -BaseUtcOffset.Ticks, out date, DateTimeKind.Utc)) return false; - - date = new DateTime (ticks, DateTimeKind.Utc); } for (var i = transitions.Count - 1; i >= 0; i--) { @@ -1199,6 +1205,14 @@ namespace System if (dst_end.Date == new DateTime (dst_end.Year, 1, 1) && dst_end.Year > dst_start.Year) dst_end -= new TimeSpan (24, 0, 0); + /* + * AdjustmentRule specifies a DST period that starts and ends within a year. + * When we have a DST period longer than a year, the generated AdjustmentRule may not be usable. + * Thus we fallback to the transitions. + */ + if (dst_start.AddYears (1) < dst_end) + storeTransition = true; + DateTime dateStart, dateEnd; if (dst_start.Month < 7) dateStart = new DateTime (dst_start.Year, 1, 1); @@ -1298,333 +1312,32 @@ namespace System } #region reference sources - // Shortcut for TimeZoneInfo.Local.GetUtcOffset - internal static TimeSpan GetLocalUtcOffset(DateTime dateTime, TimeZoneInfoOptions flags) - { - bool dst; - return Local.GetUtcOffset (dateTime, out dst); - } + // Shortcut for TimeZoneInfo.Local.GetUtcOffset + internal static TimeSpan GetLocalUtcOffset(DateTime dateTime, TimeZoneInfoOptions flags) + { + bool dst; + return Local.GetUtcOffset (dateTime, out dst); + } - internal TimeSpan GetUtcOffset(DateTime dateTime, TimeZoneInfoOptions flags) - { - bool dst; - return GetUtcOffset (dateTime, out dst); - } + internal TimeSpan GetUtcOffset(DateTime dateTime, TimeZoneInfoOptions flags) + { + bool dst; + return GetUtcOffset (dateTime, out dst); + } - // used by GetUtcOffsetFromUtc (DateTime.Now, DateTime.ToLocalTime) for max/min whole-day range checks - private static DateTime s_maxDateOnly = new DateTime(9999, 12, 31); - private static DateTime s_minDateOnly = new DateTime(1, 1, 2); + static internal TimeSpan GetUtcOffsetFromUtc (DateTime time, TimeZoneInfo zone, out Boolean isDaylightSavings, out Boolean isAmbiguousLocalDst) + { + isDaylightSavings = false; + isAmbiguousLocalDst = false; + TimeSpan baseOffset = zone.BaseUtcOffset; - static internal TimeSpan GetUtcOffsetFromUtc (DateTime time, TimeZoneInfo zone, out Boolean isDaylightSavings, out Boolean isAmbiguousLocalDst) - { - isDaylightSavings = false; - isAmbiguousLocalDst = false; - TimeSpan baseOffset = zone.BaseUtcOffset; - Int32 year; - AdjustmentRule rule; + if (zone.IsAmbiguousTime (time)) { + isAmbiguousLocalDst = true; + return baseOffset; + } - if (time > s_maxDateOnly) { - rule = zone.GetAdjustmentRuleForTime(DateTime.MaxValue); - year = 9999; - } - else if (time < s_minDateOnly) { - rule = zone.GetAdjustmentRuleForTime(DateTime.MinValue); - year = 1; - } - else { - DateTime targetTime = time + baseOffset; - year = time.Year; - rule = zone.GetAdjustmentRuleForTime(targetTime); - } - - if (rule != null) { - isDaylightSavings = GetIsDaylightSavingsFromUtc(time, year, zone.baseUtcOffset, rule, out isAmbiguousLocalDst); - baseOffset += (isDaylightSavings ? rule.DaylightDelta : TimeSpan.Zero /* */); - } - - return baseOffset; - } - - // assumes dateTime is in the current time zone's time - private AdjustmentRule GetAdjustmentRuleForTime(DateTime dateTime) { - if (adjustmentRules == null || adjustmentRules.Length == 0) { - return null; - } - -#if WINXP_AND_WIN2K3_SUPPORT - // On pre-Vista versions of Windows if you run "cmd /c date" or "cmd /c time" to update the system time - // the operating system doesn't pick up the correct time zone adjustment rule (it stays on the currently loaded rule). - // We need to use the OS API data in this scenario instead of the loaded adjustment rules from the registry for - // consistency. Otherwise DateTime.Now might not match the time displayed in the system tray. - if (!Environment.IsWindowsVistaOrAbove && s_cachedData.GetCorrespondingKind(this) == DateTimeKind.Local) { - return s_cachedData.GetOneYearLocalFromLocal(dateTime.Year).rule; - } -#endif - // Only check the whole-date portion of the dateTime - - // This is because the AdjustmentRule DateStart & DateEnd are stored as - // Date-only values {4/2/2006 - 10/28/2006} but actually represent the - // time span {4/2/2006@00:00:00.00000 - 10/28/2006@23:59:59.99999} - DateTime date = dateTime.Date; - - for (int i = 0; i < adjustmentRules.Length; i++) { - if (adjustmentRules[i].DateStart <= date && adjustmentRules[i].DateEnd >= date) { - return adjustmentRules[i]; - } - } - - return null; - } - - // - // GetIsDaylightSavingsFromUtc - - // - // Helper function that checks if a given dateTime is in Daylight Saving Time (DST) - // This function assumes the dateTime is in UTC and AdjustmentRule is in a different time zone - // - static private Boolean GetIsDaylightSavingsFromUtc(DateTime time, Int32 Year, TimeSpan utc, AdjustmentRule rule, out Boolean isAmbiguousLocalDst) { - isAmbiguousLocalDst = false; - - if (rule == null) { - return false; - } - - // Get the daylight changes for the year of the specified time. - TimeSpan offset = utc; /* */ - DaylightTime daylightTime = GetDaylightTime(Year, rule); - - // The start and end times represent the range of universal times that are in DST for that year. - // Within that there is an ambiguous hour, usually right at the end, but at the beginning in - // the unusual case of a negative daylight savings delta. - DateTime startTime = daylightTime.Start - offset; - DateTime endTime = daylightTime.End - offset - rule.DaylightDelta; /* */ - DateTime ambiguousStart; - DateTime ambiguousEnd; - if (daylightTime.Delta.Ticks > 0) { - ambiguousStart = endTime - daylightTime.Delta; - ambiguousEnd = endTime; - } else { - ambiguousStart = startTime; - ambiguousEnd = startTime - daylightTime.Delta; - } - - Boolean isDst = CheckIsDst(startTime, time, endTime); - - // See if the resulting local time becomes ambiguous. This must be captured here or the - // DateTime will not be able to round-trip back to UTC accurately. - if (isDst) { - isAmbiguousLocalDst = (time >= ambiguousStart && time < ambiguousEnd); - - if (!isAmbiguousLocalDst && ambiguousStart.Year != ambiguousEnd.Year) { - // there exists an extreme corner case where the start or end period is on a year boundary and - // because of this the comparison above might have been performed for a year-early or a year-later - // than it should have been. - DateTime ambiguousStartModified; - DateTime ambiguousEndModified; - try { - ambiguousStartModified = ambiguousStart.AddYears(1); - ambiguousEndModified = ambiguousEnd.AddYears(1); - isAmbiguousLocalDst = (time >= ambiguousStart && time < ambiguousEnd); - } - catch (ArgumentOutOfRangeException) {} - - if (!isAmbiguousLocalDst) { - try { - ambiguousStartModified = ambiguousStart.AddYears(-1); - ambiguousEndModified = ambiguousEnd.AddYears(-1); - isAmbiguousLocalDst = (time >= ambiguousStart && time < ambiguousEnd); - } - catch (ArgumentOutOfRangeException) {} - } - - } - } - - return isDst; - } - - - static private Boolean CheckIsDst(DateTime startTime, DateTime time, DateTime endTime) { - Boolean isDst; - - int startTimeYear = startTime.Year; - int endTimeYear = endTime.Year; - - if (startTimeYear != endTimeYear) { - endTime = endTime.AddYears(startTimeYear - endTimeYear); - } - - int timeYear = time.Year; - - if (startTimeYear != timeYear) { - time = time.AddYears(startTimeYear - timeYear); - } - - if (startTime > endTime) { - // In southern hemisphere, the daylight saving time starts later in the year, and ends in the beginning of next year. - // Note, the summer in the southern hemisphere begins late in the year. - isDst = (time < endTime || time >= startTime); - } - else { - // In northern hemisphere, the daylight saving time starts in the middle of the year. - isDst = (time >= startTime && time < endTime); - } - return isDst; - } - - // - // GetDaylightTime - - // - // Helper function that returns a DaylightTime from a year and AdjustmentRule - // - static private DaylightTime GetDaylightTime(Int32 year, AdjustmentRule rule) { - TimeSpan delta = rule.DaylightDelta; - DateTime startTime = TransitionTimeToDateTime(year, rule.DaylightTransitionStart); - DateTime endTime = TransitionTimeToDateTime(year, rule.DaylightTransitionEnd); - return new DaylightTime(startTime, endTime, delta); - } - - // - // TransitionTimeToDateTime - - // - // Helper function that converts a year and TransitionTime into a DateTime - // - static private DateTime TransitionTimeToDateTime(Int32 year, TransitionTime transitionTime) { - DateTime value; - DateTime timeOfDay = transitionTime.TimeOfDay; - - if (transitionTime.IsFixedDateRule) { - // create a DateTime from the passed in year and the properties on the transitionTime - - // if the day is out of range for the month then use the last day of the month - Int32 day = DateTime.DaysInMonth(year, transitionTime.Month); - - value = new DateTime(year, transitionTime.Month, (day < transitionTime.Day) ? day : transitionTime.Day, - timeOfDay.Hour, timeOfDay.Minute, timeOfDay.Second, timeOfDay.Millisecond); - } - else { - if (transitionTime.Week <= 4) { - // - // Get the (transitionTime.Week)th Sunday. - // - value = new DateTime(year, transitionTime.Month, 1, - timeOfDay.Hour, timeOfDay.Minute, timeOfDay.Second, timeOfDay.Millisecond); - - int dayOfWeek = (int)value.DayOfWeek; - int delta = (int)transitionTime.DayOfWeek - dayOfWeek; - if (delta < 0) { - delta += 7; - } - delta += 7 * (transitionTime.Week - 1); - - if (delta > 0) { - value = value.AddDays(delta); - } - } - else { - // - // If TransitionWeek is greater than 4, we will get the last week. - // - Int32 daysInMonth = DateTime.DaysInMonth(year, transitionTime.Month); - value = new DateTime(year, transitionTime.Month, daysInMonth, - timeOfDay.Hour, timeOfDay.Minute, timeOfDay.Second, timeOfDay.Millisecond); - - // This is the day of week for the last day of the month. - int dayOfWeek = (int)value.DayOfWeek; - int delta = dayOfWeek - (int)transitionTime.DayOfWeek; - if (delta < 0) { - delta += 7; - } - - if (delta > 0) { - value = value.AddDays(-delta); - } - } - } - return value; - } - - // - // IsInvalidTime - - // - // returns true when dateTime falls into a "hole in time". - // - public Boolean IsInvalidTime(DateTime dateTime) { - Boolean isInvalid = false; - - if ( (dateTime.Kind == DateTimeKind.Unspecified) - || (dateTime.Kind == DateTimeKind.Local && this == Local) ) { - - // only check Unspecified and (Local when this TimeZoneInfo instance is Local) - AdjustmentRule rule = GetAdjustmentRuleForTime(dateTime); - - - if (rule != null) { - DaylightTime daylightTime = GetDaylightTime(dateTime.Year, rule); - isInvalid = GetIsInvalidTime(dateTime, rule, daylightTime); - } - else { - isInvalid = false; - } - } - - return isInvalid; - } - - // - // GetIsInvalidTime - - // - // Helper function that checks if a given DateTime is in an invalid time ("time hole") - // A "time hole" occurs at a DST transition point when time jumps forward; - // For example, in Pacific Standard Time on Sunday, April 2, 2006 time jumps from - // 1:59:59.9999999 to 3AM. The time range 2AM to 2:59:59.9999999AM is the "time hole". - // A "time hole" is not limited to only occurring at the start of DST, and may occur at - // the end of DST as well. - // - static private Boolean GetIsInvalidTime(DateTime time, AdjustmentRule rule, DaylightTime daylightTime) { - Boolean isInvalid = false; - if (rule == null || rule.DaylightDelta == TimeSpan.Zero) { - return isInvalid; - } - - DateTime startInvalidTime; - DateTime endInvalidTime; - - // if at DST start we transition forward in time then there is an ambiguous time range at the DST end - if (rule.DaylightDelta < TimeSpan.Zero) { - startInvalidTime = daylightTime.End; - endInvalidTime = daylightTime.End - rule.DaylightDelta; /* */ - } - else { - startInvalidTime = daylightTime.Start; - endInvalidTime = daylightTime.Start + rule.DaylightDelta; /* */ - } - - isInvalid = (time >= startInvalidTime && time < endInvalidTime); - - if (!isInvalid && startInvalidTime.Year != endInvalidTime.Year) { - // there exists an extreme corner case where the start or end period is on a year boundary and - // because of this the comparison above might have been performed for a year-early or a year-later - // than it should have been. - DateTime startModifiedInvalidTime; - DateTime endModifiedInvalidTime; - try { - startModifiedInvalidTime = startInvalidTime.AddYears(1); - endModifiedInvalidTime = endInvalidTime.AddYears(1); - isInvalid = (time >= startModifiedInvalidTime && time < endModifiedInvalidTime); - } - catch (ArgumentOutOfRangeException) {} - - if (!isInvalid) { - try { - startModifiedInvalidTime = startInvalidTime.AddYears(-1); - endModifiedInvalidTime = endInvalidTime.AddYears(-1); - isInvalid = (time >= startModifiedInvalidTime && time < endModifiedInvalidTime); - } - catch (ArgumentOutOfRangeException) {} - } - } - return isInvalid; - } + return zone.GetUtcOffset (time, out isDaylightSavings); + } #endregion } diff --git a/mcs/class/corlib/Test/System.Threading/ManualResetEventSlimTests.cs b/mcs/class/corlib/Test/System.Threading/ManualResetEventSlimTests.cs index ebb0433c2a..a0389f27a0 100644 --- a/mcs/class/corlib/Test/System.Threading/ManualResetEventSlimTests.cs +++ b/mcs/class/corlib/Test/System.Threading/ManualResetEventSlimTests.cs @@ -54,7 +54,7 @@ namespace MonoTests.System.Threading public void Constructor_Defaults () { Assert.IsFalse (mre.IsSet, "#1"); - Assert.AreEqual (10, mre.SpinCount, "#2"); + Assert.AreEqual (Environment.ProcessorCount == 1 ? 1 : 10, mre.SpinCount, "#2"); } [Test] diff --git a/mcs/class/corlib/corlib.dll.sources b/mcs/class/corlib/corlib.dll.sources index 4b26ebaca5..768856c724 100644 --- a/mcs/class/corlib/corlib.dll.sources +++ b/mcs/class/corlib/corlib.dll.sources @@ -607,6 +607,8 @@ System.Runtime.InteropServices/CONNECTDATA.cs System.Runtime.InteropServices/CriticalHandle.cs System.Runtime.InteropServices/CurrencyWrapper.cs System.Runtime.InteropServices/DefaultCharSetAttribute.cs +System.Runtime.InteropServices/DllImportSearchPath.cs +System.Runtime.InteropServices/DefaultDllImportSearchPathsAttribute.cs System.Runtime.InteropServices/DESCKIND.cs System.Runtime.InteropServices/DispatchWrapper.cs System.Runtime.InteropServices/DISPPARAMS.cs diff --git a/mcs/class/lib/monolite/Mono.Security.dll.REMOVED.git-id b/mcs/class/lib/monolite/Mono.Security.dll.REMOVED.git-id index 4708fe1b1c..a3f00f1655 100644 --- a/mcs/class/lib/monolite/Mono.Security.dll.REMOVED.git-id +++ b/mcs/class/lib/monolite/Mono.Security.dll.REMOVED.git-id @@ -1 +1 @@ -49f816213be165022e8677532601a760171cde7a \ No newline at end of file +4816a33a1117da3f621fc172ae972cb88e983fe0 \ No newline at end of file diff --git a/mcs/class/lib/monolite/System.Configuration.dll.REMOVED.git-id b/mcs/class/lib/monolite/System.Configuration.dll.REMOVED.git-id index 91102f291c..5396256772 100644 --- a/mcs/class/lib/monolite/System.Configuration.dll.REMOVED.git-id +++ b/mcs/class/lib/monolite/System.Configuration.dll.REMOVED.git-id @@ -1 +1 @@ -b0b5eee6071ded2ebd95521972c0df2c88e50deb \ No newline at end of file +d56b0642b5e7cef07830b8435781e7decd5a3c88 \ No newline at end of file diff --git a/mcs/class/lib/monolite/System.Core.dll.REMOVED.git-id b/mcs/class/lib/monolite/System.Core.dll.REMOVED.git-id index 430713b091..fc042dabff 100644 --- a/mcs/class/lib/monolite/System.Core.dll.REMOVED.git-id +++ b/mcs/class/lib/monolite/System.Core.dll.REMOVED.git-id @@ -1 +1 @@ -f5fb66b0084a9b19caf40eb6af8006e3ad5d086f \ No newline at end of file +f812e116ea4476a6400787d291a6c33982351043 \ No newline at end of file diff --git a/mcs/class/lib/monolite/System.Security.dll.REMOVED.git-id b/mcs/class/lib/monolite/System.Security.dll.REMOVED.git-id index 0ddfdb854c..d606f24ae0 100644 --- a/mcs/class/lib/monolite/System.Security.dll.REMOVED.git-id +++ b/mcs/class/lib/monolite/System.Security.dll.REMOVED.git-id @@ -1 +1 @@ -6914d5a4219e0c744f39061819064a11992c8c0d \ No newline at end of file +d5baf4466182688805ba46006f24dee0f2a58a7f \ No newline at end of file diff --git a/mcs/class/lib/monolite/System.Xml.dll.REMOVED.git-id b/mcs/class/lib/monolite/System.Xml.dll.REMOVED.git-id index f074943050..d2ed6bd250 100644 --- a/mcs/class/lib/monolite/System.Xml.dll.REMOVED.git-id +++ b/mcs/class/lib/monolite/System.Xml.dll.REMOVED.git-id @@ -1 +1 @@ -5904d2521471bbf55b59d880c2c2db4f8541eaf2 \ No newline at end of file +e634a26a89825c34d9fa548f211a6b2e1968da66 \ No newline at end of file diff --git a/mcs/class/lib/monolite/System.dll.REMOVED.git-id b/mcs/class/lib/monolite/System.dll.REMOVED.git-id index 732b8b8c78..7e5ec7cc2b 100644 --- a/mcs/class/lib/monolite/System.dll.REMOVED.git-id +++ b/mcs/class/lib/monolite/System.dll.REMOVED.git-id @@ -1 +1 @@ -918c2fe1f59932f25345576015dcb4587da4e712 \ No newline at end of file +45516bac994827703522453286f3a1c1b8d75b1b \ No newline at end of file diff --git a/mcs/class/lib/monolite/basic.exe.REMOVED.git-id b/mcs/class/lib/monolite/basic.exe.REMOVED.git-id index 375d900c8c..61a5ac93a6 100644 --- a/mcs/class/lib/monolite/basic.exe.REMOVED.git-id +++ b/mcs/class/lib/monolite/basic.exe.REMOVED.git-id @@ -1 +1 @@ -324b4f1564f360d9036eb9db709bd652ed7456e5 \ No newline at end of file +340def76e208dadff3d94c971334b503dee1dc4c \ No newline at end of file diff --git a/mcs/class/lib/monolite/mscorlib.dll.REMOVED.git-id b/mcs/class/lib/monolite/mscorlib.dll.REMOVED.git-id index a5a7456594..2aedee9539 100644 --- a/mcs/class/lib/monolite/mscorlib.dll.REMOVED.git-id +++ b/mcs/class/lib/monolite/mscorlib.dll.REMOVED.git-id @@ -1 +1 @@ -0aebaa98e4bce0d7503d0ec21e5b1ce28078cd70 \ No newline at end of file +976d3a548faca8313dcbe8037ca0a8aa1d22b8da \ No newline at end of file diff --git a/mcs/class/reference-assemblies/Makefile b/mcs/class/reference-assemblies/Makefile index a14f96f208..e4b660ba5d 100644 --- a/mcs/class/reference-assemblies/Makefile +++ b/mcs/class/reference-assemblies/Makefile @@ -4,10 +4,16 @@ include ../../build/rules.make all-local: -install-local: - $(MKINSTALLDIRS) $(DESTDIR)$(LIBRARY_INSTALL_DIR) - $(INSTALL_LIB) ../../../external/binary-reference-assemblies/v4.0/* $(DESTDIR)$(LIBRARY_INSTALL_DIR) +PROFILE_DIR=$(DESTDIR)$(mono_libdir)/mono/ -DISTFILES = $(wildcard ../../../external/binary-reference-assemblies/v4.0/*) Makefile +install-local: + $(MKINSTALLDIRS) $(PROFILE_DIR)/2.0 + $(MKINSTALLDIRS) $(PROFILE_DIR)/3.5 + $(MKINSTALLDIRS) $(PROFILE_DIR)/4.0 + $(INSTALL_LIB) ../../../external/binary-reference-assemblies/v2.0/* $(PROFILE_DIR)/2.0 + $(INSTALL_LIB) ../../../external/binary-reference-assemblies/v3.5/* $(PROFILE_DIR)/3.5 + $(INSTALL_LIB) ../../../external/binary-reference-assemblies/v4.0/* $(PROFILE_DIR)/4.0 + +DISTFILES = $(wildcard ../../../external/binary-reference-assemblies/v4.0/*) $(wildcard ../../../external/binary-reference-assemblies/v3.5/*) $(wildcard ../../../external/binary-reference-assemblies/v2.0/*) Makefile dist-local: dist-default diff --git a/mcs/mcs/anonymous.cs b/mcs/mcs/anonymous.cs index 1063fb1b07..12bf992bbc 100644 --- a/mcs/mcs/anonymous.cs +++ b/mcs/mcs/anonymous.cs @@ -1920,17 +1920,16 @@ namespace Mono.CSharp { var delegate_method = method.Spec; if (storey != null && storey.MemberName.IsGeneric) { - TypeSpec t = storey.Instance.Type; - // // Mutate anonymous method instance type if we are in nested // hoisted generic anonymous method storey // if (ec.IsAnonymousStoreyMutateRequired) { - t = storey.Mutator.Mutate (t); + ec.Emit (OpCodes.Ldftn, delegate_method); + } else { + TypeSpec t = storey.Instance.Type; + ec.Emit (OpCodes.Ldftn, TypeBuilder.GetMethod (t.GetMetaInfo (), (MethodInfo) delegate_method.GetMetaInfo ())); } - - ec.Emit (OpCodes.Ldftn, TypeBuilder.GetMethod (t.GetMetaInfo (), (MethodInfo) delegate_method.GetMetaInfo ())); } else { if (delegate_method.IsGeneric) { TypeParameterSpec[] tparams; diff --git a/mcs/mcs/expression.cs.REMOVED.git-id b/mcs/mcs/expression.cs.REMOVED.git-id index 4841c3fc3c..a0156f36fe 100644 --- a/mcs/mcs/expression.cs.REMOVED.git-id +++ b/mcs/mcs/expression.cs.REMOVED.git-id @@ -1 +1 @@ -85c8f16902b8b89793cc1e76dfe930df4ce09f01 \ No newline at end of file +f4df8c9c44375d7f0307ed0c4fffedf1ce231ca6 \ No newline at end of file diff --git a/mcs/tests/test-anon-177.cs b/mcs/tests/test-anon-177.cs new file mode 100644 index 0000000000..cb31425b53 --- /dev/null +++ b/mcs/tests/test-anon-177.cs @@ -0,0 +1,25 @@ +using System; +using System.Linq; +using System.Collections.Generic; + +class X +{ + public static void Execute(TArg args) + { + Action a = () => { + List s = new List () { + "test" + }; + + object res = null; + var res2 = s.Select(acrl => acrl.Select(acr => res)).ToArray (); + }; + + a (); + } + + public static void Main () + { + Execute (null); + } +} \ No newline at end of file diff --git a/mcs/tests/test-null-operator-011.cs b/mcs/tests/test-null-operator-011.cs new file mode 100644 index 0000000000..9c116a48e6 --- /dev/null +++ b/mcs/tests/test-null-operator-011.cs @@ -0,0 +1,12 @@ +static class Crash +{ + static string GetFoo () + { + return null; + } + + static void Main () + { + (GetFoo ()?.ToLower ()).ToUpper (); + } +} diff --git a/mcs/tools/cil-strip/cilstrip.cs b/mcs/tools/cil-strip/cilstrip.cs index 4b56f2e16a..ec80b178ca 100644 --- a/mcs/tools/cil-strip/cilstrip.cs +++ b/mcs/tools/cil-strip/cilstrip.cs @@ -8,7 +8,6 @@ // using System; -using System.IO; using System.Reflection; using Mono.Cecil; @@ -17,7 +16,7 @@ namespace Mono.CilStripper { class Program { - static void Main (string [] args) + static int Main (string [] args) { Header (); @@ -35,11 +34,13 @@ namespace Mono.CilStripper { Console.WriteLine ("Assembly {0} stripped out into {1}", file, output); else Console.WriteLine ("Assembly {0} stripped", file); + return 0; } catch (TargetInvocationException tie) { Console.WriteLine ("Error: {0}", tie.InnerException); } catch (Exception e) { Console.WriteLine ("Error: {0}", e); } + return 1; } static void StripAssembly (AssemblyDefinition assembly, string output) diff --git a/mcs/tools/linker/Mono.Linker.Steps/SweepStep.cs b/mcs/tools/linker/Mono.Linker.Steps/SweepStep.cs index 9bd2bad934..d7be23ac9e 100644 --- a/mcs/tools/linker/Mono.Linker.Steps/SweepStep.cs +++ b/mcs/tools/linker/Mono.Linker.Steps/SweepStep.cs @@ -144,6 +144,16 @@ namespace Mono.Linker.Steps { scope = assembly.MainModule.Import (td).Scope; hash.Add (tr, scope); } + if (assembly.MainModule.HasExportedTypes) { + foreach (var et in assembly.MainModule.ExportedTypes) { + var td = et.Resolve (); + IMetadataScope scope = et.Scope; + if ((td != null) && Annotations.IsMarked (td)) { + scope = assembly.MainModule.Import (td).Scope; + hash.Add (td, scope); + } + } + } // Resolve everything first before updating scopes. // If we set the scope to null, then calling Resolve() on any of its diff --git a/mcs/tools/xbuild/Makefile b/mcs/tools/xbuild/Makefile index 05c24763cd..949f3e5966 100644 --- a/mcs/tools/xbuild/Makefile +++ b/mcs/tools/xbuild/Makefile @@ -41,8 +41,12 @@ install-bin-data: install-frameworks: $(MKINSTALLDIRS) $(DESTDIR)$(NETFRAMEWORK_DIR)/v$(FRAMEWORK_VERSION)/RedistList $(INSTALL_DATA) frameworks/net_$(FRAMEWORK_VERSION).xml $(DESTDIR)$(NETFRAMEWORK_DIR)/v$(FRAMEWORK_VERSION)/RedistList/FrameworkList.xml + $(MKINSTALLDIRS) $(DESTDIR)$(NETFRAMEWORK_DIR)/v2.0/RedistList + $(INSTALL_DATA) frameworks/net_2.0.xml $(DESTDIR)$(NETFRAMEWORK_DIR)/v2.0/RedistList/FrameworkList.xml $(MKINSTALLDIRS) $(DESTDIR)$(NETFRAMEWORK_DIR)/v3.0/RedistList $(INSTALL_DATA) frameworks/net_3.0.xml $(DESTDIR)$(NETFRAMEWORK_DIR)/v3.0/RedistList/FrameworkList.xml + $(MKINSTALLDIRS) $(DESTDIR)$(NETFRAMEWORK_DIR)/v3.5/RedistList + $(INSTALL_DATA) frameworks/net_3.5.xml $(DESTDIR)$(NETFRAMEWORK_DIR)/v3.5/RedistList/FrameworkList.xml $(MKINSTALLDIRS) $(DESTDIR)$(NETFRAMEWORK_DIR)/v4.0/RedistList $(INSTALL_DATA) frameworks/net_4.0.xml $(DESTDIR)$(NETFRAMEWORK_DIR)/v4.0/RedistList/FrameworkList.xml $(MKINSTALLDIRS) $(DESTDIR)$(NETFRAMEWORK_DIR)/v4.0/Profile/Client/RedistList diff --git a/mono-core.spec b/mono-core.spec index 8c5add9ec4..47bae23566 100644 --- a/mono-core.spec +++ b/mono-core.spec @@ -15,7 +15,7 @@ License: LGPL v2.1 only Group: Development/Languages/Mono Summary: A .NET Runtime Environment Url: http://www.mono-project.com -Version: 4.0.0 +Version: 4.0.1 Release: 0 Source0: mono-%{version}.tar.bz2 BuildRequires: bison diff --git a/mono/metadata/image.c b/mono/metadata/image.c index 33c389cb4b..d62b7036d8 100644 --- a/mono/metadata/image.c +++ b/mono/metadata/image.c @@ -1618,6 +1618,9 @@ mono_image_close_except_pools (MonoImage *image) } free_hash (image->native_wrapper_cache); + free_hash (image->native_wrapper_aot_cache); + free_hash (image->native_wrapper_check_cache); + free_hash (image->native_wrapper_aot_check_cache); free_hash (image->native_func_wrapper_cache); free_hash (image->managed_wrapper_cache); free_hash (image->delegate_begin_invoke_cache); diff --git a/mono/metadata/marshal.c.REMOVED.git-id b/mono/metadata/marshal.c.REMOVED.git-id index 783d935031..db4a0d3cab 100644 --- a/mono/metadata/marshal.c.REMOVED.git-id +++ b/mono/metadata/marshal.c.REMOVED.git-id @@ -1 +1 @@ -eb5e507434af26801525bafdcd2e5775a3ce090b \ No newline at end of file +0b3265de9b69f018f6bbdbc74247de6151f934c1 \ No newline at end of file diff --git a/mono/metadata/metadata-internals.h b/mono/metadata/metadata-internals.h index 14eb80cd79..936afbd367 100644 --- a/mono/metadata/metadata-internals.h +++ b/mono/metadata/metadata-internals.h @@ -275,6 +275,8 @@ struct _MonoImage { GHashTable *managed_wrapper_cache; GHashTable *native_wrapper_cache; GHashTable *native_wrapper_aot_cache; + GHashTable *native_wrapper_check_cache; + GHashTable *native_wrapper_aot_check_cache; GHashTable *native_func_wrapper_aot_cache; GHashTable *remoting_invoke_cache; GHashTable *synchronized_cache; diff --git a/mono/mini/version.h b/mono/mini/version.h index bba0eafab1..c456f776d2 100644 --- a/mono/mini/version.h +++ b/mono/mini/version.h @@ -1 +1 @@ -#define FULL_VERSION "(detached/21d849b" +#define FULL_VERSION "mono-4.0.0-branch/7975f50" diff --git a/mono/utils/mono-codeman.c b/mono/utils/mono-codeman.c index 5c2a83b118..f027e0f447 100644 --- a/mono/utils/mono-codeman.c +++ b/mono/utils/mono-codeman.c @@ -529,15 +529,21 @@ new_codechunk (CodeChunk *last, int dynamic, int size) } } #ifdef BIND_ROOM - bsize = chunk_size / BIND_ROOM; + if (dynamic) + /* Reserve more space since there are no other chunks we might use if this one gets full */ + bsize = (chunk_size * 2) / BIND_ROOM; + else + bsize = chunk_size / BIND_ROOM; if (bsize < MIN_BSIZE) bsize = MIN_BSIZE; bsize += MIN_ALIGN -1; bsize &= ~ (MIN_ALIGN - 1); if (chunk_size - size < bsize) { chunk_size = size + bsize; - chunk_size += pagesize - 1; - chunk_size &= ~ (pagesize - 1); + if (!dynamic) { + chunk_size += pagesize - 1; + chunk_size &= ~ (pagesize - 1); + } } #endif diff --git a/po/mcs/de.gmo b/po/mcs/de.gmo index d8d7104d59..98663c8951 100644 Binary files a/po/mcs/de.gmo and b/po/mcs/de.gmo differ diff --git a/po/mcs/de.po.REMOVED.git-id b/po/mcs/de.po.REMOVED.git-id index 7da3e8d9fb..1c496055d1 100644 --- a/po/mcs/de.po.REMOVED.git-id +++ b/po/mcs/de.po.REMOVED.git-id @@ -1 +1 @@ -818881af8e6ffe35d0c07be71c0ccfedf24ee1e9 \ No newline at end of file +1177d93cba3ffbf1fa3293bf5d3f7326ef8dc78f \ No newline at end of file diff --git a/po/mcs/es.gmo b/po/mcs/es.gmo index 10c8fe56df..d4df693eaf 100644 Binary files a/po/mcs/es.gmo and b/po/mcs/es.gmo differ diff --git a/po/mcs/es.po.REMOVED.git-id b/po/mcs/es.po.REMOVED.git-id index 902256e336..2337f3f73f 100644 --- a/po/mcs/es.po.REMOVED.git-id +++ b/po/mcs/es.po.REMOVED.git-id @@ -1 +1 @@ -384c007d0111057a7dcd007740fe4b8316c68cd6 \ No newline at end of file +2a545eef43afb0b31f38d049740abc3d8d71073b \ No newline at end of file diff --git a/po/mcs/ja.gmo b/po/mcs/ja.gmo index 3d0fd3b37f..f08543cde0 100644 Binary files a/po/mcs/ja.gmo and b/po/mcs/ja.gmo differ diff --git a/po/mcs/ja.po.REMOVED.git-id b/po/mcs/ja.po.REMOVED.git-id index 6ec2577bb0..3f03c33c8f 100644 --- a/po/mcs/ja.po.REMOVED.git-id +++ b/po/mcs/ja.po.REMOVED.git-id @@ -1 +1 @@ -f0bdaf799add4b43e026647f57f63373334e6f77 \ No newline at end of file +a7ca76240aea3ebb6ea24e02beacd3ae518727af \ No newline at end of file diff --git a/po/mcs/mcs.pot b/po/mcs/mcs.pot index 0af3530060..3093a84917 100644 --- a/po/mcs/mcs.pot +++ b/po/mcs/mcs.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: mono 4.0.0\n" +"Project-Id-Version: mono 4.0.1\n" "Report-Msgid-Bugs-To: http://www.mono-project.com/Bugs\n" -"POT-Creation-Date: 2015-04-07 08:44+0100\n" +"POT-Creation-Date: 2015-04-26 17:48+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -91,7 +91,7 @@ msgstr "" msgid "An expression tree cannot contain an anonymous method expression" msgstr "" -#: mcs/mcs/anonymous.cs:2024 +#: mcs/mcs/anonymous.cs:2023 #, csharp-format msgid "" "`{0}': An anonymous type cannot have multiple properties with the same name" @@ -608,7 +608,7 @@ msgstr "" msgid "The operation overflows at compile time in checked mode" msgstr "" -#: mcs/mcs/cfold.cs:329 mcs/mcs/expression.cs:4928 +#: mcs/mcs/cfold.cs:329 mcs/mcs/expression.cs:4933 #, csharp-format msgid "Operator `{0}' is ambiguous on operands of type `{1}' and `{2}'" msgstr "" @@ -1348,8 +1348,8 @@ msgstr "" msgid "Internal compiler error: {0}" msgstr "" -#: mcs/mcs/ecore.cs:581 mcs/mcs/expression.cs:1826 mcs/mcs/expression.cs:7871 -#: mcs/mcs/expression.cs:7879 +#: mcs/mcs/ecore.cs:581 mcs/mcs/expression.cs:1831 mcs/mcs/expression.cs:7876 +#: mcs/mcs/expression.cs:7884 msgid "A constant value is expected" msgstr "" @@ -1811,316 +1811,316 @@ msgstr "" msgid "Detection Parsing Error" msgstr "" -#: mcs/mcs/expression.cs:609 +#: mcs/mcs/expression.cs:614 #, csharp-format msgid "Operator `{0}' is ambiguous on an operand of type `{1}'" msgstr "" -#: mcs/mcs/expression.cs:715 +#: mcs/mcs/expression.cs:720 msgid "Cannot take the address of the given expression" msgstr "" -#: mcs/mcs/expression.cs:738 +#: mcs/mcs/expression.cs:743 msgid "" "You can only take the address of unfixed expression inside of a fixed " "statement initializer" msgstr "" -#: mcs/mcs/expression.cs:982 +#: mcs/mcs/expression.cs:987 msgid "The * or -> operator must be applied to a pointer" msgstr "" -#: mcs/mcs/expression.cs:1205 +#: mcs/mcs/expression.cs:1210 msgid "" "The operand of an increment or decrement operator must be a variable, " "property or indexer" msgstr "" -#: mcs/mcs/expression.cs:1448 +#: mcs/mcs/expression.cs:1453 #, csharp-format msgid "The second operand of `is' or `as' operator cannot be static type `{0}'" msgstr "" -#: mcs/mcs/expression.cs:1454 +#: mcs/mcs/expression.cs:1459 #, csharp-format msgid "The `{0}' operator cannot be applied to an operand of pointer type" msgstr "" -#: mcs/mcs/expression.cs:1460 +#: mcs/mcs/expression.cs:1465 #, csharp-format msgid "" "The `{0}' operator cannot be applied to a lambda expression, anonymous " "method, or method group" msgstr "" -#: mcs/mcs/expression.cs:2214 +#: mcs/mcs/expression.cs:2219 #, csharp-format msgid "`{0}' is not a valid pattern member" msgstr "" -#: mcs/mcs/expression.cs:2221 +#: mcs/mcs/expression.cs:2226 #, csharp-format msgid "Property `{0}.get' accessor is required" msgstr "" -#: mcs/mcs/expression.cs:2354 +#: mcs/mcs/expression.cs:2359 #, csharp-format msgid "" "The `as' operator cannot be used with a non-reference type parameter `{0}'. " "Consider adding `class' or a reference type constraint" msgstr "" -#: mcs/mcs/expression.cs:2358 +#: mcs/mcs/expression.cs:2363 #, csharp-format msgid "The `as' operator cannot be used with a non-nullable value type `{0}'" msgstr "" -#: mcs/mcs/expression.cs:2392 +#: mcs/mcs/expression.cs:2397 #, csharp-format msgid "Cannot convert type `{0}' to `{1}' via a built-in conversion" msgstr "" -#: mcs/mcs/expression.cs:2433 +#: mcs/mcs/expression.cs:2438 #, csharp-format msgid "Cannot convert to static type `{0}'" msgstr "" -#: mcs/mcs/expression.cs:2536 +#: mcs/mcs/expression.cs:2541 msgid "An expression tree cannot contain a declaration expression" msgstr "" -#: mcs/mcs/expression.cs:2633 +#: mcs/mcs/expression.cs:2638 msgid "" "The `default value' operator cannot be applied to an operand of a static type" msgstr "" -#: mcs/mcs/expression.cs:3315 +#: mcs/mcs/expression.cs:3320 #, csharp-format msgid "Operator `{0}' cannot be applied to operands of type `{1}' and `{2}'" msgstr "" -#: mcs/mcs/expression.cs:4121 +#: mcs/mcs/expression.cs:4126 msgid "To cast a negative value, you must enclose the value in parentheses" msgstr "" -#: mcs/mcs/expression.cs:4214 +#: mcs/mcs/expression.cs:4219 #, csharp-format msgid "" "Expression must be implicitly convertible to Boolean or its type `{0}' must " "define operator `{1}'" msgstr "" -#: mcs/mcs/expression.cs:5820 +#: mcs/mcs/expression.cs:5825 #, csharp-format msgid "" "A user-defined operator `{0}' must have each parameter type and return type " "of the same type in order to be applicable as a short circuit operator" msgstr "" -#: mcs/mcs/expression.cs:5830 +#: mcs/mcs/expression.cs:5835 #, csharp-format msgid "" "The type `{0}' must have operator `true' and operator `false' defined when " "`{1}' is used as a short circuit operator" msgstr "" -#: mcs/mcs/expression.cs:6205 +#: mcs/mcs/expression.cs:6210 #, csharp-format msgid "" "Type of conditional expression cannot be determined as `{0}' and `{1}' " "convert implicitly to each other" msgstr "" -#: mcs/mcs/expression.cs:6218 +#: mcs/mcs/expression.cs:6223 #, csharp-format msgid "" "Type of conditional expression cannot be determined because there is no " "implicit conversion between `{0}' and `{1}'" msgstr "" -#: mcs/mcs/expression.cs:6565 +#: mcs/mcs/expression.cs:6570 #, csharp-format msgid "Use of unassigned local variable `{0}'" msgstr "" -#: mcs/mcs/expression.cs:6588 +#: mcs/mcs/expression.cs:6593 #, csharp-format msgid "" "Cannot use fixed local `{0}' inside an anonymous method, lambda expression " "or query expression" msgstr "" -#: mcs/mcs/expression.cs:6606 +#: mcs/mcs/expression.cs:6611 #, csharp-format msgid "Cannot use uninitialized variable `{0}'" msgstr "" -#: mcs/mcs/expression.cs:6778 +#: mcs/mcs/expression.cs:6783 #, csharp-format msgid "" "Parameter `{0}' cannot be used inside `{1}' when using `ref' or `out' " "modifier" msgstr "" -#: mcs/mcs/expression.cs:6848 +#: mcs/mcs/expression.cs:6853 #, csharp-format msgid "Use of unassigned out parameter `{0}'" msgstr "" -#: mcs/mcs/expression.cs:7052 +#: mcs/mcs/expression.cs:7057 #, csharp-format msgid "Cannot invoke a non-delegate type `{0}'" msgstr "" -#: mcs/mcs/expression.cs:7063 +#: mcs/mcs/expression.cs:7068 #, csharp-format msgid "The member `{0}' cannot be used as method or delegate" msgstr "" -#: mcs/mcs/expression.cs:7085 +#: mcs/mcs/expression.cs:7090 msgid "" "Do not directly call your base class Finalize method. It is called " "automatically from your destructor" msgstr "" -#: mcs/mcs/expression.cs:7087 +#: mcs/mcs/expression.cs:7092 msgid "" "Destructors and object.Finalize cannot be called directly. Consider calling " "IDisposable.Dispose if available" msgstr "" -#: mcs/mcs/expression.cs:7116 +#: mcs/mcs/expression.cs:7121 #, csharp-format msgid "" "The base call to method `{0}' cannot be dynamically dispatched. Consider " "casting the dynamic arguments or eliminating the base access" msgstr "" -#: mcs/mcs/expression.cs:7209 +#: mcs/mcs/expression.cs:7214 #, csharp-format msgid "`{0}': cannot explicitly call operator or accessor" msgstr "" -#: mcs/mcs/expression.cs:7399 +#: mcs/mcs/expression.cs:7404 #, csharp-format msgid "Unsafe type `{0}' cannot be used in an object creation expression" msgstr "" -#: mcs/mcs/expression.cs:7422 +#: mcs/mcs/expression.cs:7427 #, csharp-format msgid "" "Cannot create an instance of the variable type `{0}' because it does not " "have the new() constraint" msgstr "" -#: mcs/mcs/expression.cs:7428 +#: mcs/mcs/expression.cs:7433 #, csharp-format msgid "" "`{0}': cannot provide arguments when creating an instance of a variable type" msgstr "" -#: mcs/mcs/expression.cs:7437 +#: mcs/mcs/expression.cs:7442 #, csharp-format msgid "Cannot create an instance of the static class `{0}'" msgstr "" -#: mcs/mcs/expression.cs:7449 +#: mcs/mcs/expression.cs:7454 #, csharp-format msgid "Cannot create an instance of the abstract class or interface `{0}'" msgstr "" -#: mcs/mcs/expression.cs:7722 +#: mcs/mcs/expression.cs:7727 msgid "" "An implicitly typed local variable declarator cannot use an array initializer" msgstr "" -#: mcs/mcs/expression.cs:7885 mcs/mcs/expression.cs:7910 +#: mcs/mcs/expression.cs:7890 mcs/mcs/expression.cs:7915 #, csharp-format msgid "An array initializer of length `{0}' was expected" msgstr "" -#: mcs/mcs/expression.cs:7901 +#: mcs/mcs/expression.cs:7906 msgid "" "Array initializers can only be used in a variable or field initializer. Try " "using a new expression instead" msgstr "" -#: mcs/mcs/expression.cs:7918 +#: mcs/mcs/expression.cs:7923 msgid "A nested array initializer was expected" msgstr "" -#: mcs/mcs/expression.cs:7965 +#: mcs/mcs/expression.cs:7970 msgid "An expression tree cannot contain a multidimensional array initializer" msgstr "" -#: mcs/mcs/expression.cs:8001 +#: mcs/mcs/expression.cs:8006 msgid "Cannot create an array with a negative size" msgstr "" -#: mcs/mcs/expression.cs:8093 +#: mcs/mcs/expression.cs:8098 msgid "" "Can only use array initializer expressions to assign to array types. Try " "using a new expression instead" msgstr "" -#: mcs/mcs/expression.cs:8517 +#: mcs/mcs/expression.cs:8522 msgid "" "The type of an implicitly typed array cannot be inferred from the " "initializer. Try specifying array type explicitly" msgstr "" -#: mcs/mcs/expression.cs:8672 +#: mcs/mcs/expression.cs:8677 msgid "" "The `this' object cannot be used before all of its fields are assigned to" msgstr "" -#: mcs/mcs/expression.cs:8678 +#: mcs/mcs/expression.cs:8683 msgid "" "Keyword `this' is not valid in a static property, static method, or static " "field initializer" msgstr "" -#: mcs/mcs/expression.cs:8681 +#: mcs/mcs/expression.cs:8686 msgid "" "Anonymous methods inside structs cannot access instance members of `this'. " "Consider copying `this' to a local variable outside the anonymous method and " "using the local instead" msgstr "" -#: mcs/mcs/expression.cs:8684 +#: mcs/mcs/expression.cs:8689 msgid "Keyword `this' is not available in the current context" msgstr "" -#: mcs/mcs/expression.cs:8760 +#: mcs/mcs/expression.cs:8765 msgid "Cannot take the address of `this' because it is read-only" msgstr "" -#: mcs/mcs/expression.cs:8762 +#: mcs/mcs/expression.cs:8767 msgid "Cannot pass `this' as a ref or out argument because it is read-only" msgstr "" -#: mcs/mcs/expression.cs:8764 +#: mcs/mcs/expression.cs:8769 msgid "Cannot assign to `this' because it is read-only" msgstr "" -#: mcs/mcs/expression.cs:8832 +#: mcs/mcs/expression.cs:8837 msgid "The __arglist construct is valid only within a variable argument method" msgstr "" -#: mcs/mcs/expression.cs:8893 +#: mcs/mcs/expression.cs:8898 msgid "An expression tree cannot contain a method with variable arguments" msgstr "" -#: mcs/mcs/expression.cs:9167 +#: mcs/mcs/expression.cs:9172 msgid "The typeof operator cannot be used on the dynamic type" msgstr "" -#: mcs/mcs/expression.cs:9208 +#: mcs/mcs/expression.cs:9213 #, csharp-format msgid "`{0}': an attribute argument cannot use type parameters" msgstr "" -#: mcs/mcs/expression.cs:9423 +#: mcs/mcs/expression.cs:9428 #, csharp-format msgid "" "`{0}' does not have a predefined size, therefore sizeof can only be used in " @@ -2128,154 +2128,154 @@ msgid "" "SizeOf)" msgstr "" -#: mcs/mcs/expression.cs:9488 +#: mcs/mcs/expression.cs:9493 #, csharp-format msgid "Alias `{0}' not found" msgstr "" -#: mcs/mcs/expression.cs:9529 +#: mcs/mcs/expression.cs:9534 msgid "" "The namespace alias qualifier `::' cannot be used to invoke a method. " "Consider using `.' instead" msgstr "" -#: mcs/mcs/expression.cs:9619 +#: mcs/mcs/expression.cs:9624 msgid "Cannot perform member binding on `null' value" msgstr "" -#: mcs/mcs/expression.cs:9777 +#: mcs/mcs/expression.cs:9782 #, csharp-format msgid "" "`{0}': cannot reference a type through an expression. Consider using `{1}' " "instead" msgstr "" -#: mcs/mcs/expression.cs:9856 +#: mcs/mcs/expression.cs:9861 #, csharp-format msgid "A nested type cannot be specified through a type parameter `{0}'" msgstr "" -#: mcs/mcs/expression.cs:9864 +#: mcs/mcs/expression.cs:9869 #, csharp-format msgid "" "Alias `{0}' cannot be used with `::' since it denotes a type. Consider " "replacing `::' with `.'" msgstr "" -#: mcs/mcs/expression.cs:9933 +#: mcs/mcs/expression.cs:9938 #, csharp-format msgid "The nested type `{0}' does not exist in the type `{1}'" msgstr "" -#: mcs/mcs/expression.cs:9957 +#: mcs/mcs/expression.cs:9962 #, csharp-format msgid "" "Type `{0}' does not contain a definition for `{1}' and no extension method " "`{1}' of type `{0}' could be found. Are you missing {2}?" msgstr "" -#: mcs/mcs/expression.cs:10236 +#: mcs/mcs/expression.cs:10241 #, csharp-format msgid "Cannot apply indexing with [] to an expression of type `{0}'" msgstr "" -#: mcs/mcs/expression.cs:10381 +#: mcs/mcs/expression.cs:10386 #, csharp-format msgid "Wrong number of indexes `{0}' inside [], expected `{1}'" msgstr "" -#: mcs/mcs/expression.cs:10809 +#: mcs/mcs/expression.cs:10814 msgid "" "The indexer base access cannot be dynamically dispatched. Consider casting " "the dynamic arguments or eliminating the base access" msgstr "" -#: mcs/mcs/expression.cs:10899 +#: mcs/mcs/expression.cs:10904 msgid "An expression tree may not contain a base access" msgstr "" -#: mcs/mcs/expression.cs:10917 +#: mcs/mcs/expression.cs:10922 msgid "Keyword `base' is not available in a static method" msgstr "" -#: mcs/mcs/expression.cs:10919 +#: mcs/mcs/expression.cs:10924 msgid "Keyword `base' is not available in the current context" msgstr "" -#: mcs/mcs/expression.cs:10957 +#: mcs/mcs/expression.cs:10962 msgid "" "A property, indexer or dynamic member access may not be passed as `ref' or " "`out' parameter" msgstr "" -#: mcs/mcs/expression.cs:11302 +#: mcs/mcs/expression.cs:11307 #, csharp-format msgid "Array elements cannot be of type `{0}'" msgstr "" -#: mcs/mcs/expression.cs:11305 +#: mcs/mcs/expression.cs:11310 #, csharp-format msgid "Array elements cannot be of static type `{0}'" msgstr "" -#: mcs/mcs/expression.cs:11481 +#: mcs/mcs/expression.cs:11486 msgid "Cannot use a negative size with stackalloc" msgstr "" -#: mcs/mcs/expression.cs:11485 +#: mcs/mcs/expression.cs:11490 msgid "Cannot use stackalloc in finally or catch" msgstr "" -#: mcs/mcs/expression.cs:11640 +#: mcs/mcs/expression.cs:11645 #, csharp-format msgid "" "Member `{0}' cannot be initialized. An object initializer may only be used " "for fields, or properties" msgstr "" -#: mcs/mcs/expression.cs:11648 +#: mcs/mcs/expression.cs:11653 #, csharp-format msgid "" "Static field or property `{0}' cannot be assigned in an object initializer" msgstr "" -#: mcs/mcs/expression.cs:11752 +#: mcs/mcs/expression.cs:11757 msgid "Expression tree cannot contain a dictionary initializer" msgstr "" -#: mcs/mcs/expression.cs:11877 +#: mcs/mcs/expression.cs:11882 #, csharp-format msgid "" "A field or property `{0}' cannot be initialized with a collection object " "initializer because type `{1}' does not implement `{2}' interface" msgstr "" -#: mcs/mcs/expression.cs:11888 +#: mcs/mcs/expression.cs:11893 #, csharp-format msgid "Inconsistent `{0}' member declaration" msgstr "" -#: mcs/mcs/expression.cs:11896 +#: mcs/mcs/expression.cs:11901 #, csharp-format msgid "" "An object initializer includes more than one member `{0}' initialization" msgstr "" -#: mcs/mcs/expression.cs:11914 +#: mcs/mcs/expression.cs:11919 #, csharp-format msgid "Cannot initialize object of type `{0}' with a collection initializer" msgstr "" -#: mcs/mcs/expression.cs:12059 +#: mcs/mcs/expression.cs:12064 msgid "" "Object and collection initializers cannot be used to instantiate a delegate" msgstr "" -#: mcs/mcs/expression.cs:12247 +#: mcs/mcs/expression.cs:12252 msgid "Anonymous types cannot be used in this expression" msgstr "" -#: mcs/mcs/expression.cs:12341 +#: mcs/mcs/expression.cs:12346 #, csharp-format msgid "An anonymous type property `{0}' cannot be initialized with `{1}'" msgstr "" diff --git a/po/mcs/pt_BR.gmo b/po/mcs/pt_BR.gmo index b8db73b5de..d1b7f60028 100644 Binary files a/po/mcs/pt_BR.gmo and b/po/mcs/pt_BR.gmo differ diff --git a/po/mcs/pt_BR.po.REMOVED.git-id b/po/mcs/pt_BR.po.REMOVED.git-id index 2c8ec492ec..f41dedf1dc 100644 --- a/po/mcs/pt_BR.po.REMOVED.git-id +++ b/po/mcs/pt_BR.po.REMOVED.git-id @@ -1 +1 @@ -ea06e267d7dc2b8531053c0dac0658f5334a8970 \ No newline at end of file +92245423ae71d2dca945ca1e614c2ee04a053695 \ No newline at end of file diff --git a/runtime/Makefile.am b/runtime/Makefile.am index aea6c5faa3..3f6fe489fa 100644 --- a/runtime/Makefile.am +++ b/runtime/Makefile.am @@ -34,7 +34,7 @@ else build_profiles = if INSTALL_4_5 -build_profiles += net_4_0 net_4_5 xbuild_12 xbuild_14 +build_profiles += binary_reference_assemblies net_4_5 xbuild_12 xbuild_14 al_profile = net_4_5 endif @@ -110,11 +110,11 @@ endif # Compile all assemblies with the verifier turned on. Code must be valid but not verifiable. # TODO it would be nice to split assemblies without unsafe code to use the verifier with verifiable mode. -# Skip net 4.0 assemblies because they contain metadata only +# Skip binary_reference_assemblies because they contain metadata only mcs-compileall: mono-wrapper etc/mono/config save_MONO_PATH=$$MONO_PATH; mcs_topdir=`cd $(mcs_topdir) && $(cur_dir_cmd)`; ok=:; \ for profile in $(test_profiles); do \ - if [ "net_4_0" = "$$profile" ]; then \ + if [ "binary_reference_assemblies" = "$$profile" ]; then \ continue; \ fi; \ if [ "xbuild_12" = "$$profile" ]; then \ diff --git a/runtime/Makefile.in b/runtime/Makefile.in index acec253fb9..0bb55d038d 100644 --- a/runtime/Makefile.in +++ b/runtime/Makefile.in @@ -80,7 +80,7 @@ build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ @INSTALL_4_5_TRUE@am__append_1 = etc/mono/4.0/machine.config etc/mono/4.0/web.config etc/mono/4.5/web.config etc/mono/4.5/machine.config etc/mono/4.0/Browsers/Compat.browser etc/mono/4.5/Browsers/Compat.browser -@INSTALL_4_5_TRUE@@ONLY_MONOTOUCH_FALSE@@ONLY_XAMMAC_FALSE@am__append_2 = net_4_0 net_4_5 xbuild_12 xbuild_14 +@INSTALL_4_5_TRUE@@ONLY_MONOTOUCH_FALSE@@ONLY_XAMMAC_FALSE@am__append_2 = binary_reference_assemblies net_4_5 xbuild_12 xbuild_14 @INSTALL_MONODROID_TRUE@@ONLY_MONOTOUCH_FALSE@@ONLY_XAMMAC_FALSE@am__append_3 = monodroid @INSTALL_MONOTOUCH_TRUE@@ONLY_MONOTOUCH_FALSE@@ONLY_XAMMAC_FALSE@am__append_4 = monotouch monotouch_runtime @INSTALL_XAMMAC_TRUE@@ONLY_MONOTOUCH_FALSE@@ONLY_XAMMAC_FALSE@am__append_5 = xammac @@ -583,11 +583,11 @@ mcs-do-run-test-profiles: test-support-files # Compile all assemblies with the verifier turned on. Code must be valid but not verifiable. # TODO it would be nice to split assemblies without unsafe code to use the verifier with verifiable mode. -# Skip net 4.0 assemblies because they contain metadata only +# Skip binary_reference_assemblies because they contain metadata only mcs-compileall: mono-wrapper etc/mono/config save_MONO_PATH=$$MONO_PATH; mcs_topdir=`cd $(mcs_topdir) && $(cur_dir_cmd)`; ok=:; \ for profile in $(test_profiles); do \ - if [ "net_4_0" = "$$profile" ]; then \ + if [ "binary_reference_assemblies" = "$$profile" ]; then \ continue; \ fi; \ if [ "xbuild_12" = "$$profile" ]; then \ diff --git a/scripts/mono-find-provides.in b/scripts/mono-find-provides.in index c9210060c2..155690d75a 100644 --- a/scripts/mono-find-provides.in +++ b/scripts/mono-find-provides.in @@ -33,7 +33,7 @@ fi # set LD_LIBRARY_PATH to ensure that libmono is found export LD_LIBRARY_PATH=$libdir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} # and set MONO_PATH to ensure that mscorlib.dll can be found -export MONO_PATH=$prefix/lib/mono/2.0 +export MONO_PATH=$prefix/lib/mono/4.5 for i in "${monolist[@]}"; do ($bindir/monodis --assembly $i | awk ' diff --git a/scripts/mono-find-requires.in b/scripts/mono-find-requires.in index f0ad60bb8a..d7b6a325bc 100644 --- a/scripts/mono-find-requires.in +++ b/scripts/mono-find-requires.in @@ -50,7 +50,7 @@ esac # set LD_LIBRARY_PATH to ensure that libmono is found export LD_LIBRARY_PATH=$libdir${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} # and set MONO_PATH to ensure that mscorlib.dll can be found -export MONO_PATH=$prefix/lib/mono/2.0 +export MONO_PATH=$prefix/lib/mono/4.5 REQUIRES=$( for i in "${monolist[@]}"; do