explorerframe: Use global memory allocation helpers.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
7675ce7550
commit
9e8f152dc9
|
@ -33,6 +33,7 @@
|
||||||
|
|
||||||
#include "wine/list.h"
|
#include "wine/list.h"
|
||||||
#include "wine/debug.h"
|
#include "wine/debug.h"
|
||||||
|
#include "wine/heap.h"
|
||||||
|
|
||||||
#include "explorerframe_main.h"
|
#include "explorerframe_main.h"
|
||||||
|
|
||||||
|
@ -861,9 +862,8 @@ static ULONG WINAPI NSTC2_fnRelease(INameSpaceTreeControl2* iface)
|
||||||
if(!ref)
|
if(!ref)
|
||||||
{
|
{
|
||||||
TRACE("Freeing.\n");
|
TRACE("Freeing.\n");
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
heap_free(This);
|
||||||
EFRAME_UnlockModule();
|
EFRAME_UnlockModule();
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ref;
|
return ref;
|
||||||
|
@ -1001,7 +1001,7 @@ static HRESULT WINAPI NSTC2_fnInsertRoot(INameSpaceTreeControl2* iface,
|
||||||
|
|
||||||
TRACE("%p, %d, %p, %x, %x, %p\n", This, iIndex, psiRoot, grfEnumFlags, grfRootStyle, pif);
|
TRACE("%p, %d, %p, %x, %x, %p\n", This, iIndex, psiRoot, grfEnumFlags, grfRootStyle, pif);
|
||||||
|
|
||||||
new_root = HeapAlloc(GetProcessHeap(), 0, sizeof(nstc_root));
|
new_root = heap_alloc(sizeof(*new_root));
|
||||||
if(!new_root)
|
if(!new_root)
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
|
|
||||||
|
@ -1025,7 +1025,7 @@ static HRESULT WINAPI NSTC2_fnInsertRoot(INameSpaceTreeControl2* iface,
|
||||||
if(!new_root->htreeitem)
|
if(!new_root->htreeitem)
|
||||||
{
|
{
|
||||||
WARN("Failed to add the root.\n");
|
WARN("Failed to add the root.\n");
|
||||||
HeapFree(GetProcessHeap(), 0, new_root);
|
heap_free(new_root);
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1093,7 +1093,7 @@ static HRESULT WINAPI NSTC2_fnRemoveRoot(INameSpaceTreeControl2* iface,
|
||||||
events_OnItemDeleted(This, root->psi, TRUE);
|
events_OnItemDeleted(This, root->psi, TRUE);
|
||||||
SendMessageW(This->hwnd_tv, TVM_DELETEITEM, 0, (LPARAM)root->htreeitem);
|
SendMessageW(This->hwnd_tv, TVM_DELETEITEM, 0, (LPARAM)root->htreeitem);
|
||||||
list_remove(&root->entry);
|
list_remove(&root->entry);
|
||||||
HeapFree(GetProcessHeap(), 0, root);
|
heap_free(root);
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1135,7 +1135,7 @@ static HRESULT WINAPI NSTC2_fnGetRootItems(INameSpaceTreeControl2* iface,
|
||||||
if(!count)
|
if(!count)
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
|
||||||
array = HeapAlloc(GetProcessHeap(), 0, sizeof(LPITEMIDLIST)*count);
|
array = heap_alloc(sizeof(LPITEMIDLIST)*count);
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
LIST_FOR_EACH_ENTRY(root, &This->roots, nstc_root, entry)
|
LIST_FOR_EACH_ENTRY(root, &This->roots, nstc_root, entry)
|
||||||
|
@ -1149,7 +1149,7 @@ static HRESULT WINAPI NSTC2_fnGetRootItems(INameSpaceTreeControl2* iface,
|
||||||
for(i = 0; i < count; i++)
|
for(i = 0; i < count; i++)
|
||||||
ILFree(array[i]);
|
ILFree(array[i]);
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, array);
|
heap_free(array);
|
||||||
|
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
@ -1610,7 +1610,7 @@ HRESULT NamespaceTreeControl_Constructor(IUnknown *pUnkOuter, REFIID riid, void
|
||||||
|
|
||||||
EFRAME_LockModule();
|
EFRAME_LockModule();
|
||||||
|
|
||||||
nstc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(NSTC2Impl));
|
nstc = heap_alloc_zero(sizeof(*nstc));
|
||||||
if (!nstc)
|
if (!nstc)
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue