summaryrefslogtreecommitdiff
path: root/ping/ping.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ping/ping.cpp')
-rw-r--r--ping/ping.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/ping/ping.cpp b/ping/ping.cpp
index b5fba5c..9623fcd 100644
--- a/ping/ping.cpp
+++ b/ping/ping.cpp
@@ -13,7 +13,7 @@ bool use_raw_ping = true;
PLUGININFOEX pluginInfo={
sizeof(PLUGININFOEX),
"Ping Plugin",
- PLUGIN_MAKE_VERSION(0, 8, 0, 2),
+ PLUGIN_MAKE_VERSION(0, 9, 1, 0),
"Ping labelled IP addresses or domain names.",
"Scott Ellis",
"mail@scottellis.com.au",
@@ -27,6 +27,7 @@ PLUGININFOEX pluginInfo={
extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
{
hInst=hinstDLL;
+ DisableThreadLibraryCalls(hInst);
return TRUE;
}
@@ -87,7 +88,7 @@ int OnShutdown(WPARAM wParam, LPARAM lParam) {
if(use_raw_ping)
cleanup_raw_ping();
else
- ICMP::get_instance()->stop();
+ ICMP::cleanup();
DeinitList();
@@ -105,6 +106,7 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam) {
update.szComponentName = pluginInfo.shortName;
update.pbVersion = (BYTE *)CreateVersionString(pluginInfo.version, szVersion);
update.cpbVersion = strlen((char *)update.pbVersion);
+ update.szBetaChangelogURL = "https://server.scottellis.com.au/websvn/log.php?repname=Miranda+Plugins&path=%2Fping%2F&rev=0&sc=0&isdir=1";
update.szUpdateURL = UPDATER_AUTOREGISTER;
@@ -121,6 +123,8 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam) {
CallService(MS_UPDATE_REGISTER, 0, (WPARAM)&update);
}
+
+
NETLIBUSER nl_user = {0};
nl_user.cbSize = sizeof(nl_user);
nl_user.szSettingsModule = PLUG;
@@ -136,7 +140,7 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam) {
hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nl_user);
- InitIcons();
+ InitUtils();
InitMenus();
@@ -164,11 +168,11 @@ extern "C" PING_API int Load(PLUGINLINK *link)
{
pluginLink=link;
- if(init_raw_ping()) {
+ //if(init_raw_ping()) {
//MessageBox(0, Translate("Failed to initialize. Plugin disabled."), Translate("Ping Plugin"), MB_OK | MB_ICONERROR);
//return 1;
use_raw_ping = false;
- }
+ //}
DBWriteContactSettingByte(0, PLUG, "UsingRawSockets", (BYTE)use_raw_ping);
DuplicateHandle( GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &mainThread, THREAD_SET_CONTEXT, FALSE, 0 );
@@ -204,6 +208,8 @@ extern "C" PING_API int Unload(void)
DeleteCriticalSection(&thread_finished_cs);
DeleteCriticalSection(&list_changed_cs);
DeleteCriticalSection(&data_list_cs);
+
+ DeinitUtils();
CloseHandle( mainThread );