Commit 7df4a81f authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

shell32: Use CRT allocation functions.

parent 4d6d580b
...@@ -247,7 +247,7 @@ static HRESULT WINAPI IQueryAssociations_fnInit( ...@@ -247,7 +247,7 @@ static HRESULT WINAPI IQueryAssociations_fnInit(
0, 0,
KEY_READ, KEY_READ,
&This->hkeyProgID); &This->hkeyProgID);
heap_free(progId); free(progId);
return S_OK; return S_OK;
} }
...@@ -272,13 +272,13 @@ static HRESULT ASSOC_GetValue(HKEY hkey, const WCHAR *name, void **data, DWORD * ...@@ -272,13 +272,13 @@ static HRESULT ASSOC_GetValue(HKEY hkey, const WCHAR *name, void **data, DWORD *
return HRESULT_FROM_WIN32(ret); return HRESULT_FROM_WIN32(ret);
if (!size) if (!size)
return E_FAIL; return E_FAIL;
*data = heap_alloc(size); *data = malloc(size);
if (!*data) if (!*data)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
ret = RegQueryValueExW(hkey, name, 0, NULL, (LPBYTE)*data, &size); ret = RegQueryValueExW(hkey, name, 0, NULL, (LPBYTE)*data, &size);
if (ret != ERROR_SUCCESS) if (ret != ERROR_SUCCESS)
{ {
heap_free(*data); free(*data);
return HRESULT_FROM_WIN32(ret); return HRESULT_FROM_WIN32(ret);
} }
if(data_size) if(data_size)
...@@ -304,7 +304,7 @@ static HRESULT ASSOC_GetCommand(IQueryAssociationsImpl *This, const WCHAR *extra ...@@ -304,7 +304,7 @@ static HRESULT ASSOC_GetCommand(IQueryAssociationsImpl *This, const WCHAR *extra
HKEY hkeyFile; HKEY hkeyFile;
ret = RegOpenKeyExW(HKEY_CLASSES_ROOT, filetype, 0, KEY_READ, &hkeyFile); ret = RegOpenKeyExW(HKEY_CLASSES_ROOT, filetype, 0, KEY_READ, &hkeyFile);
heap_free(filetype); free(filetype);
if (ret == ERROR_SUCCESS) if (ret == ERROR_SUCCESS)
{ {
...@@ -336,7 +336,7 @@ static HRESULT ASSOC_GetCommand(IQueryAssociationsImpl *This, const WCHAR *extra ...@@ -336,7 +336,7 @@ static HRESULT ASSOC_GetCommand(IQueryAssociationsImpl *This, const WCHAR *extra
} }
max_subkey_len++; max_subkey_len++;
extra_from_reg = heap_alloc(max_subkey_len * sizeof(WCHAR)); extra_from_reg = malloc(max_subkey_len * sizeof(WCHAR));
if (!extra_from_reg) if (!extra_from_reg)
{ {
RegCloseKey(hkeyShell); RegCloseKey(hkeyShell);
...@@ -346,7 +346,7 @@ static HRESULT ASSOC_GetCommand(IQueryAssociationsImpl *This, const WCHAR *extra ...@@ -346,7 +346,7 @@ static HRESULT ASSOC_GetCommand(IQueryAssociationsImpl *This, const WCHAR *extra
ret = RegEnumKeyExW(hkeyShell, 0, extra_from_reg, &max_subkey_len, NULL, NULL, NULL, NULL); ret = RegEnumKeyExW(hkeyShell, 0, extra_from_reg, &max_subkey_len, NULL, NULL, NULL, NULL);
if (ret) if (ret)
{ {
heap_free(extra_from_reg); free(extra_from_reg);
RegCloseKey(hkeyShell); RegCloseKey(hkeyShell);
return HRESULT_FROM_WIN32(ret); return HRESULT_FROM_WIN32(ret);
} }
...@@ -356,7 +356,7 @@ static HRESULT ASSOC_GetCommand(IQueryAssociationsImpl *This, const WCHAR *extra ...@@ -356,7 +356,7 @@ static HRESULT ASSOC_GetCommand(IQueryAssociationsImpl *This, const WCHAR *extra
/* open verb subkey */ /* open verb subkey */
ret = RegOpenKeyExW(hkeyShell, extra, 0, KEY_READ, &hkeyVerb); ret = RegOpenKeyExW(hkeyShell, extra, 0, KEY_READ, &hkeyVerb);
heap_free(extra_from_reg); free(extra_from_reg);
RegCloseKey(hkeyShell); RegCloseKey(hkeyShell);
if (ret) return HRESULT_FROM_WIN32(ret); if (ret) return HRESULT_FROM_WIN32(ret);
...@@ -407,7 +407,7 @@ static HRESULT ASSOC_GetExecutable(IQueryAssociationsImpl *This, ...@@ -407,7 +407,7 @@ static HRESULT ASSOC_GetExecutable(IQueryAssociationsImpl *This,
*len = SearchPathW(NULL, pszStart, NULL, pathlen, path, NULL); *len = SearchPathW(NULL, pszStart, NULL, pathlen, path, NULL);
} }
heap_free(pszCommand); free(pszCommand);
if (!*len) if (!*len)
return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND); return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
return S_OK; return S_OK;
...@@ -522,7 +522,7 @@ static HRESULT WINAPI IQueryAssociations_fnGetString( ...@@ -522,7 +522,7 @@ static HRESULT WINAPI IQueryAssociations_fnGetString(
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
{ {
hr = ASSOC_ReturnString(flags, pszOut, pcchOut, command, lstrlenW(command) + 1); hr = ASSOC_ReturnString(flags, pszOut, pcchOut, command, lstrlenW(command) + 1);
heap_free(command); free(command);
} }
return hr; return hr;
} }
...@@ -546,7 +546,7 @@ static HRESULT WINAPI IQueryAssociations_fnGetString( ...@@ -546,7 +546,7 @@ static HRESULT WINAPI IQueryAssociations_fnGetString(
return HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION); return HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION);
} }
hr = ASSOC_ReturnString(flags, pszOut, pcchOut, docName, lstrlenW(docName) + 1); hr = ASSOC_ReturnString(flags, pszOut, pcchOut, docName, lstrlenW(docName) + 1);
heap_free(docName); free(docName);
return hr; return hr;
} }
...@@ -565,7 +565,7 @@ static HRESULT WINAPI IQueryAssociations_fnGetString( ...@@ -565,7 +565,7 @@ static HRESULT WINAPI IQueryAssociations_fnGetString(
retval = GetFileVersionInfoSizeW(path, &size); retval = GetFileVersionInfoSizeW(path, &size);
if (!retval) if (!retval)
goto get_friendly_name_fail; goto get_friendly_name_fail;
verinfoW = heap_alloc_zero(retval); verinfoW = calloc(1, retval);
if (!verinfoW) if (!verinfoW)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
if (!GetFileVersionInfoW(path, 0, retval, verinfoW)) if (!GetFileVersionInfoW(path, 0, retval, verinfoW))
...@@ -584,7 +584,7 @@ static HRESULT WINAPI IQueryAssociations_fnGetString( ...@@ -584,7 +584,7 @@ static HRESULT WINAPI IQueryAssociations_fnGetString(
len = lstrlenW(bufW) + 1; len = lstrlenW(bufW) + 1;
TRACE("found FileDescription: %s\n", debugstr_w(bufW)); TRACE("found FileDescription: %s\n", debugstr_w(bufW));
hr = ASSOC_ReturnString(flags, pszOut, pcchOut, bufW, len); hr = ASSOC_ReturnString(flags, pszOut, pcchOut, bufW, len);
heap_free(verinfoW); free(verinfoW);
return hr; return hr;
} }
} }
...@@ -594,7 +594,7 @@ get_friendly_name_fail: ...@@ -594,7 +594,7 @@ get_friendly_name_fail:
PathStripPathW(path); PathStripPathW(path);
TRACE("using filename: %s\n", debugstr_w(path)); TRACE("using filename: %s\n", debugstr_w(path));
hr = ASSOC_ReturnString(flags, pszOut, pcchOut, path, lstrlenW(path) + 1); hr = ASSOC_ReturnString(flags, pszOut, pcchOut, path, lstrlenW(path) + 1);
heap_free(verinfoW); free(verinfoW);
return hr; return hr;
} }
...@@ -608,7 +608,7 @@ get_friendly_name_fail: ...@@ -608,7 +608,7 @@ get_friendly_name_fail:
ret = RegGetValueW(This->hkeySource, NULL, L"Content Type", RRF_RT_REG_SZ, NULL, NULL, &size); ret = RegGetValueW(This->hkeySource, NULL, L"Content Type", RRF_RT_REG_SZ, NULL, NULL, &size);
if (ret != ERROR_SUCCESS) if (ret != ERROR_SUCCESS)
return HRESULT_FROM_WIN32(ret); return HRESULT_FROM_WIN32(ret);
contentType = heap_alloc(size); contentType = malloc(size);
if (contentType != NULL) if (contentType != NULL)
{ {
ret = RegGetValueW(This->hkeySource, NULL, L"Content Type", RRF_RT_REG_SZ, NULL, contentType, &size); ret = RegGetValueW(This->hkeySource, NULL, L"Content Type", RRF_RT_REG_SZ, NULL, contentType, &size);
...@@ -616,7 +616,7 @@ get_friendly_name_fail: ...@@ -616,7 +616,7 @@ get_friendly_name_fail:
hr = ASSOC_ReturnString(flags, pszOut, pcchOut, contentType, lstrlenW(contentType) + 1); hr = ASSOC_ReturnString(flags, pszOut, pcchOut, contentType, lstrlenW(contentType) + 1);
else else
hr = HRESULT_FROM_WIN32(ret); hr = HRESULT_FROM_WIN32(ret);
heap_free(contentType); free(contentType);
} }
else else
hr = E_OUTOFMEMORY; hr = E_OUTOFMEMORY;
...@@ -632,7 +632,7 @@ get_friendly_name_fail: ...@@ -632,7 +632,7 @@ get_friendly_name_fail:
ret = RegGetValueW(This->hkeyProgID, L"DefaultIcon", NULL, RRF_RT_REG_SZ, NULL, NULL, &size); ret = RegGetValueW(This->hkeyProgID, L"DefaultIcon", NULL, RRF_RT_REG_SZ, NULL, NULL, &size);
if (ret == ERROR_SUCCESS) if (ret == ERROR_SUCCESS)
{ {
WCHAR *icon = heap_alloc(size); WCHAR *icon = malloc(size);
if (icon) if (icon)
{ {
ret = RegGetValueW(This->hkeyProgID, L"DefaultIcon", NULL, RRF_RT_REG_SZ, NULL, icon, &size); ret = RegGetValueW(This->hkeyProgID, L"DefaultIcon", NULL, RRF_RT_REG_SZ, NULL, icon, &size);
...@@ -640,7 +640,7 @@ get_friendly_name_fail: ...@@ -640,7 +640,7 @@ get_friendly_name_fail:
hr = ASSOC_ReturnString(flags, pszOut, pcchOut, icon, lstrlenW(icon) + 1); hr = ASSOC_ReturnString(flags, pszOut, pcchOut, icon, lstrlenW(icon) + 1);
else else
hr = HRESULT_FROM_WIN32(ret); hr = HRESULT_FROM_WIN32(ret);
heap_free(icon); free(icon);
} }
else else
hr = E_OUTOFMEMORY; hr = E_OUTOFMEMORY;
...@@ -753,7 +753,7 @@ static HRESULT WINAPI IQueryAssociations_fnGetData(IQueryAssociations *iface, ...@@ -753,7 +753,7 @@ static HRESULT WINAPI IQueryAssociations_fnGetData(IQueryAssociations *iface,
hres = ASSOC_GetValue(This->hkeyProgID, L"EditFlags", &data, &size); hres = ASSOC_GetValue(This->hkeyProgID, L"EditFlags", &data, &size);
if(SUCCEEDED(hres) && pcbOut) if(SUCCEEDED(hres) && pcbOut)
hres = ASSOC_ReturnData(pvOut, pcbOut, data, size); hres = ASSOC_ReturnData(pvOut, pcbOut, data, size);
heap_free(data); free(data);
return hres; return hres;
default: default:
FIXME("Unsupported ASSOCDATA value: %d\n", assocdata); FIXME("Unsupported ASSOCDATA value: %d\n", assocdata);
......
...@@ -209,7 +209,7 @@ static void enumerate_strings(IAutoCompleteImpl *ac, enum prefix_filtering pfx_f ...@@ -209,7 +209,7 @@ static void enumerate_strings(IAutoCompleteImpl *ac, enum prefix_filtering pfx_f
do do
{ {
if ((tmp = heap_realloc(strs, array_size * sizeof(*strs))) == NULL) if ((tmp = realloc(strs, array_size * sizeof(*strs))) == NULL)
goto fail; goto fail;
strs = tmp; strs = tmp;
...@@ -223,7 +223,7 @@ static void enumerate_strings(IAutoCompleteImpl *ac, enum prefix_filtering pfx_f ...@@ -223,7 +223,7 @@ static void enumerate_strings(IAutoCompleteImpl *ac, enum prefix_filtering pfx_f
} while (read != 0); } while (read != 0);
/* Allocate even if there were zero strings enumerated, to mark it non-NULL */ /* Allocate even if there were zero strings enumerated, to mark it non-NULL */
if ((tmp = heap_realloc(strs, cur * sizeof(*strs)))) if ((tmp = realloc(strs, cur * sizeof(*strs))))
{ {
strs = tmp; strs = tmp;
if (cur > 0) if (cur > 0)
...@@ -237,7 +237,7 @@ static void enumerate_strings(IAutoCompleteImpl *ac, enum prefix_filtering pfx_f ...@@ -237,7 +237,7 @@ static void enumerate_strings(IAutoCompleteImpl *ac, enum prefix_filtering pfx_f
fail: fail:
while (cur--) while (cur--)
CoTaskMemFree(strs[cur]); CoTaskMemFree(strs[cur]);
heap_free(strs); free(strs);
} }
static UINT find_matching_enum_str(IAutoCompleteImpl *ac, UINT start, WCHAR *text, static UINT find_matching_enum_str(IAutoCompleteImpl *ac, UINT start, WCHAR *text,
...@@ -269,7 +269,7 @@ static void free_enum_strs(IAutoCompleteImpl *ac) ...@@ -269,7 +269,7 @@ static void free_enum_strs(IAutoCompleteImpl *ac)
ac->enum_strs = NULL; ac->enum_strs = NULL;
while (i--) while (i--)
CoTaskMemFree(strs[i]); CoTaskMemFree(strs[i]);
heap_free(strs); free(strs);
} }
} }
...@@ -519,7 +519,7 @@ static void autoappend_str(IAutoCompleteImpl *ac, WCHAR *text, UINT len, WCHAR * ...@@ -519,7 +519,7 @@ static void autoappend_str(IAutoCompleteImpl *ac, WCHAR *text, UINT len, WCHAR *
so merge text and str into a new string */ so merge text and str into a new string */
size = len + lstrlenW(&str[len]) + 1; size = len + lstrlenW(&str[len]) + 1;
if ((tmp = heap_alloc(size * sizeof(*tmp)))) if ((tmp = malloc(size * sizeof(*tmp))))
{ {
memcpy(tmp, text, len * sizeof(*tmp)); memcpy(tmp, text, len * sizeof(*tmp));
memcpy(&tmp[len], &str[len], (size - len) * sizeof(*tmp)); memcpy(&tmp[len], &str[len], (size - len) * sizeof(*tmp));
...@@ -528,7 +528,7 @@ static void autoappend_str(IAutoCompleteImpl *ac, WCHAR *text, UINT len, WCHAR * ...@@ -528,7 +528,7 @@ static void autoappend_str(IAutoCompleteImpl *ac, WCHAR *text, UINT len, WCHAR *
set_text_and_selection(ac, hwnd, tmp, len, size - 1); set_text_and_selection(ac, hwnd, tmp, len, size - 1);
if (tmp != str) if (tmp != str)
heap_free(tmp); free(tmp);
} }
static BOOL display_matching_strs(IAutoCompleteImpl *ac, WCHAR *text, UINT len, static BOOL display_matching_strs(IAutoCompleteImpl *ac, WCHAR *text, UINT len,
...@@ -608,7 +608,7 @@ static void autocomplete_text(IAutoCompleteImpl *ac, HWND hwnd, enum autoappend_ ...@@ -608,7 +608,7 @@ static void autocomplete_text(IAutoCompleteImpl *ac, HWND hwnd, enum autoappend_
} }
size = len + 1; size = len + 1;
if (!(text = heap_alloc(size * sizeof(WCHAR)))) if (!(text = malloc(size * sizeof(WCHAR))))
{ {
/* Reset the listbox to prevent potential crash from ResetEnumerator */ /* Reset the listbox to prevent potential crash from ResetEnumerator */
SendMessageW(ac->hwndListBox, LB_RESETCONTENT, 0, 0); SendMessageW(ac->hwndListBox, LB_RESETCONTENT, 0, 0);
...@@ -616,7 +616,7 @@ static void autocomplete_text(IAutoCompleteImpl *ac, HWND hwnd, enum autoappend_ ...@@ -616,7 +616,7 @@ static void autocomplete_text(IAutoCompleteImpl *ac, HWND hwnd, enum autoappend_
} }
len = SendMessageW(hwnd, WM_GETTEXT, size, (LPARAM)text); len = SendMessageW(hwnd, WM_GETTEXT, size, (LPARAM)text);
if (len + 1 != size) if (len + 1 != size)
text = heap_realloc(text, (len + 1) * sizeof(WCHAR)); text = realloc(text, (len + 1) * sizeof(WCHAR));
if (ac->aclist) if (ac->aclist)
{ {
...@@ -634,7 +634,7 @@ static void autocomplete_text(IAutoCompleteImpl *ac, HWND hwnd, enum autoappend_ ...@@ -634,7 +634,7 @@ static void autocomplete_text(IAutoCompleteImpl *ac, HWND hwnd, enum autoappend_
/* Set txtbackup to point to text itself (which must not be released), /* Set txtbackup to point to text itself (which must not be released),
and it must be done here since aclist_expand uses it to track changes */ and it must be done here since aclist_expand uses it to track changes */
heap_free(ac->txtbackup); free(ac->txtbackup);
ac->txtbackup = text; ac->txtbackup = text;
if (!display_matching_strs(ac, text, len, pfx_filter, hwnd, flag)) if (!display_matching_strs(ac, text, len, pfx_filter, hwnd, flag))
...@@ -676,21 +676,21 @@ static LRESULT ACEditSubclassProc_KeyDown(IAutoCompleteImpl *ac, HWND hwnd, UINT ...@@ -676,21 +676,21 @@ static LRESULT ACEditSubclassProc_KeyDown(IAutoCompleteImpl *ac, HWND hwnd, UINT
UINT len = SendMessageW(hwnd, WM_GETTEXTLENGTH, 0, 0); UINT len = SendMessageW(hwnd, WM_GETTEXTLENGTH, 0, 0);
ac->no_fwd_char = '\n'; /* CTRL+RETURN char */ ac->no_fwd_char = '\n'; /* CTRL+RETURN char */
if (!(text = heap_alloc((len + 1) * sizeof(WCHAR)))) if (!(text = malloc((len + 1) * sizeof(WCHAR))))
return 0; return 0;
len = SendMessageW(hwnd, WM_GETTEXT, len + 1, (LPARAM)text); len = SendMessageW(hwnd, WM_GETTEXT, len + 1, (LPARAM)text);
sz = lstrlenW(ac->quickComplete) + 1 + len; sz = lstrlenW(ac->quickComplete) + 1 + len;
if ((buf = heap_alloc(sz * sizeof(WCHAR)))) if ((buf = malloc(sz * sizeof(WCHAR))))
{ {
len = format_quick_complete(buf, ac->quickComplete, text, len); len = format_quick_complete(buf, ac->quickComplete, text, len);
set_text_and_selection(ac, hwnd, buf, 0, len); set_text_and_selection(ac, hwnd, buf, 0, len);
heap_free(buf); free(buf);
} }
if (ac->options & ACO_AUTOSUGGEST) if (ac->options & ACO_AUTOSUGGEST)
hide_listbox(ac, ac->hwndListBox, TRUE); hide_listbox(ac, ac->hwndListBox, TRUE);
heap_free(text); free(text);
return 0; return 0;
} }
...@@ -970,13 +970,13 @@ static ULONG WINAPI IAutoComplete2_fnRelease( ...@@ -970,13 +970,13 @@ static ULONG WINAPI IAutoComplete2_fnRelease(
if (!refCount) { if (!refCount) {
TRACE("destroying IAutoComplete(%p)\n", This); TRACE("destroying IAutoComplete(%p)\n", This);
heap_free(This->quickComplete); free(This->quickComplete);
heap_free(This->txtbackup); free(This->txtbackup);
if (This->enumstr) if (This->enumstr)
IEnumString_Release(This->enumstr); IEnumString_Release(This->enumstr);
if (This->aclist) if (This->aclist)
IACList_Release(This->aclist); IACList_Release(This->aclist);
heap_free(This); free(This);
} }
return refCount; return refCount;
} }
...@@ -1032,7 +1032,7 @@ static HRESULT WINAPI IAutoComplete2_fnInit( ...@@ -1032,7 +1032,7 @@ static HRESULT WINAPI IAutoComplete2_fnInit(
} }
/* Prevent txtbackup from ever being NULL to simplify aclist_expand */ /* Prevent txtbackup from ever being NULL to simplify aclist_expand */
if ((This->txtbackup = heap_alloc_zero(sizeof(WCHAR))) == NULL) if ((This->txtbackup = calloc(1, sizeof(WCHAR))) == NULL)
{ {
IEnumString_Release(This->enumstr); IEnumString_Release(This->enumstr);
This->enumstr = NULL; This->enumstr = NULL;
...@@ -1079,7 +1079,7 @@ static HRESULT WINAPI IAutoComplete2_fnInit( ...@@ -1079,7 +1079,7 @@ static HRESULT WINAPI IAutoComplete2_fnInit(
value = wcsrchr(pwzsRegKeyPath, '\\'); value = wcsrchr(pwzsRegKeyPath, '\\');
len = value - pwzsRegKeyPath; len = value - pwzsRegKeyPath;
if (value && (key = heap_alloc((len+1) * sizeof(*key))) != NULL) if (value && (key = malloc((len + 1) * sizeof(*key))) != NULL)
{ {
memcpy(key, pwzsRegKeyPath, len * sizeof(*key)); memcpy(key, pwzsRegKeyPath, len * sizeof(*key));
key[len] = '\0'; key[len] = '\0';
...@@ -1091,29 +1091,29 @@ static HRESULT WINAPI IAutoComplete2_fnInit( ...@@ -1091,29 +1091,29 @@ static HRESULT WINAPI IAutoComplete2_fnInit(
continue; continue;
sz = MAX_PATH * sizeof(WCHAR); sz = MAX_PATH * sizeof(WCHAR);
while ((qc = heap_alloc(sz)) != NULL) while ((qc = malloc(sz)) != NULL)
{ {
res = RegQueryValueExW(hKey, value, NULL, &type, qc, &sz); res = RegQueryValueExW(hKey, value, NULL, &type, qc, &sz);
if (res == ERROR_SUCCESS && type == REG_SZ) if (res == ERROR_SUCCESS && type == REG_SZ)
{ {
This->quickComplete = heap_realloc(qc, sz); This->quickComplete = realloc(qc, sz);
i = ARRAY_SIZE(roots); i = ARRAY_SIZE(roots);
break; break;
} }
heap_free(qc); free(qc);
if (res != ERROR_MORE_DATA || type != REG_SZ) if (res != ERROR_MORE_DATA || type != REG_SZ)
break; break;
} }
RegCloseKey(hKey); RegCloseKey(hKey);
} }
heap_free(key); free(key);
} }
} }
if (!This->quickComplete && pwszQuickComplete) if (!This->quickComplete && pwszQuickComplete)
{ {
size_t len = lstrlenW(pwszQuickComplete)+1; size_t len = lstrlenW(pwszQuickComplete)+1;
if ((This->quickComplete = heap_alloc(len * sizeof(WCHAR))) != NULL) if ((This->quickComplete = malloc(len * sizeof(WCHAR))) != NULL)
memcpy(This->quickComplete, pwszQuickComplete, len * sizeof(WCHAR)); memcpy(This->quickComplete, pwszQuickComplete, len * sizeof(WCHAR));
} }
...@@ -1285,7 +1285,7 @@ HRESULT WINAPI IAutoComplete_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVO ...@@ -1285,7 +1285,7 @@ HRESULT WINAPI IAutoComplete_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVO
if (pUnkOuter && !IsEqualIID (riid, &IID_IUnknown)) if (pUnkOuter && !IsEqualIID (riid, &IID_IUnknown))
return CLASS_E_NOAGGREGATION; return CLASS_E_NOAGGREGATION;
lpac = heap_alloc_zero(sizeof(*lpac)); lpac = calloc(1, sizeof(*lpac));
if (!lpac) if (!lpac)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
......
...@@ -1000,13 +1000,13 @@ static BOOL BrsFolder_OnSetSelectionA(browse_info *info, LPVOID selection, BOOL ...@@ -1000,13 +1000,13 @@ static BOOL BrsFolder_OnSetSelectionA(browse_info *info, LPVOID selection, BOOL
return BrsFolder_OnSetSelectionW(info, selection, is_str); return BrsFolder_OnSetSelectionW(info, selection, is_str);
if ((length = MultiByteToWideChar(CP_ACP, 0, selection, -1, NULL, 0)) && if ((length = MultiByteToWideChar(CP_ACP, 0, selection, -1, NULL, 0)) &&
(selectionW = heap_alloc(length * sizeof(WCHAR))) && (selectionW = malloc(length * sizeof(WCHAR))) &&
MultiByteToWideChar(CP_ACP, 0, selection, -1, selectionW, length)) MultiByteToWideChar(CP_ACP, 0, selection, -1, selectionW, length))
{ {
result = BrsFolder_OnSetSelectionW(info, selectionW, is_str); result = BrsFolder_OnSetSelectionW(info, selectionW, is_str);
} }
heap_free(selectionW); free(selectionW);
return result; return result;
} }
...@@ -1173,14 +1173,14 @@ LPITEMIDLIST WINAPI SHBrowseForFolderA (LPBROWSEINFOA lpbi) ...@@ -1173,14 +1173,14 @@ LPITEMIDLIST WINAPI SHBrowseForFolderA (LPBROWSEINFOA lpbi)
bi.hwndOwner = lpbi->hwndOwner; bi.hwndOwner = lpbi->hwndOwner;
bi.pidlRoot = lpbi->pidlRoot; bi.pidlRoot = lpbi->pidlRoot;
if (lpbi->pszDisplayName) if (lpbi->pszDisplayName)
bi.pszDisplayName = heap_alloc( MAX_PATH * sizeof(WCHAR) ); bi.pszDisplayName = malloc( MAX_PATH * sizeof(WCHAR) );
else else
bi.pszDisplayName = NULL; bi.pszDisplayName = NULL;
if (lpbi->lpszTitle) if (lpbi->lpszTitle)
{ {
len = MultiByteToWideChar( CP_ACP, 0, lpbi->lpszTitle, -1, NULL, 0 ); len = MultiByteToWideChar( CP_ACP, 0, lpbi->lpszTitle, -1, NULL, 0 );
title = heap_alloc( len * sizeof(WCHAR) ); title = malloc( len * sizeof(WCHAR) );
MultiByteToWideChar( CP_ACP, 0, lpbi->lpszTitle, -1, title, len ); MultiByteToWideChar( CP_ACP, 0, lpbi->lpszTitle, -1, title, len );
} }
else else
...@@ -1196,9 +1196,9 @@ LPITEMIDLIST WINAPI SHBrowseForFolderA (LPBROWSEINFOA lpbi) ...@@ -1196,9 +1196,9 @@ LPITEMIDLIST WINAPI SHBrowseForFolderA (LPBROWSEINFOA lpbi)
{ {
WideCharToMultiByte( CP_ACP, 0, bi.pszDisplayName, -1, WideCharToMultiByte( CP_ACP, 0, bi.pszDisplayName, -1,
lpbi->pszDisplayName, MAX_PATH, 0, NULL); lpbi->pszDisplayName, MAX_PATH, 0, NULL);
heap_free( bi.pszDisplayName ); free( bi.pszDisplayName );
} }
heap_free(title); free( title );
lpbi->iImage = bi.iImage; lpbi->iImage = bi.iImage;
return lpid; return lpid;
} }
......
...@@ -57,8 +57,8 @@ void Control_UnloadApplet(CPlApplet* applet) ...@@ -57,8 +57,8 @@ void Control_UnloadApplet(CPlApplet* applet)
DeactivateActCtx(0, applet->cookie); DeactivateActCtx(0, applet->cookie);
ReleaseActCtx(applet->context); ReleaseActCtx(applet->context);
list_remove( &applet->entry ); list_remove( &applet->entry );
heap_free(applet->cmd); free(applet->cmd);
heap_free(applet); free(applet);
} }
CPlApplet* Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel) CPlApplet* Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel)
...@@ -71,7 +71,7 @@ CPlApplet* Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel) ...@@ -71,7 +71,7 @@ CPlApplet* Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel)
NEWCPLINFOW newinfo; NEWCPLINFOW newinfo;
ACTCTXW ctx; ACTCTXW ctx;
if (!(applet = heap_alloc_zero(sizeof(*applet)))) if (!(applet = calloc(1, sizeof(*applet))))
return applet; return applet;
applet->context = INVALID_HANDLE_VALUE; applet->context = INVALID_HANDLE_VALUE;
...@@ -79,7 +79,7 @@ CPlApplet* Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel) ...@@ -79,7 +79,7 @@ CPlApplet* Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel)
len = ExpandEnvironmentStringsW(cmd, NULL, 0); len = ExpandEnvironmentStringsW(cmd, NULL, 0);
if (len > 0) if (len > 0)
{ {
if (!(applet->cmd = heap_alloc((len+1) * sizeof(WCHAR)))) if (!(applet->cmd = malloc((len + 1) * sizeof(WCHAR))))
{ {
WARN("Cannot allocate memory for applet path\n"); WARN("Cannot allocate memory for applet path\n");
goto theError; goto theError;
...@@ -127,8 +127,7 @@ CPlApplet* Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel) ...@@ -127,8 +127,7 @@ CPlApplet* Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel)
goto theError; goto theError;
} }
applet = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, applet, applet = _recalloc(applet, 1, FIELD_OFFSET(CPlApplet, info[applet->count]));
FIELD_OFFSET( CPlApplet, info[applet->count] ));
for (i = 0; i < applet->count; i++) { for (i = 0; i < applet->count; i++) {
ZeroMemory(&newinfo, sizeof(newinfo)); ZeroMemory(&newinfo, sizeof(newinfo));
...@@ -202,8 +201,8 @@ CPlApplet* Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel) ...@@ -202,8 +201,8 @@ CPlApplet* Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel)
if (applet->context_activated) if (applet->context_activated)
DeactivateActCtx(0, applet->cookie); DeactivateActCtx(0, applet->cookie);
ReleaseActCtx(applet->context); ReleaseActCtx(applet->context);
heap_free(applet->cmd); free(applet->cmd);
heap_free(applet); free(applet);
return NULL; return NULL;
} }
...@@ -310,7 +309,7 @@ static void Control_WndProc_Create(HWND hWnd, const CREATESTRUCTW* cs) ...@@ -310,7 +309,7 @@ static void Control_WndProc_Create(HWND hWnd, const CREATESTRUCTW* cs)
{ {
for (i = 0; i < applet->count; i++) { for (i = 0; i < applet->count; i++) {
/* set up a CPlItem for this particular subprogram */ /* set up a CPlItem for this particular subprogram */
item = heap_alloc(sizeof(CPlItem)); item = malloc(sizeof(CPlItem));
if (!item) if (!item)
continue; continue;
...@@ -387,7 +386,7 @@ static void Control_FreeCPlItems(HWND hWnd, CPanel *panel) ...@@ -387,7 +386,7 @@ static void Control_FreeCPlItems(HWND hWnd, CPanel *panel)
if (!GetMenuItemInfoW(hSubMenu, i, FALSE, &mii)) if (!GetMenuItemInfoW(hSubMenu, i, FALSE, &mii))
continue; continue;
heap_free((void *)mii.dwItemData); free((void *)mii.dwItemData);
} }
} }
...@@ -736,7 +735,7 @@ static void Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd) ...@@ -736,7 +735,7 @@ static void Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd)
BOOL quoted = FALSE; BOOL quoted = FALSE;
CPlApplet *applet; CPlApplet *applet;
buffer = heap_alloc((lstrlenW(wszCmd) + 1) * sizeof(*wszCmd)); buffer = malloc((wcslen(wszCmd) + 1) * sizeof(*wszCmd));
if (!buffer) return; if (!buffer) return;
end = lstrcpyW(buffer, wszCmd); end = lstrcpyW(buffer, wszCmd);
...@@ -825,7 +824,7 @@ static void Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd) ...@@ -825,7 +824,7 @@ static void Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd)
Control_UnloadApplet(applet); Control_UnloadApplet(applet);
} }
heap_free(buffer); free(buffer);
} }
/************************************************************************* /*************************************************************************
...@@ -856,12 +855,12 @@ void WINAPI Control_RunDLLW(HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DWORD nCmdS ...@@ -856,12 +855,12 @@ void WINAPI Control_RunDLLW(HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DWORD nCmdS
void WINAPI Control_RunDLLA(HWND hWnd, HINSTANCE hInst, LPCSTR cmd, DWORD nCmdShow) void WINAPI Control_RunDLLA(HWND hWnd, HINSTANCE hInst, LPCSTR cmd, DWORD nCmdShow)
{ {
DWORD len = MultiByteToWideChar(CP_ACP, 0, cmd, -1, NULL, 0 ); DWORD len = MultiByteToWideChar(CP_ACP, 0, cmd, -1, NULL, 0 );
LPWSTR wszCmd = heap_alloc(len * sizeof(WCHAR)); WCHAR *wszCmd = malloc(len * sizeof(WCHAR));
if (wszCmd && MultiByteToWideChar(CP_ACP, 0, cmd, -1, wszCmd, len )) if (wszCmd && MultiByteToWideChar(CP_ACP, 0, cmd, -1, wszCmd, len ))
{ {
Control_RunDLLW(hWnd, hInst, wszCmd, nCmdShow); Control_RunDLLW(hWnd, hInst, wszCmd, nCmdShow);
} }
heap_free(wszCmd); free(wszCmd);
} }
/************************************************************************* /*************************************************************************
......
...@@ -96,7 +96,7 @@ static ULONG WINAPI IEnumFORMATETC_fnRelease(LPENUMFORMATETC iface) ...@@ -96,7 +96,7 @@ static ULONG WINAPI IEnumFORMATETC_fnRelease(LPENUMFORMATETC iface)
{ {
TRACE(" destroying IEnumFORMATETC(%p)\n",This); TRACE(" destroying IEnumFORMATETC(%p)\n",This);
SHFree (This->pFmt); SHFree (This->pFmt);
heap_free(This); free(This);
} }
return refCount; return refCount;
} }
...@@ -169,7 +169,7 @@ LPENUMFORMATETC IEnumFORMATETC_Constructor(UINT cfmt, const FORMATETC afmt[]) ...@@ -169,7 +169,7 @@ LPENUMFORMATETC IEnumFORMATETC_Constructor(UINT cfmt, const FORMATETC afmt[])
IEnumFORMATETCImpl* ef; IEnumFORMATETCImpl* ef;
DWORD size=cfmt * sizeof(FORMATETC); DWORD size=cfmt * sizeof(FORMATETC);
ef = heap_alloc_zero(sizeof(*ef)); ef = calloc(1, sizeof(*ef));
if(ef) if(ef)
{ {
...@@ -272,7 +272,7 @@ static ULONG WINAPI IDataObject_fnRelease(IDataObject *iface) ...@@ -272,7 +272,7 @@ static ULONG WINAPI IDataObject_fnRelease(IDataObject *iface)
TRACE(" destroying IDataObject(%p)\n",This); TRACE(" destroying IDataObject(%p)\n",This);
_ILFreeaPidl(This->apidl, This->cidl); _ILFreeaPidl(This->apidl, This->cidl);
ILFree(This->pidl); ILFree(This->pidl);
heap_free(This); free(This);
} }
return refCount; return refCount;
} }
...@@ -428,7 +428,7 @@ IDataObject* IDataObject_Constructor(HWND hwndOwner, ...@@ -428,7 +428,7 @@ IDataObject* IDataObject_Constructor(HWND hwndOwner,
{ {
IDataObjectImpl* dto; IDataObjectImpl* dto;
dto = heap_alloc_zero(sizeof(*dto)); dto = calloc(1, sizeof(*dto));
if (dto) if (dto)
{ {
......
...@@ -136,7 +136,7 @@ static LPWSTR RunDlg_GetParentDir(LPCWSTR cmdline) ...@@ -136,7 +136,7 @@ static LPWSTR RunDlg_GetParentDir(LPCWSTR cmdline)
const WCHAR *src; const WCHAR *src;
WCHAR *dest, *result, *result_end=NULL; WCHAR *dest, *result, *result_end=NULL;
result = heap_alloc(sizeof(WCHAR)*(lstrlenW(cmdline)+5)); result = malloc(sizeof(WCHAR) * (wcslen(cmdline) + 5));
src = cmdline; src = cmdline;
dest = result; dest = result;
...@@ -176,7 +176,7 @@ static LPWSTR RunDlg_GetParentDir(LPCWSTR cmdline) ...@@ -176,7 +176,7 @@ static LPWSTR RunDlg_GetParentDir(LPCWSTR cmdline)
} }
else else
{ {
heap_free(result); free(result);
return NULL; return NULL;
} }
} }
...@@ -231,7 +231,7 @@ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPAR ...@@ -231,7 +231,7 @@ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPAR
ZeroMemory (&sei, sizeof(sei)) ; ZeroMemory (&sei, sizeof(sei)) ;
sei.cbSize = sizeof(sei) ; sei.cbSize = sizeof(sei) ;
psz = heap_alloc( (ic + 1)*sizeof(WCHAR) ); psz = malloc( (ic + 1) * sizeof(WCHAR) );
GetWindowTextW (htxt, psz, ic + 1) ; GetWindowTextW (htxt, psz, ic + 1) ;
/* according to http://www.codeproject.com/KB/shell/runfiledlg.aspx we should send a /* according to http://www.codeproject.com/KB/shell/runfiledlg.aspx we should send a
...@@ -248,8 +248,8 @@ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPAR ...@@ -248,8 +248,8 @@ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPAR
if (!ShellExecuteExW( &sei )) if (!ShellExecuteExW( &sei ))
{ {
heap_free(psz); free(psz);
heap_free(parent); free(parent);
SendMessageA (htxt, CB_SETEDITSEL, 0, MAKELPARAM (0, -1)) ; SendMessageA (htxt, CB_SETEDITSEL, 0, MAKELPARAM (0, -1)) ;
return TRUE ; return TRUE ;
} }
...@@ -258,8 +258,8 @@ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPAR ...@@ -258,8 +258,8 @@ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPAR
GetWindowTextA (htxt, (LPSTR)psz, ic + 1) ; GetWindowTextA (htxt, (LPSTR)psz, ic + 1) ;
FillList (htxt, (LPSTR)psz, FALSE) ; FillList (htxt, (LPSTR)psz, FALSE) ;
heap_free(psz); free(psz);
heap_free(parent); free(parent);
EndDialog (hwnd, 0); EndDialog (hwnd, 0);
} }
} }
...@@ -327,14 +327,14 @@ static void FillList (HWND hCb, char *pszLatest, BOOL fShowDefault) ...@@ -327,14 +327,14 @@ static void FillList (HWND hCb, char *pszLatest, BOOL fShowDefault)
if (icList > 0) if (icList > 0)
{ {
pszList = heap_alloc(icList) ; pszList = malloc(icList) ;
if (ERROR_SUCCESS != RegQueryValueExA (hkey, "MRUList", NULL, NULL, (LPBYTE)pszList, &icList)) if (ERROR_SUCCESS != RegQueryValueExA (hkey, "MRUList", NULL, NULL, (LPBYTE)pszList, &icList))
MessageBoxA (hCb, "Unable to grab MRUList !", "Nix", MB_OK) ; MessageBoxA (hCb, "Unable to grab MRUList !", "Nix", MB_OK) ;
} }
else else
{ {
icList = 1 ; icList = 1 ;
pszList = heap_alloc(icList) ; pszList = malloc(icList) ;
pszList[0] = 0 ; pszList[0] = 0 ;
} }
...@@ -347,10 +347,7 @@ static void FillList (HWND hCb, char *pszLatest, BOOL fShowDefault) ...@@ -347,10 +347,7 @@ static void FillList (HWND hCb, char *pszLatest, BOOL fShowDefault)
if (ERROR_SUCCESS != RegQueryValueExA (hkey, szIndex, NULL, NULL, NULL, &icCmd)) if (ERROR_SUCCESS != RegQueryValueExA (hkey, szIndex, NULL, NULL, NULL, &icCmd))
MessageBoxA (hCb, "Unable to grab size of index", "Nix", MB_OK) ; MessageBoxA (hCb, "Unable to grab size of index", "Nix", MB_OK) ;
if( pszCmd ) pszCmd = realloc(pszCmd, icCmd) ;
pszCmd = heap_realloc(pszCmd, icCmd) ;
else
pszCmd = heap_alloc(icCmd) ;
if (ERROR_SUCCESS != RegQueryValueExA (hkey, szIndex, NULL, NULL, (LPBYTE)pszCmd, &icCmd)) if (ERROR_SUCCESS != RegQueryValueExA (hkey, szIndex, NULL, NULL, (LPBYTE)pszCmd, &icCmd))
MessageBoxA (hCb, "Unable to grab index", "Nix", MB_OK) ; MessageBoxA (hCb, "Unable to grab index", "Nix", MB_OK) ;
...@@ -416,10 +413,7 @@ static void FillList (HWND hCb, char *pszLatest, BOOL fShowDefault) ...@@ -416,10 +413,7 @@ static void FillList (HWND hCb, char *pszLatest, BOOL fShowDefault)
SendMessageA (hCb, CB_SETEDITSEL, 0, MAKELPARAM (0, -1)) ; SendMessageA (hCb, CB_SETEDITSEL, 0, MAKELPARAM (0, -1)) ;
cMatch = ++cMax ; cMatch = ++cMax ;
if( pszList ) pszList = realloc(pszList, ++icList) ;
pszList = heap_realloc(pszList, ++icList) ;
else
pszList = heap_alloc(++icList) ;
memmove (&pszList[1], pszList, icList - 1) ; memmove (&pszList[1], pszList, icList - 1) ;
pszList[0] = cMatch ; pszList[0] = cMatch ;
szIndex[0] = cMatch ; szIndex[0] = cMatch ;
...@@ -428,8 +422,8 @@ static void FillList (HWND hCb, char *pszLatest, BOOL fShowDefault) ...@@ -428,8 +422,8 @@ static void FillList (HWND hCb, char *pszLatest, BOOL fShowDefault)
RegSetValueExA (hkey, "MRUList", 0, REG_SZ, (LPBYTE)pszList, strlen (pszList) + 1) ; RegSetValueExA (hkey, "MRUList", 0, REG_SZ, (LPBYTE)pszList, strlen (pszList) + 1) ;
heap_free(pszCmd) ; free(pszCmd) ;
heap_free(pszList) ; free(pszList) ;
} }
/************************************************************************* /*************************************************************************
......
...@@ -110,7 +110,7 @@ static void events_unadvise_all(ExplorerBrowserImpl *This) ...@@ -110,7 +110,7 @@ static void events_unadvise_all(ExplorerBrowserImpl *This)
TRACE("Removing %p\n", client); TRACE("Removing %p\n", client);
list_remove(&client->entry); list_remove(&client->entry);
IExplorerBrowserEvents_Release(client->pebe); IExplorerBrowserEvents_Release(client->pebe);
heap_free(client); free(client);
} }
} }
...@@ -182,7 +182,7 @@ static void travellog_remove_entry(ExplorerBrowserImpl *This, travellog_entry *e ...@@ -182,7 +182,7 @@ static void travellog_remove_entry(ExplorerBrowserImpl *This, travellog_entry *e
list_remove(&entry->entry); list_remove(&entry->entry);
ILFree(entry->pidl); ILFree(entry->pidl);
heap_free(entry); free(entry);
This->travellog_count--; This->travellog_count--;
} }
...@@ -214,7 +214,7 @@ static void travellog_add_entry(ExplorerBrowserImpl *This, LPITEMIDLIST pidl) ...@@ -214,7 +214,7 @@ static void travellog_add_entry(ExplorerBrowserImpl *This, LPITEMIDLIST pidl)
} }
/* Create and add the new entry */ /* Create and add the new entry */
new = heap_alloc(sizeof(*new)); new = malloc(sizeof(*new));
new->pidl = ILClone(pidl); new->pidl = ILClone(pidl);
list_add_tail(&This->travellog, &new->entry); list_add_tail(&This->travellog, &new->entry);
This->travellog_cursor = new; This->travellog_cursor = new;
...@@ -827,7 +827,7 @@ static ULONG WINAPI IExplorerBrowser_fnRelease(IExplorerBrowser *iface) ...@@ -827,7 +827,7 @@ static ULONG WINAPI IExplorerBrowser_fnRelease(IExplorerBrowser *iface)
IObjectWithSite_SetSite(&This->IObjectWithSite_iface, NULL); IObjectWithSite_SetSite(&This->IObjectWithSite_iface, NULL);
heap_free(This); free(This);
} }
return ref; return ref;
...@@ -1005,7 +1005,7 @@ static HRESULT WINAPI IExplorerBrowser_fnAdvise(IExplorerBrowser *iface, ...@@ -1005,7 +1005,7 @@ static HRESULT WINAPI IExplorerBrowser_fnAdvise(IExplorerBrowser *iface,
event_client *client; event_client *client;
TRACE("%p (%p, %p)\n", This, psbe, pdwCookie); TRACE("%p (%p, %p)\n", This, psbe, pdwCookie);
client = heap_alloc(sizeof(*client)); client = malloc(sizeof(*client));
client->pebe = psbe; client->pebe = psbe;
client->cookie = ++This->events_next_cookie; client->cookie = ++This->events_next_cookie;
...@@ -1030,7 +1030,7 @@ static HRESULT WINAPI IExplorerBrowser_fnUnadvise(IExplorerBrowser *iface, ...@@ -1030,7 +1030,7 @@ static HRESULT WINAPI IExplorerBrowser_fnUnadvise(IExplorerBrowser *iface,
{ {
list_remove(&client->entry); list_remove(&client->entry);
IExplorerBrowserEvents_Release(client->pebe); IExplorerBrowserEvents_Release(client->pebe);
heap_free(client); free(client);
return S_OK; return S_OK;
} }
} }
...@@ -2067,7 +2067,7 @@ HRESULT WINAPI ExplorerBrowser_Constructor(IUnknown *pUnkOuter, REFIID riid, voi ...@@ -2067,7 +2067,7 @@ HRESULT WINAPI ExplorerBrowser_Constructor(IUnknown *pUnkOuter, REFIID riid, voi
if(pUnkOuter) if(pUnkOuter)
return CLASS_E_NOAGGREGATION; return CLASS_E_NOAGGREGATION;
eb = heap_alloc_zero(sizeof(*eb)); eb = calloc(1, sizeof(*eb));
eb->ref = 1; eb->ref = 1;
eb->IExplorerBrowser_iface.lpVtbl = &vt_IExplorerBrowser; eb->IExplorerBrowser_iface.lpVtbl = &vt_IExplorerBrowser;
eb->IShellBrowser_iface.lpVtbl = &vt_IShellBrowser; eb->IShellBrowser_iface.lpVtbl = &vt_IShellBrowser;
......
...@@ -182,7 +182,7 @@ static ULONG WINAPI IEnumIDList_fnRelease(IEnumIDList *iface) ...@@ -182,7 +182,7 @@ static ULONG WINAPI IEnumIDList_fnRelease(IEnumIDList *iface)
SHFree(cur->pidl); SHFree(cur->pidl);
SHFree(cur); SHFree(cur);
} }
heap_free(This); free(This);
} }
return refCount; return refCount;
...@@ -291,7 +291,7 @@ static const IEnumIDListVtbl eidlvt = ...@@ -291,7 +291,7 @@ static const IEnumIDListVtbl eidlvt =
IEnumIDListImpl *IEnumIDList_Constructor(void) IEnumIDListImpl *IEnumIDList_Constructor(void)
{ {
IEnumIDListImpl *lpeidl = heap_alloc(sizeof(*lpeidl)); IEnumIDListImpl *lpeidl = malloc(sizeof(*lpeidl));
if (lpeidl) if (lpeidl)
{ {
......
...@@ -121,7 +121,7 @@ static ULONG WINAPI IExtractIconW_fnRelease(IExtractIconW * iface) ...@@ -121,7 +121,7 @@ static ULONG WINAPI IExtractIconW_fnRelease(IExtractIconW * iface)
{ {
TRACE(" destroying IExtractIcon(%p)\n",This); TRACE(" destroying IExtractIcon(%p)\n",This);
SHFree(This->pidl); SHFree(This->pidl);
heap_free(This); free(This);
} }
return refCount; return refCount;
} }
...@@ -401,14 +401,14 @@ static HRESULT WINAPI IExtractIconA_fnGetIconLocation(IExtractIconA * iface, UIN ...@@ -401,14 +401,14 @@ static HRESULT WINAPI IExtractIconA_fnGetIconLocation(IExtractIconA * iface, UIN
{ {
IExtractIconWImpl *This = impl_from_IExtractIconA(iface); IExtractIconWImpl *This = impl_from_IExtractIconA(iface);
HRESULT ret; HRESULT ret;
LPWSTR lpwstrFile = heap_alloc(cchMax * sizeof(WCHAR)); WCHAR *lpwstrFile = malloc(cchMax * sizeof(WCHAR));
TRACE("(%p) (flags=%u %p %u %p %p)\n", This, uFlags, szIconFile, cchMax, piIndex, pwFlags); TRACE("(%p) (flags=%u %p %u %p %p)\n", This, uFlags, szIconFile, cchMax, piIndex, pwFlags);
ret = IExtractIconW_GetIconLocation(&This->IExtractIconW_iface, uFlags, lpwstrFile, cchMax, ret = IExtractIconW_GetIconLocation(&This->IExtractIconW_iface, uFlags, lpwstrFile, cchMax,
piIndex, pwFlags); piIndex, pwFlags);
WideCharToMultiByte(CP_ACP, 0, lpwstrFile, -1, szIconFile, cchMax, NULL, NULL); WideCharToMultiByte(CP_ACP, 0, lpwstrFile, -1, szIconFile, cchMax, NULL, NULL);
heap_free(lpwstrFile); free(lpwstrFile);
TRACE("-- %s %x\n", szIconFile, *piIndex); TRACE("-- %s %x\n", szIconFile, *piIndex);
return ret; return ret;
...@@ -422,14 +422,14 @@ static HRESULT WINAPI IExtractIconA_fnExtract(IExtractIconA * iface, LPCSTR pszF ...@@ -422,14 +422,14 @@ static HRESULT WINAPI IExtractIconA_fnExtract(IExtractIconA * iface, LPCSTR pszF
IExtractIconWImpl *This = impl_from_IExtractIconA(iface); IExtractIconWImpl *This = impl_from_IExtractIconA(iface);
HRESULT ret; HRESULT ret;
INT len = MultiByteToWideChar(CP_ACP, 0, pszFile, -1, NULL, 0); INT len = MultiByteToWideChar(CP_ACP, 0, pszFile, -1, NULL, 0);
LPWSTR lpwstrFile = heap_alloc(len * sizeof(WCHAR)); WCHAR *lpwstrFile = malloc(len * sizeof(WCHAR));
TRACE("(%p) (file=%p index=%u %p %p size=%u)\n", This, pszFile, nIconIndex, phiconLarge, phiconSmall, nIconSize); TRACE("(%p) (file=%p index=%u %p %p size=%u)\n", This, pszFile, nIconIndex, phiconLarge, phiconSmall, nIconSize);
MultiByteToWideChar(CP_ACP, 0, pszFile, -1, lpwstrFile, len); MultiByteToWideChar(CP_ACP, 0, pszFile, -1, lpwstrFile, len);
ret = IExtractIconW_Extract(&This->IExtractIconW_iface, lpwstrFile, nIconIndex, phiconLarge, ret = IExtractIconW_Extract(&This->IExtractIconW_iface, lpwstrFile, nIconIndex, phiconLarge,
phiconSmall, nIconSize); phiconSmall, nIconSize);
heap_free(lpwstrFile); free(lpwstrFile);
return ret; return ret;
} }
...@@ -519,7 +519,7 @@ static IExtractIconWImpl *extracticon_create(LPCITEMIDLIST pidl) ...@@ -519,7 +519,7 @@ static IExtractIconWImpl *extracticon_create(LPCITEMIDLIST pidl)
TRACE("%p\n", pidl); TRACE("%p\n", pidl);
ei = heap_alloc(sizeof(*ei)); ei = malloc(sizeof(*ei));
ei->ref=1; ei->ref=1;
ei->IExtractIconW_iface.lpVtbl = &eivt; ei->IExtractIconW_iface.lpVtbl = &eivt;
ei->IExtractIconA_iface.lpVtbl = &eiavt; ei->IExtractIconA_iface.lpVtbl = &eiavt;
......
...@@ -300,8 +300,7 @@ static INT SIC_IconAppend (const WCHAR *sourcefile, INT src_index, HICON *hicons ...@@ -300,8 +300,7 @@ static INT SIC_IconAppend (const WCHAR *sourcefile, INT src_index, HICON *hicons
entry = SHAlloc(sizeof(*entry)); entry = SHAlloc(sizeof(*entry));
GetFullPathNameW(sourcefile, MAX_PATH, path, NULL); GetFullPathNameW(sourcefile, MAX_PATH, path, NULL);
entry->sSourceFile = heap_alloc( (lstrlenW(path)+1)*sizeof(WCHAR) ); entry->sSourceFile = wcsdup(path);
lstrcpyW( entry->sSourceFile, path );
entry->dwSourceIndex = src_index; entry->dwSourceIndex = src_index;
entry->dwFlags = flags; entry->dwFlags = flags;
...@@ -311,7 +310,7 @@ static INT SIC_IconAppend (const WCHAR *sourcefile, INT src_index, HICON *hicons ...@@ -311,7 +310,7 @@ static INT SIC_IconAppend (const WCHAR *sourcefile, INT src_index, HICON *hicons
index = DPA_InsertPtr(sic_hdpa, 0x7fff, entry); index = DPA_InsertPtr(sic_hdpa, 0x7fff, entry);
if ( INVALID_INDEX == index ) if ( INVALID_INDEX == index )
{ {
heap_free(entry->sSourceFile); free(entry->sSourceFile);
SHFree(entry); SHFree(entry);
ret = INVALID_INDEX; ret = INVALID_INDEX;
} }
...@@ -492,7 +491,7 @@ static BOOL WINAPI SIC_Initialize( INIT_ONCE *once, void *param, void **context ...@@ -492,7 +491,7 @@ static BOOL WINAPI SIC_Initialize( INIT_ONCE *once, void *param, void **context
*/ */
static INT CALLBACK sic_free( LPVOID ptr, LPVOID lparam ) static INT CALLBACK sic_free( LPVOID ptr, LPVOID lparam )
{ {
heap_free(((LPSIC_ENTRY)ptr)->sSourceFile); free(((SIC_ENTRY *)ptr)->sSourceFile);
SHFree(ptr); SHFree(ptr);
return TRUE; return TRUE;
} }
...@@ -745,12 +744,12 @@ INT WINAPI Shell_GetCachedImageIndexA(LPCSTR szPath, INT nIndex, BOOL bSimulateD ...@@ -745,12 +744,12 @@ INT WINAPI Shell_GetCachedImageIndexA(LPCSTR szPath, INT nIndex, BOOL bSimulateD
WARN("(%s,%08x,%08x) semi-stub.\n",debugstr_a(szPath), nIndex, bSimulateDoc); WARN("(%s,%08x,%08x) semi-stub.\n",debugstr_a(szPath), nIndex, bSimulateDoc);
len = MultiByteToWideChar( CP_ACP, 0, szPath, -1, NULL, 0 ); len = MultiByteToWideChar( CP_ACP, 0, szPath, -1, NULL, 0 );
szTemp = heap_alloc( len * sizeof(WCHAR) ); szTemp = malloc( len * sizeof(WCHAR) );
MultiByteToWideChar( CP_ACP, 0, szPath, -1, szTemp, len ); MultiByteToWideChar( CP_ACP, 0, szPath, -1, szTemp, len );
ret = SIC_GetIconIndex( szTemp, nIndex, 0 ); ret = SIC_GetIconIndex( szTemp, nIndex, 0 );
heap_free( szTemp ); free( szTemp );
return ret; return ret;
} }
...@@ -789,7 +788,7 @@ UINT WINAPI ExtractIconExA(LPCSTR lpszFile, INT nIconIndex, HICON * phiconLarge, ...@@ -789,7 +788,7 @@ UINT WINAPI ExtractIconExA(LPCSTR lpszFile, INT nIconIndex, HICON * phiconLarge,
{ {
UINT ret = 0; UINT ret = 0;
INT len = MultiByteToWideChar(CP_ACP, 0, lpszFile, -1, NULL, 0); INT len = MultiByteToWideChar(CP_ACP, 0, lpszFile, -1, NULL, 0);
LPWSTR lpwstrFile = heap_alloc( len * sizeof(WCHAR)); WCHAR *lpwstrFile = malloc( len * sizeof(WCHAR));
TRACE("%s %i %p %p %i\n", lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons); TRACE("%s %i %p %p %i\n", lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons);
...@@ -797,7 +796,7 @@ UINT WINAPI ExtractIconExA(LPCSTR lpszFile, INT nIconIndex, HICON * phiconLarge, ...@@ -797,7 +796,7 @@ UINT WINAPI ExtractIconExA(LPCSTR lpszFile, INT nIconIndex, HICON * phiconLarge,
{ {
MultiByteToWideChar(CP_ACP, 0, lpszFile, -1, lpwstrFile, len); MultiByteToWideChar(CP_ACP, 0, lpszFile, -1, lpwstrFile, len);
ret = ExtractIconExW(lpwstrFile, nIconIndex, phiconLarge, phiconSmall, nIcons); ret = ExtractIconExW(lpwstrFile, nIconIndex, phiconLarge, phiconSmall, nIcons);
heap_free(lpwstrFile); free(lpwstrFile);
} }
return ret; return ret;
} }
...@@ -817,7 +816,7 @@ HICON WINAPI ExtractAssociatedIconA(HINSTANCE hInst, LPSTR lpIconPath, LPWORD lp ...@@ -817,7 +816,7 @@ HICON WINAPI ExtractAssociatedIconA(HINSTANCE hInst, LPSTR lpIconPath, LPWORD lp
* lpIconPath itself is supposed to be large enough, so make sure lpIconPathW * lpIconPath itself is supposed to be large enough, so make sure lpIconPathW
* is large enough too. Yes, I am puking too. * is large enough too. Yes, I am puking too.
*/ */
LPWSTR lpIconPathW = heap_alloc(MAX_PATH * sizeof(WCHAR)); WCHAR *lpIconPathW = malloc(MAX_PATH * sizeof(WCHAR));
TRACE("%p %s %p\n", hInst, debugstr_a(lpIconPath), lpiIcon); TRACE("%p %s %p\n", hInst, debugstr_a(lpIconPath), lpiIcon);
...@@ -826,7 +825,7 @@ HICON WINAPI ExtractAssociatedIconA(HINSTANCE hInst, LPSTR lpIconPath, LPWORD lp ...@@ -826,7 +825,7 @@ HICON WINAPI ExtractAssociatedIconA(HINSTANCE hInst, LPSTR lpIconPath, LPWORD lp
MultiByteToWideChar(CP_ACP, 0, lpIconPath, -1, lpIconPathW, len); MultiByteToWideChar(CP_ACP, 0, lpIconPath, -1, lpIconPathW, len);
hIcon = ExtractAssociatedIconW(hInst, lpIconPathW, lpiIcon); hIcon = ExtractAssociatedIconW(hInst, lpIconPathW, lpiIcon);
WideCharToMultiByte(CP_ACP, 0, lpIconPathW, -1, lpIconPath, MAX_PATH , NULL, NULL); WideCharToMultiByte(CP_ACP, 0, lpIconPathW, -1, lpIconPath, MAX_PATH , NULL, NULL);
heap_free(lpIconPathW); free(lpIconPathW);
} }
return hIcon; return hIcon;
} }
...@@ -895,13 +894,13 @@ HICON WINAPI ExtractAssociatedIconExA(HINSTANCE hInst, LPSTR lpIconPath, LPWORD ...@@ -895,13 +894,13 @@ HICON WINAPI ExtractAssociatedIconExA(HINSTANCE hInst, LPSTR lpIconPath, LPWORD
{ {
HICON ret; HICON ret;
INT len = MultiByteToWideChar( CP_ACP, 0, lpIconPath, -1, NULL, 0 ); INT len = MultiByteToWideChar( CP_ACP, 0, lpIconPath, -1, NULL, 0 );
LPWSTR lpwstrFile = heap_alloc( len * sizeof(WCHAR) ); WCHAR *lpwstrFile = malloc( len * sizeof(WCHAR) );
TRACE("%p %s %p %p)\n", hInst, lpIconPath, lpiIconIdx, lpiIconId); TRACE("%p %s %p %p)\n", hInst, lpIconPath, lpiIconIdx, lpiIconId);
MultiByteToWideChar( CP_ACP, 0, lpIconPath, -1, lpwstrFile, len ); MultiByteToWideChar( CP_ACP, 0, lpIconPath, -1, lpwstrFile, len );
ret = ExtractAssociatedIconExW(hInst, lpwstrFile, lpiIconIdx, lpiIconId); ret = ExtractAssociatedIconExW(hInst, lpwstrFile, lpiIconIdx, lpiIconId);
heap_free(lpwstrFile); free(lpwstrFile);
return ret; return ret;
} }
...@@ -942,13 +941,13 @@ HRESULT WINAPI SHDefExtractIconA(LPCSTR pszIconFile, int iIndex, UINT uFlags, ...@@ -942,13 +941,13 @@ HRESULT WINAPI SHDefExtractIconA(LPCSTR pszIconFile, int iIndex, UINT uFlags,
{ {
HRESULT ret; HRESULT ret;
INT len = MultiByteToWideChar(CP_ACP, 0, pszIconFile, -1, NULL, 0); INT len = MultiByteToWideChar(CP_ACP, 0, pszIconFile, -1, NULL, 0);
LPWSTR lpwstrFile = heap_alloc(len * sizeof(WCHAR)); WCHAR *lpwstrFile = malloc(len * sizeof(WCHAR));
TRACE("%s %d 0x%08x %p %p %d\n", pszIconFile, iIndex, uFlags, phiconLarge, phiconSmall, nIconSize); TRACE("%s %d 0x%08x %p %p %d\n", pszIconFile, iIndex, uFlags, phiconLarge, phiconSmall, nIconSize);
MultiByteToWideChar(CP_ACP, 0, pszIconFile, -1, lpwstrFile, len); MultiByteToWideChar(CP_ACP, 0, pszIconFile, -1, lpwstrFile, len);
ret = SHDefExtractIconW(lpwstrFile, iIndex, uFlags, phiconLarge, phiconSmall, nIconSize); ret = SHDefExtractIconW(lpwstrFile, iIndex, uFlags, phiconLarge, phiconSmall, nIconSize);
heap_free(lpwstrFile); free(lpwstrFile);
return ret; return ret;
} }
......
...@@ -1057,13 +1057,13 @@ LPITEMIDLIST SHSimpleIDListFromPathA(LPCSTR lpszPath) ...@@ -1057,13 +1057,13 @@ LPITEMIDLIST SHSimpleIDListFromPathA(LPCSTR lpszPath)
if (lpszPath) if (lpszPath)
{ {
len = MultiByteToWideChar(CP_ACP, 0, lpszPath, -1, NULL, 0); len = MultiByteToWideChar(CP_ACP, 0, lpszPath, -1, NULL, 0);
wPath = heap_alloc(len * sizeof(WCHAR)); wPath = malloc(len * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, lpszPath, -1, wPath, len); MultiByteToWideChar(CP_ACP, 0, lpszPath, -1, wPath, len);
} }
_ILParsePathW(wPath, NULL, TRUE, &pidl, NULL); _ILParsePathW(wPath, NULL, TRUE, &pidl, NULL);
heap_free(wPath); free(wPath);
TRACE("%s %p\n", debugstr_a(lpszPath), pidl); TRACE("%s %p\n", debugstr_a(lpszPath), pidl);
return pidl; return pidl;
} }
......
...@@ -97,7 +97,7 @@ static BOOL WINAPI init_trash_dirs( INIT_ONCE *once, void *param, void **context ...@@ -97,7 +97,7 @@ static BOOL WINAPI init_trash_dirs( INIT_ONCE *once, void *param, void **context
if (!home) return TRUE; if (!home) return TRUE;
if (is_macos()) if (is_macos())
{ {
files = heap_alloc( (lstrlenW(home) + lstrlenW(L"\\.Trash") + 1) * sizeof(WCHAR) ); files = malloc( (wcslen(home) + ARRAY_SIZE(L"\\.Trash")) * sizeof(WCHAR) );
lstrcpyW( files, home ); lstrcpyW( files, home );
lstrcatW( files, L"\\.Trash" ); lstrcatW( files, L"\\.Trash" );
files[1] = '\\'; /* change \??\ to \\?\ */ files[1] = '\\'; /* change \??\ to \\?\ */
...@@ -114,12 +114,12 @@ static BOOL WINAPI init_trash_dirs( INIT_ONCE *once, void *param, void **context ...@@ -114,12 +114,12 @@ static BOOL WINAPI init_trash_dirs( INIT_ONCE *once, void *param, void **context
fmt = L"\\??\\unix%s/Trash"; fmt = L"\\??\\unix%s/Trash";
} }
len = lstrlenW(home) + lstrlenW(fmt) + 7; len = lstrlenW(home) + lstrlenW(fmt) + 7;
files = heap_alloc( len * sizeof(WCHAR) ); files = malloc( len * sizeof(WCHAR) );
swprintf( files, len, fmt, home ); swprintf( files, len, fmt, home );
files[1] = '\\'; /* change \??\ to \\?\ */ files[1] = '\\'; /* change \??\ to \\?\ */
for (p = files; *p; p++) if (*p == '/') *p = '\\'; for (p = files; *p; p++) if (*p == '/') *p = '\\';
CreateDirectoryW( files, NULL ); CreateDirectoryW( files, NULL );
info = heap_alloc( len * sizeof(WCHAR) ); info = malloc( len * sizeof(WCHAR) );
lstrcpyW( info, files ); lstrcpyW( info, files );
lstrcatW( files, L"\\files" ); lstrcatW( files, L"\\files" );
lstrcatW( info, L"\\info" ); lstrcatW( info, L"\\info" );
...@@ -133,8 +133,8 @@ static BOOL WINAPI init_trash_dirs( INIT_ONCE *once, void *param, void **context ...@@ -133,8 +133,8 @@ static BOOL WINAPI init_trash_dirs( INIT_ONCE *once, void *param, void **context
return TRUE; return TRUE;
done: done:
heap_free( files ); free( files );
heap_free( info ); free( info );
return TRUE; return TRUE;
} }
...@@ -201,14 +201,14 @@ static BOOL write_trashinfo_file( HANDLE handle, const WCHAR *orig_path ) ...@@ -201,14 +201,14 @@ static BOOL write_trashinfo_file( HANDLE handle, const WCHAR *orig_path )
if (!(path = wine_get_unix_file_name( orig_path ))) return FALSE; if (!(path = wine_get_unix_file_name( orig_path ))) return FALSE;
GetLocalTime( &now ); GetLocalTime( &now );
buffer = heap_alloc( strlen(path) * 3 + 128 ); buffer = malloc( strlen(path) * 3 + 128 );
strcpy( buffer, "[Trash Info]\nPath=" ); strcpy( buffer, "[Trash Info]\nPath=" );
encode( path, buffer + strlen(buffer) ); encode( path, buffer + strlen(buffer) );
sprintf( buffer + strlen(buffer), "\nDeletionDate=%04u-%02u-%02uT%02u:%02u:%02u\n", sprintf( buffer + strlen(buffer), "\nDeletionDate=%04u-%02u-%02uT%02u:%02u:%02u\n",
now.wYear, now.wMonth, now.wDay, now.wHour, now.wMinute, now.wSecond); now.wYear, now.wMonth, now.wDay, now.wHour, now.wMinute, now.wSecond);
WriteFile( handle, buffer, strlen(buffer), NULL, NULL ); WriteFile( handle, buffer, strlen(buffer), NULL, NULL );
heap_free( path ); heap_free( path );
heap_free( buffer ); free( buffer );
return TRUE; return TRUE;
} }
...@@ -220,7 +220,7 @@ static void read_trashinfo_file( HANDLE handle, WIN32_FIND_DATAW *data ) ...@@ -220,7 +220,7 @@ static void read_trashinfo_file( HANDLE handle, WIN32_FIND_DATAW *data )
int header = 0; int header = 0;
size = GetFileSize( handle, NULL ); size = GetFileSize( handle, NULL );
if (!(buffer = heap_alloc( size + 1 ))) return; if (!(buffer = malloc( size + 1 ))) return;
if (!ReadFile( handle, buffer, size, &size, NULL )) size = 0; if (!ReadFile( handle, buffer, size, &size, NULL )) size = 0;
buffer[size] = 0; buffer[size] = 0;
next = buffer; next = buffer;
...@@ -264,7 +264,7 @@ static void read_trashinfo_file( HANDLE handle, WIN32_FIND_DATAW *data ) ...@@ -264,7 +264,7 @@ static void read_trashinfo_file( HANDLE handle, WIN32_FIND_DATAW *data )
} }
} }
} }
heap_free( buffer ); free( buffer );
} }
...@@ -278,13 +278,13 @@ BOOL trash_file( const WCHAR *path ) ...@@ -278,13 +278,13 @@ BOOL trash_file( const WCHAR *path )
if (!trash_dir) return FALSE; if (!trash_dir) return FALSE;
len = lstrlenW(trash_dir) + lstrlenW(file) + 11; len = lstrlenW(trash_dir) + lstrlenW(file) + 11;
dest = heap_alloc( len * sizeof(WCHAR) ); dest = malloc( len * sizeof(WCHAR) );
if (trash_info_dir) if (trash_info_dir)
{ {
HANDLE handle; HANDLE handle;
ULONG infolen = lstrlenW(trash_info_dir) + lstrlenW(file) + 21; ULONG infolen = lstrlenW(trash_info_dir) + lstrlenW(file) + 21;
WCHAR *info = heap_alloc( infolen * sizeof(WCHAR) ); WCHAR *info = malloc( infolen * sizeof(WCHAR) );
swprintf( info, infolen, L"%s\\%s.trashinfo", trash_info_dir, file ); swprintf( info, infolen, L"%s\\%s.trashinfo", trash_info_dir, file );
for (i = 0; i < 1000; i++) for (i = 0; i < 1000; i++)
...@@ -316,7 +316,7 @@ BOOL trash_file( const WCHAR *path ) ...@@ -316,7 +316,7 @@ BOOL trash_file( const WCHAR *path )
} }
} }
if (ret) TRACE( "%s -> %s\n", debugstr_w(path), debugstr_w(dest) ); if (ret) TRACE( "%s -> %s\n", debugstr_w(path), debugstr_w(dest) );
heap_free( dest ); free( dest );
return ret; return ret;
} }
...@@ -330,11 +330,11 @@ static BOOL get_trash_item_info( const WCHAR *filename, WIN32_FIND_DATAW *data ) ...@@ -330,11 +330,11 @@ static BOOL get_trash_item_info( const WCHAR *filename, WIN32_FIND_DATAW *data )
{ {
HANDLE handle; HANDLE handle;
ULONG len = lstrlenW(trash_info_dir) + lstrlenW(filename) + 12; ULONG len = lstrlenW(trash_info_dir) + lstrlenW(filename) + 12;
WCHAR *info = heap_alloc( len * sizeof(WCHAR) ); WCHAR *info = malloc( len * sizeof(WCHAR) );
swprintf( info, len, L"%s\\%s.trashinfo", trash_info_dir, filename ); swprintf( info, len, L"%s\\%s.trashinfo", trash_info_dir, filename );
handle = CreateFileW( info, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0 ); handle = CreateFileW( info, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0 );
heap_free( info ); free( info );
if (handle == INVALID_HANDLE_VALUE) return FALSE; if (handle == INVALID_HANDLE_VALUE) return FALSE;
read_trashinfo_file( handle, data ); read_trashinfo_file( handle, data );
CloseHandle( handle ); CloseHandle( handle );
...@@ -365,7 +365,7 @@ static HRESULT add_trash_item( WIN32_FIND_DATAW *orig_data, LPITEMIDLIST **pidls ...@@ -365,7 +365,7 @@ static HRESULT add_trash_item( WIN32_FIND_DATAW *orig_data, LPITEMIDLIST **pidls
LPITEMIDLIST *new; LPITEMIDLIST *new;
*size = max( *size * 2, 32 ); *size = max( *size * 2, 32 );
new = heap_realloc( *pidls, *size * sizeof(**pidls) ); new = realloc( *pidls, *size * sizeof(**pidls) );
if (!new) if (!new)
{ {
SHFree( pidl ); SHFree( pidl );
...@@ -392,7 +392,7 @@ static HRESULT enum_trash_items( LPITEMIDLIST **pidls, int *ret_count ) ...@@ -392,7 +392,7 @@ static HRESULT enum_trash_items( LPITEMIDLIST **pidls, int *ret_count )
if (!trash_dir) return E_FAIL; if (!trash_dir) return E_FAIL;
*pidls = NULL; *pidls = NULL;
file = heap_alloc( (lstrlenW(trash_dir) + lstrlenW(L"\\*") + 1) * sizeof(WCHAR) ); file = malloc( (wcslen(trash_dir) + ARRAY_SIZE(L"\\*")) * sizeof(WCHAR) );
lstrcpyW( file, trash_dir ); lstrcpyW( file, trash_dir );
lstrcatW( file, L"\\*" ); lstrcatW( file, L"\\*" );
handle = FindFirstFileW( file, &data ); handle = FindFirstFileW( file, &data );
...@@ -413,7 +413,7 @@ static HRESULT enum_trash_items( LPITEMIDLIST **pidls, int *ret_count ) ...@@ -413,7 +413,7 @@ static HRESULT enum_trash_items( LPITEMIDLIST **pidls, int *ret_count )
*pidls = SHAlloc( count * sizeof(**pidls) ); *pidls = SHAlloc( count * sizeof(**pidls) );
memcpy( *pidls, ret, count * sizeof(**pidls) ); memcpy( *pidls, ret, count * sizeof(**pidls) );
} }
heap_free( ret ); free( ret );
*ret_count = count; *ret_count = count;
return hr; return hr;
} }
...@@ -425,10 +425,10 @@ static void remove_trashinfo( const WCHAR *filename ) ...@@ -425,10 +425,10 @@ static void remove_trashinfo( const WCHAR *filename )
if (!trash_info_dir) return; if (!trash_info_dir) return;
len = lstrlenW(trash_info_dir) + lstrlenW(filename) + 12; len = lstrlenW(trash_info_dir) + lstrlenW(filename) + 12;
info = heap_alloc( len * sizeof(WCHAR) ); info = malloc( len * sizeof(WCHAR) );
swprintf( info, len, L"%s\\%s.trashinfo", trash_info_dir, filename ); swprintf( info, len, L"%s\\%s.trashinfo", trash_info_dir, filename );
DeleteFileW( info ); DeleteFileW( info );
heap_free( info ); free( info );
} }
static HRESULT restore_trash_item( LPCITEMIDLIST pidl ) static HRESULT restore_trash_item( LPCITEMIDLIST pidl )
...@@ -443,11 +443,11 @@ static HRESULT restore_trash_item( LPCITEMIDLIST pidl ) ...@@ -443,11 +443,11 @@ static HRESULT restore_trash_item( LPCITEMIDLIST pidl )
return E_NOTIMPL; return E_NOTIMPL;
} }
len = lstrlenW(trash_dir) + lstrlenW(filename) + 2; len = lstrlenW(trash_dir) + lstrlenW(filename) + 2;
from = heap_alloc( len * sizeof(WCHAR) ); from = malloc( len * sizeof(WCHAR) );
swprintf( from, len, L"%s\\%s", trash_dir, filename ); swprintf( from, len, L"%s\\%s", trash_dir, filename );
if (MoveFileW( from, data->cFileName )) remove_trashinfo( filename ); if (MoveFileW( from, data->cFileName )) remove_trashinfo( filename );
else WARN( "failed to restore %s to %s\n", debugstr_w(from), debugstr_w(data->cFileName) ); else WARN( "failed to restore %s to %s\n", debugstr_w(from), debugstr_w(data->cFileName) );
heap_free( from ); free( from );
return S_OK; return S_OK;
} }
...@@ -457,10 +457,10 @@ static HRESULT erase_trash_item( LPCITEMIDLIST pidl ) ...@@ -457,10 +457,10 @@ static HRESULT erase_trash_item( LPCITEMIDLIST pidl )
WCHAR *from, *filename = (WCHAR *)(data + 1); WCHAR *from, *filename = (WCHAR *)(data + 1);
ULONG len = lstrlenW(trash_dir) + lstrlenW(filename) + 2; ULONG len = lstrlenW(trash_dir) + lstrlenW(filename) + 2;
from = heap_alloc( len * sizeof(WCHAR) ); from = malloc( len * sizeof(WCHAR) );
swprintf( from, len, L"%s\\%s", trash_dir, filename ); swprintf( from, len, L"%s\\%s", trash_dir, filename );
if (DeleteFileW( from )) remove_trashinfo( filename ); if (DeleteFileW( from )) remove_trashinfo( filename );
heap_free( from ); free( from );
return S_OK; return S_OK;
} }
......
...@@ -453,8 +453,8 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, ...@@ -453,8 +453,8 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
while ((hr = SIC_get_location( psfi->iIcon, file, &size, &icon_idx )) == E_NOT_SUFFICIENT_BUFFER) while ((hr = SIC_get_location( psfi->iIcon, file, &size, &icon_idx )) == E_NOT_SUFFICIENT_BUFFER)
{ {
if (file == buf) file = heap_alloc( size ); if (file == buf) file = malloc( size );
else file = heap_realloc( file, size ); else file = realloc( file, size );
if (!file) break; if (!file) break;
} }
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
...@@ -462,7 +462,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, ...@@ -462,7 +462,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
ret = PrivateExtractIconsW( file, icon_idx, width, height, &psfi->hIcon, 0, 1, 0); ret = PrivateExtractIconsW( file, icon_idx, width, height, &psfi->hIcon, 0, 1, 0);
if (ret == 0 || ret == (UINT)-1) hr = E_FAIL; if (ret == 0 || ret == (UINT)-1) hr = E_FAIL;
} }
if (file != buf) heap_free( file ); if (file != buf) free( file );
} }
} }
} }
...@@ -513,7 +513,7 @@ DWORD_PTR WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes, ...@@ -513,7 +513,7 @@ DWORD_PTR WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
else else
{ {
len = MultiByteToWideChar(CP_ACP, 0, path, -1, NULL, 0); len = MultiByteToWideChar(CP_ACP, 0, path, -1, NULL, 0);
temppath = heap_alloc(len*sizeof(WCHAR)); temppath = malloc(len * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, path, -1, temppath, len); MultiByteToWideChar(CP_ACP, 0, path, -1, temppath, len);
pathW = temppath; pathW = temppath;
} }
...@@ -546,7 +546,7 @@ DWORD_PTR WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes, ...@@ -546,7 +546,7 @@ DWORD_PTR WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
} }
} }
heap_free(temppath); free(temppath);
return ret; return ret;
} }
...@@ -701,7 +701,7 @@ static ULONG WINAPI window_prop_store_Release(IPropertyStore *iface) ...@@ -701,7 +701,7 @@ static ULONG WINAPI window_prop_store_Release(IPropertyStore *iface)
{ {
struct window_prop_store *store = impl_from_IPropertyStore(iface); struct window_prop_store *store = impl_from_IPropertyStore(iface);
LONG ref = InterlockedDecrement(&store->ref); LONG ref = InterlockedDecrement(&store->ref);
if (!ref) heap_free(store); if (!ref) free(store);
TRACE("returning %ld\n", ref); TRACE("returning %ld\n", ref);
return ref; return ref;
} }
...@@ -773,7 +773,7 @@ static HRESULT create_window_prop_store(IPropertyStore **obj) ...@@ -773,7 +773,7 @@ static HRESULT create_window_prop_store(IPropertyStore **obj)
{ {
struct window_prop_store *store; struct window_prop_store *store;
if (!(store = heap_alloc(sizeof(*store)))) return E_OUTOFMEMORY; if (!(store = malloc(sizeof(*store)))) return E_OUTOFMEMORY;
store->IPropertyStore_iface.lpVtbl = &window_prop_store_vtbl; store->IPropertyStore_iface.lpVtbl = &window_prop_store_vtbl;
store->ref = 1; store->ref = 1;
...@@ -872,7 +872,7 @@ static void add_authors( HWND list ) ...@@ -872,7 +872,7 @@ static void add_authors( HWND list )
if (!strA) return; if (!strA) return;
sizeW = MultiByteToWideChar( CP_UTF8, 0, strA, sizeA, NULL, 0 ) + 1; sizeW = MultiByteToWideChar( CP_UTF8, 0, strA, sizeA, NULL, 0 ) + 1;
if (!(strW = heap_alloc( sizeW * sizeof(WCHAR) ))) return; if (!(strW = malloc( sizeW * sizeof(WCHAR) ))) return;
MultiByteToWideChar( CP_UTF8, 0, strA, sizeA, strW, sizeW ); MultiByteToWideChar( CP_UTF8, 0, strA, sizeA, strW, sizeW );
strW[sizeW - 1] = 0; strW[sizeW - 1] = 0;
...@@ -886,7 +886,7 @@ static void add_authors( HWND list ) ...@@ -886,7 +886,7 @@ static void add_authors( HWND list )
SendMessageW( list, LB_ADDSTRING, -1, (LPARAM)start ); SendMessageW( list, LB_ADDSTRING, -1, (LPARAM)start );
start = end; start = end;
} }
heap_free( strW ); free( strW );
} }
/************************************************************************* /*************************************************************************
...@@ -987,20 +987,20 @@ BOOL WINAPI ShellAboutA( HWND hWnd, LPCSTR szApp, LPCSTR szOtherStuff, HICON hIc ...@@ -987,20 +987,20 @@ BOOL WINAPI ShellAboutA( HWND hWnd, LPCSTR szApp, LPCSTR szOtherStuff, HICON hIc
if (szApp) if (szApp)
{ {
len = MultiByteToWideChar(CP_ACP, 0, szApp, -1, NULL, 0); len = MultiByteToWideChar(CP_ACP, 0, szApp, -1, NULL, 0);
appW = heap_alloc( len * sizeof(WCHAR)); appW = malloc(len * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, szApp, -1, appW, len); MultiByteToWideChar(CP_ACP, 0, szApp, -1, appW, len);
} }
if (szOtherStuff) if (szOtherStuff)
{ {
len = MultiByteToWideChar(CP_ACP, 0, szOtherStuff, -1, NULL, 0); len = MultiByteToWideChar(CP_ACP, 0, szOtherStuff, -1, NULL, 0);
otherW = heap_alloc( len * sizeof(WCHAR)); otherW = malloc(len * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, szOtherStuff, -1, otherW, len); MultiByteToWideChar(CP_ACP, 0, szOtherStuff, -1, otherW, len);
} }
ret = ShellAboutW(hWnd, appW, otherW, hIcon); ret = ShellAboutW(hWnd, appW, otherW, hIcon);
heap_free(otherW); free(otherW);
heap_free(appW); free(appW);
return ret; return ret;
} }
......
...@@ -117,7 +117,7 @@ static ULONG WINAPI ShellItem_Release(IShellItem2 *iface) ...@@ -117,7 +117,7 @@ static ULONG WINAPI ShellItem_Release(IShellItem2 *iface)
if (ref == 0) if (ref == 0)
{ {
ILFree(This->pidl); ILFree(This->pidl);
heap_free(This); free(This);
} }
return ref; return ref;
...@@ -608,7 +608,7 @@ HRESULT WINAPI IShellItem_Constructor(IUnknown *pUnkOuter, REFIID riid, void **p ...@@ -608,7 +608,7 @@ HRESULT WINAPI IShellItem_Constructor(IUnknown *pUnkOuter, REFIID riid, void **p
if (pUnkOuter) return CLASS_E_NOAGGREGATION; if (pUnkOuter) return CLASS_E_NOAGGREGATION;
This = heap_alloc(sizeof(*This)); This = malloc(sizeof(*This));
This->IShellItem2_iface.lpVtbl = &ShellItem2_Vtbl; This->IShellItem2_iface.lpVtbl = &ShellItem2_Vtbl;
This->ref = 1; This->ref = 1;
This->pidl = NULL; This->pidl = NULL;
...@@ -976,7 +976,7 @@ static ULONG WINAPI IEnumShellItems_fnRelease(IEnumShellItems *iface) ...@@ -976,7 +976,7 @@ static ULONG WINAPI IEnumShellItems_fnRelease(IEnumShellItems *iface)
{ {
TRACE("Freeing.\n"); TRACE("Freeing.\n");
IShellItemArray_Release(This->array); IShellItemArray_Release(This->array);
heap_free(This); free(This);
return 0; return 0;
} }
...@@ -1065,7 +1065,7 @@ static HRESULT IEnumShellItems_Constructor(IShellItemArray *array, IEnumShellIte ...@@ -1065,7 +1065,7 @@ static HRESULT IEnumShellItems_Constructor(IShellItemArray *array, IEnumShellIte
IEnumShellItemsImpl *This; IEnumShellItemsImpl *This;
HRESULT ret; HRESULT ret;
This = heap_alloc(sizeof(*This)); This = malloc(sizeof(*This));
if(!This) if(!This)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
...@@ -1146,8 +1146,8 @@ static ULONG WINAPI IShellItemArray_fnRelease(IShellItemArray *iface) ...@@ -1146,8 +1146,8 @@ static ULONG WINAPI IShellItemArray_fnRelease(IShellItemArray *iface)
for(i = 0; i < This->item_count; i++) for(i = 0; i < This->item_count; i++)
IShellItem_Release(This->array[i]); IShellItem_Release(This->array[i]);
heap_free(This->array); free(This->array);
heap_free(This); free(This);
return 0; return 0;
} }
...@@ -1294,17 +1294,17 @@ static HRESULT create_shellitemarray(IShellItem **items, DWORD count, IShellItem ...@@ -1294,17 +1294,17 @@ static HRESULT create_shellitemarray(IShellItem **items, DWORD count, IShellItem
TRACE("(%p, %ld, %p)\n", items, count, ret); TRACE("(%p, %ld, %p)\n", items, count, ret);
This = heap_alloc(sizeof(*This)); This = malloc(sizeof(*This));
if(!This) if(!This)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
This->IShellItemArray_iface.lpVtbl = &vt_IShellItemArray; This->IShellItemArray_iface.lpVtbl = &vt_IShellItemArray;
This->ref = 1; This->ref = 1;
This->array = heap_alloc(count*sizeof(IShellItem*)); This->array = malloc(count * sizeof(IShellItem*));
if (!This->array) if (!This->array)
{ {
heap_free(This); free(This);
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }
memcpy(This->array, items, count*sizeof(IShellItem*)); memcpy(This->array, items, count*sizeof(IShellItem*));
...@@ -1334,7 +1334,7 @@ HRESULT WINAPI SHCreateShellItemArray(PCIDLIST_ABSOLUTE pidlParent, ...@@ -1334,7 +1334,7 @@ HRESULT WINAPI SHCreateShellItemArray(PCIDLIST_ABSOLUTE pidlParent,
if(!ppidl) if(!ppidl)
return E_INVALIDARG; return E_INVALIDARG;
array = heap_alloc_zero(cidl*sizeof(IShellItem*)); array = calloc(cidl, sizeof(IShellItem*));
if(!array) if(!array)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
...@@ -1354,7 +1354,7 @@ HRESULT WINAPI SHCreateShellItemArray(PCIDLIST_ABSOLUTE pidlParent, ...@@ -1354,7 +1354,7 @@ HRESULT WINAPI SHCreateShellItemArray(PCIDLIST_ABSOLUTE pidlParent,
for(i = 0; i < cidl; i++) for(i = 0; i < cidl; i++)
if(array[i]) IShellItem_Release(array[i]); if(array[i]) IShellItem_Release(array[i]);
} }
heap_free(array); free(array);
return ret; return ret;
} }
...@@ -1411,13 +1411,13 @@ HRESULT WINAPI SHCreateShellItemArrayFromDataObject(IDataObject *pdo, REFIID rii ...@@ -1411,13 +1411,13 @@ HRESULT WINAPI SHCreateShellItemArrayFromDataObject(IDataObject *pdo, REFIID rii
parent_pidl = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[0]); parent_pidl = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[0]);
children = heap_alloc(sizeof(LPCITEMIDLIST)*pida->cidl); children = malloc(sizeof(const ITEMIDLIST*) * pida->cidl);
for(i = 0; i < pida->cidl; i++) for(i = 0; i < pida->cidl; i++)
children[i] = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[i+1]); children[i] = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[i+1]);
ret = SHCreateShellItemArray(parent_pidl, NULL, pida->cidl, children, &psia); ret = SHCreateShellItemArray(parent_pidl, NULL, pida->cidl, children, &psia);
heap_free(children); free(children);
GlobalUnlock(medium.hGlobal); GlobalUnlock(medium.hGlobal);
GlobalFree(medium.hGlobal); GlobalFree(medium.hGlobal);
...@@ -1446,7 +1446,7 @@ HRESULT WINAPI SHCreateShellItemArrayFromIDLists(UINT cidl, ...@@ -1446,7 +1446,7 @@ HRESULT WINAPI SHCreateShellItemArrayFromIDLists(UINT cidl,
if(cidl == 0) if(cidl == 0)
return E_INVALIDARG; return E_INVALIDARG;
array = heap_alloc_zero(cidl*sizeof(IShellItem*)); array = calloc(cidl, sizeof(IShellItem*));
if(!array) if(!array)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
...@@ -1468,7 +1468,7 @@ HRESULT WINAPI SHCreateShellItemArrayFromIDLists(UINT cidl, ...@@ -1468,7 +1468,7 @@ HRESULT WINAPI SHCreateShellItemArrayFromIDLists(UINT cidl,
if(array[i]) IShellItem_Release(array[i]); if(array[i]) IShellItem_Release(array[i]);
*psia = NULL; *psia = NULL;
} }
heap_free(array); free(array);
return ret; return ret;
} }
...@@ -1528,7 +1528,7 @@ static ULONG WINAPI CustomDestinationList_Release(ICustomDestinationList *iface) ...@@ -1528,7 +1528,7 @@ static ULONG WINAPI CustomDestinationList_Release(ICustomDestinationList *iface)
TRACE("(%p), new refcount=%li\n", This, ref); TRACE("(%p), new refcount=%li\n", This, ref);
if (ref == 0) if (ref == 0)
heap_free(This); free(This);
return ref; return ref;
} }
...@@ -1640,7 +1640,7 @@ HRESULT WINAPI CustomDestinationList_Constructor(IUnknown *outer, REFIID riid, v ...@@ -1640,7 +1640,7 @@ HRESULT WINAPI CustomDestinationList_Constructor(IUnknown *outer, REFIID riid, v
if (outer) if (outer)
return CLASS_E_NOAGGREGATION; return CLASS_E_NOAGGREGATION;
if(!(list = heap_alloc(sizeof(*list)))) if(!(list = malloc(sizeof(*list))))
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
list->ICustomDestinationList_iface.lpVtbl = &CustomDestinationListVtbl; list->ICustomDestinationList_iface.lpVtbl = &CustomDestinationListVtbl;
......
...@@ -1516,7 +1516,7 @@ static HRESULT WINAPI IShellLinkA_fnSetPath(IShellLinkA *iface, LPCSTR pszFile) ...@@ -1516,7 +1516,7 @@ static HRESULT WINAPI IShellLinkA_fnSetPath(IShellLinkA *iface, LPCSTR pszFile)
if (!str) return E_OUTOFMEMORY; if (!str) return E_OUTOFMEMORY;
r = IShellLinkW_SetPath(&This->IShellLinkW_iface, str); r = IShellLinkW_SetPath(&This->IShellLinkW_iface, str);
free( str ); free(str);
return r; return r;
} }
......
...@@ -1268,7 +1268,7 @@ BOOL WINAPI IsUserAnAdmin(VOID) ...@@ -1268,7 +1268,7 @@ BOOL WINAPI IsUserAnAdmin(VOID)
} }
} }
lpGroups = heap_alloc(dwSize); lpGroups = malloc(dwSize);
if (lpGroups == NULL) if (lpGroups == NULL)
{ {
CloseHandle(hToken); CloseHandle(hToken);
...@@ -1277,7 +1277,7 @@ BOOL WINAPI IsUserAnAdmin(VOID) ...@@ -1277,7 +1277,7 @@ BOOL WINAPI IsUserAnAdmin(VOID)
if (!GetTokenInformation(hToken, TokenGroups, lpGroups, dwSize, &dwSize)) if (!GetTokenInformation(hToken, TokenGroups, lpGroups, dwSize, &dwSize))
{ {
heap_free(lpGroups); free(lpGroups);
CloseHandle(hToken); CloseHandle(hToken);
return FALSE; return FALSE;
} }
...@@ -1287,7 +1287,7 @@ BOOL WINAPI IsUserAnAdmin(VOID) ...@@ -1287,7 +1287,7 @@ BOOL WINAPI IsUserAnAdmin(VOID)
DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0,
&lpSid)) &lpSid))
{ {
heap_free(lpGroups); free(lpGroups);
return FALSE; return FALSE;
} }
...@@ -1301,7 +1301,7 @@ BOOL WINAPI IsUserAnAdmin(VOID) ...@@ -1301,7 +1301,7 @@ BOOL WINAPI IsUserAnAdmin(VOID)
} }
FreeSid(lpSid); FreeSid(lpSid);
heap_free(lpGroups); free(lpGroups);
return bResult; return bResult;
} }
...@@ -1427,7 +1427,7 @@ DWORD WINAPI DoEnvironmentSubstA(LPSTR pszString, UINT cchString) ...@@ -1427,7 +1427,7 @@ DWORD WINAPI DoEnvironmentSubstA(LPSTR pszString, UINT cchString)
TRACE("(%s, %d)\n", debugstr_a(pszString), cchString); TRACE("(%s, %d)\n", debugstr_a(pszString), cchString);
if ((dst = heap_alloc(cchString * sizeof(CHAR)))) if ((dst = malloc(cchString * sizeof(CHAR))))
{ {
len = ExpandEnvironmentStringsA(pszString, dst, cchString); len = ExpandEnvironmentStringsA(pszString, dst, cchString);
/* len includes the terminating 0 */ /* len includes the terminating 0 */
...@@ -1439,7 +1439,7 @@ DWORD WINAPI DoEnvironmentSubstA(LPSTR pszString, UINT cchString) ...@@ -1439,7 +1439,7 @@ DWORD WINAPI DoEnvironmentSubstA(LPSTR pszString, UINT cchString)
else else
len = cchString; len = cchString;
heap_free(dst); free(dst);
} }
return MAKELONG(len, res); return MAKELONG(len, res);
} }
...@@ -1471,7 +1471,7 @@ DWORD WINAPI DoEnvironmentSubstW(LPWSTR pszString, UINT cchString) ...@@ -1471,7 +1471,7 @@ DWORD WINAPI DoEnvironmentSubstW(LPWSTR pszString, UINT cchString)
TRACE("(%s, %d)\n", debugstr_w(pszString), cchString); TRACE("(%s, %d)\n", debugstr_w(pszString), cchString);
if ((cchString < MAXLONG) && (dst = heap_alloc(cchString * sizeof(WCHAR)))) if ((cchString < MAXLONG) && (dst = malloc(cchString * sizeof(WCHAR))))
{ {
len = ExpandEnvironmentStringsW(pszString, dst, cchString); len = ExpandEnvironmentStringsW(pszString, dst, cchString);
/* len includes the terminating 0 */ /* len includes the terminating 0 */
...@@ -1483,7 +1483,7 @@ DWORD WINAPI DoEnvironmentSubstW(LPWSTR pszString, UINT cchString) ...@@ -1483,7 +1483,7 @@ DWORD WINAPI DoEnvironmentSubstW(LPWSTR pszString, UINT cchString)
else else
len = cchString; len = cchString;
heap_free(dst); free(dst);
} }
return MAKELONG(len, res); return MAKELONG(len, res);
} }
......
...@@ -887,7 +887,7 @@ static ULONG WINAPI ApplicationDestinations_Release(IApplicationDestinations *if ...@@ -887,7 +887,7 @@ static ULONG WINAPI ApplicationDestinations_Release(IApplicationDestinations *if
TRACE("(%p), new refcount=%li\n", This, ref); TRACE("(%p), new refcount=%li\n", This, ref);
if (ref == 0) if (ref == 0)
heap_free(This); free(This);
return ref; return ref;
} }
...@@ -1006,7 +1006,7 @@ static ULONG WINAPI ApplicationDocumentLists_Release(IApplicationDocumentLists * ...@@ -1006,7 +1006,7 @@ static ULONG WINAPI ApplicationDocumentLists_Release(IApplicationDocumentLists *
TRACE("(%p), new refcount=%li\n", This, ref); TRACE("(%p), new refcount=%li\n", This, ref);
if (ref == 0) if (ref == 0)
heap_free(This); free(This);
return ref; return ref;
} }
...@@ -2329,13 +2329,13 @@ static LPWSTR _GetUserSidStringFromToken(HANDLE Token) ...@@ -2329,13 +2329,13 @@ static LPWSTR _GetUserSidStringFromToken(HANDLE Token)
{ {
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
return NULL; return NULL;
UserInfo = heap_alloc(InfoSize); UserInfo = malloc(InfoSize);
if (UserInfo == NULL) if (UserInfo == NULL)
return NULL; return NULL;
if (! GetTokenInformation(Token, TokenUser, UserInfo, InfoSize, if (! GetTokenInformation(Token, TokenUser, UserInfo, InfoSize,
&InfoSize)) &InfoSize))
{ {
heap_free(UserInfo); free(UserInfo);
return NULL; return NULL;
} }
} }
...@@ -2344,7 +2344,7 @@ static LPWSTR _GetUserSidStringFromToken(HANDLE Token) ...@@ -2344,7 +2344,7 @@ static LPWSTR _GetUserSidStringFromToken(HANDLE Token)
SidStr = NULL; SidStr = NULL;
if (UserInfo != (PTOKEN_USER) InfoBuffer) if (UserInfo != (PTOKEN_USER) InfoBuffer)
heap_free(UserInfo); free(UserInfo);
return SidStr; return SidStr;
} }
...@@ -2656,20 +2656,20 @@ static BOOL WINAPI init_xdg_dirs( INIT_ONCE *once, void *param, void **context ) ...@@ -2656,20 +2656,20 @@ static BOOL WINAPI init_xdg_dirs( INIT_ONCE *once, void *param, void **context )
fmt = L"%s/.config/user-dirs.dirs"; fmt = L"%s/.config/user-dirs.dirs";
} }
len = lstrlenW(var) + lstrlenW(fmt); len = lstrlenW(var) + lstrlenW(fmt);
name = heap_alloc( len * sizeof(WCHAR) ); name = malloc( len * sizeof(WCHAR) );
swprintf( name, len, fmt, var ); swprintf( name, len, fmt, var );
name[1] = '\\'; /* change \??\ to \\?\ */ name[1] = '\\'; /* change \??\ to \\?\ */
for (ptr = name; *ptr; ptr++) if (*ptr == '/') *ptr = '\\'; for (ptr = name; *ptr; ptr++) if (*ptr == '/') *ptr = '\\';
file = CreateFileW( name, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0 ); file = CreateFileW( name, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0 );
heap_free( name ); free( name );
if (file != INVALID_HANDLE_VALUE) if (file != INVALID_HANDLE_VALUE)
{ {
len = GetFileSize( file, NULL ); len = GetFileSize( file, NULL );
if (!(xdg_config = heap_alloc( len + 1 ))) return TRUE; if (!(xdg_config = malloc( len + 1 ))) return TRUE;
if (!ReadFile( file, xdg_config, len, &xdg_config_len, NULL )) if (!ReadFile( file, xdg_config, len, &xdg_config_len, NULL ))
{ {
heap_free( xdg_config ); free( xdg_config );
xdg_config = NULL; xdg_config = NULL;
} }
else else
...@@ -2704,7 +2704,7 @@ static char *get_xdg_path( const char *var ) ...@@ -2704,7 +2704,7 @@ static char *get_xdg_path( const char *var )
p++; p++;
if (*p != '/' && strncmp( p, "$HOME/", 6 )) continue; if (*p != '/' && strncmp( p, "$HOME/", 6 )) continue;
if (!(ret = heap_alloc( strlen(p) + 1 ))) break; if (!(ret = malloc( strlen(p) + 1 ))) break;
for (i = 0; *p && *p != '"'; i++, p++) for (i = 0; *p && *p != '"'; i++, p++)
{ {
if (*p == '\\' && p[1]) p++; if (*p == '\\' && p[1]) p++;
...@@ -2713,7 +2713,7 @@ static char *get_xdg_path( const char *var ) ...@@ -2713,7 +2713,7 @@ static char *get_xdg_path( const char *var )
ret[i] = 0; ret[i] = 0;
if (*p != '"') if (*p != '"')
{ {
heap_free( ret ); free( ret );
ret = NULL; ret = NULL;
} }
break; break;
...@@ -2727,7 +2727,7 @@ static BOOL link_folder( HANDLE mgr, const UNICODE_STRING *path, const char *lin ...@@ -2727,7 +2727,7 @@ static BOOL link_folder( HANDLE mgr, const UNICODE_STRING *path, const char *lin
DWORD len = sizeof(*ioctl) + path->Length + strlen(link) + 1; DWORD len = sizeof(*ioctl) + path->Length + strlen(link) + 1;
BOOL ret; BOOL ret;
if (!(ioctl = heap_alloc( len ))) return FALSE; if (!(ioctl = malloc( len ))) return FALSE;
ioctl->create_backup = FALSE; ioctl->create_backup = FALSE;
ioctl->folder_offset = sizeof(*ioctl); ioctl->folder_offset = sizeof(*ioctl);
ioctl->folder_size = path->Length; ioctl->folder_size = path->Length;
...@@ -2736,7 +2736,7 @@ static BOOL link_folder( HANDLE mgr, const UNICODE_STRING *path, const char *lin ...@@ -2736,7 +2736,7 @@ static BOOL link_folder( HANDLE mgr, const UNICODE_STRING *path, const char *lin
strcpy( (char *)ioctl + ioctl->symlink_offset, link ); strcpy( (char *)ioctl + ioctl->symlink_offset, link );
ret = DeviceIoControl( mgr, IOCTL_MOUNTMGR_DEFINE_SHELL_FOLDER, ioctl, len, NULL, 0, NULL, NULL ); ret = DeviceIoControl( mgr, IOCTL_MOUNTMGR_DEFINE_SHELL_FOLDER, ioctl, len, NULL, 0, NULL, NULL );
heap_free( ioctl ); free( ioctl );
return ret; return ret;
} }
...@@ -2771,7 +2771,7 @@ static void create_link( const WCHAR *path, const char *xdg_name, const char *de ...@@ -2771,7 +2771,7 @@ static void create_link( const WCHAR *path, const char *xdg_name, const char *de
done: done:
RtlFreeUnicodeString( &nt_name ); RtlFreeUnicodeString( &nt_name );
heap_free( target ); free( target );
CloseHandle( mgr ); CloseHandle( mgr );
} }
...@@ -2862,7 +2862,7 @@ HRESULT WINAPI SHGetFolderPathAndSubDirA( ...@@ -2862,7 +2862,7 @@ HRESULT WINAPI SHGetFolderPathAndSubDirA(
TRACE("%p,%#x,%p,%#lx,%s,%p\n", hwndOwner, nFolder, hToken, dwFlags, debugstr_a(pszSubPath), pszPath); TRACE("%p,%#x,%p,%#lx,%s,%p\n", hwndOwner, nFolder, hToken, dwFlags, debugstr_a(pszSubPath), pszPath);
if(pszPath) { if(pszPath) {
pszPathW = heap_alloc(MAX_PATH * sizeof(WCHAR)); pszPathW = malloc(MAX_PATH * sizeof(WCHAR));
if(!pszPathW) { if(!pszPathW) {
hr = HRESULT_FROM_WIN32(ERROR_NOT_ENOUGH_MEMORY); hr = HRESULT_FROM_WIN32(ERROR_NOT_ENOUGH_MEMORY);
goto cleanup; goto cleanup;
...@@ -2876,7 +2876,7 @@ HRESULT WINAPI SHGetFolderPathAndSubDirA( ...@@ -2876,7 +2876,7 @@ HRESULT WINAPI SHGetFolderPathAndSubDirA(
*/ */
if (pszSubPath && pszSubPath[0]) { if (pszSubPath && pszSubPath[0]) {
length = MultiByteToWideChar(CP_ACP, 0, pszSubPath, -1, NULL, 0); length = MultiByteToWideChar(CP_ACP, 0, pszSubPath, -1, NULL, 0);
pszSubPathW = heap_alloc(length * sizeof(WCHAR)); pszSubPathW = malloc(length * sizeof(WCHAR));
if(!pszSubPathW) { if(!pszSubPathW) {
hr = HRESULT_FROM_WIN32(ERROR_NOT_ENOUGH_MEMORY); hr = HRESULT_FROM_WIN32(ERROR_NOT_ENOUGH_MEMORY);
goto cleanup; goto cleanup;
...@@ -2890,8 +2890,8 @@ HRESULT WINAPI SHGetFolderPathAndSubDirA( ...@@ -2890,8 +2890,8 @@ HRESULT WINAPI SHGetFolderPathAndSubDirA(
WideCharToMultiByte(CP_ACP, 0, pszPathW, -1, pszPath, MAX_PATH, NULL, NULL); WideCharToMultiByte(CP_ACP, 0, pszPathW, -1, pszPath, MAX_PATH, NULL, NULL);
cleanup: cleanup:
heap_free(pszPathW); free(pszPathW);
heap_free(pszSubPathW); free(pszSubPathW);
return hr; return hr;
} }
...@@ -3616,7 +3616,7 @@ static HRESULT get_known_folder_registry_path( ...@@ -3616,7 +3616,7 @@ static HRESULT get_known_folder_registry_path(
lstrcpyW(sGuid, lpStringGuid); lstrcpyW(sGuid, lpStringGuid);
length = lstrlenW(L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions")+51; length = lstrlenW(L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions")+51;
*lpPath = heap_alloc(length*sizeof(WCHAR)); *lpPath = malloc(length * sizeof(WCHAR));
if(!(*lpPath)) if(!(*lpPath))
hr = E_OUTOFMEMORY; hr = E_OUTOFMEMORY;
...@@ -3697,7 +3697,7 @@ static HRESULT get_known_folder_redirection_place( ...@@ -3697,7 +3697,7 @@ static HRESULT get_known_folder_redirection_place(
hr = E_FAIL; hr = E_FAIL;
} }
heap_free(lpRegistryPath); free(lpRegistryPath);
return hr; return hr;
} }
...@@ -3725,7 +3725,7 @@ static HRESULT redirect_known_folder( ...@@ -3725,7 +3725,7 @@ static HRESULT redirect_known_folder(
if(SUCCEEDED(hr)) if(SUCCEEDED(hr))
hr = get_known_folder_path_by_id(rfid, lpRegistryPath, 0, &lpSrcPath); hr = get_known_folder_path_by_id(rfid, lpRegistryPath, 0, &lpSrcPath);
heap_free(lpRegistryPath); free(lpRegistryPath);
/* get path to redirection storage */ /* get path to redirection storage */
if(SUCCEEDED(hr)) if(SUCCEEDED(hr))
...@@ -3821,8 +3821,8 @@ static ULONG WINAPI knownfolder_Release( ...@@ -3821,8 +3821,8 @@ static ULONG WINAPI knownfolder_Release(
if (!refs) if (!refs)
{ {
TRACE("destroying %p\n", knownfolder); TRACE("destroying %p\n", knownfolder);
heap_free( knownfolder->registryPath ); free( knownfolder->registryPath );
heap_free( knownfolder ); free( knownfolder );
} }
return refs; return refs;
} }
...@@ -3880,7 +3880,7 @@ static HRESULT knownfolder_set_id( ...@@ -3880,7 +3880,7 @@ static HRESULT knownfolder_set_id(
else else
{ {
/* This known folder is not registered. To mark it, we set registryPath to NULL */ /* This known folder is not registered. To mark it, we set registryPath to NULL */
heap_free(knownfolder->registryPath); free(knownfolder->registryPath);
knownfolder->registryPath = NULL; knownfolder->registryPath = NULL;
hr = S_OK; hr = S_OK;
} }
...@@ -3959,15 +3959,15 @@ static HRESULT get_known_folder_path( ...@@ -3959,15 +3959,15 @@ static HRESULT get_known_folder_path(
hr = get_known_folder_path(parentGuid, parentRegistryPath, &parentPath); hr = get_known_folder_path(parentGuid, parentRegistryPath, &parentPath);
if(FAILED(hr)) { if(FAILED(hr)) {
heap_free(parentRegistryPath); free(parentRegistryPath);
return hr; return hr;
} }
lstrcatW(path, parentPath); lstrcatW(path, parentPath);
lstrcatW(path, L"\\"); lstrcatW(path, L"\\");
heap_free(parentRegistryPath); free(parentRegistryPath);
heap_free(parentPath); free(parentPath);
} }
/* check, if folder was redirected */ /* check, if folder was redirected */
...@@ -4182,7 +4182,7 @@ static HRESULT knownfolder_create( struct knownfolder **knownfolder ) ...@@ -4182,7 +4182,7 @@ static HRESULT knownfolder_create( struct knownfolder **knownfolder )
{ {
struct knownfolder *kf; struct knownfolder *kf;
kf = heap_alloc( sizeof(*kf) ); kf = malloc( sizeof(*kf) );
if (!kf) return E_OUTOFMEMORY; if (!kf) return E_OUTOFMEMORY;
kf->IKnownFolder_iface.lpVtbl = &knownfolder_vtbl; kf->IKnownFolder_iface.lpVtbl = &knownfolder_vtbl;
...@@ -4224,8 +4224,8 @@ static ULONG WINAPI foldermanager_Release( ...@@ -4224,8 +4224,8 @@ static ULONG WINAPI foldermanager_Release(
if (!refs) if (!refs)
{ {
TRACE("destroying %p\n", foldermanager); TRACE("destroying %p\n", foldermanager);
heap_free( foldermanager->ids ); free( foldermanager->ids );
heap_free( foldermanager ); free( foldermanager );
} }
return refs; return refs;
} }
...@@ -4317,7 +4317,7 @@ static BOOL is_knownfolder( struct foldermanager *fm, const KNOWNFOLDERID *id ) ...@@ -4317,7 +4317,7 @@ static BOOL is_knownfolder( struct foldermanager *fm, const KNOWNFOLDERID *id )
if(SUCCEEDED(hr)) if(SUCCEEDED(hr))
{ {
hr = HRESULT_FROM_WIN32(RegOpenKeyExW(HKEY_LOCAL_MACHINE, registryPath, 0, 0, &hKey)); hr = HRESULT_FROM_WIN32(RegOpenKeyExW(HKEY_LOCAL_MACHINE, registryPath, 0, 0, &hKey));
heap_free(registryPath); free(registryPath);
} }
if(SUCCEEDED(hr)) if(SUCCEEDED(hr))
...@@ -4377,7 +4377,7 @@ static HRESULT WINAPI foldermanager_GetFolderByName( ...@@ -4377,7 +4377,7 @@ static HRESULT WINAPI foldermanager_GetFolderByName(
if (FAILED( hr )) return hr; if (FAILED( hr )) return hr;
hr = get_known_folder_wstr( path, L"Name", &name ); hr = get_known_folder_wstr( path, L"Name", &name );
heap_free( path ); free( path );
if (FAILED( hr )) return hr; if (FAILED( hr )) return hr;
found = !wcsicmp( pszCanonicalName, name ); found = !wcsicmp( pszCanonicalName, name );
...@@ -4451,7 +4451,7 @@ static HRESULT register_folder(const KNOWNFOLDERID *rfid, const KNOWNFOLDER_DEFI ...@@ -4451,7 +4451,7 @@ static HRESULT register_folder(const KNOWNFOLDERID *rfid, const KNOWNFOLDER_DEFI
SHDeleteKeyW(HKEY_LOCAL_MACHINE, registryPath); SHDeleteKeyW(HKEY_LOCAL_MACHINE, registryPath);
} }
heap_free(registryPath); free(registryPath);
return hr; return hr;
} }
...@@ -4477,7 +4477,7 @@ static HRESULT WINAPI foldermanager_UnregisterFolder( ...@@ -4477,7 +4477,7 @@ static HRESULT WINAPI foldermanager_UnregisterFolder(
if(SUCCEEDED(hr)) if(SUCCEEDED(hr))
hr = HRESULT_FROM_WIN32(SHDeleteKeyW(HKEY_LOCAL_MACHINE, registryPath)); hr = HRESULT_FROM_WIN32(SHDeleteKeyW(HKEY_LOCAL_MACHINE, registryPath));
heap_free(registryPath); free(registryPath);
return hr; return hr;
} }
...@@ -4535,7 +4535,7 @@ static HRESULT foldermanager_create( void **ppv ) ...@@ -4535,7 +4535,7 @@ static HRESULT foldermanager_create( void **ppv )
UINT i, j; UINT i, j;
struct foldermanager *fm; struct foldermanager *fm;
fm = heap_alloc( sizeof(*fm) ); fm = malloc( sizeof(*fm) );
if (!fm) return E_OUTOFMEMORY; if (!fm) return E_OUTOFMEMORY;
fm->IKnownFolderManager_iface.lpVtbl = &foldermanager_vtbl; fm->IKnownFolderManager_iface.lpVtbl = &foldermanager_vtbl;
...@@ -4546,10 +4546,10 @@ static HRESULT foldermanager_create( void **ppv ) ...@@ -4546,10 +4546,10 @@ static HRESULT foldermanager_create( void **ppv )
{ {
if (!IsEqualGUID( CSIDL_Data[i].id, &GUID_NULL )) fm->num_ids++; if (!IsEqualGUID( CSIDL_Data[i].id, &GUID_NULL )) fm->num_ids++;
} }
fm->ids = heap_alloc( fm->num_ids * sizeof(KNOWNFOLDERID) ); fm->ids = malloc( fm->num_ids * sizeof(KNOWNFOLDERID) );
if (!fm->ids) if (!fm->ids)
{ {
heap_free( fm ); free( fm );
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }
for (i = j = 0; i < ARRAY_SIZE(CSIDL_Data); i++) for (i = j = 0; i < ARRAY_SIZE(CSIDL_Data); i++)
......
...@@ -807,7 +807,7 @@ static void get_display_name( WCHAR dest[MAX_PATH], const WCHAR *path, LPCITEMID ...@@ -807,7 +807,7 @@ static void get_display_name( WCHAR dest[MAX_PATH], const WCHAR *path, LPCITEMID
if (!is_unix) if (!is_unix)
{ {
len = WideCharToMultiByte( CP_UNIXCP, 0, path + 8, -1, NULL, 0, NULL, NULL ); len = WideCharToMultiByte( CP_UNIXCP, 0, path + 8, -1, NULL, 0, NULL, NULL );
buffer = heap_alloc( len ); buffer = malloc( len );
len = WideCharToMultiByte( CP_UNIXCP, 0, path + 8, -1, buffer, len, NULL, NULL ); len = WideCharToMultiByte( CP_UNIXCP, 0, path + 8, -1, buffer, len, NULL, NULL );
for (i = 0; i < len; i++) if (buffer[i] == '\\') buffer[i] = '/'; for (i = 0; i < len; i++) if (buffer[i] == '\\') buffer[i] = '/';
if ((res = wine_get_dos_file_name( buffer ))) if ((res = wine_get_dos_file_name( buffer )))
...@@ -1232,7 +1232,7 @@ static WCHAR *build_paths_list(LPCWSTR wszBasePath, int cidl, const LPCITEMIDLIS ...@@ -1232,7 +1232,7 @@ static WCHAR *build_paths_list(LPCWSTR wszBasePath, int cidl, const LPCITEMIDLIS
int i; int i;
iPathLen = lstrlenW(wszBasePath); iPathLen = lstrlenW(wszBasePath);
wszPathsList = heap_alloc(MAX_PATH*sizeof(WCHAR)*cidl+1); wszPathsList = malloc(MAX_PATH * sizeof(WCHAR) * cidl + 1);
wszListPos = wszPathsList; wszListPos = wszPathsList;
for (i = 0; i < cidl; i++) { for (i = 0; i < cidl; i++) {
...@@ -1310,7 +1310,7 @@ ISFHelper_fnDeleteItems (ISFHelper * iface, UINT cidl, LPCITEMIDLIST * apidl) ...@@ -1310,7 +1310,7 @@ ISFHelper_fnDeleteItems (ISFHelper * iface, UINT cidl, LPCITEMIDLIST * apidl)
wszCurrentPath += lstrlenW(wszCurrentPath)+1; wszCurrentPath += lstrlenW(wszCurrentPath)+1;
} }
heap_free(wszPathsList); free(wszPathsList);
return ret; return ret;
} }
...@@ -1360,7 +1360,7 @@ ISFHelper_fnCopyItems (ISFHelper * iface, IShellFolder * pSFFrom, UINT cidl, ...@@ -1360,7 +1360,7 @@ ISFHelper_fnCopyItems (ISFHelper * iface, IShellFolder * pSFFrom, UINT cidl,
WARN("Copy failed\n"); WARN("Copy failed\n");
ret = E_FAIL; ret = E_FAIL;
} }
heap_free(wszSrcPathsList); free(wszSrcPathsList);
} }
SHFree(pidl); SHFree(pidl);
IPersistFolder2_Release(ppf2); IPersistFolder2_Release(ppf2);
......
...@@ -88,7 +88,7 @@ HRESULT WINAPI ISF_NetworkPlaces_Constructor (IUnknown * pUnkOuter, REFIID riid, ...@@ -88,7 +88,7 @@ HRESULT WINAPI ISF_NetworkPlaces_Constructor (IUnknown * pUnkOuter, REFIID riid,
if (pUnkOuter) if (pUnkOuter)
return CLASS_E_NOAGGREGATION; return CLASS_E_NOAGGREGATION;
sf = heap_alloc_zero (sizeof (*sf)); sf = calloc (1, sizeof (*sf));
if (!sf) if (!sf)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
...@@ -164,7 +164,7 @@ static ULONG WINAPI ISF_NetworkPlaces_fnRelease (IShellFolder2 * iface) ...@@ -164,7 +164,7 @@ static ULONG WINAPI ISF_NetworkPlaces_fnRelease (IShellFolder2 * iface)
if (!refCount) { if (!refCount) {
TRACE ("-- destroying IShellFolder(%p)\n", This); TRACE ("-- destroying IShellFolder(%p)\n", This);
SHFree (This->pidlRoot); SHFree (This->pidlRoot);
heap_free (This); free (This);
} }
return refCount; return refCount;
} }
......
...@@ -379,7 +379,7 @@ static void *SHELL_BuildEnvW( const WCHAR *path ) ...@@ -379,7 +379,7 @@ static void *SHELL_BuildEnvW( const WCHAR *path )
if (!got_path) total += 5; /* we need to create PATH */ if (!got_path) total += 5; /* we need to create PATH */
total++; /* terminating null */ total++; /* terminating null */
if (!(new_env = heap_alloc( total * sizeof(WCHAR) ))) if (!(new_env = malloc( total * sizeof(WCHAR) )))
{ {
FreeEnvironmentStringsW( strings ); FreeEnvironmentStringsW( strings );
return NULL; return NULL;
...@@ -913,7 +913,7 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec ...@@ -913,7 +913,7 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec
SHELL_ArgifyW(static_res, ARRAY_SIZE(static_res), exec, lpFile, pidl, szCommandline, &resultLen); SHELL_ArgifyW(static_res, ARRAY_SIZE(static_res), exec, lpFile, pidl, szCommandline, &resultLen);
if (resultLen > ARRAY_SIZE(static_res)) if (resultLen > ARRAY_SIZE(static_res))
{ {
res = dynamic_res = heap_alloc(resultLen * sizeof(WCHAR)); res = dynamic_res = malloc(resultLen * sizeof(WCHAR));
SHELL_ArgifyW(dynamic_res, resultLen, exec, lpFile, pidl, szCommandline, NULL); SHELL_ArgifyW(dynamic_res, resultLen, exec, lpFile, pidl, szCommandline, NULL);
} }
else else
...@@ -929,11 +929,11 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec ...@@ -929,11 +929,11 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec
else else
{ {
DWORD lenA = WideCharToMultiByte(CP_ACP, 0, res, -1, NULL, 0, NULL, NULL); DWORD lenA = WideCharToMultiByte(CP_ACP, 0, res, -1, NULL, 0, NULL, NULL);
char *resA = heap_alloc(lenA); char *resA = malloc(lenA);
WideCharToMultiByte(CP_ACP, 0, res, -1, resA, lenA, NULL, NULL); WideCharToMultiByte(CP_ACP, 0, res, -1, resA, lenA, NULL, NULL);
hDdeData = DdeClientTransaction( (LPBYTE)resA, lenA, hConv, 0L, 0, hDdeData = DdeClientTransaction( (LPBYTE)resA, lenA, hConv, 0L, 0,
XTYP_EXECUTE, 10000, &tid ); XTYP_EXECUTE, 10000, &tid );
heap_free(resA); free(resA);
} }
if (hDdeData) if (hDdeData)
DdeFreeDataHandle(hDdeData); DdeFreeDataHandle(hDdeData);
...@@ -941,7 +941,7 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec ...@@ -941,7 +941,7 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec
WARN("DdeClientTransaction failed with error %04x\n", DdeGetLastError(ddeInst)); WARN("DdeClientTransaction failed with error %04x\n", DdeGetLastError(ddeInst));
ret = 33; ret = 33;
heap_free(dynamic_res); free(dynamic_res);
DdeDisconnect(hConv); DdeDisconnect(hConv);
...@@ -1113,7 +1113,7 @@ static HKEY ShellExecute_GetClassKey( const SHELLEXECUTEINFOW *sei ) ...@@ -1113,7 +1113,7 @@ static HKEY ShellExecute_GetClassKey( const SHELLEXECUTEINFOW *sei )
if ( r == ERROR_SUCCESS && type == REG_SZ ) if ( r == ERROR_SUCCESS && type == REG_SZ )
{ {
sz += sizeof (WCHAR); sz += sizeof (WCHAR);
cls = heap_alloc( sz ); cls = malloc( sz );
cls[0] = 0; cls[0] = 0;
RegQueryValueExW( hkey, NULL, 0, &type, (LPBYTE) cls, &sz ); RegQueryValueExW( hkey, NULL, 0, &type, (LPBYTE) cls, &sz );
} }
...@@ -1128,7 +1128,7 @@ static HKEY ShellExecute_GetClassKey( const SHELLEXECUTEINFOW *sei ) ...@@ -1128,7 +1128,7 @@ static HKEY ShellExecute_GetClassKey( const SHELLEXECUTEINFOW *sei )
if ( lpClass ) if ( lpClass )
RegOpenKeyW( HKEY_CLASSES_ROOT, lpClass, &hkey ); RegOpenKeyW( HKEY_CLASSES_ROOT, lpClass, &hkey );
heap_free( cls ); free( cls );
return hkey; return hkey;
} }
...@@ -1448,7 +1448,7 @@ static UINT_PTR SHELL_quote_and_execute( LPCWSTR wcmd, LPCWSTR wszParameters, LP ...@@ -1448,7 +1448,7 @@ static UINT_PTR SHELL_quote_and_execute( LPCWSTR wcmd, LPCWSTR wszParameters, LP
/* Length of space plus length of parameters */ /* Length of space plus length of parameters */
len += 1 + lstrlenW(wszParameters); len += 1 + lstrlenW(wszParameters);
} }
wszQuotedCmd = heap_alloc(len * sizeof(WCHAR)); wszQuotedCmd = malloc(len * sizeof(WCHAR));
/* Must quote to handle case where cmd contains spaces, /* Must quote to handle case where cmd contains spaces,
* else security hole if malicious user creates executable file "C:\\Program" * else security hole if malicious user creates executable file "C:\\Program"
*/ */
...@@ -1464,7 +1464,7 @@ static UINT_PTR SHELL_quote_and_execute( LPCWSTR wcmd, LPCWSTR wszParameters, LP ...@@ -1464,7 +1464,7 @@ static UINT_PTR SHELL_quote_and_execute( LPCWSTR wcmd, LPCWSTR wszParameters, LP
retval = execute_from_key(wszKeyname, wszApplicationName, env, psei->lpParameters, wcmd, execfunc, psei, psei_out); retval = execute_from_key(wszKeyname, wszApplicationName, env, psei->lpParameters, wcmd, execfunc, psei, psei_out);
else else
retval = execfunc(wszQuotedCmd, env, FALSE, psei, psei_out); retval = execfunc(wszQuotedCmd, env, FALSE, psei, psei_out);
heap_free(wszQuotedCmd); free(wszQuotedCmd);
return retval; return retval;
} }
...@@ -1489,7 +1489,7 @@ static UINT_PTR SHELL_execute_url( LPCWSTR lpFile, LPCWSTR wcmd, LPSHELLEXECUTEI ...@@ -1489,7 +1489,7 @@ static UINT_PTR SHELL_execute_url( LPCWSTR lpFile, LPCWSTR wcmd, LPSHELLEXECUTEI
len += lstrlenW(psei->lpVerb); len += lstrlenW(psei->lpVerb);
else else
len += lstrlenW(L"open"); len += lstrlenW(L"open");
lpstrProtocol = heap_alloc(len * sizeof(WCHAR)); lpstrProtocol = malloc(len * sizeof(WCHAR));
memcpy(lpstrProtocol, lpFile, iSize*sizeof(WCHAR)); memcpy(lpstrProtocol, lpFile, iSize*sizeof(WCHAR));
lpstrProtocol[iSize] = '\0'; lpstrProtocol[iSize] = '\0';
lstrcatW(lpstrProtocol, L"\\shell\\"); lstrcatW(lpstrProtocol, L"\\shell\\");
...@@ -1498,7 +1498,7 @@ static UINT_PTR SHELL_execute_url( LPCWSTR lpFile, LPCWSTR wcmd, LPSHELLEXECUTEI ...@@ -1498,7 +1498,7 @@ static UINT_PTR SHELL_execute_url( LPCWSTR lpFile, LPCWSTR wcmd, LPSHELLEXECUTEI
retval = execute_from_key(lpstrProtocol, lpFile, NULL, psei->lpParameters, retval = execute_from_key(lpstrProtocol, lpFile, NULL, psei->lpParameters,
wcmd, execfunc, psei, psei_out); wcmd, execfunc, psei, psei_out);
heap_free(lpstrProtocol); free(lpstrProtocol);
return retval; return retval;
} }
...@@ -1523,13 +1523,13 @@ static WCHAR *expand_environment( const WCHAR *str ) ...@@ -1523,13 +1523,13 @@ static WCHAR *expand_environment( const WCHAR *str )
len = ExpandEnvironmentStringsW(str, NULL, 0); len = ExpandEnvironmentStringsW(str, NULL, 0);
if (!len) return NULL; if (!len) return NULL;
buf = heap_alloc(len * sizeof(WCHAR)); buf = malloc(len * sizeof(WCHAR));
if (!buf) return NULL; if (!buf) return NULL;
len = ExpandEnvironmentStringsW(str, buf, len); len = ExpandEnvironmentStringsW(str, buf, len);
if (!len) if (!len)
{ {
heap_free(buf); free(buf);
return NULL; return NULL;
} }
return buf; return buf;
...@@ -1572,13 +1572,13 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) ...@@ -1572,13 +1572,13 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
/* make copies of all path/command strings */ /* make copies of all path/command strings */
if (!sei_tmp.lpFile) if (!sei_tmp.lpFile)
{ {
wszApplicationName = heap_alloc(dwApplicationNameLen*sizeof(WCHAR)); wszApplicationName = malloc(dwApplicationNameLen * sizeof(WCHAR));
*wszApplicationName = '\0'; *wszApplicationName = '\0';
} }
else if (*sei_tmp.lpFile == '\"' && sei_tmp.lpFile[(len = lstrlenW(sei_tmp.lpFile))-1] == '\"') else if (*sei_tmp.lpFile == '\"' && sei_tmp.lpFile[(len = lstrlenW(sei_tmp.lpFile))-1] == '\"')
{ {
if(len-1 >= dwApplicationNameLen) dwApplicationNameLen = len; if(len-1 >= dwApplicationNameLen) dwApplicationNameLen = len;
wszApplicationName = heap_alloc(dwApplicationNameLen*sizeof(WCHAR)); wszApplicationName = malloc(dwApplicationNameLen * sizeof(WCHAR));
memcpy(wszApplicationName, sei_tmp.lpFile+1, len*sizeof(WCHAR)); memcpy(wszApplicationName, sei_tmp.lpFile+1, len*sizeof(WCHAR));
if(len > 2) if(len > 2)
wszApplicationName[len-2] = '\0'; wszApplicationName[len-2] = '\0';
...@@ -1586,7 +1586,7 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) ...@@ -1586,7 +1586,7 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
} else { } else {
DWORD l = lstrlenW(sei_tmp.lpFile)+1; DWORD l = lstrlenW(sei_tmp.lpFile)+1;
if(l > dwApplicationNameLen) dwApplicationNameLen = l+1; if(l > dwApplicationNameLen) dwApplicationNameLen = l+1;
wszApplicationName = heap_alloc(dwApplicationNameLen*sizeof(WCHAR)); wszApplicationName = malloc(dwApplicationNameLen * sizeof(WCHAR));
memcpy(wszApplicationName, sei_tmp.lpFile, l*sizeof(WCHAR)); memcpy(wszApplicationName, sei_tmp.lpFile, l*sizeof(WCHAR));
} }
...@@ -1596,7 +1596,7 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) ...@@ -1596,7 +1596,7 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
len = lstrlenW(sei_tmp.lpParameters) + 1; len = lstrlenW(sei_tmp.lpParameters) + 1;
if (len > parametersLen) if (len > parametersLen)
{ {
wszParameters = heap_alloc(len * sizeof(WCHAR)); wszParameters = malloc(len * sizeof(WCHAR));
parametersLen = len; parametersLen = len;
} }
lstrcpyW(wszParameters, sei_tmp.lpParameters); lstrcpyW(wszParameters, sei_tmp.lpParameters);
...@@ -1609,7 +1609,7 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) ...@@ -1609,7 +1609,7 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
{ {
len = lstrlenW(sei_tmp.lpDirectory) + 1; len = lstrlenW(sei_tmp.lpDirectory) + 1;
if (len > ARRAY_SIZE(dirBuffer)) if (len > ARRAY_SIZE(dirBuffer))
wszDir = heap_alloc(len * sizeof(WCHAR)); wszDir = malloc(len * sizeof(WCHAR));
lstrcpyW(wszDir, sei_tmp.lpDirectory); lstrcpyW(wszDir, sei_tmp.lpDirectory);
} }
else else
...@@ -1639,11 +1639,11 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) ...@@ -1639,11 +1639,11 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
IShellExecuteHookW_Release(pSEH); IShellExecuteHookW_Release(pSEH);
if (hr == S_OK) { if (hr == S_OK) {
heap_free(wszApplicationName); free(wszApplicationName);
if (wszParameters != parametersBuffer) if (wszParameters != parametersBuffer)
heap_free(wszParameters); free(wszParameters);
if (wszDir != dirBuffer) if (wszDir != dirBuffer)
heap_free(wszDir); free(wszDir);
return TRUE; return TRUE;
} }
} }
...@@ -1662,7 +1662,7 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) ...@@ -1662,7 +1662,7 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
retval = SE_ERR_OOM; retval = SE_ERR_OOM;
goto end; goto end;
} }
heap_free(wszApplicationName); free(wszApplicationName);
sei_tmp.lpFile = wszApplicationName = tmp; sei_tmp.lpFile = wszApplicationName = tmp;
tmp = expand_environment(sei_tmp.lpDirectory); tmp = expand_environment(sei_tmp.lpDirectory);
...@@ -1672,18 +1672,18 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) ...@@ -1672,18 +1672,18 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
goto end; goto end;
} }
if (wszDir != dirBuffer) if (wszDir != dirBuffer)
heap_free(wszDir); free(wszDir);
sei_tmp.lpDirectory = wszDir = tmp; sei_tmp.lpDirectory = wszDir = tmp;
} }
if ( ERROR_SUCCESS == ShellExecute_FromContextMenu( &sei_tmp ) ) if ( ERROR_SUCCESS == ShellExecute_FromContextMenu( &sei_tmp ) )
{ {
sei->hInstApp = (HINSTANCE) 33; sei->hInstApp = (HINSTANCE) 33;
heap_free(wszApplicationName); free(wszApplicationName);
if (wszParameters != parametersBuffer) if (wszParameters != parametersBuffer)
heap_free(wszParameters); free(wszParameters);
if (wszDir != dirBuffer) if (wszDir != dirBuffer)
heap_free(wszDir); free(wszDir);
return TRUE; return TRUE;
} }
...@@ -1693,11 +1693,11 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) ...@@ -1693,11 +1693,11 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
execfunc ); execfunc );
if (retval <= 32 && !(sei_tmp.fMask & SEE_MASK_FLAG_NO_UI)) if (retval <= 32 && !(sei_tmp.fMask & SEE_MASK_FLAG_NO_UI))
do_error_dialog(retval, sei_tmp.hwnd); do_error_dialog(retval, sei_tmp.hwnd);
heap_free(wszApplicationName); free(wszApplicationName);
if (wszParameters != parametersBuffer) if (wszParameters != parametersBuffer)
heap_free(wszParameters); free(wszParameters);
if (wszDir != dirBuffer) if (wszDir != dirBuffer)
heap_free(wszDir); free(wszDir);
return retval > 32; return retval > 32;
} }
...@@ -1717,14 +1717,14 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) ...@@ -1717,14 +1717,14 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
DWORD size; DWORD size;
size = MAX_PATH; size = MAX_PATH;
buf = heap_alloc(size * sizeof(WCHAR)); buf = malloc(size * sizeof(WCHAR));
if (!buf || FAILED(PathCreateFromUrlW(sei_tmp.lpFile, buf, &size, 0))) { if (!buf || FAILED(PathCreateFromUrlW(sei_tmp.lpFile, buf, &size, 0))) {
heap_free(buf); free(buf);
retval = SE_ERR_OOM; retval = SE_ERR_OOM;
goto end; goto end;
} }
heap_free(wszApplicationName); free(wszApplicationName);
wszApplicationName = buf; wszApplicationName = buf;
sei_tmp.lpFile = wszApplicationName; sei_tmp.lpFile = wszApplicationName;
} }
...@@ -1734,10 +1734,10 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) ...@@ -1734,10 +1734,10 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
if (len>0) if (len>0)
{ {
LPWSTR buf; LPWSTR buf;
buf = heap_alloc((len + 1) * sizeof(WCHAR)); buf = malloc((len + 1) * sizeof(WCHAR));
ExpandEnvironmentStringsW(sei_tmp.lpFile, buf, len + 1); ExpandEnvironmentStringsW(sei_tmp.lpFile, buf, len + 1);
heap_free(wszApplicationName); free(wszApplicationName);
wszApplicationName = buf; wszApplicationName = buf;
sei_tmp.lpFile = wszApplicationName; sei_tmp.lpFile = wszApplicationName;
...@@ -1751,10 +1751,10 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) ...@@ -1751,10 +1751,10 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
{ {
LPWSTR buf; LPWSTR buf;
len++; len++;
buf = heap_alloc(len * sizeof(WCHAR)); buf = malloc(len * sizeof(WCHAR));
ExpandEnvironmentStringsW(sei_tmp.lpDirectory, buf, len); ExpandEnvironmentStringsW(sei_tmp.lpDirectory, buf, len);
if (wszDir != dirBuffer) if (wszDir != dirBuffer)
heap_free(wszDir); free(wszDir);
wszDir = buf; wszDir = buf;
sei_tmp.lpDirectory = wszDir; sei_tmp.lpDirectory = wszDir;
} }
...@@ -1769,7 +1769,7 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) ...@@ -1769,7 +1769,7 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
len += 1 + lstrlenW(wszParameters); len += 1 + lstrlenW(wszParameters);
if (len > wcmdLen) if (len > wcmdLen)
{ {
wcmd = heap_alloc(len * sizeof(WCHAR)); wcmd = malloc(len * sizeof(WCHAR));
wcmdLen = len; wcmdLen = len;
} }
lstrcpyW(wcmd, wszApplicationName); lstrcpyW(wcmd, wszApplicationName);
...@@ -1785,13 +1785,13 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) ...@@ -1785,13 +1785,13 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
wszApplicationName, NULL, &sei_tmp, wszApplicationName, NULL, &sei_tmp,
sei, execfunc ); sei, execfunc );
if (retval > 32) { if (retval > 32) {
heap_free(wszApplicationName); free(wszApplicationName);
if (wszParameters != parametersBuffer) if (wszParameters != parametersBuffer)
heap_free(wszParameters); free(wszParameters);
if (wszDir != dirBuffer) if (wszDir != dirBuffer)
heap_free(wszDir); free(wszDir);
if (wcmd != wcmdBuffer) if (wcmd != wcmdBuffer)
heap_free(wcmd); free(wcmd);
return TRUE; return TRUE;
} }
...@@ -1803,12 +1803,12 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) ...@@ -1803,12 +1803,12 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
retval = SHELL_quote_and_execute( wcmd, wszParameters, wszKeyname, retval = SHELL_quote_and_execute( wcmd, wszParameters, wszKeyname,
wszApplicationName, env, &sei_tmp, wszApplicationName, env, &sei_tmp,
sei, execfunc ); sei, execfunc );
heap_free( env ); free( env );
} }
else if (PathIsDirectoryW(lpFile)) else if (PathIsDirectoryW(lpFile))
{ {
WCHAR wExec[MAX_PATH]; WCHAR wExec[MAX_PATH];
WCHAR * lpQuotedFile = heap_alloc( sizeof(WCHAR) * (lstrlenW(lpFile) + 3) ); WCHAR * lpQuotedFile = malloc( sizeof(WCHAR) * (lstrlenW(lpFile) + 3) );
if (lpQuotedFile) if (lpQuotedFile)
{ {
...@@ -1824,9 +1824,9 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) ...@@ -1824,9 +1824,9 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
wszKeyname, wszKeyname,
wszApplicationName, env, wszApplicationName, env,
&sei_tmp, sei, execfunc ); &sei_tmp, sei, execfunc );
heap_free( env ); free( env );
} }
heap_free( lpQuotedFile ); free( lpQuotedFile );
} }
else else
retval = 0; /* Out of memory */ retval = 0; /* Out of memory */
...@@ -1848,13 +1848,13 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) ...@@ -1848,13 +1848,13 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
end: end:
TRACE("retval %Iu\n", retval); TRACE("retval %Iu\n", retval);
heap_free(wszApplicationName); free(wszApplicationName);
if (wszParameters != parametersBuffer) if (wszParameters != parametersBuffer)
heap_free(wszParameters); free(wszParameters);
if (wszDir != dirBuffer) if (wszDir != dirBuffer)
heap_free(wszDir); free(wszDir);
if (wcmd != wcmdBuffer) if (wcmd != wcmdBuffer)
heap_free(wcmd); free(wcmd);
sei->hInstApp = (HINSTANCE)(retval > 32 ? 33 : retval); sei->hInstApp = (HINSTANCE)(retval > 32 ? 33 : retval);
......
...@@ -316,7 +316,7 @@ static DWORD SHELL32_AnsiToUnicodeBuf(LPCSTR aPath, LPWSTR *wPath, DWORD minChar ...@@ -316,7 +316,7 @@ static DWORD SHELL32_AnsiToUnicodeBuf(LPCSTR aPath, LPWSTR *wPath, DWORD minChar
if (len < minChars) if (len < minChars)
len = minChars; len = minChars;
*wPath = heap_alloc(len * sizeof(WCHAR)); *wPath = malloc(len * sizeof(WCHAR));
if (*wPath) if (*wPath)
{ {
MultiByteToWideChar(CP_ACP, 0, aPath, -1, *wPath, len); MultiByteToWideChar(CP_ACP, 0, aPath, -1, *wPath, len);
...@@ -395,7 +395,7 @@ static DWORD SHNotifyCreateDirectoryA(LPCSTR path, LPSECURITY_ATTRIBUTES sec) ...@@ -395,7 +395,7 @@ static DWORD SHNotifyCreateDirectoryA(LPCSTR path, LPSECURITY_ATTRIBUTES sec)
if (!retCode) if (!retCode)
{ {
retCode = SHNotifyCreateDirectoryW(wPath, sec); retCode = SHNotifyCreateDirectoryW(wPath, sec);
heap_free(wPath); free(wPath);
} }
return retCode; return retCode;
} }
...@@ -449,7 +449,7 @@ static DWORD SHNotifyRemoveDirectoryA(LPCSTR path) ...@@ -449,7 +449,7 @@ static DWORD SHNotifyRemoveDirectoryA(LPCSTR path)
if (!retCode) if (!retCode)
{ {
retCode = SHNotifyRemoveDirectoryW(wPath); retCode = SHNotifyRemoveDirectoryW(wPath);
heap_free(wPath); free(wPath);
} }
return retCode; return retCode;
} }
...@@ -513,7 +513,7 @@ static DWORD SHNotifyDeleteFileA(LPCSTR path) ...@@ -513,7 +513,7 @@ static DWORD SHNotifyDeleteFileA(LPCSTR path)
if (!retCode) if (!retCode)
{ {
retCode = SHNotifyDeleteFileW(wPath); retCode = SHNotifyDeleteFileW(wPath);
heap_free(wPath); free(wPath);
} }
return retCode; return retCode;
} }
...@@ -709,7 +709,7 @@ int WINAPI SHCreateDirectoryExA(HWND hWnd, LPCSTR path, LPSECURITY_ATTRIBUTES se ...@@ -709,7 +709,7 @@ int WINAPI SHCreateDirectoryExA(HWND hWnd, LPCSTR path, LPSECURITY_ATTRIBUTES se
if (!retCode) if (!retCode)
{ {
retCode = SHCreateDirectoryExW(hWnd, wPath, sec); retCode = SHCreateDirectoryExW(hWnd, wPath, sec);
heap_free(wPath); free(wPath);
} }
return retCode; return retCode;
} }
...@@ -881,12 +881,12 @@ int WINAPI SHFileOperationA(LPSHFILEOPSTRUCTA lpFileOp) ...@@ -881,12 +881,12 @@ int WINAPI SHFileOperationA(LPSHFILEOPSTRUCTA lpFileOp)
if (retCode == ERROR_ACCESS_DENIED && (GetVersion() & 0x80000000)) if (retCode == ERROR_ACCESS_DENIED && (GetVersion() & 0x80000000))
retCode = S_OK; retCode = S_OK;
heap_free(ForFree); /* we cannot use wString, it was changed */ free(ForFree); /* we cannot use wString, it was changed */
break; break;
} }
else else
{ {
wString = ForFree = heap_alloc(size * sizeof(WCHAR)); wString = ForFree = malloc(size * sizeof(WCHAR));
if (ForFree) continue; if (ForFree) continue;
retCode = ERROR_OUTOFMEMORY; retCode = ERROR_OUTOFMEMORY;
nFileOp.fAnyOperationsAborted = TRUE; nFileOp.fAnyOperationsAborted = TRUE;
...@@ -925,8 +925,7 @@ typedef struct ...@@ -925,8 +925,7 @@ typedef struct
static inline void grow_list(FILE_LIST *list) static inline void grow_list(FILE_LIST *list)
{ {
FILE_ENTRY *new = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, list->feFiles, FILE_ENTRY *new = _recalloc(list->feFiles, list->num_alloc * 2, sizeof(*new));
list->num_alloc * 2 * sizeof(*new) );
list->feFiles = new; list->feFiles = new;
list->num_alloc *= 2; list->num_alloc *= 2;
} }
...@@ -938,18 +937,18 @@ static void add_file_to_entry(FILE_ENTRY *feFile, LPCWSTR szFile) ...@@ -938,18 +937,18 @@ static void add_file_to_entry(FILE_ENTRY *feFile, LPCWSTR szFile)
DWORD dwLen = lstrlenW(szFile) + 1; DWORD dwLen = lstrlenW(szFile) + 1;
LPCWSTR ptr; LPCWSTR ptr;
feFile->szFullPath = heap_alloc(dwLen * sizeof(WCHAR)); feFile->szFullPath = malloc(dwLen * sizeof(WCHAR));
lstrcpyW(feFile->szFullPath, szFile); lstrcpyW(feFile->szFullPath, szFile);
ptr = StrRChrW(szFile, NULL, '\\'); ptr = StrRChrW(szFile, NULL, '\\');
if (ptr) if (ptr)
{ {
dwLen = ptr - szFile + 1; dwLen = ptr - szFile + 1;
feFile->szDirectory = heap_alloc(dwLen * sizeof(WCHAR)); feFile->szDirectory = malloc(dwLen * sizeof(WCHAR));
lstrcpynW(feFile->szDirectory, szFile, dwLen); lstrcpynW(feFile->szDirectory, szFile, dwLen);
dwLen = lstrlenW(feFile->szFullPath) - dwLen + 1; dwLen = lstrlenW(feFile->szFullPath) - dwLen + 1;
feFile->szFilename = heap_alloc(dwLen * sizeof(WCHAR)); feFile->szFilename = malloc(dwLen * sizeof(WCHAR));
lstrcpyW(feFile->szFilename, ptr + 1); /* skip over backslash */ lstrcpyW(feFile->szFilename, ptr + 1); /* skip over backslash */
} }
feFile->bFromWildcard = FALSE; feFile->bFromWildcard = FALSE;
...@@ -965,7 +964,7 @@ static LPWSTR wildcard_to_file(LPCWSTR szWildCard, LPCWSTR szFileName) ...@@ -965,7 +964,7 @@ static LPWSTR wildcard_to_file(LPCWSTR szWildCard, LPCWSTR szFileName)
dwDirLen = ptr - szWildCard + 1; dwDirLen = ptr - szWildCard + 1;
dwFullLen = dwDirLen + lstrlenW(szFileName) + 1; dwFullLen = dwDirLen + lstrlenW(szFileName) + 1;
szFullPath = heap_alloc(dwFullLen * sizeof(WCHAR)); szFullPath = malloc(dwFullLen * sizeof(WCHAR));
lstrcpynW(szFullPath, szWildCard, dwDirLen + 1); lstrcpynW(szFullPath, szWildCard, dwDirLen + 1);
lstrcatW(szFullPath, szFileName); lstrcatW(szFullPath, szFileName);
...@@ -993,7 +992,7 @@ static void parse_wildcard_files(FILE_LIST *flList, LPCWSTR szFile, LPDWORD pdwL ...@@ -993,7 +992,7 @@ static void parse_wildcard_files(FILE_LIST *flList, LPCWSTR szFile, LPDWORD pdwL
file->bFromWildcard = TRUE; file->bFromWildcard = TRUE;
file->attributes = wfd.dwFileAttributes; file->attributes = wfd.dwFileAttributes;
if (IsAttribDir(file->attributes)) flList->bAnyDirectories = TRUE; if (IsAttribDir(file->attributes)) flList->bAnyDirectories = TRUE;
heap_free(szFullPath); free(szFullPath);
} }
FindClose(hFile); FindClose(hFile);
...@@ -1019,8 +1018,8 @@ static HRESULT parse_file_list(FILE_LIST *flList, LPCWSTR szFiles) ...@@ -1019,8 +1018,8 @@ static HRESULT parse_file_list(FILE_LIST *flList, LPCWSTR szFiles)
/* empty list */ /* empty list */
if (!szFiles[0]) if (!szFiles[0])
return ERROR_ACCESS_DENIED; return ERROR_ACCESS_DENIED;
flList->feFiles = heap_alloc_zero(flList->num_alloc * sizeof(FILE_ENTRY)); flList->feFiles = calloc(flList->num_alloc, sizeof(FILE_ENTRY));
while (*ptr) while (*ptr)
{ {
...@@ -1077,12 +1076,12 @@ static void destroy_file_list(FILE_LIST *flList) ...@@ -1077,12 +1076,12 @@ static void destroy_file_list(FILE_LIST *flList)
for (i = 0; i < flList->dwNumFiles; i++) for (i = 0; i < flList->dwNumFiles; i++)
{ {
heap_free(flList->feFiles[i].szDirectory); free(flList->feFiles[i].szDirectory);
heap_free(flList->feFiles[i].szFilename); free(flList->feFiles[i].szFilename);
heap_free(flList->feFiles[i].szFullPath); free(flList->feFiles[i].szFullPath);
} }
heap_free(flList->feFiles); free(flList->feFiles);
} }
static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPCWSTR szDestPath) static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPCWSTR szDestPath)
...@@ -1211,9 +1210,9 @@ static int copy_files(FILE_OPERATION *op, const FILE_LIST *flFrom, FILE_LIST *fl ...@@ -1211,9 +1210,9 @@ static int copy_files(FILE_OPERATION *op, const FILE_LIST *flFrom, FILE_LIST *fl
/* Free all but the first entry. */ /* Free all but the first entry. */
for (i = 1; i < flTo->dwNumFiles; i++) for (i = 1; i < flTo->dwNumFiles; i++)
{ {
heap_free(flTo->feFiles[i].szDirectory); free(flTo->feFiles[i].szDirectory);
heap_free(flTo->feFiles[i].szFilename); free(flTo->feFiles[i].szFilename);
heap_free(flTo->feFiles[i].szFullPath); free(flTo->feFiles[i].szFullPath);
} }
flTo->dwNumFiles = 1; flTo->dwNumFiles = 1;
...@@ -1751,7 +1750,7 @@ HRESULT WINAPI SHPathPrepareForWriteW(HWND hwnd, IUnknown *modless, LPCWSTR path ...@@ -1751,7 +1750,7 @@ HRESULT WINAPI SHPathPrepareForWriteW(HWND hwnd, IUnknown *modless, LPCWSTR path
len = 1; len = 1;
else else
len = last_slash - path + 1; len = last_slash - path + 1;
temppath = heap_alloc(len * sizeof(WCHAR)); temppath = malloc(len * sizeof(WCHAR));
if (!temppath) if (!temppath)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
StrCpyNW(temppath, path, len); StrCpyNW(temppath, path, len);
...@@ -1774,7 +1773,7 @@ HRESULT WINAPI SHPathPrepareForWriteW(HWND hwnd, IUnknown *modless, LPCWSTR path ...@@ -1774,7 +1773,7 @@ HRESULT WINAPI SHPathPrepareForWriteW(HWND hwnd, IUnknown *modless, LPCWSTR path
/* check if we can access the directory */ /* check if we can access the directory */
res = GetFileAttributesW(realpath); res = GetFileAttributesW(realpath);
heap_free(temppath); free(temppath);
if (res == INVALID_FILE_ATTRIBUTES) if (res == INVALID_FILE_ATTRIBUTES)
{ {
...@@ -1849,7 +1848,7 @@ static ULONG WINAPI file_operation_Release(IFileOperation *iface) ...@@ -1849,7 +1848,7 @@ static ULONG WINAPI file_operation_Release(IFileOperation *iface)
if (!ref) if (!ref)
{ {
HeapFree(GetProcessHeap(), 0, operation); free(operation);
} }
return ref; return ref;
...@@ -2033,7 +2032,7 @@ HRESULT WINAPI IFileOperation_Constructor(IUnknown *outer, REFIID riid, void **o ...@@ -2033,7 +2032,7 @@ HRESULT WINAPI IFileOperation_Constructor(IUnknown *outer, REFIID riid, void **o
struct file_operation *object; struct file_operation *object;
HRESULT hr; HRESULT hr;
object = heap_alloc_zero(sizeof(*object)); object = calloc(1, sizeof(*object));
if (!object) if (!object)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
......
...@@ -90,7 +90,7 @@ static ULONG WINAPI FileSystemBindData_Release(IFileSystemBindData *iface) ...@@ -90,7 +90,7 @@ static ULONG WINAPI FileSystemBindData_Release(IFileSystemBindData *iface)
TRACE("(%p)->(%lu)\n", This, ref); TRACE("(%p)->(%lu)\n", This, ref);
if (!ref) if (!ref)
heap_free(This); free(This);
return ref; return ref;
} }
...@@ -141,7 +141,7 @@ HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *find_data ...@@ -141,7 +141,7 @@ HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *find_data
*ppV = NULL; *ppV = NULL;
This = heap_alloc(sizeof(*This)); This = malloc(sizeof(*This));
if (!This) return E_OUTOFMEMORY; if (!This) return E_OUTOFMEMORY;
This->IFileSystemBindData_iface.lpVtbl = &FileSystemBindDataVtbl; This->IFileSystemBindData_iface.lpVtbl = &FileSystemBindDataVtbl;
...@@ -163,6 +163,6 @@ HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *find_data ...@@ -163,6 +163,6 @@ HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *find_data
IFileSystemBindData_Release(&This->IFileSystemBindData_iface); IFileSystemBindData_Release(&This->IFileSystemBindData_iface);
} }
else else
heap_free(This); free(This);
return ret; return ret;
} }
...@@ -213,7 +213,7 @@ static int FM_InitMenuPopup(HMENU hmenu, LPCITEMIDLIST pAlternatePidl) ...@@ -213,7 +213,7 @@ static int FM_InitMenuPopup(HMENU hmenu, LPCITEMIDLIST pAlternatePidl)
MENUINFO MenuInfo; MENUINFO MenuInfo;
HMENU hMenuPopup = CreatePopupMenu(); HMENU hMenuPopup = CreatePopupMenu();
lpFmMi = heap_alloc_zero(sizeof(*lpFmMi)); lpFmMi = calloc(1, sizeof(*lpFmMi));
lpFmMi->pidl = ILCombine(pidl, pidlTemp); lpFmMi->pidl = ILCombine(pidl, pidlTemp);
lpFmMi->uEnumFlags = SHCONTF_FOLDERS | SHCONTF_NONFOLDERS; lpFmMi->uEnumFlags = SHCONTF_FOLDERS | SHCONTF_NONFOLDERS;
...@@ -283,7 +283,7 @@ HMENU WINAPI FileMenu_Create ( ...@@ -283,7 +283,7 @@ HMENU WINAPI FileMenu_Create (
TRACE("0x%08lx 0x%08x %p 0x%08x 0x%08x hMenu=%p\n", TRACE("0x%08lx 0x%08x %p 0x%08x 0x%08x hMenu=%p\n",
crBorderColor, nBorderWidth, hBorderBmp, nSelHeight, uFlags, hMenu); crBorderColor, nBorderWidth, hBorderBmp, nSelHeight, uFlags, hMenu);
menudata = heap_alloc_zero(sizeof(*menudata)); menudata = calloc(1, sizeof(*menudata));
menudata->crBorderColor = crBorderColor; menudata->crBorderColor = crBorderColor;
menudata->nBorderWidth = nBorderWidth; menudata->nBorderWidth = nBorderWidth;
menudata->hBorderBmp = hBorderBmp; menudata->hBorderBmp = hBorderBmp;
...@@ -313,7 +313,7 @@ void WINAPI FileMenu_Destroy (HMENU hmenu) ...@@ -313,7 +313,7 @@ void WINAPI FileMenu_Destroy (HMENU hmenu)
menudata = FM_GetMenuInfo(hmenu); menudata = FM_GetMenuInfo(hmenu);
SHFree( menudata->pidl); SHFree( menudata->pidl);
heap_free(menudata); free(menudata);
DestroyMenu (hmenu); DestroyMenu (hmenu);
} }
...@@ -416,11 +416,11 @@ BOOL WINAPI FileMenu_AppendItemAW( ...@@ -416,11 +416,11 @@ BOOL WINAPI FileMenu_AppendItemAW(
else else
{ {
DWORD len = MultiByteToWideChar( CP_ACP, 0, lpText, -1, NULL, 0 ); DWORD len = MultiByteToWideChar( CP_ACP, 0, lpText, -1, NULL, 0 );
LPWSTR lpszText = heap_alloc( len*sizeof(WCHAR) ); WCHAR *lpszText = malloc(len * sizeof(WCHAR));
if (!lpszText) return FALSE; if (!lpszText) return FALSE;
MultiByteToWideChar( CP_ACP, 0, lpText, -1, lpszText, len ); MultiByteToWideChar( CP_ACP, 0, lpText, -1, lpszText, len );
ret = FileMenu_AppendItemW(hMenu, lpszText, uID, icon, hMenuPopup, nItemHeight); ret = FileMenu_AppendItemW(hMenu, lpszText, uID, icon, hMenuPopup, nItemHeight);
heap_free( lpszText ); free(lpszText);
} }
return ret; return ret;
...@@ -1040,22 +1040,22 @@ static HRESULT CompositeCMenu_Constructor(IContextMenu **menus,UINT menu_count, ...@@ -1040,22 +1040,22 @@ static HRESULT CompositeCMenu_Constructor(IContextMenu **menus,UINT menu_count,
TRACE("(%p,%u,%s,%p)\n",menus,menu_count,shdebugstr_guid(riid),ppv); TRACE("(%p,%u,%s,%p)\n",menus,menu_count,shdebugstr_guid(riid),ppv);
ret = heap_alloc(sizeof(*ret)); ret = malloc(sizeof(*ret));
if(!ret) if(!ret)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
ret->IContextMenu3_iface.lpVtbl = &CompositeCMenuVtbl; ret->IContextMenu3_iface.lpVtbl = &CompositeCMenuVtbl;
ret->menu_count = menu_count; ret->menu_count = menu_count;
ret->menus = heap_alloc(menu_count*sizeof(IContextMenu*)); ret->menus = malloc(menu_count * sizeof(IContextMenu*));
if(!ret->menus) if(!ret->menus)
{ {
heap_free(ret); free(ret);
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }
ret->offsets = heap_alloc_zero(menu_count*sizeof(UINT)); ret->offsets = calloc(menu_count, sizeof(UINT));
if(!ret->offsets) if(!ret->offsets)
{ {
heap_free(ret->menus); free(ret->menus);
heap_free(ret); free(ret);
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }
ret->refCount=0; ret->refCount=0;
...@@ -1070,9 +1070,9 @@ static void CompositeCMenu_Destroy(CompositeCMenu *This) ...@@ -1070,9 +1070,9 @@ static void CompositeCMenu_Destroy(CompositeCMenu *This)
UINT i; UINT i;
for(i=0;i<This->menu_count;i++) for(i=0;i<This->menu_count;i++)
IContextMenu_Release(This->menus[i]); IContextMenu_Release(This->menus[i]);
heap_free(This->menus); free(This->menus);
heap_free(This->offsets); free(This->offsets);
heap_free(This); free(This);
} }
static HRESULT WINAPI CompositeCMenu_QueryInterface(IContextMenu3 *iface, REFIID riid, void **ppv) static HRESULT WINAPI CompositeCMenu_QueryInterface(IContextMenu3 *iface, REFIID riid, void **ppv)
......
...@@ -1577,7 +1577,7 @@ static LRESULT ShellView_OnNotify(IShellViewImpl * This, UINT CtlID, LPNMHDR lpn ...@@ -1577,7 +1577,7 @@ static LRESULT ShellView_OnNotify(IShellViewImpl * This, UINT CtlID, LPNMHDR lpn
} }
/* allocate memory for the pidl array */ /* allocate memory for the pidl array */
pItems = heap_alloc(sizeof(LPITEMIDLIST) * count); pItems = malloc(sizeof(ITEMIDLIST*) * count);
/* retrieve all selected items */ /* retrieve all selected items */
i = 0; i = 0;
...@@ -1603,7 +1603,7 @@ static LRESULT ShellView_OnNotify(IShellViewImpl * This, UINT CtlID, LPNMHDR lpn ...@@ -1603,7 +1603,7 @@ static LRESULT ShellView_OnNotify(IShellViewImpl * This, UINT CtlID, LPNMHDR lpn
ISFHelper_Release(psfhlp); ISFHelper_Release(psfhlp);
/* free pidl array memory */ /* free pidl array memory */
heap_free(pItems); free(pItems);
} }
break; break;
...@@ -1825,7 +1825,7 @@ static ULONG WINAPI IShellView_fnRelease(IShellView3 *iface) ...@@ -1825,7 +1825,7 @@ static ULONG WINAPI IShellView_fnRelease(IShellView3 *iface)
if(This->pAdvSink) if(This->pAdvSink)
IAdviseSink_Release(This->pAdvSink); IAdviseSink_Release(This->pAdvSink);
heap_free(This); free(This);
} }
return refCount; return refCount;
} }
...@@ -3756,7 +3756,7 @@ IShellView *IShellView_Constructor(IShellFolder *folder) ...@@ -3756,7 +3756,7 @@ IShellView *IShellView_Constructor(IShellFolder *folder)
{ {
IShellViewImpl *sv; IShellViewImpl *sv;
sv = heap_alloc_zero(sizeof(*sv)); sv = calloc(1, sizeof(*sv));
if (!sv) if (!sv)
return NULL; return NULL;
......
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
#include "shresdef.h" #include "shresdef.h"
#include "shlwapi.h" #include "shlwapi.h"
#include "wine/heap.h"
#include "wine/debug.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(shell); WINE_DEFAULT_DEBUG_CHANNEL(shell);
...@@ -135,7 +134,7 @@ static ULONG WINAPI ContextMenu_Release(IContextMenu3 *iface) ...@@ -135,7 +134,7 @@ static ULONG WINAPI ContextMenu_Release(IContextMenu3 *iface)
SHFree(This->pidl); SHFree(This->pidl);
_ILFreeaPidl(This->apidl, This->cidl); _ILFreeaPidl(This->apidl, This->cidl);
heap_free(This); free(This);
} }
return ref; return ref;
...@@ -366,7 +365,7 @@ static BOOL get_program_description(WCHAR *path, WCHAR *buffer, DWORD size) ...@@ -366,7 +365,7 @@ static BOOL get_program_description(WCHAR *path, WCHAR *buffer, DWORD size)
versize = GetFileVersionInfoSizeW(path, NULL); versize = GetFileVersionInfoSizeW(path, NULL);
if (!versize) return FALSE; if (!versize) return FALSE;
data = heap_alloc(versize); data = malloc(versize);
if (!data) return FALSE; if (!data) return FALSE;
if (!GetFileVersionInfoW(path, 0, versize, data)) if (!GetFileVersionInfoW(path, 0, versize, data))
...@@ -390,7 +389,7 @@ static BOOL get_program_description(WCHAR *path, WCHAR *buffer, DWORD size) ...@@ -390,7 +389,7 @@ static BOOL get_program_description(WCHAR *path, WCHAR *buffer, DWORD size)
} }
out: out:
heap_free(data); free(data);
return ret; return ret;
} }
...@@ -566,7 +565,7 @@ static UINT CALLBACK file_properties_callback(HWND hwnd, UINT uMsg, LPPROPSHEETP ...@@ -566,7 +565,7 @@ static UINT CALLBACK file_properties_callback(HWND hwnd, UINT uMsg, LPPROPSHEETP
struct file_properties_info *props = (struct file_properties_info *)page->lParam; struct file_properties_info *props = (struct file_properties_info *)page->lParam;
if (uMsg == PSPCB_RELEASE) if (uMsg == PSPCB_RELEASE)
{ {
heap_free(props); free(props);
} }
return 1; return 1;
} }
...@@ -581,7 +580,7 @@ static void init_file_properties_pages(IDataObject *dataobject, LPFNADDPROPSHEET ...@@ -581,7 +580,7 @@ static void init_file_properties_pages(IDataObject *dataobject, LPFNADDPROPSHEET
HRESULT hr; HRESULT hr;
WCHAR *p; WCHAR *p;
props = heap_alloc(sizeof(*props)); props = malloc(sizeof(*props));
if (!props) return; if (!props) return;
format.cfFormat = CF_HDROP; format.cfFormat = CF_HDROP;
...@@ -632,7 +631,7 @@ static void init_file_properties_pages(IDataObject *dataobject, LPFNADDPROPSHEET ...@@ -632,7 +631,7 @@ static void init_file_properties_pages(IDataObject *dataobject, LPFNADDPROPSHEET
return; return;
error: error:
heap_free(props); free(props);
} }
#define MAX_PROP_PAGES 99 #define MAX_PROP_PAGES 99
...@@ -1014,7 +1013,7 @@ HRESULT ItemMenu_Constructor(IShellFolder *parent, LPCITEMIDLIST pidl, const LPC ...@@ -1014,7 +1013,7 @@ HRESULT ItemMenu_Constructor(IShellFolder *parent, LPCITEMIDLIST pidl, const LPC
HRESULT hr; HRESULT hr;
UINT i; UINT i;
This = heap_alloc(sizeof(*This)); This = malloc(sizeof(*This));
if (!This) return E_OUTOFMEMORY; if (!This) return E_OUTOFMEMORY;
This->IContextMenu3_iface.lpVtbl = &ItemContextMenuVtbl; This->IContextMenu3_iface.lpVtbl = &ItemContextMenuVtbl;
...@@ -1437,7 +1436,7 @@ HRESULT BackgroundMenu_Constructor(IShellFolder *parent, BOOL desktop, REFIID ri ...@@ -1437,7 +1436,7 @@ HRESULT BackgroundMenu_Constructor(IShellFolder *parent, BOOL desktop, REFIID ri
ContextMenu *This; ContextMenu *This;
HRESULT hr; HRESULT hr;
This = heap_alloc(sizeof(*This)); This = malloc(sizeof(*This));
if (!This) return E_OUTOFMEMORY; if (!This) return E_OUTOFMEMORY;
This->IContextMenu3_iface.lpVtbl = &BackgroundContextMenuVtbl; This->IContextMenu3_iface.lpVtbl = &BackgroundContextMenuVtbl;
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include "shell32_main.h" #include "shell32_main.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL(systray); WINE_DEFAULT_DEBUG_CHANNEL(systray);
...@@ -182,7 +181,7 @@ BOOL WINAPI Shell_NotifyIconW(DWORD dwMessage, PNOTIFYICONDATAW nid) ...@@ -182,7 +181,7 @@ BOOL WINAPI Shell_NotifyIconW(DWORD dwMessage, PNOTIFYICONDATAW nid)
if (iconinfo.hbmColor) if (iconinfo.hbmColor)
cbColourBits = (bmColour.bmPlanes * bmColour.bmWidth * bmColour.bmHeight * bmColour.bmBitsPixel + 15) / 16 * 2; cbColourBits = (bmColour.bmPlanes * bmColour.bmWidth * bmColour.bmHeight * bmColour.bmBitsPixel + 15) / 16 * 2;
cds.cbData = sizeof(*data) + cbMaskBits + cbColourBits; cds.cbData = sizeof(*data) + cbMaskBits + cbColourBits;
buffer = heap_alloc(cds.cbData); buffer = malloc(cds.cbData);
if (!buffer) if (!buffer)
{ {
DeleteObject(iconinfo.hbmMask); DeleteObject(iconinfo.hbmMask);
...@@ -243,7 +242,7 @@ noicon: ...@@ -243,7 +242,7 @@ noicon:
cds.lpData = data; cds.lpData = data;
ret = SendMessageW(tray, WM_COPYDATA, (WPARAM)nid->hWnd, (LPARAM)&cds); ret = SendMessageW(tray, WM_COPYDATA, (WPARAM)nid->hWnd, (LPARAM)&cds);
if (data != &data_buffer) heap_free( data ); if (data != &data_buffer) free(data);
SetLastError(ret ? S_OK : E_FAIL); SetLastError(ret ? S_OK : E_FAIL);
return ret; return ret;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment