From 488214ac8af0c4aeb1a5c1d8fd48368daaf4c4c7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 12 Nov 2018 20:12:53 +0300 Subject: end of ME_OPT_INITIALISE related zoo in another plugins --- plugins/HTTPServer/src/GuiElements.cpp | 4 ---- plugins/HTTPServer/src/main.cpp | 10 +++++----- 2 files changed, 5 insertions(+), 9 deletions(-) (limited to 'plugins/HTTPServer/src') diff --git a/plugins/HTTPServer/src/GuiElements.cpp b/plugins/HTTPServer/src/GuiElements.cpp index 66fddc14aa..de1a8553af 100644 --- a/plugins/HTTPServer/src/GuiElements.cpp +++ b/plugins/HTTPServer/src/GuiElements.cpp @@ -28,8 +28,6 @@ static HANDLE hShowStatisticsViewService = nullptr; static HANDLE hShareNewFileMenuItem = nullptr; static HANDLE hShowStatisticsViewMenuItem = nullptr; -static HANDLE hEventOptionsInitialize = nullptr; - HWND hwndStatsticView = nullptr; bool bLastAutoRefress = false; @@ -1455,7 +1453,5 @@ void InitGuiElements() hShowStatisticsViewMenuItem = Menu_AddMainMenuItem(&mi); } - hEventOptionsInitialize = HookEvent(ME_OPT_INITIALISE, OptionsInitialize); - bShowPopups = db_get_b(NULL, MODULENAME, "ShowPopups", bShowPopups) != 0; } diff --git a/plugins/HTTPServer/src/main.cpp b/plugins/HTTPServer/src/main.cpp index b20ef338c1..bc3e9e4d57 100644 --- a/plugins/HTTPServer/src/main.cpp +++ b/plugins/HTTPServer/src/main.cpp @@ -42,8 +42,8 @@ const char* pszDefaultShares[] = { nullptr, nullptr }; -void ConnectionOpen(HANDLE hNewConnection, DWORD dwRemoteIP); -int PreShutdown(WPARAM /*wparam*/, LPARAM /*lparam*/); +int OptionsInitialize(WPARAM, LPARAM); +int PreShutdown(WPARAM, LPARAM); HNETLIBUSER hNetlibUser; HANDLE hDirectBoundPort; @@ -74,7 +74,6 @@ int nMaxConnectionsPerUser = -1; int nDefaultDownloadLimit = -1; bool bIsOnline = true; -static HANDLE hEventProtoAck = nullptr; bool bLimitOnlyWhenOnline = true; @@ -330,7 +329,7 @@ bool bReadConfigurationFile() bool bWriteConfigurationFile() { CLFileShareListAccess clCritSection; - char szBuf[1000], temp[200]; + char szBuf[1000]; mir_strcpy(szBuf, szPluginPath); mir_strcat(szBuf, szConfigFile); HANDLE hFile = CreateFile(szBuf, GENERIC_WRITE, FILE_SHARE_READ, nullptr, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr); @@ -833,7 +832,8 @@ int CMPlugin::Load() db_set_b(NULL, MODULENAME, "IndexCreationMode", (BYTE)indexCreationMode); } - hEventProtoAck = HookEvent(ME_PROTO_ACK, nProtoAck); + HookEvent(ME_OPT_INITIALISE, OptionsInitialize); + HookEvent(ME_PROTO_ACK, nProtoAck); return 0; } -- cgit v1.2.3