diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-11 19:06:07 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-11 19:06:07 +0000 |
commit | e521cf5548352e7a443241e10614f97bc9630a2c (patch) | |
tree | f42e46cf4eb5bd7d994cd3eefa74856dc539d04f | |
parent | e498e2e961e0edf547cbc478797e69ec8a8d42d4 (diff) |
- more transparent ProtoServiceExists implementation;
- ProtoServiceExists moved from mir_core into miranda32.exe;
- miranda32.def is used again to define the order of functions precisely;
- libraries updated
git-svn-id: http://svn.miranda-ng.org/main/trunk@14118 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | bin10/lib/Miranda32.lib | bin | 5450 -> 5364 bytes | |||
-rw-r--r-- | bin10/lib/Miranda64.lib | bin | 5312 -> 5288 bytes | |||
-rw-r--r-- | bin10/lib/mir_core.lib | bin | 385830 -> 385816 bytes | |||
-rw-r--r-- | bin10/lib/mir_core64.lib | bin | 388906 -> 388906 bytes | |||
-rw-r--r-- | bin12/lib/Miranda32.lib | bin | 5450 -> 5364 bytes | |||
-rw-r--r-- | bin12/lib/Miranda64.lib | bin | 5312 -> 5288 bytes | |||
-rw-r--r-- | bin12/lib/mir_core.lib | bin | 385830 -> 385816 bytes | |||
-rw-r--r-- | bin12/lib/mir_core64.lib | bin | 388906 -> 388906 bytes | |||
-rw-r--r-- | include/m_core.h | 15 | ||||
-rw-r--r-- | src/core/miranda.h | 4 | ||||
-rw-r--r-- | src/core/stdplug.h | 2 | ||||
-rw-r--r-- | src/mir_core/src/protos.cpp | 13 | ||||
-rw-r--r-- | src/miranda32.def | 1 | ||||
-rw-r--r-- | src/miranda32_10.vcxproj | 2 | ||||
-rw-r--r-- | src/miranda32_12.vcxproj | 2 | ||||
-rw-r--r-- | src/modules/protocols/protocols.cpp | 21 |
16 files changed, 35 insertions, 25 deletions
diff --git a/bin10/lib/Miranda32.lib b/bin10/lib/Miranda32.lib Binary files differindex 778adec2a8..8aad2f9a60 100644 --- a/bin10/lib/Miranda32.lib +++ b/bin10/lib/Miranda32.lib diff --git a/bin10/lib/Miranda64.lib b/bin10/lib/Miranda64.lib Binary files differindex a3af3a24d9..8d77f2648a 100644 --- a/bin10/lib/Miranda64.lib +++ b/bin10/lib/Miranda64.lib diff --git a/bin10/lib/mir_core.lib b/bin10/lib/mir_core.lib Binary files differindex 0ce31a55de..1c78b841ee 100644 --- a/bin10/lib/mir_core.lib +++ b/bin10/lib/mir_core.lib diff --git a/bin10/lib/mir_core64.lib b/bin10/lib/mir_core64.lib Binary files differindex 60b35cbd18..925dde519b 100644 --- a/bin10/lib/mir_core64.lib +++ b/bin10/lib/mir_core64.lib diff --git a/bin12/lib/Miranda32.lib b/bin12/lib/Miranda32.lib Binary files differindex 182f7b1bab..8aad2f9a60 100644 --- a/bin12/lib/Miranda32.lib +++ b/bin12/lib/Miranda32.lib diff --git a/bin12/lib/Miranda64.lib b/bin12/lib/Miranda64.lib Binary files differindex 2b946376fc..8d77f2648a 100644 --- a/bin12/lib/Miranda64.lib +++ b/bin12/lib/Miranda64.lib diff --git a/bin12/lib/mir_core.lib b/bin12/lib/mir_core.lib Binary files differindex 4c46d16ccf..7d5b67bdb6 100644 --- a/bin12/lib/mir_core.lib +++ b/bin12/lib/mir_core.lib diff --git a/bin12/lib/mir_core64.lib b/bin12/lib/mir_core64.lib Binary files differindex 8157d04337..9ea396afea 100644 --- a/bin12/lib/mir_core64.lib +++ b/bin12/lib/mir_core64.lib diff --git a/include/m_core.h b/include/m_core.h index ad4e1fe3cb..1d5639ed75 100644 --- a/include/m_core.h +++ b/include/m_core.h @@ -113,10 +113,8 @@ MIR_CORE_DLL(int) CallFunctionAsync(void (__stdcall *func)(void *), void *ar MIR_CORE_DLL(void) KillModuleServices(HINSTANCE hInst);
MIR_CORE_DLL(void) KillObjectServices(void* pObject);
-#if defined(_STATIC)
-__declspec(dllexport) INT_PTR CallContactService(MCONTACT, const char *, WPARAM, LPARAM);
-__declspec(dllexport) INT_PTR CallProtoService(LPCSTR szModule, const char *szService, WPARAM wParam, LPARAM lParam);
-#else
+#if !defined(_STATIC)
+MIR_C_CORE_DLL(int) ProtoServiceExists(LPCSTR szModule, const char *szService);
MIR_C_CORE_DLL(INT_PTR) CallContactService(MCONTACT, const char *, WPARAM, LPARAM);
MIR_C_CORE_DLL(INT_PTR) CallProtoService(LPCSTR szModule, const char *szService, WPARAM wParam, LPARAM lParam);
#endif
@@ -262,11 +260,11 @@ MIR_CORE_DLL(void) List_ObjCopy(SortedList* s, SortedList* d, size_t item MIR_CORE_DLL(HANDLE) mir_createLog(const char *pszName, const TCHAR *ptszDescr, const TCHAR *ptszFile, unsigned options);
MIR_CORE_DLL(void) mir_closeLog(HANDLE hLogger);
-MIR_C_CORE_DLL(int) mir_writeLogA(HANDLE hLogger, const char *format, ...);
-MIR_C_CORE_DLL(int) mir_writeLogW(HANDLE hLogger, const wchar_t *format, ...);
+MIR_C_CORE_DLL(int) mir_writeLogA(HANDLE hLogger, const char *format, ...);
+MIR_C_CORE_DLL(int) mir_writeLogW(HANDLE hLogger, const wchar_t *format, ...);
-MIR_CORE_DLL(int) mir_writeLogVA(HANDLE hLogger, const char *format, va_list args);
-MIR_CORE_DLL(int) mir_writeLogVW(HANDLE hLogger, const wchar_t *format, va_list args);
+MIR_CORE_DLL(int) mir_writeLogVA(HANDLE hLogger, const char *format, va_list args);
+MIR_CORE_DLL(int) mir_writeLogVW(HANDLE hLogger, const wchar_t *format, va_list args);
///////////////////////////////////////////////////////////////////////////////
// md5 functions
@@ -369,7 +367,6 @@ MIR_CORE_DLL(int) mir_vsnwprintf(wchar_t *buffer, size_t count, const wchar_t struct PROTO_INTERFACE;
-MIR_CORE_DLL(int) ProtoServiceExists(LPCSTR szModule, const char *szService);
MIR_CORE_DLL(INT_PTR) ProtoBroadcastAck(LPCSTR szModule, MCONTACT hContact, int type, int result, HANDLE hProcess, LPARAM lParam);
// Call it in the very beginning of your proto's constructor
diff --git a/src/core/miranda.h b/src/core/miranda.h index 5d31e64aed..ba8516baf1 100644 --- a/src/core/miranda.h +++ b/src/core/miranda.h @@ -183,4 +183,8 @@ extern "C" MIR_CORE_DLL(void) db_setCurrent(MIDatabase* _db);
MIR_CORE_DLL(PROTOCOLDESCRIPTOR*) Proto_RegisterModule(PROTOCOLDESCRIPTOR *pd);
+
+ int ProtoServiceExists(LPCSTR szModule, const char *szService);
+ INT_PTR CallContactService(MCONTACT, const char *, WPARAM, LPARAM);
+ INT_PTR CallProtoService(LPCSTR szModule, const char *szService, WPARAM wParam, LPARAM lParam);
};
diff --git a/src/core/stdplug.h b/src/core/stdplug.h index ef65298258..9a6f751829 100644 --- a/src/core/stdplug.h +++ b/src/core/stdplug.h @@ -1,6 +1,6 @@ #ifdef _STATIC
- #define MIRANDA_EXE_FUNC(T) extern "C" T __declspec(dllexport)
+ #define MIRANDA_EXE_FUNC(T) extern "C" T
#else
#define MIRANDA_EXE_FUNC(T) extern "C" T __declspec(dllimport)
#endif
diff --git a/src/mir_core/src/protos.cpp b/src/mir_core/src/protos.cpp index 154ff2ad26..051e5a9792 100644 --- a/src/mir_core/src/protos.cpp +++ b/src/mir_core/src/protos.cpp @@ -99,19 +99,6 @@ MIR_CORE_DLL(INT_PTR) ProtoBroadcastAck(const char *szModule, MCONTACT hContact, /////////////////////////////////////////////////////////////////////////////////////////
-MIR_CORE_DLL(int) ProtoServiceExists(const char *szModule, const char *szService)
-{
- if (szModule == NULL || szService == NULL)
- return false;
-
- char str[MAXMODULELABELLENGTH * 2];
- strncpy_s(str, szModule, _TRUNCATE);
- strncat_s(str, szService, _TRUNCATE);
- return ServiceExists(str);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
MIR_CORE_DLL(void) ProtoConstructor(PROTO_INTERFACE *pThis, LPCSTR pszModuleName, LPCTSTR ptszUserName)
{
pThis->m_iVersion = 2;
diff --git a/src/miranda32.def b/src/miranda32.def index c36a1b6fc4..207032d84a 100644 --- a/src/miranda32.def +++ b/src/miranda32.def @@ -16,3 +16,4 @@ IcoLib_ReleaseIcon @13 Window_FreeIcon_IcoLib @14
Window_SetIcon_IcoLib @15
Window_SetProtoIcon_IcoLib @16
+ProtoServiceExists @17
diff --git a/src/miranda32_10.vcxproj b/src/miranda32_10.vcxproj index 157ff16114..0b94c03baa 100644 --- a/src/miranda32_10.vcxproj +++ b/src/miranda32_10.vcxproj @@ -142,6 +142,7 @@ <AdditionalLibraryDirectories>$(ProfileDir)..\bin10\lib</AdditionalLibraryDirectories>
<AdditionalOptions>/PDBALTPATH:%_PDB%</AdditionalOptions>
<BaseAddress>0x400000</BaseAddress>
+ <ModuleDefinitionFile>miranda32.def</ModuleDefinitionFile>
</Link>
<Manifest>
<AdditionalManifestFiles>miranda32.exe.manifest</AdditionalManifestFiles>
@@ -208,6 +209,7 @@ <AdditionalLibraryDirectories>$(SolutionDir)\lib</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(ProfileDir)..\bin10\lib</AdditionalLibraryDirectories>
<BaseAddress>0x400000</BaseAddress>
+ <ModuleDefinitionFile>miranda32.def</ModuleDefinitionFile>
</Link>
<Manifest>
<AdditionalManifestFiles>miranda32.exe.manifest</AdditionalManifestFiles>
diff --git a/src/miranda32_12.vcxproj b/src/miranda32_12.vcxproj index 7d514d96d8..2bbabfb35d 100644 --- a/src/miranda32_12.vcxproj +++ b/src/miranda32_12.vcxproj @@ -145,6 +145,7 @@ <AdditionalLibraryDirectories>$(SolutionDir)\lib</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(ProfileDir)..\bin12\lib</AdditionalLibraryDirectories>
<BaseAddress>0x400000</BaseAddress>
+ <ModuleDefinitionFile>miranda32.def</ModuleDefinitionFile>
</Link>
<Manifest>
<AdditionalManifestFiles>miranda32.exe.manifest</AdditionalManifestFiles>
@@ -212,6 +213,7 @@ <AdditionalLibraryDirectories>$(SolutionDir)\lib</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(ProfileDir)..\bin12\lib</AdditionalLibraryDirectories>
<BaseAddress>0x400000</BaseAddress>
+ <ModuleDefinitionFile>miranda32.def</ModuleDefinitionFile>
</Link>
<Manifest>
<AdditionalManifestFiles>miranda32.exe.manifest</AdditionalManifestFiles>
diff --git a/src/modules/protocols/protocols.cpp b/src/modules/protocols/protocols.cpp index c1eff7848e..273fb85dd9 100644 --- a/src/modules/protocols/protocols.cpp +++ b/src/modules/protocols/protocols.cpp @@ -100,9 +100,9 @@ INT_PTR srvProto_IsLoaded(WPARAM, LPARAM lParam) return (INT_PTR)Proto_IsProtocolLoaded((char*)lParam);
}
-static PROTO_INTERFACE* defInitProto(const char* szModuleName, const TCHAR*)
+static PROTO_INTERFACE* defInitProto(const char* szModule, const TCHAR*)
{
- return AddDefaultAccount(szModuleName);
+ return AddDefaultAccount(szModule);
}
static INT_PTR srvProto_RegisterModule(WPARAM, LPARAM lParam)
@@ -366,6 +366,23 @@ static INT_PTR Proto_BroadcastAck(WPARAM, LPARAM lParam) /////////////////////////////////////////////////////////////////////////////////////////
+int ProtoServiceExists(const char *szModule, const char *szService)
+{
+ if (szModule == NULL || szService == NULL)
+ return false;
+
+ TServiceListItem *item = (TServiceListItem*)bsearch(&szService, serviceItems, _countof(serviceItems), sizeof(serviceItems[0]), CompareServiceItems);
+ if (item != NULL)
+ return true;
+
+ char str[MAXMODULELABELLENGTH * 2];
+ strncpy_s(str, szModule, _TRUNCATE);
+ strncat_s(str, szService, _TRUNCATE);
+ return ServiceExists(str);
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
INT_PTR CallProtoService(const char* szModule, const char* szService, WPARAM wParam, LPARAM lParam)
{
return CallProtoServiceInt(NULL, szModule, szService, wParam, lParam);
|