During Direct3D device enumeration, Tomb Raider 3 modifies the buffer holding the Direct3D reference device description string. However, due to insufficient space in the buffer, the modification overruns the buffer and corrupts the IDirectDraw vtable, which leads to a crash on game startup.
Reserving extra space in the description string buffer avoids the vtable corruption and allows the game to start.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56367
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5272
--
v4: vkd3d-shader/fx: Add support for writing shared object descriptions for fx_4_x.
vkd3d-shader: Add an option to enable child effects compilation.
vkd3d-shader/fx: Add initial support for writing uninitialized vertex/pixel shader objects.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/692
Sorry for the long silence. A couple of nits above, but generally that looks fine to me. My understanding is that we could in principle have a client that calls Microsoft's d3d9on12.dll instead of returning our d3d9, is that right? The games just go through `Direct3DCreate9On12` but then only use the D3D9 interface?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/4915#note_64358
Jan Sikorski (@jsikorski) commented about dlls/d3d9/d3d9on12.c:
> + d3d9on12_ReturnUnderlyingResource,
> +};
> +
> +BOOL d3d9on12_init( struct d3d9on12 **d3d9on12, D3D9ON12_ARGS *override_list, UINT override_entries )
> +{
> + struct d3d9on12 *object;
> +
> + if (!override_list || !override_list->Enable9On12 || !override_entries)
> + {
> + *d3d9on12 = NULL;
> + return TRUE;
> + }
> +
> + if (!(object = calloc( 1, sizeof(*object) )))
> + return FALSE;
> + if (!(object->override_list = calloc( 1, sizeof(D3D9ON12_ARGS) )))
That's a bit odd: if we only care about the first entry, why not just store it in a static member? Or if we don't care about it, don't store it at all? To me, use of `calloc` here indicates an intention that I'm missing.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/4915#note_64355
Jan Sikorski (@jsikorski) commented about dlls/d3d9/d3d9on12.c:
> +{
> + /* IUnknown */
> + d3d9on12_QueryInterface,
> + d3d9on12_AddRef,
> + d3d9on12_Release,
> + /* IDirect3DDevice9On12 */
> + d3d9on12_GetD3D12Device,
> + d3d9on12_UnwrapUnderlyingResource,
> + d3d9on12_ReturnUnderlyingResource,
> +};
> +
> +BOOL d3d9on12_init( struct d3d9on12 **d3d9on12, D3D9ON12_ARGS *override_list, UINT override_entries )
> +{
> + struct d3d9on12 *object;
> +
> + if (!override_list || !override_list->Enable9On12 || !override_entries)
Do we want to dereference the list before checking `override_entries`? I see that was changed previously, I'm not sure why, to me the current version is confusing and I don't see a test that justifies it.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/4915#note_64353