diff options
author | George Hazan <ghazan@miranda.im> | 2018-07-26 21:40:50 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-07-26 21:40:50 +0300 |
commit | 1019387a8f6ccc087a113f138c5237146492a356 (patch) | |
tree | 50ef616016686e43ae119333ebac88bc90b2ff11 /plugins/HTTPServer/src | |
parent | d61bc49d53578c26b50531fdec1bbd633e19b6ac (diff) |
fixes #1527 (Remove obsolete g_hMainThread and QueueUSerAPC from plugins)
Diffstat (limited to 'plugins/HTTPServer/src')
-rw-r--r-- | plugins/HTTPServer/src/GuiElements.cpp | 36 | ||||
-rw-r--r-- | plugins/HTTPServer/src/GuiElements.h | 1 | ||||
-rw-r--r-- | plugins/HTTPServer/src/main.cpp | 3 |
3 files changed, 5 insertions, 35 deletions
diff --git a/plugins/HTTPServer/src/GuiElements.cpp b/plugins/HTTPServer/src/GuiElements.cpp index 726f5947da..5b0cd2d32a 100644 --- a/plugins/HTTPServer/src/GuiElements.cpp +++ b/plugins/HTTPServer/src/GuiElements.cpp @@ -32,7 +32,6 @@ static HANDLE hEventOptionsInitialize = nullptr; HWND hwndStatsticView = nullptr;
bool bLastAutoRefress = false;
-HANDLE hMainThread;
bool bShowPopups = true;
@@ -1357,9 +1356,9 @@ int OptionsInitialize(WPARAM wParam, LPARAM /*lParam*/) // Developer : KN
/////////////////////////////////////////////////////////////////////
-void CALLBACK MainThreadCallback(ULONG_PTR dwParam)
+void CALLBACK MainThreadCallback(void *param)
{
- POPUPDATAT *pclData = (POPUPDATAT*)dwParam;
+ POPUPDATAT *pclData = (POPUPDATAT*)param;
if (db_get_b(NULL, MODULENAME, "WriteLogFile", 0) != 0)
LogEvent(pclData->lpzContactName, pclData->lpzText);
@@ -1383,7 +1382,7 @@ void CALLBACK MainThreadCallback(ULONG_PTR dwParam) // Developer : KN, Houdini
/////////////////////////////////////////////////////////////////////
-void CALLBACK OpenStatisticViewFromPopupProc(ULONG_PTR /* dwParam */)
+static void CALLBACK OpenStatisticViewFromPopupProc(void*)
{
nShowStatisticsView(0, 0);
}
@@ -1394,7 +1393,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM switch (message) {
case WM_LBUTTONDOWN:
- QueueUserAPC(OpenStatisticViewFromPopupProc, hMainThread, 0);
+ CallFunctionAsync(OpenStatisticViewFromPopupProc, 0);
PUDeletePopup(hWnd);
return 0;
@@ -1429,12 +1428,8 @@ void ShowPopupWindow(const char * pszName, const char * pszText, COLORREF ColorB strncpy(pclData->lpzContactName, pszName, sizeof(pclData->lpzContactName) - 1); // -1 so that there aways will be a null termination !!
strncpy(pclData->lpzText, pszText, sizeof(pclData->lpzText) - 1);
pclData->colorBack = ColorBack;
- //ppd.colorText = colorText;
pclData->PluginWindowProc = PopupWindowProc;
- //Now that every field has been filled, we want to see the popup.
-
- //CallService(MS_POPUP_ADDPOPUP, (WPARAM)&ppd, 0);
- QueueUserAPC(MainThreadCallback, hMainThread, (ULONG_PTR)pclData);
+ CallFunctionAsync(MainThreadCallback, pclData);
}
/////////////////////////////////////////////////////////////////////
@@ -1457,9 +1452,6 @@ void InitGuiElements() stInitCom.dwICC = ICC_INTERNET_CLASSES;
InitCommonControlsEx(&stInitCom);
- //hMainThread = GetCurrentThread();
- DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &hMainThread, THREAD_SET_CONTEXT, FALSE, 0);
-
sUrlAddress = DBGetString(NULL, MODULENAME, "UrlAddress", szDefaultUrlAddress);
sPageKeyword = DBGetString(NULL, MODULENAME, "PageKeyword", szDefaultPageKeyword);
@@ -1489,21 +1481,3 @@ void InitGuiElements() bShowPopups = db_get_b(NULL, MODULENAME, "ShowPopups", bShowPopups) != 0;
}
-
-/////////////////////////////////////////////////////////////////////
-// Member Function : UninitGuiElements
-// Type : Global
-// Parameters : None
-// Returns : void
-// Description :
-//
-// References : -
-// Remarks : -
-// Created : 031011, 11 oktober 2003
-// Developer : KN
-/////////////////////////////////////////////////////////////////////
-
-void UnInitGuiElements()
-{
- CloseHandle(hMainThread);
-}
diff --git a/plugins/HTTPServer/src/GuiElements.h b/plugins/HTTPServer/src/GuiElements.h index 0ce1d11814..23ca03d032 100644 --- a/plugins/HTTPServer/src/GuiElements.h +++ b/plugins/HTTPServer/src/GuiElements.h @@ -21,7 +21,6 @@ #include <windows.h>
void InitGuiElements();
-void UnInitGuiElements();
void UpdateStatisticsView();
void ShowPopupWindow(const char * pszName, const char * pszText, COLORREF ColorBack = 0);
void SendLinkToUser(WPARAM wParam, char *pszSrvPath); // Add By Sergio Vieira Rolanski
diff --git a/plugins/HTTPServer/src/main.cpp b/plugins/HTTPServer/src/main.cpp index e951994a83..159b763bd3 100644 --- a/plugins/HTTPServer/src/main.cpp +++ b/plugins/HTTPServer/src/main.cpp @@ -790,11 +790,8 @@ int nSystemShutdown(WPARAM /*wparam*/, LPARAM /*lparam*/) }
pclFirstNode = nullptr;
- UnInitGuiElements();
-
db_set_b(NULL, MODULENAME, "IndexCreationMode", (BYTE)indexCreationMode);
FreeIndexHTMLTemplate();
-
return 0;
}
|