From a050be0895093350471280c93cf5dd047a25b2c8 Mon Sep 17 00:00:00 2001 From: Doug Lyons Date: Sun, 12 Feb 2023 12:17:55 -0600 Subject: [PATCH] Fix Wine Internet Explorer Print hang (#5064) When using wine internet explorer it crashes if you click print even if you click cancel, this fixes that issue. nsIWebBrowserPrint_Print apparently causes issues for unknown reasons. JIRA issue: CORE-16884 By returning S_OK print doesn't cause a crash. Use ERR and S_OK return before hitting nsIWebBrowserPrint_Print --- dll/win32/mshtml/olecmd.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dll/win32/mshtml/olecmd.c b/dll/win32/mshtml/olecmd.c index 96b3f4bb6b7..6c419f8761f 100644 --- a/dll/win32/mshtml/olecmd.c +++ b/dll/win32/mshtml/olecmd.c @@ -241,6 +241,13 @@ static HRESULT exec_print(HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, return S_OK; } +#ifdef __REACTOS__ + // returning here fixes CORE-16884. Maybe use this until printing works. + ERR("Aborting print, to work around CORE-16884\n"); + nsIWebBrowserPrint_Release(nsprint); + return S_OK; +#endif + nsres = nsIWebBrowserPrint_GetGlobalPrintSettings(nsprint, &settings); if(NS_FAILED(nsres)) ERR("GetCurrentPrintSettings failed: %08x\n", nsres);