diff options
75 files changed, 499 insertions, 503 deletions
diff --git a/include/m_protoint.h b/include/m_protoint.h index 7f1230b06b..77612e8ee7 100644 --- a/include/m_protoint.h +++ b/include/m_protoint.h @@ -150,8 +150,8 @@ struct  PROTO_INTERFACE : public MZeroedObject  	//////////////////////////////////////////////////////////////////////////////////////
  	// Virtual functions
 -	virtual	HANDLE   __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr) = 0;
 -	virtual	HANDLE   __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent) = 0;
 +	virtual	HCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr) = 0;
 +	virtual	HCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent) = 0;
  	virtual	int      __cdecl Authorize(HANDLE hDbEvent) = 0;
  	virtual	int      __cdecl AuthDeny(HANDLE hDbEvent, const PROTOCHAR* szReason) = 0;
 diff --git a/plugins/AvatarHistory/src/popup.cpp b/plugins/AvatarHistory/src/popup.cpp index 34a39ec6c7..ed36550961 100644 --- a/plugins/AvatarHistory/src/popup.cpp +++ b/plugins/AvatarHistory/src/popup.cpp @@ -70,7 +70,7 @@ void ShowTestPopup(HCONTACT hContact,const TCHAR *title, const TCHAR *descriptio  void ShowPopup(HCONTACT hContact, const TCHAR *title, const TCHAR *description)
  {
 -	ShowPopupEx(hContact, title, description, hContact, POPUP_TYPE_NORMAL, &opts);
 +	ShowPopupEx(hContact, title, description, (void*)hContact, POPUP_TYPE_NORMAL, &opts);
  }
  void ShowDebugPopup(HCONTACT hContact, const TCHAR *title, const TCHAR *description)
 diff --git a/plugins/BasicHistory/src/EventList.cpp b/plugins/BasicHistory/src/EventList.cpp index 044b32e3e5..e354353c89 100644 --- a/plugins/BasicHistory/src/EventList.cpp +++ b/plugins/BasicHistory/src/EventList.cpp @@ -237,7 +237,7 @@ void EventList::RefreshEventList()  		std::vector<IImport::ExternalMessage> messages;
  		EnterCriticalSection(&criticalSection);
 -		std::map<HANDLE, EventList::ImportDiscData>::iterator it = contactFileMap.find(hContact);
 +		std::map<HCONTACT, EventList::ImportDiscData>::iterator it = contactFileMap.find(hContact);
  		if (it != contactFileMap.end()) {
  			ExportManager imp(hWnd, hContact, 1);
  			imp.SetAutoImport(it->second.file);
 @@ -307,7 +307,7 @@ bool EventList::SearchInContact(HCONTACT hContact, TCHAR *strFind, ComparatorInt  		std::vector<IImport::ExternalMessage> messages;
  		EnterCriticalSection(&criticalSection);
 -		std::map<HANDLE, EventList::ImportDiscData>::iterator it = contactFileMap.find(hContact);
 +		std::map<HCONTACT, EventList::ImportDiscData>::iterator it = contactFileMap.find(hContact);
  		if (it != contactFileMap.end()) {
  			ExportManager imp(hWnd, hContact, 1);
  			imp.SetAutoImport(it->second.file);
 @@ -640,7 +640,7 @@ void EventList::RebuildGroup(int selected)  }
  CRITICAL_SECTION EventList::criticalSection;
 -std::map<HANDLE, EventList::ImportDiscData> EventList::contactFileMap;
 +std::map<HCONTACT, EventList::ImportDiscData> EventList::contactFileMap;
  std::wstring EventList::contactFileDir;
  void EventList::AddImporter(HCONTACT hContact, IImport::ImportType type, const std::wstring& file)
 @@ -677,7 +677,7 @@ int EventList::GetContactMessageNumber(HCONTACT hContact)  {
  	int count = db_event_count(hContact);
  	EnterCriticalSection(&criticalSection);
 -	std::map<HANDLE, EventList::ImportDiscData>::iterator it = contactFileMap.find(hContact);
 +	std::map<HCONTACT, EventList::ImportDiscData>::iterator it = contactFileMap.find(hContact);
  	if (it != contactFileMap.end())
  		++count;
 @@ -689,7 +689,7 @@ bool EventList::IsImportedHistory(HCONTACT hContact)  {
  	bool count = false;
  	EnterCriticalSection(&criticalSection);
 -	std::map<HANDLE, EventList::ImportDiscData>::iterator it = contactFileMap.find(hContact);
 +	std::map<HCONTACT, EventList::ImportDiscData>::iterator it = contactFileMap.find(hContact);
  	if (it != contactFileMap.end())
  		count = true;
 @@ -700,7 +700,7 @@ bool EventList::IsImportedHistory(HCONTACT hContact)  void EventList::DeleteImporter(HCONTACT hContact)
  {
  	EnterCriticalSection(&criticalSection);
 -	std::map<HANDLE, EventList::ImportDiscData>::iterator it = contactFileMap.find(hContact);
 +	std::map<HCONTACT, EventList::ImportDiscData>::iterator it = contactFileMap.find(hContact);
  	if (it != contactFileMap.end()) {
  		DeleteFile(it->second.file.c_str());
  		contactFileMap.erase(it);
 diff --git a/plugins/BasicHistory/src/EventList.h b/plugins/BasicHistory/src/EventList.h index 6a3327760c..35d675e4d4 100644 --- a/plugins/BasicHistory/src/EventList.h +++ b/plugins/BasicHistory/src/EventList.h @@ -72,7 +72,7 @@ private:  		std::wstring file;
  	};
 -	static std::map<HANDLE, ImportDiscData> contactFileMap;
 +	static std::map<HCONTACT, ImportDiscData> contactFileMap;
  	static std::wstring contactFileDir;
  	bool CanShowHistory(DBEVENTINFO* dbei);
 diff --git a/plugins/BasicHistory/src/HistoryWindow.cpp b/plugins/BasicHistory/src/HistoryWindow.cpp index 766b8805d6..7d95ac81e7 100644 --- a/plugins/BasicHistory/src/HistoryWindow.cpp +++ b/plugins/BasicHistory/src/HistoryWindow.cpp @@ -112,23 +112,23 @@ HistoryWindow::~HistoryWindow()  		DeleteObject(bkFindBrush);
  }
 -std::map<HANDLE, HistoryWindow*> HistoryWindow::windows;
 +std::map<HCONTACT, HistoryWindow*> HistoryWindow::windows;
  std::vector<HistoryWindow*> HistoryWindow::freeWindows;
  void HistoryWindow::Deinit()
  {
  	bool destroyed = true;
 -	std::vector<HANDLE> keys;
 -	for (std::map<HANDLE, HistoryWindow*>::iterator it = windows.begin(); it != windows.end(); ++it)
 +	std::vector<HCONTACT> keys;
 +	for (std::map<HCONTACT, HistoryWindow*>::iterator it = windows.begin(); it != windows.end(); ++it)
  	{
  		if (!it->second->isDestroyed)
  		{
  			keys.push_back(it->first);
  		}
  	}
 -	for (std::vector<HANDLE>::iterator it = keys.begin(); it != keys.end(); ++it)
 +	for (std::vector<HCONTACT>::iterator it = keys.begin(); it != keys.end(); ++it)
  	{
 -		std::map<HANDLE, HistoryWindow*>::iterator it1 = windows.find(*it);
 +		std::map<HCONTACT, HistoryWindow*>::iterator it1 = windows.find(*it);
  		if (it1 != windows.end())
  		{
  			DestroyWindow(it1->second->hWnd);
 @@ -160,7 +160,7 @@ void HistoryWindow::Deinit()  	if (destroyed)
  	{
 -		for (std::map<HANDLE, HistoryWindow*>::iterator it = windows.begin(); it != windows.end(); ++it)
 +		for (std::map<HCONTACT, HistoryWindow*>::iterator it = windows.begin(); it != windows.end(); ++it)
  		{
  			delete it->second;
  		}
 @@ -186,7 +186,7 @@ void HistoryWindow::Open(HCONTACT hContact)  	}
  	else
  	{
 -		std::map<HANDLE, HistoryWindow*>::iterator it = windows.find(hContact);
 +		std::map<HCONTACT, HistoryWindow*>::iterator it = windows.find(hContact);
  		if (it != windows.end())
  		{
  			it->second->Focus();
 @@ -201,7 +201,7 @@ void HistoryWindow::Open(HCONTACT hContact)  void HistoryWindow::Close(HCONTACT hContact)
  {
 -	std::map<HANDLE, HistoryWindow*>::iterator it = windows.find(hContact);
 +	std::map<HCONTACT, HistoryWindow*>::iterator it = windows.find(hContact);
  	if (it != windows.end())
  	{
  		if (it->second->isDestroyed)
 @@ -223,7 +223,7 @@ void  HistoryWindow::Close(HistoryWindow* historyWindow)  		DestroyWindow(historyWindow->hWnd);
  		return;
  	}
 -	std::map<HANDLE, HistoryWindow*>::iterator it = windows.find(historyWindow->hContact);
 +	std::map<HCONTACT, HistoryWindow*>::iterator it = windows.find(historyWindow->hContact);
  	if (it != windows.end() && it->second == historyWindow)
  	{
  		delete it->second;
 @@ -247,7 +247,7 @@ void HistoryWindow::RebuildEvents(HCONTACT hContact)  {
  	if (hContact != NULL)
  	{
 -		std::map<HANDLE, HistoryWindow*>::iterator it = windows.find(hContact);
 +		std::map<HCONTACT, HistoryWindow*>::iterator it = windows.find(hContact);
  		if (it != windows.end() && !it->second->isDestroyed)
  		{
  			SendMessage(it->second->hWnd,DM_HREBUILD,0,0);
 @@ -265,7 +265,7 @@ void HistoryWindow::RebuildEvents(HCONTACT hContact)  void HistoryWindow::ChangeToFreeWindow(HistoryWindow* historyWindow)
  {
 -	std::map<HANDLE, HistoryWindow*>::iterator it = windows.find(historyWindow->hContact);
 +	std::map<HCONTACT, HistoryWindow*>::iterator it = windows.find(historyWindow->hContact);
  	if (it != windows.end() && it->second == historyWindow)
  	{
  		windows.erase(it);
 @@ -294,7 +294,7 @@ void HistoryWindow::Focus()  int HistoryWindow::FontsChanged(WPARAM wParam, LPARAM lParam)
  {
 -	for (std::map<HANDLE, HistoryWindow*>::iterator it = windows.begin(); it != windows.end(); ++it)
 +	for (std::map<HCONTACT, HistoryWindow*>::iterator it = windows.begin(); it != windows.end(); ++it)
  	{
  		if (!it->second->isDestroyed)
  		{
 @@ -345,7 +345,7 @@ void OptionsGroupChanged()  void HistoryWindow::OptionsGroupChanged()
  {
 -	for (std::map<HANDLE, HistoryWindow*>::iterator it = windows.begin(); it != windows.end(); ++it)
 +	for (std::map<HCONTACT, HistoryWindow*>::iterator it = windows.begin(); it != windows.end(); ++it)
  	{
  		if (!it->second->isDestroyed)
  		{
 @@ -371,7 +371,7 @@ void OptionsMainChanged()  void HistoryWindow::OptionsMainChanged()
  {
 -	for (std::map<HANDLE, HistoryWindow*>::iterator it = windows.begin(); it != windows.end(); ++it)
 +	for (std::map<HCONTACT, HistoryWindow*>::iterator it = windows.begin(); it != windows.end(); ++it)
  	{
  		if (!it->second->isDestroyed)
  		{
 @@ -406,7 +406,7 @@ void OptionsSearchingChanged()  void HistoryWindow::OptionsSearchingChanged()
  {
 -	for (std::map<HANDLE, HistoryWindow*>::iterator it = windows.begin(); it != windows.end(); ++it)
 +	for (std::map<HCONTACT, HistoryWindow*>::iterator it = windows.begin(); it != windows.end(); ++it)
  	{
  		if (!it->second->isDestroyed)
  		{
 @@ -435,7 +435,7 @@ INT_PTR HistoryWindow::DeleteAllUserHistory(WPARAM wParam, LPARAM)  	if (!count)
  		return FALSE;
 -	for (std::map<HANDLE, HistoryWindow*>::iterator it = windows.begin(); it != windows.end(); ++it)
 +	for (std::map<HCONTACT, HistoryWindow*>::iterator it = windows.begin(); it != windows.end(); ++it)
  	{
  		if (!it->second->isDestroyed)
  		{
 @@ -495,7 +495,7 @@ INT_PTR HistoryWindow::DeleteAllUserHistory(WPARAM wParam, LPARAM)  bool HistoryWindow::IsInList(HWND hWnd)
  {
 -	for (std::map<HANDLE, HistoryWindow*>::iterator it = windows.begin(); it != windows.end(); ++it)
 +	for (std::map<HCONTACT, HistoryWindow*>::iterator it = windows.begin(); it != windows.end(); ++it)
  		if (!it->second->isDestroyed)
  			if (it->second->hWnd == hWnd)
  				return true;
 @@ -1643,7 +1643,7 @@ void HistoryWindow::ReloadContacts()  			cii.cbSize = sizeof(cii);
  			cii.flags = CLCIIF_GROUPFONT | CLCIIF_BELOWCONTACTS;
  			cii.pszText = TranslateT("System");
 -			hSystem = (HANDLE) SendMessage(contactList, CLM_ADDINFOITEM, 0, (LPARAM) & cii);
 +			hSystem = (HCONTACT)SendMessage(contactList, CLM_ADDINFOITEM, 0, (LPARAM) & cii);
  		}
  	}
  	else
 @@ -2333,7 +2333,7 @@ HCONTACT HistoryWindow::GetNextContact(HCONTACT hContact, int adder)  	return hContact;
  }
 -void HistoryWindow::SelectContact(HANDLE _hContact)
 +void HistoryWindow::SelectContact(HCONTACT _hContact)
  {
  	if (hContact != _hContact) {
  		HWND contactList = GetDlgItem(hWnd,IDC_LIST_CONTACTS);
 diff --git a/plugins/BasicHistory/src/HistoryWindow.h b/plugins/BasicHistory/src/HistoryWindow.h index 4bebe0e738..339866edf4 100644 --- a/plugins/BasicHistory/src/HistoryWindow.h +++ b/plugins/BasicHistory/src/HistoryWindow.h @@ -49,7 +49,7 @@ private:  	void ReloadMainOptions();
  	void DoImport(IImport::ImportType type);
 -	static std::map<HANDLE, HistoryWindow*> windows;
 +	static std::map<HCONTACT, HistoryWindow*> windows;
  	static std::vector<HistoryWindow*> freeWindows;
  	bool isDestroyed;
  	LONG splitterY;
 @@ -67,7 +67,7 @@ private:  	HIMAGELIST himlSmall, himlNone;
  	HBRUSH bkBrush;
  	HBRUSH bkFindBrush;
 -	HANDLE hSystem;
 +	HCONTACT hSystem;
  	HWND splitterXhWnd, splitterYhWnd;
  	bool isStartSelect;
  protected:
 @@ -90,6 +90,6 @@ public:  	// SearchContext interface
  	virtual void SelectEventGroup(int sel);
  	virtual HCONTACT GetNextContact(HCONTACT hContact, int adder);
 -	virtual void SelectContact(HANDLE _hContact);
 +	virtual void SelectContact(HCONTACT _hContact);
  };
 diff --git a/plugins/BasicHistory/src/Options.cpp b/plugins/BasicHistory/src/Options.cpp index bd563ed046..f61be22121 100644 --- a/plugins/BasicHistory/src/Options.cpp +++ b/plugins/BasicHistory/src/Options.cpp @@ -1568,7 +1568,7 @@ void ResetListOptions(HWND hwnd)  		SendMessage(hwnd, CLM_SETTEXTCOLOR, i, GetSysColor(COLOR_WINDOWTEXT));
  }
 -void RebuildList(HWND hwnd, HANDLE hSystem, TaskOptions* to)
 +void RebuildList(HWND hwnd, HCONTACT hSystem, TaskOptions* to)
  {
  	HANDLE hItem;
  	if (to->isSystem && hSystem)
 @@ -1581,11 +1581,11 @@ void RebuildList(HWND hwnd, HANDLE hSystem, TaskOptions* to)  	}
  }
 -void SaveList(HWND hwnd, HANDLE hSystem, TaskOptions* to)
 +void SaveList(HWND hwnd, HCONTACT hSystem, TaskOptions* to)
  {
  	to->contacts.clear();
  	if (hSystem)
 -		to->isSystem = SendMessage(hwnd, CLM_GETCHECKMARK, (WPARAM) hSystem, 0) != 0;
 +		to->isSystem = SendMessage(hwnd, CLM_GETCHECKMARK, (WPARAM)hSystem, 0) != 0;
  	for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
  		HANDLE hItem = (HANDLE) SendMessage(hwnd, CLM_FINDCONTACT, (WPARAM) hContact, 0);
 @@ -1602,7 +1602,7 @@ bool IsValidTask(TaskOptions& to, std::list<TaskOptions>* top = NULL, std::wstri  INT_PTR CALLBACK Options::DlgProcOptsTask(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
  {
 -	static HANDLE hSystem;
 +	static HCONTACT hSystem;
  	switch(msg) {
  	case WM_INITDIALOG:
  		TranslateDialogDefault(hwndDlg);
 @@ -1738,7 +1738,7 @@ INT_PTR CALLBACK Options::DlgProcOptsTask(HWND hwndDlg, UINT msg, WPARAM wParam,  			cii.cbSize = sizeof(cii);
  			cii.flags = CLCIIF_GROUPFONT | CLCIIF_CHECKBOX | CLCIIF_BELOWCONTACTS;
  			cii.pszText = TranslateT("System");
 -			hSystem = (HANDLE) SendMessage(contactList, CLM_ADDINFOITEM, 0, (LPARAM) & cii);
 +			hSystem = (HCONTACT)SendMessage(contactList, CLM_ADDINFOITEM, 0, (LPARAM) & cii);
  			SendMessage(contactList, CLM_AUTOREBUILD, 0, 0);
  			ResetListOptions(contactList);
  			RebuildList(contactList, hSystem, to);
 diff --git a/plugins/BasicHistory/src/Scheduler.cpp b/plugins/BasicHistory/src/Scheduler.cpp index 9f52474d35..dcd9dd5593 100644 --- a/plugins/BasicHistory/src/Scheduler.cpp +++ b/plugins/BasicHistory/src/Scheduler.cpp @@ -410,8 +410,8 @@ bool DoTask(TaskOptions& to)  			}
  			if (contactList.size() > 0) {
 -				HANDLE* contacts = new HANDLE[contactList.size() + 1];
 -				contacts[0] = (HANDLE)contactList.size();
 +				HCONTACT *contacts = new HCONTACT[contactList.size() + 1];
 +				contacts[0] = (HCONTACT)contactList.size();
  				int i = 1;
  				for (std::list<HCONTACT>::iterator it = contactList.begin(); it != contactList.end(); ++it)
  					contacts[i++] = *it;
 diff --git a/plugins/BasicHistory/src/SearchContext.h b/plugins/BasicHistory/src/SearchContext.h index dd16d95d79..4c9e6f04dc 100644 --- a/plugins/BasicHistory/src/SearchContext.h +++ b/plugins/BasicHistory/src/SearchContext.h @@ -30,7 +30,7 @@ public:  	virtual void SelectEventGroup(int sel) = 0;
  	virtual HCONTACT GetNextContact(HCONTACT hContact, int adder) = 0;
 -	virtual void SelectContact(HANDLE _hContact) = 0;
 +	virtual void SelectContact(HCONTACT _hContact) = 0;
  	struct MessageData
  	{
 diff --git a/plugins/BasicHistory/src/Searcher.h b/plugins/BasicHistory/src/Searcher.h index 274f738082..e8ce263f11 100644 --- a/plugins/BasicHistory/src/Searcher.h +++ b/plugins/BasicHistory/src/Searcher.h @@ -26,7 +26,7 @@ private:  	int lastFindSelection;
  	int startFindPos;
  	int startFindSel;
 -	HANDLE startFindContact;
 +	HCONTACT startFindContact;
  	bool isFindSelChanged;
  	bool isFindContactChanged;
  	bool findBack, matchCase, matchWholeWords, onlyIn, onlyOut, onlyGroup, allUsers, searchForInLG, searchForInMes;
 diff --git a/plugins/BuddyPounce/src/dialog.cpp b/plugins/BuddyPounce/src/dialog.cpp index d47444d3bd..3307f81901 100644 --- a/plugins/BuddyPounce/src/dialog.cpp +++ b/plugins/BuddyPounce/src/dialog.cpp @@ -10,7 +10,7 @@ void populateSettingsList(HWND hwnd2List)  	SendMessage(hwnd2List, LB_ADDSTRING, 0, (LPARAM)TranslateT("Confirmation Window"));
  }
 -void populateContacts(HANDLE BPhContact,HWND hwnd2CB)
 +void populateContacts(HCONTACT BPhContact, HWND hwnd2CB)
  {
  	for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
  		char *szProto = GetContactProto(hContact);
 diff --git a/plugins/FingerprintNG/src/fingerprint.cpp b/plugins/FingerprintNG/src/fingerprint.cpp index cf778443a1..82addeed47 100644 --- a/plugins/FingerprintNG/src/fingerprint.cpp +++ b/plugins/FingerprintNG/src/fingerprint.cpp @@ -167,7 +167,7 @@ int __fastcall ApplyFingerprintImage(HCONTACT hContact, LPTSTR szMirVer)  	ExtraIcon_SetIcon(hExtraIcon, hContact, hImage);
 -	if (arMonitoredWindows.getIndex(hContact) != -1)
 +	if (arMonitoredWindows.getIndex((HANDLE)hContact) != -1)
  		SetSrmmIcon(hContact, szMirVer);
  	return 0;
  }
 @@ -905,7 +905,7 @@ static int OnSrmmWindowEvent(WPARAM wParam, LPARAM lParam)  		if (szProto != NULL)
  			ptszMirVer = db_get_tsa(event->hContact, szProto, "MirVer");
  		SetSrmmIcon(event->hContact, ptszMirVer);
 -		arMonitoredWindows.insert(event->hContact);
 +		arMonitoredWindows.insert((HANDLE)event->hContact);
  	}
  	else if (event->uType == MSG_WINDOW_EVT_CLOSE)
  		arMonitoredWindows.remove(event->hContact);
 diff --git a/plugins/MirFox/src/MirandaUtils.cpp b/plugins/MirFox/src/MirandaUtils.cpp index 2fefc5b8ec..f3491471c7 100644 --- a/plugins/MirFox/src/MirandaUtils.cpp +++ b/plugins/MirFox/src/MirandaUtils.cpp @@ -213,8 +213,7 @@ void MirandaUtils::sendMessage(ActionThreadArgStruct* args, MFENUM_SEND_MESSAGE_  		}
 -
 -		MirandaContact* mirandaContact = args->mirfoxDataPtr->getMirandaContactPtrByHandle(args->targetHandle);
 +		MirandaContact* mirandaContact = args->mirfoxDataPtr->getMirandaContactPtrByHandle((HCONTACT)args->targetHandle);
  		const wchar_t* contactNameW = NULL;
  		TCHAR* tszAccountName = NULL;
  		if (mirandaContact){
 diff --git a/plugins/MirFox/src/MirfoxData.cpp b/plugins/MirFox/src/MirfoxData.cpp index ddb6ebdc8e..0f82d638f8 100644 --- a/plugins/MirFox/src/MirfoxData.cpp +++ b/plugins/MirFox/src/MirfoxData.cpp @@ -49,7 +49,7 @@ void MirfoxData::clearMirandaContacts(){  }
  int
 -MirfoxData::updateMirandaContactState(HANDLE contactHandle, MFENUM_MIRANDACONTACT_STATE & contactState)
 +MirfoxData::updateMirandaContactState(HCONTACT contactHandle, MFENUM_MIRANDACONTACT_STATE & contactState)
  {
  	boost::ptr_list<MirandaContact>* mirandaContactsPtr = getMirandaContacts();
 @@ -65,7 +65,7 @@ MirfoxData::updateMirandaContactState(HANDLE contactHandle, MFENUM_MIRANDACONTAC  }
  MirandaContact*
 -MirfoxData::getMirandaContactPtrByHandle(HANDLE contactHandle){
 +MirfoxData::getMirandaContactPtrByHandle(HCONTACT contactHandle){
  	MFLogger* logger = MFLogger::getInstance();
 diff --git a/plugins/MirFox/src/MirfoxData.h b/plugins/MirFox/src/MirfoxData.h index fe98ff31b4..8fe5729107 100644 --- a/plugins/MirFox/src/MirfoxData.h +++ b/plugins/MirFox/src/MirfoxData.h @@ -134,10 +134,10 @@ public:  	//update MirandaContact's state by id
  	//return 0 - ok,
 -	int updateMirandaContactState(HANDLE contactHandle, MFENUM_MIRANDACONTACT_STATE & contactState);
 +	int updateMirandaContactState(HCONTACT contactHandle, MFENUM_MIRANDACONTACT_STATE & contactState);
  	//return MirandaContact* by HANDLE
 -	MirandaContact* getMirandaContactPtrByHandle(HANDLE contactHandle);
 +	MirandaContact* getMirandaContactPtrByHandle(HCONTACT contactHandle);
 diff --git a/plugins/New_GPG/src/init.cpp b/plugins/New_GPG/src/init.cpp index b0a2232cce..fd21bdaf2f 100644 --- a/plugins/New_GPG/src/init.cpp +++ b/plugins/New_GPG/src/init.cpp @@ -31,7 +31,7 @@ XML_API xi = {0};  int hLangpack = 0;
  logtofile debuglog;
  bool gpg_valid = false, gpg_keyexist = false;
 -std::map<HANDLE, contact_data> hcontact_data;
 +std::map<HCONTACT, contact_data> hcontact_data;
  PLUGININFOEX pluginInfo={
  	sizeof(PLUGININFOEX),
 diff --git a/plugins/New_GPG/src/main.h b/plugins/New_GPG/src/main.h index 353dee0aae..36a7bafb0f 100644 --- a/plugins/New_GPG/src/main.h +++ b/plugins/New_GPG/src/main.h @@ -22,7 +22,7 @@ struct contact_data  	string key_in_prescense;
  };
 -extern std::map<HANDLE, contact_data> hcontact_data;
 +extern std::map<HCONTACT, contact_data> hcontact_data;
  extern bool bAutoExchange;
  extern RECT key_from_keyserver_rect, firstrun_rect, new_key_rect, key_gen_rect, load_key_rect, import_key_rect, key_password_rect, load_existing_key_rect;
 diff --git a/plugins/New_GPG/src/messages.cpp b/plugins/New_GPG/src/messages.cpp index b9deb63655..514f7ae2c8 100755 --- a/plugins/New_GPG/src/messages.cpp +++ b/plugins/New_GPG/src/messages.cpp @@ -485,8 +485,6 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l)  					}  					db_set_b(ccs->hContact, szGPGModuleName, "GPGEncryption", 1);  					db_set_b(ccs->hContact, szGPGModuleName, "bAlwatsTrust", 1); -					void setSrmmIcon(HANDLE); -					void setClistIcon(HANDLE);  					setSrmmIcon(ccs->hContact);  					setClistIcon(ccs->hContact);  					if(metaIsSubcontact(ccs->hContact)) diff --git a/plugins/New_GPG/src/metacontacts.cpp b/plugins/New_GPG/src/metacontacts.cpp index dcf7667f4f..27c6963213 100644 --- a/plugins/New_GPG/src/metacontacts.cpp +++ b/plugins/New_GPG/src/metacontacts.cpp @@ -32,7 +32,7 @@ bool metaIsProtoMetaContacts(HCONTACT hContact)  bool metaIsDefaultSubContact(HCONTACT hContact) 
  {
  	if(bMetaContacts)
 -		return (HANDLE)CallService(MS_MC_GETDEFAULTCONTACT,(WPARAM)CallService(MS_MC_GETMETACONTACT,(WPARAM)hContact,0),0)==hContact;
 +		return (HCONTACT)CallService(MS_MC_GETDEFAULTCONTACT,(WPARAM)CallService(MS_MC_GETMETACONTACT,(WPARAM)hContact,0),0)==hContact;
  	return false;
  }
 diff --git a/plugins/New_GPG/src/options.cpp b/plugins/New_GPG/src/options.cpp index 75279c7e96..3f43a4e9fd 100755 --- a/plugins/New_GPG/src/options.cpp +++ b/plugins/New_GPG/src/options.cpp @@ -738,7 +738,6 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam  				msg += (char*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hcnt, 0);
  				SetWindowTextA(hwndDlg, msg.c_str());
  			}
 -			bool isContactSecured(HANDLE);
  			if(!hcnt)
  			{
  				EnableWindow(GetDlgItem(hwndDlg, IDC_SELECT_EXISTING), 0);
 @@ -1182,8 +1181,6 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam  					key_buf.clear();
  					if(IsDlgButtonChecked(hwndDlg, IDC_ENABLE_ENCRYPTION))
  					{
 -						void setSrmmIcon(HANDLE);
 -						void setClistIcon(HANDLE);
  						if(hContact)
  						{
  							if(metaIsProtoMetaContacts(hContact))
 diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp index d1122dca94..1170542944 100755 --- a/plugins/New_GPG/src/utilities.cpp +++ b/plugins/New_GPG/src/utilities.cpp @@ -1754,7 +1754,7 @@ INT_PTR ImportGpGKeys(WPARAM w, LPARAM l)  						string output;  						DWORD exitcode;  						{ -							HANDLE hcnt = hContact; +							HCONTACT hcnt = hContact;  							ptmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", _T(""));  							path = ptmp;  							mir_free(ptmp); diff --git a/plugins/NewsAggregator/Src/Services.cpp b/plugins/NewsAggregator/Src/Services.cpp index ee03c41900..8f508afdc0 100644 --- a/plugins/NewsAggregator/Src/Services.cpp +++ b/plugins/NewsAggregator/Src/Services.cpp @@ -145,7 +145,7 @@ static void __cdecl AckThreadProc(void *param)  INT_PTR NewsAggrGetInfo(WPARAM wParam, LPARAM lParam)
  {
  	CCSDATA *ccs = (CCSDATA *)lParam;
 -	mir_forkthread(AckThreadProc, ccs->hContact);
 +	mir_forkthread(AckThreadProc, (void*)ccs->hContact);
  	return 0;
  }
 diff --git a/plugins/Weather/src/weather_mwin.cpp b/plugins/Weather/src/weather_mwin.cpp index 8444644f7f..ccf23266cb 100644 --- a/plugins/Weather/src/weather_mwin.cpp +++ b/plugins/Weather/src/weather_mwin.cpp @@ -95,7 +95,7 @@ static LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara  			GetWindowRect(hwnd, &ti.rcItem);
  			ti.cbSize = sizeof(ti);
 -			ti.hItem = data->hContact;
 +			ti.hItem = (HANDLE)data->hContact;
  			ti.ptCursor = pt;
  			ti.isTreeFocused = 1;
  			CallService(MS_TOOLTIP_SHOWTIP, 0, (LPARAM)&ti);
 @@ -256,7 +256,7 @@ static void addWindow(HCONTACT hContact)  	db_free(&dbv);
  	HWND hWnd = CreateWindow( _T("WeatherFrame"), _T(""), WS_CHILD | WS_VISIBLE,
 -		0, 0, 10, 10, (HWND)CallService(MS_CLUI_GETHWND, 0, 0), NULL, hInst, hContact);
 +		0, 0, 10, 10, (HWND)CallService(MS_CLUI_GETHWND, 0, 0), NULL, hInst, (void*)hContact);
  	WindowList_Add(hMwinWindowList, hWnd, hContact);
  	CLISTFrame Frame = {0};
 diff --git a/plugins/WebView/src/webview.cpp b/plugins/WebView/src/webview.cpp index c1e00d6532..a176e7b81a 100644 --- a/plugins/WebView/src/webview.cpp +++ b/plugins/WebView/src/webview.cpp @@ -129,7 +129,7 @@ void StartUpdate(void *dummy)  	Sleep(((db_get_dw(NULL, MODULENAME, START_DELAY_KEY, 0)) * SECOND));
  	for (HCONTACT hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME))
 -		GetData(hContact);
 +		GetData((void*)hContact);
  	StartUpDelay = 0;
  }
 @@ -139,7 +139,7 @@ void ContactLoop(void *dummy)  {
  	if (StartUpDelay == 0) {
  		for (HCONTACT hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) {
 -			GetData(hContact);
 +			GetData((void*)hContact);
  			Sleep(10); // avoid 100% CPU
  		}
  	}
 @@ -212,11 +212,11 @@ int Doubleclick(WPARAM wParam, LPARAM lParam)  		ShowWindow(hwndDlg, SW_SHOW);
  		SetActiveWindow(hwndDlg);
 -		if ( db_get_b(NULL, MODULENAME, UPDATE_ON_OPEN_KEY, 0)) {
 -			if ( db_get_b(hContact, MODULENAME, ENABLE_ALERTS_KEY, 0))
 -				mir_forkthread(ReadFromFile, hContact);
 +		if (db_get_b(NULL, MODULENAME, UPDATE_ON_OPEN_KEY, 0)) {
 +			if (db_get_b(hContact, MODULENAME, ENABLE_ALERTS_KEY, 0))
 +				mir_forkthread(ReadFromFile, (void*)hContact);
  			else
 -				mir_forkthread(GetData, hContact);
 +				mir_forkthread(GetData, (void*)hContact);
  			db_set_w(hContact, MODULENAME, "Status", ID_STATUS_ONLINE);     
  		}
  	}
 @@ -395,9 +395,9 @@ INT_PTR DataWndMenuCommand(WPARAM wParam, LPARAM lParam)  	if ( db_get_b(NULL, MODULENAME, UPDATE_ON_OPEN_KEY, 0)) {
  		if ( db_get_b(hContact, MODULENAME, ENABLE_ALERTS_KEY, 0))
 -			mir_forkthread(ReadFromFile, hContact);
 +			mir_forkthread(ReadFromFile, (void*)hContact);
  		else
 -			mir_forkthread(GetData, hContact);
 +			mir_forkthread(GetData, (void*)hContact);
  		db_set_w(hContact, MODULENAME, "Status", ID_STATUS_ONLINE);     
  	}
 @@ -467,7 +467,7 @@ INT_PTR WebsiteMenuCommand(WPARAM wParam, LPARAM lParam)  /*****************************************************************************/
  int UpdateMenuCommand(WPARAM wParam, LPARAM lParam, HCONTACT singlecontact)
  {
 -	mir_forkthread(GetData, singlecontact);
 +	mir_forkthread(GetData, (void*)singlecontact);
  	return 0;
  }
 diff --git a/plugins/WebView/src/webview_alerts.cpp b/plugins/WebView/src/webview_alerts.cpp index 0ab3287d87..5a3bca1cb4 100644 --- a/plugins/WebView/src/webview_alerts.cpp +++ b/plugins/WebView/src/webview_alerts.cpp @@ -37,7 +37,7 @@ int CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)  				// open data window
  				if ( db_get_b(NULL, MODULENAME, LCLK_WINDOW_KEY, 0)) {
  					NotifyEventHooks(hHookDisplayDataAlert, (int) hContact, 0);
 -					mir_forkthread(GetData, hContact);
 +					mir_forkthread(GetData, (void*)hContact);
  					PUDeletePopup(hWnd);
  				}
  				// open url
 @@ -58,7 +58,7 @@ int CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)  				// open datA window
  				if ( db_get_b(NULL, MODULENAME, RCLK_WINDOW_KEY, 0)) {
  					NotifyEventHooks(hHookDisplayDataAlert, (int) hContact, 0);
 -					mir_forkthread(GetData, hContact);
 +					mir_forkthread(GetData, (void*)hContact);
  					PUDeletePopup(hWnd);
  				}
  				// open url
 @@ -81,9 +81,9 @@ int CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)  }
  /*****************************************************************************/
 -int WDisplayDataAlert(void *hContact)
 +int WDisplayDataAlert(HCONTACT hContact)
  {
 -	NotifyEventHooks(hHookDisplayDataAlert, (int) hContact, 0);
 +	NotifyEventHooks(hHookDisplayDataAlert, (WPARAM)hContact, 0);
  	return 0;
  }
 diff --git a/plugins/YahooGroups/src/utils.cpp b/plugins/YahooGroups/src/utils.cpp index 4274f8c38a..93b84691c8 100644 --- a/plugins/YahooGroups/src/utils.cpp +++ b/plugins/YahooGroups/src/utils.cpp @@ -314,7 +314,7 @@ TCHAR *GetContactID(HCONTACT hContact, char *szProto)  		}
  }
 -HANDLE GetContactFromID(TCHAR *szID, char *szProto)
 +HCONTACT GetContactFromID(TCHAR *szID, char *szProto)
  {
  	TCHAR *szHandle;
  	TCHAR dispName[1024];
 @@ -330,12 +330,12 @@ HANDLE GetContactFromID(TCHAR *szID, char *szProto)  		_tcsncpy(dispName, tmp, SIZEOF(dispName));
  		if ((szHandle) && ((_tcsicmp(szHandle, szID) == 0) || (_tcsicmp(dispName, szID) == 0)) && ((szProto == NULL) || (_stricmp(szProto, cProtocol) == 0)))
 -		{
  			found = 1;
 -		}
 +
  		if (szHandle) { free(szHandle); }
 -		if (found) return hContact;
 +		if (found)
 +			return hContact;
  	}
  	return NULL;
 @@ -343,7 +343,7 @@ HANDLE GetContactFromID(TCHAR *szID, char *szProto)  #pragma warning (default: 4312)
  #pragma warning (disable: 4312)
 -HANDLE GetContactFromID(TCHAR *szID, wchar_t *szProto)
 +HCONTACT GetContactFromID(TCHAR *szID, wchar_t *szProto)
  {
  	char protocol[1024];
  	WideCharToMultiByte(CP_ACP, 0, szProto, -1, protocol, sizeof(protocol), NULL, NULL);
 diff --git a/plugins/YahooGroups/src/utils.h b/plugins/YahooGroups/src/utils.h index c3dc480dfa..9e07609dc6 100644 --- a/plugins/YahooGroups/src/utils.h +++ b/plugins/YahooGroups/src/utils.h @@ -49,12 +49,12 @@ int GetStringFromDatabase(HCONTACT hContact, char *szModule, char *szSettingName  int GetStringFromDatabase(char *szSettingName, char *szError, char *szResult, int size);
  int GetStringFromDatabase(char *szSettingName, WCHAR *szError, WCHAR *szResult, int count);
 -TCHAR *GetContactName(HCONTACT hContact, char *szProto);
 -TCHAR *GetContactID(HCONTACT hContact);
 -TCHAR *GetContactID(HCONTACT hContact, char *szProto);
 -HANDLE GetContactFromID(TCHAR *szID, char *szProto);
 -HANDLE GetContactFromID(TCHAR *szID, wchar_t *szProto);
 -void GetContactProtocol(HCONTACT hContact, char *szProto, int size);
 +TCHAR   *GetContactName(HCONTACT hContact, char *szProto);
 +TCHAR   *GetContactID(HCONTACT hContact);
 +TCHAR   *GetContactID(HCONTACT hContact, char *szProto);
 +HCONTACT GetContactFromID(TCHAR *szID, char *szProto);
 +HCONTACT GetContactFromID(TCHAR *szID, wchar_t *szProto);
 +void     GetContactProtocol(HCONTACT hContact, char *szProto, int size);
  int MyPUShowMessage(char *lpzText, BYTE kind);
 diff --git a/plugins/wbOSD/src/events.cpp b/plugins/wbOSD/src/events.cpp index 10efe9572e..647891b5f7 100644 --- a/plugins/wbOSD/src/events.cpp +++ b/plugins/wbOSD/src/events.cpp @@ -23,7 +23,7 @@ void showmsgwnd(unsigned int param)  		CallService(MS_MSG_SENDMESSAGET, (WPARAM)param, 0);
  }
 -LRESULT ShowOSD(TCHAR *str, int timeout, COLORREF color, HANDLE user)
 +LRESULT ShowOSD(TCHAR *str, int timeout, COLORREF color, HCONTACT user)
  {
  	logmsg("ShowOSD");
 @@ -196,7 +196,7 @@ int HookedNewEvent(WPARAM wParam, LPARAM lParam)  	TCHAR buffer[512];
  	mir_sntprintf(buffer, SIZEOF(buffer), buf, c1, c2);
 -	ShowOSD(buffer, 0, db_get_dw(NULL,THIS_MODULE, "clr_msg", DEFAULT_CLRMSG), (HANDLE)wParam);
 +	ShowOSD(buffer, 0, db_get_dw(NULL,THIS_MODULE, "clr_msg", DEFAULT_CLRMSG), (HCONTACT)wParam);
  	mir_free( c1 );
  	mir_free( c2 );
 diff --git a/protocols/AimOscar/src/proto.cpp b/protocols/AimOscar/src/proto.cpp index 8789f548e2..d47a759b62 100644 --- a/protocols/AimOscar/src/proto.cpp +++ b/protocols/AimOscar/src/proto.cpp @@ -126,7 +126,7 @@ int CAimProto::OnModulesLoaded(WPARAM wParam, LPARAM lParam)  ////////////////////////////////////////////////////////////////////////////////////////
  // AddToList - adds a contact to the contact list
 -HANDLE CAimProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
 +HCONTACT CAimProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
  {
  	if (state != 1) return 0;
  	TCHAR *id = psr->id ? psr->id : psr->nick;
 @@ -136,7 +136,7 @@ HANDLE CAimProto::AddToList(int flags, PROTOSEARCHRESULT* psr)  	return hContact; //See authrequest for serverside addition
  }
 -HANDLE __cdecl CAimProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent)
 +HCONTACT __cdecl CAimProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent)
  {
  	return NULL;
  }
 diff --git a/protocols/AimOscar/src/proto.h b/protocols/AimOscar/src/proto.h index bdd1dd42e7..fa1f999728 100644 --- a/protocols/AimOscar/src/proto.h +++ b/protocols/AimOscar/src/proto.h @@ -28,50 +28,50 @@ struct CAimProto : public PROTO<CAimProto>  	// PROTO_INTERFACE
  	//====================================================================================
 -	virtual	HANDLE __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr );
 -	virtual	HANDLE __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent );
 +	virtual	HCONTACT  __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr );
 +	virtual	HCONTACT  __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent );
 -	virtual	int    __cdecl Authorize( HANDLE hDbEvent );
 -	virtual	int    __cdecl AuthDeny( HANDLE hDbEvent, const TCHAR* szReason );
 -	virtual	int    __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT* );
 -	virtual	int    __cdecl AuthRequest(HCONTACT hContact, const TCHAR* szMessage );
 +	virtual	int       __cdecl Authorize( HANDLE hDbEvent );
 +	virtual	int       __cdecl AuthDeny( HANDLE hDbEvent, const TCHAR* szReason );
 +	virtual	int       __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT* );
 +	virtual	int       __cdecl AuthRequest(HCONTACT hContact, const TCHAR* szMessage );
 -	virtual	HANDLE __cdecl ChangeInfo( int iInfoType, void* pInfoData );
 +	virtual	HANDLE    __cdecl ChangeInfo( int iInfoType, void* pInfoData );
 -	virtual	HANDLE __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath );
 -	virtual	int    __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer );
 -	virtual	int    __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason );
 -	virtual	int    __cdecl FileResume( HANDLE hTransfer, int* action, const PROTOCHAR** szFilename );
 +	virtual	HANDLE    __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath );
 +	virtual	int       __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer );
 +	virtual	int       __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason );
 +	virtual	int       __cdecl FileResume( HANDLE hTransfer, int* action, const PROTOCHAR** szFilename );
  	virtual	DWORD_PTR __cdecl GetCaps( int type, HCONTACT hContact = NULL );
 -	virtual	int    __cdecl GetInfo(HCONTACT hContact, int infoType );
 +	virtual	int       __cdecl GetInfo(HCONTACT hContact, int infoType );
 -	virtual	HANDLE __cdecl SearchBasic( const PROTOCHAR* id );
 -	virtual	HANDLE __cdecl SearchByEmail( const PROTOCHAR* email );
 -	virtual	HANDLE __cdecl SearchByName( const PROTOCHAR* nick, const PROTOCHAR* firstName, const PROTOCHAR* lastName );
 -	virtual	HWND   __cdecl SearchAdvanced( HWND owner );
 -	virtual	HWND   __cdecl CreateExtendedSearchUI( HWND owner );
 +	virtual	HANDLE    __cdecl SearchBasic( const PROTOCHAR* id );
 +	virtual	HANDLE    __cdecl SearchByEmail( const PROTOCHAR* email );
 +	virtual	HANDLE    __cdecl SearchByName( const PROTOCHAR* nick, const PROTOCHAR* firstName, const PROTOCHAR* lastName );
 +	virtual	HWND      __cdecl SearchAdvanced( HWND owner );
 +	virtual	HWND      __cdecl CreateExtendedSearchUI( HWND owner );
 -	virtual	int    __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT* );
 -	virtual	int    __cdecl RecvFile(HCONTACT hContact, PROTOFILEEVENT* );
 -	virtual	int    __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT* );
 -	virtual	int    __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT* );
 +	virtual	int       __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT* );
 +	virtual	int       __cdecl RecvFile(HCONTACT hContact, PROTOFILEEVENT* );
 +	virtual	int       __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT* );
 +	virtual	int       __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT* );
 -	virtual	int    __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList);
 -	virtual	HANDLE __cdecl SendFile(HCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles);
 -	virtual	int    __cdecl SendMsg(HCONTACT hContact, int flags, const char* msg );
 -	virtual	int    __cdecl SendUrl(HCONTACT hContact, int flags, const char* url );
 +	virtual	int       __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList);
 +	virtual	HANDLE    __cdecl SendFile(HCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles);
 +	virtual	int       __cdecl SendMsg(HCONTACT hContact, int flags, const char* msg );
 +	virtual	int       __cdecl SendUrl(HCONTACT hContact, int flags, const char* url );
 -	virtual	int    __cdecl SetApparentMode(HCONTACT hContact, int mode );
 -	virtual	int    __cdecl SetStatus( int iNewStatus );
 +	virtual	int       __cdecl SetApparentMode(HCONTACT hContact, int mode );
 +	virtual	int       __cdecl SetStatus( int iNewStatus );
 -	virtual	HANDLE __cdecl GetAwayMsg(HCONTACT hContact );
 -	virtual	int    __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt );
 -	virtual	int    __cdecl SetAwayMsg( int m_iStatus, const TCHAR* msg );
 +	virtual	HANDLE    __cdecl GetAwayMsg(HCONTACT hContact );
 +	virtual	int       __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt );
 +	virtual	int       __cdecl SetAwayMsg( int m_iStatus, const TCHAR* msg );
 -	virtual	int    __cdecl UserIsTyping(HCONTACT hContact, int type );
 +	virtual	int       __cdecl UserIsTyping(HCONTACT hContact, int type );
 -	virtual	int    __cdecl OnEvent( PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam );
 +	virtual	int       __cdecl OnEvent( PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam );
  	//====| Services |====================================================================
  	INT_PTR  __cdecl SvcCreateAccMgrUI(WPARAM wParam, LPARAM lParam);
 diff --git a/protocols/FacebookRM/src/json.cpp b/protocols/FacebookRM/src/json.cpp index 28e102b46e..7fdbcbe2a8 100644 --- a/protocols/FacebookRM/src/json.cpp +++ b/protocols/FacebookRM/src/json.cpp @@ -424,7 +424,7 @@ int facebook_json_parser::parse_messages(void* data, std::vector< facebook_messa  						participant = chatroom->second.participants.find(reader_id);
  						if (participant != chatroom->second.participants.end()) {
 -							HANDLE hChatContact = proto->ChatIDToHContact(tid);
 +							HCONTACT hChatContact = proto->ChatIDToHContact(tid);
  							const char *participant_name = participant->second.c_str();
  							if (!chatroom->second.message_readers.empty())
 @@ -560,7 +560,7 @@ int facebook_json_parser::parse_messages(void* data, std::vector< facebook_messa  					// TODO: support also system messages (rename chat, user quit, etc.)! (here? or it is somewhere else?)
  					proto->UpdateChat(thread_id.c_str(), id.c_str(), senderName.c_str(), message_text.c_str(), utils::time::fix_timestamp(json_as_float(timestamp)));
  					proto->setString(hChatContact, FACEBOOK_KEY_MESSAGE_ID, message_id.c_str());
 -					proto->ForkThread(&FacebookProto::ReadMessageWorker, hChatContact);
 +					proto->ForkThread(&FacebookProto::ReadMessageWorker, (void*)hChatContact);
  				} else {
  					facebook_message* message = new facebook_message();
 diff --git a/protocols/FacebookRM/src/messages.cpp b/protocols/FacebookRM/src/messages.cpp index 051cb9cd39..a06efacc46 100644 --- a/protocols/FacebookRM/src/messages.cpp +++ b/protocols/FacebookRM/src/messages.cpp @@ -24,7 +24,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  int FacebookProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT *pre)
  {
 -	ForkThread(&FacebookProto::ReadMessageWorker, hContact);
 +	ForkThread(&FacebookProto::ReadMessageWorker, (void*)hContact);
  	CallService(MS_PROTO_CONTACTISTYPING, (WPARAM)hContact, (LPARAM)PROTOTYPE_CONTACTTYPING_OFF);
  	return Proto_RecvMessage(hContact, pre);
 @@ -168,7 +168,7 @@ void FacebookProto::ReadMessageWorker(void *p)  	if (p == NULL)
  		return;
 -	HCONTACT hContact = static_cast<HCONTACT>(p);
 +	HCONTACT hContact = (HCONTACT)p;
  	if (getBool(FACEBOOK_KEY_KEEP_UNREAD, 0) || getBool(hContact, FACEBOOK_KEY_KEEP_UNREAD, 0))
  		return;
 diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp index c06e9b562a..4e0531996a 100644 --- a/protocols/FacebookRM/src/process.cpp +++ b/protocols/FacebookRM/src/process.cpp @@ -378,7 +378,7 @@ void FacebookProto::ProcessUnreadMessage(void *p)  					hChatContact = ChatIDToHContact(room->thread_id);
  				setTString(hChatContact, FACEBOOK_KEY_MESSAGE_ID, room->thread_id.c_str());
 -				ForkThread(&FacebookProto::ReadMessageWorker, hChatContact);
 +				ForkThread(&FacebookProto::ReadMessageWorker, (void*)hChatContact);
  				delete it->second;
  				it = chatrooms.erase(it);
 diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp index 5e05071dec..2bb3659f87 100644 --- a/protocols/FacebookRM/src/proto.cpp +++ b/protocols/FacebookRM/src/proto.cpp @@ -238,7 +238,7 @@ HANDLE FacebookProto::SearchByName(const PROTOCHAR* nick, const PROTOCHAR* first  	return SearchByEmail(arg); // Facebook is using one search method for everything (except IDs)
  }
 -HANDLE FacebookProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
 +HCONTACT FacebookProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
  {
  	ptrA id( mir_t2a_cp(psr->id, CP_UTF8));
  	ptrA name( mir_t2a_cp(psr->firstName, CP_UTF8));
 diff --git a/protocols/FacebookRM/src/proto.h b/protocols/FacebookRM/src/proto.h index 9b5b550253..b271f62c8a 100644 --- a/protocols/FacebookRM/src/proto.h +++ b/protocols/FacebookRM/src/proto.h @@ -62,8 +62,8 @@ public:  	//PROTO_INTERFACE
 -	virtual	HANDLE   __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr);
 -	virtual	HANDLE   __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent);
 +	virtual	HCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr);
 +	virtual	HCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent);
  	virtual	int      __cdecl Authorize(HANDLE hDbEvent);
  	virtual	int      __cdecl AuthDeny(HANDLE hDbEvent, const PROTOCHAR* szReason);
 diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp index 24e8c40aa8..b3ad11201c 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.cpp +++ b/protocols/Gadu-Gadu/src/gg_proto.cpp @@ -124,24 +124,24 @@ GGPROTO::~GGPROTO()  //////////////////////////////////////////////////////////
  // Dummies for function that have to be implemented
 -HANDLE GGPROTO::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent) { return NULL; }
 -int    GGPROTO::Authorize(HANDLE hDbEvent) { return 1; }
 -int    GGPROTO::AuthDeny(HANDLE hDbEvent, const TCHAR *szReason) { return 1; }
 -int    GGPROTO::AuthRecv(HCONTACT hContact, PROTORECVEVENT *pre) { return 1; }
 -int    GGPROTO::AuthRequest(HCONTACT hContact, const TCHAR *szMessage) { return 1; }
 -HANDLE GGPROTO::ChangeInfo(int iInfoType, void *pInfoData) { return NULL; }
 -int    GGPROTO::FileResume(HANDLE hTransfer, int *action, const PROTOCHAR** szFilename) { return 1; }
 -HANDLE GGPROTO::SearchByEmail(const PROTOCHAR *email) { return NULL; }
 -int    GGPROTO::RecvContacts(HCONTACT hContact, PROTORECVEVENT *pre) { return 1; }
 -int    GGPROTO::RecvUrl(HCONTACT hContact, PROTORECVEVENT *pre) { return 1; }
 -int    GGPROTO::SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList) { return 1; }
 -int    GGPROTO::SendUrl(HCONTACT hContact, int flags, const char *url) { return 1; }
 -int    GGPROTO::RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT *evt) { return 1; }
 +HCONTACT GGPROTO::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent) { return NULL; }
 +int      GGPROTO::Authorize(HANDLE hDbEvent) { return 1; }
 +int      GGPROTO::AuthDeny(HANDLE hDbEvent, const TCHAR *szReason) { return 1; }
 +int      GGPROTO::AuthRecv(HCONTACT hContact, PROTORECVEVENT *pre) { return 1; }
 +int      GGPROTO::AuthRequest(HCONTACT hContact, const TCHAR *szMessage) { return 1; }
 +HANDLE   GGPROTO::ChangeInfo(int iInfoType, void *pInfoData) { return NULL; }
 +int      GGPROTO::FileResume(HANDLE hTransfer, int *action, const PROTOCHAR** szFilename) { return 1; }
 +HANDLE   GGPROTO::SearchByEmail(const PROTOCHAR *email) { return NULL; }
 +int      GGPROTO::RecvContacts(HCONTACT hContact, PROTORECVEVENT *pre) { return 1; }
 +int      GGPROTO::RecvUrl(HCONTACT hContact, PROTORECVEVENT *pre) { return 1; }
 +int      GGPROTO::SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList) { return 1; }
 +int      GGPROTO::SendUrl(HCONTACT hContact, int flags, const char *url) { return 1; }
 +int      GGPROTO::RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT *evt) { return 1; }
  //////////////////////////////////////////////////////////
  // when contact is added to list
 -HANDLE GGPROTO::AddToList(int flags, PROTOSEARCHRESULT *psr)
 +HCONTACT GGPROTO::AddToList(int flags, PROTOSEARCHRESULT *psr)
  {
  #ifdef DEBUGMODE
  	debugLogA("AddToList(): id=%s");
 diff --git a/protocols/Gadu-Gadu/src/gg_proto.h b/protocols/Gadu-Gadu/src/gg_proto.h index 4aa8a54ca4..a993447226 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.h +++ b/protocols/Gadu-Gadu/src/gg_proto.h @@ -31,50 +31,50 @@ struct GGPROTO : public PROTO<GGPROTO>  	// PROTO_INTERFACE
  	//====================================================================================
 -	virtual	HANDLE __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr );
 -	virtual	HANDLE __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent );
 +	virtual	HCONTACT __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr );
 +	virtual	HCONTACT __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent );
 +							 
 +	virtual	int      __cdecl Authorize( HANDLE hDbEvent );
 +	virtual	int      __cdecl AuthDeny( HANDLE hDbEvent, const TCHAR* szReason );
 +	virtual	int      __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT* );
 +	virtual	int      __cdecl AuthRequest(HCONTACT hContact, const TCHAR* szMessage );
 -	virtual	int    __cdecl Authorize( HANDLE hDbEvent );
 -	virtual	int    __cdecl AuthDeny( HANDLE hDbEvent, const TCHAR* szReason );
 -	virtual	int    __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT* );
 -	virtual	int    __cdecl AuthRequest(HCONTACT hContact, const TCHAR* szMessage );
 +	virtual	HANDLE   __cdecl ChangeInfo( int iInfoType, void* pInfoData );
 -	virtual	HANDLE __cdecl ChangeInfo( int iInfoType, void* pInfoData );
 -
 -	virtual	HANDLE __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath );
 -	virtual	int    __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer );
 -	virtual	int    __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR* szReason );
 -	virtual	int    __cdecl FileResume( HANDLE hTransfer, int* action, const TCHAR** szFilename );
 +	virtual	HANDLE   __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath );
 +	virtual	int      __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer );
 +	virtual	int      __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR* szReason );
 +	virtual	int      __cdecl FileResume( HANDLE hTransfer, int* action, const TCHAR** szFilename );
  	virtual	DWORD_PTR __cdecl GetCaps( int type, HCONTACT hContact = NULL );
 -	virtual	int    __cdecl GetInfo(HCONTACT hContact, int infoType );
 +	virtual	int       __cdecl GetInfo(HCONTACT hContact, int infoType );
 -	virtual	HANDLE __cdecl SearchBasic( const TCHAR* id );
 -	virtual	HANDLE __cdecl SearchByEmail( const TCHAR* email );
 -	virtual	HANDLE __cdecl SearchByName( const TCHAR* nick, const TCHAR* firstName, const TCHAR* lastName );
 -	virtual	HWND   __cdecl SearchAdvanced( HWND owner );
 -	virtual	HWND   __cdecl CreateExtendedSearchUI( HWND owner );
 +	virtual	HANDLE    __cdecl SearchBasic( const TCHAR* id );
 +	virtual	HANDLE    __cdecl SearchByEmail( const TCHAR* email );
 +	virtual	HANDLE    __cdecl SearchByName( const TCHAR* nick, const TCHAR* firstName, const TCHAR* lastName );
 +	virtual	HWND      __cdecl SearchAdvanced( HWND owner );
 +	virtual	HWND      __cdecl CreateExtendedSearchUI( HWND owner );
 -	virtual	int    __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT* );
 -	virtual	int    __cdecl RecvFile(HCONTACT hContact, PROTORECVFILET* );
 -	virtual	int    __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT* );
 -	virtual	int    __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT* );
 +	virtual	int       __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT* );
 +	virtual	int       __cdecl RecvFile(HCONTACT hContact, PROTORECVFILET* );
 +	virtual	int       __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT* );
 +	virtual	int       __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT* );
 -	virtual	int    __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList);
 -	virtual	HANDLE __cdecl SendFile(HCONTACT hContact, const TCHAR* szDescription, TCHAR** ppszFiles );
 -	virtual	int    __cdecl SendMsg(HCONTACT hContact, int flags, const char* msg );
 -	virtual	int    __cdecl SendUrl(HCONTACT hContact, int flags, const char* url );
 +	virtual	int       __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList);
 +	virtual	HANDLE    __cdecl SendFile(HCONTACT hContact, const TCHAR* szDescription, TCHAR** ppszFiles );
 +	virtual	int       __cdecl SendMsg(HCONTACT hContact, int flags, const char* msg );
 +	virtual	int       __cdecl SendUrl(HCONTACT hContact, int flags, const char* url );
 -	virtual	int    __cdecl SetApparentMode(HCONTACT hContact, int mode );
 -	virtual	int    __cdecl SetStatus( int iNewStatus );
 +	virtual	int       __cdecl SetApparentMode(HCONTACT hContact, int mode );
 +	virtual	int       __cdecl SetStatus( int iNewStatus );
 -	virtual	HANDLE __cdecl GetAwayMsg(HCONTACT hContact );
 -	virtual	int    __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt );
 -	virtual	int    __cdecl SetAwayMsg( int m_iStatus, const TCHAR* msg );
 +	virtual	HANDLE    __cdecl GetAwayMsg(HCONTACT hContact );
 +	virtual	int       __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt );
 +	virtual	int       __cdecl SetAwayMsg( int m_iStatus, const TCHAR* msg );
 -	virtual	int    __cdecl UserIsTyping(HCONTACT hContact, int type );
 +	virtual	int       __cdecl UserIsTyping(HCONTACT hContact, int type );
 -	virtual	int    __cdecl OnEvent( PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam );
 +	virtual	int       __cdecl OnEvent( PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam );
  	//////////////////////////////////////////////////////////////////////////////////////
  	//  Services
 diff --git a/protocols/IRCG/src/irc.h b/protocols/IRCG/src/irc.h index cf351b65a5..6a024ad099 100644 --- a/protocols/IRCG/src/irc.h +++ b/protocols/IRCG/src/irc.h @@ -214,50 +214,50 @@ struct CIrcProto : public PROTO<CIrcProto>  				// Protocol interface
 -	virtual	HANDLE __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr );
 -	virtual	HANDLE __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent );
 +	virtual	HCONTACT  __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr );
 +	virtual	HCONTACT  __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent );
 -	virtual	int    __cdecl Authorize(HANDLE hDbEvent);
 -	virtual	int    __cdecl AuthDeny(HANDLE hDbEvent, const TCHAR* szReason);
 -	virtual	int    __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT*);
 -	virtual	int    __cdecl AuthRequest(HCONTACT hContact, const TCHAR *szMessage);
 +	virtual	int       __cdecl Authorize(HANDLE hDbEvent);
 +	virtual	int       __cdecl AuthDeny(HANDLE hDbEvent, const TCHAR* szReason);
 +	virtual	int       __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT*);
 +	virtual	int       __cdecl AuthRequest(HCONTACT hContact, const TCHAR *szMessage);
 -	virtual	HANDLE __cdecl ChangeInfo( int iInfoType, void *pInfoData);
 +	virtual	HANDLE    __cdecl ChangeInfo( int iInfoType, void *pInfoData);
 -	virtual	HANDLE __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath);
 -	virtual	int    __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer );
 -	virtual	int    __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason);
 -	virtual	int    __cdecl FileResume( HANDLE hTransfer, int *action, const TCHAR **szFilename);
 +	virtual	HANDLE    __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath);
 +	virtual	int       __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer );
 +	virtual	int       __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason);
 +	virtual	int       __cdecl FileResume( HANDLE hTransfer, int *action, const TCHAR **szFilename);
  	virtual	DWORD_PTR __cdecl GetCaps( int type, HCONTACT hContact = NULL);
 -	virtual	int    __cdecl GetInfo(HCONTACT hContact, int infoType);
 +	virtual	int       __cdecl GetInfo(HCONTACT hContact, int infoType);
 -	virtual	HANDLE __cdecl SearchBasic(const PROTOCHAR* id);
 -	virtual	HANDLE __cdecl SearchByEmail(const PROTOCHAR* email);
 -	virtual	HANDLE __cdecl SearchByName(const PROTOCHAR* nick, const PROTOCHAR* firstName, const PROTOCHAR* lastName);
 -	virtual	HWND   __cdecl SearchAdvanced(HWND owner);
 -	virtual	HWND   __cdecl CreateExtendedSearchUI(HWND owner);
 +	virtual	HANDLE    __cdecl SearchBasic(const PROTOCHAR* id);
 +	virtual	HANDLE    __cdecl SearchByEmail(const PROTOCHAR* email);
 +	virtual	HANDLE    __cdecl SearchByName(const PROTOCHAR* nick, const PROTOCHAR* firstName, const PROTOCHAR* lastName);
 +	virtual	HWND      __cdecl SearchAdvanced(HWND owner);
 +	virtual	HWND      __cdecl CreateExtendedSearchUI(HWND owner);
 -	virtual	int    __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT*);
 -	virtual	int    __cdecl RecvFile(HCONTACT hContact, PROTORECVFILET*);
 -	virtual	int    __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT*);
 -	virtual	int    __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT*);
 +	virtual	int       __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT*);
 +	virtual	int       __cdecl RecvFile(HCONTACT hContact, PROTORECVFILET*);
 +	virtual	int       __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT*);
 +	virtual	int       __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT*);
 -	virtual	int    __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList);
 -	virtual	HANDLE __cdecl SendFile(HCONTACT hContact, const TCHAR *szDescription, TCHAR **ppszFiles);
 -	virtual	int    __cdecl SendMsg(HCONTACT hContact, int flags, const char* msg);
 -	virtual	int    __cdecl SendUrl(HCONTACT hContact, int flags, const char* url);
 +	virtual	int       __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList);
 +	virtual	HANDLE    __cdecl SendFile(HCONTACT hContact, const TCHAR *szDescription, TCHAR **ppszFiles);
 +	virtual	int       __cdecl SendMsg(HCONTACT hContact, int flags, const char* msg);
 +	virtual	int       __cdecl SendUrl(HCONTACT hContact, int flags, const char* url);
 -	virtual	int    __cdecl SetApparentMode(HCONTACT hContact, int mode);
 -	virtual	int    __cdecl SetStatus(int iNewStatus);
 +	virtual	int       __cdecl SetApparentMode(HCONTACT hContact, int mode);
 +	virtual	int       __cdecl SetStatus(int iNewStatus);
 -	virtual	HANDLE __cdecl GetAwayMsg(HCONTACT hContact);
 -	virtual	int    __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT *evt);
 -	virtual	int    __cdecl SetAwayMsg(int m_iStatus, const TCHAR *msg);
 +	virtual	HANDLE    __cdecl GetAwayMsg(HCONTACT hContact);
 +	virtual	int       __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT *evt);
 +	virtual	int       __cdecl SetAwayMsg(int m_iStatus, const TCHAR *msg);
 -	virtual	int    __cdecl UserIsTyping(HCONTACT hContact, int type);
 +	virtual	int       __cdecl UserIsTyping(HCONTACT hContact, int type);
 -	virtual	int    __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam);
 +	virtual	int       __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam);
  	// Services
  	INT_PTR __cdecl SvcCreateAccMgrUI(WPARAM, LPARAM);
 diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp index e1a26116f4..1a33ac9a73 100644 --- a/protocols/IRCG/src/ircproto.cpp +++ b/protocols/IRCG/src/ircproto.cpp @@ -318,7 +318,7 @@ int CIrcProto::OnModulesLoaded(WPARAM, LPARAM)  ////////////////////////////////////////////////////////////////////////////////////////
  // AddToList - adds a contact to the contact list
 -HANDLE __cdecl CIrcProto::AddToList(int, PROTOSEARCHRESULT* psr)
 +HCONTACT __cdecl CIrcProto::AddToList(int, PROTOSEARCHRESULT* psr)
  {
  	if (m_iStatus == ID_STATUS_OFFLINE || m_iStatus == ID_STATUS_CONNECTING)
  		return 0;
 @@ -359,7 +359,7 @@ HANDLE __cdecl CIrcProto::AddToList(int, PROTOSEARCHRESULT* psr)  ////////////////////////////////////////////////////////////////////////////////////////
  // AddToList - adds a contact to the contact list
 -HANDLE __cdecl CIrcProto::AddToListByEvent(int, int, HANDLE)
 +HCONTACT __cdecl CIrcProto::AddToListByEvent(int, int, HANDLE)
  {
  	return NULL;
  }
 diff --git a/protocols/IcqOscarJ/src/fam_02location.cpp b/protocols/IcqOscarJ/src/fam_02location.cpp index d5d6ec590a..af5d7a0fb7 100644 --- a/protocols/IcqOscarJ/src/fam_02location.cpp +++ b/protocols/IcqOscarJ/src/fam_02location.cpp @@ -127,7 +127,7 @@ void CIcqProto::handleLocationUserInfoReply(BYTE* buf, WORD wLen, DWORD dwCookie  	HCONTACT hContact = HContactFromUID(dwUIN, szUID, NULL);
  	// Ignore away status if the user is not already on our list
 -	if (hContact == INVALID_HANDLE_VALUE) {
 +	if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) {
  #ifdef _DEBUG
  		debugLogA("Ignoring away reply (%s)", strUID(dwUIN, szUID));
  #endif
 diff --git a/protocols/IcqOscarJ/src/fam_03buddy.cpp b/protocols/IcqOscarJ/src/fam_03buddy.cpp index d443919e6c..9b1f01444c 100644 --- a/protocols/IcqOscarJ/src/fam_03buddy.cpp +++ b/protocols/IcqOscarJ/src/fam_03buddy.cpp @@ -197,7 +197,7 @@ void CIcqProto::handleUserOnline(BYTE *buf, WORD wLen, serverthread_info *info)  	// Ignore status notification if the user is not already on our list
  	HCONTACT hContact = HContactFromUID(dwUIN, szUID, NULL);
 -	if (hContact == INVALID_HANDLE_VALUE)
 +	if (hContact == (HCONTACT)INVALID_HANDLE_VALUE)
  	{
  #ifdef _DEBUG
  		debugLogA("Ignoring user online (%s)", strUID(dwUIN, szUID));
 @@ -621,7 +621,7 @@ void CIcqProto::handleUserOffline(BYTE *buf, WORD wLen)  		HCONTACT hContact = HContactFromUID(dwUIN, szUID, NULL);
  		// Skip contacts that are not already on our list or are already offline
 -		if (hContact != INVALID_HANDLE_VALUE)
 +		if (hContact != (HCONTACT)INVALID_HANDLE_VALUE)
  		{
  			WORD wOldStatus = getContactStatus(hContact);
 diff --git a/protocols/IcqOscarJ/src/fam_04message.cpp b/protocols/IcqOscarJ/src/fam_04message.cpp index bd53d9c045..be7d453e55 100644 --- a/protocols/IcqOscarJ/src/fam_04message.cpp +++ b/protocols/IcqOscarJ/src/fam_04message.cpp @@ -504,7 +504,7 @@ void CIcqProto::handleRecvServMsgType2(BYTE *buf, WORD wLen, DWORD dwUin, char *  			WORD wAckType = chain->getWord(0x0A, 1);
  			// Update the saved DC info (if contact already exists)
 -			if (hContact != INVALID_HANDLE_VALUE)
 +			if (hContact != (HCONTACT)INVALID_HANDLE_VALUE)
  			{
  				DWORD dwIP, dwExternalIP;
  				WORD wPort;
 @@ -576,7 +576,7 @@ void CIcqProto::handleRecvServMsgType2(BYTE *buf, WORD wLen, DWORD dwUin, char *  					unpackLEDWord(&buf, &dwUin);
  					HCONTACT hContact = HContactFromUIN(dwUin, NULL);
 -					if (hContact == INVALID_HANDLE_VALUE)
 +					if (hContact == (HCONTACT)INVALID_HANDLE_VALUE)
  					{
  						debugLogA("Error: %s from unknown contact %u", "Reverse Connect Request", dwUin);
  					}
 @@ -677,7 +677,7 @@ void CIcqProto::parseServRelayData(BYTE *pDataBuf, WORD wLen, HCONTACT hContact,  		unpackLEWord(&pDataBuf, &wVersion);
  		wLen -= 2;
 -		if (hContact != INVALID_HANDLE_VALUE)
 +		if (hContact != (HCONTACT)INVALID_HANDLE_VALUE)
  			setWord(hContact, "Version", wVersion);
  		unpackDWord(&pDataBuf, &dwGuid1); // plugin type GUID
 @@ -1621,7 +1621,7 @@ void packPluginTypeId(icq_packet *packet, int nTypeID)  void CIcqProto::handleStatusMsgReply(const char *szPrefix, HCONTACT hContact, DWORD dwUin, WORD wVersion, int bMsgType, WORD wCookie, const char *szMsg, int nMsgFlags)
  {
 -	if (hContact == INVALID_HANDLE_VALUE) {
 +	if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) {
  		debugLogA("%sIgnoring status message from unknown contact %u", szPrefix, dwUin);
  		return;
  	}
 @@ -2307,7 +2307,7 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d  		// An ack of some kind
  		int ackType;
 -		if (hContact == NULL || hContact == INVALID_HANDLE_VALUE) {
 +		if (hContact == NULL || hContact == (HCONTACT)INVALID_HANDLE_VALUE) {
  			debugLogA("SNAC(4.B) Message from unknown contact (%u)", dwUin);
  			ReleaseCookie(dwCookie); // This could be a bad idea, but I think it is safe
  			return;
 @@ -2698,7 +2698,7 @@ void CIcqProto::handleServerAck(BYTE *buf, WORD wLen, WORD wFlags, DWORD dwSeque  		// server ack should be ignored here.
  		if (pCookieData && (pCookieData->nAckType == ACKTYPE_SERVER))
  		{
 -			if ((hContact != NULL) && (hContact != INVALID_HANDLE_VALUE))
 +			if ((hContact != NULL) && (hContact != (HCONTACT)INVALID_HANDLE_VALUE))
  			{
  				int ackType;
  				int ackRes = ACKRESULT_SUCCESS;
 @@ -2891,7 +2891,7 @@ void CIcqProto::handleTypingNotification(BYTE *buf, WORD wLen, WORD wFlags, DWOR  	HCONTACT hContact = HContactFromUID(dwUin, szUid, NULL);
 -	if (hContact == INVALID_HANDLE_VALUE) return;
 +	if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) return;
  	// Typing notification code
  	unpackWord(&buf, &wNotification);
 diff --git a/protocols/IcqOscarJ/src/fam_13servclist.cpp b/protocols/IcqOscarJ/src/fam_13servclist.cpp index fa83b408cd..fe15da519c 100644 --- a/protocols/IcqOscarJ/src/fam_13servclist.cpp +++ b/protocols/IcqOscarJ/src/fam_13servclist.cpp @@ -909,7 +909,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server  				hContact = HContactFromRecordName(szRecordName, &bAdded);
 -				if (hContact != INVALID_HANDLE_VALUE)
 +				if (hContact != (HCONTACT)INVALID_HANDLE_VALUE)
  				{
  					int bRegroup = 0;
  					int bNicked = 0;
 @@ -1177,7 +1177,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server  				hContact = HContactFromRecordName(szRecordName, &bAdded);
 -				if (hContact != INVALID_HANDLE_VALUE)
 +				if (hContact != (HCONTACT)INVALID_HANDLE_VALUE)
  				{
  					if (bAdded)
  					{
 @@ -1216,7 +1216,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server  				hContact = HContactFromRecordName(szRecordName, &bAdded);
 -				if (hContact != INVALID_HANDLE_VALUE)
 +				if (hContact != (HCONTACT)INVALID_HANDLE_VALUE)
  				{
  					if (bAdded)
  					{
 @@ -1274,7 +1274,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server  				hContact = HContactFromRecordName(szRecordName, &bAdded);
 -				if (hContact != INVALID_HANDLE_VALUE)
 +				if (hContact != (HCONTACT)INVALID_HANDLE_VALUE)
  				{
  					if (bAdded)
  					{
 @@ -1473,7 +1473,7 @@ void CIcqProto::handleServerCListItemUpdate(const char *szRecordName, WORD wGrou  {
  	HCONTACT hContact = (wItemType == SSI_ITEM_BUDDY || wItemType == SSI_ITEM_DENY || wItemType == SSI_ITEM_PERMIT || wItemType == SSI_ITEM_IGNORE) ? HContactFromRecordName(szRecordName, NULL) : NULL;
 -	if (hContact != INVALID_HANDLE_VALUE && wItemType == SSI_ITEM_BUDDY)
 +	if (hContact != (HCONTACT)INVALID_HANDLE_VALUE && wItemType == SSI_ITEM_BUDDY)
  	{ // a contact was updated on server
  		if (pItemData)
  		{
 @@ -1588,7 +1588,7 @@ void CIcqProto::handleServerCListItemDelete(const char *szRecordName, WORD wGrou  {
  	HCONTACT hContact = (wItemType == SSI_ITEM_BUDDY || wItemType == SSI_ITEM_DENY || wItemType == SSI_ITEM_PERMIT || wItemType == SSI_ITEM_IGNORE) ? HContactFromRecordName(szRecordName, NULL) : NULL;
 -	if (hContact != INVALID_HANDLE_VALUE && wItemType == SSI_ITEM_BUDDY)
 +	if (hContact != (HCONTACT)INVALID_HANDLE_VALUE && wItemType == SSI_ITEM_BUDDY)
  	{ // a contact was removed from our list
  		if (getWord(hContact, DBSETTING_SERVLIST_ID, 0) == wItemId)
  		{
 @@ -1783,8 +1783,8 @@ void CIcqProto::handleRecvAuthResponse(unsigned char *buf, WORD wLen)  	}
  	HCONTACT hContact = HContactFromUID(dwUin, szUid, &bAdded);
 -
 -	if (hContact != INVALID_HANDLE_VALUE) szNick = NickFromHandle(hContact);
 +	if (hContact != (HCONTACT)INVALID_HANDLE_VALUE)
 +		szNick = NickFromHandle(hContact);
  	if (wLen > 0)
  	{
 diff --git a/protocols/IcqOscarJ/src/fam_15icqserver.cpp b/protocols/IcqOscarJ/src/fam_15icqserver.cpp index 78759c03d8..bedd63885b 100644 --- a/protocols/IcqOscarJ/src/fam_15icqserver.cpp +++ b/protocols/IcqOscarJ/src/fam_15icqserver.cpp @@ -862,7 +862,7 @@ void CIcqProto::parseDirectoryUserDetailsData(HCONTACT hContact, oscar_tlv_chain  			dwUin = atoi(szUid);
  		hContact = HContactFromUID(dwUin, szUid, NULL);
 -		if (hContact == INVALID_HANDLE_VALUE)
 +		if (hContact == (HCONTACT)INVALID_HANDLE_VALUE)
  		{
  			debugLogA("Error: Received details for unknown contact \"%s\"", szUid);
  			SAFE_FREE(&szUid);
 diff --git a/protocols/IcqOscarJ/src/icq_avatar.h b/protocols/IcqOscarJ/src/icq_avatar.h index e989640d93..4323ffda8b 100644 --- a/protocols/IcqOscarJ/src/icq_avatar.h +++ b/protocols/IcqOscarJ/src/icq_avatar.h @@ -69,10 +69,10 @@ protected:  	rates *m_rates;
  	icq_critical_section *m_ratesMutex;
 -	HANDLE runContact[4];
 -	DWORD  runTime[4];
 -	int    runCount;
 -	void   checkRequestQueue();
 +	HCONTACT runContact[4];
 +	DWORD    runTime[4];
 +	int      runCount;
 +	void     checkRequestQueue();
  public:
  	avatars_server_connection(CIcqProto *ppro, HANDLE hConnection, char *pCookie, WORD wCookieLen);
 diff --git a/protocols/IcqOscarJ/src/icq_direct.cpp b/protocols/IcqOscarJ/src/icq_direct.cpp index 4229777b5a..095ad7734e 100644 --- a/protocols/IcqOscarJ/src/icq_direct.cpp +++ b/protocols/IcqOscarJ/src/icq_direct.cpp @@ -639,7 +639,7 @@ void CIcqProto::handleDirectPacket(directconnect* dc, PBYTE buf, WORD wLen)  			if (dc->dwRemoteUin || !dc->dwReqId)
  			{ // OMG! Licq sends on reverse connection empty uin
  				hContact = HContactFromUIN(dc->dwRemoteUin, NULL);
 -				if (hContact == INVALID_HANDLE_VALUE)
 +				if (hContact == (HCONTACT)INVALID_HANDLE_VALUE)
  				{
  					NetLog_Direct("Error: Received PEER_INIT from %u not on my list", dwUin);
  					CloseDirectConnection(dc);
 diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp index d347223323..6754e296c8 100644 --- a/protocols/IcqOscarJ/src/icq_proto.cpp +++ b/protocols/IcqOscarJ/src/icq_proto.cpp @@ -316,7 +316,7 @@ int CIcqProto::OnPreShutdown(WPARAM wParam, LPARAM lParam)  ////////////////////////////////////////////////////////////////////////////////////////
  // PS_AddToList - adds a contact to the contact list
 -HANDLE CIcqProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
 +HCONTACT CIcqProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
  {
  	if (psr) {
  		if (psr->cbSize == sizeof(ICQSEARCHRESULT)) {
 @@ -354,7 +354,7 @@ HANDLE CIcqProto::AddToList(int flags, PROTOSEARCHRESULT* psr)  	return 0; // Failure
  }
 -HANDLE __cdecl CIcqProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent)
 +HCONTACT __cdecl CIcqProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent)
  {
  	DWORD uin = 0;
  	uid_str uid = { 0 };
 @@ -374,24 +374,24 @@ HANDLE __cdecl CIcqProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEv  	switch (dbei.eventType) {
  	case EVENTTYPE_CONTACTS:
 -	{
 -									  char *pbOffset = (char*)dbei.pBlob;
 -									  char *pbEnd = pbOffset + dbei.cbBlob;
 -									  for (int i = 0; i <= iContact; i++) {
 -										  pbOffset += strlennull(pbOffset) + 1;  // Nick
 -										  if (pbOffset >= pbEnd) break;
 -										  if (i == iContact) { // we found the contact, get uid
 -											  if (IsStringUIN((char*)pbOffset))
 -												  uin = atoi((char*)pbOffset);
 -											  else {
 -												  uin = 0;
 -												  strcpy(uid, (char*)pbOffset);
 -											  }
 -										  }
 -										  pbOffset += strlennull(pbOffset) + 1;  // Uin
 -										  if (pbOffset >= pbEnd) break;
 -									  }
 -	}
 +		{
 +			char *pbOffset = (char*)dbei.pBlob;
 +			char *pbEnd = pbOffset + dbei.cbBlob;
 +			for (int i = 0; i <= iContact; i++) {
 +				pbOffset += strlennull(pbOffset) + 1;  // Nick
 +				if (pbOffset >= pbEnd) break;
 +				if (i == iContact) { // we found the contact, get uid
 +					if (IsStringUIN((char*)pbOffset))
 +						uin = atoi((char*)pbOffset);
 +					else {
 +						uin = 0;
 +						strcpy(uid, (char*)pbOffset);
 +					}
 +				}
 +				pbOffset += strlennull(pbOffset) + 1;  // Uin
 +				if (pbOffset >= pbEnd) break;
 +			}
 +		}
  		break;
  	case EVENTTYPE_AUTHREQUEST:
 @@ -421,7 +421,7 @@ int CIcqProto::Authorize(HANDLE hDbEvent)  {
  	if (icqOnline() && hDbEvent) {
  		HCONTACT hContact = HContactFromAuthEvent(hDbEvent);
 -		if (hContact == INVALID_HANDLE_VALUE)
 +		if (hContact == (HCONTACT)INVALID_HANDLE_VALUE)
  			return 1;
  		DWORD uin;
 @@ -447,7 +447,7 @@ int CIcqProto::AuthDeny(HANDLE hDbEvent, const TCHAR* szReason)  {
  	if (icqOnline() && hDbEvent) {
  		HCONTACT hContact = HContactFromAuthEvent(hDbEvent);
 -		if (hContact == INVALID_HANDLE_VALUE)
 +		if (hContact == (HCONTACT)INVALID_HANDLE_VALUE)
  			return 1;
  		DWORD uin;
 diff --git a/protocols/IcqOscarJ/src/icq_proto.h b/protocols/IcqOscarJ/src/icq_proto.h index 9b9986d06d..44e23e627f 100644 --- a/protocols/IcqOscarJ/src/icq_proto.h +++ b/protocols/IcqOscarJ/src/icq_proto.h @@ -54,50 +54,50 @@ struct CIcqProto : public PROTO<CIcqProto>  	// PROTO_INTERFACE
  	//====================================================================================
 -	virtual	HANDLE __cdecl AddToList( int flags, PROTOSEARCHRESULT *psr);
 -	virtual	HANDLE __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent);
 +	virtual	HCONTACT  __cdecl AddToList( int flags, PROTOSEARCHRESULT *psr);
 +	virtual	HCONTACT  __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent);
 -	virtual	int    __cdecl Authorize(HANDLE hDbEvent);
 -	virtual	int    __cdecl AuthDeny(HANDLE hDbEvent, const TCHAR *szReason);
 -	virtual	int    __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT*);
 -	virtual	int    __cdecl AuthRequest(HCONTACT hContact, const TCHAR *szMessage);
 +	virtual	int       __cdecl Authorize(HANDLE hDbEvent);
 +	virtual	int       __cdecl AuthDeny(HANDLE hDbEvent, const TCHAR *szReason);
 +	virtual	int       __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT*);
 +	virtual	int       __cdecl AuthRequest(HCONTACT hContact, const TCHAR *szMessage);
 -	virtual	HANDLE __cdecl ChangeInfo( int iInfoType, void *pInfoData);
 +	virtual	HANDLE    __cdecl ChangeInfo( int iInfoType, void *pInfoData);
 -	virtual	HANDLE __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath);
 -	virtual	int    __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer);
 -	virtual	int    __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason);
 -	virtual	int    __cdecl FileResume( HANDLE hTransfer, int *action, const TCHAR **szFilename);
 +	virtual	HANDLE    __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath);
 +	virtual	int       __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer);
 +	virtual	int       __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason);
 +	virtual	int       __cdecl FileResume( HANDLE hTransfer, int *action, const TCHAR **szFilename);
  	virtual	DWORD_PTR __cdecl GetCaps(int type, HCONTACT hContact = NULL);
 -	virtual	int    __cdecl GetInfo(HCONTACT hContact, int infoType);
 +	virtual	int       __cdecl GetInfo(HCONTACT hContact, int infoType);
 -	virtual	HANDLE __cdecl SearchBasic(const PROTOCHAR *id);
 -	virtual	HANDLE __cdecl SearchByEmail(const PROTOCHAR *email);
 -	virtual	HANDLE __cdecl SearchByName(const PROTOCHAR *nick, const PROTOCHAR *firstName, const PROTOCHAR *lastName);
 -	virtual	HWND   __cdecl SearchAdvanced(HWND owner);
 -	virtual	HWND   __cdecl CreateExtendedSearchUI(HWND owner);
 +	virtual	HANDLE    __cdecl SearchBasic(const PROTOCHAR *id);
 +	virtual	HANDLE    __cdecl SearchByEmail(const PROTOCHAR *email);
 +	virtual	HANDLE    __cdecl SearchByName(const PROTOCHAR *nick, const PROTOCHAR *firstName, const PROTOCHAR *lastName);
 +	virtual	HWND      __cdecl SearchAdvanced(HWND owner);
 +	virtual	HWND      __cdecl CreateExtendedSearchUI(HWND owner);
 -	virtual	int    __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT*);
 -	virtual	int    __cdecl RecvFile(HCONTACT hContact, PROTORECVFILET*);
 -	virtual	int    __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT*);
 -	virtual	int    __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT*);
 +	virtual	int       __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT*);
 +	virtual	int       __cdecl RecvFile(HCONTACT hContact, PROTORECVFILET*);
 +	virtual	int       __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT*);
 +	virtual	int       __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT*);
 -	virtual	int    __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList);
 -	virtual	HANDLE __cdecl SendFile(HCONTACT hContact, const TCHAR *szDescription, TCHAR **ppszFiles);
 -	virtual	int    __cdecl SendMsg(HCONTACT hContact, int flags, const char *msg);
 -	virtual	int    __cdecl SendUrl(HCONTACT hContact, int flags, const char *url);
 +	virtual	int       __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList);
 +	virtual	HANDLE    __cdecl SendFile(HCONTACT hContact, const TCHAR *szDescription, TCHAR **ppszFiles);
 +	virtual	int       __cdecl SendMsg(HCONTACT hContact, int flags, const char *msg);
 +	virtual	int       __cdecl SendUrl(HCONTACT hContact, int flags, const char *url);
 -	virtual	int    __cdecl SetApparentMode(HCONTACT hContact, int mode);
 -	virtual	int    __cdecl SetStatus(int iNewStatus);
 +	virtual	int       __cdecl SetApparentMode(HCONTACT hContact, int mode);
 +	virtual	int       __cdecl SetStatus(int iNewStatus);
 -	virtual	HANDLE __cdecl GetAwayMsg(HCONTACT hContact);
 -	virtual	int    __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT *evt);
 -	virtual	int    __cdecl SetAwayMsg(int m_iStatus, const TCHAR *msg);
 +	virtual	HANDLE    __cdecl GetAwayMsg(HCONTACT hContact);
 +	virtual	int       __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT *evt);
 +	virtual	int       __cdecl SetAwayMsg(int m_iStatus, const TCHAR *msg);
 -	virtual	int    __cdecl UserIsTyping(HCONTACT hContact, int type);
 +	virtual	int       __cdecl UserIsTyping(HCONTACT hContact, int type);
 -	virtual	int    __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam);
 +	virtual	int       __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam);
  	//====| Services |====================================================================
  	INT_PTR  __cdecl AddServerContact(WPARAM wParam, LPARAM lParam);
 @@ -620,7 +620,7 @@ struct CIcqProto : public PROTO<CIcqProto>  	// server-list support functions
  	int    nJustAddedCount;
  	int    nJustAddedSize;
 -	HANDLE* pdwJustAddedList;
 +	HCONTACT* pdwJustAddedList;
  	void   AddJustAddedContact(HCONTACT hContact);
  	BOOL   IsContactJustAdded(HCONTACT hContact);
 @@ -766,8 +766,8 @@ struct CIcqProto : public PROTO<CIcqProto>  	void   oft_sendFileRedirect(DWORD dwUin, char *szUid, oscar_filetransfer *ft, DWORD dwIP, WORD wPort, int bProxy);
  	//---- | icq_svcs.cpp |----------------------------------------------------------------
 -	HANDLE AddToListByUIN(DWORD dwUin, DWORD dwFlags);
 -	HANDLE AddToListByUID(const char *szUID, DWORD dwFlags);
 +	HCONTACT AddToListByUIN(DWORD dwUin, DWORD dwFlags);
 +	HCONTACT AddToListByUID(const char *szUID, DWORD dwFlags);
  	void   ICQAddRecvEvent(HCONTACT hContact, WORD wType, PROTORECVEVENT* pre, DWORD cbBlob, PBYTE pBlob, DWORD flags);
  	INT_PTR __cdecl IcqAddCapability(WPARAM wParam, LPARAM lParam);
 diff --git a/protocols/IcqOscarJ/src/icq_servlist.cpp b/protocols/IcqOscarJ/src/icq_servlist.cpp index fa866116bc..df7fdc753f 100644 --- a/protocols/IcqOscarJ/src/icq_servlist.cpp +++ b/protocols/IcqOscarJ/src/icq_servlist.cpp @@ -807,7 +807,7 @@ void CIcqProto::AddJustAddedContact(HCONTACT hContact)  	if (nJustAddedCount >= nJustAddedSize)
  	{
  		nJustAddedSize += 10;
 -		pdwJustAddedList = (HANDLE*)SAFE_REALLOC(pdwJustAddedList, nJustAddedSize * sizeof(HANDLE));
 +		pdwJustAddedList = (HCONTACT*)SAFE_REALLOC(pdwJustAddedList, nJustAddedSize * sizeof(HCONTACT));
  	}
  	pdwJustAddedList[nJustAddedCount] = hContact;
 diff --git a/protocols/IcqOscarJ/src/icq_xtraz.cpp b/protocols/IcqOscarJ/src/icq_xtraz.cpp index 45ff2829fe..68bf447e3f 100644 --- a/protocols/IcqOscarJ/src/icq_xtraz.cpp +++ b/protocols/IcqOscarJ/src/icq_xtraz.cpp @@ -411,7 +411,7 @@ void CIcqProto::SendXtrazNotifyResponse(DWORD dwUin, DWORD dwMID, DWORD dwMID2,  	char *szBody = (char*)_alloca(nBodyLen);
  	HCONTACT hContact = HContactFromUIN(dwUin, NULL);
 -	if (hContact != INVALID_HANDLE_VALUE && !CheckContactCapabilities(hContact, CAPF_XTRAZ)) {
 +	if (hContact != (HCONTACT)INVALID_HANDLE_VALUE && !CheckContactCapabilities(hContact, CAPF_XTRAZ)) {
  		SAFE_FREE(&szResBody);
  		return; // Contact does not support xtraz, do not send anything
  	}
 diff --git a/protocols/IcqOscarJ/src/icqosc_svcs.cpp b/protocols/IcqOscarJ/src/icqosc_svcs.cpp index c0077c9c89..d8b59e2ff4 100644 --- a/protocols/IcqOscarJ/src/icqosc_svcs.cpp +++ b/protocols/IcqOscarJ/src/icqosc_svcs.cpp @@ -633,7 +633,7 @@ INT_PTR CIcqProto::SetPassword(WPARAM wParam, LPARAM lParam)  // TODO: Adding needs some more work in general
 -HANDLE CIcqProto::AddToListByUIN(DWORD dwUin, DWORD dwFlags)
 +HCONTACT CIcqProto::AddToListByUIN(DWORD dwUin, DWORD dwFlags)
  {
  	int bAdded;
  	HCONTACT hContact = HContactFromUIN(dwUin, &bAdded);
 @@ -652,7 +652,7 @@ HANDLE CIcqProto::AddToListByUIN(DWORD dwUin, DWORD dwFlags)  }
 -HANDLE CIcqProto::AddToListByUID(const char *szUID, DWORD dwFlags)
 +HCONTACT CIcqProto::AddToListByUID(const char *szUID, DWORD dwFlags)
  {
  	int bAdded;
  	HCONTACT hContact = HContactFromUID(0, szUID, &bAdded);
 diff --git a/protocols/IcqOscarJ/src/utilities.cpp b/protocols/IcqOscarJ/src/utilities.cpp index 57b3f9ac4f..2c38bcd74a 100644 --- a/protocols/IcqOscarJ/src/utilities.cpp +++ b/protocols/IcqOscarJ/src/utilities.cpp @@ -1455,7 +1455,7 @@ bool CIcqProto::validateStatusMessageRequest(HCONTACT hContact, WORD byMessageTy  	// Privacy control
  	if (getByte("StatusMsgReplyCList", 0)) {
  		// Don't send statusmessage to unknown contacts
 -		if (hContact == INVALID_HANDLE_VALUE)
 +		if (hContact == (HCONTACT)INVALID_HANDLE_VALUE)
  			return false;
  		// Don't send statusmessage to temporary contacts or hidden contacts
 @@ -1472,7 +1472,7 @@ bool CIcqProto::validateStatusMessageRequest(HCONTACT hContact, WORD byMessageTy  	}
  	// Dont send messages to people you are hiding from
 -	if (hContact != INVALID_HANDLE_VALUE &&
 +	if (hContact != (HCONTACT)INVALID_HANDLE_VALUE &&
  		getWord(hContact, "ApparentMode", 0) == ID_STATUS_OFFLINE) {
  		return false;
  	}
 @@ -1487,7 +1487,7 @@ bool CIcqProto::validateStatusMessageRequest(HCONTACT hContact, WORD byMessageTy  		return false;
  	}
 -	if (hContact != INVALID_HANDLE_VALUE && m_iStatus == ID_STATUS_INVISIBLE &&
 +	if (hContact != (HCONTACT)INVALID_HANDLE_VALUE && m_iStatus == ID_STATUS_INVISIBLE &&
  		getWord(hContact, "ApparentMode", 0) != ID_STATUS_ONLINE) {
  		if (!getByte(hContact, "TemporaryVisible", 0)) { // Allow request to temporary visible contacts
  			return false;
 diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 2af1d877fe..fad43be645 100644 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -358,7 +358,7 @@ HCONTACT CJabberProto::AddToListByJID(const TCHAR *newJid, DWORD flags)  	return hContact;
  }
 -HANDLE CJabberProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
 +HCONTACT CJabberProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
  {
  	if (psr->cbSize != sizeof(JABBER_SEARCH_RESULT) && psr->id == NULL)
  		return NULL;
 @@ -368,7 +368,7 @@ HANDLE CJabberProto::AddToList(int flags, PROTOSEARCHRESULT* psr)  	return AddToListByJID(jid, flags);
  }
 -HANDLE __cdecl CJabberProto::AddToListByEvent(int flags, int /*iContact*/, HANDLE hDbEvent)
 +HCONTACT __cdecl CJabberProto::AddToListByEvent(int flags, int /*iContact*/, HANDLE hDbEvent)
  {
  	debugLogA("AddToListByEvent");
 diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h index 6c90985d43..80b206ce71 100644 --- a/protocols/JabberG/src/jabber_proto.h +++ b/protocols/JabberG/src/jabber_proto.h @@ -82,50 +82,50 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface  	// PROTO_INTERFACE
  	//====================================================================================
 -	virtual	HANDLE __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr);
 -	virtual	HANDLE __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent);
 +	virtual	HCONTACT  __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr);
 +	virtual	HCONTACT  __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent);
 -	virtual	int    __cdecl Authorize(HANDLE hDbEvent);
 -	virtual	int    __cdecl AuthDeny(HANDLE hDbEvent, const TCHAR *szReason);
 -	virtual	int    __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT*);
 -	virtual	int    __cdecl AuthRequest(HCONTACT hContact, const TCHAR *szMessage);
 +	virtual	int       __cdecl Authorize(HANDLE hDbEvent);
 +	virtual	int       __cdecl AuthDeny(HANDLE hDbEvent, const TCHAR *szReason);
 +	virtual	int       __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT*);
 +	virtual	int       __cdecl AuthRequest(HCONTACT hContact, const TCHAR *szMessage);
 -	virtual	HANDLE __cdecl ChangeInfo(int iInfoType, void* pInfoData);
 +	virtual	HANDLE    __cdecl ChangeInfo(int iInfoType, void* pInfoData);
 -	virtual	HANDLE __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath);
 -	virtual	int    __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer);
 -	virtual	int    __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason);
 -	virtual	int    __cdecl FileResume(HANDLE hTransfer, int* action, const TCHAR** szFilename);
 +	virtual	HANDLE    __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath);
 +	virtual	int       __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer);
 +	virtual	int       __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason);
 +	virtual	int       __cdecl FileResume(HANDLE hTransfer, int* action, const TCHAR** szFilename);
  	virtual	DWORD_PTR __cdecl GetCaps(int type, HCONTACT hContact = NULL);
 -	virtual	int    __cdecl GetInfo(HCONTACT hContact, int infoType);
 +	virtual	int       __cdecl GetInfo(HCONTACT hContact, int infoType);
 -	virtual	HANDLE __cdecl SearchBasic(const TCHAR *id);
 -	virtual	HANDLE __cdecl SearchByEmail(const TCHAR *email);
 -	virtual	HANDLE __cdecl SearchByName(const TCHAR *nick, const TCHAR *firstName, const TCHAR *lastName);
 -	virtual	HWND   __cdecl SearchAdvanced(HWND owner);
 -	virtual	HWND   __cdecl CreateExtendedSearchUI(HWND owner);
 +	virtual	HANDLE    __cdecl SearchBasic(const TCHAR *id);
 +	virtual	HANDLE    __cdecl SearchByEmail(const TCHAR *email);
 +	virtual	HANDLE    __cdecl SearchByName(const TCHAR *nick, const TCHAR *firstName, const TCHAR *lastName);
 +	virtual	HWND      __cdecl SearchAdvanced(HWND owner);
 +	virtual	HWND      __cdecl CreateExtendedSearchUI(HWND owner);
 -	virtual	int    __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT*);
 -	virtual	int    __cdecl RecvFile(HCONTACT hContact, PROTORECVFILET*);
 -	virtual	int    __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT*);
 -	virtual	int    __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT*);
 +	virtual	int       __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT*);
 +	virtual	int       __cdecl RecvFile(HCONTACT hContact, PROTORECVFILET*);
 +	virtual	int       __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT*);
 +	virtual	int       __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT*);
 -	virtual	int    __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList);
 -	virtual	HANDLE __cdecl SendFile(HCONTACT hContact, const TCHAR *szDescription, TCHAR **ppszFiles);
 -	virtual	int    __cdecl SendMsg(HCONTACT hContact, int flags, const char *msg);
 -	virtual	int    __cdecl SendUrl(HCONTACT hContact, int flags, const char *url);
 +	virtual	int       __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList);
 +	virtual	HANDLE    __cdecl SendFile(HCONTACT hContact, const TCHAR *szDescription, TCHAR **ppszFiles);
 +	virtual	int       __cdecl SendMsg(HCONTACT hContact, int flags, const char *msg);
 +	virtual	int       __cdecl SendUrl(HCONTACT hContact, int flags, const char *url);
 -	virtual	int    __cdecl SetApparentMode(HCONTACT hContact, int mode);
 -	virtual	int    __cdecl SetStatus(int iNewStatus);
 +	virtual	int       __cdecl SetApparentMode(HCONTACT hContact, int mode);
 +	virtual	int       __cdecl SetStatus(int iNewStatus);
 -	virtual	HANDLE __cdecl GetAwayMsg(HCONTACT hContact);
 -	virtual	int    __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt);
 -	virtual	int    __cdecl SetAwayMsg(int m_iStatus, const TCHAR *msg);
 +	virtual	HANDLE    __cdecl GetAwayMsg(HCONTACT hContact);
 +	virtual	int       __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt);
 +	virtual	int       __cdecl SetAwayMsg(int m_iStatus, const TCHAR *msg);
 -	virtual	int    __cdecl UserIsTyping(HCONTACT hContact, int type);
 +	virtual	int       __cdecl UserIsTyping(HCONTACT hContact, int type);
 -	virtual	int    __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam);
 +	virtual	int       __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam);
  	//====| Services |====================================================================
  	INT_PTR  __cdecl SvcCreateAccMgrUI(WPARAM wParam, LPARAM lParam);
 diff --git a/protocols/MRA/src/MraChat.cpp b/protocols/MRA/src/MraChat.cpp index 7cf8571652..4c95f5ec38 100644 --- a/protocols/MRA/src/MraChat.cpp +++ b/protocols/MRA/src/MraChat.cpp @@ -111,7 +111,7 @@ INT_PTR CMraProto::MraChatSessionEventSendByHandle(HCONTACT hContactChatSession,  		gce.ptszNick = wszNick;
  	}
  	else {
 -		HANDLE hContactSender = MraHContactFromEmail(lpszUID, FALSE, TRUE, NULL);
 +		HCONTACT hContactSender = MraHContactFromEmail(lpszUID, FALSE, TRUE, NULL);
  		wszUID = lpszUID;
  		if (hContactSender)
  			gce.ptszNick = GetContactNameW(hContactSender);
 diff --git a/protocols/MRA/src/MraProto.cpp b/protocols/MRA/src/MraProto.cpp index a8686a95ee..f6ea74dbff 100644 --- a/protocols/MRA/src/MraProto.cpp +++ b/protocols/MRA/src/MraProto.cpp @@ -126,7 +126,7 @@ int CMraProto::OnPreShutdown(WPARAM, LPARAM)  /////////////////////////////////////////////////////////////////////////////////////////
 -HANDLE CMraProto::AddToListByEmail(LPCTSTR plpsEMail, LPCTSTR plpsNick, LPCTSTR plpsFirstName, LPCTSTR plpsLastName, DWORD dwFlags)
 +HCONTACT CMraProto::AddToListByEmail(LPCTSTR plpsEMail, LPCTSTR plpsNick, LPCTSTR plpsFirstName, LPCTSTR plpsLastName, DWORD dwFlags)
  {
  	if (!plpsEMail)
  		return NULL;
 @@ -153,7 +153,7 @@ HANDLE CMraProto::AddToListByEmail(LPCTSTR plpsEMail, LPCTSTR plpsNick, LPCTSTR  	return hContact;
  }
 -HANDLE CMraProto::AddToList(int flags, PROTOSEARCHRESULT *psr)
 +HCONTACT CMraProto::AddToList(int flags, PROTOSEARCHRESULT *psr)
  {
  	if (psr->cbSize != sizeof(PROTOSEARCHRESULT))
  		return 0;
 @@ -161,7 +161,7 @@ HANDLE CMraProto::AddToList(int flags, PROTOSEARCHRESULT *psr)  	return AddToListByEmail(psr->email, psr->nick, psr->firstName, psr->lastName, flags);
  }
 -HANDLE CMraProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent)
 +HCONTACT CMraProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent)
  {
  	DBEVENTINFO dbei = {0};
  	dbei.cbSize = sizeof(dbei);
 diff --git a/protocols/MRA/src/MraProto.h b/protocols/MRA/src/MraProto.h index d0a73ab7af..3ac3f5cfc9 100644 --- a/protocols/MRA/src/MraProto.h +++ b/protocols/MRA/src/MraProto.h @@ -38,50 +38,50 @@ struct CMraProto : public PROTO<CMraProto>  	// PROTO_INTERFACE
  	// ====================================================================================
 -	virtual	HANDLE __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr);
 -	virtual	HANDLE __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent);
 +	virtual	HCONTACT  __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr);
 +	virtual	HCONTACT  __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent);
 -	virtual	int    __cdecl Authorize(HANDLE hDBEvent);
 -	virtual	int    __cdecl AuthDeny(HANDLE hDBEvent, const TCHAR* szReason);
 -	virtual	int    __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT*);
 -	virtual	int    __cdecl AuthRequest(HCONTACT hContact, const TCHAR* szMessage);
 +	virtual	int       __cdecl Authorize(HANDLE hDBEvent);
 +	virtual	int       __cdecl AuthDeny(HANDLE hDBEvent, const TCHAR* szReason);
 +	virtual	int       __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT*);
 +	virtual	int       __cdecl AuthRequest(HCONTACT hContact, const TCHAR* szMessage);
 -	virtual	HANDLE __cdecl ChangeInfo(int iInfoType, void* pInfoData);
 +	virtual	HANDLE    __cdecl ChangeInfo(int iInfoType, void* pInfoData);
 -	virtual	HANDLE __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath);
 -	virtual	int    __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer);
 -	virtual	int    __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR* szReason);
 -	virtual	int    __cdecl FileResume(HANDLE hTransfer, int* action, const TCHAR** szFilename);
 +	virtual	HANDLE    __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath);
 +	virtual	int       __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer);
 +	virtual	int       __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR* szReason);
 +	virtual	int       __cdecl FileResume(HANDLE hTransfer, int* action, const TCHAR** szFilename);
  	virtual	DWORD_PTR __cdecl GetCaps(int type, HCONTACT hContact = NULL);
 -	virtual	int    __cdecl GetInfo(HCONTACT hContact, int infoType);
 +	virtual	int       __cdecl GetInfo(HCONTACT hContact, int infoType);
 -	virtual	HANDLE __cdecl SearchBasic(const TCHAR* id);
 -	virtual	HANDLE __cdecl SearchByEmail(const TCHAR* email);
 -	virtual	HANDLE __cdecl SearchByName(const TCHAR* nick, const TCHAR* firstName, const TCHAR* lastName);
 -	virtual	HWND   __cdecl SearchAdvanced(HWND owner);
 -	virtual	HWND   __cdecl CreateExtendedSearchUI(HWND owner);
 +	virtual	HANDLE    __cdecl SearchBasic(const TCHAR* id);
 +	virtual	HANDLE    __cdecl SearchByEmail(const TCHAR* email);
 +	virtual	HANDLE    __cdecl SearchByName(const TCHAR* nick, const TCHAR* firstName, const TCHAR* lastName);
 +	virtual	HWND      __cdecl SearchAdvanced(HWND owner);
 +	virtual	HWND      __cdecl CreateExtendedSearchUI(HWND owner);
 -	virtual	int    __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT*);
 -	virtual	int    __cdecl RecvFile(HCONTACT hContact, PROTORECVFILET*);
 -	virtual	int    __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT*);
 -	virtual	int    __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT*);
 +	virtual	int       __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT*);
 +	virtual	int       __cdecl RecvFile(HCONTACT hContact, PROTORECVFILET*);
 +	virtual	int       __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT*);
 +	virtual	int       __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT*);
 -	virtual	int    __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList);
 -	virtual	HANDLE __cdecl SendFile(HCONTACT hContact, const TCHAR *szDescription, TCHAR **ppszFiles);
 -	virtual	int    __cdecl SendMsg(HCONTACT hContact, int flags, const char* msg);
 -	virtual	int    __cdecl SendUrl(HCONTACT hContact, int flags, const char* url);
 +	virtual	int       __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList);
 +	virtual	HANDLE    __cdecl SendFile(HCONTACT hContact, const TCHAR *szDescription, TCHAR **ppszFiles);
 +	virtual	int       __cdecl SendMsg(HCONTACT hContact, int flags, const char* msg);
 +	virtual	int       __cdecl SendUrl(HCONTACT hContact, int flags, const char* url);
 -	virtual	int    __cdecl SetApparentMode(HCONTACT hContact, int mode);
 -	virtual	int    __cdecl SetStatus(int iNewStatus);
 +	virtual	int       __cdecl SetApparentMode(HCONTACT hContact, int mode);
 +	virtual	int       __cdecl SetStatus(int iNewStatus);
 -	virtual	HANDLE __cdecl GetAwayMsg(HCONTACT hContact);
 -	virtual	int    __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt);
 -	virtual	int    __cdecl SetAwayMsg(int m_iStatus, const TCHAR* msg);
 +	virtual	HANDLE    __cdecl GetAwayMsg(HCONTACT hContact);
 +	virtual	int       __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt);
 +	virtual	int       __cdecl SetAwayMsg(int m_iStatus, const TCHAR* msg);
 -	virtual	int    __cdecl UserIsTyping(HCONTACT hContact, int type);
 +	virtual	int       __cdecl UserIsTyping(HCONTACT hContact, int type);
 -	virtual	int    __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam);
 +	virtual	int       __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam);
  	void   ShowFormattedErrorMessage(LPWSTR lpwszErrText, DWORD dwErrorCode);
  	void   MraPopupShowW(HCONTACT hContact, DWORD dwType, DWORD dwFlags, LPWSTR lpszTitle, LPCWSTR lpszMessage);
 @@ -196,7 +196,7 @@ struct CMraProto : public PROTO<CMraProto>  	CRITICAL_SECTION csCriticalSectionSend;
 -	HANDLE AddToListByEmail(LPCTSTR plpsEMail, LPCTSTR plpsNick, LPCTSTR plpsFirstName, LPCTSTR plpsLastName, DWORD dwFlags);
 +	HCONTACT AddToListByEmail(LPCTSTR plpsEMail, LPCTSTR plpsNick, LPCTSTR plpsFirstName, LPCTSTR plpsLastName, DWORD dwFlags);
  	DWORD  MraMessage(BOOL bAddToQueue, HCONTACT hContact, DWORD dwAckType, DWORD dwFlags, const CMStringA &szEmail, const CMStringW &wszMessage, LPBYTE lpbMultiChatData, size_t dwMultiChatDataSize);
  	DWORD  MraMessageAsk(DWORD dwMsgID, DWORD dwFlags, const CMStringA &szEmail, const CMStringW &wszMessage, const CMStringW &wszMessageRTF);
 diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp index 950d8575ef..8ce3a13620 100644 --- a/protocols/MSN/src/msn_proto.cpp +++ b/protocols/MSN/src/msn_proto.cpp @@ -249,7 +249,7 @@ HCONTACT CMsnProto::AddToListByEmail(const char *email, const char *nick, DWORD  	return hContact;
  }
 -HANDLE __cdecl CMsnProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
 +HCONTACT __cdecl CMsnProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
  {
  	TCHAR *id = psr->id ? psr->id : psr->email;
  	return AddToListByEmail(
 @@ -258,7 +258,7 @@ HANDLE __cdecl CMsnProto::AddToList(int flags, PROTOSEARCHRESULT* psr)  		flags);
  }
 -HANDLE __cdecl CMsnProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent)
 +HCONTACT __cdecl CMsnProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent)
  {
  	DBEVENTINFO dbei = { sizeof(dbei) };
  	if ((dbei.cbBlob = db_event_getBlobSize(hDbEvent)) == (DWORD)(-1))
 diff --git a/protocols/MSN/src/msn_proto.h b/protocols/MSN/src/msn_proto.h index 1e351b900b..cf40b2b89e 100644 --- a/protocols/MSN/src/msn_proto.h +++ b/protocols/MSN/src/msn_proto.h @@ -32,8 +32,8 @@ struct CMsnProto : public PROTO<CMsnProto>  	// PROTO_INTERFACE
  	//====================================================================================
 -	virtual	HANDLE    __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr);
 -	virtual	HANDLE    __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent);
 +	virtual	HCONTACT  __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr);
 +	virtual	HCONTACT  __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent);
  	virtual	int       __cdecl Authorize(HANDLE hDbEvent);
  	virtual	int       __cdecl AuthDeny(HANDLE hDbEvent, const TCHAR* szReason);
 diff --git a/protocols/Omegle/src/proto.h b/protocols/Omegle/src/proto.h index 507faea578..0827d7616c 100644 --- a/protocols/Omegle/src/proto.h +++ b/protocols/Omegle/src/proto.h @@ -44,8 +44,8 @@ public:  	}
  	// PROTO_INTERFACE
 -	virtual	HANDLE   __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr );
 -	virtual	HANDLE   __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent );
 +	virtual	HCONTACT __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr );
 +	virtual	HCONTACT __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent );
  	virtual	int      __cdecl Authorize( HANDLE hDbEvent );
  	virtual	int      __cdecl AuthDeny( HANDLE hDbEvent, const PROTOCHAR* szReason );
 diff --git a/protocols/Omegle/src/stubs.cpp b/protocols/Omegle/src/stubs.cpp index 817c2c02a9..1f8c085547 100644 --- a/protocols/Omegle/src/stubs.cpp +++ b/protocols/Omegle/src/stubs.cpp @@ -22,12 +22,12 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  #include "common.h"
 -HANDLE OmegleProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
 +HCONTACT OmegleProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
  {
  	return NULL;
  };
 -HANDLE OmegleProto::AddToListByEvent(int flags,int iContact,HANDLE hDbEvent)
 +HCONTACT OmegleProto::AddToListByEvent(int flags,int iContact,HANDLE hDbEvent)
  {
  	return NULL;
  };
 diff --git a/protocols/Skype/src/skype_proto.cpp b/protocols/Skype/src/skype_proto.cpp index 27aed96317..01f3f43e23 100644 --- a/protocols/Skype/src/skype_proto.cpp +++ b/protocols/Skype/src/skype_proto.cpp @@ -46,14 +46,14 @@ CSkypeProto::~CSkypeProto()  	}
  }
 -HANDLE __cdecl CSkypeProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
 +HCONTACT __cdecl CSkypeProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
  {
  	CContact::Ref contact;
  	this->GetContact((char *)mir_ptr<char>(::mir_utf8encodeW(psr->id)), contact);
  	return this->AddContact(contact);
  }
 -HANDLE __cdecl CSkypeProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent)
 +HCONTACT __cdecl CSkypeProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent)
  {
  	DBEVENTINFO dbei = {0};
  	dbei.cbSize = sizeof(dbei);
 diff --git a/protocols/Skype/src/skype_proto.h b/protocols/Skype/src/skype_proto.h index 761607c9c4..972d450e0f 100644 --- a/protocols/Skype/src/skype_proto.h +++ b/protocols/Skype/src/skype_proto.h @@ -179,50 +179,50 @@ public:  	~CSkypeProto();
  	// PROTO_INTERFACE
 -	virtual	HANDLE __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr );
 -	virtual	HANDLE __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent );
 +	virtual	HCONTACT  __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr );
 +	virtual	HCONTACT  __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent );
 -	virtual	int    __cdecl Authorize( HANDLE hDbEvent );
 -	virtual	int    __cdecl AuthDeny( HANDLE hDbEvent, const TCHAR* szReason );
 -	virtual	int    __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT* );
 -	virtual	int    __cdecl AuthRequest(HCONTACT hContact, const TCHAR* szMessage );
 +	virtual	int       __cdecl Authorize( HANDLE hDbEvent );
 +	virtual	int       __cdecl AuthDeny( HANDLE hDbEvent, const TCHAR* szReason );
 +	virtual	int       __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT* );
 +	virtual	int       __cdecl AuthRequest(HCONTACT hContact, const TCHAR* szMessage );
 -	virtual	HANDLE __cdecl ChangeInfo( int iInfoType, void* pInfoData );
 +	virtual	HANDLE    __cdecl ChangeInfo( int iInfoType, void* pInfoData );
 -	virtual	HANDLE __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath );
 -	virtual	int    __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer );
 -	virtual	int    __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR* szReason );
 -	virtual	int    __cdecl FileResume( HANDLE hTransfer, int* action, const TCHAR** szFilename );
 +	virtual	HANDLE    __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath );
 +	virtual	int       __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer );
 +	virtual	int       __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR* szReason );
 +	virtual	int       __cdecl FileResume( HANDLE hTransfer, int* action, const TCHAR** szFilename );
  	virtual	DWORD_PTR __cdecl GetCaps( int type, HCONTACT hContact = NULL );
 -	virtual	int    __cdecl GetInfo(HCONTACT hContact, int infoType );
 +	virtual	int       __cdecl GetInfo(HCONTACT hContact, int infoType );
 -	virtual	HANDLE __cdecl SearchBasic( const TCHAR* id );
 -	virtual	HANDLE __cdecl SearchByEmail( const TCHAR* email );
 -	virtual	HANDLE __cdecl SearchByName( const TCHAR* nick, const TCHAR* firstName, const TCHAR* lastName );
 -	virtual	HWND   __cdecl SearchAdvanced( HWND owner );
 -	virtual	HWND   __cdecl CreateExtendedSearchUI( HWND owner );
 +	virtual	HANDLE    __cdecl SearchBasic( const TCHAR* id );
 +	virtual	HANDLE    __cdecl SearchByEmail( const TCHAR* email );
 +	virtual	HANDLE    __cdecl SearchByName( const TCHAR* nick, const TCHAR* firstName, const TCHAR* lastName );
 +	virtual	HWND      __cdecl SearchAdvanced( HWND owner );
 +	virtual	HWND      __cdecl CreateExtendedSearchUI( HWND owner );
 -	virtual	int    __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT* );
 -	virtual	int    __cdecl RecvFile(HCONTACT hContact, PROTORECVFILET* );
 -	virtual	int    __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT* );
 -	virtual	int    __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT* );
 +	virtual	int       __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT* );
 +	virtual	int       __cdecl RecvFile(HCONTACT hContact, PROTORECVFILET* );
 +	virtual	int       __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT* );
 +	virtual	int       __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT* );
 -	virtual	int    __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList);
 -	virtual	HANDLE __cdecl SendFile(HCONTACT hContact, const TCHAR* szDescription, TCHAR** ppszFiles );
 -	virtual	int    __cdecl SendMsg(HCONTACT hContact, int flags, const char* msg );
 -	virtual	int    __cdecl SendUrl(HCONTACT hContact, int flags, const char* url );
 +	virtual	int       __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList);
 +	virtual	HANDLE    __cdecl SendFile(HCONTACT hContact, const TCHAR* szDescription, TCHAR** ppszFiles );
 +	virtual	int       __cdecl SendMsg(HCONTACT hContact, int flags, const char* msg );
 +	virtual	int       __cdecl SendUrl(HCONTACT hContact, int flags, const char* url );
 -	virtual	int    __cdecl SetApparentMode(HCONTACT hContact, int mode );
 -	virtual	int    __cdecl SetStatus( int iNewStatus );
 +	virtual	int       __cdecl SetApparentMode(HCONTACT hContact, int mode );
 +	virtual	int       __cdecl SetStatus( int iNewStatus );
 -	virtual	HANDLE __cdecl GetAwayMsg(HCONTACT hContact );
 -	virtual	int    __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt );
 -	virtual	int    __cdecl SetAwayMsg( int m_iStatus, const TCHAR* msg );
 +	virtual	HANDLE    __cdecl GetAwayMsg(HCONTACT hContact );
 +	virtual	int       __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt );
 +	virtual	int       __cdecl SetAwayMsg( int m_iStatus, const TCHAR* msg );
 -	virtual	int    __cdecl UserIsTyping(HCONTACT hContact, int type );
 +	virtual	int       __cdecl UserIsTyping(HCONTACT hContact, int type );
 -	virtual	int    __cdecl OnEvent( PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam );
 +	virtual	int       __cdecl OnEvent( PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam );
  	// instances
  	static CSkypeProto* InitSkypeProto(const char* protoName, const wchar_t* userName);
 diff --git a/protocols/Tlen/src/tlen.h b/protocols/Tlen/src/tlen.h index e9ad52b64a..1096210110 100644 --- a/protocols/Tlen/src/tlen.h +++ b/protocols/Tlen/src/tlen.h @@ -218,8 +218,8 @@ struct TlenProtocol : public PROTO<TlenProtocol>  	// PROTO_INTERFACE
  	//====================================================================================
 -	virtual	HANDLE   __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr );
 -	virtual	HANDLE   __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent );
 +	virtual	HCONTACT __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr );
 +	virtual	HCONTACT __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent );
  	virtual	int	     __cdecl Authorize(HANDLE hDbEvent);
  	virtual	int      __cdecl AuthDeny(HANDLE hDbEvent, const PROTOCHAR* szReason);
 diff --git a/protocols/Tlen/src/tlen_svc.cpp b/protocols/Tlen/src/tlen_svc.cpp index 3eff4c7b86..034bfd0ea8 100644 --- a/protocols/Tlen/src/tlen_svc.cpp +++ b/protocols/Tlen/src/tlen_svc.cpp @@ -214,7 +214,7 @@ static HCONTACT AddToListByJID(TlenProtocol *proto, const char *newJid, DWORD fl  	return hContact;
  }
 -HANDLE TlenProtocol::AddToList(int flags, PROTOSEARCHRESULT *psr)
 +HCONTACT TlenProtocol::AddToList(int flags, PROTOSEARCHRESULT *psr)
  {
  	HCONTACT hContact;
  	TLEN_SEARCH_RESULT *jsr = (TLEN_SEARCH_RESULT*)psr;
 @@ -224,7 +224,7 @@ HANDLE TlenProtocol::AddToList(int flags, PROTOSEARCHRESULT *psr)  	return hContact;
  }
 -HANDLE TlenProtocol::AddToListByEvent( int flags, int iContact, HANDLE hDbEvent )
 +HCONTACT TlenProtocol::AddToListByEvent( int flags, int iContact, HANDLE hDbEvent )
  {
  	DBEVENTINFO dbei = { sizeof(dbei) };
  	if ((dbei.cbBlob = db_event_getBlobSize(hDbEvent)) == (DWORD)(-1))
 diff --git a/protocols/Twitter/src/contacts.cpp b/protocols/Twitter/src/contacts.cpp index 9a37a50284..3cb24db577 100644 --- a/protocols/Twitter/src/contacts.cpp +++ b/protocols/Twitter/src/contacts.cpp @@ -43,7 +43,7 @@ void TwitterProto::AddToListWorker(void *p)  	mir_free(name);
  }
 -HANDLE TwitterProto::AddToList(int flags,PROTOSEARCHRESULT *result)
 +HCONTACT TwitterProto::AddToList(int flags,PROTOSEARCHRESULT *result)
  {
  	if(m_iStatus != ID_STATUS_ONLINE)
  		return 0;
 @@ -87,7 +87,7 @@ int TwitterProto::GetInfo(HCONTACT hContact,int info_type)  	if(info_type == 0) // From clicking "Update" in the Userinfo dialog
  	{
 -		ForkThread(&TwitterProto::UpdateInfoWorker, hContact);
 +		ForkThread(&TwitterProto::UpdateInfoWorker, (void*)hContact);
  		return 0;
  	}
 @@ -179,7 +179,7 @@ void TwitterProto::GetAwayMsgWorker(void *hContact)  HANDLE TwitterProto::GetAwayMsg(HCONTACT hContact)
  {
 -	ForkThread(&TwitterProto::GetAwayMsgWorker, hContact);
 +	ForkThread(&TwitterProto::GetAwayMsgWorker, (void*)hContact);
  	return (HANDLE)1;
  }
 @@ -188,7 +188,7 @@ int TwitterProto::OnContactDeleted(WPARAM wParam,LPARAM lParam)  	if(m_iStatus != ID_STATUS_ONLINE)
  		return 0;
 -	const HCONTACT hContact = reinterpret_cast<HCONTACT>(wParam);
 +	const HCONTACT hContact = (HCONTACT)wParam;
  	if(!IsMyContact(hContact))
  		return 0;
 diff --git a/protocols/Twitter/src/proto.cpp b/protocols/Twitter/src/proto.cpp index 33b7a019ea..6ec565871f 100644 --- a/protocols/Twitter/src/proto.cpp +++ b/protocols/Twitter/src/proto.cpp @@ -246,7 +246,7 @@ INT_PTR TwitterProto::GetStatus(WPARAM,LPARAM)  INT_PTR TwitterProto::ReplyToTweet(WPARAM wParam,LPARAM)
  {
  	// TODO: support replying to tweets instead of just users
 -	HCONTACT hContact = reinterpret_cast<HCONTACT>(wParam);
 +	HCONTACT hContact = (HCONTACT)wParam;
  	HWND hDlg = CreateDialogParam(g_hInstance,MAKEINTRESOURCE(IDD_TWEET),0,tweet_proc,reinterpret_cast<LPARAM>(this));
 @@ -264,7 +264,7 @@ INT_PTR TwitterProto::ReplyToTweet(WPARAM wParam,LPARAM)  INT_PTR TwitterProto::VisitHomepage(WPARAM wParam,LPARAM)
  {
 -	HCONTACT hContact = reinterpret_cast<HCONTACT>(wParam);
 +	HCONTACT hContact = (HCONTACT)wParam;
  	DBVARIANT dbv;
  	// TODO: remove this
 @@ -398,7 +398,7 @@ int TwitterProto::OnPreShutdown(WPARAM,LPARAM)  int TwitterProto::OnPrebuildContactMenu(WPARAM wParam,LPARAM)
  {
 -	HCONTACT hContact = reinterpret_cast<HCONTACT>(wParam);
 +	HCONTACT hContact = (HCONTACT)wParam;
  	if(IsMyContact(hContact))
  		ShowContactMenus(true);
 @@ -498,7 +498,7 @@ void TwitterProto::UpdateSettings()  		for(HCONTACT hContact = db_find_first(m_szModuleName); hContact; ) {
  			HCONTACT hNext = db_find_next(hContact, m_szModuleName);
  			if(isChatRoom(hContact))
 -				CallService(MS_DB_CONTACT_DELETE,reinterpret_cast<WPARAM>(hContact),0);
 +				CallService(MS_DB_CONTACT_DELETE, WPARAM(hContact), 0);
  			hContact = hNext;
  		}
  	}
 diff --git a/protocols/Twitter/src/proto.h b/protocols/Twitter/src/proto.h index 16739bbfc9..68a7cb3b27 100644 --- a/protocols/Twitter/src/proto.h +++ b/protocols/Twitter/src/proto.h @@ -36,8 +36,8 @@ public:  	//PROTO_INTERFACE
 -	virtual	HANDLE    __cdecl AddToList(int,PROTOSEARCHRESULT *);
 -	virtual	HANDLE    __cdecl AddToListByEvent(int,int,HANDLE);
 +	virtual	HCONTACT  __cdecl AddToList(int,PROTOSEARCHRESULT *);
 +	virtual	HCONTACT  __cdecl AddToListByEvent(int,int,HANDLE);
  	virtual	int       __cdecl Authorize(HANDLE);
  	virtual	int       __cdecl AuthDeny(HANDLE,const TCHAR *);
 diff --git a/protocols/Twitter/src/stubs.cpp b/protocols/Twitter/src/stubs.cpp index c62ae86147..9b8fc7deea 100644 --- a/protocols/Twitter/src/stubs.cpp +++ b/protocols/Twitter/src/stubs.cpp @@ -17,7 +17,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  #include "proto.h"
 -HANDLE TwitterProto::AddToListByEvent(int flags,int iContact,HANDLE hDbEvent)
 +HCONTACT TwitterProto::AddToListByEvent(int flags,int iContact,HANDLE hDbEvent)
  {
  	return NULL;
  }
 diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index 2a0bfb0a90..3e52d04e5f 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -273,7 +273,7 @@ HANDLE CVkProto::SearchByName(const PROTOCHAR* nick, const PROTOCHAR* firstName,  	return 0;
  }
 -HANDLE CVkProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
 +HCONTACT CVkProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
  {
  	return NULL;
  }
 @@ -300,7 +300,7 @@ int CVkProto::UserIsTyping(HCONTACT hContact, int type)  	return 0;
  }
 -HANDLE CVkProto::AddToListByEvent(int flags,int iContact,HANDLE hDbEvent)
 +HCONTACT CVkProto::AddToListByEvent(int flags,int iContact,HANDLE hDbEvent)
  {
  	return NULL;
  }
 diff --git a/protocols/VKontakte/src/vk_proto.h b/protocols/VKontakte/src/vk_proto.h index 7d247b2776..6d5eec5f1a 100644 --- a/protocols/VKontakte/src/vk_proto.h +++ b/protocols/VKontakte/src/vk_proto.h @@ -116,50 +116,50 @@ struct CVkProto : public PROTO<CVkProto>  	// PROTO_INTERFACE
  	//====================================================================================
 -	virtual	HANDLE __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr);
 -	virtual	HANDLE __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent);
 +	virtual	HCONTACT  __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr);
 +	virtual	HCONTACT  __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent);
 -	virtual	int    __cdecl Authorize(HANDLE hDbEvent);
 -	virtual	int    __cdecl AuthDeny(HANDLE hDbEvent, const TCHAR *szReason);
 -	virtual	int    __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT*);
 -	virtual	int    __cdecl AuthRequest(HCONTACT hContact, const TCHAR *szMessage);
 +	virtual	int       __cdecl Authorize(HANDLE hDbEvent);
 +	virtual	int       __cdecl AuthDeny(HANDLE hDbEvent, const TCHAR *szReason);
 +	virtual	int       __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT*);
 +	virtual	int       __cdecl AuthRequest(HCONTACT hContact, const TCHAR *szMessage);
 -	virtual	HANDLE __cdecl ChangeInfo(int iInfoType, void* pInfoData);
 +	virtual	HANDLE    __cdecl ChangeInfo(int iInfoType, void* pInfoData);
 -	virtual	HANDLE __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath);
 -	virtual	int    __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer);
 -	virtual	int    __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason);
 -	virtual	int    __cdecl FileResume(HANDLE hTransfer, int* action, const TCHAR** szFilename);
 +	virtual	HANDLE    __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath);
 +	virtual	int       __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer);
 +	virtual	int       __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason);
 +	virtual	int       __cdecl FileResume(HANDLE hTransfer, int* action, const TCHAR** szFilename);
  	virtual	DWORD_PTR __cdecl GetCaps(int type, HCONTACT hContact = NULL);
 -	virtual	int    __cdecl GetInfo(HCONTACT hContact, int infoType);
 +	virtual	int       __cdecl GetInfo(HCONTACT hContact, int infoType);
 -	virtual	HANDLE __cdecl SearchBasic(const TCHAR *id);
 -	virtual	HANDLE __cdecl SearchByEmail(const TCHAR *email);
 -	virtual	HANDLE __cdecl SearchByName(const TCHAR *nick, const TCHAR *firstName, const TCHAR *lastName);
 -	virtual	HWND   __cdecl SearchAdvanced(HWND owner);
 -	virtual	HWND   __cdecl CreateExtendedSearchUI(HWND owner);
 +	virtual	HANDLE    __cdecl SearchBasic(const TCHAR *id);
 +	virtual	HANDLE    __cdecl SearchByEmail(const TCHAR *email);
 +	virtual	HANDLE    __cdecl SearchByName(const TCHAR *nick, const TCHAR *firstName, const TCHAR *lastName);
 +	virtual	HWND      __cdecl SearchAdvanced(HWND owner);
 +	virtual	HWND      __cdecl CreateExtendedSearchUI(HWND owner);
 -	virtual	int    __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT*);
 -	virtual	int    __cdecl RecvFile(HCONTACT hContact, PROTORECVFILET*);
 -	virtual	int    __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT*);
 -	virtual	int    __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT*);
 +	virtual	int       __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT*);
 +	virtual	int       __cdecl RecvFile(HCONTACT hContact, PROTORECVFILET*);
 +	virtual	int       __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT*);
 +	virtual	int       __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT*);
 -	virtual	int    __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList);
 -	virtual	HANDLE __cdecl SendFile(HCONTACT hContact, const TCHAR *szDescription, TCHAR **ppszFiles);
 -	virtual	int    __cdecl SendMsg(HCONTACT hContact, int flags, const char* msg);
 -	virtual	int    __cdecl SendUrl(HCONTACT hContact, int flags, const char* url);
 +	virtual	int       __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList);
 +	virtual	HANDLE    __cdecl SendFile(HCONTACT hContact, const TCHAR *szDescription, TCHAR **ppszFiles);
 +	virtual	int       __cdecl SendMsg(HCONTACT hContact, int flags, const char* msg);
 +	virtual	int       __cdecl SendUrl(HCONTACT hContact, int flags, const char* url);
 -	virtual	int    __cdecl SetApparentMode(HCONTACT hContact, int mode);
 -	virtual	int    __cdecl SetStatus(int iNewStatus);
 +	virtual	int       __cdecl SetApparentMode(HCONTACT hContact, int mode);
 +	virtual	int       __cdecl SetStatus(int iNewStatus);
 -	virtual	HANDLE __cdecl GetAwayMsg(HCONTACT hContact);
 -	virtual	int    __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt);
 -	virtual	int    __cdecl SetAwayMsg(int m_iStatus, const TCHAR *msg);
 +	virtual	HANDLE    __cdecl GetAwayMsg(HCONTACT hContact);
 +	virtual	int       __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt);
 +	virtual	int       __cdecl SetAwayMsg(int m_iStatus, const TCHAR *msg);
 -	virtual	int    __cdecl UserIsTyping(HCONTACT hContact, int type);
 +	virtual	int       __cdecl UserIsTyping(HCONTACT hContact, int type);
 -	virtual	int    __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam);
 +	virtual	int       __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam);
  	//==== Events ========================================================================
 diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index cac5aee537..c8d729f540 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -313,7 +313,7 @@ void CVkProto::OnReceiveFriends(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq  	if (bCleanContacts)
  		for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName))
  			if (!isChatRoom(hContact))
 -				arContacts.insert(hContact);
 +				arContacts.insert((HANDLE)hContact);
  	for (int i = 0; (pInfo = json_at(pResponse, i)) != NULL; i++) {
  		ptrT szValue(json_as_string(json_get(pInfo, "uid")));
 diff --git a/protocols/Yahoo/src/proto.cpp b/protocols/Yahoo/src/proto.cpp index afd2138d9c..b97c79b396 100644 --- a/protocols/Yahoo/src/proto.cpp +++ b/protocols/Yahoo/src/proto.cpp @@ -99,7 +99,7 @@ int CYahooProto::OnModulesLoadedEx(WPARAM, LPARAM)  ////////////////////////////////////////////////////////////////////////////////////////
  // AddToList - adds a contact to the contact list
 -HANDLE CYahooProto::AddToList( int flags, PROTOSEARCHRESULT* psr )
 +HCONTACT CYahooProto::AddToList( int flags, PROTOSEARCHRESULT* psr )
  {
  	debugLogA("[YahooAddToList] Flags: %d", flags);
 @@ -119,12 +119,14 @@ HANDLE CYahooProto::AddToList( int flags, PROTOSEARCHRESULT* psr )  		if (db_get_b(hContact, "CList", "NotOnList", 0)) {
  			debugLogA("[YahooAddToList] Temporary Buddy:%s already on our buddy list", id);
  			//return 0;
 -		} else {
 +		}
 +		else {
  			debugLogA("[YahooAddToList] Buddy:%s already on our buddy list", id);
  			mir_free(id);
  			return 0;
  		}
 -	} else if (flags & PALF_TEMPORARY) { /* not on our list */
 +	}
 +	else if (flags & PALF_TEMPORARY) { /* not on our list */
  		debugLogA("[YahooAddToList] Adding Temporary Buddy:%s ", id);
  	}
 @@ -135,7 +137,7 @@ HANDLE CYahooProto::AddToList( int flags, PROTOSEARCHRESULT* psr )  	return hContact;
  }
 -HANDLE __cdecl CYahooProto::AddToListByEvent( int flags, int /*iContact*/, HANDLE hDbEvent )
 +HCONTACT __cdecl CYahooProto::AddToListByEvent( int flags, int /*iContact*/, HANDLE hDbEvent )
  {
  	debugLogA("[YahooAddToListByEvent]");
  	if (!m_bLoggedIn)
 diff --git a/protocols/Yahoo/src/proto.h b/protocols/Yahoo/src/proto.h index c548585dab..667473292b 100644 --- a/protocols/Yahoo/src/proto.h +++ b/protocols/Yahoo/src/proto.h @@ -25,51 +25,51 @@ struct CYahooProto : public PROTO<CYahooProto>  	// PROTO_INTERFACE
  	//====================================================================================
 -	virtual	HANDLE __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr );
 -	virtual	HANDLE __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent );
 +	virtual	HCONTACT  __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr );
 +	virtual	HCONTACT  __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent );
 -	virtual	int    __cdecl Authorize( HANDLE hDbEvent );
 -	virtual	int    __cdecl AuthDeny( HANDLE hDbEvent, const TCHAR* szReason );
 -	virtual	int    __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT* );
 -	virtual	int    __cdecl AuthRequest(HCONTACT hContact, const TCHAR* szMessage );
 +	virtual	int       __cdecl Authorize( HANDLE hDbEvent );
 +	virtual	int       __cdecl AuthDeny( HANDLE hDbEvent, const TCHAR* szReason );
 +	virtual	int       __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT* );
 +	virtual	int       __cdecl AuthRequest(HCONTACT hContact, const TCHAR* szMessage );
 -	virtual	HANDLE __cdecl ChangeInfo( int iInfoType, void* pInfoData );
 +	virtual	HANDLE    __cdecl ChangeInfo( int iInfoType, void* pInfoData );
 -	virtual	HANDLE __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath );
 -	virtual	int    __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer );
 -	virtual	int    __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason );
 -	virtual	int    __cdecl FileResume( HANDLE hTransfer, int* action, const PROTOCHAR** szFilename );
 +	virtual	HANDLE    __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath );
 +	virtual	int       __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer );
 +	virtual	int       __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason );
 +	virtual	int       __cdecl FileResume( HANDLE hTransfer, int* action, const PROTOCHAR** szFilename );
  	virtual	DWORD_PTR __cdecl GetCaps( int type, HCONTACT hContact = NULL);
 -	virtual	int    __cdecl GetInfo(HCONTACT hContact, int infoType );
 +	virtual	int       __cdecl GetInfo(HCONTACT hContact, int infoType );
 -	virtual	HANDLE __cdecl SearchBasic( const PROTOCHAR* id );
 -	virtual	HANDLE __cdecl SearchByEmail( const PROTOCHAR* email );
 -	virtual	HANDLE __cdecl SearchByName( const PROTOCHAR* nick, const PROTOCHAR* firstName, const PROTOCHAR* lastName );
 -	virtual	HWND   __cdecl SearchAdvanced( HWND owner );
 -	virtual	HWND   __cdecl CreateExtendedSearchUI( HWND owner );
 +	virtual	HANDLE    __cdecl SearchBasic( const PROTOCHAR* id );
 +	virtual	HANDLE    __cdecl SearchByEmail( const PROTOCHAR* email );
 +	virtual	HANDLE    __cdecl SearchByName( const PROTOCHAR* nick, const PROTOCHAR* firstName, const PROTOCHAR* lastName );
 +	virtual	HWND      __cdecl SearchAdvanced( HWND owner );
 +	virtual	HWND      __cdecl CreateExtendedSearchUI( HWND owner );
 -	virtual	int    __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT*);
 -	virtual	int    __cdecl RecvFile(HCONTACT hContact, PROTORECVFILET*);
 -	virtual	int    __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT*);
 -	virtual	int    __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT*);
 +	virtual	int       __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT*);
 +	virtual	int       __cdecl RecvFile(HCONTACT hContact, PROTORECVFILET*);
 +	virtual	int       __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT*);
 +	virtual	int       __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT*);
 -	virtual	int    __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList);
 -	virtual	HANDLE __cdecl SendFile(HCONTACT hContact, const PROTOCHAR *szDescription, PROTOCHAR **ppszFiles);
 -	virtual	int    __cdecl SendMsg(HCONTACT hContact, int flags, const char* msg );
 -	virtual	int    __cdecl SendUrl(HCONTACT hContact, int flags, const char* url );
 +	virtual	int       __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList);
 +	virtual	HANDLE    __cdecl SendFile(HCONTACT hContact, const PROTOCHAR *szDescription, PROTOCHAR **ppszFiles);
 +	virtual	int       __cdecl SendMsg(HCONTACT hContact, int flags, const char* msg );
 +	virtual	int       __cdecl SendUrl(HCONTACT hContact, int flags, const char* url );
 -	virtual	int    __cdecl SetApparentMode(HCONTACT hContact, int mode);
 -	virtual	int    __cdecl SetStatus(int iNewStatus);
 +	virtual	int       __cdecl SetApparentMode(HCONTACT hContact, int mode);
 +	virtual	int       __cdecl SetStatus(int iNewStatus);
 -	virtual	HANDLE __cdecl GetAwayMsg(HCONTACT hContact);
 -	virtual	int    __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT *evt);
 -	virtual	int    __cdecl SetAwayMsg( int m_iStatus, const PROTOCHAR *msg);
 -	virtual INT_PTR __cdecl GetMyAwayMsg(WPARAM wParam, LPARAM lParam);
 +	virtual	HANDLE    __cdecl GetAwayMsg(HCONTACT hContact);
 +	virtual	int       __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT *evt);
 +	virtual	int       __cdecl SetAwayMsg( int m_iStatus, const PROTOCHAR *msg);
 +	virtual INT_PTR    __cdecl GetMyAwayMsg(WPARAM wParam, LPARAM lParam);
 -	virtual	int    __cdecl UserIsTyping(HCONTACT hContact, int type);
 +	virtual	int       __cdecl UserIsTyping(HCONTACT hContact, int type);
 -	virtual	int    __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam);
 +	virtual	int       __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam);
  	//====| Events |======================================================================
  	int     __cdecl OnContactDeleted(WPARAM, LPARAM);
 diff --git a/src/modules/protocols/protoint.cpp b/src/modules/protocols/protoint.cpp index 41b4a7991a..75099e8c95 100644 --- a/src/modules/protocols/protoint.cpp +++ b/src/modules/protocols/protoint.cpp @@ -47,14 +47,14 @@ void FreeFilesMatrix(TCHAR ***files)  struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
  {
 -	HANDLE __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr)
 +	HCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr)
  	{
 -		return (HANDLE)ProtoCallService(m_szModuleName, PS_ADDTOLIST, flags, (LPARAM)psr);
 +		return (HCONTACT)ProtoCallService(m_szModuleName, PS_ADDTOLIST, flags, (LPARAM)psr);
  	}
 -	HANDLE __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent)
 +	HCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent)
  	{
 -		return (HANDLE)ProtoCallService(m_szModuleName, PS_ADDTOLISTBYEVENT, MAKELONG(flags, iContact), (LPARAM)hDbEvent);
 +		return (HCONTACT)ProtoCallService(m_szModuleName, PS_ADDTOLISTBYEVENT, MAKELONG(flags, iContact), (LPARAM)hDbEvent);
  	}
  	int __cdecl Authorize(HANDLE hDbEvent)
  | 
