shell32/autocomplete: Remove redundant memory initialization.

This commit is contained in:
Nikolay Sivov 2011-07-24 23:18:51 +04:00 committed by Alexandre Julliard
parent 5354b974a1
commit 46a2ec0209
1 changed files with 7 additions and 8 deletions

View File

@ -287,7 +287,7 @@ static HRESULT WINAPI IAutoComplete2_fnInit(
LONG len;
/* pwszRegKeyPath contains the key as well as the value, so we split */
key = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (lstrlenW(pwzsRegKeyPath)+1)*sizeof(WCHAR));
key = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(pwzsRegKeyPath)+1)*sizeof(WCHAR));
strcpyW(key, pwzsRegKeyPath);
value = strrchrW(key, '\\');
*value = 0;
@ -301,7 +301,7 @@ static HRESULT WINAPI IAutoComplete2_fnInit(
if (res == ERROR_SUCCESS) {
res = RegQueryValueW(hKey, value, result, &len);
if (res == ERROR_SUCCESS) {
This->quickComplete = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len*sizeof(WCHAR));
This->quickComplete = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
strcpyW(This->quickComplete, result);
}
RegCloseKey(hKey);
@ -310,7 +310,7 @@ static HRESULT WINAPI IAutoComplete2_fnInit(
}
if ((pwszQuickComplete) && (!This->quickComplete)) {
This->quickComplete = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (lstrlenW(pwszQuickComplete)+1)*sizeof(WCHAR));
This->quickComplete = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(pwszQuickComplete)+1)*sizeof(WCHAR));
lstrcpyW(This->quickComplete, pwszQuickComplete);
}
@ -493,7 +493,7 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam,
/* If quickComplete is set and control is pressed, replace the string */
control = GetKeyState(VK_CONTROL) & 0x8000;
if (control && This->quickComplete) {
hwndQCText = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
hwndQCText = HeapAlloc(GetProcessHeap(), 0,
(lstrlenW(This->quickComplete)+lstrlenW(hwndText))*sizeof(WCHAR));
sel = sprintfW(hwndQCText, This->quickComplete, hwndText);
SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)hwndQCText);
@ -536,7 +536,7 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam,
int len;
len = SendMessageW(This->hwndListBox, LB_GETTEXTLEN, sel, 0);
msg = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (len+1)*sizeof(WCHAR));
msg = HeapAlloc(GetProcessHeap(), 0, (len+1)*sizeof(WCHAR));
SendMessageW(This->hwndListBox, LB_GETTEXT, sel, (LPARAM)msg);
SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)msg);
SendMessageW(hwnd, EM_SETSEL, lstrlenW(msg), lstrlenW(msg));
@ -573,8 +573,7 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam,
SendMessageW(This->hwndListBox, LB_RESETCONTENT, 0, 0);
HeapFree(GetProcessHeap(), 0, This->txtbackup);
This->txtbackup = HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY, (lstrlenW(hwndText)+1)*sizeof(WCHAR));
This->txtbackup = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(hwndText)+1)*sizeof(WCHAR));
lstrcpyW(This->txtbackup, hwndText);
/* Returns if there is no text to search and we doesn't want to display all the entries */
@ -664,7 +663,7 @@ static LRESULT APIENTRY ACLBoxSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam,
if (sel < 0)
break;
len = SendMessageW(This->hwndListBox, LB_GETTEXTLEN, sel, 0);
msg = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (len+1)*sizeof(WCHAR));
msg = HeapAlloc(GetProcessHeap(), 0, (len+1)*sizeof(WCHAR));
SendMessageW(hwnd, LB_GETTEXT, sel, (LPARAM)msg);
SendMessageW(This->hwndEdit, WM_SETTEXT, 0, (LPARAM)msg);
SendMessageW(This->hwndEdit, EM_SETSEL, 0, lstrlenW(msg));