From 00d71971d9cf831b991d391bb073dd846a15855f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 13 Jun 2018 14:14:35 +0300 Subject: profile lock detection unbound from contact list services --- include/m_database.h | 4 +++- include/m_db_int.h | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/m_database.h b/include/m_database.h index 651a0a3b0a..8f7e974b40 100644 --- a/include/m_database.h +++ b/include/m_database.h @@ -458,9 +458,11 @@ EXTERN_C MIR_APP_DLL(int) Profile_GetPathW(size_t cbLen, wchar_t *pwszDest); // Sets the default profile name programmatically // Analog of Database/DefaultProfile in mirandaboot.ini - EXTERN_C MIR_APP_DLL(void) Profile_SetDefault(const wchar_t *pwszPath); +// Checks if a profile is opened +EXTERN_C MIR_APP_DLL(bool) Profile_CheckOpened(const wchar_t *pwszProfileName); + ///////////////////////////////////////////////////////////////////////////////////////// // Contact services diff --git a/include/m_db_int.h b/include/m_db_int.h index f32439c213..d0b66e8f25 100644 --- a/include/m_db_int.h +++ b/include/m_db_int.h @@ -133,6 +133,7 @@ interface MIR_APP_EXPORT MIDatabase class MIR_APP_EXPORT MDatabaseCommon : public MIDatabase { + HANDLE m_hLock; protected: int m_codePage; @@ -142,7 +143,9 @@ protected: MIDatabaseCache* m_cache; protected: - int CheckProto(DBCachedContact *cc, const char *proto); + bool LockName(const wchar_t *pwszProfileName); + int CheckProto(DBCachedContact *cc, const char *proto); + void UnlockName(); STDMETHOD_(BOOL, GetContactSettingWorker)(MCONTACT contactID, LPCSTR szModule, LPCSTR szSetting, DBVARIANT *dbv, int isStatic) PURE; -- cgit v1.2.3