Skip to content

Commit faf40d1

Browse files
committed
update: use preprocessor derivative to use in-built method for 64bit
1 parent 2f5a383 commit faf40d1

File tree

1 file changed

+4
-0
lines changed
  • BrowserStackLocal/BrowserStackLocal

1 file changed

+4
-0
lines changed

BrowserStackLocal/BrowserStackLocal/Util.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ namespace BrowserStack
66
{
77
public class Util {
88

9+
// Ref: https://stackoverflow.com/a/336729
910
[DllImport("kernel32.dll", SetLastError = true, CallingConvention = CallingConvention.Winapi)]
1011
[return: MarshalAs(UnmanagedType.Bool)]
1112
private static extern bool IsWow64Process(
@@ -45,6 +46,9 @@ public static string GetUName()
4546

4647
public static bool Is64BitOS()
4748
{
49+
#if NET48_OR_GREATER || NETSTANDARD2_0_OR_GREATER || NETCOREAPP3_0_OR_GREATER
50+
return Environment.Is64BitOperatingSystem;
51+
#endif
4852
bool is64BitProcess = IntPtr.Size == 8;
4953
return is64BitProcess || InternalCheckIsWow64();
5054
}

0 commit comments

Comments
 (0)