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":...@@ -38,7 +38,7 @@ if args.platform == "linux":
38 ], check=True)38 ], check=True)
39 raise SystemExit(0)39 raise SystemExit(0)
40args.arch = args.arch or "x86_64"40args.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"
42environment = subprocess.check_output(["zig", "env"], text=True)42environment = subprocess.check_output(["zig", "env"], text=True)
43match = re.search(r'\.lib_dir\s*=\s*"([^"]+)"', environment)43match = re.search(r'\.lib_dir\s*=\s*"([^"]+)"', environment)
44library = Path(match[1] if match else json.loads(environment)["lib_dir"])44library = Path(match[1] if match else json.loads(environment)["lib_dir"])
guest/computer-windows.cs-1
...@@ -122,7 +122,6 @@ public static class ComputerWorker {...@@ -122,7 +122,6 @@ public static class ComputerWorker {
122 [DllImport("user32.dll")] static extern bool SetProcessDPIAware();122 [DllImport("user32.dll")] static extern bool SetProcessDPIAware();
123 [STAThread] public static void Main(string[] args) {123 [STAThread] public static void Main(string[] args) {
124 if(args.Length != 2) return;124 if(args.Length != 2) return;
125 if(args[0]=="--stop") {try {ComputerProcess.Stop(args[1]);}catch {Environment.Exit(1);}return;}
126 requestPath=args[0];responsePath=args[1]; object result;125 requestPath=args[0];responsePath=args[1]; object result;
127 try { SetProcessDPIAware(); result=Run(Map(json.DeserializeObject(System.IO.File.ReadAllText(requestPath)))); }126 try { SetProcessDPIAware(); result=Run(Map(json.DeserializeObject(System.IO.File.ReadAllText(requestPath)))); }
128 catch(Exception error) { result=new { error=error.Message }; }127 catch(Exception error) { result=new { error=error.Message }; }
guest/test.py+1-1
...@@ -13,7 +13,7 @@ for arch in ['x86', 'x86_64', 'aarch64']:...@@ -13,7 +13,7 @@ for arch in ['x86', 'x86_64', 'aarch64']:
13 machine, sections, _, _, _, optional_size = struct.unpack_from('<HHIIIH', data, pe + 4)13 machine, sections, _, _, _, optional_size = struct.unpack_from('<HHIIIH', data, pe + 4)
14 optional = pe + 2414 optional = pe + 24
15 assert machine == {'x86': 0x14c, 'x86_64': 0x8664, 'aarch64': 0xaa64}[arch]15 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))
17 table = optional + optional_size17 table = optional + optional_size
18 def offset(rva):18 def offset(rva):
19 for index in range(sections):19 for index in range(sections):
guest/windows-provision.ps1+1-1
...@@ -27,7 +27,7 @@ try {...@@ -27,7 +27,7 @@ try {
27 if ($Prepare) {27 if ($Prepare) {
28 Remove-ItemProperty 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Run' -Name SnowglobeBootstrap -ErrorAction SilentlyContinue28 Remove-ItemProperty 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Run' -Name SnowglobeBootstrap -ErrorAction SilentlyContinue
29 foreach ($task in $folder.GetTasks(1)) {29 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) }
31 }31 }
32 & "$root\install-guest.ps1" -Binary "$root\snowglobe-guest.exe" -User sandbox32 & "$root\install-guest.ps1" -Binary "$root\snowglobe-guest.exe" -User sandbox
33 $user = Get-WmiObject Win32_UserAccount -Filter "LocalAccount=True AND Name='sandbox'"33 $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):...@@ -359,8 +359,7 @@ def finish_operation(name, operation):
359 cleanup += "$t=$f.GetTasks(1) | Where-Object {$_.Name -eq 'SnowglobeComputer-"+run+"'};if($t){"359 cleanup += "$t=$f.GetTasks(1) | Where-Object {$_.Name -eq 'SnowglobeComputer-"+run+"'};if($t){"
360 if not operation.get('keep_spawn'):360 if not operation.get('keep_spawn'):
361 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}});"361 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;"362 cleanup += "[Reflection.Assembly]::LoadFrom($t.Definition.Actions.Item(1).Path)|Out-Null;[ComputerProcess]::Stop($d+'\\request.json');"
363 cleanup += "$stop=[Diagnostics.Process]::Start($info);if(!$stop.WaitForExit(12000) -or $stop.ExitCode -ne 0){throw 'Process cleanup failed'};$stop.Dispose();"
364 cleanup += "$t.Stop(0);while($t.State -eq 4){Start-Sleep -Milliseconds 100};"363 cleanup += "$t.Stop(0);while($t.State -eq 4){Start-Sleep -Milliseconds 100};"
365 cleanup += "foreach($p in $workers){if(!$p.WaitForExit(10000)){throw 'Process cleanup failed'};$p.Dispose()};"364 cleanup += "foreach($p in $workers){if(!$p.WaitForExit(10000)){throw 'Process cleanup failed'};$p.Dispose()};"
366 cleanup += "$f.DeleteTask('SnowglobeComputer-"+run+"',0)};"365 cleanup += "$f.DeleteTask('SnowglobeComputer-"+run+"',0)};"