Stefan Dösinger (@stefan) commented about dlls/d3drm/tests/d3drm.c:
IDirect3DRM_Release(d3drm1);
}
+struct update_rect_context +{
- int rect_count;
- D3DRECT rect;
+};
+static void CDECL update_cb_modify_rect(IDirect3DRMDevice *device, void *arg, int rect_count, D3DRECT *update_rects) +{
- if (rect_count > 0)
update_rects[0].x1 = 999999;
+} +static void CDECL update_cb_get_rect(IDirect3DRMDevice *device, void *arg, int rect_count, D3DRECT *update_rects)
Suggestion: Check if *device is indeed the IDirect3DRMDevice (QI IID_IDirect3DRMDevice from it and compare pointers). We have cases in plain ddraw where callbacks and getters return the interface passed in instead of what the header says and applications depend on it.
IOW, if you register the callback with IDirect3DRMDevice3::AddUpdateCallback you may or may not get an IDirect3DRMDevice3 * here.