Commit e3a74a91 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

shell32: Don't use strdupW or heap_* functions in shelldispatch.c.

parent e8aba9c4
...@@ -244,7 +244,7 @@ static ULONG WINAPI FolderItemVerbImpl_Release(FolderItemVerb *iface) ...@@ -244,7 +244,7 @@ static ULONG WINAPI FolderItemVerbImpl_Release(FolderItemVerb *iface)
{ {
IContextMenu_Release(This->contextmenu); IContextMenu_Release(This->contextmenu);
SysFreeString(This->name); SysFreeString(This->name);
heap_free(This); free(This);
} }
return ref; return ref;
...@@ -356,7 +356,7 @@ static HRESULT FolderItemVerb_Constructor(IContextMenu *contextmenu, BSTR name, ...@@ -356,7 +356,7 @@ static HRESULT FolderItemVerb_Constructor(IContextMenu *contextmenu, BSTR name,
TRACE("%p, %s\n", contextmenu, debugstr_w(name)); TRACE("%p, %s\n", contextmenu, debugstr_w(name));
This = heap_alloc(sizeof(*This)); This = malloc(sizeof(*This));
if (!This) if (!This)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
...@@ -414,7 +414,7 @@ static ULONG WINAPI FolderItemVerbsImpl_Release(FolderItemVerbs *iface) ...@@ -414,7 +414,7 @@ static ULONG WINAPI FolderItemVerbsImpl_Release(FolderItemVerbs *iface)
{ {
IContextMenu_Release(This->contextmenu); IContextMenu_Release(This->contextmenu);
DestroyMenu(This->hMenu); DestroyMenu(This->hMenu);
heap_free(This); free(This);
} }
return ref; return ref;
...@@ -588,7 +588,7 @@ static HRESULT FolderItemVerbs_Constructor(BSTR path, FolderItemVerbs **verbs) ...@@ -588,7 +588,7 @@ static HRESULT FolderItemVerbs_Constructor(BSTR path, FolderItemVerbs **verbs)
*verbs = NULL; *verbs = NULL;
This = heap_alloc(sizeof(*This)); This = malloc(sizeof(*This));
if (!This) if (!This)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
...@@ -623,7 +623,7 @@ static HRESULT FolderItemVerbs_Constructor(BSTR path, FolderItemVerbs **verbs) ...@@ -623,7 +623,7 @@ static HRESULT FolderItemVerbs_Constructor(BSTR path, FolderItemVerbs **verbs)
return S_OK; return S_OK;
failed: failed:
heap_free(This); free(This);
return hr; return hr;
} }
...@@ -671,7 +671,7 @@ static ULONG WINAPI ShellLinkObject_Release(IShellLinkDual2 *iface) ...@@ -671,7 +671,7 @@ static ULONG WINAPI ShellLinkObject_Release(IShellLinkDual2 *iface)
if (!ref) if (!ref)
{ {
if (This->shell_link) IShellLinkW_Release(This->shell_link); if (This->shell_link) IShellLinkW_Release(This->shell_link);
heap_free(This); free(This);
} }
return ref; return ref;
} }
...@@ -899,7 +899,7 @@ static HRESULT ShellLinkObject_Constructor(FolderItemImpl *item, IShellLinkDual2 ...@@ -899,7 +899,7 @@ static HRESULT ShellLinkObject_Constructor(FolderItemImpl *item, IShellLinkDual2
*link = NULL; *link = NULL;
This = heap_alloc(sizeof(*This)); This = malloc(sizeof(*This));
if (!This) return E_OUTOFMEMORY; if (!This) return E_OUTOFMEMORY;
This->IShellLinkDual2_iface.lpVtbl = &ShellLinkObjectVtbl; This->IShellLinkDual2_iface.lpVtbl = &ShellLinkObjectVtbl;
This->ref = 1; This->ref = 1;
...@@ -909,7 +909,7 @@ static HRESULT ShellLinkObject_Constructor(FolderItemImpl *item, IShellLinkDual2 ...@@ -909,7 +909,7 @@ static HRESULT ShellLinkObject_Constructor(FolderItemImpl *item, IShellLinkDual2
&IID_IShellLinkW, (LPVOID*)&This->shell_link); &IID_IShellLinkW, (LPVOID*)&This->shell_link);
if (FAILED(hr)) if (FAILED(hr))
{ {
heap_free(This); free(This);
return hr; return hr;
} }
...@@ -918,7 +918,7 @@ static HRESULT ShellLinkObject_Constructor(FolderItemImpl *item, IShellLinkDual2 ...@@ -918,7 +918,7 @@ static HRESULT ShellLinkObject_Constructor(FolderItemImpl *item, IShellLinkDual2
if (FAILED(hr)) if (FAILED(hr))
{ {
IShellLinkW_Release(This->shell_link); IShellLinkW_Release(This->shell_link);
heap_free(This); free(This);
return hr; return hr;
} }
...@@ -927,7 +927,7 @@ static HRESULT ShellLinkObject_Constructor(FolderItemImpl *item, IShellLinkDual2 ...@@ -927,7 +927,7 @@ static HRESULT ShellLinkObject_Constructor(FolderItemImpl *item, IShellLinkDual2
if (FAILED(hr)) if (FAILED(hr))
{ {
IShellLinkW_Release(This->shell_link); IShellLinkW_Release(This->shell_link);
heap_free(This); free(This);
return hr; return hr;
} }
...@@ -979,8 +979,8 @@ static ULONG WINAPI FolderItemImpl_Release(FolderItem2 *iface) ...@@ -979,8 +979,8 @@ static ULONG WINAPI FolderItemImpl_Release(FolderItem2 *iface)
if (!ref) if (!ref)
{ {
Folder3_Release(&This->folder->Folder3_iface); Folder3_Release(&This->folder->Folder3_iface);
heap_free(This->path); free(This->path);
heap_free(This); free(This);
} }
return ref; return ref;
} }
...@@ -1295,14 +1295,14 @@ static HRESULT FolderItem_Constructor(FolderImpl *folder, const WCHAR *path, Fol ...@@ -1295,14 +1295,14 @@ static HRESULT FolderItem_Constructor(FolderImpl *folder, const WCHAR *path, Fol
*item = NULL; *item = NULL;
This = heap_alloc_zero(sizeof(*This)); This = calloc(1, sizeof(*This));
if (!This) if (!This)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
This->FolderItem2_iface.lpVtbl = &FolderItemImpl_Vtbl; This->FolderItem2_iface.lpVtbl = &FolderItemImpl_Vtbl;
This->ref = 1; This->ref = 1;
if (path) if (path)
This->path = strdupW(path); This->path = wcsdup(path);
This->folder = folder; This->folder = folder;
Folder3_AddRef(&folder->Folder3_iface); Folder3_AddRef(&folder->Folder3_iface);
...@@ -1362,8 +1362,8 @@ static ULONG WINAPI FolderItemsImpl_Release(FolderItems3 *iface) ...@@ -1362,8 +1362,8 @@ static ULONG WINAPI FolderItemsImpl_Release(FolderItems3 *iface)
Folder3_Release(&This->folder->Folder3_iface); Folder3_Release(&This->folder->Folder3_iface);
for (i = 0; i < This->item_count; i++) for (i = 0; i < This->item_count; i++)
SysFreeString(This->item_names[i]); SysFreeString(This->item_names[i]);
heap_free(This->item_names); free(This->item_names);
heap_free(This); free(This);
} }
return ref; return ref;
} }
...@@ -1623,7 +1623,7 @@ static HRESULT FolderItems_Constructor(FolderImpl *folder, FolderItems **ret) ...@@ -1623,7 +1623,7 @@ static HRESULT FolderItems_Constructor(FolderImpl *folder, FolderItems **ret)
*ret = NULL; *ret = NULL;
This = heap_alloc_zero(sizeof(*This)); This = calloc(1, sizeof(*This));
if (!This) if (!This)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
...@@ -1650,13 +1650,13 @@ static HRESULT FolderItems_Constructor(FolderImpl *folder, FolderItems **ret) ...@@ -1650,13 +1650,13 @@ static HRESULT FolderItems_Constructor(FolderImpl *folder, FolderItems **ret)
LPITEMIDLIST *pidls; LPITEMIDLIST *pidls;
ULONG fetched; ULONG fetched;
pidls = heap_alloc(This->item_count * sizeof(*pidls)); pidls = malloc(This->item_count * sizeof(*pidls));
This->item_names = heap_alloc_zero(This->item_count * sizeof(*This->item_names)); This->item_names = calloc(This->item_count, sizeof(*This->item_names));
if (!pidls || !This->item_names) if (!pidls || !This->item_names)
{ {
heap_free(pidls); free(pidls);
heap_free(This->item_names); free(This->item_names);
hr = E_OUTOFMEMORY; hr = E_OUTOFMEMORY;
goto failed; goto failed;
} }
...@@ -1674,7 +1674,7 @@ static HRESULT FolderItems_Constructor(FolderImpl *folder, FolderItems **ret) ...@@ -1674,7 +1674,7 @@ static HRESULT FolderItems_Constructor(FolderImpl *folder, FolderItems **ret)
ILFree(pidls[i]); ILFree(pidls[i]);
} }
heap_free(pidls); free(pidls);
} }
IEnumIDList_Release(enumidlist); IEnumIDList_Release(enumidlist);
...@@ -1735,7 +1735,7 @@ static ULONG WINAPI FolderImpl_Release(Folder3 *iface) ...@@ -1735,7 +1735,7 @@ static ULONG WINAPI FolderImpl_Release(Folder3 *iface)
SysFreeString(This->path); SysFreeString(This->path);
IShellFolder2_Release(This->folder); IShellFolder2_Release(This->folder);
IDispatch_Release(This->application); IDispatch_Release(This->application);
heap_free(This); free(This);
} }
return ref; return ref;
} }
...@@ -2005,7 +2005,7 @@ static HRESULT Folder_Constructor(IShellFolder2 *folder, LPITEMIDLIST pidl, Fold ...@@ -2005,7 +2005,7 @@ static HRESULT Folder_Constructor(IShellFolder2 *folder, LPITEMIDLIST pidl, Fold
*ret = NULL; *ret = NULL;
This = heap_alloc(sizeof(*This)); This = malloc(sizeof(*This));
if (!This) if (!This)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
...@@ -2072,7 +2072,7 @@ static ULONG WINAPI ShellDispatch_Release(IShellDispatch6 *iface) ...@@ -2072,7 +2072,7 @@ static ULONG WINAPI ShellDispatch_Release(IShellDispatch6 *iface)
TRACE("(%p), new refcount=%li\n", iface, ref); TRACE("(%p), new refcount=%li\n", iface, ref);
if (!ref) if (!ref)
heap_free(This); free(This);
return ref; return ref;
} }
...@@ -2620,7 +2620,7 @@ HRESULT WINAPI IShellDispatch_Constructor(IUnknown *outer, REFIID riid, void **p ...@@ -2620,7 +2620,7 @@ HRESULT WINAPI IShellDispatch_Constructor(IUnknown *outer, REFIID riid, void **p
if (outer) return CLASS_E_NOAGGREGATION; if (outer) return CLASS_E_NOAGGREGATION;
This = heap_alloc(sizeof(*This)); This = malloc(sizeof(*This));
if (!This) return E_OUTOFMEMORY; if (!This) return E_OUTOFMEMORY;
This->IShellDispatch6_iface.lpVtbl = &ShellDispatchVtbl; This->IShellDispatch6_iface.lpVtbl = &ShellDispatchVtbl;
This->ref = 1; This->ref = 1;
......
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