vcl/win/gdi/salprn.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
New commits: commit b581cb2f5529d4ff137d036f043845ef14f4ea6e Author: Noel Grandin <[email protected]> AuthorDate: Mon Nov 13 13:13:42 2023 +0200 Commit: Thorsten Behrens <[email protected]> CommitDate: Wed Dec 3 01:25:33 2025 +0100 tdf#127547 Freeze in Microsoft Print to PDF dialog Change-Id: I7a6ef85fae637c8359a96df1bd31d7e8f0b36512 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159369 Tested-by: Hossein <[email protected]> Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> (cherry picked from commit 07dfeffae8cba808dbad85dfed9b6a693a1f9543) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194754 Reviewed-by: Thorsten Behrens <[email protected]> Tested-by: allotropia jenkins <[email protected]> Tested-by: Gabor Kelemen <[email protected]> diff --git a/vcl/win/gdi/salprn.cxx b/vcl/win/gdi/salprn.cxx index 1fe4968690bd..b5914a8887ca 100644 --- a/vcl/win/gdi/salprn.cxx +++ b/vcl/win/gdi/salprn.cxx @@ -1399,7 +1399,7 @@ void WinSalPrinter::markInvalid() // need wrappers for StarTocW/A to use structured exception handling // since SEH does not mix with standard exception handling's cleanup -static int lcl_StartDocW( HDC hDC, DOCINFOW const * pInfo, WinSalPrinter* pPrt ) +static int lcl_StartDocW1( HDC hDC, DOCINFOW const * pInfo, WinSalPrinter* pPrt ) { int nRet = 0; CATCH_DRIVER_EX_BEGIN; @@ -1408,6 +1408,16 @@ static int lcl_StartDocW( HDC hDC, DOCINFOW const * pInfo, WinSalPrinter* pPrt ) return nRet; } +static int lcl_StartDocW( HDC hDC, DOCINFOW const * pInfo, WinSalPrinter* pPrt ) +{ + //tdf#127547 - Freeze/crash in Microsoft Print to PDF dialog, if we try to paste while + // executing the StartDocW method, Windows will call back into us on a separate thread, + // where we will attempt to take the SolarMutex. + SolarMutexReleaser aReleaser; + + return lcl_StartDocW1(hDC, pInfo, pPrt); +} + bool WinSalPrinter::StartJob( const OUString* pFileName, const OUString& rJobName, const OUString&,
