summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorAlexander Gluzsky <sss123next@list.ru>2012-10-17 10:22:44 +0000
committerAlexander Gluzsky <sss123next@list.ru>2012-10-17 10:22:44 +0000
commitd60fbed343e32116dd85c4f756404a1be532a4fc (patch)
tree6dcbd46a5e7462db01889f575a4f1fe5bbd3b1e9 /plugins
parent92d7b0659edd025093f71e15a87bb1b8e5218aca (diff)
fixed startup crash
git-svn-id: http://svn.miranda-ng.org/main/trunk@1968 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-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);