diff options
Diffstat (limited to 'utilities.cpp')
-rw-r--r-- | utilities.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/utilities.cpp b/utilities.cpp index 7f59ce4..90f8a7e 100644 --- a/utilities.cpp +++ b/utilities.cpp @@ -74,9 +74,10 @@ struct hContact_entry void RemoveExcludedUsers() { HANDLE hContact; - hContact_entry first, *plist, *tmp; + hContact_entry *first, *plist, *tmp; hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); - plist = &first; + first = new hContact_entry; + plist = first; plist->hContact = INVALID_HANDLE_VALUE; if(hContact) { @@ -92,13 +93,13 @@ void RemoveExcludedUsers() } while(hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact, 0)) ; - plist = &first; + plist = first; while(plist->hContact != INVALID_HANDLE_VALUE) { CallService(MS_DB_CONTACT_DELETE, (WPARAM)plist->hContact, 0); tmp = plist; plist = plist->next; -// delete tmp; //something wrong here %) + delete tmp; } } } @@ -106,9 +107,10 @@ void RemoveExcludedUsers() void RemoveTemporaryUsers() { HANDLE hContact; - hContact_entry first, *plist, *tmp; + hContact_entry *first, *plist, *tmp; hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); - plist = &first; + first = new hContact_entry; + plist = first; plist->hContact = INVALID_HANDLE_VALUE; if(hContact) { @@ -124,13 +126,13 @@ void RemoveTemporaryUsers() } while(hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact, 0)) ; - plist = &first; + plist = first; while(plist->hContact != INVALID_HANDLE_VALUE) { CallService(MS_DB_CONTACT_DELETE, (WPARAM)plist->hContact, 0); tmp = plist; plist = plist->next; -// delete tmp; //something wrong here %) + delete tmp; } } } |