DBG("This=%p riid=%p id=%s ppContainer=%p\n",
This, riid, riid ? GUID_sprintf(guid_str, riid) : "", ppContainer);
- if (!NineUnknown(This)->container)
- return E_NOINTERFACE;
+ if (!ppContainer) return E_POINTER;
+
+ /* Return device for OffscreenPlainSurface, DepthStencilSurface and RenderTarget */
+ if (!NineUnknown(This)->container) {
+ *ppContainer = NineUnknown(This)->device;
+ NineUnknown_AddRef(NineUnknown(*ppContainer));
+
+ return D3D_OK;
+ }
+
hr = NineUnknown_QueryInterface(NineUnknown(This)->container, riid, ppContainer);
if (FAILED(hr))
DBG("QueryInterface FAILED!\n");