summaryrefslogtreecommitdiff
path: root/plugins/YAMN/yamn.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-05-27 16:05:18 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-05-27 16:05:18 +0000
commitc5e9ee462edc701924e0b378df1404759f9ee0fb (patch)
tree714ea38805adcef600ac02f021a726169ff31718 /plugins/YAMN/yamn.cpp
parent5c64f7b180825e9fa39a394a713de13765e50291 (diff)
YAMN adaptation for the modern Miranda
git-svn-id: http://svn.miranda-ng.org/main/trunk@198 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/YAMN/yamn.cpp')
-rw-r--r--plugins/YAMN/yamn.cpp222
1 files changed, 78 insertions, 144 deletions
diff --git a/plugins/YAMN/yamn.cpp b/plugins/YAMN/yamn.cpp
index 652ce01712..c1ffda847a 100644
--- a/plugins/YAMN/yamn.cpp
+++ b/plugins/YAMN/yamn.cpp
@@ -12,37 +12,6 @@
#include "m_synchro.h"
#include "main.h"
-//- imported ---------------------------------------------------------------------------------------
-//--------------------------------------------------------------------------------------------------
-
-extern PYAMN_PROTOPLUGINQUEUE FirstProtoPlugin;
-extern YAMN_VARIABLES YAMNVar;
-
-extern char *ProtoName;
-
-extern HANDLE hTTButton; //TopToolBar button
-
-extern DWORD WriteAccountsToFile();
-extern DWORD WINAPI SWMRGWaitToRead(PSWMRG,DWORD);
-extern void WINAPI SWMRGDoneReading(PSWMRG);
-extern DWORD WINAPI WaitToReadFcn(PSWMRG);
-extern void WINAPI ReadDoneFcn(PSWMRG);
-
-//From protoplugin.cpp
-extern struct CExportedFunctions ProtoPluginExportedFcn[1];
-extern struct CExportedServices ProtoPluginExportedSvc[5];
-//From filterplugin.cpp
-extern struct CExportedFunctions FilterPluginExportedFcn[1];
-extern struct CExportedServices FilterPluginExportedSvc[2];
-//From synchro.cpp
-extern struct CExportedFunctions SynchroExportedFcn[7];
-//From account.cpp
-extern struct CExportedFunctions AccountExportedFcn[2];
-extern struct CExportedServices AccountExportedSvc[9];
-//From mails.cpp (MIME)
-extern struct CExportedFunctions MailExportedFcn[8];
-extern struct CExportedServices MailExportedSvc[5];
-
//--------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------
@@ -64,21 +33,18 @@ HANDLE ExitEV;
HANDLE WriteToFileEV;
//Returns pointer to YAMN exported function
-INT_PTR GetFcnPtrSvc(WPARAM wParam,LPARAM lParam);
+INT_PTR GetFcnPtrSvc(WPARAM wParam, LPARAM lParam);
//Returns pointer to YAMN variables
-INT_PTR GetVariablesSvc(WPARAM wParam,LPARAM);
-
-// Thread running only to catch hotkeys
-DWORD WINAPI YAMNHotKeyThread(LPVOID Param);
+INT_PTR GetVariablesSvc(WPARAM wParam, LPARAM);
// Function every seconds decrements account counter of seconds and checks if they are 0
// If yes, creates a POP3 thread to check account
-void CALLBACK TimerProc(HWND,UINT,UINT,DWORD);
+void CALLBACK TimerProc(HWND, UINT, UINT, DWORD);
// Function called to check all accounts immidialtelly
// no params
-INT_PTR ForceCheckSvc(WPARAM,LPARAM);
+INT_PTR ForceCheckSvc(WPARAM, LPARAM);
//thread is running all the time
//waits for WriteToFileEV and then writes all accounts to file
@@ -90,128 +56,94 @@ INT_PTR ForceCheckSvc(WPARAM,LPARAM);
//not used now, perhaps in the future
-//int ExitProc(WPARAM wParam,LPARAM lParam);
+//int ExitProc(WPARAM wParam, LPARAM lParam);
//--------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------
-INT_PTR GetFcnPtrSvc(WPARAM wParam,LPARAM lParam)
+INT_PTR GetFcnPtrSvc(WPARAM wParam, LPARAM lParam)
{
register int i;
- for(i=0;i<sizeof(ProtoPluginExportedFcn)/sizeof(ProtoPluginExportedFcn[0]);i++)
- if (0==lstrcmpA((char *)wParam,ProtoPluginExportedFcn[i].ID))
+ for (i=0;i<sizeof(ProtoPluginExportedFcn)/sizeof(ProtoPluginExportedFcn[0]);i++)
+ if (0==lstrcmpA((char *)wParam, ProtoPluginExportedFcn[i].ID))
return (INT_PTR)ProtoPluginExportedFcn[i].Ptr;
- for(i=0;i<sizeof(ProtoPluginExportedSvc)/sizeof(ProtoPluginExportedSvc[0]);i++)
- if (0==lstrcmpA((char *)wParam,ProtoPluginExportedSvc[i].ID))
+ for (i=0;i<sizeof(ProtoPluginExportedSvc)/sizeof(ProtoPluginExportedSvc[0]);i++)
+ if (0==lstrcmpA((char *)wParam, ProtoPluginExportedSvc[i].ID))
return (INT_PTR)ProtoPluginExportedSvc[i].Ptr;
- for(i=0;i<sizeof(SynchroExportedFcn)/sizeof(SynchroExportedFcn[0]);i++)
- if (0==lstrcmpA((char *)wParam,SynchroExportedFcn[i].ID))
+ for (i=0;i<sizeof(SynchroExportedFcn)/sizeof(SynchroExportedFcn[0]);i++)
+ if (0==lstrcmpA((char *)wParam, SynchroExportedFcn[i].ID))
return (INT_PTR)SynchroExportedFcn[i].Ptr;
- for(i=0;i<sizeof(AccountExportedFcn)/sizeof(AccountExportedFcn[0]);i++)
- if (0==lstrcmpA((char *)wParam,AccountExportedFcn[i].ID))
+ for (i=0;i<sizeof(AccountExportedFcn)/sizeof(AccountExportedFcn[0]);i++)
+ if (0==lstrcmpA((char *)wParam, AccountExportedFcn[i].ID))
return (INT_PTR)AccountExportedFcn[i].Ptr;
- for(i=0;i<sizeof(AccountExportedSvc)/sizeof(AccountExportedSvc[0]);i++)
- if (0==lstrcmpA((char *)wParam,AccountExportedSvc[i].ID))
+ for (i=0;i<sizeof(AccountExportedSvc)/sizeof(AccountExportedSvc[0]);i++)
+ if (0==lstrcmpA((char *)wParam, AccountExportedSvc[i].ID))
return (INT_PTR)AccountExportedSvc[i].Ptr;
- for(i=0;i<sizeof(MailExportedFcn)/sizeof(MailExportedFcn[0]);i++)
- if (0==lstrcmpA((char *)wParam,MailExportedFcn[i].ID))
+ for (i=0;i<sizeof(MailExportedFcn)/sizeof(MailExportedFcn[0]);i++)
+ if (0==lstrcmpA((char *)wParam, MailExportedFcn[i].ID))
return (INT_PTR)MailExportedFcn[i].Ptr;
- for(i=0;i<sizeof(MailExportedSvc)/sizeof(MailExportedSvc[0]);i++)
- if (0==lstrcmpA((char *)wParam,MailExportedSvc[i].ID))
+ for (i=0;i<sizeof(MailExportedSvc)/sizeof(MailExportedSvc[0]);i++)
+ if (0==lstrcmpA((char *)wParam, MailExportedSvc[i].ID))
return (INT_PTR)MailExportedSvc[i].Ptr;
- for(i=0;i<sizeof(FilterPluginExportedFcn)/sizeof(FilterPluginExportedFcn[0]);i++)
- if (0==lstrcmpA((char *)wParam,FilterPluginExportedFcn[i].ID))
+ for (i=0;i<sizeof(FilterPluginExportedFcn)/sizeof(FilterPluginExportedFcn[0]);i++)
+ if (0==lstrcmpA((char *)wParam, FilterPluginExportedFcn[i].ID))
return (INT_PTR)FilterPluginExportedFcn[i].Ptr;
- for(i=0;i<sizeof(FilterPluginExportedSvc)/sizeof(FilterPluginExportedSvc[0]);i++)
- if (0==lstrcmpA((char *)wParam,FilterPluginExportedSvc[i].ID))
+ for (i=0;i<sizeof(FilterPluginExportedSvc)/sizeof(FilterPluginExportedSvc[0]);i++)
+ if (0==lstrcmpA((char *)wParam, FilterPluginExportedSvc[i].ID))
return (INT_PTR)FilterPluginExportedSvc[i].Ptr;
return (INT_PTR)NULL;
}
-INT_PTR GetVariablesSvc(WPARAM wParam,LPARAM)
+INT_PTR GetVariablesSvc(WPARAM wParam, LPARAM)
{
return wParam==YAMN_VARIABLESVERSION ? (INT_PTR)&YAMNVar : (INT_PTR)NULL;
}
-DWORD WINAPI YAMNHotKeyThread(LPVOID Param)
-{
- MSG WinMessage;
- WORD HotKey = LOWORD(Param);
- int HotKeyID;
-
-// register hotkey for main YAMN thread first
- if (!(HotKeyID=RegisterHotKey(NULL,(int)GlobalAddAtomA(YAMN_HKCHECKMAIL),HIBYTE(HotKey),LOBYTE(HotKey))))
- return 0;
-
- while(1)
- {
- GetMessage(&WinMessage,NULL,WM_HOTKEY,WM_YAMN_CHANGEHOTKEY);
-
-// if we want to close miranda, we get event and do not run pop3 checking anymore
- if (WAIT_OBJECT_0==WaitForSingleObject(ExitEV,0))
- break;
-
- switch(WinMessage.message)
- {
-// user pressed hotkey
- case WM_HOTKEY:
- ForceCheckSvc((WPARAM)0,(LPARAM)0);
- break;
-// hotkey changed
- case WM_YAMN_CHANGEHOTKEY:
- UnregisterHotKey(NULL,HotKeyID);
- HotKeyID=RegisterHotKey(NULL,(int)GlobalAddAtomA(YAMN_HKCHECKMAIL),WinMessage.wParam,WinMessage.lParam);
- break;
- }
- }
- return 1;
-}
-
-void CALLBACK TimerProc(HWND,UINT,UINT,DWORD)
+void CALLBACK TimerProc(HWND, UINT, UINT, DWORD)
{
PYAMN_PROTOPLUGINQUEUE ActualPlugin;
HACCOUNT ActualAccount;
HANDLE ThreadRunningEV;
- DWORD Status,tid;
+ DWORD Status, tid;
// we use event to signal, that running thread has all needed stack parameters copied
- if (NULL==(ThreadRunningEV=CreateEvent(NULL,FALSE,FALSE,NULL)))
+ if (NULL==(ThreadRunningEV=CreateEvent(NULL, FALSE, FALSE, NULL)))
return;
// if we want to close miranda, we get event and do not run checking anymore
- if (WAIT_OBJECT_0==WaitForSingleObject(ExitEV,0))
+ if (WAIT_OBJECT_0==WaitForSingleObject(ExitEV, 0))
return;
// Get actual status of current user in Miranda
- Status=CallService(MS_CLIST_GETSTATUSMODE,0,0);
+ Status=CallService(MS_CLIST_GETSTATUSMODE, 0, 0);
EnterCriticalSection(&PluginRegCS);
- for(ActualPlugin=FirstProtoPlugin;ActualPlugin!=NULL;ActualPlugin=ActualPlugin->Next)
+ for (ActualPlugin=FirstProtoPlugin;ActualPlugin!=NULL;ActualPlugin=ActualPlugin->Next)
{
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"TimerProc:AccountBrowserSO-read wait\n");
+ DebugLog(SynchroFile, "TimerProc:AccountBrowserSO-read wait\n");
#endif
- if (WAIT_OBJECT_0!=SWMRGWaitToRead(ActualPlugin->Plugin->AccountBrowserSO,0)) //we want to access accounts immiadtelly
+ if (WAIT_OBJECT_0!=SWMRGWaitToRead(ActualPlugin->Plugin->AccountBrowserSO, 0)) //we want to access accounts immiadtelly
{
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"TimerProc:AccountBrowserSO-read enter failed\n");
+ DebugLog(SynchroFile, "TimerProc:AccountBrowserSO-read enter failed\n");
#endif
LeaveCriticalSection(&PluginRegCS);
return;
}
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"TimerProc:AccountBrowserSO-read enter\n");
+ DebugLog(SynchroFile, "TimerProc:AccountBrowserSO-read enter\n");
#endif
- for(ActualAccount=ActualPlugin->Plugin->FirstAccount;ActualAccount!=NULL;ActualAccount=ActualAccount->Next)
+ for (ActualAccount=ActualPlugin->Plugin->FirstAccount;ActualAccount!=NULL;ActualAccount=ActualAccount->Next)
{
if (ActualAccount->Plugin==NULL || ActualAccount->Plugin->Fcn==NULL) //account not inited
continue;
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"TimerProc:ActualAccountSO-read wait\n");
+ DebugLog(SynchroFile, "TimerProc:ActualAccountSO-read wait\n");
#endif
- if (WAIT_OBJECT_0!=SWMRGWaitToRead(ActualAccount->AccountAccessSO,0))
+ if (WAIT_OBJECT_0!=SWMRGWaitToRead(ActualAccount->AccountAccessSO, 0))
{
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"TimerProc:ActualAccountSO-read wait failed\n");
+ DebugLog(SynchroFile, "TimerProc:ActualAccountSO-read wait failed\n");
#endif
continue;
}
@@ -220,37 +152,37 @@ void CALLBACK TimerProc(HWND,UINT,UINT,DWORD)
switch(Status)
{
case ID_STATUS_OFFLINE:
- DebugLog(SynchroFile,"TimerProc:ActualAccountSO-read enter status offline\n");
+ DebugLog(SynchroFile, "TimerProc:ActualAccountSO-read enter status offline\n");
break;
case ID_STATUS_ONLINE:
- DebugLog(SynchroFile,"TimerProc:ActualAccountSO-read enter status online\n");
+ DebugLog(SynchroFile, "TimerProc:ActualAccountSO-read enter status online\n");
break;
case ID_STATUS_AWAY:
- DebugLog(SynchroFile,"TimerProc:ActualAccountSO-read enter status away\n");
+ DebugLog(SynchroFile, "TimerProc:ActualAccountSO-read enter status away\n");
break;
case ID_STATUS_DND:
- DebugLog(SynchroFile,"TimerProc:ActualAccountSO-read enter status dnd\n");
+ DebugLog(SynchroFile, "TimerProc:ActualAccountSO-read enter status dnd\n");
break;
case ID_STATUS_NA:
- DebugLog(SynchroFile,"TimerProc:ActualAccountSO-read enter status na\n");
+ DebugLog(SynchroFile, "TimerProc:ActualAccountSO-read enter status na\n");
break;
case ID_STATUS_OCCUPIED:
- DebugLog(SynchroFile,"TimerProc:ActualAccountSO-read enter status occupied\n");
+ DebugLog(SynchroFile, "TimerProc:ActualAccountSO-read enter status occupied\n");
break;
case ID_STATUS_FREECHAT:
- DebugLog(SynchroFile,"TimerProc:ActualAccountSO-read enter status freechat\n");
+ DebugLog(SynchroFile, "TimerProc:ActualAccountSO-read enter status freechat\n");
break;
case ID_STATUS_INVISIBLE:
- DebugLog(SynchroFile,"TimerProc:ActualAccountSO-read enter status invisible\n");
+ DebugLog(SynchroFile, "TimerProc:ActualAccountSO-read enter status invisible\n");
break;
case ID_STATUS_ONTHEPHONE:
- DebugLog(SynchroFile,"TimerProc:ActualAccountSO-read enter status onthephone\n");
+ DebugLog(SynchroFile, "TimerProc:ActualAccountSO-read enter status onthephone\n");
break;
case ID_STATUS_OUTTOLUNCH:
- DebugLog(SynchroFile,"TimerProc:ActualAccountSO-read enter status outtolunch\n");
+ DebugLog(SynchroFile, "TimerProc:ActualAccountSO-read enter status outtolunch\n");
break;
default:
- DebugLog(SynchroFile,"TimerProc:ActualAccountSO-read enter status unknown\n");
+ DebugLog(SynchroFile, "TimerProc:ActualAccountSO-read enter status unknown\n");
break;
}
#endif
@@ -278,26 +210,26 @@ void CALLBACK TimerProc(HWND,UINT,UINT,DWORD)
isAccountCounting = TRUE;
}
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"TimerProc:time left : %i\n",ActualAccount->TimeLeft);
+ DebugLog(SynchroFile, "TimerProc:time left : %i\n", ActualAccount->TimeLeft);
#endif
- WindowList_BroadcastAsync(YAMNVar.MessageWnds,WM_YAMN_CHANGETIME,(WPARAM)ActualAccount,(LPARAM)ActualAccount->TimeLeft);
+ WindowList_BroadcastAsync(YAMNVar.MessageWnds, WM_YAMN_CHANGETIME, (WPARAM)ActualAccount, (LPARAM)ActualAccount->TimeLeft);
if (!ActualAccount->TimeLeft)
{
- struct CheckParam ParamToPlugin={YAMN_CHECKVERSION,ThreadRunningEV,ActualAccount,YAMN_NORMALCHECK,(void *)0,NULL};
+ struct CheckParam ParamToPlugin={YAMN_CHECKVERSION, ThreadRunningEV, ActualAccount, YAMN_NORMALCHECK, (void *)0, NULL};
HANDLE NewThread;
ActualAccount->TimeLeft=ActualAccount->Interval;
- if (NULL==(NewThread=CreateThread(NULL,0,(YAMN_STANDARDFCN)ActualAccount->Plugin->Fcn->TimeoutFcnPtr,&ParamToPlugin,0,&tid)))
+ if (NULL==(NewThread=CreateThread(NULL, 0, (YAMN_STANDARDFCN)ActualAccount->Plugin->Fcn->TimeoutFcnPtr, &ParamToPlugin, 0, &tid)))
{
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"TimerProc:ActualAccountSO-read done\n");
+ DebugLog(SynchroFile, "TimerProc:ActualAccountSO-read done\n");
#endif
ReadDoneFcn(ActualAccount->AccountAccessSO);
continue;
}
else
{
- WaitForSingleObject(ThreadRunningEV,INFINITE);
+ WaitForSingleObject(ThreadRunningEV, INFINITE);
CloseHandle(NewThread);
}
}
@@ -305,22 +237,22 @@ void CALLBACK TimerProc(HWND,UINT,UINT,DWORD)
}
ChangeIsCountingStatusLabel:
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"TimerProc:ActualAccountSO-read done\n");
+ DebugLog(SynchroFile, "TimerProc:ActualAccountSO-read done\n");
#endif
if (((ActualAccount->isCounting)!=0)!=isAccountCounting){
ActualAccount->isCounting=isAccountCounting;
- WORD cStatus = DBGetContactSettingWord(ActualAccount->hContact,ProtoName,"Status",0);
+ WORD cStatus = DBGetContactSettingWord(ActualAccount->hContact, YAMN_DBMODULE, "Status", 0);
switch (cStatus){
case ID_STATUS_ONLINE:
case ID_STATUS_OFFLINE:
- DBWriteContactSettingWord(ActualAccount->hContact, ProtoName, "Status", isAccountCounting?ID_STATUS_ONLINE:ID_STATUS_OFFLINE);
+ DBWriteContactSettingWord(ActualAccount->hContact, YAMN_DBMODULE, "Status", isAccountCounting?ID_STATUS_ONLINE:ID_STATUS_OFFLINE);
default: break;
}
}
ReadDoneFcn(ActualAccount->AccountAccessSO);
}
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"TimerProc:AccountBrowserSO-read done\n");
+ DebugLog(SynchroFile, "TimerProc:AccountBrowserSO-read done\n");
#endif
SWMRGDoneReading(ActualPlugin->Plugin->AccountBrowserSO);
}
@@ -329,7 +261,7 @@ ChangeIsCountingStatusLabel:
return;
}
-INT_PTR ForceCheckSvc(WPARAM,LPARAM)
+INT_PTR ForceCheckSvc(WPARAM, LPARAM)
{
PYAMN_PROTOPLUGINQUEUE ActualPlugin;
HACCOUNT ActualAccount;
@@ -337,37 +269,37 @@ INT_PTR ForceCheckSvc(WPARAM,LPARAM)
DWORD tid;
//we use event to signal, that running thread has all needed stack parameters copied
- if (NULL==(ThreadRunningEV=CreateEvent(NULL,FALSE,FALSE,NULL)))
+ if (NULL==(ThreadRunningEV=CreateEvent(NULL, FALSE, FALSE, NULL)))
return 0;
//if we want to close miranda, we get event and do not run pop3 checking anymore
- if (WAIT_OBJECT_0==WaitForSingleObject(ExitEV,0))
+ if (WAIT_OBJECT_0==WaitForSingleObject(ExitEV, 0))
return 0;
EnterCriticalSection(&PluginRegCS);
- for(ActualPlugin=FirstProtoPlugin;ActualPlugin!=NULL;ActualPlugin=ActualPlugin->Next)
+ for (ActualPlugin=FirstProtoPlugin;ActualPlugin!=NULL;ActualPlugin=ActualPlugin->Next)
{
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"ForceCheck:AccountBrowserSO-read wait\n");
+ DebugLog(SynchroFile, "ForceCheck:AccountBrowserSO-read wait\n");
#endif
- SWMRGWaitToRead(ActualPlugin->Plugin->AccountBrowserSO,INFINITE);
+ SWMRGWaitToRead(ActualPlugin->Plugin->AccountBrowserSO, INFINITE);
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"ForceCheck:AccountBrowserSO-read enter\n");
+ DebugLog(SynchroFile, "ForceCheck:AccountBrowserSO-read enter\n");
#endif
- for(ActualAccount=ActualPlugin->Plugin->FirstAccount;ActualAccount!=NULL;ActualAccount=ActualAccount->Next)
+ for (ActualAccount=ActualPlugin->Plugin->FirstAccount;ActualAccount!=NULL;ActualAccount=ActualAccount->Next)
{
if (ActualAccount->Plugin->Fcn==NULL) //account not inited
continue;
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"ForceCheck:ActualAccountSO-read wait\n");
+ DebugLog(SynchroFile, "ForceCheck:ActualAccountSO-read wait\n");
#endif
if (WAIT_OBJECT_0!=WaitToReadFcn(ActualAccount->AccountAccessSO))
{
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"ForceCheck:ActualAccountSO-read wait failed\n");
+ DebugLog(SynchroFile, "ForceCheck:ActualAccountSO-read wait failed\n");
#endif
continue;
}
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"ForceCheck:ActualAccountSO-read enter\n");
+ DebugLog(SynchroFile, "ForceCheck:ActualAccountSO-read enter\n");
#endif
if ((ActualAccount->Flags & YAMN_ACC_ENA) && (ActualAccount->StatusFlags & YAMN_ACC_FORCE)) //account cannot be forced to check
{
@@ -376,25 +308,27 @@ INT_PTR ForceCheckSvc(WPARAM,LPARAM)
ReadDoneFcn(ActualAccount->AccountAccessSO);
continue;
}
- struct CheckParam ParamToPlugin={YAMN_CHECKVERSION,ThreadRunningEV,ActualAccount,YAMN_FORCECHECK,(void *)0,NULL};
+ struct CheckParam ParamToPlugin={YAMN_CHECKVERSION, ThreadRunningEV, ActualAccount, YAMN_FORCECHECK, (void *)0, NULL};
- if (NULL==CreateThread(NULL,0,(YAMN_STANDARDFCN)ActualAccount->Plugin->Fcn->ForceCheckFcnPtr,&ParamToPlugin,0,&tid))
+ if (NULL==CreateThread(NULL, 0, (YAMN_STANDARDFCN)ActualAccount->Plugin->Fcn->ForceCheckFcnPtr, &ParamToPlugin, 0, &tid))
{
ReadDoneFcn(ActualAccount->AccountAccessSO);
continue;
}
else
- WaitForSingleObject(ThreadRunningEV,INFINITE);
+ WaitForSingleObject(ThreadRunningEV, INFINITE);
}
ReadDoneFcn(ActualAccount->AccountAccessSO);
}
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"ForceCheck:AccountBrowserSO-read done\n");
+ DebugLog(SynchroFile, "ForceCheck:AccountBrowserSO-read done\n");
#endif
SWMRGDoneReading(ActualPlugin->Plugin->AccountBrowserSO);
}
LeaveCriticalSection(&PluginRegCS);
CloseHandle(ThreadRunningEV);
- CallService(MS_TTB_SETBUTTONSTATE,(WPARAM)hTTButton,(LPARAM)TTBST_RELEASED);
+
+ if ( hTTButton ) CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)hTTButton, TTBST_RELEASED);
+ if ( hTButton ) CallService(MS_TB_SETBUTTONSTATE, (WPARAM)hTButton, TBST_RELEASED);
return 1;
}