HRESULT WINAPI CDirectInput8Hook::DirectInput8Create__Hook( HINSTANCE hInst, DWORD dwVersion, REFIID riidltf, LPVOID * ppvOut, LPUNKNOWN punkOuter ) { HRESULT hResult = m_pDirectInput8Create( hInst, dwVersion, riidltf, ppvOut, punkOuter ); if( SUCCEEDED( hResult ) ) { IDirectInput8 * pInput = (IDirectInput8 *)*ppvOut; *ppvOut = new IDirectInput8Proxy( pInput ); } return hResult; }
HRESULT WINAPI CDirectInput8Hook::DirectInput8Create_Hook(HINSTANCE hinst, DWORD dwVersion, REFIID riidltf, LPVOID *ppvOut, LPUNKNOWN punkOuter) { CLogFile::Printf("DirectInput8Create Called"); // Call the real 'DirectInput8Create' HRESULT hr = m_pDirectInput8Create(hinst, dwVersion, riidltf, ppvOut, punkOuter); // If the call succeeded create our proxy device if(SUCCEEDED(hr)) { IDirectInput8 * pDInput = (IDirectInput8 *)*ppvOut; *ppvOut = new CDirectInput8Proxy(pDInput); } else CLogFile::Printf("DirectInput8Create Call Failed!"); return hr; }