Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 051955d

Browse filesBrowse files
committed
get the win eventlog
1 parent 2a0f8e6 commit 051955d
Copy full SHA for 051955d

File tree

3 files changed

+11
-8
lines changed
Filter options

3 files changed

+11
-8
lines changed

‎src/plugins/servicebackends/systemd/de.skycoder42.QtService.ServicePlugin.systemd.xml

Copy file name to clipboardExpand all lines: src/plugins/servicebackends/systemd/de.skycoder42.QtService.ServicePlugin.systemd.xml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<node name="/de/skycoder42/QtService/SystemdServiceBackend">
33
<interface name="de.skycoder42.QtService.ServicePlugin.systemd">
44
<method name="quitService" />
5-
65
<method name="reloadService" />
6+
77
<signal name="serviceReloaded">
88
<arg name="success" type="b" />
99
</signal>

‎src/plugins/servicebackends/windows/windowsservicebackend.cpp

Copy file name to clipboardExpand all lines: src/plugins/servicebackends/windows/windowsservicebackend.cpp
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,8 @@ void WindowsServiceBackend::handler(DWORD dwOpcode)
257257
void WindowsServiceBackend::winsvcMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &message)
258258
{
259259
auto msg = qFormatLogMessage(type, context, message);
260-
auto h = RegisterEventSourceW(0, SVCNAME);
261-
if(h) {
260+
auto hEvSrc = RegisterEventSourceW(0, SVCNAME);
261+
if (hEvSrc) {
262262
WORD wType;
263263
switch (type) {
264264
case QtFatalMsg:
@@ -292,11 +292,11 @@ void WindowsServiceBackend::winsvcMessageHandler(QtMsgType type, const QMessageL
292292
.toUtf8();
293293

294294
auto msgStr = reinterpret_cast<const wchar_t *>(msg.utf16());
295-
ReportEvent(h, wType, 1, 1, NULL,
296-
1, contextStr.size(),
297-
&msgStr,
298-
contextStr.data());
299-
DeregisterEventSource(h);
295+
ReportEventW(hEvSrc, wType, 1, 1, NULL,
296+
1, contextStr.size(),
297+
&msgStr,
298+
contextStr.data());
299+
DeregisterEventSource(hEvSrc);
300300
} else
301301
std::cerr << msg.toStdString() << std::endl;
302302
}

‎tests/auto/service/TestWindowsService/tst_windowsservice.cpp

Copy file name to clipboardExpand all lines: tests/auto/service/TestWindowsService/tst_windowsservice.cpp
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ void TestWindowsService::init()
157157

158158
void TestWindowsService::cleanup()
159159
{
160+
// Print eventlog in hopes for some error info:
161+
QProcess::execute(QStringLiteral("wevtutil qe Application"));
162+
160163
if(_manager) {
161164
auto handle = OpenServiceW(_manager,
162165
reinterpret_cast<const wchar_t*>(name().utf16()),

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.