diff options
Diffstat (limited to 'plugins/Ping/src')
-rw-r--r-- | plugins/Ping/src/ping.cpp | 3 | ||||
-rw-r--r-- | plugins/Ping/src/pingthread.cpp | 1 | ||||
-rw-r--r-- | plugins/Ping/src/stdafx.h | 1 | ||||
-rw-r--r-- | plugins/Ping/src/utils.cpp | 5 |
4 files changed, 3 insertions, 7 deletions
diff --git a/plugins/Ping/src/ping.cpp b/plugins/Ping/src/ping.cpp index ad55a54a90..da44e3ac1a 100644 --- a/plugins/Ping/src/ping.cpp +++ b/plugins/Ping/src/ping.cpp @@ -121,7 +121,6 @@ int CMPlugin::Load() use_raw_ping = false;
db_set_b(0, MODULENAME, "UsingRawSockets", (BYTE)use_raw_ping);
- DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &mainThread, THREAD_SET_CONTEXT, FALSE, 0);
hWakeEvent = CreateEvent(nullptr, FALSE, FALSE, L"Local\\ThreadWaitEvent");
// create services before loading options - so we can have the 'getlogfilename' service!
@@ -147,8 +146,6 @@ int CMPlugin::Unload() {
SavePingList(0, 0);
- CloseHandle(mainThread);
-
if (options.logging)
CallService(MODULENAME "/Log", (WPARAM)L"stop", 0);
diff --git a/plugins/Ping/src/pingthread.cpp b/plugins/Ping/src/pingthread.cpp index 09eba92fb0..f17298f6e1 100644 --- a/plugins/Ping/src/pingthread.cpp +++ b/plugins/Ping/src/pingthread.cpp @@ -4,7 +4,6 @@ int upCount, total = 0; size_t list_size = 0;
-HANDLE mainThread;
HANDLE hWakeEvent = nullptr;
// thread protected variables
diff --git a/plugins/Ping/src/stdafx.h b/plugins/Ping/src/stdafx.h index 257c56d6f8..80b2da686d 100644 --- a/plugins/Ping/src/stdafx.h +++ b/plugins/Ping/src/stdafx.h @@ -129,7 +129,6 @@ extern HistoryMap history_map; extern PINGLIST list_items;
extern HANDLE reload_event_handle;
extern mir_cs list_cs;
-extern HANDLE mainThread;
extern HANDLE hWakeEvent;
extern mir_cs thread_finished_cs, list_changed_cs, data_list_cs;
diff --git a/plugins/Ping/src/utils.cpp b/plugins/Ping/src/utils.cpp index 2f603ec3a0..58111c7f15 100644 --- a/plugins/Ping/src/utils.cpp +++ b/plugins/Ping/src/utils.cpp @@ -16,7 +16,7 @@ LRESULT CALLBACK NullWindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l return DefWindowProc(hWnd, message, wParam, lParam);
}
-void CALLBACK sttMainThreadCallback(ULONG_PTR dwParam)
+static INT_PTR CALLBACK sttMainThreadCallback(void *dwParam)
{
POPUPDATAT* ppd = (POPUPDATAT*)dwParam;
@@ -24,6 +24,7 @@ void CALLBACK sttMainThreadCallback(ULONG_PTR dwParam) PUAddPopupT(ppd);
free(ppd);
+ return 0;
}
void __stdcall ShowPopup(wchar_t *line1, wchar_t *line2, int flags)
@@ -48,7 +49,7 @@ void __stdcall ShowPopup(wchar_t *line1, wchar_t *line2, int flags) ppd->PluginWindowProc = NullWindowProc;
ppd->PluginData = nullptr;
- QueueUserAPC(sttMainThreadCallback, mainThread, (ULONG_PTR)ppd);
+ CallFunctionSync(sttMainThreadCallback, ppd);
}
else{
MessageBox(nullptr, line2, _A2W(MODULENAME) L" Message", MB_OK | MB_ICONINFORMATION);
|