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

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog38
-rw-r--r--configure.in112
-rw-r--r--doc/pending-classes.in246
-rw-r--r--man/gacutil.162
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ChangeLog5
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Interaction.cs2
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Strings.cs103
-rwxr-xr-xmcs/class/Mono.Security/Mono.Security.Authenticode/AuthenticodeBase.cs184
-rwxr-xr-xmcs/class/Mono.Security/Mono.Security.Authenticode/AuthenticodeDeformatter.cs123
-rwxr-xr-xmcs/class/Mono.Security/Mono.Security.Authenticode/AuthenticodeFormatter.cs11
-rw-r--r--mcs/class/Mono.Security/Mono.Security.Authenticode/ChangeLog6
-rw-r--r--mcs/class/Mono.Security/Mono.Security.Cryptography/ChangeLog5
-rw-r--r--mcs/class/Mono.Security/Mono.Security.Cryptography/RSAManaged.cs10
-rw-r--r--mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ChangeLog9
-rw-r--r--mcs/class/Mono.Security/Mono.Security.Protocol.Tls/HttpsClientStream.cs5
-rw-r--r--mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs4
-rw-r--r--mcs/class/Mono.Security/Mono.Security.X509/ChangeLog5
-rwxr-xr-xmcs/class/Mono.Security/Mono.Security.X509/X509Chain.cs9
-rwxr-xr-xmcs/class/Mono.Security/Mono.Security.X509/X509Store.cs31
-rwxr-xr-xmcs/class/System.Data/System.Data.SqlClient/ChangeLog4
-rw-r--r--mcs/class/System.Data/System.Data.SqlClient/SqlTransaction.cs3
-rw-r--r--mcs/class/System.Data/System.Data/ChangeLog39
-rw-r--r--mcs/class/System.Data/System.Data/DataRow.cs8
-rw-r--r--mcs/class/System.Data/System.Data/DataRowCollection.cs2
-rw-r--r--mcs/class/System.Data/System.Data/DataSet.cs40
-rw-r--r--mcs/class/System.Data/System.Data/DataTable.cs32
-rw-r--r--mcs/class/System.Data/Test/System.Data.SqlClient/SqlTransactionTest.cs85
-rw-r--r--mcs/class/System.Data/Test/System.Data/ChangeLog12
-rw-r--r--mcs/class/System.Data/Test/System.Data/DataRowTest.cs37
-rw-r--r--mcs/class/System.Data/Test/System.Data/DataSetTest.cs69
-rw-r--r--mcs/class/System.Drawing/System.Drawing/ChangeLog20
-rw-r--r--mcs/class/System.Drawing/System.Drawing/Font.cs67
-rwxr-xr-xmcs/class/System.Drawing/System.Drawing/Graphics.cs13
-rw-r--r--mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs13
-rw-r--r--mcs/class/System.Web.Services/System.Web.Services.Protocols/ChangeLog5
-rwxr-xr-xmcs/class/System.Web.Services/System.Web.Services.Protocols/WebServiceHelper.cs4
-rw-r--r--mcs/class/System.Web/System.Web.Caching/Cache.cs4
-rw-r--r--mcs/class/System.Web/System.Web.Caching/CacheEntry.cs2
-rw-r--r--mcs/class/System.Web/System.Web.Caching/CacheExpires.cs4
-rw-r--r--mcs/class/System.Web/System.Web.Caching/ChangeLog5
-rw-r--r--mcs/class/System.Web/System.Web.Caching/ExpiresBuckets.cs2
-rw-r--r--mcs/class/System.Web/System.Web.Compilation/BuildProviderResultFlags.cs41
-rw-r--r--mcs/class/System.Web/System.Web.Compilation/ChangeLog4
-rw-r--r--mcs/class/System.Web/System.Web.Compilation/IImplicitResourceProvider.cs42
-rw-r--r--mcs/class/System.Web/System.Web.Compilation/IResourceReader.cs39
-rw-r--r--mcs/class/System.Web/System.Web.Compilation/ImplicitResourceKey.cs43
-rw-r--r--mcs/class/System.Web/System.Web.Compilation/WebServiceCompiler.cs2
-rw-r--r--mcs/class/System.Web/System.Web.Handlers/ChangeLog5
-rw-r--r--mcs/class/System.Web/System.Web.Handlers/TraceHandler.cs21
-rw-r--r--mcs/class/System.Web/System.Web.SessionState/ChangeLog10
-rw-r--r--mcs/class/System.Web/System.Web.SessionState/HttpSessionState.cs2
-rw-r--r--mcs/class/System.Web/System.Web.SessionState/SessionStateModule.cs2
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/AdRotator.cs6
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/BaseCompareValidator.cs2
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog9
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/RadioButton.cs30
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/TableStyle.cs4
-rw-r--r--mcs/class/System.Web/System.Web.UI/ChangeLog10
-rw-r--r--mcs/class/System.Web/System.Web.UI/Control.cs8
-rwxr-xr-xmcs/class/System.Web/System.Web.UI/TemplateParser.cs3
-rw-r--r--mcs/class/System.Web/System.Web/ChangeLog65
-rw-r--r--mcs/class/System.Web/System.Web/HttpApplication.cs20
-rw-r--r--mcs/class/System.Web/System.Web/HttpApplicationFactory.cs66
-rw-r--r--mcs/class/System.Web/System.Web/HttpContext.cs10
-rw-r--r--mcs/class/System.Web/System.Web/HttpRequest.cs8
-rw-r--r--mcs/class/System.Web/System.Web/HttpResponse.cs8
-rw-r--r--mcs/class/System.Web/System.Web/HttpRuntime.cs40
-rw-r--r--mcs/class/System.Web/System.Web/HttpServerUtility.cs45
-rw-r--r--mcs/class/System.Web/System.Web/HttpStaticObjectsCollection.cs17
-rw-r--r--mcs/class/System.Web/System.Web/HttpUtility.cs2
-rw-r--r--mcs/class/System.Web/System.Web/HttpValueCollection.cs2
-rw-r--r--mcs/class/System.Web/System.Web/TimeoutManager.cs2
-rw-r--r--mcs/class/System.Web/System.Web/TraceContext.cs6
-rw-r--r--mcs/class/System.XML/Mono.Xml.Xsl/ChangeLog9
-rw-r--r--mcs/class/System.XML/Mono.Xml.Xsl/HtmlEmitter.cs5
-rwxr-xr-xmcs/class/System.XML/Mono.Xml.Xsl/ScriptCompilerInfo.cs20
-rw-r--r--mcs/class/System.XML/System.Xml.Schema/BuiltInDatatype.cs52
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/ChangeLog6
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/SchemaDataValueType.cs10
-rwxr-xr-xmcs/class/System.XML/System.Xml.Serialization/ChangeLog5
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/CodeIdentifier.cs2
-rw-r--r--mcs/class/System/System.ComponentModel/AttributeCollection.cs2
-rw-r--r--mcs/class/System/System.ComponentModel/ChangeLog5
-rwxr-xr-xmcs/class/System/System.IO/ChangeLog11
-rw-r--r--mcs/class/System/System.IO/DefaultWatcher.cs30
-rw-r--r--mcs/class/System/System.Net/ChangeLog30
-rw-r--r--mcs/class/System/System.Net/HttpWebRequest.cs24
-rw-r--r--mcs/class/System/System.Net/HttpWebResponse.cs14
-rw-r--r--mcs/class/System/System.Net/ServicePoint.cs6
-rw-r--r--mcs/class/System/System.Net/ServicePointManager.cs8
-rw-r--r--mcs/class/System/System.Net/WebConnection.cs75
-rw-r--r--mcs/class/System/System.Net/WebHeaderCollection.cs13
-rwxr-xr-xmcs/class/corlib/Mono.Security.Authenticode/AuthenticodeBase.cs184
-rwxr-xr-xmcs/class/corlib/Mono.Security.Authenticode/AuthenticodeDeformatter.cs124
-rwxr-xr-xmcs/class/corlib/Mono.Security.Authenticode/ChangeLog5
-rw-r--r--mcs/class/corlib/Mono.Security.Cryptography/ChangeLog5
-rw-r--r--mcs/class/corlib/Mono.Security.Cryptography/RSAManaged.cs8
-rw-r--r--mcs/class/corlib/Mono.Security.X509/ChangeLog4
-rwxr-xr-xmcs/class/corlib/Mono.Security.X509/X509Chain.cs9
-rw-r--r--mcs/class/corlib/System.IO/ChangeLog8
-rw-r--r--mcs/class/corlib/System.IO/UnexceptionalStreamReader.cs149
-rw-r--r--mcs/class/corlib/System.IO/UnexceptionalStreamWriter.cs128
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/ChangeLog21
-rwxr-xr-xmcs/class/corlib/System.Reflection.Emit/CustomAttributeBuilder.cs18
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs7
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs3
-rw-r--r--mcs/class/corlib/System.Runtime.InteropServices/ChangeLog6
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/UnmanagedType.cs1
-rw-r--r--mcs/class/corlib/System.Security.Cryptography.X509Certificates/ChangeLog4
-rw-r--r--mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate.cs23
-rw-r--r--mcs/class/corlib/System.Security.Permissions/ChangeLog6
-rw-r--r--mcs/class/corlib/System.Security.Permissions/PrincipalPermission.cs7
-rw-r--r--mcs/class/corlib/System.Threading/ChangeLog5
-rwxr-xr-xmcs/class/corlib/System.Threading/Timer.cs3
-rw-r--r--mcs/class/corlib/System/Activator.cs14
-rwxr-xr-xmcs/class/corlib/System/AppDomain.cs4
-rw-r--r--mcs/class/corlib/System/ChangeLog39
-rw-r--r--mcs/class/corlib/System/Console.cs6
-rw-r--r--mcs/class/corlib/System/Convert.cs29
-rw-r--r--mcs/class/corlib/System/DateTime.cs16
-rw-r--r--mcs/class/corlib/Test/System/ChangeLog5
-rwxr-xr-xmcs/class/corlib/Test/System/ConvertTest.cs12
-rwxr-xr-xmcs/class/corlib/corlib.dll.sources2
-rw-r--r--mcs/ilasm/AssemblyInfo.cs2
-rw-r--r--mcs/mcs/AssemblyInfo.cs2
-rwxr-xr-xmcs/mcs/ChangeLog31
-rwxr-xr-xmcs/mcs/cs-parser.jay33
-rwxr-xr-xmcs/mcs/expression.cs6
-rwxr-xr-xmcs/mcs/namespace.cs8
-rw-r--r--mcs/nunit20/core/Makefile2
-rw-r--r--mcs/nunit20/framework/Makefile2
-rw-r--r--mcs/nunit20/util/Makefile2
-rwxr-xr-xmcs/tests/ChangeLog10
-rw-r--r--mcs/tests/Makefile3
-rw-r--r--mcs/tests/test-280.cs4
-rw-r--r--mcs/tests/test-292.cs11
-rw-r--r--mcs/tools/security/AssemblyInfo.cs2
-rw-r--r--mcs/tools/security/ChangeLog10
-rw-r--r--mcs/tools/security/MakeCert.cs11
-rwxr-xr-xmcs/tools/security/certmgr.cs34
-rw-r--r--mono/dis/get.c1
-rw-r--r--mono/interpreter/ChangeLog6
-rw-r--r--mono/interpreter/interp.c2
-rw-r--r--mono/interpreter/mintops.h10
-rw-r--r--mono/io-layer/ChangeLog91
-rw-r--r--mono/io-layer/daemon.c62
-rw-r--r--mono/io-layer/handles-private.h52
-rw-r--r--mono/io-layer/handles.c166
-rw-r--r--mono/io-layer/io.c263
-rw-r--r--mono/io-layer/mutexes.c20
-rw-r--r--mono/io-layer/sockets.c347
-rw-r--r--mono/io-layer/threads.c12
-rw-r--r--mono/io-layer/timed-thread.c2
-rw-r--r--mono/io-layer/wait.c12
-rw-r--r--mono/io-layer/wapi-private.h3
-rw-r--r--mono/metadata/ChangeLog133
-rw-r--r--mono/metadata/appdomain.c14
-rw-r--r--mono/metadata/assembly.c14
-rw-r--r--mono/metadata/class.c2
-rw-r--r--mono/metadata/debug-mono-symfile.c2
-rw-r--r--mono/metadata/filewatcher.c13
-rw-r--r--mono/metadata/gc.c72
-rw-r--r--mono/metadata/locales.c21
-rw-r--r--mono/metadata/marshal.c255
-rw-r--r--mono/metadata/metadata.c106
-rw-r--r--mono/metadata/object.c10
-rw-r--r--mono/metadata/object.h6
-rw-r--r--mono/metadata/process.c6
-rw-r--r--mono/metadata/reflection.c24
-rw-r--r--mono/metadata/socket-io.c52
-rw-r--r--mono/metadata/socket-io.h15
-rw-r--r--mono/mini/ChangeLog54
-rw-r--r--mono/mini/exceptions-x86.c6
-rw-r--r--mono/mini/inssel-long32.brg19
-rw-r--r--mono/mini/inssel-ppc.brg20
-rw-r--r--mono/mini/inssel-x86.brg2
-rw-r--r--mono/mini/mini-ppc.c17
-rw-r--r--mono/mini/mini-s390.c2
-rw-r--r--mono/mini/mini-sparc.c1
-rw-r--r--mono/mini/mini-x86.c2
-rw-r--r--mono/mini/mini.c94
-rw-r--r--mono/mini/mini.h1
-rw-r--r--mono/tests/Makefile.am1
-rw-r--r--mono/tests/libtest.c40
-rwxr-xr-xmono/tests/pinvoke2.cs18
-rwxr-xr-xmono/tests/pinvoke3.cs14
-rw-r--r--mono/tests/typeof-ptr.cs20
-rw-r--r--web/pending-classes.in246
-rw-r--r--web/web/masterinfos/.cvsignore1
-rw-r--r--web/web/masterinfos/Makefile96
190 files changed, 3307 insertions, 2510 deletions
diff --git a/ChangeLog b/ChangeLog
index bf710d6e16c..7c4aa6bea3e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,41 +1,3 @@
-2004-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * configure.in: added check for kqueue. Patch from Geoff Norton
- in HEAD.
-
-2004-08-17 Dick Porter <dick@ximian.com>
-
- * configure.in: Correct intl library for FreeBSD and OpenBSD.
- Fixes bug 62884, patch by Tom McLaughlin (tmclaugh@sdf.lonestar.org).
-
-2004-07-27 John Merryweather Cooper <john_m_cooper@yahoo.com>
- * configure.in: Disable __thread test (TLS) for FreeBSD as
- it succeeds on FreeBSD 5.x when it should fail. Fix pthread
- library detection for FreeBSD 4.x since pthread is embedded
- in libc_r on this platform. Fix some typos in my host
- regexes for freebsd.
-
-2004-07-23 Dick Porter <dick@ximian.com>
-
- * configure.in: Changes for FreeBSD thread support by John
- Merryweather Cooper <john_m_cooper@yahoo.com>.
-
-2004-07-03 Zoltan Varga <vargaz@freemail.hu>
-
- * configure.in: Add --with-tls option to replace the misnamed
- --with-nptl option.
-
-2004-06-30 Zoltan Varga <vargaz@freemail.hu>
-
- * configure.in: Fix trunc check + add SPARC64 defines.
-
- * marshal.c (mono_marshal_get_managed_wrapper): Handle returning
- delegates from a delegate. Fixes #61033.
-
-2004-06-29 Jackson Harper <jackson@ximian.com>
-
- * man/gacutil.1: Update man with new command line options.
-
2004-06-29 Raja R Harinath <rharinath@novell.com>
Atsushi Enomoto <atsushi@ximian.com>
diff --git a/configure.in b/configure.in
index 663a5ec561f..248763c5a0d 100644
--- a/configure.in
+++ b/configure.in
@@ -1,7 +1,7 @@
AC_INIT(README)
AC_CANONICAL_SYSTEM
AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(mono,1.0.1)
+AM_INIT_AUTOMAKE(mono,1.0)
AM_MAINTAINER_MODE
AC_PROG_LN_S
@@ -67,62 +67,7 @@ case "$host" in
libdl=
libgc_threads=no
;;
-# these flags will work for all versions of -STABLE
-#
- *-*-*freebsd4*)
- platform_win32=no
- if test "x$PTHREAD_CFLAGS" = "x"; then
- CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_FREEBSD_THREADS"
- libmono_cflags="-D_THREAD_SAFE"
- else
- CPPFLAGS="$CPPFLAGS $PTHREAD_CFLAGS -DGC_FREEBSD_THREADS"
- libmono_cflags="$PTHREAD_CFLAGS"
- fi
- if test "x$PTHREAD_LIBS" = "x"; then
- LDFLAGS="$LDFLAGS -pthread"
- libmono_ldflags="-pthread"
- else
- LDFLAGS="$LDFLAGS $PTHREAD_LIBS"
- libmono_ldflags="$PTHREAD_LIBS"
- fi
- need_link_unlink=yes
- AC_DEFINE(PTHREAD_POINTER_ID)
- libdl=
- libgc_threads=pthreads
-# TLS isn't implemented at all on -STABLE
- with_nptl=no
- with_tls=pthread
- ;;
-# older versions of -CURRENT will break with these flags but testing
-# indicates these older versions won't run Mono anyway
-#
- *-*-*freebsd5*)
- platform_win32=no
- if test "x$PTHREAD_CFLAGS" = "x"; then
- CPPFLAGS="$CPPFLAGS -DGC_FREEBSD_THREADS"
- libmono_cflags=
- else
- CPPFLAGS="$CPPFLAGS $PTHREAD_CFLAGS -DGC_FREEBSD_THREADS"
- libmono_cflags="$PTHREAD_CFLAGS"
- fi
- if test "x$PTHREAD_LIBS" = "x"; then
- LDFLAGS="$LDFLAGS -lpthread"
- libmono_ldflags="-lpthread"
- else
- LDFLAGS="$LDFLAGS $PTHREAD_LIBS"
- libmono_ldflags="$PTHREAD_LIBS"
- fi
- need_link_unlink=yes
- AC_DEFINE(PTHREAD_POINTER_ID)
- libdl=
- libgc_threads=pthreads
-# TLS is only partially implemented on -CURRENT (compiler support
-# but NOT library support)
-#
- with_nptl=no
- with_tls=pthread
- ;;
- *-*-*openbsd*)
+ *-*-*freebsd*|*-*-*openbsd*)
platform_win32=no
CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_FREEBSD_THREADS"
libmono_cflags="-D_THREAD_SAFE"
@@ -303,21 +248,9 @@ AC_ARG_WITH(gc, [ --with-gc=boehm,included,none],[gc=$with_gc],[gc=$gc_default]
# Enable support for fast thread-local storage
# Some systems have broken support, so we allow to disable it.
-AC_ARG_WITH(tls, [ --with-tls=__thread,pthread select Thread Local Storage implementation],[],[with_tls=__thread])
-
-# Kept for compatibility
-AC_ARG_WITH(nptl, [ --with-nptl=yes,no deprecated, use --with-tls instead],[],[with_nptl=default])
-
-if test "x$with_nptl" != "xdefault"; then
- if test "x$with_nptl" = "xyes"; then
- AC_MSG_WARN([--with-nptl=yes is deprecated, use --with-tls=__thread option instead.])
- with_tls=__thread
- fi
- if test "x$with_nptl" = "xno"; then
- AC_MSG_WARN([--with-nptl=no is deprecated, use --with-tls=pthread option instead.])
- with_tls=pthread
- fi
-fi
+# This is misnamed: __thread support has no relation to NPTL,
+# but people already use it...
+AC_ARG_WITH(nptl, [ --with-nptl=yes,no enable/disable support for __thread support],[],[with_nptl=yes])
# Enable support for using sigaltstack for SIGSEGV and stack overflow handling
# This does not work on some platforms (bug #55253)
@@ -466,7 +399,6 @@ if test x$platform_win32 = xno; then
AC_CHECK_FUNCS(getpwuid_r)
AC_CHECK_FUNCS(getresuid)
AC_CHECK_FUNCS(setresuid)
- AC_CHECK_FUNCS(kqueue)
dnl ******************************************************************
dnl *** Check for large file support ***
@@ -709,17 +641,7 @@ if test x$platform_win32 = xno; then
dnl *****************************
dnl *** Checks for libpthread ***
dnl *****************************
-# on FreeBSD -STABLE, the pthreads functions all reside in libc_r
-# and libpthread does not exist
-#
- case "${host}" in
- *-*-*freebsd4*)
- AC_CHECK_LIB(pthread, main, LIBS="$LIBS -pthread")
- ;;
- *)
- AC_CHECK_LIB(pthread, main, LIBS="$LIBS -lpthread")
- ;;
- esac
+ AC_CHECK_LIB(pthread, main, LIBS="$LIBS -lpthread")
AC_CHECK_HEADERS(pthread.h)
AC_CHECK_FUNCS(pthread_mutex_timedlock)
AC_CHECK_FUNCS(pthread_getattr_np pthread_attr_get_np)
@@ -740,7 +662,7 @@ if test x$platform_win32 = xno; then
dnl *** Checks for working __thread ***
dnl ***********************************
AC_MSG_CHECKING(for working __thread)
- if test "x$with_tls" != "x__thread"; then
+ if test "x$with_nptl" != "xyes"; then
AC_MSG_RESULT(disabled)
else
AC_TRY_RUN([
@@ -1032,9 +954,8 @@ ac_cv_c_socklen_t=yes
])
AC_CHECK_FUNCS(trunc, , AC_MSG_CHECKING(for trunc in math.h)
- # Simply calling trunc (0.0) is no good since gcc will optimize the call away
AC_TRY_LINK([#include <math.h>],
- [ static void *p = &trunc; ],
+ [ trunc(0.0); ],
[
AC_DEFINE(HAVE_TRUNC)
AC_MSG_RESULT(yes)
@@ -1175,11 +1096,7 @@ case "$host" in
JIT_SUPPORTED=no
;;
sparc*-*-*)
- if test "x$ac_cv_sizeof_void_p" = "x8"; then
- TARGET=SPARC64
- else
- TARGET=SPARC
- fi
+ TARGET=SPARC;
arch_target=sparc;
JIT_SUPPORTED=yes
ACCESS_UNALIGNED="no"
@@ -1267,14 +1184,6 @@ case "$host" in
LIBC="libc.so.12"
INTL="libintl.so.0"
;;
- *-*-*freebsd*)
- LIBC="libc.so"
- INTL="libintl.so"
- ;;
- *-*-*openbsd*)
- LIBC="libc.so"
- INTL="libintl.so"
- ;;
esac
AC_SUBST(libsuffix)
@@ -1318,7 +1227,6 @@ AM_CONDITIONAL(INSTALL_2_0, test x$PREVIEW = xyes)
AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes)
AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno)
AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
-AM_CONDITIONAL(SPARC64, test x$TARGET = xSPARC64)
AM_CONDITIONAL(X86, test x$TARGET = xX86)
AM_CONDITIONAL(AMD64, test x$TARGET = xAMD64)
AM_CONDITIONAL(ALPHA, test x$TARGET = xALPHA)
@@ -1391,7 +1299,7 @@ echo "
GC: $gc
ICU: $enable_icu
- TLS: $with_tls
+ __thread: $with_nptl
SIGALTSTACK: $with_sigaltstack
Engine: $jit_status
2.0 Alpha: $PREVIEW
diff --git a/doc/pending-classes.in b/doc/pending-classes.in
new file mode 100644
index 00000000000..1cdb5a4cb36
--- /dev/null
+++ b/doc/pending-classes.in
@@ -0,0 +1,246 @@
+System.Object
+System.Exception
+System.ValueType
+System.Delegate
+System.MulticastDelegate
+System.Enum
+System.Activator
+System.ArgIterator
+System.__ComObject
+System.TypedReference
+System.Security.AllowPartiallyTrustedCallersAttribute
+System.Runtime.Serialization.Formatter
+System.Runtime.Serialization.FormatterConverter
+System.Runtime.Serialization.FormatterServices
+System.Runtime.Serialization.ObjectIDGenerator
+System.Runtime.Serialization.ObjectManager
+System.Reflection.ModuleResolveEventHandler
+System.Reflection.Pointer
+System.Globalization.CompareInfo
+System.Globalization.HebrewCalendar
+System.Globalization.HijriCalendar
+System.Globalization.JapaneseCalendar
+System.Globalization.KoreanCalendar
+System.Globalization.SortKey
+System.Globalization.StringInfo
+System.Globalization.TaiwanCalendar
+System.Globalization.TextElementEnumerator
+System.Globalization.TextInfo
+System.Globalization.ThaiBuddhistCalendar
+System.IO.IsolatedStorage.IsolatedStorageFile
+System.Reflection.Emit.MethodRental
+System.Runtime.CompilerServices.AccessedThroughPropertyAttribute
+System.Runtime.CompilerServices.CallConvCdecl
+System.Runtime.CompilerServices.CallConvStdcall
+System.Runtime.CompilerServices.CallConvThiscall
+System.Runtime.CompilerServices.CallConvFastcall
+System.Runtime.CompilerServices.CustomConstantAttribute
+System.Runtime.CompilerServices.DateTimeConstantAttribute
+System.Runtime.CompilerServices.DiscardableAttribute
+System.Runtime.CompilerServices.DecimalConstantAttribute
+System.Runtime.CompilerServices.CompilationRelaxationsAttribute
+System.Runtime.CompilerServices.CompilerGlobalScopeAttribute
+System.Runtime.CompilerServices.IDispatchConstantAttribute
+System.Runtime.CompilerServices.IsVolatile
+System.Runtime.CompilerServices.IUnknownConstantAttribute
+System.Runtime.CompilerServices.RequiredAttributeAttribute
+System.Runtime.InteropServices.ArrayWithOffset
+System.Runtime.InteropServices.DispIdAttribute
+System.Runtime.InteropServices.ClassInterfaceType
+System.Runtime.InteropServices.ClassInterfaceAttribute
+System.Runtime.InteropServices.ComVisibleAttribute
+System.Runtime.InteropServices.LCIDConversionAttribute
+System.Runtime.InteropServices.ComRegisterFunctionAttribute
+System.Runtime.InteropServices.ComUnregisterFunctionAttribute
+System.Runtime.InteropServices.ProgIdAttribute
+System.Runtime.InteropServices.ImportedFromTypeLibAttribute
+System.Runtime.InteropServices.IDispatchImplType
+System.Runtime.InteropServices.IDispatchImplAttribute
+System.Runtime.InteropServices.ComSourceInterfacesAttribute
+System.Runtime.InteropServices.ComConversionLossAttribute
+System.Runtime.InteropServices.TypeLibTypeFlags
+System.Runtime.InteropServices.TypeLibFuncFlags
+System.Runtime.InteropServices.TypeLibVarFlags
+System.Runtime.InteropServices.TypeLibTypeAttribute
+System.Runtime.InteropServices.TypeLibFuncAttribute
+System.Runtime.InteropServices.TypeLibVarAttribute
+System.Runtime.InteropServices.ComImportAttribute
+System.Runtime.InteropServices.PreserveSigAttribute
+System.Runtime.InteropServices.ComAliasNameAttribute
+System.Runtime.InteropServices.AutomationProxyAttribute
+System.Runtime.InteropServices.PrimaryInteropAssemblyAttribute
+System.Runtime.InteropServices.CoClassAttribute
+System.Runtime.InteropServices.ComEventInterfaceAttribute
+System.Runtime.InteropServices.COMException
+System.Runtime.InteropServices.ComMemberType
+System.Runtime.InteropServices.CurrencyWrapper
+System.Runtime.InteropServices.DispatchWrapper
+System.Runtime.InteropServices.ErrorWrapper
+System.Runtime.InteropServices.ExtensibleClassFactory
+System.Runtime.InteropServices.HandleRef
+System.Runtime.InteropServices.InvalidComObjectException
+System.Runtime.InteropServices.InvalidOleVariantTypeException
+System.Runtime.InteropServices.TypeLibImporterFlags
+System.Runtime.InteropServices.ExporterEventKind
+System.Runtime.InteropServices.ITypeLibExporterNotifySink
+System.Runtime.InteropServices.ITypeLibConverter
+System.Runtime.InteropServices.MarshalDirectiveException
+System.Runtime.InteropServices.ObjectCreationDelegate
+System.Runtime.InteropServices.RuntimeEnvironment
+System.Runtime.InteropServices.RegistrationServices
+System.Runtime.InteropServices.SafeArrayRankMismatchException
+System.Runtime.InteropServices.SafeArrayTypeMismatchException
+System.Runtime.InteropServices.SEHException
+System.Runtime.InteropServices.TypeLibConverter
+System.Runtime.InteropServices.BIND_OPTS
+System.Runtime.InteropServices.UCOMIBindCtx
+System.Runtime.InteropServices.UCOMIConnectionPointContainer
+System.Runtime.InteropServices.UCOMIConnectionPoint
+System.Runtime.InteropServices.UCOMIEnumMoniker
+System.Runtime.InteropServices.CONNECTDATA
+System.Runtime.InteropServices.UCOMIEnumConnections
+System.Runtime.InteropServices.UCOMIEnumConnectionPoints
+System.Runtime.InteropServices.UCOMIEnumString
+System.Runtime.InteropServices.UCOMIEnumVARIANT
+System.Runtime.InteropServices.FILETIME
+System.Runtime.InteropServices.UCOMIMoniker
+System.Runtime.InteropServices.UCOMIPersistFile
+System.Runtime.InteropServices.UCOMIRunningObjectTable
+System.Runtime.InteropServices.STATSTG
+System.Runtime.InteropServices.UCOMIStream
+System.Runtime.InteropServices.DESCKIND
+System.Runtime.InteropServices.BINDPTR
+System.Runtime.InteropServices.UCOMITypeComp
+System.Runtime.InteropServices.TYPEKIND
+System.Runtime.InteropServices.TYPEFLAGS
+System.Runtime.InteropServices.IMPLTYPEFLAGS
+System.Runtime.InteropServices.TYPEATTR
+System.Runtime.InteropServices.FUNCDESC
+System.Runtime.InteropServices.IDLFLAG
+System.Runtime.InteropServices.IDLDESC
+System.Runtime.InteropServices.PARAMFLAG
+System.Runtime.InteropServices.PARAMDESC
+System.Runtime.InteropServices.TYPEDESC
+System.Runtime.InteropServices.ELEMDESC
+System.Runtime.InteropServices.VARDESC
+System.Runtime.InteropServices.DISPPARAMS
+System.Runtime.InteropServices.EXCEPINFO
+System.Runtime.InteropServices.FUNCKIND
+System.Runtime.InteropServices.INVOKEKIND
+System.Runtime.InteropServices.CALLCONV
+System.Runtime.InteropServices.FUNCFLAGS
+System.Runtime.InteropServices.VARFLAGS
+System.Runtime.InteropServices.UCOMITypeInfo
+System.Runtime.InteropServices.SYSKIND
+System.Runtime.InteropServices.LIBFLAGS
+System.Runtime.InteropServices.TYPELIBATTR
+System.Runtime.InteropServices.UCOMITypeLib
+System.Runtime.InteropServices.UnknownWrapper
+System.Runtime.Remoting.IObjectHandle
+System.Runtime.Remoting.IRemotingTypeInfo
+System.Runtime.Remoting.IChannelInfo
+System.Runtime.Remoting.IEnvoyInfo
+System.Runtime.Remoting.RemotingConfiguration
+System.Runtime.Remoting.TypeEntry
+System.Runtime.Remoting.ActivatedClientTypeEntry
+System.Runtime.Remoting.ActivatedServiceTypeEntry
+System.Runtime.Remoting.WellKnownClientTypeEntry
+System.Runtime.Remoting.WellKnownServiceTypeEntry
+System.Runtime.Remoting.RemotingException
+System.Runtime.Remoting.ServerException
+System.Runtime.Remoting.RemotingTimeoutException
+System.Runtime.Remoting.RemotingServices
+System.Runtime.Remoting.InternalRemotingServices
+System.Runtime.Remoting.SoapServices
+System.Runtime.Remoting.Activation.UrlAttribute
+System.Runtime.Remoting.Messaging.IMessageSink
+System.Runtime.Remoting.Messaging.AsyncResult
+System.Runtime.Remoting.Messaging.CallContext
+System.Runtime.Remoting.Messaging.ILogicalThreadAffinative
+System.Runtime.Remoting.Messaging.InternalMessageWrapper
+System.Runtime.Remoting.Messaging.IMethodCallMessage
+System.Runtime.Remoting.Messaging.MethodCallMessageWrapper
+System.Runtime.Remoting.Messaging.HeaderHandler
+System.Runtime.Remoting.Messaging.IMessageCtrl
+System.Runtime.Remoting.Messaging.IRemotingFormatter
+System.Runtime.Remoting.Messaging.ReturnMessage
+System.Runtime.Remoting.Messaging.MethodCall
+System.Runtime.Remoting.Messaging.ConstructionCall
+System.Runtime.Remoting.Messaging.MethodResponse
+System.Runtime.Remoting.Messaging.ConstructionResponse
+System.Runtime.Remoting.Messaging.MethodReturnMessageWrapper
+System.Runtime.Remoting.Messaging.OneWayAttribute
+System.Runtime.Remoting.Messaging.MessageSurrogateFilter
+System.Runtime.Remoting.Messaging.RemotingSurrogateSelector
+System.Runtime.Remoting.Contexts.CrossContextDelegate
+System.Runtime.Remoting.Contexts.ContextProperty
+System.Runtime.Remoting.Contexts.IContextPropertyActivator
+System.Runtime.Remoting.Contexts.IContributeClientContextSink
+System.Runtime.Remoting.Contexts.IContributeDynamicSink
+System.Runtime.Remoting.Contexts.IContributeEnvoySink
+System.Runtime.Remoting.Contexts.IContributeObjectSink
+System.Runtime.Remoting.Contexts.IContributeServerContextSink
+System.Runtime.Serialization.Formatters.InternalRM
+System.Runtime.Serialization.Formatters.InternalST
+System.Runtime.Serialization.Formatters.SoapMessage
+System.Runtime.Serialization.Formatters.SoapFault
+System.Runtime.Serialization.Formatters.ServerFault
+System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+System.Security.Cryptography.CryptoConfig
+System.Security.Cryptography.KeyedHashAlgorithm
+System.Security.Cryptography.HMACSHA1
+System.Security.Cryptography.MACTripleDES
+System.Security.Cryptography.MaskGenerationMethod
+System.Security.Cryptography.PasswordDeriveBytes
+System.Security.Cryptography.PKCS1MaskGenerationMethod
+System.Security.Cryptography.RC2
+System.Security.Cryptography.RC2CryptoServiceProvider
+System.Security.Cryptography.RSACryptoServiceProvider
+System.Security.Cryptography.RSAOAEPKeyExchangeDeformatter
+System.Security.Cryptography.RSAOAEPKeyExchangeFormatter
+System.Security.Cryptography.RSAPKCS1KeyExchangeDeformatter
+System.Security.Cryptography.RSAPKCS1KeyExchangeFormatter
+System.Security.Cryptography.RSAPKCS1SignatureDeformatter
+System.Security.Cryptography.RSAPKCS1SignatureFormatter
+System.Security.Cryptography.SHA1Managed
+System.Security.Cryptography.TripleDES
+System.Security.Cryptography.TripleDESCryptoServiceProvider
+System.Security.Permissions.EnvironmentPermission
+System.Security.Permissions.FileDialogPermission
+System.Security.Permissions.IsolatedStorageFilePermission
+System.Security.Permissions.PrincipalPermissionAttribute
+System.Security.Permissions.SecurityPermissionAttribute
+System.Security.Permissions.PublisherIdentityPermissionAttribute
+System.Security.Permissions.PublisherIdentityPermission
+System.Security.Permissions.ReflectionPermission
+System.Security.Permissions.RegistryPermission
+System.Security.Permissions.PrincipalPermission
+System.Security.Permissions.SiteIdentityPermission
+System.Security.Permissions.StrongNameIdentityPermission
+System.Security.Permissions.StrongNamePublicKeyBlob
+System.Security.Permissions.UIPermission
+System.Security.Permissions.UrlIdentityPermission
+System.Security.Permissions.ZoneIdentityPermission
+System.Security.Policy.ApplicationDirectory
+System.Security.Policy.ApplicationDirectoryMembershipCondition
+System.Security.Policy.FirstMatchCodeGroup
+System.Security.Policy.Hash
+System.Security.Policy.HashMembershipCondition
+System.Security.Policy.NetCodeGroup
+System.Security.Policy.PermissionRequestEvidence
+System.Security.Policy.Publisher
+System.Security.Policy.PublisherMembershipCondition
+System.Security.Policy.Site
+System.Security.Policy.SiteMembershipCondition
+System.Security.Policy.StrongName
+System.Security.Policy.StrongNameMembershipCondition
+System.Security.Policy.UnionCodeGroup
+System.Security.Policy.Url
+System.Security.Policy.UrlMembershipCondition
+System.Security.Policy.Zone
+System.Security.Policy.ZoneMembershipCondition
+System.Security.Principal.WindowsIdentity
+System.Security.Principal.WindowsImpersonationContext
+System.Security.Principal.WindowsPrincipal
+System.Threading.CompressedStack
+
diff --git a/man/gacutil.1 b/man/gacutil.1
index 704c263486f..54838e02cc6 100644
--- a/man/gacutil.1
+++ b/man/gacutil.1
@@ -24,17 +24,20 @@ convention is that assemblies must also be placed in a separate
directory for being accessed to the compiler. This is done with the
-package directive to gacutil.
.PP
-The tool allows for installation, removal, and listing of the
+The tool allows for installationl, removal, and listing of the
contents of the assembly cache.
.PP
The GAC is relative to the Mono installation prefix:
mono_prefix/lib/mono.
+.SH FLAGS
+The "-user" flag enables you to install/remove the assembly into the
+user's assembly cache, as opposed to the global one.
.PP
.SH COMMANDS
-.I -i <assembly_path> [-check_refs] [-package NAME] [-root ROOTDIR] [-gacdir GACDIR]
+.I "-i path_to_assembly" [-f] [-root ROOTDIR] [-package NAME]
.Sp
- Installs an assembly into the global assembly cache. <assembly_path>
-is the name of the file that contains the assembly manifest
+The above installs the assembly into the GAC, use the -f flag to force
+an installation an overwrite anything in there.
.Sp
The -package option can be used to also create a directory in in
prefix/lib/mono with the name NAME, and a symlink is created from
@@ -44,32 +47,18 @@ developers can reference a set of libraries at once.
The -root option is used by developers integrating this with automake
tools or packaging tools that require a prefix directory to be
specified. The root represents the "libdir" component of a prefix
-(typically prefix/lib).
-.Sp
-The -gacdir option is used to specify the GACs base directory. Once an
-assembly has been installed to a non standard gacdir the MONO_GAC_PATH
-environment variable must be used to access the assembly.
-.Sp
-The -check_refs option is used to ensure that the assembly being
-installed into the GAC does not reference any non strong named
-assemblies. Assemblies being installed to the GAC should not reference
-non strong named assemblies, however the is an optional check.
+(typically prefix/lib).
.fi
.PP
-.I "-l" [assembly_name] [-root ROOTDIR] [-gacdir GACDIR]
+.I "-l"
.Sp
-Lists the contents of the global assembly cache. When the
-<assembly_name> parameter is specified only matching assemblies are
-listed.
+Lists the contents of the Global Assembly Cache
.PP
-.I "-u" <assembly_display_name> [-package NAME] [-root ROOTDIR] [-gacdir GACDIR]
+.I "-u assembly_name [-root]"
.Sp
-Uninstalls an assembly from the global assembly cache.
-<assembly_display_name> is the name of the assembly (partial or
-fully qualified) to remove from the global assembly cache. If a
-partial name is specified all matching assemblies will be
-uninstalled. As opposed to the install option that takes a filename,
-this takes as an argument the assembly name, which looks like this:
+The above removes the given assembly name from the Global Assembly
+Cache. As opposed to the install option that takes a filename, this
+takes as an argument the assembly name, which looks like this:
.nf
MyLibrary.Something, version=1.0.0.0, publicKeyToken=xxxx,culture=neutral
.fi
@@ -80,29 +69,6 @@ to quote them.
The removal performs a greedy removal, if you only specifiy one
component like, "MyLibrary.Something", it will remove all versions of
the library.
-.Sp
-.I "-us" <assembly_path> [-package NAME] [-root ROOTDIR] [-gacdir GACDIR]
-Uninstalls an assembly using the specifed assemblies full name.
-<assembly path> is the path to an assembly. The full assembly name
-is retrieved from the specified assembly if there is an assembly in
-the GAC with a matching name, it is removed. Unlike the -u option this
-option takes a file name, like this:
-.nf
- Example: -us myDll.dll
-.fi
-.Sp
-.I "-ul" <assembly_list_file> [-package NAME] [-root ROOTDIR] [-gacdir GACDIR]
-Uninstalls one or more assemblies from the global assembly cache.
-<assembly_list_file> is the path to a test file containing a list of
-assembly names on separate lines.
-.nf
-Example -ul assembly_list.txt
-.fi
-.nf
-assembly_list.txt contents:
- assembly1,Version=1.0.0.0,Culture=en,PublicKeyToken=0123456789abcdef
- assembly2,Version=2.0.0.0,Culture=en,PublicKeyToken=0123456789abcdef
-.fi
.SH FILES
On Unix assemblies are loaded from the installation lib directory. If you set
`prefix' to /usr, the assemblies will be located in /usr/lib. On
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ChangeLog b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ChangeLog
index 594c2b007f8..38f5670f638 100644
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ChangeLog
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ChangeLog
@@ -1,3 +1,8 @@
+2004-10-05 Anirban Bhattacharjee <banirban@novell.com>
+ * Interaction.cs:
+ * Strings.cs :
+ Few important fixes
+
2004-07-22 Jambunathan K <kjambunathan@novell.com>
* Constants.cs: Fixed definitions of vbCr, vbLf, vbCrLf and
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Interaction.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Interaction.cs
index d042be15f78..4d2b278201b 100644
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Interaction.cs
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Interaction.cs
@@ -352,7 +352,7 @@ namespace Microsoft.VisualBasic {
string [] args = Environment.GetCommandLineArgs ();
if (args != null && args.Length > 1) {
- return string.Join (" ", args, 2, args.Length - 1);
+ return string.Join (" ", args, 1, args.Length - 1);
} else {
return "";
}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Strings.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Strings.cs
index ae8f92d88ba..86c558eeed8 100644
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Strings.cs
+++ b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Strings.cs
@@ -401,7 +401,21 @@ namespace Microsoft.VisualBasic
}
break;
default:
- returnstr=Convert.ToDouble(expression).ToString (style);
+ if (style.IndexOf("X") != -1
+ || style.IndexOf("x") != -1 ) {
+ returnstr = Microsoft.VisualBasic.Conversion.Hex(Convert.ToInt64(expression));
+ }
+ else
+ try
+ {
+ returnstr=Convert.ToDouble(expression).ToString (style);
+ }
+ catch (Exception ex){
+ style = "0" + style;
+ returnstr=Convert.ToDouble(expression).ToString (style);
+ }
+
+
break;
}
break;
@@ -694,6 +708,7 @@ namespace Microsoft.VisualBasic
return InStr(1, String1, String2, Compare);
}
+
/// <summary>
/// Returns an integer specifying the start position of the first occurrence of one string within another.
/// </summary>
@@ -826,17 +841,22 @@ namespace Microsoft.VisualBasic
[DefaultValue(" ")]
string Delimiter)
{
+ try
+ {
+ if (SourceArray == null)
+ throw new ArgumentException("Argument 'SourceArray' can not be null.", "SourceArray");
+ if (SourceArray.Rank > 1)
+ throw new ArgumentException("Argument 'SourceArray' can have only one dimension.", "SourceArray");
- if (SourceArray == null)
- throw new ArgumentException("Argument 'SourceArray' can not be null.", "SourceArray");
- if (SourceArray.Rank > 1)
- throw new ArgumentException("Argument 'SourceArray' can have only one dimension.", "SourceArray");
-
- string[] dest;
- dest = new string[SourceArray.Length];
+ string[] dest;
+ dest = new string[SourceArray.Length];
- SourceArray.CopyTo(dest, 0);
- return string.Join(Delimiter, dest);
+ SourceArray.CopyTo(dest, 0);
+ return string.Join(Delimiter, dest);
+ }
+ catch (System.InvalidCastException ie){
+ throw new System.ArgumentException("Invalid argument");
+ }
}
/// <summary>
@@ -854,8 +874,8 @@ namespace Microsoft.VisualBasic
/// <param name="Value">Required. Any valid String or Char expression.</param>
public static string LCase(string Value)
{
- if ((Value == null) || (Value.Length == 0))
- return String.Empty; // VB.net does this.
+ if ((Value == null) || (Value.Length == 0))
+ return Value; // comparing nunit test results say this is an exception to the return String.Empty rule
return Value.ToLower();
}
@@ -865,16 +885,18 @@ namespace Microsoft.VisualBasic
/// Returns a string containing a specified number of characters from the left side of a string.
/// </summary>
/// <param name="Str">Required. String expression from which the leftmost characters are returned.</param>
- /// <param name="Length">Required. Integer expression. Numeric expression indicating how many characters to return. If 0, a zero-length string ("") is returned. If greater than or equal to the number of characters in Str, the entire string is returned.</param>
- public static string Left(string Str,
- int Length)
+ /// <param name="Length">Required. Integer expression. Numeric expression indicating how many characters to return.
+ /// If 0, a zero-length string ("") is returned. If greater than or equal to the number of characters in Str,
+ /// the entire string is returned.</param>
+ public static string Left(string Str, int Length)
{
if (Length < 0)
throw new ArgumentException("Argument 'Length' must be non-negative.", "Length");
- if ((Str == null) || (Str.Length == 0))
+ if ((Str == null) || (Str.Length == 0) || Length == 0)
return String.Empty; // VB.net does this.
-
- return Str.Substring(0, Length);
+ if (Length < Str.Length)
+ return Str.Substring(0, Length);
+ return Str;
}
/// <summary>
@@ -1202,16 +1224,16 @@ namespace Microsoft.VisualBasic
/// </summary>
/// <param name="Source">Required. String expression. Name of string variable.</param>
/// <param name="Length">Required. Integer expression. Length of returned string.</param>
- public static string RSet(string Source,
- int Length)
+ public static string RSet(string Source, int Length)
{
if (Source == null)
Source = String.Empty;
if (Length < 0)
throw new ArgumentOutOfRangeException("Length", "Length must be non-negative.");
-
- return Source.PadLeft(Length);
+ if (Length > Source.Length)
+ return Source.PadLeft(Length);
+ return Source.Substring(0, Length);
}
/// <summary>
@@ -1235,7 +1257,7 @@ namespace Microsoft.VisualBasic
/// <param name="Compare">Optional. Numeric value indicating the comparison to use when evaluating substrings. See Settings for values.</param>
public static string[] Split(string Expression,
[Optional]
- [DefaultValue(" ")]
+ [DefaultValue("")]
string Delimiter,
[Optional]
[DefaultValue(-1)]
@@ -1245,30 +1267,37 @@ namespace Microsoft.VisualBasic
[DefaultValue(CompareMethod.Binary)]
CompareMethod Compare)
{
-
-
if (Expression == null)
return new string[1];
- if ((Delimiter == null) || (Delimiter.Length == 0))
- {
+ if ((Delimiter == null) || (Delimiter.Length == 0)) {
string [] ret = new string[1];
ret[0] = Expression;
return ret;
}
if (Limit == 0)
Limit = 1;
-
- if (Limit < -1)
+ else if (Limit < -1)
throw new OverflowException("Arithmetic operation resulted in an overflow.");
- switch (Compare)
- {
- case CompareMethod.Binary:
- return Expression.Split(Delimiter.ToCharArray(0, 1), Limit);
- case CompareMethod.Text:
- return Expression.Split(Delimiter.ToCharArray(0, 1), Limit);
- default:
- throw new System.ArgumentException("Argument 'Compare' must be CompareMethod.Binary or CompareMethod.Text.", "Compare");
+
+ if (Limit != -1) {
+ switch (Compare){
+ case CompareMethod.Binary:
+ return Expression.Split(Delimiter.ToCharArray(0, 1), Limit);
+ case CompareMethod.Text:
+ return Expression.Split(Delimiter.ToCharArray(0, 1), Limit);
+ default:
+ throw new System.ArgumentException("Argument 'Compare' must be CompareMethod.Binary or CompareMethod.Text.", "Compare");
+ }
+ } else {
+ switch (Compare) {
+ case CompareMethod.Binary:
+ return Expression.Split(Delimiter.ToCharArray(0, 1));
+ case CompareMethod.Text:
+ return Expression.Split(Delimiter.ToCharArray(0, 1));
+ default:
+ throw new System.ArgumentException("Argument 'Compare' must be CompareMethod.Binary or CompareMethod.Text.", "Compare");
+ }
}
}
diff --git a/mcs/class/Mono.Security/Mono.Security.Authenticode/AuthenticodeBase.cs b/mcs/class/Mono.Security/Mono.Security.Authenticode/AuthenticodeBase.cs
index 63fbab93a8c..c2d609ecec2 100755
--- a/mcs/class/Mono.Security/Mono.Security.Authenticode/AuthenticodeBase.cs
+++ b/mcs/class/Mono.Security/Mono.Security.Authenticode/AuthenticodeBase.cs
@@ -5,9 +5,7 @@
// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-// (C) 2004 Novell (http://www.novell.com)
-//
-
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -58,63 +56,167 @@ namespace Mono.Security.Authenticode {
public const string spcIndirectDataContext = "1.3.6.1.4.1.311.2.1.4";
- internal byte[] rawData;
+ private byte[] fileblock;
+ private FileStream fs;
+ private int blockNo;
+ private int blockLength;
+ private int peOffset;
+ private int dirSecurityOffset;
+ private int dirSecuritySize;
public AuthenticodeBase ()
{
+ fileblock = new byte [4096];
}
- protected byte[] HashFile (string fileName, string hashName)
+ internal void Open (string filename)
{
- FileStream fs = new FileStream (fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
- byte[] file = new byte [fs.Length];
- fs.Read (file, 0, file.Length);
- fs.Close ();
+ if (fs != null)
+ Close ();
+ fs = new FileStream (filename, FileMode.Open, FileAccess.Read, FileShare.Read);
+ }
- // MZ - DOS header
- if (BitConverterLE.ToUInt16 (file, 0) != 0x5A4D)
- return null;
+ internal void Close ()
+ {
+ if (fs != null) {
+ fs.Close ();
+ fs = null;
+ blockNo = 0;
+ }
+ }
- // find offset of PE header
- int peOffset = BitConverterLE.ToInt32 (file, 60);
- if (peOffset > file.Length)
- return null;
+ internal bool ReadFirstBlock ()
+ {
+ if (fs == null)
+ return false;
+
+ fs.Position = 0;
+ // read first block - it will include (100% sure)
+ // the MZ header and (99.9% sure) the PE header
+ blockLength = fs.Read (fileblock, 0, fileblock.Length);
+ blockNo = 1;
+ if (blockLength < 64)
+ return false; // invalid PE file
+
+ // 1. Validate the MZ header informations
+ // 1.1. Check for magic MZ at start of header
+ if (BitConverterLE.ToUInt16 (fileblock, 0) != 0x5A4D)
+ return false;
+
+ // 1.2. Find the offset of the PE header
+ peOffset = BitConverterLE.ToInt32 (fileblock, 60);
+ if (peOffset > fileblock.Length) {
+ // just in case (0.1%) this can actually happen
+ string msg = String.Format (Locale.GetText (
+ "Header size too big (> {0} bytes)."),
+ fileblock.Length);
+ throw new NotSupportedException (msg);
+ }
+ if (peOffset > fs.Length)
+ return false;
- // PE - NT header
- if (BitConverterLE.ToUInt16 (file, peOffset) != 0x4550)
- return null;
+ // 2. Read between DOS header and first part of PE header
+ // 2.1. Check for magic PE at start of header
+ if (BitConverterLE.ToUInt16 (fileblock, peOffset) != 0x4550)
+ return false;
- // IMAGE_DIRECTORY_ENTRY_SECURITY
- int dirSecurityOffset = BitConverterLE.ToInt32 (file, peOffset + 152);
- int dirSecuritySize = BitConverterLE.ToInt32 (file, peOffset + 156);
+ // 2.2. Locate IMAGE_DIRECTORY_ENTRY_SECURITY (offset and size)
+ dirSecurityOffset = BitConverterLE.ToInt32 (fileblock, peOffset + 152);
+ dirSecuritySize = BitConverterLE.ToInt32 (fileblock, peOffset + 156);
+
+ return true;
+ }
+
+ internal byte[] GetSecurityEntry ()
+ {
+ if (blockNo < 1)
+ ReadFirstBlock ();
if (dirSecuritySize > 8) {
- rawData = new byte [dirSecuritySize - 8];
- Buffer.BlockCopy (file, dirSecurityOffset + 8, rawData, 0, rawData.Length);
-/* DEBUG
- FileStream debug = new FileStream (fileName + ".sig", FileMode.Create, FileAccess.Write);
- debug.Write (rawData, 0, rawData.Length);
- debug.Close ();*/
+ // remove header from size (not ASN.1 based)
+ byte[] secEntry = new byte [dirSecuritySize - 8];
+ // position after header and read entry
+ fs.Position = dirSecurityOffset + 8;
+ fs.Read (secEntry, 0, secEntry.Length);
+ return secEntry;
+ }
+ return null;
+ }
+
+ // returns null if the file isn't signed
+ internal byte[] GetHash (HashAlgorithm hash)
+ {
+ if (blockNo < 1)
+ ReadFirstBlock ();
+ fs.Position = blockLength;
+
+ // hash the rest of the file
+ long n = fs.Length - blockLength;
+ // minus any authenticode signature (with 8 bytes header)
+ if (dirSecurityOffset > 0) {
+ // it is also possible that the signature block
+ // starts within the block in memory (small EXE)
+ if (dirSecurityOffset < blockLength) {
+ blockLength = dirSecurityOffset;
+ n = 0;
+ }
+ else
+ n -= (dirSecuritySize);
}
- else
- rawData = null;
- HashAlgorithm hash = HashAlgorithm.Create (hashName);
- // 0 to 215 (216) then skip 4 (checksum)
+ // Authenticode(r) gymnastics
+ // Hash from (generally) 0 to 215 (216 bytes)
int pe = peOffset + 88;
- hash.TransformBlock (file, 0, pe, file, 0);
+ hash.TransformBlock (fileblock, 0, pe, fileblock, 0);
+ // then skip 4 for checksum
pe += 4;
- // 220 to 279 (60) then skip 8 (IMAGE_DIRECTORY_ENTRY_SECURITY)
- hash.TransformBlock (file, pe, 60, file, pe);
+ // Continue hashing from (generally) 220 to 279 (60 bytes)
+ hash.TransformBlock (fileblock, pe, 60, fileblock, pe);
+ // then skip 8 bytes for IMAGE_DIRECTORY_ENTRY_SECURITY
pe += 68;
- // 288 to end of file
- int n = file.Length - pe;
- // minus any authenticode signature (with 8 bytes header)
- if (dirSecurityOffset != 0)
- n -= (dirSecuritySize);
- hash.TransformFinalBlock (file, pe, n);
+ // everything is present so start the hashing
+ if (n == 0) {
+ // hash the (only) block
+ hash.TransformFinalBlock (fileblock, pe, blockLength - pe);
+ }
+ else {
+ // hash the last part of the first (already in memory) block
+ hash.TransformBlock (fileblock, pe, blockLength - pe, fileblock, 0);
+
+ // hash by blocks of 4096 bytes
+ long blocks = (n >> 12);
+ int remainder = (int)(n - (blocks << 12));
+ if (remainder == 0) {
+ blocks--;
+ remainder = 4096;
+ }
+ // blocks
+ while (blocks-- > 0) {
+ fs.Read (fileblock, 0, fileblock.Length);
+ hash.TransformBlock (fileblock, 0, fileblock.Length, fileblock, 0);
+ }
+ // remainder
+ if (fs.Read (fileblock, 0, remainder) != remainder)
+ return null;
+ hash.TransformFinalBlock (fileblock, 0, remainder);
+ }
return hash.Hash;
}
+
+ // for compatibility only
+ protected byte[] HashFile (string fileName, string hashName)
+ {
+ try {
+ Open (fileName);
+ HashAlgorithm hash = HashAlgorithm.Create (hashName);
+ byte[] result = GetHash (hash);
+ Close ();
+ return result;
+ }
+ catch {
+ return null;
+ }
+ }
}
}
diff --git a/mcs/class/Mono.Security/Mono.Security.Authenticode/AuthenticodeDeformatter.cs b/mcs/class/Mono.Security/Mono.Security.Authenticode/AuthenticodeDeformatter.cs
index 4d30ea38aab..ea0bd30e242 100755
--- a/mcs/class/Mono.Security/Mono.Security.Authenticode/AuthenticodeDeformatter.cs
+++ b/mcs/class/Mono.Security/Mono.Security.Authenticode/AuthenticodeDeformatter.cs
@@ -5,9 +5,7 @@
// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-// (C) 2004 Novell (http://www.novell.com)
-//
-
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -56,6 +54,9 @@ namespace Mono.Security.Authenticode {
private DateTime timestamp;
private X509Certificate signingCertificate;
private int reason;
+ private bool trustedRoot;
+ private bool trustedTimestampRoot;
+ private byte[] entry;
private X509Chain signerChain;
private X509Chain timestampChain;
@@ -69,17 +70,20 @@ namespace Mono.Security.Authenticode {
public AuthenticodeDeformatter (string fileName) : this ()
{
- if (!CheckSignature (fileName)) {
- // invalid or no signature
- if (signedHash != null)
- throw new COMException ("Invalid signature");
- // no exception is thrown when there's no signature in the PE file
- }
+ FileName = fileName;
}
public string FileName {
get { return filename; }
- set { CheckSignature (value); }
+ set {
+ Reset ();
+ try {
+ CheckSignature (value);
+ }
+ catch {
+ reason = 1;
+ }
+ }
}
public byte[] Hash {
@@ -100,7 +104,7 @@ namespace Mono.Security.Authenticode {
public bool IsTrusted ()
{
- if (rawData == null) {
+ if (entry == null) {
reason = 1;
return false;
}
@@ -110,13 +114,13 @@ namespace Mono.Security.Authenticode {
return false;
}
- if (signerChain.Root == null) {
+ if ((signerChain.Root == null) || !trustedRoot) {
reason = 6;
return false;
}
if (timestamp != DateTime.MinValue) {
- if (timestampChain.Root == null) {
+ if ((timestampChain.Root == null) || !trustedTimestampRoot) {
reason = 6;
return false;
}
@@ -138,7 +142,11 @@ namespace Mono.Security.Authenticode {
}
public byte[] Signature {
- get { return (byte[]) rawData.Clone (); }
+ get {
+ if (entry == null)
+ return null;
+ return (byte[]) entry.Clone ();
+ }
}
public DateTime Timestamp {
@@ -156,43 +164,58 @@ namespace Mono.Security.Authenticode {
private bool CheckSignature (string fileName)
{
filename = fileName;
-
- // by default we try with MD5
- string hashName = "MD5";
- // compare the signature's hash with the hash of the file
- hash = HashFile (filename, hashName);
-
- // is a signature present ?
- if (rawData == null)
+ base.Open (filename);
+ entry = base.GetSecurityEntry ();
+ if (entry == null) {
+ // no signature is present
+ reason = 1;
+ base.Close ();
return false;
+ }
- PKCS7.ContentInfo ci = new PKCS7.ContentInfo (rawData);
- if (ci.ContentType != PKCS7.Oid.signedData)
+ PKCS7.ContentInfo ci = new PKCS7.ContentInfo (entry);
+ if (ci.ContentType != PKCS7.Oid.signedData) {
+ base.Close ();
return false;
+ }
PKCS7.SignedData sd = new PKCS7.SignedData (ci.Content);
- if (sd.ContentInfo.ContentType != spcIndirectDataContext)
+ if (sd.ContentInfo.ContentType != spcIndirectDataContext) {
+ base.Close ();
return false;
+ }
coll = sd.Certificates;
ASN1 spc = sd.ContentInfo.Content;
signedHash = spc [0][1][1];
- if (signedHash.Length == 20) {
- // seems to be SHA-1, restart hashing
- hashName = "SHA1";
- hash = HashFile (filename, hashName);
+
+ HashAlgorithm ha = null;
+ switch (signedHash.Length) {
+ case 16:
+ ha = HashAlgorithm.Create ("MD5");
+ hash = GetHash (ha);
+ break;
+ case 20:
+ ha = HashAlgorithm.Create ("SHA1");
+ hash = GetHash (ha);
+ break;
+ default:
+ reason = 5;
+ base.Close ();
+ return false;
}
+ base.Close ();
if (!signedHash.CompareValue (hash))
return false;
// messageDigest is a hash of spcIndirectDataContext (which includes the file hash)
byte[] spcIDC = spc [0].Value;
- HashAlgorithm ha = HashAlgorithm.Create (hashName);
+ ha.Initialize (); // re-using hash instance
byte[] messageDigest = ha.ComputeHash (spcIDC);
- return VerifySignature (sd, messageDigest, hashName);
+ return VerifySignature (sd, messageDigest, ha);
}
private bool CompareIssuerSerial (string issuer, byte[] serial, X509Certificate x509)
@@ -212,7 +235,7 @@ namespace Mono.Security.Authenticode {
}
//private bool VerifySignature (ASN1 cs, byte[] calculatedMessageDigest, string hashName)
- private bool VerifySignature (PKCS7.SignedData sd, byte[] calculatedMessageDigest, string hashName)
+ private bool VerifySignature (PKCS7.SignedData sd, byte[] calculatedMessageDigest, HashAlgorithm ha)
{
string contentType = null;
ASN1 messageDigest = null;
@@ -241,7 +264,7 @@ namespace Mono.Security.Authenticode {
case "1.3.6.1.4.1.311.2.1.12":
// spcSpOpusInfo (Microsoft code signing)
try {
- spcSpOpusInfo = System.Text.Encoding.UTF8.GetString (attr[1][0][1][0].Value);
+ spcSpOpusInfo = System.Text.Encoding.UTF8.GetString (attr[1][0][0][0].Value);
}
catch (NullReferenceException) {
spcSpOpusInfo = null;
@@ -261,13 +284,13 @@ namespace Mono.Security.Authenticode {
return false;
// verify signature
- string hashOID = CryptoConfig.MapNameToOID (hashName);
+ string hashOID = CryptoConfig.MapNameToOID (ha.ToString ());
// change to SET OF (not [0]) as per PKCS #7 1.5
ASN1 aa = new ASN1 (0x31);
foreach (ASN1 a in sd.SignerInfo.AuthenticatedAttributes)
aa.Add (a);
- HashAlgorithm ha = HashAlgorithm.Create (hashName);
+ ha.Initialize ();
byte[] p7hash = ha.ComputeHash (aa.GetBytes ());
byte[] signature = sd.SignerInfo.Signature;
@@ -281,10 +304,9 @@ namespace Mono.Security.Authenticode {
RSACryptoServiceProvider rsa = (RSACryptoServiceProvider) x509.RSA;
if (rsa.VerifyHash (p7hash, hashOID, signature)) {
signerChain.LoadCertificates (coll);
- if (signerChain.Build (x509))
- signingCertificate = x509;
- else
- return false;
+ trustedRoot = signerChain.Build (x509);
+ signingCertificate = x509;
+ break;
}
}
}
@@ -300,17 +322,18 @@ namespace Mono.Security.Authenticode {
// countersignature (1 2 840 113549 1 9 6)
// SET {
PKCS7.SignerInfo cs = new PKCS7.SignerInfo (attr [1]);
- return VerifyCounterSignature (cs, signature, hashName);
+ trustedTimestampRoot = VerifyCounterSignature (cs, signature);
+ break;
default:
// we don't support other unauthenticated attributes
break;
}
}
- return true;
+ return (trustedRoot && trustedTimestampRoot);
}
- private bool VerifyCounterSignature (PKCS7.SignerInfo cs, byte[] signature, string hashName)
+ private bool VerifyCounterSignature (PKCS7.SignerInfo cs, byte[] signature)
{
// SEQUENCE {
// INTEGER 1
@@ -357,6 +380,7 @@ namespace Mono.Security.Authenticode {
if (messageDigest == null)
return false;
// TODO: must be read from the ASN.1 structure
+ string hashName = null;
switch (messageDigest.Length) {
case 16:
hashName = "MD5";
@@ -397,5 +421,20 @@ namespace Mono.Security.Authenticode {
// no certificate can verify this signature!
return false;
}
+
+ private void Reset ()
+ {
+ filename = null;
+ entry = null;
+ hash = null;
+ signedHash = null;
+ signingCertificate = null;
+ reason = -1;
+ trustedRoot = false;
+ trustedTimestampRoot = false;
+ signerChain.Reset ();
+ timestampChain.Reset ();
+ timestamp = DateTime.MinValue;
+ }
}
}
diff --git a/mcs/class/Mono.Security/Mono.Security.Authenticode/AuthenticodeFormatter.cs b/mcs/class/Mono.Security/Mono.Security.Authenticode/AuthenticodeFormatter.cs
index 9813f809be4..983c55534cc 100755
--- a/mcs/class/Mono.Security/Mono.Security.Authenticode/AuthenticodeFormatter.cs
+++ b/mcs/class/Mono.Security/Mono.Security.Authenticode/AuthenticodeFormatter.cs
@@ -5,9 +5,7 @@
// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-// (C) 2004 Novell (http://www.novell.com)
-//
-
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -54,6 +52,7 @@ namespace Mono.Security.Authenticode {
private PKCS7.SignedData pkcs7;
private string description;
private Uri url;
+ private byte [] entry;
public AuthenticodeFormatter () : base ()
{
@@ -242,11 +241,11 @@ namespace Mono.Security.Authenticode {
int dirSecuritySize = BitConverter.ToInt32 (file, peOffset + 156);
if (dirSecuritySize > 8) {
- rawData = new byte [dirSecuritySize - 8];
- Buffer.BlockCopy (file, dirSecurityOffset + 8, rawData, 0, rawData.Length);
+ entry = new byte [dirSecuritySize - 8];
+ Buffer.BlockCopy (file, dirSecurityOffset + 8, entry, 0, entry.Length);
}
else
- rawData = null;
+ entry = null;
HashAlgorithm hash = HashAlgorithm.Create (hashAlgorithm);
// 0 to 215 (216) then skip 4 (checksum)
diff --git a/mcs/class/Mono.Security/Mono.Security.Authenticode/ChangeLog b/mcs/class/Mono.Security/Mono.Security.Authenticode/ChangeLog
index 19cc3c81335..0e1b07e15aa 100644
--- a/mcs/class/Mono.Security/Mono.Security.Authenticode/ChangeLog
+++ b/mcs/class/Mono.Security/Mono.Security.Authenticode/ChangeLog
@@ -1,3 +1,9 @@
+2004-09-07 Sebastien Pouliot <sebastien@ximian.com>
+
+ * AuthenticodeBase.cs: Merge optimizations from HEAD.
+ * AuthenticodeDeformatter.cs: Merge optimizations from HEAD.
+ * AuthenticodeFormatter.cs: Merge optimizations from HEAD.
+
2004-05-11 Sebastien Pouliot <sebastien@ximian.com>
* PrivateKey.cs: Better exception reporting. Added globalization to
diff --git a/mcs/class/Mono.Security/Mono.Security.Cryptography/ChangeLog b/mcs/class/Mono.Security/Mono.Security.Cryptography/ChangeLog
index 5299183d037..6ad744e0eb0 100644
--- a/mcs/class/Mono.Security/Mono.Security.Cryptography/ChangeLog
+++ b/mcs/class/Mono.Security/Mono.Security.Cryptography/ChangeLog
@@ -1,3 +1,8 @@
+2004-09-29 Sebastien Pouliot <sebastien@ximian.com>
+
+ * RSAManaged.cs: KeySize is now always a multiple of 8 bits.
+ Fix #66929.
+
2004-06-23 Sebastien Pouliot <sebastien@ximian.com>
* SymmetricTransform.cs: Reduce by one the number of block when
diff --git a/mcs/class/Mono.Security/Mono.Security.Cryptography/RSAManaged.cs b/mcs/class/Mono.Security/Mono.Security.Cryptography/RSAManaged.cs
index 79771634302..82b16f6b291 100644
--- a/mcs/class/Mono.Security/Mono.Security.Cryptography/RSAManaged.cs
+++ b/mcs/class/Mono.Security/Mono.Security.Cryptography/RSAManaged.cs
@@ -14,6 +14,8 @@
//
//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.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
@@ -147,8 +149,12 @@ namespace Mono.Security.Cryptography {
public override int KeySize {
get {
// in case keypair hasn't been (yet) generated
- if (keypairGenerated)
- return n.BitCount ();
+ if (keypairGenerated) {
+ int ks = n.BitCount ();
+ if ((ks & 7) != 0)
+ ks = ks + (8 - (ks & 7));
+ return ks;
+ }
else
return base.KeySize;
}
diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ChangeLog b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ChangeLog
index a5a20358101..971879f8b9a 100644
--- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ChangeLog
+++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ChangeLog
@@ -1,3 +1,12 @@
+2004-10-05 Sebastien Pouliot <sebastien@ximian.com>
+
+ * SslClientStream.cs: Changed InputBuffer to internal (was protected).
+
+2004-10-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * HttpsClientStream.cs: the .ctor receives a pre-read buffer now.
+ * SslClientStream.cs: added InputBuffer property.
+
2004-07-14 Sebastien Pouliot <sebastien@ximian.com>
* SslClientStream.cs: Changed lock to "new object()" and not
diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/HttpsClientStream.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/HttpsClientStream.cs
index 678cf83163c..89562c9b416 100644
--- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/HttpsClientStream.cs
+++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/HttpsClientStream.cs
@@ -44,12 +44,14 @@ namespace Mono.Security.Protocol.Tls {
public HttpsClientStream (Stream stream, X509CertificateCollection clientCertificates,
- HttpWebRequest request)
+ HttpWebRequest request, byte [] buffer)
: base (stream, request.RequestUri.Host, false, SecurityProtocolType.Default, clientCertificates)
{
// this constructor permit access to the WebRequest to call
// ICertificatePolicy.CheckValidationResult
_request = request;
+ if (buffer != null)
+ InputBuffer.Write (buffer, 0, buffer.Length);
#if !NET_1_0
// also saved from reflection
base.CheckCertRevocationStatus = ServicePointManager.CheckCertificateRevocationList;
@@ -71,3 +73,4 @@ namespace Mono.Security.Protocol.Tls {
}
}
}
+
diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs
index fccfb9902b3..18cc041f4a4 100644
--- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs
+++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs
@@ -125,6 +125,10 @@ namespace Mono.Security.Protocol.Tls
set { throw new NotSupportedException(); }
}
+ // required by HttpsClientStream for proxy support
+ internal Stream InputBuffer {
+ get { return inputBuffer; }
+ }
#endregion
#region Security Properties
diff --git a/mcs/class/Mono.Security/Mono.Security.X509/ChangeLog b/mcs/class/Mono.Security/Mono.Security.X509/ChangeLog
index 38b3d393aa5..fc6c1b3b64b 100644
--- a/mcs/class/Mono.Security/Mono.Security.X509/ChangeLog
+++ b/mcs/class/Mono.Security/Mono.Security.X509/ChangeLog
@@ -1,3 +1,8 @@
+2004-09-07 Sebastien Pouliot <sebastien@ximian.com>
+
+ * X509Chain.cs: Merge bug fixes from HEAD.
+ * X509Store.cs: Merge enhancements from HEAD.
+
2004-07-15 Sebastien Pouliot <sebastien@ximian.com>
* X501Name.cs: Support for E (email) in FromString.
diff --git a/mcs/class/Mono.Security/Mono.Security.X509/X509Chain.cs b/mcs/class/Mono.Security/Mono.Security.X509/X509Chain.cs
index 254ff1b70fa..f8035e6c661 100755
--- a/mcs/class/Mono.Security/Mono.Security.X509/X509Chain.cs
+++ b/mcs/class/Mono.Security/Mono.Security.X509/X509Chain.cs
@@ -9,9 +9,7 @@
// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-// (C) 2004 Novell (http://www.novell.com)
-//
-
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -134,7 +132,7 @@ namespace Mono.Security.X509 {
tmp = FindCertificateParent (x);
if (x != null) {
_chain.Add (x);
- tmp = x; // last valid
+ x = tmp; // last valid
}
}
// find a trusted root
@@ -191,7 +189,8 @@ namespace Mono.Security.X509 {
_status = X509ChainStatusFlags.NoError;
roots = null; // this force a reload
certs.Clear ();
- _chain.Clear ();
+ if (_chain != null)
+ _chain.Clear ();
}
// private stuff
diff --git a/mcs/class/Mono.Security/Mono.Security.X509/X509Store.cs b/mcs/class/Mono.Security/Mono.Security.X509/X509Store.cs
index 81db71b5c75..aa27a4a7dfd 100755
--- a/mcs/class/Mono.Security/Mono.Security.X509/X509Store.cs
+++ b/mcs/class/Mono.Security/Mono.Security.X509/X509Store.cs
@@ -4,9 +4,7 @@
// Author:
// Sebastien Pouliot <sebastien@ximian.com>
//
-// (C) 2004 Novell (http://www.novell.com)
-//
-
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -106,9 +104,7 @@ namespace Mono.Security.X509 {
public void Import (X509Certificate certificate)
{
- if (!Directory.Exists (_storePath)) {
- Directory.CreateDirectory (_storePath);
- }
+ CheckStore (_storePath, true);
string filename = Path.Combine (_storePath, GetUniqueName (certificate));
if (!File.Exists (filename)) {
@@ -183,14 +179,28 @@ namespace Mono.Security.X509 {
return crl;
}
- private X509CertificateCollection BuildCertificatesCollection (string storeName)
+ private bool CheckStore (string path, bool throwException)
{
- string path = Path.Combine (_storePath, storeName);
- if (!Directory.Exists (path)) {
+ try {
+ if (Directory.Exists (path))
+ return true;
Directory.CreateDirectory (path);
+ return Directory.Exists (path);
+ }
+ catch {
+ if (throwException)
+ throw;
+ return false;
}
+ }
+ private X509CertificateCollection BuildCertificatesCollection (string storeName)
+ {
X509CertificateCollection coll = new X509CertificateCollection ();
+ string path = Path.Combine (_storePath, storeName);
+ if (!CheckStore (path, false))
+ return coll; // empty collection
+
string[] files = Directory.GetFiles (path, "*.cer");
if ((files != null) && (files.Length > 0)) {
foreach (string file in files) {
@@ -213,6 +223,9 @@ namespace Mono.Security.X509 {
{
ArrayList list = new ArrayList ();
string path = Path.Combine (_storePath, storeName);
+ if (!CheckStore (path, false))
+ return list; // empty list
+
string[] files = Directory.GetFiles (path, "*.crl");
if ((files != null) && (files.Length > 0)) {
foreach (string file in files) {
diff --git a/mcs/class/System.Data/System.Data.SqlClient/ChangeLog b/mcs/class/System.Data/System.Data.SqlClient/ChangeLog
index 8cbc2916c38..8b39fed6e74 100755
--- a/mcs/class/System.Data/System.Data.SqlClient/ChangeLog
+++ b/mcs/class/System.Data/System.Data.SqlClient/ChangeLog
@@ -1,3 +1,7 @@
+2004-09-24 Umadevi S <sumadevi@novell.com>
+ * SqlTransaction.cs - Dispose will not call rollback incase the transaction is not open.
+
+
2004-09-02 Umadevi S <sumadevi@novell.com>
* SqlCommand.cs - ExecuteNonQuery to return -1 incase of executing a storedprocedure
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlTransaction.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlTransaction.cs
index f6c1ad13f5c..aa145d2c426 100644
--- a/mcs/class/System.Data/System.Data.SqlClient/SqlTransaction.cs
+++ b/mcs/class/System.Data/System.Data.SqlClient/SqlTransaction.cs
@@ -94,7 +94,8 @@ namespace System.Data.SqlClient {
{
if (!disposed) {
if (disposing) {
- Rollback ();
+ if (isOpen)
+ Rollback ();
}
disposed = true;
}
diff --git a/mcs/class/System.Data/System.Data/ChangeLog b/mcs/class/System.Data/System.Data/ChangeLog
index 78cc45ac101..c1212daff3f 100644
--- a/mcs/class/System.Data/System.Data/ChangeLog
+++ b/mcs/class/System.Data/System.Data/ChangeLog
@@ -1,3 +1,42 @@
+2004-10-08 Atsushi Enomoto <atsushi@ximian.com>
+
+ * DataSet.cs : Yesterday's fix was different and broke the build :(
+
+2004-10-07 Atsushi Enomoto <atsushi@ximian.com>
+
+ * DataSet.cs :
+ - When AllowDBNull is false on attribute DataColumn, its schema
+ should contain use="required". This fixes bug #66792.
+ - If MaxLength is set on attribute DataColumn, the mapped schema
+ type should contain maxLength facet. This fixes bug #66793.
+
+2004-10-04 Atsushi Enomoto <atsushi@ximian.com>
+
+ * DataSet.cs : For a row, when a relation is not nested, then it is
+ still output target since it won't be written as a child of its
+ parent. It fixes bug #66379.
+
+2004-10-03 Atsushi Enomoto <atsushi@ximian.com>
+
+ * DataSet.cs : Attribute constraint field XPath must be written as
+ @blah. This fixes bug #66366.
+
+2004-09-28 Umadevi S <sumadevi@novell.com>
+ * DataRow.cs - checked for Enforceconstraints, while using indices to search for related rows
+
+2004-09-24 Sureshkumar T <tsureshkumar@novell.com>
+
+ * DataSet.cs : Don't check constraints for dataset clear
+ * DataRowCollection.cs : check for EnforceConstraints flag
+ before checking foriegn key constraints in Clear method
+ * DataTable.cs : Redundant checking removed in Clear method as it is
+ checked in DataRowCollection.Clear method.
+
+2004-09-21 Sureshkumar T <tsureshkumar@novell.com>
+
+ * DataRow.cs: Added a new original row cache, if the current row happens
+ to be the original row. fixed bug #63097
+
2004-08-06 Atsushi Enomoto <atsushi@ximian.com>
* DataSet.cs : DataSet's ExtendedProperties were not XmlConverted.
diff --git a/mcs/class/System.Data/System.Data/DataRow.cs b/mcs/class/System.Data/System.Data/DataRow.cs
index 382659bbcfc..49c59a922db 100644
--- a/mcs/class/System.Data/System.Data/DataRow.cs
+++ b/mcs/class/System.Data/System.Data/DataRow.cs
@@ -489,7 +489,9 @@ namespace System.Data {
DataColumn column = _table.Columns[columnName];
_table.ChangingDataColumn (this, column, val);
- if (_original < 0) {
+ if (_original < 0 || _original == _current) {
+ // really add a row cache, if _original is not there &
+ // make row modified
_original = Table.RecordCache.NewRecord();
}
CheckValue (val, column);
@@ -1036,7 +1038,9 @@ namespace System.Data {
int numColumn = parentColumns.Length;
if (HasVersion(version)) {
Index indx = relation.ParentTable.GetIndexByColumns (parentColumns);
- if (indx != null) { // get the child rows from the index
+ if (indx != null &&
+ (Table == null || Table.DataSet == null ||
+ Table.DataSet.EnforceConstraints)) { // get the child rows from the index
Node[] childNodes = indx.FindAllSimple(childColumns, IndexFromVersion(version));
for (int i = 0; i < childNodes.Length; i++) {
rows.Add (childNodes[i].Row);
diff --git a/mcs/class/System.Data/System.Data/DataRowCollection.cs b/mcs/class/System.Data/System.Data/DataRowCollection.cs
index 06e94a354b3..8b1d2e20190 100644
--- a/mcs/class/System.Data/System.Data/DataRowCollection.cs
+++ b/mcs/class/System.Data/System.Data/DataRowCollection.cs
@@ -123,7 +123,7 @@ namespace System.Data
/// </summary>
public void Clear ()
{
- if (this.table.DataSet != null)
+ if (this.table.DataSet != null && this.table.DataSet.EnforceConstraints)
{
foreach (DataTable table in this.table.DataSet.Tables)
{
diff --git a/mcs/class/System.Data/System.Data/DataSet.cs b/mcs/class/System.Data/System.Data/DataSet.cs
index 8ac4d34836b..60b1680e73b 100644
--- a/mcs/class/System.Data/System.Data/DataSet.cs
+++ b/mcs/class/System.Data/System.Data/DataSet.cs
@@ -330,13 +330,19 @@ namespace System.Data {
tempTable.AcceptChanges ();
}
+ /// <summary>
+ /// Clears all the tables
+ /// </summary>
public void Clear ()
{
if (_xmlDataDocument != null)
throw new NotSupportedException ("Clear function on dataset and datatable is not supported when XmlDataDocument is bound to the DataSet.");
- for (int t = 0; t < tableCollection.Count; t++) {
- tableCollection[t].Clear ();
+ bool enforceConstraints = this.EnforceConstraints;
+ this.EnforceConstraints = false;
+ for (int t = 0; t < tableCollection.Count; t++) {
+ tableCollection [t].Clear ();
}
+ this.EnforceConstraints = enforceConstraints;
}
public virtual DataSet Clone ()
@@ -1188,16 +1194,22 @@ namespace System.Data {
case 0:
break;
case 1:
+ if (!oneRel.Nested)
+ break;
if (row.GetParentRow (oneRel) != null)
continue;
break;
case 2:
bool skip = false;
- for (int i = 0; i < table.ParentRelations.Count; i++)
- if (row.GetParentRow (table.ParentRelations [i]) != null) {
+ for (int i = 0; i < table.ParentRelations.Count; i++) {
+ DataRelation prel = table.ParentRelations [i];
+ if (!prel.Nested)
+ continue;
+ if (row.GetParentRow (prel) != null) {
skip = true;
continue;
}
+ }
if (skip)
continue;
break;
@@ -1539,7 +1551,8 @@ namespace System.Data {
XmlSchemaXPath field;
foreach (DataColumn column in uqConst.Columns) {
field = new XmlSchemaXPath();
- field.XPath = constraintPrefix+column.ColumnName;
+ string typePrefix = column.ColumnMapping == MappingType.Attribute ? "@" : "";
+ field.XPath = typePrefix + constraintPrefix + column.ColumnName;
uniq.Fields.Add(field);
}
@@ -1606,7 +1619,8 @@ namespace System.Data {
XmlSchemaXPath field;
foreach (DataColumn column in rel.ChildColumns) {
field = new XmlSchemaXPath();
- field.XPath = constraintPrefix+column.ColumnName;
+ string typePrefix = column.ColumnMapping == MappingType.Attribute ? "@" : "";
+ field.XPath = typePrefix + constraintPrefix + column.ColumnName;
keyRef.Fields.Add(field);
}
@@ -1753,8 +1767,20 @@ namespace System.Data {
// FIXME: Handle prefix mapping correctly.
schemaToAdd.Namespaces.Add (prefix, col.Namespace);
}
- att.SchemaTypeName = MapType (col.DataType);
+ if (!col.AllowDBNull)
+ att.Use = XmlSchemaUse.Required;
+
+ if (col.MaxLength > -1)
+ att.SchemaType = GetTableSimpleType (doc, col);
+ else
+ att.SchemaTypeName = MapType (col.DataType);
// FIXME: what happens if extended properties are set on attribute columns??
+ if (!col.AllowDBNull)
+ att.Use = XmlSchemaUse.Required;
+ if (col.MaxLength > -1)
+ att.SchemaType = GetTableSimpleType (doc, col);
+ else
+ att.SchemaTypeName = MapType (col.DataType);
schemaAttributes.Add (att);
}
diff --git a/mcs/class/System.Data/System.Data/DataTable.cs b/mcs/class/System.Data/System.Data/DataTable.cs
index c8f06e7ec0b..344d928f2ec 100644
--- a/mcs/class/System.Data/System.Data/DataTable.cs
+++ b/mcs/class/System.Data/System.Data/DataTable.cs
@@ -677,37 +677,7 @@ namespace System.Data {
/// Clears the DataTable of all data.
/// </summary>
public void Clear () {
- // TODO: thow an exception if any rows that
- // have enforced child relations
- // that would result in child rows being orphaned
- // now we check if any ForeignKeyConstraint is referncing 'table'.
- if (DataSet != null)
- {
- if (DataSet._xmlDataDocument != null)
- throw new NotSupportedException ("Clear function on dataset and datatable is not supported on XmlDataDocument.");
-
- IEnumerator tableEnumerator = DataSet.Tables.GetEnumerator();
-
- // loop on all tables in dataset
- while (tableEnumerator.MoveNext())
- {
- IEnumerator constraintEnumerator = ((DataTable) tableEnumerator.Current).Constraints.GetEnumerator();
- // loop on all constrains in the current table
- while (constraintEnumerator.MoveNext())
- {
- Object o = constraintEnumerator.Current;
- // we only check ForeignKeyConstraint
- if (o is ForeignKeyConstraint)
- {
- ForeignKeyConstraint fc = (ForeignKeyConstraint) o;
- if(fc.RelatedTable == this && fc.Table.Rows.Count > 0)
- throw new InvalidConstraintException("Cannot clear table " + fc.RelatedTable + " because ForeignKeyConstraint " + fc.ConstraintName + " enforces constraints and there are child rows in " + fc.Table);
- }
- }
- }
- }
-
-
+ // Foriegn key constraints are checked in _rows.Clear method
_rows.Clear ();
}
diff --git a/mcs/class/System.Data/Test/System.Data.SqlClient/SqlTransactionTest.cs b/mcs/class/System.Data/Test/System.Data.SqlClient/SqlTransactionTest.cs
new file mode 100644
index 00000000000..c91e27631cc
--- /dev/null
+++ b/mcs/class/System.Data/Test/System.Data.SqlClient/SqlTransactionTest.cs
@@ -0,0 +1,85 @@
+//
+// SqlTransactionTest.cs - NUnit Test Cases for testing the
+// SqlTransaction class
+// Author:
+// Umadevi S (sumadevi@novell.com)
+//
+// Copyright (c) 2004 Novell Inc., and the individuals listed
+// on the ChangeLog entries.
+//
+// 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.
+//
+
+using System;
+using System.Data;
+using System.Data.Common;
+using System.Data.SqlClient;
+
+using NUnit.Framework;
+
+namespace MonoTests.System.Data.SqlClient
+{
+
+ [TestFixture]
+ public class SqlTransactionTest : MSSqlTestClient {
+
+ [SetUp]
+ public void GetReady () {
+ OpenConnection ();
+ }
+
+ [TearDown]
+ public void Clean () {
+ CloseConnection ();
+ }
+
+ [Test]
+ /**
+ The below test expects a table table4 with a bigint column.
+ **/
+ public void TransactionCommitTest () {
+
+ using (SqlTransaction transaction = conn.BeginTransaction())
+ {
+ try
+ {
+ string sSql = "Insert into Region(RegionID,RegionDescription) Values ('10112', 'NovellBangalore')";
+ SqlCommand command = new SqlCommand();
+ command.Connection = conn;
+ command.CommandText = sSql;
+ command.Transaction = transaction;
+ command.CommandType = CommandType.Text;
+ command.ExecuteNonQuery();
+ transaction.Commit();
+ }
+ catch (System.Exception ex)
+ {
+ transaction.Rollback();
+ }
+ finally
+ {
+ conn.Close();
+ }
+
+ }
+ }
+
+ }
+}
diff --git a/mcs/class/System.Data/Test/System.Data/ChangeLog b/mcs/class/System.Data/Test/System.Data/ChangeLog
index 48ffde727ce..07f46872aea 100644
--- a/mcs/class/System.Data/Test/System.Data/ChangeLog
+++ b/mcs/class/System.Data/Test/System.Data/ChangeLog
@@ -1,3 +1,15 @@
+2004-09-24 Umadevi S <sumadevi@novell.com>
+ * DataRowTest.cs : Added a test for EnforceConstraints with relations defined.
+
+2004-09-24 Sureshkumar T <tsureshkumar@novell.com>
+
+ * DataSetTest.cs (DataSetClearTest): Added a test for DataSet.Clear. This should not
+ throw any exception and should override constraints.
+
+2004-09-21 Sureshkumar T <tsureshkumar@novell.com>
+
+ * DataSetTest.cs : Added a test for Deserialization of dataset : DeserializeModifiedDataSet
+
2004-06-23 Umadevi S <sumadevi@novell.com>
* DataTableTest.cs :Corrected Testcases to .net 1.1 specifications
diff --git a/mcs/class/System.Data/Test/System.Data/DataRowTest.cs b/mcs/class/System.Data/Test/System.Data/DataRowTest.cs
index a82637dc9cd..2f347ddd005 100644
--- a/mcs/class/System.Data/Test/System.Data/DataRowTest.cs
+++ b/mcs/class/System.Data/Test/System.Data/DataRowTest.cs
@@ -756,5 +756,42 @@ namespace MonoTests.System.Data
dt.Columns.Add (col);
dt.Rows [0] [0] = "test";
}
+
+ [Test]
+ public void EnforceConstraint ()
+ {
+ int id = 100;
+ // Setup stuff
+ DataSet ds = new DataSet();
+ DataTable parent = ds.Tables.Add("parent");
+ parent.Columns.Add("id", typeof(int));
+ DataTable child = ds.Tables.Add("child");
+ child.Columns.Add("idref", typeof(int));
+ Constraint uniqueId = null;
+ parent.Constraints.Add(uniqueId = new UniqueConstraint("uniqueId",
+ new DataColumn[] {parent.Columns["id"]}, true));
+ ForeignKeyConstraint fkc = new ForeignKeyConstraint("ParentChildConstraint", new DataColumn[] { parent.Columns["id"] },
+ new DataColumn[] { child.Columns["idref"]});
+
+ child.Constraints.Add(fkc);
+
+ DataRelation relateParentChild = new DataRelation("relateParentChild",
+ new DataColumn[] {parent.Columns["id"] },
+ new DataColumn[] {child.Columns["idref"] },
+ false);
+ ds.Relations.Add(relateParentChild);
+
+ ds.EnforceConstraints = false;
+ DataRow parentRow = parent.Rows.Add(new object[] { id });
+ DataRow childRow = child.Rows.Add(new object[] { id });
+ if (parentRow == childRow.GetParentRow(relateParentChild)) {
+ foreach(DataColumn dc in parent.Columns)
+ AssertEquals(100,parentRow[dc]);
+
+ }
+
+
+ }
+
}
}
diff --git a/mcs/class/System.Data/Test/System.Data/DataSetTest.cs b/mcs/class/System.Data/Test/System.Data/DataSetTest.cs
index 766f0e86863..95c6c3061a7 100644
--- a/mcs/class/System.Data/Test/System.Data/DataSetTest.cs
+++ b/mcs/class/System.Data/Test/System.Data/DataSetTest.cs
@@ -1235,5 +1235,74 @@ namespace MonoTests.System.Data
ds.WriteXml (xtw);
AssertEquals (xml, sw.ToString ());
}
+
+ [Test]
+ public void DeserializeModifiedDataSet ()
+ {
+ // Serialization begins
+ DataSet prevDs = new DataSet ();
+ DataTable dt = prevDs.Tables.Add ();
+ dt.Columns.Add(new DataColumn("Id", typeof(string)));
+
+ DataRow dr = dt.NewRow();
+ dr [0] = "a";
+ dt.Rows.Add (dr);
+ prevDs.AcceptChanges ();
+ dr = prevDs.Tables[0].Rows[0];
+ dr [0] = "b";
+
+ XmlSerializer serializer = new XmlSerializer (typeof (DataSet));
+ StringWriter sw = new StringWriter ();
+ XmlTextWriter xw = new XmlTextWriter (sw);
+ xw.QuoteChar = '\'';
+ serializer.Serialize (xw, prevDs);
+
+ // Deserialization begins
+ StringReader sr = new StringReader (sw.ToString ());
+ XmlTextReader reader = new XmlTextReader (sr);
+ XmlSerializer serializer1 = new XmlSerializer (typeof (DataSet));
+ DataSet ds = serializer1.Deserialize (reader) as DataSet;
+ AssertEquals ("deserialization after modification does not give original values",
+ prevDs.Tables[0].Rows [0][0,DataRowVersion.Original].ToString (),
+ ds.Tables[0].Rows [0][0,DataRowVersion.Original].ToString ());
+ AssertEquals ("deserialization after modification does not give current values",
+ prevDs.Tables[0].Rows [0][0,DataRowVersion.Current].ToString (),
+ ds.Tables[0].Rows [0][0,DataRowVersion.Current].ToString ());
+ }
+
+ /// <summary>
+ /// Test for testing DataSet.Clear method with foriegn key relations
+ /// This is expected to clear all the related datatable rows also
+ /// </summary>
+ [Test]
+ public void DataSetClearTest ()
+ {
+ DataSet ds = new DataSet ();
+ DataTable parent = ds.Tables.Add ("Parent");
+ DataTable child = ds.Tables.Add ("Child");
+
+ parent.Columns.Add ("id", typeof (int));
+ child.Columns.Add ("ref_id", typeof(int));
+
+ child.Constraints.Add (new ForeignKeyConstraint ("fk_constraint", parent.Columns [0], child.Columns [0]));
+
+ DataRow dr = parent.NewRow ();
+ dr [0] = 1;
+ parent.Rows.Add (dr);
+ dr.AcceptChanges ();
+
+ dr = child.NewRow ();
+ dr [0] = 1;
+ child.Rows.Add (dr);
+ dr.AcceptChanges ();
+
+ try {
+ ds.Clear (); // this should clear all the rows in parent & child tables
+ } catch (Exception e) {
+ throw (new Exception ("Exception should not have been thrown at Clear method" + e.ToString ()));
+ }
+ Assertion.AssertEquals ("parent table rows should not exist!", 0, parent.Rows.Count);
+ Assertion.AssertEquals ("child table rows should not exist!", 0, child.Rows.Count);
+ }
}
}
diff --git a/mcs/class/System.Drawing/System.Drawing/ChangeLog b/mcs/class/System.Drawing/System.Drawing/ChangeLog
index ee4e72e3e57..48b2c8a2537 100644
--- a/mcs/class/System.Drawing/System.Drawing/ChangeLog
+++ b/mcs/class/System.Drawing/System.Drawing/ChangeLog
@@ -1,3 +1,23 @@
+2004-10-04 Ravindra <rkumar@novell.com>
+
+ * gdipFunctioncs.cs: Backporting. Fix from Alois for bug #67383.
+
+2004-09-22 Ravindra <rkumar@novell.com>
+
+ * gdipFunctions.cs: Backporting. Improved the exception message
+ for unsupported image formats.
+
+2004-09-13 Ravindra <rkumar@novell.com>
+
+ * Graphics.cs: MSDN says that using image width and height gives
+ better performance, hence we are using image width and height to
+ avoid autoscaling in DrawImageUnscaled. DrawImageUnscaled method.
+
+2004-09-10 Ravindra <rkumar@novell.com>
+
+ * Font.cs: Fixed Height property and GetHeight method.
+ * Graphics.cs: Fixed DrawImageUnscaled method.
+
2004-07-02 Jordi Mas i Hernandez <jordi@ximian.com>
* gdipFunctions.cs: fixes bug 61050
diff --git a/mcs/class/System.Drawing/System.Drawing/Font.cs b/mcs/class/System.Drawing/System.Drawing/Font.cs
index 31044a5b306..ee3ffdfc6c9 100644
--- a/mcs/class/System.Drawing/System.Drawing/Font.cs
+++ b/mcs/class/System.Drawing/System.Drawing/Font.cs
@@ -395,12 +395,10 @@ namespace System.Drawing
}
}
- private int _height;
-
[Browsable (false)]
public int Height {
get {
- return _height;
+ return (int) Math.Ceiling (GetHeight ());
}
}
@@ -511,7 +509,7 @@ namespace System.Drawing
public float GetHeight ()
{
- return (float) _height;
+ return GetHeight (Graphics.systemDpiY);
}
[MonoTODO]
@@ -532,19 +530,68 @@ namespace System.Drawing
throw new NotImplementedException ();
}
- [MonoTODO]
public float GetHeight (Graphics graphics)
{
- if (Unit == GraphicsUnit.Pixel || Unit == GraphicsUnit.World)
- return GetHeight ();
+ float height = GetHeight (graphics.DpiY);
+
+ switch (graphics.PageUnit) {
+ case GraphicsUnit.Document:
+ height *= (300f / graphics.DpiY);
+ break;
+ case GraphicsUnit.Display:
+ height *= (75f / graphics.DpiY);
+ break;
+ case GraphicsUnit.Inch:
+ height /= graphics.DpiY;
+ break;
+ case GraphicsUnit.Millimeter:
+ height *= (25.4f / graphics.DpiY);
+ break;
+ case GraphicsUnit.Point:
+ height *= (72f / graphics.DpiY);
+ break;
+
+ case GraphicsUnit.Pixel:
+ case GraphicsUnit.World:
+ default:
+ break;
+ }
- throw new NotImplementedException ();
+ return height;
}
- [MonoTODO]
public float GetHeight (float dpi)
{
- return GetHeight ();
+ float height;
+ int emHeight = _fontFamily.GetEmHeight (_style);
+ int lineSpacing = _fontFamily.GetLineSpacing (_style);
+
+ height = lineSpacing * (_size / emHeight);
+
+ switch (_unit) {
+ case GraphicsUnit.Document:
+ height *= (dpi / 300f);
+ break;
+ case GraphicsUnit.Display:
+ height *= (dpi / 75f);
+ break;
+ case GraphicsUnit.Inch:
+ height *= dpi;
+ break;
+ case GraphicsUnit.Millimeter:
+ height *= (dpi / 25.4f);
+ break;
+ case GraphicsUnit.Point:
+ height *= (dpi / 72f);
+ break;
+
+ case GraphicsUnit.Pixel:
+ case GraphicsUnit.World:
+ default:
+ break;
+ }
+
+ return height;
}
public override String ToString ()
diff --git a/mcs/class/System.Drawing/System.Drawing/Graphics.cs b/mcs/class/System.Drawing/System.Drawing/Graphics.cs
index 54c750c03ff..a580eb2e19b 100755
--- a/mcs/class/System.Drawing/System.Drawing/Graphics.cs
+++ b/mcs/class/System.Drawing/System.Drawing/Graphics.cs
@@ -651,22 +651,27 @@ namespace System.Drawing
public void DrawImageUnscaled (Image image, Point point)
{
- DrawImage(image, point.X, point.Y);
+ DrawImageUnscaled (image, point.X, point.Y);
}
public void DrawImageUnscaled (Image image, Rectangle rect)
{
- DrawImage(image, rect.X, rect.Y, rect.Width, rect.Height);
+ DrawImageUnscaled (image, rect.X, rect.Y, rect.Width, rect.Height);
}
public void DrawImageUnscaled (Image image, int x, int y)
{
- DrawImage(image, x, y);
+ DrawImage (image, x, y, image.Width, image.Height);
}
public void DrawImageUnscaled (Image image, int x, int y, int width, int height)
{
- DrawImage(image, x, y, width, height);
+ Image tmpImg = new Bitmap (width, height);
+ Graphics g = FromImage (tmpImg);
+ g.DrawImage (image, 0, 0, image.Width, image.Height);
+ this.DrawImage (tmpImg, x, y, width, height);
+ tmpImg.Dispose ();
+ g.Dispose ();
}
public void DrawLine (Pen pen, PointF pt1, PointF pt2)
diff --git a/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs b/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs
index 5244cd50235..8c408cd58fb 100644
--- a/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs
+++ b/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs
@@ -7,11 +7,7 @@
// Sanjay Gupta (gsanjay@novell.com)
// Ravindra (rkumar@novell.com)
//
-// Copyright (C) 2004 Novell, Inc. http://www.novell.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004 Novell, Inc. (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -161,7 +157,7 @@ namespace System.Drawing
throw new UnauthorizedAccessException ("Access denied.");
case Status.UnknownImageFormat:
- throw new NotSupportedException ("Unknown image format.");
+ throw new NotSupportedException ("Either image format is unknown or you don't have the required libraries for this format.");
case Status.NotImplemented:
throw new NotImplementedException ("Feature not implemented.");
@@ -1420,8 +1416,9 @@ namespace System.Drawing
public GdiPlusStreamHelper (Stream s)
{
- stream = s;
- stream.Seek(0, SeekOrigin.Begin);
+ stream = s;
+ if (stream.CanSeek)
+ stream.Seek (0, SeekOrigin.Begin);
}
public int StreamGetBytesImpl (IntPtr buf, int bufsz, bool peek)
diff --git a/mcs/class/System.Web.Services/System.Web.Services.Protocols/ChangeLog b/mcs/class/System.Web.Services/System.Web.Services.Protocols/ChangeLog
index 8b0776c0c38..6519e52d14e 100644
--- a/mcs/class/System.Web.Services/System.Web.Services.Protocols/ChangeLog
+++ b/mcs/class/System.Web.Services/System.Web.Services.Protocols/ChangeLog
@@ -1,3 +1,8 @@
+2004-09-28 Lluis Sanchez Gual <lluis@novell.com>
+
+ * WebServiceHelper.cs: Write the encodingStyle attribute when using the
+ encoded format. This fixes bug #66908.
+
2004-08-25 Lluis Sanchez Gual <lluis@novell.com>
* HttpSoapWebServiceHandler.cs, WebServiceHandler.cs: Do not assign the
diff --git a/mcs/class/System.Web.Services/System.Web.Services.Protocols/WebServiceHelper.cs b/mcs/class/System.Web.Services/System.Web.Services.Protocols/WebServiceHelper.cs
index 309cdccf7c4..3c2efcfbfc1 100755
--- a/mcs/class/System.Web.Services/System.Web.Services.Protocols/WebServiceHelper.cs
+++ b/mcs/class/System.Web.Services/System.Web.Services.Protocols/WebServiceHelper.cs
@@ -118,6 +118,10 @@ namespace System.Web.Services.Protocols
// Serialize body
xtw.WriteStartElement ("soap", "Body", WebServiceHelper.SoapEnvelopeNamespace);
+
+ if (methodUse == SoapBindingUse.Encoded)
+ xtw.WriteAttributeString ("encodingStyle", WebServiceHelper.SoapEnvelopeNamespace, "http://schemas.xmlsoap.org/soap/encoding/");
+
bodySerializer.Serialize (xtw, bodyContent);
xtw.WriteEndElement ();
diff --git a/mcs/class/System.Web/System.Web.Caching/Cache.cs b/mcs/class/System.Web/System.Web.Caching/Cache.cs
index b8ecda5dd90..720d86c71ca 100644
--- a/mcs/class/System.Web/System.Web.Caching/Cache.cs
+++ b/mcs/class/System.Web/System.Web.Caching/Cache.cs
@@ -209,7 +209,7 @@ namespace System.Web.Caching {
// If we have any kind of expiration add into the CacheExpires class
if (objEntry.HasSlidingExpiration || objEntry.HasAbsoluteExpiration) {
if (objEntry.HasSlidingExpiration)
- objEntry.Expires = DateTime.Now.Ticks + objEntry.SlidingExpiration;
+ objEntry.Expires = DateTime.UtcNow.Ticks + objEntry.SlidingExpiration;
_objExpires.Add (objEntry);
}
@@ -392,7 +392,7 @@ namespace System.Web.Caching {
internal CacheEntry GetEntry (string strKey) {
CacheEntry objEntry = null;
- long ticksNow = DateTime.Now.Ticks;
+ long ticksNow = DateTime.UtcNow.Ticks;
if (strKey == null)
throw new ArgumentNullException ("strKey");
diff --git a/mcs/class/System.Web/System.Web.Caching/CacheEntry.cs b/mcs/class/System.Web/System.Web.Caching/CacheEntry.cs
index 0e07353dc56..10e0f7c57a0 100644
--- a/mcs/class/System.Web/System.Web.Caching/CacheEntry.cs
+++ b/mcs/class/System.Web/System.Web.Caching/CacheEntry.cs
@@ -100,7 +100,7 @@ namespace System.Web.Caching {
// moved after each period, and the absolute expiration is the value used
// for all expiration calculations.
if (tsSpan.Ticks != Cache.NoSlidingExpiration.Ticks)
- _ticksExpires = System.DateTime.Now.AddTicks(_ticksSlidingExpiration).Ticks;
+ _ticksExpires = System.DateTime.UtcNow.AddTicks(_ticksSlidingExpiration).Ticks;
_objDependency = objDependency;
if (_objDependency != null)
diff --git a/mcs/class/System.Web/System.Web.Caching/CacheExpires.cs b/mcs/class/System.Web/System.Web.Caching/CacheExpires.cs
index 673468ae209..11e2377e3c1 100644
--- a/mcs/class/System.Web/System.Web.Caching/CacheExpires.cs
+++ b/mcs/class/System.Web/System.Web.Caching/CacheExpires.cs
@@ -71,7 +71,7 @@ namespace System.Web.Caching {
} while (bytePos < 60);
// GC Bucket controller
- _intFlush = System.DateTime.Now.Minute - 1;
+ _intFlush = System.DateTime.UtcNow.Minute - 1;
_objTimer = new System.Threading.Timer (new System.Threading.TimerCallback (GarbageCleanup), null, 10000, 60000);
}
@@ -80,7 +80,7 @@ namespace System.Web.Caching {
/// </summary>
/// <param name="objEntry">Cache entry to add.</param>
internal void Add (CacheEntry objEntry) {
- long now = DateTime.Now.Ticks;
+ long now = DateTime.UtcNow.Ticks;
if (objEntry.Expires < now)
objEntry.Expires = now;
diff --git a/mcs/class/System.Web/System.Web.Caching/ChangeLog b/mcs/class/System.Web/System.Web.Caching/ChangeLog
index 3b09664543a..1b19523286f 100644
--- a/mcs/class/System.Web/System.Web.Caching/ChangeLog
+++ b/mcs/class/System.Web/System.Web.Caching/ChangeLog
@@ -1,3 +1,8 @@
+2004-10-03 Ben Maurer <bmaurer@ximian.com>
+
+ * Cache.cs, CacheEntry.cs, CacheExpires.cs, ExpiresBuckets.cs:
+ use UtcNow rather than Now.
+
2004-05-27 Patrik Torstensson <totte@hiddenpeaks.com>
* ExpiresBucket.cs (FlushExpiredItems): fix csc and a typo bug
diff --git a/mcs/class/System.Web/System.Web.Caching/ExpiresBuckets.cs b/mcs/class/System.Web/System.Web.Caching/ExpiresBuckets.cs
index e32194c836c..7b8c139afeb 100644
--- a/mcs/class/System.Web/System.Web.Caching/ExpiresBuckets.cs
+++ b/mcs/class/System.Web/System.Web.Caching/ExpiresBuckets.cs
@@ -231,7 +231,7 @@ namespace System.Web.Caching {
int intPos;
long ticksNow;
- ticksNow = DateTime.Now.Ticks;
+ ticksNow = DateTime.UtcNow.Ticks;
intPos = 0;
// Lookup all items that needs to be removed, this is done in a two part
diff --git a/mcs/class/System.Web/System.Web.Compilation/BuildProviderResultFlags.cs b/mcs/class/System.Web/System.Web.Compilation/BuildProviderResultFlags.cs
deleted file mode 100644
index 3cd3ea5723a..00000000000
--- a/mcs/class/System.Web/System.Web.Compilation/BuildProviderResultFlags.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// System.Web.Compilation.BuildProviderResultFlags.cs
-//
-// Authors:
-// Duncan Mak (duncan@ximian.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.
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-
-using System.Resources;
-
-#if NET_2_0
-namespace System.Web.Compilation
-{
- [Serializable, Flags]
- public enum BuildProviderResultFlags
- {
- Default = 0,
- ShutdownAppDomainOnChange = 1
- }
-}
-#endif
diff --git a/mcs/class/System.Web/System.Web.Compilation/ChangeLog b/mcs/class/System.Web/System.Web.Compilation/ChangeLog
index 5d1e428381b..80c8ae1ffbf 100644
--- a/mcs/class/System.Web/System.Web.Compilation/ChangeLog
+++ b/mcs/class/System.Web/System.Web.Compilation/ChangeLog
@@ -1,3 +1,7 @@
+2004-09-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * WebServiceCompiler.cs: fix buglet in my last commit.
+
2004-09-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* BaseCompiler.cs:
diff --git a/mcs/class/System.Web/System.Web.Compilation/IImplicitResourceProvider.cs b/mcs/class/System.Web/System.Web.Compilation/IImplicitResourceProvider.cs
deleted file mode 100644
index 3e2c38ff5db..00000000000
--- a/mcs/class/System.Web/System.Web.Compilation/IImplicitResourceProvider.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.Web.Compilation.IImplicitResourceProvider.cs
-//
-// Authors:
-// Duncan Mak (duncan@ximian.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.
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-
-#if NET_2_0
-
-using System.Collections;
-using System.Globalization;
-
-namespace System.Web.Compilation
-{
- public interface IImplicitResourceProvider
- {
- object GetObject (ImplicitResourceKey key, CultureInfo culture);
- ICollection GetResources (string keyPrefix);
- }
-}
-#endif
diff --git a/mcs/class/System.Web/System.Web.Compilation/IResourceReader.cs b/mcs/class/System.Web/System.Web.Compilation/IResourceReader.cs
deleted file mode 100644
index 4cdb8b14784..00000000000
--- a/mcs/class/System.Web/System.Web.Compilation/IResourceReader.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.Web.Compilation.IResourceProvider.cs
-//
-// Authors:
-// Duncan Mak (duncan@ximian.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.
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-
-using System.Resources;
-
-#if NET_2_0
-namespace System.Web.Compilation
-{
- public interface IResourceProvider
- {
- IResourceReader ResourceReader { get; }
- }
-}
-#endif
diff --git a/mcs/class/System.Web/System.Web.Compilation/ImplicitResourceKey.cs b/mcs/class/System.Web/System.Web.Compilation/ImplicitResourceKey.cs
deleted file mode 100644
index ac2bab3c256..00000000000
--- a/mcs/class/System.Web/System.Web.Compilation/ImplicitResourceKey.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// System.Web.Compilation.IImplicitResourceProvider.cs
-//
-// Authors:
-// Duncan Mak (duncan@ximian.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.
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-
-#if NET_2_0
-namespace System.Web.Compilation
-{
- public class ImplicitResourceKey
- {
- public ImplicitResourceKey ()
- {
- }
-
- public string Filter;
- public string KeyPrefix;
- public string Property;
- }
-}
-#endif
diff --git a/mcs/class/System.Web/System.Web.Compilation/WebServiceCompiler.cs b/mcs/class/System.Web/System.Web.Compilation/WebServiceCompiler.cs
index 469bb0aba72..4df2b6b9a94 100644
--- a/mcs/class/System.Web/System.Web.Compilation/WebServiceCompiler.cs
+++ b/mcs/class/System.Web/System.Web.Compilation/WebServiceCompiler.cs
@@ -64,7 +64,7 @@ namespace System.Web.Compilation
return type;
if (parser.Program.Trim () == "") {
- type = parser.GetTypeFromBin (parser.PhysicalPath);
+ type = parser.GetTypeFromBin (parser.ClassName);
CachingCompiler.InsertType (type, parser.PhysicalPath);
return type;
}
diff --git a/mcs/class/System.Web/System.Web.Handlers/ChangeLog b/mcs/class/System.Web/System.Web.Handlers/ChangeLog
index 50459bd9024..4f3e185e220 100644
--- a/mcs/class/System.Web/System.Web.Handlers/ChangeLog
+++ b/mcs/class/System.Web/System.Web.Handlers/ChangeLog
@@ -1,3 +1,8 @@
+2004-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * TraceHandler.cs: error code is 403 and the message different when
+ trace is enabled but not for remote clients.
+
2004-07-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* TraceHandler.cs: check that trace is enabled or throw.
diff --git a/mcs/class/System.Web/System.Web.Handlers/TraceHandler.cs b/mcs/class/System.Web/System.Web.Handlers/TraceHandler.cs
index 343aa5957a7..23e35288f80 100644
--- a/mcs/class/System.Web/System.Web.Handlers/TraceHandler.cs
+++ b/mcs/class/System.Web/System.Web.Handlers/TraceHandler.cs
@@ -44,11 +44,21 @@ namespace System.Web.Handlers
#endif
class TraceNotAvailableException : HttpException
{
- public TraceNotAvailableException () :
- base ("Trace Error") {}
+ bool notLocal;
+
+ public TraceNotAvailableException (bool notLocal) :
+ base (notLocal ? 403 : 500, "Trace Error")
+ {
+ this.notLocal = notLocal;
+ }
internal override string Description {
- get { return "Trace.axd is not enabled in the configuration file for this application."; }
+ get {
+ if (notLocal)
+ return "Trace is not enabled for remote clients.";
+
+ return "Trace.axd is not enabled in the configuration file for this application.";
+ }
}
}
@@ -58,9 +68,8 @@ namespace System.Web.Handlers
{
TraceManager manager = HttpRuntime.TraceManager;
- if (!manager.Enabled || manager.LocalOnly && !context.Request.IsLocal) {
- throw new TraceNotAvailableException ();
- }
+ if (!manager.Enabled || manager.LocalOnly && !context.Request.IsLocal)
+ throw new TraceNotAvailableException (manager.Enabled);
HtmlTextWriter output = new HtmlTextWriter (context.Response.Output);
diff --git a/mcs/class/System.Web/System.Web.SessionState/ChangeLog b/mcs/class/System.Web/System.Web.SessionState/ChangeLog
index 3e70b628dc9..65d40fbe0bc 100644
--- a/mcs/class/System.Web/System.Web.SessionState/ChangeLog
+++ b/mcs/class/System.Web/System.Web.SessionState/ChangeLog
@@ -1,3 +1,13 @@
+2004-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * SessionStateModule.cs: use SetCurrentExePath instead of SetFilePath.
+
+2004-09-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * HttpSessionState.cs: don't share static session objects declared in
+ the application file across the application, but on a per-session
+ basis. Fixes bug #65446.
+
2004-07-07 Juraj Skripsky <juraj@hotfeet.ch>
* SessionStateModule.cs: set path in session cookie to application
diff --git a/mcs/class/System.Web/System.Web.SessionState/HttpSessionState.cs b/mcs/class/System.Web/System.Web.SessionState/HttpSessionState.cs
index 0e92660cbc1..03fcacbb118 100644
--- a/mcs/class/System.Web/System.Web.SessionState/HttpSessionState.cs
+++ b/mcs/class/System.Web/System.Web.SessionState/HttpSessionState.cs
@@ -59,7 +59,7 @@ public sealed class HttpSessionState : ICollection, IEnumerable
{
_id = id;
_dict = dict;
- _staticObjects = staticObjects;
+ _staticObjects = staticObjects.Clone ();
_timeout = timeout;
_newSession = newSession;
_isCookieless = isCookieless;
diff --git a/mcs/class/System.Web/System.Web.SessionState/SessionStateModule.cs b/mcs/class/System.Web/System.Web.SessionState/SessionStateModule.cs
index cbee9af88f8..c909e2a4086 100644
--- a/mcs/class/System.Web/System.Web.SessionState/SessionStateModule.cs
+++ b/mcs/class/System.Web/System.Web.SessionState/SessionStateModule.cs
@@ -109,7 +109,7 @@ namespace System.Web.SessionState
if (id == null)
return;
- context.Request.SetFilePath (UrlUtils.RemoveSessionId (base_path,
+ context.Request.SetCurrentExePath (UrlUtils.RemoveSessionId (base_path,
context.Request.FilePath));
context.Request.SetHeader (HeaderName, id);
}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/AdRotator.cs b/mcs/class/System.Web/System.Web.UI.WebControls/AdRotator.cs
index 0777e266fc4..de46e7d14ac 100755
--- a/mcs/class/System.Web/System.Web.UI.WebControls/AdRotator.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/AdRotator.cs
@@ -217,7 +217,7 @@ namespace System.Web.UI.WebControls
[Bindable(true)]
[DefaultValue("")]
[Editor ("System.Web.UI.Design.XmlUrlEditor, " + Consts.AssemblySystem_Design, typeof (System.Drawing.Design.UITypeEditor))]
- [WebCategory("Behaviour")]
+ [WebCategory("Behavior")]
[WebSysDescription("AdRotator_AdvertisementFile")]
public string AdvertisementFile {
get { return ((advertisementFile != null) ? advertisementFile : ""); }
@@ -232,7 +232,7 @@ namespace System.Web.UI.WebControls
[Bindable(true)]
[DefaultValue("")]
- [WebCategory("Behaviour")]
+ [WebCategory("Behavior")]
[WebSysDescription("AdRotator_KeywordFilter")]
public string KeywordFilter {
get {
@@ -251,7 +251,7 @@ namespace System.Web.UI.WebControls
[Bindable(true)]
[DefaultValue("")]
[TypeConverter(typeof(TargetConverter))]
- [WebCategory("Behaviour")]
+ [WebCategory("Behavior")]
[WebSysDescription("AdRotator_Target")]
public string Target {
get {
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/BaseCompareValidator.cs b/mcs/class/System.Web/System.Web.UI.WebControls/BaseCompareValidator.cs
index 86de6a314f5..83ac1c850cc 100755
--- a/mcs/class/System.Web/System.Web.UI.WebControls/BaseCompareValidator.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/BaseCompareValidator.cs
@@ -56,7 +56,7 @@ namespace System.Web.UI.WebControls
}
[DefaultValue(ValidationDataType.String)]
- [WebCategory("Behaviour")]
+ [WebCategory("Behavior")]
[WebSysDescription("RangeValidator_Type")]
public ValidationDataType Type
{
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog b/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
index aada87a6c2d..632b24ace91 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
@@ -1,3 +1,12 @@
+2004-09-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * TableStyle.cs: don't render empty 'rules' attribute (again).
+
+2004-09-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * RadioButton.cs: fix GroupName when the control is inside a
+ NamingContainer different from Page. Closes bug #65586.
+
2004-09-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* Xml.cs: fixed get_DocumentContent (it was returning "" always!) and
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/RadioButton.cs b/mcs/class/System.Web/System.Web.UI.WebControls/RadioButton.cs
index 27bfa2c99a3..becb19787bc 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/RadioButton.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/RadioButton.cs
@@ -99,19 +99,23 @@ namespace System.Web.UI.WebControls
writer.RenderBeginTag (System.Web.UI.HtmlTextWriterTag.Input);
writer.RenderEndTag ();
}
-
- private string UniqueGroupNamePrivate
- {
- get {
- string retVal = GroupName;
- int unique = UniqueID.LastIndexOf (':');
- if (unique >= 0)
- retVal += UniqueID.Substring (unique + 1);
-
- return retVal;
- }
- }
-
+
+ private string UniqueGroupNamePrivate
+ {
+ get {
+ string retVal;
+ string uid = UniqueID;
+ int unique = uid.LastIndexOf (':');
+ if (unique == -1) {
+ retVal = GroupName;
+ } else {
+ retVal = uid.Substring (0, unique + 1) + GroupName;
+ }
+
+ return retVal;
+ }
+ }
+
private string ValueAttributePrivate
{
get {
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TableStyle.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TableStyle.cs
index 413b8a0745c..a1653a11928 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TableStyle.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/TableStyle.cs
@@ -171,7 +171,7 @@ namespace System.Web.UI.WebControls
{
writer.AddAttribute(HtmlTextWriterAttribute.Align, Enum.Format(typeof(HorizontalAlign), HorizontalAlign, "G"));
}
- string gd = String.Empty;
+ string gd = null;
switch(GridLines)
{
case GridLines.None: break;
@@ -182,6 +182,8 @@ namespace System.Web.UI.WebControls
case GridLines.Both: gd = "all";
break;
}
+
+ if (gd != null)
writer.AddAttribute(HtmlTextWriterAttribute.Rules, gd);
}
diff --git a/mcs/class/System.Web/System.Web.UI/ChangeLog b/mcs/class/System.Web/System.Web.UI/ChangeLog
index 6337d82a2c2..4f16a45684a 100644
--- a/mcs/class/System.Web/System.Web.UI/ChangeLog
+++ b/mcs/class/System.Web/System.Web.UI/ChangeLog
@@ -1,3 +1,13 @@
+2004-10-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * Control.cs: even if the control has no children the naming container
+ may contain the control we're looking for. Fixes bug #67304.
+
+2004-09-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * TemplateParser.cs: ensure bin directory exists before trying to access
+ it. Fixes bug #65446 (not closed yet due to dependencies).
+
2004-09-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* SimpleWebHandlerParser.cs: correctly cache Type instead of the
diff --git a/mcs/class/System.Web/System.Web.UI/Control.cs b/mcs/class/System.Web/System.Web.UI/Control.cs
index b2d3ada71f2..da9aac46dc8 100644
--- a/mcs/class/System.Web/System.Web.UI/Control.cs
+++ b/mcs/class/System.Web/System.Web.UI/Control.cs
@@ -501,9 +501,6 @@ namespace System.Web.UI
protected virtual Control FindControl (string id, int pathOffset)
{
EnsureChildControls ();
- if (_controls == null)
- return null;
-
Control namingContainer = null;
if (!_isNamingContainer) {
namingContainer = NamingContainer;
@@ -512,7 +509,10 @@ namespace System.Web.UI
return namingContainer.FindControl (id, pathOffset);
}
-
+
+ if (!HasControls ())
+ return null;
+
int colon = id.IndexOf (':', pathOffset);
if (colon == -1)
return LookForControlByName (id.Substring (pathOffset));
diff --git a/mcs/class/System.Web/System.Web.UI/TemplateParser.cs b/mcs/class/System.Web/System.Web.UI/TemplateParser.cs
index 55d98c7cb6b..6402b7f84f8 100755
--- a/mcs/class/System.Web/System.Web.UI/TemplateParser.cs
+++ b/mcs/class/System.Web/System.Web.UI/TemplateParser.cs
@@ -276,6 +276,9 @@ namespace System.Web.UI
return null;
// Load from bin
+ if (!Directory.Exists (PrivateBinPath))
+ return null;
+
string [] binDlls = Directory.GetFiles (PrivateBinPath, "*.dll");
foreach (string s in binDlls) {
Assembly binA = Assembly.LoadFrom (s);
diff --git a/mcs/class/System.Web/System.Web/ChangeLog b/mcs/class/System.Web/System.Web/ChangeLog
index cd306ffaded..9bfa82351cf 100644
--- a/mcs/class/System.Web/System.Web/ChangeLog
+++ b/mcs/class/System.Web/System.Web/ChangeLog
@@ -1,8 +1,73 @@
+2004-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * HttpRequest.cs: CurrentExecutionFilePath is the one that
+ changes when Transfer or Execute are used, not FilePath.
+
+ * HttpServerUtility.cs: moved form saving/restoring from
+ Transfer to Execute, as it's needed there too. the query string is
+ correctly set now. Fixes bug #67388.
+
+ * HttpContext.cs: use SetCurrentExePath instead of SetFilePath.
+
+2004-10-03 Ben Maurer <bmaurer@ximian.com>
+
+ * HttpResponse.cs: use UtcNow
+
+2004-10-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * HttpResponse.cs: SuppressContent does not throw and clears all the
+ buffered output. Fixes bug #67213.
+
+2004-09-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * HttpUtility.cs: UrlPathEncode is static. Fixes bug #67155.
+
+2004-09-29 Ben Maurer <bmaurer@ximian.com>
+
+ * HttpContext.cs, TimeoutManager: Use DateTime.UtcNow.
+
+2004-09-25 Ben Maurer <bmaurer@ximian.com>
+
+ * HttpApplication.cs: Make sure requests are removed from
+ the timeout manager. Fixes a major leak. #66751.
+
+2004-09-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * HttpApplicationFactory.cs:
+ * HttpRuntime.cs: implemented UnloadAppDomain and be ready for domain
+ unloading.
+
+2004-09-12 Ben Maurer <bmaurer@ximian.com>
+
+ * HttpContext.cs: use CallContext. It is a little bit faster.
+
+2004-09-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * HttpStaticObjectsCollection.cs: don't share static session objects
+ declared in the application file across the application, but on a
+ per-session basis. Fixes bug #65446.
+
+2004-09-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * HttpServerUtility.cs: in Transfer(path), don't keep form data if
+ the transfer is done from inside a page that received a postback.
+ Fixes bug #65613.
+
+2004-09-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * HttpValueCollection.cs: fixed signature of ToString (). Closes bug
+ #65392.
+
2004-09-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* HttpApplication.cs: only add/remove to/from the timeout
manager when we're in a interruptible step.
+2004-09-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * TraceContext.cs: when IsEnabled has not been set, return the value
+ from the TraceManager. Fixes bug #63469.
+
2004-08-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* HttpRuntime.cs: initialize the response writer when finishing a
diff --git a/mcs/class/System.Web/System.Web/HttpApplication.cs b/mcs/class/System.Web/System.Web/HttpApplication.cs
index 37599a8e1f0..91dfda2ae8d 100644
--- a/mcs/class/System.Web/System.Web/HttpApplication.cs
+++ b/mcs/class/System.Web/System.Web/HttpApplication.cs
@@ -664,19 +664,23 @@ namespace System.Web
handler = _handlers [_currentStateIdx];
_countSteps++;
timeoutPossible = handler.PossibleToTimeout;
- if (timeoutPossible)
- HttpRuntime.TimeoutManager.Add (_app.Context);
-
- lasterror = ExecuteState (handler, ref ready_sync);
- if (ready_sync)
- _countSyncSteps++;
+ try {
+ if (timeoutPossible)
+ HttpRuntime.TimeoutManager.Add (_app.Context);
+
+ lasterror = ExecuteState (handler, ref ready_sync);
+ if (ready_sync)
+ _countSyncSteps++;
+ } finally {
+ if (timeoutPossible)
+ HttpRuntime.TimeoutManager.Remove (_app.Context);
+ }
} while (ready_sync && _currentStateIdx < _endStateIdx);
if (null != lasterror)
_app.HandleError (lasterror);
} finally {
- if (timeoutPossible)
- HttpRuntime.TimeoutManager.Remove (_app.Context);
+
_app.OnStateExecuteLeave ();
}
diff --git a/mcs/class/System.Web/System.Web/HttpApplicationFactory.cs b/mcs/class/System.Web/System.Web/HttpApplicationFactory.cs
index 65ce0a9f9e1..5882982564c 100644
--- a/mcs/class/System.Web/System.Web/HttpApplicationFactory.cs
+++ b/mcs/class/System.Web/System.Web/HttpApplicationFactory.cs
@@ -142,43 +142,39 @@ namespace System.Web {
return appTypeEventHandlers;
}
-
- static bool FireEvents (string method_name, object target, object [] args)
- {
- Hashtable possibleEvents = GetApplicationTypeEvents ((HttpApplication) target);
- MethodInfo method = possibleEvents [method_name] as MethodInfo;
- if (method == null)
- return false;
-
- if (method.GetParameters ().Length == 0)
- method.Invoke (target, null);
- else
- method.Invoke (target, args);
-
- return true;
- }
-
+
+ static bool FireEvent (string method_name, object target, object [] args)
+ {
+ Hashtable possibleEvents = GetApplicationTypeEvents ((HttpApplication) target);
+ MethodInfo method = possibleEvents [method_name] as MethodInfo;
+ if (method == null)
+ return false;
+
+ if (method.GetParameters ().Length == 0)
+ method.Invoke (target, null);
+ else
+ method.Invoke (target, args);
+
+ return true;
+ }
+
internal static void FireOnAppStart (HttpApplication app)
- {
+ {
object [] args = new object [] {app, EventArgs.Empty};
- FireEvents ("Application_Start", app, args);
- }
-
- void FireOnAppEnd ()
- {
- // FireEvents ("Application_End", this, new object [] {this, EventArgs.Empty});
- }
-
- void FireOnSessionStart (HttpSessionState state, object source, EventArgs args)
- {
- // FireEvents ("Session_Start", state, new object [] {source, EventArgs.Empty});
- }
-
- void FireOnSessionEnd (HttpSessionState state, object source, EventArgs args)
- {
- // FireEvents ("Session_End", state, new object [] {source, args});
- }
-
+ FireEvent ("Application_Start", app, args);
+ }
+
+ void FireOnAppEnd ()
+ {
+ if (_appType == null)
+ return; // we didn't even get an application
+
+ HttpApplication app = (HttpApplication) HttpRuntime.CreateInternalObject (_appType);
+ AttachEvents (app);
+ FireEvent ("Application_End", app, new object [] {this, EventArgs.Empty});
+ app.Dispose ();
+ }
+
private void InitializeFactory (HttpContext context)
{
_appFilename = GetAppFilename (context);
diff --git a/mcs/class/System.Web/System.Web/HttpContext.cs b/mcs/class/System.Web/System.Web/HttpContext.cs
index 8ffb184383e..4d28af400ad 100644
--- a/mcs/class/System.Web/System.Web/HttpContext.cs
+++ b/mcs/class/System.Web/System.Web/HttpContext.cs
@@ -38,6 +38,7 @@ using System.Web.Configuration;
using System.Web.Util;
using System.Web.SessionState;
using System.Threading;
+using System.Runtime.Remoting.Messaging;
namespace System.Web
{
@@ -96,15 +97,14 @@ namespace System.Web
}
}
- [MonoTODO("Context - Use System.Remoting.Messaging.CallContext instead of Thread storage")]
internal static HttpContext Context
{
get {
- return (HttpContext) Thread.GetData (Thread.GetNamedDataSlot ("Context"));
+ return (HttpContext) CallContext.GetData ("Context");
}
set {
- Thread.SetData (Thread.GetNamedDataSlot ("Context"), value);
+ CallContext.SetData ("Context", value);
}
}
@@ -287,7 +287,7 @@ namespace System.Web
internal void BeginTimeoutPossible ()
{
timeoutPossible = 1;
- timeoutBegin = DateTime.Now.Ticks;
+ timeoutBegin = DateTime.UtcNow.Ticks;
}
internal void EndTimeoutPossible ()
@@ -403,7 +403,7 @@ namespace System.Web
throw new HttpException (404, "The virtual path '" + path +
"' maps to another application.");
- Request.SetFilePath (path);
+ Request.SetCurrentExePath (path);
Request.QueryStringRaw = query;
}
diff --git a/mcs/class/System.Web/System.Web/HttpRequest.cs b/mcs/class/System.Web/System.Web/HttpRequest.cs
index 5b1cbef349c..48140d4c1f9 100644
--- a/mcs/class/System.Web/System.Web/HttpRequest.cs
+++ b/mcs/class/System.Web/System.Web/HttpRequest.cs
@@ -88,6 +88,7 @@ namespace System.Web {
Stream userFilter;
HttpRequestStream requestFilter;
string clientTarget;
+ string currentExePath;
#if NET_1_1
bool validateCookies;
bool validateForm;
@@ -503,6 +504,9 @@ namespace System.Web {
public string CurrentExecutionFilePath {
get {
+ if (currentExePath != null)
+ return currentExePath;
+
return FilePath;
}
}
@@ -1139,9 +1143,9 @@ namespace System.Web {
}
#endif
- internal void SetFilePath (string filePath)
+ internal void SetCurrentExePath (string filePath)
{
- _sFilePath = filePath;
+ currentExePath = filePath;
_sRequestRootVirtualDir = null;
baseVirtualDir = null;
}
diff --git a/mcs/class/System.Web/System.Web/HttpResponse.cs b/mcs/class/System.Web/System.Web/HttpResponse.cs
index 45128ce4415..fa8c2892af8 100644
--- a/mcs/class/System.Web/System.Web/HttpResponse.cs
+++ b/mcs/class/System.Web/System.Web/HttpResponse.cs
@@ -190,7 +190,7 @@ namespace System.Web
CultureInfo oSavedInfo = Thread.CurrentThread.CurrentCulture;
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
- string date = DateTime.Now.ToUniversalTime ().ToString ("ddd, d MMM yyyy HH:mm:ss ");
+ string date = DateTime.UtcNow.ToString ("ddd, d MMM yyyy HH:mm:ss ");
HttpResponseHeader date_header = new HttpResponseHeader ("Date", date + "GMT");
oHeaders.Add (date_header);
@@ -618,9 +618,6 @@ namespace System.Web
}
set {
- if (_bHeadersSent)
- throw new HttpException ("Headers has been sent to the client");
-
_bSuppressContent = true;
}
}
@@ -846,6 +843,9 @@ namespace System.Web
if (!_bSuppressContent && Request.HttpMethod == "HEAD")
_bSuppressContent = true;
+ if (_bSuppressContent)
+ _Writer.Clear ();
+
if (!_bSuppressContent) {
_bClientDisconnected = false;
if (_bChunked) {
diff --git a/mcs/class/System.Web/System.Web/HttpRuntime.cs b/mcs/class/System.Web/System.Web/HttpRuntime.cs
index 9ebbf381c93..da23b53407b 100644
--- a/mcs/class/System.Web/System.Web/HttpRuntime.cs
+++ b/mcs/class/System.Web/System.Web/HttpRuntime.cs
@@ -61,11 +61,10 @@ namespace System.Web {
private int _activeRequests;
private HttpWorkerRequest.EndOfSendNotification _endOfSendCallback;
private AsyncCallback _handlerCallback;
- private WaitCallback _appDomainCallback;
+ private WaitCallback unloadDomainCallback;
private bool _firstRequestStarted;
private bool _firstRequestExecuted;
- private DateTime _firstRequestStartTime;
private Exception _initError;
private TimeoutManager timeoutManager;
@@ -95,9 +94,10 @@ namespace System.Web {
_cache = new Cache ();
timeoutManager = new TimeoutManager ();
- _endOfSendCallback = new HttpWorkerRequest.EndOfSendNotification(OnEndOfSend);
- _handlerCallback = new AsyncCallback(OnHandlerReady);
- _appDomainCallback = new WaitCallback(OnAppDomainUnload);
+ _endOfSendCallback = new HttpWorkerRequest.EndOfSendNotification (OnEndOfSend);
+ _handlerCallback = new AsyncCallback (OnHandlerReady);
+ unloadDomainCallback = new WaitCallback (DoUnload);
+ AppDomain.CurrentDomain.DomainUnload += new EventHandler (OnDomainUnload);
}
catch (Exception error) {
_initError = error;
@@ -238,17 +238,29 @@ namespace System.Web {
_runtime.FinishRequest (context, exception);
}
- private void OnAppDomainUnload(object state) {
- Dispose();
+ void DoUnload (object state)
+ {
+ AppDomain.Unload (AppDomain.CurrentDomain);
}
internal void Dispose() {
- WaitForRequests(5000);
+ WaitForRequests (2000);
queueManager.Dispose (); // Send a 503 to all queued requests
queueManager = null;
_cache = null;
- HttpApplicationFactory.EndApplication();
+ HttpApplicationFactory.EndApplication ();
+ }
+
+ void OnDomainUnload (object o, EventArgs args)
+ {
+ HttpApplicationFactory.EndApplication ();
+ }
+
+ internal void ByeByeDomain ()
+ {
+ HttpApplicationFactory.EndApplication ();
+ ThreadPool.QueueUserWorkItem (unloadDomainCallback);
}
internal void WaitForRequests(int ms) {
@@ -277,7 +289,6 @@ namespace System.Web {
if (!_firstRequestStarted) {
lock (this) {
if (!_firstRequestStarted) {
- _firstRequestStartTime = DateTime.Now;
OnFirstRequestStart(context);
_firstRequestStarted = true;
}
@@ -315,7 +326,7 @@ namespace System.Web {
void TryExecuteQueuedRequests ()
{
// Wait for pending jobs to start
- if (Interlocked.CompareExchange (ref pendingCallbacks, 3, 3) == 3)
+ if (Interlocked.CompareExchange (ref pendingCallbacks, 3, 3) >= 3)
return;
HttpWorkerRequest wr = queueManager.GetNextRequest (null);
@@ -344,10 +355,9 @@ namespace System.Web {
}
#if NET_1_1
- [MonoTODO]
- public void UnloadAppDomain ()
+ public static void UnloadAppDomain ()
{
- throw new NotImplementedException ();
+ _runtime.ByeByeDomain ();
}
#endif
public static Cache Cache {
@@ -444,7 +454,7 @@ namespace System.Web {
public static void Close ()
{
- _runtime.Dispose();
+ _runtime.Dispose ();
}
internal static string FormatResourceString (string key)
diff --git a/mcs/class/System.Web/System.Web/HttpServerUtility.cs b/mcs/class/System.Web/System.Web/HttpServerUtility.cs
index 29022db8253..86c925de04b 100644
--- a/mcs/class/System.Web/System.Web/HttpServerUtility.cs
+++ b/mcs/class/System.Web/System.Web/HttpServerUtility.cs
@@ -46,6 +46,7 @@ using System.Collections.Specialized;
using System.IO;
using System.Text;
using System.Web.Hosting;
+using System.Web.UI;
using System.Web.Util;
namespace System.Web
@@ -191,19 +192,26 @@ namespace System.Web
} else {
query = "";
}
-
- string filePath = _Context.Request.MapPath (path);
+
+ HttpRequest request = _Context.Request;
HttpResponse response = _Context.Response;
+
+ string oldQuery = request.QueryStringRaw;
+ request.QueryStringRaw = query;
+
+ HttpValueCollection oldForm = null;
+ if (!preserveQuery) {
+ oldForm = _Context.Request.Form as HttpValueCollection;
+ _Context.Request.SetForm (new HttpValueCollection ());
+ }
+
+ string filePath = _Context.Request.MapPath (path);
TextWriter output = writer;
if (output == null)
output = response.Output;
- HttpRequest request = _Context.Request;
string oldFilePath = request.FilePath;
- request.SetFilePath (UrlUtils.Combine (_Context.Request.BaseVirtualDir, path));
- string oldQuery = request.QueryStringRaw;
-
- if (!preserveQuery) request.QueryStringRaw = query;
+ request.SetCurrentExePath (UrlUtils.Combine (_Context.Request.BaseVirtualDir, path));
IHttpHandler handler = _Context.ApplicationInstance.CreateHttpHandler (_Context,
request.RequestType,
path,
@@ -220,9 +228,11 @@ namespace System.Web
asyncHandler.EndProcessRequest (ar);
}
} finally {
- request.SetFilePath (oldFilePath);
+ request.SetCurrentExePath (oldFilePath);
request.QueryStringRaw = oldQuery;
response.SetTextWriter (previous);
+ if (!preserveQuery)
+ _Context.Request.SetForm (oldForm);
}
}
@@ -303,7 +313,15 @@ namespace System.Web
/// <param name="path">The URL path of the new page on the server to execute. </param>
public void Transfer (string path)
{
- Transfer (path, true);
+ // If it's a page and a postback, don't pass form data
+ // See bug #65613.
+ bool preserveForm = true;
+ if (_Context.Handler is Page) {
+ Page page = (Page) _Context.Handler;
+ preserveForm = !page.IsPostBack;
+ }
+
+ Transfer (path, preserveForm);
}
/// <summary>
@@ -315,16 +333,7 @@ namespace System.Web
/// they are cleared. The default is false. </param>
public void Transfer (string path, bool preserveForm)
{
- HttpValueCollection oldForm = null;
- if (!preserveForm) {
- oldForm = _Context.Request.Form as HttpValueCollection;
- _Context.Request.SetForm (new HttpValueCollection ());
- }
-
Execute (path, null, preserveForm);
- if (!preserveForm)
- _Context.Request.SetForm (oldForm);
-
_Context.Response.End ();
}
diff --git a/mcs/class/System.Web/System.Web/HttpStaticObjectsCollection.cs b/mcs/class/System.Web/System.Web/HttpStaticObjectsCollection.cs
index 46d7c129396..873da72de7c 100644
--- a/mcs/class/System.Web/System.Web/HttpStaticObjectsCollection.cs
+++ b/mcs/class/System.Web/System.Web/HttpStaticObjectsCollection.cs
@@ -37,6 +37,11 @@ namespace System.Web {
this.type = type;
}
+ public StaticItem (StaticItem item)
+ {
+ this.type = item.type;
+ }
+
public object Instance {
get {
lock (this) {
@@ -101,6 +106,18 @@ namespace System.Web {
get { return this; }
}
+ internal HttpStaticObjectsCollection Clone ()
+ {
+ HttpStaticObjectsCollection coll = new HttpStaticObjectsCollection ();
+ coll._Objects = new Hashtable ();
+ foreach (string key in _Objects.Keys) {
+ StaticItem item = new StaticItem ((StaticItem) _Objects [key]);
+ coll._Objects [key] = item;
+ }
+
+ return coll;
+ }
+
internal void Add (ObjectTagBuilder tag)
{
_Objects.Add (tag.ObjectID, new StaticItem (tag.Type));
diff --git a/mcs/class/System.Web/System.Web/HttpUtility.cs b/mcs/class/System.Web/System.Web/HttpUtility.cs
index d1a2d0dbb07..c7f3fecf63b 100644
--- a/mcs/class/System.Web/System.Web/HttpUtility.cs
+++ b/mcs/class/System.Web/System.Web/HttpUtility.cs
@@ -829,7 +829,7 @@ namespace System.Web {
}
#if NET_1_1
- public string UrlPathEncode (string s)
+ public static string UrlPathEncode (string s)
{
if (s == null)
return null;
diff --git a/mcs/class/System.Web/System.Web/HttpValueCollection.cs b/mcs/class/System.Web/System.Web/HttpValueCollection.cs
index 946b8542d46..e8ba4e3a0db 100644
--- a/mcs/class/System.Web/System.Web/HttpValueCollection.cs
+++ b/mcs/class/System.Web/System.Web/HttpValueCollection.cs
@@ -211,7 +211,7 @@ namespace System.Web
return result.ToString ();
}
- virtual new public string ToString ()
+ public override string ToString ()
{
return ToString (false);
}
diff --git a/mcs/class/System.Web/System.Web/TimeoutManager.cs b/mcs/class/System.Web/System.Web/TimeoutManager.cs
index d686568cc88..2fbdd35e3f6 100644
--- a/mcs/class/System.Web/System.Web/TimeoutManager.cs
+++ b/mcs/class/System.Web/System.Web/TimeoutManager.cs
@@ -106,7 +106,7 @@ namespace System.Web
return;
}
- DateTime now = DateTime.Now;
+ DateTime now = DateTime.UtcNow;
ArrayList clist = new ArrayList ();
lock (this) { // The lock prevents Keys enumerator from being out of synch
diff --git a/mcs/class/System.Web/System.Web/TraceContext.cs b/mcs/class/System.Web/System.Web/TraceContext.cs
index f939add498b..f4ad22af99d 100644
--- a/mcs/class/System.Web/System.Web/TraceContext.cs
+++ b/mcs/class/System.Web/System.Web/TraceContext.cs
@@ -42,7 +42,7 @@ namespace System.Web {
private TraceMode _Mode;
private TraceData data;
private bool data_saved;
- private bool _haveTrace = false;
+ private bool _haveTrace;
public TraceContext(HttpContext Context) {
_Context = Context;
@@ -58,6 +58,8 @@ namespace System.Web {
public bool IsEnabled {
get {
+ if (!_haveTrace)
+ return HttpRuntime.TraceManager.Enabled;
return _Enabled;
}
@@ -104,7 +106,7 @@ namespace System.Web {
}
private void Write(string category, string msg, Exception error, bool Warning) {
- if (!_Enabled)
+ if (!IsEnabled)
return;
if (data == null)
data = new TraceData ();
diff --git a/mcs/class/System.XML/Mono.Xml.Xsl/ChangeLog b/mcs/class/System.XML/Mono.Xml.Xsl/ChangeLog
index ece4b875d31..bb78351e9de 100644
--- a/mcs/class/System.XML/Mono.Xml.Xsl/ChangeLog
+++ b/mcs/class/System.XML/Mono.Xml.Xsl/ChangeLog
@@ -1,3 +1,12 @@
+2004-10-04 Atsushi Enomoto <atsushi@ximian.com>
+
+ * HtmlEmitter.cs : TH tag is not regarded as HTML tag.
+ This fixes bug #67390.
+
+Thu Sep 9 07:09:11 PDT 2004 Paolo Molaro <lupus@ximian.com>
+
+ * ScriptCompilerInfo.cs: avoid using a .cctor and fix precomp.
+
2004-06-18 Atsushi Enomoto <atsushi@ximian.com>
* Debug.cs, HtmlEmitter.cs, MSXslScriptManager.cs,
diff --git a/mcs/class/System.XML/Mono.Xml.Xsl/HtmlEmitter.cs b/mcs/class/System.XML/Mono.Xml.Xsl/HtmlEmitter.cs
index 39839561219..ad5872c3c9a 100644
--- a/mcs/class/System.XML/Mono.Xml.Xsl/HtmlEmitter.cs
+++ b/mcs/class/System.XML/Mono.Xml.Xsl/HtmlEmitter.cs
@@ -226,9 +226,8 @@ namespace Mono.Xml.Xsl
case "SMALL": case "SPAN": case "STRIKE": case "STRONG":
case "STYLE": case "SUB": case "SUP":
case "TABLE": case "TBODY": case "TD": case "TEXTAREA":
- case "TFOOT": case "THEAD": case "TITLE": case "TR": case "TT":
- case "U": case "UL":
- case "VAR":
+ case "TFOOT": case "TH": case "THEAD": case "TITLE":
+ case "TR": case "TT": case "U": case "UL": case "VAR":
return true;
}
return false;
diff --git a/mcs/class/System.XML/Mono.Xml.Xsl/ScriptCompilerInfo.cs b/mcs/class/System.XML/Mono.Xml.Xsl/ScriptCompilerInfo.cs
index 0a5d72ed4cb..87438fa2bb0 100755
--- a/mcs/class/System.XML/Mono.Xml.Xsl/ScriptCompilerInfo.cs
+++ b/mcs/class/System.XML/Mono.Xml.Xsl/ScriptCompilerInfo.cs
@@ -216,12 +216,6 @@ end namespace
{
static Type providerType;
- static JScriptCompilerInfo ()
- {
- Assembly jsasm = Assembly.LoadWithPartialName ("Microsoft.JScript", null);
- providerType = jsasm.GetType ("Microsoft.JScript.JScriptCodeProvider");
- }
-
public JScriptCompilerInfo ()
{
this.CompilerCommand = "mjs";
@@ -231,9 +225,17 @@ end namespace
this.DefaultCompilerOptions = "/t:library /r:Microsoft.VisualBasic.dll";
}
- public override CodeDomProvider CodeDomProvider {
- get { return (CodeDomProvider) Activator.CreateInstance (providerType); }
- }
+ public override CodeDomProvider CodeDomProvider {
+ get {
+ // no need for locking
+ if (providerType == null) {
+ Assembly jsasm = Assembly.LoadWithPartialName ("Microsoft.JScript", null);
+ if (jsasm != null)
+ providerType = jsasm.GetType ("Microsoft.JScript.JScriptCodeProvider");
+ }
+ return (CodeDomProvider) Activator.CreateInstance (providerType);
+ }
+ }
public override string Extension {
get { return ".js"; }
diff --git a/mcs/class/System.XML/System.Xml.Schema/BuiltInDatatype.cs b/mcs/class/System.XML/System.Xml.Schema/BuiltInDatatype.cs
index 8402f2d8004..4587f204179 100644
--- a/mcs/class/System.XML/System.Xml.Schema/BuiltInDatatype.cs
+++ b/mcs/class/System.XML/System.Xml.Schema/BuiltInDatatype.cs
@@ -1370,15 +1370,61 @@ namespace Mono.Xml.Schema
public override object ParseValue (string s,
XmlNameTable nameTable, XmlNamespaceManager nsmgr)
{
- return ParseValueType (s, nameTable, nsmgr);
+ return new XmlSchemaUri (Normalize (s));
}
internal override ValueType ParseValueType (string s, XmlNameTable nameTable, XmlNamespaceManager nsmgr)
{
- return new UriValueType (Normalize (s));
+ return new UriValueType ((XmlSchemaUri) ParseValue (s, nameTable, nsmgr));
}
}
-
+
+ internal class XmlSchemaUri : Uri
+ {
+ public string value;
+
+ // LAMESPEC: In this way, some strings that contain ':' might
+ // result in exception (MS.NET looks implemented as such).
+ public XmlSchemaUri (string src)
+ : this (src, src.IndexOf (':') > 0)
+ {
+ }
+
+ private XmlSchemaUri (string src, bool formal)
+ : base (formal ? src : "anyuri:" + src, !formal)
+ {
+ value = src;
+ }
+
+ public static bool operator == (XmlSchemaUri v1, XmlSchemaUri v2)
+ {
+ return v1.value == v2.value;
+ }
+
+ public static bool operator != (XmlSchemaUri v1, XmlSchemaUri v2)
+ {
+ return v1.value != v2.value;
+ }
+
+ public override bool Equals (object obj)
+ {
+ if (obj is XmlSchemaUri)
+ return (XmlSchemaUri) obj == this;
+ else
+ return false;
+ }
+
+ public override int GetHashCode ()
+ {
+ return value.GetHashCode ();
+ }
+
+ public override string ToString ()
+ {
+ return value;
+ }
+ }
+
// xs:duration
internal class XsdDuration : XsdAnySimpleType
{
diff --git a/mcs/class/System.XML/System.Xml.Schema/ChangeLog b/mcs/class/System.XML/System.Xml.Schema/ChangeLog
index c16cf1a9f1f..e3dc9a5679f 100755
--- a/mcs/class/System.XML/System.Xml.Schema/ChangeLog
+++ b/mcs/class/System.XML/System.Xml.Schema/ChangeLog
@@ -1,3 +1,9 @@
+2004-09-16 Atsushi Enomoto <atsushi@ximian.com>
+
+ * BuiltInDatatype.cs, SchemaDataValueType.cs :
+ ParseValue() for xs:AnyURI should return System.Uri. MS.NET returns
+ XmlSchemaUri, but it is derived from System.Uri, while ours was not.
+
2004-09-03 Atsushi Enomoto <atsushi@ximian.com>
* XmlSchema.cs : When schema inclusion results in a recursion, just
diff --git a/mcs/class/System.XML/System.Xml.Schema/SchemaDataValueType.cs b/mcs/class/System.XML/System.Xml.Schema/SchemaDataValueType.cs
index c2b9305fcad..ff4031f2806 100755
--- a/mcs/class/System.XML/System.Xml.Schema/SchemaDataValueType.cs
+++ b/mcs/class/System.XML/System.Xml.Schema/SchemaDataValueType.cs
@@ -19,6 +19,8 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using Mono.Xml.Schema;
+
namespace System.Xml.Schema
{
internal struct QNameValueType
@@ -97,14 +99,14 @@ namespace System.Xml.Schema
internal struct UriValueType
{
- string value;
+ XmlSchemaUri value;
- public UriValueType (string value)
+ public UriValueType (XmlSchemaUri value)
{
this.value = value;
}
- public string Value {
+ public XmlSchemaUri Value {
get { return value; }
}
@@ -133,7 +135,7 @@ namespace System.Xml.Schema
public override string ToString ()
{
- return value;
+ return value.ToString ();
}
}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/ChangeLog b/mcs/class/System.XML/System.Xml.Serialization/ChangeLog
index ded7e921c04..0586af82013 100755
--- a/mcs/class/System.XML/System.Xml.Serialization/ChangeLog
+++ b/mcs/class/System.XML/System.Xml.Serialization/ChangeLog
@@ -1,3 +1,8 @@
+2004-09-28 Lluis Sanchez Gual <lluis@novell.com>
+
+ * CodeIdentifier.cs: MakeValid now returns "Item" for an empty string.
+ This fixes bug #66877.
+
2004-09-03 Lluis Sanchez Gual <lluis@novell.com>
* XmlSerializer.cs: When the XmlReader is created by XmlSerializer, use
diff --git a/mcs/class/System.XML/System.Xml.Serialization/CodeIdentifier.cs b/mcs/class/System.XML/System.Xml.Serialization/CodeIdentifier.cs
index 93d78b2f69f..54c0b6bee87 100644
--- a/mcs/class/System.XML/System.Xml.Serialization/CodeIdentifier.cs
+++ b/mcs/class/System.XML/System.Xml.Serialization/CodeIdentifier.cs
@@ -55,7 +55,7 @@ namespace System.Xml.Serialization {
if (identifier == null)
throw new NullReferenceException ();
if (identifier.Length == 0)
- return identifier;
+ return "Item";
string output = "";
diff --git a/mcs/class/System/System.ComponentModel/AttributeCollection.cs b/mcs/class/System/System.ComponentModel/AttributeCollection.cs
index 2c5c6d840e0..1221270f082 100644
--- a/mcs/class/System/System.ComponentModel/AttributeCollection.cs
+++ b/mcs/class/System/System.ComponentModel/AttributeCollection.cs
@@ -138,7 +138,7 @@ namespace System.ComponentModel
get {
Attribute attr = null;
foreach (Attribute a in attrList) {
- if (a.GetType () == type){
+ if (type.IsAssignableFrom (a.GetType ())) {
attr = a;
break;
}
diff --git a/mcs/class/System/System.ComponentModel/ChangeLog b/mcs/class/System/System.ComponentModel/ChangeLog
index 290fc659e98..13a43c1d05a 100644
--- a/mcs/class/System/System.ComponentModel/ChangeLog
+++ b/mcs/class/System/System.ComponentModel/ChangeLog
@@ -1,3 +1,8 @@
+2004-10-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * AttributeCollection.cs: support attributes inherited from the one
+ we want. Fixes bug #67088. Thanks to Sander Rijken.
+
2004-06-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* TypeDescriptor.cs: when a component in componentTable is Disposed,
diff --git a/mcs/class/System/System.IO/ChangeLog b/mcs/class/System/System.IO/ChangeLog
index 9096cb03094..014914f20ca 100755
--- a/mcs/class/System/System.IO/ChangeLog
+++ b/mcs/class/System/System.IO/ChangeLog
@@ -1,3 +1,14 @@
+2004-10-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * DefaultWatcher.cs: if the file is removed between reading the
+ directory and filling the file info, catch the exception and ignore the
+ file. Fixes bug #59482.
+
+2004-10-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * DefaultWatcher.cs: don't use Directory.GetFileSystemEntries when the
+ pattern has no wildcards. Fixes bug #67447.
+
2004-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* FAMWatcher.cs: s/fam/libfam.so.0/ so that g_module finds it even
diff --git a/mcs/class/System/System.IO/DefaultWatcher.cs b/mcs/class/System/System.IO/DefaultWatcher.cs
index 36d6d939f4e..b68149c4ca3 100644
--- a/mcs/class/System/System.IO/DefaultWatcher.cs
+++ b/mcs/class/System/System.IO/DefaultWatcher.cs
@@ -37,9 +37,10 @@ namespace System.IO {
class DefaultWatcherData {
public FileSystemWatcher FSW;
public string Directory;
- public string FileMask;
+ public string FileMask; // If NoWildcards, contains the full path to the file.
public bool IncludeSubdirs;
public bool Enabled;
+ public bool NoWildcards;
public DateTime DisabledTime;
public Hashtable Files;
}
@@ -100,7 +101,12 @@ namespace System.IO {
data.FSW = fsw;
data.Directory = fsw.FullPath;
- data.FileMask = fsw.MangledFilter;
+ data.NoWildcards = !fsw.Pattern.HasWildcard;
+ if (data.NoWildcards)
+ data.FileMask = Path.Combine (data.Directory, fsw.MangledFilter);
+ else
+ data.FileMask = fsw.MangledFilter;
+
data.IncludeSubdirs = fsw.IncludeSubdirectories;
data.Enabled = true;
data.DisabledTime = DateTime.MaxValue;
@@ -185,6 +191,7 @@ namespace System.IO {
}
}
+ static string [] NoStringsArray = new string [0];
void DoFiles (DefaultWatcherData data, string directory, bool dispatch)
{
bool direxists = Directory.Exists (directory);
@@ -194,10 +201,16 @@ namespace System.IO {
}
string [] files = null;
- if (direxists) {
+ if (!direxists) {
+ files = NoStringsArray;
+ } else if (!data.NoWildcards) {
files = Directory.GetFileSystemEntries (directory, data.FileMask);
} else {
- files = new string [0];
+ // The pattern does not have wildcards
+ if (File.Exists (data.FileMask))
+ files = new string [] { data.FileMask };
+ else
+ files = NoStringsArray;
}
/* Set all as untested */
@@ -211,7 +224,14 @@ namespace System.IO {
foreach (string filename in files) {
FileData fd = (FileData) data.Files [filename];
if (fd == null) {
- data.Files.Add (filename, CreateFileData (directory, filename));
+ try {
+ data.Files.Add (filename, CreateFileData (directory, filename));
+ } catch {
+ // The file might have been removed in the meanwhile
+ data.Files.Remove (filename);
+ continue;
+ }
+
if (dispatch)
DispatchEvents (data.FSW, FileAction.Added, filename);
} else if (fd.Directory == directory) {
diff --git a/mcs/class/System/System.Net/ChangeLog b/mcs/class/System/System.Net/ChangeLog
index 92fa9343ef4..94166c8508a 100644
--- a/mcs/class/System/System.Net/ChangeLog
+++ b/mcs/class/System/System.Net/ChangeLog
@@ -1,3 +1,33 @@
+2004-10-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * HttpWebRequest.cs: ProxyQuery returns true when we use a proxy without
+ tunneling a secure connection.
+
+ * ServicePoint.cs: added UseConnect property.
+
+ * ServicePointManager.cs: set the UseConnect property when we use a http
+ proxy for a https connection.
+
+ * WebConnection.cs: setup the tunnled connection when using a proxy and
+ https.
+
+2004-10-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * HttpWebRequest.cs: ProxyQuery returns true when we use a proxy without
+ tunneling a secure connection.
+
+ * ServicePoint.cs: added UseConnect property.
+
+ * ServicePointManager.cs: set the UseConnect property when we use a http
+ proxy for a https connection.
+
+ * WebConnection.cs: setup the tunnled connection when using a proxy and
+ https.
+
+2004-09-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * HttpWebResponse.cs: remove unused SplitValue method.
+
2004-08-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* Cookie.cs: don't fail when using default constructor. Fixes bug
diff --git a/mcs/class/System/System.Net/HttpWebRequest.cs b/mcs/class/System/System.Net/HttpWebRequest.cs
index f20a0747a3f..af18f9a6154 100644
--- a/mcs/class/System/System.Net/HttpWebRequest.cs
+++ b/mcs/class/System/System.Net/HttpWebRequest.cs
@@ -147,7 +147,7 @@ namespace System.Net
get { return webHeaders ["Accept"]; }
set {
CheckRequestStarted ();
- webHeaders.SetInternal ("Accept", value);
+ webHeaders.RemoveAndAdd ("Accept", value);
}
}
@@ -199,7 +199,7 @@ namespace System.Net
if (keepAlive && val.IndexOf ("keep-alive") == -1)
value = value + ", Keep-Alive";
- webHeaders.SetInternal ("Connection", value);
+ webHeaders.RemoveAndAdd ("Connection", value);
}
}
@@ -231,7 +231,7 @@ namespace System.Net
webHeaders.RemoveInternal ("Content-Type");
return;
}
- webHeaders.SetInternal ("Content-Type", value);
+ webHeaders.RemoveAndAdd ("Content-Type", value);
}
}
@@ -266,7 +266,7 @@ namespace System.Net
if (val == "100-continue")
throw new ArgumentException ("100-Continue cannot be set with this property.",
"value");
- webHeaders.SetInternal ("Expect", value);
+ webHeaders.RemoveAndAdd ("Expect", value);
}
}
@@ -452,7 +452,7 @@ namespace System.Net
if (!sendChunked)
throw new ArgumentException ("SendChunked must be True", "value");
- webHeaders.SetInternal ("Transfer-Encoding", value);
+ webHeaders.RemoveAndAdd ("Transfer-Encoding", value);
}
}
@@ -484,7 +484,7 @@ namespace System.Net
}
internal bool ProxyQuery {
- get { return servicePoint.UsesProxy; }
+ get { return servicePoint.UsesProxy && !servicePoint.UseConnect; }
}
// Methods
@@ -852,13 +852,13 @@ namespace System.Net
webHeaders.RemoveInternal ("Transfer-Encoding");
} else if (sendChunked) {
continue100 = true;
- webHeaders.SetInternal ("Transfer-Encoding", "chunked");
+ webHeaders.RemoveAndAdd ("Transfer-Encoding", "chunked");
webHeaders.RemoveInternal ("Content-Length");
}
if (actualVersion == HttpVersion.Version11 && continue100 &&
servicePoint.SendContinue) { // RFC2616 8.2.3
- webHeaders.SetInternal ("Expect" , "100-continue");
+ webHeaders.RemoveAndAdd ("Expect" , "100-continue");
expectContinue = true;
} else {
webHeaders.RemoveInternal ("Expect");
@@ -871,9 +871,9 @@ namespace System.Net
servicePoint.ProtocolVersion == HttpVersion.Version10);
if (keepAlive && (version == HttpVersion.Version10 || spoint10)) {
- webHeaders.SetInternal (connectionHeader, "keep-alive");
+ webHeaders.RemoveAndAdd (connectionHeader, "keep-alive");
} else if (!keepAlive && version == HttpVersion.Version11) {
- webHeaders.SetInternal (connectionHeader, "close");
+ webHeaders.RemoveAndAdd (connectionHeader, "close");
}
webHeaders.SetInternal ("Host", actualUri.Authority);
@@ -883,9 +883,9 @@ namespace System.Net
webHeaders.SetInternal ("Cookie", cookieHeader);
}
- if (!usedPreAuth && preAuthenticate) {
+ if (!usedPreAuth && preAuthenticate)
DoPreAuthenticate ();
- }
+
return webHeaders.ToString ();
}
diff --git a/mcs/class/System/System.Net/HttpWebResponse.cs b/mcs/class/System/System.Net/HttpWebResponse.cs
index 9fcdce33fe3..459749e7c14 100644
--- a/mcs/class/System/System.Net/HttpWebResponse.cs
+++ b/mcs/class/System/System.Net/HttpWebResponse.cs
@@ -329,20 +329,6 @@ namespace System.Net
}
}
- static string [] SplitValue (string input)
- {
- string [] result = new string [2];
- int eq = input.IndexOf ('=');
- if (eq == -1) {
- result [0] = "invalid";
- } else {
- result [0] = input.Substring (0, eq).Trim ().ToUpper ();
- result [1] = input.Substring (eq + 1);
- }
-
- return result;
- }
-
void SetCookie (string header)
{
string [] name_values = header.Trim ().Split (';');
diff --git a/mcs/class/System/System.Net/ServicePoint.cs b/mcs/class/System/System.Net/ServicePoint.cs
index a22ca44aefd..09a1f61d609 100644
--- a/mcs/class/System/System.Net/ServicePoint.cs
+++ b/mcs/class/System/System.Net/ServicePoint.cs
@@ -52,6 +52,7 @@ namespace System.Net
bool usesProxy;
Hashtable groups;
bool sendContinue = true;
+ bool useConnect;
#if NET_1_1
bool useNagle;
#endif
@@ -160,6 +161,11 @@ namespace System.Net
set { usesProxy = value; }
}
+ internal bool UseConnect {
+ get { return useConnect; }
+ set { useConnect = value; }
+ }
+
internal bool AvailableForRecycling {
get {
return CurrentConnections == 0
diff --git a/mcs/class/System/System.Net/ServicePointManager.cs b/mcs/class/System/System.Net/ServicePointManager.cs
index ca176694532..06a7284777e 100644
--- a/mcs/class/System/System.Net/ServicePointManager.cs
+++ b/mcs/class/System/System.Net/ServicePointManager.cs
@@ -186,11 +186,16 @@ namespace System.Net
RecycleServicePoints ();
bool usesProxy = false;
+ bool useConnect = false;
if (proxy != null && !proxy.IsBypassed(address)) {
usesProxy = true;
+ bool isSecure = address.Scheme == "https";
address = proxy.GetProxy (address);
- if (address.Scheme != "http" && address.Scheme != "https")
+ if (address.Scheme != "http" && !isSecure)
throw new NotSupportedException ("Proxy scheme not supported.");
+
+ if (isSecure && address.Scheme == "http")
+ useConnect = true;
}
address = new Uri (address.Scheme + "://" + address.Authority);
@@ -212,6 +217,7 @@ namespace System.Net
sp.UseNagleAlgorithm = useNagle;
#endif
sp.UsesProxy = usesProxy;
+ sp.UseConnect = useConnect;
servicePoints.Add (address, sp);
}
diff --git a/mcs/class/System/System.Net/WebConnection.cs b/mcs/class/System/System.Net/WebConnection.cs
index f3ef1d22076..0f72d361996 100644
--- a/mcs/class/System/System.Net/WebConnection.cs
+++ b/mcs/class/System/System.Net/WebConnection.cs
@@ -148,6 +148,70 @@ namespace System.Net
}
}
+ bool CreateTunnel (HttpWebRequest request, Stream stream, out byte [] buffer)
+ {
+ StringBuilder sb = new StringBuilder ();
+ sb.Append ("CONNECT ");
+ sb.Append (request.Address.Host);
+ sb.Append (':');
+ sb.Append (request.Address.Port);
+ sb.Append (" HTTP/");
+ if (request.ServicePoint.ProtocolVersion == HttpVersion.Version11)
+ sb.Append ("1.1");
+ else
+ sb.Append ("1.0");
+
+ sb.Append ("\r\nHost: ");
+ sb.Append (request.Address.Authority);
+ if (request.Headers ["Proxy-Authorization"] != null) {
+ sb.Append ("\r\nProxy-Authorization: ");
+ sb.Append (request.Headers ["Proxy-Authorization"]);
+ }
+
+ sb.Append ("\r\n\r\n");
+ byte [] connectBytes = Encoding.Default.GetBytes (sb.ToString ());
+ stream.Write (connectBytes, 0, connectBytes.Length);
+ return ReadHeaders (request, stream, out buffer);
+ }
+
+ bool ReadHeaders (HttpWebRequest request, Stream stream, out byte [] retBuffer)
+ {
+ retBuffer = null;
+
+ byte [] buffer = new byte [256];
+ MemoryStream ms = new MemoryStream ();
+ bool gotStatus = false;
+
+ while (true) {
+ int n = stream.Read (buffer, 0, 256);
+ ms.Write (buffer, 0, n);
+ int start = 0;
+ string str = null;
+ while (ReadLine (ms.GetBuffer (), ref start, (int) ms.Length, ref str)) {
+ if (str == null) {
+ if (ms.Length - start > 0) {
+ retBuffer = new byte [ms.Length - start];
+ Buffer.BlockCopy (ms.GetBuffer (), start, retBuffer, 0, retBuffer.Length);
+ }
+ return true;
+ }
+
+ if (gotStatus)
+ continue;
+
+ int spaceidx = str.IndexOf (' ');
+ if (spaceidx == -1)
+ throw new Exception ();
+
+ int resultCode = Int32.Parse (str.Substring (spaceidx + 1, 3));
+ if (resultCode != 200)
+ throw new Exception ();
+
+ gotStatus = true;
+ }
+ }
+ }
+
bool CreateStream (HttpWebRequest request)
{
try {
@@ -156,9 +220,16 @@ namespace System.Net
ssl = true;
EnsureSSLStreamAvailable ();
if (!reused || nstream == null || nstream.GetType () != sslStream) {
- object[] args = new object [3] { serverStream,
+ byte [] buffer = null;
+ if (sPoint.UseConnect) {
+ bool ok = CreateTunnel (request, serverStream, out buffer);
+ if (!ok)
+ return false;
+ }
+
+ object[] args = new object [4] { serverStream,
request.ClientCertificates,
- request };
+ request, buffer};
nstream = (Stream) Activator.CreateInstance (sslStream, args);
}
// we also need to set ServicePoint.Certificate
diff --git a/mcs/class/System/System.Net/WebHeaderCollection.cs b/mcs/class/System/System.Net/WebHeaderCollection.cs
index f41105bd5bc..4d3c29db3cd 100644
--- a/mcs/class/System/System.Net/WebHeaderCollection.cs
+++ b/mcs/class/System/System.Net/WebHeaderCollection.cs
@@ -267,7 +267,18 @@ namespace System.Net
base.Set (name, value);
}
}
-
+
+ internal void RemoveAndAdd (string name, string value)
+ {
+ if (value == null)
+ value = String.Empty;
+ else
+ value = value.Trim ();
+
+ base.Remove (name);
+ base.Set (name, value);
+ }
+
internal void RemoveInternal (string name)
{
if (name == null)
diff --git a/mcs/class/corlib/Mono.Security.Authenticode/AuthenticodeBase.cs b/mcs/class/corlib/Mono.Security.Authenticode/AuthenticodeBase.cs
index 9e5923667b5..c2d609ecec2 100755
--- a/mcs/class/corlib/Mono.Security.Authenticode/AuthenticodeBase.cs
+++ b/mcs/class/corlib/Mono.Security.Authenticode/AuthenticodeBase.cs
@@ -5,10 +5,6 @@
// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-// (C) 2004 Novell (http://www.novell.com)
-//
-
-//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
@@ -60,63 +56,167 @@ namespace Mono.Security.Authenticode {
public const string spcIndirectDataContext = "1.3.6.1.4.1.311.2.1.4";
- internal byte[] rawData;
+ private byte[] fileblock;
+ private FileStream fs;
+ private int blockNo;
+ private int blockLength;
+ private int peOffset;
+ private int dirSecurityOffset;
+ private int dirSecuritySize;
public AuthenticodeBase ()
{
+ fileblock = new byte [4096];
}
- protected byte[] HashFile (string fileName, string hashName)
+ internal void Open (string filename)
{
- FileStream fs = new FileStream (fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
- byte[] file = new byte [fs.Length];
- fs.Read (file, 0, file.Length);
- fs.Close ();
+ if (fs != null)
+ Close ();
+ fs = new FileStream (filename, FileMode.Open, FileAccess.Read, FileShare.Read);
+ }
- // MZ - DOS header
- if (BitConverterLE.ToUInt16 (file, 0) != 0x5A4D)
- return null;
+ internal void Close ()
+ {
+ if (fs != null) {
+ fs.Close ();
+ fs = null;
+ blockNo = 0;
+ }
+ }
- // find offset of PE header
- int peOffset = BitConverterLE.ToInt32 (file, 60);
- if (peOffset > file.Length)
- return null;
+ internal bool ReadFirstBlock ()
+ {
+ if (fs == null)
+ return false;
+
+ fs.Position = 0;
+ // read first block - it will include (100% sure)
+ // the MZ header and (99.9% sure) the PE header
+ blockLength = fs.Read (fileblock, 0, fileblock.Length);
+ blockNo = 1;
+ if (blockLength < 64)
+ return false; // invalid PE file
+
+ // 1. Validate the MZ header informations
+ // 1.1. Check for magic MZ at start of header
+ if (BitConverterLE.ToUInt16 (fileblock, 0) != 0x5A4D)
+ return false;
+
+ // 1.2. Find the offset of the PE header
+ peOffset = BitConverterLE.ToInt32 (fileblock, 60);
+ if (peOffset > fileblock.Length) {
+ // just in case (0.1%) this can actually happen
+ string msg = String.Format (Locale.GetText (
+ "Header size too big (> {0} bytes)."),
+ fileblock.Length);
+ throw new NotSupportedException (msg);
+ }
+ if (peOffset > fs.Length)
+ return false;
- // PE - NT header
- if (BitConverterLE.ToUInt16 (file, peOffset) != 0x4550)
- return null;
+ // 2. Read between DOS header and first part of PE header
+ // 2.1. Check for magic PE at start of header
+ if (BitConverterLE.ToUInt16 (fileblock, peOffset) != 0x4550)
+ return false;
- // IMAGE_DIRECTORY_ENTRY_SECURITY
- int dirSecurityOffset = BitConverterLE.ToInt32 (file, peOffset + 152);
- int dirSecuritySize = BitConverterLE.ToInt32 (file, peOffset + 156);
+ // 2.2. Locate IMAGE_DIRECTORY_ENTRY_SECURITY (offset and size)
+ dirSecurityOffset = BitConverterLE.ToInt32 (fileblock, peOffset + 152);
+ dirSecuritySize = BitConverterLE.ToInt32 (fileblock, peOffset + 156);
+
+ return true;
+ }
+
+ internal byte[] GetSecurityEntry ()
+ {
+ if (blockNo < 1)
+ ReadFirstBlock ();
if (dirSecuritySize > 8) {
- rawData = new byte [dirSecuritySize - 8];
- Buffer.BlockCopy (file, dirSecurityOffset + 8, rawData, 0, rawData.Length);
-/* DEBUG
- FileStream debug = new FileStream (fileName + ".sig", FileMode.Create, FileAccess.Write);
- debug.Write (rawData, 0, rawData.Length);
- debug.Close ();*/
+ // remove header from size (not ASN.1 based)
+ byte[] secEntry = new byte [dirSecuritySize - 8];
+ // position after header and read entry
+ fs.Position = dirSecurityOffset + 8;
+ fs.Read (secEntry, 0, secEntry.Length);
+ return secEntry;
+ }
+ return null;
+ }
+
+ // returns null if the file isn't signed
+ internal byte[] GetHash (HashAlgorithm hash)
+ {
+ if (blockNo < 1)
+ ReadFirstBlock ();
+ fs.Position = blockLength;
+
+ // hash the rest of the file
+ long n = fs.Length - blockLength;
+ // minus any authenticode signature (with 8 bytes header)
+ if (dirSecurityOffset > 0) {
+ // it is also possible that the signature block
+ // starts within the block in memory (small EXE)
+ if (dirSecurityOffset < blockLength) {
+ blockLength = dirSecurityOffset;
+ n = 0;
+ }
+ else
+ n -= (dirSecuritySize);
}
- else
- rawData = null;
- HashAlgorithm hash = HashAlgorithm.Create (hashName);
- // 0 to 215 (216) then skip 4 (checksum)
+ // Authenticode(r) gymnastics
+ // Hash from (generally) 0 to 215 (216 bytes)
int pe = peOffset + 88;
- hash.TransformBlock (file, 0, pe, file, 0);
+ hash.TransformBlock (fileblock, 0, pe, fileblock, 0);
+ // then skip 4 for checksum
pe += 4;
- // 220 to 279 (60) then skip 8 (IMAGE_DIRECTORY_ENTRY_SECURITY)
- hash.TransformBlock (file, pe, 60, file, pe);
+ // Continue hashing from (generally) 220 to 279 (60 bytes)
+ hash.TransformBlock (fileblock, pe, 60, fileblock, pe);
+ // then skip 8 bytes for IMAGE_DIRECTORY_ENTRY_SECURITY
pe += 68;
- // 288 to end of file
- int n = file.Length - pe;
- // minus any authenticode signature (with 8 bytes header)
- if (dirSecurityOffset != 0)
- n -= (dirSecuritySize);
- hash.TransformFinalBlock (file, pe, n);
+ // everything is present so start the hashing
+ if (n == 0) {
+ // hash the (only) block
+ hash.TransformFinalBlock (fileblock, pe, blockLength - pe);
+ }
+ else {
+ // hash the last part of the first (already in memory) block
+ hash.TransformBlock (fileblock, pe, blockLength - pe, fileblock, 0);
+
+ // hash by blocks of 4096 bytes
+ long blocks = (n >> 12);
+ int remainder = (int)(n - (blocks << 12));
+ if (remainder == 0) {
+ blocks--;
+ remainder = 4096;
+ }
+ // blocks
+ while (blocks-- > 0) {
+ fs.Read (fileblock, 0, fileblock.Length);
+ hash.TransformBlock (fileblock, 0, fileblock.Length, fileblock, 0);
+ }
+ // remainder
+ if (fs.Read (fileblock, 0, remainder) != remainder)
+ return null;
+ hash.TransformFinalBlock (fileblock, 0, remainder);
+ }
return hash.Hash;
}
+
+ // for compatibility only
+ protected byte[] HashFile (string fileName, string hashName)
+ {
+ try {
+ Open (fileName);
+ HashAlgorithm hash = HashAlgorithm.Create (hashName);
+ byte[] result = GetHash (hash);
+ Close ();
+ return result;
+ }
+ catch {
+ return null;
+ }
+ }
}
}
diff --git a/mcs/class/corlib/Mono.Security.Authenticode/AuthenticodeDeformatter.cs b/mcs/class/corlib/Mono.Security.Authenticode/AuthenticodeDeformatter.cs
index 803781954f7..ea0bd30e242 100755
--- a/mcs/class/corlib/Mono.Security.Authenticode/AuthenticodeDeformatter.cs
+++ b/mcs/class/corlib/Mono.Security.Authenticode/AuthenticodeDeformatter.cs
@@ -2,12 +2,9 @@
// AuthenticodeDeformatter.cs: Authenticode signature validator
//
// Author:
-// Sebastien Pouliot (spouliot@motus.com)
+// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-//
-
-//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
@@ -57,6 +54,9 @@ namespace Mono.Security.Authenticode {
private DateTime timestamp;
private X509Certificate signingCertificate;
private int reason;
+ private bool trustedRoot;
+ private bool trustedTimestampRoot;
+ private byte[] entry;
private X509Chain signerChain;
private X509Chain timestampChain;
@@ -70,17 +70,20 @@ namespace Mono.Security.Authenticode {
public AuthenticodeDeformatter (string fileName) : this ()
{
- if (!CheckSignature (fileName)) {
- // invalid or no signature
- if (signedHash != null)
- throw new COMException ("Invalid signature");
- // no exception is thrown when there's no signature in the PE file
- }
+ FileName = fileName;
}
public string FileName {
get { return filename; }
- set { CheckSignature (value); }
+ set {
+ Reset ();
+ try {
+ CheckSignature (value);
+ }
+ catch {
+ reason = 1;
+ }
+ }
}
public byte[] Hash {
@@ -101,7 +104,7 @@ namespace Mono.Security.Authenticode {
public bool IsTrusted ()
{
- if (rawData == null) {
+ if (entry == null) {
reason = 1;
return false;
}
@@ -111,13 +114,13 @@ namespace Mono.Security.Authenticode {
return false;
}
- if (signerChain.Root == null) {
+ if ((signerChain.Root == null) || !trustedRoot) {
reason = 6;
return false;
}
if (timestamp != DateTime.MinValue) {
- if (timestampChain.Root == null) {
+ if ((timestampChain.Root == null) || !trustedTimestampRoot) {
reason = 6;
return false;
}
@@ -139,7 +142,11 @@ namespace Mono.Security.Authenticode {
}
public byte[] Signature {
- get { return (byte[]) rawData.Clone (); }
+ get {
+ if (entry == null)
+ return null;
+ return (byte[]) entry.Clone ();
+ }
}
public DateTime Timestamp {
@@ -157,43 +164,58 @@ namespace Mono.Security.Authenticode {
private bool CheckSignature (string fileName)
{
filename = fileName;
-
- // by default we try with MD5
- string hashName = "MD5";
- // compare the signature's hash with the hash of the file
- hash = HashFile (filename, hashName);
-
- // is a signature present ?
- if (rawData == null)
+ base.Open (filename);
+ entry = base.GetSecurityEntry ();
+ if (entry == null) {
+ // no signature is present
+ reason = 1;
+ base.Close ();
return false;
+ }
- PKCS7.ContentInfo ci = new PKCS7.ContentInfo (rawData);
- if (ci.ContentType != PKCS7.Oid.signedData)
+ PKCS7.ContentInfo ci = new PKCS7.ContentInfo (entry);
+ if (ci.ContentType != PKCS7.Oid.signedData) {
+ base.Close ();
return false;
+ }
PKCS7.SignedData sd = new PKCS7.SignedData (ci.Content);
- if (sd.ContentInfo.ContentType != spcIndirectDataContext)
+ if (sd.ContentInfo.ContentType != spcIndirectDataContext) {
+ base.Close ();
return false;
+ }
coll = sd.Certificates;
ASN1 spc = sd.ContentInfo.Content;
signedHash = spc [0][1][1];
- if (signedHash.Length == 20) {
- // seems to be SHA-1, restart hashing
- hashName = "SHA1";
- hash = HashFile (filename, hashName);
+
+ HashAlgorithm ha = null;
+ switch (signedHash.Length) {
+ case 16:
+ ha = HashAlgorithm.Create ("MD5");
+ hash = GetHash (ha);
+ break;
+ case 20:
+ ha = HashAlgorithm.Create ("SHA1");
+ hash = GetHash (ha);
+ break;
+ default:
+ reason = 5;
+ base.Close ();
+ return false;
}
+ base.Close ();
if (!signedHash.CompareValue (hash))
return false;
// messageDigest is a hash of spcIndirectDataContext (which includes the file hash)
byte[] spcIDC = spc [0].Value;
- HashAlgorithm ha = HashAlgorithm.Create (hashName);
+ ha.Initialize (); // re-using hash instance
byte[] messageDigest = ha.ComputeHash (spcIDC);
- return VerifySignature (sd, messageDigest, hashName);
+ return VerifySignature (sd, messageDigest, ha);
}
private bool CompareIssuerSerial (string issuer, byte[] serial, X509Certificate x509)
@@ -213,7 +235,7 @@ namespace Mono.Security.Authenticode {
}
//private bool VerifySignature (ASN1 cs, byte[] calculatedMessageDigest, string hashName)
- private bool VerifySignature (PKCS7.SignedData sd, byte[] calculatedMessageDigest, string hashName)
+ private bool VerifySignature (PKCS7.SignedData sd, byte[] calculatedMessageDigest, HashAlgorithm ha)
{
string contentType = null;
ASN1 messageDigest = null;
@@ -242,7 +264,7 @@ namespace Mono.Security.Authenticode {
case "1.3.6.1.4.1.311.2.1.12":
// spcSpOpusInfo (Microsoft code signing)
try {
- spcSpOpusInfo = System.Text.Encoding.UTF8.GetString (attr[1][0][1][0].Value);
+ spcSpOpusInfo = System.Text.Encoding.UTF8.GetString (attr[1][0][0][0].Value);
}
catch (NullReferenceException) {
spcSpOpusInfo = null;
@@ -262,13 +284,13 @@ namespace Mono.Security.Authenticode {
return false;
// verify signature
- string hashOID = CryptoConfig.MapNameToOID (hashName);
+ string hashOID = CryptoConfig.MapNameToOID (ha.ToString ());
// change to SET OF (not [0]) as per PKCS #7 1.5
ASN1 aa = new ASN1 (0x31);
foreach (ASN1 a in sd.SignerInfo.AuthenticatedAttributes)
aa.Add (a);
- HashAlgorithm ha = HashAlgorithm.Create (hashName);
+ ha.Initialize ();
byte[] p7hash = ha.ComputeHash (aa.GetBytes ());
byte[] signature = sd.SignerInfo.Signature;
@@ -282,10 +304,9 @@ namespace Mono.Security.Authenticode {
RSACryptoServiceProvider rsa = (RSACryptoServiceProvider) x509.RSA;
if (rsa.VerifyHash (p7hash, hashOID, signature)) {
signerChain.LoadCertificates (coll);
- if (signerChain.Build (x509))
- signingCertificate = x509;
- else
- return false;
+ trustedRoot = signerChain.Build (x509);
+ signingCertificate = x509;
+ break;
}
}
}
@@ -301,17 +322,18 @@ namespace Mono.Security.Authenticode {
// countersignature (1 2 840 113549 1 9 6)
// SET {
PKCS7.SignerInfo cs = new PKCS7.SignerInfo (attr [1]);
- return VerifyCounterSignature (cs, signature, hashName);
+ trustedTimestampRoot = VerifyCounterSignature (cs, signature);
+ break;
default:
// we don't support other unauthenticated attributes
break;
}
}
- return true;
+ return (trustedRoot && trustedTimestampRoot);
}
- private bool VerifyCounterSignature (PKCS7.SignerInfo cs, byte[] signature, string hashName)
+ private bool VerifyCounterSignature (PKCS7.SignerInfo cs, byte[] signature)
{
// SEQUENCE {
// INTEGER 1
@@ -358,6 +380,7 @@ namespace Mono.Security.Authenticode {
if (messageDigest == null)
return false;
// TODO: must be read from the ASN.1 structure
+ string hashName = null;
switch (messageDigest.Length) {
case 16:
hashName = "MD5";
@@ -398,5 +421,20 @@ namespace Mono.Security.Authenticode {
// no certificate can verify this signature!
return false;
}
+
+ private void Reset ()
+ {
+ filename = null;
+ entry = null;
+ hash = null;
+ signedHash = null;
+ signingCertificate = null;
+ reason = -1;
+ trustedRoot = false;
+ trustedTimestampRoot = false;
+ signerChain.Reset ();
+ timestampChain.Reset ();
+ timestamp = DateTime.MinValue;
+ }
}
}
diff --git a/mcs/class/corlib/Mono.Security.Authenticode/ChangeLog b/mcs/class/corlib/Mono.Security.Authenticode/ChangeLog
index 7f9398815f2..da0e586a096 100755
--- a/mcs/class/corlib/Mono.Security.Authenticode/ChangeLog
+++ b/mcs/class/corlib/Mono.Security.Authenticode/ChangeLog
@@ -1,3 +1,8 @@
+2004-09-07 Sebastien Pouliot <sebastien@ximian.com>
+
+ * AuthenticodeBase.cs: Merge optimizations from HEAD.
+ * AuthenticodeDeformatter.cs: Merge optimizations from HEAD.
+
2004-04-28 Sebastien Pouliot <sebastien@ximian.com>
* AuthenticodeBase.cs: In sync with Mono.Security.dll version.
diff --git a/mcs/class/corlib/Mono.Security.Cryptography/ChangeLog b/mcs/class/corlib/Mono.Security.Cryptography/ChangeLog
index 4162be45b05..1515435dce9 100644
--- a/mcs/class/corlib/Mono.Security.Cryptography/ChangeLog
+++ b/mcs/class/corlib/Mono.Security.Cryptography/ChangeLog
@@ -1,3 +1,8 @@
+2004-09-29 Sebastien Pouliot <sebastien@ximian.com>
+
+ * RSAManaged.cs: KeySize is now always a multiple of 8 bits.
+ Fix #66929.
+
2004-06-23 Sebastien Pouliot <sebastien@ximian.com>
* SymmetricTransform.cs: Reduce by one the number of block when
diff --git a/mcs/class/corlib/Mono.Security.Cryptography/RSAManaged.cs b/mcs/class/corlib/Mono.Security.Cryptography/RSAManaged.cs
index 40f58801dce..82b16f6b291 100644
--- a/mcs/class/corlib/Mono.Security.Cryptography/RSAManaged.cs
+++ b/mcs/class/corlib/Mono.Security.Cryptography/RSAManaged.cs
@@ -149,8 +149,12 @@ namespace Mono.Security.Cryptography {
public override int KeySize {
get {
// in case keypair hasn't been (yet) generated
- if (keypairGenerated)
- return n.BitCount ();
+ if (keypairGenerated) {
+ int ks = n.BitCount ();
+ if ((ks & 7) != 0)
+ ks = ks + (8 - (ks & 7));
+ return ks;
+ }
else
return base.KeySize;
}
diff --git a/mcs/class/corlib/Mono.Security.X509/ChangeLog b/mcs/class/corlib/Mono.Security.X509/ChangeLog
index 5cfdfbd7a78..add41ab01a7 100644
--- a/mcs/class/corlib/Mono.Security.X509/ChangeLog
+++ b/mcs/class/corlib/Mono.Security.X509/ChangeLog
@@ -1,3 +1,7 @@
+2004-09-07 Sebastien Pouliot <sebastien@ximian.com>
+
+ * X509Chain.cs: Merge bug fixes from HEAD.
+
2004-05-27 Sebastien Pouliot <sebastien@ximian.com>
* X509Certificate.cs: Rethrow original exception when parsing X.509
diff --git a/mcs/class/corlib/Mono.Security.X509/X509Chain.cs b/mcs/class/corlib/Mono.Security.X509/X509Chain.cs
index 0ff5d875ac5..f8035e6c661 100755
--- a/mcs/class/corlib/Mono.Security.X509/X509Chain.cs
+++ b/mcs/class/corlib/Mono.Security.X509/X509Chain.cs
@@ -9,10 +9,6 @@
// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-// (C) 2004 Novell (http://www.novell.com)
-//
-
-//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
@@ -136,7 +132,7 @@ namespace Mono.Security.X509 {
tmp = FindCertificateParent (x);
if (x != null) {
_chain.Add (x);
- tmp = x; // last valid
+ x = tmp; // last valid
}
}
// find a trusted root
@@ -193,7 +189,8 @@ namespace Mono.Security.X509 {
_status = X509ChainStatusFlags.NoError;
roots = null; // this force a reload
certs.Clear ();
- _chain.Clear ();
+ if (_chain != null)
+ _chain.Clear ();
}
// private stuff
diff --git a/mcs/class/corlib/System.IO/ChangeLog b/mcs/class/corlib/System.IO/ChangeLog
index 4412e03bfe9..2a98da3be31 100644
--- a/mcs/class/corlib/System.IO/ChangeLog
+++ b/mcs/class/corlib/System.IO/ChangeLog
@@ -1,3 +1,11 @@
+2004-09-19 Dick Porter <dick@ximian.com>
+
+ * UnexceptionalStreamWriter.cs:
+ * UnexceptionalStreamReader.cs: Wrappers around StreamWriter and
+ StreamReader that catch IOException. Used by System.Console so
+ that graphical applications dont get IO errors when their
+ stdin/out/err vanishes (ie when they spew debug output.)
+
2004-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* Stream.cs: Close() does not call Flush(). Fixes bug #65340.
diff --git a/mcs/class/corlib/System.IO/UnexceptionalStreamReader.cs b/mcs/class/corlib/System.IO/UnexceptionalStreamReader.cs
new file mode 100644
index 00000000000..7c527459204
--- /dev/null
+++ b/mcs/class/corlib/System.IO/UnexceptionalStreamReader.cs
@@ -0,0 +1,149 @@
+//
+// System.IO.UnexceptionalStreamReader.cs
+//
+// Authors:
+// Dietmar Maurer (dietmar@ximian.com)
+// Miguel de Icaza (miguel@ximian.com)
+// Dick Porter (dick@ximian.com)
+//
+// (C) Ximian, Inc. http://www.ximian.com
+// Copyright (C) 2004 Novell (http://www.novell.com)
+//
+
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.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.
+//
+
+
+// This is a wrapper around StreamReader used by System.Console that
+// catches IOException so that graphical applications don't suddenly
+// get IO errors when their terminal vanishes. See
+// UnexceptionalStreamWriter too.
+
+using System;
+using System.Text;
+using System.Runtime.InteropServices;
+
+namespace System.IO {
+ internal class UnexceptionalStreamReader : StreamReader {
+ public UnexceptionalStreamReader(Stream stream)
+ : base (stream)
+ {
+ }
+
+ public UnexceptionalStreamReader(Stream stream, bool detect_encoding_from_bytemarks)
+ : base (stream, detect_encoding_from_bytemarks)
+ {
+ }
+
+ public UnexceptionalStreamReader(Stream stream, Encoding encoding)
+ : base (stream, encoding)
+ {
+ }
+
+ public UnexceptionalStreamReader(Stream stream, Encoding encoding, bool detect_encoding_from_bytemarks)
+ : base (stream, encoding, detect_encoding_from_bytemarks)
+ {
+ }
+
+ public UnexceptionalStreamReader(Stream stream, Encoding encoding, bool detect_encoding_from_bytemarks, int buffer_size)
+ : base (stream, encoding, detect_encoding_from_bytemarks, buffer_size)
+ {
+ }
+
+ public UnexceptionalStreamReader(string path)
+ : base (path)
+ {
+ }
+
+ public UnexceptionalStreamReader(string path, bool detect_encoding_from_bytemarks)
+ : base (path, detect_encoding_from_bytemarks)
+ {
+ }
+
+ public UnexceptionalStreamReader(string path, Encoding encoding)
+ : base (path, encoding)
+ {
+ }
+
+ public UnexceptionalStreamReader(string path, Encoding encoding, bool detect_encoding_from_bytemarks)
+ : base (path, encoding, detect_encoding_from_bytemarks)
+ {
+ }
+
+ public UnexceptionalStreamReader(string path, Encoding encoding, bool detect_encoding_from_bytemarks, int buffer_size)
+ : base (path, encoding, detect_encoding_from_bytemarks, buffer_size)
+ {
+ }
+
+ public override int Peek ()
+ {
+ try {
+ return(base.Peek ());
+ } catch (IOException) {
+ }
+
+ return(-1);
+ }
+
+ public override int Read ()
+ {
+ try {
+ return(base.Read ());
+ } catch (IOException) {
+ }
+
+ return(-1);
+ }
+
+ public override int Read ([In, Out] char[] dest_buffer,
+ int index, int count)
+ {
+ try {
+ return(base.Read (dest_buffer, index, count));
+ } catch (IOException) {
+ }
+
+ return(0);
+ }
+
+ public override string ReadLine()
+ {
+ try {
+ return(base.ReadLine ());
+ } catch (IOException) {
+ }
+
+ return(null);
+ }
+
+ public override string ReadToEnd()
+ {
+ try {
+ return(base.ReadToEnd ());
+ } catch (IOException) {
+ }
+
+ return(null);
+ }
+ }
+}
diff --git a/mcs/class/corlib/System.IO/UnexceptionalStreamWriter.cs b/mcs/class/corlib/System.IO/UnexceptionalStreamWriter.cs
new file mode 100644
index 00000000000..db9fd5842e7
--- /dev/null
+++ b/mcs/class/corlib/System.IO/UnexceptionalStreamWriter.cs
@@ -0,0 +1,128 @@
+//
+// System.IO.StreamWriter.cs
+//
+// Authors:
+// Dietmar Maurer (dietmar@ximian.com)
+// Paolo Molaro (lupus@ximian.com)
+// Dick Porter (dick@ximian.com)
+//
+// (C) Ximian, Inc. http://www.ximian.com
+//
+
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.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.
+//
+
+
+// This is a wrapper around StreamWriter used by System.Console that
+// catches IOException so that graphical applications don't suddenly
+// get IO errors when their terminal vanishes (ie when they spew debug
+// output.) See UnexceptionalStreamReader too.
+
+using System.Text;
+using System;
+
+namespace System.IO {
+ internal class UnexceptionalStreamWriter: StreamWriter {
+ public UnexceptionalStreamWriter (Stream stream)
+ : base (stream)
+ {
+ }
+
+ public UnexceptionalStreamWriter (Stream stream,
+ Encoding encoding)
+ : base (stream, encoding)
+ {
+ }
+
+ public UnexceptionalStreamWriter (Stream stream,
+ Encoding encoding,
+ int bufferSize)
+ : base (stream, encoding, bufferSize)
+ {
+ }
+
+ public UnexceptionalStreamWriter (string path)
+ : base (path)
+ {
+ }
+
+ public UnexceptionalStreamWriter (string path, bool append)
+ : base (path, append)
+ {
+ }
+
+ public UnexceptionalStreamWriter (string path, bool append,
+ Encoding encoding)
+ : base (path, append, encoding)
+ {
+ }
+
+ public UnexceptionalStreamWriter (string path, bool append,
+ Encoding encoding,
+ int bufferSize)
+ : base (path, append, encoding, bufferSize)
+ {
+ }
+
+ public override void Flush ()
+ {
+ try {
+ base.Flush ();
+ } catch (IOException) {
+ }
+ }
+
+ public override void Write (char[] buffer, int index,
+ int count)
+ {
+ try {
+ base.Write (buffer, index, count);
+ } catch (IOException) {
+ }
+ }
+
+ public override void Write (char value)
+ {
+ try {
+ base.Write (value);
+ } catch (IOException) {
+ }
+ }
+
+ public override void Write (char[] value)
+ {
+ try {
+ base.Write (value);
+ } catch (IOException) {
+ }
+ }
+
+ public override void Write (string value)
+ {
+ try {
+ base.Write (value);
+ } catch (IOException) {
+ }
+ }
+ }
+}
diff --git a/mcs/class/corlib/System.Reflection.Emit/ChangeLog b/mcs/class/corlib/System.Reflection.Emit/ChangeLog
index 0f117fa51cf..0ecc28b55ff 100644
--- a/mcs/class/corlib/System.Reflection.Emit/ChangeLog
+++ b/mcs/class/corlib/System.Reflection.Emit/ChangeLog
@@ -1,3 +1,24 @@
+2004-10-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * ModuleBuilder.cs (GetTypes): Fix length of returned array. Fixes
+ #65931.
+
+2004-10-04 Zoltan Varga <vargaz@freemail.hu>
+
+ * ModuleBuilder.cs (DefineType): Check for duplicate type names. Fixes
+ #65988.
+
+2004-09-17 Zoltan Varga <vargaz@freemail.hu>
+
+ * CustomAttributeBuilder.cs: Applied patch from Marcus Urban (mathpup@mylinuxisp.com). Add support for defining custom marshallers by calling SetCustomAttribute.
+
+2004-09-09 Zoltan Varga <vargaz@freemail.hu>
+
+ * TypeBuilder.cs: Set the table_idx of the global type to 1.
+
+ * ModuleBuilder.cs: Save the main module of the assembly even if it is
+ transient.
+
2004-08-13 Sebastien Pouliot <sebastien@ximian.com>
* AssemblyBuilder.cs: (Partly) Fix delay-signing issue (#56621) when
diff --git a/mcs/class/corlib/System.Reflection.Emit/CustomAttributeBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/CustomAttributeBuilder.cs
index e85e67022bc..daadb065ed3 100755
--- a/mcs/class/corlib/System.Reflection.Emit/CustomAttributeBuilder.cs
+++ b/mcs/class/corlib/System.Reflection.Emit/CustomAttributeBuilder.cs
@@ -198,6 +198,8 @@ namespace System.Reflection.Emit {
int sizeConst = 0;
int value;
int utype; /* the (stupid) ctor takes a short or an enum ... */
+ Type marshalTypeRef = null;
+ string marshalCookie = String.Empty;
utype = (int)data [2];
utype |= ((int)data [3]) << 8;
@@ -231,7 +233,21 @@ namespace System.Reflection.Emit {
value |= ((int)data [pos++]) << 24;
sizeConst = value;
break;
+ case "MarshalTypeRef":
+ case "MarshalType":
+ len = decode_len (data, pos, out pos);
+ marshalTypeRef = Type.GetType (string_from_bytes (data, pos, len));
+ pos += len;
+ break;
+ case "MarshalCookie":
+ len = decode_len (data, pos, out pos);
+ marshalCookie = string_from_bytes (data, pos, len);
+ pos += len;
+ break;
default:
+ len = decode_len(data, pos, out pos);
+ string v = string_from_bytes (data, pos, len);
+ pos += len;
break;
}
}
@@ -245,6 +261,8 @@ namespace System.Reflection.Emit {
return UnmanagedMarshal.DefineByValArray (sizeConst);
case UnmanagedType.ByValTStr:
return UnmanagedMarshal.DefineByValTStr (sizeConst);
+ case UnmanagedType.CustomMarshaler:
+ return UnmanagedMarshal.DefineCustom ( marshalTypeRef, marshalCookie, marshalTypeRef.ToString (), Guid.Empty);
default:
return UnmanagedMarshal.DefineUnmanagedMarshal ((UnmanagedType)utype);
}
diff --git a/mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs
index a7d4888d6d7..eabb8f84fb9 100644
--- a/mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs
+++ b/mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs
@@ -252,6 +252,8 @@ namespace System.Reflection.Emit {
}
private TypeBuilder DefineType (string name, TypeAttributes attr, Type parent, Type[] interfaces, PackingSize packsize, int typesize) {
+ if (name_cache.Contains (name))
+ throw new ArgumentException ("Duplicate type name within an assembly.");
TypeBuilder res = new TypeBuilder (this, name, attr, parent, interfaces, packsize, typesize, null);
if (types != null) {
if (types.Length == num_types) {
@@ -433,7 +435,7 @@ namespace System.Reflection.Emit {
if (types == null)
return new TypeBuilder [0];
- int n = types.Length;
+ int n = num_types;
TypeBuilder [] copy = new TypeBuilder [n];
Array.Copy (types, copy, n);
@@ -624,9 +626,8 @@ namespace System.Reflection.Emit {
internal void Save ()
{
- if (transient)
+ if (transient && !is_main)
return;
-
if ((global_type != null) && (global_type_created == null))
global_type_created = global_type.CreateType ();
diff --git a/mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs
index c0059b54286..edcf429d9cc 100644
--- a/mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs
+++ b/mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs
@@ -97,6 +97,7 @@ namespace System.Reflection.Emit {
this.attrs = attr;
this.class_size = 0;
fullname = this.tname = "<Module>";
+ this.table_idx = 1;
this.nspace = "";
pmodule = mb;
setup_internal_class (this);
@@ -987,7 +988,7 @@ namespace System.Reflection.Emit {
public override Type[] GetNestedTypes (BindingFlags bindingAttr) {
bool match;
ArrayList result = new ArrayList ();
-
+
if (subtypes == null)
return Type.EmptyTypes;
foreach (TypeBuilder t in subtypes) {
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ChangeLog b/mcs/class/corlib/System.Runtime.InteropServices/ChangeLog
index 3eab4fba987..b74738d5faf 100644
--- a/mcs/class/corlib/System.Runtime.InteropServices/ChangeLog
+++ b/mcs/class/corlib/System.Runtime.InteropServices/ChangeLog
@@ -1,3 +1,9 @@
+2004-09-10 Raja R Harinath <rharinath@novell.com>
+
+ Fix bootstrap with mcs 1.1.x.
+ * UnmanagedType.cs (UnmanagedType.__mono_bootstrap_NativeTypeMax):
+ Mark as non-compliant to CLS.
+
2004-06-22 Raja R Harinath <rharinath@novell.com>
Fix bootstrap with mcs 0.31.
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/UnmanagedType.cs b/mcs/class/corlib/System.Runtime.InteropServices/UnmanagedType.cs
index 6502e1f90f6..1b5f3363c24 100755
--- a/mcs/class/corlib/System.Runtime.InteropServices/UnmanagedType.cs
+++ b/mcs/class/corlib/System.Runtime.InteropServices/UnmanagedType.cs
@@ -188,6 +188,7 @@ namespace System.Runtime.InteropServices {
#if BOOTSTRAP_WITH_OLDLIB
/// <summary>
/// </summary>
+ [CLSCompliant(false)]
__mono_bootstrap_NativeTypeMax = 80,
#endif
} // UnmanagedType
diff --git a/mcs/class/corlib/System.Security.Cryptography.X509Certificates/ChangeLog b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/ChangeLog
index b5a036af423..86be09eef0a 100644
--- a/mcs/class/corlib/System.Security.Cryptography.X509Certificates/ChangeLog
+++ b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/ChangeLog
@@ -1,3 +1,7 @@
+2004-09-07 Sebastien Pouliot <sebastien@ximian.com>
+
+ * X509Certificate.cs: Merge changes from HEAD.
+
2003-12-15 Sebastien Pouliot <spouliot@videotron.ca>
* X509Certificate.cs: Removed old (commented) Authenticode stuff.
diff --git a/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate.cs b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate.cs
index af5722f601d..5d3f9dd8177 100644
--- a/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate.cs
+++ b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate.cs
@@ -116,15 +116,26 @@ namespace System.Security.Cryptography.X509Certificates {
[MonoTODO ("Incomplete - minimal validation in this version")]
public static X509Certificate CreateFromSignedFile (string filename)
{
- AuthenticodeDeformatter a = new AuthenticodeDeformatter (filename);
- if (a.SigningCertificate != null) {
- return new X509Certificate (a.SigningCertificate.RawData);
- }
- else {
+ try {
+ AuthenticodeDeformatter a = new AuthenticodeDeformatter (filename);
+ if (a.SigningCertificate != null) {
+ if (a.Reason != 0) {
+ string msg = String.Format (Locale.GetText (
+ "Invalid digital signature on {0}, reason #{1}."),
+ filename, a.Reason);
+ throw new COMException (msg);
+ }
+ return new X509Certificate (a.SigningCertificate.RawData);
+ }
+
// if no signature is present return an empty certificate
byte[] cert = null; // must not confuse compiler about null ;)
return new X509Certificate (cert);
}
+ catch (Exception e) {
+ string msg = String.Format (Locale.GetText ("Couldn't extract digital signature from {0}."), filename);
+ throw new COMException (msg, e);
+ }
}
// constructors
@@ -410,4 +421,4 @@ namespace System.Security.Cryptography.X509Certificates {
}
#endif
}
-} \ No newline at end of file
+}
diff --git a/mcs/class/corlib/System.Security.Permissions/ChangeLog b/mcs/class/corlib/System.Security.Permissions/ChangeLog
index 219a8c199ea..63e95738285 100644
--- a/mcs/class/corlib/System.Security.Permissions/ChangeLog
+++ b/mcs/class/corlib/System.Security.Permissions/ChangeLog
@@ -1,3 +1,9 @@
+2004-10-05 Sebastien Pouliot <sebastien@ximian.com>
+
+ * PrincipalPermission.cs: Fixed bug where a change to a permission
+ (e.g. Copy, Union) could affect multiple instances. Fixed FromXml
+ to clear existing entries.
+
2004-06-10 Gert Driesen <drieseng@users.sourceforge.net>
* StrongNameIdentityPermission.cs: removed extra useless finalizer
diff --git a/mcs/class/corlib/System.Security.Permissions/PrincipalPermission.cs b/mcs/class/corlib/System.Security.Permissions/PrincipalPermission.cs
index d1f23c091a5..17235490015 100644
--- a/mcs/class/corlib/System.Security.Permissions/PrincipalPermission.cs
+++ b/mcs/class/corlib/System.Security.Permissions/PrincipalPermission.cs
@@ -98,7 +98,7 @@ namespace System.Security.Permissions {
internal PrincipalPermission (ArrayList principals)
{
- this.principals = principals;
+ this.principals = (ArrayList) principals.Clone ();
}
// Properties
@@ -147,6 +147,7 @@ namespace System.Security.Permissions {
if ((esd.Attributes ["version"] as string) != "1")
throw new ArgumentException ("wrong version");
+ principals.Clear ();
// Children is null, not empty, when no child is present
if (esd.Children != null) {
foreach (SecurityElement se in esd.Children) {
@@ -273,7 +274,7 @@ namespace System.Security.Permissions {
PrincipalPermission union = new PrincipalPermission (principals);
foreach (PrincipalInfo pi in o.principals)
- principals.Add (pi);
+ union.principals.Add (pi);
return union;
}
@@ -284,4 +285,4 @@ namespace System.Security.Permissions {
return 8;
}
}
-} \ No newline at end of file
+}
diff --git a/mcs/class/corlib/System.Threading/ChangeLog b/mcs/class/corlib/System.Threading/ChangeLog
index d6236617956..d441965fb9b 100644
--- a/mcs/class/corlib/System.Threading/ChangeLog
+++ b/mcs/class/corlib/System.Threading/ChangeLog
@@ -1,3 +1,8 @@
+2004-09-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * Timer.cs: don't invoke the callback twice when the timer changes.
+ Fixes bug #66116.
+
2004-08-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* Timer.cs: don't invoke the callback if the period changes before the
diff --git a/mcs/class/corlib/System.Threading/Timer.cs b/mcs/class/corlib/System.Threading/Timer.cs
index 1675a5a4be7..1bba6fa581e 100755
--- a/mcs/class/corlib/System.Threading/Timer.cs
+++ b/mcs/class/corlib/System.Threading/Timer.cs
@@ -128,6 +128,9 @@ namespace System.Threading
wait.Reset ();
signaled = wait.WaitOne (period, false);
+ if (aborted)
+ break;
+
if (!signaled) {
callback (state);
} else if (!WaitForDueTime ()) {
diff --git a/mcs/class/corlib/System/Activator.cs b/mcs/class/corlib/System/Activator.cs
index 4727251d9e6..6cb4c24b262 100644
--- a/mcs/class/corlib/System/Activator.cs
+++ b/mcs/class/corlib/System/Activator.cs
@@ -168,9 +168,10 @@ namespace System
length = args.Length;
Type [] atypes = new Type [length];
- for (int i = 0; i < length; ++i) {
- atypes [i] = args [i].GetType ();
- }
+ for (int i = 0; i < length; ++i)
+ if (args [i] != null)
+ atypes [i] = args [i].GetType ();
+
ConstructorInfo ctor = type.GetConstructor (atypes);
if (ctor == null) {
if (type.IsValueType && atypes.Length == 0)
@@ -213,9 +214,10 @@ namespace System
length = args.Length;
Type[] atypes = new Type [length];
- for (int i = 0; i < length; ++i) {
- atypes [i] = args [i].GetType ();
- }
+ for (int i = 0; i < length; ++i)
+ if (args [i] != null)
+ atypes [i] = args [i].GetType ();
+
ConstructorInfo ctor = type.GetConstructor (bindingAttr, binder, atypes, null);
if (ctor == null) {
// Not sure about this
diff --git a/mcs/class/corlib/System/AppDomain.cs b/mcs/class/corlib/System/AppDomain.cs
index 06ab7351c93..e987f1a7b4f 100755
--- a/mcs/class/corlib/System/AppDomain.cs
+++ b/mcs/class/corlib/System/AppDomain.cs
@@ -63,10 +63,10 @@ namespace System
static string _process_guid;
[ThreadStatic]
- Hashtable type_resolve_in_progress;
+ static Hashtable type_resolve_in_progress;
[ThreadStatic]
- Hashtable assembly_resolve_in_progress;
+ static Hashtable assembly_resolve_in_progress;
// Evidence evidence;
diff --git a/mcs/class/corlib/System/ChangeLog b/mcs/class/corlib/System/ChangeLog
index d07ee07070c..f9b59c29d4f 100644
--- a/mcs/class/corlib/System/ChangeLog
+++ b/mcs/class/corlib/System/ChangeLog
@@ -1,3 +1,42 @@
+2004-10-08 Zoltan Varga <vargaz@freemail.hu>
+
+ * Convert.cs (ToType): Throw an exception when converting null to a
+ valuetype. Fixes #67780.
+
+2004-10-08 Atsushi Enomoto <atsushi@ximian.com>
+
+ * DateTime.cs : Removed incorrectly injected HEAD fix.
+
+2004-10-08 Atsushi Enomoto <atsushi@ximian.com>
+
+ * DateTime.cs : When it it not exact parse, 'Z' is allowed as a suffix
+ of m/s/t/z. This fixes bug 66723.
+
+2004-10-04 Zoltan Varga <vargaz@freemail.hu>
+
+ * AppDomain.cs: Make ThreadStatic variables static. Fixes #56614.
+
+2004-09-30 Geoff Norton <gnorton@customerdna.com>
+
+ * Convert.cs: ConvertToBase* was not endian aware. Implemented EndianSwap
+ and swapping of all values before going into the BitConverter so that values
+ are returned with proper endianess.
+
+2004-09-23 Martin Garton <martin@wrasse.demon.co.uk>
+
+ * Convert.cs: ToType was returning unconverted object when it should
+ fail with an ArgumentException.
+
+2004-09-19 Dick Porter <dick@ximian.com>
+
+ * Console.cs: Use the internal wrappers for StreamReader and
+ StreamWriter that catch IOException.
+
+2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * Activator.cs (CreateInstance): If an argument is null,
+ do not call GetType () on it. #63852
+
2004-09-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* Environment.cs: (ExpandEnvironmentVariables) don't nullify the case
diff --git a/mcs/class/corlib/System/Console.cs b/mcs/class/corlib/System/Console.cs
index 8a0830a7328..f71b4069c43 100644
--- a/mcs/class/corlib/System/Console.cs
+++ b/mcs/class/corlib/System/Console.cs
@@ -63,15 +63,15 @@ namespace System
encoding = Encoding.Default;
}
- stderr = new StreamWriter (OpenStandardError (0), encoding);
+ stderr = new UnexceptionalStreamWriter (OpenStandardError (0), encoding);
((StreamWriter)stderr).AutoFlush = true;
stderr = TextWriter.Synchronized (stderr, true);
- stdout = new StreamWriter (OpenStandardOutput (0), encoding);
+ stdout = new UnexceptionalStreamWriter (OpenStandardOutput (0), encoding);
((StreamWriter)stdout).AutoFlush = true;
stdout = TextWriter.Synchronized (stdout, true);
- stdin = new StreamReader (OpenStandardInput (0), encoding);
+ stdin = new UnexceptionalStreamReader (OpenStandardInput (0), encoding);
stdin = TextReader.Synchronized (stdin);
}
diff --git a/mcs/class/corlib/System/Convert.cs b/mcs/class/corlib/System/Convert.cs
index f63481831c5..5e15d578704 100644
--- a/mcs/class/corlib/System/Convert.cs
+++ b/mcs/class/corlib/System/Convert.cs
@@ -2559,8 +2559,18 @@ namespace System {
return (long) result;
}
+ private static void EndianSwap (ref byte[] value)
+ {
+ byte[] buf = new byte[value.Length];
+ for (int i = 0; i < value.Length; i++)
+ buf[i] = value[value.Length-1-i];
+ value = buf;
+ }
+
private static string ConvertToBase2 (byte[] value)
{
+ if (!BitConverter.IsLittleEndian)
+ EndianSwap (ref value);
StringBuilder sb = new StringBuilder ();
for (int i = value.Length - 1; i >= 0; i--) {
byte b = value [i];
@@ -2580,6 +2590,8 @@ namespace System {
private static string ConvertToBase8 (byte[] value)
{
+ if (!BitConverter.IsLittleEndian)
+ EndianSwap (ref value);
ulong l = 0;
switch (value.Length) {
case 1:
@@ -2612,6 +2624,8 @@ namespace System {
private static string ConvertToBase16 (byte[] value)
{
+ if (!BitConverter.IsLittleEndian)
+ EndianSwap (ref value);
StringBuilder sb = new StringBuilder ();
for (int i = value.Length - 1; i >= 0; i--) {
char high = (char)((value[i] >> 4) & 0x0f);
@@ -2672,8 +2686,12 @@ namespace System {
internal static object ToType (object value, Type conversionType,
IFormatProvider provider)
{
- if (value == null)
- return null;
+ if (value == null) {
+ if ((conversionType != null) && conversionType.IsValueType)
+ throw new InvalidCastException ("Null object can not be converted to a value type.");
+ else
+ return null;
+ }
if (conversionType == null)
throw new InvalidCastException ("Cannot cast to destination type.");
@@ -2739,12 +2757,7 @@ namespace System {
else if (conversionType == conversionTable[18]) // 18 TypeCode.String
return (object) convertValue.ToString (provider);
else {
- try {
- return (object) convertValue;
- }
- catch {
- throw new ArgumentException (Locale.GetText ("Unknown target conversion type"));
- }
+ throw new ArgumentException (Locale.GetText ("Unknown target conversion type"));
}
} else
// Not in the conversion table
diff --git a/mcs/class/corlib/System/DateTime.cs b/mcs/class/corlib/System/DateTime.cs
index ca1e1e564f7..188d0d27bd4 100644
--- a/mcs/class/corlib/System/DateTime.cs
+++ b/mcs/class/corlib/System/DateTime.cs
@@ -1190,6 +1190,22 @@ namespace System
s = s.Substring (num_parsed);
+ if (!exact) {
+ switch (chars [pos]) {
+ case 'm':
+ case 's':
+ case 'f':
+ case 'z':
+ if (s.Length > 0 && s [0] == 'Z'
+ && (pos + 1 == chars.Length
+ || chars [pos + 1] != 'Z')) {
+ useutc = true;
+ s = s.Substring (1);
+ }
+ break;
+ }
+ }
+
pos = pos + num + 1;
num = 0;
}
diff --git a/mcs/class/corlib/Test/System/ChangeLog b/mcs/class/corlib/Test/System/ChangeLog
index 1e1e1931fbe..6d419bfee33 100644
--- a/mcs/class/corlib/Test/System/ChangeLog
+++ b/mcs/class/corlib/Test/System/ChangeLog
@@ -1,3 +1,8 @@
+2004-09-23 Martin Garton <martin@wrasse.demon.co.uk>
+
+ * ConvertTest.cs: Ensure ToType() fails with an ArgumentException in
+ a case where is cannot convert.
+
2004-08-17 Sebastien Pouliot <sebastien@ximian.com>
* VersionTest.cs: Added tests when cloning a version with no build and
diff --git a/mcs/class/corlib/Test/System/ConvertTest.cs b/mcs/class/corlib/Test/System/ConvertTest.cs
index bafdffdb566..44e5f547567 100755
--- a/mcs/class/corlib/Test/System/ConvertTest.cs
+++ b/mcs/class/corlib/Test/System/ConvertTest.cs
@@ -189,7 +189,17 @@ namespace MonoTests.System {
}
catch (Exception e) {
AssertEquals("#A33", typeof(ArgumentNullException), e.GetType());
- }
+ }
+
+ try {
+ /* should fail to convert string to any enumeration type. */
+ Convert.ChangeType("random string", typeof(DayOfWeek));
+ Fail();
+ }
+ catch (Exception e) {
+ AssertEquals("#A34", typeof(ArgumentException), e.GetType());
+ }
+
}
public void TestGetTypeCode() {
diff --git a/mcs/class/corlib/corlib.dll.sources b/mcs/class/corlib/corlib.dll.sources
index 4a49234f3f2..c1a958a1308 100755
--- a/mcs/class/corlib/corlib.dll.sources
+++ b/mcs/class/corlib/corlib.dll.sources
@@ -307,6 +307,8 @@ System.IO/StringReader.cs
System.IO/StringWriter.cs
System.IO/TextReader.cs
System.IO/TextWriter.cs
+System.IO/UnexceptionalStreamReader.cs
+System.IO/UnexceptionalStreamWriter.cs
System.IO.IsolatedStorage/INormalizeForIsolatedStorage.cs
System.IO.IsolatedStorage/IsolatedStorage.cs
System.IO.IsolatedStorage/IsolatedStorageException.cs
diff --git a/mcs/ilasm/AssemblyInfo.cs b/mcs/ilasm/AssemblyInfo.cs
index 5f70fdc7d78..614d59d75c6 100644
--- a/mcs/ilasm/AssemblyInfo.cs
+++ b/mcs/ilasm/AssemblyInfo.cs
@@ -1,7 +1,7 @@
using System.Reflection;
using System.Runtime.CompilerServices;
-[assembly: AssemblyVersion("1.0.1")]
+[assembly: AssemblyVersion("1.0.2")]
[assembly: AssemblyTitle ("Mono ILasm Compiler")]
[assembly: AssemblyDescription ("Mono ILasm Compiler")]
[assembly: AssemblyCopyright ("Sergey Chaban and Jackson Harper")]
diff --git a/mcs/mcs/AssemblyInfo.cs b/mcs/mcs/AssemblyInfo.cs
index 44f053c64a1..d54cda38d27 100644
--- a/mcs/mcs/AssemblyInfo.cs
+++ b/mcs/mcs/AssemblyInfo.cs
@@ -1,7 +1,7 @@
using System.Reflection;
using System.Runtime.CompilerServices;
-[assembly: AssemblyVersion("1.0.1")]
+[assembly: AssemblyVersion("1.0.2")]
[assembly: AssemblyTitle ("Mono C# Compiler")]
[assembly: AssemblyDescription ("Mono C# Compiler")]
[assembly: AssemblyCopyright ("2001, 2002, 2003 Ximian, Inc.")]
diff --git a/mcs/mcs/ChangeLog b/mcs/mcs/ChangeLog
index 8f75d35512a..f6eee2c2074 100755
--- a/mcs/mcs/ChangeLog
+++ b/mcs/mcs/ChangeLog
@@ -1,3 +1,34 @@
+2004-10-04 Juraj Skripsky <js@hotfeet.ch>
+
+ * namespace.cs (NamespaceEntry.Using): No matter which warning
+ level is set, check if this namespace name has already been added.
+
+2004-10-03 Ben Maurer <bmaurer@ximian.com>
+
+ * expression.cs: reftype [!=]= null should always use br[true,false].
+ # 67410
+
+2004-09-19 Miguel de Icaza <miguel@ximian.com>
+
+ * cs-parser.jay: Do not report the stack trace, it is useless
+ anyways for the production compiler.
+
+2004-09-15 Raja R Harinath <rharinath@novell.com>
+
+ * cs-parser.jay (fixed_statement): Introduce a scope for the
+ declaration in a 'fixed' statement.
+
+2004-09-10 Raja R Harinath <rharinath@novell.com>
+
+ Fix test-290.cs.
+ * cs-parser.jay (delegate_declaration): Record a delegate
+ declaration as a type declaration.
+
+2004-09-07 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs: Return false if we fail to resolve the inner
+ expression.
+
2004-09-06 Miguel de Icaza <miguel@ximian.com>
* expression.cs: Report errors with unsafe pointers, fixes #64896
diff --git a/mcs/mcs/cs-parser.jay b/mcs/mcs/cs-parser.jay
index deebef3ae69..347869796dd 100755
--- a/mcs/mcs/cs-parser.jay
+++ b/mcs/mcs/cs-parser.jay
@@ -1929,11 +1929,12 @@ delegate_declaration
SEMICOLON
{
Location l = lexer.Location;
+ string name = MakeName ((string) $5);
Delegate del = new Delegate (current_namespace, current_container, (Expression) $4,
- (int) $2, MakeName ((string) $5), (Parameters) $7,
- (Attributes) $1, l);
+ (int) $2, name, (Parameters) $7, (Attributes) $1, l);
CheckDef (current_container.AddDelegate (del), del.Name, l);
+ RootContext.Tree.RecordDecl (name, del);
}
| opt_attributes
opt_modifiers
@@ -1944,12 +1945,14 @@ delegate_declaration
SEMICOLON
{
Location l = lexer.Location;
+ string name = MakeName ((string) $5);
Delegate del = new Delegate (
current_namespace, current_container,
- TypeManager.system_void_expr, (int) $2, MakeName ((string) $5),
+ TypeManager.system_void_expr, (int) $2, name,
(Parameters) $7, (Attributes) $1, l);
CheckDef (current_container.AddDelegate (del), del.Name, l);
+ RootContext.Tree.RecordDecl (name, del);
}
;
@@ -3818,12 +3821,14 @@ fixed_statement
type fixed_pointer_declarators
CLOSE_PARENS
{
- Block assign_block = new Block (current_block, Block.Flags.Implicit);
ArrayList list = (ArrayList) $4;
Expression type = (Expression) $3;
Location l = lexer.Location;
int top = list.Count;
+ Block assign_block = new Block (current_block);
+ current_block = assign_block;
+
for (int i = 0; i < top; i++){
Pair p = (Pair) list [i];
LocalInfo v;
@@ -3835,17 +3840,25 @@ fixed_statement
p.First = v;
list [i] = p;
}
- current_block.AddStatement (assign_block);
- current_block = assign_block;
- oob_stack.Push (assign_block);
+
oob_stack.Push (l);
}
embedded_statement
{
Location l = (Location) oob_stack.Pop ();
- oob_stack.Pop ();
- $$ = new Fixed ((Expression) $3, (ArrayList) $4, (Statement) $7, l);
+ Fixed f = new Fixed ((Expression) $3, (ArrayList) $4, (Statement) $7, l);
+
+ if (RootContext.WarningLevel >= 3){
+ if ($7 == EmptyStatement.Value)
+ Report.Warning (642, lexer.Location, "Possible mistaken empty statement");
+ }
+
+ current_block.AddStatement (f);
+ while (current_block.Implicit)
+ current_block = current_block.Parent;
+ $$ = current_block;
+ current_block = current_block.Parent;
}
;
@@ -4337,7 +4350,7 @@ public override void parse ()
// Please do not remove this, it is used during debugging
// of the grammar
//
- Console.WriteLine (e);
+ // Console.WriteLine (e);
Report.Error (-25, lexer.Location, "Parsing error");
if (Driver.parser_verbose)
Console.WriteLine (e);
diff --git a/mcs/mcs/expression.cs b/mcs/mcs/expression.cs
index 93d9316a8f6..314578e9e9e 100755
--- a/mcs/mcs/expression.cs
+++ b/mcs/mcs/expression.cs
@@ -2313,8 +2313,8 @@ namespace Mono.CSharp {
// Special cases: string comapred to null
//
if (oper == Operator.Equality || oper == Operator.Inequality){
- if ((l == TypeManager.string_type && (right is NullLiteral)) ||
- (r == TypeManager.string_type && (left is NullLiteral))){
+ if ((!TypeManager.IsValueType (l) && (right is NullLiteral)) ||
+ (!TypeManager.IsValueType (r) && (left is NullLiteral))) {
Type = TypeManager.bool_type;
return this;
@@ -5841,7 +5841,7 @@ namespace Mono.CSharp {
Expression tmp = (Expression) o;
tmp = tmp.Resolve (ec);
if (tmp == null)
- continue;
+ return false;
// Console.WriteLine ("I got: " + tmp);
// Handle initialization from vars, fields etc.
diff --git a/mcs/mcs/namespace.cs b/mcs/mcs/namespace.cs
index f7f10d3c0f9..ae1317bccd5 100755
--- a/mcs/mcs/namespace.cs
+++ b/mcs/mcs/namespace.cs
@@ -335,10 +335,10 @@ namespace Mono.CSharp {
if (using_clauses == null)
using_clauses = new ArrayList ();
- foreach (UsingEntry old_entry in using_clauses){
- if (old_entry.Name == ns){
- Report.Warning (105, loc, "The using directive for '" + ns +
- "' appeared previously in this namespace");
+ foreach (UsingEntry old_entry in using_clauses) {
+ if (old_entry.Name == ns) {
+ if (RootContext.WarningLevel >= 3)
+ Report.Warning (105, loc, "The using directive for '{0}' appeared previously in this namespace", ns);
return;
}
}
diff --git a/mcs/nunit20/core/Makefile b/mcs/nunit20/core/Makefile
index 4714607c8cd..575e4f0652a 100644
--- a/mcs/nunit20/core/Makefile
+++ b/mcs/nunit20/core/Makefile
@@ -5,7 +5,7 @@ include ../../build/rules.make
LIBRARY = nunit.core.dll
LIBRARY_SNK = $(topdir)/nunit.key
-LOCAL_MCS_FLAGS= -r:nunit.framework.dll -r:System.dll /d:StronglyNamedAssembly
+LOCAL_MCS_FLAGS= -debug -r:nunit.framework.dll -r:System.dll /d:StronglyNamedAssembly
NO_TEST = yo
EXTRA_DISTFILES = nunit.core.dll.csproj
diff --git a/mcs/nunit20/framework/Makefile b/mcs/nunit20/framework/Makefile
index 928299815be..2538dc968d2 100644
--- a/mcs/nunit20/framework/Makefile
+++ b/mcs/nunit20/framework/Makefile
@@ -6,7 +6,7 @@ LIBRARY = NUnit.Framework.dll
LIBRARY_NAME = nunit.framework.dll
LIBRARY_SNK = $(topdir)/nunit.key
-LIB_MCS_FLAGS = /r:System.Xml.dll /r:System.dll /d:StronglyNamedAssembly
+LIB_MCS_FLAGS = -debug /r:System.Xml.dll /r:System.dll /d:StronglyNamedAssembly
NO_TEST = yo
EXTRA_DISTFILES = \
diff --git a/mcs/nunit20/util/Makefile b/mcs/nunit20/util/Makefile
index bae83a0198d..8c058cd7a69 100644
--- a/mcs/nunit20/util/Makefile
+++ b/mcs/nunit20/util/Makefile
@@ -9,7 +9,7 @@ LIBRARY_SNK = $(topdir)/nunit.key
LOCAL_MCS_FLAGS= \
/resource:Transform.resources,NUnit.Util.Transform.resources \
-r:nunit.framework.dll -r:nunit.core.dll -r:System.dll \
- -r:System.Xml.dll /d:MONO /d:StronglyNamedAssembly
+ -r:System.Xml.dll /d:MONO /d:StronglyNamedAssembly -debug
NO_TEST = yo
EXTRA_DISTFILES = \
diff --git a/mcs/tests/ChangeLog b/mcs/tests/ChangeLog
index d626aa14dd7..196e11c13db 100755
--- a/mcs/tests/ChangeLog
+++ b/mcs/tests/ChangeLog
@@ -1,3 +1,13 @@
+2004-09-15 Raja R Harinath <rharinath@novell.com>
+
+ * test-280.cs: Backport fix from HEAD.
+ * test-292.cs: New test for #64330.
+
+2004-09-10 Raja R Harinath <rharinath@novell.com>
+
+ * test-290.cs: New test.
+ * Makefile (TEST_SOURCES): Add test-290.cs.
+
2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
* unsafe-10.cs: new test
diff --git a/mcs/tests/Makefile b/mcs/tests/Makefile
index bc3901cecf9..79fe1a6aed4 100644
--- a/mcs/tests/Makefile
+++ b/mcs/tests/Makefile
@@ -44,7 +44,8 @@ TEST_SOURCES = \
test-251 test-252 test-253 test-254 test-255 test-256 test-257 test-258 test-259 test-260 \
test-261 test-262 test-263 test-264 test-265 test-266 test-267 test-268 test-269 test-270 \
test-271 test-272 test-273 test-274 test-275 test-276 test-277 test-280 \
- test-283 test-284 \
+ test-283 test-284 test-290 \
+ test-292 \
cls-test-0 cls-test-1 cls-test-2 cls-test-3 cls-test-5 cls-test-6 cls-test-7 cls-test-10 \
cls-test-11 cls-test-14 cls-test-15 cls-test-16
diff --git a/mcs/tests/test-280.cs b/mcs/tests/test-280.cs
index 8713c078ae2..aff2fbb5994 100644
--- a/mcs/tests/test-280.cs
+++ b/mcs/tests/test-280.cs
@@ -16,8 +16,8 @@ namespace AppFramework.Util
}
return false;
}
- }
- static void Main () {}
+ static void Main () {}
+ }
}
diff --git a/mcs/tests/test-292.cs b/mcs/tests/test-292.cs
new file mode 100644
index 00000000000..c67fec01e29
--- /dev/null
+++ b/mcs/tests/test-292.cs
@@ -0,0 +1,11 @@
+// Compiler options: -unsafe
+// Test for bug #64330: A 'fixed' statement should introduce a scope
+
+unsafe class X {
+ static int x = 0;
+ static void Main () {
+ fixed (void* p = &x) {}
+ fixed (void* p = &x) {}
+ }
+}
+
diff --git a/mcs/tools/security/AssemblyInfo.cs b/mcs/tools/security/AssemblyInfo.cs
index 21cbdfa06a0..4a98018e772 100644
--- a/mcs/tools/security/AssemblyInfo.cs
+++ b/mcs/tools/security/AssemblyInfo.cs
@@ -6,7 +6,7 @@ using System.Runtime.CompilerServices;
[assembly: AssemblyCompany("Motus Technologies, Novell")]
[assembly: AssemblyProduct("Mono Security Tools")]
[assembly: AssemblyCopyright("Copyright 2002, 2003 Motus Technologies. Copyright 2004 Novell. BSD licensed.")]
-[assembly: AssemblyVersion("1.0.1.0")]
+[assembly: AssemblyVersion("1.0.3.0")]
//[assembly: AssemblyConfiguration("")]
//[assembly: AssemblyTrademark("")]
//[assembly: AssemblyCulture("")]
diff --git a/mcs/tools/security/ChangeLog b/mcs/tools/security/ChangeLog
index 95500607f1b..7b98ed706bb 100644
--- a/mcs/tools/security/ChangeLog
+++ b/mcs/tools/security/ChangeLog
@@ -1,3 +1,13 @@
+2004-09-23 Sebastien Pouliot <sebastien@ximian.com>
+
+ * AssemblyInfo.cs: Updated version to 1.0.3 for next stable release.
+ * MakeCert.cs: Hack for date parsing problem with Mono.
+
+2004-09-07 Sebastien Pouliot <sebastien@ximian.com>
+
+ * certmgr.cs: Merge enhancements from HEAD. Now allows users to
+ manipulate the machine's cert store (not just the user's store).
+
2004-08-02 Sebastien Pouliot <sebastien@ximian.com>
* AssemblyInfo.cs: Update version number for Mono 1.0.1.
diff --git a/mcs/tools/security/MakeCert.cs b/mcs/tools/security/MakeCert.cs
index 485608213e7..f55e628717d 100644
--- a/mcs/tools/security/MakeCert.cs
+++ b/mcs/tools/security/MakeCert.cs
@@ -2,12 +2,14 @@
// MakeCert.cs: makecert clone tool
//
// Author:
-// Sebastien Pouliot (spouliot@motus.com)
+// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
using System;
+using System.Globalization;
using System.IO;
using System.Reflection;
using System.Security.Cryptography;
@@ -100,7 +102,6 @@ namespace Mono.Tools {
return -1;
}
- System.IFormatProvider format = new System.Globalization.CultureInfo("en-US", true);
string fileName = args [args.Length - 1];
// default values
@@ -108,7 +109,7 @@ namespace Mono.Tools {
string subject = defaultSubject;
string issuer = defaultIssuer;
DateTime notBefore = DateTime.Now;
- DateTime notAfter = DateTime.Parse ("12/31/2039 23:59:59Z", format);
+ DateTime notAfter = new DateTime (643445675990000000); // 12/31/2039 23:59:59Z
RSA issuerKey = (RSA)RSA.Create ();
issuerKey.FromXmlString (MonoTestRootAgency);
@@ -169,7 +170,7 @@ namespace Mono.Tools {
break;
case "-b":
// Validity / notBefore
- notBefore = DateTime.Parse (args [i++] + " 23:59:59", format);
+ notBefore = DateTime.Parse (args [i++] + " 23:59:59", CultureInfo.InvariantCulture);
break;
case "-cy":
// basic constraints - autority or end-entity
@@ -197,7 +198,7 @@ namespace Mono.Tools {
break;
case "-e":
// Validity / notAfter
- notAfter = DateTime.Parse (args [i++] + " 23:59:59", format);
+ notAfter = DateTime.Parse (args [i++] + " 23:59:59", CultureInfo.InvariantCulture);
break;
case "-eku":
// extendedKeyUsage extension
diff --git a/mcs/tools/security/certmgr.cs b/mcs/tools/security/certmgr.cs
index af59cc720c4..53bb97d28f5 100755
--- a/mcs/tools/security/certmgr.cs
+++ b/mcs/tools/security/certmgr.cs
@@ -4,7 +4,7 @@
// Author:
// Sebastien Pouliot <sebastien@ximian.com>
//
-// (C) 2004 Novell (http://www.novell.com)
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
using System;
@@ -51,6 +51,7 @@ namespace Mono.Tools {
Console.WriteLine ("\t-crl\tadd/del/put certificate revocation lists");
Console.WriteLine ("\t-ctl\tadd/del/put certificate trust lists [unsupported]");
Console.WriteLine ("other options");
+ Console.WriteLine ("\t-m\tuse the machine certificate store (default to user)");
Console.WriteLine ("\t-v\tverbose mode (display status for every steps)");
Console.WriteLine ("\t-?\th[elp]\tDisplay this help message");
}
@@ -246,7 +247,8 @@ namespace Mono.Tools {
static void Delete (ObjectType type, X509Store store, string file, bool verbose)
{
- switch (type) {
+ throw new NotImplementedException ("Delete not yet supported");
+/* switch (type) {
case ObjectType.Certificate:
break;
case ObjectType.CRL:
@@ -254,12 +256,13 @@ namespace Mono.Tools {
break;
default:
throw new NotSupportedException (type.ToString ());
- }
+ }*/
}
static void Put (ObjectType type, X509Store store, string file, bool verbose)
{
- switch (type) {
+ throw new NotImplementedException ("Put not yet supported");
+/* switch (type) {
case ObjectType.Certificate:
break;
case ObjectType.CRL:
@@ -267,7 +270,7 @@ namespace Mono.Tools {
break;
default:
throw new NotSupportedException (type.ToString ());
- }
+ }*/
}
[STAThread]
@@ -295,9 +298,12 @@ namespace Mono.Tools {
bool verbose = (GetCommand (args [n]) == "V");
if (verbose)
n++;
+ bool machine = (GetCommand (args [n]) == "M");
+ if (machine)
+ n++;
string storeName = args [n++];
- X509Store store = GetStoreFromName (storeName, false);
+ X509Store store = GetStoreFromName (storeName, machine);
if (store == null) {
Console.WriteLine ("Invalid Store: {0}", storeName);
Console.WriteLine ("Valid stores are: {0}, {1}, {2}, {3} and {4}",
@@ -312,18 +318,24 @@ namespace Mono.Tools {
string file = args [n];
// now action!
- switch (action) {
+ try {
+ switch (action) {
case Action.Add:
Add (type, store, file, verbose);
break;
case Action.Delete:
- throw new NotImplementedException ("Delete not yet supported");
- //Delete (type, store, file, verbose);
+ Delete (type, store, file, verbose);
break;
case Action.Put:
- throw new NotImplementedException ("Put not yet supported");
- //Put (type, store, file, verbose);
+ Put (type, store, file, verbose);
break;
+ default:
+ throw new NotSupportedException (action.ToString ());
+ }
+ }
+ catch (UnauthorizedAccessException) {
+ Console.WriteLine ("Access to the {0} '{1}' certificate store has been denied.",
+ (machine ? "machine" : "user"), storeName);
}
}
}
diff --git a/mono/dis/get.c b/mono/dis/get.c
index 22dea4fa32a..43845cd6c19 100644
--- a/mono/dis/get.c
+++ b/mono/dis/get.c
@@ -197,7 +197,6 @@ get_typespec (MonoImage *m, guint32 idx)
if (s)
g_string_append (res, s);
}
- g_string_append (res, "*");
break;
case MONO_TYPE_FNPTR:
diff --git a/mono/interpreter/ChangeLog b/mono/interpreter/ChangeLog
index 088f0756976..2c2d176ef2f 100644
--- a/mono/interpreter/ChangeLog
+++ b/mono/interpreter/ChangeLog
@@ -1,9 +1,3 @@
-2004-07-05 Zoltan Varga <vargaz@freemail.hu>
-
- * mintops.h: Applied patch from Marcin Krzyzanowski (krzak@pld-linux.org). Add support for unaligned access on little endian machines.
-
- * interp.c:Applied patch from Marcin Krzyzanowski (krzak@pld-linux.org). Fix crash seen on amd64.
-
2004-06-24 David Waite <mass@akuma.org>
* interp.c: change to C90-style comments from C99/C++-style
diff --git a/mono/interpreter/interp.c b/mono/interpreter/interp.c
index 3f7ad24660d..872fad14aae 100644
--- a/mono/interpreter/interp.c
+++ b/mono/interpreter/interp.c
@@ -1164,7 +1164,7 @@ handle_enum:
}
}
- if (method->klass->valuetype && obj)
+ if (method->klass->valuetype)
/* Unbox the instance, since valuetype methods expect an interior pointer. */
obj = mono_object_unbox (obj);
diff --git a/mono/interpreter/mintops.h b/mono/interpreter/mintops.h
index e787526e2fe..ab559de7ac6 100644
--- a/mono/interpreter/mintops.h
+++ b/mono/interpreter/mintops.h
@@ -1,8 +1,6 @@
#ifndef __INTERPRETER_MINTOPS_H
#define __INTERPRETER_MINTOPS_H
-#include <glib.h>
-
typedef enum
{
MintOpNoArgs,
@@ -31,19 +29,11 @@ enum {
#undef OPDEF
#if NO_UNALIGNED_ACCESS
-# if G_BYTE_ORDER == G_LITTLE_ENDIAN
-#define READ32(x) (((guint16 *)(x)) [0] | ((guint16 *)(x)) [1] << 16)
-#define READ64(x) ((guint64)((guint16 *)(x)) [0] | \
- (guint64)((guint16 *)(x)) [1] << 16 | \
- (guint64)((guint16 *)(x)) [2] << 32 | \
- (guint64)((guint16 *)(x)) [3] << 48)
-# else
#define READ32(x) (((guint16 *)(x)) [0] << 16 | ((guint16 *)(x)) [1])
#define READ64(x) ((guint64)((guint16 *)(x)) [0] << 48 | \
(guint64)((guint16 *)(x)) [1] << 32 | \
(guint64)((guint16 *)(x)) [2] << 16 | \
(guint64)((guint16 *)(x)) [3])
-# endif
#else /* unaligned access OK */
#define READ32(x) (*(guint32 *)(x))
#define READ64(x) (*(guint64 *)(x))
diff --git a/mono/io-layer/ChangeLog b/mono/io-layer/ChangeLog
index 980b680bfc0..5b19c8ceadf 100644
--- a/mono/io-layer/ChangeLog
+++ b/mono/io-layer/ChangeLog
@@ -1,94 +1,3 @@
-2004-09-06 Dick Porter <dick@ximian.com>
-
- * handles.c (_wapi_handle_unref): Reset the private record's type
- (_wapi_handle_process_fork): Fix long-standing bug in checking
- handle return values. Also do the required bookkeeping with the
- new process's handles.
-
- * daemon.c: When creating a new process's handles, check whether
- the shared space needs to be increased
-
-2004-08-19 Dick Porter <dick@ximian.com>
-
- * handles.c (_wapi_handle_count_signalled_handles): Fix thinko
- introduced with the fd offset stuff: unlock handles properly when
- backing off. Fixes the monologue hang at exit.
-
-2004-08-18 Dick Porter <dick@ximian.com>
-
- * sockets.c:
- * io.c: Check that new fds fit in the table, return error if not
-
- * daemon.c (_wapi_daemon_main):
- * handles.c (shared_init): Have all processes agree on a size for
- the fd table.
-
-2004-08-17 Dick Porter <dick@ximian.com>
-
- * daemon.c (process_new):
- * handles.c (_wapi_handle_new_internal): Cope when the space
- reserved for file descriptors is larger than the shared segment
- size. Fixes the crash reported when running mono under gdb on
- macosx.
-
-2004-08-16 Dick Porter <dick@ximian.com>
-
- * sockets.c:
- * io.c:
- * handles-private.h (_wapi_handle_fd_offset_to_handle): Improve
- error checking with passed-in file descriptors.
-
-2004-08-11 Dick Porter <dick@ximian.com>
-
- * sockets.c:
- * io.c: Returned handle values are the file descriptor the handle
- encapsulates
-
- * handles.c:
- * handles-private.h:
- * daemon.c: Reserve the range of handles that can have the same
- values as file descriptors. These won't be used, but the values
- will be used as file, console, pipe or socket handles. The fd to
- handle mapping is done internally and is invisible to users.
- Fixes bug 61828.
-
- * wapi-private.h (_WAPI_HANDLE_VERSION): Increment, because we now
- reserve a chunk of handle space.
-
-2004-07-22 Dick Porter <dick@ximian.com>
-
- * timed-thread.c:
- * threads.c: Move the destruction of the internal thread data to
- after the thread has been joined. Fixes bug 61418.
-
-2004-07-14 Dick Porter <dick@ximian.com>
-
- * wait.c (test_and_own): When not waiting for all handles to
- become signalled, only own and return the lowest. All the
- documentation suggests that the old way was correct, but
- experimentation shows it actually works like this. Patch by
- Sébastien Robitaille
- (sebastien.robitaille@croesus.com), fixes bug 61511.
-
-2004-07-08 Dick Porter <dick@ximian.com>
-
- * io.c (file_seek): If there is a high 32bit offset part, make
- sure the low part isn't sign-extended. Set error codes when
- returning failure. Fixes bug 61131.
-
-2004-07-06 Dick Porter <dick@ximian.com>
-
- * io.c (file_setfiletime): Check for underflow when converting to
- time_t values. Set error codes when returning failure. Fixes bug
- 60970.
-
-2004-07-05 Dick Porter <dick@ximian.com>
-
- * mutexes.c (mutex_ops_init): Make the named mutex mutex sharable.
-
- * daemon.c (unref_handle): Only destroy a handle if all processes
- have released it, not just the current one. Fixes bug 60887.
-
2004-06-24 Dick Porter <dick@ximian.com>
* mutexes.c: Indicate when a named mutex was reused
diff --git a/mono/io-layer/daemon.c b/mono/io-layer/daemon.c
index e2eca91b3eb..746fba49d17 100644
--- a/mono/io-layer/daemon.c
+++ b/mono/io-layer/daemon.c
@@ -340,14 +340,16 @@ static gboolean unref_handle (ChannelData *channel_data, guint32 handle)
channel_data->open_handles[handle]);
#endif
- if (_wapi_shared_data[segment]->handles[idx].ref == 0) {
+ if(channel_data->open_handles[handle]==0) {
+ /* This client has released the handle */
+ destroy=TRUE;
+ }
+
+ if(_wapi_shared_data[segment]->handles[idx].ref==0) {
gboolean was_file;
dev_t device = 0;
ino_t inode = 0;
- /* This client has released the handle */
- destroy=TRUE;
-
if (channel_data->open_handles[handle]!=0) {
g_warning (G_GNUC_PRETTY_FUNCTION ": per-process open_handles mismatch, set to %d, should be 0",
channel_data->open_handles[handle]);
@@ -830,11 +832,23 @@ static void send_reply (GIOChannel *channel, WapiHandleResponse *resp)
_wapi_daemon_response (g_io_channel_unix_get_fd (channel), resp);
}
-static guint32 new_handle_with_shared_check (WapiHandleType type)
+/*
+ * process_new:
+ * @channel: The client making the request
+ * @channel_data: Our data for this channel
+ * @type: type to init handle to
+ *
+ * Find a free handle and initialize it to 'type', increase refcnt and
+ * send back a reply to the client.
+ */
+static void process_new (GIOChannel *channel, ChannelData *channel_data,
+ WapiHandleType type)
{
- guint32 handle = 0;
-
- while ((handle = _wapi_handle_new_internal (type)) == 0) {
+ guint32 handle;
+ WapiHandleResponse resp={0};
+
+ handle=_wapi_handle_new_internal (type);
+ if(handle==0) {
/* Try and allocate a new shared segment, and have
* another go
*/
@@ -859,34 +873,15 @@ static guint32 new_handle_with_shared_check (WapiHandleType type)
channels[i].open_handles=_wapi_g_renew0 (channels[i].open_handles, old_len, new_len);
}
}
+
+ handle=_wapi_handle_new_internal (type);
} else {
/* Map failed. Just return 0 meaning "out of
* handles"
*/
- break;
}
}
- return(handle);
-}
-
-/*
- * process_new:
- * @channel: The client making the request
- * @channel_data: Our data for this channel
- * @type: type to init handle to
- *
- * Find a free handle and initialize it to 'type', increase refcnt and
- * send back a reply to the client.
- */
-static void process_new (GIOChannel *channel, ChannelData *channel_data,
- WapiHandleType type)
-{
- guint32 handle;
- WapiHandleResponse resp={0};
-
- handle = new_handle_with_shared_check (type);
-
/* handle might still be set to 0. This is handled at the
* client end
*/
@@ -1071,11 +1066,11 @@ static void process_process_fork (GIOChannel *channel, ChannelData *channel_data
* client must check if either handle is 0 and take
* appropriate error handling action.
*/
- process_handle = new_handle_with_shared_check (WAPI_HANDLE_PROCESS);
+ process_handle=_wapi_handle_new_internal (WAPI_HANDLE_PROCESS);
ref_handle (daemon_channel_data, process_handle);
ref_handle (channel_data, process_handle);
- thread_handle = new_handle_with_shared_check (WAPI_HANDLE_THREAD);
+ thread_handle=_wapi_handle_new_internal (WAPI_HANDLE_THREAD);
ref_handle (daemon_channel_data, thread_handle);
ref_handle (channel_data, thread_handle);
@@ -1253,7 +1248,7 @@ static void process_process_fork (GIOChannel *channel, ChannelData *channel_data
resp.u.process_fork.pid=pid;
}
-
+
resp.u.process_fork.process_handle=process_handle;
resp.u.process_fork.thread_handle=thread_handle;
@@ -1498,9 +1493,6 @@ void _wapi_daemon_main(gpointer data, gpointer scratch)
/* Note that we've got the starting segment already */
_wapi_shared_data[0]->num_segments=1;
_wapi_shm_mapped_segments=1;
-
- _wapi_fd_offset_table_size=getdtablesize ();
- _wapi_shared_data[0]->fd_offset_table_size = _wapi_fd_offset_table_size;
startup ();
diff --git a/mono/io-layer/handles-private.h b/mono/io-layer/handles-private.h
index 36890a97160..674e01384b9 100644
--- a/mono/io-layer/handles-private.h
+++ b/mono/io-layer/handles-private.h
@@ -28,9 +28,6 @@ extern struct _WapiHandlePrivate_list **_wapi_private_data;
extern pthread_mutex_t _wapi_shared_mutex;
extern guint32 _wapi_shm_mapped_segments;
-extern guint32 _wapi_fd_offset_table_size;
-extern gpointer *_wapi_fd_offset_table;
-
extern guint32 _wapi_handle_new_internal (WapiHandleType type);
extern gpointer _wapi_handle_new (WapiHandleType type);
extern gboolean _wapi_lookup_handle (gpointer handle, WapiHandleType type,
@@ -96,43 +93,6 @@ extern gboolean _wapi_handle_get_or_set_share (dev_t device, ino_t inode,
extern void _wapi_handle_set_share (dev_t device, ino_t inode,
guint32 sharemode, guint32 access);
-static inline void _wapi_handle_fd_offset_store (int fd, gpointer handle)
-{
- g_assert (fd < _wapi_fd_offset_table_size);
- g_assert (_wapi_fd_offset_table[fd]==NULL || handle==NULL);
- g_assert (GPOINTER_TO_UINT (handle) >= _wapi_fd_offset_table_size || handle==NULL);
-
-#ifdef DEBUG
- g_message (G_GNUC_PRETTY_FUNCTION ": Assigning fd offset %d to %p", fd,
- handle);
-#endif
-
- _wapi_fd_offset_table[fd]=handle;
-}
-
-static inline gpointer _wapi_handle_fd_offset_to_handle (gpointer fd_handle)
-{
- int fd = GPOINTER_TO_INT (fd_handle);
- gpointer handle;
-
- if (fd >= _wapi_fd_offset_table_size) {
- return(NULL);
- }
-
- handle = _wapi_fd_offset_table[fd];
-
- if (GPOINTER_TO_UINT (handle) < _wapi_fd_offset_table_size) {
- return(NULL);
- }
-
-#ifdef DEBUG
- g_message (G_GNUC_PRETTY_FUNCTION ": Returning fd offset %d of %p", fd,
- handle);
-#endif
-
- return(handle);
-}
-
static inline struct _WapiHandleShared_list *_wapi_handle_get_shared_segment (guint32 segment)
{
struct _WapiHandleShared_list *shared;
@@ -265,10 +225,6 @@ static inline WapiHandleType _wapi_handle_type (gpointer handle)
guint32 idx;
guint32 segment;
- if (GPOINTER_TO_UINT (handle) < _wapi_fd_offset_table_size) {
- handle = _wapi_handle_fd_offset_to_handle (handle);
- }
-
_wapi_handle_segment (handle, &segment, &idx);
if(segment>=_wapi_shm_mapped_segments)
@@ -286,8 +242,6 @@ static inline void _wapi_handle_set_signal_state (gpointer handle,
struct _WapiHandleShared *shared_handle;
int thr_ret;
- g_assert (GPOINTER_TO_UINT (handle) >= _wapi_fd_offset_table_size);
-
_wapi_handle_segment (handle, &segment, &idx);
shared_handle=&_wapi_handle_get_shared_segment (segment)->handles[idx];
@@ -363,8 +317,6 @@ static inline gboolean _wapi_handle_issignalled (gpointer handle)
guint32 idx;
guint32 segment;
- g_assert (GPOINTER_TO_UINT (handle) >= _wapi_fd_offset_table_size);
-
_wapi_handle_segment (handle, &segment, &idx);
return(_wapi_handle_get_shared_segment (segment)->handles[idx].signalled);
@@ -400,8 +352,6 @@ static inline int _wapi_handle_lock_handle (gpointer handle)
guint32 idx;
guint32 segment;
- g_assert (GPOINTER_TO_UINT (handle) >= _wapi_fd_offset_table_size);
-
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": locking handle %p", handle);
#endif
@@ -419,8 +369,6 @@ static inline int _wapi_handle_unlock_handle (gpointer handle)
guint32 segment;
int ret;
- g_assert (GPOINTER_TO_UINT (handle) >= _wapi_fd_offset_table_size);
-
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": unlocking handle %p", handle);
#endif
diff --git a/mono/io-layer/handles.c b/mono/io-layer/handles.c
index a1c3dde13ef..769235fe76d 100644
--- a/mono/io-layer/handles.c
+++ b/mono/io-layer/handles.c
@@ -77,9 +77,6 @@ pthread_mutex_t _wapi_shared_mutex=PTHREAD_MUTEX_INITIALIZER;
*/
guint32 _wapi_shm_mapped_segments;
-guint32 _wapi_fd_offset_table_size;
-gpointer *_wapi_fd_offset_table=NULL;
-
static void shared_init (void)
{
struct sockaddr_un shared_socket_address;
@@ -89,7 +86,7 @@ static void shared_init (void)
_wapi_shared_data=g_new0 (struct _WapiHandleShared_list *, 1);
_wapi_private_data=g_new0 (struct _WapiHandlePrivate_list *, 1);
-
+
attach_again:
#ifndef DISABLE_SHARED_HANDLES
@@ -149,9 +146,6 @@ attach_again:
goto attach_again;
}
- } else {
- _wapi_fd_offset_table_size = _wapi_shared_data[0]->fd_offset_table_size;
- _wapi_fd_offset_table=g_new0 (gpointer, _wapi_fd_offset_table_size);
}
}
@@ -164,10 +158,6 @@ attach_again:
_wapi_shared_data[0]->num_segments=1;
_wapi_shared_scratch=g_new0 (struct _WapiHandleScratch, 1);
-
- _wapi_fd_offset_table_size=getdtablesize ();
- _wapi_fd_offset_table=g_new0 (gpointer,
- _wapi_fd_offset_table_size);
}
_wapi_private_data[0]=g_new0 (struct _WapiHandlePrivate_list, 1);
_wapi_shm_mapped_segments=1;
@@ -250,7 +240,6 @@ guint32 _wapi_handle_new_internal (WapiHandleType type)
guint32 i, j;
static guint32 last=1;
int thr_ret;
- guint32 num_segments = _wapi_handle_get_shared_segment (0)->num_segments;
/* A linear scan should be fast enough. Start from the last
* allocation, assuming that handles are allocated more often
@@ -261,7 +250,8 @@ guint32 _wapi_handle_new_internal (WapiHandleType type)
#endif
again:
_wapi_handle_segment (GUINT_TO_POINTER (last), &segment, &idx);
- for(i=segment; i < num_segments; i++) {
+ for(i=segment; i<_wapi_handle_get_shared_segment (0)->num_segments;
+ i++) {
if(i!=segment) {
idx=0;
}
@@ -269,20 +259,8 @@ again:
for(j=idx; j<_WAPI_HANDLES_PER_SEGMENT; j++) {
struct _WapiHandleShared *shared;
- /* Make sure we dont try and assign the
- * handles that would clash with fds
- */
- if ((i * _WAPI_HANDLES_PER_SEGMENT + j) < _wapi_fd_offset_table_size) {
- i = _wapi_fd_offset_table_size / _WAPI_HANDLES_PER_SEGMENT;
- j = _wapi_fd_offset_table_size - (i * _WAPI_HANDLES_PER_SEGMENT);
-
- if (i >= num_segments) {
- /* Need to get the caller to
- * add more shared segments
- */
- return(0);
- }
-
+ /* Make sure we dont try and assign handle 0 */
+ if (i==0 && j==0) {
continue;
}
@@ -336,7 +314,7 @@ gpointer _wapi_handle_new (WapiHandleType type)
int thr_ret;
mono_once (&shared_init_once, shared_init);
-
+
again:
if(shared==TRUE) {
new.type=WapiHandleRequestType_New;
@@ -358,7 +336,8 @@ again:
thr_ret = pthread_mutex_lock (&scan_mutex);
g_assert (thr_ret == 0);
- while ((handle_idx = _wapi_handle_new_internal (type)) == 0) {
+ handle_idx=_wapi_handle_new_internal (type);
+ if(handle_idx==0) {
/* Try and get a new segment, and have another go */
segment=_wapi_handle_get_shared_segment (0)->num_segments;
_wapi_handle_ensure_mapped (segment);
@@ -366,6 +345,7 @@ again:
if(_wapi_handle_get_shared_segment (segment)!=NULL) {
/* Got a new segment */
_wapi_handle_get_shared_segment (0)->num_segments++;
+ handle_idx=_wapi_handle_new_internal (type);
} else {
/* Map failed. Just return 0 meaning
* "out of handles"
@@ -381,9 +361,6 @@ again:
pthread_cleanup_pop (0);
}
- /* Make sure we left the space for fd mappings */
- g_assert (handle_idx >= _wapi_fd_offset_table_size);
-
if(handle_idx==0) {
g_warning (G_GNUC_PRETTY_FUNCTION ": Ran out of handles!");
@@ -437,8 +414,6 @@ gboolean _wapi_lookup_handle (gpointer handle, WapiHandleType type,
guint32 idx;
guint32 segment;
- g_assert (GPOINTER_TO_UINT (handle) >= _wapi_fd_offset_table_size);
-
_wapi_handle_segment (handle, &segment, &idx);
_wapi_handle_ensure_mapped (segment);
@@ -617,8 +592,6 @@ gpointer _wapi_search_handle_namespace (WapiHandleType type,
void _wapi_handle_ref (gpointer handle)
{
- g_assert (GPOINTER_TO_UINT (handle) >= _wapi_fd_offset_table_size);
-
if(shared==TRUE) {
WapiHandleRequest req={0};
WapiHandleResponse resp={0};
@@ -655,8 +628,6 @@ void _wapi_handle_unref (gpointer handle)
gboolean destroy = FALSE;
int thr_ret;
- g_assert (GPOINTER_TO_UINT (handle) >= _wapi_fd_offset_table_size);
-
_wapi_handle_segment (handle, &segment, &idx);
if(shared==TRUE) {
@@ -705,7 +676,6 @@ void _wapi_handle_unref (gpointer handle)
_wapi_handle_ops_close_private (handle);
_wapi_handle_get_shared_segment (segment)->handles[idx].type=WAPI_HANDLE_UNUSED;
- _wapi_handle_get_private_segment (segment)->handles[idx].type=WAPI_HANDLE_UNUSED;
/* Destroy the mutex and cond var. We hope nobody
* tried to grab them between the handle unlock and
@@ -1210,10 +1180,6 @@ gboolean _wapi_handle_test_capabilities (gpointer handle,
guint32 idx, segment;
WapiHandleType type;
- if (GPOINTER_TO_UINT (handle) < _wapi_fd_offset_table_size) {
- handle = _wapi_handle_fd_offset_to_handle (handle);
- }
-
_wapi_handle_segment (handle, &segment, &idx);
type=_wapi_handle_get_shared_segment (segment)->handles[idx].type;
@@ -1231,10 +1197,6 @@ void _wapi_handle_ops_close_shared (gpointer handle)
guint32 idx, segment;
WapiHandleType type;
- if (GPOINTER_TO_UINT (handle) < _wapi_fd_offset_table_size) {
- handle = _wapi_handle_fd_offset_to_handle (handle);
- }
-
_wapi_handle_segment (handle, &segment, &idx);
type=_wapi_handle_get_shared_segment (segment)->handles[idx].type;
@@ -1249,10 +1211,6 @@ void _wapi_handle_ops_close_private (gpointer handle)
guint32 idx, segment;
WapiHandleType type;
- if (GPOINTER_TO_UINT (handle) < _wapi_fd_offset_table_size) {
- handle = _wapi_handle_fd_offset_to_handle (handle);
- }
-
_wapi_handle_segment (handle, &segment, &idx);
type=_wapi_handle_get_shared_segment (segment)->handles[idx].type;
@@ -1274,10 +1232,6 @@ void _wapi_handle_ops_signal (gpointer handle)
guint32 idx, segment;
WapiHandleType type;
- if (GPOINTER_TO_UINT (handle) < _wapi_fd_offset_table_size) {
- handle = _wapi_handle_fd_offset_to_handle (handle);
- }
-
_wapi_handle_segment (handle, &segment, &idx);
type=_wapi_handle_get_shared_segment (segment)->handles[idx].type;
@@ -1292,10 +1246,6 @@ void _wapi_handle_ops_own (gpointer handle)
guint32 idx, segment;
WapiHandleType type;
- if (GPOINTER_TO_UINT (handle) < _wapi_fd_offset_table_size) {
- handle = _wapi_handle_fd_offset_to_handle (handle);
- }
-
_wapi_handle_segment (handle, &segment, &idx);
type=_wapi_handle_get_shared_segment (segment)->handles[idx].type;
@@ -1310,10 +1260,6 @@ gboolean _wapi_handle_ops_isowned (gpointer handle)
guint32 idx, segment;
WapiHandleType type;
- if (GPOINTER_TO_UINT (handle) < _wapi_fd_offset_table_size) {
- handle = _wapi_handle_fd_offset_to_handle (handle);
- }
-
_wapi_handle_segment (handle, &segment, &idx);
type=_wapi_handle_get_shared_segment (segment)->handles[idx].type;
@@ -1338,14 +1284,6 @@ gboolean _wapi_handle_ops_isowned (gpointer handle)
*/
gboolean CloseHandle(gpointer handle)
{
- if (GPOINTER_TO_UINT (handle) < _wapi_fd_offset_table_size) {
- handle = _wapi_handle_fd_offset_to_handle (handle);
- }
-
- if (handle == NULL) {
- return(FALSE);
- }
-
_wapi_handle_unref (handle);
return(TRUE);
@@ -1365,17 +1303,12 @@ gboolean _wapi_handle_count_signalled_handles (guint32 numhandles,
again:
for(i=0; i<numhandles; i++) {
guint32 idx, segment;
- gpointer handle = handles[i];
-
- if (GPOINTER_TO_UINT (handle) < _wapi_fd_offset_table_size) {
- handle = _wapi_handle_fd_offset_to_handle (handle);
- }
- _wapi_handle_segment (handle, &segment, &idx);
+ _wapi_handle_segment (handles[i], &segment, &idx);
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": attempting to lock %p",
- handle);
+ handles[i]);
#endif
ret=mono_mutex_trylock (&_wapi_handle_get_shared_segment (segment)->handles[idx].signal_mutex);
@@ -1384,17 +1317,11 @@ again:
struct timespec sleepytime;
#ifdef DEBUG
- g_message (G_GNUC_PRETTY_FUNCTION ": attempt failed for %p: %s", handle, strerror (ret));
+ g_message (G_GNUC_PRETTY_FUNCTION ": attempt failed for %p", handles[i]);
#endif
while(i--) {
- handle = handles[i];
-
- if (GPOINTER_TO_UINT (handle) < _wapi_fd_offset_table_size) {
- handle = _wapi_handle_fd_offset_to_handle (handle);
- }
-
- _wapi_handle_segment (handle, &segment, &idx);
+ _wapi_handle_segment (handles[i], &segment, &idx);
thr_ret = mono_mutex_unlock (&_wapi_handle_get_shared_segment (segment)->handles[idx].signal_mutex);
g_assert (thr_ret == 0);
}
@@ -1432,29 +1359,24 @@ again:
for(i=0; i<numhandles; i++) {
guint32 idx, segment;
- gpointer handle = handles[i];
-
- if (GPOINTER_TO_UINT (handle) < _wapi_fd_offset_table_size) {
- handle = _wapi_handle_fd_offset_to_handle (handle);
- }
-
- _wapi_handle_ref (handle);
+
+ _wapi_handle_ref (handles[i]);
- _wapi_handle_segment (handle, &segment, &idx);
+ _wapi_handle_segment (handles[i], &segment, &idx);
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": Checking handle %p",
- handle);
+ handles[i]);
#endif
- if(((_wapi_handle_test_capabilities (handle, WAPI_HANDLE_CAP_OWN)==TRUE) &&
- (_wapi_handle_ops_isowned (handle)==TRUE)) ||
+ if(((_wapi_handle_test_capabilities (handles[i], WAPI_HANDLE_CAP_OWN)==TRUE) &&
+ (_wapi_handle_ops_isowned (handles[i])==TRUE)) ||
(_wapi_handle_get_shared_segment (segment)->handles[idx].signalled==TRUE)) {
count++;
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION
- ": Handle %p signalled", handle);
+ ": Handle %p signalled", handles[i]);
#endif
if(*lowest>i) {
*lowest=i;
@@ -1490,23 +1412,18 @@ void _wapi_handle_unlock_handles (guint32 numhandles, gpointer *handles)
for(i=0; i<numhandles; i++) {
guint32 idx, segment;
- gpointer handle = handles[i];
-
- if (GPOINTER_TO_UINT (handle) < _wapi_fd_offset_table_size) {
- handle = _wapi_handle_fd_offset_to_handle (handle);
- }
-
- _wapi_handle_segment (handle, &segment, &idx);
+
+ _wapi_handle_segment (handles[i], &segment, &idx);
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": unlocking handle %p",
- handle);
+ handles[i]);
#endif
thr_ret = mono_mutex_unlock (&_wapi_handle_get_shared_segment (segment)->handles[idx].signal_mutex);
g_assert (thr_ret == 0);
- _wapi_handle_unref (handle);
+ _wapi_handle_unref (handles[i]);
}
}
@@ -1578,10 +1495,6 @@ int _wapi_handle_wait_signal_handle (gpointer handle)
#if defined(_POSIX_THREAD_PROCESS_SHARED) && _POSIX_THREAD_PROCESS_SHARED != -1
guint32 idx, segment;
- if (GPOINTER_TO_UINT (handle) < _wapi_fd_offset_table_size) {
- handle = _wapi_handle_fd_offset_to_handle (handle);
- }
-
_wapi_handle_segment (handle, &segment, &idx);
return(mono_cond_wait (&_wapi_handle_get_shared_segment (segment)->handles[idx].signal_cond,
@@ -1591,10 +1504,6 @@ int _wapi_handle_wait_signal_handle (gpointer handle)
struct timespec fake_timeout;
int ret;
- if (GPOINTER_TO_UINT (handle) < _wapi_fd_offset_table_size) {
- handle = _wapi_handle_fd_offset_to_handle (handle);
- }
-
_wapi_handle_segment (handle, &segment, &idx);
_wapi_calc_timeout (&fake_timeout, 100);
@@ -1615,10 +1524,6 @@ int _wapi_handle_timedwait_signal_handle (gpointer handle,
#if defined(_POSIX_THREAD_PROCESS_SHARED) && _POSIX_THREAD_PROCESS_SHARED != -1
guint32 idx, segment;
- if (GPOINTER_TO_UINT (handle) < _wapi_fd_offset_table_size) {
- handle = _wapi_handle_fd_offset_to_handle (handle);
- }
-
_wapi_handle_segment (handle, &segment, &idx);
return(mono_cond_timedwait (&_wapi_handle_get_shared_segment (segment)->handles[idx].signal_cond,
@@ -1629,10 +1534,6 @@ int _wapi_handle_timedwait_signal_handle (gpointer handle,
struct timespec fake_timeout;
int ret;
- if (GPOINTER_TO_UINT (handle) < _wapi_fd_offset_table_size) {
- handle = _wapi_handle_fd_offset_to_handle (handle);
- }
-
_wapi_handle_segment (handle, &segment, &idx);
_wapi_calc_timeout (&fake_timeout, 100);
@@ -1708,26 +1609,9 @@ gboolean _wapi_handle_process_fork (guint32 cmd, guint32 env, guint32 dir,
* exec_errno will be set, and the handle will be
* signalled immediately.
*/
- if(*process_handle==0 || *thread_handle==0) {
+ if(process_handle==0 || thread_handle==0) {
return(FALSE);
} else {
- /* This call returns new handles, so we need to do
- * a little bookkeeping
- */
- if (_wapi_private_data != NULL) {
- guint32 segment, idx;
-
- _wapi_handle_segment (*process_handle,
- &segment, &idx);
- _wapi_handle_ensure_mapped (segment);
- _wapi_handle_get_private_segment (segment)->handles[idx].type = WAPI_HANDLE_PROCESS;
-
- _wapi_handle_segment (*thread_handle,
- &segment, &idx);
- _wapi_handle_ensure_mapped (segment);
- _wapi_handle_get_private_segment (segment)->handles[idx].type = WAPI_HANDLE_THREAD;
- }
-
return(TRUE);
}
} else {
diff --git a/mono/io-layer/io.c b/mono/io-layer/io.c
index a7a9b2032d0..e0436186ee0 100644
--- a/mono/io-layer/io.c
+++ b/mono/io-layer/io.c
@@ -271,9 +271,6 @@ static void file_close_private (gpointer handle)
handle, file_private_handle->fd);
#endif
- /* Blank out the mapping, to make catching errors easier */
- _wapi_handle_fd_offset_store (file_private_handle->fd, NULL);
-
close(file_private_handle->fd);
}
@@ -620,7 +617,6 @@ static guint32 file_seek(gpointer handle, gint32 movedistance,
if(ok==FALSE) {
g_warning (G_GNUC_PRETTY_FUNCTION
": error looking up file handle %p", handle);
- SetLastError (ERROR_INVALID_HANDLE);
return(INVALID_SET_FILE_POINTER);
}
@@ -631,7 +627,6 @@ static guint32 file_seek(gpointer handle, gint32 movedistance,
g_message(G_GNUC_PRETTY_FUNCTION ": handle %p fd %d doesn't have GENERIC_READ or GENERIC_WRITE access: %u", handle, file_private_handle->fd, file_handle->fileaccess);
#endif
- SetLastError (ERROR_ACCESS_DENIED);
return(INVALID_SET_FILE_POINTER);
}
@@ -651,7 +646,6 @@ static guint32 file_seek(gpointer handle, gint32 movedistance,
method);
#endif
- SetLastError (ERROR_INVALID_PARAMETER);
return(INVALID_SET_FILE_POINTER);
}
@@ -664,7 +658,7 @@ static guint32 file_seek(gpointer handle, gint32 movedistance,
movedistance);
#endif
} else {
- offset=((gint64) *highmovedistance << 32) | (unsigned long)movedistance;
+ offset=((gint64) *highmovedistance << 32) | movedistance;
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION ": setting offset to %lld 0x%llx (high %d 0x%x, low %d 0x%x)", offset, offset, *highmovedistance, *highmovedistance, movedistance, movedistance);
@@ -694,7 +688,6 @@ static guint32 file_seek(gpointer handle, gint32 movedistance,
handle, file_private_handle->fd, strerror(errno));
#endif
- _wapi_set_last_error_from_errno ();
return(INVALID_SET_FILE_POINTER);
}
@@ -993,7 +986,6 @@ static gboolean file_setfiletime(gpointer handle,
if(ok==FALSE) {
g_warning (G_GNUC_PRETTY_FUNCTION
": error looking up file handle %p", handle);
- SetLastError (ERROR_INVALID_HANDLE);
return(FALSE);
}
@@ -1003,7 +995,6 @@ static gboolean file_setfiletime(gpointer handle,
g_message(G_GNUC_PRETTY_FUNCTION ": handle %p fd %d doesn't have GENERIC_WRITE access: %u", handle, file_private_handle->fd, file_handle->fileaccess);
#endif
- SetLastError (ERROR_ACCESS_DENIED);
return(FALSE);
}
@@ -1014,7 +1005,6 @@ static gboolean file_setfiletime(gpointer handle,
file_private_handle->fd);
#endif
- SetLastError (ERROR_INVALID_HANDLE);
return(FALSE);
}
@@ -1029,25 +1019,12 @@ static gboolean file_setfiletime(gpointer handle,
file_private_handle->fd, strerror(errno));
#endif
- SetLastError (ERROR_INVALID_PARAMETER);
return(FALSE);
}
if(last_access!=NULL) {
access_ticks=((guint64)last_access->dwHighDateTime << 32) +
last_access->dwLowDateTime;
- /* This is (time_t)0. We can actually go to INT_MIN,
- * but this will do for now.
- */
- if (access_ticks < 116444736000000000ULL) {
-#ifdef DEBUG
- g_message (G_GNUC_PRETTY_FUNCTION
- ": attempt to set access time too early");
-#endif
- SetLastError (ERROR_INVALID_PARAMETER);
- return(FALSE);
- }
-
utbuf.actime=(access_ticks - 116444736000000000ULL) / 10000000;
} else {
utbuf.actime=statbuf.st_atime;
@@ -1056,18 +1033,6 @@ static gboolean file_setfiletime(gpointer handle,
if(last_write!=NULL) {
write_ticks=((guint64)last_write->dwHighDateTime << 32) +
last_write->dwLowDateTime;
- /* This is (time_t)0. We can actually go to INT_MIN,
- * but this will do for now.
- */
- if (write_ticks < 116444736000000000ULL) {
-#ifdef DEBUG
- g_message (G_GNUC_PRETTY_FUNCTION
- ": attempt to set write time too early");
-#endif
- SetLastError (ERROR_INVALID_PARAMETER);
- return(FALSE);
- }
-
utbuf.modtime=(write_ticks - 116444736000000000ULL) / 10000000;
} else {
utbuf.modtime=statbuf.st_mtime;
@@ -1090,7 +1055,6 @@ static gboolean file_setfiletime(gpointer handle,
#endif
g_free (name);
- SetLastError (ERROR_INVALID_PARAMETER);
return(FALSE);
}
@@ -1145,9 +1109,6 @@ static void console_close_private (gpointer handle)
console_private_handle->fd);
#endif
- /* Blank out the mapping, to make catching errors easier */
- _wapi_handle_fd_offset_store (console_private_handle->fd, NULL);
-
close(console_private_handle->fd);
}
@@ -1307,9 +1268,6 @@ static void pipe_close_private (gpointer handle)
pipe_private_handle->fd);
#endif
- /* Blank out the mapping, to make catching errors easier */
- _wapi_handle_fd_offset_store (pipe_private_handle->fd, NULL);
-
close(pipe_private_handle->fd);
}
@@ -1628,19 +1586,6 @@ gpointer CreateFile(const gunichar2 *name, guint32 fileaccess,
return(INVALID_HANDLE_VALUE);
}
- if (fd >= _wapi_fd_offset_table_size) {
-#ifdef DEBUG
- g_message (G_GNUC_PRETTY_FUNCTION ": File descriptor is too big");
-#endif
-
- SetLastError (ERROR_TOO_MANY_OPEN_FILES);
-
- close (fd);
- g_free (filename);
-
- return(INVALID_HANDLE_VALUE);
- }
-
ret = fstat (fd, &statbuf);
if (ret == -1) {
#ifdef DEBUG
@@ -1727,9 +1672,7 @@ gpointer CreateFile(const gunichar2 *name, guint32 fileaccess,
close (fd);
goto cleanup;
}
-
- _wapi_handle_fd_offset_store (fd, handle);
- cf_ret = GINT_TO_POINTER (fd);
+ cf_ret = handle;
file_private_handle->fd=fd;
file_private_handle->assigned=TRUE;
@@ -2015,16 +1958,16 @@ gboolean CopyFile (const gunichar2 *name, const gunichar2 *dest_name,
}
static mono_once_t stdhandle_once=MONO_ONCE_INIT;
-static gpointer stdin_handle=INVALID_HANDLE_VALUE;
-static gpointer stdout_handle=INVALID_HANDLE_VALUE;
-static gpointer stderr_handle=INVALID_HANDLE_VALUE;
+static gpointer stdin_handle=NULL;
+static gpointer stdout_handle=NULL;
+static gpointer stderr_handle=NULL;
static gpointer stdhandle_create (int fd, const guchar *name)
{
struct _WapiHandle_file *file_handle;
struct _WapiHandlePrivate_file *file_private_handle;
gboolean ok;
- gpointer handle, ret = INVALID_HANDLE_VALUE;
+ gpointer handle, ret = NULL;
int flags;
int thr_ret;
@@ -2055,7 +1998,7 @@ static gpointer stdhandle_create (int fd, const guchar *name)
if(handle==_WAPI_HANDLE_INVALID) {
g_warning (G_GNUC_PRETTY_FUNCTION
": error creating file handle");
- return(INVALID_HANDLE_VALUE);
+ return(NULL);
}
pthread_cleanup_push ((void(*)(void *))_wapi_handle_unlock_handle,
@@ -2071,10 +2014,7 @@ static gpointer stdhandle_create (int fd, const guchar *name)
": error looking up console handle %p", handle);
goto cleanup;
}
-
- /* We know this is fd 0, 1 or 2 */
- _wapi_handle_fd_offset_store (fd, handle);
- ret = GINT_TO_POINTER (fd);
+ ret = handle;
file_private_handle->fd=fd;
file_private_handle->assigned=TRUE;
@@ -2144,13 +2084,8 @@ gpointer GetStdHandle(WapiStdHandle stdhandle)
return(INVALID_HANDLE_VALUE);
}
- if (handle == INVALID_HANDLE_VALUE) {
- SetLastError (ERROR_NO_MORE_FILES);
- return(INVALID_HANDLE_VALUE);
- }
-
/* Add a reference to this handle */
- _wapi_handle_ref (_wapi_handle_fd_offset_to_handle (handle));
+ _wapi_handle_ref (handle);
return(handle);
}
@@ -2182,21 +2117,12 @@ gpointer GetStdHandle(WapiStdHandle stdhandle)
* read due to an attempt to read past the end of the file), %FALSE on
* error.
*/
-gboolean ReadFile(gpointer fd_handle, gpointer buffer, guint32 numbytes,
+gboolean ReadFile(gpointer handle, gpointer buffer, guint32 numbytes,
guint32 *bytesread, WapiOverlapped *overlapped)
{
- gpointer handle = _wapi_handle_fd_offset_to_handle (fd_handle);
- WapiHandleType type;
-
- if (handle == NULL) {
- SetLastError (ERROR_INVALID_HANDLE);
- return(FALSE);
- }
-
- type = _wapi_handle_type (handle);
+ WapiHandleType type=_wapi_handle_type (handle);
if(io_ops[type].readfile==NULL) {
- SetLastError (ERROR_INVALID_HANDLE);
return(FALSE);
}
@@ -2229,21 +2155,12 @@ gboolean ReadFile(gpointer fd_handle, gpointer buffer, guint32 numbytes,
*
* Return value: %TRUE if the write succeeds, %FALSE on error.
*/
-gboolean WriteFile(gpointer fd_handle, gconstpointer buffer, guint32 numbytes,
+gboolean WriteFile(gpointer handle, gconstpointer buffer, guint32 numbytes,
guint32 *byteswritten, WapiOverlapped *overlapped)
{
- gpointer handle = _wapi_handle_fd_offset_to_handle (fd_handle);
- WapiHandleType type;
-
- if (handle == NULL) {
- SetLastError (ERROR_INVALID_HANDLE);
- return(FALSE);
- }
-
- type = _wapi_handle_type (handle);
+ WapiHandleType type=_wapi_handle_type (handle);
if(io_ops[type].writefile==NULL) {
- SetLastError (ERROR_INVALID_HANDLE);
return(FALSE);
}
@@ -2261,20 +2178,11 @@ gboolean WriteFile(gpointer fd_handle, gconstpointer buffer, guint32 numbytes,
*
* Return value: %TRUE on success, %FALSE otherwise.
*/
-gboolean FlushFileBuffers(gpointer fd_handle)
+gboolean FlushFileBuffers(gpointer handle)
{
- gpointer handle = _wapi_handle_fd_offset_to_handle (fd_handle);
- WapiHandleType type;
-
- if (handle == NULL) {
- SetLastError (ERROR_INVALID_HANDLE);
- return(FALSE);
- }
-
- type = _wapi_handle_type (handle);
+ WapiHandleType type=_wapi_handle_type (handle);
if(io_ops[type].flushfile==NULL) {
- SetLastError (ERROR_INVALID_HANDLE);
return(FALSE);
}
@@ -2291,20 +2199,11 @@ gboolean FlushFileBuffers(gpointer fd_handle)
*
* Return value: %TRUE on success, %FALSE otherwise.
*/
-gboolean SetEndOfFile(gpointer fd_handle)
+gboolean SetEndOfFile(gpointer handle)
{
- gpointer handle = _wapi_handle_fd_offset_to_handle (fd_handle);
- WapiHandleType type;
-
- if (handle == NULL) {
- SetLastError (ERROR_INVALID_HANDLE);
- return(FALSE);
- }
-
- type = _wapi_handle_type (handle);
+ WapiHandleType type=_wapi_handle_type (handle);
if(io_ops[type].setendoffile==NULL) {
- SetLastError (ERROR_INVALID_HANDLE);
return(FALSE);
}
@@ -2340,22 +2239,13 @@ gboolean SetEndOfFile(gpointer fd_handle)
* If @highmovedistance is not %NULL, the high 32 bits of the new file
* pointer are stored there. On failure, %INVALID_SET_FILE_POINTER.
*/
-guint32 SetFilePointer(gpointer fd_handle, gint32 movedistance,
+guint32 SetFilePointer(gpointer handle, gint32 movedistance,
gint32 *highmovedistance, WapiSeekMethod method)
{
- gpointer handle = _wapi_handle_fd_offset_to_handle (fd_handle);
- WapiHandleType type;
-
- if (handle == NULL) {
- SetLastError (ERROR_INVALID_HANDLE);
- return(INVALID_SET_FILE_POINTER);
- }
-
- type = _wapi_handle_type (handle);
+ WapiHandleType type=_wapi_handle_type (handle);
if(io_ops[type].seek==NULL) {
- SetLastError (ERROR_INVALID_HANDLE);
- return(INVALID_SET_FILE_POINTER);
+ return(FALSE);
}
return(io_ops[type].seek (handle, movedistance, highmovedistance,
@@ -2373,20 +2263,11 @@ guint32 SetFilePointer(gpointer fd_handle, gint32 movedistance,
* %FILE_TYPE_CHAR - @handle is a character device, such as a console.
* %FILE_TYPE_PIPE - @handle is a named or anonymous pipe.
*/
-WapiFileType GetFileType(gpointer fd_handle)
+WapiFileType GetFileType(gpointer handle)
{
- gpointer handle = _wapi_handle_fd_offset_to_handle (fd_handle);
- WapiHandleType type;
-
- if (handle == NULL) {
- SetLastError (ERROR_INVALID_HANDLE);
- return(FILE_TYPE_UNKNOWN);
- }
-
- type = _wapi_handle_type (handle);
+ WapiHandleType type=_wapi_handle_type (handle);
if(io_ops[type].getfiletype==NULL) {
- SetLastError (ERROR_INVALID_HANDLE);
return(FILE_TYPE_UNKNOWN);
}
@@ -2409,21 +2290,12 @@ WapiFileType GetFileType(gpointer fd_handle)
* @highsize is non-%NULL then the high 32 bits of the file size are
* stored here. On failure %INVALID_FILE_SIZE is returned.
*/
-guint32 GetFileSize(gpointer fd_handle, guint32 *highsize)
+guint32 GetFileSize(gpointer handle, guint32 *highsize)
{
- gpointer handle = _wapi_handle_fd_offset_to_handle (fd_handle);
- WapiHandleType type;
-
- if (handle == NULL) {
- SetLastError (ERROR_INVALID_HANDLE);
- return(INVALID_FILE_SIZE);
- }
-
- type = _wapi_handle_type (handle);
+ WapiHandleType type=_wapi_handle_type (handle);
if(io_ops[type].getfilesize==NULL) {
- SetLastError (ERROR_INVALID_HANDLE);
- return(INVALID_FILE_SIZE);
+ return(FALSE);
}
return(io_ops[type].getfilesize (handle, highsize));
@@ -2454,21 +2326,12 @@ guint32 GetFileSize(gpointer fd_handle, guint32 *highsize)
*
* Return value: %TRUE on success, %FALSE otherwise.
*/
-gboolean GetFileTime(gpointer fd_handle, WapiFileTime *create_time,
+gboolean GetFileTime(gpointer handle, WapiFileTime *create_time,
WapiFileTime *last_access, WapiFileTime *last_write)
{
- gpointer handle = _wapi_handle_fd_offset_to_handle (fd_handle);
- WapiHandleType type;
-
- if (handle == NULL) {
- SetLastError (ERROR_INVALID_HANDLE);
- return(FALSE);
- }
-
- type = _wapi_handle_type (handle);
+ WapiHandleType type=_wapi_handle_type (handle);
if(io_ops[type].getfiletime==NULL) {
- SetLastError (ERROR_INVALID_HANDLE);
return(FALSE);
}
@@ -2499,22 +2362,13 @@ gboolean GetFileTime(gpointer fd_handle, WapiFileTime *create_time,
*
* Return value: %TRUE on success, %FALSE otherwise.
*/
-gboolean SetFileTime(gpointer fd_handle, const WapiFileTime *create_time,
+gboolean SetFileTime(gpointer handle, const WapiFileTime *create_time,
const WapiFileTime *last_access,
const WapiFileTime *last_write)
{
- gpointer handle = _wapi_handle_fd_offset_to_handle (fd_handle);
- WapiHandleType type;
-
- if (handle == NULL) {
- SetLastError (ERROR_INVALID_HANDLE);
- return(FALSE);
- }
-
- type = _wapi_handle_type (handle);
+ WapiHandleType type=_wapi_handle_type (handle);
if(io_ops[type].setfiletime==NULL) {
- SetLastError (ERROR_INVALID_HANDLE);
return(FALSE);
}
@@ -3513,14 +3367,10 @@ extern gboolean SetCurrentDirectory (const gunichar2 *path)
return result;
}
-/* When we're confident there are no more bugs in the fd->handle
- * mapping, this can be replaced as a no-op: GPOINTER_TO_INT(fd_handle) == fd
- */
-int _wapi_file_handle_to_fd (gpointer fd_handle)
+int _wapi_file_handle_to_fd (gpointer handle)
{
struct _WapiHandlePrivate_file *file_private_handle;
gboolean ok;
- gpointer handle = _wapi_handle_fd_offset_to_handle (fd_handle);
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": looking up fd for %p", handle);
@@ -3549,8 +3399,6 @@ int _wapi_file_handle_to_fd (gpointer fd_handle)
file_private_handle->fd);
#endif
- g_assert (file_private_handle->fd == GPOINTER_TO_INT (fd_handle));
-
return(file_private_handle->fd);
}
@@ -3586,20 +3434,6 @@ gboolean CreatePipe (gpointer *readpipe, gpointer *writepipe,
_wapi_set_last_error_from_errno ();
return(FALSE);
}
-
- if (filedes[0] >= _wapi_fd_offset_table_size ||
- filedes[1] >= _wapi_fd_offset_table_size) {
-#ifdef DEBUG
- g_message (G_GNUC_PRETTY_FUNCTION ": File descriptor is too big");
-#endif
-
- SetLastError (ERROR_TOO_MANY_OPEN_FILES);
-
- close (filedes[0]);
- close (filedes[1]);
-
- return(FALSE);
- }
/* filedes[0] is open for reading, filedes[1] for writing */
@@ -3661,18 +3495,18 @@ gboolean CreatePipe (gpointer *readpipe, gpointer *writepipe,
pipe_read_private_handle->assigned=TRUE;
pipe_read_handle->fileaccess=GENERIC_READ;
- _wapi_handle_fd_offset_store (filedes[0], read_handle);
- *readpipe=GINT_TO_POINTER (filedes[0]);
+ *readpipe=read_handle;
pipe_write_private_handle->fd=filedes[1];
pipe_write_private_handle->assigned=TRUE;
pipe_write_handle->fileaccess=GENERIC_WRITE;
- _wapi_handle_fd_offset_store (filedes[1], write_handle);
- *writepipe=GINT_TO_POINTER (filedes[1]);
+ *writepipe=write_handle;
#ifdef DEBUG
- g_message (G_GNUC_PRETTY_FUNCTION ": Returning pipe: read handle %p (fd %d), write handle %p (fd %d)", read_handle, filedes[0], write_handle, filedes[1]);
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": Returning pipe: read handle %p, write handle %p",
+ read_handle, write_handle);
#endif
write_cleanup:
@@ -3745,7 +3579,7 @@ guint32 GetTempPath (guint32 len, gunichar2 *buf)
}
gboolean
-_wapi_io_add_callback (gpointer fd_handle,
+_wapi_io_add_callback (gpointer handle,
WapiOverlappedCB callback,
guint64 flags G_GNUC_UNUSED)
{
@@ -3754,12 +3588,6 @@ _wapi_io_add_callback (gpointer fd_handle,
gboolean ok;
int thr_ret;
gboolean ret = FALSE;
- gpointer handle = _wapi_handle_fd_offset_to_handle (fd_handle);
-
- if (handle == NULL) {
- SetLastError (ERROR_INVALID_HANDLE);
- return(FALSE);
- }
ok = _wapi_lookup_handle (handle, WAPI_HANDLE_FILE,
(gpointer *) &file_handle,
@@ -3933,19 +3761,13 @@ static gboolean _wapi_unlock_file_region (int fd, off_t offset, off_t length)
return(TRUE);
}
-gboolean LockFile (gpointer fd_handle, guint32 offset_low, guint32 offset_high,
+gboolean LockFile (gpointer handle, guint32 offset_low, guint32 offset_high,
guint32 length_low, guint32 length_high)
{
struct _WapiHandle_file *file_handle;
struct _WapiHandlePrivate_file *file_private_handle;
gboolean ok;
off_t offset, length;
- gpointer handle = _wapi_handle_fd_offset_to_handle (fd_handle);
-
- if (handle == NULL) {
- SetLastError (ERROR_INVALID_HANDLE);
- return(FALSE);
- }
ok = _wapi_lookup_handle (handle, WAPI_HANDLE_FILE,
(gpointer *)&file_handle,
@@ -3991,20 +3813,13 @@ gboolean LockFile (gpointer fd_handle, guint32 offset_low, guint32 offset_high,
length));
}
-gboolean UnlockFile (gpointer fd_handle, guint32 offset_low,
- guint32 offset_high, guint32 length_low,
- guint32 length_high)
+gboolean UnlockFile (gpointer handle, guint32 offset_low, guint32 offset_high,
+ guint32 length_low, guint32 length_high)
{
struct _WapiHandle_file *file_handle;
struct _WapiHandlePrivate_file *file_private_handle;
gboolean ok;
off_t offset, length;
- gpointer handle = _wapi_handle_fd_offset_to_handle (fd_handle);
-
- if (handle == NULL) {
- SetLastError (ERROR_INVALID_HANDLE);
- return(FALSE);
- }
ok = _wapi_lookup_handle (handle, WAPI_HANDLE_FILE,
(gpointer *)&file_handle,
diff --git a/mono/io-layer/mutexes.c b/mono/io-layer/mutexes.c
index ee10921578a..ee736aac2c2 100644
--- a/mono/io-layer/mutexes.c
+++ b/mono/io-layer/mutexes.c
@@ -23,8 +23,9 @@
#undef DEBUG
/* This is used to serialise mutex creation when names are given
+ * (FIXME: make it process-shared)
*/
-static mono_mutex_t named_mutex_mutex;
+static mono_mutex_t named_mutex_mutex = MONO_MUTEX_INITIALIZER;
static void mutex_close_shared (gpointer handle);
static void mutex_signal(gpointer handle);
@@ -43,23 +44,6 @@ static mono_once_t mutex_ops_once=MONO_ONCE_INIT;
static void mutex_ops_init (void)
{
- int thr_ret;
-#if defined(_POSIX_THREAD_PROCESS_SHARED) && _POSIX_THREAD_PROCESS_SHARED != -1
- pthread_mutexattr_t mutex_shared_attr;
-
- thr_ret = mono_mutexattr_init (&mutex_shared_attr);
- g_assert (thr_ret == 0);
-
- thr_ret = mono_mutexattr_setpshared (&mutex_shared_attr,
- PTHREAD_PROCESS_SHARED);
- g_assert (thr_ret == 0);
-
- thr_ret = mono_mutex_init (&named_mutex_mutex, &mutex_shared_attr);
- g_assert (thr_ret == 0);
-#else
- thr_ret = mono_mutex_init (&named_mutex_mutex, NULL);
-#endif
-
_wapi_handle_register_capabilities (WAPI_HANDLE_MUTEX,
WAPI_HANDLE_CAP_WAIT |
WAPI_HANDLE_CAP_SIGNAL |
diff --git a/mono/io-layer/sockets.c b/mono/io-layer/sockets.c
index 25f165763ea..3f48f02af8e 100644
--- a/mono/io-layer/sockets.c
+++ b/mono/io-layer/sockets.c
@@ -97,9 +97,6 @@ static void socket_close_private (gpointer handle)
g_ptr_array_remove_fast(sockets, GUINT_TO_POINTER (handle));
- /* Blank out the mapping, to make catching errors easier */
- _wapi_handle_fd_offset_store (socket_private_handle->fd, NULL);
-
do {
ret=close(socket_private_handle->fd);
}
@@ -208,27 +205,20 @@ int WSAGetLastError(void)
return(err);
}
-int closesocket(guint32 fd_handle)
+int closesocket(guint32 handle)
{
- gpointer handle = _wapi_handle_fd_offset_to_handle (GUINT_TO_POINTER (fd_handle));
-
- if (handle == NULL ||
- _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
- WSASetLastError (WSAENOTSOCK);
- return(0);
- }
-
- _wapi_handle_unref (handle);
+ _wapi_handle_unref (GUINT_TO_POINTER (handle));
return(0);
}
-guint32 _wapi_accept(guint32 fd, struct sockaddr *addr, socklen_t *addrlen)
+guint32 _wapi_accept(guint32 handle, struct sockaddr *addr,
+ socklen_t *addrlen)
{
+ struct _WapiHandlePrivate_socket *socket_private_handle;
struct _WapiHandlePrivate_socket *new_socket_private_handle;
- gpointer handle = _wapi_handle_fd_offset_to_handle (GUINT_TO_POINTER (fd));
gpointer new_handle;
gboolean ok;
- int new_fd;
+ int fd;
int thr_ret;
guint32 ret = INVALID_SOCKET;
@@ -237,18 +227,21 @@ guint32 _wapi_accept(guint32 fd, struct sockaddr *addr, socklen_t *addrlen)
return(INVALID_SOCKET);
}
- if (handle == NULL ||
- _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
+ ok=_wapi_lookup_handle (GUINT_TO_POINTER (handle), WAPI_HANDLE_SOCKET,
+ NULL, (gpointer *)&socket_private_handle);
+ if(ok==FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up socket handle 0x%x", handle);
WSASetLastError(WSAENOTSOCK);
return(INVALID_SOCKET);
}
do {
- new_fd=accept(fd, addr, addrlen);
+ fd=accept(socket_private_handle->fd, addr, addrlen);
}
- while (new_fd==-1 && errno==EINTR && !_wapi_thread_cur_apc_pending());
+ while (fd==-1 && errno==EINTR && !_wapi_thread_cur_apc_pending());
- if(new_fd==-1) {
+ if(fd==-1) {
gint errnum = errno;
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION ": accept error: %s",
@@ -261,23 +254,10 @@ guint32 _wapi_accept(guint32 fd, struct sockaddr *addr, socklen_t *addrlen)
return(INVALID_SOCKET);
}
- if (new_fd >= _wapi_fd_offset_table_size) {
-#ifdef DEBUG
- g_message (G_GNUC_PRETTY_FUNCTION ": File descriptor is too big");
-#endif
-
- WSASetLastError (WSASYSCALLFAILURE);
-
- close (new_fd);
-
- return(INVALID_SOCKET);
- }
-
new_handle=_wapi_handle_new (WAPI_HANDLE_SOCKET);
if(new_handle==_WAPI_HANDLE_INVALID) {
g_warning (G_GNUC_PRETTY_FUNCTION
": error creating socket handle");
- WSASetLastError (ERROR_GEN_FAILURE);
return(INVALID_SOCKET);
}
@@ -290,15 +270,12 @@ guint32 _wapi_accept(guint32 fd, struct sockaddr *addr, socklen_t *addrlen)
(gpointer *)&new_socket_private_handle);
if(ok==FALSE) {
g_warning (G_GNUC_PRETTY_FUNCTION
- ": error looking up new socket handle %p",
- new_handle);
+ ": error looking up socket handle 0x%x", handle);
goto cleanup;
}
-
- _wapi_handle_fd_offset_store (new_fd, new_handle);
- ret = new_fd;
+ ret = GPOINTER_TO_UINT (new_handle);
- new_socket_private_handle->fd=new_fd;
+ new_socket_private_handle->fd=fd;
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION
@@ -314,23 +291,27 @@ cleanup:
return(ret);
}
-int _wapi_bind(guint32 fd, struct sockaddr *my_addr, socklen_t addrlen)
+int _wapi_bind(guint32 handle, struct sockaddr *my_addr, socklen_t addrlen)
{
- gpointer handle = _wapi_handle_fd_offset_to_handle (GUINT_TO_POINTER (fd));
+ struct _WapiHandlePrivate_socket *socket_private_handle;
+ gboolean ok;
int ret;
if(startup_count==0) {
WSASetLastError(WSANOTINITIALISED);
return(SOCKET_ERROR);
}
-
- if (handle == NULL ||
- _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
+
+ ok=_wapi_lookup_handle (GUINT_TO_POINTER (handle), WAPI_HANDLE_SOCKET,
+ NULL, (gpointer *)&socket_private_handle);
+ if(ok==FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up socket handle 0x%x", handle);
WSASetLastError(WSAENOTSOCK);
return(SOCKET_ERROR);
}
- ret=bind(fd, my_addr, addrlen);
+ ret=bind(socket_private_handle->fd, my_addr, addrlen);
if(ret==-1) {
gint errnum = errno;
#ifdef DEBUG
@@ -345,10 +326,11 @@ int _wapi_bind(guint32 fd, struct sockaddr *my_addr, socklen_t addrlen)
return(ret);
}
-int _wapi_connect(guint32 fd, const struct sockaddr *serv_addr,
+int _wapi_connect(guint32 handle, const struct sockaddr *serv_addr,
socklen_t addrlen)
{
- gpointer handle = _wapi_handle_fd_offset_to_handle (GUINT_TO_POINTER (fd));
+ struct _WapiHandlePrivate_socket *socket_private_handle;
+ gboolean ok;
int ret;
gint errnum;
@@ -357,14 +339,17 @@ int _wapi_connect(guint32 fd, const struct sockaddr *serv_addr,
return(SOCKET_ERROR);
}
- if (handle == NULL ||
- _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
+ ok=_wapi_lookup_handle (GUINT_TO_POINTER (handle), WAPI_HANDLE_SOCKET,
+ NULL, (gpointer *)&socket_private_handle);
+ if(ok==FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up socket handle 0x%x", handle);
WSASetLastError(WSAENOTSOCK);
return(SOCKET_ERROR);
}
do {
- ret=connect(fd, serv_addr, addrlen);
+ ret=connect(socket_private_handle->fd, serv_addr, addrlen);
}
while (ret==-1 && errno==EINTR && !_wapi_thread_cur_apc_pending());
@@ -376,11 +361,11 @@ int _wapi_connect(guint32 fd, const struct sockaddr *serv_addr,
errnum = errno;
- ret=setsockopt (fd, SOL_SOCKET, SO_BROADCAST, &true,
- sizeof(true));
+ ret=setsockopt (socket_private_handle->fd, SOL_SOCKET,
+ SO_BROADCAST, &true, sizeof(true));
if(ret==0) {
do {
- ret=connect (fd, serv_addr, addrlen);
+ ret=connect (socket_private_handle->fd, serv_addr, addrlen);
}
while (ret==-1 && errno==EINTR && !_wapi_thread_cur_apc_pending());
}
@@ -401,9 +386,11 @@ int _wapi_connect(guint32 fd, const struct sockaddr *serv_addr,
return(ret);
}
-int _wapi_getpeername(guint32 fd, struct sockaddr *name, socklen_t *namelen)
+int _wapi_getpeername(guint32 handle, struct sockaddr *name,
+ socklen_t *namelen)
{
- gpointer handle = _wapi_handle_fd_offset_to_handle (GUINT_TO_POINTER (fd));
+ struct _WapiHandlePrivate_socket *socket_private_handle;
+ gboolean ok;
int ret;
if(startup_count==0) {
@@ -411,13 +398,16 @@ int _wapi_getpeername(guint32 fd, struct sockaddr *name, socklen_t *namelen)
return(SOCKET_ERROR);
}
- if (handle == NULL ||
- _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
+ ok=_wapi_lookup_handle (GUINT_TO_POINTER (handle), WAPI_HANDLE_SOCKET,
+ NULL, (gpointer *)&socket_private_handle);
+ if(ok==FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up socket handle 0x%x", handle);
WSASetLastError(WSAENOTSOCK);
return(SOCKET_ERROR);
}
- ret=getpeername(fd, name, namelen);
+ ret=getpeername(socket_private_handle->fd, name, namelen);
if(ret==-1) {
gint errnum = errno;
#ifdef DEBUG
@@ -434,9 +424,11 @@ int _wapi_getpeername(guint32 fd, struct sockaddr *name, socklen_t *namelen)
return(ret);
}
-int _wapi_getsockname(guint32 fd, struct sockaddr *name, socklen_t *namelen)
+int _wapi_getsockname(guint32 handle, struct sockaddr *name,
+ socklen_t *namelen)
{
- gpointer handle = _wapi_handle_fd_offset_to_handle (GUINT_TO_POINTER (fd));
+ struct _WapiHandlePrivate_socket *socket_private_handle;
+ gboolean ok;
int ret;
if(startup_count==0) {
@@ -444,13 +436,16 @@ int _wapi_getsockname(guint32 fd, struct sockaddr *name, socklen_t *namelen)
return(SOCKET_ERROR);
}
- if (handle == NULL ||
- _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
+ ok=_wapi_lookup_handle (GUINT_TO_POINTER (handle), WAPI_HANDLE_SOCKET,
+ NULL, (gpointer *)&socket_private_handle);
+ if(ok==FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up socket handle 0x%x", handle);
WSASetLastError(WSAENOTSOCK);
return(SOCKET_ERROR);
}
- ret=getsockname(fd, name, namelen);
+ ret=getsockname(socket_private_handle->fd, name, namelen);
if(ret==-1) {
gint errnum = errno;
#ifdef DEBUG
@@ -467,10 +462,11 @@ int _wapi_getsockname(guint32 fd, struct sockaddr *name, socklen_t *namelen)
return(ret);
}
-int _wapi_getsockopt(guint32 fd, int level, int optname, void *optval,
+int _wapi_getsockopt(guint32 handle, int level, int optname, void *optval,
socklen_t *optlen)
{
- gpointer handle = _wapi_handle_fd_offset_to_handle (GUINT_TO_POINTER (fd));
+ struct _WapiHandlePrivate_socket *socket_private_handle;
+ gboolean ok;
int ret;
if(startup_count==0) {
@@ -478,13 +474,17 @@ int _wapi_getsockopt(guint32 fd, int level, int optname, void *optval,
return(SOCKET_ERROR);
}
- if (handle == NULL ||
- _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
+ ok=_wapi_lookup_handle (GUINT_TO_POINTER (handle), WAPI_HANDLE_SOCKET,
+ NULL, (gpointer *)&socket_private_handle);
+ if(ok==FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up socket handle 0x%x", handle);
WSASetLastError(WSAENOTSOCK);
return(SOCKET_ERROR);
}
- ret=getsockopt(fd, level, optname, optval, optlen);
+ ret=getsockopt(socket_private_handle->fd, level, optname, optval,
+ optlen);
if(ret==-1) {
gint errnum = errno;
#ifdef DEBUG
@@ -501,9 +501,10 @@ int _wapi_getsockopt(guint32 fd, int level, int optname, void *optval,
return(ret);
}
-int _wapi_listen(guint32 fd, int backlog)
+int _wapi_listen(guint32 handle, int backlog)
{
- gpointer handle = _wapi_handle_fd_offset_to_handle (GUINT_TO_POINTER (fd));
+ struct _WapiHandlePrivate_socket *socket_private_handle;
+ gboolean ok;
int ret;
if(startup_count==0) {
@@ -511,13 +512,16 @@ int _wapi_listen(guint32 fd, int backlog)
return(SOCKET_ERROR);
}
- if (handle == NULL ||
- _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
+ ok=_wapi_lookup_handle (GUINT_TO_POINTER (handle), WAPI_HANDLE_SOCKET,
+ NULL, (gpointer *)&socket_private_handle);
+ if(ok==FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up socket handle 0x%x", handle);
WSASetLastError(WSAENOTSOCK);
return(SOCKET_ERROR);
}
- ret=listen(fd, backlog);
+ ret=listen(socket_private_handle->fd, backlog);
if(ret==-1) {
gint errnum = errno;
#ifdef DEBUG
@@ -534,18 +538,19 @@ int _wapi_listen(guint32 fd, int backlog)
return(0);
}
-int _wapi_recv(guint32 fd, void *buf, size_t len, int recv_flags)
+int _wapi_recv(guint32 handle, void *buf, size_t len, int recv_flags)
{
- return(_wapi_recvfrom(fd, buf, len, recv_flags, NULL, 0));
+ return(_wapi_recvfrom(handle, buf, len, recv_flags, NULL, 0));
}
-int _wapi_recvfrom(guint32 fd, void *buf, size_t len, int recv_flags,
+int _wapi_recvfrom(guint32 handle, void *buf, size_t len, int recv_flags,
struct sockaddr *from, socklen_t *fromlen)
{
#ifndef HAVE_MSG_NOSIGNAL
void (*old_sigpipe)(int); // old SIGPIPE handler
#endif
- gpointer handle = _wapi_handle_fd_offset_to_handle (GUINT_TO_POINTER (fd));
+ struct _WapiHandlePrivate_socket *socket_private_handle;
+ gboolean ok;
int ret;
if(startup_count==0) {
@@ -553,22 +558,26 @@ int _wapi_recvfrom(guint32 fd, void *buf, size_t len, int recv_flags,
return(SOCKET_ERROR);
}
- if (handle == NULL ||
- _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
+ ok=_wapi_lookup_handle (GUINT_TO_POINTER (handle), WAPI_HANDLE_SOCKET,
+ NULL, (gpointer *)&socket_private_handle);
+ if(ok==FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up socket handle 0x%x", handle);
WSASetLastError(WSAENOTSOCK);
return(SOCKET_ERROR);
}
#ifdef HAVE_MSG_NOSIGNAL
do {
- ret=recvfrom(fd, buf, len, recv_flags | MSG_NOSIGNAL, from,
+ ret=recvfrom(socket_private_handle->fd, buf, len, recv_flags | MSG_NOSIGNAL, from,
fromlen);
}
while (ret==-1 && errno==EINTR && !_wapi_thread_cur_apc_pending());
#else
old_sigpipe = signal(SIGPIPE, SIG_IGN);
do {
- ret=recvfrom(fd, buf, len, recv_flags, from, fromlen);
+ ret=recvfrom(socket_private_handle->fd, buf, len, recv_flags, from,
+ fromlen);
}
while (ret==-1 && errno==EINTR && !_wapi_thread_cur_apc_pending());
signal(SIGPIPE, old_sigpipe);
@@ -589,12 +598,13 @@ int _wapi_recvfrom(guint32 fd, void *buf, size_t len, int recv_flags,
return(ret);
}
-int _wapi_send(guint32 fd, const void *msg, size_t len, int send_flags)
+int _wapi_send(guint32 handle, const void *msg, size_t len, int send_flags)
{
#ifndef HAVE_MSG_NOSIGNAL
void (*old_sigpipe)(int); // old SIGPIPE handler
#endif
- gpointer handle = _wapi_handle_fd_offset_to_handle (GUINT_TO_POINTER (fd));
+ struct _WapiHandlePrivate_socket *socket_private_handle;
+ gboolean ok;
int ret;
if(startup_count==0) {
@@ -602,21 +612,24 @@ int _wapi_send(guint32 fd, const void *msg, size_t len, int send_flags)
return(SOCKET_ERROR);
}
- if (handle == NULL ||
- _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
+ ok=_wapi_lookup_handle (GUINT_TO_POINTER (handle), WAPI_HANDLE_SOCKET,
+ NULL, (gpointer *)&socket_private_handle);
+ if(ok==FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up socket handle 0x%x", handle);
WSASetLastError(WSAENOTSOCK);
return(SOCKET_ERROR);
}
#ifdef HAVE_MSG_NOSIGNAL
do {
- ret=send(fd, msg, len, send_flags | MSG_NOSIGNAL);
+ ret=send(socket_private_handle->fd, msg, len, send_flags | MSG_NOSIGNAL);
}
while (ret==-1 && errno==EINTR && !_wapi_thread_cur_apc_pending());
#else
old_sigpipe = signal(SIGPIPE, SIG_IGN);
do {
- ret=send(fd, msg, len, send_flags);
+ ret=send(socket_private_handle->fd, msg, len, send_flags);
}
while (ret==-1 && errno==EINTR && !_wapi_thread_cur_apc_pending());
signal(SIGPIPE, old_sigpipe);
@@ -636,13 +649,14 @@ int _wapi_send(guint32 fd, const void *msg, size_t len, int send_flags)
return(ret);
}
-int _wapi_sendto(guint32 fd, const void *msg, size_t len, int send_flags,
+int _wapi_sendto(guint32 handle, const void *msg, size_t len, int send_flags,
const struct sockaddr *to, socklen_t tolen)
{
#ifndef HAVE_MSG_NOSIGNAL
void (*old_sigpipe)(int); // old SIGPIPE handler
#endif
- gpointer handle = _wapi_handle_fd_offset_to_handle (GUINT_TO_POINTER (fd));
+ struct _WapiHandlePrivate_socket *socket_private_handle;
+ gboolean ok;
int ret;
if(startup_count==0) {
@@ -650,21 +664,24 @@ int _wapi_sendto(guint32 fd, const void *msg, size_t len, int send_flags,
return(SOCKET_ERROR);
}
- if (handle == NULL ||
- _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
+ ok=_wapi_lookup_handle (GUINT_TO_POINTER (handle), WAPI_HANDLE_SOCKET,
+ NULL, (gpointer *)&socket_private_handle);
+ if(ok==FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up socket handle 0x%x", handle);
WSASetLastError(WSAENOTSOCK);
return(SOCKET_ERROR);
}
#ifdef HAVE_MSG_NOSIGNAL
do {
- ret=sendto(fd, msg, len, send_flags | MSG_NOSIGNAL, to, tolen);
+ ret=sendto(socket_private_handle->fd, msg, len, send_flags | MSG_NOSIGNAL, to, tolen);
}
while (ret==-1 && errno==EINTR && !_wapi_thread_cur_apc_pending());
#else
old_sigpipe = signal(SIGPIPE, SIG_IGN);
do {
- ret=sendto(fd, msg, len, send_flags, to, tolen);
+ ret=sendto(socket_private_handle->fd, msg, len, send_flags, to, tolen);
}
while (ret==-1 && errno==EINTR && !_wapi_thread_cur_apc_pending());
signal(SIGPIPE, old_sigpipe);
@@ -684,10 +701,11 @@ int _wapi_sendto(guint32 fd, const void *msg, size_t len, int send_flags,
return(ret);
}
-int _wapi_setsockopt(guint32 fd, int level, int optname,
+int _wapi_setsockopt(guint32 handle, int level, int optname,
const void *optval, socklen_t optlen)
{
- gpointer handle = _wapi_handle_fd_offset_to_handle (GUINT_TO_POINTER (fd));
+ struct _WapiHandlePrivate_socket *socket_private_handle;
+ gboolean ok;
int ret;
if(startup_count==0) {
@@ -695,13 +713,17 @@ int _wapi_setsockopt(guint32 fd, int level, int optname,
return(SOCKET_ERROR);
}
- if (handle == NULL ||
- _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
+ ok=_wapi_lookup_handle (GUINT_TO_POINTER (handle), WAPI_HANDLE_SOCKET,
+ NULL, (gpointer *)&socket_private_handle);
+ if(ok==FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up socket handle 0x%x", handle);
WSASetLastError(WSAENOTSOCK);
return(SOCKET_ERROR);
}
- ret=setsockopt(fd, level, optname, optval, optlen);
+ ret=setsockopt(socket_private_handle->fd, level, optname, optval,
+ optlen);
if(ret==-1) {
gint errnum = errno;
#ifdef DEBUG
@@ -718,9 +740,10 @@ int _wapi_setsockopt(guint32 fd, int level, int optname,
return(ret);
}
-int _wapi_shutdown(guint32 fd, int how)
+int _wapi_shutdown(guint32 handle, int how)
{
- gpointer handle = _wapi_handle_fd_offset_to_handle (GUINT_TO_POINTER (fd));
+ struct _WapiHandlePrivate_socket *socket_private_handle;
+ gboolean ok;
int ret;
if(startup_count==0) {
@@ -728,13 +751,16 @@ int _wapi_shutdown(guint32 fd, int how)
return(SOCKET_ERROR);
}
- if (handle == NULL ||
- _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
+ ok=_wapi_lookup_handle (GUINT_TO_POINTER (handle), WAPI_HANDLE_SOCKET,
+ NULL, (gpointer *)&socket_private_handle);
+ if(ok==FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up socket handle 0x%x", handle);
WSASetLastError(WSAENOTSOCK);
return(SOCKET_ERROR);
}
- ret=shutdown(fd, how);
+ ret=shutdown(socket_private_handle->fd, how);
if(ret==-1) {
gint errnum = errno;
#ifdef DEBUG
@@ -776,18 +802,6 @@ guint32 _wapi_socket(int domain, int type, int protocol, void *unused, guint32 u
return(INVALID_SOCKET);
}
-
- if (fd >= _wapi_fd_offset_table_size) {
-#ifdef DEBUG
- g_message (G_GNUC_PRETTY_FUNCTION ": File descriptor is too big");
-#endif
-
- WSASetLastError (WSASYSCALLFAILURE);
- close (fd);
-
- return(INVALID_SOCKET);
- }
-
mono_once (&socket_ops_once, socket_ops_init);
@@ -810,9 +824,7 @@ guint32 _wapi_socket(int domain, int type, int protocol, void *unused, guint32 u
": error looking up socket handle %p", handle);
goto cleanup;
}
-
- _wapi_handle_fd_offset_store (fd, handle);
- ret = fd;
+ ret = GPOINTER_TO_UINT (handle);
socket_private_handle->fd=fd;
@@ -872,12 +884,13 @@ struct hostent *_wapi_gethostbyname(const char *hostname)
}
int
-WSAIoctl (guint32 fd, gint32 command,
- gchar *input, gint i_len,
- gchar *output, gint o_len, glong *written,
- void *unused1, void *unused2)
+WSAIoctl (guint32 handle, gint32 command,
+ gchar *input, gint i_len,
+ gchar *output, gint o_len, glong *written,
+ void *unused1, void *unused2)
{
- gpointer handle = _wapi_handle_fd_offset_to_handle (GUINT_TO_POINTER (fd));
+ struct _WapiHandlePrivate_socket *socket_private_handle;
+ gboolean ok;
int ret;
gchar *buffer = NULL;
@@ -886,8 +899,12 @@ WSAIoctl (guint32 fd, gint32 command,
return(SOCKET_ERROR);
}
- if (handle == NULL ||
- _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
+ ok = _wapi_lookup_handle (GUINT_TO_POINTER (handle), WAPI_HANDLE_SOCKET,
+ NULL, (gpointer *)&socket_private_handle);
+
+ if (ok == FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up socket handle 0x%x", handle);
WSASetLastError (WSAENOTSOCK);
return SOCKET_ERROR;
}
@@ -895,7 +912,7 @@ WSAIoctl (guint32 fd, gint32 command,
if (i_len > 0)
buffer = g_memdup (input, i_len);
- ret = ioctl (fd, command, buffer);
+ ret = ioctl (socket_private_handle->fd, command, buffer);
if (ret == -1) {
gint errnum = errno;
#ifdef DEBUG
@@ -924,9 +941,10 @@ WSAIoctl (guint32 fd, gint32 command,
return 0;
}
-int ioctlsocket(guint32 fd, gint32 command, gpointer arg)
+int ioctlsocket(guint32 handle, gint32 command, gpointer arg)
{
- gpointer handle = _wapi_handle_fd_offset_to_handle (GUINT_TO_POINTER (fd));
+ struct _WapiHandlePrivate_socket *socket_private_handle;
+ gboolean ok;
int ret;
if(startup_count==0) {
@@ -934,8 +952,11 @@ int ioctlsocket(guint32 fd, gint32 command, gpointer arg)
return(SOCKET_ERROR);
}
- if (handle == NULL ||
- _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
+ ok=_wapi_lookup_handle (GUINT_TO_POINTER (handle), WAPI_HANDLE_SOCKET,
+ NULL, (gpointer *)&socket_private_handle);
+ if(ok==FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up socket handle 0x%x", handle);
WSASetLastError(WSAENOTSOCK);
return(SOCKET_ERROR);
}
@@ -955,19 +976,19 @@ int ioctlsocket(guint32 fd, gint32 command, gpointer arg)
* connect to return EINPROGRESS, but the ioctl doesn't seem to)
*/
if(command==FIONBIO) {
- ret=fcntl(fd, F_GETFL, 0);
+ ret=fcntl(socket_private_handle->fd, F_GETFL, 0);
if(ret!=-1) {
if(*(gboolean *)arg) {
ret &= ~O_NONBLOCK;
} else {
ret |= O_NONBLOCK;
}
- ret=fcntl(fd, F_SETFL, ret);
+ ret=fcntl(socket_private_handle->fd, F_SETFL, ret);
}
} else
#endif /* O_NONBLOCK */
{
- ret=ioctl(fd, command, arg);
+ ret=ioctl(socket_private_handle->fd, command, arg);
}
if(ret==-1) {
gint errnum = errno;
@@ -1015,43 +1036,55 @@ int _wapi_select(int nfds G_GNUC_UNUSED, fd_set *readfds, fd_set *writefds,
return(ret);
}
-void _wapi_FD_CLR(guint32 fd, fd_set *set)
+void _wapi_FD_CLR(guint32 handle, fd_set *set)
{
- gpointer handle = _wapi_handle_fd_offset_to_handle (GUINT_TO_POINTER (fd));
+ struct _WapiHandlePrivate_socket *socket_private_handle;
+ gboolean ok;
- if (handle == NULL ||
- _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
+ ok=_wapi_lookup_handle (GUINT_TO_POINTER (handle), WAPI_HANDLE_SOCKET,
+ NULL, (gpointer *)&socket_private_handle);
+ if(ok==FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up socket handle 0x%x", handle);
WSASetLastError(WSAENOTSOCK);
return;
}
- FD_CLR(fd, set);
+ FD_CLR(socket_private_handle->fd, set);
}
-int _wapi_FD_ISSET(guint32 fd, fd_set *set)
+int _wapi_FD_ISSET(guint32 handle, fd_set *set)
{
- gpointer handle = _wapi_handle_fd_offset_to_handle (GUINT_TO_POINTER (fd));
+ struct _WapiHandlePrivate_socket *socket_private_handle;
+ gboolean ok;
- if (handle == NULL ||
- _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
+ ok=_wapi_lookup_handle (GUINT_TO_POINTER (handle), WAPI_HANDLE_SOCKET,
+ NULL, (gpointer *)&socket_private_handle);
+ if(ok==FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up socket handle 0x%x", handle);
WSASetLastError(WSAENOTSOCK);
return(0);
}
- return(FD_ISSET(fd, set));
+ return(FD_ISSET(socket_private_handle->fd, set));
}
-void _wapi_FD_SET(guint32 fd, fd_set *set)
+void _wapi_FD_SET(guint32 handle, fd_set *set)
{
- gpointer handle = _wapi_handle_fd_offset_to_handle (GUINT_TO_POINTER (fd));
+ struct _WapiHandlePrivate_socket *socket_private_handle;
+ gboolean ok;
- if (handle == NULL ||
- _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
+ ok=_wapi_lookup_handle (GUINT_TO_POINTER (handle), WAPI_HANDLE_SOCKET,
+ NULL, (gpointer *)&socket_private_handle);
+ if(ok==FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up socket handle 0x%x", handle);
WSASetLastError(WSAENOTSOCK);
return;
}
- FD_SET(fd, set);
+ FD_SET(socket_private_handle->fd, set);
}
#ifdef USE_AIO
@@ -1086,23 +1119,29 @@ async_notifier (union sigval sig)
}
static gboolean
-do_aio_call (gboolean is_read, gpointer fd_handle, gpointer buffer,
+do_aio_call (gboolean is_read, gpointer handle, gpointer buffer,
guint32 numbytes, guint32 *out_bytes,
gpointer ares,
SocketAsyncCB callback)
{
- gpointer handle = _wapi_handle_fd_offset_to_handle (fd_handle);
- int fd = GPOINTER_TO_UINT (fd_handle);
+ struct _WapiHandlePrivate_socket *socket_private_handle;
+ gboolean ok;
+ int fd;
struct aiocb *aio;
int result;
notifier_data_t *ndata;
- if (handle == NULL ||
- _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
+ ok=_wapi_lookup_handle (GUINT_TO_POINTER (handle), WAPI_HANDLE_SOCKET,
+ NULL, (gpointer *)&socket_private_handle);
+ if (ok == FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up socket handle 0x%x", (guint) handle);
WSASetLastError (WSAENOTSOCK);
return FALSE;
}
+ fd = socket_private_handle->fd;
+
ndata = g_new0 (notifier_data_t, 1);
aio = g_new0 (struct aiocb, 1);
ndata->ares = ares;
diff --git a/mono/io-layer/threads.c b/mono/io-layer/threads.c
index 31c1176a12c..b9ddc6aa3dc 100644
--- a/mono/io-layer/threads.c
+++ b/mono/io-layer/threads.c
@@ -99,7 +99,9 @@ static void thread_close_private (gpointer handle)
thread_handle->thread->id);
#endif
- thread_handle->thread=NULL;
+ if(thread_handle->thread!=NULL) {
+ _wapi_timed_thread_destroy (thread_handle->thread);
+ }
}
static void thread_own (gpointer handle)
@@ -626,10 +628,6 @@ guint32 ResumeThread(gpointer handle)
return(0xFFFFFFFF);
}
- if (thread_private_handle->thread == NULL) {
- return(0xFFFFFFFF);
- }
-
#ifdef WITH_INCLUDED_LIBGC
if (thread_private_handle->thread->suspend_count <= 1)
_wapi_timed_thread_resume (thread_private_handle->thread);
@@ -672,10 +670,6 @@ guint32 SuspendThread(gpointer handle)
return(0xFFFFFFFF);
}
- if (thread_private_handle->thread == NULL) {
- return(0xFFFFFFFF);
- }
-
if (!thread_private_handle->thread->suspend_count) {
if (handle == current)
_wapi_timed_thread_suspend (thread_private_handle->thread);
diff --git a/mono/io-layer/timed-thread.c b/mono/io-layer/timed-thread.c
index 6599e0660f3..c0d737862a2 100644
--- a/mono/io-layer/timed-thread.c
+++ b/mono/io-layer/timed-thread.c
@@ -254,8 +254,6 @@ int _wapi_timed_thread_join(TimedThread *thread, struct timespec *timeout,
if(exitstatus!=NULL) {
*exitstatus = thread->exitstatus;
}
-
- _wapi_timed_thread_destroy (thread);
}
return(result);
}
diff --git a/mono/io-layer/wait.c b/mono/io-layer/wait.c
index a236d17ed3e..e3d07b3a255 100644
--- a/mono/io-layer/wait.c
+++ b/mono/io-layer/wait.c
@@ -354,15 +354,9 @@ static gboolean test_and_own (guint32 numobjects, gpointer *handles,
done = _wapi_handle_count_signalled_handles (numobjects, handles,
waitall, count, lowest);
if (done == TRUE) {
- if (waitall == TRUE) {
- for (i = 0; i < numobjects; i++) {
- if (_wapi_handle_issignalled (handles[i])) {
- _wapi_handle_ops_own (handles[i]);
- }
- }
- } else {
- if (_wapi_handle_issignalled (handles[*lowest])) {
- _wapi_handle_ops_own (handles[*lowest]);
+ for (i = 0; i < numobjects; i++) {
+ if (_wapi_handle_issignalled (handles[i])) {
+ _wapi_handle_ops_own (handles[i]);
}
}
}
diff --git a/mono/io-layer/wapi-private.h b/mono/io-layer/wapi-private.h
index 92e0682288a..59ec8defe30 100644
--- a/mono/io-layer/wapi-private.h
+++ b/mono/io-layer/wapi-private.h
@@ -35,7 +35,7 @@
/* Increment this whenever an incompatible change is made to the
* shared handle structure.
*/
-#define _WAPI_HANDLE_VERSION 3
+#define _WAPI_HANDLE_VERSION 1
typedef enum {
WAPI_HANDLE_UNUSED=0,
@@ -152,7 +152,6 @@ struct _WapiHandleShared_list
{
guchar daemon[MONO_SIZEOF_SUNPATH];
_wapi_daemon_status daemon_running;
- guint32 fd_offset_table_size;
#if defined(_POSIX_THREAD_PROCESS_SHARED) && _POSIX_THREAD_PROCESS_SHARED != -1
mono_mutex_t signal_mutex;
diff --git a/mono/metadata/ChangeLog b/mono/metadata/ChangeLog
index b1069f1191d..03869d5b735 100644
--- a/mono/metadata/ChangeLog
+++ b/mono/metadata/ChangeLog
@@ -1,136 +1,3 @@
-2004-09-07 Zoltan Varga <vargaz@freemail.hu>
-
- * reflection.c (mono_reflection_create_runtime_class): Initialize
- klass->nested_classes. Fixes #61224.
-
-2004-09-06 Zoltan Varga <vargaz@freemail.hu>
-
- * reflection.c (mono_param_get_objects): Initialize the default value
- with DBNull.Value, not null. Fixes #62123.
-
-2004-09-01 Miguel de Icaza <miguel@ximian.com>
-
- * marshal.c (mono_marshal_get_managed_wrapper): Remove FIXME and
- throw an exception with a cute explanation.
-
-2004-09-06 Dick Porter <dick@ximian.com>
-
- * process.c (ves_icall_System_Diagnostics_Process_Start_internal):
- Close the new process's thread handle, as we don't use it. The
- handle stays around forever otherwise.
-
-2004-09-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * assembly.c: provide more information when loading an assembly fails.
-
-2004-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * filewatcher.c: don't expect the development fam package to be
- installed. If HAVE_KQUEUE return mode 3 to use the new kqueue
- watcher. Patch by Geoff Norton.
-
-2004-09-02 Zoltan Varga <vargaz@freemail.hu>
-
- * marshal.c (mono_marshal_alloc): Return a valid pointer on size 0
- as well.
-
-2004-08-28 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * gc.c: actually enable paolo's patch to make GC warnings
- use the trace api.
-
-2004-08-23 Zoltan Varga <vargaz@freemail.hu>
-
- * metadata.c (mono_metadata_parse_type): Alloc pinned, byref and
- custom modifiers to be in any order. Fixes #61990.
-
-Thu Aug 5 17:11:44 CEST 2004 Paolo Molaro <lupus@ximian.com>
-
- * reflection.c: fix to deal with object[] arrays in custom ctors
- (bug #62550).
-
-Tue Aug 3 17:54:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
-
- * gc.c: make GC warning messages use the trace API, they are just
- noise to most of the users.
-
-Tue Aug 3 16:40:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
-
- * gc.c, object.h: mono_gc_handle_*() interface and
- AddrOfPinnedObject fixes. GC handle support even without GC.
-
-Fri Jul 30 16:49:05 CEST 2004 Paolo Molaro <lupus@ximian.com>
-
- * object.c: always create an object if null is passed
- to Invoke() where a valuetype is expected.
-
-2004-07-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * appdomain.c: hack to build correctly the private bin path on windows.
- Fixes bug #61991.
-
-2004-07-28 Dick Porter <dick@ximian.com>
-
- * socket-io.c
- (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal): Check
- returned sockaddr size before creating the remote address object.
- Patch by Nick Vaughan (dev@6wardlaw.freeserve.co.uk), fixes bug
- 61608.
-
-2004-07-28 Dick Porter <dick@ximian.com>
-
- * locales.c (string_invariant_compare_char): Fix invariant char
- compares between upper and lower cases. Fixes bug 61458.
-
-Tue Jul 27 15:58:19 CEST 2004 Paolo Molaro <lupus@ximian.com>
-
- * debug-mono-symfile.c: fix one more endianess issue, from a patch
- by Geoff Norton (<gnorton@customerdna.com>).
-
-Tue Jul 27 15:47:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
-
- * class.c: fix class loads for pointer types (typeof(int) !=
- typeof(int*)).
-
-2004-07-24 Martin Baulig <martin@ximian.com>
-
- * reflection.c (mono_image_get_type_info): Only write a class
- layout entry if we actually have a size or a packing size.
-
-2004-07-13 Peter Williams <peter@newton.cx>
-
- * process.c (complete_path): Make sure we don't attempt to execute
- directories.
-
-2004-07-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * debug-helpers.c: undo my previous patch and fixed the real issue in
- ../mini/exceptions-x86.c
-
-2004-07-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * debug-helpers.c: prevent SIGSEGV. It happened running xsp on monodoc
- when no HOME env. variable was set and a NullRef was thrown in a .cctor
- called from other .cctors.
-
-2004-07-09 Dick Porter <dick@ximian.com>
-
- * locales.c (ves_icall_System_String_InternalReplace_Str_Comp):
- Don't do any more processing if the matched length was 0. It was
- increasing the size of the string before. Fixes bug 61167.
-
-2004-07-09 Dick Porter <dick@ximian.com>
-
- * socket-io.h:
- * socket-io.c
- (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
- Add support for SO_PEERCRED if its available.
-
-2004-07-03 Zoltan Varga <vargaz@freemail.hu>
-
- * marshal.c: Fix managed->native stringbuilder marshalling. Implement
- marshalling of stringbuilder arrays. Fixes #59900.
-
2004-06-29 Martin Baulig <martin@ximian.com>
* mono-debug.c (mono_debug_add_method): Protect the whole function
diff --git a/mono/metadata/appdomain.c b/mono/metadata/appdomain.c
index af00a3510d2..a917a9ecd19 100644
--- a/mono/metadata/appdomain.c
+++ b/mono/metadata/appdomain.c
@@ -547,17 +547,9 @@ reduce_path (const gchar *dirname)
for (tmp = list; tmp; tmp = tmp->next) {
gchar *data = (gchar *) tmp->data;
- if (data && *data) {
-#ifdef PLATFORM_WIN32
- if (result->len == 0)
- g_string_append_printf (result, "%s\\", data);
- else if (result->str [result->len - 1] == '\\')
- g_string_append_printf (result, "%s", data);
- else
-#endif
- g_string_append_printf (result, "%c%s",
- G_DIR_SEPARATOR, data);
- }
+ if (data && *data)
+ g_string_append_printf (result, "%c%s", G_DIR_SEPARATOR,
+ (char *) tmp->data);
}
res = result->str;
diff --git a/mono/metadata/assembly.c b/mono/metadata/assembly.c
index a0ec7467f38..2ae0d0eef7b 100644
--- a/mono/metadata/assembly.c
+++ b/mono/metadata/assembly.c
@@ -388,15 +388,6 @@ mono_assembly_load_references (MonoImage *image, MonoImageOpenStatus *status)
image->name, aname.name);
} else {
- char *extra_msg = g_strdup ("");
-
- if (*status == MONO_IMAGE_ERROR_ERRNO) {
- extra_msg = g_strdup_printf ("System error: %s\n", strerror (errno));
- } else if (*status == MONO_IMAGE_MISSING_ASSEMBLYREF) {
- extra_msg = g_strdup ("Cannot find an assembly referenced from this one.\n");
- } else if (*status == MONO_IMAGE_IMAGE_INVALID) {
- extra_msg = g_strdup ("The file exists but is not a valid assembly.\n");
- }
for (j = 0; j < i; j++)
mono_assembly_close (references [j]);
@@ -405,12 +396,11 @@ mono_assembly_load_references (MonoImage *image, MonoImageOpenStatus *status)
g_warning ("Could not find assembly %s, references from %s (assemblyref_index=%d)\n"
" Major/Minor: %d,%d\n"
" Build: %d,%d\n"
- " Token: %s\n%s",
+ " Token: %s\n",
aname.name, image->name, i,
aname.major, aname.minor, aname.build, aname.revision,
- aname.public_key_token, extra_msg);
+ aname.public_key_token);
*status = MONO_IMAGE_MISSING_ASSEMBLYREF;
- g_free (extra_msg);
return;
}
}
diff --git a/mono/metadata/class.c b/mono/metadata/class.c
index 2814e47d255..7f434b5c734 100644
--- a/mono/metadata/class.c
+++ b/mono/metadata/class.c
@@ -2124,7 +2124,7 @@ mono_class_create_from_typespec (MonoImage *image, guint32 type_spec,
class = mono_array_class_get (type->data.klass, 1);
break;
case MONO_TYPE_PTR:
- class = mono_ptr_class_get (type->data.type);
+ class = mono_class_from_mono_type (type->data.type);
break;
case MONO_TYPE_GENERICINST:
g_assert (type->data.generic_inst->klass);
diff --git a/mono/metadata/debug-mono-symfile.c b/mono/metadata/debug-mono-symfile.c
index 612eb39babf..4f39e6827f1 100644
--- a/mono/metadata/debug-mono-symfile.c
+++ b/mono/metadata/debug-mono-symfile.c
@@ -136,7 +136,7 @@ mono_debug_close_mono_symbol_file (MonoSymbolFile *symfile)
static gchar *
read_string (const char *ptr)
{
- int len = read32 (ptr);
+ int len = *((guint32 *) ptr);
ptr += sizeof(guint32);
return g_filename_from_utf8 (ptr, len, NULL, NULL, NULL);
}
diff --git a/mono/metadata/filewatcher.c b/mono/metadata/filewatcher.c
index 731eb3a1ad2..6210dc6b1f8 100644
--- a/mono/metadata/filewatcher.c
+++ b/mono/metadata/filewatcher.c
@@ -89,26 +89,21 @@ static int (*FAMNextEvent) (gpointer, gpointer);
gint
ves_icall_System_IO_FSW_SupportsFSW (void)
{
-#if HAVE_KQUEUE
- return 3;
-#else
GModule *fam_module;
- gchar *filename;
MONO_ARCH_SAVE_REGS;
- filename = g_module_build_path (NULL, "libfam.so.0");
- fam_module = g_module_open (filename, G_MODULE_BIND_LAZY);
- g_free (filename);
- if (fam_module == NULL)
+ fam_module = g_module_open ("libfam", G_MODULE_BIND_LAZY);
+ if (fam_module == NULL) {
return 0;
+ }
+
g_module_symbol (fam_module, "FAMNextEvent", (gpointer *) &FAMNextEvent);
if (FAMNextEvent == NULL)
return 0;
return 2;
-#endif
}
gpointer
diff --git a/mono/metadata/gc.c b/mono/metadata/gc.c
index 3a9db3a1c62..4695c8c1a2a 100644
--- a/mono/metadata/gc.c
+++ b/mono/metadata/gc.c
@@ -16,7 +16,6 @@
#include <mono/metadata/exception.h>
#include <mono/metadata/domain-internals.h>
#include <mono/metadata/class-internals.h>
-#include <mono/utils/mono-logger.h>
#define GC_I_HIDE_POINTERS
#include <mono/os/gc_wrapper.h>
@@ -348,17 +347,13 @@ ves_icall_System_GCHandle_GetTargetHandle (MonoObject *obj, guint32 handle, gint
/* Indexes start from 1 since 0 means the handle is not allocated */
idx = ++next_handle;
if (idx >= array_size) {
+#if HAVE_BOEHM_GC
gpointer *new_array;
guint8 *new_type_array;
if (!array_size)
array_size = 16;
-#if HAVE_BOEHM_GC
new_array = GC_MALLOC (sizeof (gpointer) * (array_size * 2));
new_type_array = GC_MALLOC (sizeof (guint8) * (array_size * 2));
-#else
- new_array = g_malloc0 (sizeof (gpointer) * (array_size * 2));
- new_type_array = g_malloc0 (sizeof (guint8) * (array_size * 2));
-#endif
if (gc_handles) {
int i;
memcpy (new_array, gc_handles, sizeof (gpointer) * array_size);
@@ -375,22 +370,20 @@ ves_icall_System_GCHandle_GetTargetHandle (MonoObject *obj, guint32 handle, gint
#else
if (((gulong)new_array [i]) & 0x1) {
#endif
-#if HAVE_BOEHM_GC
if (gc_handles [i] != (gpointer)-1)
GC_unregister_disappearing_link (&(gc_handles [i]));
if (new_array [i] != (gpointer)-1)
GC_GENERAL_REGISTER_DISAPPEARING_LINK (&(new_array [i]), REVEAL_POINTER (new_array [i]));
-#endif
}
}
}
array_size *= 2;
-#ifndef HAVE_BOEHM_GC
- g_free (gc_handles);
- g_free (gc_handle_types);
-#endif
gc_handles = new_array;
gc_handle_types = new_type_array;
+#else
+ LeaveCriticalSection (&handle_section);
+ mono_raise_exception (mono_get_exception_execution_engine ("No GCHandle support built-in"));
+#endif
}
/* resuse the type from the old target */
@@ -406,6 +399,9 @@ ves_icall_System_GCHandle_GetTargetHandle (MonoObject *obj, guint32 handle, gint
#if HAVE_BOEHM_GC
if (gc_handles [idx] != (gpointer)-1)
GC_GENERAL_REGISTER_DISAPPEARING_LINK (&(gc_handles [idx]), obj);
+#else
+ LeaveCriticalSection (&handle_section);
+ mono_raise_exception (mono_get_exception_execution_engine ("No weakref support"));
#endif
break;
default:
@@ -433,6 +429,9 @@ ves_icall_System_GCHandle_FreeHandle (guint32 handle)
if (gc_handles [idx] != (gpointer)-1)
GC_unregister_disappearing_link (&(gc_handles [idx]));
}
+#else
+ LeaveCriticalSection (&handle_section);
+ mono_raise_exception (mono_get_exception_execution_engine ("No GCHandle support"));
#endif
gc_handles [idx] = (gpointer)-1;
@@ -458,50 +457,11 @@ ves_icall_System_GCHandle_GetAddrOfPinnedObject (guint32 handle)
if (obj == (MonoObject *) -1)
return NULL;
}
- if (obj) {
- MonoClass *klass = mono_object_class (obj);
- if (klass == mono_defaults.string_class) {
- return mono_string_chars ((MonoString*)obj);
- } else if (klass->rank) {
- return mono_array_addr ((MonoArray*)obj, char, 0);
- } else {
- /* the C# code will check and throw the exception */
- /* FIXME: missing !klass->blittable test, see bug #61134,
- * disabled in 1.0 untill the blittable-using code is audited.
- if ((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_AUTO_LAYOUT)
- return (gpointer)-1; */
- return (char*)obj + sizeof (MonoObject);
- }
- }
+ return obj;
}
return NULL;
}
-guint32
-mono_gchandle_new (MonoObject *obj, gboolean pinned)
-{
- return ves_icall_System_GCHandle_GetTargetHandle (obj, 0, pinned? HANDLE_PINNED: HANDLE_NORMAL);
-}
-
-guint32
-mono_gchandle_new_weakref (MonoObject *obj, gboolean track_resurrection)
-{
- return ves_icall_System_GCHandle_GetTargetHandle (obj, 0, track_resurrection? HANDLE_WEAK_TRACK: HANDLE_WEAK);
-}
-
-/* This will return NULL for a collected object if using a weakref handle */
-MonoObject*
-mono_gchandle_get_target (guint32 gchandle)
-{
- return ves_icall_System_GCHandle_GetTarget (gchandle);
-}
-
-void
-mono_gchandle_free (guint32 gchandle)
-{
- ves_icall_System_GCHandle_FreeHandle (gchandle);
-}
-
#if HAVE_BOEHM_GC
static HANDLE finalizer_event;
@@ -646,12 +606,6 @@ static GCThreadFunctions mono_gc_thread_vtable = {
};
#endif /* WITH_INCLUDED_LIBGC */
-static void
-mono_gc_warning (char *msg, GC_word arg)
-{
- mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_GC, msg, (unsigned long)arg);
-}
-
void mono_gc_init (void)
{
InitializeCriticalSection (&handle_section);
@@ -663,8 +617,6 @@ void mono_gc_init (void)
gc_thread_vtable = &mono_gc_thread_vtable;
#endif
- GC_set_warn_proc (mono_gc_warning);
-
#ifdef ENABLE_FINALIZER_THREAD
if (g_getenv ("GC_DONT_GC")) {
diff --git a/mono/metadata/locales.c b/mono/metadata/locales.c
index 1210965a70a..7c10529f3f3 100644
--- a/mono/metadata/locales.c
+++ b/mono/metadata/locales.c
@@ -25,7 +25,7 @@
#include <locale.h>
-#undef DEBUG
+//#undef DEBUG
static gint32 string_invariant_compare_char (gunichar2 c1, gunichar2 c2,
gint32 options);
@@ -1431,11 +1431,6 @@ MonoString *ves_icall_System_String_InternalReplace_Str_Comp (MonoString *this,
* does match properly...
*/
match_len = usearch_getMatchedLength (search);
-
- if(match_len == 0) {
- continue;
- }
-
match=(UChar *)g_malloc0 (sizeof(UChar) * (match_len + 1));
usearch_getMatchedText (search, match, match_len, &ec);
@@ -1472,11 +1467,6 @@ MonoString *ves_icall_System_String_InternalReplace_Str_Comp (MonoString *this,
pos!=USEARCH_DONE;
pos=usearch_next (search, &ec)) {
match_len = usearch_getMatchedLength (search);
-
- if (match_len == 0) {
- continue;
- }
-
match=(UChar *)g_malloc0 (sizeof(UChar) * (match_len + 1));
usearch_getMatchedText (search, match, match_len, &ec);
@@ -1875,6 +1865,15 @@ static gint32 string_invariant_compare_char (gunichar2 c1, gunichar2 c2,
/* No options. Kana, symbol and spacing options don't
* apply to the invariant culture.
*/
+ if (c1type == G_UNICODE_UPPERCASE_LETTER &&
+ c2type == G_UNICODE_LOWERCASE_LETTER) {
+ return(1);
+ }
+
+ if (c1type == G_UNICODE_LOWERCASE_LETTER &&
+ c2type == G_UNICODE_UPPERCASE_LETTER) {
+ return(-1);
+ }
result = (gint32) c1 - c2;
}
diff --git a/mono/metadata/marshal.c b/mono/metadata/marshal.c
index 97a71e3a56a..e2f384734b9 100644
--- a/mono/metadata/marshal.c
+++ b/mono/metadata/marshal.c
@@ -45,6 +45,9 @@ struct _MonoMethodBuilder {
static void
emit_struct_conv (MonoMethodBuilder *mb, MonoClass *klass, gboolean to_object);
+static gint
+mono_marshal_runtime_glist_find_klass (gconstpointer a, gconstpointer b);
+
static MonoMethod *
mono_find_method_by_name (MonoClass *klass, const char *name, int param_count)
{
@@ -221,20 +224,17 @@ mono_string_builder_to_utf8 (MonoStringBuilder *sb)
{
GError *error = NULL;
glong *res;
- gchar *tmp;
if (!sb)
return NULL;
res = g_malloc0 (mono_stringbuilder_capacity (sb) + 1);
- tmp = g_utf16_to_utf8 (mono_string_chars (sb->str), sb->length, NULL, res, &error);
+ g_utf16_to_utf8 (mono_string_chars (sb->str), sb->length, NULL, res, &error);
if (error) {
g_error_free (error);
mono_raise_exception (mono_get_exception_execution_engine ("Failed to convert StringBuilder from utf16 to utf8"));
}
- else
- memcpy (res, tmp, sb->length + 1);
return res;
}
@@ -1270,52 +1270,6 @@ mono_marshal_get_string_encoding (MonoMethodPInvoke *piinfo, MonoMarshalSpec *sp
}
}
-static MonoMarshalNative
-mono_marshal_get_stringbuilder_to_ptr_encoding (MonoMethodPInvoke *piinfo, MonoMarshalSpec *spec)
-{
- MonoMarshalNative encoding = mono_marshal_get_string_encoding (piinfo, spec);
-
- switch (encoding) {
- case MONO_NATIVE_LPWSTR:
- return MONO_MARSHAL_CONV_SB_LPWSTR;
- break;
- case MONO_NATIVE_LPSTR:
- return MONO_MARSHAL_CONV_SB_LPSTR;
- break;
- case MONO_NATIVE_LPTSTR:
- return MONO_MARSHAL_CONV_SB_LPTSTR;
- break;
- default:
- return -1;
- }
-}
-
-static MonoMarshalNative
-mono_marshal_get_ptr_to_stringbuilder_encoding (MonoMethodPInvoke *piinfo, MonoMarshalSpec *spec, gboolean *need_free)
-{
- MonoMarshalNative encoding = mono_marshal_get_string_encoding (piinfo, spec);
-
- *need_free = TRUE;
-
- switch (encoding) {
- case MONO_NATIVE_LPWSTR:
- /*
- * mono_string_builder_to_utf16 does not allocate a
- * new buffer, so no need to free it.
- */
- *need_free = FALSE;
- return MONO_MARSHAL_CONV_LPWSTR_SB;
- case MONO_NATIVE_LPSTR:
- return MONO_MARSHAL_CONV_LPSTR_SB;
- break;
- case MONO_NATIVE_LPTSTR:
- return MONO_MARSHAL_CONV_LPTSTR_SB;
- break;
- default:
- return -1;
- }
-}
-
static inline MonoMethod*
mono_marshal_find_in_cache (GHashTable *cache, gpointer key)
{
@@ -1665,7 +1619,7 @@ mono_remoting_wrapper (MonoMethod *method, gpointer *params)
}
}
- return mono_runtime_invoke (method, method->klass->valuetype? mono_object_unbox ((MonoObject*)this): this, mparams, NULL);
+ return mono_runtime_invoke (method, method->klass->valuetype? mono_object_unbox (this): this, mparams, NULL);
}
msg = mono_method_call_message_new (method, params, NULL, NULL, NULL);
@@ -2198,19 +2152,6 @@ handle_enum:
return res;
}
-static void
-raise_auto_layout_exception (MonoClass *klass)
-{
- char *msg = g_strdup_printf ("The type `%s.%s' layout needs to be Sequential or Explicit",
- klass->name_space, klass->name, NULL);
-
- MonoException *e = mono_exception_from_name_msg (
- mono_get_corlib (), "System.Runtime.InteropServices",
- "MarshalDirectiveException", msg);
- g_free (msg);
- mono_raise_exception (e);
-}
-
/*
* generates IL code to call managed methods from unmanaged code
*/
@@ -2372,9 +2313,8 @@ mono_marshal_get_managed_wrapper (MonoMethod *method, MonoObject *this, MonoMars
break;
}
- /* The class can not have an automatic layout */
- if ((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_AUTO_LAYOUT)
- raise_auto_layout_exception (klass);
+ /* FIXME: Raise a MarshalDirectiveException here */
+ g_assert ((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) != TYPE_ATTRIBUTE_AUTO_LAYOUT);
if (t->attrs & PARAM_ATTRIBUTE_OUT) {
mono_mb_emit_byte (mb, CEE_LDNULL);
@@ -2636,17 +2576,8 @@ mono_marshal_get_managed_wrapper (MonoMethod *method, MonoObject *this, MonoMars
klass = sig->ret->data.klass;
- if (klass->delegate) {
- mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
- mono_mb_emit_byte (mb, CEE_MONO_FUNC1);
- mono_mb_emit_byte (mb, MONO_MARSHAL_CONV_DEL_FTN);
- mono_mb_emit_byte (mb, CEE_STLOC_3);
- break;
- }
-
- /* The class can not have an automatic layout */
- if ((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_AUTO_LAYOUT)
- raise_auto_layout_exception (klass);
+ /* FIXME: Raise a MarshalDirectiveException here */
+ g_assert ((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) != TYPE_ATTRIBUTE_AUTO_LAYOUT);
mono_mb_emit_byte (mb, CEE_STLOC_0);
/* Check for null */
@@ -3453,22 +3384,31 @@ mono_marshal_get_native_wrapper (MonoMethod *method)
mono_mb_emit_byte (mb, MONO_MARSHAL_CONV_DEL_FTN);
mono_mb_emit_stloc (mb, tmp_locals [i]);
} else if (klass == mono_defaults.stringbuilder_class) {
- MonoMarshalNative encoding = mono_marshal_get_stringbuilder_to_ptr_encoding (piinfo, spec);
+ MonoMarshalNative encoding = mono_marshal_get_string_encoding (piinfo, spec);
g_assert (!t->byref);
mono_mb_emit_ldarg (mb, argnum);
mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
mono_mb_emit_byte (mb, CEE_MONO_FUNC1);
- if (encoding != -1)
- mono_mb_emit_byte (mb, encoding);
- else {
+ switch (encoding) {
+ case MONO_NATIVE_LPWSTR:
+ mono_mb_emit_byte (mb, MONO_MARSHAL_CONV_SB_LPWSTR);
+ break;
+ case MONO_NATIVE_LPSTR:
+ mono_mb_emit_byte (mb, MONO_MARSHAL_CONV_SB_LPSTR);
+ break;
+ case MONO_NATIVE_LPTSTR:
+ mono_mb_emit_byte (mb, MONO_MARSHAL_CONV_SB_LPTSTR);
+ break;
+ default: {
char *msg = g_strdup_printf ("stringbuilder marshalling conversion %d not implemented", encoding);
MonoException *exc = mono_get_exception_not_implemented (msg);
g_warning (msg);
g_free (msg);
mono_raise_exception (exc);
}
+ }
mono_mb_emit_stloc (mb, tmp_locals [i]);
} else {
@@ -3564,13 +3504,10 @@ mono_marshal_get_native_wrapper (MonoMethod *method)
else {
MonoClass *eklass;
guint32 label1, label2, label3;
- int index_var, dest_ptr, esize;
- MonoMarshalNative encoding = mono_marshal_get_stringbuilder_to_ptr_encoding (piinfo, spec);
+ int index_var, dest_ptr;
dest_ptr = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
- eklass = klass->element_class;
-
/* Check null */
mono_mb_emit_ldarg (mb, argnum);
mono_mb_emit_stloc (mb, tmp_locals [i]);
@@ -3579,23 +3516,9 @@ mono_marshal_get_native_wrapper (MonoMethod *method)
label1 = mb->pos;
mono_mb_emit_i4 (mb, 0);
- if (eklass == mono_defaults.stringbuilder_class) {
- if (encoding == -1) {
- char *msg = g_strdup_printf ("stringbuilder marshalling conversion %d not implemented", encoding);
- MonoException *exc = mono_get_exception_not_implemented (msg);
- g_warning (msg);
- g_free (msg);
- mono_raise_exception (exc);
- }
- }
-
- if (eklass == mono_defaults.stringbuilder_class)
- esize = sizeof (gpointer);
- else
- esize = mono_class_native_size (eklass, NULL);
-
/* allocate space for the native struct and store the address */
- mono_mb_emit_icon (mb, esize);
+ eklass = klass->element_class;
+ mono_mb_emit_icon (mb, mono_class_native_size (eklass, NULL));
mono_mb_emit_ldarg (mb, argnum);
mono_mb_emit_byte (mb, CEE_LDLEN);
mono_mb_emit_byte (mb, CEE_MUL);
@@ -3620,34 +3543,22 @@ mono_marshal_get_native_wrapper (MonoMethod *method)
/* Emit marshalling code */
- if (eklass == mono_defaults.stringbuilder_class) {
- mono_mb_emit_ldloc (mb, dest_ptr);
- mono_mb_emit_ldarg (mb, argnum);
- mono_mb_emit_ldloc (mb, index_var);
- mono_mb_emit_byte (mb, CEE_LDELEM_REF);
- mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
- mono_mb_emit_byte (mb, CEE_MONO_FUNC1);
- mono_mb_emit_byte (mb, encoding);
- mono_mb_emit_byte (mb, CEE_STIND_I);
- }
- else {
- /* set the src_ptr */
- mono_mb_emit_ldarg (mb, argnum);
- mono_mb_emit_ldloc (mb, index_var);
- mono_mb_emit_byte (mb, CEE_LDELEMA);
- mono_mb_emit_i4 (mb, mono_mb_add_data (mb, eklass));
- mono_mb_emit_byte (mb, CEE_STLOC_0);
+ /* set the src_ptr */
+ mono_mb_emit_ldarg (mb, argnum);
+ mono_mb_emit_ldloc (mb, index_var);
+ mono_mb_emit_byte (mb, CEE_LDELEMA);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, eklass));
+ mono_mb_emit_byte (mb, CEE_STLOC_0);
- /* set dst_ptr */
- mono_mb_emit_ldloc (mb, dest_ptr);
- mono_mb_emit_byte (mb, CEE_STLOC_1);
+ /* set dst_ptr */
+ mono_mb_emit_ldloc (mb, dest_ptr);
+ mono_mb_emit_byte (mb, CEE_STLOC_1);
- /* emit valuetype conversion code */
- emit_struct_conv (mb, eklass, FALSE);
- }
+ /* emit valuetype conversion code */
+ emit_struct_conv (mb, eklass, FALSE);
mono_mb_emit_add_to_local (mb, index_var, 1);
- mono_mb_emit_add_to_local (mb, dest_ptr, esize);
+ mono_mb_emit_add_to_local (mb, dest_ptr, mono_class_native_size (eklass, NULL));
mono_mb_emit_byte (mb, CEE_BR);
mono_mb_emit_i4 (mb, label2 - (mb->pos + 4));
@@ -4074,20 +3985,33 @@ mono_marshal_get_native_wrapper (MonoMethod *method)
case MONO_TYPE_CLASS:
case MONO_TYPE_OBJECT:
if (t->data.klass == mono_defaults.stringbuilder_class) {
- gboolean need_free;
- MonoMarshalNative encoding;
-
- encoding = mono_marshal_get_ptr_to_stringbuilder_encoding (piinfo, spec, &need_free);
+ MonoMarshalNative encoding = mono_marshal_get_string_encoding (piinfo, spec);
+ gboolean need_free = TRUE;
g_assert (!t->byref);
- g_assert (encoding != -1);
-
mono_mb_emit_ldarg (mb, argnum);
mono_mb_emit_ldloc (mb, tmp_locals [i]);
mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
mono_mb_emit_byte (mb, CEE_MONO_PROC2);
- mono_mb_emit_byte (mb, encoding);
+ switch (encoding) {
+ case MONO_NATIVE_LPWSTR:
+ mono_mb_emit_byte (mb, MONO_MARSHAL_CONV_LPWSTR_SB);
+ /*
+ * mono_string_builder_to_utf16 does not allocate a
+ * new buffer, so no need to free it.
+ */
+ need_free = FALSE;
+ break;
+ case MONO_NATIVE_LPSTR:
+ mono_mb_emit_byte (mb, MONO_MARSHAL_CONV_LPSTR_SB);
+ break;
+ case MONO_NATIVE_LPTSTR:
+ mono_mb_emit_byte (mb, MONO_MARSHAL_CONV_LPTSTR_SB);
+ break;
+ default:
+ g_assert_not_reached ();
+ }
if (need_free) {
mono_mb_emit_ldloc (mb, tmp_locals [i]);
@@ -4202,17 +4126,13 @@ mono_marshal_get_native_wrapper (MonoMethod *method)
}
/* Character arrays are implicitly marshalled as [Out] */
- if ((klass->element_class == mono_defaults.char_class) || (klass->element_class == mono_defaults.stringbuilder_class) || (t->attrs & PARAM_ATTRIBUTE_OUT)) {
+ if ((klass->element_class == mono_defaults.char_class) || (t->attrs & PARAM_ATTRIBUTE_OUT)) {
/* FIXME: Optimize blittable case */
MonoClass *eklass;
guint32 label1, label2, label3;
- int index_var, src_ptr, esize;
+ int index_var, src_ptr;
eklass = klass->element_class;
- if (eklass == mono_defaults.stringbuilder_class)
- esize = sizeof (gpointer);
- else
- esize = mono_class_native_size (eklass, NULL);
src_ptr = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
/* Check null */
@@ -4238,53 +4158,22 @@ mono_marshal_get_native_wrapper (MonoMethod *method)
/* Emit marshalling code */
- if (eklass == mono_defaults.stringbuilder_class) {
- gboolean need_free;
- MonoMarshalNative encoding = mono_marshal_get_ptr_to_stringbuilder_encoding (piinfo, spec, &need_free);
-
- g_assert (encoding != -1);
-
- /* dest */
- mono_mb_emit_ldarg (mb, argnum);
- mono_mb_emit_ldloc (mb, index_var);
- mono_mb_emit_byte (mb, CEE_LDELEM_REF);
-
- /* src */
- mono_mb_emit_ldloc (mb, src_ptr);
- mono_mb_emit_byte (mb, CEE_LDIND_I);
-
- mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
- mono_mb_emit_byte (mb, CEE_MONO_PROC2);
-
- mono_mb_emit_byte (mb, encoding);
-
- if (need_free) {
- /* src */
- mono_mb_emit_ldloc (mb, src_ptr);
- mono_mb_emit_byte (mb, CEE_LDIND_I);
-
- mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
- mono_mb_emit_byte (mb, CEE_MONO_FREE);
- }
- }
- else {
- /* set the src_ptr */
- mono_mb_emit_ldloc (mb, src_ptr);
- mono_mb_emit_byte (mb, CEE_STLOC_0);
+ /* set the src_ptr */
+ mono_mb_emit_ldloc (mb, src_ptr);
+ mono_mb_emit_byte (mb, CEE_STLOC_0);
- /* set dst_ptr */
- mono_mb_emit_ldarg (mb, argnum);
- mono_mb_emit_ldloc (mb, index_var);
- mono_mb_emit_byte (mb, CEE_LDELEMA);
- mono_mb_emit_i4 (mb, mono_mb_add_data (mb, eklass));
- mono_mb_emit_byte (mb, CEE_STLOC_1);
+ /* set dst_ptr */
+ mono_mb_emit_ldarg (mb, argnum);
+ mono_mb_emit_ldloc (mb, index_var);
+ mono_mb_emit_byte (mb, CEE_LDELEMA);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, eklass));
+ mono_mb_emit_byte (mb, CEE_STLOC_1);
- /* emit valuetype conversion code */
- emit_struct_conv (mb, eklass, TRUE);
- }
+ /* emit valuetype conversion code */
+ emit_struct_conv (mb, eklass, TRUE);
mono_mb_emit_add_to_local (mb, index_var, 1);
- mono_mb_emit_add_to_local (mb, src_ptr, esize);
+ mono_mb_emit_add_to_local (mb, src_ptr, mono_class_native_size (eklass, NULL));
mono_mb_emit_byte (mb, CEE_BR);
mono_mb_emit_i4 (mb, label2 - (mb->pos + 4));
@@ -4860,8 +4749,6 @@ mono_marshal_alloc (gpointer size)
{
MONO_ARCH_SAVE_REGS;
- if (size == NULL)
- size = (gpointer)4;
return g_try_malloc ((gulong)size);
}
diff --git a/mono/metadata/metadata.c b/mono/metadata/metadata.c
index 3d44463cde9..88699f3e890 100644
--- a/mono/metadata/metadata.c
+++ b/mono/metadata/metadata.c
@@ -1203,10 +1203,6 @@ mono_metadata_parse_type (MonoImage *m, MonoParseTypeMode mode, short opt_attrs,
{
MonoType *type, *cached;
gboolean byref = FALSE;
- gboolean pinned = FALSE;
- const char *tmp_ptr;
- int count = 0;
- gboolean found;
/*
* According to the spec, custom modifiers should come before the byref
@@ -1216,70 +1212,70 @@ mono_metadata_parse_type (MonoImage *m, MonoParseTypeMode mode, short opt_attrs,
* Also, this type seems to be different from 'object & modopt(...)'. Maybe
* it would be better to treat byref as real type constructor instead of
* a modifier...
- * Also, pinned should come before anything else, but some MSV++ produced
- * assemblies violate this (#bug 61990).
*/
-
- /* Count the modifiers first */
- tmp_ptr = ptr;
- found = TRUE;
- while (found) {
- switch (*tmp_ptr) {
- case MONO_TYPE_PINNED:
- case MONO_TYPE_BYREF:
- ++tmp_ptr;
- break;
- case MONO_TYPE_CMOD_REQD:
- case MONO_TYPE_CMOD_OPT:
- count ++;
- mono_metadata_parse_custom_mod (m, NULL, tmp_ptr, &tmp_ptr);
- break;
- default:
- found = FALSE;
- }
+ if (*ptr == MONO_TYPE_BYREF) {
+ byref = TRUE;
+ ++ptr;
}
- if (count) {
- type = g_malloc0 (sizeof (MonoType) + ((gint32)count - MONO_ZERO_LEN_ARRAY) * sizeof (MonoCustomMod));
- type->num_mods = count;
- if (count > 64)
- g_warning ("got more than 64 modifiers in type");
+ switch (mode) {
+ case MONO_PARSE_MOD_TYPE:
+ case MONO_PARSE_PARAM:
+ case MONO_PARSE_RET:
+ case MONO_PARSE_LOCAL: /* should not have modifiers according to the spec, but ms tools disagree */
+ case MONO_PARSE_FIELD: {
+ /* count the modifiers */
+ const char *tmp_ptr = ptr;
+ int count = 0;
+ while (mono_metadata_parse_custom_mod (m, NULL, tmp_ptr, &tmp_ptr))
+ count++;
+ if (count) {
+ type = g_malloc0 (sizeof (MonoType) + ((gint32)count - MONO_ZERO_LEN_ARRAY) * sizeof (MonoCustomMod));
+ type->num_mods = count;
+ if (count > 64)
+ g_warning ("got more than 64 modifiers in type");
+ /* save them this time */
+ count = 0;
+ while (mono_metadata_parse_custom_mod (m, &(type->modifiers [count]), ptr, &ptr))
+ count++;
+ break;
+ } /* fall through */
}
- else
+ case MONO_PARSE_TYPE:
/*
* Later we can avoid doing this allocation.
*/
type = g_new0 (MonoType, 1);
-
- /* Parse pinned, byref and custom modifiers */
- found = TRUE;
- count = 0;
- while (found) {
- switch (*ptr) {
- case MONO_TYPE_PINNED:
- pinned = TRUE;
- ++ptr;
- break;
- case MONO_TYPE_BYREF:
- byref = TRUE;
- ++ptr;
- break;
- case MONO_TYPE_CMOD_REQD:
- case MONO_TYPE_CMOD_OPT:
- count ++;
- mono_metadata_parse_custom_mod (m, &(type->modifiers [count]), ptr, &ptr);
- break;
- default:
- found = FALSE;
- }
+ break;
+ default:
+ g_assert_not_reached ();
}
type->attrs = opt_attrs;
type->byref = byref;
- type->pinned = pinned ? 1 : 0;
-
- do_mono_metadata_parse_type (type, m, ptr, &ptr);
+ if (mode == MONO_PARSE_LOCAL) {
+ /*
+ * check for pinned flag
+ */
+ if (*ptr == MONO_TYPE_PINNED) {
+ type->pinned = 1;
+ ++ptr;
+ }
+ }
+ switch (*ptr) {
+ case MONO_TYPE_BYREF:
+ if (mode == MONO_PARSE_FIELD)
+ g_warning ("A field type cannot be byref");
+ type->byref = 1;
+ ptr++;
+ /* follow through */
+ default:
+ /*if (*ptr == MONO_TYPE_VOID && mode != MONO_PARSE_RET)
+ g_error ("void not allowed in param");*/
+ do_mono_metadata_parse_type (type, m, ptr, &ptr);
+ break;
+ }
if (rptr)
*rptr = ptr;
diff --git a/mono/metadata/object.c b/mono/metadata/object.c
index 65176ce2435..bdf832baa6d 100644
--- a/mono/metadata/object.c
+++ b/mono/metadata/object.c
@@ -1586,9 +1586,13 @@ mono_runtime_invoke_array (MonoMethod *method, void *obj, MonoArray *params,
case MONO_TYPE_R4:
case MONO_TYPE_R8:
case MONO_TYPE_VALUETYPE:
- /* MS seems to create the objects if a null is passed in */
- if (! ((gpointer *)params->vector)[i])
- ((gpointer*)params->vector)[i] = mono_object_new (mono_domain_get (), mono_class_from_mono_type (sig->params [i]));
+ if (sig->params [i]->byref) {
+ /* MS seems to create the objects if a null is passed in */
+ if (! ((gpointer *)params->vector)[i])
+ ((gpointer*)params->vector)[i] = mono_object_new (mono_domain_get (), mono_class_from_mono_type (sig->params [i]));
+ }
+ else
+ g_assert (((gpointer*)params->vector) [i]);
pa [i] = (char *)(((gpointer *)params->vector)[i]) + sizeof (MonoObject);
break;
case MONO_TYPE_STRING:
diff --git a/mono/metadata/object.h b/mono/metadata/object.h
index 2413cc7a346..c1ffc3c4c2d 100644
--- a/mono/metadata/object.h
+++ b/mono/metadata/object.h
@@ -252,11 +252,5 @@ mono_property_set_value (MonoProperty *prop, void *obj, void **params, MonoObjec
MonoObject*
mono_property_get_value (MonoProperty *prop, void *obj, void **params, MonoObject **exc);
-/* GC handles support */
-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);
-
#endif
diff --git a/mono/metadata/process.c b/mono/metadata/process.c
index 5fa57bcf0ed..5e7cce9de7b 100644
--- a/mono/metadata/process.c
+++ b/mono/metadata/process.c
@@ -738,7 +738,7 @@ complete_path (const gunichar2 *appname, gunichar2 **completed)
return FALSE;
}
- if (g_file_test (utf8app, G_FILE_TEST_IS_EXECUTABLE) && !g_file_test (utf8app, G_FILE_TEST_IS_DIR)) {
+ if (g_file_test (utf8app, G_FILE_TEST_IS_EXECUTABLE)) {
g_free (utf8app);
return FALSE;
}
@@ -875,9 +875,7 @@ MonoBoolean ves_icall_System_Diagnostics_Process_Start_internal (MonoString *app
if(ret) {
process_info->process_handle=procinfo.hProcess;
- /*process_info->thread_handle=procinfo.hThread;*/
- process_info->thread_handle=NULL;
- CloseHandle(procinfo.hThread);
+ process_info->thread_handle=procinfo.hThread;
process_info->pid=procinfo.dwProcessId;
process_info->tid=procinfo.dwThreadId;
} else {
diff --git a/mono/metadata/reflection.c b/mono/metadata/reflection.c
index bf22f1f6d4a..9640136c0eb 100644
--- a/mono/metadata/reflection.c
+++ b/mono/metadata/reflection.c
@@ -2716,8 +2716,7 @@ mono_image_get_type_info (MonoDomain *domain, MonoReflectionTypeBuilder *tb, Mon
* if we have explicitlayout or sequentiallayouts, output data in the
* ClassLayout table.
*/
- if (((tb->attrs & TYPE_ATTRIBUTE_LAYOUT_MASK) != TYPE_ATTRIBUTE_AUTO_LAYOUT) &&
- ((tb->class_size > 0) || (tb->packing_size > 0))) {
+ if (((tb->attrs & TYPE_ATTRIBUTE_LAYOUT_MASK) != TYPE_ATTRIBUTE_AUTO_LAYOUT) && (tb->class_size != -1)) {
table = &assembly->tables [MONO_TABLE_CLASSLAYOUT];
table->rows++;
alloc_table (table, table->rows);
@@ -5257,21 +5256,12 @@ MonoArray*
mono_param_get_objects (MonoDomain *domain, MonoMethod *method)
{
static MonoClass *System_Reflection_ParameterInfo;
- static MonoClassField *dbnull_value_field;
- MonoClass *klass;
MonoArray *res = NULL;
MonoReflectionMethod *member = NULL;
MonoReflectionParameter *param = NULL;
char **names;
int i;
- if (!dbnull_value_field) {
- klass = mono_class_from_name (mono_defaults.corlib, "System", "DBNull");
- mono_class_init (klass);
- dbnull_value_field = mono_class_get_field_from_name (klass, "Value");
- g_assert (dbnull_value_field);
- }
-
if (!System_Reflection_ParameterInfo)
System_Reflection_ParameterInfo = mono_class_from_name (
mono_defaults.corlib, "System.Reflection", "ParameterInfo");
@@ -5293,7 +5283,7 @@ mono_param_get_objects (MonoDomain *domain, MonoMethod *method)
param = (MonoReflectionParameter *)mono_object_new (domain,
System_Reflection_ParameterInfo);
param->ClassImpl = mono_type_get_object (domain, method->signature->params [i]);
- param->DefaultValueImpl = mono_field_get_value_object (domain, dbnull_value_field, NULL); /* FIXME */
+ param->DefaultValueImpl = NULL; /* FIXME */
param->MemberImpl = (MonoObject*)member;
param->NameImpl = mono_string_new (domain, names [i]);
param->PositionImpl = i;
@@ -5878,7 +5868,6 @@ handle_type:
}
break;
case MONO_TYPE_CLASS:
- case MONO_TYPE_OBJECT:
case MONO_TYPE_STRING:
for (i = 0; i < alen; i++) {
MonoObject *item = load_cattr_value (image, &t->data.klass->byval_arg, p, &p);
@@ -7829,7 +7818,6 @@ mono_reflection_create_runtime_class (MonoReflectionTypeBuilder *tb)
{
MonoClass *klass;
MonoReflectionType* res;
- int i;
MONO_ARCH_SAVE_REGS;
@@ -7840,6 +7828,7 @@ mono_reflection_create_runtime_class (MonoReflectionTypeBuilder *tb)
/*
* Fields to set in klass:
* the various flags: delegate/unicode/contextbound etc.
+ * nested_classes
*/
klass->flags = tb->attrs;
@@ -7851,13 +7840,6 @@ mono_reflection_create_runtime_class (MonoReflectionTypeBuilder *tb)
if (!klass->enumtype)
ensure_runtime_vtable (klass);
- if (tb->subtypes) {
- for (i = 0; i < mono_array_length (tb->subtypes); ++i) {
- MonoReflectionTypeBuilder *subtb = mono_array_get (tb->subtypes, MonoReflectionTypeBuilder*, i);
- klass->nested_classes = g_list_prepend (klass->nested_classes, my_mono_class_from_mono_type (subtb->type.type));
- }
- }
-
/* fields and object layout */
if (klass->parent) {
if (!klass->parent->size_inited)
diff --git a/mono/metadata/socket-io.c b/mono/metadata/socket-io.c
index 1ef49278ea9..c2b129984e7 100644
--- a/mono/metadata/socket-io.c
+++ b/mono/metadata/socket-io.c
@@ -330,11 +330,6 @@ static gint32 convert_sockopt_level_and_name(MonoSocketOptionLevel mono_level,
case SocketOptionName_Type:
*system_name = SO_TYPE;
break;
-#ifdef SO_PEERCRED
- case SocketOptionName_PeerCred:
- *system_name = SO_PEERCRED;
- break;
-#endif
case SocketOptionName_ExclusiveAddressUse:
case SocketOptionName_UseLoopback:
case SocketOptionName_MaxConnections:
@@ -1160,15 +1155,7 @@ gint32 ves_icall_System_Net_Sockets_Socket_RecvFrom_internal(SOCKET sock, MonoAr
return(0);
}
- /* If we didn't get a socket size, then we're probably a
- * connected connection-oriented socket and the stack hasn't
- * returned the remote address. All we can do is return null.
- */
- if ( sa_size != 0 )
- *sockaddr=create_object_from_sockaddr(sa, sa_size, error);
- else
- *sockaddr=NULL;
-
+ *sockaddr=create_object_from_sockaddr(sa, sa_size, error);
g_free(sa);
return(ret);
@@ -1441,10 +1428,6 @@ void ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal(SOCKET soc
int lingersize=sizeof(linger);
struct timeval tv;
int tvsize=sizeof(tv);
-#ifdef SO_PEERCRED
- struct ucred cred;
- int credsize = sizeof(cred);
-#endif
MonoDomain *domain=mono_domain_get();
MonoObject *obj;
MonoClass *obj_class;
@@ -1478,13 +1461,6 @@ void ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal(SOCKET soc
&tvsize);
break;
-#ifdef SO_PEERCRED
- case SocketOptionName_PeerCred:
- ret = _wapi_getsockopt (sock, system_level, system_name, &cred,
- &credsize);
- break;
-#endif
-
default:
ret = _wapi_getsockopt (sock, system_level, system_name, &val,
&valsize);
@@ -1524,32 +1500,6 @@ void ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal(SOCKET soc
obj = int_to_object (domain, (tv.tv_sec * 1000) + (tv.tv_usec / 1000));
break;
-#ifdef SO_PEERCRED
- case SocketOptionName_PeerCred:
- {
- /* build a Mono.Posix.PeerCred+PeerCredData if
- * possible
- */
- MonoImage *mono_posix_image = mono_image_loaded ("Mono.Posix");
- MonoPeerCredData *cred_data;
-
- if (mono_posix_image == NULL) {
- *error = WSAENOPROTOOPT;
- return;
- }
-
- obj_class = mono_class_from_name(mono_posix_image,
- "Mono.Posix",
- "PeerCred/PeerCredData");
- obj = mono_object_new(domain, obj_class);
- cred_data = (MonoPeerCredData *)obj;
- cred_data->pid = cred.pid;
- cred_data->uid = cred.uid;
- cred_data->gid = cred.gid;
- break;
- }
-#endif
-
default:
obj = int_to_object (domain, val);
}
diff --git a/mono/metadata/socket-io.h b/mono/metadata/socket-io.h
index 5c2ee72181a..3540882f105 100644
--- a/mono/metadata/socket-io.h
+++ b/mono/metadata/socket-io.h
@@ -130,12 +130,7 @@ typedef enum {
SocketOptionName_BsdUrgent=2,
SocketOptionName_Expedited=2,
SocketOptionName_NoChecksum=1,
- SocketOptionName_ChecksumCoverage=20,
-
- /* This is Mono-specific, keep it in sync with
- * Mono.Posix/PeerCred.cs
- */
- SocketOptionName_PeerCred=10001
+ SocketOptionName_ChecksumCoverage=20
} MonoSocketOptionName;
typedef struct _MonoSocketAsyncResult {
@@ -159,14 +154,6 @@ typedef struct _MonoSocketAsyncResult {
gint error;
} MonoSocketAsyncResult;
-typedef struct
-{
- MonoObject obj;
- gint pid;
- gint uid;
- gint gid;
-} MonoPeerCredData;
-
extern gpointer ves_icall_System_Net_Sockets_Socket_Socket_internal(MonoObject *this, gint32 family, gint32 type, gint32 proto, gint32 *error);
extern void ves_icall_System_Net_Sockets_Socket_Close_internal(SOCKET sock, gint32 *error);
extern gint32 ves_icall_System_Net_Sockets_SocketException_WSAGetLastError_internal(void);
diff --git a/mono/mini/ChangeLog b/mono/mini/ChangeLog
index 297d31ca1af..b7210c3fe9c 100644
--- a/mono/mini/ChangeLog
+++ b/mono/mini/ChangeLog
@@ -1,58 +1,4 @@
-2004-09-02 Zoltan Varga <vargaz@freemail.hu>
- * inssel-long32.brg: Fix OP_LCONV_TO_OVF_I1 rule. Fixes #64578.
-
-2004-08-23 Zoltan Varga <vargaz@freemail.hu>
-
- * inssel-x86.brg inssel-amd64: Add yet another missing tree->dreg assignment.
-
- * mini-x86.c (mono_arch_local_regalloc): Fix bug in long register
- allocation. Fixes #63085.
-
-2004-08-09 Zoltan Varga <vargaz@freemail.hu>
-
- * inssel-x86.brg: Set dreg of LOCALLOC correctly.
-
-Tue Aug 3 11:20:09 CEST 2004 Paolo Molaro <lupus@ximian.com>
-
- * mini-ppc.c: mul.ovf.un exception name fix.
-
-Tue Aug 3 11:19:07 CEST 2004 Paolo Molaro <lupus@ximian.com>
-
- * mini-ppc.c: reg allocator fix.
-
-Tue Aug 3 11:17:07 CEST 2004 Paolo Molaro <lupus@ximian.com>
-
- * mini-ppc.c: make sure temp regs are not used for global reg
- allocation.
-
-Tue Jul 27 16:05:19 CEST 2004 Paolo Molaro <lupus@ximian.com>
-
- * mini-ppc.c, mini-sparc.c, mini-s390.c: keep track of line
- numbers in the debug info (spotted by Geoff Norton,
- <gnorton@customerdna.com>).
-
-Mon Jul 12 17:47:00 CEST 2004 Paolo Molaro <lupus@ximian.com>
-
- * inssel-ppc.brg: arguments on the stack are always
- relative to the stack pointer (spotted by Neale Ferguson).
-
-2004-07-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * exceptions-x86.c: delay appending the method name to the trace until
- after mono_jit_info_table_find is called, as this gets the real
- MonoMethod.
-
-2004-07-08 Zoltan Varga <vargaz@freemail.hu>
-
- * mini.c (handle_stack_args): Handle some corner cases. Fixes
- 58863.
-
-2004-07-05 Zoltan Varga <vargaz@freemail.hu>
-
- * mini.c (optimize_branches): Fix linking of bblocks in branch->branch
- optimization.
-
Mon Jun 28 18:05:09 CEST 2004 Paolo Molaro <lupus@ximian.com>
* mini.c: reinstated mono_compile_get_interface_var()
diff --git a/mono/mini/exceptions-x86.c b/mono/mini/exceptions-x86.c
index c0961c485d2..b0783ae39b1 100644
--- a/mono/mini/exceptions-x86.c
+++ b/mono/mini/exceptions-x86.c
@@ -462,6 +462,9 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls, MonoJitInf
if (!(*lmf)->method)
return (gpointer)-1;
+ if (trace)
+ *trace = g_strdup_printf ("in (unmanaged) %s", mono_method_full_name ((*lmf)->method, TRUE));
+
if ((ji = mono_jit_info_table_find (domain, (gpointer)(*lmf)->eip))) {
*res = *ji;
} else {
@@ -469,9 +472,6 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls, MonoJitInf
res->method = (*lmf)->method;
}
- if (trace)
- *trace = g_strdup_printf ("in (unmanaged) %s", mono_method_full_name (res->method, TRUE));
-
new_ctx->SC_ESI = (*lmf)->esi;
new_ctx->SC_EDI = (*lmf)->edi;
new_ctx->SC_EBX = (*lmf)->ebx;
diff --git a/mono/mini/inssel-long32.brg b/mono/mini/inssel-long32.brg
index e6cf9f681a7..0d1cf077f2d 100644
--- a/mono/mini/inssel-long32.brg
+++ b/mono/mini/inssel-long32.brg
@@ -575,30 +575,15 @@ reg: OP_LCONV_TO_OVF_I1_UN (lreg) {
}
reg: OP_LCONV_TO_OVF_I1 (lreg) {
- MonoInst *is_negative, *end_label;
-
- MONO_NEW_LABEL (s, is_negative);
- MONO_NEW_LABEL (s, end_label);
-
MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->reg2, 0);
MONO_EMIT_NEW_COND_EXC (s, GT, "OverflowException");
MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->reg2, -1);
MONO_EMIT_NEW_COND_EXC (s, LT, "OverflowException");
- MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->reg2, 0);
- MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BLT, is_negative);
-
- /* Positive */
MONO_EMIT_NEW_COMPARE_IMM (s, state->left->reg1, 127);
- MONO_EMIT_NEW_COND_EXC (s, GT_UN, "OverflowException");
- MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BR, end_label);
-
- /* Negative */
- mono_bblock_add_inst (s->cbb, is_negative);
+ MONO_EMIT_NEW_COND_EXC (s, GT, "OverflowException");
MONO_EMIT_NEW_COMPARE_IMM (s, state->left->reg1, -128);
- MONO_EMIT_NEW_COND_EXC (s, LT_UN, "OverflowException");
- mono_bblock_add_inst (s->cbb, end_label);
-
+ MONO_EMIT_NEW_COND_EXC (s, LT, "OverflowException");
MONO_EMIT_UNALU (s, tree, CEE_CONV_I1, state->reg1, state->left->reg1);
}
diff --git a/mono/mini/inssel-ppc.brg b/mono/mini/inssel-ppc.brg
index 38eced8c0dc..a4043e1d797 100644
--- a/mono/mini/inssel-ppc.brg
+++ b/mono/mini/inssel-ppc.brg
@@ -131,7 +131,7 @@ stmt: OP_SETRET (OP_ICONST) {
stmt: OP_OUTARG (reg) {
if (tree->inst_imm) {
- MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG, ppc_r1, tree->inst_imm, state->left->reg1);
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG, s->frame_reg, tree->inst_imm, state->left->reg1);
return;
}
tree->opcode = OP_SETREG;
@@ -142,7 +142,7 @@ stmt: OP_OUTARG (reg) {
stmt: OP_OUTARG (OP_REGVAR) {
if (tree->inst_imm) {
- MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG, ppc_r1, tree->inst_imm, state->left->tree->dreg);
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG, s->frame_reg, tree->inst_imm, state->left->tree->dreg);
return;
}
tree->opcode = OP_SETREG;
@@ -153,8 +153,8 @@ stmt: OP_OUTARG (OP_REGVAR) {
stmt: OP_OUTARG (lreg) {
if (tree->inst_imm) {
- MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG, ppc_r1, tree->inst_imm, state->left->reg2);
- MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG, ppc_r1, tree->inst_imm + 4, state->left->reg1);
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG, s->frame_reg, tree->inst_imm, state->left->reg2);
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG, s->frame_reg, tree->inst_imm + 4, state->left->reg1);
return;
}
MONO_EMIT_NEW_UNALU (s, OP_SETREG, tree->unused, state->left->reg2);
@@ -166,7 +166,7 @@ stmt: OP_OUTARG (lreg) {
stmt: OP_OUTARG (OP_ICONST) {
if (tree->inst_imm) {
- MONO_EMIT_NEW_STORE_MEMBASE_IMM (s, OP_STORE_MEMBASE_IMM, ppc_r1, tree->inst_imm, state->left->tree->inst_c0);
+ MONO_EMIT_NEW_STORE_MEMBASE_IMM (s, OP_STORE_MEMBASE_IMM, s->frame_reg, tree->inst_imm, state->left->tree->inst_c0);
return;
}
tree->opcode = OP_SETREGIMM;
@@ -205,7 +205,7 @@ stmt: OP_OUTARG (OP_ICONST) {
stmt: OP_OUTARG (CEE_LDIND_REF (OP_REGVAR)) {
if (tree->inst_imm) {
- MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG, ppc_r1, tree->inst_imm, state->left->left->tree->dreg);
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG, s->frame_reg, tree->inst_imm, state->left->left->tree->dreg);
return;
}
tree->opcode = OP_SETREG;
@@ -223,7 +223,7 @@ stmt: OP_OUTARG (CEE_LDIND_REF (OP_REGVAR)) {
stmt: OP_OUTARG (freg) {
if (tree->inst_imm) {
int opcode = (tree->unused & 0xff00) == 0x0400? OP_STORER4_MEMBASE_REG: OP_STORER8_MEMBASE_REG;
- MONO_EMIT_NEW_STORE_MEMBASE (s, opcode, ppc_r1, tree->inst_imm, state->left->reg1);
+ MONO_EMIT_NEW_STORE_MEMBASE (s, opcode, s->frame_reg, tree->inst_imm, state->left->reg1);
return;
}
tree->opcode = OP_SETFREG;
@@ -234,7 +234,7 @@ stmt: OP_OUTARG (freg) {
stmt: OP_OUTARG_R4 (freg) {
if (tree->inst_imm) {
- MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORER4_MEMBASE_REG, ppc_r1, tree->inst_imm, state->left->reg1);
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORER4_MEMBASE_REG, s->frame_reg, tree->inst_imm, state->left->reg1);
return;
}
tree->opcode = OP_SETFREG;
@@ -245,7 +245,7 @@ stmt: OP_OUTARG_R4 (freg) {
stmt: OP_OUTARG_R8 (freg) {
if (tree->inst_imm) {
- MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORER8_MEMBASE_REG, ppc_r1, tree->inst_imm, state->left->reg1);
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORER8_MEMBASE_REG, s->frame_reg, tree->inst_imm, state->left->reg1);
return;
}
tree->opcode = OP_SETFREG;
@@ -269,7 +269,7 @@ stmt: OP_OUTARG_VT (CEE_LDOBJ (base)) {
}
//g_print ("vt size: %d at R%d + %d\n", tree->inst_imm, vt->inst_basereg, vt->inst_offset);
if (ovf_size != 0) {
- mini_emit_memcpy (s, ppc_r1, tree->inst_imm + (soffset - vt->inst_offset), vt->inst_basereg, soffset, ovf_size * sizeof (gpointer), 0);
+ mini_emit_memcpy (s, s->frame_reg, tree->inst_imm + (soffset - vt->inst_offset), vt->inst_basereg, soffset, ovf_size * sizeof (gpointer), 0);
}
}
diff --git a/mono/mini/inssel-x86.brg b/mono/mini/inssel-x86.brg
index b80affe25ab..b1f1cf67c77 100644
--- a/mono/mini/inssel-x86.brg
+++ b/mono/mini/inssel-x86.brg
@@ -151,7 +151,6 @@ reg: OP_LOCALLOC (OP_ICONST) {
if (tree->flags & MONO_INST_INIT) {
/* microcoded in mini-x86.c */
tree->sreg1 = mono_regstate_next_int (s->rs);
- tree->dreg = state->reg1;
MONO_EMIT_NEW_ICONST (s, tree->sreg1, state->left->tree->inst_c0);
mono_bblock_add_inst (s->cbb, tree);
} else {
@@ -162,7 +161,6 @@ reg: OP_LOCALLOC (OP_ICONST) {
reg: OP_LOCALLOC (reg) {
tree->sreg1 = state->left->tree->dreg;
- tree->dreg = state->reg1;
mono_bblock_add_inst (s->cbb, tree);
}
diff --git a/mono/mini/mini-ppc.c b/mono/mini/mini-ppc.c
index 537cefb50a7..a62d49bd453 100644
--- a/mono/mini/mini-ppc.c
+++ b/mono/mini/mini-ppc.c
@@ -209,7 +209,7 @@ mono_arch_get_global_int_regs (MonoCompile *cfg)
if (cfg->frame_reg != ppc_sp)
top = 31;
#if USE_EXTRA_TEMPS
- top = 29;
+ top -= 2;
#endif
for (i = 13; i < top; ++i)
regs = g_list_prepend (regs, GUINT_TO_POINTER (i));
@@ -1296,11 +1296,7 @@ mono_spillvar_offset_float (MonoCompile *cfg, int spillvar)
#undef DEBUG
#define DEBUG(a) if (cfg->verbose_level > 1) a
//#define DEBUG(a)
-/* use ppc_r3-ppc_10,ppc_r12 as temp registers, f1-f13 for FP registers */
-#define PPC_CALLER_REGS ((0xff<<3) | (1<<12) | USE_EXTRA_TEMPS)
-#define PPC_CALLER_FREGS (0x3ffe)
-
-#define reg_is_freeable(r) (PPC_CALLER_REGS & 1 << (r))
+#define reg_is_freeable(r) ((r) >= 3 && (r) <= 10)
#define freg_is_freeable(r) ((r) >= 1 && (r) <= 13)
typedef struct {
@@ -1635,6 +1631,10 @@ alloc_int_reg (MonoCompile *cfg, InstList *curinst, MonoInst *ins, int sym_reg,
return val;
}
+/* use ppc_r3-ppc_10,ppc_r12 as temp registers, f1-f13 for FP registers */
+#define PPC_CALLER_REGS ((0xff<<3) | (1<<12) | USE_EXTRA_TEMPS)
+#define PPC_CALLER_FREGS (0x3ffe)
+
/*
* Local register allocation.
* We first scan the list of instructions and we save the liveness info of
@@ -2275,7 +2275,6 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
}
// if (ins->cil_code)
// g_print ("cil code\n");
- mono_debug_record_line_number (cfg, ins, offset);
switch (ins->opcode) {
case OP_BIGMUL:
@@ -2687,7 +2686,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
*/
ppc_mulhwu (code, ppc_r0, ins->sreg1, ins->sreg2);
ppc_cmpi (code, 0, 0, ppc_r0, 0);
- EMIT_COND_SYSTEM_EXCEPTION (CEE_BNE_UN - CEE_BEQ, "OverflowException");
+ EMIT_COND_SYSTEM_EXCEPTION (CEE_BNE_UN - CEE_BEQ, ins->inst_p1);
ppc_mullw (code, ins->dreg, ins->sreg1, ins->sreg2);
break;
case OP_ICONST:
@@ -3410,8 +3409,6 @@ mono_arch_emit_prolog (MonoCompile *cfg)
ArgInfo *ainfo = cinfo->args + i;
inst = cfg->varinfo [pos];
- if (cfg->verbose_level > 2)
- g_print ("Saving argument %d (type: %d)\n", i, ainfo->regtype);
if (inst->opcode == OP_REGVAR) {
if (ainfo->regtype == RegTypeGeneral)
ppc_mr (code, inst->dreg, ainfo->reg);
diff --git a/mono/mini/mini-s390.c b/mono/mini/mini-s390.c
index 0a7db247fa2..101c5c7ec76 100644
--- a/mono/mini/mini-s390.c
+++ b/mono/mini/mini-s390.c
@@ -2944,8 +2944,6 @@ guint8 cond;
code = cfg->native_code + offset;
}
- mono_debug_record_line_number (cfg, ins, offset);
-
switch (ins->opcode) {
case OP_STOREI1_MEMBASE_IMM: {
s390_lhi (code, s390_r14, ins->inst_imm);
diff --git a/mono/mini/mini-sparc.c b/mono/mini/mini-sparc.c
index d0f58dc84cf..54fd7fda138 100644
--- a/mono/mini/mini-sparc.c
+++ b/mono/mini/mini-sparc.c
@@ -2546,7 +2546,6 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
code_start = (guint8*)code;
// if (ins->cil_code)
// g_print ("cil code\n");
- mono_debug_record_line_number (cfg, ins, offset);
switch (ins->opcode) {
case OP_STOREI1_MEMBASE_IMM:
diff --git a/mono/mini/mini-x86.c b/mono/mini/mini-x86.c
index 4f5842f8750..14710b31792 100644
--- a/mono/mini/mini-x86.c
+++ b/mono/mini/mini-x86.c
@@ -1866,8 +1866,6 @@ mono_arch_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb)
/* force source to be same as dest */
rs->iassign [ins->sreg1] = ins->dreg;
rs->iassign [ins->sreg1 + 1] = ins->unused;
- rs->isymbolic [ins->dreg] = ins->sreg1;
- rs->isymbolic [ins->unused] = ins->sreg1 + 1;
DEBUG (g_print ("\tassigned sreg1 (long) %s to sreg1 R%d\n", mono_arch_regname (ins->dreg), ins->sreg1));
DEBUG (g_print ("\tassigned sreg1 (long-high) %s to sreg1 R%d\n", mono_arch_regname (ins->unused), ins->sreg1 + 1));
diff --git a/mono/mini/mini.c b/mono/mini/mini.c
index 14a32f6dd6c..95a14efc341 100644
--- a/mono/mini/mini.c
+++ b/mono/mini/mini.c
@@ -1581,24 +1581,23 @@ mono_compile_get_interface_var (MonoCompile *cfg, int slot, MonoInst *ins)
*/
static int
handle_stack_args (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst **sp, int count) {
- int i, bindex;
+ int i;
MonoBasicBlock *outb;
MonoInst *inst, **locals;
- gboolean found;
if (!count)
return 0;
if (cfg->verbose_level > 3)
g_print ("%d item(s) on exit from B%d\n", count, bb->block_num);
if (!bb->out_scount) {
+ int found = 0;
bb->out_scount = count;
//g_print ("bblock %d has out:", bb->block_num);
- found = FALSE;
for (i = 0; i < bb->out_count; ++i) {
outb = bb->out_bb [i];
//g_print (" %d", outb->block_num);
if (outb->in_stack) {
- found = TRUE;
+ found = 1;
bb->out_stack = outb->in_stack;
break;
}
@@ -1607,34 +1606,19 @@ handle_stack_args (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst **sp, int coun
if (!found) {
bb->out_stack = mono_mempool_alloc (cfg->mempool, sizeof (MonoInst*) * count);
for (i = 0; i < count; ++i) {
- /*
- * try to reuse temps already allocated for this purpouse, if they occupy the same
- * stack slot and if they are of the same type.
- * This won't cause conflicts since if 'local' is used to
- * store one of the values in the in_stack of a bblock, then
- * the same variable will be used for the same outgoing stack
- * slot as well.
- * This doesn't work when inlining methods, since the bblocks
- * in the inlined methods do not inherit their in_stack from
- * the bblock they are inlined to. See bug #58863 for an
- * example.
- */
- if (cfg->inlined_method)
- bb->out_stack [i] = mono_compile_create_var (cfg, type_from_stack_type (sp [i]), OP_LOCAL);
- else
- bb->out_stack [i] = mono_compile_get_interface_var (cfg, i, sp [i]);
+/* see bug#58863, but removing this code causes regressions in gtk-sharp build
+ * (SEGV running Method::Initialize() in gapi_codegen.exe)
+ */
+#if 1
+ /* try to reuse temps already allocated for this purpouse, if they occupy the same
+ * stack slot and if they are of the same type. */
+ bb->out_stack [i] = mono_compile_get_interface_var (cfg, i, sp [i]);
+#else
+ bb->out_stack [i] = mono_compile_create_var (cfg, type_from_stack_type (sp [i]), OP_LOCAL);
+#endif
}
}
}
-
- for (i = 0; i < bb->out_count; ++i) {
- outb = bb->out_bb [i];
- if (outb->in_scount)
- continue; /* check they are the same locals */
- outb->in_scount = count;
- outb->in_stack = bb->out_stack;
- }
-
locals = bb->out_stack;
for (i = 0; i < count; ++i) {
/* add store ops at the end of the bb, before the branch */
@@ -1649,36 +1633,14 @@ handle_stack_args (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst **sp, int coun
if (cfg->verbose_level > 3)
g_print ("storing %d to temp %d\n", i, locals [i]->inst_c0);
}
-
- /*
- * It is possible that the out bblocks already have in_stack assigned, and
- * the in_stacks differ. In this case, we will store to all the different
- * in_stacks.
- */
-
- found = TRUE;
- bindex = 0;
- while (found) {
- /* Find a bblock which has a different in_stack */
- found = FALSE;
- while (bindex < bb->out_count) {
- outb = bb->out_bb [bindex];
- if (outb->in_stack != locals) {
- /*
- * Instead of storing sp [i] to locals [i], we need to store
- * locals [i] to <new locals>[i], since the sp [i] tree can't
- * be shared between trees.
- */
- for (i = 0; i < count; ++i)
- mono_add_varcopy_to_end (cfg, bb, locals [i]->inst_c0, outb->in_stack [i]->inst_c0);
- locals = outb->in_stack;
- found = TRUE;
- break;
- }
- bindex ++;
- }
- }
+ for (i = 0; i < bb->out_count; ++i) {
+ outb = bb->out_bb [i];
+ if (outb->in_scount)
+ continue; /* check they are the same locals */
+ outb->in_scount = count;
+ outb->in_stack = locals;
+ }
return 0;
}
@@ -2465,7 +2427,6 @@ inline_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig,
MonoMethodHeader *cheader;
MonoBasicBlock *ebblock, *sbblock;
int i, costs, new_locals_offset;
- MonoMethod *prev_inlined_method;
if (cfg->verbose_level > 2)
g_print ("INLINE START %p %s -> %s\n", cmethod, mono_method_full_name (cfg->method, TRUE), mono_method_full_name (cmethod, TRUE));
@@ -2494,13 +2455,8 @@ inline_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig,
ebblock->block_num = cfg->num_bblocks++;
ebblock->real_offset = real_offset;
- prev_inlined_method = cfg->inlined_method;
- cfg->inlined_method = cmethod;
-
costs = mono_method_to_ir (cfg, cmethod, sbblock, ebblock, new_locals_offset, rvar, dont_inline, sp, real_offset, *ip == CEE_CALLVIRT);
- cfg->inlined_method = prev_inlined_method;
-
if ((costs >= 0 && costs < 60) || inline_allways) {
if (cfg->verbose_level > 2)
g_print ("INLINE END %s -> %s\n", mono_method_full_name (cfg->method, TRUE), mono_method_full_name (cmethod, TRUE));
@@ -7090,12 +7046,10 @@ optimize_branches (MonoCompile *cfg)
bbn->code->inst_target_bb->region == bb->region) {
if (cfg->verbose_level > 2)
- g_print ("in %s branch to branch triggered %d -> %d -> %d\n", cfg->method->name,
- bb->block_num, bbn->block_num, bbn->code->inst_target_bb->block_num);
-
- replace_in_block (bbn, bb, NULL);
- replace_out_block (bb, bbn, bbn->code->inst_target_bb);
- link_bblock (cfg, bb, bbn->code->inst_target_bb);
+ g_print ("in %s branch to branch triggered %d -> %d\n", cfg->method->name,
+ bb->block_num, bbn->block_num);
+
+ replace_basic_block (bb, bb->out_bb [0], bbn->code->inst_target_bb);
bb->last_ins->inst_target_bb = bbn->code->inst_target_bb;
changed = TRUE;
break;
diff --git a/mono/mini/mini.h b/mono/mini/mini.h
index e62be1b95cb..adc1e9086b5 100644
--- a/mono/mini/mini.h
+++ b/mono/mini/mini.h
@@ -492,7 +492,6 @@ typedef struct {
MonoSpillInfo *spill_info_float; /* fp register spills */
gint spill_count;
/* unsigned char *cil_code; */
- MonoMethod *inlined_method; /* the method which is currently inlined */
/* the exception object passed to catch/filter blocks */
MonoInst *exvar;
diff --git a/mono/tests/Makefile.am b/mono/tests/Makefile.am
index 2ac008e74c4..23cc36cc3cc 100644
--- a/mono/tests/Makefile.am
+++ b/mono/tests/Makefile.am
@@ -41,7 +41,6 @@ TEST_CS_SRC= \
exception16.cs \
struct.cs \
valuetype-gettype.cs \
- typeof-ptr.cs \
static-constructor.cs \
pinvoke.cs \
pinvoke1.cs \
diff --git a/mono/tests/libtest.c b/mono/tests/libtest.c
index 6a9bad00f5a..0d651b00e80 100644
--- a/mono/tests/libtest.c
+++ b/mono/tests/libtest.c
@@ -636,24 +636,10 @@ mono_test_marshal_primitive_byref_delegate (PrimitiveByrefDelegate delegate)
return 0;
}
-typedef int (*return_int_delegate) (int i);
-
-typedef return_int_delegate (*ReturnDelegateDelegate) ();
-
-int
-mono_test_marshal_return_delegate_delegate (ReturnDelegateDelegate d)
-{
- return (d ()) (55);
-}
-
-
int
mono_test_marshal_stringbuilder (char *s, int n)
{
const char m[] = "This is my message. Isn't it nice?";
-
- if (strcmp (s, "ABCD") != 0)
- return 1;
strncpy(s, m, n);
return 0;
}
@@ -701,20 +687,6 @@ mono_test_marshal_string_array (char **array)
}
int
-mono_test_marshal_stringbuilder_array (char **array)
-{
- if (strcmp (array [0], "ABC"))
- return 1;
- if (strcmp (array [1], "DEF"))
- return 2;
-
- strcpy (array [0], "DEF");
- strcpy (array [1], "ABC");
-
- return 0;
-}
-
-int
mono_test_marshal_unicode_string_array (gunichar2 **array, char **array2)
{
GError *error = NULL;
@@ -1020,18 +992,6 @@ mono_test_marshal_mixed_point (mixed_point pt)
}
int
-mono_test_marshal_mixed_point_2 (mixed_point *pt)
-{
- if (pt->x != 5 || pt->y != 6.75)
- return 1;
-
- pt->x = 10;
- pt->y = 12.35;
-
- return 0;
-}
-
-int
time_t_sizeof (void)
{
return sizeof (time_t);
diff --git a/mono/tests/pinvoke2.cs b/mono/tests/pinvoke2.cs
index 6dd5a7828a7..179f67d0f56 100755
--- a/mono/tests/pinvoke2.cs
+++ b/mono/tests/pinvoke2.cs
@@ -111,9 +111,6 @@ public class Tests {
[DllImport ("libtest", EntryPoint="mono_test_marshal_unicode_string_array", CharSet=CharSet.Unicode)]
public static extern int mono_test_marshal_unicode_string_array (string [] a1, [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStr)]string [] a2);
- [DllImport ("libtest", EntryPoint="mono_test_marshal_stringbuilder_array")]
- public static extern int mono_test_marshal_stringbuilder_array (StringBuilder [] a1);
-
[DllImport ("libtest", EntryPoint="mono_test_marshal_inout_array")]
public static extern int mono_test_marshal_inout_array ([In, Out] int [] a1);
@@ -416,7 +413,6 @@ public class Tests {
static int test_0_marshal_stringbuilder () {
StringBuilder sb = new StringBuilder(255);
- sb.Append ("ABCD");
mono_test_marshal_stringbuilder (sb, sb.Capacity);
String res = sb.ToString();
@@ -449,20 +445,6 @@ public class Tests {
return mono_test_marshal_unicode_string_array (new String [] { "ABC", "DEF" }, new String [] { "ABC", "DEF" });
}
- static int test_0_marshal_stringbuilder_array () {
- StringBuilder sb1 = new StringBuilder ("ABC");
- StringBuilder sb2 = new StringBuilder ("DEF");
-
- int res = mono_test_marshal_stringbuilder_array (new StringBuilder [] { sb1, sb2 });
- if (res != 0)
- return res;
- if (sb1.ToString () != "DEF")
- return 5;
- if (sb2.ToString () != "ABC")
- return 6;
- return 0;
- }
-
static int test_0_last_error () {
mono_test_last_error (5);
if (Marshal.GetLastWin32Error () == 5)
diff --git a/mono/tests/pinvoke3.cs b/mono/tests/pinvoke3.cs
index 0a0d39ee3aa..f463e14afc5 100755
--- a/mono/tests/pinvoke3.cs
+++ b/mono/tests/pinvoke3.cs
@@ -150,9 +150,6 @@ public class Tests {
[DllImport ("libtest", EntryPoint="mono_test_marshal_primitive_byref_delegate")]
public static extern int mono_test_marshal_primitive_byref_delegate (PrimitiveByrefDelegate d);
- [DllImport ("libtest", EntryPoint="mono_test_marshal_return_delegate_delegate")]
- public static extern int mono_test_marshal_return_delegate_delegate (ReturnDelegateDelegate d);
-
public delegate int TestDelegate (int a, ref SimpleStruct ss, int b);
public delegate SimpleStruct SimpleDelegate2 (SimpleStruct ss);
@@ -171,8 +168,6 @@ public class Tests {
public delegate int PrimitiveByrefDelegate (ref int i);
- public delegate return_int_delegate ReturnDelegateDelegate ();
-
public static int Main () {
return TestDriver.RunTests (typeof (Tests));
}
@@ -283,13 +278,4 @@ public class Tests {
return mono_test_marshal_primitive_byref_delegate (d);
}
-
- public static return_int_delegate return_delegate () {
- return new return_int_delegate (return_self);
- }
-
- static int test_55_marshal_return_delegate_delegate () {
- return mono_test_marshal_return_delegate_delegate (new ReturnDelegateDelegate (return_delegate));
- }
-
}
diff --git a/mono/tests/typeof-ptr.cs b/mono/tests/typeof-ptr.cs
deleted file mode 100644
index eea3d1072db..00000000000
--- a/mono/tests/typeof-ptr.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-using System.Reflection;
-
-class T {
- public static unsafe void meth (int a, int* b) {
- }
- static int Main () {
- ParameterInfo[] args = typeof (T).GetMethod ("meth").GetParameters ();
- if (args[0].ParameterType == args[1].ParameterType)
- return 1;
-
- if (typeof(int) == typeof (int*))
- return 2;
- if (args[0].ParameterType != typeof(int))
- return 3;
- if (args[1].ParameterType != typeof(int*))
- return 4;
- return 0;
- }
-}
diff --git a/web/pending-classes.in b/web/pending-classes.in
new file mode 100644
index 00000000000..1cdb5a4cb36
--- /dev/null
+++ b/web/pending-classes.in
@@ -0,0 +1,246 @@
+System.Object
+System.Exception
+System.ValueType
+System.Delegate
+System.MulticastDelegate
+System.Enum
+System.Activator
+System.ArgIterator
+System.__ComObject
+System.TypedReference
+System.Security.AllowPartiallyTrustedCallersAttribute
+System.Runtime.Serialization.Formatter
+System.Runtime.Serialization.FormatterConverter
+System.Runtime.Serialization.FormatterServices
+System.Runtime.Serialization.ObjectIDGenerator
+System.Runtime.Serialization.ObjectManager
+System.Reflection.ModuleResolveEventHandler
+System.Reflection.Pointer
+System.Globalization.CompareInfo
+System.Globalization.HebrewCalendar
+System.Globalization.HijriCalendar
+System.Globalization.JapaneseCalendar
+System.Globalization.KoreanCalendar
+System.Globalization.SortKey
+System.Globalization.StringInfo
+System.Globalization.TaiwanCalendar
+System.Globalization.TextElementEnumerator
+System.Globalization.TextInfo
+System.Globalization.ThaiBuddhistCalendar
+System.IO.IsolatedStorage.IsolatedStorageFile
+System.Reflection.Emit.MethodRental
+System.Runtime.CompilerServices.AccessedThroughPropertyAttribute
+System.Runtime.CompilerServices.CallConvCdecl
+System.Runtime.CompilerServices.CallConvStdcall
+System.Runtime.CompilerServices.CallConvThiscall
+System.Runtime.CompilerServices.CallConvFastcall
+System.Runtime.CompilerServices.CustomConstantAttribute
+System.Runtime.CompilerServices.DateTimeConstantAttribute
+System.Runtime.CompilerServices.DiscardableAttribute
+System.Runtime.CompilerServices.DecimalConstantAttribute
+System.Runtime.CompilerServices.CompilationRelaxationsAttribute
+System.Runtime.CompilerServices.CompilerGlobalScopeAttribute
+System.Runtime.CompilerServices.IDispatchConstantAttribute
+System.Runtime.CompilerServices.IsVolatile
+System.Runtime.CompilerServices.IUnknownConstantAttribute
+System.Runtime.CompilerServices.RequiredAttributeAttribute
+System.Runtime.InteropServices.ArrayWithOffset
+System.Runtime.InteropServices.DispIdAttribute
+System.Runtime.InteropServices.ClassInterfaceType
+System.Runtime.InteropServices.ClassInterfaceAttribute
+System.Runtime.InteropServices.ComVisibleAttribute
+System.Runtime.InteropServices.LCIDConversionAttribute
+System.Runtime.InteropServices.ComRegisterFunctionAttribute
+System.Runtime.InteropServices.ComUnregisterFunctionAttribute
+System.Runtime.InteropServices.ProgIdAttribute
+System.Runtime.InteropServices.ImportedFromTypeLibAttribute
+System.Runtime.InteropServices.IDispatchImplType
+System.Runtime.InteropServices.IDispatchImplAttribute
+System.Runtime.InteropServices.ComSourceInterfacesAttribute
+System.Runtime.InteropServices.ComConversionLossAttribute
+System.Runtime.InteropServices.TypeLibTypeFlags
+System.Runtime.InteropServices.TypeLibFuncFlags
+System.Runtime.InteropServices.TypeLibVarFlags
+System.Runtime.InteropServices.TypeLibTypeAttribute
+System.Runtime.InteropServices.TypeLibFuncAttribute
+System.Runtime.InteropServices.TypeLibVarAttribute
+System.Runtime.InteropServices.ComImportAttribute
+System.Runtime.InteropServices.PreserveSigAttribute
+System.Runtime.InteropServices.ComAliasNameAttribute
+System.Runtime.InteropServices.AutomationProxyAttribute
+System.Runtime.InteropServices.PrimaryInteropAssemblyAttribute
+System.Runtime.InteropServices.CoClassAttribute
+System.Runtime.InteropServices.ComEventInterfaceAttribute
+System.Runtime.InteropServices.COMException
+System.Runtime.InteropServices.ComMemberType
+System.Runtime.InteropServices.CurrencyWrapper
+System.Runtime.InteropServices.DispatchWrapper
+System.Runtime.InteropServices.ErrorWrapper
+System.Runtime.InteropServices.ExtensibleClassFactory
+System.Runtime.InteropServices.HandleRef
+System.Runtime.InteropServices.InvalidComObjectException
+System.Runtime.InteropServices.InvalidOleVariantTypeException
+System.Runtime.InteropServices.TypeLibImporterFlags
+System.Runtime.InteropServices.ExporterEventKind
+System.Runtime.InteropServices.ITypeLibExporterNotifySink
+System.Runtime.InteropServices.ITypeLibConverter
+System.Runtime.InteropServices.MarshalDirectiveException
+System.Runtime.InteropServices.ObjectCreationDelegate
+System.Runtime.InteropServices.RuntimeEnvironment
+System.Runtime.InteropServices.RegistrationServices
+System.Runtime.InteropServices.SafeArrayRankMismatchException
+System.Runtime.InteropServices.SafeArrayTypeMismatchException
+System.Runtime.InteropServices.SEHException
+System.Runtime.InteropServices.TypeLibConverter
+System.Runtime.InteropServices.BIND_OPTS
+System.Runtime.InteropServices.UCOMIBindCtx
+System.Runtime.InteropServices.UCOMIConnectionPointContainer
+System.Runtime.InteropServices.UCOMIConnectionPoint
+System.Runtime.InteropServices.UCOMIEnumMoniker
+System.Runtime.InteropServices.CONNECTDATA
+System.Runtime.InteropServices.UCOMIEnumConnections
+System.Runtime.InteropServices.UCOMIEnumConnectionPoints
+System.Runtime.InteropServices.UCOMIEnumString
+System.Runtime.InteropServices.UCOMIEnumVARIANT
+System.Runtime.InteropServices.FILETIME
+System.Runtime.InteropServices.UCOMIMoniker
+System.Runtime.InteropServices.UCOMIPersistFile
+System.Runtime.InteropServices.UCOMIRunningObjectTable
+System.Runtime.InteropServices.STATSTG
+System.Runtime.InteropServices.UCOMIStream
+System.Runtime.InteropServices.DESCKIND
+System.Runtime.InteropServices.BINDPTR
+System.Runtime.InteropServices.UCOMITypeComp
+System.Runtime.InteropServices.TYPEKIND
+System.Runtime.InteropServices.TYPEFLAGS
+System.Runtime.InteropServices.IMPLTYPEFLAGS
+System.Runtime.InteropServices.TYPEATTR
+System.Runtime.InteropServices.FUNCDESC
+System.Runtime.InteropServices.IDLFLAG
+System.Runtime.InteropServices.IDLDESC
+System.Runtime.InteropServices.PARAMFLAG
+System.Runtime.InteropServices.PARAMDESC
+System.Runtime.InteropServices.TYPEDESC
+System.Runtime.InteropServices.ELEMDESC
+System.Runtime.InteropServices.VARDESC
+System.Runtime.InteropServices.DISPPARAMS
+System.Runtime.InteropServices.EXCEPINFO
+System.Runtime.InteropServices.FUNCKIND
+System.Runtime.InteropServices.INVOKEKIND
+System.Runtime.InteropServices.CALLCONV
+System.Runtime.InteropServices.FUNCFLAGS
+System.Runtime.InteropServices.VARFLAGS
+System.Runtime.InteropServices.UCOMITypeInfo
+System.Runtime.InteropServices.SYSKIND
+System.Runtime.InteropServices.LIBFLAGS
+System.Runtime.InteropServices.TYPELIBATTR
+System.Runtime.InteropServices.UCOMITypeLib
+System.Runtime.InteropServices.UnknownWrapper
+System.Runtime.Remoting.IObjectHandle
+System.Runtime.Remoting.IRemotingTypeInfo
+System.Runtime.Remoting.IChannelInfo
+System.Runtime.Remoting.IEnvoyInfo
+System.Runtime.Remoting.RemotingConfiguration
+System.Runtime.Remoting.TypeEntry
+System.Runtime.Remoting.ActivatedClientTypeEntry
+System.Runtime.Remoting.ActivatedServiceTypeEntry
+System.Runtime.Remoting.WellKnownClientTypeEntry
+System.Runtime.Remoting.WellKnownServiceTypeEntry
+System.Runtime.Remoting.RemotingException
+System.Runtime.Remoting.ServerException
+System.Runtime.Remoting.RemotingTimeoutException
+System.Runtime.Remoting.RemotingServices
+System.Runtime.Remoting.InternalRemotingServices
+System.Runtime.Remoting.SoapServices
+System.Runtime.Remoting.Activation.UrlAttribute
+System.Runtime.Remoting.Messaging.IMessageSink
+System.Runtime.Remoting.Messaging.AsyncResult
+System.Runtime.Remoting.Messaging.CallContext
+System.Runtime.Remoting.Messaging.ILogicalThreadAffinative
+System.Runtime.Remoting.Messaging.InternalMessageWrapper
+System.Runtime.Remoting.Messaging.IMethodCallMessage
+System.Runtime.Remoting.Messaging.MethodCallMessageWrapper
+System.Runtime.Remoting.Messaging.HeaderHandler
+System.Runtime.Remoting.Messaging.IMessageCtrl
+System.Runtime.Remoting.Messaging.IRemotingFormatter
+System.Runtime.Remoting.Messaging.ReturnMessage
+System.Runtime.Remoting.Messaging.MethodCall
+System.Runtime.Remoting.Messaging.ConstructionCall
+System.Runtime.Remoting.Messaging.MethodResponse
+System.Runtime.Remoting.Messaging.ConstructionResponse
+System.Runtime.Remoting.Messaging.MethodReturnMessageWrapper
+System.Runtime.Remoting.Messaging.OneWayAttribute
+System.Runtime.Remoting.Messaging.MessageSurrogateFilter
+System.Runtime.Remoting.Messaging.RemotingSurrogateSelector
+System.Runtime.Remoting.Contexts.CrossContextDelegate
+System.Runtime.Remoting.Contexts.ContextProperty
+System.Runtime.Remoting.Contexts.IContextPropertyActivator
+System.Runtime.Remoting.Contexts.IContributeClientContextSink
+System.Runtime.Remoting.Contexts.IContributeDynamicSink
+System.Runtime.Remoting.Contexts.IContributeEnvoySink
+System.Runtime.Remoting.Contexts.IContributeObjectSink
+System.Runtime.Remoting.Contexts.IContributeServerContextSink
+System.Runtime.Serialization.Formatters.InternalRM
+System.Runtime.Serialization.Formatters.InternalST
+System.Runtime.Serialization.Formatters.SoapMessage
+System.Runtime.Serialization.Formatters.SoapFault
+System.Runtime.Serialization.Formatters.ServerFault
+System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+System.Security.Cryptography.CryptoConfig
+System.Security.Cryptography.KeyedHashAlgorithm
+System.Security.Cryptography.HMACSHA1
+System.Security.Cryptography.MACTripleDES
+System.Security.Cryptography.MaskGenerationMethod
+System.Security.Cryptography.PasswordDeriveBytes
+System.Security.Cryptography.PKCS1MaskGenerationMethod
+System.Security.Cryptography.RC2
+System.Security.Cryptography.RC2CryptoServiceProvider
+System.Security.Cryptography.RSACryptoServiceProvider
+System.Security.Cryptography.RSAOAEPKeyExchangeDeformatter
+System.Security.Cryptography.RSAOAEPKeyExchangeFormatter
+System.Security.Cryptography.RSAPKCS1KeyExchangeDeformatter
+System.Security.Cryptography.RSAPKCS1KeyExchangeFormatter
+System.Security.Cryptography.RSAPKCS1SignatureDeformatter
+System.Security.Cryptography.RSAPKCS1SignatureFormatter
+System.Security.Cryptography.SHA1Managed
+System.Security.Cryptography.TripleDES
+System.Security.Cryptography.TripleDESCryptoServiceProvider
+System.Security.Permissions.EnvironmentPermission
+System.Security.Permissions.FileDialogPermission
+System.Security.Permissions.IsolatedStorageFilePermission
+System.Security.Permissions.PrincipalPermissionAttribute
+System.Security.Permissions.SecurityPermissionAttribute
+System.Security.Permissions.PublisherIdentityPermissionAttribute
+System.Security.Permissions.PublisherIdentityPermission
+System.Security.Permissions.ReflectionPermission
+System.Security.Permissions.RegistryPermission
+System.Security.Permissions.PrincipalPermission
+System.Security.Permissions.SiteIdentityPermission
+System.Security.Permissions.StrongNameIdentityPermission
+System.Security.Permissions.StrongNamePublicKeyBlob
+System.Security.Permissions.UIPermission
+System.Security.Permissions.UrlIdentityPermission
+System.Security.Permissions.ZoneIdentityPermission
+System.Security.Policy.ApplicationDirectory
+System.Security.Policy.ApplicationDirectoryMembershipCondition
+System.Security.Policy.FirstMatchCodeGroup
+System.Security.Policy.Hash
+System.Security.Policy.HashMembershipCondition
+System.Security.Policy.NetCodeGroup
+System.Security.Policy.PermissionRequestEvidence
+System.Security.Policy.Publisher
+System.Security.Policy.PublisherMembershipCondition
+System.Security.Policy.Site
+System.Security.Policy.SiteMembershipCondition
+System.Security.Policy.StrongName
+System.Security.Policy.StrongNameMembershipCondition
+System.Security.Policy.UnionCodeGroup
+System.Security.Policy.Url
+System.Security.Policy.UrlMembershipCondition
+System.Security.Policy.Zone
+System.Security.Policy.ZoneMembershipCondition
+System.Security.Principal.WindowsIdentity
+System.Security.Principal.WindowsImpersonationContext
+System.Security.Principal.WindowsPrincipal
+System.Threading.CompressedStack
+
diff --git a/web/web/masterinfos/.cvsignore b/web/web/masterinfos/.cvsignore
new file mode 100644
index 00000000000..6722cd96e78
--- /dev/null
+++ b/web/web/masterinfos/.cvsignore
@@ -0,0 +1 @@
+*.xml
diff --git a/web/web/masterinfos/Makefile b/web/web/masterinfos/Makefile
new file mode 100644
index 00000000000..73f0b96341b
--- /dev/null
+++ b/web/web/masterinfos/Makefile
@@ -0,0 +1,96 @@
+# Note that you will need Microsoft.NET to generate those masterinfos
+
+# Customize to indicate your own installation dir.
+DLL_PATH=c:/WINDOWS/Microsoft.NET/Framework/v1.1.4322
+# DLL_PATH=c:/WINDOWS/Microsoft.NET/Framework/v1.2.30703
+
+all: \
+ mscorlib.xml \
+ System.xml \
+ System.Xml.xml \
+ System.Configuration.Install.xml \
+ System.Data.xml \
+ System.Data.OracleClient.xml \
+ System.Design.xml \
+ System.Management.xml \
+ System.Messaging.xml \
+ System.Web.xml \
+ System.Web.Services.xml \
+ System.Runtime.Serialization.Formatters.Soap.xml \
+ System.Drawing.xml \
+ System.Drawing.Design.xml \
+ System.Security.xml \
+ System.DirectoryServices.xml \
+ System.EnterpriseServices.xml \
+ System.Runtime.Remoting.xml \
+ System.Windows.Forms.xml \
+ Microsoft.VisualBasic.xml \
+ Cscompmgd.xml
+
+mscorlib.xml :
+ mono-api-info $(DLL_PATH)/mscorlib.dll > mscorlib.xml
+
+System.xml :
+ mono-api-info $(DLL_PATH)/System.dll > System.xml
+
+System.Xml.xml :
+ mono-api-info $(DLL_PATH)/System.Xml.dll > System.Xml.xml
+
+System.Configuration.Install.xml :
+ mono-api-info $(DLL_PATH)/System.Configuration.Install.dll > System.Configuration.Install.xml
+
+System.Data.xml :
+ mono-api-info $(DLL_PATH)/System.Data.dll > System.Data.xml
+
+System.Data.OracleClient.xml :
+ mono-api-info $(DLL_PATH)/System.Data.OracleClient.dll > System.Data.OracleClient.xml
+
+System.Design.xml :
+ mono-api-info $(DLL_PATH)/System.Design.dll > System.Design.xml
+
+System.Management.xml :
+ mono-api-info $(DLL_PATH)/System.Management.dll > System.Management.xml
+
+System.Messaging.xml :
+ mono-api-info $(DLL_PATH)/System.Messaging.dll > System.Messaging.xml
+
+System.Web.xml :
+ mono-api-info $(DLL_PATH)/System.Web.dll > System.Web.xml
+
+System.Web.Services.xml :
+ mono-api-info $(DLL_PATH)/System.Web.Services.dll > System.Web.Services.xml
+
+System.Runtime.Remoting.xml :
+ mono-api-info $(DLL_PATH)/System.Runtime.Remoting.dll > System.Runtime.Remoting.xml
+
+System.Runtime.Serialization.Formatters.Soap.xml :
+ mono-api-info $(DLL_PATH)/System.Runtime.Serialization.Formatters.Soap.dll > System.Runtime.Serialization.Formatters.Soap.xml
+
+System.Drawing.xml :
+ mono-api-info $(DLL_PATH)/System.Drawing.dll > System.Drawing.xml
+
+System.Drawing.Design.xml :
+ mono-api-info $(DLL_PATH)/System.Drawing.Design.dll > System.Drawing.Design.xml
+
+System.Security.xml :
+ mono-api-info $(DLL_PATH)/System.Security.dll > System.Security.xml
+
+System.DirectoryServices.xml :
+ mono-api-info $(DLL_PATH)/System.DirectoryServices.dll > System.DirectoryServices.xml
+
+System.EnterpriseServices.xml :
+ mono-api-info $(DLL_PATH)/System.EnterpriseServices.dll > System.EnterpriseServices.xml
+
+System.Windows.Forms.xml :
+ mono-api-info $(DLL_PATH)/System.Windows.Forms.dll > System.Windows.Forms.xml
+
+Cscompmgd.xml :
+ mono-api-info $(DLL_PATH)/Cscompmgd.dll > Cscompmgd.xml
+
+Microsoft.VisualBasic.xml :
+ mono-api-info $(DLL_PATH)/Microsoft.VisualBasic.dll > Microsoft.VisualBasic.xml
+
+clean:
+ rm mscorlib.xml System.xml System.Xml.xml System.Configuration.Install.xml System.Data.xml System.Data.OracleClient.xml System.Design.xml System.Drawing.Design.xml System.Management.xml System.Messaging.xml System.Web.xml System.Web.Services.xml System.Runtime.Serialization.Formatters.Soap.xml System.Drawing.xml System.Security.xml System.DirectoryServices.xml System.EnterpriseServices.xml System.Runtime.Remoting.xml System.Windows.Forms.xml Cscompmgd.xml Microsoft.VisualBasic.xml
+
+