/*++ * @name IDirect3DTexture9::GetDevice * @implemented * * The function D3D9MipMap_GetDevice sets the ppDevice argument * to the device connected to create the swap chain. * * @param LPDIRECT3DTEXTURE9 iface * Pointer to a IDirect3DTexture9 object returned from IDirect3D9Device::CreateTexture() * * @param IDirect3DDevice9** ppDevice * Pointer to a IDirect3DDevice9* structure to be set to the device object. * * @return HRESULT * If the method successfully sets the ppDevice value, the return value is D3D_OK. * If ppDevice is a bad pointer the return value will be D3DERR_INVALIDCALL. * If the texture didn't contain any device, the return value will be D3DERR_INVALIDDEVICE. * */ HRESULT WINAPI D3D9MipMap_GetDevice(LPDIRECT3DTEXTURE9 iface, IDirect3DDevice9** ppDevice) { LPD3D9MIPMAP This = IDirect3DTexture9ToImpl(iface); LOCK_D3DDEVICE9(); if (NULL == ppDevice) { DPRINT1("Invalid ppDevice parameter specified"); UNLOCK_D3DDEVICE9(); return D3DERR_INVALIDCALL; } if (FAILED(D3D9BaseObject_GetDevice(&This->BaseTexture.BaseResource.BaseObject, ppDevice))) { DPRINT1("Invalid This parameter speficied"); UNLOCK_D3DDEVICE9(); return D3DERR_INVALIDDEVICE; } UNLOCK_D3DDEVICE9(); return D3D_OK; }
static HRESULT InvalidCall(LPDIRECT3DDEVICE9_INT This, LPSTR ErrorMsg) { DPRINT1("%s",ErrorMsg); UNLOCK_D3DDEVICE9(); return D3DERR_INVALIDCALL; }