feat: update actions

This commit is contained in:
2026-02-27 15:17:21 +07:00
parent 5f893a87d9
commit cdce3a6b1a
2 changed files with 13 additions and 9 deletions
+4 -6
View File
@@ -10,19 +10,17 @@ permissions:
jobs:
build-and-release:
runs-on: windows-latest
runs-on: windows-2019
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.x
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Build Solution
run: dotnet build TimeMocker.sln -c Release -p:Platform=x64
run: msbuild TimeMocker.sln -p:Configuration=Release -p:Platform=x64 -m
- name: Prepare Release Artifacts
run: |
+9 -3
View File
@@ -65,23 +65,29 @@ namespace TimeMocker.Hook
public void Run(RemoteHooking.IContext context, string mmfName)
{
string logPath = Path.Combine(Path.GetTempPath(), "TimeMocker.Hook.log");
try
{
File.AppendAllText(logPath, $"[{DateTime.Now}] Starting hook, MMF: {mmfName}\r\n");
// Open the shared memory created by the UI process
_mmf = System.IO.MemoryMappedFiles.MemoryMappedFile.OpenExisting(mmfName);
_view = _mmf.CreateViewAccessor(0, Marshal.SizeOf<MockTimeInfo>());
File.AppendAllText(logPath, $"[{DateTime.Now}] MMF opened successfully\r\n");
InstallHooks();
File.AppendAllText(logPath, $"[{DateTime.Now}] Hooks installed successfully\r\n");
RemoteHooking.WakeUpProcess();
File.AppendAllText(logPath, $"[{DateTime.Now}] Process woken up\r\n");
// Keep alive until process exits
while (true) Thread.Sleep(500);
}
catch (Exception ex)
{
File.AppendAllText(
Path.Combine(Path.GetTempPath(), "TimeMocker.Hook.log"),
$"[{DateTime.Now}] ERROR: {ex}\r\n");
File.AppendAllText(logPath, $"[{DateTime.Now}] ERROR: {ex.GetType().Name}: {ex.Message}\r\n{ex.StackTrace}\r\n");
}
finally
{