-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
I like the overall structure a lot more than the previous incarnation!
Here are a few more comments:
> + hr = DirectDrawCreate(NULL, &ddraw, NULL);
> + if (FAILED(hr))
> + return hr;
> +
> hr = Direct3DRMDevice_create(&object);
> if (FAILED(hr))
> return hr;
You're leaking "ddraw" here. There are many more incomplete error handling paths in the patches.
> +HRESULT set_clipper_surface(struct d3drm_device *object, IDirectDraw *ddraw, IDirectDrawClipper *clipper, int width, int height,
> + IDirectDrawSurface **surface) DECLSPEC_HIDDEN;
I'm not entirely happy with this name, because it doesn't merely set any surfaces, it creates them. What do you think about d3drm_device_create_surfaces_from_clipper? Check for consistency wrt the "d3drm_device" part. E.g. the next function you could name "d3drm_device_init" or just "device_init".
> +HRESULT init_device(struct d3drm_device *device, UINT version, IDirect3DRM *d3drm, IDirectDraw *ddraw, IDirectDrawSurface *surface, BOOL z_surface, IDirect3D2 *d3d2,
> + int width, int height)
"BOOL z_surface" is unused right now. It won't be needed until you add CreateDeviceFromSurface version 3.
You are leaking ds here in the success case. You can release it after calling AddAttachedSurface.