summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMaurice Kalinowski <maurice.kalinowski@qt.io>2016-11-16 08:35:36 +0100
committerMaurice Kalinowski <maurice.kalinowski@qt.io>2016-11-16 08:13:12 +0000
commit78e33de8e5538235b06623bbeef0019d4fb320c8 (patch)
treeaafa692556ab348c5d0f51cd0da0d76e6ff9a8bf /src
parent27aeeac6eeb11150b505f8ffde6e87e157c22c90 (diff)
winrt: Check for sanity of variables in debug build
Identified as potential issues by analyze mode. Change-Id: I3f7c63a2349f29cc3de7baa78157fec157b9e561 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/winmain/qtmain_winrt.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/winmain/qtmain_winrt.cpp b/src/winmain/qtmain_winrt.cpp
index e49817ada4..b0e70608f9 100644
--- a/src/winmain/qtmain_winrt.cpp
+++ b/src/winmain/qtmain_winrt.cpp
@@ -110,7 +110,12 @@ static void devMessageHandler(QtMsgType type, const QMessageLogContext &context,
if (!event)
event = CreateEventEx(NULL, L"qdebug-event", 0, EVENT_ALL_ACCESS);
+ Q_ASSERT_X(shmem, Q_FUNC_INFO, "Could not create file mapping");
+ Q_ASSERT_X(event, Q_FUNC_INFO, "Could not create debug event");
+
void *data = MapViewOfFileFromApp(shmem, FILE_MAP_WRITE, 0, 4096);
+ Q_ASSERT_X(data, Q_FUNC_INFO, "Could not map file");
+
memset(data, quint32(type), sizeof(quint32));
memcpy_s(static_cast<quint32 *>(data) + 1, 4096 - sizeof(quint32),
message.data(), (message.length() + 1) * sizeof(wchar_t));
@@ -179,6 +184,7 @@ public:
app->core->Exit();
return res;
}, this, CREATE_SUSPENDED, nullptr);
+ Q_ASSERT_X(mainThread, Q_FUNC_INFO, "Could not create Qt main thread");
HRESULT hr;
ComPtr<Xaml::IApplicationStatics> appStatics;