From 85c0b6a96f366bdf0ca334ee7cb1877fb3f2288c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 16 Jan 2015 17:49:54 +0000 Subject: MEVENT - the strict type for events, they are not HANDLE anymore git-svn-id: http://svn.miranda-ng.org/main/trunk@11866 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/core/stdauth/src/auth.cpp | 4 ++-- src/core/stdauth/src/authdialogs.cpp | 8 ++++---- src/core/stdfile/src/file.cpp | 11 +++++------ src/core/stdfile/src/file.h | 2 +- src/core/stdmsg/src/globals.cpp | 8 ++++---- src/core/stdmsg/src/msgdialog.cpp | 10 +++++----- src/core/stdmsg/src/msglog.cpp | 6 +++--- src/core/stdmsg/src/msgs.cpp | 8 ++++---- src/core/stdmsg/src/msgs.h | 28 ++++++++++++++-------------- src/core/stduihist/src/history.cpp | 14 +++++++------- src/core/stdurl/url.cpp | 6 +++--- src/core/stdurl/url.h | 2 +- src/core/stduseronline/src/useronline.cpp | 2 +- src/mir_core/src/db.cpp | 22 +++++++++++----------- src/modules/chat/chat.h | 2 +- src/modules/chat/clist.cpp | 2 +- src/modules/clist/clc.h | 2 +- src/modules/clist/clistevents.cpp | 8 ++++---- src/modules/protocols/protoaccs.cpp | 6 +++--- src/modules/protocols/protocols.cpp | 14 +++++++------- src/modules/protocols/protoint.cpp | 6 +++--- 21 files changed, 85 insertions(+), 86 deletions(-) (limited to 'src') diff --git a/src/core/stdauth/src/auth.cpp b/src/core/stdauth/src/auth.cpp index bd6a7feb4c..3a1a1d43eb 100644 --- a/src/core/stdauth/src/auth.cpp +++ b/src/core/stdauth/src/auth.cpp @@ -46,10 +46,10 @@ static int AuthEventAdded(WPARAM, LPARAM lParam) { TCHAR szUid[128] = _T(""); TCHAR szTooltip[256]; - const HANDLE hDbEvent = (HANDLE)lParam; + MEVENT hDbEvent = (MEVENT)lParam; DBEVENTINFO dbei = { sizeof(dbei) }; - db_event_get((HANDLE)lParam, &dbei); + db_event_get(lParam, &dbei); if (dbei.flags & (DBEF_SENT | DBEF_READ) || (dbei.eventType != EVENTTYPE_AUTHREQUEST && dbei.eventType != EVENTTYPE_ADDED)) return 0; diff --git a/src/core/stdauth/src/authdialogs.cpp b/src/core/stdauth/src/authdialogs.cpp index e1a1865507..4c8c66ce5d 100644 --- a/src/core/stdauth/src/authdialogs.cpp +++ b/src/core/stdauth/src/authdialogs.cpp @@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. INT_PTR CALLBACK DlgProcAdded(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { - HANDLE hDbEvent = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); + MEVENT hDbEvent = (MEVENT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (msg) { case WM_INITDIALOG: @@ -34,7 +34,7 @@ INT_PTR CALLBACK DlgProcAdded(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar Button_SetIcon_IcoLib(hwndDlg, IDC_DETAILS, SKINICON_OTHER_USERDETAILS, LPGEN("View user's details")); Button_SetIcon_IcoLib(hwndDlg, IDC_ADD, SKINICON_OTHER_ADDCONTACT, LPGEN("Add contact permanently to list")); - hDbEvent = (HANDLE)lParam; + hDbEvent = lParam; SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam); { //blob is: uin(DWORD), hcontact(HANDLE), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ) @@ -149,7 +149,7 @@ INT_PTR CALLBACK DlgProcAdded(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar INT_PTR CALLBACK DlgProcAuthReq(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { - HANDLE hDbEvent = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); + MEVENT hDbEvent = (MEVENT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (msg) { case WM_INITDIALOG: @@ -157,7 +157,7 @@ INT_PTR CALLBACK DlgProcAuthReq(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP Button_SetIcon_IcoLib(hwndDlg, IDC_DETAILS, SKINICON_OTHER_USERDETAILS, LPGEN("View user's details")); Button_SetIcon_IcoLib(hwndDlg, IDC_ADD, SKINICON_OTHER_ADDCONTACT, LPGEN("Add contact permanently to list")); { - hDbEvent = (HANDLE)lParam; + hDbEvent = lParam; SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam); //blob is: uin(DWORD), hcontact(HANDLE), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ), reason(ASCIIZ) diff --git a/src/core/stdfile/src/file.cpp b/src/core/stdfile/src/file.cpp index 0363ebc851..f61378f3ca 100644 --- a/src/core/stdfile/src/file.cpp +++ b/src/core/stdfile/src/file.cpp @@ -109,7 +109,7 @@ static INT_PTR RecvFileCommand(WPARAM, LPARAM lParam) return 0; } -void PushFileEvent(MCONTACT hContact, HANDLE hdbe, LPARAM lParam) +void PushFileEvent(MCONTACT hContact, MEVENT hdbe, LPARAM lParam) { CLISTEVENT cle = { 0 }; cle.cbSize = sizeof(cle); @@ -140,11 +140,11 @@ static int FileEventAdded(WPARAM wParam, LPARAM lParam) DBEVENTINFO dbei = { sizeof(dbei) }; dbei.cbBlob = sizeof(DWORD); dbei.pBlob = (PBYTE)&dwSignature; - db_event_get((HANDLE)lParam, &dbei); + db_event_get(lParam, &dbei); if (dbei.flags & (DBEF_SENT | DBEF_READ) || dbei.eventType != EVENTTYPE_FILE || dwSignature == 0) return 0; - PushFileEvent(wParam, (HANDLE)lParam, 0); + PushFileEvent(wParam, lParam, 0); return 0; } @@ -287,7 +287,7 @@ void UpdateProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *dest, PROTOFILETRANS static void RemoveUnreadFileEvents(void) { for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { - HANDLE hDbEvent = db_event_firstUnread(hContact); + MEVENT hDbEvent = db_event_firstUnread(hContact); while (hDbEvent) { DBEVENTINFO dbei = { sizeof(dbei) }; db_event_get(hDbEvent, &dbei); @@ -399,8 +399,7 @@ static INT_PTR Proto_RecvFileT(WPARAM, LPARAM lParam) mir_free(pszFiles[i]); mir_free(szDescr); - HANDLE hdbe = db_event_add(ccs->hContact, &dbei); - + MEVENT hdbe = db_event_add(ccs->hContact, &dbei); PushFileEvent(ccs->hContact, hdbe, pre->lParam); mir_free(dbei.pBlob); return 0; diff --git a/src/core/stdfile/src/file.h b/src/core/stdfile/src/file.h index 4231cef5e0..1d0c8322b7 100644 --- a/src/core/stdfile/src/file.h +++ b/src/core/stdfile/src/file.h @@ -49,7 +49,7 @@ struct FileDlgData HWND hwndTransfer; HANDLE fs; MCONTACT hContact; - HANDLE hDbEvent; + MEVENT hDbEvent; HANDLE hNotifyEvent; TCHAR **files; int send; diff --git a/src/core/stdmsg/src/globals.cpp b/src/core/stdmsg/src/globals.cpp index f2033c6e00..62fe7fa5e8 100644 --- a/src/core/stdmsg/src/globals.cpp +++ b/src/core/stdmsg/src/globals.cpp @@ -58,17 +58,17 @@ static int OnMetaChanged(WPARAM hMeta, LPARAM) return 0; } -static int dbaddedevent(WPARAM hContact, LPARAM lParam) +static int dbaddedevent(WPARAM hContact, LPARAM hDbEvent) { if (hContact) { HWND h = WindowList_Find(g_dat.hMessageWindowList, hContact); if (h) - SendMessage(h, HM_DBEVENTADDED, hContact, lParam); + SendMessage(h, HM_DBEVENTADDED, hContact, hDbEvent); - MCONTACT hEventContact = db_event_getContact((HANDLE)lParam); + MCONTACT hEventContact = db_event_getContact(hDbEvent); if (hEventContact != hContact) if ((h = WindowList_Find(g_dat.hMessageWindowList, hEventContact)) != NULL) - SendMessage(h, HM_DBEVENTADDED, hEventContact, lParam); + SendMessage(h, HM_DBEVENTADDED, hEventContact, hDbEvent); } return 0; } diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index f0bf138396..ee401f03f4 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -757,7 +757,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP switch (historyMode) { case LOADHISTORY_COUNT: for (int i = db_get_w(NULL, SRMMMOD, SRMSGSET_LOADCOUNT, SRMSGDEFSET_LOADCOUNT); i--;) { - HANDLE hPrevEvent; + MEVENT hPrevEvent; if (dat->hDbEventFirst == NULL) hPrevEvent = db_event_last(dat->hContact); else @@ -782,7 +782,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP DWORD firstTime = dbei.timestamp - 60 * db_get_w(NULL, SRMMMOD, SRMSGSET_LOADTIME, SRMSGDEFSET_LOADTIME); for (;;) { - HANDLE hPrevEvent; + MEVENT hPrevEvent; if (dat->hDbEventFirst == NULL) hPrevEvent = db_event_last(dat->hContact); else @@ -800,7 +800,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP } } - HANDLE hdbEvent = db_event_last(dat->hContact); + MEVENT hdbEvent = db_event_last(dat->hContact); if (hdbEvent) { do { DBEVENTINFO dbei = { sizeof(dbei) }; @@ -1260,7 +1260,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP break; case DM_APPENDTOLOG: //takes wParam=hDbEvent - StreamInEvents(hwndDlg, (HANDLE)wParam, 1, 1); + StreamInEvents(hwndDlg, wParam, 1, 1); break; case DM_SCROLLLOGTOBOTTOM: @@ -1281,7 +1281,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case HM_DBEVENTADDED: if (wParam == dat->hContact) { - HANDLE hDbEvent = (HANDLE)lParam; + MEVENT hDbEvent = lParam; if (dat->hDbEventFirst == NULL) dat->hDbEventFirst = hDbEvent; diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp index 8a604a72a0..c25f1bdd2d 100644 --- a/src/core/stdmsg/src/msglog.cpp +++ b/src/core/stdmsg/src/msglog.cpp @@ -39,7 +39,7 @@ struct LogStreamData { int stage; MCONTACT hContact; - HANDLE hDbEvent, hDbEventLast; + MEVENT hDbEvent, hDbEventLast; char *buffer; int bufferOffset, bufferLen; int eventsToInsert; @@ -228,7 +228,7 @@ int DbEventIsShown(DBEVENTINFO *dbei) } //mir_free() the return value -static char *CreateRTFFromDbEvent(SrmmWindowData *dat, MCONTACT hContact, HANDLE hDbEvent, struct LogStreamData *streamData) +static char *CreateRTFFromDbEvent(SrmmWindowData *dat, MCONTACT hContact, MEVENT hDbEvent, struct LogStreamData *streamData) { int showColon = 0; @@ -444,7 +444,7 @@ static DWORD CALLBACK LogStreamInEvents(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG return 0; } -void StreamInEvents(HWND hwndDlg, HANDLE hDbEventFirst, int count, int fAppend) +void StreamInEvents(HWND hwndDlg, MEVENT hDbEventFirst, int count, int fAppend) { EDITSTREAM stream = { 0 }; struct LogStreamData streamData = { 0 }; diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index 2a846769ec..0f3e5e5eb2 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -52,7 +52,7 @@ static int SRMMStatusToPf2(int status) static int MessageEventAdded(WPARAM hContact, LPARAM lParam) { DBEVENTINFO dbei = { sizeof(dbei) }; - db_event_get((HANDLE)lParam, &dbei); + db_event_get(lParam, &dbei); if (dbei.flags & (DBEF_SENT | DBEF_READ) || !(dbei.eventType == EVENTTYPE_MESSAGE || DbEventIsForMsgWindow(&dbei))) return 0; @@ -89,7 +89,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam) CLISTEVENT cle = { sizeof(cle) }; cle.hContact = hContact; - cle.hDbEvent = (HANDLE)lParam; + cle.hDbEvent = lParam; cle.flags = CLEF_TCHAR; cle.hIcon = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE); cle.pszService = "SRMsg/ReadMessage"; @@ -179,7 +179,7 @@ static int TypingMessage(WPARAM hContact, LPARAM lParam) else { CLISTEVENT cle = { sizeof(cle) }; cle.hContact = hContact; - cle.hDbEvent = (HANDLE)1; + cle.hDbEvent = 1; cle.flags = CLEF_ONLYAFEW | CLEF_TCHAR; cle.hIcon = LoadSkinnedIcon(SKINICON_OTHER_TYPING); cle.pszService = "SRMsg/ReadMessage"; @@ -235,7 +235,7 @@ static void RestoreUnreadMessageAlerts(void) DBEVENTINFO dbei = { sizeof(dbei) }; for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { - for (HANDLE hDbEvent = db_event_firstUnread(hContact); hDbEvent; hDbEvent = db_event_next(hContact, hDbEvent)) { + for (MEVENT hDbEvent = db_event_firstUnread(hContact); hDbEvent; hDbEvent = db_event_next(hContact, hDbEvent)) { bool autoPopup = false; dbei.cbBlob = 0; db_event_get(hDbEvent, &dbei); diff --git a/src/core/stdmsg/src/msgs.h b/src/core/stdmsg/src/msgs.h index 0ce9aea114..45d040d7dc 100644 --- a/src/core/stdmsg/src/msgs.h +++ b/src/core/stdmsg/src/msgs.h @@ -40,7 +40,7 @@ struct SrmmWindowData : public MZeroedObject {} MCONTACT hContact; - HANDLE hDbEventFirst, hDbEventLast; + MEVENT hDbEventFirst, hDbEventLast; HBRUSH hBkgBrush; int splitterPos, originalSplitterPos; SIZE minEditBoxSize; @@ -105,26 +105,26 @@ struct CREOleCallback : public IRichEditOleCallback int nextStgId; STDMETHOD(QueryInterface)(REFIID riid, LPVOID FAR * lplpObj); - STDMETHOD_(ULONG,AddRef) (THIS); - STDMETHOD_(ULONG,Release) (THIS); + STDMETHOD_(ULONG,AddRef)(THIS); + STDMETHOD_(ULONG,Release)(THIS); STDMETHOD(ContextSensitiveHelp)(BOOL fEnterMode); - STDMETHOD(GetNewStorage) (LPSTORAGE FAR * lplpstg); - STDMETHOD(GetInPlaceContext) (LPOLEINPLACEFRAME FAR * lplpFrame, LPOLEINPLACEUIWINDOW FAR * lplpDoc, LPOLEINPLACEFRAMEINFO lpFrameInfo); - STDMETHOD(ShowContainerUI) (BOOL fShow); - STDMETHOD(QueryInsertObject) (LPCLSID lpclsid, LPSTORAGE lpstg, LONG cp); - STDMETHOD(DeleteObject) (LPOLEOBJECT lpoleobj); - STDMETHOD(QueryAcceptData) (LPDATAOBJECT lpdataobj, CLIPFORMAT FAR * lpcfFormat, DWORD reco, BOOL fReally, HGLOBAL hMetaPict); - STDMETHOD(GetClipboardData) (CHARRANGE FAR * lpchrg, DWORD reco, LPDATAOBJECT FAR * lplpdataobj); - STDMETHOD(GetDragDropEffect) (BOOL fDrag, DWORD grfKeyState, LPDWORD pdwEffect); - STDMETHOD(GetContextMenu) (WORD seltype, LPOLEOBJECT lpoleobj, CHARRANGE FAR * lpchrg, HMENU FAR * lphmenu) ; + STDMETHOD(GetNewStorage)(LPSTORAGE FAR * lplpstg); + STDMETHOD(GetInPlaceContext)(LPOLEINPLACEFRAME FAR * lplpFrame, LPOLEINPLACEUIWINDOW FAR * lplpDoc, LPOLEINPLACEFRAMEINFO lpFrameInfo); + STDMETHOD(ShowContainerUI)(BOOL fShow); + STDMETHOD(QueryInsertObject)(LPCLSID lpclsid, LPSTORAGE lpstg, LONG cp); + STDMETHOD(DeleteObject)(LPOLEOBJECT lpoleobj); + STDMETHOD(QueryAcceptData)(LPDATAOBJECT lpdataobj, CLIPFORMAT FAR * lpcfFormat, DWORD reco, BOOL fReally, HGLOBAL hMetaPict); + STDMETHOD(GetClipboardData)(CHARRANGE FAR *lpchrg, DWORD reco, LPDATAOBJECT FAR * lplpdataobj); + STDMETHOD(GetDragDropEffect)(BOOL fDrag, DWORD grfKeyState, LPDWORD pdwEffect); + STDMETHOD(GetContextMenu)(WORD seltype, LPOLEOBJECT lpoleobj, CHARRANGE FAR * lpchrg, HMENU FAR * lphmenu) ; }; INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); INT_PTR CALLBACK ErrorDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); int DbEventIsForMsgWindow(DBEVENTINFO *dbei); -int DbEventIsShown(DBEVENTINFO * dbei); -void StreamInEvents(HWND hwndDlg, HANDLE hDbEventFirst, int count, int fAppend); +int DbEventIsShown(DBEVENTINFO *dbei); +void StreamInEvents(HWND hwndDlg, MEVENT hDbEventFirst, int count, int fAppend); int SendMessageDirect(const TCHAR *szMsg, MCONTACT hContact, char *szProto); void LoadMsgLogIcons(void); diff --git a/src/core/stduihist/src/history.cpp b/src/core/stduihist/src/history.cpp index 545c23fa7b..b1d3bc5c49 100644 --- a/src/core/stduihist/src/history.cpp +++ b/src/core/stduihist/src/history.cpp @@ -148,7 +148,7 @@ static void FillHistoryThread(void* param) DBEVENTINFO dbei = { sizeof(dbei) }; int oldBlobSize = 0; - HANDLE hDbEvent = db_event_last(hInfo->hContact); + MEVENT hDbEvent = db_event_last(hInfo->hContact); while (hDbEvent != NULL) { if (!IsWindow(hInfo->hwnd)) @@ -259,14 +259,14 @@ static INT_PTR CALLBACK DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wParam, LP return TRUE; case IDC_DELETEHISTORY: - HANDLE hDbevent; + MEVENT hDbevent; { int index = SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETCURSEL, 0, 0); if (index == LB_ERR) break; if (MessageBox(hwndDlg, TranslateT("Are you sure you want to delete this history item?"), TranslateT("Delete history"), MB_YESNO | MB_ICONQUESTION) == IDYES) { - hDbevent = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETITEMDATA, index, 0); + hDbevent = SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETITEMDATA, index, 0); db_event_delete(hContact, hDbevent); SendMessage(hwndDlg, DM_HREBUILD, 0, 0); } @@ -279,7 +279,7 @@ static INT_PTR CALLBACK DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (sel == LB_ERR) { EnableWindow(GetDlgItem(hwndDlg, IDC_DELETEHISTORY), FALSE); break; } EnableWindow(GetDlgItem(hwndDlg, IDC_DELETEHISTORY), TRUE); TCHAR *contactName = pcli->pfnGetContactDisplayName(hContact, 0); - HANDLE hDbEvent = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETITEMDATA, sel, 0); + MEVENT hDbEvent = SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETITEMDATA, sel, 0); DBEVENTINFO dbei = { sizeof(dbei) }; dbei.cbBlob = db_event_getBlobSize(hDbEvent); @@ -305,11 +305,11 @@ static INT_PTR CALLBACK DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wParam, LP DBEVENTINFO dbei = { sizeof(dbei) }; int oldBlobSize = 0; - HANDLE hDbEventStart = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETITEMDATA, index, 0); + MEVENT hDbEventStart = SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETITEMDATA, index, 0); for (;;) { - HANDLE hDbEvent = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETITEMDATA, ++index, 0); - if (hDbEvent == (HANDLE)LB_ERR) { + MEVENT hDbEvent = SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETITEMDATA, ++index, 0); + if (hDbEvent == LB_ERR) { index = -1; continue; } diff --git a/src/core/stdurl/url.cpp b/src/core/stdurl/url.cpp index 2eb4783206..f12c170831 100644 --- a/src/core/stdurl/url.cpp +++ b/src/core/stdurl/url.cpp @@ -42,7 +42,7 @@ static INT_PTR ReadUrlCommand(WPARAM, LPARAM lParam) static int UrlEventAdded(WPARAM hContact, LPARAM lParam) { DBEVENTINFO dbei = { sizeof(dbei) }; - db_event_get((HANDLE)lParam, &dbei); + db_event_get(lParam, &dbei); if (dbei.flags & (DBEF_SENT|DBEF_READ) || dbei.eventType != EVENTTYPE_URL) return 0; @@ -54,7 +54,7 @@ static int UrlEventAdded(WPARAM hContact, LPARAM lParam) CLISTEVENT cle = { sizeof(cle) }; cle.flags = CLEF_TCHAR; cle.hContact = hContact; - cle.hDbEvent = (HANDLE)lParam; + cle.hDbEvent = lParam; cle.hIcon = LoadSkinIcon(SKINICON_EVENT_URL); cle.pszService = "SRUrl/ReadUrl"; cle.ptszTooltip = szTooltip; @@ -76,7 +76,7 @@ static void RestoreUnreadUrlAlerts(void) cle.flags = CLEF_TCHAR; for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { - HANDLE hDbEvent = db_event_firstUnread(hContact); + MEVENT hDbEvent = db_event_firstUnread(hContact); while (hDbEvent) { DBEVENTINFO dbei = { sizeof(dbei) }; db_event_get(hDbEvent, &dbei); diff --git a/src/core/stdurl/url.h b/src/core/stdurl/url.h index d1202d10e2..ec91490ef3 100644 --- a/src/core/stdurl/url.h +++ b/src/core/stdurl/url.h @@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct UrlRcvData { MCONTACT hContact; - HANDLE hDbEvent; + MEVENT hDbEvent; }; struct UrlSendData { diff --git a/src/core/stduseronline/src/useronline.cpp b/src/core/stduseronline/src/useronline.cpp index d7737d0099..e0a8801e81 100644 --- a/src/core/stduseronline/src/useronline.cpp +++ b/src/core/stduseronline/src/useronline.cpp @@ -64,7 +64,7 @@ static int UserOnlineSettingChanged(WPARAM hContact, LPARAM lParam) cle.cbSize = sizeof(cle); cle.flags = CLEF_ONLYAFEW | CLEF_TCHAR; cle.hContact = hContact; - cle.hDbEvent = (HANDLE)(uniqueEventId++); + cle.hDbEvent = uniqueEventId++; cle.hIcon = LoadSkinIcon(SKINICON_OTHER_USERONLINE, false); cle.pszService = "UserOnline/Description"; mir_sntprintf(tooltip, SIZEOF(tooltip), TranslateT("%s is online"), pcli->pfnGetContactDisplayName(hContact, 0)); diff --git a/src/mir_core/src/db.cpp b/src/mir_core/src/db.cpp index 85c11345f2..7f723a21cf 100644 --- a/src/mir_core/src/db.cpp +++ b/src/mir_core/src/db.cpp @@ -256,7 +256,7 @@ MIR_CORE_DLL(INT_PTR) db_set_blob(MCONTACT hContact, const char *szModule, const ///////////////////////////////////////////////////////////////////////////////////////// // events -MIR_CORE_DLL(HANDLE) db_event_add(MCONTACT hContact, DBEVENTINFO *dbei) +MIR_CORE_DLL(MEVENT) db_event_add(MCONTACT hContact, DBEVENTINFO *dbei) { return (currDb == NULL) ? 0 : currDb->AddEvent(hContact, dbei); } @@ -266,52 +266,52 @@ MIR_CORE_DLL(int) db_event_count(MCONTACT hContact) return (currDb == NULL) ? 0 : currDb->GetEventCount(hContact); } -MIR_CORE_DLL(int) db_event_delete(MCONTACT hContact, HANDLE hDbEvent) +MIR_CORE_DLL(int) db_event_delete(MCONTACT hContact, MEVENT hDbEvent) { return (currDb == NULL) ? 0 : currDb->DeleteEvent(hContact, hDbEvent); } -MIR_CORE_DLL(HANDLE) db_event_first(MCONTACT hContact) +MIR_CORE_DLL(MEVENT) db_event_first(MCONTACT hContact) { return (currDb == NULL) ? 0 : currDb->FindFirstEvent(hContact); } -MIR_CORE_DLL(HANDLE) db_event_firstUnread(MCONTACT hContact) +MIR_CORE_DLL(MEVENT) db_event_firstUnread(MCONTACT hContact) { return (currDb == NULL) ? 0 : currDb->FindFirstUnreadEvent(hContact); } -MIR_CORE_DLL(int) db_event_get(HANDLE hDbEvent, DBEVENTINFO *dbei) +MIR_CORE_DLL(int) db_event_get(MEVENT hDbEvent, DBEVENTINFO *dbei) { return (currDb == NULL) ? 1 : currDb->GetEvent(hDbEvent, dbei); } -MIR_CORE_DLL(int) db_event_getBlobSize(HANDLE hDbEvent) +MIR_CORE_DLL(int) db_event_getBlobSize(MEVENT hDbEvent) { return (currDb == NULL) ? 0 : currDb->GetBlobSize(hDbEvent); } -MIR_CORE_DLL(MCONTACT) db_event_getContact(HANDLE hDbEvent) +MIR_CORE_DLL(MCONTACT) db_event_getContact(MEVENT hDbEvent) { return (currDb == NULL) ? 0 : currDb->GetEventContact(hDbEvent); } -MIR_CORE_DLL(HANDLE) db_event_last(MCONTACT hContact) +MIR_CORE_DLL(MEVENT) db_event_last(MCONTACT hContact) { return (currDb == NULL) ? 0 : currDb->FindLastEvent(hContact); } -MIR_CORE_DLL(int) db_event_markRead(MCONTACT hContact, HANDLE hDbEvent) +MIR_CORE_DLL(int) db_event_markRead(MCONTACT hContact, MEVENT hDbEvent) { return (currDb == NULL) ? 0 : currDb->MarkEventRead(hContact, hDbEvent); } -MIR_CORE_DLL(HANDLE) db_event_next(MCONTACT hContact, HANDLE hDbEvent) +MIR_CORE_DLL(MEVENT) db_event_next(MCONTACT hContact, MEVENT hDbEvent) { return (currDb == NULL) ? 0 : currDb->FindNextEvent(hContact, hDbEvent); } -MIR_CORE_DLL(HANDLE) db_event_prev(MCONTACT hContact, HANDLE hDbEvent) +MIR_CORE_DLL(MEVENT) db_event_prev(MCONTACT hContact, MEVENT hDbEvent) { return (currDb == NULL) ? 0 : currDb->FindPrevEvent(hContact, hDbEvent); } diff --git a/src/modules/chat/chat.h b/src/modules/chat/chat.h index 68ef108dfb..f393d629b3 100644 --- a/src/modules/chat/chat.h +++ b/src/modules/chat/chat.h @@ -55,7 +55,7 @@ char* Log_CreateRTF(LOGSTREAMDATA *streamData); char* Log_SetStyle(int style); // clist.c -BOOL AddEvent(MCONTACT hContact, HICON hIcon, HANDLE hEvent, int type, TCHAR* fmt, ...); +BOOL AddEvent(MCONTACT hContact, HICON hIcon, MEVENT hEvent, int type, TCHAR* fmt, ...); MCONTACT AddRoom(const char *pszModule, const TCHAR *pszRoom, const TCHAR *pszDisplayName, int iType); MCONTACT FindRoom(const char *pszModule, const TCHAR *pszRoom); BOOL SetAllOffline(BOOL bHide, const char *pszModule); diff --git a/src/modules/chat/clist.cpp b/src/modules/chat/clist.cpp index 2499b79f2d..f96179e84b 100644 --- a/src/modules/chat/clist.cpp +++ b/src/modules/chat/clist.cpp @@ -197,7 +197,7 @@ INT_PTR PrebuildContactMenuSvc(WPARAM wParam, LPARAM lParam) return PrebuildContactMenu(wParam, lParam); } -BOOL AddEvent(MCONTACT hContact, HICON hIcon, HANDLE hEvent, int type, TCHAR* fmt, ... ) +BOOL AddEvent(MCONTACT hContact, HICON hIcon, MEVENT hEvent, int type, TCHAR* fmt, ...) { TCHAR szBuf[4096]; diff --git a/src/modules/clist/clc.h b/src/modules/clist/clc.h index b3e9bf6b17..c0100a6b8c 100644 --- a/src/modules/clist/clc.h +++ b/src/modules/clist/clc.h @@ -146,7 +146,7 @@ void fnFreeEvent(struct CListEvent* p); int fnEventsProcessContactDoubleClick(MCONTACT hContact); int fnEventsProcessTrayDoubleClick(int); int fnGetImlIconIndex(HICON hIcon); -int fnRemoveEvent(MCONTACT hContact, HANDLE dbEvent); +int fnRemoveEvent(MCONTACT hContact, MEVENT dbEvent); /* clistmod.c */ int fnGetContactIcon(MCONTACT hContact); diff --git a/src/modules/clist/clistevents.cpp b/src/modules/clist/clistevents.cpp index 0a63fcb759..fae471f9b9 100644 --- a/src/modules/clist/clistevents.cpp +++ b/src/modules/clist/clistevents.cpp @@ -185,7 +185,7 @@ CListEvent* fnAddEvent(CLISTEVENT *cle) // Removes an event from the contact list's queue // Returns 0 if the event was successfully removed, or nonzero if the event was not found -int fnRemoveEvent(MCONTACT hContact, HANDLE dbEvent) +int fnRemoveEvent(MCONTACT hContact, MEVENT dbEvent) { // Find the event that should be removed int i; @@ -255,7 +255,7 @@ int fnEventsProcessContactDoubleClick(MCONTACT hContact) { for (int i = 0; i < cli.events.count; i++) { if (cli.events.items[i]->cle.hContact == hContact) { - HANDLE hDbEvent = cli.events.items[i]->cle.hDbEvent; + MEVENT hDbEvent = cli.events.items[i]->cle.hDbEvent; CallService(cli.events.items[i]->cle.pszService, (WPARAM)(HWND)NULL, (LPARAM)& cli.events.items[i]->cle); cli.pfnRemoveEvent(hContact, hDbEvent); return 0; @@ -330,7 +330,7 @@ int fnEventsProcessTrayDoubleClick(int index) lck.unlock(); MCONTACT hContact = cli.events.items[eventIndex]->cle.hContact; - HANDLE hDbEvent = cli.events.items[eventIndex]->cle.hDbEvent; + MEVENT hDbEvent = cli.events.items[eventIndex]->cle.hDbEvent; // ; may be better to show send msg? CallService(cli.events.items[eventIndex]->cle.pszService, 0, (LPARAM)& cli.events.items[eventIndex]->cle); cli.pfnRemoveEvent(hContact, hDbEvent); @@ -378,7 +378,7 @@ static int CListEventSettingsChanged(WPARAM hContact, LPARAM lParam) INT_PTR AddEventSyncStub(WPARAM wParam, LPARAM lParam) { return CallServiceSync(MS_CLIST_ADDEVENT"_SYNC", wParam, lParam); } INT_PTR AddEventStub(WPARAM, LPARAM lParam) { return cli.pfnAddEvent((CLISTEVENT*)lParam) == NULL; } -INT_PTR RemoveEventStub(WPARAM wParam, LPARAM lParam) { return cli.pfnRemoveEvent(wParam, (HANDLE)lParam); } +INT_PTR RemoveEventStub(WPARAM wParam, LPARAM lParam) { return cli.pfnRemoveEvent(wParam, lParam); } INT_PTR GetEventStub(WPARAM wParam, LPARAM lParam) { return (INT_PTR)cli.pfnGetEvent(wParam, (int)lParam); } int InitCListEvents(void) diff --git a/src/modules/protocols/protoaccs.cpp b/src/modules/protocols/protoaccs.cpp index fcadce7773..393fb3aae4 100644 --- a/src/modules/protocols/protoaccs.cpp +++ b/src/modules/protocols/protoaccs.cpp @@ -298,17 +298,17 @@ static INT_PTR stub1(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam) static INT_PTR stub2(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam) { - return (INT_PTR)ppi->AddToListByEvent(HIWORD(wParam), LOWORD(wParam), (HANDLE)lParam); + return (INT_PTR)ppi->AddToListByEvent(HIWORD(wParam), LOWORD(wParam), (MEVENT)lParam); } static INT_PTR stub3(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM) { - return (INT_PTR)ppi->Authorize((HANDLE)wParam); + return (INT_PTR)ppi->Authorize((MEVENT)wParam); } static INT_PTR stub4(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam) { - return (INT_PTR)ppi->AuthDeny((HANDLE)wParam, StrConvT((const char*)lParam)); + return (INT_PTR)ppi->AuthDeny((MEVENT)wParam, StrConvT((const char*)lParam)); } static INT_PTR stub11(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam) diff --git a/src/modules/protocols/protocols.cpp b/src/modules/protocols/protocols.cpp index a981c96a96..ee89f89233 100644 --- a/src/modules/protocols/protocols.cpp +++ b/src/modules/protocols/protocols.cpp @@ -412,12 +412,12 @@ INT_PTR CallProtoServiceInt(MCONTACT hContact, const char *szModule, const char return res; } - case 2: return (INT_PTR)ppi->AddToListByEvent(LOWORD(wParam), HIWORD(wParam), (HANDLE)lParam); - case 3: return (INT_PTR)ppi->Authorize((HANDLE)wParam); + case 2: return (INT_PTR)ppi->AddToListByEvent(LOWORD(wParam), HIWORD(wParam), (MEVENT)lParam); + case 3: return (INT_PTR)ppi->Authorize((MEVENT)wParam); case 4: if (ppi->m_iVersion > 1) - return (INT_PTR)ppi->AuthDeny((HANDLE)wParam, StrConvT((char*)lParam)); - return (INT_PTR)ppi->AuthDeny((HANDLE)wParam, (PROTOCHAR*)lParam); + return (INT_PTR)ppi->AuthDeny((MEVENT)wParam, StrConvT((char*)lParam)); + return (INT_PTR)ppi->AuthDeny((MEVENT)wParam, (PROTOCHAR*)lParam); case 5: return (INT_PTR)ppi->AuthRecv(hContact, (PROTORECVEVENT*)lParam); case 6: if (ppi->m_iVersion > 1) @@ -529,8 +529,8 @@ INT_PTR CallProtoServiceInt(MCONTACT hContact, const char *szModule, const char return (INT_PTR)ppi->AuthRequest(hContact, StrConvA((const TCHAR*)lParam)); case 107: if (ppi->m_iVersion > 1) - return (INT_PTR)ppi->AuthDeny((HANDLE)wParam, (const TCHAR*)lParam); - return (INT_PTR)ppi->AuthDeny((HANDLE)wParam, StrConvA((const TCHAR*)lParam)); + return (INT_PTR)ppi->AuthDeny((MEVENT)wParam, (const TCHAR*)lParam); + return (INT_PTR)ppi->AuthDeny((MEVENT)wParam, StrConvA((const TCHAR*)lParam)); case 108: if (ppi->m_iVersion > 1) return (INT_PTR)ppi->SearchBasic((const TCHAR*)lParam); @@ -595,7 +595,7 @@ INT_PTR CallProtoServiceInt(MCONTACT hContact, const char *szModule, const char case 106: return (INT_PTR)pa->ppro->AuthRequest(ccs->hContact, (const TCHAR*)ccs->lParam); case 107: - return (INT_PTR)pa->ppro->AuthDeny((HANDLE)wParam, (const TCHAR*)lParam); + return (INT_PTR)pa->ppro->AuthDeny((MEVENT)wParam, (const TCHAR*)lParam); case 108: return (INT_PTR)pa->ppro->SearchBasic((const TCHAR*)lParam); case 109: diff --git a/src/modules/protocols/protoint.cpp b/src/modules/protocols/protoint.cpp index be43cbf488..9152877e44 100644 --- a/src/modules/protocols/protoint.cpp +++ b/src/modules/protocols/protoint.cpp @@ -51,17 +51,17 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE return (MCONTACT)ProtoCallService(m_szModuleName, PS_ADDTOLIST, flags, (LPARAM)psr); } - MCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent) + MCONTACT __cdecl AddToListByEvent(int flags, int iContact, MEVENT hDbEvent) { return (MCONTACT)ProtoCallService(m_szModuleName, PS_ADDTOLISTBYEVENT, MAKELONG(flags, iContact), (LPARAM)hDbEvent); } - int __cdecl Authorize(HANDLE hDbEvent) + int __cdecl Authorize(MEVENT hDbEvent) { return (int)ProtoCallService(m_szModuleName, PS_AUTHALLOW, (WPARAM)hDbEvent, 0); } - int __cdecl AuthDeny(HANDLE hDbEvent, const TCHAR* szReason) + int __cdecl AuthDeny(MEVENT hDbEvent, const TCHAR* szReason) { return (int)ProtoCallService(m_szModuleName, PS_AUTHDENY, (WPARAM)hDbEvent, (LPARAM)StrConvA(szReason)); } -- cgit v1.2.3