Skip to content
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

Win7 OSArchitecture crash workaround #808

Merged
merged 5 commits into from
Dec 8, 2018

Conversation

rjmholt
Copy link
Contributor

@rjmholt rjmholt commented Dec 7, 2018

Avoids calling the System.Runtime.InteropServices.RuntimeInformation API that crashes in Win7.

See PowerShell/vscode-powershell#1633.

@@ -493,6 +495,16 @@ private IServerListener CreateServiceListener(MessageProtocolType protocol, Edit
}
}

private static string GetOSArchitecture()
{
if (IntPtr.Size == 8)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will tell you the architecture of the current process, so this could be a x86 process running on a x64 OS.

Does Environment.Is64BitOperatingSystem work for us?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that's a much better way

@rjmholt rjmholt force-pushed the win7-osarch-workaround branch from 4494bb4 to e627ad6 Compare December 7, 2018 23:22
Copy link
Member

@TylerLeonhardt TylerLeonhardt left a comment

Choose a reason for hiding this comment

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

I wish we could still use RuntimeInformation to check the OS... But I respect using this package as little as possible on win7.

Win7 EOL Jan 2020!!

@rjmholt
Copy link
Contributor Author

rjmholt commented Dec 7, 2018

This doesn't work yet. Looking into it

@rjmholt
Copy link
Contributor Author

rjmholt commented Dec 8, 2018

Ok, I've fixed my foolishness

Copy link
Member

@TylerLeonhardt TylerLeonhardt left a comment

Choose a reason for hiding this comment

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

LGTM

@rjmholt rjmholt merged commit b5dc308 into PowerShell:master Dec 8, 2018
@rjmholt rjmholt deleted the win7-osarch-workaround branch December 12, 2018 05:59
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.

3 participants