mirror of
https://github.com/tiennm99/time-mocker.git
synced 2026-10-14 22:17:42 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a9a76fb541 | ||
|
|
add9912ddd | ||
|
|
d394f6f589 | ||
|
|
b2329b68c9 | ||
|
|
0dc883eb6d |
No files matched your search
Vendored
+5
-5
@@ -3,23 +3,23 @@ name: Create Draft Release
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- "v*"
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-release:
|
build-and-release:
|
||||||
runs-on: windows-latest
|
runs-on: windows-2025-vs2026
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Setup .NET
|
- name: Setup .NET
|
||||||
uses: actions/setup-dotnet@v4
|
uses: actions/setup-dotnet@v5
|
||||||
with:
|
with:
|
||||||
dotnet-version: 8.x
|
dotnet-version: 10.x
|
||||||
|
|
||||||
- name: Build Solution
|
- name: Build Solution
|
||||||
run: dotnet build TimeMocker.sln -c Release -p:Platform=x64
|
run: dotnet build TimeMocker.sln -c Release -p:Platform=x64
|
||||||
|
|||||||
@@ -95,17 +95,28 @@ namespace TimeMocker.UI.Core
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[DllImport("kernel32.dll", SetLastError = true)]
|
||||||
|
private static extern bool IsWow64Process2(
|
||||||
|
IntPtr hProcess,
|
||||||
|
out ushort pProcessMachine,
|
||||||
|
out ushort pNativeMachine);
|
||||||
|
|
||||||
private static bool Is64BitProcess(Process process)
|
private static bool Is64BitProcess(Process process)
|
||||||
{
|
{
|
||||||
if (!Environment.Is64BitOperatingSystem)
|
if (!Environment.Is64BitOperatingSystem)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
bool isWow64;
|
ushort processMachine, nativeMachine;
|
||||||
if (!IsWow64Process(process.Handle, out isWow64))
|
if (IsWow64Process2(process.Handle, out processMachine, out nativeMachine))
|
||||||
return false;
|
{
|
||||||
|
// IMAGE_FILE_MACHINE_UNKNOWN (0) means it's a native 64-bit process
|
||||||
|
// IMAGE_FILE_MACHINE_I386 (0x014c) means it's 32-bit on 64-bit Windows
|
||||||
|
return processMachine == 0x0000; // 0 = native, not emulated
|
||||||
|
}
|
||||||
|
|
||||||
// If IsWow64Process returns false, it's a 64-bit process
|
// Fallback
|
||||||
// If it returns true, it's a 32-bit process running on 64-bit Windows
|
bool isWow64;
|
||||||
|
IsWow64Process(process.Handle, out isWow64);
|
||||||
return !isWow64;
|
return !isWow64;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user