summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/Exchange/src/MirandaExchange.h2
-rw-r--r--plugins/Exchange/src/commonheaders.h26
-rw-r--r--plugins/Exchange/src/services.cpp6
-rw-r--r--plugins/Exchange/src/services.h2
-rw-r--r--plugins/Exchange/src/utils.cpp6
5 files changed, 11 insertions, 31 deletions
diff --git a/plugins/Exchange/src/MirandaExchange.h b/plugins/Exchange/src/MirandaExchange.h
index 9644e69fdb..e4ca0b3ad8 100644
--- a/plugins/Exchange/src/MirandaExchange.h
+++ b/plugins/Exchange/src/MirandaExchange.h
@@ -231,7 +231,7 @@ private:
bool m_bNoInitAgain;
UINT m_nNumberOfHeaders;
- CRITICAL_SECTION m_myCritical;
+ mir_cs m_myCritical;
};
diff --git a/plugins/Exchange/src/commonheaders.h b/plugins/Exchange/src/commonheaders.h
index 656dc8af13..3fe791c0a1 100644
--- a/plugins/Exchange/src/commonheaders.h
+++ b/plugins/Exchange/src/commonheaders.h
@@ -28,38 +28,26 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define DEFAULT_RECONNECT_INTERVAL 10 //in minutes
#include <windows.h>
-//#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-
-#include "resource.h"
-
-#include "version.h"
-#include "utils.h"
-#include "emails.h"
-#include "services.h"
-#include "hooked_events.h"
-//#include "mirandaMem.h"
-
-//#include "forkthread.h"
-
#include <newpluginapi.h>
#include <m_core.h>
#include <m_popup.h>
#include <m_utils.h>
#include <m_system.h>
-//#include "m_skin.h"
+#include <m_system_cpp.h>
#include <m_options.h>
#include <m_clist.h>
#include <m_langpack.h>
-//#include "m_history.h"
-//#include "m_contacts.h"
-//#include "m_fontservice.h"
-
#include "m_utils.h"
-//#include "m_updater.h"
+#include "resource.h"
+#include "version.h"
+#include "utils.h"
+#include "emails.h"
+#include "services.h"
+#include "hooked_events.h"
extern char ModuleName[];
extern HINSTANCE hInstance;
diff --git a/plugins/Exchange/src/services.cpp b/plugins/Exchange/src/services.cpp
index e5999ac50a..c6a7beb665 100644
--- a/plugins/Exchange/src/services.cpp
+++ b/plugins/Exchange/src/services.cpp
@@ -21,21 +21,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "commonheaders.h"
#include "services.h"
-CRITICAL_SECTION csCheck;
-
int InitServices()
{
CreateServiceFunction(MS_EXCHANGE_CHECKEMAIL, (MIRANDASERVICE) CheckEmailService);
- InitializeCriticalSection(&csCheck);
-
return 0;
}
int DestroyServices()
{
DestroyServiceFunction(MS_EXCHANGE_CHECKEMAIL);
- DeleteCriticalSection(&csCheck);
-
return 0;
}
diff --git a/plugins/Exchange/src/services.h b/plugins/Exchange/src/services.h
index f1c549dedd..f445c69b42 100644
--- a/plugins/Exchange/src/services.h
+++ b/plugins/Exchange/src/services.h
@@ -23,8 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define MS_EXCHANGE_CHECKEMAIL "Exchange/CheckEmail"
-extern CRITICAL_SECTION csCheck;
-
int InitServices();
int DestroyServices();
diff --git a/plugins/Exchange/src/utils.cpp b/plugins/Exchange/src/utils.cpp
index 4a2ff20514..4208576f9f 100644
--- a/plugins/Exchange/src/utils.cpp
+++ b/plugins/Exchange/src/utils.cpp
@@ -23,6 +23,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define ___DEB
+mir_cs csCheck;
+
int LogInit()
{
#ifdef ___DEBUGG
@@ -201,7 +203,7 @@ RECT AnchorCalcPos(HWND window, const RECT *rParent, const WINDOWPOS *parentPos,
DWORD WINAPI CheckEmailWorkerThread(LPVOID data)
{
- EnterCriticalSection(&csCheck);
+ mir_cslock lck(csCheck);
int bForceAttempt = (int) data;
@@ -210,8 +212,6 @@ DWORD WINAPI CheckEmailWorkerThread(LPVOID data)
exchangeServer.Check(bForceAttempt);
- LeaveCriticalSection(&csCheck);
-
return 0;
}