Fix smoke 1차 follow-up gaps: player resolver, type target, filter, utf8 (#12)

This commit is contained in:
minsung
2026-04-07 20:30:59 +09:00
parent 3738a0df5c
commit 8784fec923
13 changed files with 802 additions and 30 deletions

View File

@@ -82,6 +82,30 @@ public static class Program
Console.Error.WriteLine($"[recorder] attach failed: {ex.Message}");
}
// Issue #12 Gap C — once attached, drop events that originate from
// any window not owned by the SUT process.
if (app is not null)
{
int sutPid = app.ProcessId;
hook.Filter = new SutProcessWindowFilter(
sutPid,
processFromPoint: (x, y) =>
{
var hwnd = NativeMethods.WindowFromPoint(new NativeMethods.POINT { x = x, y = y });
if (hwnd == IntPtr.Zero) return 0;
NativeMethods.GetWindowThreadProcessId(hwnd, out var pid);
return (int)pid;
},
processFromForeground: () =>
{
var hwnd = NativeMethods.GetForegroundWindow();
if (hwnd == IntPtr.Zero) return 0;
NativeMethods.GetWindowThreadProcessId(hwnd, out var pid);
return (int)pid;
});
Console.WriteLine($"[recorder] window filter active for pid={sutPid}");
}
var scenario = new Scenario
{
Name = System.IO.Path.GetFileNameWithoutExtension(args.OutputPath),