summaryrefslogtreecommitdiff
path: root/plugins/StatusPlugins
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2013-09-26 18:36:45 +0000
committerKirill Volinsky <mataes2007@gmail.com>2013-09-26 18:36:45 +0000
commitf34c2e508eeaba527009e2b86bf6ef7a09a496bb (patch)
tree4b89867b872732b1899609f5dea358092ca4891d /plugins/StatusPlugins
parent895ee7a4623bfa3378c5c5f1dec69893ca87b6b6 (diff)
plugins cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@6243 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/StatusPlugins')
-rw-r--r--plugins/StatusPlugins/KeepStatus/KeepStatus_10.vcxproj8
-rw-r--r--plugins/StatusPlugins/KeepStatus/KeepStatus_11.vcxproj8
-rw-r--r--plugins/StatusPlugins/KeepStatus/keepstatus.cpp24
-rw-r--r--plugins/StatusPlugins/KeepStatus/keepstatus.h2
-rw-r--r--plugins/StatusPlugins/StartupStatus/options.cpp26
5 files changed, 14 insertions, 54 deletions
diff --git a/plugins/StatusPlugins/KeepStatus/KeepStatus_10.vcxproj b/plugins/StatusPlugins/KeepStatus/KeepStatus_10.vcxproj
index 0ae73ed1d0..8923d4a812 100644
--- a/plugins/StatusPlugins/KeepStatus/KeepStatus_10.vcxproj
+++ b/plugins/StatusPlugins/KeepStatus/KeepStatus_10.vcxproj
@@ -88,7 +88,7 @@
<AdditionalIncludeDirectories>..\..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wininet.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wininet.lib;UxTheme.lib;Iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
@@ -120,7 +120,7 @@
<AdditionalIncludeDirectories>..\..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wininet.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wininet.lib;UxTheme.lib;Iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
@@ -155,7 +155,7 @@
</Link>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
- <AdditionalDependencies>ws2_32.lib;wininet.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wininet.lib;UxTheme.lib;Iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<SubSystem>Windows</SubSystem>
@@ -183,7 +183,7 @@
<ExceptionHandling>false</ExceptionHandling>
</ClCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wininet.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wininet.lib;UxTheme.lib;Iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<SubSystem>Windows</SubSystem>
diff --git a/plugins/StatusPlugins/KeepStatus/KeepStatus_11.vcxproj b/plugins/StatusPlugins/KeepStatus/KeepStatus_11.vcxproj
index bd4aa6fec1..a14674c4d1 100644
--- a/plugins/StatusPlugins/KeepStatus/KeepStatus_11.vcxproj
+++ b/plugins/StatusPlugins/KeepStatus/KeepStatus_11.vcxproj
@@ -92,7 +92,7 @@
<AdditionalIncludeDirectories>..\..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wininet.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wininet.lib;UxTheme.lib;Iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
@@ -125,7 +125,7 @@
<AdditionalIncludeDirectories>..\..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wininet.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wininet.lib;UxTheme.lib;Iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
@@ -159,7 +159,7 @@
</Link>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
- <AdditionalDependencies>ws2_32.lib;wininet.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wininet.lib;UxTheme.lib;Iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<SubSystem>Windows</SubSystem>
@@ -186,7 +186,7 @@
<ExceptionHandling>false</ExceptionHandling>
</ClCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;wininet.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;wininet.lib;UxTheme.lib;Iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<SubSystem>Windows</SubSystem>
diff --git a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp
index 743e664a1c..5e9ad4e953 100644
--- a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp
+++ b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp
@@ -55,7 +55,6 @@ static UINT_PTR checkContinTimerId = 0;
static UINT_PTR checkConnectingTimerId = 0;
static int retryCount = 0;
static BOOL bLastPingResult = TRUE;
-static HMODULE hICMP = NULL;
// variables (options)
static int maxRetries = 0;
static int initDelay = 0;
@@ -121,7 +120,6 @@ int LoadMainOptions()
if (IsWindow(hMessageWindow))
DestroyWindow(hMessageWindow);
if (StartTimer(IDT_CHECKCONTIN, -1, FALSE)) {
- FreeLibrary(hICMP);
WSACleanup();
}
StopTimer(IDT_CHECKCONN|IDT_PROCESSACK|IDT_AFTERCHECK|IDT_CHECKCONTIN|IDT_CHECKCONNECTING);
@@ -132,12 +130,7 @@ int LoadMainOptions()
if ( db_get_b(NULL, MODULENAME, SETTING_CONTCHECK, FALSE)) {
if ( db_get_b(NULL, MODULENAME, SETTING_BYPING, FALSE)) {
WSADATA wsaData;
-
WSAStartup(MAKEWORD(2, 2), &wsaData);
- hICMP = LoadLibraryA("ICMP.DLL");
- if (hICMP == NULL) {
- log_infoA("KeepStatus: icmp.dll not found, ping disabled");
- }
}
StartTimer(IDT_CHECKCONTIN, 0, FALSE);
}
@@ -768,10 +761,6 @@ static VOID CALLBACK AfterCheckTimer(HWND hwnd,UINT message,UINT_PTR idEvent,DWO
StopChecking();
}
-typedef HANDLE ( WINAPI *pfnIcmpCreateFile )( void );
-typedef BOOL ( WINAPI *pfnIcmpCloseHandle )( HANDLE );
-typedef DWORD ( WINAPI *pfnIcmpSendEcho )( HANDLE, DWORD, int, int, void*, char*, int, int );
-
static void CheckContinueslyFunction(void *arg)
{
static int pingFailures = 0;
@@ -815,14 +804,7 @@ static void CheckContinueslyFunction(void *arg)
char reply[sizeof(ICMP_ECHO_REPLY)+8];
bLastPingResult = FALSE;
- pfnIcmpCreateFile lpfnIcmpCreateFile = (pfnIcmpCreateFile)GetProcAddress(hICMP,"IcmpCreateFile");
- pfnIcmpCloseHandle lpfnIcmpCloseHandle = (pfnIcmpCloseHandle)GetProcAddress(hICMP,"IcmpCloseHandle");
- pfnIcmpSendEcho lpfnIcmpSendEcho = (pfnIcmpSendEcho)GetProcAddress(hICMP,"IcmpSendEcho");
- if ((hICMP == NULL) || (lpfnIcmpCreateFile == NULL) || (lpfnIcmpCloseHandle == NULL) || (lpfnIcmpSendEcho == NULL)) {
- bLastPingResult = TRUE;
- log_infoA("KeepStatus: icmp.dll error (1)");
- }
- HANDLE hICMPFile = (HANDLE) lpfnIcmpCreateFile();
+ HANDLE hICMPFile = (HANDLE)IcmpCreateFile();
if (hICMPFile == INVALID_HANDLE_VALUE) {
bLastPingResult = TRUE;
log_infoA("KeepStatus: icmp.dll error (2)");
@@ -838,7 +820,7 @@ static void CheckContinueslyFunction(void *arg)
hostent = gethostbyname(host);
if (hostent != NULL) {
addr = (DWORD *)( *hostent->h_addr_list );
- bLastPingResult = (lpfnIcmpSendEcho(hICMPFile, *addr, 0,0,NULL, reply,sizeof(ICMP_ECHO_REPLY)+8,5000) != 0);
+ bLastPingResult = (IcmpSendEcho(hICMPFile, *addr, 0,0,NULL, reply,sizeof(ICMP_ECHO_REPLY)+8,5000) != 0);
if (bLastPingResult)
pingFailures = 0;
@@ -854,7 +836,7 @@ static void CheckContinueslyFunction(void *arg)
start++;
}
}
- lpfnIcmpCloseHandle(hICMPFile);
+ IcmpCloseHandle(hICMPFile);
}
db_free(&dbv);
}
diff --git a/plugins/StatusPlugins/KeepStatus/keepstatus.h b/plugins/StatusPlugins/KeepStatus/keepstatus.h
index 2bb79a2f22..0bcadaa66a 100644
--- a/plugins/StatusPlugins/KeepStatus/keepstatus.h
+++ b/plugins/StatusPlugins/KeepStatus/keepstatus.h
@@ -24,6 +24,8 @@
#include <winsock.h>
#include <wininet.h>
#include <ipexport.h>
+#include <Icmpapi.h>
+
#include <m_options.h>
#include <m_skin.h>
#include <m_utils.h>
diff --git a/plugins/StatusPlugins/StartupStatus/options.cpp b/plugins/StatusPlugins/StartupStatus/options.cpp
index c2ecff2710..63394872ca 100644
--- a/plugins/StatusPlugins/StartupStatus/options.cpp
+++ b/plugins/StatusPlugins/StartupStatus/options.cpp
@@ -29,7 +29,6 @@ INT_PTR CALLBACK CmdlOptionsDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM l
INT_PTR CALLBACK OptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam);
INT_PTR CALLBACK addProfileDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam);
-BOOL MyGetSpecialFolderPath(HWND hwndOwner, LPTSTR lpszPath, int nFolder, BOOL fCreate);
static int CountSettings(const char *szSetting,LPARAM lParam);
static int DeleteSetting(const char *szSetting,LPARAM lParam);
static int ClearDatabase(char* filter);
@@ -173,7 +172,7 @@ HRESULT CreateLink(TSettingsList& protoSettings)
char *args = GetCMDLArguments(protoSettings);
char *desc = GetLinkDescription(protoSettings);
- if (MyGetSpecialFolderPath(NULL, savePath, 0x10, FALSE))
+ if (SHGetSpecialFolderPath(NULL, savePath, 0x10, FALSE))
_tcscat(savePath, _T(SHORTCUT_FILENAME));
else
mir_sntprintf(savePath, SIZEOF(savePath), _T(".\\%s"), _T(SHORTCUT_FILENAME));
@@ -925,29 +924,6 @@ int OptionsInit(WPARAM wparam,LPARAM lparam)
return 0;
}
-// from: http://www.codeproject.com/winhelp/msdnintegrator/
-
- static const CHAR _szSpecialFolderPath[] = "SHGetSpecialFolderPathW";
-
-BOOL MyGetSpecialFolderPath(HWND hwndOwner, LPTSTR lpszPath, int nFolder, BOOL fCreate)
-{
- typedef int (WINAPI* _SHGET)(HWND, LPTSTR, int, BOOL);
-
- // Get a function pointer to SHGetSpecialFolderPath(...) from
- // Shell32.dll, if this returns NULL then check ShFolder.dll...
- _SHGET pfn = (_SHGET)GetProcAddress( LoadLibraryA( "Shell32.dll" ), _szSpecialFolderPath);
- if (pfn == NULL) {
- // Try to get the function pointer from ShFolder.dll, if pfn is still
- // NULL then we have bigger problems...
- pfn = (_SHGET)GetProcAddress( LoadLibraryA("ShFolder.dll"), _szSpecialFolderPath);
- if (pfn == NULL)
- return FALSE;
- }
-
- return pfn(hwndOwner, lpszPath, nFolder, fCreate);
-}
-
-// end: from: http://www.codeproject.com/winhelp/msdnintegrator/
static int ClearDatabase(char* filter)
{
DBCONTACTENUMSETTINGS dbces;