-Subproject commit 627333cae84f02a36ee9ca605c96dac4557d9f35
+Subproject commit 5afb5950c037a3b06ce2005ec5bf436d6be0f860
-Subproject commit cb1b049c95227465c1791b857cb5ba86385d9f29
+Subproject commit eed24cf38a93e59638405a4c92f610dca02be1ec
ifdef RESOURCE_STRINGS
ifneq (basic, $(PROFILE))
RESOURCE_STRINGS_FILES += $(RESOURCE_STRINGS:%=--resourcestrings:%)
+IL_REPLACE_FILES += $(IL_REPLACE:%=--ilreplace:%)
endif
endif
ifndef NO_BUILD
-$(build_lib): $(response) $(sn) $(BUILT_SOURCES) $(build_libdir)/.stamp $(GEN_RESOURCE_DEPS)
+$(build_lib): $(response) $(sn) $(BUILT_SOURCES) $(build_libdir)/.stamp $(GEN_RESOURCE_DEPS) $(MODULE_DEPS)
$(LIBRARY_COMPILE) $(LIBRARY_FLAGS) $(LIB_MCS_FLAGS) $(KEYFILE_MCS_FLAGS) $(GEN_RESOURCE_FLAGS) -target:library -out:$@ $(BUILT_SOURCES_cmdline) @$(response)
ifdef RESOURCE_STRINGS_FILES
- $(Q) $(STRING_REPLACER) $(RESOURCE_STRINGS_FILES) $@
+ $(Q) $(STRING_REPLACER) $(RESOURCE_STRINGS_FILES) $(IL_REPLACE_FILES) $@
endif
$(Q) $(SN) -R $@ $(LIBRARY_SNK)
Q_AOT=$(if $(V),,@echo "AOT [$(intermediate)$(PROFILE_DIRECTORY)] $(notdir $(@))";)
ifndef BUILD_TOOLS_PROFILE
+ifeq ($(PROFILE),basic)
+BUILD_TOOLS_PROFILE = basic
+else
BUILD_TOOLS_PROFILE = build
endif
+endif
USE_MCS_FLAGS = /codepage:$(CODEPAGE) /nologo /noconfig /deterministic $(LOCAL_MCS_FLAGS) $(PLATFORM_MCS_FLAGS) $(PROFILE_MCS_FLAGS) $(MCS_FLAGS)
USE_MBAS_FLAGS = /codepage:$(CODEPAGE) $(LOCAL_MBAS_FLAGS) $(PLATFORM_MBAS_FLAGS) $(PROFILE_MBAS_FLAGS) $(MBAS_FLAGS)
INSTALL_LIB = $(INSTALL_BIN)
MKINSTALLDIRS = $(SHELL) $(topdir)/mkinstalldirs
INTERNAL_MBAS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/mbas/mbas.exe
-INTERNAL_ILASM = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/ilasm.exe
INTERNAL_CSC_LOCATION = $(CSC_LOCATION)
# Using CSC_SDK_PATH_DISABLED for sanity check that all references have path specified
INTERNAL_CSC = CSC_SDK_PATH_DISABLED= $(RUNTIME) $(RUNTIME_FLAGS) $(CSC_RUNTIME_FLAGS) $(INTERNAL_CSC_LOCATION)
-RESGEN = MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(RESGEN_EXE) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/resgen.exe
+RESGEN = MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/resgen.exe
STRING_REPLACER = MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/cil-stringreplacer.exe
+ILASM = MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/ilasm.exe
+
depsdir = $(topdir)/build/deps
test_nunit_lib = nunitlite.dll
xunit_core := xunit.core xunit.abstractions xunit.assert Xunit.NetCore.Extensions
xunit_deps := System.Runtime
-xunit_src := $(patsubst %,$(topdir)/../external/xunit-binaries/%,BenchmarkAttribute.cs BenchmarkDiscover.cs)
+xunit_src := $(patsubst %,$(topdir)/../external/xunit-binaries/%,BenchmarkAttribute.cs BenchmarkDiscover.cs) $(topdir)/../mcs/class/test-helpers/PlatformDetection.cs
xunit_class_deps :=
xunit_libs_ref = $(patsubst %,-r:$(topdir)/../external/xunit-binaries/%.dll,$(xunit_core))
System.Xml.Linq \
Mono.Cecil \
$(MCS_MODE_dirs) \
- ../tools/cil-stringreplacer
+ Mono.CompilerServices.SymbolWriter \
+ PEAPI \
+ ../tools/cil-stringreplacer \
+ ../ilasm \
+ corlib/il
build_SUBDIRS := \
corlib \
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\CSharpSetMemberBinder.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\CSharpUnaryOperationBinder.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Error.cs" />\r
- <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Errors\CController.cs" />\r
- <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Errors\CError.cs" />\r
- <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Errors\CErrorFactory.cs" />\r
- <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Errors\CParameterizedError.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Errors\ErrorCode.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Errors\ErrorFacts.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Errors\ErrorFmt.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Errors\ErrorHandling.cs" />\r
- <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Errors\IErrorSink.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Errors\MessageID.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Errors\UserStringBuilder.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\ExpressionTreeCallRewriter.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\ICSharpInvokeOrInvokeMemberBinder.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\ResetBindException.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\RuntimeBinder.cs" />\r
- <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\RuntimeBinderController.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\RuntimeBinderException.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\RuntimeBinderExtensions.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\RuntimeBinderInternalCompilerException.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\GroupToArgsBinder.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\GroupToArgsBinderResult.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\ImplicitConversion.cs" />\r
- <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\LangCompiler.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\MemberLookup.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\MemberLookupResults.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\MethodIterator.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\LocalVariableSymbol.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\MethodOrPropertySymbol.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\MethodSymbol.cs" />\r
- <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\MiscSymFactory.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\NamespaceOrAggregateSymbol.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\NamespaceSymbol.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\ParentSymbol.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\SymbolMask.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\SymbolTable.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\SymFactory.cs" />\r
- <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\SymFactoryBase.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\TypeParameterSymbol.cs" />\r
- <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\UnresolvedAggregateSymbol.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\VariableSymbol.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\ArrayIndex.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\ArrayInitialization.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\CompoundOperator.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Concatenate.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Constant.cs" />\r
- <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Event.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\EXPR.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\ExpressionIterator.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Tree\ExprOperator.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\AggregateType.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\ArgumentListType.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\ArrayType.cs" />\r
- <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\BoundLambdaType.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\ErrorType.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\MethodGroupType.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\NullableType.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\NullType.cs" />\r
- <Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\OpenTypePlaceholderType.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\ParameterModifierType.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\PointerType.cs" />\r
<Compile Include="..\..\..\external\corefx\src\Microsoft.CSharp\src\Microsoft\CSharp\RuntimeBinder\Semantics\Types\PredefinedTypes.cs" />\r
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/CSharpSetMemberBinder.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/CSharpUnaryOperationBinder.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Error.cs
-../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Errors/CController.cs
-../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Errors/CError.cs
-../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Errors/CErrorFactory.cs
-../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Errors/CParameterizedError.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Errors/ErrorCode.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Errors/ErrorFacts.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Errors/ErrorFmt.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Errors/ErrorHandling.cs
-../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Errors/IErrorSink.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Errors/MessageID.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Errors/UserStringBuilder.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ExpressionTreeCallRewriter.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ICSharpInvokeOrInvokeMemberBinder.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ResetBindException.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/RuntimeBinder.cs
-../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/RuntimeBinderController.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/RuntimeBinderException.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/RuntimeBinderExtensions.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/RuntimeBinderInternalCompilerException.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/GroupToArgsBinder.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/GroupToArgsBinderResult.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/ImplicitConversion.cs
-../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/LangCompiler.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/MemberLookup.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/MemberLookupResults.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/MethodIterator.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/LocalVariableSymbol.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/MethodOrPropertySymbol.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/MethodSymbol.cs
-../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/MiscSymFactory.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/NamespaceOrAggregateSymbol.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/NamespaceSymbol.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/ParentSymbol.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/SymbolMask.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/SymbolTable.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/SymFactory.cs
-../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/SymFactoryBase.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/TypeParameterSymbol.cs
-../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/UnresolvedAggregateSymbol.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/VariableSymbol.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/ArrayIndex.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/ArrayInitialization.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/CompoundOperator.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Concatenate.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Constant.cs
-../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/Event.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/EXPR.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/ExpressionIterator.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Tree/ExprOperator.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/AggregateType.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/ArgumentListType.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/ArrayType.cs
-../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/BoundLambdaType.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/ErrorType.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/MethodGroupType.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/NullableType.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/NullType.cs
-../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/OpenTypePlaceholderType.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/ParameterModifierType.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/PointerType.cs
../../../external/corefx/src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/PredefinedTypes.cs
public const string AssgReadonlyStatic = "A static readonly field cannot be assigned to (except in a static constructor or a variable initializer)";
public const string RefReadonlyStatic = "A static readonly field cannot be passed ref or out (except in a static constructor)";
public const string AssgReadonlyProp = "Property or indexer '{0}' cannot be assigned to -- it is read only";
- public const string AbstractBaseCall = "Cannot call an abstract base member: '{0}'";
public const string RefProperty = "A property or indexer may not be passed as an out or ref parameter";
public const string UnsafeNeeded = "Dynamic calls cannot be used in conjunction with pointers";
public const string BadBoolOp = "In order to be applicable as a short circuit operator a user-defined logical operator ('{0}') must have the same return type as the type of its 2 parameters";
public const string MustHaveOpTF = "The type ('{0}') must contain declarations of operator true and operator false";
public const string ConstOutOfRangeChecked = "Constant value '{0}' cannot be converted to a '{1}' (use 'unchecked' syntax to override)";
public const string AmbigMember = "Ambiguity between '{0}' and '{1}'";
- public const string SizeofUnsafe = "'{0}' does not have a predefined size, therefore sizeof can only be used in an unsafe context (consider using System.Runtime.InteropServices.Marshal.SizeOf)";
- public const string CallingFinalizeDepracated = "Destructors and object.Finalize cannot be called directly. Consider calling IDisposable.Dispose if available.";
- public const string CallingBaseFinalizeDeprecated = "Do not directly call your base class Finalize method. It is called automatically from your destructor.";
public const string NoImplicitConvCast = "Cannot implicitly convert type '{0}' to '{1}'. An explicit conversion exists (are you missing a cast?)";
public const string InaccessibleGetter = "The property or indexer '{0}' cannot be used in this context because the get accessor is inaccessible";
public const string InaccessibleSetter = "The property or indexer '{0}' cannot be used in this context because the set accessor is inaccessible";
public const string GenericConstraintNotSatisfiedRefType = "The type '{3}' cannot be used as type parameter '{2}' in the generic type or method '{0}'. There is no implicit reference conversion from '{3}' to '{1}'.";
public const string GenericConstraintNotSatisfiedNullableEnum = "The type '{3}' cannot be used as type parameter '{2}' in the generic type or method '{0}'. The nullable type '{3}' does not satisfy the constraint of '{1}'.";
public const string GenericConstraintNotSatisfiedNullableInterface = "The type '{3}' cannot be used as type parameter '{2}' in the generic type or method '{0}'. The nullable type '{3}' does not satisfy the constraint of '{1}'. Nullable types can not satisfy any interface constraints.";
- public const string GenericConstraintNotSatisfiedTyVar = "The type '{3}' cannot be used as type parameter '{2}' in the generic type or method '{0}'. There is no boxing conversion or type parameter conversion from '{3}' to '{1}'.";
public const string GenericConstraintNotSatisfiedValType = "The type '{3}' cannot be used as type parameter '{2}' in the generic type or method '{0}'. There is no boxing conversion from '{3}' to '{1}'.";
public const string TypeVarCantBeNull = "Cannot convert null to type parameter '{0}' because it could be a non-nullable value type. Consider using 'default({0})' instead.";
public const string BadRetType = "'{1} {0}' has the wrong return type";
public const string RefConstraintNotSatisfied = "The type '{2}' must be a reference type in order to use it as parameter '{1}' in the generic type or method '{0}'";
public const string ValConstraintNotSatisfied = "The type '{2}' must be a non-nullable value type in order to use it as parameter '{1}' in the generic type or method '{0}'";
public const string AmbigUDConv = "Ambiguous user defined conversions '{0}' and '{1}' when converting from '{2}' to '{3}'";
- public const string PredefinedTypeNotFound = "Predefined type '{0}' is not defined or imported";
public const string BindToBogus = "'{0}' is not supported by the language";
public const string CantCallSpecialMethod = "'{0}': cannot explicitly call operator or accessor";
- public const string BogusType = "'{0}' is a type not supported by the language";
- public const string MissingPredefinedMember = "Missing compiler required member '{0}.{1}'";
- public const string LiteralDoubleCast = "Literal of type double cannot be implicitly converted to type '{1}'; use an '{0}' suffix to create a literal of this type";
public const string ConvertToStaticClass = "Cannot convert to static type '{0}'";
public const string GenericArgIsStaticClass = "'{0}': static types cannot be used as type arguments";
- public const string PartialMethodToDelegate = "Cannot create delegate from method '{0}' because it is a partial method without an implementing declaration";
public const string IncrementLvalueExpected = "The operand of an increment or decrement operator must be a variable, property or indexer";
- public const string NoSuchMemberOrExtension = "'{0}' does not contain a definition for '{1}' and no extension method '{1}' accepting a first argument of type '{0}' could be found (are you missing a using directive or an assembly reference?)";
- public const string ValueTypeExtDelegate = "Extension methods '{0}' defined on value type '{1}' cannot be used to create delegates";
public const string BadArgCount = "No overload for method '{0}' takes '{1}' arguments";
public const string BadArgTypes = "The best overloaded method match for '{0}' has some invalid arguments";
- public const string BadArgType = "Argument '{0}': cannot convert from '{1}' to '{2}'";
public const string RefLvalueExpected = "A ref or out argument must be an assignable variable";
public const string BadProtectedAccess = "Cannot access protected member '{0}' via a qualifier of type '{1}'; the qualifier must be of type '{2}' (or derived from it)";
public const string BindToBogusProp2 = "Property, indexer, or event '{0}' is not supported by the language; try directly calling accessor methods '{1}' or '{2}'";
public const string AssgReadonlyLocal = "Cannot assign to '{0}' because it is read-only";
public const string RefReadonlyLocal = "Cannot pass '{0}' as a ref or out argument because it is read-only";
public const string ReturnNotLValue = "Cannot modify the return value of '{0}' because it is not a variable";
- public const string BadArgExtraRef = "Argument '{0}' should not be passed with the '{1}' keyword";
- public const string BadArgRef = "Argument '{0}' must be passed with the '{1}' keyword";
public const string AssgReadonly2 = "Members of readonly field '{0}' cannot be modified (except in a constructor or a variable initializer)";
public const string RefReadonly2 = "Members of readonly field '{0}' cannot be passed ref or out (except in a constructor)";
public const string AssgReadonlyStatic2 = "Fields of static readonly field '{0}' cannot be assigned to (except in a static constructor or a variable initializer)";
public const string RefReadonlyLocalCause = "Cannot pass '{0}' as a ref or out argument because it is a '{1}'";
public const string DelegateOnNullable = "Cannot bind delegate to '{0}' because it is a member of 'System.Nullable<T>'";
public const string BadCtorArgCount = "'{0}' does not contain a constructor that takes '{1}' arguments";
- public const string BadExtensionArgTypes = "'{0}' does not contain a definition for '{1}' and the best extension method overload '{2}' has some invalid arguments";
- public const string BadInstanceArgType = "Instance argument: cannot convert from '{0}' to '{1}'";
- public const string BadArgTypesForCollectionAdd = "The best overloaded Add method '{0}' for the collection initializer has some invalid arguments";
- public const string InitializerAddHasParamModifiers = "The best overloaded method match '{0}' for the collection initializer element cannot be used. Collection initializer 'Add' methods cannot have ref or out parameters.";
public const string NonInvocableMemberCalled = "Non-invocable member '{0}' cannot be used like a method.";
public const string NamedArgumentSpecificationBeforeFixedArgument = "Named argument specifications must appear after all fixed arguments have been specified";
public const string BadNamedArgument = "The best overload for '{0}' does not have a parameter named '{1}'";
public const string BadNamedArgumentForDelegateInvoke = "The delegate '{0}' does not have a parameter named '{1}'";
public const string DuplicateNamedArgument = "Named argument '{0}' cannot be specified multiple times";
public const string NamedArgumentUsedInPositional = "Named argument '{0}' specifies a parameter for which a positional argument has already been given";
- public const string TypeArgumentRequiredForStaticCall = "The first argument to dynamically-bound static call must be a Type";
+ public const string TypeArgumentRequiredForStaticCall = "The first argument to dynamically-bound static or constructor call must be a Type";
+ public const string DynamicArgumentNeedsValue = "The runtime binder cannot bind a metaobject without a value";
+ public const string BindingNameCollision = "More than one type in the binding has the same full name.";
}
$(CSCOMPILE) -r:$(topdir)/class/lib/$(PROFILE)/System.Core.dll -r:$(topdir)/class/lib/$(PROFILE)/System.dll -out:$@ -unsafe $(PLATFORM_DEBUG_FLAGS) -optimize- Test/dtest-app.cs $(TEST_HELPERS_SOURCES)
dtest-excfilter.exe: Test/dtest-excfilter.il
- MONO_PATH=$(topdir)/class/lib/$(PROFILE) $(INTERNAL_ILASM) -out:$@ /exe /debug Test/dtest-excfilter.il
+ $(ILASM) -out:$@ /exe /debug Test/dtest-excfilter.il
else
</PropertyGroup>\r
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
<ItemGroup>\r
+ <Compile Include="..\..\..\external\corefx\src\Common\src\System\Drawing\ColorTable.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\Common\src\System\Drawing\ColorUtil.netcoreapp21.cs" />\r
<Compile Include="..\..\..\external\corefx\src\System.Drawing.Common\src\AssemblyRef.cs" />\r
<Compile Include="..\..\..\external\corefx\src\System.Drawing.Common\src\misc\HandleCollector.cs" />\r
<Compile Include="..\..\..\external\corefx\src\System.Drawing.Common\src\System\Drawing\BitmapSuffixInSameAssemblyAttribute.cs" />\r
<Compile Include="..\..\..\external\corefx\src\System.Drawing.Common\src\System\Drawing\Drawing2D\CompositingQuality.cs" />\r
<Compile Include="..\..\..\external\corefx\src\System.Drawing.Common\src\System\Drawing\Drawing2D\CoordinateSpace.cs" />\r
<Compile Include="..\..\..\external\corefx\src\System.Drawing.Common\src\System\Drawing\Drawing2D\CustomLineCap.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Drawing.Common\src\System\Drawing\Drawing2D\CustomLineCap.Unix.cs" />\r
<Compile Include="..\..\..\external\corefx\src\System.Drawing.Common\src\System\Drawing\Drawing2D\CustomLineCapType.cs" />\r
<Compile Include="..\..\..\external\corefx\src\System.Drawing.Common\src\System\Drawing\Drawing2D\DashStyle.cs" />\r
<Compile Include="..\..\..\external\corefx\src\System.Drawing.Common\src\System\Drawing\Drawing2D\FillMode.cs" />\r
<Compile Include="..\..\..\external\corefx\src\System.Drawing.Common\src\System\Drawing\Internal\GPPOINTF.cs" />\r
<Compile Include="..\..\..\external\corefx\src\System.Drawing.Common\src\System\Drawing\Internal\GPRECT.cs" />\r
<Compile Include="..\..\..\external\corefx\src\System.Drawing.Common\src\System\Drawing\Internal\GPRECTF.cs" />\r
- <Compile Include="..\..\..\external\corefx\src\System.Drawing.Common\src\System\Drawing\Internal\ISystemEventTracker.cs" />\r
<Compile Include="..\..\..\external\corefx\src\System.Drawing.Common\src\System\Drawing\NativeMethods.cs" />\r
<Compile Include="..\..\..\external\corefx\src\System.Drawing.Common\src\System\Drawing\Printing\Duplex.cs" />\r
<Compile Include="..\..\..\external\corefx\src\System.Drawing.Common\src\System\Drawing\Printing\InvalidPrinterException.cs" />\r
//
using System.ComponentModel;
+using System.Runtime.InteropServices;
namespace System.Drawing.Drawing2D {
public override object Clone ()
{
IntPtr clonePtr;
- Status status = GDIPlus.GdipCloneBrush (NativeBrush, out clonePtr);
+ Status status = (Status) GDIPlus.GdipCloneBrush (new HandleRef (this, NativeBrush), out clonePtr);
GDIPlus.CheckStatus (status);
return new LinearGradientBrush (clonePtr);
//
using System.ComponentModel;
+using System.Runtime.InteropServices;
namespace System.Drawing.Drawing2D {
public override object Clone ()
{
IntPtr clonePtr;
- Status status = GDIPlus.GdipCloneBrush (NativeBrush, out clonePtr);
+ Status status = (Status) GDIPlus.GdipCloneBrush (new HandleRef(this, NativeBrush), out clonePtr);
GDIPlus.CheckStatus (status);
PathGradientBrush clone = new PathGradientBrush (clonePtr);
-corefx/SR.cs
System.Drawing/SR.cs
Assembly/AssemblyInfo.cs
+
+System.Drawing/gdipFunctions.cs
+
+corefx/SR.cs
+
../../build/common/Consts.cs
../../build/common/Locale.cs
../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/ClientUtils.cs
../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Internal/GPRECT.cs
../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Internal/GPRECTF.cs
../../../external/corefx/src/System.Drawing.Common/src/AssemblyRef.cs
-../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Internal/ISystemEventTracker.cs
System.Drawing/Bitmap.cs
../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/BitmapSuffixInSameAssemblyAttribute.cs
../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/BitmapSuffixInSatelliteAssemblyAttribute.cs
../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Text/InstalledFontCollection.cs
../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Text/TextRenderingHint.cs
+../../../external/corefx/src/Common/src/System/Drawing/ColorTable.cs
+../../../external/corefx/src/Common/src/System/Drawing/ColorUtil.netcoreapp21.cs
+
+../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Drawing2D/CustomLineCap.Unix.cs
namespace System.Drawing
{
+ internal partial class SafeNativeMethods
+ {
+ internal partial class Gdip : GDIPlus
+ {
+
+ }
+ }
+
/// <summary>
/// GDI+ API Functions
/// </summary>
- internal static class GDIPlus {
+ internal /*static*/ class GDIPlus {
public const int FACESIZE = 32;
public const int LANG_NEUTRAL = 0;
public static IntPtr Display = IntPtr.Zero;
// Brush functions
[DllImport(GdiPlus)]
- static internal extern Status GdipCloneBrush (IntPtr brush, out IntPtr clonedBrush);
+ static internal extern int GdipCloneBrush (HandleRef brush, out IntPtr clonedBrush);
[DllImport(GdiPlus)]
- static internal extern Status GdipDeleteBrush (IntPtr brush);
+ static internal extern int GdipDeleteBrush (HandleRef brush);
[DllImport(GdiPlus)]
- static internal extern Status GdipGetBrushType (IntPtr brush, out BrushType type);
+ static internal extern int GdipGetBrushType (HandleRef brush, out BrushType type);
// Region functions
// Solid brush functions
[DllImport(GdiPlus)]
- static internal extern Status GdipCreateSolidFill (int color, out IntPtr brush);
+ static internal extern int GdipCreateSolidFill (int color, out IntPtr brush);
[DllImport(GdiPlus)]
- static internal extern Status GdipGetSolidFillColor (IntPtr brush, out int color);
+ static internal extern int GdipGetSolidFillColor (HandleRef brush, out int color);
[DllImport(GdiPlus)]
- static internal extern Status GdipSetSolidFillColor (IntPtr brush, int color);
+ static internal extern int GdipSetSolidFillColor (HandleRef brush, int color);
// Hatch Brush functions
[DllImport(GdiPlus)]
- static internal extern Status GdipCreateHatchBrush (HatchStyle hatchstyle, int foreColor, int backColor, out IntPtr brush);
+ static internal extern int GdipCreateHatchBrush (/*HatchStyle*/ int hatchstyle, int foreColor, int backColor, out IntPtr brush);
[DllImport(GdiPlus)]
- static internal extern Status GdipGetHatchStyle (IntPtr brush, out HatchStyle hatchstyle);
+ static internal extern int GdipGetHatchStyle (HandleRef brush, out /*HatchStyle*/ int hatchstyle);
[DllImport(GdiPlus)]
- static internal extern Status GdipGetHatchForegroundColor (IntPtr brush, out int foreColor);
+ static internal extern int GdipGetHatchForegroundColor (HandleRef brush, out int foreColor);
[DllImport(GdiPlus)]
- static internal extern Status GdipGetHatchBackgroundColor (IntPtr brush, out int backColor);
+ static internal extern int GdipGetHatchBackgroundColor (HandleRef brush, out int backColor);
// Texture brush functions
[DllImport(GdiPlus)]
- static internal extern Status GdipGetTextureImage (IntPtr texture, out IntPtr image);
+ static internal extern int GdipGetTextureImage (HandleRef texture, out IntPtr image);
[DllImport(GdiPlus)]
- static internal extern Status GdipCreateTexture (IntPtr image, WrapMode wrapMode, out IntPtr texture);
+ static internal extern int GdipCreateTexture (HandleRef image, /*WrapMode*/ int wrapMode, out IntPtr texture);
[DllImport(GdiPlus)]
- static internal extern Status GdipCreateTextureIAI (IntPtr image, IntPtr imageAttributes, int x, int y, int width, int height, out IntPtr texture);
+ static internal extern int GdipCreateTextureIAI (HandleRef image, HandleRef imageAttributes, int x, int y, int width, int height, out IntPtr texture);
[DllImport(GdiPlus)]
- static internal extern Status GdipCreateTextureIA (IntPtr image, IntPtr imageAttributes, float x, float y, float width, float height, out IntPtr texture);
+ static internal extern int GdipCreateTextureIA (HandleRef image, HandleRef imageAttributes, float x, float y, float width, float height, out IntPtr texture);
[DllImport(GdiPlus)]
- static internal extern Status GdipCreateTexture2I (IntPtr image, WrapMode wrapMode, int x, int y, int width, int height, out IntPtr texture);
+ static internal extern int GdipCreateTexture2I (HandleRef image, /*WrapMode*/ int wrapMode, int x, int y, int width, int height, out IntPtr texture);
[DllImport(GdiPlus)]
- static internal extern Status GdipCreateTexture2 (IntPtr image, WrapMode wrapMode, float x, float y, float width, float height, out IntPtr texture);
+ static internal extern int GdipCreateTexture2 (HandleRef image, /*WrapMode*/ int wrapMode, float x, float y, float width, float height, out IntPtr texture);
[DllImport(GdiPlus)]
- static internal extern Status GdipGetTextureTransform (IntPtr texture, IntPtr matrix);
+ static internal extern int GdipGetTextureTransform (HandleRef texture, HandleRef matrix);
[DllImport(GdiPlus)]
- static internal extern Status GdipSetTextureTransform (IntPtr texture, IntPtr matrix);
+ static internal extern int GdipSetTextureTransform (HandleRef texture, HandleRef matrix);
[DllImport(GdiPlus)]
- static internal extern Status GdipGetTextureWrapMode (IntPtr texture, out WrapMode wrapMode);
+ static internal extern int GdipGetTextureWrapMode (HandleRef texture, out /*WrapMode*/ int wrapMode);
[DllImport(GdiPlus)]
- static internal extern Status GdipSetTextureWrapMode (IntPtr texture, WrapMode wrapMode);
+ static internal extern int GdipSetTextureWrapMode (HandleRef texture, /*WrapMode*/ int wrapMode);
[DllImport(GdiPlus)]
- static internal extern Status GdipMultiplyTextureTransform (IntPtr texture, IntPtr matrix, MatrixOrder order);
+ static internal extern int GdipMultiplyTextureTransform (HandleRef texture, HandleRef matrix, MatrixOrder order);
[DllImport(GdiPlus)]
- static internal extern Status GdipResetTextureTransform (IntPtr texture);
+ static internal extern int GdipResetTextureTransform (HandleRef texture);
[DllImport(GdiPlus)]
- static internal extern Status GdipRotateTextureTransform (IntPtr texture, float angle, MatrixOrder order);
+ static internal extern int GdipRotateTextureTransform (HandleRef texture, float angle, MatrixOrder order);
[DllImport(GdiPlus)]
- static internal extern Status GdipScaleTextureTransform (IntPtr texture, float sx, float sy, MatrixOrder order);
+ static internal extern int GdipScaleTextureTransform (HandleRef texture, float sx, float sy, MatrixOrder order);
[DllImport(GdiPlus)]
- static internal extern Status GdipTranslateTextureTransform (IntPtr texture, float dx, float dy, MatrixOrder order);
+ static internal extern int GdipTranslateTextureTransform (HandleRef texture, float dx, float dy, MatrixOrder order);
// PathGradientBrush functions
[DllImport(GdiPlus)]
static internal extern Status GdipGetRenderingOrigin (IntPtr graphics, out int x, out int y);
[DllImport (GdiPlus)]
static internal extern Status GdipSetRenderingOrigin (IntPtr graphics, int x, int y);
- [DllImport(GdiPlus)]
- internal static extern Status GdipCloneBitmapArea (float x, float y, float width, float height, PixelFormat format, IntPtr original, out IntPtr bitmap);
- [DllImport(GdiPlus)]
- internal static extern Status GdipCloneBitmapAreaI (int x, int y, int width, int height, PixelFormat format, IntPtr original, out IntPtr bitmap);
- [DllImport(GdiPlus)]
- internal static extern Status GdipResetWorldTransform (IntPtr graphics);
- [DllImport(GdiPlus)]
- internal static extern Status GdipSetWorldTransform (IntPtr graphics, IntPtr matrix);
- [DllImport(GdiPlus)]
- internal static extern Status GdipGetWorldTransform (IntPtr graphics, IntPtr matrix);
- [DllImport(GdiPlus)]
- internal static extern Status GdipScaleWorldTransform (IntPtr graphics, float sx, float sy, MatrixOrder order);
- [DllImport(GdiPlus)]
- internal static extern Status GdipGraphicsClear(IntPtr graphics, int argb);
- [DllImport(GdiPlus)]
- internal static extern Status GdipDrawClosedCurve(IntPtr graphics, IntPtr pen, PointF [] points, int count);
- [DllImport(GdiPlus)]
- internal static extern Status GdipDrawClosedCurveI(IntPtr graphics, IntPtr pen, Point [] points, int count);
- [DllImport(GdiPlus)]
- internal static extern Status GdipDrawClosedCurve2(IntPtr graphics, IntPtr pen, PointF [] points, int count, float tension);
- [DllImport(GdiPlus)]
- internal static extern Status GdipDrawClosedCurve2I(IntPtr graphics, IntPtr pen, Point [] points, int count, float tension);
- [DllImport(GdiPlus)]
- internal static extern Status GdipDrawCurve(IntPtr graphics, IntPtr pen, PointF [] points, int count);
- [DllImport(GdiPlus)]
- internal static extern Status GdipDrawCurveI(IntPtr graphics, IntPtr pen, Point [] points, int count);
- [DllImport(GdiPlus)]
- internal static extern Status GdipDrawCurve2(IntPtr graphics, IntPtr pen, PointF [] points, int count, float tension);
- [DllImport(GdiPlus)]
- internal static extern Status GdipDrawCurve2I(IntPtr graphics, IntPtr pen, Point [] points, int count, float tension);
- [DllImport(GdiPlus)]
- internal static extern Status GdipDrawCurve3(IntPtr graphics, IntPtr pen, PointF [] points, int count, int offset, int numberOfSegments, float tension);
- [DllImport(GdiPlus)]
- internal static extern Status GdipDrawCurve3I(IntPtr graphics, IntPtr pen, Point [] points, int count, int offset, int numberOfSegments, float tension);
- [DllImport(GdiPlus)]
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipCloneBitmapArea (float x, float y, float width, float height, PixelFormat format, IntPtr original, out IntPtr bitmap);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipCloneBitmapAreaI (int x, int y, int width, int height, PixelFormat format, IntPtr original, out IntPtr bitmap);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipResetWorldTransform (IntPtr graphics);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipSetWorldTransform (IntPtr graphics, IntPtr matrix);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipGetWorldTransform (IntPtr graphics, IntPtr matrix);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipScaleWorldTransform (IntPtr graphics, float sx, float sy, MatrixOrder order);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipGraphicsClear(IntPtr graphics, int argb);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipDrawClosedCurve(IntPtr graphics, IntPtr pen, PointF [] points, int count);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipDrawClosedCurveI(IntPtr graphics, IntPtr pen, Point [] points, int count);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipDrawClosedCurve2(IntPtr graphics, IntPtr pen, PointF [] points, int count, float tension);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipDrawClosedCurve2I(IntPtr graphics, IntPtr pen, Point [] points, int count, float tension);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipDrawCurve(IntPtr graphics, IntPtr pen, PointF [] points, int count);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipDrawCurveI(IntPtr graphics, IntPtr pen, Point [] points, int count);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipDrawCurve2(IntPtr graphics, IntPtr pen, PointF [] points, int count, float tension);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipDrawCurve2I(IntPtr graphics, IntPtr pen, Point [] points, int count, float tension);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipDrawCurve3(IntPtr graphics, IntPtr pen, PointF [] points, int count, int offset, int numberOfSegments, float tension);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipDrawCurve3I(IntPtr graphics, IntPtr pen, Point [] points, int count, int offset, int numberOfSegments, float tension);
+ [DllImport(GdiPlus)]
internal static extern Status GdipSetClipRect(IntPtr graphics, float x, float y, float width, float height, CombineMode combineMode);
[DllImport(GdiPlus)]
internal static extern Status GdipSetClipRectI(IntPtr graphics, int x, int y, int width, int height, CombineMode combineMode);
// CustomLineCap functions
[DllImport(GdiPlus)]
- internal static extern Status GdipCreateCustomLineCap (IntPtr fillPath, IntPtr strokePath, LineCap baseCap, float baseInset, out IntPtr customCap);
+ internal static extern int GdipCreateCustomLineCap (HandleRef fillPath, HandleRef strokePath, LineCap baseCap, float baseInset, out IntPtr customCap);
[DllImport(GdiPlus)]
- internal static extern Status GdipDeleteCustomLineCap (IntPtr customCap);
+ internal static extern int GdipDeleteCustomLineCap (HandleRef customCap);
[DllImport(GdiPlus)]
- internal static extern Status GdipCloneCustomLineCap (IntPtr customCap, out IntPtr clonedCap);
+ internal static extern int GdipCloneCustomLineCap (HandleRef customCap, out IntPtr clonedCap);
[DllImport(GdiPlus)]
- internal static extern Status GdipSetCustomLineCapStrokeCaps (IntPtr customCap, LineCap startCap, LineCap endCap);
+ internal static extern int GdipSetCustomLineCapStrokeCaps (HandleRef customCap, LineCap startCap, LineCap endCap);
[DllImport(GdiPlus)]
- internal static extern Status GdipGetCustomLineCapStrokeCaps (IntPtr customCap, out LineCap startCap, out LineCap endCap);
+ internal static extern int GdipGetCustomLineCapStrokeCaps (HandleRef customCap, out LineCap startCap, out LineCap endCap);
[DllImport(GdiPlus)]
- internal static extern Status GdipSetCustomLineCapStrokeJoin (IntPtr customCap, LineJoin lineJoin);
+ internal static extern int GdipSetCustomLineCapStrokeJoin (HandleRef customCap, LineJoin lineJoin);
[DllImport(GdiPlus)]
- internal static extern Status GdipGetCustomLineCapStrokeJoin (IntPtr customCap, out LineJoin lineJoin);
+ internal static extern int GdipGetCustomLineCapStrokeJoin (HandleRef customCap, out LineJoin lineJoin);
[DllImport(GdiPlus)]
- internal static extern Status GdipSetCustomLineCapBaseCap (IntPtr customCap, LineCap baseCap);
+ internal static extern int GdipSetCustomLineCapBaseCap (HandleRef customCap, LineCap baseCap);
[DllImport(GdiPlus)]
- internal static extern Status GdipGetCustomLineCapBaseCap (IntPtr customCap, out LineCap baseCap);
+ internal static extern int GdipGetCustomLineCapBaseCap (HandleRef customCap, out LineCap baseCap);
[DllImport(GdiPlus)]
- internal static extern Status GdipSetCustomLineCapBaseInset (IntPtr customCap, float inset);
+ internal static extern int GdipSetCustomLineCapBaseInset (HandleRef customCap, float inset);
[DllImport(GdiPlus)]
- internal static extern Status GdipGetCustomLineCapBaseInset (IntPtr customCap, out float inset);
+ internal static extern int GdipGetCustomLineCapBaseInset (HandleRef customCap, out float inset);
[DllImport(GdiPlus)]
- internal static extern Status GdipSetCustomLineCapWidthScale (IntPtr customCap, float widthScale);
+ internal static extern int GdipSetCustomLineCapWidthScale (HandleRef customCap, float widthScale);
[DllImport(GdiPlus)]
- internal static extern Status GdipGetCustomLineCapWidthScale (IntPtr customCap, out float widthScale);
+ internal static extern int GdipGetCustomLineCapWidthScale (HandleRef customCap, out float widthScale);
// AdjustableArrowCap functions
[DllImport(GdiPlus)]
- internal static extern Status GdipCreateAdjustableArrowCap (float height, float width, bool isFilled, out IntPtr arrowCap);
+ internal static extern int GdipCreateAdjustableArrowCap (float height, float width, bool isFilled, out IntPtr arrowCap);
[DllImport(GdiPlus)]
- internal static extern Status GdipSetAdjustableArrowCapHeight (IntPtr arrowCap, float height);
+ internal static extern int GdipSetAdjustableArrowCapHeight (HandleRef arrowCap, float height);
[DllImport(GdiPlus)]
- internal static extern Status GdipGetAdjustableArrowCapHeight (IntPtr arrowCap, out float height);
+ internal static extern int GdipGetAdjustableArrowCapHeight (HandleRef arrowCap, out float height);
[DllImport(GdiPlus)]
- internal static extern Status GdipSetAdjustableArrowCapWidth (IntPtr arrowCap, float width);
+ internal static extern int GdipSetAdjustableArrowCapWidth (HandleRef arrowCap, float width);
[DllImport(GdiPlus)]
- internal static extern Status GdipGetAdjustableArrowCapWidth (IntPtr arrowCap, out float width);
+ internal static extern int GdipGetAdjustableArrowCapWidth (HandleRef arrowCap, out float width);
[DllImport(GdiPlus)]
- internal static extern Status GdipSetAdjustableArrowCapMiddleInset (IntPtr arrowCap, float middleInset);
+ internal static extern int GdipSetAdjustableArrowCapMiddleInset (HandleRef arrowCap, float middleInset);
[DllImport(GdiPlus)]
- internal static extern Status GdipGetAdjustableArrowCapMiddleInset (IntPtr arrowCap, out float middleInset);
+ internal static extern int GdipGetAdjustableArrowCapMiddleInset (HandleRef arrowCap, out float middleInset);
[DllImport(GdiPlus)]
- internal static extern Status GdipSetAdjustableArrowCapFillState (IntPtr arrowCap, bool isFilled);
+ internal static extern int GdipSetAdjustableArrowCapFillState (HandleRef arrowCap, bool isFilled);
[DllImport(GdiPlus)]
- internal static extern Status GdipGetAdjustableArrowCapFillState (IntPtr arrowCap, out bool isFilled);
+ internal static extern int GdipGetAdjustableArrowCapFillState (HandleRef arrowCap, out bool isFilled);
[DllImport(GdiPlus)]
// GraphicsPathIterator
[DllImport(GdiPlus)]
- internal static extern Status GdipCreatePathIter (out IntPtr iterator, IntPtr path);
+ internal static extern int GdipCreatePathIter (out IntPtr iterator, HandleRef path);
[DllImport(GdiPlus)]
- internal static extern Status GdipPathIterGetCount (IntPtr iterator, out int count);
+ internal static extern int GdipPathIterGetCount (HandleRef iterator, out int count);
[DllImport(GdiPlus)]
- internal static extern Status GdipPathIterGetSubpathCount (IntPtr iterator, out int count);
+ internal static extern int GdipPathIterGetSubpathCount (HandleRef iterator, out int count);
[DllImport(GdiPlus)]
- internal static extern Status GdipDeletePathIter (IntPtr iterator);
+ internal static extern int GdipDeletePathIter (HandleRef iterator);
[DllImport(GdiPlus)]
- internal static extern Status GdipPathIterCopyData (IntPtr iterator, out int resultCount, PointF [] points, byte [] types, int startIndex, int endIndex);
+ internal static extern int GdipPathIterCopyData (HandleRef iterator, out int resultCount, /*PointF[]*/ IntPtr points, byte [] types, int startIndex, int endIndex);
[DllImport(GdiPlus)]
- internal static extern Status GdipPathIterEnumerate (IntPtr iterator, out int resultCount, PointF [] points, byte [] types, int count);
+ internal static extern int GdipPathIterEnumerate (HandleRef iterator, out int resultCount, /*PointF[]*/ IntPtr points, byte [] types, int count);
[DllImport(GdiPlus)]
- internal static extern Status GdipPathIterHasCurve (IntPtr iterator, out bool curve);
+ internal static extern int GdipPathIterHasCurve (HandleRef iterator, out bool curve);
[DllImport(GdiPlus)]
- internal static extern Status GdipPathIterNextMarkerPath (IntPtr iterator, out int resultCount, IntPtr path);
+ internal static extern int GdipPathIterNextMarkerPath (HandleRef iterator, out int resultCount, HandleRef path);
[DllImport(GdiPlus)]
- internal static extern Status GdipPathIterNextMarker (IntPtr iterator, out int resultCount, out int startIndex, out int endIndex);
+ internal static extern int GdipPathIterNextMarker (HandleRef iterator, out int resultCount, out int startIndex, out int endIndex);
[DllImport(GdiPlus)]
- internal static extern Status GdipPathIterNextPathType (IntPtr iterator, out int resultCount, out byte pathType, out int startIndex, out int endIndex);
+ internal static extern int GdipPathIterNextPathType (HandleRef iterator, out int resultCount, out byte pathType, out int startIndex, out int endIndex);
[DllImport(GdiPlus)]
- internal static extern Status GdipPathIterNextSubpathPath (IntPtr iterator, out int resultCount, IntPtr path, out bool isClosed);
+ internal static extern int GdipPathIterNextSubpathPath (HandleRef iterator, out int resultCount, HandleRef path, out bool isClosed);
[DllImport(GdiPlus)]
- internal static extern Status GdipPathIterNextSubpath (IntPtr iterator, out int resultCount, out int startIndex, out int endIndex, out bool isClosed);
+ internal static extern int GdipPathIterNextSubpath (HandleRef iterator, out int resultCount, out int startIndex, out int endIndex, out bool isClosed);
[DllImport(GdiPlus)]
- internal static extern Status GdipPathIterRewind (IntPtr iterator);
+ internal static extern int GdipPathIterRewind (HandleRef iterator);
// ImageAttributes
[DllImport (GdiPlus)]
- internal static extern Status GdipCreateImageAttributes (out IntPtr imageattr);
+ internal static extern int GdipCreateImageAttributes (out IntPtr imageattr);
[DllImport (GdiPlus)]
- internal static extern Status GdipSetImageAttributesColorKeys (IntPtr imageattr,
+ internal static extern int GdipSetImageAttributesColorKeys (HandleRef imageattr,
ColorAdjustType type, bool enableFlag, int colorLow, int colorHigh);
[DllImport (GdiPlus)]
- internal static extern Status GdipDisposeImageAttributes (IntPtr imageattr);
+ internal static extern int GdipDisposeImageAttributes (HandleRef imageattr);
[DllImport (GdiPlus)]
- internal static extern Status GdipSetImageAttributesColorMatrix (IntPtr imageattr,
- ColorAdjustType type, bool enableFlag, IntPtr colorMatrix,
- IntPtr grayMatrix, ColorMatrixFlag flags);
+ internal static extern int GdipSetImageAttributesColorMatrix (HandleRef imageattr,
+ ColorAdjustType type, bool enableFlag, ColorMatrix colorMatrix,
+ ColorMatrix grayMatrix, ColorMatrixFlag flags);
[DllImport (GdiPlus)]
- internal static extern Status GdipSetImageAttributesGamma (IntPtr imageattr,
+ internal static extern int GdipSetImageAttributesGamma (HandleRef imageattr,
ColorAdjustType type, bool enableFlag,
float gamma);
[DllImport (GdiPlus)]
- internal static extern Status GdipSetImageAttributesNoOp (IntPtr imageattr,
+ internal static extern int GdipSetImageAttributesNoOp (HandleRef imageattr,
ColorAdjustType type, bool enableFlag);
[DllImport (GdiPlus)]
- internal static extern Status GdipSetImageAttributesOutputChannel (IntPtr imageattr,
+ internal static extern int GdipSetImageAttributesOutputChannel (HandleRef imageattr,
ColorAdjustType type, bool enableFlag, ColorChannelFlag channelFlags);
[DllImport (GdiPlus, CharSet=CharSet.Auto)]
- internal static extern Status GdipSetImageAttributesOutputChannelColorProfile (IntPtr imageattr,
+ internal static extern int GdipSetImageAttributesOutputChannelColorProfile (HandleRef imageattr,
ColorAdjustType type, bool enableFlag, [MarshalAs (UnmanagedType.LPWStr)] string profileName);
[DllImport (GdiPlus)]
- internal static extern Status GdipSetImageAttributesRemapTable (IntPtr imageattr,
- ColorAdjustType type, bool enableFlag, uint mapSize, IntPtr colorMap);
+ internal static extern int GdipSetImageAttributesRemapTable (HandleRef imageattr,
+ ColorAdjustType type, bool enableFlag, int mapSize, HandleRef colorMap);
[DllImport (GdiPlus)]
- internal static extern Status GdipSetImageAttributesThreshold (IntPtr imageattr,
+ internal static extern int GdipSetImageAttributesThreshold (HandleRef imageattr,
ColorAdjustType type, bool enableFlag, float thresHold);
[DllImport (GdiPlus)]
- internal static extern Status GdipCloneImageAttributes(IntPtr imageattr, out IntPtr cloneImageattr);
+ internal static extern int GdipCloneImageAttributes(HandleRef imageattr, out IntPtr cloneImageattr);
[DllImport (GdiPlus)]
- internal static extern Status GdipGetImageAttributesAdjustedPalette (IntPtr imageattr, IntPtr colorPalette,
+ internal static extern int GdipGetImageAttributesAdjustedPalette (HandleRef imageattr, HandleRef colorPalette,
ColorAdjustType colorAdjustType);
[DllImport (GdiPlus)]
- internal static extern Status GdipSetImageAttributesWrapMode(IntPtr imageattr, WrapMode wrap,
+ internal static extern int GdipSetImageAttributesWrapMode(HandleRef imageattr, /*WrapMode*/ int wrap,
int argb, bool clamp);
// FontCollection
[DllImport (GdiPlus)]
- internal static extern Status GdipGetFontCollectionFamilyCount (IntPtr collection, out int found);
+ internal static extern int GdipGetFontCollectionFamilyCount (HandleRef collection, out int found);
[DllImport (GdiPlus)]
- internal static extern Status GdipGetFontCollectionFamilyList (IntPtr collection, int getCount, IntPtr[] dest, out int retCount);
+ internal static extern int GdipGetFontCollectionFamilyList (HandleRef collection, int getCount, IntPtr[] dest, out int retCount);
//internal static extern Status GdipGetFontCollectionFamilyList( IntPtr collection, int getCount, [Out] FontFamily [] familyList, out int retCount );
[DllImport (GdiPlus)]
- internal static extern Status GdipNewInstalledFontCollection (out IntPtr collection);
+ internal static extern int GdipNewInstalledFontCollection (out IntPtr collection);
[DllImport (GdiPlus)]
internal static extern Status GdipNewPrivateFontCollection (out IntPtr collection);
internal static extern Status GdipGetFontHeightGivenDPI (IntPtr font, float dpi, out float height);
[DllImport (GdiPlus)]
- internal static extern Status GdipCloneFontFamily (IntPtr fontFamily, out IntPtr clone);
+ internal static extern int GdipCloneFontFamily (HandleRef fontFamily, out IntPtr clone);
// String Format
#endif
//ImageCodecInfo functions
[DllImport(GdiPlus)]
- static internal extern Status GdipGetImageDecodersSize (out int decoderNums, out int arraySize);
+ static internal extern int GdipGetImageDecodersSize (out int decoderNums, out int arraySize);
[DllImport(GdiPlus)]
- static internal extern Status GdipGetImageDecoders (int decoderNums, int arraySize, IntPtr decoders);
+ static internal extern int GdipGetImageDecoders (int decoderNums, int arraySize, IntPtr decoders);
[DllImport(GdiPlus)]
- static internal extern Status GdipGetImageEncodersSize (out int encoderNums, out int arraySize);
+ static internal extern int GdipGetImageEncodersSize (out int encoderNums, out int arraySize);
[DllImport(GdiPlus)]
- static internal extern Status GdipGetImageEncoders (int encoderNums, int arraySize, IntPtr encoders);
+ static internal extern int GdipGetImageEncoders (int encoderNums, int arraySize, IntPtr encoders);
//
// These are stuff that is unix-only
../../test-helpers/NunitHelpers.cs
../../../build/common/Locale.cs
-../../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Gdiplus.cs
-../../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/NativeMethods.cs
-../../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/UnsafeNativeMethods.cs
-../../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Internal/GPPOINT.cs
-../../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Internal/GPPOINTF.cs
-../../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Internal/GPRECT.cs
-../../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Internal/GPRECTF.cs
-../../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Drawing2D/CustomLineCapType.cs
-../../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/PropertyItemInternal.cs
-../../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Imaging/PropertyItem.cs
-../../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Imaging/MetafileHeaderWmf.cs
-../../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Imaging/MetafileHeaderEmf.cs
-../../../../external/corefx/src/System.Drawing.Common/src/System/Drawing/Imaging/EmfPlusFlags.cs
-../../../../external/corefx/src/System.Drawing.Common/src/misc/HandleCollector.cs
-../corefx/SR.cs
-../System.Drawing/SR.cs
-../System.Drawing/ExternDll.cs
-../System.Drawing/gdipEnums.cs
+
+../System.Drawing/gdipEnums.cs
../System.Drawing/gdipFunctions.cs
../System.Drawing/gdipStructs.cs
+
HostIgnoreList.cs
System.Drawing/ColorTranslator.cs
System.Drawing/ColorConverter.cs
[TestFixture]
public class GDIPlusTest {
+ static readonly HandleRef HandleRefZero = new HandleRef (null, IntPtr.Zero);
+
// for the moment this LOGFONT is different (and ok) from the one defined internally in SD
[StructLayout (LayoutKind.Sequential, CharSet = CharSet.Auto)]
public class LOGFONT {
Assert.AreEqual (Status.Ok, GDIPlus.GdipCreatePath (FillMode.Alternate, out path), "GdipCreatePath");
// test invalid conditions for #81829
- Assert.AreEqual (Status.Ok, GDIPlus.GdipCreateCustomLineCap (IntPtr.Zero, path, LineCap.Flat, 1.0f, out cap), "GdipCreateCustomLineCap-FillPath-Null");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipDeleteCustomLineCap (cap), "GdipDeleteCustomLineCap-1");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipCreateCustomLineCap (path, IntPtr.Zero, LineCap.Flat, 1.0f, out cap), "GdipCreateCustomLineCap-StrokePath-Null");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipDeleteCustomLineCap (cap), "GdipDeleteCustomLineCap-2");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipCreateCustomLineCap (HandleRefZero, new HandleRef (this, path), LineCap.Flat, 1.0f, out cap), "GdipCreateCustomLineCap-FillPath-Null");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipDeleteCustomLineCap (new HandleRef (this, cap)), "GdipDeleteCustomLineCap-1");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipCreateCustomLineCap (new HandleRef (this, path), HandleRefZero, LineCap.Flat, 1.0f, out cap), "GdipCreateCustomLineCap-StrokePath-Null");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipDeleteCustomLineCap (new HandleRef (this, cap)), "GdipDeleteCustomLineCap-2");
Assert.AreEqual (Status.Ok, GDIPlus.GdipDeletePath (path), "GdipDeletePath");
}
public void CloneFontFamily ()
{
IntPtr font_family = IntPtr.Zero;
- Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipCloneFontFamily (IntPtr.Zero, out font_family), "GdipCloneFontFamily(null)");
+ Assert.AreEqual ((int) Status.InvalidParameter, GDIPlus.GdipCloneFontFamily (HandleRefZero, out font_family), "GdipCloneFontFamily(null)");
GDIPlus.GdipCreateFontFamilyFromName ("Arial", IntPtr.Zero, out font_family);
if (font_family != IntPtr.Zero) {
+ var font_family_handle = new HandleRef (this, font_family);
+
IntPtr clone;
- Assert.AreEqual (Status.Ok, GDIPlus.GdipCloneFontFamily (font_family, out clone), "GdipCloneFontFamily(arial)");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipCloneFontFamily (font_family_handle, out clone), "GdipCloneFontFamily(arial)");
Assert.IsTrue (clone != IntPtr.Zero, "clone");
Assert.AreEqual (Status.Ok, GDIPlus.GdipDeleteFontFamily (font_family), "GdipDeleteFontFamily(arial)");
Assert.AreEqual (Status.Ok, GDIPlus.GdipDeleteFontFamily (clone), "GdipDeleteFontFamily(clone)");
[Test]
public void DeleteBrush ()
{
- Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipDeleteBrush (IntPtr.Zero), "GdipDeleteBrush");
+ Assert.AreEqual ((int) Status.InvalidParameter, GDIPlus.GdipDeleteBrush (HandleRefZero), "GdipDeleteBrush");
}
// Graphics
{
IntPtr path;
Assert.AreEqual (Status.Ok, GDIPlus.GdipCreatePath (FillMode.Alternate, out path), "GdipCreatePath");
-
+ var pathHandle = new HandleRef (this, path);
+
IntPtr iter;
- Assert.AreEqual (Status.Ok, GDIPlus.GdipCreatePathIter (out iter, path), "GdipCreatePathIter");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipCreatePathIter (out iter, pathHandle), "GdipCreatePathIter");
+ var iterHandle = new HandleRef (this, iter);
int count = -1;
- Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipPathIterGetCount (IntPtr.Zero, out count), "GdipPathIterGetCount-null");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipPathIterGetCount (iter, out count), "GdipPathIterGetCount");
+ Assert.AreEqual ((int) Status.InvalidParameter, GDIPlus.GdipPathIterGetCount (HandleRefZero, out count), "GdipPathIterGetCount-null");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipPathIterGetCount (iterHandle, out count), "GdipPathIterGetCount");
Assert.AreEqual (0, count, "count-1");
count = -1;
- Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipPathIterGetSubpathCount (IntPtr.Zero, out count), "GdipPathIterGetSubpathCount-null");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipPathIterGetSubpathCount (iter, out count), "GdipPathIterGetSubpathCount");
+ Assert.AreEqual ((int) Status.InvalidParameter, GDIPlus.GdipPathIterGetSubpathCount (HandleRefZero, out count), "GdipPathIterGetSubpathCount-null");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipPathIterGetSubpathCount (iterHandle, out count), "GdipPathIterGetSubpathCount");
Assert.AreEqual (0, count, "count-2");
bool curve;
- Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipPathIterHasCurve (IntPtr.Zero, out curve), "GdipPathIterHasCurve-null");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipPathIterHasCurve (iter, out curve), "GdipPathIterHasCurve");
+ Assert.AreEqual ((int) Status.InvalidParameter, GDIPlus.GdipPathIterHasCurve (HandleRefZero, out curve), "GdipPathIterHasCurve-null");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipPathIterHasCurve (iterHandle, out curve), "GdipPathIterHasCurve");
Assert.IsFalse (curve, "curve");
int result;
PointF[] points = new PointF[count];
byte[] types = new byte[count];
- Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipPathIterEnumerate (IntPtr.Zero, out result, points, types, count), "GdipPathIterEnumerate-iter");
- Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipPathIterEnumerate (iter, out result, null, types, count), "GdipPathIterEnumerate-points");
- Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipPathIterEnumerate (iter, out result, points, null, count), "GdipPathIterEnumerate-types");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipPathIterEnumerate (iter, out result, points, types, -1), "GdipPathIterEnumerate-count");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipPathIterEnumerate (iter, out result, points, types, count), "GdipPathIterEnumerate");
-
- Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipPathIterCopyData (IntPtr.Zero, out result, points, types, 0, 0), "GdipPathIterCopyData-iter");
- Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipPathIterCopyData (iter, out result, null, types, 0, 0), "GdipPathIterCopyData-points");
- Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipPathIterCopyData (iter, out result, points, null, 0, 0), "GdipPathIterCopyData-types");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipPathIterCopyData (iter, out result, points, types, -1, 0), "GdipPathIterCopyData-start");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipPathIterCopyData (iter, out result, points, types, 0, -1), "GdipPathIterCopyData-end");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipPathIterCopyData (iter, out result, points, types, 0, 0), "GdipPathIterCopyData");
-
- Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipPathIterNextMarkerPath (IntPtr.Zero, out result, path), "GdipPathIterNextMarkerPath-iter");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipPathIterNextMarkerPath (iter, out result, IntPtr.Zero), "GdipPathIterNextMarkerPath-path");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipPathIterNextMarkerPath (iter, out result, path), "GdipPathIterNextMarkerPath");
+// Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipPathIterEnumerate (HandleRefZero, out result, points, types, count), "GdipPathIterEnumerate-iter");
+// Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipPathIterEnumerate (iterHandle, out result, null, types, count), "GdipPathIterEnumerate-points");
+// Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipPathIterEnumerate (iterHandle, out result, points, null, count), "GdipPathIterEnumerate-types");
+// Assert.AreEqual (Status.Ok, GDIPlus.GdipPathIterEnumerate (iterHandle, out result, points, types, -1), "GdipPathIterEnumerate-count");
+// Assert.AreEqual (Status.Ok, GDIPlus.GdipPathIterEnumerate (iterHandle, out result, points, types, count), "GdipPathIterEnumerate");
+
+// Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipPathIterCopyData (HandleRefZero, out result, points, types, 0, 0), "GdipPathIterCopyData-iter");
+// Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipPathIterCopyData (iterHandle, out result, null, types, 0, 0), "GdipPathIterCopyData-points");
+// Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipPathIterCopyData (iterHandle, out result, points, null, 0, 0), "GdipPathIterCopyData-types");
+// Assert.AreEqual (Status.Ok, GDIPlus.GdipPathIterCopyData (iterHandle, out result, points, types, -1, 0), "GdipPathIterCopyData-start");
+// Assert.AreEqual (Status.Ok, GDIPlus.GdipPathIterCopyData (iterHandle, out result, points, types, 0, -1), "GdipPathIterCopyData-end");
+// Assert.AreEqual (Status.Ok, GDIPlus.GdipPathIterCopyData (iterHandle, out result, points, types, 0, 0), "GdipPathIterCopyData");
+
+ Assert.AreEqual ((int) Status.InvalidParameter, GDIPlus.GdipPathIterNextMarkerPath (HandleRefZero, out result, pathHandle), "GdipPathIterNextMarkerPath-iter");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipPathIterNextMarkerPath (iterHandle, out result, HandleRefZero), "GdipPathIterNextMarkerPath-path");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipPathIterNextMarkerPath (iterHandle, out result, pathHandle), "GdipPathIterNextMarkerPath");
result = -1;
int start = -1;
int end = -1;
- Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipPathIterNextMarker (IntPtr.Zero, out result, out start, out end), "GdipPathIterNextMarker-iter");
+ Assert.AreEqual ((int) Status.InvalidParameter, GDIPlus.GdipPathIterNextMarker (HandleRefZero, out result, out start, out end), "GdipPathIterNextMarker-iter");
start = -1;
end = -1;
- Assert.AreEqual (Status.Ok, GDIPlus.GdipPathIterNextMarker (iter, out result, out start, out end), "GdipPathIterNextMarker");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipPathIterNextMarker (iterHandle, out result, out start, out end), "GdipPathIterNextMarker");
Assert.AreEqual (0, result, "result-4");
Assert.AreEqual (-1, start, "start-1");
Assert.AreEqual (-1, end, "end-1");
byte pathType = 255;
- Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipPathIterNextPathType (IntPtr.Zero, out result, out pathType, out start, out end), "GdipPathIterNextPathType-iter");
+ Assert.AreEqual ((int) Status.InvalidParameter, GDIPlus.GdipPathIterNextPathType (HandleRefZero, out result, out pathType, out start, out end), "GdipPathIterNextPathType-iter");
pathType = 255;
start = -1;
end = -1;
- Assert.AreEqual (Status.Ok, GDIPlus.GdipPathIterNextPathType (iter, out result, out pathType, out start, out end), "GdipPathIterNextPathType");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipPathIterNextPathType (iterHandle, out result, out pathType, out start, out end), "GdipPathIterNextPathType");
Assert.AreEqual (0, result, "result-5");
Assert.AreEqual (255, pathType, "pathType");
Assert.AreEqual (-1, start, "start-2");
Assert.AreEqual (-1, end, "end-2");
bool closed = false;
- Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipPathIterNextSubpathPath (IntPtr.Zero, out result, IntPtr.Zero, out closed), "GdipPathIterNextSubpathPath-iter");
+ Assert.AreEqual ((int) Status.InvalidParameter, GDIPlus.GdipPathIterNextSubpathPath (HandleRefZero, out result, HandleRefZero, out closed), "GdipPathIterNextSubpathPath-iter");
closed = false;
- Assert.AreEqual (Status.Ok, GDIPlus.GdipPathIterNextSubpathPath (iter, out result, IntPtr.Zero, out closed), "GdipPathIterNextSubpathPath-path");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipPathIterNextSubpathPath (iter, out result, path, out closed), "GdipPathIterNextSubpathPath");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipPathIterNextSubpathPath (iterHandle, out result, HandleRefZero, out closed), "GdipPathIterNextSubpathPath-path");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipPathIterNextSubpathPath (iterHandle, out result, pathHandle, out closed), "GdipPathIterNextSubpathPath");
- Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipPathIterNextSubpath (IntPtr.Zero, out result, out start, out end, out closed), "GdipPathIterNextSubpath-iter");
+ Assert.AreEqual ((int) Status.InvalidParameter, GDIPlus.GdipPathIterNextSubpath (HandleRefZero, out result, out start, out end, out closed), "GdipPathIterNextSubpath-iter");
start = -1;
end = -1;
closed = false;
- Assert.AreEqual (Status.Ok, GDIPlus.GdipPathIterNextSubpath (iter, out result, out start, out end, out closed), "GdipPathIterNextSubpath");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipPathIterNextSubpath (iterHandle, out result, out start, out end, out closed), "GdipPathIterNextSubpath");
Assert.AreEqual (-1, start, "start-3");
Assert.AreEqual (-1, end, "end-3");
- Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipPathIterRewind (IntPtr.Zero), "GdipPathIterRewind-null");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipPathIterRewind (iter), "GdipPathIterRewind");
+ Assert.AreEqual ((int) Status.InvalidParameter, GDIPlus.GdipPathIterRewind (HandleRefZero), "GdipPathIterRewind-null");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipPathIterRewind (iterHandle), "GdipPathIterRewind");
- Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipDeletePathIter (IntPtr.Zero), "GdipDeletePathIter-null");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipDeletePathIter (iter), "GdipDeletePathIter");
+ Assert.AreEqual ((int) Status.InvalidParameter, GDIPlus.GdipDeletePathIter (HandleRefZero), "GdipDeletePathIter-null");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipDeletePathIter (iterHandle), "GdipDeletePathIter");
Assert.AreEqual (Status.Ok, GDIPlus.GdipDeletePath (path), "GdipDeletePath");
}
{
// a path isn't required to create an iterator - ensure we never crash for any api
IntPtr iter;
- Assert.AreEqual (Status.Ok, GDIPlus.GdipCreatePathIter (out iter, IntPtr.Zero), "GdipCreatePathIter-null");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipCreatePathIter (out iter, HandleRefZero), "GdipCreatePathIter-null");
+ var iterHandle = new HandleRef (this, iter);
int count = -1;
- Assert.AreEqual (Status.Ok, GDIPlus.GdipPathIterGetCount (iter, out count), "GdipPathIterGetCount");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipPathIterGetCount (iterHandle, out count), "GdipPathIterGetCount");
Assert.AreEqual (0, count, "count-1");
count = -1;
- Assert.AreEqual (Status.Ok, GDIPlus.GdipPathIterGetSubpathCount (iter, out count), "GdipPathIterGetSubpathCount");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipPathIterGetSubpathCount (iterHandle, out count), "GdipPathIterGetSubpathCount");
Assert.AreEqual (0, count, "count-2");
bool curve;
- Assert.AreEqual (Status.Ok, GDIPlus.GdipPathIterHasCurve (iter, out curve), "GdipPathIterHasCurve");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipPathIterHasCurve (iterHandle, out curve), "GdipPathIterHasCurve");
int result = -1;
- PointF[] points = new PointF[count];
- byte[] types = new byte[count];
- Assert.AreEqual (Status.Ok, GDIPlus.GdipPathIterEnumerate (iter, out result, points, types, count), "GdipPathIterEnumerate");
- Assert.AreEqual (0, result, "result-1");
+// PointF[] points = new PointF[count];
+// byte[] types = new byte[count];
+// Assert.AreEqual (Status.Ok, GDIPlus.GdipPathIterEnumerate (iterHandle, out result, points, types, count), "GdipPathIterEnumerate");
+// Assert.AreEqual (0, result, "result-1");
- result = -1;
- Assert.AreEqual (Status.Ok, GDIPlus.GdipPathIterCopyData (iter, out result, points, types, 0, 0), "GdipPathIterCopyData");
- Assert.AreEqual (0, result, "result-2");
+// result = -1;
+// Assert.AreEqual (Status.Ok, GDIPlus.GdipPathIterCopyData (iterHandle, out result, points, types, 0, 0), "GdipPathIterCopyData");
+// Assert.AreEqual (0, result, "result-2");
result = -1;
- Assert.AreEqual (Status.Ok, GDIPlus.GdipPathIterNextMarkerPath (iter, out result, IntPtr.Zero), "GdipPathIterNextMarkerPath");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipPathIterNextMarkerPath (iterHandle, out result, HandleRefZero), "GdipPathIterNextMarkerPath");
Assert.AreEqual (0, result, "result-3");
result = -1;
int start = -1;
int end = -1;
- Assert.AreEqual (Status.Ok, GDIPlus.GdipPathIterNextMarker (iter, out result, out start, out end), "GdipPathIterNextMarker");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipPathIterNextMarker (iterHandle, out result, out start, out end), "GdipPathIterNextMarker");
Assert.AreEqual (0, result, "result-4");
Assert.AreEqual (-1, start, "start-1");
Assert.AreEqual (-1, end, "end-1");
byte pathType = 255;
start = -1;
end = -1;
- Assert.AreEqual (Status.Ok, GDIPlus.GdipPathIterNextPathType (iter, out result, out pathType, out start, out end), "GdipPathIterNextPathType");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipPathIterNextPathType (iterHandle, out result, out pathType, out start, out end), "GdipPathIterNextPathType");
Assert.AreEqual (0, result, "result-5");
Assert.AreEqual (255, pathType, "pathType");
Assert.AreEqual (-1, start, "start-2");
Assert.AreEqual (-1, end, "end-2");
bool closed = false;
- Assert.AreEqual (Status.Ok, GDIPlus.GdipPathIterNextSubpathPath (iter, out result, IntPtr.Zero, out closed), "GdipPathIterNextSubpathPath");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipPathIterNextSubpathPath (iterHandle, out result, HandleRefZero, out closed), "GdipPathIterNextSubpathPath");
start = -1;
end = -1;
closed = false;
- Assert.AreEqual (Status.Ok, GDIPlus.GdipPathIterNextSubpath (iter, out result, out start, out end, out closed), "GdipPathIterNextSubpath");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipPathIterNextSubpath (iterHandle, out result, out start, out end, out closed), "GdipPathIterNextSubpath");
Assert.AreEqual (-1, start, "start-3");
Assert.AreEqual (-1, end, "end-3");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipPathIterRewind (iter), "GdipPathIterRewind");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipPathIterRewind (iterHandle), "GdipPathIterRewind");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipDeletePathIter (iter), "GdipDeletePathIter");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipDeletePathIter (iterHandle), "GdipDeletePathIter");
}
// Matrix
public void ImageAttribute ()
{
IntPtr attr;
- Assert.AreEqual (Status.Ok, GDIPlus.GdipCreateImageAttributes (out attr), "GdipCreateImageAttributes");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipCreateImageAttributes (out attr), "GdipCreateImageAttributes");
+ var attrHandle = new HandleRef (this, attr);
IntPtr clone;
- Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipCloneImageAttributes (IntPtr.Zero, out clone), "GdipCloneImageAttributes");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipCloneImageAttributes (attr, out clone), "GdipCloneImageAttributes");
+ Assert.AreEqual ((int) Status.InvalidParameter, GDIPlus.GdipCloneImageAttributes (HandleRefZero, out clone), "GdipCloneImageAttributes");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipCloneImageAttributes (attrHandle, out clone), "GdipCloneImageAttributes");
+ var cloneHandle = new HandleRef (this, clone);
- Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipSetImageAttributesColorMatrix (attr, ColorAdjustType.Default, true, IntPtr.Zero, IntPtr.Zero, ColorMatrixFlag.Default), "GdipSetImageAttributesColorMatrix-true-matrix1");
+ Assert.AreEqual ((int) Status.InvalidParameter, GDIPlus.GdipSetImageAttributesColorMatrix (attrHandle, ColorAdjustType.Default, true, null, null, ColorMatrixFlag.Default), "GdipSetImageAttributesColorMatrix-true-matrix1");
// the first color matrix can be null if enableFlag is false
- Assert.AreEqual (Status.Ok, GDIPlus.GdipSetImageAttributesColorMatrix (attr, ColorAdjustType.Default, false, IntPtr.Zero, IntPtr.Zero, ColorMatrixFlag.Default), "GdipSetImageAttributesColorMatrix-false-matrix1");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipSetImageAttributesColorMatrix (attrHandle, ColorAdjustType.Default, false, null, null, ColorMatrixFlag.Default), "GdipSetImageAttributesColorMatrix-false-matrix1");
ColorMatrix cm = new ColorMatrix ();
- IntPtr color = Marshal.AllocHGlobal (Marshal.SizeOf (typeof (ColorMatrix)));
- try {
- Marshal.StructureToPtr (cm, color, false);
- Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipSetImageAttributesColorMatrix (IntPtr.Zero, ColorAdjustType.Default, true, color, IntPtr.Zero, ColorMatrixFlag.Default), "GdipSetImageAttributesColorMatrix-null");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipSetImageAttributesColorMatrix (attr, ColorAdjustType.Default, true, color, IntPtr.Zero, ColorMatrixFlag.Default), "GdipCloneImageAttributes");
- }
- finally {
- Marshal.FreeHGlobal (color);
- }
+ Assert.AreEqual ((int) Status.InvalidParameter, GDIPlus.GdipSetImageAttributesColorMatrix (HandleRefZero, ColorAdjustType.Default, true, cm, null, ColorMatrixFlag.Default), "GdipSetImageAttributesColorMatrix-null");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipSetImageAttributesColorMatrix (attrHandle, ColorAdjustType.Default, true, cm, null, ColorMatrixFlag.Default), "GdipCloneImageAttributes");
- Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipDisposeImageAttributes (IntPtr.Zero), "GdipDisposeImageAttributes-null");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipDisposeImageAttributes (attr), "GdipDisposeImageAttributes");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipDisposeImageAttributes (clone), "GdipDisposeImageAttributes-clone");
+ Assert.AreEqual ((int) Status.InvalidParameter, GDIPlus.GdipDisposeImageAttributes (HandleRefZero), "GdipDisposeImageAttributes-null");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipDisposeImageAttributes (attrHandle), "GdipDisposeImageAttributes");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipDisposeImageAttributes (cloneHandle), "GdipDisposeImageAttributes-clone");
}
// PathGradientBrush
points = new PointF[2] { new PointF (1, 2), new PointF (20, 30) };
Assert.AreEqual (Status.Ok, GDIPlus.GdipCreatePathGradient (points, 2, WrapMode.Clamp, out brush), "two");
Assert.IsTrue (brush != IntPtr.Zero, "Handle");
+ var brushHandle = new HandleRef (this, brush);
int count;
Assert.AreEqual (Status.Ok, GDIPlus.GdipGetPathGradientBlendCount (brush, out count), "GdipGetPathGradientBlendCount");
Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipGetPathGradientPresetBlend (brush, colors, positions, count), "GdipGetPathGradientBlend");
// can't call that for 1 count!
- Assert.AreEqual (Status.Ok, GDIPlus.GdipDeleteBrush (brush), "GdipDeleteBrush");
+ Assert.AreEqual (0, GDIPlus.GdipDeleteBrush (brushHandle), "GdipDeleteBrush");
}
[Test]
Assert.AreEqual (Status.Ok, GDIPlus.GdipCreatePathGradientFromPath (path, out brush), "path");
Assert.IsTrue (brush != IntPtr.Zero, "Handle");
+ var brushHandle = new HandleRef (this, brush);
int count;
Assert.AreEqual (Status.Ok, GDIPlus.GdipGetPathGradientBlendCount (brush, out count), "GdipGetPathGradientBlendCount");
float[] positions = new float[count];
Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipGetPathGradientPresetBlend (brush, colors, positions, count), "GdipGetPathGradientBlend");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipDeleteBrush (brush), "GdipDeleteBrush");
+ Assert.AreEqual (0, GDIPlus.GdipDeleteBrush (brushHandle), "GdipDeleteBrush");
Assert.AreEqual (Status.Ok, GDIPlus.GdipDeletePath (path), "GdipDeletePath");
}
IntPtr brush;
Assert.AreEqual (Status.Ok, GDIPlus.GdipCreatePathGradientFromPath (path, out brush), "path");
Assert.IsTrue (brush != IntPtr.Zero, "Handle");
+ var brushHandle = new HandleRef (this, brush);
int count;
Assert.AreEqual (Status.Ok, GDIPlus.GdipGetPathGradientBlendCount (brush, out count), "GdipGetPathGradientBlendCount");
float[] positions = new float[count];
Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipGetPathGradientPresetBlend (brush, colors, positions, count), "GdipGetPathGradientBlend");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipDeleteBrush (brush), "GdipDeleteBrush");
+ Assert.AreEqual (0, GDIPlus.GdipDeleteBrush (brushHandle), "GdipDeleteBrush");
Assert.AreEqual (Status.Ok, GDIPlus.GdipDeletePath (path), "GdipDeletePath");
}
try {
int color = 0;
IntPtr brush;
+ HandleRef brushHandle;
Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipGetPenBrushFill (IntPtr.Zero, out brush), "GdipGetPenBrushFill-null");
Assert.AreEqual (Status.Ok, GDIPlus.GdipGetPenBrushFill (pen, out brush), "GdipGetPenBrushFill");
+ brushHandle = new HandleRef (this, brush);
+
try {
- Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipGetSolidFillColor (IntPtr.Zero, out color), "GdipGetSolidFillColor-null");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipGetSolidFillColor (brush, out color), "GdipGetSolidFillColor-0");
+ Assert.AreEqual ((int) Status.InvalidParameter, GDIPlus.GdipGetSolidFillColor (HandleRefZero, out color), "GdipGetSolidFillColor-null");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipGetSolidFillColor (brushHandle, out color), "GdipGetSolidFillColor-0");
Assert.AreEqual (0x7f0000ff, color, "color-0");
Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipSetPenColor (IntPtr.Zero, 0x7fff0000), "GdipSetPenColor-null");
Assert.AreEqual (Status.Ok, GDIPlus.GdipSetPenColor (pen, 0x7fff0000), "GdipSetPenColor");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipGetSolidFillColor (brush, out color), "GdipGetSolidFillColor-1");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipGetSolidFillColor (brushHandle, out color), "GdipGetSolidFillColor-1");
// previous brush color didn't change
Assert.AreEqual (0x7f0000ff, color, "color-1");
}
finally {
- Assert.AreEqual (Status.Ok, GDIPlus.GdipDeleteBrush (brush), "GdipDeleteBrush");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipDeleteBrush (brushHandle), "GdipDeleteBrush");
}
Assert.AreEqual (Status.Ok, GDIPlus.GdipGetPenBrushFill (pen, out brush), "GdipGetPenBrushFill-2");
+ brushHandle = new HandleRef (this, brush);
try {
- Assert.AreEqual (Status.Ok, GDIPlus.GdipGetSolidFillColor (brush, out color), "GdipGetSolidFillColor-2");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipGetSolidFillColor (brushHandle, out color), "GdipGetSolidFillColor-2");
// new brush color is updated
Assert.AreEqual (0x7fff0000, color, "color-2");
}
finally {
- Assert.AreEqual (Status.Ok, GDIPlus.GdipDeleteBrush (brush), "GdipDeleteBrush-2");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipDeleteBrush (brushHandle), "GdipDeleteBrush-2");
}
}
finally {
IntPtr brush;
GDIPlus.GdipCreateSolidFill (0, out brush);
-
+ var brushHandle = new HandleRef (this, brush);
Assert.AreEqual (Status.InvalidParameter,
GDIPlus.GdipFillClosedCurveI (graphics, brush, new Point [] {}, 0),
new Point (2, 2) }, 2),
"FillClosedCurve with 2 pts");
- GDIPlus.GdipDeleteBrush (brush);
+ GDIPlus.GdipDeleteBrush (brushHandle);
GDIPlus.GdipDeleteGraphics (graphics);
GDIPlus.GdipDisposeImage (image);
{
IntPtr image;
GDIPlus.GdipCreateBitmapFromScan0 (10, 10, 0, PixelFormat.Format32bppArgb, IntPtr.Zero, out image);
+ var imageHandle = new HandleRef (this, image);
IntPtr brush;
- Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipCreateTexture (IntPtr.Zero, WrapMode.Tile, out brush), "GdipCreateTexture-image");
- Assert.AreEqual (Status.OutOfMemory, GDIPlus.GdipCreateTexture (image, (WrapMode)Int32.MinValue, out brush), "GdipCreateTexture-wrapmode");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipCreateTexture (image, WrapMode.Tile, out brush), "GdipCreateTexture");
+ Assert.AreEqual ((int) Status.InvalidParameter, GDIPlus.GdipCreateTexture (HandleRefZero, (int) WrapMode.Tile, out brush), "GdipCreateTexture-image");
+ Assert.AreEqual ((int) Status.OutOfMemory, GDIPlus.GdipCreateTexture (imageHandle, Int32.MinValue, out brush), "GdipCreateTexture-wrapmode");
+
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipCreateTexture (imageHandle, (int) WrapMode.Tile, out brush), "GdipCreateTexture");
+ var brushHandle = new HandleRef (this, brush);
IntPtr image2;
// this would throw an AccessViolationException under MS 2.0 (missing null check?)
// Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipGetTextureImage (IntPtr.Zero, out image2), "GdipGetTextureImage-brush");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipGetTextureImage (brush, out image2), "GdipGetTextureImage");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipGetTextureImage (brushHandle, out image2), "GdipGetTextureImage");
Assert.IsFalse (image == image2, "image");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipDeleteBrush (brush), "GdipDeleteBrush");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipDeleteBrush (brushHandle), "GdipDeleteBrush");
Assert.AreEqual (Status.Ok, GDIPlus.GdipDisposeImage (image), "GdipDisposeImage");
Assert.AreEqual (Status.Ok, GDIPlus.GdipDisposeImage (image2), "GdipDisposeImage-image2");
}
{
IntPtr image;
GDIPlus.GdipCreateBitmapFromScan0 (10, 10, 0, PixelFormat.Format32bppArgb, IntPtr.Zero, out image);
+ var imageHandle = new HandleRef (this, image);
IntPtr brush;
- Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipCreateTexture2 (IntPtr.Zero, WrapMode.Tile, 0, 0, 10, 10, out brush), "GdipCreateTexture2-image");
- Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipCreateTexture2 (IntPtr.Zero, (WrapMode) Int32.MinValue, 0, 0, 10, 10, out brush), "GdipCreateTexture2-wrapmode");
- Assert.AreEqual (Status.OutOfMemory, GDIPlus.GdipCreateTexture2 (image, WrapMode.Tile, 0, 0, 0, 10, out brush), "GdipCreateTexture2-width");
- Assert.AreEqual (Status.OutOfMemory, GDIPlus.GdipCreateTexture2 (image, WrapMode.Tile, 0, 0, 10, 0, out brush), "GdipCreateTexture2-height");
- Assert.AreEqual (Status.OutOfMemory, GDIPlus.GdipCreateTexture2 (image, WrapMode.Tile, -1, 0, 0, 10, out brush), "GdipCreateTexture2-x");
- Assert.AreEqual (Status.OutOfMemory, GDIPlus.GdipCreateTexture2 (image, WrapMode.Tile, 0, -1, 10, 0, out brush), "GdipCreateTexture2-y");
- Assert.AreEqual (Status.OutOfMemory, GDIPlus.GdipCreateTexture2 (image, WrapMode.Tile, 1, 0, 10, 10, out brush), "GdipCreateTexture2-too-wide");
- Assert.AreEqual (Status.OutOfMemory, GDIPlus.GdipCreateTexture2 (image, WrapMode.Tile, 0, 1, 10, 10, out brush), "GdipCreateTexture2-too-tall");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipCreateTexture2 (image, WrapMode.Tile, 0, 0, 10, 10, out brush), "GdipCreateTexture2");
-
- WrapMode wm;
- Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipGetTextureWrapMode (IntPtr.Zero, out wm), "GdipGetTextureWrapMode-brush");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipGetTextureWrapMode (brush, out wm), "GdipGetTextureWrapMode");
- Assert.AreEqual (WrapMode.Tile, wm, "WrapMode");
-
- Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipSetTextureWrapMode (IntPtr.Zero, WrapMode.Clamp), "GdipSetTextureWrapMode-brush");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipSetTextureWrapMode (brush, WrapMode.Clamp), "GdipSetTextureWrapMode");
- GDIPlus.GdipGetTextureWrapMode (brush, out wm);
- Assert.AreEqual (WrapMode.Clamp, wm, "WrapMode.Clamp");
+ Assert.AreEqual ((int) Status.InvalidParameter, GDIPlus.GdipCreateTexture2 (HandleRefZero, (int) WrapMode.Tile, 0, 0, 10, 10, out brush), "GdipCreateTexture2-image");
+ Assert.AreEqual ((int) Status.InvalidParameter, GDIPlus.GdipCreateTexture2 (HandleRefZero, Int32.MinValue, 0, 0, 10, 10, out brush), "GdipCreateTexture2-wrapmode");
+ Assert.AreEqual ((int) Status.OutOfMemory, GDIPlus.GdipCreateTexture2 (imageHandle, (int) WrapMode.Tile, 0, 0, 0, 10, out brush), "GdipCreateTexture2-width");
+ Assert.AreEqual ((int) Status.OutOfMemory, GDIPlus.GdipCreateTexture2 (imageHandle, (int) WrapMode.Tile, 0, 0, 10, 0, out brush), "GdipCreateTexture2-height");
+ Assert.AreEqual ((int) Status.OutOfMemory, GDIPlus.GdipCreateTexture2 (imageHandle, (int) WrapMode.Tile, -1, 0, 0, 10, out brush), "GdipCreateTexture2-x");
+ Assert.AreEqual ((int) Status.OutOfMemory, GDIPlus.GdipCreateTexture2 (imageHandle, (int) WrapMode.Tile, 0, -1, 10, 0, out brush), "GdipCreateTexture2-y");
+ Assert.AreEqual ((int) Status.OutOfMemory, GDIPlus.GdipCreateTexture2 (imageHandle, (int) WrapMode.Tile, 1, 0, 10, 10, out brush), "GdipCreateTexture2-too-wide");
+ Assert.AreEqual ((int) Status.OutOfMemory, GDIPlus.GdipCreateTexture2 (imageHandle, (int) WrapMode.Tile, 0, 1, 10, 10, out brush), "GdipCreateTexture2-too-tall");
+
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipCreateTexture2 (imageHandle, (int) WrapMode.Tile, 0, 0, 10, 10, out brush), "GdipCreateTexture2");
+ var brushHandle = new HandleRef (this, brush);
+
+ int wm;
+ Assert.AreEqual ((int) Status.InvalidParameter, GDIPlus.GdipGetTextureWrapMode (HandleRefZero, out wm), "GdipGetTextureWrapMode-brush");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipGetTextureWrapMode (brushHandle, out wm), "GdipGetTextureWrapMode");
+ Assert.AreEqual ((int) WrapMode.Tile, wm, "WrapMode");
+
+ Assert.AreEqual ((int) Status.InvalidParameter, GDIPlus.GdipSetTextureWrapMode (HandleRefZero, (int) WrapMode.Clamp), "GdipSetTextureWrapMode-brush");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipSetTextureWrapMode (brushHandle, (int) WrapMode.Clamp), "GdipSetTextureWrapMode");
+ GDIPlus.GdipGetTextureWrapMode (brushHandle, out wm);
+ Assert.AreEqual ((int) WrapMode.Clamp, wm, "WrapMode.Clamp");
// an invalid WrapMode is ignored
- Assert.AreEqual (Status.Ok, GDIPlus.GdipSetTextureWrapMode (brush, (WrapMode) Int32.MinValue), "GdipSetTextureWrapMode-wrapmode");
- GDIPlus.GdipGetTextureWrapMode (brush, out wm);
- Assert.AreEqual (WrapMode.Clamp, wm, "WrapMode/Invalid");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipSetTextureWrapMode (brushHandle, Int32.MinValue), "GdipSetTextureWrapMode-wrapmode");
+ GDIPlus.GdipGetTextureWrapMode (brushHandle, out wm);
+ Assert.AreEqual ((int) WrapMode.Clamp, wm, "WrapMode/Invalid");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipDeleteBrush (brush), "GdipDeleteBrush");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipDeleteBrush (brushHandle), "GdipDeleteBrush");
Assert.AreEqual (Status.Ok, GDIPlus.GdipDisposeImage (image), "GdipDisposeImage");
}
{
IntPtr image;
GDIPlus.GdipCreateBitmapFromScan0 (10, 10, 0, PixelFormat.Format32bppArgb, IntPtr.Zero, out image);
+ var imageHandle = new HandleRef (this, image);
IntPtr brush;
- Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipCreateTextureIA (IntPtr.Zero, IntPtr.Zero, 0, 0, 10, 10, out brush), "GdipCreateTexture2-image");
- Assert.AreEqual (Status.OutOfMemory, GDIPlus.GdipCreateTextureIA (image, IntPtr.Zero, 0, 0, 0, 10, out brush), "GdipCreateTexture2-width");
- Assert.AreEqual (Status.OutOfMemory, GDIPlus.GdipCreateTextureIA (image, IntPtr.Zero, 0, 0, 10, 0, out brush), "GdipCreateTexture2-height");
- Assert.AreEqual (Status.OutOfMemory, GDIPlus.GdipCreateTextureIA (image, IntPtr.Zero, -1, 0, 10, 10, out brush), "GdipCreateTexture2-x");
- Assert.AreEqual (Status.OutOfMemory, GDIPlus.GdipCreateTextureIA (image, IntPtr.Zero, 0, -1, 10, 10, out brush), "GdipCreateTexture2-y");
- Assert.AreEqual (Status.OutOfMemory, GDIPlus.GdipCreateTextureIA (image, IntPtr.Zero, 1, 0, 10, 10, out brush), "GdipCreateTexture2-too-wide");
- Assert.AreEqual (Status.OutOfMemory, GDIPlus.GdipCreateTextureIA (image, IntPtr.Zero, 0, 1, 10, 10, out brush), "GdipCreateTexture2-too-tall");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipCreateTextureIA (image, IntPtr.Zero, 0, 0, 10, 10, out brush), "GdipCreateTexture2");
+ Assert.AreEqual ((int)Status.InvalidParameter, GDIPlus.GdipCreateTextureIA (HandleRefZero, HandleRefZero, 0, 0, 10, 10, out brush), "GdipCreateTexture2-image");
+ Assert.AreEqual ((int)Status.OutOfMemory, GDIPlus.GdipCreateTextureIA (imageHandle, HandleRefZero, 0, 0, 0, 10, out brush), "GdipCreateTexture2-width");
+ Assert.AreEqual ((int)Status.OutOfMemory, GDIPlus.GdipCreateTextureIA (imageHandle, HandleRefZero, 0, 0, 10, 0, out brush), "GdipCreateTexture2-height");
+ Assert.AreEqual ((int)Status.OutOfMemory, GDIPlus.GdipCreateTextureIA (imageHandle, HandleRefZero, -1, 0, 10, 10, out brush), "GdipCreateTexture2-x");
+ Assert.AreEqual ((int)Status.OutOfMemory, GDIPlus.GdipCreateTextureIA (imageHandle, HandleRefZero, 0, -1, 10, 10, out brush), "GdipCreateTexture2-y");
+ Assert.AreEqual ((int)Status.OutOfMemory, GDIPlus.GdipCreateTextureIA (imageHandle, HandleRefZero, 1, 0, 10, 10, out brush), "GdipCreateTexture2-too-wide");
+ Assert.AreEqual ((int)Status.OutOfMemory, GDIPlus.GdipCreateTextureIA (imageHandle, HandleRefZero, 0, 1, 10, 10, out brush), "GdipCreateTexture2-too-tall");
+
+ Assert.AreEqual ((int)Status.Ok, GDIPlus.GdipCreateTextureIA (imageHandle, HandleRefZero, 0, 0, 10, 10, out brush), "GdipCreateTexture2");
+ var brushHandle = new HandleRef (this, brush);
// TODO - handle ImageAttribute in the tests
IntPtr matrix;
Assert.AreEqual (Status.Ok, GDIPlus.GdipCreateMatrix (out matrix), "GdipCreateMatrix");
+ var matrixHandle = new HandleRef (this, matrix);
- Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipGetTextureTransform (IntPtr.Zero, matrix), "GdipGetTextureTransform-brush");
- Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipGetTextureTransform (brush, IntPtr.Zero), "GdipGetTextureTransform-matrix");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipGetTextureTransform (brush, matrix), "GdipGetTextureTransform");
+ Assert.AreEqual ((int) Status.InvalidParameter, GDIPlus.GdipGetTextureTransform (HandleRefZero, matrixHandle), "GdipGetTextureTransform-brush");
+ Assert.AreEqual ((int) Status.InvalidParameter, GDIPlus.GdipGetTextureTransform (brushHandle, HandleRefZero), "GdipGetTextureTransform-matrix");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipGetTextureTransform (brushHandle, matrixHandle), "GdipGetTextureTransform");
- Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipSetTextureTransform (IntPtr.Zero, matrix), "GdipSetTextureTransform-brush");
- Assert.AreEqual (Status.InvalidParameter, GDIPlus.GdipSetTextureTransform (brush, IntPtr.Zero), "GdipSetTextureTransform-matrix");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipSetTextureTransform (brush, matrix), "GdipSetTextureTransform");
+ Assert.AreEqual ((int) Status.InvalidParameter, GDIPlus.GdipSetTextureTransform (HandleRefZero, matrixHandle), "GdipSetTextureTransform-brush");
+ Assert.AreEqual ((int) Status.InvalidParameter, GDIPlus.GdipSetTextureTransform (brushHandle, HandleRefZero), "GdipSetTextureTransform-matrix");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipSetTextureTransform (brushHandle, matrixHandle), "GdipSetTextureTransform");
Assert.AreEqual (Status.Ok, GDIPlus.GdipDeleteMatrix (matrix), "GdipDeleteMatrix");
- Assert.AreEqual (Status.Ok, GDIPlus.GdipDeleteBrush (brush), "GdipDeleteBrush");
+ Assert.AreEqual ((int) Status.Ok, GDIPlus.GdipDeleteBrush (brushHandle), "GdipDeleteBrush");
Assert.AreEqual (Status.Ok, GDIPlus.GdipDisposeImage (image), "GdipDisposeImage");
}
public const string DCTypeInvalid = "GetObjectType on this dc returned an invalid value.";
public const string InvalidEnumArgument = "The value of argument '{0}' ({1}) is invalid for Enum type '{2}'.";
public const string ConvertInvalidPrimitive = "{0} is not a valid value for {1}.";
+ public const string LibgdiplusNotFound = "The native library \"libgdiplus\" is not installed on the system, or was otherwise unable to be loaded.";
}
../../../external/corefx/src/CoreFx.Private.TestUtilities/src/System/AssertExtensions.cs
-../../../external/corefx/src/Common/tests/System/PlatformDetection.cs
+
../../../external/corefx/src/Common/src/System/MathF.netstandard.cs
# ../../../external/corefx/src/System.Runtime.Numerics/tests/*.cs
-../../../external/corefx/src/System.Runtime.Numerics/tests/BigInteger/*.cs
+#../../../external/corefx/src/System.Runtime.Numerics/tests/BigInteger/*.cs
../../../external/corefx/src/System.Numerics.Vectors/src/System/Numerics/ConstantHelper.cs
}
}
+ internal int ReadCore (Span<byte> destination)
+ {
+ throw new NotImplementedException ();
+ }
+
public override int Read (byte[] array, int offset, int count)
{
if (disposed)
}
}
+ internal void WriteCore (ReadOnlySpan<byte> source)
+ {
+ throw new NotImplementedException ();
+ }
+
public override void Write (byte[] array, int offset, int count)
{
if (disposed)
endif
ifeq ($(PROFILE),build)
-CSC_RUNTIME_FLAGS=--profile=aot:output=$(topdir)/class/lib/$(PROFILE)/csc.$(LIBRARY).aotprofile
+CSC_RUNTIME_FLAGS=--profile=aot:output=$(topdir)/class/lib/$(PROFILE_DIRECTORY)/csc.$(LIBRARY).aotprofile
endif
-RESOURCE_STRINGS = ../referencesource/mscorlib/mscorlib.txt
-
RESX_RESOURCE_STRING = \
../../../external/corert/src/System.Private.CoreLib/src/Resources/Strings.resx \
- ../../../external/corefx/src/System.Collections.Concurrent/src/Resources/Strings.resx
+ ../../../external/corefx/src/System.Collections.Concurrent/src/Resources/Strings.resx \
+ ../../../external/corefx/src/System.Memory/src/Resources/Strings.resx
LIBRARY_COMPILE = $(BOOT_COMPILE)
LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)
+ifneq ($(PROFILE),basic)
+RESOURCE_STRINGS = ../referencesource/mscorlib/mscorlib.txt
+include il/il.make
+
+MODULE_DEPS = $(IL_REPLACE)
+endif
+
RESOURCE_FILES = \
resources/charinfo.nlp \
resources/collation.core.bin \
Test/resources/Resources.es-ES.resources \
Test/resources/Resources.nn-NO.resources \
-CLEAN_FILES += $(TEST_RESX_RESOURCES)
+CLEAN_FILES += $(TEST_RESX_RESOURCES) $(IL_REPLACE)
include $(topdir)/build/library.make
$(vtsdir)/VersionTolerantSerializationTestLib/4.0/Address.cs \
$(vtsdir)/VersionTolerantSerializationTestLib/5.0/Address.cs \
$(vtsdir)/VersionTolerantSerializationTestLib/6.0/Address.cs \
- $(vtsdir)/BinarySerializationOverVersions.cs
+ $(vtsdir)/BinarySerializationOverVersions.cs \
+ System.Runtime.CompilerServices/Unsafe.il \
+ il/il.make \
+ il/Makefile
#
# Android TimeZoneInfo testing....
--- /dev/null
+//
+// Unsafe.cs: Compile only stubs for Unsafe implementation
+//
+// Authors:
+// Marek Safar (marek.safar@gmail.com)
+//
+// Copyright (C) 2017 Microsoft Corporation (http://microsoft.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace System.Runtime.CompilerServices
+{
+ static partial class Unsafe
+ {
+ public static ref T Add<T> (ref T source, int elementOffset)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static ref T Add<T> (ref T source, System.IntPtr elementOffset)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static ref T AddByteOffset<T> (ref T source, System.IntPtr byteOffset)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static bool AreSame<T> (ref T left, ref T right)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static T As<T> (object o) where T : class
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static ref TTo As<TFrom, TTo>(ref TFrom source)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public unsafe static ref T AsRef<T> (void* source)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static System.IntPtr ByteOffset<T> (ref T origin, ref T target)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static void CopyBlock (ref byte destination, ref byte source, uint byteCount)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static void InitBlockUnaligned (ref byte startAddress, byte value, uint byteCount)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public unsafe static void InitBlockUnaligned (void* startAddress, byte value, uint byteCount)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public unsafe static T Read<T> (void* source)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static int SizeOf<T> ()
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+// Simplified version of ../../../external/corefx/src/System.Runtime.CompilerServices.Unsafe/src/System.Runtime.CompilerServices.Unsafe.il
+
+.class public abstract auto ansi sealed beforefieldinit System.Runtime.CompilerServices.Unsafe
+{
+ .method public hidebysig static !!T Read<T>(void* source) cil managed aggressiveinlining
+ {
+
+ .maxstack 1
+ ldarg.0
+ ldobj !!T
+ ret
+ }
+
+ .method public hidebysig static !!T ReadUnaligned<T>(void* source) cil managed aggressiveinlining
+ {
+
+ .maxstack 1
+ ldarg.0
+ unaligned. 0x1
+ ldobj !!T
+ ret
+ }
+
+ .method public hidebysig static !!T ReadUnaligned<T>(uint8& source) cil managed aggressiveinlining
+ {
+
+ .maxstack 1
+ ldarg.0
+ unaligned. 0x1
+ ldobj !!T
+ ret
+ }
+
+ .method public hidebysig static void Write<T>(void* destination,
+ !!T 'value') cil managed aggressiveinlining
+ {
+
+ .maxstack 2
+ ldarg.0
+ ldarg.1
+ stobj !!T
+ ret
+ }
+
+ .method public hidebysig static void WriteUnaligned<T>(void* destination,
+ !!T 'value') cil managed aggressiveinlining
+ {
+
+ .maxstack 2
+ ldarg.0
+ ldarg.1
+ unaligned. 0x01
+ stobj !!T
+ ret
+ }
+
+ .method public hidebysig static void WriteUnaligned<T>(uint8& destination,
+ !!T 'value') cil managed aggressiveinlining
+ {
+
+ .maxstack 2
+ ldarg.0
+ ldarg.1
+ unaligned. 0x01
+ stobj !!T
+ ret
+ }
+
+ .method public hidebysig static void Copy<T>(void* destination,
+ !!T& source) cil managed aggressiveinlining
+ {
+
+ .maxstack 2
+ ldarg.0
+ ldarg.1
+ ldobj !!T
+ stobj !!T
+ ret
+ }
+
+ .method public hidebysig static void Copy<T>(!!T& destination,
+ void* source) cil managed aggressiveinlining
+ {
+
+ .maxstack 2
+ ldarg.0
+ ldarg.1
+ ldobj !!T
+ stobj !!T
+ ret
+ }
+
+ .method public hidebysig static void* AsPointer<T>(!!T& 'value') cil managed aggressiveinlining
+ {
+
+ .maxstack 1
+ ldarg.0
+ conv.u
+ ret
+ }
+
+ .method public hidebysig static int32 SizeOf<T>() cil managed aggressiveinlining
+ {
+
+ .maxstack 1
+ sizeof !!T
+ ret
+ }
+
+ .method public hidebysig static void CopyBlock(void* destination, void* source, uint32 byteCount) cil managed aggressiveinlining
+ {
+
+ .maxstack 3
+ ldarg.0
+ ldarg.1
+ ldarg.2
+ cpblk
+ ret
+ }
+
+ .method public hidebysig static void CopyBlock(uint8& destination, uint8& source, uint32 byteCount) cil managed aggressiveinlining
+ {
+
+ .maxstack 3
+ ldarg.0
+ ldarg.1
+ ldarg.2
+ cpblk
+ ret
+ }
+
+ .method public hidebysig static void CopyBlockUnaligned(void* destination, void* source, uint32 byteCount) cil managed aggressiveinlining
+ {
+
+ .maxstack 3
+ ldarg.0
+ ldarg.1
+ ldarg.2
+ unaligned. 0x1
+ cpblk
+ ret
+ }
+
+ .method public hidebysig static void CopyBlockUnaligned(uint8& destination, uint8& source, uint32 byteCount) cil managed aggressiveinlining
+ {
+
+ .maxstack 3
+ ldarg.0
+ ldarg.1
+ ldarg.2
+ unaligned. 0x1
+ cpblk
+ ret
+ }
+
+ .method public hidebysig static void InitBlock(void* startAddress, uint8 'value', uint32 byteCount) cil managed aggressiveinlining
+ {
+
+ .maxstack 3
+ ldarg.0
+ ldarg.1
+ ldarg.2
+ initblk
+ ret
+ }
+
+ .method public hidebysig static void InitBlock(uint8& startAddress, uint8 'value', uint32 byteCount) cil managed aggressiveinlining
+ {
+
+ .maxstack 3
+ ldarg.0
+ ldarg.1
+ ldarg.2
+ initblk
+ ret
+ }
+
+ .method public hidebysig static void InitBlockUnaligned(void* startAddress, uint8 'value', uint32 byteCount) cil managed aggressiveinlining
+ {
+
+ .maxstack 3
+ ldarg.0
+ ldarg.1
+ ldarg.2
+ unaligned. 0x1
+ initblk
+ ret
+ }
+
+ .method public hidebysig static void InitBlockUnaligned(uint8& startAddress, uint8 'value', uint32 byteCount) cil managed aggressiveinlining
+ {
+
+ .maxstack 3
+ ldarg.0
+ ldarg.1
+ ldarg.2
+ unaligned. 0x1
+ initblk
+ ret
+ }
+
+ .method public hidebysig static !!T As<class T>(object o) cil managed aggressiveinlining
+ {
+
+ .maxstack 1
+ ldarg.0
+ ret
+ }
+
+ .method public hidebysig static !!T& AsRef<T>(void* source) cil managed aggressiveinlining
+ {
+
+ .locals (int32&)
+ .maxstack 1
+ ldarg.0
+ // Roundtrip via a local to avoid type mismatch on return that the JIT inliner chokes on.
+ stloc.0
+ ldloc.0
+ ret
+ }
+
+ .method public hidebysig static !!TTo& As<TFrom, TTo>(!!TFrom& source) cil managed aggressiveinlining
+ {
+
+ .maxstack 1
+ ldarg.0
+ ret
+ }
+
+ .method public hidebysig static !!T& Add<T>(!!T& source, int32 elementOffset) cil managed aggressiveinlining
+ {
+
+ .maxstack 3
+ ldarg.0
+ ldarg.1
+ sizeof !!T
+ conv.i
+ mul
+ add
+ ret
+ }
+
+ .method public hidebysig static void* Add<T>(void* source, int32 elementOffset) cil managed aggressiveinlining
+ {
+
+ .maxstack 3
+ ldarg.0
+ ldarg.1
+ sizeof !!T
+ conv.i
+ mul
+ add
+ ret
+ }
+
+ .method public hidebysig static !!T& Add<T>(!!T& source, native int elementOffset) cil managed aggressiveinlining
+ {
+
+ .maxstack 3
+ ldarg.0
+ ldarg.1
+ sizeof !!T
+ mul
+ add
+ ret
+ }
+
+ .method public hidebysig static !!T& AddByteOffset<T>(!!T& source, native int byteOffset) cil managed aggressiveinlining
+ {
+
+ .maxstack 2
+ ldarg.0
+ ldarg.1
+ add
+ ret
+ }
+
+ .method public hidebysig static !!T& Subtract<T>(!!T& source, int32 elementOffset) cil managed aggressiveinlining
+ {
+
+ .maxstack 3
+ ldarg.0
+ ldarg.1
+ sizeof !!T
+ conv.i
+ mul
+ sub
+ ret
+ }
+
+ .method public hidebysig static void* Subtract<T>(void* source, int32 elementOffset) cil managed aggressiveinlining
+ {
+
+ .maxstack 3
+ ldarg.0
+ ldarg.1
+ sizeof !!T
+ conv.i
+ mul
+ sub
+ ret
+ }
+
+ .method public hidebysig static !!T& Subtract<T>(!!T& source, native int elementOffset) cil managed aggressiveinlining
+ {
+
+ .maxstack 3
+ ldarg.0
+ ldarg.1
+ sizeof !!T
+ mul
+ sub
+ ret
+ }
+
+ .method public hidebysig static !!T& SubtractByteOffset<T>(!!T& source, native int byteOffset) cil managed aggressiveinlining
+ {
+
+ .maxstack 2
+ ldarg.0
+ ldarg.1
+ sub
+ ret
+ }
+
+ .method public hidebysig static native int ByteOffset<T>(!!T& origin, !!T& target) cil managed aggressiveinlining
+ {
+
+ .maxstack 2
+ ldarg.1
+ ldarg.0
+ sub
+ ret
+ }
+
+ .method public hidebysig static bool AreSame<T>(!!T& left, !!T& right) cil managed aggressiveinlining
+ {
+
+ .maxstack 2
+ ldarg.0
+ ldarg.1
+ ceq
+ ret
+ }
+
+}
\ No newline at end of file
internal IEnumerator<T> InternalArray__IEnumerable_GetEnumerator<T> ()
{
- return new InternalEnumerator<T> (this);
+ if (Length == 0)
+ return EmptyInternalEnumerator<T>.Value;
+ else
+ return new InternalEnumerator<T> (this);
}
internal void InternalArray__ICollection_Clear ()
}
}
+ internal class EmptyInternalEnumerator<T> : IEnumerator<T>
+ {
+ public static readonly EmptyInternalEnumerator<T> Value = new EmptyInternalEnumerator<T> ();
+
+ public void Dispose ()
+ {
+ return;
+ }
+
+ public bool MoveNext ()
+ {
+ return false;
+ }
+
+ public T Current {
+ get {
+ throw new InvalidOperationException ("Enumeration has not started. Call MoveNext");
+ }
+ }
+
+ object IEnumerator.Current {
+ get {
+ return Current;
+ }
+ }
+
+ void IEnumerator.Reset ()
+ {
+ return;
+ }
+ }
+
// InternalCall Methods
[MethodImplAttribute (MethodImplOptions.InternalCall)]
extern int GetRank ();
0x79, 0xC0, 0x9B, 0x5F, 0x34, 0x86, 0xB2, 0xDE, 0xC4, 0x19, 0x84, 0x5F,
0x0E, 0xED, 0x9B, 0xB8, 0xD3, 0x17, 0xDA, 0x78 };
+ string tempDir = Path.Combine (Path.GetTempPath (), typeof (SaveTest).FullName);
+
+ [SetUp]
+ protected void SetUp ()
+ {
+ var rand = new Random ();
+ string basePath = tempDir;
+ while (Directory.Exists (tempDir))
+ tempDir = Path.Combine (basePath, rand.Next ().ToString ());
+ Directory.CreateDirectory (tempDir);
+ }
+
+ [TearDown]
+ protected void TearDown ()
+ {
+ try {
+ Directory.Delete (tempDir, true);
+ } catch (DirectoryNotFoundException) {
+ } catch (IOException) {
+ // Can happen on Windows if assemblies from this dir are still used
+ }
+ }
+
[Test]
public void Save () {
- // FIXME: Temp dir etc.
//
// Create a test assembly, write it to disk, then read it back
aname.CultureInfo = new CultureInfo ("en");
aname.Flags = AssemblyNameFlags.Retargetable;
aname.HashAlgorithm = AssemblyHashAlgorithm.SHA256;
- var ab = AppDomain.CurrentDomain.DefineDynamicAssembly (aname, AssemblyBuilderAccess.RunAndSave);
+ var ab = AppDomain.CurrentDomain.DefineDynamicAssembly (aname, AssemblyBuilderAccess.RunAndSave, tempDir);
- string strongfile = "strongname.snk";
+ string strongfile = Path.Combine (tempDir, "strongname.snk");
using (FileStream fs = File.OpenWrite (strongfile)) {
fs.Write (strongName, 0, strongName.Length);
fs.Close ();
ab.Save ("h.exe");
// Read the assembly and check data
- Assembly a = Assembly.LoadFrom ("h.exe");
+ Assembly a = Assembly.LoadFrom (Path.Combine (tempDir, "h.exe"));
Assert.IsTrue (a != ab);
CheckAssembly (a);
}
public void GetReferencedAssemblies ()
{
Assembly corlib_test = Assembly.GetExecutingAssembly ();
- AssemblyName[] names = corlib_test.GetReferencedAssemblies ();
- foreach (AssemblyName an in names) {
- Assert.IsNull (an.CodeBase, "CodeBase");
- Assert.IsNotNull (an.CultureInfo, "CultureInfo");
- Assert.IsNull (an.EscapedCodeBase, "EscapedCodeBase");
- Assert.AreEqual (AssemblyNameFlags.None, an.Flags, "Flags");
- Assert.IsNotNull (an.FullName, "FullName");
- Assert.AreEqual (AssemblyHashAlgorithm.SHA1, an.HashAlgorithm, "HashAlgorithm");
- Assert.IsNull (an.KeyPair, "KeyPair");
- Assert.IsNotNull (an.Name, "Name");
- Assert.IsNotNull (an.Version, "Version");
- Assert.AreEqual (AssemblyVersionCompatibility.SameMachine,
- an.VersionCompatibility, "VersionCompatibility");
- }
+ AssemblyName an = corlib_test.GetReferencedAssemblies ().First (l => l.Name == "mscorlib");
+ Assert.IsNull (an.CodeBase, "CodeBase");
+ Assert.IsNotNull (an.CultureInfo, "CultureInfo");
+ Assert.IsNull (an.EscapedCodeBase, "EscapedCodeBase");
+ Assert.AreEqual (AssemblyNameFlags.None, an.Flags, "Flags");
+ Assert.IsNotNull (an.FullName, "FullName");
+ Assert.AreEqual (AssemblyHashAlgorithm.SHA1, an.HashAlgorithm, "HashAlgorithm");
+ Assert.IsNull (an.KeyPair, "KeyPair");
+ Assert.IsNotNull (an.Name, "Name");
+ Assert.IsNotNull (an.Version, "Version");
+ Assert.AreEqual (AssemblyVersionCompatibility.SameMachine, an.VersionCompatibility, "VersionCompatibility");
}
#if !MONOTOUCH && !FULL_AOT_RUNTIME // Reflection.Emit is not supported.
Assert.AreEqual (3, c.Counter);
}
+ [Test]
+ public void EnumeratorsEquality ()
+ {
+ int [] normalBase = new int [0];
+ IEnumerable<int> specialBase = new int [0];
+
+ var firstSpecial = specialBase.GetEnumerator ();
+ var secondSpecial = specialBase.GetEnumerator ();
+ var firstNormal = normalBase.GetEnumerator ();
+ var secondNormal = normalBase.GetEnumerator ();
+
+ Assert.IsFalse (object.ReferenceEquals (firstNormal, secondNormal));
+ Assert.IsTrue (object.ReferenceEquals (firstSpecial, secondSpecial));
+ }
[Test]
public void JaggedArrayCtor ()
public const string Arg_DuplicateWaitObjectException = "Duplicate objects in argument.";
public const string Arg_EnumAndObjectMustBeSameType = "Object must be the same type as the enum. The type passed in was '{0}'; the enum type was '{1}'.";
public const string Arg_EntryPointNotFoundException = "Entry point was not found.";
+ public const string Arg_EntryPointNotFoundExceptionParameterized = "Unable to find an entry point named '{0}' in DLL '{1}'.";
public const string Arg_EnumIllegalVal = "Illegal enum value: {0}.";
public const string Arg_ExecutionEngineException = "Internal error in the runtime.";
public const string Arg_ExternalException = "External component has thrown an exception.";
public const string InvalidOperation_IComparerFailed = "Failed to compare two elements in the array.";
public const string InvalidOperation_NoValue = "Nullable object must have a value.";
public const string InvalidOperation_NullArray = "The underlying array is null.";
+ public const string InvalidOperation_Overlapped_Pack = "Cannot pack a packed Overlapped again.";
public const string InvalidOperation_ReadOnly = "Instance is read-only.";
public const string InvalidOperation_ThreadWrongThreadStart = "The thread was created with a ThreadStart delegate that does not accept a parameter.";
public const string InvalidOperation_UnknownEnumType = "Unknown enum type.";
public const string Argument_NotEnoughBytesToRead = "There are not enough bytes remaining in the accessor to read at this position.";
public const string Argument_NotEnoughBytesToWrite = "There are not enough bytes remaining in the accessor to write at this position.";
public const string Argument_OffsetAndCapacityOutOfBounds = "Offset and capacity were greater than the size of the view.";
+ public const string ArgumentOutOfRange_UnmanagedMemStreamLength = "UnmanagedMemoryStream length must be non-negative and less than 2^63 - 1 - baseAddress.";
public const string Argument_UnmanagedMemAccessorWrapAround = "The UnmanagedMemoryAccessor capacity and offset would wrap around the high end of the address space.";
public const string ArgumentOutOfRange_StreamLength = "Stream length must be non-negative and less than 2^31 - 1 - origin.";
public const string ArgumentOutOfRange_UnmanagedMemStreamWrapAround = "The UnmanagedMemoryStream capacity would wrap around the high end of the address space.";
public const string EventSource_EventSourceGuidInUse = "An instance of EventSource with Guid {0} already exists.";
public const string EventSource_ListenerWriteFailure = "An error occurred when writing to a listener.";
public const string EventSource_NoManifest = "A manifest could not be generated for this EventSource because it contains one or more ill-formed event methods.";
+ public const string Argument_StreamNotWritable = "Stream was not writable.";
+ public const string Arg_SurrogatesNotAllowedAsSingleChar = "Unicode surrogate characters must be written out as pairs together in the same call, not individually. Consider passing in a character array instead.";
+ public const string CustomAttributeFormat_InvalidFieldFail = "'{0}' field specified was not found.";
+ public const string CustomAttributeFormat_InvalidPropertyFail = "'{0}' property specified was not found.";
+ public const string NotSupported_CannotCallEqualsOnSpan = "Equals() on Span and ReadOnlySpan is not supported. Use operator== instead.";
+ public const string NotSupported_CannotCallGetHashCodeOnSpan = "GetHashCode() on Span and ReadOnlySpan is not supported.";
+ public const string Argument_DestinationTooShort = "Destination is too short.";
+ public const string Argument_InvalidTypeWithPointersNotSupported = "Cannot use type '{0}'. Only value types without pointers or references are supported.";
+ public const string ArrayTypeMismatch_ConstrainedCopy = "Array.ConstrainedCopy will only work on array types that are provably compatible, without any form of boxing, unboxing, widening, or casting of each array element. Change the array types (i.e., copy a Derived[] to a Base[]), or use a mitigation strategy in the CER for Array.Copy's less powerful reliability contract, such as cloning the array or throwing away the potentially corrupt destination array.";
+ public const string Arg_DllNotFoundException = "Dll was not found.";
+ public const string Arg_DllNotFoundExceptionParameterized = "Unable to load DLL '{0}': The specified module could not be found.";
+ public const string WrongSizeArrayInNStruct = "Type could not be marshaled because the length of an embedded array instance does not match the declared length in the layout.";
+ public const string Arg_InteropMarshalUnmappableChar = "Cannot marshal: Encountered unmappable character.";
+ public const string Arg_MarshalDirectiveException = "Marshaling directives are invalid.";
public const string BlockingCollection_Add_ConcurrentCompleteAdd = "CompleteAdding may not be used concurrently with additions to the collection.";
public const string BlockingCollection_Add_Failed = "The underlying collection didn't accept the item.";
public const string BlockingCollection_CantAddAnyWhenCompleted = "At least one of the specified collections is marked as complete with regards to additions.";
public const string PartitionerStatic_CanNotCallGetEnumeratorAfterSourceHasBeenDisposed = "Can not call GetEnumerator on partitions after the source enumerable is disposed";
public const string PartitionerStatic_CurrentCalledBeforeMoveNext = "MoveNext must be called at least once before calling Current.";
public const string ConcurrentBag_Enumerator_EnumerationNotStartedOrAlreadyFinished = "Enumeration has either not started or has already finished.";
+ public const string ArrayTypeMustBeExactMatch = "The array type must be exactly {0}.";
+ public const string CannotCallEqualsOnSpan = "Equals() on Span and ReadOnlySpan is not supported. Use operator== instead.";
+ public const string CannotCallGetHashCodeOnSpan = "GetHashCode() on Span and ReadOnlySpan is not supported.";
}
--- /dev/null
+namespace System.IO
+{
+ partial class Stream
+ {
+ public virtual int Read (Span<byte> destination)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public virtual void Write(ReadOnlySpan<byte> source)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
\ No newline at end of file
<Compile Include="..\..\..\external\corefx\src\System.Collections.Concurrent\src\System\Collections\Concurrent\Partitioner.cs" />\r
<Compile Include="..\..\..\external\corefx\src\System.Collections.Concurrent\src\System\Collections\Concurrent\PartitionerStatic.cs" />\r
<Compile Include="..\..\..\external\corefx\src\System.Collections\src\System\Collections\Generic\CollectionExtensions.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Memory\src\System\Pinnable.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Memory\src\System\ReadOnlySpan.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Memory\src\System\Span.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Memory\src\System\SpanDebugView.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Memory\src\System\SpanHelpers.Clear.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Memory\src\System\SpanHelpers.cs" />\r
+ <Compile Include="..\..\..\external\corefx\src\System.Memory\src\System\ThrowHelper.cs" />\r
<Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X509ContentType.cs" />\r
<Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.X509Certificates\src\System\Security\Cryptography\X509Certificates\X509KeyStorageFlags.cs" />\r
<Compile Include="..\..\..\external\corert\src\Common\src\Interop\Unix\Interop.Libraries.cs" />\r
<Compile Include="corert\Interop.MemAllocFree.cs" />\r
<Compile Include="corert\RelocatedTypeAttribute.cs" />\r
<Compile Include="corert\RuntimeThread.cs" />\r
+ <Compile Include="corert\Stream.cs" />\r
<Compile Include="corert\ThreadPoolBoundHandle.cs" />\r
<Compile Include="Microsoft.Win32\IRegistryApi.cs" />\r
<Compile Include="Microsoft.Win32\Registry.cs" />\r
<Compile Include="System.Resources\Win32Resources.cs" />\r
<Compile Include="System.Runtime.CompilerServices\ConditionalWeakTable.cs" />\r
<Compile Include="System.Runtime.CompilerServices\RuntimeHelpers.cs" />\r
+ <Compile Include="System.Runtime.CompilerServices\Unsafe.cs" />\r
<Compile Include="System.Runtime.Hosting\ActivationArguments.cs" />\r
<Compile Include="System.Runtime.Hosting\ApplicationActivator.cs" />\r
<Compile Include="System.Runtime.InteropServices.WindowsRuntime\DesignerNamespaceResolveEventArgs.cs" />\r
System.Runtime/MemoryFailPoint.cs
System.Runtime.CompilerServices/ConditionalWeakTable.cs
System.Runtime.CompilerServices/RuntimeHelpers.cs
+System.Runtime.CompilerServices/Unsafe.cs
System.Runtime.Hosting/ActivationArguments.cs
System.Runtime.Hosting/ApplicationActivator.cs
System.Runtime.InteropServices/_Activator.cs
corert/EnvironmentAugments.cs
corert/RelocatedTypeAttribute.cs
corert/RuntimeThread.cs
+corert/Stream.cs
corert/ThreadPoolBoundHandle.cs
../../../external/corert/src/Common/src/Interop/Unix/Interop.Libraries.cs
../../../external/corefx/src/System.Collections.Concurrent/src/System/Collections/Concurrent/Partitioner.cs
../../../external/corefx/src/System.Collections.Concurrent/src/System/Collections/Concurrent/PartitionerStatic.cs
+../../../external/corefx/src/System.Memory/src/System/Pinnable.cs
+../../../external/corefx/src/System.Memory/src/System/ReadOnlySpan.cs
+../../../external/corefx/src/System.Memory/src/System/Span.cs
+../../../external/corefx/src/System.Memory/src/System/SpanDebugView.cs
+../../../external/corefx/src/System.Memory/src/System/SpanHelpers.cs
+../../../external/corefx/src/System.Memory/src/System/SpanHelpers.Clear.cs
+../../../external/corefx/src/System.Memory/src/System/ThrowHelper.cs
+
+
System.Security.Cryptography.X509Certificates/X509CertificateImplApple.cs
System.Security.Cryptography.X509Certificates/X509Helper.Apple.cs
CoreFoundation/CFHelpers.cs
../../../external/corefx/src/CoreFx.Private.TestUtilities/src/System/AssertExtensions.cs
-../../../external/corefx/src/Common/tests/System/PlatformDetection.cs
../../../external/corefx/src/System.Reflection.Emit/tests/Utilities.cs
--- /dev/null
+thisdir = class/corlib/il
+
+include ../../../build/rules.make
+include il.make
+
+clean-local:
+
+TMP_MSCORLIB = $(topdir)/class/lib/$(PROFILE_DIRECTORY)/mscorlib.input
+
+all-local: $(IL_REPLACE)
+ cp $(topdir)/class/lib/$(PROFILE_DIRECTORY)/mscorlib.dll $(TMP_MSCORLIB)
+ $(Q) $(STRING_REPLACER) --ilreplace=$(IL_REPLACE) $(TMP_MSCORLIB)
+ mv $(TMP_MSCORLIB) $(topdir)/class/lib/$(PROFILE_DIRECTORY)/mscorlib.dll
+
+install-local:
--- /dev/null
+IL_REPLACE = $(topdir)/class/lib/$(PROFILE_DIRECTORY)/corlib.unsafe.dll.tmp
+
+$(topdir)/class/lib/$(PROFILE_DIRECTORY)/corlib.unsafe.dll.tmp: $(topdir)/class/corlib/System.Runtime.CompilerServices/Unsafe.il
+ $(Q) $(ILASM) $< /dll /noautoinherit /out:$@
+
+CLEAN_FILES += $(IL_REPLACE)
return (*(UInt64*)(&d) & 0x7FFFFFFFFFFFFFFFL) > 0x7FF0000000000000L;
}
+#if MONO
+ [Pure]
+ [System.Runtime.Versioning.NonVersionable]
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public unsafe static bool IsFinite(double d)
+ {
+ var bits = BitConverter.DoubleToInt64Bits(d);
+ return (bits & 0x7FFFFFFFFFFFFFFF) < 0x7FF0000000000000;
+ }
+#endif
// Compares this object to another object, returning an instance of System.Relation.
// Null is considered less than any instance.
[ContractClass(typeof(StreamContract))]
#endif
#if FEATURE_REMOTING || MONO
- public abstract class Stream : MarshalByRefObject, IDisposable {
+ public abstract partial class Stream : MarshalByRefObject, IDisposable {
#else // FEATURE_REMOTING
public abstract class Stream : IDisposable {
#endif // FEATURE_REMOTING
InternalCopyTo(destination, _DefaultCopyBufferSize);
}
+#if MONO
+ virtual
+#endif
public void CopyTo(Stream destination, int bufferSize)
{
if (destination == null)
return (*(int*)(&f) & 0x7FFFFFFF) > 0x7F800000;
}
+#if MONO
+ [Pure]
+ [System.Runtime.Versioning.NonVersionable]
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public unsafe static bool IsFinite(float f) {
+ return (*(int*)(&f) & 0x7FFFFFFF) < 0x7F800000;
+ }
+#endif
+
// Compares this object to another object, returning an integer that
// indicates the relationship.
// Returns a value less than zero if this object
using System.Diagnostics.Contracts;
[Pure]
- internal static class ThrowHelper {
+ internal static partial class ThrowHelper {
internal static void ThrowArgumentOutOfRangeException() {
ThrowArgumentOutOfRangeException(ExceptionArgument.index, ExceptionResource.ArgumentOutOfRange_Index);
}
throw new ArgumentException(Environment.GetResourceString(GetResourceName(resource)), GetArgumentName(argument));
}
+#if !MONO
internal static void ThrowArgumentNullException(ExceptionArgument argument) {
throw new ArgumentNullException(GetArgumentName(argument));
}
internal static void ThrowArgumentOutOfRangeException(ExceptionArgument argument) {
throw new ArgumentOutOfRangeException(GetArgumentName(argument));
}
+#endif
internal static void ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) {
options,
view,
sourceBytesToCopy,
+#if MONO
+ start,
+#endif
}
//
--- /dev/null
+namespace System
+{
+ static partial class PlatformDetection
+ {
+ public static readonly bool IsNetNative = false;
+ }
+}
\ No newline at end of file
public bool ShowHelp { get; set; }
public bool Verbose { get; set; }
public List<string> ResourcesStrings { get; }
+ public string ILFile { get; set; }
public CmdOptions ()
{
var p = new OptionSet () {
{ "r|resourcestrings=", "File with string resource in key=value format",
v => options.ResourcesStrings.Add (v) },
- { "h|help", "Display available options",
+ { "h|help", "Display available options",
v => options.ShowHelp = v != null },
- { "v|verbose", "Use verbose output",
- v => options.Verbose = v != null },
+ { "v|verbose", "Use verbose output",
+ v => options.Verbose = v != null },
+ { "ilreplace=", "File with IL code to be used instead",
+ v => options.ILFile = v },
};
List<string> extra;
static void RewriteAssembly (string assemblyLocation, Dictionary<string, string> resourcesStrings, CmdOptions options)
{
+ var methods = new Dictionary<string, MethodBody> (StringComparer.Ordinal);
+ if (options.ILFile != null) {
+ var rp = new ReaderParameters {
+ InMemory = true
+ };
+
+ using (var module = ModuleDefinition.ReadModule (options.ILFile,rp)) {
+ foreach (var type in module.GetTypes ()) {
+ foreach (var method in type.Methods) {
+ if (!method.HasBody)
+ continue;
+
+ methods.Add (method.FullName, method.Body);
+ }
+ }
+ }
+ }
+
var readerParameters = new ReaderParameters {
ReadSymbols = true,
ReadWrite = true,
if (!method.HasBody)
continue;
+ MethodBody newBody;
+ if (methods.TryGetValue (method.FullName, out newBody)) {
+ var mbody = method.Body;
+ mbody.Instructions.Clear ();
+ foreach (var instr in newBody.Instructions) {
+ switch (instr.OpCode.OperandType) {
+ case OperandType.InlineType:
+ var tr = (TypeReference)instr.Operand;
+ foreach (var t in method.GenericParameters) {
+ if (tr.FullName == t.FullName) {
+ instr.Operand = t;
+ break;
+ }
+ }
+
+ break;
+ }
+
+ mbody.Instructions.Add (instr);
+ }
+
+ method.Body.Variables.Clear ();
+ foreach (var variable in newBody.Variables) {
+ mbody.Variables.Add (variable);
+ }
+ }
+
foreach (var instr in method.Body.Instructions) {
if (instr.OpCode != OpCodes.Ldstr)
continue;
}
}
- if (!ic)
- g_assert (ic);
- g_assert (MONO_CLASS_IS_INTERFACE (ic));
-
return ic;
}
+static void
+mono_cominterop_get_interface_missing_error (MonoError* error, MonoMethod* method)
+{
+ mono_error_set_invalid_operation (error, "Method '%s' in ComImport class '%s' must implement an interface method.", method->name, method->klass->name);
+}
+
/**
* cominterop_get_com_slot_for_method:
* @method: a method
+ * @error: set on error
*
* Returns: the method's slot in the COM interface vtable
*/
static int
-cominterop_get_com_slot_for_method (MonoMethod* method)
+cominterop_get_com_slot_for_method (MonoMethod* method, MonoError* error)
{
guint32 slot = method->slot;
MonoClass *ic = method->klass;
+ error_init (error);
+
/* if method is on a class, we need to look up interface method exists on */
if (!MONO_CLASS_IS_INTERFACE(ic)) {
int offset = 0;
int i = 0;
ic = cominterop_get_method_interface (method);
+ if (!ic || !MONO_CLASS_IS_INTERFACE (ic)) {
+ mono_cominterop_get_interface_missing_error (error, method);
+ return -1;
+ }
offset = mono_class_interface_offset (method->klass, ic);
g_assert(offset >= 0);
int mcount = mono_class_get_method_count (ic);
mono_mb_emit_cominterop_get_function_pointer (MonoMethodBuilder *mb, MonoMethod *method)
{
#ifndef DISABLE_JIT
+ int slot;
+ MonoError error;
// get function pointer from 1st arg, the COM interface pointer
mono_mb_emit_ldarg (mb, 0);
- mono_mb_emit_icon (mb, cominterop_get_com_slot_for_method (method));
- mono_mb_emit_icall (mb, cominterop_get_function_pointer);
- /* Leaves the function pointer on top of the stack */
+ slot = cominterop_get_com_slot_for_method (method, &error);
+ if (is_ok (&error)) {
+ mono_mb_emit_icon (mb, slot);
+ mono_mb_emit_icall (mb, cominterop_get_function_pointer);
+ /* Leaves the function pointer on top of the stack */
+ }
+ else {
+ mono_mb_emit_exception_for_error (mb, &error);
+ }
+ mono_error_cleanup (&error);
#endif
}
mono_mb_emit_managed_call (mb, ctor, NULL);
mono_mb_emit_byte (mb, CEE_RET);
}
+ else if (method->flags & METHOD_ATTRIBUTE_STATIC) {
+ /*
+ * The method's class must implement an interface.
+ * However, no interfaces are allowed to have static methods.
+ * Thus, calling it should invariably lead to an exception.
+ */
+ MonoError error;
+ error_init (&error);
+ mono_cominterop_get_interface_missing_error (&error, method);
+ mono_mb_emit_exception_for_error (mb, &error);
+ mono_error_cleanup (&error);
+ }
else {
static MonoMethod * ThrowExceptionForHR = NULL;
MonoMethod *adjusted_method;
ves_icall_System_Runtime_InteropServices_Marshal_GetComSlotForMethodInfoInternal (MonoReflectionMethod *m)
{
#ifndef DISABLE_COM
- return cominterop_get_com_slot_for_method (m->method);
+ MonoError error;
+ int slot = cominterop_get_com_slot_for_method (m->method, &error);
+ mono_error_assert_ok (&error);
+ return slot;
#else
g_assert_not_reached ();
#endif
mono_mb_emit_exception_full (mb, "System", exc_name, msg);
}
+/**
+ * mono_mb_emit_exception_for_error:
+ */
+void
+mono_mb_emit_exception_for_error (MonoMethodBuilder *mb, MonoError *error)
+{
+ /*
+ * If at some point there is need to support other types of errors,
+ * the behaviour should conform with mono_error_prepare_exception().
+ */
+ g_assert (mono_error_get_error_code (error) == MONO_ERROR_GENERIC && "Unsupported error code.");
+ mono_mb_emit_exception_full (mb, "System", mono_error_get_exception_name (error), mono_error_get_message (error));
+}
+
/**
* mono_mb_emit_add_to_local:
*/
void
mono_mb_emit_exception_full (MonoMethodBuilder *mb, const char *exc_nspace, const char *exc_name, const char *msg);
+void
+mono_mb_emit_exception_for_error (MonoMethodBuilder *mb, MonoError *error);
+
void
mono_mb_emit_icon (MonoMethodBuilder *mb, gint32 value);
--- /dev/null
+// This test is meant to make sure Mono doesn't fail when invalid COM invocations are present but never reached.
+// See https://bugzilla.xamarin.com/show_bug.cgi?id=8477 for details.
+
+using System;
+using System.Runtime.InteropServices;
+using System.Runtime.CompilerServices;
+
+[ComImport, Guid("06A82D35-8946-4E2E-AE71-DADDE8341F5D")]
+class COMponent
+{
+ [MethodImpl(MethodImplOptions.InternalCall)] public static extern void InCOMplete1 ();
+ [MethodImpl(MethodImplOptions.InternalCall)] public extern void InCOMplete2 ();
+}
+
+class Test
+{
+ static void COMmunicate (COMponent c)
+ {
+ if (c != null)
+ c.InCOMplete2 ();
+ }
+
+ static int Main()
+ {
+ // Check #1: An invocation of a ComImport class method w/o a corresponding interface method must lead to an exception.
+ try
+ {
+ COMponent.InCOMplete1();
+ // No exception has been thrown, something is wrong.
+ return 1;
+ }
+ catch (InvalidOperationException)
+ {
+ // An exception has been thrown and caught correctly.
+ }
+
+ // Check #2: Same as #1, but the method is not executed (i.e. it's located in a "cold" basic block). No exception should be thrown.
+ COMmunicate (null);
+
+ return 0;
+ }
+}
#endif
/* Used when building with Android NDK's unified headers */
-#if defined(HOST_ANDROID)
+#if defined(HOST_ANDROID) && defined (ANDROID_UNIFIED_HEADERS)
#if __ANDROID_API__ < 21
typedef int32_t __mono_off32_t;
#endif /* !sendfile */
#endif /* __ANDROID_API__ < 21 */
-#endif /* HOST_ANDROID */
+#endif /* HOST_ANDROID && ANDROID_UNIFIED_HEADERS */
#endif /* __UTILS_MONO_COMPILER_H__*/
gboolean
mono_error_set_from_boxed (MonoError *error, const MonoErrorBoxed *from);
+const char*
+mono_error_get_exception_name (MonoError *oerror);
#endif
return error->error_code;
}
+const char*
+mono_error_get_exception_name (MonoError *oerror)
+{
+ MonoErrorInternal *error = (MonoErrorInternal*)oerror;
+
+ if (error->error_code == MONO_ERROR_NONE)
+ return NULL;
+
+ return error->exception_name;
+}
+
/*Return a pointer to the internal error message, might be NULL.
Caller should not release it.*/
const char*