summaryrefslogtreecommitdiff
path: root/protocols/IcqOscarJ
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-07-08 22:10:14 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-07-08 22:10:14 +0000
commitbb952e431866d131bae95c08e579ec8a00f00343 (patch)
tree60881668cf328b50906346c5f66ce47da2d9ad88 /protocols/IcqOscarJ
parentc181af64bab27eb50e684c64c0a3caa49f8bbe39 (diff)
core protocol helpers for creating protocol evengs, services & threads
git-svn-id: http://svn.miranda-ng.org/main/trunk@5286 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/IcqOscarJ')
-rw-r--r--protocols/IcqOscarJ/src/chan_05ping.cpp2
-rw-r--r--protocols/IcqOscarJ/src/icq_avatar.cpp2
-rw-r--r--protocols/IcqOscarJ/src/icq_direct.cpp4
-rw-r--r--protocols/IcqOscarJ/src/icq_infoupdate.cpp2
-rw-r--r--protocols/IcqOscarJ/src/icq_proto.cpp68
-rw-r--r--protocols/IcqOscarJ/src/icq_proto.h22
-rw-r--r--protocols/IcqOscarJ/src/icq_rates.cpp2
-rw-r--r--protocols/IcqOscarJ/src/icq_server.cpp4
-rw-r--r--protocols/IcqOscarJ/src/icq_servlist.cpp4
-rw-r--r--protocols/IcqOscarJ/src/icq_xstatus.cpp2
-rw-r--r--protocols/IcqOscarJ/src/oscar_filetransfer.cpp4
-rw-r--r--protocols/IcqOscarJ/src/utilities.cpp46
12 files changed, 50 insertions, 112 deletions
diff --git a/protocols/IcqOscarJ/src/chan_05ping.cpp b/protocols/IcqOscarJ/src/chan_05ping.cpp
index 2a2b843509..cc28e5c185 100644
--- a/protocols/IcqOscarJ/src/chan_05ping.cpp
+++ b/protocols/IcqOscarJ/src/chan_05ping.cpp
@@ -78,7 +78,7 @@ void CIcqProto::StartKeepAlive(serverthread_info *info)
return;
if (getSettingByte(NULL, "KeepAlive", DEFAULT_KEEPALIVE_ENABLED))
- CloseHandle( ForkThreadEx(&CIcqProto::KeepAliveThread, info));
+ CloseHandle( ForkThreadEx(&CIcqProto::KeepAliveThread, info, 0));
}
diff --git a/protocols/IcqOscarJ/src/icq_avatar.cpp b/protocols/IcqOscarJ/src/icq_avatar.cpp
index 31581e8fdb..b323030be3 100644
--- a/protocols/IcqOscarJ/src/icq_avatar.cpp
+++ b/protocols/IcqOscarJ/src/icq_avatar.cpp
@@ -999,7 +999,7 @@ isLoggedIn(FALSE), stopThread(FALSE), isActive(FALSE)
m_ratesMutex = new icq_critical_section();
// Create connection thread
- ppro->ForkThread(( IcqThreadFunc )&CIcqProto::AvatarThread, this);
+ ppro->ForkThread((CIcqProto::MyThreadFunc)&CIcqProto::AvatarThread, this);
}
diff --git a/protocols/IcqOscarJ/src/icq_direct.cpp b/protocols/IcqOscarJ/src/icq_direct.cpp
index ac016ba935..cfe357bc58 100644
--- a/protocols/IcqOscarJ/src/icq_direct.cpp
+++ b/protocols/IcqOscarJ/src/icq_direct.cpp
@@ -178,7 +178,7 @@ void icq_newConnectionReceived(HANDLE hNewConnection, DWORD dwRemoteIP, void *pE
{
// Start a new thread for the incomming connection
CIcqProto* ppro = (CIcqProto*)pExtra;
- ppro->ForkThread(( IcqThreadFunc )&CIcqProto::icq_directThread, CreateDTSI(NULL, hNewConnection, -1));
+ ppro->ForkThread((CIcqProto::MyThreadFunc)&CIcqProto::icq_directThread, CreateDTSI(NULL, hNewConnection, -1));
}
// Opens direct connection of specified type to specified contact
@@ -187,7 +187,7 @@ void CIcqProto::OpenDirectConnection(HANDLE hContact, int type, void* pvExtra)
// Create a new connection
directthreadstartinfo* dtsi = CreateDTSI(hContact, NULL, type);
dtsi->pvExtra = pvExtra;
- ForkThread(( IcqThreadFunc )&CIcqProto::icq_directThread, dtsi);
+ ForkThread((MyThreadFunc)&CIcqProto::icq_directThread, dtsi);
}
// Safely close NetLib connection - do not corrupt direct connection list
diff --git a/protocols/IcqOscarJ/src/icq_infoupdate.cpp b/protocols/IcqOscarJ/src/icq_infoupdate.cpp
index 257256fd1f..cf61c3ea3d 100644
--- a/protocols/IcqOscarJ/src/icq_infoupdate.cpp
+++ b/protocols/IcqOscarJ/src/icq_infoupdate.cpp
@@ -46,7 +46,7 @@ void CIcqProto::icq_InitInfoUpdate(void)
m_infoUpdateList[i].queued = 0;
}
- CloseHandle( ForkThreadEx( &CIcqProto::InfoUpdateThread, NULL));
+ ForkThread(&CIcqProto::InfoUpdateThread, 0);
}
bInfoPendingUsers = 0;
diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp
index f25d21827a..cb5ee9948e 100644
--- a/protocols/IcqOscarJ/src/icq_proto.cpp
+++ b/protocols/IcqOscarJ/src/icq_proto.cpp
@@ -71,14 +71,13 @@ static int CompareContactsCache(const icq_contacts_cache *p1, const icq_contacts
}
CIcqProto::CIcqProto( const char* aProtoName, const TCHAR* aUserName ) :
+ PROTO<CIcqProto>(aProtoName, aUserName),
cookies(10, CompareCookies),
directConns(10, CompareConns),
expectedFileRecvs(10, CompareFT),
contactsCache(10, CompareContactsCache),
- cheekySearchId( -1 )
+ cheekySearchId(-1)
{
- ProtoConstructor(this, aProtoName, aUserName);
-
NetLog_Server( "Setting protocol/module name to '%s'", m_szModuleName );
oftMutex = new icq_critical_section();
@@ -90,7 +89,7 @@ CIcqProto::CIcqProto( const char* aProtoName, const TCHAR* aUserName ) :
// Initialize server lists
servlistMutex = new icq_critical_section();
servlistQueueMutex = new icq_critical_section();
- HookProtoEvent(ME_CLIST_GROUPCHANGE, &CIcqProto::ServListCListGroupChange);
+ HookEvent(ME_CLIST_GROUPCHANGE, &CIcqProto::ServListCListGroupChange);
// Initialize status message struct
ZeroMemory(&m_modeMsgs, sizeof(icq_mode_messages));
@@ -98,7 +97,7 @@ CIcqProto::CIcqProto( const char* aProtoName, const TCHAR* aUserName ) :
connectionHandleMutex = new icq_critical_section();
localSeqMutex = new icq_critical_section();
- m_modeMsgsEvent = CreateProtoEvent(ME_ICQ_STATUSMSGREQ);
+ m_modeMsgsEvent = CreateHookableEvent(ME_ICQ_STATUSMSGREQ);
// Initialize cookies
cookieMutex = new icq_critical_section();
@@ -123,42 +122,42 @@ CIcqProto::CIcqProto( const char* aProtoName, const TCHAR* aUserName ) :
db_set_resident(m_szModuleName, DBSETTING_STATUS_MOOD);
// Setup services
- CreateProtoService(PS_CREATEACCMGRUI, &CIcqProto::OnCreateAccMgrUI );
- CreateProtoService(MS_ICQ_SENDSMS, &CIcqProto::SendSms);
- CreateProtoService(PS_SET_NICKNAME, &CIcqProto::SetNickName);
+ CreateService(PS_CREATEACCMGRUI, &CIcqProto::OnCreateAccMgrUI );
+ CreateService(MS_ICQ_SENDSMS, &CIcqProto::SendSms);
+ CreateService(PS_SET_NICKNAME, &CIcqProto::SetNickName);
- CreateProtoService(PS_GETMYAWAYMSG, &CIcqProto::GetMyAwayMsg);
+ CreateService(PS_GETMYAWAYMSG, &CIcqProto::GetMyAwayMsg);
- CreateProtoService(PS_GETINFOSETTING, &CIcqProto::GetInfoSetting);
+ CreateService(PS_GETINFOSETTING, &CIcqProto::GetInfoSetting);
- CreateProtoService(PSS_ADDED, &CIcqProto::SendYouWereAdded);
+ CreateService(PSS_ADDED, &CIcqProto::SendYouWereAdded);
// Session password API
- CreateProtoService(PS_ICQ_SETPASSWORD, &CIcqProto::SetPassword);
+ CreateService(PS_ICQ_SETPASSWORD, &CIcqProto::SetPassword);
// ChangeInfo API
- CreateProtoService(PS_CHANGEINFOEX, &CIcqProto::ChangeInfoEx);
+ CreateService(PS_CHANGEINFOEX, &CIcqProto::ChangeInfoEx);
// Avatar API
- CreateProtoService(PS_GETAVATARINFOT, &CIcqProto::GetAvatarInfo);
- CreateProtoService(PS_GETAVATARCAPS, &CIcqProto::GetAvatarCaps);
- CreateProtoService(PS_GETMYAVATART, &CIcqProto::GetMyAvatar);
- CreateProtoService(PS_SETMYAVATART, &CIcqProto::SetMyAvatar);
+ CreateService(PS_GETAVATARINFOT, &CIcqProto::GetAvatarInfo);
+ CreateService(PS_GETAVATARCAPS, &CIcqProto::GetAvatarCaps);
+ CreateService(PS_GETMYAVATART, &CIcqProto::GetMyAvatar);
+ CreateService(PS_SETMYAVATART, &CIcqProto::SetMyAvatar);
// Custom Status API
- CreateProtoService(PS_SETCUSTOMSTATUSEX, &CIcqProto::SetXStatusEx);
- CreateProtoService(PS_GETCUSTOMSTATUSEX, &CIcqProto::GetXStatusEx);
- CreateProtoService(PS_GETCUSTOMSTATUSICON, &CIcqProto::GetXStatusIcon);
- CreateProtoService(PS_GETADVANCEDSTATUSICON, &CIcqProto::RequestAdvStatusIconIdx);
- CreateProtoService(PS_ICQ_REQUESTCUSTOMSTATUS, &CIcqProto::RequestXStatusDetails);
+ CreateService(PS_SETCUSTOMSTATUSEX, &CIcqProto::SetXStatusEx);
+ CreateService(PS_GETCUSTOMSTATUSEX, &CIcqProto::GetXStatusEx);
+ CreateService(PS_GETCUSTOMSTATUSICON, &CIcqProto::GetXStatusIcon);
+ CreateService(PS_GETADVANCEDSTATUSICON, &CIcqProto::RequestAdvStatusIconIdx);
+ CreateService(PS_ICQ_REQUESTCUSTOMSTATUS, &CIcqProto::RequestXStatusDetails);
- CreateProtoService(MS_ICQ_ADDSERVCONTACT, &CIcqProto::AddServerContact);
+ CreateService(MS_ICQ_ADDSERVCONTACT, &CIcqProto::AddServerContact);
- CreateProtoService(MS_REQ_AUTH, &CIcqProto::RequestAuthorization);
- CreateProtoService(MS_GRANT_AUTH, &CIcqProto::GrantAuthorization);
- CreateProtoService(MS_REVOKE_AUTH, &CIcqProto::RevokeAuthorization);
+ CreateService(MS_REQ_AUTH, &CIcqProto::RequestAuthorization);
+ CreateService(MS_GRANT_AUTH, &CIcqProto::GrantAuthorization);
+ CreateService(MS_REVOKE_AUTH, &CIcqProto::RevokeAuthorization);
- CreateProtoService(MS_XSTATUS_SHOWDETAILS, &CIcqProto::ShowXStatusDetails);
+ CreateService(MS_XSTATUS_SHOWDETAILS, &CIcqProto::ShowXStatusDetails);
// Custom caps
- CreateProtoService(PS_ICQ_ADDCAPABILITY, &CIcqProto::IcqAddCapability);
- CreateProtoService(PS_ICQ_CHECKCAPABILITY, &CIcqProto::IcqCheckCapability);
+ CreateService(PS_ICQ_ADDCAPABILITY, &CIcqProto::IcqAddCapability);
+ CreateService(PS_ICQ_CHECKCAPABILITY, &CIcqProto::IcqCheckCapability);
// Reset a bunch of session specific settings
UpdateGlobalSettings();
@@ -170,7 +169,7 @@ CIcqProto::CIcqProto( const char* aProtoName, const TCHAR* aUserName ) :
// Startup Auto Info-Update thread
icq_InitInfoUpdate();
- HookProtoEvent(ME_CLIST_PREBUILDSTATUSMENU, &CIcqProto::OnPreBuildStatusMenu);
+ HookEvent(ME_CLIST_PREBUILDSTATUSMENU, &CIcqProto::OnPreBuildStatusMenu);
// Register netlib users
NETLIBUSER nlu = {0};
@@ -265,14 +264,11 @@ CIcqProto::~CIcqProto()
SAFE_FREE(&m_modeMsgs.szFfc);
NetLog_Server("%s: Protocol instance '%s' destroyed.", ICQ_PROTOCOL_NAME, m_szModuleName);
- ProtoDestructor(this);
}
-
////////////////////////////////////////////////////////////////////////////////////////
// OnModulesLoadedEx - performs hook registration
-
int CIcqProto::OnModulesLoaded( WPARAM wParam, LPARAM lParam )
{
char pszP2PName[MAX_PATH];
@@ -289,9 +285,9 @@ int CIcqProto::OnModulesLoaded( WPARAM wParam, LPARAM lParam )
modules[3] = pszSrvGroupsName;
CallService("DBEditorpp/RegisterModule",(WPARAM)modules,(LPARAM)4);
- HookProtoEvent(ME_OPT_INITIALISE, &CIcqProto::OnOptionsInit);
- HookProtoEvent(ME_USERINFO_INITIALISE, &CIcqProto::OnUserInfoInit);
- HookProtoEvent(ME_IDLE_CHANGED, &CIcqProto::OnIdleChanged);
+ HookEvent(ME_OPT_INITIALISE, &CIcqProto::OnOptionsInit);
+ HookEvent(ME_USERINFO_INITIALISE, &CIcqProto::OnUserInfoInit);
+ HookEvent(ME_IDLE_CHANGED, &CIcqProto::OnIdleChanged);
InitAvatars();
diff --git a/protocols/IcqOscarJ/src/icq_proto.h b/protocols/IcqOscarJ/src/icq_proto.h
index 5b322f929d..81a4c5755e 100644
--- a/protocols/IcqOscarJ/src/icq_proto.h
+++ b/protocols/IcqOscarJ/src/icq_proto.h
@@ -37,23 +37,17 @@
#define XSTATUS_COUNT 86
-struct CIcqProto;
-typedef void ( __cdecl CIcqProto::*IcqThreadFunc )( void* );
-typedef int ( __cdecl CIcqProto::*IcqEventFunc )( WPARAM, LPARAM );
-typedef INT_PTR ( __cdecl CIcqProto::*IcqServiceFunc )( WPARAM, LPARAM );
-typedef INT_PTR ( __cdecl CIcqProto::*IcqServiceFuncParam )( WPARAM, LPARAM, LPARAM );
-
// for InfoUpdate
struct userinfo
{
- DWORD dwUin;
+ DWORD dwUin;
HANDLE hContact;
- time_t queued;
+ time_t queued;
};
-struct CIcqProto : public PROTO_INTERFACE
+struct CIcqProto : public PROTO<CIcqProto>
{
- CIcqProto( const char*, const TCHAR* );
+ CIcqProto(const char*, const TCHAR*);
~CIcqProto();
//====================================================================================
@@ -898,17 +892,9 @@ struct CIcqProto : public PROTO_INTERFACE
DWORD ReportGenericSendError(HANDLE hContact, int nType, const char* szErrorMsg);
void SetCurrentStatus(int nStatus);
- void ForkThread( IcqThreadFunc pFunc, void* arg );
- HANDLE ForkThreadEx( IcqThreadFunc pFunc, void* arg, UINT* threadID = NULL );
-
void __cdecl ProtocolAckThread(icq_ack_args* pArguments);
void SendProtoAck(HANDLE hContact, DWORD dwCookie, int nAckResult, int nAckType, char* pszMessage);
- HANDLE CreateProtoEvent(const char* szEvent);
- void CreateProtoService(const char* szService, IcqServiceFunc serviceProc);
- void CreateProtoServiceParam(const char* szService, IcqServiceFuncParam serviceProc, LPARAM lParam);
- HANDLE HookProtoEvent(const char* szEvent, IcqEventFunc pFunc);
-
int NetLog_Server(const char *fmt,...);
int NetLog_Direct(const char *fmt,...);
int NetLog_Uni(BOOL bDC, const char *fmt,...);
diff --git a/protocols/IcqOscarJ/src/icq_rates.cpp b/protocols/IcqOscarJ/src/icq_rates.cpp
index 55ac226d31..e2c5734049 100644
--- a/protocols/IcqOscarJ/src/icq_rates.cpp
+++ b/protocols/IcqOscarJ/src/icq_rates.cpp
@@ -365,7 +365,7 @@ void rates_queue::initDelay(int nDelay, IcqRateFunc delaycode)
pArgs->nDelay = nDelay;
pArgs->delaycode = delaycode;
- ppro->ForkThread((IcqThreadFunc)&CIcqProto::rateDelayThread, pArgs);
+ ppro->ForkThread((CIcqProto::MyThreadFunc)&CIcqProto::rateDelayThread, pArgs);
}
diff --git a/protocols/IcqOscarJ/src/icq_server.cpp b/protocols/IcqOscarJ/src/icq_server.cpp
index 1b4e48e804..cb02eec4ad 100644
--- a/protocols/IcqOscarJ/src/icq_server.cpp
+++ b/protocols/IcqOscarJ/src/icq_server.cpp
@@ -385,7 +385,7 @@ void CIcqProto::sendServPacketAsync(icq_packet *packet)
pPacket = (icq_packet*)SAFE_MALLOC(sizeof(icq_packet)); // This will be freed in the new thread
memcpy(pPacket, packet, sizeof(icq_packet));
- ForkThread(( IcqThreadFunc )&CIcqProto::SendPacketAsyncThread, pPacket);
+ ForkThread((MyThreadFunc)&CIcqProto::SendPacketAsyncThread, pPacket);
}
@@ -438,5 +438,5 @@ void CIcqProto::icq_login(const char* szPassword)
// Initialize members
m_avatarsConnectionPending = TRUE;
- serverThreadHandle = ForkThreadEx(( IcqThreadFunc )&CIcqProto::ServerThread, stsi, &serverThreadId);
+ serverThreadHandle = ForkThreadEx((MyThreadFunc)&CIcqProto::ServerThread, stsi, &serverThreadId);
}
diff --git a/protocols/IcqOscarJ/src/icq_servlist.cpp b/protocols/IcqOscarJ/src/icq_servlist.cpp
index ac9667618e..19f029f6ff 100644
--- a/protocols/IcqOscarJ/src/icq_servlist.cpp
+++ b/protocols/IcqOscarJ/src/icq_servlist.cpp
@@ -334,7 +334,7 @@ void CIcqProto::servlistQueueAddGroupItem(servlistgroupitem* pGroupItem, int dwT
if (!servlistQueueThreadHandle)
{
// create new board thread
- servlistQueueThreadHandle = ForkThreadEx( &CIcqProto::servlistQueueThread, &servlistQueueState );
+ servlistQueueThreadHandle = ForkThreadEx(&CIcqProto::servlistQueueThread, &servlistQueueState, 0);
}
else // signal thread, that queue was changed during sleep
servlistQueueState = TRUE;
@@ -444,7 +444,7 @@ void CIcqProto::servlistProcessLogin()
// if the server-list queue contains items and thread is not running, start it
if (servlistQueueCount && !servlistQueueThreadHandle)
- servlistQueueThreadHandle = ForkThreadEx( &CIcqProto::servlistQueueThread, &servlistQueueState );
+ servlistQueueThreadHandle = ForkThreadEx(&CIcqProto::servlistQueueThread, &servlistQueueState, 0);
}
// HERE ENDS SERVER-LIST UPDATE BOARD IMPLEMENTATION //
diff --git a/protocols/IcqOscarJ/src/icq_xstatus.cpp b/protocols/IcqOscarJ/src/icq_xstatus.cpp
index 4453ab2884..59da80a08d 100644
--- a/protocols/IcqOscarJ/src/icq_xstatus.cpp
+++ b/protocols/IcqOscarJ/src/icq_xstatus.cpp
@@ -871,7 +871,7 @@ void CIcqProto::InitXStatusItems(BOOL bAllowStatus)
bXStatusMenuBuilt = ServiceExists(srvFce);
if (!bXStatusMenuBuilt)
- CreateProtoServiceParam(srvFce+len, &CIcqProto::menuXStatus, i);
+ CreateServiceParam(srvFce+len, &CIcqProto::menuXStatus, i);
mi.flags = (bXStatus == i ? CMIF_CHECKED : 0);
mi.icolibItem = i ? hXStatusIcons[i-1] : NULL;
diff --git a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp
index 479002e2ab..b0f42a826d 100644
--- a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp
+++ b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp
@@ -809,7 +809,7 @@ static void oft_newConnectionReceived(HANDLE hNewConnection, DWORD dwRemoteIP, v
otsi->listener = listener;
// Start a new thread for the incomming connection
- listener->ppro->ForkThread(( IcqThreadFunc )&CIcqProto::oft_connectionThread, otsi );
+ listener->ppro->ForkThread((CIcqProto::MyThreadFunc)&CIcqProto::oft_connectionThread, otsi );
}
@@ -1241,7 +1241,7 @@ void CIcqProto::OpenOscarConnection(HANDLE hContact, oscar_filetransfer *ft, int
otsi->type = type;
otsi->ft = ft;
- ForkThread(( IcqThreadFunc )&CIcqProto::oft_connectionThread, otsi );
+ ForkThread((MyThreadFunc)&CIcqProto::oft_connectionThread, otsi );
}
diff --git a/protocols/IcqOscarJ/src/utilities.cpp b/protocols/IcqOscarJ/src/utilities.cpp
index 593fa6408c..99d9b690dc 100644
--- a/protocols/IcqOscarJ/src/utilities.cpp
+++ b/protocols/IcqOscarJ/src/utilities.cpp
@@ -1082,7 +1082,7 @@ void CIcqProto::SendProtoAck(HANDLE hContact, DWORD dwCookie, int nAckResult, in
pArgs->nAckType = nAckType;
pArgs->pszMessage = (LPARAM)null_strdup(pszMessage);
- ForkThread(( IcqThreadFunc )&CIcqProto::ProtocolAckThread, pArgs );
+ ForkThread((MyThreadFunc)&CIcqProto::ProtocolAckThread, pArgs );
}
void CIcqProto::SetCurrentStatus(int nStatus)
@@ -1829,17 +1829,6 @@ char* __fastcall ICQTranslateUtfStatic(const char *src, char *buf, size_t bufsiz
return buf;
}
-void CIcqProto::ForkThread( IcqThreadFunc pFunc, void* arg )
-{
- CloseHandle(( HANDLE )mir_forkthreadowner(( pThreadFuncOwner )*( void** )&pFunc, this, arg, NULL ));
-}
-
-HANDLE CIcqProto::ForkThreadEx( IcqThreadFunc pFunc, void* arg, UINT* threadID )
-{
- return ( HANDLE )mir_forkthreadowner(( pThreadFuncOwner )*( void** )&pFunc, this, arg, threadID );
-}
-
-
char* CIcqProto::GetUserStoredPassword(char *szBuffer, int cbSize)
{
if (!getSettingStringStatic(NULL, "Password", szBuffer, cbSize))
@@ -2117,36 +2106,3 @@ DWORD CIcqProto::ReportGenericSendError(HANDLE hContact, int nType, const char*
SendProtoAck(hContact, dwCookie, ACKRESULT_FAILED, nType, Translate(szErrorMsg));
return dwCookie;
}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-void CIcqProto::CreateProtoService(const char* szService, IcqServiceFunc serviceProc)
-{
- char temp[MAX_PATH*2];
-
- null_snprintf(temp, sizeof(temp), "%s%s", m_szModuleName, szService);
- CreateServiceFunctionObj( temp, ( MIRANDASERVICEOBJ )*( void** )&serviceProc, this );
-}
-
-void CIcqProto::CreateProtoServiceParam(const char* szService, IcqServiceFuncParam serviceProc, LPARAM lParam)
-{
- char temp[MAX_PATH*2];
-
- null_snprintf(temp, sizeof(temp), "%s%s", m_szModuleName, szService);
- CreateServiceFunctionObjParam( temp, ( MIRANDASERVICEOBJPARAM )*( void** )&serviceProc, this, lParam );
-}
-
-
-HANDLE CIcqProto::HookProtoEvent(const char* szEvent, IcqEventFunc pFunc)
-{
- return ::HookEventObj(szEvent, (MIRANDAHOOKOBJ)*(void**)&pFunc, this);
-}
-
-
-HANDLE CIcqProto::CreateProtoEvent(const char* szEvent)
-{
- char str[MAX_PATH + 32];
- strcpy(str, m_szModuleName);
- strcat(str, szEvent);
- return CreateHookableEvent(str);
-}