WGI: fix interop with applications that have their own WGI code

QI for Added/Removed events need to handle IAgileObject
This commit is contained in:
Shawn Hoffman 2022-08-08 14:52:19 -07:00 committed by Sam Lantinga
parent ada55c690d
commit 5aa438e80a

View File

@ -32,6 +32,7 @@
#define COBJMACROS
#include "windows.gaming.input.h"
#include <cfgmgr32.h>
#include <objidlbase.h>
#include <roapi.h>
@ -213,11 +214,15 @@ static HRESULT STDMETHODCALLTYPE IEventHandler_CRawGameControllerVtbl_QueryInter
}
*ppvObject = NULL;
if (WIN_IsEqualIID(riid, &IID_IUnknown) || WIN_IsEqualIID(riid, &IID_IEventHandler_RawGameController)) {
if (WIN_IsEqualIID(riid, &IID_IUnknown) || WIN_IsEqualIID(riid, &IID_IAgileObject) || WIN_IsEqualIID(riid, &IID_IEventHandler_RawGameController)) {
*ppvObject = This;
return S_OK;
} else if (WIN_IsEqualIID(riid, &IID_IMarshal)) {
// This seems complicated. Let's hope it doesn't happen.
return E_OUTOFMEMORY;
} else {
return E_NOINTERFACE;
}
return E_NOINTERFACE;
}
static ULONG STDMETHODCALLTYPE IEventHandler_CRawGameControllerVtbl_AddRef(__FIEventHandler_1_Windows__CGaming__CInput__CRawGameController * This)