Re: [PATCH 2/2] d3drm: Added IDirect3DRMWrap stub
On 23 June 2017 at 15:15, Nikolay Sivov <nsivov(a)codeweavers.com> wrote:
+static HRESULT WINAPI d3drm_wrap_QueryInterface(IDirect3DRMWrap *iface, REFIID riid, void **out) +{ + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); + + if (IsEqualGUID(riid, &IID_IDirect3DRMWrap) + || IsEqualGUID(riid, &IID_IDirect3DRMObject) + || IsEqualGUID(riid, &IID_IUnknown)) + { + IDirect3DRMWrap_AddRef(iface); + *out = iface; + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); + + *out = NULL; + return E_NOINTERFACE; +} Likewise, while E_NOINTERFACE would normally be the expected value, that's not a given with d3drm.
+static ULONG WINAPI d3drm_wrap_Release(IDirect3DRMWrap *iface) +{ + struct d3drm_wrap *wrap = impl_from_IDirect3DRMWrap(iface); + ULONG refcount = InterlockedDecrement(&wrap->ref); + + TRACE("%p decreasing refcount to %u.\n", iface, refcount); + + if (!refcount) + { + d3drm_object_cleanup((IDirect3DRMObject *)iface, &wrap->obj); + //IDirect3DRM_Release(mesh->d3drm); C99 comment.
@@ -109,10 +109,10 @@ static void test_class_name_(unsigned int line, IDirect3DRMObject *object, const ok_(__FILE__, line)(hr == D3DRM_OK, "Failed to get classname size, hr %#x.\n", hr); ok_(__FILE__, line)(size == strlen(name) + 1, "wrong size: %u\n", size);
- size = 1; + size = size2 = *name ? 1 : 0; I think "!!*name" would be more obvious, but don't care strongly.
participants (1)
-
Henri Verbeet