Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 897412 Details for
Bug 1057911
Review Request: mingw-qt5-qtwinextras - Qt5 for Windows - QtWinExtras component
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
It's need to get working binaries on Windows XP
0001-Remove-dependency-on-swprintf_s-pulled-in-via-_com_e.patch (text/plain), 2.07 KB, created by
Ivan Romanov
on 2014-05-20 04:13:46 UTC
(
hide
)
Description:
It's need to get working binaries on Windows XP
Filename:
MIME Type:
Creator:
Ivan Romanov
Created:
2014-05-20 04:13:46 UTC
Size:
2.07 KB
patch
obsolete
>From 8ff3e135f9691f374086fe6cdf6f1dfc05dbb16e Mon Sep 17 00:00:00 2001 >From: Friedemann Kleint <Friedemann.Kleint@digia.com> >Date: Mon, 19 May 2014 14:08:20 +0200 >Subject: [PATCH] Remove dependency on swprintf_s() pulled in via > _com_error::ErrorMessage(). > >Task-number: QTBUG-35617 >Change-Id: I5078e3cb3841baa836934be60cce27b2e47d9a7e >--- > src/winextras/qwinfunctions.cpp | 26 ++++++++++++++++++++------ > 1 file changed, 20 insertions(+), 6 deletions(-) > >diff --git a/src/winextras/qwinfunctions.cpp b/src/winextras/qwinfunctions.cpp >index 3e62aff..9468f02 100644 >--- a/src/winextras/qwinfunctions.cpp >+++ b/src/winextras/qwinfunctions.cpp >@@ -216,6 +216,25 @@ QRegion QtWin::fromHRGN(HRGN hrgn) > return region; > } > >+// Re-engineered from the inline function _com_error::ErrorMessage(). >+// We cannot use it directly since it uses swprintf_s(), which is not >+// present in the MSVCRT.DLL found on Windows XP (QTBUG-35617). >+static inline QString errorMessageFromComError(const _com_error &comError) >+{ >+ TCHAR *message = Q_NULLPTR; >+ FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, >+ NULL, comError.Error(), MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT), >+ message, 0, NULL); >+ if (message) { >+ const QString result = QString::fromWCharArray(message).trimmed(); >+ LocalFree((HLOCAL)message); >+ return result; >+ } >+ if (const WORD wCode = comError.WCode()) >+ return QStringLiteral("IDispatch error #") + QString::number(wCode); >+ return QStringLiteral("Unknown error 0x0") + QString::number(comError.Error(), 16); >+} >+ > /*! > \since 5.2 > >@@ -225,12 +244,7 @@ QRegion QtWin::fromHRGN(HRGN hrgn) > QString QtWin::stringFromHresult(HRESULT hresult) > { > _com_error error(hresult); >- QString errorMsg; >- if (sizeof(TCHAR) == sizeof(wchar_t)) >- errorMsg = QString::fromWCharArray((wchar_t*) error.ErrorMessage()); >- else >- errorMsg = QString::fromLocal8Bit((char*) error.ErrorMessage()); >- return errorMsg; >+ return errorMessageFromComError(error); > } > > /*! >-- >1.9.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1057911
: 897412