summaryrefslogtreecommitdiff
path: root/protocols/MSN
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-09-16 11:50:15 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-09-16 11:50:15 +0000
commit5161fd3fe53b85f579cfece81e25b562f1fa56ae (patch)
tree3ac6979cd3774351cb68431da64ca014f1170e98 /protocols/MSN
parentce6e5ab03d58151c4eda36d05a8436d337b2d3c0 (diff)
- event code standardization for protocols
- fix for EVENTTYPE_AUTHREQUEST processing - protocols' custom CallService core removed git-svn-id: http://svn.miranda-ng.org/main/trunk@1576 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MSN')
-rw-r--r--protocols/MSN/msn.cpp2
-rw-r--r--protocols/MSN/msn_auth.cpp18
-rw-r--r--protocols/MSN/msn_chat.cpp6
-rw-r--r--protocols/MSN/msn_commands.cpp16
-rw-r--r--protocols/MSN/msn_contact.cpp4
-rw-r--r--protocols/MSN/msn_ftold.cpp2
-rw-r--r--protocols/MSN/msn_global.h6
-rw-r--r--protocols/MSN/msn_http.cpp2
-rw-r--r--protocols/MSN/msn_links.cpp2
-rw-r--r--protocols/MSN/msn_lists.cpp12
-rw-r--r--protocols/MSN/msn_mail.cpp2
-rw-r--r--protocols/MSN/msn_menu.cpp24
-rw-r--r--protocols/MSN/msn_misc.cpp32
-rw-r--r--protocols/MSN/msn_natdetect.cpp2
-rw-r--r--protocols/MSN/msn_opts.cpp16
-rw-r--r--protocols/MSN/msn_p2p.cpp10
-rw-r--r--protocols/MSN/msn_proto.cpp67
-rw-r--r--protocols/MSN/msn_soapab.cpp2
-rw-r--r--protocols/MSN/msn_srv.cpp2
-rw-r--r--protocols/MSN/msn_std.cpp21
-rw-r--r--protocols/MSN/msn_threads.cpp14
-rw-r--r--protocols/MSN/msn_ws.cpp12
22 files changed, 122 insertions, 152 deletions
diff --git a/protocols/MSN/msn.cpp b/protocols/MSN/msn.cpp
index 9399bf6e3a..de85a0c6bf 100644
--- a/protocols/MSN/msn.cpp
+++ b/protocols/MSN/msn.cpp
@@ -126,7 +126,7 @@ extern "C" int __declspec(dllexport) Load(void)
pd.fnInit = (pfnInitProto)msnProtoInit;
pd.fnUninit = (pfnUninitProto)msnProtoUninit;
pd.type = PROTOTYPE_PROTOCOL;
- MSN_CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
+ CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
MsnInitIcons();
MSN_InitContactMenu();
diff --git a/protocols/MSN/msn_auth.cpp b/protocols/MSN/msn_auth.cpp
index 065f4c0247..32bbe01e0d 100644
--- a/protocols/MSN/msn_auth.cpp
+++ b/protocols/MSN/msn_auth.cpp
@@ -133,7 +133,7 @@ int CMsnProto::MSN_GetPassportAuth(void)
char szPassword[100];
getStaticString(NULL, "Password", szPassword, sizeof(szPassword));
- MSN_CallService(MS_DB_CRYPT_DECODESTRING, strlen(szPassword)+1, (LPARAM)szPassword);
+ CallService(MS_DB_CRYPT_DECODESTRING, strlen(szPassword)+1, (LPARAM)szPassword);
szPassword[16] = 0;
char* szEncPassword = HtmlEncode(szPassword);
@@ -254,7 +254,7 @@ int CMsnProto::MSN_GetPassportAuth(void)
if (errurl)
{
MSN_DebugLog("Starting URL: '%s'", errurl);
- MSN_CallService(MS_UTILS_OPENURL, 1, (LPARAM)errurl);
+ CallService(MS_UTILS_OPENURL, 1, (LPARAM)errurl);
}
ezxml_t tokf = ezxml_get(xml, "S:Body", 0, "S:Fault", 0, "S:Detail", -1);
@@ -436,7 +436,7 @@ char* CMsnProto::GenerateLoginBlob(char* challenge)
unsigned char* key1 = (unsigned char*)alloca(key1len);
NETLIBBASE64 nlb = { authSecretToken, (int)keylen, key1, (int)key1len };
- MSN_CallService(MS_NETLIB_BASE64DECODE, 0, LPARAM(&nlb));
+ CallService(MS_NETLIB_BASE64DECODE, 0, LPARAM(&nlb));
key1len = nlb.cbDecoded;
mir_sha1_byte_t key2[MIR_SHA1_HASH_SIZE+4];
@@ -464,7 +464,7 @@ char* CMsnProto::GenerateLoginBlob(char* challenge)
p += sizeof(MsgrUsrKeyHdr);
unsigned char iv[8];
- MSN_CallService(MS_UTILS_GETRANDOM, sizeof(iv), (LPARAM)iv);
+ CallService(MS_UTILS_GETRANDOM, sizeof(iv), (LPARAM)iv);
memcpy(p, iv, sizeof(iv));
p += sizeof(iv);
@@ -483,7 +483,7 @@ char* CMsnProto::GenerateLoginBlob(char* challenge)
char* buf = (char*)mir_alloc(rlen);
NETLIBBASE64 nlb1 = { buf, (int)rlen, userKey, (int)pktsz };
- MSN_CallService(MS_NETLIB_BASE64ENCODE, 0, LPARAM(&nlb1));
+ CallService(MS_NETLIB_BASE64ENCODE, 0, LPARAM(&nlb1));
return buf;
}
@@ -492,14 +492,14 @@ char* CMsnProto::GenerateLoginBlob(char* challenge)
char* CMsnProto::HotmailLogin(const char* url)
{
unsigned char nonce[24];
- MSN_CallService(MS_UTILS_GETRANDOM, sizeof(nonce), (LPARAM)nonce);
+ CallService(MS_UTILS_GETRANDOM, sizeof(nonce), (LPARAM)nonce);
const size_t hotSecretlen = strlen(hotSecretToken);
size_t key1len = Netlib_GetBase64DecodedBufferSize(hotSecretlen);
unsigned char* key1 = (unsigned char*)alloca(key1len);
NETLIBBASE64 nlb = { hotSecretToken, (int)hotSecretlen, key1, (int)key1len };
- MSN_CallService(MS_NETLIB_BASE64DECODE, 0, LPARAM(&nlb));
+ CallService(MS_NETLIB_BASE64DECODE, 0, LPARAM(&nlb));
key1len = nlb.cbDecoded;
static const unsigned char encdata[] = "WS-SecureConversation";
@@ -519,7 +519,7 @@ char* CMsnProto::HotmailLogin(const char* url)
size_t noncenclen = Netlib_GetBase64EncodedBufferSize(sizeof(nonce));
char* noncenc = (char*)alloca(noncenclen);
NETLIBBASE64 nlb1 = { noncenc, (int)noncenclen, nonce, sizeof(nonce) };
- MSN_CallService(MS_NETLIB_BASE64ENCODE, 0, LPARAM(&nlb1));
+ CallService(MS_NETLIB_BASE64ENCODE, 0, LPARAM(&nlb1));
noncenclen = nlb1.cchEncoded - 1;
const size_t fnpstlen = strlen(xmlenc) + strlen(url) + 3*noncenclen + 100;
@@ -534,7 +534,7 @@ char* CMsnProto::HotmailLogin(const char* url)
hmac_sha1(hash, key2, sizeof(key2), (mir_sha1_byte_t*)fnpst, sz);
NETLIBBASE64 nlb2 = { noncenc, (int)noncenclen, hash, sizeof(hash) };
- MSN_CallService(MS_NETLIB_BASE64ENCODE, 0, LPARAM(&nlb2));
+ CallService(MS_NETLIB_BASE64ENCODE, 0, LPARAM(&nlb2));
sz += mir_snprintf(fnpst + sz, fnpstlen - sz, "&hash=");
diff --git a/protocols/MSN/msn_chat.cpp b/protocols/MSN/msn_chat.cpp
index 58bfcbf866..620477c6a3 100644
--- a/protocols/MSN/msn_chat.cpp
+++ b/protocols/MSN/msn_chat.cpp
@@ -382,7 +382,7 @@ int CMsnProto::MSN_GCEventHook(WPARAM, LPARAM lParam)
{
char *email = mir_t2a(gch->ptszUID);
HANDLE hContact = MSN_HContactFromEmail(email);
- MSN_CallService(MS_MSG_SENDMESSAGE, (WPARAM)hContact, 0);
+ CallService(MS_MSG_SENDMESSAGE, (WPARAM)hContact, 0);
mir_free(email);
break;
}
@@ -410,11 +410,11 @@ int CMsnProto::MSN_GCEventHook(WPARAM, LPARAM lParam)
switch(gch->dwData)
{
case 10:
- MSN_CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)hContact, 0);
+ CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)hContact, 0);
break;
case 20:
- MSN_CallService(MS_HISTORY_SHOWCONTACTHISTORY, (WPARAM)hContact, 0);
+ CallService(MS_HISTORY_SHOWCONTACTHISTORY, (WPARAM)hContact, 0);
break;
case 110:
diff --git a/protocols/MSN/msn_commands.cpp b/protocols/MSN/msn_commands.cpp
index 76dab93234..5a239dd986 100644
--- a/protocols/MSN/msn_commands.cpp
+++ b/protocols/MSN/msn_commands.cpp
@@ -161,7 +161,7 @@ void CMsnProto::sttInviteMessage(ThreadData* info, char* msgBody, char* email, c
ccs.szProtoService = PSR_FILE;
ccs.wParam = 0;
ccs.lParam = (LPARAM)&pre;
- MSN_CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
+ CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
return;
}
@@ -310,7 +310,7 @@ void CMsnProto::sttCustomSmiley(const char* msgBody, char* email, char* nick, in
char* buf = (char*)mir_alloc(rlen);
NETLIBBASE64 nlb = { buf, (int)rlen, (PBYTE)lastsml, (int)slen };
- MSN_CallService(MS_NETLIB_BASE64ENCODE, 0, LPARAM(&nlb));
+ CallService(MS_NETLIB_BASE64ENCODE, 0, LPARAM(&nlb));
char* smileyName = (char*)mir_alloc(rlen*3);
UrlEncode(buf, smileyName, rlen*3);
@@ -509,7 +509,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para
{
if (!sentMsg)
{
- MSN_CallService(MS_PROTO_CONTACTISTYPING, WPARAM(ccs.hContact), 0);
+ CallService(MS_PROTO_CONTACTISTYPING, WPARAM(ccs.hContact), 0);
PROTORECVEVENT pre;
pre.szMessage = (char*)msgBody;
@@ -520,7 +520,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para
ccs.szProtoService = PSR_MESSAGE;
ccs.wParam = 0;
ccs.lParam = (LPARAM)&pre;
- MSN_CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
+ CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
}
else
{
@@ -535,7 +535,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para
dbei.timestamp = time(NULL);
dbei.cbBlob = (unsigned)strlen(msgBody) + 1;
dbei.pBlob = (PBYTE)msgBody;
- MSN_CallService(MS_DB_EVENT_ADD, (WPARAM)ccs.hContact, (LPARAM)&dbei);
+ CallService(MS_DB_EVENT_ADD, (WPARAM)ccs.hContact, (LPARAM)&dbei);
}
}
}
@@ -564,7 +564,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para
if (tTypingUser != NULL && info->mChatID[0] == 0 && _stricmp(email, MyOptions.szEmail))
{
HANDLE hContact = MSN_HContactFromEmail(tTypingUser, tTypingUser);
- MSN_CallService(MS_PROTO_CONTACTISTYPING, (WPARAM) hContact, 7);
+ CallService(MS_PROTO_CONTACTISTYPING, (WPARAM) hContact, 7);
}
}
else if (!_strnicmp(tContentType, "text/x-msnmsgr-datacast", 23))
@@ -789,7 +789,7 @@ void CMsnProto::sttProcessRemove(char* buf, size_t len)
{
if (msc->hContact && _stricmp(szEmail, MyOptions.szEmail))
{
- MSN_CallService(MS_DB_CONTACT_DELETE, (WPARAM)msc->hContact, 0);
+ CallService(MS_DB_CONTACT_DELETE, (WPARAM)msc->hContact, 0);
msc->hContact = NULL;
}
}
@@ -984,7 +984,7 @@ void CMsnProto::sttProcessPage(char* buf, unsigned len)
ccs.hContact = MSN_HContactFromEmail(szTel, szTel, true, true);
ccs.szProtoService = PSR_MESSAGE;
ccs.lParam = (LPARAM)&pre;
- MSN_CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
+ CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
}
ezxml_free(xmlnot);
diff --git a/protocols/MSN/msn_contact.cpp b/protocols/MSN/msn_contact.cpp
index f87a6fafca..086bf6b3ed 100644
--- a/protocols/MSN/msn_contact.cpp
+++ b/protocols/MSN/msn_contact.cpp
@@ -33,8 +33,8 @@ HANDLE CMsnProto::MSN_HContactFromEmail(const char* wlid, const char* msnNick,
if (hContact == NULL && addIfNeeded)
{
- hContact = (HANDLE)MSN_CallService(MS_DB_CONTACT_ADD, 0, 0);
- MSN_CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)m_szModuleName);
+ hContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
+ CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)m_szModuleName);
setString(hContact, "e-mail", szEmail);
setStringUtf(hContact, "Nick", msnNick ? msnNick : wlid);
if (temporary)
diff --git a/protocols/MSN/msn_ftold.cpp b/protocols/MSN/msn_ftold.cpp
index fcf894c4e2..6ed5ce08af 100644
--- a/protocols/MSN/msn_ftold.cpp
+++ b/protocols/MSN/msn_ftold.cpp
@@ -342,7 +342,7 @@ void CMsnProto::msnftp_startFileSend(ThreadData* info, const char* Invcommand, c
nlb.pfnNewConnectionV2 = MSN_ConnectionProc;
nlb.pExtra = this;
- sb = (HANDLE)MSN_CallService(MS_NETLIB_BINDPORT, (WPARAM)hNetlibUser, (LPARAM)&nlb);
+ sb = (HANDLE)CallService(MS_NETLIB_BINDPORT, (WPARAM)hNetlibUser, (LPARAM)&nlb);
if (sb == NULL)
MSN_DebugLog("Unable to bind the port for incoming transfers");
}
diff --git a/protocols/MSN/msn_global.h b/protocols/MSN/msn_global.h
index 955c3123db..0e348901f7 100644
--- a/protocols/MSN/msn_global.h
+++ b/protocols/MSN/msn_global.h
@@ -179,12 +179,6 @@ bool MSN_MsgWndExist(HANDLE hContact);
#define MSN_SendNickname(a) MSN_SendNicknameUtf(UTF8(a))
-#if defined(_DEBUG)
-#define MSN_CallService CallService
-#else
-INT_PTR MSN_CallService(const char* szSvcName, WPARAM wParam, LPARAM lParam);
-#endif
-
void MSN_FreeVariant(DBVARIANT* dbv);
char* MSN_Translate(const char* str);
unsigned MSN_GenRandom(void);
diff --git a/protocols/MSN/msn_http.cpp b/protocols/MSN/msn_http.cpp
index 5f727ef30b..a53f9401fb 100644
--- a/protocols/MSN/msn_http.cpp
+++ b/protocols/MSN/msn_http.cpp
@@ -42,7 +42,7 @@ int msn_httpGatewayInit(HANDLE hConn, NETLIBOPENCONNECTION* nloc, NETLIBHTTPREQU
nlhpi.szHttpPostUrl = "messenger.hotmail.com";
nlhpi.flags = NLHPIF_HTTP11;
nlhpi.combinePackets = MSN_PACKETS_COMBINE;
- return MSN_CallService(MS_NETLIB_SETHTTPPROXYINFO, (WPARAM)hConn, (LPARAM)&nlhpi);
+ return CallService(MS_NETLIB_SETHTTPPROXYINFO, (WPARAM)hConn, (LPARAM)&nlhpi);
}
//=======================================================================================
diff --git a/protocols/MSN/msn_links.cpp b/protocols/MSN/msn_links.cpp
index 7da85b3202..1d54afd64c 100644
--- a/protocols/MSN/msn_links.cpp
+++ b/protocols/MSN/msn_links.cpp
@@ -111,7 +111,7 @@ static INT_PTR ServiceParseMsnimLink(WPARAM, LPARAM lParam)
psr.flags = PSR_TCHAR;
psr.nick = email;
psr.email = email;
- MSN_CallService(MS_ADDCONTACT_SHOW, 0, (LPARAM)&acs);
+ CallService(MS_ADDCONTACT_SHOW, 0, (LPARAM)&acs);
}
return 0;
}
diff --git a/protocols/MSN/msn_lists.cpp b/protocols/MSN/msn_lists.cpp
index 5325e8190b..8e4b48a129 100644
--- a/protocols/MSN/msn_lists.cpp
+++ b/protocols/MSN/msn_lists.cpp
@@ -236,10 +236,10 @@ void CMsnProto::Lists_Remove(int list, const char* email)
void CMsnProto::Lists_Populate(void)
{
- HANDLE hContact = (HANDLE)MSN_CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
while (hContact != NULL)
{
- HANDLE hContactN = (HANDLE)MSN_CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ HANDLE hContactN = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
if (MSN_IsMyContact(hContact))
{
char szEmail[MSN_MAX_EMAIL_LEN] = "";;
@@ -255,7 +255,7 @@ void CMsnProto::Lists_Populate(void)
Lists_Add(0, NETID_UNKNOWN, szEmail, hContact);
}
else
- MSN_CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0);
+ CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0);
}
hContact = hContactN;
}
@@ -304,7 +304,7 @@ void CMsnProto::MSN_CleanupLists(void)
if (!(p.list & (LIST_LL | LIST_FL)))
{
- MSN_CallService(MS_DB_CONTACT_DELETE, (WPARAM)p.hContact, 0);
+ CallService(MS_DB_CONTACT_DELETE, (WPARAM)p.hContact, 0);
p.hContact = NULL;
}
@@ -322,7 +322,7 @@ void CMsnProto::MSN_CleanupLists(void)
cont.type = 0;
cont.path = path;
- MSN_CallService(MS_SMILEYADD_LOADCONTACTSMILEYS, 0, (LPARAM)&cont);
+ CallService(MS_SMILEYADD_LOADCONTACTSMILEYS, 0, (LPARAM)&cont);
}
}
}
@@ -571,7 +571,7 @@ static void SaveSettings(HANDLE hItem, HWND hwndList, CMsnProto* proto)
{
if (!IsHContactInfo(hItem))
{
- MSN_CallService(MS_DB_CONTACT_DELETE, (WPARAM)hItem, 0);
+ CallService(MS_DB_CONTACT_DELETE, (WPARAM)hItem, 0);
MsnContact* msc = proto->Lists_Get(szEmail);
if (msc) msc->hContact = NULL;
}
diff --git a/protocols/MSN/msn_mail.cpp b/protocols/MSN/msn_mail.cpp
index 57996b65ac..869642d1d4 100644
--- a/protocols/MSN/msn_mail.cpp
+++ b/protocols/MSN/msn_mail.cpp
@@ -126,7 +126,7 @@ void CMsnProto::getOIMs(ezxml_t xmli)
ccs.hContact = MSN_HContactFromEmail(szEmail);
ccs.szProtoService = PSR_MESSAGE;
ccs.lParam = (LPARAM)&pre;
- MSN_CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
+ CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
mir_free(pre.szMessage);
ezxml_t delmid = ezxml_add_child(delmids, "messageId", 0);
diff --git a/protocols/MSN/msn_menu.cpp b/protocols/MSN/msn_menu.cpp
index e90480fb32..1913483b36 100644
--- a/protocols/MSN/msn_menu.cpp
+++ b/protocols/MSN/msn_menu.cpp
@@ -155,17 +155,17 @@ int CMsnProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM)
mi.flags = CMIM_NAME | CMIM_FLAGS | CMIF_ICONFROMICOLIB;
if (noChat) mi.flags |= CMIF_HIDDEN;
mi.pszName = (char*)((listId & LIST_BL) ? "&Unblock" : "&Block");
- MSN_CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hBlockMenuItem, (LPARAM)&mi);
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hBlockMenuItem, (LPARAM)&mi);
mi.flags = CMIM_NAME | CMIM_FLAGS | CMIF_ICONFROMICOLIB;
if (!emailEnabled) mi.flags |= CMIF_HIDDEN;
mi.pszName = isMe ? LPGEN("Open &Hotmail Inbox") : LPGEN("Send &Hotmail E-mail");
- MSN_CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hOpenInboxMenuItem, (LPARAM)&mi);
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hOpenInboxMenuItem, (LPARAM)&mi);
mi.flags = CMIM_FLAGS | CMIF_ICONFROMICOLIB | CMIF_NOTOFFLINE;
if (noChat) mi.flags |= CMIF_HIDDEN;
- MSN_CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hNetmeetingMenuItem, (LPARAM)&mi);
- MSN_CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hChatInviteMenuItem, (LPARAM)&mi);
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hNetmeetingMenuItem, (LPARAM)&mi);
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hChatInviteMenuItem, (LPARAM)&mi);
}
return 0;
@@ -359,7 +359,7 @@ void CMsnProto::MsnInitMainMenu(void)
void CMsnProto::MsnRemoveMainMenus(void)
{
if (mainMenuRoot)
- MSN_CallService(MS_CLIST_REMOVEMAINMENUITEM, (WPARAM)mainMenuRoot, 0);
+ CallService(MS_CLIST_REMOVEMAINMENUITEM, (WPARAM)mainMenuRoot, 0);
}
void CMsnProto::MSN_EnableMenuItems(bool bEnable)
@@ -373,14 +373,14 @@ void CMsnProto::MSN_EnableMenuItems(bool bEnable)
for (unsigned i=0; i < SIZEOF(menuItemsMain); i++)
{
if (menuItemsMain[i] != NULL)
- MSN_CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)menuItemsMain[i], (LPARAM)&mi);
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)menuItemsMain[i], (LPARAM)&mi);
}
if (bEnable)
{
mi.flags = CMIM_FLAGS;
if (!emailEnabled) mi.flags |= CMIF_HIDDEN;
- MSN_CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)menuItemsMain[1], (LPARAM)&mi);
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)menuItemsMain[1], (LPARAM)&mi);
}
}
@@ -499,11 +499,11 @@ void MSN_RemoveContactMenus(void)
{
UnhookEvent(hPrebuildMenuHook);
- MSN_CallService(MS_CLIST_REMOVECONTACTMENUITEM, (WPARAM)hBlockMenuItem, 0);
- MSN_CallService(MS_CLIST_REMOVECONTACTMENUITEM, (WPARAM)hLiveSpaceMenuItem, 0);
- MSN_CallService(MS_CLIST_REMOVECONTACTMENUITEM, (WPARAM)hNetmeetingMenuItem, 0);
- MSN_CallService(MS_CLIST_REMOVECONTACTMENUITEM, (WPARAM)hChatInviteMenuItem, 0);
- MSN_CallService(MS_CLIST_REMOVECONTACTMENUITEM, (WPARAM)hOpenInboxMenuItem, 0);
+ CallService(MS_CLIST_REMOVECONTACTMENUITEM, (WPARAM)hBlockMenuItem, 0);
+ CallService(MS_CLIST_REMOVECONTACTMENUITEM, (WPARAM)hLiveSpaceMenuItem, 0);
+ CallService(MS_CLIST_REMOVECONTACTMENUITEM, (WPARAM)hNetmeetingMenuItem, 0);
+ CallService(MS_CLIST_REMOVECONTACTMENUITEM, (WPARAM)hChatInviteMenuItem, 0);
+ CallService(MS_CLIST_REMOVECONTACTMENUITEM, (WPARAM)hOpenInboxMenuItem, 0);
DestroyServiceFunction(hNetMeeting);
DestroyServiceFunction(hBlockCom);
diff --git a/protocols/MSN/msn_misc.cpp b/protocols/MSN/msn_misc.cpp
index 12b07cd08e..c313fd4467 100644
--- a/protocols/MSN/msn_misc.cpp
+++ b/protocols/MSN/msn_misc.cpp
@@ -118,7 +118,7 @@ void CMsnProto::MSN_AddAuthRequest(const char *email, const char *nick, const c
strcpy(pCurBlob, email); pCurBlob += emaillen + 1; // E-mail
strcpy(pCurBlob, reason); // Reason
- MSN_CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
+ CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -133,7 +133,7 @@ void CMsnProto::MSN_DebugLog(const char *fmt, ...)
if (_vsnprintf(str, sizeof(str), fmt, vararg) != 0)
{
str[sizeof(str)-1] = 0;
- MSN_CallService(MS_NETLIB_LOG, (WPARAM)hNetlibUser, (LPARAM)str);
+ CallService(MS_NETLIB_LOG, (WPARAM)hNetlibUser, (LPARAM)str);
}
va_end(vararg);
}
@@ -170,7 +170,7 @@ char* MSN_GetAvatarHash(char* szContext)
const size_t len = strlen(szAvatarHash);
NETLIBBASE64 nlb = { (char*)szAvatarHash, (int)len, szActHash, sizeof(szActHash) };
- int decod = MSN_CallService(MS_NETLIB_BASE64DECODE, 0, LPARAM(&nlb));
+ int decod = CallService(MS_NETLIB_BASE64DECODE, 0, LPARAM(&nlb));
if (decod != 0 && nlb.cbDecoded > 0)
res = arrayToHex(szActHash, nlb.cbDecoded);
}
@@ -203,7 +203,7 @@ void CMsnProto::MSN_GetAvatarFileName(HANDLE hContact, TCHAR* pszDest, size_t c
}
if (_taccess(pszDest, 0))
- MSN_CallService(MS_UTILS_CREATEDIRTREET, 0, (LPARAM)pszDest);
+ CallService(MS_UTILS_CREATEDIRTREET, 0, (LPARAM)pszDest);
size_t tPathLen2 = tPathLen;
if (hContact != NULL)
@@ -323,7 +323,7 @@ int CMsnProto::MSN_SetMyAvatar(const TCHAR* sztFname, void* pData, size_t cbLen
{
NETLIBBASE64 nlb = { szSha1d, sizeof(szSha1d), (PBYTE)sha1d, sizeof(sha1d) };
- MSN_CallService(MS_NETLIB_BASE64ENCODE, 0, LPARAM(&nlb));
+ CallService(MS_NETLIB_BASE64ENCODE, 0, LPARAM(&nlb));
}
mir_sha1_init(&sha1ctx);
@@ -359,7 +359,7 @@ int CMsnProto::MSN_SetMyAvatar(const TCHAR* sztFname, void* pData, size_t cbLen
{
NETLIBBASE64 nlb = { szSha1c, sizeof(szSha1c), (PBYTE)sha1c, sizeof(sha1c) };
- MSN_CallService(MS_NETLIB_BASE64ENCODE, 0, LPARAM(&nlb));
+ CallService(MS_NETLIB_BASE64ENCODE, 0, LPARAM(&nlb));
}
// ezxml_set_attr(xmlp, "SHA1C", szSha1c);
@@ -457,7 +457,7 @@ void CMsnProto::MSN_GetCustomSmileyFileName(HANDLE hContact, TCHAR* pszDest, si
}
if (!exist)
- MSN_CallService(MS_UTILS_CREATEDIRTREET, 0, (LPARAM)pszDest);
+ CallService(MS_UTILS_CREATEDIRTREET, 0, (LPARAM)pszDest);
TCHAR *sztSmileyName = mir_a2t(SmileyName);
mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, _T("\\%s.%s"), sztSmileyName,
@@ -580,7 +580,7 @@ int ThreadData::sendMessage(int msgType, const char* email, int netId, const cha
void ThreadData::sendCaps(void)
{
char mversion[100], capMsg[1000];
- MSN_CallService(MS_SYSTEM_GETVERSIONTEXT, sizeof(mversion), (LPARAM)mversion);
+ CallService(MS_SYSTEM_GETVERSIONTEXT, sizeof(mversion), (LPARAM)mversion);
mir_snprintf(capMsg, sizeof(capMsg),
"Content-Type: text/x-clientcaps\r\n\r\n"
@@ -927,7 +927,7 @@ void CMsnProto::MsnInvokeMyURL(bool ismail, const char* url)
}
MSN_DebugLog("Starting URL: '%s'", hippy);
- MSN_CallService(MS_UTILS_OPENURL, 1, (LPARAM)hippy);
+ CallService(MS_UTILS_OPENURL, 1, (LPARAM)hippy);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -938,7 +938,7 @@ void CMsnProto::MSN_ShowError(const char* msgtext, ...)
TCHAR tBuffer[4096];
va_list tArgs;
- TCHAR *buf = (TCHAR*)MSN_CallService(MS_LANGPACK_PCHARTOTCHAR, 0, (LPARAM)msgtext);
+ TCHAR *buf = (TCHAR*)CallService(MS_LANGPACK_PCHARTOTCHAR, 0, (LPARAM)msgtext);
va_start(tArgs, msgtext);
mir_vsntprintf(tBuffer, SIZEOF(tBuffer), buf, tArgs);
@@ -971,7 +971,7 @@ LRESULT CALLBACK NullWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara
else
{
if (tData->url != NULL)
- MSN_CallService(MS_UTILS_OPENURL, 1, (LPARAM)tData->url);
+ CallService(MS_UTILS_OPENURL, 1, (LPARAM)tData->url);
}
}
PUDeletePopUp(hWnd);
@@ -1365,7 +1365,7 @@ char* MSN_Base64Decode(const char* str)
}
NETLIBBASE64 nlb = { p, (int)len, (PBYTE)res, (int)reslen };
- if (!MSN_CallService(MS_NETLIB_BASE64DECODE, 0, LPARAM(&nlb))) nlb.cbDecoded = 0;
+ if (!CallService(MS_NETLIB_BASE64DECODE, 0, LPARAM(&nlb))) nlb.cbDecoded = 0;
res[nlb.cbDecoded] = 0;
return res;
@@ -1373,7 +1373,7 @@ char* MSN_Base64Decode(const char* str)
bool CMsnProto::MSN_IsMyContact(HANDLE hContact)
{
- const char* szProto = (char*)MSN_CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ const char* szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
return szProto != NULL && strcmp(m_szModuleName, szProto) == 0;
}
@@ -1396,14 +1396,14 @@ bool MSN_MsgWndExist(HANDLE hContact)
MessageWindowData msgWinData = {0};
msgWinData.cbSize = sizeof(MessageWindowData);
- bool res = MSN_CallService(MS_MSG_GETWINDOWDATA, (WPARAM)&msgWinInData, (LPARAM)&msgWinData) != 0;
+ bool res = CallService(MS_MSG_GETWINDOWDATA, (WPARAM)&msgWinInData, (LPARAM)&msgWinData) != 0;
res = res || msgWinData.hwndWindow;
if (res)
{
- msgWinInData.hContact = (HANDLE)MSN_CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0);
+ msgWinInData.hContact = (HANDLE)CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0);
if (msgWinInData.hContact != NULL)
{
- res = MSN_CallService(MS_MSG_GETWINDOWDATA, (WPARAM)&msgWinInData, (LPARAM)&msgWinData) != 0;
+ res = CallService(MS_MSG_GETWINDOWDATA, (WPARAM)&msgWinInData, (LPARAM)&msgWinData) != 0;
res |= (msgWinData.hwndWindow == NULL);
}
}
diff --git a/protocols/MSN/msn_natdetect.cpp b/protocols/MSN/msn_natdetect.cpp
index 827f51590d..0d17f4a530 100644
--- a/protocols/MSN/msn_natdetect.cpp
+++ b/protocols/MSN/msn_natdetect.cpp
@@ -194,7 +194,7 @@ void CMsnProto::MSNatDetect(void)
nlb.pfnNewConnectionV2 = MSN_ConnectionProc;
nlb.pExtra = this;
- HANDLE sb = (HANDLE) MSN_CallService(MS_NETLIB_BINDPORT, (WPARAM)hNetlibUser, (LPARAM)&nlb);
+ HANDLE sb = (HANDLE) CallService(MS_NETLIB_BINDPORT, (WPARAM)hNetlibUser, (LPARAM)&nlb);
if ( sb != NULL )
{
MyConnection.upnpNAT = htonl(nlb.dwExternalIP) == MyConnection.extIP;
diff --git a/protocols/MSN/msn_opts.cpp b/protocols/MSN/msn_opts.cpp
index b2fd4a9f8c..b92e21ee5b 100644
--- a/protocols/MSN/msn_opts.cpp
+++ b/protocols/MSN/msn_opts.cpp
@@ -80,7 +80,7 @@ HICON LoadIconEx(const char* name, bool big)
{
char szSettingName[100];
mir_snprintf(szSettingName, sizeof(szSettingName), "MSN_%s", name);
- return (HICON)MSN_CallService(MS_SKIN2_GETICON, big, (LPARAM)szSettingName);
+ return (HICON)CallService(MS_SKIN2_GETICON, big, (LPARAM)szSettingName);
}
HANDLE GetIconHandle(int iconId)
@@ -96,7 +96,7 @@ void ReleaseIconEx(const char* name, bool big)
{
char szSettingName[100];
mir_snprintf(szSettingName, sizeof(szSettingName), "MSN_%s", name);
- MSN_CallService(big ? MS_SKIN2_RELEASEICONBIG : MS_SKIN2_RELEASEICON, 0, (LPARAM)szSettingName);
+ CallService(big ? MS_SKIN2_RELEASEICONBIG : MS_SKIN2_RELEASEICON, 0, (LPARAM)szSettingName);
}
INT_PTR CALLBACK DlgProcMsnServLists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
@@ -120,7 +120,7 @@ static INT_PTR CALLBACK DlgProcMsnOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
char tBuffer[MAX_PATH];
if (!proto->getStaticString(NULL, "Password", tBuffer, sizeof(tBuffer)))
{
- MSN_CallService(MS_DB_CRYPT_DECODESTRING, strlen(tBuffer)+1, (LPARAM)tBuffer);
+ CallService(MS_DB_CRYPT_DECODESTRING, strlen(tBuffer)+1, (LPARAM)tBuffer);
tBuffer[16] = 0;
SetDlgItemTextA(hwndDlg, IDC_PASSWORD, tBuffer);
}
@@ -161,7 +161,7 @@ static INT_PTR CALLBACK DlgProcMsnOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
case WM_COMMAND:
if (LOWORD(wParam) == IDC_NEWMSNACCOUNTLINK)
{
- MSN_CallService(MS_UTILS_OPENURL, 1, (LPARAM)"https://signup.live.com");
+ CallService(MS_UTILS_OPENURL, 1, (LPARAM)"https://signup.live.com");
return TRUE;
}
@@ -278,7 +278,7 @@ LBL_Continue:
}
GetDlgItemTextA(hwndDlg, IDC_PASSWORD, password, sizeof(password));
- MSN_CallService(MS_DB_CRYPT_ENCODESTRING, sizeof(password),(LPARAM)password);
+ CallService(MS_DB_CRYPT_ENCODESTRING, sizeof(password),(LPARAM)password);
if (!proto->getString("Password", &dbv))
{
if (strcmp(password, dbv.pszVal))
@@ -601,7 +601,7 @@ static INT_PTR CALLBACK DlgProcAccMgrUI(HWND hwndDlg, UINT msg, WPARAM wParam, L
char tBuffer[MAX_PATH];
if (!proto->getStaticString(NULL, "Password", tBuffer, sizeof(tBuffer)))
{
- MSN_CallService(MS_DB_CRYPT_DECODESTRING, strlen(tBuffer)+1, (LPARAM)tBuffer);
+ CallService(MS_DB_CRYPT_DECODESTRING, strlen(tBuffer)+1, (LPARAM)tBuffer);
tBuffer[16] = 0;
SetDlgItemTextA(hwndDlg, IDC_PASSWORD, tBuffer);
}
@@ -619,7 +619,7 @@ static INT_PTR CALLBACK DlgProcAccMgrUI(HWND hwndDlg, UINT msg, WPARAM wParam, L
case WM_COMMAND:
if (LOWORD(wParam) == IDC_NEWMSNACCOUNTLINK)
{
- MSN_CallService(MS_UTILS_OPENURL, 1, (LPARAM)"https://signup.live.com");
+ CallService(MS_UTILS_OPENURL, 1, (LPARAM)"https://signup.live.com");
return TRUE;
}
@@ -649,7 +649,7 @@ static INT_PTR CALLBACK DlgProcAccMgrUI(HWND hwndDlg, UINT msg, WPARAM wParam, L
}
GetDlgItemTextA(hwndDlg, IDC_PASSWORD, password, sizeof(password));
- MSN_CallService(MS_DB_CRYPT_ENCODESTRING, sizeof(password),(LPARAM)password);
+ CallService(MS_DB_CRYPT_ENCODESTRING, sizeof(password),(LPARAM)password);
if (!proto->getString("Password", &dbv))
{
if (strcmp(password, dbv.pszVal))
diff --git a/protocols/MSN/msn_p2p.cpp b/protocols/MSN/msn_p2p.cpp
index 84d1ee8d2c..599dee57fd 100644
--- a/protocols/MSN/msn_p2p.cpp
+++ b/protocols/MSN/msn_p2p.cpp
@@ -86,7 +86,7 @@ bool CMsnProto::p2p_createListener(filetransfer* ft, directconnection *dc, MimeH
nlb.cbSize = sizeof(nlb);
nlb.pfnNewConnectionV2 = MSN_ConnectionProc;
nlb.pExtra = this;
- HANDLE sb = (HANDLE) MSN_CallService(MS_NETLIB_BINDPORT, (WPARAM) hNetlibUser, (LPARAM)&nlb);
+ HANDLE sb = (HANDLE) CallService(MS_NETLIB_BINDPORT, (WPARAM) hNetlibUser, (LPARAM)&nlb);
if (sb == NULL)
{
MSN_DebugLog("Unable to bind the port for incoming transfers");
@@ -278,7 +278,7 @@ void CMsnProto::p2p_savePicture2disk(filetransfer* ft)
cont.path = pathcpy;
- MSN_CallService(MS_SMILEYADD_LOADCONTACTSMILEYS, 0, (LPARAM)&cont);
+ CallService(MS_SMILEYADD_LOADCONTACTSMILEYS, 0, (LPARAM)&cont);
mir_free(pathcpy);
}
break;
@@ -731,7 +731,7 @@ bool CMsnProto::p2p_connectTo(ThreadData* info, directconnection *dc)
MSN_DebugLog("Connecting to %s:%d", tConn.szHost, tConn.wPort);
- info->s = (HANDLE)MSN_CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)hNetlibUser, (LPARAM)&tConn);
+ info->s = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)hNetlibUser, (LPARAM)&tConn);
if (info->s == NULL)
{
TWinErrorCode err;
@@ -1335,7 +1335,7 @@ void CMsnProto::p2p_InitFileTransfer(
ccs.szProtoService = PSR_FILE;
ccs.wParam = 0;
ccs.lParam = (LPARAM)&pre;
- MSN_CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
+ CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
}
break;
@@ -2318,7 +2318,7 @@ void CMsnProto::p2p_invite(unsigned iAppID, filetransfer* ft, const char *wlid)
int cbContextEnc = Netlib_GetBase64EncodedBufferSize((int)cbContext);
char* szContextEnc = (char*)alloca(cbContextEnc);
NETLIBBASE64 nlb = { szContextEnc, cbContextEnc, (PBYTE)pContext, (int)cbContext };
- MSN_CallService(MS_NETLIB_BASE64ENCODE, 0, LPARAM(&nlb));
+ CallService(MS_NETLIB_BASE64ENCODE, 0, LPARAM(&nlb));
MimeHeaders chdrs(10);
chdrs.addString("EUF-GUID", szAppID);
diff --git a/protocols/MSN/msn_proto.cpp b/protocols/MSN/msn_proto.cpp
index db417d84d0..23abd2cfe6 100644
--- a/protocols/MSN/msn_proto.cpp
+++ b/protocols/MSN/msn_proto.cpp
@@ -50,19 +50,19 @@ CMsnProto::CMsnProto(const char* aProtoName, const TCHAR* aUserName) :
m_szProtoName[0] = (char)toupper(m_szProtoName[0]);
mir_snprintf(path, sizeof(path), "%s/Status", m_szModuleName);
- MSN_CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)path);
+ CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)path);
mir_snprintf(path, sizeof(path), "%s/IdleTS", m_szModuleName);
- MSN_CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)path);
+ CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)path);
mir_snprintf(path, sizeof(path), "%s/p2pMsgId", m_szModuleName);
- MSN_CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)path);
+ CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)path);
mir_snprintf(path, sizeof(path), "%s/MobileEnabled", m_szModuleName);
- MSN_CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)path);
+ CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)path);
mir_snprintf(path, sizeof(path), "%s/MobileAllowed", m_szModuleName);
- MSN_CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)path);
+ CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)path);
// Protocol services and events...
hMSNNudge = CreateProtoEvent("/Nudge");
@@ -94,7 +94,7 @@ CMsnProto::CMsnProto(const char* aProtoName, const TCHAR* aUserName) :
LoadOptions();
- HANDLE hContact = (HANDLE)MSN_CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
while (hContact != NULL)
{
if (MSN_IsMyContact(hContact))
@@ -104,7 +104,7 @@ CMsnProto::CMsnProto(const char* aProtoName, const TCHAR* aUserName) :
deleteSetting(hContact, "p2pMsgId");
deleteSetting(hContact, "AccList");
}
- hContact = (HANDLE)MSN_CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact, 0);
+ hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact, 0);
}
deleteSetting(NULL, "MobileEnabled");
deleteSetting(NULL, "MobileAllowed");
@@ -149,7 +149,7 @@ CMsnProto::CMsnProto(const char* aProtoName, const TCHAR* aUserName) :
mir_snprintf(szDbsettings, sizeof(szDbsettings), "%s_HTTPS", m_szModuleName);
mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("%s plugin HTTPS connections"), m_tszUserName);
- hNetlibUserHttps = (HANDLE)MSN_CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu1);
+ hNetlibUserHttps = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu1);
NETLIBUSER nlu = {0};
nlu.cbSize = sizeof(nlu);
@@ -163,7 +163,7 @@ CMsnProto::CMsnProto(const char* aProtoName, const TCHAR* aUserName) :
nlu.pfnHttpGatewayUnwrapRecv = msn_httpGatewayUnwrapRecv;
mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("%s plugin connections"), m_tszUserName);
- hNetlibUser = (HANDLE)MSN_CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
+ hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
}
CMsnProto::~CMsnProto()
@@ -290,15 +290,15 @@ HANDLE __cdecl CMsnProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEv
{
DBEVENTINFO dbei = {0};
dbei.cbSize = sizeof(dbei);
- if ((dbei.cbBlob = MSN_CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDbEvent, 0)) == (DWORD)(-1))
+ if ((dbei.cbBlob = CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDbEvent, 0)) == (DWORD)(-1))
return NULL;
dbei.pBlob=(PBYTE) alloca(dbei.cbBlob);
- if (MSN_CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei)) return NULL;
+ if (CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei)) return NULL;
if (strcmp(dbei.szModule, m_szModuleName)) return NULL;
if (dbei.eventType != EVENTTYPE_AUTHREQUEST) return NULL;
- char* nick = (char *) (dbei.pBlob + sizeof(DWORD) + sizeof(HANDLE));
+ char* nick = (char *) (dbei.pBlob + sizeof(DWORD)*2);
char* firstName = nick + strlen(nick) + 1;
char* lastName = firstName + strlen(firstName) + 1;
char* email = lastName + strlen(lastName) + 1;
@@ -308,21 +308,7 @@ HANDLE __cdecl CMsnProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEv
int CMsnProto::AuthRecv(HANDLE hContact, PROTORECVEVENT* pre)
{
- DBEVENTINFO dbei = { 0 };
-
- dbei.cbSize = sizeof(dbei);
- dbei.szModule = m_szModuleName;
- dbei.timestamp = pre->timestamp;
- dbei.flags = (pre->flags & PREF_CREATEREAD) ? DBEF_READ : 0;
- dbei.flags |= (pre->flags & PREF_UTF) ? DBEF_UTF : 0;
- dbei.eventType = EVENTTYPE_AUTHREQUEST;
-
- /* Just copy the Blob from PSR_AUTH event. */
- dbei.cbBlob = pre->lParam;
- dbei.pBlob = (PBYTE)pre->szMessage;
- MSN_CallService(MS_DB_EVENT_ADD, 0,(LPARAM)&dbei);
-
- return 0;
+ return Proto_AuthRecv(m_szModuleName, pre);
}
////////////////////////////////////////////////////////////////////////////////////////
@@ -375,11 +361,11 @@ int CMsnProto::Authorize(HANDLE hDbEvent)
DBEVENTINFO dbei = { 0 };
dbei.cbSize = sizeof(dbei);
- if ((int)(dbei.cbBlob = MSN_CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDbEvent, 0)) == -1)
+ if ((int)(dbei.cbBlob = CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDbEvent, 0)) == -1)
return 1;
dbei.pBlob = (PBYTE)alloca(dbei.cbBlob);
- if (MSN_CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei))
+ if (CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei))
return 1;
if (dbei.eventType != EVENTTYPE_AUTHREQUEST)
@@ -388,7 +374,7 @@ int CMsnProto::Authorize(HANDLE hDbEvent)
if (strcmp(dbei.szModule, m_szModuleName))
return 1;
- char* nick = (char*)(dbei.pBlob + sizeof(DWORD) + sizeof(HANDLE));
+ char* nick = (char*)(dbei.pBlob + sizeof(DWORD)*2);
char* firstName = nick + strlen(nick) + 1;
char* lastName = firstName + strlen(firstName) + 1;
char* email = lastName + strlen(lastName) + 1;
@@ -415,11 +401,11 @@ int CMsnProto::AuthDeny(HANDLE hDbEvent, const TCHAR* szReason)
DBEVENTINFO dbei = { 0 };
dbei.cbSize = sizeof(dbei);
- if ((int)(dbei.cbBlob = MSN_CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDbEvent, 0)) == -1)
+ if ((int)(dbei.cbBlob = CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDbEvent, 0)) == -1)
return 1;
dbei.pBlob = (PBYTE)alloca(dbei.cbBlob);
- if (MSN_CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei))
+ if (CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei))
return 1;
if (dbei.eventType != EVENTTYPE_AUTHREQUEST)
@@ -428,7 +414,7 @@ int CMsnProto::AuthDeny(HANDLE hDbEvent, const TCHAR* szReason)
if (strcmp(dbei.szModule, m_szModuleName))
return 1;
- char* nick = (char*)(dbei.pBlob + sizeof(DWORD) + sizeof(HANDLE));
+ char* nick = (char*)(dbei.pBlob + sizeof(DWORD)*2);
char* firstName = nick + strlen(nick) + 1;
char* lastName = firstName + strlen(firstName) + 1;
char* email = lastName + strlen(lastName) + 1;
@@ -442,10 +428,10 @@ int CMsnProto::AuthDeny(HANDLE hDbEvent, const TCHAR* szReason)
if (!(msc->list & (LIST_FL | LIST_LL)))
{
- if (msc->hContact) MSN_CallService(MS_DB_CONTACT_DELETE, (WPARAM)msc->hContact, 0);
+ if (msc->hContact) CallService(MS_DB_CONTACT_DELETE, (WPARAM)msc->hContact, 0);
msc->hContact = NULL;
HANDLE hContact = MSN_HContactFromEmail(email);
- if (hContact) MSN_CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0);
+ if (hContact) CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0);
}
return 0;
@@ -808,8 +794,7 @@ int __cdecl CMsnProto::RecvContacts(HANDLE hContact, PROTORECVEVENT*)
int __cdecl CMsnProto::RecvFile(HANDLE hContact, PROTOFILEEVENT* evt)
{
- CCSDATA ccs = { hContact, PSR_FILE, 0, (LPARAM)evt };
- return MSN_CallService(MS_PROTO_RECVFILET, 0, (LPARAM)&ccs);
+ return Proto_RecvFile(hContact, evt);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -823,9 +808,7 @@ int __cdecl CMsnProto::RecvMsg(HANDLE hContact, PROTORECVEVENT* pre)
if (Lists_IsInList(LIST_FL, tEmail))
DBDeleteContactSetting(hContact, "CList", "Hidden");
- CCSDATA ccs = { hContact, PSR_MESSAGE, 0, (LPARAM)pre };
- MSN_CallService(MS_PROTO_RECVMSG, 0, (LPARAM)&ccs);
- return 0;
+ return Proto_RecvMessage(hContact, pre);
}
////////////////////////////////////////////////////////////////////////////////////////
@@ -1232,7 +1215,7 @@ int __cdecl CMsnProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM l
{
char szDbsettings[64];
mir_snprintf(szDbsettings, sizeof(szDbsettings), "%s_HTTPS", m_szModuleName);
- MSN_CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)szDbsettings);
+ CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)szDbsettings);
break;
}
@@ -1243,7 +1226,7 @@ int __cdecl CMsnProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM l
clmi.cbSize = sizeof(CLISTMENUITEM);
clmi.flags = CMIM_NAME | CMIF_TCHAR;
clmi.ptszName = m_tszUserName;
- MSN_CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)mainMenuRoot, (LPARAM)&clmi);
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)mainMenuRoot, (LPARAM)&clmi);
}
break;
diff --git a/protocols/MSN/msn_soapab.cpp b/protocols/MSN/msn_soapab.cpp
index df6f513dbf..b565305199 100644
--- a/protocols/MSN/msn_soapab.cpp
+++ b/protocols/MSN/msn_soapab.cpp
@@ -976,7 +976,7 @@ bool CMsnProto::MSN_ABFind(const char* szMethod, const char* szGuid, bool deltas
char* szCircleTicketEnc = (char*)alloca(cbCircleTicketEnc);
NETLIBBASE64 nlb = { szCircleTicketEnc, cbCircleTicketEnc, (PBYTE)szCircleTicket, cbCircleTicket };
- MSN_CallService(MS_NETLIB_BASE64ENCODE, 0, LPARAM(&nlb));
+ CallService(MS_NETLIB_BASE64ENCODE, 0, LPARAM(&nlb));
if (szCircleTicketEnc[0])
msnNsThread->sendPacket("USR", "SHA A %s", szCircleTicketEnc);
diff --git a/protocols/MSN/msn_srv.cpp b/protocols/MSN/msn_srv.cpp
index 5a4f611ad3..a01cd401da 100644
--- a/protocols/MSN/msn_srv.cpp
+++ b/protocols/MSN/msn_srv.cpp
@@ -346,7 +346,7 @@ void CMsnProto::msn_storeAvatarThread(void* arg)
size_t szEncPngSize = Netlib_GetBase64EncodedBufferSize(dat->dataSize);
szEncBuf = (char*)mir_alloc(szEncPngSize);
NETLIBBASE64 nlb = { szEncBuf, (int)szEncPngSize, dat->data, (int)dat->dataSize };
- MSN_CallService(MS_NETLIB_BASE64ENCODE, 0, LPARAM(&nlb));
+ CallService(MS_NETLIB_BASE64ENCODE, 0, LPARAM(&nlb));
}
if (photoid[0] && dat)
diff --git a/protocols/MSN/msn_std.cpp b/protocols/MSN/msn_std.cpp
index 082e0044ac..588df3c9e9 100644
--- a/protocols/MSN/msn_std.cpp
+++ b/protocols/MSN/msn_std.cpp
@@ -79,7 +79,7 @@ int CMsnProto::getStaticString(HANDLE hContact, const char* valueName, char* de
sVal.pValue = &dbv;
sVal.szModule = m_szModuleName;
sVal.szSetting = valueName;
- if (MSN_CallService(MS_DB_CONTACT_GETSETTINGSTATIC, (WPARAM)hContact, (LPARAM)&sVal) != 0)
+ if (CallService(MS_DB_CONTACT_GETSETTINGSTATIC, (WPARAM)hContact, (LPARAM)&sVal) != 0)
return 1;
return (dbv.type != DBVT_ASCIIZ);
@@ -171,7 +171,7 @@ void CMsnProto::ForkThread(MsnThreadFunc pFunc, void* param)
CloseHandle((HANDLE)mir_forkthreadowner((pThreadFuncOwner)*(void**)&pFunc, this, param, &threadID));
}
-int CMsnProto::SendBroadcast(HANDLE hContact, int type, int result, HANDLE hProcess, LPARAM lParam)
+int CMsnProto::SendBroadcast(HANDLE hContact, int type, int result, HANDLE hProcess, LPARAM lParam)
{
ACKDATA ack = {0};
ack.cbSize = sizeof(ACKDATA);
@@ -181,21 +181,14 @@ int CMsnProto::SendBroadcast(HANDLE hContact, int type, int result, HANDLE hPro
ack.result = result;
ack.hProcess = hProcess;
ack.lParam = lParam;
- return MSN_CallService(MS_PROTO_BROADCASTACK, 0, (LPARAM)&ack);
+ return CallService(MS_PROTO_BROADCASTACK, 0, (LPARAM)&ack);
}
-#if !defined(_DEBUG)
-INT_PTR MSN_CallService(const char* szSvcName, WPARAM wParam, LPARAM lParam)
-{
- return CallService(szSvcName, wParam, lParam);
-}
-#endif
-
-TCHAR* CMsnProto::GetContactNameT(HANDLE hContact)
+TCHAR* CMsnProto::GetContactNameT(HANDLE hContact)
{
if (hContact)
- return (TCHAR*)MSN_CallService(MS_CLIST_GETCONTACTDISPLAYNAME, WPARAM(hContact), GCDNF_TCHAR);
+ return (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, WPARAM(hContact), GCDNF_TCHAR);
else
{
CONTACTINFO ci = {0};
@@ -214,7 +207,7 @@ void MSN_FreeVariant(DBVARIANT* dbv)
DBFreeVariant(dbv);
}
-char* MSN_Translate(const char* str)
+char* MSN_Translate(const char* str)
{
return Translate(str);
}
@@ -222,6 +215,6 @@ char* MSN_Translate(const char* str)
unsigned MSN_GenRandom(void)
{
unsigned rndnum;
- MSN_CallService(MS_UTILS_GETRANDOM, sizeof(rndnum), (LPARAM)&rndnum);
+ CallService(MS_UTILS_GETRANDOM, sizeof(rndnum), (LPARAM)&rndnum);
return rndnum & 0x7FFFFFFF;
}
diff --git a/protocols/MSN/msn_threads.cpp b/protocols/MSN/msn_threads.cpp
index 3581f9afad..ca625b4fa1 100644
--- a/protocols/MSN/msn_threads.cpp
+++ b/protocols/MSN/msn_threads.cpp
@@ -133,7 +133,7 @@ void __cdecl CMsnProto::MSNServerThread(void* arg)
MSN_DebugLog("Thread started: server='%s:%d', type=%d", tConn.szHost, tConn.wPort, info->mType);
- info->s = (HANDLE)MSN_CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)hNetlibUser, (LPARAM)&tConn);
+ info->s = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)hNetlibUser, (LPARAM)&tConn);
if (info->s == NULL)
{
MSN_DebugLog("Connection Failed (%d) server='%s:%d'", WSAGetLastError(), tConn.szHost, tConn.wPort);
@@ -152,7 +152,7 @@ void __cdecl CMsnProto::MSNServerThread(void* arg)
}
if (usingGateway)
- MSN_CallService(MS_NETLIB_SETPOLLINGTIMEOUT, WPARAM(info->s), info->mGatewayTimeout);
+ CallService(MS_NETLIB_SETPOLLINGTIMEOUT, WPARAM(info->s), info->mGatewayTimeout);
MSN_DebugLog("Connected with handle=%08X", info->s);
@@ -321,14 +321,14 @@ void CMsnProto::MSN_CloseConnections(void)
if (T->s != NULL && !T->sessionClosed && !T->termPending)
{
nls.hReadConns[0] = T->s;
- int res = MSN_CallService(MS_NETLIB_SELECTEX, 0, (LPARAM)&nls);
+ int res = CallService(MS_NETLIB_SELECTEX, 0, (LPARAM)&nls);
if (res >= 0 || nls.hReadStatus[0] == 0)
T->sendTerminate();
}
break;
case SERVER_P2P_DIRECT :
- MSN_CallService(MS_NETLIB_SHUTDOWN, (WPARAM)T->s, 0);
+ CallService(MS_NETLIB_SHUTDOWN, (WPARAM)T->s, 0);
break;
}
}
@@ -336,7 +336,7 @@ void CMsnProto::MSN_CloseConnections(void)
LeaveCriticalSection(&sttLock);
if (hHttpsConnection)
- MSN_CallService(MS_NETLIB_SHUTDOWN, (WPARAM)hHttpsConnection, 0);
+ CallService(MS_NETLIB_SHUTDOWN, (WPARAM)hHttpsConnection, 0);
}
void CMsnProto::MSN_CloseThreads(void)
@@ -363,7 +363,7 @@ void CMsnProto::MSN_CloseThreads(void)
ThreadData* T = &sttThreads[i];
if (T->s != NULL)
- MSN_CallService(MS_NETLIB_SHUTDOWN, (WPARAM)T->s, 0);
+ CallService(MS_NETLIB_SHUTDOWN, (WPARAM)T->s, 0);
}
LeaveCriticalSection(&sttLock);
@@ -729,7 +729,7 @@ void ThreadData::applyGatewayData(HANDLE hConn, bool isPoll)
nlhpi.szHttpGetUrl = NULL;
nlhpi.szHttpPostUrl = szHttpPostUrl;
nlhpi.combinePackets = 5;
- MSN_CallService(MS_NETLIB_SETHTTPPROXYINFO, (WPARAM)hConn, (LPARAM)&nlhpi);
+ CallService(MS_NETLIB_SETHTTPPROXYINFO, (WPARAM)hConn, (LPARAM)&nlhpi);
}
void ThreadData::getGatewayUrl(char* dest, int destlen, bool isPoll)
diff --git a/protocols/MSN/msn_ws.cpp b/protocols/MSN/msn_ws.cpp
index b1dff440c8..653343e7f8 100644
--- a/protocols/MSN/msn_ws.cpp
+++ b/protocols/MSN/msn_ws.cpp
@@ -33,10 +33,10 @@ int ThreadData::send(const char data[], size_t datalen)
if (proto->usingGateway && !(mType == SERVER_FILETRANS || mType == SERVER_P2P_DIRECT))
{
mGatewayTimeout = 2;
- MSN_CallService(MS_NETLIB_SETPOLLINGTIMEOUT, WPARAM(s), mGatewayTimeout);
+ CallService(MS_NETLIB_SETPOLLINGTIMEOUT, WPARAM(s), mGatewayTimeout);
}
- int rlen = MSN_CallService(MS_NETLIB_SEND, (WPARAM)s, (LPARAM)&nlb);
+ int rlen = CallService(MS_NETLIB_SEND, (WPARAM)s, (LPARAM)&nlb);
if (rlen == SOCKET_ERROR)
{
// should really also check if sendlen is the same as datalen
@@ -127,7 +127,7 @@ int ThreadData::recv(char* data, size_t datalen)
for (;;)
{
- int ret = MSN_CallService(MS_NETLIB_SELECT, 0, (LPARAM)&nls);
+ int ret = CallService(MS_NETLIB_SELECT, 0, (LPARAM)&nls);
if (ret < 0)
{
proto->MSN_DebugLog("Connection abortively closed, error %d", WSAGetLastError());
@@ -143,7 +143,7 @@ int ThreadData::recv(char* data, size_t datalen)
}
LBL_RecvAgain:
- int ret = MSN_CallService(MS_NETLIB_RECV, (WPARAM)s, (LPARAM)&nlb);
+ int ret = CallService(MS_NETLIB_RECV, (WPARAM)s, (LPARAM)&nlb);
if (ret == 0)
{
proto->MSN_DebugLog("Connection closed gracefully");
@@ -163,14 +163,14 @@ LBL_RecvAgain:
if (sessionClosed || isTimeout()) return 0;
if ((mGatewayTimeout += 2) > 20) mGatewayTimeout = 20;
- MSN_CallService(MS_NETLIB_SETPOLLINGTIMEOUT, WPARAM(s), mGatewayTimeout);
+ CallService(MS_NETLIB_SETPOLLINGTIMEOUT, WPARAM(s), mGatewayTimeout);
goto LBL_RecvAgain;
}
else
{
resetTimeout();
mGatewayTimeout = 1;
- MSN_CallService(MS_NETLIB_SETPOLLINGTIMEOUT, WPARAM(s), mGatewayTimeout);
+ CallService(MS_NETLIB_SETPOLLINGTIMEOUT, WPARAM(s), mGatewayTimeout);
}
}