This repository was archived by the owner on Aug 30, 2023. It is now read-only.
fix(device): Report Device architecture or Null if it cannot reliably#247
Merged
Conversation
asbjornu
approved these changes
May 1, 2018
|
|
||
| [DllImport("kernel32.dll", CallingConvention = CallingConvention.Winapi)] | ||
| [return: MarshalAs(UnmanagedType.Bool)] | ||
| private static extern bool IsWow64Process([In] IntPtr hProcess, [Out] out bool wow64Process); |
Contributor
There was a problem hiding this comment.
Will this just silently fail and return null on Mono?
Member
Author
There was a problem hiding this comment.
On Windows it should work. On non-Windows it returns false.
P/Invoke calls return false if they fail. We can set SetLastError = true which allows us to get it via Marshal.GetLastWin32Error but I thought it's not worth making another platform call to find out why it was not possible to get the value. If it fails to get it, we return null and don't report any Arch.
jan-auer
approved these changes
May 2, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #245