Browse Source

Win+X: Adjust the CreateInstance hook to not fail when the QueryInterface fails

pull/4392/head
Amrsatrio 7 months ago
parent
commit
207f669a62
  1. 3
      ExplorerPatcher/TwinUIPatches.cpp

3
ExplorerPatcher/TwinUIPatches.cpp

@ -490,8 +490,7 @@ HRESULT STDMETHODCALLTYPE CLauncherTipContextMenu_CreateInstance_IClassFactory_H
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
{ {
ILauncherTipContextMenu* pLTCM = nullptr; ILauncherTipContextMenu* pLTCM = nullptr;
hr = ((IUnknown*)*ppvObject)->QueryInterface(IID_PPV_ARGS(&pLTCM)); if (SUCCEEDED(((IUnknown*)*ppvObject)->QueryInterface(IID_PPV_ARGS(&pLTCM)))) // Don't influence hr: if this fails, black screen
if (SUCCEEDED(hr))
{ {
void** vtable = *(void***)pLTCM; void** vtable = *(void***)pLTCM;
REPLACE_VTABLE_ENTRY(vtable, 3, CLauncherTipContextMenu_ShowLauncherTipContextMenu); REPLACE_VTABLE_ENTRY(vtable, 3, CLauncherTipContextMenu_ShowLauncherTipContextMenu);

Loading…
Cancel
Save