summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-01-22 21:56:10 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-01-22 21:56:10 +0000
commitb1f964cbef02c1b3f127fb6a91f089c1cd9d0cf4 (patch)
tree1605399a3e66003235d9f75ec4d1460f923a6d11 /src/modules
parent1eae67789ffeebe0f77e02499ce2845c81e4790d (diff)
huh-huh... still need a check for wrong parameters passed (from borkra, zihrono levraha)
git-svn-id: http://svn.miranda-ng.org/main/trunk@7833 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/utils/windowlist.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/modules/utils/windowlist.cpp b/src/modules/utils/windowlist.cpp
index 1b3c3493ab..667af0322d 100644
--- a/src/modules/utils/windowlist.cpp
+++ b/src/modules/utils/windowlist.cpp
@@ -50,6 +50,7 @@ static INT_PTR DestroyWindowList(WPARAM wParam, LPARAM)
static INT_PTR AddToWindowList(WPARAM, LPARAM lParam)
{
+ if (lParam == 0) return 1;
WINDOWLISTENTRY *pEntry = (WINDOWLISTENTRY*)lParam;
TWindowList *pList = (TWindowList*)pEntry->hList;
pList->insert(new TWindowListItem(pEntry->hContact, pEntry->hwnd));
@@ -58,6 +59,7 @@ static INT_PTR AddToWindowList(WPARAM, LPARAM lParam)
static INT_PTR RemoveFromWindowList(WPARAM wParam, LPARAM lParam)
{
+ if (wParam == 0) return 1;
TWindowList &pList = *(TWindowList*)wParam;
for (int i = 0; i < pList.getCount(); i++) {
if (pList[i].hWnd == (HWND)lParam) {
@@ -70,15 +72,17 @@ static INT_PTR RemoveFromWindowList(WPARAM wParam, LPARAM lParam)
static INT_PTR FindInWindowList(WPARAM wParam, LPARAM lParam)
{
+ if (wParam == 0) return NULL;
TWindowList &pList = *(TWindowList*)wParam;
TWindowListItem *p = pList.find((TWindowListItem*)&lParam);
- return (p == NULL) ? 0 : (INT_PTR)p->hWnd;
+ return (p == NULL) ? NULL : (INT_PTR)p->hWnd;
}
static INT_PTR BroadcastToWindowList(WPARAM wParam, LPARAM lParam)
{
- MSG *msg = (MSG*)lParam;
+ if (wParam == 0 || lParam == 0) return NULL;
TWindowList &pList = *(TWindowList*)wParam;
+ MSG *msg = (MSG*)lParam;
for (int i = pList.getCount()-1; i >= 0; i--)
SendMessage(pList[i].hWnd, msg->message, msg->wParam, msg->lParam);
return 0;
@@ -86,8 +90,9 @@ static INT_PTR BroadcastToWindowList(WPARAM wParam, LPARAM lParam)
static INT_PTR BroadcastToWindowListAsync(WPARAM wParam, LPARAM lParam)
{
- MSG *msg = (MSG*)lParam;
+ if (wParam == 0 || lParam == 0) return NULL;
TWindowList &pList = *(TWindowList*)wParam;
+ MSG *msg = (MSG*)lParam;
for (int i = pList.getCount()-1; i >= 0; i--)
PostMessage(pList[i].hWnd, msg->message, msg->wParam, msg->lParam);
return 0;