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

64Bit detection #16

Closed
zivillian opened this issue Jul 17, 2017 · 1 comment
Closed

64Bit detection #16

zivillian opened this issue Jul 17, 2017 · 1 comment

Comments

@zivillian
Copy link

I've found this project today, and stumbled upon the following sentence in the documentation:

Note that your application must be built using “Prefer 32-bit” unchecked if the Platform Target is set to Any CPU. Also note that your application must be built for 64-bit to work on a 64-bit system (or Any CPU with Prefer 32-bit off), and in 32-bit to work on a 32-bit system.

After a quick look at the source it seems to me, that the name of the loaded platform binary is built in GetPlatformSpecificAssemblyShortName() which checks Environment.Is64BitOperatingSystem.
I would suggest replacing this check with the following code:

if (IntPtr.Size == 8)
    result.Append("x64");
  else
    result.Append("x86"); 

The documentation clearly states, that this property can be used to detect the process bitness:

The value of this property is 4 in a 32-bit process, and 8 in a 64-bit process.

@alphaleonis
Copy link
Owner

Yes, but I don't want the process bitness, I need the operating system bitness, so to speak. So I do need Environment.Is64BitOperatingSystem. If this would differ the process bitness, then VSS will not work, hence the comment that the process must be built for (or run in) the same bitness as the operating system.

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

No branches or pull requests

2 participants