diff options
author | George Hazan <george.hazan@gmail.com> | 2013-06-21 15:11:57 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-06-21 15:11:57 +0000 |
commit | 57edbfdb0eea5ca07e8052f576c52a4fd9398204 (patch) | |
tree | 4526cc40f58226f2c3e1c34afa9a25a04845c980 /src/modules/protocols | |
parent | 1c28535b64607096f699432e1de151f6e8f9983e (diff) |
fix for regression in rev. 5010
git-svn-id: http://svn.miranda-ng.org/main/trunk@5080 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/protocols')
-rw-r--r-- | src/modules/protocols/protocols.cpp | 5 | ||||
-rw-r--r-- | src/modules/protocols/protoint.cpp | 75 |
2 files changed, 36 insertions, 44 deletions
diff --git a/src/modules/protocols/protocols.cpp b/src/modules/protocols/protocols.cpp index 24aef1670e..426bf039fb 100644 --- a/src/modules/protocols/protocols.cpp +++ b/src/modules/protocols/protocols.cpp @@ -65,7 +65,6 @@ LIST<PROTOCOLDESCRIPTOR> filters(10, CompareProtos2); //------------------------------------------------------------------------------------
-INT_PTR __fastcall MyCallProtoService(const char *szModule, const char *szService, WPARAM wParam, LPARAM lParam);
void FreeFilesMatrix(TCHAR ***files);
PROTOCOLDESCRIPTOR* __fastcall Proto_IsProtocolLoaded(const char* szProtoName)
@@ -565,7 +564,7 @@ INT_PTR CallProtoServiceInt(HANDLE hContact, const char *szModule, const char *s psra->lastName = (PROTOCHAR*)mir_u2a(psr->lastName);
psra->email = (PROTOCHAR*)mir_u2a(psr->email);
- INT_PTR res = MyCallProtoService(szModule, szService, wParam, (LPARAM)psra);
+ INT_PTR res = ProtoCallService(szModule, szService, wParam, (LPARAM)psra);
mir_free(psra->nick);
mir_free(psra->firstName);
@@ -576,7 +575,7 @@ INT_PTR CallProtoServiceInt(HANDLE hContact, const char *szModule, const char *s }
}
- INT_PTR res = MyCallProtoService(szModule, szService, wParam, lParam);
+ INT_PTR res = ProtoCallService(szModule, szService, wParam, lParam);
if (res == CALLSERVICE_NOTFOUND && pa && pa->bOldProto && pa->ppro && strchr(szService, 'W')) {
TServiceListItem *item = serviceItems.find((TServiceListItem*)&szService);
diff --git a/src/modules/protocols/protoint.cpp b/src/modules/protocols/protoint.cpp index 1c80a97565..83c9d1dac5 100644 --- a/src/modules/protocols/protoint.cpp +++ b/src/modules/protocols/protoint.cpp @@ -44,53 +44,46 @@ void FreeFilesMatrix(TCHAR ***files) *files = NULL;
}
-INT_PTR __fastcall MyCallProtoService(const char *szModule, const char *szService, WPARAM wParam, LPARAM lParam)
-{
- char str[MAXMODULELABELLENGTH];
- mir_snprintf(str, sizeof(str), "%s%s", szModule, szService);
- return CallService(str, wParam, lParam);
-}
-
struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
{
HANDLE __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr)
{
- return (HANDLE)MyCallProtoService(m_szModuleName, PS_ADDTOLIST, flags, (LPARAM)psr);
+ return (HANDLE)ProtoCallService(m_szModuleName, PS_ADDTOLIST, flags, (LPARAM)psr);
}
HANDLE __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent)
{
- return (HANDLE)MyCallProtoService(m_szModuleName, PS_ADDTOLISTBYEVENT, MAKELONG(flags, iContact), (LPARAM)hDbEvent);
+ return (HANDLE)ProtoCallService(m_szModuleName, PS_ADDTOLISTBYEVENT, MAKELONG(flags, iContact), (LPARAM)hDbEvent);
}
int __cdecl Authorize(HANDLE hContact)
{
- return (int)MyCallProtoService(m_szModuleName, PS_AUTHALLOW, (WPARAM)hContact, 0);
+ return (int)ProtoCallService(m_szModuleName, PS_AUTHALLOW, (WPARAM)hContact, 0);
}
int __cdecl AuthDeny(HANDLE hContact, const TCHAR* szReason)
{
- return (int)MyCallProtoService(m_szModuleName, PS_AUTHDENY, (WPARAM)hContact, (LPARAM)StrConvA(szReason));
+ return (int)ProtoCallService(m_szModuleName, PS_AUTHDENY, (WPARAM)hContact, (LPARAM)StrConvA(szReason));
}
int __cdecl AuthRecv(HANDLE hContact, PROTORECVEVENT* evt)
{
CCSDATA ccs = { hContact, PSR_AUTH, 0, (LPARAM)evt };
- return (int)MyCallProtoService(m_szModuleName, PSR_AUTH, 0, (LPARAM)&ccs);
+ return (int)ProtoCallService(m_szModuleName, PSR_AUTH, 0, (LPARAM)&ccs);
}
int __cdecl AuthRequest(HANDLE hContact, const TCHAR* szMessage)
{
CCSDATA ccs = { hContact, PSS_AUTHREQUEST, 0, (LPARAM)szMessage };
ccs.lParam = (LPARAM)mir_t2a(szMessage);
- int res = (int)MyCallProtoService(m_szModuleName, PSS_AUTHREQUEST, 0, (LPARAM)&ccs);
+ int res = (int)ProtoCallService(m_szModuleName, PSS_AUTHREQUEST, 0, (LPARAM)&ccs);
mir_free((char*)ccs.lParam);
return res;
}
HANDLE __cdecl ChangeInfo(int iInfoType, void* pInfoData)
{
- return (HANDLE)MyCallProtoService(m_szModuleName, PS_CHANGEINFO, iInfoType, (LPARAM)pInfoData);
+ return (HANDLE)ProtoCallService(m_szModuleName, PS_CHANGEINFO, iInfoType, (LPARAM)pInfoData);
}
HANDLE __cdecl FileAllow(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szPath)
@@ -98,7 +91,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE CCSDATA ccs = { hContact, PSS_FILEALLOW, (WPARAM)hTransfer, (LPARAM)szPath };
ccs.lParam = (LPARAM)mir_t2a(szPath);
- HANDLE res = (HANDLE)MyCallProtoService(m_szModuleName, PSS_FILEALLOW, 0, (LPARAM)&ccs);
+ HANDLE res = (HANDLE)ProtoCallService(m_szModuleName, PSS_FILEALLOW, 0, (LPARAM)&ccs);
mir_free((char*)ccs.lParam);
return res;
}
@@ -106,7 +99,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE int __cdecl FileCancel(HANDLE hContact, HANDLE hTransfer)
{
CCSDATA ccs = { hContact, PSS_FILECANCEL, (WPARAM)hTransfer, 0 };
- return (int)MyCallProtoService(m_szModuleName, PSS_FILECANCEL, 0, (LPARAM)&ccs);
+ return (int)ProtoCallService(m_szModuleName, PSS_FILECANCEL, 0, (LPARAM)&ccs);
}
int __cdecl FileDeny(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szReason)
@@ -114,7 +107,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE CCSDATA ccs = { hContact, PSS_FILEDENY, (WPARAM)hTransfer, (LPARAM)szReason };
ccs.lParam = (LPARAM)mir_t2a(szReason);
- int res = (int)MyCallProtoService(m_szModuleName, PSS_FILEDENY, 0, (LPARAM)&ccs);
+ int res = (int)ProtoCallService(m_szModuleName, PSS_FILEDENY, 0, (LPARAM)&ccs);
mir_free((char*)ccs.lParam);
return res;
}
@@ -124,7 +117,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE PROTOFILERESUME pfr = { *action, *szFilename };
pfr.szFilename = (PROTOCHAR*)mir_t2a(pfr.szFilename);
- int res = (int)MyCallProtoService(m_szModuleName, PS_FILERESUME, (WPARAM)hTransfer, (LPARAM)&pfr);
+ int res = (int)ProtoCallService(m_szModuleName, PS_FILERESUME, (WPARAM)hTransfer, (LPARAM)&pfr);
mir_free((PROTOCHAR*)*szFilename);
*action = pfr.action; *szFilename = (PROTOCHAR*)pfr.szFilename;
@@ -133,28 +126,28 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE DWORD_PTR __cdecl GetCaps(int type, HANDLE hContact)
{
- return (DWORD_PTR)MyCallProtoService(m_szModuleName, PS_GETCAPS, type, (LPARAM)hContact);
+ return (DWORD_PTR)ProtoCallService(m_szModuleName, PS_GETCAPS, type, (LPARAM)hContact);
}
HICON __cdecl GetIcon(int iconIndex)
{
- return (HICON)MyCallProtoService(m_szModuleName, PS_LOADICON, iconIndex, 0);
+ return (HICON)ProtoCallService(m_szModuleName, PS_LOADICON, iconIndex, 0);
}
int __cdecl GetInfo(HANDLE hContact, int flags)
{
CCSDATA ccs = { hContact, PSS_GETINFO, flags, 0 };
- return MyCallProtoService(m_szModuleName, PSS_GETINFO, 0, (LPARAM)&ccs);
+ return ProtoCallService(m_szModuleName, PSS_GETINFO, 0, (LPARAM)&ccs);
}
HANDLE __cdecl SearchBasic(const PROTOCHAR* id)
{
- return (HANDLE)MyCallProtoService(m_szModuleName, PS_BASICSEARCH, 0, (LPARAM)StrConvA(id));
+ return (HANDLE)ProtoCallService(m_szModuleName, PS_BASICSEARCH, 0, (LPARAM)StrConvA(id));
}
HANDLE __cdecl SearchByEmail(const PROTOCHAR* email)
{
- return (HANDLE)MyCallProtoService(m_szModuleName, PS_SEARCHBYEMAIL, 0, (LPARAM)StrConvA(email));
+ return (HANDLE)ProtoCallService(m_szModuleName, PS_SEARCHBYEMAIL, 0, (LPARAM)StrConvA(email));
}
HANDLE __cdecl SearchByName(const PROTOCHAR* nick, const PROTOCHAR* firstName, const PROTOCHAR* lastName)
@@ -164,7 +157,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE psn.pszNick = (PROTOCHAR*)mir_t2a(nick);
psn.pszFirstName = (PROTOCHAR*)mir_t2a(firstName);
psn.pszLastName = (PROTOCHAR*)mir_t2a(lastName);
- HANDLE res = (HANDLE)MyCallProtoService(m_szModuleName, PS_SEARCHBYNAME, 0, (LPARAM)&psn);
+ HANDLE res = (HANDLE)ProtoCallService(m_szModuleName, PS_SEARCHBYNAME, 0, (LPARAM)&psn);
mir_free(psn.pszNick);
mir_free(psn.pszFirstName);
mir_free(psn.pszLastName);
@@ -174,42 +167,42 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE HWND __cdecl SearchAdvanced(HWND owner)
{
- return (HWND)MyCallProtoService(m_szModuleName, PS_SEARCHBYADVANCED, 0, (LPARAM)owner);
+ return (HWND)ProtoCallService(m_szModuleName, PS_SEARCHBYADVANCED, 0, (LPARAM)owner);
}
HWND __cdecl CreateExtendedSearchUI(HWND owner)
{
- return (HWND)MyCallProtoService(m_szModuleName, PS_CREATEADVSEARCHUI, 0, (LPARAM)owner);
+ return (HWND)ProtoCallService(m_szModuleName, PS_CREATEADVSEARCHUI, 0, (LPARAM)owner);
}
int __cdecl RecvContacts(HANDLE hContact, PROTORECVEVENT* evt)
{
CCSDATA ccs = { hContact, PSR_CONTACTS, 0, (LPARAM)evt };
- return (int)MyCallProtoService(m_szModuleName, PSR_CONTACTS, 0, (LPARAM)&ccs);
+ return (int)ProtoCallService(m_szModuleName, PSR_CONTACTS, 0, (LPARAM)&ccs);
}
int __cdecl RecvFile(HANDLE hContact, PROTOFILEEVENT* evt)
{
CCSDATA ccs = { hContact, PSR_FILE, 0, (LPARAM)evt };
- return MyCallProtoService(m_szModuleName, PSR_FILE, 0, (LPARAM)&ccs);
+ return ProtoCallService(m_szModuleName, PSR_FILE, 0, (LPARAM)&ccs);
}
int __cdecl RecvMsg(HANDLE hContact, PROTORECVEVENT* evt)
{
CCSDATA ccs = { hContact, PSR_MESSAGE, 0, (LPARAM)evt };
- return (int)MyCallProtoService(m_szModuleName, PSR_MESSAGE, 0, (LPARAM)&ccs);
+ return (int)ProtoCallService(m_szModuleName, PSR_MESSAGE, 0, (LPARAM)&ccs);
}
int __cdecl RecvUrl(HANDLE hContact, PROTORECVEVENT* evt)
{
CCSDATA ccs = { hContact, PSR_URL, 0, (LPARAM)evt };
- return (int)MyCallProtoService(m_szModuleName, PSR_URL, 0, (LPARAM)&ccs);
+ return (int)ProtoCallService(m_szModuleName, PSR_URL, 0, (LPARAM)&ccs);
}
int __cdecl SendContacts(HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList)
{
CCSDATA ccs = { hContact, PSS_CONTACTS, MAKEWPARAM(flags, nContacts), (LPARAM)hContactsList };
- return (int)MyCallProtoService(m_szModuleName, PSS_CONTACTS, 0, (LPARAM)&ccs);
+ return (int)ProtoCallService(m_szModuleName, PSS_CONTACTS, 0, (LPARAM)&ccs);
}
HANDLE __cdecl SendFile(HANDLE hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles)
@@ -218,7 +211,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE ccs.wParam = (WPARAM)mir_t2a(szDescription);
ccs.lParam = (LPARAM)Proto_FilesMatrixA(ppszFiles);
- HANDLE res = (HANDLE)MyCallProtoService(m_szModuleName, PSS_FILE, 0, (LPARAM)&ccs);
+ HANDLE res = (HANDLE)ProtoCallService(m_szModuleName, PSS_FILE, 0, (LPARAM)&ccs);
if (res == 0) FreeFilesMatrix((TCHAR***)&ccs.lParam);
mir_free((char*)ccs.wParam);
return res;
@@ -227,53 +220,53 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE int __cdecl SendMsg(HANDLE hContact, int flags, const char* msg)
{
CCSDATA ccs = { hContact, PSS_MESSAGE, flags, (LPARAM)msg };
- return (int)MyCallProtoService(m_szModuleName, PSS_MESSAGE, 0, (LPARAM)&ccs);
+ return (int)ProtoCallService(m_szModuleName, PSS_MESSAGE, 0, (LPARAM)&ccs);
}
int __cdecl SendUrl(HANDLE hContact, int flags, const char* url)
{
CCSDATA ccs = { hContact, PSS_URL, flags, (LPARAM)url };
- return (int)MyCallProtoService(m_szModuleName, PSS_URL, 0, (LPARAM)&ccs);
+ return (int)ProtoCallService(m_szModuleName, PSS_URL, 0, (LPARAM)&ccs);
}
int __cdecl SetApparentMode(HANDLE hContact, int mode)
{
CCSDATA ccs = { hContact, PSS_SETAPPARENTMODE, mode, 0 };
- return (int)MyCallProtoService(m_szModuleName, PSS_SETAPPARENTMODE, 0, (LPARAM)&ccs);
+ return (int)ProtoCallService(m_szModuleName, PSS_SETAPPARENTMODE, 0, (LPARAM)&ccs);
}
int __cdecl SetStatus(int iNewStatus)
{
- return (int)MyCallProtoService(m_szModuleName, PS_SETSTATUS, iNewStatus, 0);
+ return (int)ProtoCallService(m_szModuleName, PS_SETSTATUS, iNewStatus, 0);
}
HANDLE __cdecl GetAwayMsg(HANDLE hContact)
{
CCSDATA ccs = { hContact, PSS_GETAWAYMSG, 0, 0 };
- return (HANDLE)MyCallProtoService(m_szModuleName, PSS_GETAWAYMSG, 0, (LPARAM)&ccs);
+ return (HANDLE)ProtoCallService(m_szModuleName, PSS_GETAWAYMSG, 0, (LPARAM)&ccs);
}
int __cdecl RecvAwayMsg(HANDLE hContact, int statusMode, PROTORECVEVENT* evt)
{
CCSDATA ccs = { hContact, PSR_AWAYMSG, statusMode, (LPARAM)evt };
- return (int)MyCallProtoService(m_szModuleName, PSR_AWAYMSG, 0, (LPARAM)&ccs);
+ return (int)ProtoCallService(m_szModuleName, PSR_AWAYMSG, 0, (LPARAM)&ccs);
}
int __cdecl SendAwayMsg(HANDLE hContact, HANDLE hProcess, const char* msg)
{
CCSDATA ccs = { hContact, PSS_AWAYMSG, (WPARAM)hProcess, (LPARAM)msg };
- return (int)MyCallProtoService(m_szModuleName, PSS_AWAYMSG, 0, (LPARAM)&ccs);
+ return (int)ProtoCallService(m_szModuleName, PSS_AWAYMSG, 0, (LPARAM)&ccs);
}
int __cdecl SetAwayMsg(int iStatus, const TCHAR* msg)
{
- return (int)MyCallProtoService(m_szModuleName, PS_SETAWAYMSG, iStatus, (LPARAM)StrConvA(msg));
+ return (int)ProtoCallService(m_szModuleName, PS_SETAWAYMSG, iStatus, (LPARAM)StrConvA(msg));
}
int __cdecl UserIsTyping(HANDLE hContact, int type)
{
CCSDATA ccs = { hContact, PSS_USERISTYPING, (WPARAM)hContact, type };
- return MyCallProtoService(m_szModuleName, PSS_USERISTYPING, 0, (LPARAM)&ccs);
+ return ProtoCallService(m_szModuleName, PSS_USERISTYPING, 0, (LPARAM)&ccs);
}
int __cdecl OnEvent(PROTOEVENTTYPE, WPARAM, LPARAM)
|