HRESULT CProxyIDirectInput7::Proxy_CreateDevice(THIS_ REFGUID rguid,LPDIRECTINPUTDEVICEA *lpIDD,LPUNKNOWN pUnkOuter)
{
	DEBUG_LOGGING_MORE_DETAIL(("IDirectInput7::CreateDevice()\n"));

	void *ret_cProxy;
	IDirectInputDevice7* lpDirectInputDevice7;

	HRESULT Result = m_Instance->CreateDevice(rguid, (LPDIRECTINPUTDEVICEA*)&lpDirectInputDevice7,pUnkOuter);

	if ( IsEqualGUID(rguid, GUID_SysMouse) ){
		DEBUG_LOGGING_MORE_DETAIL(("IDirectInput7::Hook_CProxyIDirectInputDevice7 0x%0x ", lpDirectInputDevice7));
		ret_cProxy = (void*)(new CProxyIDirectInputDevice7(lpDirectInputDevice7));
		*lpIDD = (LPDIRECTINPUTDEVICEA)ret_cProxy;
	}

	return Result;
}
Exemplo n.º 2
0
HRESULT WINAPI ProxyDirectInputCreateA(
	HINSTANCE hinst,
	DWORD dwVersion,
	LPDIRECTINPUTA *ppDI,
	LPUNKNOWN punkOuter )
{
	DEBUG_LOGGING_MORE_DETAIL(("DirectInputCreateA hookfunc instance = %08X", hinst));

	HRESULT Result = OrigDirectInputCreateA( hinst, dwVersion, ppDI, punkOuter );

	if(FAILED(Result))
		return Result;
	if(dwVersion == 0x0700){
		*ppDI = new CProxyIDirectInput7((IDirectInput7*)*ppDI);
	}
	DEBUG_LOGGING_MORE_DETAIL(("DirectInputCreateA Hook hookfunc"));

    return Result;
}
Exemplo n.º 3
0
HRESULT WINAPI ProxyDirectDrawCreateEx(
	GUID FAR     *lpGuid,
	LPVOID       *lplpDD,
	REFIID        iid,
	IUnknown FAR *pUnkOuter )
{
	DEBUG_LOGGING_MORE_DETAIL(("DirectDrawCreateEx hookfunc\n"));

	HRESULT Result = OrigDirectDrawCreateEx( lpGuid, lplpDD, iid, pUnkOuter );
	if(FAILED(Result))
		return Result;

	CProxyIDirectDraw7 *lpcDD;
	*lplpDD = lpcDD = new CProxyIDirectDraw7((IDirectDraw7*)*lplpDD);
	lpcDD->setThis(lpcDD);

	DEBUG_LOGGING_MORE_DETAIL(("DirectDrawCreateEx Hook hookfunc"));

    return Result;
}
HRESULT CProxyIDirectInputDevice7::Proxy_SetCooperativeLevel(HWND hwnd, DWORD dwflags)
{
	HRESULT Result;
	DEBUG_LOGGING_MORE_DETAIL(("lpDI->SetCooperativeLevel\n"));

	if( g_FreeMouseSw )
		dwflags = DISCL_NONEXCLUSIVE | DISCL_BACKGROUND;

	Result = m_Instance->SetCooperativeLevel(hwnd,dwflags);

	return Result;
}