// Hook function. HRESULT FAR WINAPI OBGECreateVolumeTextureFromFileInMemoryEx(LPDIRECT3DDEVICE9 pDevice, LPCVOID pSrcData, UINT SrcDataSize, UINT Width, UINT Height, UINT Depth, UINT MipLevels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, DWORD Filter, DWORD MipFilter, D3DCOLOR ColorKey, D3DXIMAGE_INFO *pSrcInfo, PALETTEENTRY *pPalette, LPDIRECT3DTEXTURE9 *ppVolumeTexture) { D3DXCreateVolumeTextureFromFileInMemoryEx_t old_func = (D3DXCreateVolumeTextureFromFileInMemoryEx_t) D3XHook.Functions[D3XFN_CreateVolumeTextureFromFileInMemoryEx].OrigFn; HRESULT res = old_func(pDevice, pSrcData, SrcDataSize, Width, Height, Depth, MipLevels, Usage, Format, Pool, Filter, MipFilter, ColorKey, pSrcInfo, pPalette, ppVolumeTexture); //_MESSAGE("OD3DX: CreateVolumeTextureFromFileInMemoryEx(\"%d\") queried from 0x%08x", SrcDataSize, _ReturnAddress()); lastOBGEDirect3DBaseTexture9 = *ppVolumeTexture; return res; }
// Hook function. HRESULT FAR WINAPI OBGECreateTextureFromFileExA(LPDIRECT3DDEVICE9 pDevice, LPCTSTR pSrcFile, UINT Width, UINT Height, UINT MipLevels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, DWORD Filter, DWORD MipFilter, D3DCOLOR ColorKey, D3DXIMAGE_INFO *pSrcInfo, PALETTEENTRY *pPalette, LPDIRECT3DTEXTURE9 *ppTexture) { D3DXCreateTextureFromFileExA_t old_func = (D3DXCreateTextureFromFileExA_t) D3XHook.Functions[D3XFN_CreateTextureFromFileExA].OrigFn; //_MESSAGE("OD3DX: CreateTextureFromFileEx(\"%s\") queried from 0x%08x", pSrcFile, _ReturnAddress()); HRESULT res = old_func(pDevice, pSrcFile, Width, Height, MipLevels, Usage, Format, Pool, Filter, MipFilter, ColorKey, pSrcInfo, pPalette, ppTexture); if (res != D3D_OK) res = OBGECreateBC45TextureFromFileEx(pDevice, pSrcFile, Width, Height, MipLevels, Usage, Format, Pool, Filter, MipFilter, ColorKey, pSrcInfo, pPalette, ppTexture); lastOBGEDirect3DBaseTexture9 = *ppTexture; return res; }
static GstFlowReturn no_fail_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer) { GstFlowReturn ret; GstPadChainFunction old_func = g_object_get_data (G_OBJECT (pad), OLD_CHAIN_KEY); if (old_func == NULL) { return GST_FLOW_OK; } ret = old_func (pad, parent, buffer); if (G_UNLIKELY (ret != GST_FLOW_OK)) { GstPad *peer; switch (ret) { case GST_FLOW_FLUSHING: break; default: GST_WARNING_OBJECT (pad, "Chain returned: %s. It will be unlinked", gst_flow_get_name (ret)); peer = gst_pad_get_peer (pad); if (peer != NULL) { gst_pad_unlink (peer, pad); g_object_unref (peer); } } } return GST_FLOW_OK; }
IDirect3D9* WINAPI MyDirect3DCreate9(UINT sdk_version) { OutputDebugString( "Direct3D-Hook: MyDirect3DCreate9 called.\n" ); Direct3DCreate9_t old_func = (Direct3DCreate9_t) D3DHook.Functions[D3DFN_Direct3DCreate9].OrigFn; IDirect3D9* d3d = old_func(sdk_version); return d3d ? new BaseDirect3D9(d3d) : 0; }
// Hook function. IDirect3D9* FAR WINAPI OBGEDirect3DCreate9(UINT sdk_version) { Direct3DCreate9_t old_func = (Direct3DCreate9_t) D3DHook.Functions[D3DFN_Direct3DCreate9].OrigFn; IDirect3D9* d3d = old_func(sdk_version); _MESSAGE("OD3D9: Driver queried from 0x%08x", _ReturnAddress()); return d3d ? new OBGEDirect3D9(d3d) : 0; }
// Hook function. HRESULT FAR WINAPI OBGECreateVolumeTextureFromFileA(LPDIRECT3DDEVICE9 pDevice, LPCTSTR pSrcFile, LPDIRECT3DTEXTURE9 *ppVolumeTexture) { D3DXCreateVolumeTextureFromFileA_t old_func = (D3DXCreateVolumeTextureFromFileA_t) D3XHook.Functions[D3XFN_CreateVolumeTextureFromFileA].OrigFn; HRESULT res = old_func(pDevice, pSrcFile, ppVolumeTexture); //_MESSAGE("OD3DX: CreateVolumeTextureFromFile(\"%s\") queried from 0x%08x", pSrcFile, _ReturnAddress()); lastOBGEDirect3DBaseTexture9 = *ppVolumeTexture; return res; }
// Hook function. HRESULT FAR WINAPI OBGECreateVolumeTextureFromFileInMemory(LPDIRECT3DDEVICE9 pDevice, LPCVOID pSrcData, UINT SrcDataSize, LPDIRECT3DTEXTURE9 *ppVolumeTexture) { D3DXCreateVolumeTextureFromFileInMemory_t old_func = (D3DXCreateVolumeTextureFromFileInMemory_t) D3XHook.Functions[D3XFN_CreateVolumeTextureFromFileInMemory].OrigFn; HRESULT res = old_func(pDevice, pSrcData, SrcDataSize, ppVolumeTexture); //_MESSAGE("OD3DX: CreateVolumeTextureFromFileInMemory(\"%d\") queried from 0x%08x", SrcDataSize, _ReturnAddress()); lastOBGEDirect3DBaseTexture9 = *ppVolumeTexture; return res; }
// Hook function. HRESULT FAR WINAPI OBGESaveTextureToFileA(LPCTSTR pDestFile, D3DXIMAGE_FILEFORMAT DestFormat, LPDIRECT3DBASETEXTURE9 pSrcTexture, const PALETTEENTRY *pSrcPalette) { D3DXSaveTextureToFileA_t old_func = (D3DXSaveTextureToFileA_t) D3XHook.Functions[D3XFN_SaveTextureToFileA].OrigFn; //_MESSAGE("OD3DX: SaveTextureToFile(\"%s\") queried from 0x%08x", pDestFile, _ReturnAddress()); HRESULT res = old_func(pDestFile, DestFormat, pSrcTexture, pSrcPalette); if (res != D3D_OK) res = OBGESaveBC45TextureToFile(pDestFile, DestFormat, pSrcTexture, pSrcPalette); return res; }
// Hook function. HWND WINAPI OBGEGetActiveWindow(void) { GetActiveWindow_t old_func = (GetActiveWindow_t) U32Hook.Functions[U32FN_GetActiveWindow].OrigFn; HWND hWnd = old_func(); #if 0 // hook active window if (!dw) DebugWindow::Expunge(); if (dw) hWnd = dw->ControlActiveWindow(hWnd); #endif return hWnd; }