> + hr = IDirect3D2_QueryInterface(d3d2, &IID_IDirectDraw, (void**)&ddraw);
Why aren't you using the existing ddraw1 interface variable?
> + primary_surface_found = FALSE;
> + hr = IDirectDraw_EnumSurfaces(ddraw, DDENUMSURFACES_ALL | DDENUMSURFACES_DOESEXIST,
> + NULL, NULL, surface_callback);
> + ok(hr == DD_OK, "Failed to enumerate surfaces (hr = %x).\n", hr);
> + ok(!primary_surface_found, "Primary surface shouldn't be created by CreateDeviceFromD3D.\n");
> + IDirectDraw_Release(ddraw);
> +
> + hr = IDirectDrawSurface_GetAttachedSurface(surface, &caps, &ds);
> + ok(hr == DD_OK, "Cannot get attached depth surface (hr = %x).\n", hr);
> +
> + desc.dwSize = sizeof(desc);
> + hr = IDirectDrawSurface_GetSurfaceDesc(ds, &desc);
> + ok(hr == DD_OK, "Cannot get z surface desc structure (hr = %x).\n", hr);
I think here it would be interesting to confirm that the Z surface is
the one created by create_device().