Skip to content

[Xamarin.Android.Tools.AndroidSdk] Probe for Microsoft OpenJDK dirs #113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 24, 2021

Conversation

jonpryor
Copy link
Contributor

No description provided.

@jonpryor jonpryor requested a review from tondat March 19, 2021 02:05
@jonpryor jonpryor force-pushed the jonp-check-msjdk-dirs branch from cb01ba5 to 01ed56b Compare March 19, 2021 02:06

static IEnumerable<string> GetMacOSMicrosoftOpenJdkPaths ()
{
var jdk = AppDomain.CurrentDomain.GetData ($"GetMacOSMicrosoftOpenJdkPath override! {typeof (JdkInfo).AssemblyQualifiedName}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: spacing

@jonpryor jonpryor force-pushed the jonp-check-msjdk-dirs branch 6 times, most recently from 2a32fd3 to 1a29cf3 Compare March 24, 2021 18:38
@@ -139,9 +140,89 @@ internal static class RegistryEx
static extern int RegCreateKeyEx (UIntPtr hKey, string subKey, uint reserved, string? @class, uint options,
uint samDesired, IntPtr lpSecurityAttributes, out UIntPtr phkResult, out Disposition lpdwDisposition);

// https://docs.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-regenumkeyexw
[DllImport (ADVAPI, CharSet = CharSet.Unicode, SetLastError = true)]
static extern int RegEnumKeyExW (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the need for p/invoke here? Is it an issue with 32-bit processes reading 64-bit keys?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure of the original need; this code never used Microsoft.Win32.Registry & co, and I'm not sure why. (Apparently a question for @mhutch?)

Thus, given that we're already a tangled mess of P/Invokes, I figured it "best" to continue with the current paradigm.

@jonpryor jonpryor force-pushed the jonp-check-msjdk-dirs branch from 1a29cf3 to 4c041c8 Compare March 24, 2021 21:11
Context: https://aka.ms/getopenjdk
Context: https://devblogs.microsoft.com/java

Remove support for the obsolete (and never updated)
`microsoft_dist_openjdk_*` builds of OpenJDK.  Despite having
"microsoft" in the name, it was maintained by a different team which
has moved on to other things.
@jonpryor jonpryor force-pushed the jonp-check-msjdk-dirs branch from 4c041c8 to 21ea061 Compare March 24, 2021 21:12
@jonpryor jonpryor merged commit 237642c into dotnet:main Mar 24, 2021
@mhutch
Copy link

mhutch commented May 26, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants