diff options
author | George Hazan <ghazan@miranda.im> | 2017-03-28 14:21:33 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-03-28 14:21:33 +0300 |
commit | eccbb5307a048e70ac4adb0d3fd333be28245fa8 (patch) | |
tree | a9a2c92c13391a5cf288c9e0d841833c54f3cd5e /src/core | |
parent | 6a9e3738066370dac38f5f6768b8a6f61fe709e0 (diff) |
massive cleanup of useless cbSize fields
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/stdmsg/src/cmdlist.cpp | 2 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgs.cpp | 16 |
2 files changed, 8 insertions, 10 deletions
diff --git a/src/core/stdmsg/src/cmdlist.cpp b/src/core/stdmsg/src/cmdlist.cpp index d334eb19ef..9c615e3271 100644 --- a/src/core/stdmsg/src/cmdlist.cpp +++ b/src/core/stdmsg/src/cmdlist.cpp @@ -100,7 +100,7 @@ void msgQueue_processack(MCONTACT hContact, int id, BOOL success, const char *sz dbei.cbBlob = (DWORD)(mir_strlen(p->szMsg) + 1);
dbei.pBlob = (PBYTE)p->szMsg;
- MessageWindowEvent evt = { sizeof(evt), id, hContact, &dbei };
+ MessageWindowEvent evt = { id, hContact, &dbei };
NotifyEventHooks(hHookWinWrite, 0, (LPARAM)&evt);
p->szMsg = (char*)dbei.pBlob;
diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index 0c049ff6f6..48b8832a70 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -30,7 +30,7 @@ const CLSID IID_IRichEditOleCallback = { 0x00020D03, 0x00, 0x00, { 0xC0, 0x00, 0 int OnCheckPlugins(WPARAM, LPARAM);
-HANDLE hHookWinEvt, hHookWinPopup, hHookWinWrite;
+HANDLE hHookWinPopup, hHookWinWrite;
HGENMENU hMsgMenuItem;
HMODULE hMsftEdit;
@@ -479,6 +479,10 @@ static int PrebuildContactMenu(WPARAM hContact, LPARAM) static INT_PTR SetStatusText(WPARAM wParam, LPARAM lParam)
{
+ StatusTextData *st = (StatusTextData*)lParam;
+ if (st == NULL)
+ return 1;
+
HWND hwnd = WindowList_Find(pci->hWindowList, wParam);
if (hwnd == NULL)
return 1;
@@ -487,10 +491,6 @@ static INT_PTR SetStatusText(WPARAM wParam, LPARAM lParam) if (dat == NULL)
return 1;
- StatusTextData *st = (StatusTextData*)lParam;
- if (st != NULL && st->cbSize != sizeof(StatusTextData))
- return 1;
-
dat->SetStatusData(st);
return 0;
}
@@ -498,11 +498,11 @@ static INT_PTR SetStatusText(WPARAM wParam, LPARAM lParam) static INT_PTR GetWindowData(WPARAM wParam, LPARAM lParam)
{
MessageWindowInputData *mwid = (MessageWindowInputData*)wParam;
- if (mwid == NULL || (mwid->cbSize != sizeof(MessageWindowInputData)) || (mwid->hContact == NULL) || (mwid->uFlags != MSG_WINDOW_UFLAG_MSG_BOTH))
+ if (mwid == NULL || mwid->hContact == 0 || mwid->uFlags != MSG_WINDOW_UFLAG_MSG_BOTH)
return 1;
MessageWindowData *mwd = (MessageWindowData*)lParam;
- if(mwd == NULL || (mwd->cbSize != sizeof(MessageWindowData)))
+ if(mwd == NULL)
return 1;
HWND hwnd = WindowList_Find(pci->hWindowList, mwid->hContact);
@@ -547,7 +547,6 @@ int LoadSendRecvMessageModule(void) CreateServiceFunction(MS_MSG_SETSTATUSTEXT, SetStatusText);
CreateServiceFunction("SRMsg/ReadMessage", ReadMessageCommand);
- hHookWinEvt = CreateHookableEvent(ME_MSG_WINDOWEVENT);
hHookWinPopup = CreateHookableEvent(ME_MSG_WINDOWPOPUP);
hHookWinWrite = CreateHookableEvent(ME_MSG_PRECREATEEVENT);
@@ -565,7 +564,6 @@ int LoadSendRecvMessageModule(void) void SplitmsgShutdown(void)
{
- DestroyHookableEvent(hHookWinEvt);
DestroyHookableEvent(hHookWinPopup);
DestroyHookableEvent(hHookWinWrite);
|