Skip to content

Commit

Permalink
Make interfaces consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
elishacloud committed Dec 2, 2024
1 parent 986654f commit d3a3878
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 20 deletions.
2 changes: 1 addition & 1 deletion BuildNo.rc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define BUILD_NUMBER 81
#define BUILD_NUMBER 82
2 changes: 1 addition & 1 deletion IDirectInputDeviceX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ HRESULT m_IDirectInputDeviceX::WriteEffectToFileX(V lpszFileName, DWORD dwEntrie
return GetProxyInterface<T>()->WriteEffectToFile(lpszFileName, dwEntries, rgDiFileEft, dwFlags);
}

void m_IDirectInputDeviceX::ReleaseDirectInput()
void m_IDirectInputDeviceX::ReleaseInterface()
{
// Don't delete wrapper interface
if (StringType == ANSI_CHARSET)
Expand Down
4 changes: 2 additions & 2 deletions IDirectInputDeviceX.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class m_IDirectInputDeviceX : public AddressLookupTableDinputObject
template <class T, class V>
inline HRESULT WriteEffectToFileX(V lpszFileName, DWORD dwEntries, LPDIFILEEFFECT rgDiFileEft, DWORD dwFlags);

void ReleaseDirectInput();
void ReleaseInterface();

public:
m_IDirectInputDeviceX(IDirectInputDevice8W *aOriginal, REFIID riid) : ProxyInterface(aOriginal), WrapperID(riid), StringType(GetStringType(riid))
Expand All @@ -131,7 +131,7 @@ class m_IDirectInputDeviceX : public AddressLookupTableDinputObject
// Delete Critical Section
DeleteCriticalSection(&dics);

ReleaseDirectInput();
ReleaseInterface();
}

/*** IUnknown methods ***/
Expand Down
16 changes: 3 additions & 13 deletions IDirectInputEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,11 @@ HRESULT m_IDirectInputEffect::QueryInterface(REFIID riid, LPVOID * ppvObj)

if (!ProxyInterface)
{
if (!ppvObj)
if (ppvObj)
{
return E_POINTER;
*ppvObj = nullptr;
}
*ppvObj = nullptr;

if (riid == WrapperID || riid == IID_IUnknown)
{
*ppvObj = this;

AddRef();

return DI_OK;
}
return E_POINTER;
return E_NOINTERFACE;
}

return ProxyQueryInterface(ProxyInterface, riid, ppvObj, WrapperID, WrapperInterface);
Expand Down
2 changes: 1 addition & 1 deletion IDirectInputX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ HRESULT m_IDirectInputX::CreateDeviceExX(REFGUID rguid, REFIID riid, V *ppvObj,
return hr;
}

void m_IDirectInputX::ReleaseDirectInput()
void m_IDirectInputX::ReleaseInterface()
{
// Don't delete wrapper interface
if (StringType == ANSI_CHARSET)
Expand Down
4 changes: 2 additions & 2 deletions IDirectInputX.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class m_IDirectInputX : public AddressLookupTableDinputObject
template <class T, class V>
inline HRESULT CreateDeviceExX(REFGUID rguid, REFIID riid, V *ppvObj, LPUNKNOWN pUnkOuter);

void ReleaseDirectInput();
void ReleaseInterface();

public:
m_IDirectInputX(IDirectInput8W *aOriginal, REFIID riid) : ProxyInterface(aOriginal), WrapperID(riid), StringType(GetStringType(riid))
Expand All @@ -59,7 +59,7 @@ class m_IDirectInputX : public AddressLookupTableDinputObject
{
LOG_LIMIT(3, __FUNCTION__ << " (" << this << ")" << " deleting interface!");

ReleaseDirectInput();
ReleaseInterface();
}

/*** IUnknown methods ***/
Expand Down

0 comments on commit d3a3878

Please sign in to comment.