fix: admit explicit ICDB maintenance with preserved address evidence

This commit is contained in:
阿白叔 committed 2026-11-03 09:13:32 +08:00
1 parent 4f741cd176
commit e39dc63ded
10 files changed
+691 -25

No files matched your search

+9 -3
View File
@@ -163,16 +163,22 @@ def test_public_verify_preserves_existing_apartment(tmp_path, monkeypatch, mode,
def existing_mta():
pythoncom.CoInitializeEx(mode)
try:
runner.run_verify(runner.VerifyRequest(library, 'Block', tmp_path/'out'))
apartment, qualifier = ctypes.c_int(), ctypes.c_int()
ole32 = ctypes.WinDLL('ole32')
ole32.CoGetApartmentType.argtypes = [ctypes.POINTER(ctypes.c_int), ctypes.POINTER(ctypes.c_int)]
assert ole32.CoGetApartmentType(ctypes.byref(apartment), ctypes.byref(qualifier)) == 0
before = apartment.value
# A thread can be the main STA (3) when it creates the process's
# first remaining STA. Verify must preserve either STA flavor.
assert before in ((1,) if mode == 0 else (0, 3))
runner.run_verify(runner.VerifyRequest(library, 'Block', tmp_path/'out'))
result = ole32.CoGetApartmentType(ctypes.byref(apartment), ctypes.byref(qualifier))
return result, apartment.value
return result, apartment.value, before
finally:
pythoncom.CoUninitialize()
with ThreadPoolExecutor(1) as pool:
assert pool.submit(existing_mta).result() == (0, expected)
result, after, before = pool.submit(existing_mta).result()
assert result == 0 and after == before
def test_nested_snapshot_retains_runtime_checkpoint_bytes_without_semantic_conflicts(tmp_path):