Imported Upstream version 4.2.1.36

Former-commit-id: fb75898888a02f4d3a74cf0a5b841681bc4c7fa8
This commit is contained in:
Xamarin Public Jenkins
2015-09-24 06:06:07 -04:00
committed by Jo Shields
parent 9668de7cb8
commit dd547c45d4
172 changed files with 6570 additions and 11015 deletions

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2002-2014 Jeroen Frijters
Copyright (C) 2002-2015 Jeroen Frijters
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -23,6 +23,7 @@
*/
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
@ -131,6 +132,24 @@ namespace IKVM.NativeCode.java.lang
return IsWindowsConsole(false) ? GetConsoleEncoding() : null;
}
public static FileVersionInfo getKernel32FileVersionInfo()
{
try
{
foreach (ProcessModule module in Process.GetCurrentProcess().Modules)
{
if (string.Compare(module.ModuleName, "kernel32.dll", StringComparison.OrdinalIgnoreCase) == 0)
{
return module.FileVersionInfo;
}
}
}
catch
{
}
return null;
}
private static bool IsWindowsConsole(bool stdout)
{
if (Environment.OSVersion.Platform != PlatformID.Win32NT)