fix: cancel orphaned PCB before its license completes

This commit is contained in:
阿白叔 committed 2026-11-25 18:08:14 +08:00
1 parent e4fc37a291
commit becaf2e8e4
2 files changed
+29 -9

No files matched your search

+7 -1
View File
@@ -1150,7 +1150,7 @@ def finish_owned_idle_session(path, *, stop=None):
return target
return None
def startup_prompt():
from .failed_session import _startup_snapshot, _cancel_target, _tip_target
from .failed_session import _startup_snapshot, _cancel_target, _tip_target, _startup_license_cancel
snapshot = _process_windows({client['pid']}, include_hidden_documents=True)
windows = snapshot.get(client['pid'], [])
if (_window_error(snapshot, client['pid']) or not windows
@@ -1174,6 +1174,12 @@ def finish_owned_idle_session(path, *, stop=None):
for event in read('events.jsonl', lines=True)):
return None
return observed, tip.handle, 'tip', modal['hwnd']
if orphan_client is not None and all(w is modal or (
w['class'] in ('UAC_InputIndicatorOverlayWnd', 'UAC Input Indicator')
and not w.get('documents')) for w in windows):
license_cancel = _startup_license_cancel(observed)
if license_cancel is not None:
return observed, license_cancel.handle, 'license_cancel', modal['hwnd']
target = _cancel_target(observed)
if target is not None and (orphan_client is not None or target[0] == 'database_load_log'):
return observed, target[1].handle, target[0], modal['hwnd']