authoravatarclover caruso<git@paperclover.net>2026-10-22 13:14:53-07:00
committeravatarclover caruso<git@paperclover.net>2026-10-24 19:01:23-07:00
logfaf67c106107e66fc5f2bb7f3b73bb972f1411e3
treeb042ab895b31539e3cb19cb0e6daf87dd5bd6d2f
parentf4d8ce9b1e0defb90de5d60d85276bff2b7ff738
signature Signed by SSH key SHA256:52mNGHRsVFBDED9IAX5pe+LRWUefqTbxEReunq21QvU

Repair ARM64 capture loading and Windows teardown

Use the ARM desktop subsystem ABI, remove the legacy bootstrap task during preparation, and call the existing job stop method inside the cleanup PowerShell process. Assisted-by: gpt-6.1-sol

5 files changed, 4 insertions(+), 6 deletions(-)

guest/build.py+1-1
......@@ -38,7 +38,7 @@ if args.platform == "linux":
3838 ], check=True)
3939 raise SystemExit(0)
4040args.arch = args.arch or "x86_64"
41subsystem = "10.0" if args.arch == "aarch64" else "6.1"
41subsystem = "6.2" if args.arch == "aarch64" else "6.1"
4242environment = subprocess.check_output(["zig", "env"], text=True)
4343match = re.search(r'\.lib_dir\s*=\s*"([^"]+)"', environment)
4444library = Path(match[1] if match else json.loads(environment)["lib_dir"])
guest/computer-windows.cs-1
......@@ -122,7 +122,6 @@ public static class ComputerWorker {
122122 [DllImport("user32.dll")] static extern bool SetProcessDPIAware();
123123 [STAThread] public static void Main(string[] args) {
124124 if(args.Length != 2) return;
125 if(args[0]=="--stop") {try {ComputerProcess.Stop(args[1]);}catch {Environment.Exit(1);}return;}
126125 requestPath=args[0];responsePath=args[1]; object result;
127126 try { SetProcessDPIAware(); result=Run(Map(json.DeserializeObject(System.IO.File.ReadAllText(requestPath)))); }
128127 catch(Exception error) { result=new { error=error.Message }; }
guest/test.py+1-1
......@@ -13,7 +13,7 @@ for arch in ['x86', 'x86_64', 'aarch64']:
1313 machine, sections, _, _, _, optional_size = struct.unpack_from('<HHIIIH', data, pe + 4)
1414 optional = pe + 24
1515 assert machine == {'x86': 0x14c, 'x86_64': 0x8664, 'aarch64': 0xaa64}[arch]
16 assert struct.unpack_from('<HH', data, optional + 48) == ((10, 0) if arch == 'aarch64' else (6, 1))
16 assert struct.unpack_from('<HH', data, optional + 48) == ((6, 2) if arch == 'aarch64' else (6, 1))
1717 table = optional + optional_size
1818 def offset(rva):
1919 for index in range(sections):
guest/windows-provision.ps1+1-1
......@@ -27,7 +27,7 @@ try {
2727 if ($Prepare) {
2828 Remove-ItemProperty 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Run' -Name SnowglobeBootstrap -ErrorAction SilentlyContinue
2929 foreach ($task in $folder.GetTasks(1)) {
30 if ($task.Name -eq 'SnowglobeFinalize') { $task.Stop(0); $folder.DeleteTask($task.Name, 0) }
30 if ($task.Name -eq 'SnowglobeFinalize' -or $task.Name -eq 'SnowglobeBootstrap') { $task.Stop(0); $folder.DeleteTask($task.Name, 0) }
3131 }
3232 & "$root\install-guest.ps1" -Binary "$root\snowglobe-guest.exe" -User sandbox
3333 $user = Get-WmiObject Win32_UserAccount -Filter "LocalAccount=True AND Name='sandbox'"
tools/vm-computer.py+1-2
......@@ -359,8 +359,7 @@ def finish_operation(name, operation):
359359 cleanup += "$t=$f.GetTasks(1) | Where-Object {$_.Name -eq 'SnowglobeComputer-"+run+"'};if($t){"
360360 if not operation.get('keep_spawn'):
361361 cleanup += "$workers=@(Get-WmiObject Win32_Process | Where-Object {$_.CommandLine -like ('*'+$d+'\\request.json*')} | ForEach-Object {$p=Get-Process -Id $_.ProcessId -ErrorAction SilentlyContinue;if($p){$null=$p.Handle;$p}});"
362 cleanup += "$info=New-Object Diagnostics.ProcessStartInfo;$info.FileName=$t.Definition.Actions.Item(1).Path;$info.Arguments='--stop \"'+$d+'\\request.json\"';$info.UseShellExecute=$false;$info.CreateNoWindow=$true;"
363 cleanup += "$stop=[Diagnostics.Process]::Start($info);if(!$stop.WaitForExit(12000) -or $stop.ExitCode -ne 0){throw 'Process cleanup failed'};$stop.Dispose();"
362 cleanup += "[Reflection.Assembly]::LoadFrom($t.Definition.Actions.Item(1).Path)|Out-Null;[ComputerProcess]::Stop($d+'\\request.json');"
364363 cleanup += "$t.Stop(0);while($t.State -eq 4){Start-Sleep -Milliseconds 100};"
365364 cleanup += "foreach($p in $workers){if(!$p.WaitForExit(10000)){throw 'Process cleanup failed'};$p.Dispose()};"
366365 cleanup += "$f.DeleteTask('SnowglobeComputer-"+run+"',0)};"