mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-18 12:31:30 -10:00
Compare commits
17
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4657221dcc | ||
|
|
1b62dca6cc | ||
|
|
0a425af914 | ||
|
|
472bc7bfa5 | ||
|
|
7c274c477d | ||
|
|
1bb562b8d5 | ||
|
|
3901f01875 | ||
|
|
cf7d241aab | ||
|
|
40f92d5cb6 | ||
|
|
0895a37089 | ||
|
|
5b8ba7e3ca | ||
|
|
0c35cf5ef0 | ||
|
|
d2a1623a18 | ||
|
|
cb725ff9de | ||
|
|
50f293135f | ||
|
|
11e1a399ac | ||
|
|
61740f8417 |
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 ()
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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[] { ',' });
|
||||
|
||||
@@ -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>
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
@@ -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
@@ -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);
|
||||
|
||||
@@ -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 */
|
||||
|
||||
|
||||
Reference in new issue
Block a user