Compare commits

...
Author SHA1 Message Date
Michael Hutchinson 4657221dcc [gacutil] Create correct relative package symlinks
BXC17951 - broken softlinks in mono/xbuild/12.0/bin
2014-02-26 18:38:44 -05:00
Michael Hutchinson 1b62dca6cc [xbuild] Fix PCL 4.5 targets 2014-02-18 12:09:48 -05:00
Michael Hutchinson 0a425af914 [xbuild] Define VisualStudioVersion, since F# projects can depend on it 2014-02-18 12:09:12 -05:00
Ashley Winters 472bc7bfa5 Fix 'make dist' broken since 35287878
In commit 35287878b9:

    [xbuild] Reorganize xbuild targets/frameworks/bin data

Several files were shuffled around, but the EXTRA_DISTFILES was
not fully updated with the new file paths.

This patch is required to build a 3.2.7 tarball.
2014-02-18 12:09:04 -05:00
Alex Rønne Petersen 7c274c477d Merge pull request #893 from antoniusriha/fixregression
[runtime] Fix a regression caused by a0afa38296
2014-02-18 16:46:24 +01:00
Alex Rønne Petersen 1bb562b8d5 Merge pull request #894 from antoniusriha/fixIsIPv6Teredo
[System] Fixed an error in the implementation of System.Net.IPAddress.IsIPv6Teredo
2014-02-18 03:42:03 +01:00
Alexander Köplinger 3901f01875 [System] Fixed an error in the implementation of System.Net.IPAddress.IsIPv6Teredo
The property was introduced with PR #870 but it missed to convert network byte order to host byte order, so the comparison
wasn't working correctly and the corresponding unit test failed. @marek-safar erroneously "fixed" the test in 27e07c7.

This is the corrected implementation and the original test now works as intended.
2014-02-09 13:02:33 +01:00
Zoltan Varga cf7d241aab [runtime] Fix a regression caused by a0afa38296. 2014-02-09 10:27:40 +01:00
Rodrigo Kumpera 40f92d5cb6 [System] Fix process creation when UseShellExecute is set to false.
This fixes the behavior of process spawning when UseShellExecute is
set to true.

The right behavior is to return no process only when we used the system
launcher. So, spawning /bin/cat should behave in the same way independent
of how UseShellExecute is set.
2014-02-06 15:56:14 -05:00
Rodrigo Kumpera 0895a37089 Revert "[runtime] Don't pass SEE_MASK_NOCLOSEPROCESS to ShellExecuteEx as we don't care for the launched process. Part 1/3 of Bug #16119."
This reverts commit 6c06d10995.
2014-02-06 15:56:01 -05:00
Zoltan Varga 5b8ba7e3ca [runtime] Put back ensure_synch_cs_set () which was removed in a157ac79e8 to work around some shutdown crashes. 2014-02-06 20:09:05 +01:00
Alan McGovern 0c35cf5ef0 [Microsoft.Build.Utilities] Properly escape/unescape ItemSpec
With tests.
2014-01-28 16:28:22 -05:00
Alan McGovern d2a1623a18 [Microsoft.Build.Utilities] Fix the escaping/unescaping of ItemSpec
This should hopefully fix compilation of projects using files with
names like '[email protected]' in various places like embedded resources
or content items which must be copied to the output directory.

With tests.
2014-01-28 16:28:16 -05:00
Alan McGovern cb725ff9de [Microsoft.Build.Engine] Fix the escaping/unescaping of FullPath metadata
It is incorrect to escape the FullPath metadata for a build item when
we invoke GetEvaluatedMetadata. If we do this we end up completely breaking
every file with a special character in it as things like this would always
fail as we'd pass an escaped path to the filesystem:
	File.Exists (item.GetEvaluatedMetadata ("FullPath"))

The iOS designer encountered this issue when we added retina images
called "[email protected]" to our solution.

With tests.
2014-01-28 16:28:11 -05:00
Rodrigo Kumpera 50f293135f Properly compare assembly versions when performing binding. Fixes #17368.
The right way to compare assembly versions is by translating the major/minor
pair into a single number and compare that.

Since each element can only be one byte long, we multiply major by 256
before adding to minor.

This solves the problem where version 100.0.0.0 was not after 3.5.0.0.
2014-01-27 16:39:38 -05:00
Aaron Bockover 11e1a399ac driver.c: Revert "Update message"
This reverts commit 85841d0bbd.

Some scripts unfortunately depend on the verbage "Mono JIT compiler"
in the "mono --version" message. While this was never a blessed
or supported way of getting the version (use pkg-config) of Mono,
nonetheless this breaks some important stuff. We can use the better
message in the (somewhat distant) future.
2014-01-16 18:05:25 -05:00
Zoltan Varga 61740f8417 [jit] Use the jit lock instead of the loader lock in mono_tramp_info_register (). 2014-01-15 18:51:58 +01:00
24 changed files with 319 additions and 78 deletions

No files matched your search

@@ -167,9 +167,7 @@ namespace Microsoft.Build.BuildEngine {
{
if (ReservedNameUtils.IsReservedMetadataName (metadataName)) {
string metadata = ReservedNameUtils.GetReservedMetadata (FinalItemSpec, metadataName, evaluatedMetadata);
return string.Equals (metadataName, "fullpath", StringComparison.OrdinalIgnoreCase)
? MSBuildUtils.Escape (metadata)
: metadata;
return MSBuildUtils.Unescape (metadata);
}
if (evaluatedMetadata.Contains (metadataName))
@@ -181,10 +179,7 @@ namespace Microsoft.Build.BuildEngine {
public string GetMetadata (string metadataName)
{
if (ReservedNameUtils.IsReservedMetadataName (metadataName)) {
string metadata = ReservedNameUtils.GetReservedMetadata (FinalItemSpec, metadataName, unevaluatedMetadata);
return string.Equals (metadataName, "fullpath", StringComparison.OrdinalIgnoreCase)
? MSBuildUtils.Escape (metadata)
: metadata;
return ReservedNameUtils.GetReservedMetadata (FinalItemSpec, metadataName, unevaluatedMetadata);
} else if (unevaluatedMetadata.Contains (metadataName))
return (string) unevaluatedMetadata [metadataName];
else
@@ -284,6 +284,40 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
Assert.AreEqual (String.Empty, item.GetMetadata ("AccessedTime"), "A13");
}
[Test]
public void GetMetadata_UnescapedItemSpec ()
{
string itemInclude = "a;b;c";
string escapedItemInclude = Utilities.Escape (itemInclude);
item = new BuildItem ("name", itemInclude);
Assert.IsTrue (item.GetMetadata ("FullPath").EndsWith (escapedItemInclude), "#1a");
Assert.IsTrue (item.GetEvaluatedMetadata ("FullPath").EndsWith (itemInclude), "#1b");
Assert.AreEqual (itemInclude, item.GetMetadata ("FileName"), "#2b");
Assert.AreEqual (itemInclude, item.GetEvaluatedMetadata ("FileName"), "#2b");
Assert.AreEqual (itemInclude, item.GetMetadata ("Identity"), "#3a");
Assert.AreEqual (itemInclude, item.GetEvaluatedMetadata ("Identity"), "#3b");
}
[Test]
public void GetMetadata_EscapedItemSpec ()
{
string itemInclude = "a;b;c";
string escapedItemInclude = Utilities.Escape (itemInclude);
item = new BuildItem ("name", escapedItemInclude);
Assert.IsTrue (item.GetMetadata ("FullPath").EndsWith (escapedItemInclude), "#1a");
Assert.IsTrue (item.GetEvaluatedMetadata ("FullPath").EndsWith (itemInclude), "#1b");
Assert.AreEqual (escapedItemInclude, item.GetMetadata ("FileName"), "#2b");
Assert.AreEqual (itemInclude, item.GetEvaluatedMetadata ("FileName"), "#2b");
Assert.AreEqual (escapedItemInclude, item.GetMetadata ("Identity"), "#3a");
Assert.AreEqual ("a;b;c", item.GetEvaluatedMetadata ("Identity"), "#3b");
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
public void TestGetMetadata2 ()
+1 -1
View File
@@ -13,7 +13,7 @@ LIB_MCS_FLAGS = \
/r:System.dll \
/r:$(XBUILD_FRAMEWORK)
TEST_MCS_FLAGS = /r:$(XBUILD_FRAMEWORK) -r:System.dll -r:System.Core.dll
TEST_MCS_FLAGS = /r:$(XBUILD_ENGINE) /r:$(XBUILD_FRAMEWORK) -r:System.dll -r:System.Core.dll
include $(XBUILD_DIR)/xbuild_test.make
include ../../build/library.make
@@ -64,7 +64,6 @@ namespace Microsoft.Build.Utilities
if (itemSpec == null)
throw new ArgumentNullException ("itemSpec");
this.itemSpec = itemSpec;
this.metadata = CollectionsUtil.CreateCaseInsensitiveHashtable ();
// FIXME: hack
@@ -108,9 +107,9 @@ namespace Microsoft.Build.Utilities
public string GetMetadata (string metadataName)
{
if (ReservedNameUtils.IsReservedMetadataName (metadataName))
return ReservedNameUtils.GetReservedMetadata (ItemSpec, metadataName, metadata);
return MSBuildUtils.Unescape (ReservedNameUtils.GetReservedMetadata (ItemSpec, metadataName, metadata));
else if (metadata.Contains (metadataName))
return (string) metadata [metadataName];
return MSBuildUtils.Unescape ((string)metadata [metadataName]);
else
return String.Empty;
}
@@ -153,7 +152,7 @@ namespace Microsoft.Build.Utilities
}
public string ItemSpec {
get { return itemSpec; }
get { return MSBuildUtils.Unescape (itemSpec); }
set { itemSpec = value; }
}
@@ -77,7 +77,8 @@ namespace Mono.XBuild.Utilities {
switch (metadataName.ToLowerInvariant ()) {
case "fullpath":
return Path.GetFullPath (itemSpec);
var unescapedItemSpec = MSBuildUtils.Unescape (itemSpec);
return MSBuildUtils.Escape (Path.GetFullPath (unescapedItemSpec));
case "rootdir":
if (Path.IsPathRooted (itemSpec))
return Path.GetPathRoot (itemSpec);
@@ -28,6 +28,7 @@
using System;
using System.Collections;
using System.Collections.Specialized;
using System.IO;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using NUnit.Framework;
@@ -115,6 +116,50 @@ namespace MonoTests.Microsoft.Build.Utilities {
new TaskItem ("itemspec", null);
}
[Test]
public void TestCtor_EscapedSpecialChar ()
{
// If we instantiate with the *escaped* metadata, it's unescaped automatically
var metadata = "[email protected]";
var escapedMetadata = global::Microsoft.Build.BuildEngine.Utilities.Escape ("[email protected]");
var item = new TaskItem (escapedMetadata);
item.SetMetadata ("mine", escapedMetadata);
Assert.AreEqual (metadata, item.ItemSpec, "#1");
Assert.AreEqual (metadata, item.GetMetadata ("Identity"), "#2");
Assert.AreEqual (Path.GetFileNameWithoutExtension (metadata), item.GetMetadata ("FileName"), "#3");
Assert.IsTrue (item.GetMetadata ("FullPath").EndsWith (metadata), "#4");
Assert.AreEqual (metadata, item.GetMetadata ("mine"), "#5");
}
[Test]
public void TestCtor_EscapedSpecialChar_BrokenEscaping ()
{
// This is badly escaped, but MSBuild does not care.
var metadata = "foo%[email protected]";
var item = new TaskItem (metadata);
Assert.AreEqual (metadata, item.ItemSpec, "#1");
Assert.AreEqual (metadata, item.GetMetadata ("Identity"), "#2");
Assert.AreEqual (Path.GetFileNameWithoutExtension (metadata), item.GetMetadata ("FileName"), "#3");
Assert.IsTrue (item.GetMetadata ("FullPath").EndsWith (metadata), "#4");
}
[Test]
public void TestCtor_UnescapedSpecialChar ()
{
// If we instantiate with unescaped metadata, we get the same value back
var metadata = "[email protected]";
var item = new TaskItem (metadata);
item.SetMetadata ("mine", metadata);
Assert.AreEqual (metadata, item.ItemSpec, "#1");
Assert.AreEqual (metadata, item.GetMetadata ("Identity"), "#2");
Assert.AreEqual (Path.GetFileNameWithoutExtension (metadata), item.GetMetadata ("FileName"), "#3");
Assert.IsTrue (item.GetMetadata ("FullPath").EndsWith (metadata), "#4");
Assert.AreEqual (metadata, item.GetMetadata ("mine"), "#5");
}
[Test]
public void TestCopyConstructor ()
{
@@ -240,5 +285,19 @@ namespace MonoTests.Microsoft.Build.Utilities {
item = new TaskItem ("lalala");
item.SetMetadata ("Identity", "some value");
}
[Test]
public void TestSetItemSpec ()
{
var itemSpec = "[email protected]";
var escapedItemSpec = global::Microsoft.Build.BuildEngine.Utilities.Escape (itemSpec);
var item = new TaskItem ("foo");
item.ItemSpec = itemSpec;
Assert.AreEqual (itemSpec, item.ItemSpec, "#1");
item.ItemSpec = escapedItemSpec;
Assert.AreEqual (itemSpec, item.ItemSpec, "#2");
}
}
}
@@ -918,7 +918,7 @@ namespace System.Diagnostics {
IntPtr stderr,
ref ProcInfo proc_info);
private static bool Start_shell (ProcessStartInfo startInfo)
private static bool Start_shell (ProcessStartInfo startInfo, Process process)
{
ProcInfo proc_info=new ProcInfo();
bool ret;
@@ -945,6 +945,9 @@ namespace System.Diagnostics {
throw new Win32Exception (-proc_info.pid);
}
process.process_handle = proc_info.process_handle;
process.pid = proc_info.pid;
process.StartExitCallbackIfNeeded ();
return(ret);
}
@@ -1156,7 +1159,7 @@ namespace System.Diagnostics {
if (startInfo.UseShellExecute) {
if (!String.IsNullOrEmpty (startInfo.UserName))
throw new InvalidOperationException ("UserShellExecute must be false if an explicit UserName is specified when starting a process");
return (Start_shell (startInfo));
return (Start_shell (startInfo, process));
} else {
return (Start_noshell (startInfo, process));
}
@@ -1176,12 +1179,9 @@ namespace System.Diagnostics {
if (startInfo == null)
throw new ArgumentNullException ("startInfo");
Process process = null;
if (!startInfo.UseShellExecute) {
process = new Process();
process.StartInfo = startInfo;
}
if (Start_common(startInfo, process))
Process process = new Process();
process.StartInfo = startInfo;
if (Start_common(startInfo, process) && process.process_handle != IntPtr.Zero)
return process;
return null;
}
+1 -1
View File
@@ -337,7 +337,7 @@ namespace System.Net {
public bool IsIPv6Teredo {
get {
return m_Family != AddressFamily.InterNetwork &&
m_Numbers[0] == 0x2001 &&
NetworkToHostOrder ((short) m_Numbers [0]) == 0x2001 &&
m_Numbers[1] == 0;
}
}
+1 -1
View File
@@ -2,7 +2,7 @@ thisdir = tools/gacutil
SUBDIRS =
include ../../build/rules.make
LOCAL_MCS_FLAGS = -r:Mono.Security.dll
LOCAL_MCS_FLAGS = -r:Mono.Security.dll -unsafe
PROGRAM = gacutil.exe
+84 -1
View File
@@ -352,7 +352,8 @@ namespace Mono.Tools {
Environment.Exit (1);
}
if (Path.DirectorySeparatorChar == '/') {
string pkg_path = "../gac/" + an.Name + "/" + version_token + "/" + asmb_file;
string pkg_path_abs = Path.Combine (gacdir, Path.Combine (an.Name, Path.Combine (version_token, asmb_file)));
string pkg_path = AbsoluteToRelativePath (ref_dir, pkg_path_abs);
symlink (pkg_path, ref_path);
foreach (string ext in siblings) {
@@ -385,6 +386,88 @@ namespace Mono.Tools {
return true;
}
//from MonoDevelop.Core.FileService
unsafe static string AbsoluteToRelativePath (string baseDirectoryPath, string absPath)
{
if (!Path.IsPathRooted (absPath) || string.IsNullOrEmpty (baseDirectoryPath))
return absPath;
absPath = Path.GetFullPath (absPath);
baseDirectoryPath = Path.GetFullPath (baseDirectoryPath).TrimEnd (Path.DirectorySeparatorChar);
fixed (char* bPtr = baseDirectoryPath, aPtr = absPath) {
var bEnd = bPtr + baseDirectoryPath.Length;
var aEnd = aPtr + absPath.Length;
char* lastStartA = aEnd;
char* lastStartB = bEnd;
int indx = 0;
// search common base path
var a = aPtr;
var b = bPtr;
while (a < aEnd) {
if (*a != *b)
break;
if (IsSeparator (*a)) {
indx++;
lastStartA = a + 1;
lastStartB = b;
}
a++;
b++;
if (b >= bEnd) {
if (a >= aEnd || IsSeparator (*a)) {
indx++;
lastStartA = a + 1;
lastStartB = b;
}
break;
}
}
if (indx == 0)
return absPath;
if (lastStartA >= aEnd)
return ".";
// handle case a: some/path b: some/path/deeper...
if (a >= aEnd) {
if (IsSeparator (*b)) {
lastStartA = a + 1;
lastStartB = b;
}
}
// look how many levels to go up into the base path
int goUpCount = 0;
while (lastStartB < bEnd) {
if (IsSeparator (*lastStartB))
goUpCount++;
lastStartB++;
}
var size = goUpCount * 2 + goUpCount + aEnd - lastStartA;
var result = new char [size];
fixed (char* rPtr = result) {
// go paths up
var r = rPtr;
for (int i = 0; i < goUpCount; i++) {
*(r++) = '.';
*(r++) = '.';
*(r++) = Path.DirectorySeparatorChar;
}
// copy the remaining absulute path
while (lastStartA < aEnd)
*(r++) = *(lastStartA++);
}
return new string (result);
}
}
static bool IsSeparator (char ch)
{
return ch == Path.DirectorySeparatorChar || ch == Path.AltDirectorySeparatorChar || ch == Path.VolumeSeparatorChar;
}
private static void Uninstall (string name, string package, string gacdir, string libdir, bool listMode, ref int uninstalled, ref int failures)
{
string [] assembly_pieces = name.Split (new char[] { ',' });
+10 -3
View File
@@ -53,6 +53,8 @@ install-pcl-targets:
$(INSTALL_DATA) targets/Microsoft.Portable.CSharp_4.0.targets $(DESTDIR)$(PORTABLE_TARGETS_DIR)/v4.0/Microsoft.Portable.CSharp.targets
$(MKINSTALLDIRS) $(DESTDIR)$(PORTABLE_TARGETS_DIR)/v4.5
$(INSTALL_DATA) targets/Microsoft.Portable.CSharp_4.5.targets $(DESTDIR)$(PORTABLE_TARGETS_DIR)/v4.5/Microsoft.Portable.CSharp.targets
$(INSTALL_DATA) targets/Microsoft.Portable.Core.targets $(DESTDIR)$(PORTABLE_TARGETS_DIR)/Microsoft.Portable.Core.targets
$(INSTALL_DATA) targets/Microsoft.Portable.Core.props $(DESTDIR)$(PORTABLE_TARGETS_DIR)/Microsoft.Portable.Core.props
install-web-targets:
$(MKINSTALLDIRS) $(DESTDIR)$(VS_TARGETS_DIR)/v9.0/WebApplications
@@ -69,20 +71,25 @@ EXTRA_DISTFILES = \
data/2.0/Microsoft.Common.tasks \
data/3.5/Microsoft.Common.tasks \
data/4.0/Microsoft.Common.tasks \
data/12.0/Microsoft.Common.tasks \
data/2.0/Microsoft.Common.targets \
data/3.5/Microsoft.Common.targets \
data/4.0/Microsoft.Common.targets \
data/12.0/Microsoft.Common.targets \
data/Microsoft.CSharp.targets \
data/Microsoft.VisualBasic.targets \
data/MSBuild/Microsoft.Build.CommonTypes.xsd \
data/MSBuild/Microsoft.Build.Core.xsd \
frameworks/net_2.0.xml \
frameworks/net_3.0.xml \
frameworks/net_3.5.xml \
frameworks/net_4.0.xml \
frameworks/net_4.0_client.xml \
frameworks/net_4.5.xml \
targets/Microsoft.Portable.CSharp_4.0.targets \
targets/Microsoft.Portable.CSharp_4.5.targets \
targets/Microsoft.VisualBasic.targets \
targets/Microsoft.Portable.Core.targets \
targets/Microsoft.Portable.Core.props \
targets/Microsoft.WebApplication.targets \
targets/Microsoft.Portable.CSharp.targets \
xbuild_tests.make
xbuild.make \
xbuild_test.make
@@ -21,6 +21,11 @@
<ProjectDir Condition="'$(ProjectDir)' == ''">$(MSBuildProjectDirectory)\</ProjectDir>
</PropertyGroup>
<!-- MSBuild defines this even outside of VS, and F# projects depend on it -->
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">12.0</VisualStudioVersion>
</PropertyGroup>
<PropertyGroup>
<AssemblyName Condition="'$(AssemblyName)' == ''">$(MSBuildProjectName)</AssemblyName>
<OutputPath Condition="'$(OutputPath)' != '' and !HasTrailingSlash('$(OutputPath)')">$(OutputPath)\</OutputPath>
@@ -21,6 +21,11 @@
<ProjectDir Condition="'$(ProjectDir)' == ''">$(MSBuildProjectDirectory)\</ProjectDir>
</PropertyGroup>
<!-- MSBuild defines this even outside of VS, and F# projects depend on it -->
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">11.0</VisualStudioVersion>
</PropertyGroup>
<PropertyGroup>
<AssemblyName Condition="'$(AssemblyName)' == ''">$(MSBuildProjectName)</AssemblyName>
<OutputPath Condition="'$(OutputPath)' != '' and !HasTrailingSlash('$(OutputPath)')">$(OutputPath)\</OutputPath>
@@ -1,43 +1,5 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<AvailablePlatforms>Any CPU</AvailablePlatforms>
<TargetPlatformIdentifier>Portable</TargetPlatformIdentifier>
<TargetFrameworkIdentifier>.NETPortable</TargetFrameworkIdentifier>
<TargetFrameworkMonikerDisplayName>.NET Portable Subset</TargetFrameworkMonikerDisplayName>
<AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
<NoStdLib>true</NoStdLib>
<ImplicitlyExpandTargetFramework Condition="'$(ImplicitlyExpandTargetFramework)' == '' ">true</ImplicitlyExpandTargetFramework>
</PropertyGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.Targets" />
<PropertyGroup>
<ResolveReferencesDependsOn>
$(ResolveReferencesDependsOn);
ImplicitlyExpandTargetFramework;
</ResolveReferencesDependsOn>
<ImplicitlyExpandTargetFrameworkDependsOn>
$(ImplicitlyExpandTargetFrameworkDependsOn);
GetReferenceAssemblyPaths
</ImplicitlyExpandTargetFrameworkDependsOn>
</PropertyGroup>
<Target Name="ImplicitlyExpandTargetFramework"
DependsOnTargets="$(ImplicitlyExpandTargetFrameworkDependsOn)">
<ItemGroup>
<ReferenceAssemblyPaths Include="$(_TargetFrameworkDirectories)"/>
<ReferencePath Include="%(ReferenceAssemblyPaths.Identity)\*.dll">
<CopyLocal>false</CopyLocal>
<ResolvedFrom>ImplicitlyExpandTargetFramework</ResolvedFrom>
<IsSystemReference>True</IsSystemReference>
</ReferencePath>
</ItemGroup>
</Target>
<Import Project="..\Microsoft.Portable.Core.props" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\Microsoft.Portable.Core.targets" />
</Project>
@@ -1,3 +1,5 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildToolsPath)\Microsoft.Portable.CSharp.Targets" />
<Import Project="..\Microsoft.Portable.Core.props" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\Microsoft.Portable.Core.targets" />
</Project>
@@ -0,0 +1,14 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<AvailablePlatforms>Any CPU</AvailablePlatforms>
<TargetPlatformIdentifier>Portable</TargetPlatformIdentifier>
<TargetFrameworkIdentifier>.NETPortable</TargetFrameworkIdentifier>
<TargetFrameworkMonikerDisplayName>.NET Portable Subset</TargetFrameworkMonikerDisplayName>
<AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
<NoStdLib>true</NoStdLib>
<ImplicitlyExpandTargetFramework Condition="'$(ImplicitlyExpandTargetFramework)' == '' ">true</ImplicitlyExpandTargetFramework>
</PropertyGroup>
</Project>
@@ -0,0 +1,27 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ResolveReferencesDependsOn>
$(ResolveReferencesDependsOn);
ImplicitlyExpandTargetFramework;
</ResolveReferencesDependsOn>
<ImplicitlyExpandTargetFrameworkDependsOn>
$(ImplicitlyExpandTargetFrameworkDependsOn);
GetReferenceAssemblyPaths
</ImplicitlyExpandTargetFrameworkDependsOn>
</PropertyGroup>
<Target Name="ImplicitlyExpandTargetFramework"
DependsOnTargets="$(ImplicitlyExpandTargetFrameworkDependsOn)">
<ItemGroup>
<ReferenceAssemblyPaths Include="$(_TargetFrameworkDirectories)"/>
<ReferencePath Include="%(ReferenceAssemblyPaths.Identity)\*.dll">
<CopyLocal>false</CopyLocal>
<ResolvedFrom>ImplicitlyExpandTargetFramework</ResolvedFrom>
<IsSystemReference>True</IsSystemReference>
</ReferencePath>
</ItemGroup>
</Target>
</Project>
+3
View File
@@ -380,6 +380,9 @@ gboolean ShellExecuteEx (WapiShellExecuteInfo *sei)
SetLastError (ERROR_INVALID_DATA);
return FALSE;
}
/* Shell exec should not return a process handle when it spawned a GUI thing, like a browser. */
CloseHandle (process_info.hProcess);
process_info.hProcess = NULL;
}
if (sei->fMask & SEE_MASK_NOCLOSEPROCESS) {
+9 -2
View File
@@ -2562,16 +2562,23 @@ assembly_binding_info_parsed (MonoAssemblyBindingInfo *info, void *user_data)
domain->assembly_bindings = g_slist_append_mempool (domain->mp, domain->assembly_bindings, info_copy);
}
static int
get_version_number (int major, int minor)
{
return major * 256 + minor;
}
static inline gboolean
info_major_minor_in_range (MonoAssemblyBindingInfo *info, MonoAssemblyName *aname)
{
int aname_version_number = get_version_number (aname->major, aname->minor);
if (!info->has_old_version_bottom)
return FALSE;
if (info->old_version_bottom.major > aname->major || info->old_version_bottom.minor > aname->minor)
if (get_version_number (info->old_version_bottom.major, info->old_version_bottom.minor) > aname_version_number)
return FALSE;
if (info->has_old_version_top && (info->old_version_top.major < aname->major || info->old_version_top.minor < aname->minor))
if (info->has_old_version_top && get_version_number (info->old_version_top.major, info->old_version_top.minor) < aname_version_number)
return FALSE;
/* This is not the nicest way to do it, but it's a by-product of the way parsing is done */
+17 -1
View File
@@ -604,7 +604,7 @@ MonoBoolean ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal (MonoPr
gboolean ret;
shellex.cbSize = sizeof(SHELLEXECUTEINFO);
shellex.fMask = SEE_MASK_FLAG_DDEWAIT | SEE_MASK_UNICODE;
shellex.fMask = SEE_MASK_FLAG_DDEWAIT | SEE_MASK_NOCLOSEPROCESS | SEE_MASK_UNICODE;
shellex.nShow = proc_start_info->window_style;
shellex.nShow = (shellex.nShow == 0) ? 1 : (shellex.nShow == 1 ? 0 : shellex.nShow);
@@ -634,6 +634,22 @@ MonoBoolean ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal (MonoPr
}
ret = ShellExecuteEx (&shellex);
if (ret == FALSE) {
process_info->pid = -GetLastError ();
} else {
process_info->process_handle = shellex.hProcess;
process_info->thread_handle = NULL;
/* It appears that there's no way to get the pid from a
* process handle before windows xp. Really.
*/
#if defined(HAVE_GETPROCESSID) && !defined(MONO_CROSS_COMPILE)
process_info->pid = GetProcessId (shellex.hProcess);
#else
process_info->pid = 0;
#endif
process_info->tid = 0;
}
return (ret);
}
+22
View File
@@ -323,9 +323,31 @@ static gboolean handle_remove(MonoInternalThread *thread)
return ret;
}
static void ensure_synch_cs_set (MonoInternalThread *thread)
{
CRITICAL_SECTION *synch_cs;
if (thread->synch_cs != NULL) {
return;
}
synch_cs = g_new0 (CRITICAL_SECTION, 1);
InitializeCriticalSection (synch_cs);
if (InterlockedCompareExchangePointer ((gpointer *)&thread->synch_cs,
synch_cs, NULL) != NULL) {
/* Another thread must have installed this CS */
DeleteCriticalSection (synch_cs);
g_free (synch_cs);
}
}
static inline void
lock_thread (MonoInternalThread *thread)
{
if (!thread->synch_cs)
ensure_synch_cs_set (thread);
g_assert (thread->synch_cs);
EnterCriticalSection (thread->synch_cs);
}
+1 -1
View File
@@ -1542,7 +1542,7 @@ mono_main (int argc, char* argv[])
char *build = mono_get_runtime_build_info ();
char *gc_descr;
g_print ("Mono Runtime Engine version %s\nCopyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com\n", build);
g_print ("Mono JIT compiler version %s\nCopyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com\n", build);
g_free (build);
g_print (info);
gc_descr = mono_gc_get_description ();
+4 -4
View File
@@ -670,9 +670,9 @@ mono_tramp_info_register (MonoTrampInfo *info)
copy->code_size = info->code_size;
copy->name = g_strdup (info->name);
mono_loader_lock_if_inited ();
mono_jit_lock ();
tramp_infos = g_slist_prepend (tramp_infos, copy);
mono_loader_unlock_if_inited ();
mono_jit_unlock ();
mono_save_trampoline_xdebug_info (info);
@@ -7104,6 +7104,8 @@ mini_init (const char *filename, const char *runtime_version)
}
#endif
InitializeCriticalSection (&jit_mutex);
/* Happens when using the embedding interface */
if (!default_opt_set)
default_opt = mono_parse_default_optimizations (NULL);
@@ -7113,8 +7115,6 @@ mini_init (const char *filename, const char *runtime_version)
mono_set_generic_sharing_vt_supported (TRUE);
#endif
InitializeCriticalSection (&jit_mutex);
#ifdef MONO_HAVE_FAST_TLS
MONO_FAST_TLS_INIT (mono_jit_tls);
MONO_FAST_TLS_INIT (mono_lmf_addr);
+1 -1
View File
@@ -49,7 +49,7 @@ typedef pthread_t MonoNativeThreadId;
typedef void* mono_native_thread_return_t;
#define MONO_NATIVE_THREAD_ID_TO_UINT(tid) GPOINTER_TO_UINT((tid))
#define MONO_NATIVE_THREAD_ID_TO_UINT(tid) (gsize)(tid)
#endif /* #ifdef HOST_WIN32 */