diff options
202 files changed, 654 insertions, 682 deletions
diff --git a/bin10/lib/mir_core.lib b/bin10/lib/mir_core.lib Binary files differindex 9fc3e0034e..e3eb7c4d78 100644 --- a/bin10/lib/mir_core.lib +++ b/bin10/lib/mir_core.lib diff --git a/bin12/lib/mir_core.lib b/bin12/lib/mir_core.lib Binary files differindex 7bca5ddaf1..0777a6370d 100644 --- a/bin12/lib/mir_core.lib +++ b/bin12/lib/mir_core.lib diff --git a/bin12/lib/mir_core64.lib b/bin12/lib/mir_core64.lib Binary files differindex a59d08d0ab..a51209b4aa 100644 --- a/bin12/lib/mir_core64.lib +++ b/bin12/lib/mir_core64.lib diff --git a/include/delphi/m_addcontact.inc b/include/delphi/m_addcontact.inc index 6b4201640f..f6fb8834d8 100644 --- a/include/delphi/m_addcontact.inc +++ b/include/delphi/m_addcontact.inc @@ -32,7 +32,7 @@ type PADDCONTACTSTRUCT = ^TADDCONTACTSTRUCT;
TADDCONTACTSTRUCT = record
handleType: int;
- handle : THANDLE; // HDBEVENT, TMCONTACT, SearchResult
+ handle : HDBEVENT; // HDBEVENT, SearchResult
szProto : PAnsiChar; // used by search result only
psr : pointer; // @PROTOSEARCHRESULT
end;
diff --git a/include/delphi/m_clistint.inc b/include/delphi/m_clistint.inc index 0615f9d7d9..3a0b478a44 100644 --- a/include/delphi/m_clistint.inc +++ b/include/delphi/m_clistint.inc @@ -458,7 +458,7 @@ type pfnAddEvent : function (_para1:PCLISTEVENT):PCListEvent; cdecl;
pfnGetEvent : function (hContact:TMCONTACT; idx:int):PCLISTEVENT; cdecl;
- pfnRemoveEvent : function (hContact:TMCONTACT; hDbEvent:THANDLE):int; cdecl;
+ pfnRemoveEvent : function (hContact:TMCONTACT; hDbEvent:HDBEVENT):int; cdecl;
pfnGetImlIconIndex : function (hIcon:HICON):int; cdecl;
(*************************************************************************************
diff --git a/include/delphi/m_core.inc b/include/delphi/m_core.inc index 20558e72ca..53e9886a49 100644 --- a/include/delphi/m_core.inc +++ b/include/delphi/m_core.inc @@ -55,11 +55,12 @@ const type
PMCONTACT = ^TMCONTACT;
TMCONTACT = dword;
+
const
INVALID_CONTACT_ID = TMCONTACT(-1);
type
- HDBEVENT = THANDLE;
+ HDBEVENT = dword;
PDBVARIANT = ^TDBVARIANT;
TDBVARIANT = record
_type: byte;
@@ -125,7 +126,7 @@ modules are free to define their own, beginning at 2000 DBEVENTINFO.timestamp is in GMT, as returned by time(). There are services
db/time/x below with useful stuff for dealing with it.
}
-function db_event_add(hContact:TMCONTACT; dbei:PDBEVENTINFO):THANDLE; stdcall;
+function db_event_add(hContact:TMCONTACT; dbei:PDBEVENTINFO):HDBEVENT; stdcall;
external CoreDLL name 'db_event_add';
{
@@ -143,7 +144,7 @@ hDbEvent should have been returned by db_event_add/first/last/next/prev() Returns 0 on success, or nonzero if hDbEvent was invalid
Triggers a db/event/deleted event just *before* the event is deleted
}
-function db_event_delete(hContact:TMCONTACT; hDbEvent:THANDLE):int; stdcall;
+function db_event_delete(hContact:TMCONTACT; hDbEvent:HDBEVENT):int; stdcall;
external CoreDLL name 'db_event_delete';
{
@@ -151,7 +152,7 @@ Retrieves a handle to the first event in the chain for hContact Returns the handle, or NULL if hContact is invalid or has no events
Events in a chain are sorted chronologically automatically
}
-function db_event_first(hContact:TMCONTACT):THANDLE; stdcall;
+function db_event_first(hContact:TMCONTACT):HDBEVENT; stdcall;
external CoreDLL name 'db_event_first';
{
@@ -165,7 +166,7 @@ should be checked individually with db_event_next() and db_event_get() This service is designed for startup, reloading all the events that remained
unread from last time
}
-function db_event_firstUnread(hContact:TMCONTACT):THANDLE; stdcall;
+function db_event_firstUnread(hContact:TMCONTACT):HDBEVENT; stdcall;
external CoreDLL name 'db_event_firstUnread';
{
@@ -182,7 +183,7 @@ and then dbe.cbBlob is set to the required size of data to go in dbe.pBlob On return, dbe.szModule is a pointer to the database module's own internal list
of modules. Look but don't touch.
}
-function db_event_get(hDbEvent:THANDLE; dbei:PDBEVENTINFO):int; stdcall;
+function db_event_get(hDbEvent:HDBEVENT; dbei:PDBEVENTINFO):int; stdcall;
external CoreDLL name 'db_event_get';
{
@@ -190,7 +191,7 @@ Retrieves the space in bytes required to store the blob in hDbEvent hDbEvent should have been returned by db_event_add/first/last/next/prev()
Returns the space required in bytes, or -1 if hDbEvent is invalid
}
-function db_event_getBlobSize(hDbEvent:THANDLE):int; stdcall;
+function db_event_getBlobSize(hDbEvent:HDBEVENT):int; stdcall;
external CoreDLL name 'db_event_getBlobSize';
{
@@ -202,7 +203,7 @@ success This service is exceptionally slow. Use only when you have no other choice at
all.
}
-function db_event_getContact(hDbEvent:THANDLE):TMCONTACT; stdcall;
+function db_event_getContact(hDbEvent:HDBEVENT):TMCONTACT; stdcall;
external CoreDLL name 'db_event_getContact';
{
@@ -210,7 +211,7 @@ Retrieves a handle to the last event in the chain for hContact Returns the handle, or NULL if hContact is invalid or has no events
Events in a chain are sorted chronologically automatically
}
-function db_event_last(hContact:TMCONTACT):THANDLE; stdcall;
+function db_event_last(hContact:TMCONTACT):HDBEVENT; stdcall;
external CoreDLL name 'db_event_last';
{
@@ -221,7 +222,7 @@ is invalid. This is the one database write operation that does not trigger an event.
Modules should not save flags states for any length of time.
}
-function db_event_markRead(hContact:TMCONTACT; hDbEvent:THANDLE):int; stdcall;
+function db_event_markRead(hContact:TMCONTACT; hDbEvent:HDBEVENT):int; stdcall;
external CoreDLL name 'db_event_markRead';
{
@@ -229,7 +230,7 @@ Retrieves a handle to the next event in a chain after hDbEvent Returns the handle, or NULL if hDbEvent is invalid or is the last event
Events in a chain are sorted chronologically automatically
}
-function db_event_next(hContact:TMCONTACT; hDbEvent:THANDLE):THANDLE; stdcall;
+function db_event_next(hContact:TMCONTACT; hDbEvent:HDBEVENT):HDBEVENT; stdcall;
external CoreDLL name 'db_event_next';
{
@@ -237,7 +238,7 @@ Retrieves a handle to the previous event in a chain before hDbEvent Returns the handle, or NULL if hDbEvent is invalid or is the first event
Events in a chain are sorted chronologically automatically
}
-function db_event_prev(hContact:TMCONTACT; hDbEvent:THANDLE):THANDLE; stdcall;
+function db_event_prev(hContact:TMCONTACT; hDbEvent:HDBEVENT):HDBEVENT; stdcall;
external CoreDLL name 'db_event_prev';
function db_free(dbv:PDBVARIANT):int_ptr; stdcall;
diff --git a/include/delphi/m_db_int.inc b/include/delphi/m_db_int.inc index ee6334e52f..61d8d66fc5 100644 --- a/include/delphi/m_db_int.inc +++ b/include/delphi/m_db_int.inc @@ -83,17 +83,17 @@ type IsDbContact:function(contactID:TMCONTACT):bool; stdcall;
GetEventCount:function(contactID:TMCONTACT):long; stdcall;
- AddEvent:function(contactID:TMCONTACT; dbe:PDBEVENTINFO):THANDLE; stdcall;
- DeleteEvent:function(contactID:TMCONTACT; hDbEvent:THANDLE):bool; stdcall;
- GetBlobSize:function(hDbEvent:THANDLE):long; stdcall;
- GetEvent:function(hDbEvent:THANDLE; dbe:PDBEVENTINFO):bool; stdcall;
- MarkEventRead:function(contactID:TMCONTACT; hDbEvent:THANDLE):bool; stdcall;
- GetEventContact:function(hDbEvent:THANDLE):TMCONTACT; stdcall;
- FindFirstEvent:function(contactID:TMCONTACT):THANDLE; stdcall;
- FindFirstUnreadEvent:function(contactID:TMCONTACT):THANDLE; stdcall;
- FindLastEvent:function(contactID:TMCONTACT):THANDLE; stdcall;
- FindNextEvent:function(contactID:TMCONTACT;hDbEvent:THANDLE):THANDLE; stdcall;
- FindPrevEvent:function(contactID:TMCONTACT;hDbEvent:THANDLE):THANDLE; stdcall;
+ AddEvent:function(contactID:TMCONTACT; dbe:PDBEVENTINFO):HDBEVENT; stdcall;
+ DeleteEvent:function(contactID:TMCONTACT; hDbEvent:HDBEVENT):bool; stdcall;
+ GetBlobSize:function(hDbEvent:HDBEVENT):long; stdcall;
+ GetEvent:function(hDbEvent:HDBEVENT; dbe:PDBEVENTINFO):bool; stdcall;
+ MarkEventRead:function(contactID:TMCONTACT; hDbEvent:HDBEVENT):bool; stdcall;
+ GetEventContact:function(hDbEvent:HDBEVENT):TMCONTACT; stdcall;
+ FindFirstEvent:function(contactID:TMCONTACT):HDBEVENT; stdcall;
+ FindFirstUnreadEvent:function(contactID:TMCONTACT):HDBEVENT; stdcall;
+ FindLastEvent:function(contactID:TMCONTACT):HDBEVENT; stdcall;
+ FindNextEvent:function(contactID:TMCONTACT;hDbEvent:HDBEVENT):HDBEVENT; stdcall;
+ FindPrevEvent:function(contactID:TMCONTACT;hDbEvent:HDBEVENT):HDBEVENT; stdcall;
EnumModuleNames:function(pFunc:TDBMODULEENUMPROC; pParam:pointer):bool; stdcall;
diff --git a/include/delphi/m_protoint.inc b/include/delphi/m_protoint.inc index be6b9e64cd..2d1f49d22a 100644 --- a/include/delphi/m_protoint.inc +++ b/include/delphi/m_protoint.inc @@ -56,10 +56,10 @@ type // Virtual functions
AddToList :function(intf:PPROTO_INTERFACE;flags:int; var psr:TPROTOSEARCHRESULT):TMCONTACT; cdecl;
- AddToListByEvent:function(intf:PPROTO_INTERFACE;flags:int; iContact:int; hDbEvent:THANDLE):TMCONTACT; cdecl;
+ AddToListByEvent:function(intf:PPROTO_INTERFACE;flags:int; iContact:int; hDbEvent:HDBEVENT):TMCONTACT; cdecl;
- Authorize :function(intf:PPROTO_INTERFACE;hDbEvent:THANDLE):int; cdecl;
- AuthDeny :function(intf:PPROTO_INTERFACE;hDbEvent:THANDLE;const szReason:TChar):int; cdecl;
+ Authorize :function(intf:PPROTO_INTERFACE;hDbEvent:HDBEVENT):int; cdecl;
+ AuthDeny :function(intf:PPROTO_INTERFACE;hDbEvent:HDBEVENT;const szReason:TChar):int; cdecl;
AuthRecv :function(intf:PPROTO_INTERFACE;hContact:TMCONTACT;var ptr:TPROTORECVEVENT):int; cdecl;
AuthRequest:function(intf:PPROTO_INTERFACE;hContact:TMCONTACT;szMessage:TChar):int; cdecl;
diff --git a/include/m_addcontact.h b/include/m_addcontact.h index 8f42c0f31e..a36bffa2c7 100644 --- a/include/m_addcontact.h +++ b/include/m_addcontact.h @@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. typedef struct{
int handleType; // one of the HANDLE_ constants
union {
- HANDLE hDbEvent; // hDbEvent if acs.handleType == HANDLE_EVENT
+ MEVENT hDbEvent; // hDbEvent if acs.handleType == HANDLE_EVENT
MCONTACT hContact; // hContact if acs.handleType == HANDLE_CONTACT
// ignored if acs.handleType == HANDLE_SEARCHRESULT
};
diff --git a/include/m_chat_int.h b/include/m_chat_int.h index 0725158a72..a98d682713 100644 --- a/include/m_chat_int.h +++ b/include/m_chat_int.h @@ -32,7 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define CHAT_MODULE "Chat"
#define CHATFONT_MODULE "ChatFonts"
-#define GC_FAKE_EVENT HANDLE(0xBABABEDA)
+#define GC_FAKE_EVENT MEVENT(0xBABABEDA)
#define GC_UPDATETITLE (WM_USER+100)
#define GC_SPLITTERMOVED (WM_USER+101)
@@ -369,7 +369,7 @@ struct CHAT_MANAGER MCONTACT (*AddRoom)(const char *pszModule, const TCHAR *pszRoom, const TCHAR *pszDisplayName, int iType);
BOOL (*SetOffline)(MCONTACT hContact, BOOL bHide);
BOOL (*SetAllOffline)(BOOL bHide, const char *pszModule);
- 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 (*FindRoom)(const char *pszModule, const TCHAR *pszRoom);
char* (*Log_CreateRTF)(LOGSTREAMDATA *streamData);
diff --git a/include/m_clist.h b/include/m_clist.h index 3c22836d1f..b4d2ae16e5 100644 --- a/include/m_clist.h +++ b/include/m_clist.h @@ -290,7 +290,7 @@ typedef struct { DWORD flags; //...of course
union
{
- HANDLE hDbEvent; //caller defined but should be unique for hContact
+ MEVENT hDbEvent; //caller defined but should be unique for hContact
char * lpszProtocol;
};
LPARAM lParam; //caller defined
diff --git a/include/m_clistint.h b/include/m_clistint.h index 1d3dde5e26..477179390d 100644 --- a/include/m_clistint.h +++ b/include/m_clistint.h @@ -404,7 +404,7 @@ typedef struct struct CListEvent* (*pfnAddEvent)(CLISTEVENT*);
CLISTEVENT* (*pfnGetEvent)(MCONTACT hContact, int idx);
- int (*pfnRemoveEvent)(MCONTACT hContact, HANDLE hDbEvent);
+ int (*pfnRemoveEvent)(MCONTACT hContact, MEVENT hDbEvent);
int (*pfnGetImlIconIndex)(HICON hIcon);
/*************************************************************************************
diff --git a/include/m_core.h b/include/m_core.h index 9497e11813..9f5bf4cbdb 100644 --- a/include/m_core.h +++ b/include/m_core.h @@ -25,6 +25,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef M_CORE_H__
#define M_CORE_H__ 1
+#include <stdint.h>
+
#ifndef M_TYPES_H__
#include <m_types.h>
#endif
@@ -54,9 +56,11 @@ MIR_CORE_DLL(LPCTSTR) CmdLine_GetOption(LPCTSTR ptszParameter); ///////////////////////////////////////////////////////////////////////////////
// database functions
-typedef UINT32 MCONTACT;
+typedef uint32_t MCONTACT;
#define INVALID_CONTACT_ID (MCONTACT(-1))
+typedef uint32_t MEVENT;
+
// DBVARIANT: used by db/contact/getsetting and db/contact/writesetting
#define DBVT_DELETED 0 // this setting just got deleted, no other values are valid
#define DBVT_BYTE 1 // bVal and cVal are valid
@@ -181,7 +185,7 @@ db/time/x below with useful stuff for dealing with it. #define EVENTTYPE_AUTHREQUEST 1001 //specific codes, hence the module-
#define EVENTTYPE_FILE 1002 //specific limit has been raised to 2000
-MIR_CORE_DLL(HANDLE) db_event_add(MCONTACT hContact, DBEVENTINFO *dbei);
+MIR_CORE_DLL(MEVENT) db_event_add(MCONTACT hContact, DBEVENTINFO *dbei);
/*
Gets the number of events in the chain belonging to a contact in the database.
@@ -198,7 +202,7 @@ Returns 0 on success, or nonzero if hDbEvent was invalid Triggers a db/event/deleted event just *before* the event is deleted
*/
-MIR_CORE_DLL(int) db_event_delete(MCONTACT hContact, HANDLE hDbEvent);
+MIR_CORE_DLL(int) db_event_delete(MCONTACT hContact, MEVENT hDbEvent);
/*
Retrieves a handle to the first event in the chain for hContact
@@ -206,7 +210,7 @@ Returns the handle, or NULL if hContact is invalid or has no events Events in a chain are sorted chronologically automatically
*/
-MIR_CORE_DLL(HANDLE) db_event_first(MCONTACT hContact);
+MIR_CORE_DLL(MEVENT) db_event_first(MCONTACT hContact);
/*
Retrieves a handle to the first unread event in the chain for hContact
@@ -220,7 +224,7 @@ This service is designed for startup, reloading all the events that remained unread from last time
*/
-MIR_CORE_DLL(HANDLE) db_event_firstUnread(MCONTACT hContact);
+MIR_CORE_DLL(MEVENT) db_event_firstUnread(MCONTACT hContact);
/*
Retrieves all the information stored in hDbEvent
@@ -237,7 +241,7 @@ On return, dbe.szModule is a pointer to the database module's own internal list of modules. Look but don't touch.
*/
-MIR_CORE_DLL(int) db_event_get(HANDLE hDbEvent, DBEVENTINFO *dbei);
+MIR_CORE_DLL(int) db_event_get(MEVENT hDbEvent, DBEVENTINFO *dbei);
/*
Retrieves the space in bytes required to store the blob in hDbEvent
@@ -245,19 +249,16 @@ hDbEvent should have been returned by db_event_add/first/last/next/prev() Returns the space required in bytes, or -1 if hDbEvent is invalid
*/
-MIR_CORE_DLL(int) db_event_getBlobSize(HANDLE hDbEvent);
+MIR_CORE_DLL(int) db_event_getBlobSize(MEVENT hDbEvent);
/*
Retrieves a handle to the contact that owns hDbEvent.
hDbEvent should have been returned by db_event_add/first/last/next/prev()
NULL is a valid return value, meaning, as usual, the user.
-Returns (HANDLE)(-1) if hDbEvent is invalid, or the handle to the contact on
-success
-This service is exceptionally slow. Use only when you have no other choice at
-all.
+Returns INVALID_CONTACT_ID if hDbEvent is invalid, or the handle to the contact on success
*/
-MIR_CORE_DLL(MCONTACT) db_event_getContact(HANDLE hDbEvent);
+MIR_CORE_DLL(MCONTACT) db_event_getContact(MEVENT hDbEvent);
/*
Retrieves a handle to the last event in the chain for hContact
@@ -265,7 +266,7 @@ Returns the handle, or NULL if hContact is invalid or has no events Events in a chain are sorted chronologically automatically
*/
-MIR_CORE_DLL(HANDLE) db_event_last(MCONTACT hContact);
+MIR_CORE_DLL(MEVENT) db_event_last(MCONTACT hContact);
/*
Changes the flags for an event to mark it as read.
@@ -276,7 +277,7 @@ This is the one database write operation that does not trigger an event. Modules should not save flags states for any length of time.
*/
-MIR_CORE_DLL(int) db_event_markRead(MCONTACT hContact, HANDLE hDbEvent);
+MIR_CORE_DLL(int) db_event_markRead(MCONTACT hContact, MEVENT hDbEvent);
/*
Retrieves a handle to the next event in a chain after hDbEvent
@@ -284,7 +285,7 @@ Returns the handle, or NULL if hDbEvent is invalid or is the last event Events in a chain are sorted chronologically automatically
*/
-MIR_CORE_DLL(HANDLE) db_event_next(MCONTACT hContact, HANDLE hDbEvent);
+MIR_CORE_DLL(MEVENT) db_event_next(MCONTACT hContact, MEVENT hDbEvent);
/*
Retrieves a handle to the previous event in a chain before hDbEvent
@@ -292,7 +293,7 @@ Returns the handle, or NULL if hDbEvent is invalid or is the first event Events in a chain are sorted chronologically automatically
*/
-MIR_CORE_DLL(HANDLE) db_event_prev(MCONTACT hContact, HANDLE hDbEvent);
+MIR_CORE_DLL(MEVENT) db_event_prev(MCONTACT hContact, MEVENT hDbEvent);
/******************************************************************************
* DATABASE SETTINGS
diff --git a/include/m_db_int.h b/include/m_db_int.h index a26e35e9d6..326103199d 100644 --- a/include/m_db_int.h +++ b/include/m_db_int.h @@ -90,17 +90,17 @@ interface MIDatabase STDMETHOD_(BOOL, IsDbContact)(MCONTACT contactID) PURE;
STDMETHOD_(LONG, GetEventCount)(MCONTACT contactID) PURE;
- STDMETHOD_(HANDLE, AddEvent)(MCONTACT contactID, DBEVENTINFO *dbe) PURE;
- STDMETHOD_(BOOL, DeleteEvent)(MCONTACT contactID, HANDLE hDbEvent) PURE;
- STDMETHOD_(LONG, GetBlobSize)(HANDLE hDbEvent) PURE;
- STDMETHOD_(BOOL, GetEvent)(HANDLE hDbEvent, DBEVENTINFO *dbe) PURE;
- STDMETHOD_(BOOL, MarkEventRead)(MCONTACT contactID, HANDLE hDbEvent) PURE;
- STDMETHOD_(MCONTACT, GetEventContact)(HANDLE hDbEvent) PURE;
- STDMETHOD_(HANDLE, FindFirstEvent)(MCONTACT contactID) PURE;
- STDMETHOD_(HANDLE, FindFirstUnreadEvent)(MCONTACT contactID) PURE;
- STDMETHOD_(HANDLE, FindLastEvent)(MCONTACT contactID) PURE;
- STDMETHOD_(HANDLE, FindNextEvent)(MCONTACT contactID, HANDLE hDbEvent) PURE;
- STDMETHOD_(HANDLE, FindPrevEvent)(MCONTACT contactID, HANDLE hDbEvent) PURE;
+ STDMETHOD_(MEVENT, AddEvent)(MCONTACT contactID, DBEVENTINFO *dbe) PURE;
+ STDMETHOD_(BOOL, DeleteEvent)(MCONTACT contactID, MEVENT hDbEvent) PURE;
+ STDMETHOD_(LONG, GetBlobSize)(MEVENT hDbEvent) PURE;
+ STDMETHOD_(BOOL, GetEvent)(MEVENT hDbEvent, DBEVENTINFO *dbe) PURE;
+ STDMETHOD_(BOOL, MarkEventRead)(MCONTACT contactID, MEVENT hDbEvent) PURE;
+ STDMETHOD_(MCONTACT, GetEventContact)(MEVENT hDbEvent) PURE;
+ STDMETHOD_(MEVENT, FindFirstEvent)(MCONTACT contactID) PURE;
+ STDMETHOD_(MEVENT, FindFirstUnreadEvent)(MCONTACT contactID) PURE;
+ STDMETHOD_(MEVENT, FindLastEvent)(MCONTACT contactID) PURE;
+ STDMETHOD_(MEVENT, FindNextEvent)(MCONTACT contactID, MEVENT hDbEvent) PURE;
+ STDMETHOD_(MEVENT, FindPrevEvent)(MCONTACT contactID, MEVENT hDbEvent) PURE;
STDMETHOD_(BOOL, EnumModuleNames)(DBMODULEENUMPROC pFunc, void *pParam) PURE;
diff --git a/include/m_protoint.h b/include/m_protoint.h index c19b8b7ae0..9b062a7ce9 100644 --- a/include/m_protoint.h +++ b/include/m_protoint.h @@ -151,10 +151,10 @@ struct PROTO_INTERFACE : public MZeroedObject // Virtual functions
virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr) = 0;
- virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent) = 0;
+ virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, MEVENT hDbEvent) = 0;
- virtual int __cdecl Authorize(HANDLE hDbEvent) = 0;
- virtual int __cdecl AuthDeny(HANDLE hDbEvent, const PROTOCHAR* szReason) = 0;
+ virtual int __cdecl Authorize(MEVENT hDbEvent) = 0;
+ virtual int __cdecl AuthDeny(MEVENT hDbEvent, const PROTOCHAR* szReason) = 0;
virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*) = 0;
virtual int __cdecl AuthRequest(MCONTACT hContact, const PROTOCHAR* szMessage) = 0;
diff --git a/plugins/AutoShutdown/src/watcher.cpp b/plugins/AutoShutdown/src/watcher.cpp index 0c8a22397e..bce511ce8f 100644 --- a/plugins/AutoShutdown/src/watcher.cpp +++ b/plugins/AutoShutdown/src/watcher.cpp @@ -89,10 +89,8 @@ static TCHAR* GetMessageText(BYTE **ppBlob,DWORD *pcbBlob) return (WCHAR*)buf;
}
-static int MsgEventAdded(WPARAM wParam,LPARAM lParam)
+static int MsgEventAdded(WPARAM wParam,LPARAM hDbEvent)
{
- HANDLE hDbEvent = (HANDLE)lParam;
-
if (currentWatcherType & SDWTF_MESSAGE) {
DBEVENTINFO dbe = { sizeof(dbe) };
dbe.cbBlob = db_event_getBlobSize(hDbEvent);
diff --git a/plugins/AvatarHistory/src/AvatarDlg.cpp b/plugins/AvatarHistory/src/AvatarDlg.cpp index 64ac70749d..5746cd3053 100644 --- a/plugins/AvatarHistory/src/AvatarDlg.cpp +++ b/plugins/AvatarHistory/src/AvatarDlg.cpp @@ -60,7 +60,7 @@ public: mir_free(filelink);
}
- HANDLE hDbEvent;
+ MEVENT hDbEvent;
TCHAR *filename;
TCHAR *filelink;
};
@@ -434,7 +434,7 @@ int FillAvatarListFromDB(HWND list, MCONTACT hContact) {
int max_pos = 0;
BYTE blob[2048];
- for (HANDLE hDbEvent = db_event_first(hContact); hDbEvent; hDbEvent = db_event_next(hContact, hDbEvent)) {
+ for (MEVENT hDbEvent = db_event_first(hContact); hDbEvent; hDbEvent = db_event_next(hContact, hDbEvent)) {
DBEVENTINFO dbei = { sizeof(dbei) };
dbei.cbBlob = sizeof(blob);
dbei.pBlob = blob;
diff --git a/plugins/BasicHistory/src/EventList.cpp b/plugins/BasicHistory/src/EventList.cpp index a70772e3d9..aadf2a73a4 100644 --- a/plugins/BasicHistory/src/EventList.cpp +++ b/plugins/BasicHistory/src/EventList.cpp @@ -198,7 +198,7 @@ void EventList::GetTempList(std::list<EventTempIndex>& tempList, bool noFilter, EventIndex ei;
ti.isExternal = false;
ei.isExternal = false;
- HANDLE hDbEvent = db_event_first(_hContact);
+ MEVENT hDbEvent = db_event_first(_hContact);
while (hDbEvent != NULL) {
if (isWndLocal && !IsWindow(hWnd))
break;
diff --git a/plugins/BasicHistory/src/EventList.h b/plugins/BasicHistory/src/EventList.h index a4f5dd885d..3b037b0a5a 100644 --- a/plugins/BasicHistory/src/EventList.h +++ b/plugins/BasicHistory/src/EventList.h @@ -40,7 +40,7 @@ public: {
union
{
- HANDLE hEvent;
+ MEVENT hEvent;
int exIdx;
};
bool isExternal;
@@ -59,7 +59,7 @@ private: {
union
{
- HANDLE hEvent;
+ MEVENT hEvent;
int exIdx;
};
bool isExternal;
diff --git a/plugins/BasicHistory/src/HistoryWindow.cpp b/plugins/BasicHistory/src/HistoryWindow.cpp index 76b5bd3c9a..74fe25d110 100644 --- a/plugins/BasicHistory/src/HistoryWindow.cpp +++ b/plugins/BasicHistory/src/HistoryWindow.cpp @@ -475,9 +475,9 @@ INT_PTR HistoryWindow::DeleteAllUserHistory(WPARAM hContact, LPARAM) return FALSE;
CallService(MS_DB_SETSAFETYMODE, FALSE, 0);
- HANDLE hDbEvent = db_event_last(hContact);
+ MEVENT hDbEvent = db_event_last(hContact);
while (hDbEvent != NULL) {
- HANDLE hPrevEvent = db_event_prev(hContact, hDbEvent);
+ MEVENT hPrevEvent = db_event_prev(hContact, hDbEvent);
hDbEvent = ( db_event_delete(hContact, hDbEvent) == 0) ? hPrevEvent : NULL;
}
CallService(MS_DB_SETSAFETYMODE, TRUE, 0);
diff --git a/plugins/Boltun/src/boltun.cpp b/plugins/Boltun/src/boltun.cpp index c4444fe221..defc925837 100644 --- a/plugins/Boltun/src/boltun.cpp +++ b/plugins/Boltun/src/boltun.cpp @@ -210,7 +210,7 @@ static bool BoltunAutoChat(MCONTACT hContact) return false;
}
-static int MessageEventAdded(WPARAM hContact, LPARAM lParam)
+static int MessageEventAdded(WPARAM hContact, LPARAM hDbEvent)
{
if (!BoltunAutoChat(hContact))
return 0;
@@ -219,8 +219,6 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam) memset(&dbei, 0, sizeof(dbei));
dbei.cbSize = sizeof(dbei);
dbei.cbBlob = 0;
-
- HANDLE hDbEvent = (HANDLE)lParam;
dbei.cbBlob = db_event_getBlobSize(hDbEvent);
if (dbei.cbBlob == -1)
return 0;
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp index ded191b288..9f5a9eac05 100644 --- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp +++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp @@ -81,7 +81,7 @@ void setLastSeen(MCONTACT hContact) time_t getLastInputMsg(MCONTACT hContact)
{
- HANDLE hDbEvent = db_event_last(hContact);
+ MEVENT hDbEvent = db_event_last(hContact);
while (hDbEvent) {
DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get(hDbEvent, &dbei);
diff --git a/plugins/Clist_modern/src/hdr/modern_commonprototypes.h b/plugins/Clist_modern/src/hdr/modern_commonprototypes.h index cfb30d7069..f92b95bb30 100644 --- a/plugins/Clist_modern/src/hdr/modern_commonprototypes.h +++ b/plugins/Clist_modern/src/hdr/modern_commonprototypes.h @@ -266,7 +266,7 @@ int cliFindRowByText(HWND hwnd, ClcData *dat, const TCHAR *text, int prefixO int cliGetRowsPriorTo(ClcGroup *group, ClcGroup *subgroup, int contactIndex);
int cli_IconFromStatusMode(const char *szProto, int nStatus, MCONTACT hContact);
int cli_GetContactIcon(MCONTACT hContact);
-int cli_RemoveEvent(MCONTACT hContact, HANDLE hDbEvent);
+int cli_RemoveEvent(MCONTACT hContact, MEVENT hDbEvent);
void cli_AddContactToTree(HWND hwnd, ClcData *dat, MCONTACT hContact, int updateTotalCount, int checkHideOffline);
void cli_DeleteItemFromTree(HWND hwnd, MCONTACT hItem);
void cli_FreeContact(ClcContact*);
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index 43ab091a44..5d03e2e199 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -247,7 +247,7 @@ static int clcHookDbEventAdded(WPARAM hContact, LPARAM lParam) g_CluiData.t_now = time(NULL); if (hContact && lParam) { DBEVENTINFO dbei = { sizeof(dbei) }; - db_event_get((HANDLE)lParam, &dbei); + db_event_get(lParam, &dbei); if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT)) { db_set_dw(hContact, "CList", "mf_lastmsg", dbei.timestamp); ClcCacheEntry *pdnce = pcli->pfnGetCacheEntry(hContact); diff --git a/plugins/Clist_modern/src/modern_clistevents.cpp b/plugins/Clist_modern/src/modern_clistevents.cpp index a3976c01fd..85a278a7ad 100644 --- a/plugins/Clist_modern/src/modern_clistevents.cpp +++ b/plugins/Clist_modern/src/modern_clistevents.cpp @@ -78,7 +78,7 @@ struct NotifyMenuItemExData { MCONTACT hContact;
int iIcon; // icon index in the image list
HICON hIcon; // corresponding icon handle
- HANDLE hDbEvent;
+ MEVENT hDbEvent;
};
static CLISTEVENT* MyGetEvent(int iSelection)
@@ -106,7 +106,7 @@ struct CListEvent* cli_AddEvent(CLISTEVENT *cle) if (p == NULL)
return NULL;
- if (p->cle.hContact != 0 && p->cle.hDbEvent != (HANDLE)1 && !(p->cle.flags & CLEF_ONLYAFEW)) {
+ if (p->cle.hContact != 0 && p->cle.hDbEvent != 1 && !(p->cle.flags & CLEF_ONLYAFEW)) {
MENUITEMINFO mii = { sizeof(mii) };
mii.fMask = MIIM_DATA | MIIM_BITMAP | MIIM_ID;
if (p->cle.pszService &&
@@ -170,7 +170,7 @@ struct CListEvent* cli_AddEvent(CLISTEVENT *cle) }
-int cli_RemoveEvent(MCONTACT hContact, HANDLE hDbEvent)
+int cli_RemoveEvent(MCONTACT hContact, MEVENT hDbEvent)
{
// Find the event that should be removed
int i;
diff --git a/plugins/Clist_modern/src/modern_contact.cpp b/plugins/Clist_modern/src/modern_contact.cpp index e7f9bf90eb..383500629d 100644 --- a/plugins/Clist_modern/src/modern_contact.cpp +++ b/plugins/Clist_modern/src/modern_contact.cpp @@ -65,7 +65,7 @@ static int GetStatusModeOrdering(int statusMode) DWORD CompareContacts2_getLMTime(MCONTACT hContact)
{
- HANDLE hDbEvent = db_event_last(hContact);
+ MEVENT hDbEvent = db_event_last(hContact);
while (hDbEvent) {
DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get(hDbEvent, &dbei);
diff --git a/plugins/Clist_nicer/src/Include/clc.h b/plugins/Clist_nicer/src/Include/clc.h index b9911140ff..5e93ec0b54 100644 --- a/plugins/Clist_nicer/src/Include/clc.h +++ b/plugins/Clist_nicer/src/Include/clc.h @@ -333,7 +333,7 @@ struct NotifyMenuItemExData MCONTACT hContact;
int iIcon; // icon index in the image list
HICON hIcon; // corresponding icon handle
- HANDLE hDbEvent;
+ MEVENT hDbEvent;
};
// #define NOTIFY_HEIGHT 24
diff --git a/plugins/Clist_nicer/src/clc.cpp b/plugins/Clist_nicer/src/clc.cpp index 61c12e4dd5..db8eda857b 100644 --- a/plugins/Clist_nicer/src/clc.cpp +++ b/plugins/Clist_nicer/src/clc.cpp @@ -76,7 +76,7 @@ static int ClcEventAdded(WPARAM hContact, LPARAM lParam) if (hContact && lParam) {
DBEVENTINFO dbei = { sizeof(dbei) };
- db_event_get((HANDLE)lParam, &dbei);
+ db_event_get(lParam, &dbei);
if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT)) {
DWORD firstTime = cfg::getDword(hContact, "CList", "mf_firstEvent", 0);
DWORD count = cfg::getDword(hContact, "CList", "mf_count", 0);
diff --git a/plugins/Clist_nicer/src/clistevents.cpp b/plugins/Clist_nicer/src/clistevents.cpp index b4c710ce06..16c1735c73 100644 --- a/plugins/Clist_nicer/src/clistevents.cpp +++ b/plugins/Clist_nicer/src/clistevents.cpp @@ -257,7 +257,7 @@ CListEvent* AddEvent(CLISTEVENT *cle) if (p == NULL)
return NULL;
- if (p->cle.hContact != 0 && p->cle.hDbEvent != (HANDLE)1 && !(p->cle.flags & CLEF_ONLYAFEW)) {
+ if (p->cle.hContact != 0 && p->cle.hDbEvent != 1 && !(p->cle.flags & CLEF_ONLYAFEW)) {
MENUITEMINFO mii = { sizeof(mii) };
mii.fMask = MIIM_DATA | MIIM_BITMAP | MIIM_ID;
if (p->cle.pszService && !strncmp("SRMsg/ReadMessage", p->cle.pszService, 17)) {
@@ -329,7 +329,7 @@ CListEvent* AddEvent(CLISTEVENT *cle) // wParam=(MCONTACT)hContact
// lParam=(LPARAM)(HANDLE)hDbEvent
// Returns 0 if the event was successfully removed, or nonzero if the event was not found
-int RemoveEvent(MCONTACT hContact, HANDLE hDbEvent)
+int RemoveEvent(MCONTACT hContact, MEVENT hDbEvent)
{
// Find the event that should be removed
int i;
diff --git a/plugins/Clist_nicer/src/contact.cpp b/plugins/Clist_nicer/src/contact.cpp index bf9d9ade7b..bf060534fd 100644 --- a/plugins/Clist_nicer/src/contact.cpp +++ b/plugins/Clist_nicer/src/contact.cpp @@ -66,7 +66,7 @@ static void MF_CalcFrequency(MCONTACT hContact, DWORD dwCutoffDays, int doSleep) {
DWORD curTime = time(NULL);
DWORD frequency, eventCount;
- HANDLE hEvent = db_event_last(hContact);
+ MEVENT hEvent = db_event_last(hContact);
eventCount = 0;
@@ -151,7 +151,7 @@ void LoadContactTree(void) DWORD INTSORT_GetLastMsgTime(MCONTACT hContact)
{
- for (HANDLE hDbEvent = db_event_last(hContact); hDbEvent; hDbEvent = db_event_prev(hContact, hDbEvent)) {
+ for (MEVENT hDbEvent = db_event_last(hContact); hDbEvent; hDbEvent = db_event_prev(hContact, hDbEvent)) {
DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get(hDbEvent, &dbei);
if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT))
diff --git a/plugins/Clist_nicer/src/init.cpp b/plugins/Clist_nicer/src/init.cpp index ec724c0246..a9eef79489 100644 --- a/plugins/Clist_nicer/src/init.cpp +++ b/plugins/Clist_nicer/src/init.cpp @@ -60,7 +60,7 @@ ClcGroup *AddGroup(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD fl int AddContactToGroup(struct ClcData *dat, ClcGroup *group, MCONTACT hContact);
int AddInfoItemToGroup(ClcGroup *group, int flags, const TCHAR *pszText);
LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM wParam, LPARAM lParam);
-int RemoveEvent(MCONTACT hContact, HANDLE hDbEvent);
+int RemoveEvent(MCONTACT hContact, MEVENT hDbEvent);
INT_PTR TrayIconProcessMessage(WPARAM wParam, LPARAM lParam);
void RecalcScrollBar(HWND hwnd, struct ClcData *dat);
diff --git a/plugins/CmdLine/src/mimcmd_handlers.cpp b/plugins/CmdLine/src/mimcmd_handlers.cpp index 4c075cd84a..7f0c75260f 100644 --- a/plugins/CmdLine/src/mimcmd_handlers.cpp +++ b/plugins/CmdLine/src/mimcmd_handlers.cpp @@ -1518,7 +1518,7 @@ void HandleContactsCommand(PCommand command, TArgument *argv, int argc, PReply r *reply->message = 0;
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- HANDLE hUnreadEvent = db_event_firstUnread(hContact);
+ MEVENT hUnreadEvent = db_event_firstUnread(hContact);
if (hUnreadEvent != NULL) {
DWORD threadID;
HANDLE thread = CreateThread(NULL, NULL, OpenMessageWindowThread, (void*)hContact, NULL, &threadID);
@@ -1587,7 +1587,7 @@ void HandleHistoryCommand(PCommand command, TArgument *argv, int argc, PReply re mir_snprintf(reply->message, reply->cMessage, Translate("No unread messages found."));
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- HANDLE hEvent = db_event_firstUnread(hContact);
+ MEVENT hEvent = db_event_firstUnread(hContact);
if (hEvent != NULL) {
count = 0;
while (hEvent != NULL) {
@@ -1631,7 +1631,7 @@ void HandleHistoryCommand(PCommand command, TArgument *argv, int argc, PReply re {
if (_stricmp(cmd, "unread") == 0)
{
- HANDLE hEvent = db_event_firstUnread(hContact);
+ MEVENT hEvent = db_event_firstUnread(hContact);
reply->code = MIMRES_SUCCESS;
@@ -1683,7 +1683,7 @@ void HandleHistoryCommand(PCommand command, TArgument *argv, int argc, PReply re if (count > 0)
{
int index = 0;
- HANDLE hEvent = db_event_first(hContact);
+ MEVENT hEvent = db_event_first(hContact);
DBEVENTINFO dbEvent = { sizeof(DBEVENTINFO) };
char message[4096];
dbEvent.pBlob = (PBYTE) message;
@@ -1691,7 +1691,7 @@ void HandleHistoryCommand(PCommand command, TArgument *argv, int argc, PReply re while (hEvent)
{
dbEvent.cbBlob = sizeof(message);
- if (!db_event_get( hEvent, &dbEvent)) // if successful call
+ if (!db_event_get(hEvent, &dbEvent)) // if successful call
{
dbEvent.pBlob[dbEvent.cbBlob] = 0;
if ((index >= start) && (index <= stop))
diff --git a/plugins/ContactsPlus/src/main.cpp b/plugins/ContactsPlus/src/main.cpp index d8cd064f55..a34c8ed315 100644 --- a/plugins/ContactsPlus/src/main.cpp +++ b/plugins/ContactsPlus/src/main.cpp @@ -57,9 +57,8 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) return TRUE;
}
-static int HookDBEventAdded(WPARAM hContact, LPARAM lParam)
+static int HookDBEventAdded(WPARAM hContact, LPARAM hDbEvent)
{
- HANDLE hDbEvent = (HANDLE)lParam;
//process the event
DBEVENTINFO dbe = { sizeof(dbe) };
db_event_get(hDbEvent, &dbe);
@@ -92,7 +91,7 @@ static int HookDBEventAdded(WPARAM hContact, LPARAM lParam) static void ProcessUnreadEvents(void)
{
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)) {
DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get(hDbEvent, &dbei);
if (!(dbei.flags & (DBEF_SENT | DBEF_READ)) && dbei.eventType == EVENTTYPE_CONTACTS) {
diff --git a/plugins/ContactsPlus/src/receive.h b/plugins/ContactsPlus/src/receive.h index 3f67906930..73ee03cb1e 100644 --- a/plugins/ContactsPlus/src/receive.h +++ b/plugins/ContactsPlus/src/receive.h @@ -46,7 +46,7 @@ struct TRecvContactsData TRecvContactsData(MCONTACT contact);
~TRecvContactsData();
- HANDLE mhDbEvent; // handle to recv DB event
+ MEVENT mhDbEvent; // handle to recv DB event
MCONTACT mhContact; // from whom we received this
HIMAGELIST mhListIcon;// icons for listview
HMENU mhPopup; // popup menu for listview
diff --git a/plugins/Db3x_mmap/src/dbevents.cpp b/plugins/Db3x_mmap/src/dbevents.cpp index 4806e0140c..a869a6a949 100644 --- a/plugins/Db3x_mmap/src/dbevents.cpp +++ b/plugins/Db3x_mmap/src/dbevents.cpp @@ -32,7 +32,7 @@ STDMETHODIMP_(LONG) CDb3Mmap::GetEventCount(MCONTACT contactID) return (dbc->signature != DBCONTACT_SIGNATURE) ? -1 : dbc->eventCount;
}
-STDMETHODIMP_(HANDLE) CDb3Mmap::AddEvent(MCONTACT contactID, DBEVENTINFO *dbei)
+STDMETHODIMP_(MEVENT) CDb3Mmap::AddEvent(MCONTACT contactID, DBEVENTINFO *dbei)
{
if (dbei == NULL || dbei->cbSize != sizeof(DBEVENTINFO)) return 0;
if (dbei->timestamp == 0) return 0;
@@ -160,10 +160,10 @@ STDMETHODIMP_(HANDLE) CDb3Mmap::AddEvent(MCONTACT contactID, DBEVENTINFO *dbei) if (neednotify)
NotifyEventHooks(hEventAddedEvent, contactNotifyID, (LPARAM)ofsNew);
- return (HANDLE)ofsNew;
+ return (MEVENT)ofsNew;
}
-STDMETHODIMP_(BOOL) CDb3Mmap::DeleteEvent(MCONTACT contactID, HANDLE hDbEvent)
+STDMETHODIMP_(BOOL) CDb3Mmap::DeleteEvent(MCONTACT contactID, MEVENT hDbEvent)
{
DBCachedContact *cc;
if (contactID) {
@@ -258,14 +258,14 @@ STDMETHODIMP_(BOOL) CDb3Mmap::DeleteEvent(MCONTACT contactID, HANDLE hDbEvent) return 0;
}
-STDMETHODIMP_(LONG) CDb3Mmap::GetBlobSize(HANDLE hDbEvent)
+STDMETHODIMP_(LONG) CDb3Mmap::GetBlobSize(MEVENT hDbEvent)
{
mir_cslock lck(m_csDbAccess);
DBEvent *dbe = AdaptEvent((DWORD)hDbEvent, 0);
return (dbe->signature != DBEVENT_SIGNATURE) ? -1 : dbe->cbBlob;
}
-STDMETHODIMP_(BOOL) CDb3Mmap::GetEvent(HANDLE hDbEvent, DBEVENTINFO *dbei)
+STDMETHODIMP_(BOOL) CDb3Mmap::GetEvent(MEVENT hDbEvent, DBEVENTINFO *dbei)
{
if (dbei == NULL || dbei->cbSize != sizeof(DBEVENTINFO)) return 1;
if (dbei->cbBlob > 0 && dbei->pBlob == NULL) {
@@ -307,7 +307,7 @@ STDMETHODIMP_(BOOL) CDb3Mmap::GetEvent(HANDLE hDbEvent, DBEVENTINFO *dbei) return 0;
}
-STDMETHODIMP_(BOOL) CDb3Mmap::MarkEventRead(MCONTACT contactID, HANDLE hDbEvent)
+STDMETHODIMP_(BOOL) CDb3Mmap::MarkEventRead(MCONTACT contactID, MEVENT hDbEvent)
{
DBCachedContact *cc;
if (contactID) {
@@ -357,14 +357,14 @@ STDMETHODIMP_(BOOL) CDb3Mmap::MarkEventRead(MCONTACT contactID, HANDLE hDbEvent) return ret;
}
-STDMETHODIMP_(MCONTACT) CDb3Mmap::GetEventContact(HANDLE hDbEvent)
+STDMETHODIMP_(MCONTACT) CDb3Mmap::GetEventContact(MEVENT hDbEvent)
{
mir_cslock lck(m_csDbAccess);
DBEvent *dbe = AdaptEvent((DWORD)hDbEvent, INVALID_CONTACT_ID);
return (dbe->signature != DBEVENT_SIGNATURE) ? INVALID_CONTACT_ID : dbe->contactID;
}
-STDMETHODIMP_(HANDLE) CDb3Mmap::FindFirstEvent(MCONTACT contactID)
+STDMETHODIMP_(MEVENT) CDb3Mmap::FindFirstEvent(MCONTACT contactID)
{
DBCachedContact *cc;
DWORD ofsContact = GetContactOffset(contactID, &cc);
@@ -374,7 +374,7 @@ STDMETHODIMP_(HANDLE) CDb3Mmap::FindFirstEvent(MCONTACT contactID) if (dbc->signature != DBCONTACT_SIGNATURE)
return NULL;
if (!cc || !cc->IsSub())
- return HANDLE(dbc->ofsFirstEvent);
+ return MEVENT(dbc->ofsFirstEvent);
if ((cc = m_cache->GetCachedContact(cc->parentID)) == NULL)
return NULL;
@@ -387,13 +387,13 @@ STDMETHODIMP_(HANDLE) CDb3Mmap::FindFirstEvent(MCONTACT contactID) if (dbe->signature != DBEVENT_SIGNATURE)
return NULL;
if (dbe->contactID == contactID)
- return HANDLE(dwOffset);
+ return MEVENT(dwOffset);
dwOffset = dbe->ofsNext;
}
return NULL;
}
-STDMETHODIMP_(HANDLE) CDb3Mmap::FindFirstUnreadEvent(MCONTACT contactID)
+STDMETHODIMP_(MEVENT) CDb3Mmap::FindFirstUnreadEvent(MCONTACT contactID)
{
DBCachedContact *cc;
DWORD ofsContact = GetContactOffset(contactID, &cc);
@@ -403,7 +403,7 @@ STDMETHODIMP_(HANDLE) CDb3Mmap::FindFirstUnreadEvent(MCONTACT contactID) if (dbc->signature != DBCONTACT_SIGNATURE)
return NULL;
if (!cc || !cc->IsSub())
- return HANDLE(dbc->ofsFirstUnread);
+ return MEVENT(dbc->ofsFirstUnread);
if ((cc = m_cache->GetCachedContact(cc->parentID)) == NULL)
return NULL;
@@ -416,13 +416,13 @@ STDMETHODIMP_(HANDLE) CDb3Mmap::FindFirstUnreadEvent(MCONTACT contactID) if (dbe->signature != DBEVENT_SIGNATURE)
return NULL;
if (dbe->contactID == contactID && !dbe->markedRead())
- return HANDLE(dwOffset);
+ return MEVENT(dwOffset);
dwOffset = dbe->ofsNext;
}
return NULL;
}
-STDMETHODIMP_(HANDLE) CDb3Mmap::FindLastEvent(MCONTACT contactID)
+STDMETHODIMP_(MEVENT) CDb3Mmap::FindLastEvent(MCONTACT contactID)
{
DBCachedContact *cc;
DWORD ofsContact = GetContactOffset(contactID, &cc);
@@ -432,7 +432,7 @@ STDMETHODIMP_(HANDLE) CDb3Mmap::FindLastEvent(MCONTACT contactID) if (dbc->signature != DBCONTACT_SIGNATURE)
return NULL;
if (!cc || !cc->IsSub())
- return HANDLE(dbc->ofsLastEvent);
+ return MEVENT(dbc->ofsLastEvent);
if ((cc = m_cache->GetCachedContact(cc->parentID)) == NULL)
return NULL;
@@ -445,13 +445,13 @@ STDMETHODIMP_(HANDLE) CDb3Mmap::FindLastEvent(MCONTACT contactID) if (dbe->signature != DBEVENT_SIGNATURE)
return NULL;
if (dbe->contactID == contactID)
- return HANDLE(dwOffset);
+ return MEVENT(dwOffset);
dwOffset = dbe->ofsPrev;
}
return NULL;
}
-STDMETHODIMP_(HANDLE) CDb3Mmap::FindNextEvent(MCONTACT contactID, HANDLE hDbEvent)
+STDMETHODIMP_(MEVENT) CDb3Mmap::FindNextEvent(MCONTACT contactID, MEVENT hDbEvent)
{
DBCachedContact *cc = (contactID) ? m_cache->GetCachedContact(contactID) : NULL;
@@ -460,20 +460,20 @@ STDMETHODIMP_(HANDLE) CDb3Mmap::FindNextEvent(MCONTACT contactID, HANDLE hDbEven if (dbe->signature != DBEVENT_SIGNATURE)
return NULL;
if (!cc || !cc->IsSub())
- return HANDLE(dbe->ofsNext);
+ return MEVENT(dbe->ofsNext);
for (DWORD dwOffset = dbe->ofsNext; dwOffset != 0;) {
dbe = AdaptEvent(dwOffset, contactID);
if (dbe->signature != DBEVENT_SIGNATURE)
return NULL;
if (dbe->contactID == contactID)
- return HANDLE(dwOffset);
+ return MEVENT(dwOffset);
dwOffset = dbe->ofsNext;
}
return NULL;
}
-STDMETHODIMP_(HANDLE) CDb3Mmap::FindPrevEvent(MCONTACT contactID, HANDLE hDbEvent)
+STDMETHODIMP_(MEVENT) CDb3Mmap::FindPrevEvent(MCONTACT contactID, MEVENT hDbEvent)
{
DBCachedContact *cc = (contactID) ? m_cache->GetCachedContact(contactID) : NULL;
@@ -482,14 +482,14 @@ STDMETHODIMP_(HANDLE) CDb3Mmap::FindPrevEvent(MCONTACT contactID, HANDLE hDbEven if (dbe->signature != DBEVENT_SIGNATURE)
return NULL;
if (!cc || !cc->IsSub())
- return HANDLE(dbe->ofsPrev);
+ return MEVENT(dbe->ofsPrev);
for (DWORD dwOffset = dbe->ofsPrev; dwOffset != 0;) {
dbe = AdaptEvent(dwOffset, contactID);
if (dbe->signature != DBEVENT_SIGNATURE)
return NULL;
if (dbe->contactID == contactID)
- return HANDLE(dwOffset);
+ return MEVENT(dwOffset);
dwOffset = dbe->ofsPrev;
}
return NULL;
diff --git a/plugins/Db3x_mmap/src/dbintf.h b/plugins/Db3x_mmap/src/dbintf.h index c6e34b68d6..df3d1cd949 100644 --- a/plugins/Db3x_mmap/src/dbintf.h +++ b/plugins/Db3x_mmap/src/dbintf.h @@ -211,17 +211,17 @@ public: STDMETHODIMP_(BOOL) IsDbContact(MCONTACT contactID);
STDMETHODIMP_(LONG) GetEventCount(MCONTACT contactID);
- STDMETHODIMP_(HANDLE) AddEvent(MCONTACT contactID, DBEVENTINFO *dbe);
- STDMETHODIMP_(BOOL) DeleteEvent(MCONTACT contactID, HANDLE hDbEvent);
- STDMETHODIMP_(LONG) GetBlobSize(HANDLE hDbEvent);
- STDMETHODIMP_(BOOL) GetEvent(HANDLE hDbEvent, DBEVENTINFO *dbe);
- STDMETHODIMP_(BOOL) MarkEventRead(MCONTACT contactID, HANDLE hDbEvent);
- STDMETHODIMP_(MCONTACT) GetEventContact(HANDLE hDbEvent);
- STDMETHODIMP_(HANDLE) FindFirstEvent(MCONTACT contactID);
- STDMETHODIMP_(HANDLE) FindFirstUnreadEvent(MCONTACT contactID);
- STDMETHODIMP_(HANDLE) FindLastEvent(MCONTACT contactID);
- STDMETHODIMP_(HANDLE) FindNextEvent(MCONTACT contactID, HANDLE hDbEvent);
- STDMETHODIMP_(HANDLE) FindPrevEvent(MCONTACT contactID, HANDLE hDbEvent);
+ STDMETHODIMP_(MEVENT) AddEvent(MCONTACT contactID, DBEVENTINFO *dbe);
+ STDMETHODIMP_(BOOL) DeleteEvent(MCONTACT contactID, MEVENT hDbEvent);
+ STDMETHODIMP_(LONG) GetBlobSize(MEVENT hDbEvent);
+ STDMETHODIMP_(BOOL) GetEvent(MEVENT hDbEvent, DBEVENTINFO *dbe);
+ STDMETHODIMP_(BOOL) MarkEventRead(MCONTACT contactID, MEVENT hDbEvent);
+ STDMETHODIMP_(MCONTACT) GetEventContact(MEVENT hDbEvent);
+ STDMETHODIMP_(MEVENT) FindFirstEvent(MCONTACT contactID);
+ STDMETHODIMP_(MEVENT) FindFirstUnreadEvent(MCONTACT contactID);
+ STDMETHODIMP_(MEVENT) FindLastEvent(MCONTACT contactID);
+ STDMETHODIMP_(MEVENT) FindNextEvent(MCONTACT contactID, MEVENT hDbEvent);
+ STDMETHODIMP_(MEVENT) FindPrevEvent(MCONTACT contactID, MEVENT hDbEvent);
STDMETHODIMP_(BOOL) EnumModuleNames(DBMODULEENUMPROC pFunc, void *pParam);
diff --git a/plugins/Dbx_mdb/Dbx_mdb_12.vcxproj b/plugins/Dbx_mdb/Dbx_mdb_12.vcxproj index 524802fcdc..6a75d66c96 100644 --- a/plugins/Dbx_mdb/Dbx_mdb_12.vcxproj +++ b/plugins/Dbx_mdb/Dbx_mdb_12.vcxproj @@ -223,6 +223,8 @@ <ClCompile Include="src\ui.cpp" />
</ItemGroup>
<ItemGroup>
+ <ClInclude Include="..\..\include\m_database.h" />
+ <ClInclude Include="..\..\include\m_db_int.h" />
<ClInclude Include="src\commonheaders.h" />
<ClInclude Include="src\dbintf.h" />
<ClInclude Include="src\lmdb\lmdb.h" />
diff --git a/plugins/Dbx_mdb/Dbx_mdb_12.vcxproj.filters b/plugins/Dbx_mdb/Dbx_mdb_12.vcxproj.filters index 4b988cea86..0ec4253319 100644 --- a/plugins/Dbx_mdb/Dbx_mdb_12.vcxproj.filters +++ b/plugins/Dbx_mdb/Dbx_mdb_12.vcxproj.filters @@ -71,6 +71,12 @@ <ClInclude Include="src\lmdb\midl.h">
<Filter>Source Files\lmdb</Filter>
</ClInclude>
+ <ClInclude Include="..\..\include\m_database.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\m_db_int.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="res\dbx_mdb.rc">
diff --git a/plugins/Dbx_mdb/src/dbevents.cpp b/plugins/Dbx_mdb/src/dbevents.cpp index 6b7085575c..949c6eab64 100644 --- a/plugins/Dbx_mdb/src/dbevents.cpp +++ b/plugins/Dbx_mdb/src/dbevents.cpp @@ -31,7 +31,7 @@ STDMETHODIMP_(LONG) CDbxMdb::GetEventCount(MCONTACT contactID) return -1;
}
-STDMETHODIMP_(HANDLE) CDbxMdb::AddEvent(MCONTACT contactID, DBEVENTINFO *dbei)
+STDMETHODIMP_(MEVENT) CDbxMdb::AddEvent(MCONTACT contactID, DBEVENTINFO *dbei)
{
if (dbei == NULL || dbei->cbSize != sizeof(DBEVENTINFO)) return 0;
if (dbei->timestamp == 0) return 0;
@@ -84,10 +84,10 @@ STDMETHODIMP_(HANDLE) CDbxMdb::AddEvent(MCONTACT contactID, DBEVENTINFO *dbei) // Notify only in safe mode or on really new events
NotifyEventHooks(hEventAddedEvent, contactNotifyID, (LPARAM)-1);
- return (HANDLE)0;
+ return (MEVENT)0;
}
-STDMETHODIMP_(BOOL) CDbxMdb::DeleteEvent(MCONTACT contactID, HANDLE hDbEvent)
+STDMETHODIMP_(BOOL) CDbxMdb::DeleteEvent(MCONTACT contactID, MEVENT hDbEvent)
{
DBCachedContact *cc;
if (contactID) {
@@ -110,13 +110,13 @@ STDMETHODIMP_(BOOL) CDbxMdb::DeleteEvent(MCONTACT contactID, HANDLE hDbEvent) return 0;
}
-STDMETHODIMP_(LONG) CDbxMdb::GetBlobSize(HANDLE hDbEvent)
+STDMETHODIMP_(LONG) CDbxMdb::GetBlobSize(MEVENT hDbEvent)
{
mir_cslock lck(m_csDbAccess);
return -1;
}
-STDMETHODIMP_(BOOL) CDbxMdb::GetEvent(HANDLE hDbEvent, DBEVENTINFO *dbei)
+STDMETHODIMP_(BOOL) CDbxMdb::GetEvent(MEVENT hDbEvent, DBEVENTINFO *dbei)
{
if (dbei == NULL || dbei->cbSize != sizeof(DBEVENTINFO)) return 1;
if (dbei->cbBlob > 0 && dbei->pBlob == NULL) {
@@ -128,7 +128,7 @@ STDMETHODIMP_(BOOL) CDbxMdb::GetEvent(HANDLE hDbEvent, DBEVENTINFO *dbei) return 0;
}
-STDMETHODIMP_(BOOL) CDbxMdb::MarkEventRead(MCONTACT contactID, HANDLE hDbEvent)
+STDMETHODIMP_(BOOL) CDbxMdb::MarkEventRead(MCONTACT contactID, MEVENT hDbEvent)
{
DBCachedContact *cc;
if (contactID) {
@@ -147,31 +147,31 @@ STDMETHODIMP_(BOOL) CDbxMdb::MarkEventRead(MCONTACT contactID, HANDLE hDbEvent) return -11;
}
-STDMETHODIMP_(MCONTACT) CDbxMdb::GetEventContact(HANDLE hDbEvent)
+STDMETHODIMP_(MCONTACT) CDbxMdb::GetEventContact(MEVENT hDbEvent)
{
mir_cslock lck(m_csDbAccess);
return INVALID_CONTACT_ID;
}
-STDMETHODIMP_(HANDLE) CDbxMdb::FindFirstEvent(MCONTACT contactID)
+STDMETHODIMP_(MEVENT) CDbxMdb::FindFirstEvent(MCONTACT contactID)
{
mir_cslock lck(m_csDbAccess);
return NULL;
}
-STDMETHODIMP_(HANDLE) CDbxMdb::FindFirstUnreadEvent(MCONTACT contactID)
+STDMETHODIMP_(MEVENT) CDbxMdb::FindFirstUnreadEvent(MCONTACT contactID)
{
mir_cslock lck(m_csDbAccess);
return NULL;
}
-STDMETHODIMP_(HANDLE) CDbxMdb::FindLastEvent(MCONTACT contactID)
+STDMETHODIMP_(MEVENT) CDbxMdb::FindLastEvent(MCONTACT contactID)
{
mir_cslock lck(m_csDbAccess);
return NULL;
}
-STDMETHODIMP_(HANDLE) CDbxMdb::FindNextEvent(MCONTACT contactID, HANDLE hDbEvent)
+STDMETHODIMP_(MEVENT) CDbxMdb::FindNextEvent(MCONTACT contactID, MEVENT hDbEvent)
{
DBCachedContact *cc = (contactID) ? m_cache->GetCachedContact(contactID) : NULL;
@@ -179,7 +179,7 @@ STDMETHODIMP_(HANDLE) CDbxMdb::FindNextEvent(MCONTACT contactID, HANDLE hDbEvent return NULL;
}
-STDMETHODIMP_(HANDLE) CDbxMdb::FindPrevEvent(MCONTACT contactID, HANDLE hDbEvent)
+STDMETHODIMP_(MEVENT) CDbxMdb::FindPrevEvent(MCONTACT contactID, MEVENT hDbEvent)
{
DBCachedContact *cc = (contactID) ? m_cache->GetCachedContact(contactID) : NULL;
diff --git a/plugins/Dbx_mdb/src/dbintf.cpp b/plugins/Dbx_mdb/src/dbintf.cpp index 48f7deb1db..f519d3dd4b 100644 --- a/plugins/Dbx_mdb/src/dbintf.cpp +++ b/plugins/Dbx_mdb/src/dbintf.cpp @@ -93,6 +93,7 @@ int CDbxMdb::Load(bool bSkipInit) mdb_open(trnlck, "contacts", MDB_CREATE | MDB_INTEGERKEY, &m_dbContacts);
mdb_open(trnlck, "modules", MDB_CREATE | MDB_INTEGERKEY, &m_dbModules);
mdb_open(trnlck, "events", MDB_CREATE | MDB_INTEGERKEY, &m_dbEvents);
+ mdb_open(trnlck, "eventsrt", MDB_CREATE, &m_dbEvents);
mdb_open(trnlck, "settings", MDB_CREATE, &m_dbSettings);
trnlck.commit();
diff --git a/plugins/Dbx_mdb/src/dbintf.h b/plugins/Dbx_mdb/src/dbintf.h index e83f559634..26f7c29629 100644 --- a/plugins/Dbx_mdb/src/dbintf.h +++ b/plugins/Dbx_mdb/src/dbintf.h @@ -156,17 +156,17 @@ public: STDMETHODIMP_(BOOL) IsDbContact(MCONTACT contactID);
STDMETHODIMP_(LONG) GetEventCount(MCONTACT contactID);
- STDMETHODIMP_(HANDLE) AddEvent(MCONTACT contactID, DBEVENTINFO *dbe);
- STDMETHODIMP_(BOOL) DeleteEvent(MCONTACT contactID, HANDLE hDbEvent);
- STDMETHODIMP_(LONG) GetBlobSize(HANDLE hDbEvent);
- STDMETHODIMP_(BOOL) GetEvent(HANDLE hDbEvent, DBEVENTINFO *dbe);
- STDMETHODIMP_(BOOL) MarkEventRead(MCONTACT contactID, HANDLE hDbEvent);
- STDMETHODIMP_(MCONTACT) GetEventContact(HANDLE hDbEvent);
- STDMETHODIMP_(HANDLE) FindFirstEvent(MCONTACT contactID);
- STDMETHODIMP_(HANDLE) FindFirstUnreadEvent(MCONTACT contactID);
- STDMETHODIMP_(HANDLE) FindLastEvent(MCONTACT contactID);
- STDMETHODIMP_(HANDLE) FindNextEvent(MCONTACT contactID, HANDLE hDbEvent);
- STDMETHODIMP_(HANDLE) FindPrevEvent(MCONTACT contactID, HANDLE hDbEvent);
+ STDMETHODIMP_(MEVENT) AddEvent(MCONTACT contactID, DBEVENTINFO *dbe);
+ STDMETHODIMP_(BOOL) DeleteEvent(MCONTACT contactID, MEVENT hDbEvent);
+ STDMETHODIMP_(LONG) GetBlobSize(MEVENT hDbEvent);
+ STDMETHODIMP_(BOOL) GetEvent(MEVENT hDbEvent, DBEVENTINFO *dbe);
+ STDMETHODIMP_(BOOL) MarkEventRead(MCONTACT contactID, MEVENT hDbEvent);
+ STDMETHODIMP_(MCONTACT) GetEventContact(MEVENT hDbEvent);
+ STDMETHODIMP_(MEVENT) FindFirstEvent(MCONTACT contactID);
+ STDMETHODIMP_(MEVENT) FindFirstUnreadEvent(MCONTACT contactID);
+ STDMETHODIMP_(MEVENT) FindLastEvent(MCONTACT contactID);
+ STDMETHODIMP_(MEVENT) FindNextEvent(MCONTACT contactID, MEVENT hDbEvent);
+ STDMETHODIMP_(MEVENT) FindPrevEvent(MCONTACT contactID, MEVENT hDbEvent);
STDMETHODIMP_(BOOL) EnumModuleNames(DBMODULEENUMPROC pFunc, void *pParam);
diff --git a/plugins/ExternalAPI/m_ieview.h b/plugins/ExternalAPI/m_ieview.h index 08277c92e0..85c2b7276c 100644 --- a/plugins/ExternalAPI/m_ieview.h +++ b/plugins/ExternalAPI/m_ieview.h @@ -167,7 +167,7 @@ typedef struct { HWND hwnd; // HWND returned by IEW_CREATE
MCONTACT hContact; // contact
union {
- HANDLE hDbEventFirst; // first event to log, when IEE_LOG_EVENTS returns it will contain
+ MEVENT hDbEventFirst; // first event to log, when IEE_LOG_EVENTS returns it will contain
// the last event actually logged or NULL if no event was logged (IEE_LOG_EVENTS)
IEVIEWEVENTDATA *eventData; // the pointer to an array of IEVIEWEVENTDATA objects (IEE_LOG_IEV_EVENTS)
};
diff --git a/plugins/FavContacts/src/contact_cache.cpp b/plugins/FavContacts/src/contact_cache.cpp index 48cfe368a0..a72a24e8c8 100644 --- a/plugins/FavContacts/src/contact_cache.cpp +++ b/plugins/FavContacts/src/contact_cache.cpp @@ -27,10 +27,8 @@ CContactCache::~CContactCache() DeleteCriticalSection(&m_cs);
}
-int __cdecl CContactCache::OnDbEventAdded(WPARAM hContact, LPARAM lParam)
+int __cdecl CContactCache::OnDbEventAdded(WPARAM hContact, LPARAM hEvent)
{
- HANDLE hEvent = (HANDLE)lParam;
-
DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get(hEvent, &dbei);
if (dbei.eventType != EVENTTYPE_MESSAGE)
@@ -91,7 +89,7 @@ void CContactCache::Rebuild() info->hContact = hContact;
info->rate = 0;
- for (HANDLE hEvent = db_event_last(hContact); hEvent; hEvent = db_event_prev(hContact, hEvent)) {
+ for (MEVENT hEvent = db_event_last(hContact); hEvent; hEvent = db_event_prev(hContact, hEvent)) {
DBEVENTINFO dbei = { sizeof(dbei) };
if (!db_event_get(hEvent, &dbei)) {
if (float weight = GetEventWeight(timestamp - dbei.timestamp)) {
diff --git a/plugins/GmailNotifier/src/notify.cpp b/plugins/GmailNotifier/src/notify.cpp index 4e1ee93632..6961d88cf1 100644 --- a/plugins/GmailNotifier/src/notify.cpp +++ b/plugins/GmailNotifier/src/notify.cpp @@ -89,7 +89,7 @@ void NotifyUser(Account *curAcc) if (opt.notifierOnTray&&newMails > 0) {
CLISTEVENT cle = { sizeof(cle) };
cle.hContact = curAcc->hContact;
- cle.hDbEvent = (HANDLE)1;
+ cle.hDbEvent = 1;
cle.flags = CLEF_URGENT;
cle.hIcon = LoadSkinnedProtoIcon(pluginName, ID_STATUS_OCCUPIED);
cle.pszService = "GmailMNotifier/Notifying";
diff --git a/plugins/HistoryLinkListPlus/src/linklist.cpp b/plugins/HistoryLinkListPlus/src/linklist.cpp index b41af89a65..6c374a238e 100644 --- a/plugins/HistoryLinkListPlus/src/linklist.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist.cpp @@ -122,7 +122,7 @@ static INT_PTR LinkList_Main(WPARAM hContact, LPARAM) return 0;
}
- HANDLE hEvent = db_event_first(hContact);
+ MEVENT hEvent = db_event_first(hContact);
if (hEvent == NULL) {
MessageBox(NULL, TXT_EMPTYHISTORY, TXT_PLUGINNAME, (MB_OK | MB_ICONINFORMATION));
return 0;
diff --git a/plugins/HistoryLinkListPlus/src/linklist.h b/plugins/HistoryLinkListPlus/src/linklist.h index f3e89dd275..6bd8bdde50 100644 --- a/plugins/HistoryLinkListPlus/src/linklist.h +++ b/plugins/HistoryLinkListPlus/src/linklist.h @@ -79,7 +79,7 @@ struct LISTELEMENT { TCHAR date[DATE_SIZE];
TCHAR time[TIME_SIZE];
TCHAR link[LINK_MAX];
- HANDLE hEvent;
+ MEVENT hEvent;
int linePos;
struct LISTELEMENT *nextElement;
} ;
@@ -150,7 +150,7 @@ typedef struct { static INT_PTR LinkList_Main(WPARAM, LPARAM);
int InitOptionsDlg(WPARAM, LPARAM);
int DBUpdate(WPARAM, LPARAM);
-int ExtractURI(DBEVENTINFO*, HANDLE, LISTELEMENT*);
+int ExtractURI(DBEVENTINFO*, MEVENT, LISTELEMENT*);
int RemoveList(LISTELEMENT*);
int ListCount(LISTELEMENT*);
diff --git a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp index ff08afccd6..ab280df73b 100644 --- a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp @@ -27,7 +27,7 @@ Miranda core. It looks a bit sophisticated. I'd made a few changes but I didn't really understand what these guys did!
Great job! It works! ;-)
*/
-int ExtractURI(DBEVENTINFO *dbei, HANDLE hEvent, LISTELEMENT *listStart)
+int ExtractURI(DBEVENTINFO *dbei, MEVENT hEvent, LISTELEMENT *listStart)
{
size_t wordStart, i, j, wordlen, iLastAlphaNum;
size_t charCount = 0, cpLastAlphaNum = 0, cpWordStart;
@@ -618,7 +618,7 @@ void WriteMessage(HWND hDlg, LISTELEMENT *listStart, int actLinePos) LISTELEMENT *actualElement = listStart->nextElement;
while (actualElement != NULL) {
if (actualElement->linePos == actLinePos) {
- HANDLE hEvent = actualElement->hEvent;
+ MEVENT hEvent = actualElement->hEvent;
if (hEvent != NULL ) {
DBEVENTINFO dbe = { sizeof(dbe) };
dbe.cbBlob = db_event_getBlobSize(hEvent);
@@ -1174,9 +1174,8 @@ BYTE GetUpdateSetting(void) Special thanks to Tobi H.!
This function is derived from his Wordlookup Plugin
*/
-int DBUpdate(WPARAM wParam, LPARAM lParam)
+int DBUpdate(WPARAM wParam, LPARAM hEvent)
{
- HANDLE hEvent=(HANDLE)lParam;
HWND hDlg = WindowList_Find(hWindowList, wParam);
DIALOGPARAM *DlgParam;
HMENU listMenu = GetMenu(hDlg);
diff --git a/plugins/HistoryStats/src/mirandacontact.h b/plugins/HistoryStats/src/mirandacontact.h index c91f79853b..7c7876b915 100644 --- a/plugins/HistoryStats/src/mirandacontact.h +++ b/plugins/HistoryStats/src/mirandacontact.h @@ -23,7 +23,7 @@ public: struct ContactInfo {
MCONTACT hContact;
- HANDLE hEvent;
+ MEVENT hEvent;
EventInfo ei;
};
diff --git a/plugins/HistorySweeperLight/src/historysweeperlight.cpp b/plugins/HistorySweeperLight/src/historysweeperlight.cpp index 12042a1b6e..d42546fa51 100644 --- a/plugins/HistorySweeperLight/src/historysweeperlight.cpp +++ b/plugins/HistorySweeperLight/src/historysweeperlight.cpp @@ -81,7 +81,7 @@ int KeepCriteria(int dwti) struct BEventData
{
- HANDLE hDBEvent;
+ MEVENT hDBEvent;
DWORD CRC32;
DWORD Timestamp;
};
@@ -152,7 +152,7 @@ void SweepHistoryFromContact(MCONTACT hContact, CriteriaStruct Criteria, BOOL ke GetBookmarks(hContact, &books, &bookcnt);
// Get first event
- for (HANDLE hDBEvent = db_event_first(hContact); hDBEvent != NULL; ) {
+ for (MEVENT hDBEvent = db_event_first(hContact); hDBEvent != NULL; ) {
DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get(hDBEvent, &dbei);
@@ -176,8 +176,7 @@ void SweepHistoryFromContact(MCONTACT hContact, CriteriaStruct Criteria, BOOL ke }
// find next event
- HANDLE hDBEventNext = db_event_next(hContact, hDBEvent);
-
+ MEVENT hDBEventNext = db_event_next(hContact, hDBEvent);
if (doDelete)
db_event_delete(hContact, hDBEvent);
diff --git a/plugins/IEHistory/src/dlgHandlers.cpp b/plugins/IEHistory/src/dlgHandlers.cpp index df09f1ecf2..ddee342acf 100644 --- a/plugins/IEHistory/src/dlgHandlers.cpp +++ b/plugins/IEHistory/src/dlgHandlers.cpp @@ -38,14 +38,14 @@ int LoadIEView(HWND hWnd); int MoveIEView(HWND hWnd); int DestroyIEView(HWND hWnd); int LoadEvents(HWND hWnd); -int LoadPage(HWND hWnd, HANDLE hFirstEvent, long index, long shiftCount, long readCount, int direction); +int LoadPage(HWND hWnd, MEVENT hFirstEvent, long index, long shiftCount, long readCount, int direction); int LoadNext(HWND hWnd); int LoadPrev(HWND hWnd); int ScrollToBottom(HWND hWnd); void RefreshButtonStates(HWND hWnd); -HANDLE GetNeededEvent(HANDLE hLastFirstEvent, int num, int direction); +MEVENT GetNeededEvent(MEVENT hLastFirstEvent, int num, int direction); int CalcIEViewPos(IEVIEWWINDOW *ieWnd, HWND hMainWindow) { @@ -163,7 +163,7 @@ DWORD WINAPI WorkerThread(LPVOID lpvData) int i; IEVIEWEVENTDATA ieData[LOAD_COUNT] = { 0 }; PBYTE messages[LOAD_COUNT] = { 0 }; - HANDLE dbEvent = data->ieEvent.hDbEventFirst; + MEVENT dbEvent = data->ieEvent.hDbEventFirst; for (i = 0; i < LOAD_COUNT; i++) { ieData[i].cbSize = sizeof(IEVIEWEVENTDATA); //set the cbsize here, no need to do it every time ieData[i].next = &ieData[i + 1]; //it's a vector, so v[i]'s next element is v[i + 1] @@ -263,7 +263,7 @@ int LoadEvents(HWND hWnd) ieEvent.hContact = data->contact; ieEvent.count = (data->itemsPerPage <= 0) ? count : data->itemsPerPage; - HANDLE hFirstEvent = db_event_first(data->contact); + MEVENT hFirstEvent = db_event_first(data->contact); int num = 0; if ((data->itemsPerPage > 0) && (bLastFirst)) { num = data->count - data->itemsPerPage; @@ -279,7 +279,7 @@ int LoadEvents(HWND hWnd) return 0; } -int LoadPage(HWND hWnd, HANDLE hFirstEvent, long index, long shiftCount, long readCount, int direction) +int LoadPage(HWND hWnd, MEVENT hFirstEvent, long index, long shiftCount, long readCount, int direction) { HistoryWindowData *data = (HistoryWindowData *)GetWindowLongPtr(hWnd, DWLP_USER); int count = shiftCount; @@ -303,7 +303,7 @@ int LoadPage(HWND hWnd, HANDLE hFirstEvent, long index, long shiftCount, long re } } data->index = newIndex; - HANDLE hEvent = GetNeededEvent(hFirstEvent, count, direction); + MEVENT hEvent = GetNeededEvent(hFirstEvent, count, direction); data->hLastFirstEvent = hEvent; ieEvent.hDbEventFirst = hEvent; ieEvent.count = readCount; diff --git a/plugins/IEHistory/src/dlgHandlers.h b/plugins/IEHistory/src/dlgHandlers.h index f0696a0abc..bf492a5bbf 100644 --- a/plugins/IEHistory/src/dlgHandlers.h +++ b/plugins/IEHistory/src/dlgHandlers.h @@ -33,14 +33,14 @@ struct HistoryWindowData{ int itemsPerPage; int bEnableRTL; HWND hIEView; - HANDLE hLastFirstEvent; + MEVENT hLastFirstEvent; }; struct SearchWindowData{ long index; MCONTACT contact; HWND hHistoryWindow; - HANDLE hLastFoundEvent; + MEVENT hLastFoundEvent; }; INT_PTR CALLBACK HistoryDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); diff --git a/plugins/IEHistory/src/utils.cpp b/plugins/IEHistory/src/utils.cpp index 2b676f8235..e460e3d78d 100644 --- a/plugins/IEHistory/src/utils.cpp +++ b/plugins/IEHistory/src/utils.cpp @@ -198,32 +198,31 @@ void UnixTimeToSystemTime(time_t t, LPSYSTEMTIME pst) SystemTimeToTzSpecificLocalTime(NULL, &st, pst); } -HANDLE GetNeededEvent(HANDLE hEvent, int num, int direction) +MEVENT GetNeededEvent(MEVENT hEvent, int num, int direction) { int i; - typedef HANDLE (__stdcall *db_event_step_t)(MCONTACT hContact,HANDLE hDbEvent); + typedef MEVENT (__stdcall *db_event_step_t)(MCONTACT hContact, MEVENT hDbEvent); db_event_step_t db_event_step; - if(direction==DIRECTION_BACK){ - db_event_step=db_event_prev; - }else{ - db_event_step=db_event_next; - } + if(direction == DIRECTION_BACK) + db_event_step = db_event_prev; + else + db_event_step = db_event_next; - for (i = 0; i < num; ++i){ - hEvent = db_event_step(0,hEvent); - } + for (i = 0; i < num; ++i) + hEvent = db_event_step(0, hEvent); + return hEvent; } -SearchResult SearchHistory(MCONTACT contact, HANDLE hFirstEvent, void *searchData, int direction, int type) +SearchResult SearchHistory(MCONTACT contact, MEVENT hFirstEvent, void *searchData, int direction, int type) { if (hFirstEvent == NULL){ - typedef HANDLE (__stdcall *db_event_start_t)(MCONTACT contact); - db_event_start_t db_event_start=(direction==DIRECTION_BACK) ? db_event_last : db_event_first; - hFirstEvent=db_event_start(contact); + typedef MEVENT (__stdcall *db_event_start_t)(MCONTACT contact); + db_event_start_t db_event_start = (direction == DIRECTION_BACK) ? db_event_last : db_event_first; + hFirstEvent = db_event_start(contact); } int index = 0; - HANDLE hEvent = hFirstEvent; + MEVENT hEvent = hFirstEvent; void *buffer = NULL; TCHAR *search; bool found = false; diff --git a/plugins/IEHistory/src/utils.h b/plugins/IEHistory/src/utils.h index 2d7605b7b1..7cdf8186f6 100644 --- a/plugins/IEHistory/src/utils.h +++ b/plugins/IEHistory/src/utils.h @@ -54,7 +54,7 @@ struct TimeSearchData{ struct SearchResult{ long index; - HANDLE hEvent; + MEVENT hEvent; }; #ifdef _DEBUG @@ -75,8 +75,8 @@ RECT AnchorCalcPos(HWND window, const RECT *rParent, const WINDOWPOS *parentPos, void UnixTimeToFileTime(time_t t, LPFILETIME pft); void UnixTimeToSystemTime(time_t t, LPSYSTEMTIME pst); -HANDLE GetNeededEvent(HANDLE hLastFirstEvent, int num, int direction); -SearchResult SearchHistory(MCONTACT contact, HANDLE hFirstEvent, void *searchData, int direction, int type); +MEVENT GetNeededEvent(MEVENT hLastFirstEvent, int num, int direction); +SearchResult SearchHistory(MCONTACT contact, MEVENT hFirstEvent, void *searchData, int direction, int type); /* static __inline int mir_snprintf(char *buffer, size_t count, const char* fmt, ...) { diff --git a/plugins/IEView/src/HTMLBuilder.cpp b/plugins/IEView/src/HTMLBuilder.cpp index de6b85d0d2..9480e4c420 100644 --- a/plugins/IEView/src/HTMLBuilder.cpp +++ b/plugins/IEView/src/HTMLBuilder.cpp @@ -304,7 +304,7 @@ void HTMLBuilder::appendEventOld(IEView *view, IEVIEWEVENT *event) {
IEVIEWEVENTDATA* eventData;
IEVIEWEVENTDATA* prevEventData = NULL;
- HANDLE hDbEvent = event->hDbEventFirst;
+ MEVENT hDbEvent = event->hDbEventFirst;
event->hDbEventFirst = NULL;
ptrA szProto;
diff --git a/plugins/Import/src/import.cpp b/plugins/Import/src/import.cpp index b0d5cd27c8..f4b91dcaab 100644 --- a/plugins/Import/src/import.cpp +++ b/plugins/Import/src/import.cpp @@ -873,7 +873,7 @@ static void ImportHistory(MCONTACT hContact, PROTOACCOUNT **protocol, int protoC BYTE *eventBuf = (PBYTE)mir_alloc(cbAlloc);
// Get the start of the event chain
- HANDLE hEvent = srcDb->FindFirstEvent(hContact);
+ MEVENT hEvent = srcDb->FindFirstEvent(hContact);
for (int i = 0; hEvent; i++, hEvent = srcDb->FindNextEvent(hContact, hEvent)) {
// Copy the event and import it
DBEVENTINFO dbei = { sizeof(DBEVENTINFO) };
diff --git a/plugins/Import/src/utils.cpp b/plugins/Import/src/utils.cpp index afb7250145..f224873f78 100644 --- a/plugins/Import/src/utils.cpp +++ b/plugins/Import/src/utils.cpp @@ -77,10 +77,10 @@ bool IsDuplicateEvent(MCONTACT hContact, DBEVENTINFO dbei) {
static DWORD dwPreviousTimeStamp = -1;
static MCONTACT hPreviousContact = INVALID_CONTACT_ID;
- static HANDLE hPreviousDbEvent = NULL;
+ static MEVENT hPreviousDbEvent = NULL;
// get last event
- HANDLE hExistingDbEvent = db_event_last(hContact);
+ MEVENT hExistingDbEvent = db_event_last(hContact);
if (hExistingDbEvent == NULL)
return FALSE;
diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp index cbcdc60627..ae7e48fd98 100644 --- a/plugins/KeyboardNotify/src/main.cpp +++ b/plugins/KeyboardNotify/src/main.cpp @@ -24,7 +24,7 @@ #include "Common.h" -#define NCONVERS_BLINKID ((HANDLE)123456) //nconvers' random identifier used to flash an icon for "incoming message" on contact list +#define NCONVERS_BLINKID ((MEVENT)123456) //nconvers' random identifier used to flash an icon for "incoming message" on contact list HINSTANCE hInst; @@ -202,7 +202,7 @@ DBEVENTINFO createMsgEventInfo(MCONTACT hContact) return einfo; } -DBEVENTINFO readEventInfo(HANDLE hDbEvent, MCONTACT hContact) +DBEVENTINFO readEventInfo(MEVENT hDbEvent, MCONTACT hContact) { if (hDbEvent == NCONVERS_BLINKID) // we need to handle nconvers' blink event return createMsgEventInfo(hContact); @@ -330,12 +330,12 @@ static void FlashThreadFunction() } } -BOOL checkMsgTimestamp(MCONTACT hContact, HANDLE hEventCurrent, DWORD timestampCurrent) +BOOL checkMsgTimestamp(MCONTACT hContact, MEVENT hEventCurrent, DWORD timestampCurrent) { if (!bFlashIfMsgOlder) return TRUE; - for (HANDLE hEvent = db_event_prev(hContact, hEventCurrent); hEvent; hEvent = db_event_prev(hContact, hEvent)) { + for (MEVENT hEvent = db_event_prev(hContact, hEventCurrent); hEvent; hEvent = db_event_prev(hContact, hEvent)) { DBEVENTINFO einfo = { sizeof(einfo) }; if(!db_event_get(hEvent, &einfo)) { if ((einfo.timestamp + wSecondsOlder) <= timestampCurrent) @@ -395,10 +395,8 @@ BOOL checkXstatus(char *szProto) // 'Pings' the FlashThread to keep the LEDs flashing. -static int PluginMessageEventHook(WPARAM hContact, LPARAM lParam) +static int PluginMessageEventHook(WPARAM hContact, LPARAM hEvent) { - HANDLE hEvent = (HANDLE)lParam; - //get DBEVENTINFO without pBlob DBEVENTINFO einfo = { sizeof(einfo) }; if (!db_event_get(hEvent, &einfo) && !(einfo.flags & DBEF_SENT)) diff --git a/plugins/MirOTR/MirOTR/src/dbfilter.cpp b/plugins/MirOTR/MirOTR/src/dbfilter.cpp index 7ee8866104..4def70e5e8 100644 --- a/plugins/MirOTR/MirOTR/src/dbfilter.cpp +++ b/plugins/MirOTR/MirOTR/src/dbfilter.cpp @@ -8,7 +8,7 @@ struct DeleteEventNode { DeleteEventNode *next;
time_t timestamp;
MCONTACT hContact;
- HANDLE hDbEvent;
+ MEVENT hDbEvent;
};
struct DeleteEventHead {
DeleteEventNode *first;
@@ -193,7 +193,7 @@ int OnDatabaseEventPreAdd(WPARAM hContact, LPARAM lParam) DBEVENTINFO info = { sizeof(info) };
info.cbBlob = lenutf*2;
info.pBlob = (PBYTE)mir_alloc(info.cbBlob);
- if (!db_event_get((HANDLE)lParam, &info)) {
+ if (!db_event_get(lParam, &info)) {
if(info.eventType == EVENTTYPE_MESSAGE) {
MCONTACT hSub;
if((hSub = db_mc_getMostOnline(hContact)) != 0)
@@ -208,7 +208,7 @@ int OnDatabaseEventPreAdd(WPARAM hContact, LPARAM lParam) {
DeleteEventNode *node = new DeleteEventNode();
node->hContact = hContact;
- node->hDbEvent = (HANDLE) lParam;
+ node->hDbEvent = lParam;
node->timestamp = time(0);
node->next = 0;
EnterCriticalSection(lpRemoveChainCS);
diff --git a/plugins/MirandaG15/src/CAppletManager.cpp b/plugins/MirandaG15/src/CAppletManager.cpp index a6456866f8..dbc34fd1c3 100644 --- a/plugins/MirandaG15/src/CAppletManager.cpp +++ b/plugins/MirandaG15/src/CAppletManager.cpp @@ -797,7 +797,7 @@ void CAppletManager::SendTypingNotification(MCONTACT hContact,bool bEnable) //************************************************************************ // sends a message to the specified contact //************************************************************************ -HANDLE CAppletManager::SendMessageToContact(MCONTACT hContact,tstring strMessage) +MEVENT CAppletManager::SendMessageToContact(MCONTACT hContact,tstring strMessage) { tstring strAscii = _A2T(toNarrowString(strMessage).c_str()); int bufSize = mir_tstrlen(strAscii.c_str())+1; @@ -870,7 +870,7 @@ HANDLE CAppletManager::SendMessageToContact(MCONTACT hContact,tstring strMessage pJob->pcBuffer = NULL; return NULL; } - pJob->hEvent = (HANDLE) CallContactService(pJob->hContact, szService , pref, (LPARAM)pJob->pcBuffer ); + pJob->hEvent = (MEVENT)CallContactService(pJob->hContact, szService , pref, (LPARAM)pJob->pcBuffer ); CAppletManager::GetInstance()->AddMessageJob(pJob); } @@ -898,7 +898,7 @@ bool CAppletManager::IsMessageWindowOpen(MCONTACT hContact) //************************************************************************ // marks the given message as read //************************************************************************ -void CAppletManager::MarkMessageAsRead(MCONTACT hContact,HANDLE hEvent) +void CAppletManager::MarkMessageAsRead(MCONTACT hContact,MEVENT hEvent) { db_event_markRead(hContact, hEvent); CallService(MS_CLIST_REMOVEEVENT, hContact, (LPARAM)hEvent); @@ -907,12 +907,8 @@ void CAppletManager::MarkMessageAsRead(MCONTACT hContact,HANDLE hEvent) //************************************************************************ // translates the given database event //************************************************************************ -bool CAppletManager::TranslateDBEvent(CEvent *pEvent,WPARAM wParam, LPARAM lParam) +bool CAppletManager::TranslateDBEvent(CEvent *pEvent, WPARAM hContact, LPARAM hdbevent) { - MCONTACT hContact = wParam; - HANDLE hdbevent = (HANDLE)lParam; - - // Create struct for dbevent DBEVENTINFO dbevent; memset(&dbevent, 0, sizeof(dbevent)); @@ -1240,7 +1236,7 @@ int CAppletManager::HookChatInbound(WPARAM wParam,LPARAM lParam) else Event.eType = EVENT_IRC_RECEIVED; Event.iValue = gcd->iType; - Event.hValue = (HANDLE)lParam; + Event.hValue = lParam; CIRCHistory *pHistory = NULL; if(gcd->ptszID) @@ -1673,10 +1669,10 @@ int CAppletManager::HookProtoAck(WPARAM wParam, LPARAM lParam) list<SMessageJob*>::iterator iter = CAppletManager::GetInstance()->m_MessageJobs.begin(); while(iter != CAppletManager::GetInstance()->m_MessageJobs.end()) { - if((*iter)->hEvent == pAck->hProcess && (*iter)->hContact == pAck->hContact) + if((*iter)->hEvent == (MEVENT)pAck->hProcess && (*iter)->hContact == pAck->hContact) { Event.eType = EVENT_MESSAGE_ACK; - Event.hValue = pAck->hProcess; + Event.hValue = (MEVENT)pAck->hProcess; Event.hContact = pAck->hContact; Event.iValue = pAck->result; if(pAck->lParam != 0) diff --git a/plugins/MirandaG15/src/CAppletManager.h b/plugins/MirandaG15/src/CAppletManager.h index e95a063cb8..5af6058273 100644 --- a/plugins/MirandaG15/src/CAppletManager.h +++ b/plugins/MirandaG15/src/CAppletManager.h @@ -18,7 +18,7 @@ struct SMessageJob
{
- HANDLE hEvent;
+ MEVENT hEvent;
MCONTACT hContact;
DWORD dwFlags;
char *pcBuffer;
@@ -75,11 +75,11 @@ public: // check if a contacts message window is opened
static bool IsMessageWindowOpen(MCONTACT hContact);
// marks the given event as read
- static void MarkMessageAsRead(MCONTACT hContact,HANDLE hEvent);
+ static void MarkMessageAsRead(MCONTACT hContact, MEVENT hEvent);
// translates the given database event
static bool TranslateDBEvent(CEvent *pEvent,WPARAM wParam, LPARAM lParam);
// sends a message to the specified contact
- static HANDLE SendMessageToContact(MCONTACT hContact,tstring strMessage);
+ static MEVENT SendMessageToContact(MCONTACT hContact,tstring strMessage);
// sends typing notifications to the specified contact
static void SendTypingNotification(MCONTACT hContact,bool bEnable);
diff --git a/plugins/MirandaG15/src/CChatScreen.cpp b/plugins/MirandaG15/src/CChatScreen.cpp index f519baaae8..34a82de04f 100644 --- a/plugins/MirandaG15/src/CChatScreen.cpp +++ b/plugins/MirandaG15/src/CChatScreen.cpp @@ -303,9 +303,9 @@ void CChatScreen::LoadHistory() {
// Get last events from database
CEvent Event;
- list<HANDLE> LHandles;
- HANDLE hEvent = db_event_last(m_hContact);
- HANDLE hUnread = db_event_firstUnread(m_hContact);
+ list<MEVENT> LHandles;
+ MEVENT hEvent = db_event_last(m_hContact);
+ MEVENT hUnread = db_event_firstUnread(m_hContact);
if(CConfig::GetBoolSetting(SESSION_LOADDB))
{
diff --git a/plugins/MirandaG15/src/CChatScreen.h b/plugins/MirandaG15/src/CChatScreen.h index 0f10a17614..4f1582083b 100644 --- a/plugins/MirandaG15/src/CChatScreen.h +++ b/plugins/MirandaG15/src/CChatScreen.h @@ -93,7 +93,7 @@ protected: DWORD m_dwMaximizedDuration;
MCONTACT m_hContact;
- HANDLE m_hMessage;
+ MEVENT m_hMessage;
int m_iStatus;
diff --git a/plugins/MirandaG15/src/CContactList.cpp b/plugins/MirandaG15/src/CContactList.cpp index 69e6165d38..965607226c 100644 --- a/plugins/MirandaG15/src/CContactList.cpp +++ b/plugins/MirandaG15/src/CContactList.cpp @@ -905,9 +905,7 @@ void CContactList::UpdateMessageCounter(CListEntry<CContactListEntry*,CContactLi int iOldMessages = pEntry->iMessages;
bool bSort = false;
- HANDLE hEvent= NULL;
-
- hEvent = db_event_firstUnread(pEntry->hHandle);
+ MEVENT hEvent = db_event_firstUnread(pEntry->hHandle);
if(CAppletManager::IsMessageWindowOpen(pEntry->hHandle) || (hEvent == NULL && pEntry->iMessages > 0))
{
pEntry->iMessages = 0;
@@ -916,7 +914,7 @@ void CContactList::UpdateMessageCounter(CListEntry<CContactListEntry*,CContactLi else
{
pEntry->iMessages = 0;
- HANDLE hLastEvent = db_event_last(pEntry->hHandle);
+ MEVENT hLastEvent = db_event_last(pEntry->hHandle);
while(hLastEvent != NULL && hEvent != NULL)
{
pEntry->iMessages++;
diff --git a/plugins/MirandaG15/src/CEvent.h b/plugins/MirandaG15/src/CEvent.h index d07080b70c..c94e98d108 100644 --- a/plugins/MirandaG15/src/CEvent.h +++ b/plugins/MirandaG15/src/CEvent.h @@ -63,7 +63,7 @@ public: tstring strDescription;
tstring strSummary;
- HANDLE hValue;
+ MEVENT hValue;
int iValue;
tstring strValue;
};
diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp index 1390af62c4..0c14b89862 100755 --- a/plugins/Msg_Export/src/options.cpp +++ b/plugins/Msg_Export/src/options.cpp @@ -57,9 +57,9 @@ class CLDBEvent DWORD time;
public:
MCONTACT hUser;
- HANDLE hDbEvent;
+ MEVENT hDbEvent;
- CLDBEvent(MCONTACT hU, HANDLE hDBE )
+ CLDBEvent(MCONTACT hU, MEVENT hDBE)
{
hUser = hU;
hDbEvent = hDBE;
@@ -221,9 +221,9 @@ int nExportCompleatList(HWND hParent, bool bOnlySelected ) MCONTACT hContact = (MCONTACT)sItem.lParam;
- list< CLDBEvent > & rclCurList = AllEvents[ GetFilePathFromUser( hContact) ];
+ list<CLDBEvent> &rclCurList = AllEvents[ GetFilePathFromUser( hContact) ];
- HANDLE hDbEvent = db_event_first(hContact);
+ MEVENT hDbEvent = db_event_first(hContact);
while( hDbEvent) {
rclCurList.push_back(CLDBEvent(hContact, hDbEvent));
hDbEvent = db_event_next(hContact, hDbEvent);
@@ -260,7 +260,7 @@ int nExportCompleatList(HWND hParent, bool bOnlySelected ) list< CLDBEvent >::const_iterator iterator;
for (iterator = FileIterator->second.begin() ; iterator != FileIterator->second.end() ; ++iterator )
{
- HANDLE hDbEvent = (*iterator).hDbEvent;
+ MEVENT hDbEvent = (*iterator).hDbEvent;
nExportEvent( (WPARAM) (*iterator).hUser, (LPARAM)hDbEvent);
}
SendMessage( hProg, PBM_SETPOS, ++nCur, 0);
diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp index 1db6774808..3adbec1191 100755 --- a/plugins/Msg_Export/src/utils.cpp +++ b/plugins/Msg_Export/src/utils.cpp @@ -1408,10 +1408,8 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei ) /////////////////////////////////////////////////////////////////////
-int nExportEvent(WPARAM wparam,LPARAM lparam)
+int nExportEvent(WPARAM hContact, LPARAM hDbEvent)
{
- MCONTACT hContact = (MCONTACT)wparam;
- HANDLE hDbEvent = (HANDLE)lparam;
if ( !db_get_b(hContact,MODULE,"EnableLog",1))
return 0;
diff --git a/plugins/NewEventNotify/src/main.cpp b/plugins/NewEventNotify/src/main.cpp index 9c5f46a6e2..63fd90ea86 100644 --- a/plugins/NewEventNotify/src/main.cpp +++ b/plugins/NewEventNotify/src/main.cpp @@ -60,7 +60,7 @@ HANDLE hHookedDeletedEvent; //wParam: contact-handle
//lParam: dbevent-handle
-int HookedNewEvent(WPARAM hContact, LPARAM lParam)
+int HookedNewEvent(WPARAM hContact, LPARAM hDbEvent)
{
//are popups currently enabled?
if (pluginOptions.bDisable)
@@ -68,7 +68,7 @@ int HookedNewEvent(WPARAM hContact, LPARAM lParam) //get DBEVENTINFO without pBlob
DBEVENTINFO dbe = { sizeof(dbe) };
- db_event_get((HANDLE)lParam, &dbe);
+ db_event_get(hDbEvent, &dbe);
//do not show popups for sub-contacts
if (hContact && db_mc_isSub(hContact))
@@ -103,9 +103,9 @@ int HookedNewEvent(WPARAM hContact, LPARAM lParam) //is another popup for this contact already present? -> merge message popups if enabled
if (dbe.eventType == EVENTTYPE_MESSAGE && (pluginOptions.bMergePopup && NumberPopupData(hContact, EVENTTYPE_MESSAGE) != -1))
- PopupUpdate(hContact, (HANDLE)lParam);
+ PopupUpdate(hContact, hDbEvent);
else
- PopupShow(&pluginOptions, hContact, (HANDLE)lParam, (UINT)dbe.eventType);
+ PopupShow(&pluginOptions, hContact, hDbEvent, (UINT)dbe.eventType);
return 0;
}
diff --git a/plugins/NewEventNotify/src/neweventnotify.h b/plugins/NewEventNotify/src/neweventnotify.h index 31e6295c3d..1d73bb6d6c 100644 --- a/plugins/NewEventNotify/src/neweventnotify.h +++ b/plugins/NewEventNotify/src/neweventnotify.h @@ -189,7 +189,7 @@ struct PLUGIN_OPTIONS struct EVENT_DATA_EX
{
- HANDLE hEvent;
+ MEVENT hEvent;
int number;
struct EVENT_DATA_EX* next;
struct EVENT_DATA_EX* prev;
@@ -212,8 +212,8 @@ struct PLUGIN_DATA //---------------------------
//---External Procedure Definitions
-int PopupShow(PLUGIN_OPTIONS* pluginOptions, MCONTACT hContact, HANDLE hEvent, UINT eventType);
-int PopupUpdate(MCONTACT hContact, HANDLE hEvent);
+int PopupShow(PLUGIN_OPTIONS* pluginOptions, MCONTACT hContact, MEVENT hEvent, UINT eventType);
+int PopupUpdate(MCONTACT hContact, MEVENT hEvent);
int PopupPreview(PLUGIN_OPTIONS* pluginOptions);
int PopupAct(HWND hWnd, UINT mask, PLUGIN_DATA* pdata);
int OptionsInit(PLUGIN_OPTIONS* pluginOptions);
diff --git a/plugins/NewEventNotify/src/popup.cpp b/plugins/NewEventNotify/src/popup.cpp index eb514b5406..e6b9e894d9 100644 --- a/plugins/NewEventNotify/src/popup.cpp +++ b/plugins/NewEventNotify/src/popup.cpp @@ -400,7 +400,7 @@ static TCHAR* GetEventPreview(DBEVENTINFO *dbei) return TranslateTS( mir_a2t(commentFix));
}
-int PopupShow(PLUGIN_OPTIONS* pluginOptions, MCONTACT hContact, HANDLE hEvent, UINT eventType)
+int PopupShow(PLUGIN_OPTIONS* pluginOptions, MCONTACT hContact, MEVENT hEvent, UINT eventType)
{
TCHAR* sampleEvent;
long iSeconds;
@@ -517,7 +517,7 @@ int PopupShow(PLUGIN_OPTIONS* pluginOptions, MCONTACT hContact, HANDLE hEvent, U }
-int PopupUpdate(MCONTACT hContact, HANDLE hEvent)
+int PopupUpdate(MCONTACT hContact, MEVENT hEvent)
{
// merge only message popups
PLUGIN_DATA *pdata = (PLUGIN_DATA*)PopupList[NumberPopupData(hContact, EVENTTYPE_MESSAGE)];
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index 18d3ee05ef..14cdf6b503 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -287,7 +287,7 @@ void LogSMsgToDB(STATUSMSGINFO *smi, const TCHAR *tmplt) dbei.timestamp = (DWORD)time(NULL);
dbei.szModule = MODULE;
- HANDLE hDBEvent = db_event_add(smi->hContact, &dbei);
+ MEVENT hDBEvent = db_event_add(smi->hContact, &dbei);
mir_free(blob);
mir_free(str);
@@ -330,7 +330,7 @@ void BlinkIcon(MCONTACT hContact, HICON hIcon, TCHAR *stzText) cle.cbSize = sizeof(cle);
cle.flags = CLEF_ONLYAFEW | CLEF_TCHAR;
cle.hContact = hContact;
- cle.hDbEvent = (HANDLE)hContact;
+ cle.hDbEvent = hContact;
cle.hIcon = hIcon;
cle.pszService = "UserOnline/Description";
cle.ptszTooltip = stzText;
@@ -376,7 +376,7 @@ int ContactStatusChanged(MCONTACT hContact, WORD oldStatus, WORD newStatus) dbei.timestamp = (DWORD)time(NULL);
dbei.szModule = MODULE;
- HANDLE hDBEvent = db_event_add(hContact, &dbei);
+ MEVENT hDBEvent = db_event_add(hContact, &dbei);
mir_free(blob);
if (opt.LogToDB_WinOpen && opt.LogToDB_Remove) {
diff --git a/plugins/NewXstatusNotify/src/xstatus.cpp b/plugins/NewXstatusNotify/src/xstatus.cpp index 786ffe4265..f8dae508eb 100644 --- a/plugins/NewXstatusNotify/src/xstatus.cpp +++ b/plugins/NewXstatusNotify/src/xstatus.cpp @@ -325,7 +325,7 @@ void LogChangeToDB(XSTATUSCHANGE *xsc) dbei.timestamp = (DWORD)time(NULL);
dbei.szModule = MODULE;
- HANDLE hDBEvent = db_event_add(xsc->hContact, &dbei);
+ MEVENT hDBEvent = db_event_add(xsc->hContact, &dbei);
mir_free(blob);
if (opt.XLogToDB_WinOpen && opt.XLogToDB_Remove) {
diff --git a/plugins/NewXstatusNotify/src/xstatus.h b/plugins/NewXstatusNotify/src/xstatus.h index 9d30a65d23..1c82461245 100644 --- a/plugins/NewXstatusNotify/src/xstatus.h +++ b/plugins/NewXstatusNotify/src/xstatus.h @@ -95,7 +95,7 @@ typedef struct tagXSTATUSCHANGE typedef struct tagDBEVENT
{
MCONTACT hContact;
- HANDLE hDBEvent;
+ MEVENT hDBEvent;
} DBEVENT;
typedef struct tagPROTOTEMPLATE
diff --git a/plugins/NewsAggregator/Src/CheckFeed.cpp b/plugins/NewsAggregator/Src/CheckFeed.cpp index 1920ff7f4c..08888867a9 100644 --- a/plugins/NewsAggregator/Src/CheckFeed.cpp +++ b/plugins/NewsAggregator/Src/CheckFeed.cpp @@ -126,7 +126,7 @@ static void XmlToMsg(MCONTACT hContact, CMString &title, CMString &link, CMStrin ptrA pszTemp(mir_utf8encodeT(message));
DWORD cbMemoLen = 10000, cbOrigLen = (DWORD)strlen(pszTemp);
BYTE *pbBuffer = (BYTE*)mir_alloc(cbMemoLen);
- for (HANDLE hDbEvent = db_event_last(hContact); hDbEvent; hDbEvent = db_event_prev(hContact, hDbEvent)) {
+ for (MEVENT hDbEvent = db_event_last(hContact); hDbEvent; hDbEvent = db_event_prev(hContact, hDbEvent)) {
olddbei.cbBlob = db_event_getBlobSize(hDbEvent);
if (olddbei.cbBlob > cbMemoLen)
pbBuffer = (PBYTE)mir_realloc(pbBuffer, (size_t)(cbMemoLen = olddbei.cbBlob));
diff --git a/plugins/NoHistory/src/dllmain.cpp b/plugins/NoHistory/src/dllmain.cpp index 93f2f3c9f5..53c4df12b4 100644 --- a/plugins/NoHistory/src/dllmain.cpp +++ b/plugins/NoHistory/src/dllmain.cpp @@ -21,7 +21,7 @@ CRITICAL_SECTION list_cs; // a list of db events - we'll check them for the 'read' flag periodically and delete them whwen marked as read
struct EventListNode {
MCONTACT hContact;
- HANDLE hDBEvent;
+ MEVENT hDBEvent;
EventListNode *next;
};
@@ -99,9 +99,9 @@ void RemoveReadEvents(MCONTACT hContact = 0) void RemoveAllEvents(MCONTACT hContact)
{
- HANDLE hDBEvent = db_event_first(hContact);
+ MEVENT hDBEvent = db_event_first(hContact);
while(hDBEvent) {
- HANDLE hDBEventNext = db_event_next(hContact, hDBEvent);
+ MEVENT hDBEventNext = db_event_next(hContact, hDBEvent);
db_event_delete(hContact, hDBEvent);
hDBEvent = hDBEventNext;
}
@@ -112,16 +112,14 @@ void CALLBACK TimerProc(HWND hWnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime) RemoveReadEvents();
}
-int OnDatabaseEventAdd(WPARAM hContact, LPARAM lParam)
+int OnDatabaseEventAdd(WPARAM hContact, LPARAM hDBEvent)
{
- HANDLE hDBEvent = (HANDLE)lParam;
-
// history not disabled for this contact
if (db_get_b(hContact, MODULE, DBSETTING_REMOVE, 0) == 0)
return 0;
DBEVENTINFO info = { sizeof(info) };
- if ( !db_event_get(hDBEvent, &info)) {
+ if (!db_event_get(hDBEvent, &info)) {
if (info.eventType == EVENTTYPE_MESSAGE) {
EventListNode *node = (EventListNode *)malloc(sizeof(EventListNode));
node->hContact = hContact;
diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp index 2ae6d2011b..3e77ddff60 100644 --- a/plugins/QuickContacts/src/quickcontacts.cpp +++ b/plugins/QuickContacts/src/quickcontacts.cpp @@ -196,10 +196,10 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) // called when a message/file/url was sent
// handle of contact is set as window-userdata
-int EventAdded(WPARAM wparam, LPARAM lparam)
+int EventAdded(WPARAM wparam, LPARAM hDbEvent)
{
DBEVENTINFO dbei = { sizeof(dbei) };
- db_event_get((HANDLE)lparam, &dbei);
+ db_event_get(hDbEvent, &dbei);
if ( !(dbei.flags & DBEF_SENT) || (dbei.flags & DBEF_READ)
|| !db_get_b(NULL, MODULE_NAME, "EnableLastSentTo", 0)
|| db_get_w(NULL, MODULE_NAME, "MsgTypeRec", TYPE_GLOBAL) != TYPE_GLOBAL)
diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp index f176a8e77b..7a59f49016 100644 --- a/plugins/RecentContacts/src/RecentContacts.cpp +++ b/plugins/RecentContacts/src/RecentContacts.cpp @@ -414,7 +414,7 @@ INT_PTR OnMenuCommandShowList(WPARAM wParam, LPARAM lParam) dbe.cbSize = sizeof(dbe);
BYTE buf[1];
dbe.pBlob = buf;
- HANDLE curEvent;
+ MEVENT curEvent;
for (MCONTACT curContact = db_find_first(); curContact != NULL; curContact = db_find_next(curContact)) {
curTime = ((__time64_t)db_get_dw(curContact, dbLastUC_ModuleName, dbLastUC_LastUsedTimeLo, -1)) |
diff --git a/plugins/RemovePersonalSettings/src/rps.cpp b/plugins/RemovePersonalSettings/src/rps.cpp index d3b6176531..ac901b462b 100644 --- a/plugins/RemovePersonalSettings/src/rps.cpp +++ b/plugins/RemovePersonalSettings/src/rps.cpp @@ -222,13 +222,10 @@ void SetProtocolsOffline() void RemoveUsers()
{
if ( GetSettingBool("GlobalSettings", "RemoveAllUsers", TRUE) ) {
- MCONTACT hContact, hContactOld;
- HANDLE hDbEvent;
-
// To be faster, remove first all metacontacts (because it syncs histories)
- hContact = db_find_first();
+ MCONTACT hContact = db_find_first();
while(hContact != NULL) {
- hContactOld = hContact;
+ MCONTACT hContactOld = hContact;
hContact = db_find_next(hContact);
if (isMetaContact(hContactOld) )
@@ -244,11 +241,10 @@ void RemoveUsers() }
// Delete events for contacts not in list
- hDbEvent = db_event_first(0);
+ MEVENT hDbEvent = db_event_first(0);
while(hDbEvent != NULL) {
int ret = db_event_delete(0, hDbEvent);
-
hDbEvent = db_event_first(0);
}
diff --git a/plugins/SMS/src/SMS_svc.cpp b/plugins/SMS/src/SMS_svc.cpp index 05678d0046..6e594bea8e 100644 --- a/plugins/SMS/src/SMS_svc.cpp +++ b/plugins/SMS/src/SMS_svc.cpp @@ -135,7 +135,7 @@ 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)) {
dbei.cbBlob = 0;
if (db_event_get(hDbEvent, &dbei) == 0)
if ((dbei.flags & (DBEF_SENT|DBEF_READ))==0 && ((dbei.eventType==ICQEVENTTYPE_SMS) || (dbei.eventType==ICQEVENTTYPE_SMSCONFIRMATION)))
@@ -143,7 +143,7 @@ void RestoreUnreadMessageAlerts(void) handleNewMessage(hContact,(LPARAM)hDbEvent);
}
- for (HANDLE hDbEvent = db_event_firstUnread(NULL); hDbEvent; hDbEvent = db_event_next(NULL, hDbEvent)) {
+ for (MEVENT hDbEvent = db_event_firstUnread(NULL); hDbEvent; hDbEvent = db_event_next(NULL, hDbEvent)) {
dbei.cbBlob = 0;
if (db_event_get(hDbEvent, &dbei) == 0)
if ((dbei.flags & (DBEF_SENT|DBEF_READ))==0 && ((dbei.eventType==ICQEVENTTYPE_SMS) || (dbei.eventType==ICQEVENTTYPE_SMSCONFIRMATION)))
diff --git a/plugins/SMS/src/receive.cpp b/plugins/SMS/src/receive.cpp index fa2d31764f..813cd77ffd 100644 --- a/plugins/SMS/src/receive.cpp +++ b/plugins/SMS/src/receive.cpp @@ -74,7 +74,7 @@ int handleAckSMS(WPARAM wParam, LPARAM lParam) dbei.cbBlob=(mir_snprintf((LPSTR)dbei.pBlob,((dwBuffLen+dwPhoneSize)),"SMS From: +%s\r\n%s",szPhone,lpszMessageUTF)+sizeof(DWORD));
//dbei.pBlob=(LPBYTE)lpszBuff;
(*((DWORD*)(dbei.pBlob+(dbei.cbBlob-sizeof(DWORD)))))=0;
- HANDLE hResult = db_event_add(hContact, &dbei);
+ MEVENT hResult = db_event_add(hContact, &dbei);
if (hContact==NULL) {
if ( RecvSMSWindowAdd(NULL,ICQEVENTTYPE_SMS,tszPhone,dwPhoneSize,(LPSTR)dbei.pBlob,dbei.cbBlob)) {
db_event_markRead(hContact, hResult);
@@ -212,11 +212,10 @@ int handleAckSMS(WPARAM wParam, LPARAM lParam) }
//Handles new SMS messages added to the database
-int handleNewMessage(WPARAM hContact, LPARAM lParam)
+int handleNewMessage(WPARAM hContact, LPARAM hDbEvent)
{
char szServiceFunction[MAX_PATH], *pszServiceFunctionName;
TCHAR szToolTip[MAX_PATH];
- HANDLE hDbEvent = (HANDLE)lParam;
DBEVENTINFO dbei = { sizeof(dbei) };
if ((dbei.cbBlob = db_event_getBlobSize(hDbEvent)) == -1)
@@ -256,7 +255,7 @@ int handleNewMessage(WPARAM hContact, LPARAM lParam) SkinPlaySound("RecvSMSConfirmation");
if (DB_SMS_GetByte(NULL, "AutoPopup", 0)) {
if (RecvSMSWindowAdd(hContact,ICQEVENTTYPE_SMSCONFIRMATION,NULL,0,(LPSTR)dbei.pBlob,dbei.cbBlob))
- db_event_delete(hContact, &dbei);
+ db_event_delete(hContact, hDbEvent);
}
else {
UINT iIcon;
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 830b49d04b..31a3413a90 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -852,7 +852,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP }
DBEVENTINFO dbei = { sizeof(dbei) };
- HANDLE hPrevEvent;
+ MEVENT hPrevEvent;
switch (historyMode) {
case LOADHISTORY_COUNT:
for (int i = db_get_w(NULL, SRMMMOD, SRMSGSET_LOADCOUNT, SRMSGDEFSET_LOADCOUNT); i > 0; i--) {
@@ -896,7 +896,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP }
SendMessage(dat->hwndParent, CM_ADDCHILD, (WPARAM)hwndDlg, dat->hContact);
{
- HANDLE hdbEvent = db_event_last(dat->hContact);
+ MEVENT hdbEvent = db_event_last(dat->hContact);
if (hdbEvent) {
DBEVENTINFO dbei = { sizeof(dbei) };
do {
@@ -1221,7 +1221,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP //fall through
case WM_MOUSEACTIVATE:
if (dat->hDbUnreadEventFirst != NULL) {
- HANDLE hDbEvent = dat->hDbUnreadEventFirst;
+ MEVENT hDbEvent = dat->hDbUnreadEventFirst;
dat->hDbUnreadEventFirst = NULL;
while (hDbEvent != NULL) {
DBEVENTINFO dbei = { sizeof(dbei) };
@@ -1311,7 +1311,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:
@@ -1342,7 +1342,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;
DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get(hDbEvent, &dbei);
if (dat->hDbEventFirst == NULL)
diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp index 4d7631dba9..a5f6297500 100644 --- a/plugins/Scriver/src/msglog.cpp +++ b/plugins/Scriver/src/msglog.cpp @@ -75,7 +75,7 @@ struct LogStreamData {
int stage;
MCONTACT hContact;
- HANDLE hDbEvent, hDbEventLast;
+ MEVENT hDbEvent, hDbEventLast;
char *buffer;
size_t bufferOffset, bufferLen;
int eventsToInsert;
@@ -151,7 +151,7 @@ int DbEventIsShown(DBEVENTINFO &dbei) return DbEventIsCustomForMsgWindow(&dbei);
}
-EventData* getEventFromDB(SrmmWindowData *dat, MCONTACT hContact, HANDLE hDbEvent)
+EventData* getEventFromDB(SrmmWindowData *dat, MCONTACT hContact, MEVENT hDbEvent)
{
DBEVENTINFO dbei = { sizeof(dbei) };
dbei.cbBlob = db_event_getBlobSize(hDbEvent);
@@ -814,7 +814,7 @@ void StreamInTestEvents(HWND hEditWnd, GlobalMessageData *gdat) SendMessage(hEditWnd, EM_HIDESELECTION, FALSE, 0);
}
-void StreamInEvents(HWND hwndDlg, HANDLE hDbEventFirst, int count, int fAppend)
+void StreamInEvents(HWND hwndDlg, MEVENT hDbEventFirst, int count, int fAppend)
{
FINDTEXTEXA fi;
EDITSTREAM stream = { 0 };
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp index 913e429db6..e4a6022401 100644 --- a/plugins/Scriver/src/msgs.cpp +++ b/plugins/Scriver/src/msgs.cpp @@ -89,7 +89,7 @@ static INT_PTR ReadMessageCommand(WPARAM, LPARAM lParam) static int MessageEventAdded(WPARAM hContact, LPARAM lParam)
{
- HANDLE hDbEvent = (HANDLE)lParam;
+ MEVENT hDbEvent = (MEVENT)lParam;
DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get(hDbEvent, &dbei);
if (dbei.eventType == EVENTTYPE_MESSAGE && (dbei.flags & DBEF_READ))
@@ -221,7 +221,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 = GetCachedIcon("scriver_TYPING");
cle.pszService = "SRMsg/TypingMessage";
@@ -263,7 +263,7 @@ static void RestoreUnreadMessageAlerts(void) cle.ptszTooltip = toolTip;
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)) {
dbei.cbBlob = 0;
db_event_get(hDbEvent, &dbei);
if (!(dbei.flags & (DBEF_SENT | DBEF_READ)) && DbEventIsMessageOrCustom(&dbei)) {
diff --git a/plugins/Scriver/src/msgs.h b/plugins/Scriver/src/msgs.h index c823caff29..cc991e6c87 100644 --- a/plugins/Scriver/src/msgs.h +++ b/plugins/Scriver/src/msgs.h @@ -119,7 +119,7 @@ struct SrmmWindowData : public CommonWindowData MCONTACT hContact;
int tabId;
HWND hwndParent;
- HANDLE hDbEventFirst, hDbEventLast, hDbUnreadEventFirst;
+ MEVENT hDbEventFirst, hDbEventLast, hDbUnreadEventFirst;
int splitterPos;
int desiredInputAreaHeight;
SIZE toolbarSize;
@@ -225,7 +225,7 @@ INT_PTR CALLBACK ErrorDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar int DbEventIsShown(DBEVENTINFO &dbei);
int DbEventIsCustomForMsgWindow(DBEVENTINFO *dbei);
int DbEventIsMessageOrCustom(DBEVENTINFO *dbei);
-void StreamInEvents(HWND hwndDlg, HANDLE hDbEventFirst, int count, int fAppend);
+void StreamInEvents(HWND hwndDlg, MEVENT hDbEventFirst, int count, int fAppend);
void LoadMsgLogIcons(void);
void FreeMsgLogIcons(void);
TCHAR *GetNickname(MCONTACT hContact, const char *szProto);
diff --git a/plugins/SimpleAR/src/Main.cpp b/plugins/SimpleAR/src/Main.cpp index 8f465e07f7..1f913fd0fc 100644 --- a/plugins/SimpleAR/src/Main.cpp +++ b/plugins/SimpleAR/src/Main.cpp @@ -181,11 +181,9 @@ TCHAR* StrReplace (TCHAR* Search, TCHAR* Replace, TCHAR* Resource) return Resource;
}
-INT addEvent(WPARAM hContact, LPARAM lParam)
+INT addEvent(WPARAM hContact, LPARAM hDBEvent)
{
- HANDLE hDBEvent = (HANDLE)lParam;
BOOL fEnabled = db_get_b(NULL, protocolname, KEY_ENABLED, 1);
-
if (!fEnabled || !hContact || !hDBEvent)
return FALSE; /// unspecifyed error
diff --git a/plugins/StatusChange/src/main.cpp b/plugins/StatusChange/src/main.cpp index 56b307c369..a012ac24ec 100644 --- a/plugins/StatusChange/src/main.cpp +++ b/plugins/StatusChange/src/main.cpp @@ -43,9 +43,8 @@ void LoadOptions() Options.IfOuttolunch = (BOOL)db_get_b(NULL, PLUGINNAME, "IfOuttolunch", FALSE);
}
-static int StatusChangeGetMessage(WPARAM wParam, LPARAM lParam)
+static int StatusChangeGetMessage(WPARAM wParam, LPARAM hDbEvent)
{
- HANDLE hDbEvent = (HANDLE)lParam;
int status;
BOOL read, send, change_status;
diff --git a/plugins/StopSpamMod/src/stopspam.cpp b/plugins/StopSpamMod/src/stopspam.cpp index 2db2d3ef6b..bcb22c885d 100755 --- a/plugins/StopSpamMod/src/stopspam.cpp +++ b/plugins/StopSpamMod/src/stopspam.cpp @@ -23,10 +23,8 @@ MIRANDA_HOOK_EVENT(ME_DB_CONTACT_ADDED, w, l) return 0; } -MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, hContact, lParam) +MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, hContact, hDbEvent) { - HANDLE hDbEvent = (HANDLE)lParam; - DBEVENTINFO dbei = { sizeof(dbei) }; dbei.cbBlob = db_event_getBlobSize(hDbEvent); if (dbei.cbBlob == -1) diff --git a/plugins/StopSpamPlus/src/events.cpp b/plugins/StopSpamPlus/src/events.cpp index 4d828d5c1c..c55e9c09ee 100644 --- a/plugins/StopSpamPlus/src/events.cpp +++ b/plugins/StopSpamPlus/src/events.cpp @@ -2,7 +2,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam)
{
- HANDLE hDbEvent = (HANDLE)lParam;
+ MEVENT hDbEvent = (MEVENT)lParam;
DBEVENTINFO dbei = {0};
dbei.cbSize = sizeof(dbei);
diff --git a/plugins/StopSpamPlus/src/utils.cpp b/plugins/StopSpamPlus/src/utils.cpp index 4f4e1b407d..b8dd8371e5 100644 --- a/plugins/StopSpamPlus/src/utils.cpp +++ b/plugins/StopSpamPlus/src/utils.cpp @@ -14,7 +14,7 @@ tstring &GetDlgItemString(HWND hwnd, int id) bool IsExistMyMessage(MCONTACT hContact)
{
- HANDLE hDbEvent = db_event_first(hContact);
+ MEVENT hDbEvent = db_event_first(hContact);
while(hDbEvent){
DBEVENTINFO dbei = { sizeof(dbei) };
if (db_event_get(hDbEvent, &dbei))
diff --git a/plugins/TabSRMM/src/chat/services.cpp b/plugins/TabSRMM/src/chat/services.cpp index 6599c2859e..9c5e1e72f8 100644 --- a/plugins/TabSRMM/src/chat/services.cpp +++ b/plugins/TabSRMM/src/chat/services.cpp @@ -100,7 +100,7 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT newData.iActivate = bActivateTab;
pContainer->iChilds++;
newData.bWantPopup = bWantPopup;
- newData.hdbEvent = (HANDLE)si;
+ newData.si = si;
HWND hwndNew = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_CHANNEL), GetDlgItem(pContainer->hwnd, 1159), RoomWndProc, (LPARAM)&newData);
if (pContainer->dwFlags & CNT_SIDEBAR) {
TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwndNew, GWLP_USERDATA);
diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp index a67f364f99..f3550e2061 100644 --- a/plugins/TabSRMM/src/chat/window.cpp +++ b/plugins/TabSRMM/src/chat/window.cpp @@ -1774,10 +1774,9 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar case WM_INITDIALOG: { TNewWindowData *newData = (TNewWindowData*)lParam; - si = (SESSION_INFO*)newData->hdbEvent; TWindowData *dat = (TWindowData*)mir_calloc( sizeof(TWindowData)); - dat->si = si; + dat->si = si = newData->si; dat->hContact = si->hContact; dat->szProto = GetContactProto(si->hContact); dat->bType = SESSIONTYPE_CHAT; diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp index af53cbdda6..3faa91cc84 100644 --- a/plugins/TabSRMM/src/eventpopups.cpp +++ b/plugins/TabSRMM/src/eventpopups.cpp @@ -556,7 +556,7 @@ static TCHAR* GetPreviewT(WORD eventType, DBEVENTINFO* dbe) }
}
-static int PopupUpdateT(MCONTACT hContact, HANDLE hEvent)
+static int PopupUpdateT(MCONTACT hContact, MEVENT hEvent)
{
PLUGIN_DATAT *pdata = const_cast<PLUGIN_DATAT *>(PU_GetByContact(hContact));
if (!pdata)
@@ -627,7 +627,7 @@ static int PopupUpdateT(MCONTACT hContact, HANDLE hEvent) return 0;
}
-static int PopupShowT(NEN_OPTIONS *pluginOptions, MCONTACT hContact, HANDLE hEvent, UINT eventType, HWND hContainer)
+static int PopupShowT(NEN_OPTIONS *pluginOptions, MCONTACT hContact, MEVENT hEvent, UINT eventType, HWND hContainer)
{
//there has to be a maximum number of popups shown at the same time
if (arPopupList.getCount() >= MAX_POPUPS)
@@ -820,7 +820,7 @@ int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szPro return 0;
}
-int tabSRMM_ShowPopup(MCONTACT hContact, HANDLE hDbEvent, WORD eventType, int windowOpen, TContainerData *pContainer, HWND hwndChild, const char *szProto)
+int tabSRMM_ShowPopup(MCONTACT hContact, MEVENT hDbEvent, WORD eventType, int windowOpen, TContainerData *pContainer, HWND hwndChild, const char *szProto)
{
if (nen_options.iDisable) // no popups at all. Period
return 0;
diff --git a/plugins/TabSRMM/src/functions.h b/plugins/TabSRMM/src/functions.h index c09dd21f2e..fa5ae612fc 100644 --- a/plugins/TabSRMM/src/functions.h +++ b/plugins/TabSRMM/src/functions.h @@ -70,7 +70,7 @@ void TSAPI HandleMenuEntryFromhContact(MCONTACT iSelection); BOOL TSAPI IsUtfSendAvailable(MCONTACT hContact);
HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, MCONTACT hContact, int isSend,
- const char *pszInitialText, BOOL bActivateTAb, BOOL bPopupContainer, BOOL bWantPopup, HANDLE hdbEvent);
+ const char *pszInitialText, BOOL bActivateTAb, BOOL bPopupContainer, BOOL bWantPopup, MEVENT hdbEvent);
int TSAPI ActivateTabFromHWND(HWND hwndTab, HWND hwnd);
void TSAPI FlashContainer(TContainerData *pContainer, int iMode, int iNum);
void TSAPI CreateImageList(BOOL bInitial);
@@ -123,8 +123,8 @@ int DbEventIsForMsgWindow(DBEVENTINFO *dbei); int TSAPI InitOptions(void);
int TSAPI DbEventIsShown(DBEVENTINFO *dbei);
-void TSAPI StreamInEvents(HWND hwndDlg,HANDLE hDbEventFirst,int count,int fAppend, DBEVENTINFO *dbei_s);
-void TSAPI LoadLogfont(int i,LOGFONTA *lf,COLORREF *colour, char *szModule);
+void TSAPI StreamInEvents(HWND hwndDlg, MEVENT hDbEventFirst, int count, int fAppend, DBEVENTINFO *dbei_s);
+void TSAPI LoadLogfont(int i, LOGFONTA *lf, COLORREF *colour, char *szModule);
// custom tab control
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index b58e48aeee..7f5280b9b3 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -1560,7 +1560,7 @@ void TSAPI DM_EventAdded(TWindowData *dat, WPARAM hContact, LPARAM lParam) { TContainerData *m_pContainer = dat->pContainer; HWND hwndDlg = dat->hwnd, hwndContainer = m_pContainer->hwnd, hwndTab = GetParent(dat->hwnd); - HANDLE hDbEvent = (HANDLE)lParam; + MEVENT hDbEvent = (MEVENT)lParam; DBEVENTINFO dbei = { sizeof(dbei) }; db_event_get(hDbEvent, &dbei); @@ -1610,10 +1610,10 @@ void TSAPI DM_EventAdded(TWindowData *dat, WPARAM hContact, LPARAM lParam) if (hDbEvent != dat->hDbEventFirst) { if (!(dat->dwFlagsEx & MWF_SHOW_SCROLLINGDISABLED)) - SendMessage(hwndDlg, DM_APPENDTOLOG, lParam, 0); + SendMessage(hwndDlg, DM_APPENDTOLOG, hDbEvent, 0); else { if (dat->iNextQueuedEvent >= dat->iEventQueueSize) { - dat->hQueuedEvents = (HANDLE*)mir_realloc(dat->hQueuedEvents, (dat->iEventQueueSize + 10) * sizeof(HANDLE)); + dat->hQueuedEvents = (MEVENT*)mir_realloc(dat->hQueuedEvents, (dat->iEventQueueSize + 10) * sizeof(MEVENT)); dat->iEventQueueSize += 10; } dat->hQueuedEvents[dat->iNextQueuedEvent++] = hDbEvent; diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index ccc83a7940..0db994d7bb 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -551,7 +551,7 @@ void CGlobals::RestoreUnreadMessageAlerts(void) if (db_get_dw(hContact, "SendLater", "count", 0))
sendLater->addContact(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)) {
DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get(hDbEvent, &dbei);
if (!dbei.markedRead() && dbei.eventType == EVENTTYPE_MESSAGE) {
diff --git a/plugins/TabSRMM/src/hotkeyhandler.cpp b/plugins/TabSRMM/src/hotkeyhandler.cpp index 4b21acf3da..d87c22c912 100644 --- a/plugins/TabSRMM/src/hotkeyhandler.cpp +++ b/plugins/TabSRMM/src/hotkeyhandler.cpp @@ -428,7 +428,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP // sent from the popup to "dismiss" the event. we should do this in the main thread
case DM_REMOVECLISTEVENT:
CallService(MS_CLIST_REMOVEEVENT, wParam, lParam);
- db_event_markRead(wParam, (HANDLE)lParam);
+ db_event_markRead(wParam, lParam);
return 0;
case DM_SETLOCALE:
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp index f67a9021c4..bc905e8c68 100644 --- a/plugins/TabSRMM/src/mim.cpp +++ b/plugins/TabSRMM/src/mim.cpp @@ -186,8 +186,8 @@ bool CMimAPI::getAeroState() void CMimAPI::InitAPI() { - DWORD dwVer = LOWORD(GetVersion());
- m_winVer = MAKEWORD(HIBYTE(dwVer), LOBYTE(dwVer));
+ DWORD dwVer = LOWORD(GetVersion()); + m_winVer = MAKEWORD(HIBYTE(dwVer), LOBYTE(dwVer)); m_hUxTheme = 0; @@ -313,7 +313,7 @@ int CMimAPI::TypingMessage(WPARAM hContact, LPARAM mode) if (fShowOnClist) { CLISTEVENT cle = { sizeof(cle) }; cle.hContact = hContact; - cle.hDbEvent = (HANDLE)1; + cle.hDbEvent = 1; cle.flags = CLEF_ONLYAFEW | CLEF_TCHAR; cle.hIcon = PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING]; cle.pszService = "SRMsg/TypingMessage"; @@ -393,15 +393,15 @@ int CMimAPI::PrebuildContactMenu(WPARAM hContact, LPARAM) // this handler POSTs the event to the message window procedure - so it is fast and can exit quickly which will // improve the overall responsiveness when receiving messages. -int CMimAPI::DispatchNewEvent(WPARAM hContact, LPARAM lParam) +int CMimAPI::DispatchNewEvent(WPARAM hContact, LPARAM hDbEvent) { if (hContact) { - Utils::sendContactMessage(hContact, HM_DBEVENTADDED, hContact, lParam); + Utils::sendContactMessage(hContact, HM_DBEVENTADDED, hContact, hDbEvent); // we're in meta and an event belongs to a sub - MCONTACT hReal = db_event_getContact(HANDLE(lParam)); + MCONTACT hReal = db_event_getContact(hDbEvent); if (hReal != hContact) - Utils::sendContactMessage(hReal, HM_DBEVENTADDED, hContact, lParam); + Utils::sendContactMessage(hReal, HM_DBEVENTADDED, hContact, hDbEvent); } return 0; } @@ -413,11 +413,10 @@ int CMimAPI::DispatchNewEvent(WPARAM hContact, LPARAM lParam) // // if a session is already created, it just does nothing and DispatchNewEvent() will take care. -int CMimAPI::MessageEventAdded(WPARAM hContact, LPARAM lParam) +int CMimAPI::MessageEventAdded(WPARAM hContact, LPARAM hDbEvent) { TCHAR szName[CONTAINER_NAMELEN + 1]; - HANDLE hDbEvent = (HANDLE)lParam; DBEVENTINFO dbei = { sizeof(dbei) }; db_event_get(hDbEvent, &dbei); diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 36cce39ada..dc187812fd 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -1243,7 +1243,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP dat->sendMode |= dat->hContact == 0 ? SMODE_MULTIPLE : 0; dat->sendMode |= M.GetByte(dat->hContact, "no_ack", 0) ? SMODE_NOACK : 0; - dat->hQueuedEvents = (HANDLE*)mir_calloc(sizeof(HANDLE)* EVENT_QUEUE_SIZE); + dat->hQueuedEvents = (MEVENT*)mir_calloc(sizeof(MEVENT)* EVENT_QUEUE_SIZE); dat->iEventQueueSize = EVENT_QUEUE_SIZE; dat->iCurrentQueueError = -1; @@ -1252,7 +1252,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP dat->maxHistory = M.GetDword(dat->hContact, "maxhist", M.GetDword("maxhist", 0)); dat->curHistory = 0; if (dat->maxHistory) - dat->hHistoryEvents = (HANDLE*)mir_alloc(dat->maxHistory * sizeof(HANDLE)); + dat->hHistoryEvents = (MEVENT*)mir_alloc(dat->maxHistory * sizeof(MEVENT)); else dat->hHistoryEvents = NULL; @@ -1403,7 +1403,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP EnableSendButton(dat, TRUE); } - for (HANDLE hdbEvent = db_event_last(dat->hContact); hdbEvent; hdbEvent = db_event_prev(dat->hContact, hdbEvent)) { + for (MEVENT hdbEvent = db_event_last(dat->hContact); hdbEvent; hdbEvent = db_event_prev(dat->hContact, hdbEvent)) { DBEVENTINFO dbei = { sizeof(dbei) }; db_event_get(hdbEvent, &dbei); if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT)) { @@ -2321,15 +2321,15 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case DM_APPENDMCEVENT: if (dat->hContact == db_mc_getMeta(wParam) && dat->hDbEventFirst == NULL) { - dat->hDbEventFirst = (HANDLE)lParam; + dat->hDbEventFirst = lParam; SendMessage(dat->hwnd, DM_REMAKELOG, 0, 0); } - else if (dat->hContact == wParam && db_mc_isSub(wParam) && db_event_getContact(HANDLE(lParam)) != wParam) - StreamInEvents(hwndDlg, (HANDLE)lParam, 1, 1, NULL); + else if (dat->hContact == wParam && db_mc_isSub(wParam) && db_event_getContact(lParam) != wParam) + StreamInEvents(hwndDlg, lParam, 1, 1, NULL); return 0; case DM_APPENDTOLOG: - StreamInEvents(hwndDlg, (HANDLE)wParam, 1, 1, NULL); + StreamInEvents(hwndDlg, wParam, 1, 1, NULL); return 0; // replays queued events after the message log has been frozen for a while @@ -2782,7 +2782,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP CHARRANGE sel; SETTEXTEX stx = {ST_SELECTION, 1200}; - HANDLE hDBEvent = 0; + MEVENT hDBEvent = 0; if (dat->hwndIEView || dat->hwndHPP) { // IEView quoting support.. TCHAR *selected = 0, *szQuoted = 0; diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index 748e1eda13..5da388058e 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -757,7 +757,7 @@ void TSAPI ShowPicture(TWindowData *dat, BOOL showNewPic) SendMessage(hwndDlg, WM_SIZE, 0, 0);
}
-void TSAPI FlashOnClist(HWND hwndDlg, TWindowData *dat, HANDLE hEvent, DBEVENTINFO *dbei)
+void TSAPI FlashOnClist(HWND hwndDlg, TWindowData *dat, MEVENT hEvent, DBEVENTINFO *dbei)
{
dat->dwTickLastEvent = GetTickCount();
@@ -1179,7 +1179,7 @@ void TSAPI FindFirstEvent(TWindowData *dat) switch (historyMode) {
case LOADHISTORY_COUNT:
int i;
- HANDLE hPrevEvent;
+ MEVENT hPrevEvent;
{
DBEVENTINFO dbei = { sizeof(dbei) };
// ability to load only current session's history
@@ -1213,7 +1213,7 @@ void TSAPI FindFirstEvent(TWindowData *dat) DWORD firstTime = dbei.timestamp - 60 * db_get_w(NULL, SRMSGMOD, SRMSGSET_LOADTIME, SRMSGDEFSET_LOADTIME);
for (;;) {
- HANDLE hPrevEvent;
+ MEVENT hPrevEvent;
if (dat->hDbEventFirst == NULL)
hPrevEvent = db_event_last(dat->hContact);
else
diff --git a/plugins/TabSRMM/src/msgdlgutils.h b/plugins/TabSRMM/src/msgdlgutils.h index ff0bdfd815..4eb5d25a82 100644 --- a/plugins/TabSRMM/src/msgdlgutils.h +++ b/plugins/TabSRMM/src/msgdlgutils.h @@ -43,7 +43,7 @@ void TSAPI UpdateReadChars(const TWindowData *dat); void TSAPI ShowPicture(TWindowData *dat, BOOL showNewPic);
void TSAPI AdjustBottomAvatarDisplay(TWindowData *dat);
void TSAPI SetDialogToType(HWND hwndDlg);
-void TSAPI FlashOnClist(HWND hwndDlg, TWindowData *dat, HANDLE hEvent, DBEVENTINFO *dbei);
+void TSAPI FlashOnClist(HWND hwndDlg, TWindowData *dat, MEVENT hEvent, DBEVENTINFO *dbei);
char* TSAPI Message_GetFromStream(HWND hwndDlg, const TWindowData *dat, DWORD dwPassedFlags);
BOOL TSAPI DoRtfToTags(TCHAR * pszText, const TWindowData *dat);
void TSAPI GetMYUIN(TWindowData *dat);
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index c8ef054993..098ea3c312 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -87,7 +87,7 @@ static HICON Logicons[NR_LOGICONS]; struct LogStreamData {
int stage;
MCONTACT hContact;
- HANDLE hDbEvent, hDbEventLast;
+ MEVENT hDbEvent, hDbEventLast;
char *buffer;
int bufferOffset, bufferLen;
int eventsToInsert;
@@ -443,7 +443,7 @@ int DbEventIsForMsgWindow(DBEVENTINFO *dbei) return et && (et->flags & DETF_MSGWINDOW);
}
-static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, HANDLE hDbEvent, LogStreamData *streamData)
+static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, MEVENT hDbEvent, LogStreamData *streamData)
{
HANDLE hTimeZone = NULL;
BOOL skipToNext = FALSE, skipFont = FALSE;
@@ -1201,7 +1201,7 @@ static void ReplaceIcons(HWND hwndDlg, TWindowData *dat, LONG startAt, int fAppe }
}
-void TSAPI StreamInEvents(HWND hwndDlg, HANDLE hDbEventFirst, int count, int fAppend, DBEVENTINFO *dbei_s)
+void TSAPI StreamInEvents(HWND hwndDlg, MEVENT hDbEventFirst, int count, int fAppend, DBEVENTINFO *dbei_s)
{
TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
CHARRANGE oldSel, sel;
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index 56522f86fe..68a99e98e3 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -447,7 +447,7 @@ int TSAPI ActivateExistingTab(TContainerData *pContainer, HWND hwndChild) // bActivateTab: make the new tab the active one // bPopupContainer: restore container if it was minimized, otherwise flash it... -HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, MCONTACT hContact, int isSend, const char *pszInitialText, BOOL bActivateTab, BOOL bPopupContainer, BOOL bWantPopup, HANDLE hdbEvent) +HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, MCONTACT hContact, int isSend, const char *pszInitialText, BOOL bActivateTab, BOOL bPopupContainer, BOOL bWantPopup, MEVENT hdbEvent) { if (M.FindWindow(hContact) != 0) { _DebugPopup(hContact, _T("Warning: trying to create duplicate window")); diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h index a4db3ef8b4..116198c758 100644 --- a/plugins/TabSRMM/src/msgs.h +++ b/plugins/TabSRMM/src/msgs.h @@ -260,7 +260,7 @@ struct TWindowData SESSION_INFO *si;
RECT rcNick, rcUIN, rcStatus, rcPic;
- HANDLE hDbEventFirst, hDbEventLast;
+ MEVENT hDbEventFirst, hDbEventLast;
int sendMode;
int splitterY, originalSplitterY, dynaSplitter, savedSplitter, savedSplitY, savedDynaSplit;
int multiSplitterX;
@@ -287,10 +287,10 @@ struct TWindowData DWORD dwLastActivity;
int iOpenJobs;
int iCurrentQueueError;
- HANDLE hFlashingEvent;
+ MEVENT hFlashingEvent;
TCHAR myUin[80];
int SendFormat;
- HANDLE *hQueuedEvents;
+ MEVENT *hQueuedEvents;
int iNextQueuedEvent;
#define EVENT_QUEUE_SIZE 10
int iEventQueueSize;
@@ -304,7 +304,7 @@ struct TWindowData DWORD panelStatusCX;
COLORREF inputbg;
avatarCacheEntry *ace, *ownAce;
- HANDLE *hHistoryEvents;
+ MEVENT *hHistoryEvents;
int maxHistory, curHistory;
HANDLE hTheme, hThemeIP, hThemeToolbar;
char szMicroLf[128];
@@ -417,9 +417,12 @@ struct TNewWindowData int iActivate;
TCITEM item;
BOOL bWantPopup;
- HANDLE hdbEvent;
HKL hkl;
+ union {
+ MEVENT hdbEvent;
+ SESSION_INFO *si;
+ };
TContainerData *pContainer;
};
diff --git a/plugins/TabSRMM/src/nen.h b/plugins/TabSRMM/src/nen.h index e86c57a610..72ab2ef763 100644 --- a/plugins/TabSRMM/src/nen.h +++ b/plugins/TabSRMM/src/nen.h @@ -39,7 +39,7 @@ #define MODULE "tabSRMM_NEN"
-int tabSRMM_ShowPopup(MCONTACT hContact, HANDLE hDbEvent, WORD eventType, int windowOpen, TContainerData *pContainer, HWND hwndChild, const char *szProto);
+int tabSRMM_ShowPopup(MCONTACT hContact, MEVENT hDbEvent, WORD eventType, int windowOpen, TContainerData *pContainer, HWND hwndChild, const char *szProto);
#define DEFAULT_COLBACK RGB(255,255,128)
#define DEFAULT_COLTEXT RGB(0,0,0)
@@ -132,7 +132,7 @@ struct NEN_OPTIONS struct EVENT_DATAT
{
- HANDLE hEvent;
+ MEVENT hEvent;
TCHAR tszText[MAX_SECONDLINE + 2];
DWORD timestamp;
};
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp index c3b3b6480d..c4a6da240b 100644 --- a/plugins/TabSRMM/src/sendqueue.cpp +++ b/plugins/TabSRMM/src/sendqueue.cpp @@ -712,7 +712,7 @@ inform_and_discard: NotifyEventHooks(PluginConfig.m_event_WriteEvent, 0, (LPARAM)&evt); job.szSendBuffer = (char*)dbei.pBlob; - HANDLE hNewEvent = db_event_add(job.hContact, &dbei); + MEVENT hNewEvent = db_event_add(job.hContact, &dbei); if (m_pContainer) if (!nen_options.iNoSounds && !(m_pContainer->dwFlags & CNT_NOSOUND)) diff --git a/plugins/TipperYM/src/subst.cpp b/plugins/TipperYM/src/subst.cpp index 97559c11da..4bf6c42d4c 100644 --- a/plugins/TipperYM/src/subst.cpp +++ b/plugins/TipperYM/src/subst.cpp @@ -121,7 +121,7 @@ void StripBBCodesInPlace(TCHAR *swzText) DWORD LastMessageTimestamp(MCONTACT hContact, bool received) { - for (HANDLE hDbEvent = db_event_last(hContact); hDbEvent; hDbEvent = db_event_prev(hContact, hDbEvent)) { + for (MEVENT hDbEvent = db_event_last(hContact); hDbEvent; hDbEvent = db_event_prev(hContact, hDbEvent)) { DBEVENTINFO dbei = { sizeof(dbei) }; db_event_get(hDbEvent, &dbei); if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT) == received) @@ -168,7 +168,7 @@ bool UidName(char *szProto, TCHAR *buff, int bufflen) TCHAR *GetLastMessageText(MCONTACT hContact, bool received) { - for (HANDLE hDbEvent = db_event_last(hContact); hDbEvent; hDbEvent = db_event_prev(hContact, hDbEvent)) { + for (MEVENT hDbEvent = db_event_last(hContact); hDbEvent; hDbEvent = db_event_prev(hContact, hDbEvent)) { DBEVENTINFO dbei = { sizeof(dbei) }; db_event_get(hDbEvent, &dbei); if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT) == received) { @@ -383,7 +383,7 @@ bool GetSysSubstText(MCONTACT hContact, TCHAR *swzRawSpec, TCHAR *buff, int buff dwNewTs = dwLastTs; - HANDLE dbe = db_event_last(hTmpContact); + MEVENT dbe = db_event_last(hTmpContact); while (dbe != NULL) { DBEVENTINFO dbei = { sizeof(dbei) }; if (!db_event_get(dbe, &dbei)) { diff --git a/plugins/TipperYM/src/tipper.cpp b/plugins/TipperYM/src/tipper.cpp index 9259bb827d..ca273e1f13 100644 --- a/plugins/TipperYM/src/tipper.cpp +++ b/plugins/TipperYM/src/tipper.cpp @@ -109,7 +109,7 @@ int SettingChanged(WPARAM hContact, LPARAM lParam) int EventDeleted(WPARAM wParam, LPARAM lParam)
{
DBEVENTINFO dbei = { sizeof(dbei) };
- if (!db_event_get((HANDLE)lParam, &dbei))
+ if (!db_event_get(lParam, &dbei))
if (dbei.eventType == EVENTTYPE_MESSAGE)
db_unset(wParam, MODULE, "LastCountTS");
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp index c33bc8aaf8..0e409bc24a 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp +++ b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp @@ -401,7 +401,7 @@ BYTE CExImContactXML::ExportEvents() DWORD cbEventBuf = 0, dwNumEventsAdded = 0;
// read out all events for the current contact
- for (HANDLE hDbEvent = db_event_first(_hContact); hDbEvent != NULL; hDbEvent = db_event_next(_hContact, hDbEvent)) {
+ for (MEVENT hDbEvent = db_event_first(_hContact); hDbEvent != NULL; hDbEvent = db_event_next(_hContact, hDbEvent)) {
DBEVENTINFO dbei = { sizeof(DBEVENTINFO) };
if (DB::Event::GetInfoWithData(hDbEvent, &dbei))
continue;
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactXML.h b/plugins/UserInfoEx/src/ex_import/classExImContactXML.h index b88d1b8097..e989484072 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactXML.h +++ b/plugins/UserInfoEx/src/ex_import/classExImContactXML.h @@ -47,9 +47,9 @@ enum EError { class CExImContactXML : public CExImContactBase {
- CFileXml* _pXmlFile; // the xmlfile
- TiXmlElement* _xmlNode; // xmlnode with contact information
- HANDLE _hEvent;
+ CFileXml *_pXmlFile; // the xmlfile
+ TiXmlElement *_xmlNode; // xmlnode with contact information
+ MEVENT _hEvent;
BYTE IsContactInfo(LPCSTR pszKey);
diff --git a/plugins/UserInfoEx/src/mir_db.cpp b/plugins/UserInfoEx/src/mir_db.cpp index c55a2f4a43..972e9790ba 100644 --- a/plugins/UserInfoEx/src/mir_db.cpp +++ b/plugins/UserInfoEx/src/mir_db.cpp @@ -80,7 +80,7 @@ BYTE Delete(MCONTACT hContact) DWORD WhenAdded(DWORD dwUIN, LPCSTR pszProto)
{
DBEVENTINFO dbei = { sizeof(dbei) };
- for (HANDLE edbe = db_event_first(NULL); edbe != NULL; edbe = db_event_next(NULL, edbe)) {
+ for (MEVENT edbe = db_event_first(NULL); edbe != NULL; edbe = db_event_next(NULL, edbe)) {
// get eventtype and compare
if (!DB::Event::GetInfo(edbe, &dbei) && dbei.eventType == EVENTTYPE_ADDED) {
if (!DB::Event::GetInfoWithData(edbe, &dbei)) {
@@ -553,7 +553,7 @@ namespace Event { * @retval nonezero - failure
**/
-bool GetInfo(HANDLE hEvent, DBEVENTINFO *dbei)
+bool GetInfo(MEVENT hEvent, DBEVENTINFO *dbei)
{
dbei->cbSize = sizeof(DBEVENTINFO);
dbei->cbBlob = 0;
@@ -571,7 +571,7 @@ bool GetInfo(HANDLE hEvent, DBEVENTINFO *dbei) * @retval 1 - failure
**/
-bool GetInfoWithData(HANDLE hEvent, DBEVENTINFO *dbei)
+bool GetInfoWithData(MEVENT hEvent, DBEVENTINFO *dbei)
{
dbei->cbSize = sizeof(DBEVENTINFO);
if (!dbei->cbBlob) {
@@ -601,7 +601,7 @@ bool GetInfoWithData(HANDLE hEvent, DBEVENTINFO *dbei) * @retval timestamp
**/
-DWORD TimeOf(HANDLE hEvent)
+DWORD TimeOf(MEVENT hEvent)
{
DBEVENTINFO dbei;
if (!GetInfo(hEvent, &dbei))
@@ -648,7 +648,7 @@ static FORCEINLINE bool IsEqual(const DBEVENTINFO *d1, const DBEVENTINFO *d2, bo *
**/
-bool Exists(MCONTACT hContact, HANDLE& hDbExistingEvent, DBEVENTINFO *dbei)
+bool Exists(MCONTACT hContact, MEVENT& hDbExistingEvent, DBEVENTINFO *dbei)
{
bool result = false;
DBEVENTINFO edbei;
@@ -670,7 +670,7 @@ bool Exists(MCONTACT hContact, HANDLE& hDbExistingEvent, DBEVENTINFO *dbei) }
}
}
- HANDLE edbe = db_event_last(hContact);
+ MEVENT edbe = db_event_last(hContact);
if (edbe == hDbExistingEvent)
return FALSE;
@@ -678,8 +678,8 @@ bool Exists(MCONTACT hContact, HANDLE& hDbExistingEvent, DBEVENTINFO *dbei) }
}
if (hDbExistingEvent) {
- HANDLE sdbe = hDbExistingEvent;
- for (HANDLE edbe = sdbe; edbe && !GetInfo(edbe, &edbei) && (dbei->timestamp <= edbei.timestamp); edbe = db_event_prev(hContact, edbe)) {
+ MEVENT sdbe = hDbExistingEvent;
+ for (MEVENT edbe = sdbe; edbe && !GetInfo(edbe, &edbei) && (dbei->timestamp <= edbei.timestamp); edbe = db_event_prev(hContact, edbe)) {
hDbExistingEvent = edbe;
//compare without data (faster)
if ( result = IsEqual(dbei, &edbei, false)) {
@@ -695,7 +695,7 @@ bool Exists(MCONTACT hContact, HANDLE& hDbExistingEvent, DBEVENTINFO *dbei) } /*end for*/
if (!result) {
- for (HANDLE edbe = db_event_next(hContact, sdbe); edbe && !GetInfo(edbe, &edbei) && (dbei->timestamp >= edbei.timestamp); edbe = db_event_next(hContact, edbe)) {
+ for (MEVENT edbe = db_event_next(hContact, sdbe); edbe && !GetInfo(edbe, &edbei) && (dbei->timestamp >= edbei.timestamp); edbe = db_event_next(hContact, edbe)) {
hDbExistingEvent = edbe;
//compare without data (faster)
if (result = IsEqual(dbei, &edbei, false)) {
diff --git a/plugins/UserInfoEx/src/mir_db.h b/plugins/UserInfoEx/src/mir_db.h index a11d01dca1..adb8ef8927 100644 --- a/plugins/UserInfoEx/src/mir_db.h +++ b/plugins/UserInfoEx/src/mir_db.h @@ -110,10 +110,10 @@ namespace Variant { namespace Event {
HANDLE FindLast(MCONTACT hContact);
- bool GetInfo(HANDLE hEvent, DBEVENTINFO *dbei);
- bool GetInfoWithData(HANDLE hEvent, DBEVENTINFO *dbei);
- DWORD GetTime(HANDLE hEvent);
- bool Exists(MCONTACT hContact, HANDLE& hDbExistingEvent, DBEVENTINFO *dbei);
+ bool GetInfo(MEVENT hEvent, DBEVENTINFO *dbei);
+ bool GetInfoWithData(MEVENT hEvent, DBEVENTINFO *dbei);
+ DWORD GetTime(MEVENT hEvent);
+ bool Exists(MCONTACT hContact, MEVENT& hDbExistingEvent, DBEVENTINFO *dbei);
} /* namespace Events */
/**
diff --git a/plugins/Variables/src/parse_miranda.cpp b/plugins/Variables/src/parse_miranda.cpp index 01b7581969..d736147d23 100644 --- a/plugins/Variables/src/parse_miranda.cpp +++ b/plugins/Variables/src/parse_miranda.cpp @@ -500,7 +500,7 @@ static BOOL isValidDbEvent(DBEVENTINFO *dbe, int flags) return (bEventType && bEventFlags);
}
-static HANDLE findDbEvent(MCONTACT hContact, HANDLE hDbEvent, int flags)
+static MEVENT findDbEvent(MCONTACT hContact, MEVENT hDbEvent, int flags)
{
DBEVENTINFO dbe;
BOOL bEventOk;
@@ -526,7 +526,7 @@ static HANDLE findDbEvent(MCONTACT hContact, HANDLE hDbEvent, int flags) hDbEvent = db_event_prev(hContact, hDbEvent);
}
else {
- HANDLE hMatchEvent, hSearchEvent;
+ MEVENT hMatchEvent, hSearchEvent;
DWORD matchTimestamp, priorTimestamp;
hMatchEvent = hSearchEvent = NULL;
@@ -664,7 +664,7 @@ static TCHAR* parseDbEvent(ARGUMENTSINFO *ai) else if (ci.hContacts != NULL)
mir_free(ci.hContacts);
- HANDLE hDbEvent = findDbEvent(hContact, NULL, flags);
+ MEVENT hDbEvent = findDbEvent(hContact, NULL, flags);
if (hDbEvent == NULL)
return NULL;
diff --git a/plugins/WinterSpeak/src/EventInformation.cpp b/plugins/WinterSpeak/src/EventInformation.cpp index 21c90a7b85..f79c03eb0e 100644 --- a/plugins/WinterSpeak/src/EventInformation.cpp +++ b/plugins/WinterSpeak/src/EventInformation.cpp @@ -23,7 +23,7 @@ EventInformation::~EventInformation() }
//------------------------------------------------------------------------------
-bool EventInformation::isValidEvent(HANDLE event)
+bool EventInformation::isValidEvent(MEVENT event)
{
// clean up the old event
if (m_event_info.pBlob)
diff --git a/plugins/WinterSpeak/src/EventInformation.h b/plugins/WinterSpeak/src/EventInformation.h index 42169d21e9..7ef1d698af 100644 --- a/plugins/WinterSpeak/src/EventInformation.h +++ b/plugins/WinterSpeak/src/EventInformation.h @@ -13,7 +13,7 @@ class EventInformation // Description : is the event valid?
// Return : true = the event is valid
//--------------------------------------------------------------------------
- bool isValidEvent(HANDLE event);
+ bool isValidEvent(MEVENT event);
//--------------------------------------------------------------------------
// Description : get the last event received
@@ -49,5 +49,5 @@ class EventInformation private:
std::map<unsigned short, std::wstring> m_event_strings;
- DBEVENTINFO m_event_info;
+ DBEVENTINFO m_event_info;
};
diff --git a/plugins/WinterSpeak/src/SpeakAnnounce.cpp b/plugins/WinterSpeak/src/SpeakAnnounce.cpp index c7f87b26e8..29407e6fb2 100644 --- a/plugins/WinterSpeak/src/SpeakAnnounce.cpp +++ b/plugins/WinterSpeak/src/SpeakAnnounce.cpp @@ -66,7 +66,7 @@ void SpeakAnnounce::statusChange(DBCONTACTWRITESETTING *write_setting, MCONTACT }
//------------------------------------------------------------------------------
-void SpeakAnnounce::incomingEvent(MCONTACT user, HANDLE event)
+void SpeakAnnounce::incomingEvent(MCONTACT user, MEVENT event)
{
if (!m_event_info.isValidEvent(event))
return;
diff --git a/plugins/WinterSpeak/src/SpeakAnnounce.h b/plugins/WinterSpeak/src/SpeakAnnounce.h index c49223b86a..763f36cce8 100644 --- a/plugins/WinterSpeak/src/SpeakAnnounce.h +++ b/plugins/WinterSpeak/src/SpeakAnnounce.h @@ -17,7 +17,7 @@ public: //--------------------------------------------------------------------------
// Description : handle an event
//--------------------------------------------------------------------------
- void incomingEvent(MCONTACT user, HANDLE event);
+ void incomingEvent(MCONTACT user, MEVENT event);
//--------------------------------------------------------------------------
// Description : handle a protocol state change
diff --git a/plugins/WinterSpeak/src/main.cpp b/plugins/WinterSpeak/src/main.cpp index d6c7d9bbcc..47a432fdc5 100644 --- a/plugins/WinterSpeak/src/main.cpp +++ b/plugins/WinterSpeak/src/main.cpp @@ -53,7 +53,7 @@ int eventStatusChange(WPARAM wParam, LPARAM lParam) //-----------------------------------------------------------------------------
int eventMessageAdded(WPARAM wParam, LPARAM lParam)
{
- g_speak_announce->incomingEvent(MCONTACT(wParam), reinterpret_cast<HANDLE>(lParam));
+ g_speak_announce->incomingEvent(wParam, lParam);
return 0;
}
diff --git a/plugins/XSoundNotify/src/xsn_main.cpp b/plugins/XSoundNotify/src/xsn_main.cpp index d8334bb002..51fb53124e 100644 --- a/plugins/XSoundNotify/src/xsn_main.cpp +++ b/plugins/XSoundNotify/src/xsn_main.cpp @@ -100,7 +100,7 @@ static int ProtoAck(WPARAM, LPARAM lParam) /////////////////////////////////////////////////////////////////////////////////////////
-static bool isReceiveMessage(HANDLE hDbEvent)
+static bool isReceiveMessage(MEVENT hDbEvent)
{
DBEVENTINFO info = { sizeof(info) };
db_event_get(hDbEvent, &info);
@@ -111,7 +111,7 @@ static bool isReceiveMessage(HANDLE hDbEvent) static int ProcessEvent(WPARAM hContact, LPARAM lParam)
{
- if (!isReceiveMessage(HANDLE(lParam)))
+ if (!isReceiveMessage(lParam))
return 0;
isIgnoreSound = db_get_b(hContact, SETTINGSNAME, SETTINGSIGNOREKEY, 0);
diff --git a/plugins/YAMN/src/browser/mailbrowser.cpp b/plugins/YAMN/src/browser/mailbrowser.cpp index 09e51d0d12..644ee20222 100644 --- a/plugins/YAMN/src/browser/mailbrowser.cpp +++ b/plugins/YAMN/src/browser/mailbrowser.cpp @@ -660,8 +660,8 @@ void DoMailActions(HWND hDlg,HACCOUNT ActualAccount,struct CMailNumbers *MN,DWOR cEvent.cbSize = sizeof(CLISTEVENT); cEvent.hContact = ActualAccount->hContact; cEvent.hIcon = g_LoadIconEx(2); - cEvent.hDbEvent = (HANDLE)ActualAccount->hContact; - cEvent.lParam = (LPARAM) ActualAccount->hContact; + cEvent.hDbEvent = ActualAccount->hContact; + cEvent.lParam = ActualAccount->hContact; cEvent.pszService = MS_YAMN_CLISTDBLCLICK; cEvent.pszTooltip = sMsg; cEvent.flags = 0; diff --git a/plugins/YARelay/src/main.cpp b/plugins/YARelay/src/main.cpp index eac2d93b3f..668b5adf65 100644 --- a/plugins/YARelay/src/main.cpp +++ b/plugins/YARelay/src/main.cpp @@ -87,11 +87,8 @@ int ProtoAck(WPARAM wparam,LPARAM lparam) /**
* New event was added into DB.
*/
-static int MessageEventAdded(WPARAM wParam, LPARAM lParam)
+static int MessageEventAdded(WPARAM hContact, LPARAM hDBEvent)
{
- MCONTACT hContact = wParam;
- HANDLE hDBEvent = (HANDLE)lParam;
-
// is the message sender accepted for forwarding
if (hForwardFrom != 0 && hForwardFrom != hContact)
return 0;
diff --git a/plugins/wbOSD/src/events.cpp b/plugins/wbOSD/src/events.cpp index c985e8adf2..b9b287e37f 100644 --- a/plugins/wbOSD/src/events.cpp +++ b/plugins/wbOSD/src/events.cpp @@ -127,10 +127,9 @@ int ContactStatusChanged(WPARAM wParam, LPARAM lParam) return 0;
}
-int HookedNewEvent(WPARAM wParam, LPARAM lParam)
+int HookedNewEvent(WPARAM wParam, LPARAM hDBEvent)
{
logmsg("HookedNewEvent1");
- HANDLE hDBEvent = (HANDLE) lParam;
DBEVENTINFO dbe;
dbe.cbSize = sizeof(dbe);
dbe.cbBlob = db_event_getBlobSize(hDBEvent);
diff --git a/protocols/AimOscar/src/proto.cpp b/protocols/AimOscar/src/proto.cpp index ec60663c33..db4fab68ce 100644 --- a/protocols/AimOscar/src/proto.cpp +++ b/protocols/AimOscar/src/proto.cpp @@ -130,7 +130,7 @@ MCONTACT CAimProto::AddToList(int flags, PROTOSEARCHRESULT* psr) return hContact; //See authrequest for serverside addition
}
-MCONTACT __cdecl CAimProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent)
+MCONTACT __cdecl CAimProto::AddToListByEvent(int flags, int iContact, MEVENT hDbEvent)
{
return NULL;
}
@@ -138,7 +138,7 @@ MCONTACT __cdecl CAimProto::AddToListByEvent(int flags, int iContact, HANDLE hDb ////////////////////////////////////////////////////////////////////////////////////////
// AuthAllow - processes the successful authorization
-int CAimProto::Authorize(HANDLE hDbEvent)
+int CAimProto::Authorize(MEVENT hDbEvent)
{
return 0;
}
@@ -146,7 +146,7 @@ int CAimProto::Authorize(HANDLE hDbEvent) ////////////////////////////////////////////////////////////////////////////////////////
// AuthDeny - handles the unsuccessful authorization
-int CAimProto::AuthDeny(HANDLE hDbEvent, const TCHAR* szReason)
+int CAimProto::AuthDeny(MEVENT hDbEvent, const TCHAR* szReason)
{
return 0;
}
diff --git a/protocols/AimOscar/src/proto.h b/protocols/AimOscar/src/proto.h index 4382514b16..6635cc7a74 100644 --- a/protocols/AimOscar/src/proto.h +++ b/protocols/AimOscar/src/proto.h @@ -29,10 +29,10 @@ struct CAimProto : public PROTO<CAimProto> //====================================================================================
virtual MCONTACT __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr );
- virtual MCONTACT __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent );
+ virtual MCONTACT __cdecl AddToListByEvent( int flags, int iContact, MEVENT hDbEvent );
- virtual int __cdecl Authorize( HANDLE hDbEvent );
- virtual int __cdecl AuthDeny( HANDLE hDbEvent, const TCHAR* szReason );
+ virtual int __cdecl Authorize( MEVENT hDbEvent );
+ virtual int __cdecl AuthDeny( MEVENT hDbEvent, const TCHAR* szReason );
virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT* );
virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR* szMessage );
diff --git a/protocols/Dummy/src/dummy_proto.cpp b/protocols/Dummy/src/dummy_proto.cpp index 72819d962b..310c450ee1 100644 --- a/protocols/Dummy/src/dummy_proto.cpp +++ b/protocols/Dummy/src/dummy_proto.cpp @@ -138,12 +138,12 @@ int CDummyProto::AuthRequest(MCONTACT hContact,const PROTOCHAR *message) return 0; } -int CDummyProto::Authorize(HANDLE hDbEvent) +int CDummyProto::Authorize(MEVENT hDbEvent) { return 1; } -int CDummyProto::AuthDeny(HANDLE hDbEvent, const PROTOCHAR *reason) +int CDummyProto::AuthDeny(MEVENT hDbEvent, const PROTOCHAR *reason) { return 1; } @@ -153,7 +153,7 @@ int CDummyProto::UserIsTyping(MCONTACT hContact, int type) return 1; } -MCONTACT CDummyProto::AddToListByEvent(int flags,int iContact,HANDLE hDbEvent) +MCONTACT CDummyProto::AddToListByEvent(int flags, int iContact, MEVENT hDbEvent) { return NULL; } diff --git a/protocols/Dummy/src/dummy_proto.h b/protocols/Dummy/src/dummy_proto.h index 70bdcd0b19..f6c98ea969 100644 --- a/protocols/Dummy/src/dummy_proto.h +++ b/protocols/Dummy/src/dummy_proto.h @@ -27,10 +27,10 @@ struct CDummyProto : public PROTO<CDummyProto> //==================================================================================== virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr); - virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent); + virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, MEVENT hDbEvent); - virtual int __cdecl Authorize(HANDLE hDbEvent); - virtual int __cdecl AuthDeny(HANDLE hDbEvent, const TCHAR *szReason); + virtual int __cdecl Authorize(MEVENT hDbEvent); + virtual int __cdecl AuthDeny(MEVENT hDbEvent, const TCHAR *szReason); virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*); virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR *szMessage); diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp index f1785af1d5..62c1cd8468 100644 --- a/protocols/FacebookRM/src/proto.cpp +++ b/protocols/FacebookRM/src/proto.cpp @@ -315,7 +315,7 @@ int FacebookProto::AuthRequest(MCONTACT hContact, const PROTOCHAR *) return RequestFriendship(hContact, NULL); } -int FacebookProto::Authorize(HANDLE hDbEvent) +int FacebookProto::Authorize(MEVENT hDbEvent) { if (!hDbEvent || isOffline()) return 1; @@ -327,7 +327,7 @@ int FacebookProto::Authorize(HANDLE hDbEvent) return ApproveFriendship(hContact, NULL); } -int FacebookProto::AuthDeny(HANDLE hDbEvent, const PROTOCHAR *) +int FacebookProto::AuthDeny(MEVENT hDbEvent, const PROTOCHAR *) { if (!hDbEvent || isOffline()) return 1; @@ -817,7 +817,7 @@ INT_PTR FacebookProto::OnCancelFriendshipRequest(WPARAM wParam, LPARAM) return 0; } -MCONTACT FacebookProto::HContactFromAuthEvent(HANDLE hEvent) +MCONTACT FacebookProto::HContactFromAuthEvent(MEVENT hEvent) { DWORD body[2]; DBEVENTINFO dbei = { sizeof(dbei) }; diff --git a/protocols/FacebookRM/src/proto.h b/protocols/FacebookRM/src/proto.h index f5d697e749..4c4a7e64e1 100644 --- a/protocols/FacebookRM/src/proto.h +++ b/protocols/FacebookRM/src/proto.h @@ -69,10 +69,10 @@ public: //PROTO_INTERFACE virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr); - virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent); + virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, MEVENT hDbEvent); - virtual int __cdecl Authorize(HANDLE hDbEvent); - virtual int __cdecl AuthDeny(HANDLE hDbEvent, const PROTOCHAR* szReason); + virtual int __cdecl Authorize(MEVENT hDbEvent); + virtual int __cdecl AuthDeny(MEVENT hDbEvent, const PROTOCHAR* szReason); virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*); virtual int __cdecl AuthRequest(MCONTACT hContact, const PROTOCHAR* szMessage); @@ -207,7 +207,7 @@ public: void LoadContactInfo(facebook_user* fbu); MCONTACT AddToContactList(facebook_user*, ContactType type, bool force_add = false, bool add_temporarily = false); void SetAllContactStatuses(int status); - MCONTACT HContactFromAuthEvent(HANDLE hEvent); + MCONTACT HContactFromAuthEvent(MEVENT hEvent); void StartTyping(MCONTACT hContact); void StopTyping(MCONTACT hContact); diff --git a/protocols/FacebookRM/src/stubs.cpp b/protocols/FacebookRM/src/stubs.cpp index a52baef931..c17651eaf1 100644 --- a/protocols/FacebookRM/src/stubs.cpp +++ b/protocols/FacebookRM/src/stubs.cpp @@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "common.h"
-MCONTACT FacebookProto::AddToListByEvent(int, int, HANDLE)
+MCONTACT FacebookProto::AddToListByEvent(int, int, MEVENT)
{
return NULL;
}
diff --git a/protocols/GTalkExt/src/notifications.cpp b/protocols/GTalkExt/src/notifications.cpp index 7b56eabf26..1a6eb2825d 100644 --- a/protocols/GTalkExt/src/notifications.cpp +++ b/protocols/GTalkExt/src/notifications.cpp @@ -39,7 +39,7 @@ struct POPUP_DATA_HEADER
{
BOOL MarkRead;
- HANDLE hDbEvent;
+ MEVENT hDbEvent;
MCONTACT hContact;
LPTSTR jid;
LPTSTR url;
@@ -63,14 +63,14 @@ LPCSTR GetJidAcc(LPCTSTR jid) return NULL;
}
-void MarkEventRead(MCONTACT hCnt, HANDLE hEvt)
+void MarkEventRead(MCONTACT hCnt, MEVENT hEvt)
{
DWORD settings = (DWORD)TlsGetValue(itlsSettings);
if (ReadCheckbox(0, IDC_POPUPSENABLED, settings) &&
- ReadCheckbox(0, IDC_PSEUDOCONTACTENABLED, settings) &&
- ReadCheckbox(0, IDC_MARKEVENTREAD, settings) &&
- db_event_markRead(hCnt, hEvt) != -1)
- CallService(MS_CLIST_REMOVEEVENT, (WPARAM)hCnt, (LPARAM)hEvt);
+ ReadCheckbox(0, IDC_PSEUDOCONTACTENABLED, settings) &&
+ ReadCheckbox(0, IDC_MARKEVENTREAD, settings) &&
+ db_event_markRead(hCnt, hEvt) != -1)
+ CallService(MS_CLIST_REMOVEEVENT, hCnt, hEvt);
}
int OnEventDeleted(WPARAM hContact, LPARAM hDbEvent, LPARAM wnd)
@@ -89,7 +89,7 @@ LRESULT CALLBACK PopupProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam) LPCSTR acc;
if (EVENT_DELETED_MSG == msg) {
- if ((HANDLE)lParam == ppdh->hDbEvent)
+ if ((MEVENT)lParam == ppdh->hDbEvent)
ppdh->hDbEvent = NULL;
return 0;
}
@@ -188,7 +188,7 @@ MCONTACT SetupPseudocontact(LPCTSTR jid, LPCTSTR unreadCount, LPCSTR acc, LPCTST return hContact;
}
-HANDLE AddCListNotification(MCONTACT hContact, LPCSTR acc, POPUPDATAT *data, LPCTSTR url)
+static MEVENT AddCListNotification(MCONTACT hContact, LPCSTR acc, POPUPDATAT *data, LPCTSTR url)
{
mir_ptr<char> szUrl(mir_utf8encodeT(url)), szText(mir_utf8encodeT(data->lptzText));
@@ -214,7 +214,7 @@ BOOL UsePopups() void ShowNotification(LPCSTR acc, POPUPDATAT *data, LPCTSTR jid, LPCTSTR url, LPCTSTR unreadCount)
{
MCONTACT hCnt = SetupPseudocontact(jid, unreadCount, acc, &data->lptzContactName[0]);
- HANDLE hEvt = ReadCheckbox(0, IDC_PSEUDOCONTACTENABLED, (DWORD)TlsGetValue(itlsSettings))
+ MEVENT hEvt = ReadCheckbox(0, IDC_PSEUDOCONTACTENABLED, (DWORD)TlsGetValue(itlsSettings))
? AddCListNotification(hCnt, acc, data, url) : NULL;
if (!UsePopups())
@@ -291,8 +291,8 @@ void ClearNotificationContactHistory(LPCSTR acc) if (!hContact || !db_get_b(hContact, SHORT_PLUGIN_NAME, PSEUDOCONTACT_FLAG, 0))
return;
- for (HANDLE hEvent = db_event_first(hContact); hEvent;) {
- HANDLE hEvent1 = db_event_next(hContact, hEvent);
+ for (MEVENT hEvent = db_event_first(hContact); hEvent;) {
+ MEVENT hEvent1 = db_event_next(hContact, hEvent);
db_event_delete(hContact, hEvent);
hEvent = hEvent1;
}
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp index 52a988e025..08dfae9cb7 100644 --- a/protocols/Gadu-Gadu/src/core.cpp +++ b/protocols/Gadu-Gadu/src/core.cpp @@ -1015,7 +1015,7 @@ retry: cle.hContact = hContact;
cle.hIcon = LoadIconEx("image", FALSE);
cle.flags = CLEF_URGENT;
- cle.hDbEvent = (HANDLE)"img";
+ cle.hDbEvent = -98;
cle.lParam = (LPARAM)img;
cle.pszService = service;
cle.pszTooltip = Translate("Incoming image");
diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp index 716a75e376..d2ccaed460 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.cpp +++ b/protocols/Gadu-Gadu/src/gg_proto.cpp @@ -124,9 +124,9 @@ GGPROTO::~GGPROTO() //////////////////////////////////////////////////////////
// Dummies for function that have to be implemented
-MCONTACT 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; }
+MCONTACT GGPROTO::AddToListByEvent(int flags, int iContact, MEVENT hDbEvent) { return NULL; }
+int GGPROTO::Authorize(MEVENT hDbEvent) { return 1; }
+int GGPROTO::AuthDeny(MEVENT hDbEvent, const TCHAR *szReason) { return 1; }
int GGPROTO::AuthRecv(MCONTACT hContact, PROTORECVEVENT *pre) { return 1; }
int GGPROTO::AuthRequest(MCONTACT hContact, const TCHAR *szMessage) { return 1; }
int GGPROTO::FileResume(HANDLE hTransfer, int *action, const PROTOCHAR** szFilename) { return 1; }
diff --git a/protocols/Gadu-Gadu/src/gg_proto.h b/protocols/Gadu-Gadu/src/gg_proto.h index 4629a06824..816292100c 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.h +++ b/protocols/Gadu-Gadu/src/gg_proto.h @@ -32,10 +32,10 @@ struct GGPROTO : public PROTO<GGPROTO> //====================================================================================
virtual MCONTACT __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr );
- virtual MCONTACT __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent );
+ virtual MCONTACT __cdecl AddToListByEvent( int flags, int iContact, MEVENT hDbEvent );
- virtual int __cdecl Authorize( HANDLE hDbEvent );
- virtual int __cdecl AuthDeny( HANDLE hDbEvent, const TCHAR* szReason );
+ virtual int __cdecl Authorize( MEVENT hDbEvent );
+ virtual int __cdecl AuthDeny( MEVENT hDbEvent, const TCHAR* szReason );
virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT* );
virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR* szMessage );
diff --git a/protocols/IRCG/src/clist.cpp b/protocols/IRCG/src/clist.cpp index 3dd962a4a3..e52c1c50d7 100644 --- a/protocols/IRCG/src/clist.cpp +++ b/protocols/IRCG/src/clist.cpp @@ -64,7 +64,7 @@ BOOL CIrcProto::CList_AddDCCChat(const CMString& name, const CMString& hostmask, else {
CLISTEVENT cle = { sizeof(cle) };
cle.hContact = hContact;
- cle.hDbEvent = (HANDLE)"dccchat";
+ cle.hDbEvent = -100;
cle.flags = CLEF_TCHAR;
cle.hIcon = LoadIconEx(IDI_DCC);
mir_snprintf(szService, SIZEOF(szService), "%s/DblClickEvent", m_szModuleName);
@@ -74,7 +74,7 @@ BOOL CIrcProto::CList_AddDCCChat(const CMString& name, const CMString& hostmask, cle.lParam = (LPARAM)pdci;
if (CallService(MS_CLIST_GETEVENT, hContact, 0))
- CallService(MS_CLIST_REMOVEEVENT, hContact, (LPARAM)"dccchat");
+ CallService(MS_CLIST_REMOVEEVENT, hContact, -100);
CallService(MS_CLIST_ADDEVENT, hContact, (LPARAM)&cle);
}
return TRUE;
diff --git a/protocols/IRCG/src/irc.h b/protocols/IRCG/src/irc.h index 68df80a0d8..991a01988d 100644 --- a/protocols/IRCG/src/irc.h +++ b/protocols/IRCG/src/irc.h @@ -212,10 +212,10 @@ struct CIrcProto : public PROTO<CIrcProto> // Protocol interface
virtual MCONTACT __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr );
- virtual MCONTACT __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent );
+ virtual MCONTACT __cdecl AddToListByEvent( int flags, int iContact, MEVENT hDbEvent );
- virtual int __cdecl Authorize(HANDLE hDbEvent);
- virtual int __cdecl AuthDeny(HANDLE hDbEvent, const TCHAR* szReason);
+ virtual int __cdecl Authorize(MEVENT hDbEvent);
+ virtual int __cdecl AuthDeny(MEVENT hDbEvent, const TCHAR* szReason);
virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*);
virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR *szMessage);
diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp index 9dfd53c061..0a259851c1 100644 --- a/protocols/IRCG/src/ircproto.cpp +++ b/protocols/IRCG/src/ircproto.cpp @@ -338,7 +338,7 @@ MCONTACT __cdecl CIrcProto::AddToList(int, PROTOSEARCHRESULT* psr) ////////////////////////////////////////////////////////////////////////////////////////
// AddToList - adds a contact to the contact list
-MCONTACT __cdecl CIrcProto::AddToListByEvent(int, int, HANDLE)
+MCONTACT __cdecl CIrcProto::AddToListByEvent(int, int, MEVENT)
{
return NULL;
}
@@ -346,7 +346,7 @@ MCONTACT __cdecl CIrcProto::AddToListByEvent(int, int, HANDLE) ////////////////////////////////////////////////////////////////////////////////////////
// AuthAllow - processes the successful authorization
-int __cdecl CIrcProto::Authorize(HANDLE)
+int __cdecl CIrcProto::Authorize(MEVENT)
{
return 0;
}
@@ -354,7 +354,7 @@ int __cdecl CIrcProto::Authorize(HANDLE) ////////////////////////////////////////////////////////////////////////////////////////
// AuthDeny - handles the unsuccessful authorization
-int __cdecl CIrcProto::AuthDeny(HANDLE, const TCHAR*)
+int __cdecl CIrcProto::AuthDeny(MEVENT, const TCHAR*)
{
return 0;
}
diff --git a/protocols/IcqOscarJ/src/icq_db.cpp b/protocols/IcqOscarJ/src/icq_db.cpp index 4871d2d7b3..53e41ef407 100644 --- a/protocols/IcqOscarJ/src/icq_db.cpp +++ b/protocols/IcqOscarJ/src/icq_db.cpp @@ -189,7 +189,7 @@ int CIcqProto::IsICQContact(MCONTACT hContact) return !strcmpnull(szProto, m_szModuleName);
}
-HANDLE CIcqProto::AddEvent(MCONTACT hContact, WORD wType, DWORD dwTime, DWORD flags, size_t cbBlob, PBYTE pBlob)
+MEVENT CIcqProto::AddEvent(MCONTACT hContact, WORD wType, DWORD dwTime, DWORD flags, size_t cbBlob, PBYTE pBlob)
{
DBEVENTINFO dbei = { sizeof(dbei) };
dbei.szModule = m_szModuleName;
diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp index 330ff5235f..825cdd8068 100644 --- a/protocols/IcqOscarJ/src/icq_proto.cpp +++ b/protocols/IcqOscarJ/src/icq_proto.cpp @@ -342,7 +342,7 @@ MCONTACT CIcqProto::AddToList(int flags, PROTOSEARCHRESULT *psr) return AddToListByUID(szUid, flags);
}
-MCONTACT __cdecl CIcqProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent)
+MCONTACT __cdecl CIcqProto::AddToListByEvent(int flags, int iContact, MEVENT hDbEvent)
{
DWORD uin = 0;
uid_str uid = { 0 };
@@ -405,7 +405,7 @@ MCONTACT __cdecl CIcqProto::AddToListByEvent(int flags, int iContact, HANDLE hDb ////////////////////////////////////////////////////////////////////////////////////////
// PS_AuthAllow - processes the successful authorization
-int CIcqProto::Authorize(HANDLE hDbEvent)
+int CIcqProto::Authorize(MEVENT hDbEvent)
{
if (icqOnline() && hDbEvent) {
MCONTACT hContact = HContactFromAuthEvent(hDbEvent);
@@ -431,7 +431,7 @@ int CIcqProto::Authorize(HANDLE hDbEvent) ////////////////////////////////////////////////////////////////////////////////////////
// PS_AuthDeny - handles the unsuccessful authorization
-int CIcqProto::AuthDeny(HANDLE hDbEvent, const TCHAR* szReason)
+int CIcqProto::AuthDeny(MEVENT hDbEvent, const TCHAR* szReason)
{
if (icqOnline() && hDbEvent) {
MCONTACT hContact = HContactFromAuthEvent(hDbEvent);
diff --git a/protocols/IcqOscarJ/src/icq_proto.h b/protocols/IcqOscarJ/src/icq_proto.h index cd51336809..56db448000 100644 --- a/protocols/IcqOscarJ/src/icq_proto.h +++ b/protocols/IcqOscarJ/src/icq_proto.h @@ -55,10 +55,10 @@ struct CIcqProto : public PROTO<CIcqProto> //====================================================================================
virtual MCONTACT __cdecl AddToList( int flags, PROTOSEARCHRESULT *psr);
- virtual MCONTACT __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent);
+ virtual MCONTACT __cdecl AddToListByEvent( int flags, int iContact, MEVENT hDbEvent);
- virtual int __cdecl Authorize(HANDLE hDbEvent);
- virtual int __cdecl AuthDeny(HANDLE hDbEvent, const TCHAR *szReason);
+ virtual int __cdecl Authorize(MEVENT hDbEvent);
+ virtual int __cdecl AuthDeny(MEVENT hDbEvent, const TCHAR *szReason);
virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*);
virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR *szMessage);
@@ -412,7 +412,7 @@ struct CIcqProto : public PROTO<CIcqProto> const char* detectUserClient(MCONTACT hContact, int nIsICQ, WORD wUserClass, DWORD dwOnlineSince, const char *szCurrentClient, WORD wVersion, DWORD dwFT1, DWORD dwFT2, DWORD dwFT3, DWORD dwDirectCookie, DWORD dwWebPort, BYTE *caps, size_t wLen, BYTE *bClientId, char *szClientBuf);
//----| icq_db.cpp |------------------------------------------------------------------
- HANDLE AddEvent(MCONTACT hContact, WORD wType, DWORD dwTime, DWORD flags, size_t cbBlob, PBYTE pBlob);
+ MEVENT AddEvent(MCONTACT hContact, WORD wType, DWORD dwTime, DWORD flags, size_t cbBlob, PBYTE pBlob);
int IsICQContact(MCONTACT hContact);
int getSetting(MCONTACT hContact, const char *szSetting, DBVARIANT *dbv);
@@ -888,7 +888,7 @@ struct CIcqProto : public PROTO<CIcqProto> MCONTACT HandleFromCacheByUid(DWORD dwUin, const char *szUid);
MCONTACT HContactFromUIN(DWORD dwUin, int *Added);
MCONTACT HContactFromUID(DWORD dwUin, const char *szUid, int *Added);
- MCONTACT HContactFromAuthEvent(HANDLE hEvent);
+ MCONTACT HContactFromAuthEvent(MEVENT hEvent);
void ResetSettingsOnListReload();
void ResetSettingsOnConnect();
diff --git a/protocols/IcqOscarJ/src/utilities.cpp b/protocols/IcqOscarJ/src/utilities.cpp index 3adf403033..8dc21e8c19 100644 --- a/protocols/IcqOscarJ/src/utilities.cpp +++ b/protocols/IcqOscarJ/src/utilities.cpp @@ -552,7 +552,7 @@ MCONTACT CIcqProto::HContactFromUID(DWORD dwUin, const char *szUid, int *Added) return INVALID_CONTACT_ID;
}
-MCONTACT CIcqProto::HContactFromAuthEvent(HANDLE hEvent)
+MCONTACT CIcqProto::HContactFromAuthEvent(MEVENT hEvent)
{
DWORD body[3];
diff --git a/protocols/JabberG/src/jabber_archive.cpp b/protocols/JabberG/src/jabber_archive.cpp index bba91d3201..91185d924a 100644 --- a/protocols/JabberG/src/jabber_archive.cpp +++ b/protocols/JabberG/src/jabber_archive.cpp @@ -96,12 +96,12 @@ void CJabberProto::OnIqResultGetCollectionList(HXML iqNode, CJabberIqInfo*) static DWORD dwPreviousTimeStamp = -1;
static MCONTACT hPreviousContact = INVALID_CONTACT_ID;
-static HANDLE hPreviousDbEvent = NULL;
+static MEVENT hPreviousDbEvent = NULL;
// Returns TRUE if the event already exist in the database
BOOL IsDuplicateEvent(MCONTACT hContact, DBEVENTINFO& dbei)
{
- HANDLE hExistingDbEvent;
+ MEVENT hExistingDbEvent;
DWORD dwEventTimeStamp;
// get last event
diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp index 4445774672..65b656a594 100644 --- a/protocols/JabberG/src/jabber_iq_handlers.cpp +++ b/protocols/JabberG/src/jabber_iq_handlers.cpp @@ -746,12 +746,11 @@ BOOL CJabberProto::AddClistHttpAuthEvent(CJabberHttpAuthParams *pParams) cle.cbSize = sizeof(CLISTEVENT);
cle.hIcon = (HICON) LoadIconEx("openid");
cle.flags = CLEF_PROTOCOLGLOBAL | CLEF_TCHAR;
- cle.hDbEvent = (HANDLE)("test");
- cle.lParam = (LPARAM) pParams;
+ cle.hDbEvent = -99;
+ cle.lParam = (LPARAM)pParams;
cle.pszService = szService;
cle.ptszTooltip = TranslateT("Http authentication request received");
CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
-
return TRUE;
}
diff --git a/protocols/JabberG/src/jabber_notes.cpp b/protocols/JabberG/src/jabber_notes.cpp index 030c0bbb9f..d39556199e 100644 --- a/protocols/JabberG/src/jabber_notes.cpp +++ b/protocols/JabberG/src/jabber_notes.cpp @@ -778,7 +778,7 @@ bool CJabberProto::OnIncomingNote(const TCHAR *szFrom, HXML hXml) cle.cbSize = sizeof(CLISTEVENT);
cle.hIcon = (HICON)LoadIconEx("notes");
cle.flags = CLEF_PROTOCOLGLOBAL | CLEF_TCHAR;
- cle.hDbEvent = (HANDLE)("test");
+ cle.hDbEvent = -99;
cle.lParam = (LPARAM)pItem;
cle.pszService = szService;
cle.ptszTooltip = TranslateT("Incoming note");
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 53530363e4..271c51bed6 100644 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -345,7 +345,7 @@ MCONTACT CJabberProto::AddToList(int flags, PROTOSEARCHRESULT* psr) return AddToListByJID(jid, flags);
}
-MCONTACT __cdecl CJabberProto::AddToListByEvent(int flags, int /*iContact*/, HANDLE hDbEvent)
+MCONTACT __cdecl CJabberProto::AddToListByEvent(int flags, int /*iContact*/, MEVENT hDbEvent)
{
debugLogA("AddToListByEvent");
@@ -383,7 +383,7 @@ MCONTACT __cdecl CJabberProto::AddToListByEvent(int flags, int /*iContact*/, HAN ////////////////////////////////////////////////////////////////////////////////////////
// JabberAuthAllow - processes the successful authorization
-int CJabberProto::Authorize(HANDLE hDbEvent)
+int CJabberProto::Authorize(MEVENT hDbEvent)
{
if (!m_bJabberOnline)
return 1;
@@ -430,7 +430,7 @@ int CJabberProto::Authorize(HANDLE hDbEvent) ////////////////////////////////////////////////////////////////////////////////////////
// JabberAuthDeny - handles the unsuccessful authorization
-int CJabberProto::AuthDeny(HANDLE hDbEvent, const TCHAR*)
+int CJabberProto::AuthDeny(MEVENT hDbEvent, const TCHAR*)
{
if (!m_bJabberOnline)
return 1;
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h index c9bbff16c3..96c57806f6 100644 --- a/protocols/JabberG/src/jabber_proto.h +++ b/protocols/JabberG/src/jabber_proto.h @@ -83,10 +83,10 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface //====================================================================================
virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr);
- virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent);
+ virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, MEVENT hDbEvent);
- virtual int __cdecl Authorize(HANDLE hDbEvent);
- virtual int __cdecl AuthDeny(HANDLE hDbEvent, const TCHAR *szReason);
+ virtual int __cdecl Authorize(MEVENT hDbEvent);
+ virtual int __cdecl AuthDeny(MEVENT hDbEvent, const TCHAR *szReason);
virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*);
virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR *szMessage);
diff --git a/protocols/JabberG/src/jabber_rc.cpp b/protocols/JabberG/src/jabber_rc.cpp index 5c96401afb..049805bea0 100644 --- a/protocols/JabberG/src/jabber_rc.cpp +++ b/protocols/JabberG/src/jabber_rc.cpp @@ -468,7 +468,7 @@ int CJabberProto::RcGetUnreadEventsCount() ptrT jid( getTStringA(hContact, "jid"));
if (jid == NULL) continue;
- 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)) {
DBEVENTINFO dbei = { sizeof(dbei) };
dbei.cbBlob = db_event_getBlobSize(hDbEvent);
if (dbei.cbBlob == -1)
@@ -555,7 +555,7 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe if (tszJid == NULL)
continue;
- 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)) {
DBEVENTINFO dbei = { sizeof(dbei) };
dbei.cbBlob = db_event_getBlobSize(hDbEvent);
if (dbei.cbBlob == -1)
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index 99b76a4250..56dec1aa27 100644 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -988,7 +988,7 @@ void CJabberProto::OnProcessPubsubEvent(HXML node) DWORD JabberGetLastContactMessageTime(MCONTACT hContact)
{
// TODO: time cache can improve performance
- HANDLE hDbEvent = db_event_last(hContact);
+ MEVENT hDbEvent = db_event_last(hContact);
if (!hDbEvent)
return 0;
diff --git a/protocols/MRA/src/MraProto.cpp b/protocols/MRA/src/MraProto.cpp index c7af6e4b1e..df1ae3e97d 100644 --- a/protocols/MRA/src/MraProto.cpp +++ b/protocols/MRA/src/MraProto.cpp @@ -161,7 +161,7 @@ MCONTACT CMraProto::AddToList(int flags, PROTOSEARCHRESULT *psr) return AddToListByEmail(psr->email, psr->nick, psr->firstName, psr->lastName, flags);
}
-MCONTACT CMraProto::AddToListByEvent(int, int, HANDLE hDbEvent)
+MCONTACT CMraProto::AddToListByEvent(int, int, MEVENT hDbEvent)
{
DBEVENTINFO dbei = { 0 };
dbei.cbSize = sizeof(dbei);
@@ -191,7 +191,7 @@ int CMraProto::SendUrl(MCONTACT, int, const char*) { return 1; } /////////////////////////////////////////////////////////////////////////////////////////
-int CMraProto::Authorize(HANDLE hDBEvent)
+int CMraProto::Authorize(MEVENT hDBEvent)
{
if (!m_bLoggedIn) return 1;
@@ -211,7 +211,7 @@ int CMraProto::Authorize(HANDLE hDBEvent) return 0;
}
-int CMraProto::AuthDeny(HANDLE hDBEvent, const TCHAR* szReason)
+int CMraProto::AuthDeny(MEVENT hDBEvent, const TCHAR* szReason)
{
if (!m_bLoggedIn) return 1;
diff --git a/protocols/MRA/src/MraProto.h b/protocols/MRA/src/MraProto.h index 25763f3cd0..6fbab83126 100644 --- a/protocols/MRA/src/MraProto.h +++ b/protocols/MRA/src/MraProto.h @@ -39,10 +39,10 @@ struct CMraProto : public PROTO<CMraProto> // ====================================================================================
virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr);
- virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent);
+ virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, MEVENT hDbEvent);
- virtual int __cdecl Authorize(HANDLE hDBEvent);
- virtual int __cdecl AuthDeny(HANDLE hDBEvent, const TCHAR* szReason);
+ virtual int __cdecl Authorize(MEVENT hDBEvent);
+ virtual int __cdecl AuthDeny(MEVENT hDBEvent, const TCHAR* szReason);
virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*);
virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR* szMessage);
diff --git a/protocols/MSN/src/msn_mail.cpp b/protocols/MSN/src/msn_mail.cpp index 3158934d8e..03ab085bc5 100644 --- a/protocols/MSN/src/msn_mail.cpp +++ b/protocols/MSN/src/msn_mail.cpp @@ -291,7 +291,7 @@ void CMsnProto::sttNotificationMessage(char* msgBody, bool isInitial) cle.cbSize = sizeof(cle);
cle.hContact = hContact;
- cle.hDbEvent = (HANDLE)1;
+ cle.hDbEvent = 1;
cle.flags = CLEF_URGENT | CLEF_TCHAR;
cle.hIcon = LoadSkinnedIcon(SKINICON_OTHER_SENDEMAIL);
cle.ptszTooltip = tBuffer2;
diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp index 3e9adec7d7..b21c71a683 100644 --- a/protocols/MSN/src/msn_proto.cpp +++ b/protocols/MSN/src/msn_proto.cpp @@ -248,7 +248,7 @@ MCONTACT __cdecl CMsnProto::AddToList(int flags, PROTOSEARCHRESULT* psr) flags);
}
-MCONTACT __cdecl CMsnProto::AddToListByEvent(int flags, int, HANDLE hDbEvent)
+MCONTACT __cdecl CMsnProto::AddToListByEvent(int flags, int, MEVENT hDbEvent)
{
DBEVENTINFO dbei = { sizeof(dbei) };
if ((dbei.cbBlob = db_event_getBlobSize(hDbEvent)) == (DWORD)(-1))
@@ -303,7 +303,7 @@ int __cdecl CMsnProto::AuthRequest(MCONTACT hContact, const TCHAR* szMessage) /////////////////////////////////////////////////////////////////////////////////////////
// MsnAuthAllow - called after successful authorization
-int CMsnProto::Authorize(HANDLE hDbEvent)
+int CMsnProto::Authorize(MEVENT hDbEvent)
{
if (!msnLoggedIn)
return 1;
@@ -341,7 +341,7 @@ int CMsnProto::Authorize(HANDLE hDbEvent) /////////////////////////////////////////////////////////////////////////////////////////
// MsnAuthDeny - called after unsuccessful authorization
-int CMsnProto::AuthDeny(HANDLE hDbEvent, const TCHAR*)
+int CMsnProto::AuthDeny(MEVENT hDbEvent, const TCHAR*)
{
if (!msnLoggedIn)
return 1;
diff --git a/protocols/MSN/src/msn_proto.h b/protocols/MSN/src/msn_proto.h index 42922a2ab4..0600dc1d16 100644 --- a/protocols/MSN/src/msn_proto.h +++ b/protocols/MSN/src/msn_proto.h @@ -33,10 +33,10 @@ struct CMsnProto : public PROTO<CMsnProto> //====================================================================================
virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr);
- virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent);
+ virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, MEVENT hDbEvent);
- virtual int __cdecl Authorize(HANDLE hDbEvent);
- virtual int __cdecl AuthDeny(HANDLE hDbEvent, const TCHAR* szReason);
+ virtual int __cdecl Authorize(MEVENT hDbEvent);
+ virtual int __cdecl AuthDeny(MEVENT hDbEvent, const TCHAR* szReason);
virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*);
virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR* szMessage);
diff --git a/protocols/Omegle/src/proto.h b/protocols/Omegle/src/proto.h index 09fcbdc548..6c799f4328 100644 --- a/protocols/Omegle/src/proto.h +++ b/protocols/Omegle/src/proto.h @@ -45,10 +45,10 @@ public: // PROTO_INTERFACE
virtual MCONTACT __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr );
- virtual MCONTACT __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent );
+ virtual MCONTACT __cdecl AddToListByEvent( int flags, int iContact, MEVENT hDbEvent );
- virtual int __cdecl Authorize( HANDLE hDbEvent );
- virtual int __cdecl AuthDeny( HANDLE hDbEvent, const PROTOCHAR* szReason );
+ virtual int __cdecl Authorize( MEVENT hDbEvent );
+ virtual int __cdecl AuthDeny( MEVENT hDbEvent, const PROTOCHAR* szReason );
virtual int __cdecl AuthRecv( MCONTACT hContact, PROTORECVEVENT* );
virtual int __cdecl AuthRequest( MCONTACT hContact, const PROTOCHAR* szMessage );
diff --git a/protocols/Omegle/src/stubs.cpp b/protocols/Omegle/src/stubs.cpp index f325d90c0e..90683d9cd0 100644 --- a/protocols/Omegle/src/stubs.cpp +++ b/protocols/Omegle/src/stubs.cpp @@ -27,17 +27,17 @@ MCONTACT OmegleProto::AddToList(int flags, PROTOSEARCHRESULT* psr) return NULL;
};
-MCONTACT OmegleProto::AddToListByEvent(int flags,int iContact,HANDLE hDbEvent)
+MCONTACT OmegleProto::AddToListByEvent(int flags,int iContact,MEVENT hDbEvent)
{
return NULL;
};
-int OmegleProto::Authorize(HANDLE hDbEvent)
+int OmegleProto::Authorize(MEVENT hDbEvent)
{
return 1;
}
-int OmegleProto::AuthDeny(HANDLE hDbEvent,const PROTOCHAR *reason)
+int OmegleProto::AuthDeny(MEVENT hDbEvent,const PROTOCHAR *reason)
{
return 1;
}
diff --git a/protocols/Sametime/src/sametime_proto.cpp b/protocols/Sametime/src/sametime_proto.cpp index d69db969f9..f5e2352e9e 100644 --- a/protocols/Sametime/src/sametime_proto.cpp +++ b/protocols/Sametime/src/sametime_proto.cpp @@ -89,19 +89,19 @@ MCONTACT CSametimeProto::AddToList(int flags, PROTOSEARCHRESULT* psr) return AddSearchedUser(sr, flags & PALF_TEMPORARY);
}
-MCONTACT CSametimeProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent)
+MCONTACT CSametimeProto::AddToListByEvent(int flags, int iContact, MEVENT hDbEvent)
{
debugLog(_T("CSametimeProto::AddToListByEvent() flags=[%d]"), flags);
return 0;
}
-int CSametimeProto::Authorize(HANDLE hDbEvent)
+int CSametimeProto::Authorize(MEVENT hDbEvent)
{
debugLog(_T("CSametimeProto::Authorize()"));
return 1;
}
-int CSametimeProto::AuthDeny(HANDLE hDbEvent, const PROTOCHAR* szReason)
+int CSametimeProto::AuthDeny(MEVENT hDbEvent, const PROTOCHAR* szReason)
{
debugLog(_T("CSametimeProto::AuthDeny()"));
return 1;
diff --git a/protocols/Sametime/src/sametime_proto.h b/protocols/Sametime/src/sametime_proto.h index 67c036fbf1..c56e291c84 100644 --- a/protocols/Sametime/src/sametime_proto.h +++ b/protocols/Sametime/src/sametime_proto.h @@ -16,10 +16,10 @@ struct CSametimeProto : public PROTO<CSametimeProto> virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr);
- virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent);
+ virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, MEVENT hDbEvent);
- virtual int __cdecl Authorize(HANDLE hDbEvent);
- virtual int __cdecl AuthDeny(HANDLE hDbEvent, const PROTOCHAR* szReason);
+ virtual int __cdecl Authorize(MEVENT hDbEvent);
+ virtual int __cdecl AuthDeny(MEVENT hDbEvent, const PROTOCHAR* szReason);
virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*);
virtual int __cdecl AuthRequest(MCONTACT hContact, const PROTOCHAR* szMessage);
diff --git a/protocols/SkypeClassic/src/filexfer.cpp b/protocols/SkypeClassic/src/filexfer.cpp index 21d475460c..0c53202a83 100644 --- a/protocols/SkypeClassic/src/filexfer.cpp +++ b/protocols/SkypeClassic/src/filexfer.cpp @@ -114,7 +114,7 @@ INT_PTR SkypeSendFile(WPARAM, LPARAM lParam) if (pTok) {
ret = strtoul(pTok, NULL, 10);
- TYP_MSGLENTRY *pEntry = MsgList_Add(ret, INVALID_HANDLE_VALUE);
+ TYP_MSGLENTRY *pEntry = MsgList_Add(ret, -1);
if (pEntry) {
DWORD cbSize = sizeof(PROTOFILETRANSFERSTATUS);
/* Allocate basic entry and fill some stuff we already know */
diff --git a/protocols/SkypeClassic/src/msglist.cpp b/protocols/SkypeClassic/src/msglist.cpp index 9ba9b67679..2c33dff807 100644 --- a/protocols/SkypeClassic/src/msglist.cpp +++ b/protocols/SkypeClassic/src/msglist.cpp @@ -1,9 +1,9 @@ #define WIN32_LEAN_AND_MEAN
#include <windows.h>
+#include "filexfer.h"
#include "memlist.h"
#include "debug.h"
#include "msglist.h"
-#include "filexfer.h"
#define MSGLIST_TIMEOUT 1800 // Chatmessage references will be kept for 30 minutes
@@ -37,7 +37,7 @@ void MsgList_Exit(void) m_hMsgList = NULL;
}
-TYP_MSGLENTRY *MsgList_Add(DWORD uMsgNum, HANDLE hEvent)
+TYP_MSGLENTRY *MsgList_Add(DWORD uMsgNum, MEVENT hEvent)
{
TYP_MSGLENTRY *pEntry;
int iListInd;
diff --git a/protocols/SkypeClassic/src/msglist.h b/protocols/SkypeClassic/src/msglist.h index 94316c703e..d5afed9374 100644 --- a/protocols/SkypeClassic/src/msglist.h +++ b/protocols/SkypeClassic/src/msglist.h @@ -2,8 +2,8 @@ typedef struct {
DWORD uMsgNum;
- HANDLE hEvent;
- HANDLE hMetaEvent;
+ MEVENT hEvent;
+ MEVENT hMetaEvent;
time_t t;
time_t tEdited;
void *pfts;
@@ -11,6 +11,6 @@ typedef struct { void MsgList_Init(void);
void MsgList_Exit(void);
-TYP_MSGLENTRY *MsgList_Add(DWORD uMsgNum, HANDLE hEvent);
+TYP_MSGLENTRY *MsgList_Add(DWORD uMsgNum, MEVENT hEvent);
TYP_MSGLENTRY *MsgList_FindMessage(DWORD uMsgNum);
void MsgList_CollectGarbage(void);
diff --git a/protocols/SkypeClassic/src/skype.cpp b/protocols/SkypeClassic/src/skype.cpp index 2386fe528f..c9280b616f 100644 --- a/protocols/SkypeClassic/src/skype.cpp +++ b/protocols/SkypeClassic/src/skype.cpp @@ -868,7 +868,7 @@ void FetchMessageThread(fetchmsg_arg *pargs) { CCSDATA ccs = { 0 };
PROTORECVEVENT pre = { 0 };
MCONTACT hContact = NULL, hChat = NULL;
- HANDLE hDbEvent;
+ MEVENT hDbEvent;
DBEVENTINFO dbei = { 0 };
DBVARIANT dbv = { 0 };
fetchmsg_arg args;
@@ -1042,7 +1042,7 @@ void FetchMessageThread(fetchmsg_arg *pargs) { free_nonutf_tchar_string((void*)gcd.ptszID);
if (!args.bDontMarkSeen)
{
- MsgList_Add((DWORD)pre.lParam, INVALID_HANDLE_VALUE);
+ MsgList_Add((DWORD)pre.lParam, -1);
SkypeSend("SET %s %s SEEN", cmdMessage, args.msgnum);
}
__leave;
@@ -1169,7 +1169,7 @@ void FetchMessageThread(fetchmsg_arg *pargs) { bHasPartList = strncmp(msgptr, "<partlist ", 10) == 0;
if (args.pMsgEntry && args.pMsgEntry->tEdited) {
// Mark the message as edited
- if (!*msgptr && args.pMsgEntry->hEvent != INVALID_HANDLE_VALUE) {
+ if (!*msgptr && args.pMsgEntry->hEvent != -1) {
// Empty message and edited -> Delete event
if ((int)(hContact = db_event_getContact(args.pMsgEntry->hEvent)) != -1) {
db_event_delete(hContact, args.pMsgEntry->hEvent);
@@ -1273,7 +1273,7 @@ void FetchMessageThread(fetchmsg_arg *pargs) { gce.ptszText = (TCHAR*)(msgptr + msglen);
gce.dwFlags = GCEF_ADDTOLOG;
CallService(MS_GC_EVENT, 0, (LPARAM)&gce);
- MsgList_Add((DWORD)pre.lParam, INVALID_HANDLE_VALUE); // Mark as groupchat
+ MsgList_Add((DWORD)pre.lParam, -1); // Mark as groupchat
if (ci.pszVal) mir_free(ci.pszVal);
free_nonutf_tchar_string((void*)gce.ptszUID);
free_nonutf_tchar_string((void*)gcd.ptszID);
@@ -1612,7 +1612,7 @@ l_exitRT: void EndCallThread(char *szSkypeMsg) {
MCONTACT hContact = NULL;
- HANDLE hDbEvent;
+ MEVENT hDbEvent;
DBEVENTINFO dbei = { 0 };
DBVARIANT dbv;
@@ -2675,7 +2675,7 @@ void MessageSendWatchThread(void *a) { if ((ptr=strtok_r(str, " ", &nexttoken)) && (*ptr!='#' || (ptr=strtok_r(NULL, " ", &nexttoken))) &&
(ptr=strtok_r(NULL, " ", &nexttoken))) {
/* Use this to ensure that main thread doesn't pick up sent message */
- MsgList_Add(strtoul(ptr, NULL, 10), INVALID_HANDLE_VALUE);
+ MsgList_Add(strtoul(ptr, NULL, 10), -1);
#ifdef USE_REAL_TS
if (err=SkypeGet (cmdMessage, ptr, "TIMESTAMP")) {
m_AddEventArg.hContact = arg->hContact;
@@ -2847,15 +2847,13 @@ char *__skypeauth(WPARAM wParam) { DBEVENTINFO dbei = { 0 };
dbei.cbSize = sizeof(dbei);
- if (((dbei.cbBlob = db_event_getBlobSize((HANDLE)wParam)) == -1 ||
+ if (((dbei.cbBlob = db_event_getBlobSize(wParam)) == -1 ||
!(dbei.pBlob = (unsigned char*)malloc(dbei.cbBlob))))
{
return NULL;
}
- if (db_event_get((HANDLE)wParam, &dbei) ||
- dbei.eventType != EVENTTYPE_AUTHREQUEST ||
- strcmp(dbei.szModule, SKYPE_PROTONAME))
+ if (db_event_get(wParam, &dbei) || dbei.eventType != EVENTTYPE_AUTHREQUEST || strcmp(dbei.szModule, SKYPE_PROTONAME))
{
free(dbei.pBlob);
return NULL;
diff --git a/protocols/Steam/src/steam_contacts.cpp b/protocols/Steam/src/steam_contacts.cpp index d952d7991e..1ab84505ee 100644 --- a/protocols/Steam/src/steam_contacts.cpp +++ b/protocols/Steam/src/steam_contacts.cpp @@ -59,7 +59,7 @@ void CSteamProto::SetAllContactsStatus(WORD status) } } -MCONTACT CSteamProto::GetContactFromAuthEvent(HANDLE hEvent) +MCONTACT CSteamProto::GetContactFromAuthEvent(MEVENT hEvent) { DWORD body[3]; DBEVENTINFO dbei = { sizeof(DBEVENTINFO) }; diff --git a/protocols/Steam/src/steam_proto.cpp b/protocols/Steam/src/steam_proto.cpp index a2d609dd20..7c645b4eae 100644 --- a/protocols/Steam/src/steam_proto.cpp +++ b/protocols/Steam/src/steam_proto.cpp @@ -105,12 +105,12 @@ MCONTACT __cdecl CSteamProto::AddToList(int flags, PROTOSEARCHRESULT* psr) return hContact; } -MCONTACT __cdecl CSteamProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent) +MCONTACT __cdecl CSteamProto::AddToListByEvent(int flags, int iContact, MEVENT hDbEvent) { return 0; } -int __cdecl CSteamProto::Authorize(HANDLE hDbEvent) +int __cdecl CSteamProto::Authorize(MEVENT hDbEvent) { if (IsOnline() && hDbEvent) { @@ -136,7 +136,7 @@ int __cdecl CSteamProto::Authorize(HANDLE hDbEvent) return 1; } -int __cdecl CSteamProto::AuthDeny(HANDLE hDbEvent, const TCHAR* szReason) +int __cdecl CSteamProto::AuthDeny(MEVENT hDbEvent, const TCHAR* szReason) { if (IsOnline() && hDbEvent) { diff --git a/protocols/Steam/src/steam_proto.h b/protocols/Steam/src/steam_proto.h index 0b1b2c0d20..acbae5c3c5 100644 --- a/protocols/Steam/src/steam_proto.h +++ b/protocols/Steam/src/steam_proto.h @@ -91,10 +91,10 @@ public: // PROTO_INTERFACE virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT *psr); - virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent); + virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, MEVENT hDbEvent); - virtual int __cdecl Authorize(HANDLE hDbEvent); - virtual int __cdecl AuthDeny(HANDLE hDbEvent, const TCHAR *szReason); + virtual int __cdecl Authorize(MEVENT hDbEvent); + virtual int __cdecl AuthDeny(MEVENT hDbEvent, const TCHAR *szReason); virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT *); virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR * szMessage); @@ -194,7 +194,7 @@ protected: void SetContactStatus(MCONTACT hContact, WORD status); void SetAllContactsStatus(WORD status); - MCONTACT GetContactFromAuthEvent(HANDLE hEvent); + MCONTACT GetContactFromAuthEvent(MEVENT hEvent); void UpdateContact(MCONTACT hContact, JSONNODE *data); void ProcessContact(std::map<std::string, JSONNODE*>::iterator *it, MCONTACT hContact); @@ -275,7 +275,7 @@ protected: static int RsaEncrypt(const char *pszModulus, const char *data, BYTE *encrypted, DWORD &encryptedSize); - HANDLE AddDBEvent(MCONTACT hContact, WORD type, DWORD timestamp, DWORD flags, DWORD cbBlob, PBYTE pBlob); + MEVENT AddDBEvent(MCONTACT hContact, WORD type, DWORD timestamp, DWORD flags, DWORD cbBlob, PBYTE pBlob); static void CSteamProto::ShowNotification(const wchar_t *message, int flags = 0, MCONTACT hContact = NULL); static void CSteamProto::ShowNotification(const wchar_t *caption, const wchar_t *message, int flags = 0, MCONTACT hContact = NULL); diff --git a/protocols/Steam/src/steam_utils.cpp b/protocols/Steam/src/steam_utils.cpp index 85aef0a715..40fd27d888 100644 --- a/protocols/Steam/src/steam_utils.cpp +++ b/protocols/Steam/src/steam_utils.cpp @@ -157,7 +157,7 @@ exit: return 0;
}
-HANDLE CSteamProto::AddDBEvent(MCONTACT hContact, WORD type, DWORD timestamp, DWORD flags, DWORD cbBlob, PBYTE pBlob)
+MEVENT CSteamProto::AddDBEvent(MCONTACT hContact, WORD type, DWORD timestamp, DWORD flags, DWORD cbBlob, PBYTE pBlob)
{
DBEVENTINFO dbei = { sizeof(dbei) };
dbei.szModule = m_szModuleName;
diff --git a/protocols/Tlen/src/tlen.h b/protocols/Tlen/src/tlen.h index e877986253..1c513aba6d 100644 --- a/protocols/Tlen/src/tlen.h +++ b/protocols/Tlen/src/tlen.h @@ -219,10 +219,10 @@ struct TlenProtocol : public PROTO<TlenProtocol> //====================================================================================
virtual MCONTACT __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr );
- virtual MCONTACT __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent );
+ virtual MCONTACT __cdecl AddToListByEvent( int flags, int iContact, MEVENT hDbEvent );
- virtual int __cdecl Authorize(HANDLE hDbEvent);
- virtual int __cdecl AuthDeny(HANDLE hDbEvent, const PROTOCHAR* szReason);
+ virtual int __cdecl Authorize(MEVENT hDbEvent);
+ virtual int __cdecl AuthDeny(MEVENT hDbEvent, const PROTOCHAR* szReason);
virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*);
virtual int __cdecl AuthRequest(MCONTACT hContact, const PROTOCHAR* szMessage);
diff --git a/protocols/Tlen/src/tlen_svc.cpp b/protocols/Tlen/src/tlen_svc.cpp index 6f0c0f263c..b1e35e62b3 100644 --- a/protocols/Tlen/src/tlen_svc.cpp +++ b/protocols/Tlen/src/tlen_svc.cpp @@ -224,7 +224,7 @@ MCONTACT TlenProtocol::AddToList(int flags, PROTOSEARCHRESULT *psr) return hContact;
}
-MCONTACT TlenProtocol::AddToListByEvent( int flags, int iContact, HANDLE hDbEvent )
+MCONTACT TlenProtocol::AddToListByEvent(int flags, int iContact, MEVENT hDbEvent)
{
DBEVENTINFO dbei = { sizeof(dbei) };
if ((dbei.cbBlob = db_event_getBlobSize(hDbEvent)) == (DWORD)(-1))
@@ -262,7 +262,7 @@ MCONTACT TlenProtocol::AddToListByEvent( int flags, int iContact, HANDLE hDbEven return hContact;
}
-int TlenProtocol::Authorize(HANDLE hDbEvent)
+int TlenProtocol::Authorize(MEVENT hDbEvent)
{
if (!isOnline)
return 1;
@@ -311,7 +311,7 @@ int TlenProtocol::Authorize(HANDLE hDbEvent) return 0;
}
-int TlenProtocol::AuthDeny(HANDLE hDbEvent, const PROTOCHAR* szReason)
+int TlenProtocol::AuthDeny(MEVENT hDbEvent, const PROTOCHAR* szReason)
{
if (!isOnline)
return 1;
diff --git a/protocols/Tlen/src/tlen_thread.cpp b/protocols/Tlen/src/tlen_thread.cpp index 9f714bbdb6..dd9300d471 100644 --- a/protocols/Tlen/src/tlen_thread.cpp +++ b/protocols/Tlen/src/tlen_thread.cpp @@ -700,7 +700,7 @@ static void TlenProcessMessage(XmlNode *node, ThreadData *info) if (msgTime == 0) {
msgTime = time(NULL);
} else {
- HANDLE hDbEvent = db_event_last(hContact);
+ MEVENT hDbEvent = db_event_last(hContact);
if (hDbEvent != NULL) {
DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get( hDbEvent, &dbei);
diff --git a/protocols/Tox/src/tox_contacts.cpp b/protocols/Tox/src/tox_contacts.cpp index 110480ed8c..6a7321546f 100644 --- a/protocols/Tox/src/tox_contacts.cpp +++ b/protocols/Tox/src/tox_contacts.cpp @@ -22,7 +22,7 @@ void CToxProto::SetAllContactsStatus(WORD status) }
}
-MCONTACT CToxProto::GetContactFromAuthEvent(HANDLE hEvent)
+MCONTACT CToxProto::GetContactFromAuthEvent(MEVENT hEvent)
{
DWORD body[3];
DBEVENTINFO dbei = { sizeof(DBEVENTINFO) };
diff --git a/protocols/Tox/src/tox_proto.cpp b/protocols/Tox/src/tox_proto.cpp index 204777d9ec..e9d93dac78 100644 --- a/protocols/Tox/src/tox_proto.cpp +++ b/protocols/Tox/src/tox_proto.cpp @@ -91,12 +91,12 @@ MCONTACT __cdecl CToxProto::AddToList(int flags, PROTOSEARCHRESULT* psr) return AddContact(address, _T(""), flags & PALF_TEMPORARY);
}
-MCONTACT __cdecl CToxProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent)
+MCONTACT __cdecl CToxProto::AddToListByEvent(int flags, int iContact, MEVENT hDbEvent)
{
return 0;
}
-int __cdecl CToxProto::Authorize(HANDLE hDbEvent)
+int __cdecl CToxProto::Authorize(MEVENT hDbEvent)
{
MCONTACT hContact = GetContactFromAuthEvent(hDbEvent);
if (hContact == INVALID_CONTACT_ID)
@@ -117,7 +117,7 @@ int __cdecl CToxProto::Authorize(HANDLE hDbEvent) return 0;
}
-int __cdecl CToxProto::AuthDeny(HANDLE hDbEvent, const PROTOCHAR* szReason) { return 0; }
+int __cdecl CToxProto::AuthDeny(MEVENT hDbEvent, const PROTOCHAR* szReason) { return 0; }
int __cdecl CToxProto::AuthRecv(MCONTACT, PROTORECVEVENT* pre)
{
diff --git a/protocols/Tox/src/tox_proto.h b/protocols/Tox/src/tox_proto.h index 7dc29878b9..962af5b609 100644 --- a/protocols/Tox/src/tox_proto.h +++ b/protocols/Tox/src/tox_proto.h @@ -66,10 +66,10 @@ public: // Virtual functions
virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr);
- virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent);
+ virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, MEVENT hDbEvent);
- virtual int __cdecl Authorize(HANDLE hDbEvent);
- virtual int __cdecl AuthDeny(HANDLE hDbEvent, const PROTOCHAR* szReason);
+ virtual int __cdecl Authorize(MEVENT hDbEvent);
+ virtual int __cdecl AuthDeny(MEVENT hDbEvent, const PROTOCHAR* szReason);
virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*);
virtual int __cdecl AuthRequest(MCONTACT hContact, const PROTOCHAR* szMessage);
@@ -175,7 +175,7 @@ private: MCONTACT FindContact(const int friendNumber);
MCONTACT AddContact(const std::string &id, const std::tstring &dnsId, bool isTemporary = false);
- MCONTACT GetContactFromAuthEvent(HANDLE hEvent);
+ MCONTACT GetContactFromAuthEvent(MEVENT hEvent);
void LoadFriendList();
@@ -231,7 +231,7 @@ private: static void ShowNotification(const TCHAR *message, int flags = 0, MCONTACT hContact = NULL);
static void ShowNotification(const TCHAR *caption, const TCHAR *message, int flags = 0, MCONTACT hContact = NULL);
- HANDLE AddDbEvent(MCONTACT hContact, WORD type, DWORD timestamp, DWORD flags, DWORD cbBlob, PBYTE pBlob);
+ MEVENT AddDbEvent(MCONTACT hContact, WORD type, DWORD timestamp, DWORD flags, DWORD cbBlob, PBYTE pBlob);
std::vector<uint8_t> HexStringToData(std::string hex);
std::string DataToHexString(std::vector<uint8_t>);
diff --git a/protocols/Tox/src/tox_utils.cpp b/protocols/Tox/src/tox_utils.cpp index bc515000f9..e3bf7d9707 100644 --- a/protocols/Tox/src/tox_utils.cpp +++ b/protocols/Tox/src/tox_utils.cpp @@ -60,7 +60,7 @@ void CToxProto::ShowNotification(const TCHAR *message, int flags, MCONTACT hCont ShowNotification(_T(MODULE), message, flags, hContact);
}
-HANDLE CToxProto::AddDbEvent(MCONTACT hContact, WORD type, DWORD timestamp, DWORD flags, DWORD cbBlob, PBYTE pBlob)
+MEVENT CToxProto::AddDbEvent(MCONTACT hContact, WORD type, DWORD timestamp, DWORD flags, DWORD cbBlob, PBYTE pBlob)
{
DBEVENTINFO dbei = { sizeof(dbei) };
dbei.szModule = m_szModuleName;
diff --git a/protocols/Twitter/src/proto.h b/protocols/Twitter/src/proto.h index e19d1578ad..865ed10b17 100644 --- a/protocols/Twitter/src/proto.h +++ b/protocols/Twitter/src/proto.h @@ -33,10 +33,10 @@ public: //PROTO_INTERFACE
virtual MCONTACT __cdecl AddToList(int,PROTOSEARCHRESULT *);
- virtual MCONTACT __cdecl AddToListByEvent(int,int,HANDLE);
+ virtual MCONTACT __cdecl AddToListByEvent(int,int,MEVENT);
- virtual int __cdecl Authorize(HANDLE);
- virtual int __cdecl AuthDeny(HANDLE,const TCHAR *);
+ virtual int __cdecl Authorize(MEVENT);
+ virtual int __cdecl AuthDeny(MEVENT,const TCHAR *);
virtual int __cdecl AuthRecv(MCONTACT, PROTORECVEVENT *);
virtual int __cdecl AuthRequest(MCONTACT, const TCHAR *);
diff --git a/protocols/Twitter/src/stubs.cpp b/protocols/Twitter/src/stubs.cpp index 7a61276701..38f7b93288 100644 --- a/protocols/Twitter/src/stubs.cpp +++ b/protocols/Twitter/src/stubs.cpp @@ -18,17 +18,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "stdafx.h"
#include "proto.h"
-MCONTACT TwitterProto::AddToListByEvent(int flags,int iContact,HANDLE hDbEvent)
+MCONTACT TwitterProto::AddToListByEvent(int flags,int iContact,MEVENT hDbEvent)
{
return NULL;
}
-int TwitterProto::Authorize(HANDLE hDbEvent)
+int TwitterProto::Authorize(MEVENT hDbEvent)
{
return 1;
}
-int TwitterProto::AuthDeny(HANDLE hDbEvent,const TCHAR *reason)
+int TwitterProto::AuthDeny(MEVENT hDbEvent,const TCHAR *reason)
{
return 1;
}
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index c80990c01f..70c28659e5 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -506,23 +506,23 @@ void CVkProto::DBAddAuthRequest(const MCONTACT hContact) mir_free(szNick);
}
-MCONTACT CVkProto::MContactFromDbEvent(HANDLE hDbEvent)
-{
- debugLogA("CVkProto::MContactFromDbEvent"); - if (!hDbEvent || !IsOnline()) - return INVALID_CONTACT_ID; - - DWORD body[2]; - DBEVENTINFO dbei = { sizeof(dbei) }; - dbei.cbBlob = sizeof(DWORD) * 2; - dbei.pBlob = (PBYTE)&body; - - if (db_event_get(hDbEvent, &dbei)) - return INVALID_CONTACT_ID; - if (dbei.eventType != EVENTTYPE_AUTHREQUEST || strcmp(dbei.szModule, m_szModuleName)) - return INVALID_CONTACT_ID; - - MCONTACT hContact = DbGetAuthEventContact(&dbei); +MCONTACT CVkProto::MContactFromDbEvent(MEVENT hDbEvent)
+{
+ debugLogA("CVkProto::MContactFromDbEvent");
+ if (!hDbEvent || !IsOnline())
+ return INVALID_CONTACT_ID;
+
+ DWORD body[2];
+ DBEVENTINFO dbei = { sizeof(dbei) };
+ dbei.cbBlob = sizeof(DWORD) * 2;
+ dbei.pBlob = (PBYTE)&body;
+
+ if (db_event_get(hDbEvent, &dbei))
+ return INVALID_CONTACT_ID;
+ if (dbei.eventType != EVENTTYPE_AUTHREQUEST || strcmp(dbei.szModule, m_szModuleName))
+ return INVALID_CONTACT_ID;
+
+ MCONTACT hContact = DbGetAuthEventContact(&dbei);
db_unset(hContact, m_szModuleName, "ReqAuth");
return hContact;
}
@@ -607,30 +607,30 @@ void CVkProto::ContactTypingThread(void *p) int CVkProto::OnProcessSrmmEvent(WPARAM, LPARAM lParam)
{
- debugLogA("CVkProto::OnProcessSrmmEvent"); - MessageWindowEventData *event = (MessageWindowEventData *)lParam; - - if (event->uType == MSG_WINDOW_EVT_OPENING) - SetSrmmReadStatus(event->hContact); + debugLogA("CVkProto::OnProcessSrmmEvent");
+ MessageWindowEventData *event = (MessageWindowEventData *)lParam;
+
+ if (event->uType == MSG_WINDOW_EVT_OPENING)
+ SetSrmmReadStatus(event->hContact);
return 0;
}
void CVkProto::SetSrmmReadStatus(MCONTACT hContact)
{
- time_t time = getDword(hContact, "LastMsgReadTime", 0); - if (!time) - return; - - TCHAR ttime[64]; - _locale_t locale = _create_locale(LC_ALL, ""); - _tcsftime_l(ttime, SIZEOF(ttime), _T("%X - %x"), localtime(&time), locale); - _free_locale(locale); - - StatusTextData st = { 0 }; - st.cbSize = sizeof(st); - st.hIcon = Skin_GetIconByHandle(GetIconHandle(IDI_READMSG)); - mir_sntprintf(st.tszText, SIZEOF(st.tszText), TranslateT("Message read: %s"), ttime); + time_t time = getDword(hContact, "LastMsgReadTime", 0);
+ if (!time)
+ return;
+
+ TCHAR ttime[64];
+ _locale_t locale = _create_locale(LC_ALL, "");
+ _tcsftime_l(ttime, SIZEOF(ttime), _T("%X - %x"), localtime(&time), locale);
+ _free_locale(locale);
+
+ StatusTextData st = { 0 };
+ st.cbSize = sizeof(st);
+ st.hIcon = Skin_GetIconByHandle(GetIconHandle(IDI_READMSG));
+ mir_sntprintf(st.tszText, SIZEOF(st.tszText), TranslateT("Message read: %s"), ttime);
CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hContact, (LPARAM)&st);
}
diff --git a/protocols/VKontakte/src/vk_feed.cpp b/protocols/VKontakte/src/vk_feed.cpp index 1c9daf9df9..4744a9e44b 100644 --- a/protocols/VKontakte/src/vk_feed.cpp +++ b/protocols/VKontakte/src/vk_feed.cpp @@ -631,9 +631,9 @@ void CVkProto::NewsClearHistory() return;
time_t tTime = time(NULL) - m_iNewsAutoClearHistoryInterval;
- HANDLE hDBEvent = db_event_first(hContact);
+ MEVENT hDBEvent = db_event_first(hContact);
while (hDBEvent) {
- HANDLE hDBEventNext = db_event_next(hContact, hDBEvent);
+ MEVENT hDBEventNext = db_event_next(hContact, hDBEvent);
DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get(hDBEvent, &dbei);
if (dbei.timestamp < tTime)
diff --git a/protocols/VKontakte/src/vk_history.cpp b/protocols/VKontakte/src/vk_history.cpp index f9d3ba4ac2..09715eac04 100644 --- a/protocols/VKontakte/src/vk_history.cpp +++ b/protocols/VKontakte/src/vk_history.cpp @@ -32,9 +32,9 @@ INT_PTR __cdecl CVkProto::SvcGetAllServerHistory(WPARAM hContact, LPARAM) if (userID == -1 || userID == VK_FEED_USER)
return 0;
- HANDLE hDBEvent = db_event_first(hContact);
+ MEVENT hDBEvent = db_event_first(hContact);
while (hDBEvent) {
- HANDLE hDBEventNext = db_event_next(hContact, hDBEvent);
+ MEVENT hDBEventNext = db_event_next(hContact, hDBEvent);
db_event_delete(hContact, hDBEvent);
hDBEvent = hDBEventNext;
}
@@ -102,9 +102,9 @@ void CVkProto::GetServerHistoryLastNDay(MCONTACT hContact, int NDay) time_t tTime = time(NULL) - 60 * 60 * 24 * NDay;
- HANDLE hDBEvent = db_event_first(hContact);
+ MEVENT hDBEvent = db_event_first(hContact);
while (hDBEvent) {
- HANDLE hDBEventNext = db_event_next(hContact, hDBEvent);
+ MEVENT hDBEventNext = db_event_next(hContact, hDBEvent);
DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get(hDBEvent, &dbei);
if (dbei.timestamp > tTime)
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index f3881cd76a..e952478e8a 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -677,7 +677,7 @@ void CVkProto::OnReceiveAuthRequest(NETLIBHTTPREQUEST *reply, AsyncHttpRequest * delete param;
}
-int CVkProto::Authorize(HANDLE hDbEvent)
+int CVkProto::Authorize(MEVENT hDbEvent)
{
debugLogA("CVkProto::Authorize");
if (!IsOnline())
@@ -689,7 +689,7 @@ int CVkProto::Authorize(HANDLE hDbEvent) return AuthRequest(hContact, NULL);
}
-int CVkProto::AuthDeny(HANDLE hDbEvent, const PROTOCHAR*)
+int CVkProto::AuthDeny(MEVENT hDbEvent, const PROTOCHAR*)
{
debugLogA("CVkProto::AuthDeny");
if (!IsOnline())
@@ -721,7 +721,7 @@ int CVkProto::UserIsTyping(MCONTACT hContact, int type) return 1;
}
-MCONTACT CVkProto::AddToListByEvent(int, int, HANDLE)
+MCONTACT CVkProto::AddToListByEvent(int, int, MEVENT)
{
return NULL;
}
diff --git a/protocols/VKontakte/src/vk_proto.h b/protocols/VKontakte/src/vk_proto.h index 1e29b642b7..c77952393e 100644 --- a/protocols/VKontakte/src/vk_proto.h +++ b/protocols/VKontakte/src/vk_proto.h @@ -250,10 +250,10 @@ struct CVkProto : public PROTO<CVkProto> //====================================================================================
virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr);
- virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent);
+ virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, MEVENT hDbEvent);
- virtual int __cdecl Authorize(HANDLE hDbEvent);
- virtual int __cdecl AuthDeny(HANDLE hDbEvent, const TCHAR *szReason);
+ virtual int __cdecl Authorize(MEVENT hDbEvent);
+ virtual int __cdecl AuthDeny(MEVENT hDbEvent, const TCHAR *szReason);
virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*);
virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR *szMessage);
@@ -403,7 +403,7 @@ struct CVkProto : public PROTO<CVkProto> void ApplyCookies(AsyncHttpRequest*);
void DBAddAuthRequest(const MCONTACT hContact);
- MCONTACT MContactFromDbEvent(HANDLE hDbEvent);
+ MCONTACT MContactFromDbEvent(MEVENT hDbEvent);
void SetMirVer(MCONTACT hContact, int platform);
diff --git a/protocols/WhatsApp/src/proto.cpp b/protocols/WhatsApp/src/proto.cpp index 50a4e5a389..d4eda7f973 100644 --- a/protocols/WhatsApp/src/proto.cpp +++ b/protocols/WhatsApp/src/proto.cpp @@ -131,7 +131,7 @@ int WhatsAppProto::AuthRequest(MCONTACT hContact, const PROTOCHAR *message) return this->RequestFriendship((WPARAM)hContact, NULL);
}
-int WhatsAppProto::Authorize(HANDLE hDbEvent)
+int WhatsAppProto::Authorize(MEVENT hDbEvent)
{
return 1;
}
diff --git a/protocols/WhatsApp/src/proto.h b/protocols/WhatsApp/src/proto.h index d3ba55b576..5f5416671f 100644 --- a/protocols/WhatsApp/src/proto.h +++ b/protocols/WhatsApp/src/proto.h @@ -33,10 +33,10 @@ public: //PROTO_INTERFACE
virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr);
- virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent) { return NULL; }
+ virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, MEVENT hDbEvent) { return NULL; }
- virtual int __cdecl Authorize(HANDLE hDbEvent);
- virtual int __cdecl AuthDeny(HANDLE hDbEvent, const PROTOCHAR* szReason) { return 1; }
+ virtual int __cdecl Authorize(MEVENT hDbEvent);
+ virtual int __cdecl AuthDeny(MEVENT hDbEvent, const PROTOCHAR* szReason) { return 1; }
virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*) { return 1; }
virtual int __cdecl AuthRequest(MCONTACT hContact, const PROTOCHAR* szMessage);
diff --git a/protocols/Yahoo/src/im.cpp b/protocols/Yahoo/src/im.cpp index 54a4d9d1cf..0da62a376a 100644 --- a/protocols/Yahoo/src/im.cpp +++ b/protocols/Yahoo/src/im.cpp @@ -108,7 +108,7 @@ void CYahooProto::ext_got_im(const char *me, const char *who, int protocol, cons pre.flags = (utf8) ? PREF_UTF : 0;
if (tm) {
- HANDLE hEvent = db_event_last(hContact);
+ MEVENT hEvent = db_event_last(hContact);
if (hEvent) { // contact has events
DWORD dummy;
diff --git a/protocols/Yahoo/src/proto.cpp b/protocols/Yahoo/src/proto.cpp index 4b75b0355c..020574af1b 100644 --- a/protocols/Yahoo/src/proto.cpp +++ b/protocols/Yahoo/src/proto.cpp @@ -137,7 +137,7 @@ MCONTACT CYahooProto::AddToList( int flags, PROTOSEARCHRESULT* psr ) return hContact;
}
-MCONTACT __cdecl CYahooProto::AddToListByEvent( int flags, int /*iContact*/, HANDLE hDbEvent )
+MCONTACT __cdecl CYahooProto::AddToListByEvent( int flags, int /*iContact*/, MEVENT hDbEvent )
{
debugLogA("[YahooAddToListByEvent]");
if (!m_bLoggedIn)
@@ -178,7 +178,7 @@ MCONTACT __cdecl CYahooProto::AddToListByEvent( int flags, int /*iContact*/, HAN ////////////////////////////////////////////////////////////////////////////////////////
// AuthAllow - processes the successful authorization
-int CYahooProto::Authorize( HANDLE hdbe )
+int CYahooProto::Authorize(MEVENT hdbe)
{
debugLogA("[YahooAuthAllow]");
if ( !m_bLoggedIn ) {
@@ -217,7 +217,7 @@ int CYahooProto::Authorize( HANDLE hdbe ) ////////////////////////////////////////////////////////////////////////////////////////
// AuthDeny - handles the unsuccessful authorization
-int CYahooProto::AuthDeny( HANDLE hdbe, const TCHAR* reason )
+int CYahooProto::AuthDeny(MEVENT hdbe, const TCHAR *reason)
{
debugLogA("[YahooAuthDeny]");
if ( !m_bLoggedIn )
diff --git a/protocols/Yahoo/src/proto.h b/protocols/Yahoo/src/proto.h index 1b7d1fd5c4..207351964f 100644 --- a/protocols/Yahoo/src/proto.h +++ b/protocols/Yahoo/src/proto.h @@ -26,10 +26,10 @@ struct CYahooProto : public PROTO<CYahooProto> //====================================================================================
virtual MCONTACT __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr );
- virtual MCONTACT __cdecl AddToListByEvent( int flags, int iContact, HANDLE hDbEvent );
+ virtual MCONTACT __cdecl AddToListByEvent( int flags, int iContact, MEVENT hDbEvent );
- virtual int __cdecl Authorize( HANDLE hDbEvent );
- virtual int __cdecl AuthDeny( HANDLE hDbEvent, const TCHAR* szReason );
+ virtual int __cdecl Authorize( MEVENT hDbEvent );
+ virtual int __cdecl AuthDeny( MEVENT hDbEvent, const TCHAR* szReason );
virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT* );
virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR* szMessage );
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));
}
|