Skip to content

Commit

Permalink
Fix some variables
Browse files Browse the repository at this point in the history
  • Loading branch information
elishacloud committed Apr 27, 2019
1 parent 5e6daa9 commit 7fe84db
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
2 changes: 1 addition & 1 deletion BuildNo.rc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define BUILD_NUMBER 22
#define BUILD_NUMBER 23
20 changes: 10 additions & 10 deletions IDirectInputEnum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,36 @@

#include "dinputto8.h"

BOOL CALLBACK m_IDirectInputEnumEffect::EnumEffectCallback(LPDIRECTINPUTEFFECT a, LPVOID pvRef)
BOOL CALLBACK m_IDirectInputEnumEffect::EnumEffectCallback(LPDIRECTINPUTEFFECT pdeff, LPVOID pvRef)
{
ENUMEFFECT *lpCallbackContext = (ENUMEFFECT*)pvRef;

if (a)
if (pdeff)
{
a = ProxyAddressLookupTable.FindAddress<m_IDirectInputEffect>(a);
pdeff = ProxyAddressLookupTable.FindAddress<m_IDirectInputEffect>(pdeff);
}

return lpCallbackContext->lpCallback(a, lpCallbackContext->pvRef);
return lpCallbackContext->lpCallback(pdeff, lpCallbackContext->pvRef);
}

BOOL CALLBACK m_IDirectInputEnumDevice::EnumDeviceCallbackA(LPCDIDEVICEINSTANCEA a, LPVOID pvRef)
BOOL CALLBACK m_IDirectInputEnumDevice::EnumDeviceCallbackA(LPCDIDEVICEINSTANCEA lpddi, LPVOID pvRef)
{
ENUMDEVICE *lpCallbackContext = (ENUMDEVICE*)pvRef;

DIDEVICEINSTANCEA DI;
CopyMemory(&DI, a, a->dwSize);
DI.dwDevType = ConvertDevTypeTo7(GET_DIDEVICE_TYPE(a->dwDevType));
CopyMemory(&DI, lpddi, lpddi->dwSize);
DI.dwDevType = ConvertDevTypeTo7(GET_DIDEVICE_TYPE(lpddi->dwDevType));

return ((LPDIENUMDEVICESCALLBACKA)lpCallbackContext->lpCallback)(&DI, lpCallbackContext->pvRef);
}

BOOL CALLBACK m_IDirectInputEnumDevice::EnumDeviceCallbackW(LPCDIDEVICEINSTANCEW a, LPVOID pvRef)
BOOL CALLBACK m_IDirectInputEnumDevice::EnumDeviceCallbackW(LPCDIDEVICEINSTANCEW lpddi, LPVOID pvRef)
{
ENUMDEVICE *lpCallbackContext = (ENUMDEVICE*)pvRef;

DIDEVICEINSTANCEW DI;
CopyMemory(&DI, a, a->dwSize);
DI.dwDevType = ConvertDevTypeTo7(GET_DIDEVICE_TYPE(a->dwDevType));
CopyMemory(&DI, lpddi, lpddi->dwSize);
DI.dwDevType = ConvertDevTypeTo7(GET_DIDEVICE_TYPE(lpddi->dwDevType));

return ((LPDIENUMDEVICESCALLBACKW)lpCallbackContext->lpCallback)(&DI, lpCallbackContext->pvRef);
}
7 changes: 1 addition & 6 deletions InterfaceQuery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,7 @@ REFIID dinputto8::ConvertREFIID(REFIID riid)

HRESULT dinputto8::ProxyQueryInterface(LPVOID ProxyInterface, REFIID riid, LPVOID * ppvObj, REFIID WrapperID, LPVOID WrapperInterface)
{
if (!ppvObj)
{
return DIERR_GENERIC;
}

if (riid == WrapperID || riid == IID_IUnknown)
if ((riid == WrapperID || riid == IID_IUnknown) && ppvObj)
{
((IUnknown*)ProxyInterface)->AddRef();

Expand Down

0 comments on commit 7fe84db

Please sign in to comment.