On Fri Mar 20 16:15:03 2026 +0000, Matteo Bruni wrote:
Interesting! I wonder if the game is abusing d3dxof implementation details, like maybe it's expecting the `IDirectXFileData` object refcount in that place and it's being "efficient" / "smart" by manually incrementing and decrementing it instead of calling `AddRef()` and `Release()`. It should be possible to test that in a clean way by replicating what the game is doing in the d3dxof tests and e.g. use the existing `get_refcount()` helper to check if that affects the refcount of some d3dxof object. The target it writes to is in the COM object. It has no correlation to ref counting. It's either a bug in the game, or intentional misappropriation of allocated memory. Could be a padding area in the com object or something unused or unrelated. Fact is, with individual allocs the game loads its data as intended. Fact is also that with this patch the game will write into the heap header. So we should either allocate 4 bytes extra and return the data with an offset or keep the code as is but add buffer areas between the elements in the data buffer and then _not_ create individual allocs. I'm curious how Wine usually handles cases like that.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/10278#note_137025