summaryrefslogtreecommitdiff
path: root/plugins/!NotAdopted/Skype/skype.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/!NotAdopted/Skype/skype.c')
-rwxr-xr-xplugins/!NotAdopted/Skype/skype.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/plugins/!NotAdopted/Skype/skype.c b/plugins/!NotAdopted/Skype/skype.c
index 1210b503c4..39a8c0c47f 100755
--- a/plugins/!NotAdopted/Skype/skype.c
+++ b/plugins/!NotAdopted/Skype/skype.c
@@ -3290,7 +3290,7 @@ int __declspec(dllexport) Load()
HKEY MyKey;
BOOL SkypeInstalled;
BOOL UseCustomCommand;
- WSADATA wsaData;
+ WSADATA wsaData = {0};
char path[MAX_PATH];
mir_getLP(&pluginInfo);
@@ -3345,24 +3345,35 @@ int __declspec(dllexport) Load()
if (!UseSockets && !UseCustomCommand)
{
+ BOOL is_key_opened = FALSE;
if (RegOpenKeyEx(HKEY_CURRENT_USER, _T("Software\\Skype\\Phone"), 0, KEY_READ, &MyKey)!=ERROR_SUCCESS)
{
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Software\\Skype\\Phone"), 0, KEY_READ, &MyKey)!=ERROR_SUCCESS)
{
SkypeInstalled=FALSE;
}
+ else
+ is_key_opened = TRUE;
}
+ else
+ is_key_opened = TRUE;
Buffsize=sizeof(skype_path);
- if (SkypeInstalled==FALSE || RegQueryValueExA(MyKey, "SkypePath", NULL, NULL, (unsigned char *)skype_path, &Buffsize)!=ERROR_SUCCESS)
+ if(is_key_opened)
{
- //OUTPUT("Skype was not found installed :( \nMaybe you are using portable skype.");
+ if (SkypeInstalled==FALSE)
+ skype_path[0]=0;
+ else if (RegQueryValueExA(MyKey, "SkypePath", NULL, NULL, (unsigned char *)skype_path, &Buffsize)!=ERROR_SUCCESS)
+ {
+ //OUTPUT("Skype was not found installed :( \nMaybe you are using portable skype.");
RegCloseKey(MyKey);
skype_path[0]=0;
//return 0;
+ }
+ else
+ RegCloseKey(MyKey);
}
- RegCloseKey(MyKey);
}
WSAStartup(MAKEWORD(2,2), &wsaData);