/* IDirect3DSurface8 IDirect3DResource8 Interface follow: */ static HRESULT WINAPI IDirect3DSurface8Impl_GetDevice(IDirect3DSurface8 *iface, IDirect3DDevice8 **device) { IDirect3DSurface8Impl *This = impl_from_IDirect3DSurface8(iface); TRACE("iface %p, device %p.\n", iface, device); if (This->forwardReference) { IDirect3DResource8 *resource; HRESULT hr; hr = IUnknown_QueryInterface(This->forwardReference, &IID_IDirect3DResource8, (void **)&resource); if (SUCCEEDED(hr)) { hr = IDirect3DResource8_GetDevice(resource, device); IDirect3DResource8_Release(resource); TRACE("Returning device %p.\n", *device); } return hr; } *device = This->parentDevice; IDirect3DDevice8_AddRef(*device); TRACE("Returning device %p.\n", *device); return D3D_OK; }
static HRESULT WINAPI d3d8_volume_GetDevice(IDirect3DVolume8 *iface, IDirect3DDevice8 **device) { struct d3d8_volume *volume = impl_from_IDirect3DVolume8(iface); IDirect3DResource8 *resource; HRESULT hr; TRACE("iface %p, device %p.\n", iface, device); hr = IUnknown_QueryInterface(volume->forwardReference, &IID_IDirect3DResource8, (void **)&resource); if (SUCCEEDED(hr)) { hr = IDirect3DResource8_GetDevice(resource, device); IDirect3DResource8_Release(resource); TRACE("Returning device %p.\n", *device); } return hr; }