diff options
author | George Hazan <george.hazan@gmail.com> | 2014-02-11 19:30:58 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-02-11 19:30:58 +0000 |
commit | 0769aa40dd28fd616de393c6f14b85f762e515c2 (patch) | |
tree | 326c495cafdfe8822ebf627097d51b54b318b40a /plugins/Clist_modern/src/modern_clcidents.cpp | |
parent | a06fc0aa16053a91bf93a28020a46b78dca17ee1 (diff) |
shameful death of another 'HANDLE'
git-svn-id: http://svn.miranda-ng.org/main/trunk@8103 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern/src/modern_clcidents.cpp')
-rw-r--r-- | plugins/Clist_modern/src/modern_clcidents.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/plugins/Clist_modern/src/modern_clcidents.cpp b/plugins/Clist_modern/src/modern_clcidents.cpp index 93c5c3a9eb..e59870b5f3 100644 --- a/plugins/Clist_modern/src/modern_clcidents.cpp +++ b/plugins/Clist_modern/src/modern_clcidents.cpp @@ -104,12 +104,12 @@ int cliGetRowsPriorTo(ClcGroup *group,ClcGroup *subgroup,int contactIndex) return -1;
}
-int cliFindItem(HWND hwnd, ClcData *dat, HANDLE hItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible)
+int cliFindItem(HWND hwnd, ClcData *dat, DWORD dwItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible)
{
- return FindItem(hwnd, dat, (MCONTACT)hItem, contact, subgroup, isVisible, FALSE);
+ return FindItem(hwnd, dat, dwItem, contact, subgroup, isVisible, FALSE);
}
-int FindItem(HWND hwnd, ClcData *dat, MCONTACT hItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible, BOOL isIgnoreSubcontacts)
+int FindItem(HWND hwnd, ClcData *dat, DWORD dwItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible, BOOL isIgnoreSubcontacts)
{
int index = 0, i;
int nowVisible = 1;
@@ -138,9 +138,9 @@ int FindItem(HWND hwnd, ClcData *dat, MCONTACT hItem, ClcContact **contact, ClcG continue;
}
if (nowVisible) index++;
- if ((IsHContactGroup(hItem) && group->cl.items[group->scanIndex]->type == CLCIT_GROUP && ((UINT_PTR)hItem&~HCONTACT_ISGROUP) == group->cl.items[group->scanIndex]->groupId) ||
- (IsHContactContact(hItem) && group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && group->cl.items[group->scanIndex]->hContact == hItem) ||
- (IsHContactInfo(hItem) && group->cl.items[group->scanIndex]->type == CLCIT_INFO && group->cl.items[group->scanIndex]->hContact == (MCONTACT)((UINT_PTR)hItem&~HCONTACT_ISINFO)))
+ if ((IsHContactGroup(dwItem) && group->cl.items[group->scanIndex]->type == CLCIT_GROUP && (dwItem & ~HCONTACT_ISGROUP) == group->cl.items[group->scanIndex]->groupId) ||
+ (IsHContactContact(dwItem) && group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && group->cl.items[group->scanIndex]->hContact == dwItem) ||
+ (IsHContactInfo(dwItem) && group->cl.items[group->scanIndex]->type == CLCIT_INFO && group->cl.items[group->scanIndex]->hContact == (dwItem & ~HCONTACT_ISINFO)))
{
if (isVisible) {
if (!nowVisible) *isVisible = 0;
@@ -161,14 +161,11 @@ int FindItem(HWND hwnd, ClcData *dat, MCONTACT hItem, ClcContact **contact, ClcG return 1;
}
- if (!isIgnoreSubcontacts &&
- IsHContactContact(hItem) &&
- group->cl.items[group->scanIndex]->type == CLCIT_CONTACT &&
- group->cl.items[group->scanIndex]->SubAllocated > 0)
+ if (!isIgnoreSubcontacts && IsHContactContact(dwItem) && group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && group->cl.items[group->scanIndex]->SubAllocated > 0)
{
for (i=0; i < group->cl.items[group->scanIndex]->SubAllocated; i++)
{
- if (group->cl.items[group->scanIndex]->subcontacts[i].hContact == hItem)
+ if (group->cl.items[group->scanIndex]->subcontacts[i].hContact == dwItem)
{
#ifdef _DEBUG
if (IsBadWritePtr(&group->cl.items[group->scanIndex]->subcontacts[i], sizeof(ClcContact)))
|