Matteo Bruni (@Mystral) commented about dlls/d3dx9_36/tests/surface.c:
if (tga_tests[i].color_map)
memcpy(tga->data, tga_tests[i].color_map, tga_tests[i].color_map_size);
memcpy(tga->data + tga_tests[i].color_map_size, tga_tests[i].pixels, tga_tests[i].pixels_size);
hr = D3DXGetImageInfoFromFileInMemory(tga, file_size, &info);
ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
surface_fmt = (info.Format == D3DFMT_P8) ? D3DFMT_A8B8G8R8 : info.Format;
hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, info.Width, info.Height, surface_fmt, D3DPOOL_SCRATCH,
&surface, NULL);
ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
/*
* Unlike D3DXGetImageInfo(), file size must be valid when loading
* image data.
*/
Maybe I'm misunderstanding the comment but, looking at the existing tests, that doesn't seem to be the case? Even in the most recent TGA tests there are a number of expected failures with `D3DXGetImageInfoFromFileInMemory()` when the data size is too small.
Orthogonally, it might be better to write it like "D3DXGetImageInfo*()" or similar, to avoid possible confusion.