Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/explorerframe/nstc.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/dlls/explorerframe/nstc.c b/dlls/explorerframe/nstc.c index 15d2f2629b..37e1a553a4 100644 --- a/dlls/explorerframe/nstc.c +++ b/dlls/explorerframe/nstc.c @@ -33,6 +33,7 @@
#include "wine/list.h" #include "wine/debug.h" +#include "wine/heap.h"
#include "explorerframe_main.h"
@@ -861,9 +862,8 @@ static ULONG WINAPI NSTC2_fnRelease(INameSpaceTreeControl2* iface) if(!ref) { TRACE("Freeing.\n"); - HeapFree(GetProcessHeap(), 0, This); + heap_free(This); EFRAME_UnlockModule(); - return 0; }
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);
- new_root = HeapAlloc(GetProcessHeap(), 0, sizeof(nstc_root)); + new_root = heap_alloc(sizeof(*new_root)); if(!new_root) return E_OUTOFMEMORY;
@@ -1025,7 +1025,7 @@ static HRESULT WINAPI NSTC2_fnInsertRoot(INameSpaceTreeControl2* iface, if(!new_root->htreeitem) { WARN("Failed to add the root.\n"); - HeapFree(GetProcessHeap(), 0, new_root); + heap_free(new_root); return E_FAIL; }
@@ -1093,7 +1093,7 @@ static HRESULT WINAPI NSTC2_fnRemoveRoot(INameSpaceTreeControl2* iface, events_OnItemDeleted(This, root->psi, TRUE); SendMessageW(This->hwnd_tv, TVM_DELETEITEM, 0, (LPARAM)root->htreeitem); list_remove(&root->entry); - HeapFree(GetProcessHeap(), 0, root); + heap_free(root); return S_OK; } else @@ -1135,7 +1135,7 @@ static HRESULT WINAPI NSTC2_fnGetRootItems(INameSpaceTreeControl2* iface, if(!count) return E_INVALIDARG;
- array = HeapAlloc(GetProcessHeap(), 0, sizeof(LPITEMIDLIST)*count); + array = heap_alloc(sizeof(LPITEMIDLIST)*count);
i = 0; 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++) ILFree(array[i]);
- HeapFree(GetProcessHeap(), 0, array); + heap_free(array);
return hr; } @@ -1610,7 +1610,7 @@ HRESULT NamespaceTreeControl_Constructor(IUnknown *pUnkOuter, REFIID riid, void
EFRAME_LockModule();
- nstc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(NSTC2Impl)); + nstc = heap_alloc_zero(sizeof(*nstc)); if (!nstc) return E_OUTOFMEMORY;
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/explorerframe/tests/msg.h | 12 +++++------- dlls/explorerframe/tests/nstc.c | 7 ++++--- 2 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/dlls/explorerframe/tests/msg.h b/dlls/explorerframe/tests/msg.h index f5e20f7053..857278e4ef 100644 --- a/dlls/explorerframe/tests/msg.h +++ b/dlls/explorerframe/tests/msg.h @@ -20,6 +20,7 @@
#include <assert.h> #include <windows.h> +#include "wine/heap.h" #include "wine/test.h"
/* undocumented SWP flags - from SDK 3.1 */ @@ -66,16 +67,13 @@ static void add_message(struct msg_sequence **seq, int sequence_index, if (!msg_seq->sequence) { msg_seq->size = 10; - msg_seq->sequence = HeapAlloc(GetProcessHeap(), 0, - msg_seq->size * sizeof (struct message)); + msg_seq->sequence = heap_alloc(msg_seq->size * sizeof (struct message)); }
if (msg_seq->count == msg_seq->size) { msg_seq->size *= 2; - msg_seq->sequence = HeapReAlloc(GetProcessHeap(), 0, - msg_seq->sequence, - msg_seq->size * sizeof (struct message)); + msg_seq->sequence = heap_realloc(msg_seq->sequence, msg_seq->size * sizeof (struct message)); }
assert(msg_seq->sequence); @@ -92,7 +90,7 @@ static void add_message(struct msg_sequence **seq, int sequence_index, static void flush_sequence(struct msg_sequence **seg, int sequence_index) { struct msg_sequence *msg_seq = seg[sequence_index]; - HeapFree(GetProcessHeap(), 0, msg_seq->sequence); + heap_free(msg_seq->sequence); msg_seq->sequence = NULL; msg_seq->count = msg_seq->size = 0; } @@ -112,5 +110,5 @@ static void init_msg_sequences(struct msg_sequence **seq, int n) int i;
for (i = 0; i < n; i++) - seq[i] = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct msg_sequence)); + seq[i] = heap_alloc_zero(sizeof(struct msg_sequence)); } diff --git a/dlls/explorerframe/tests/nstc.c b/dlls/explorerframe/tests/nstc.c index 1d1673c8ab..44bdf317f2 100644 --- a/dlls/explorerframe/tests/nstc.c +++ b/dlls/explorerframe/tests/nstc.c @@ -363,7 +363,8 @@ static const INameSpaceTreeControlEventsVtbl vt_NSTCEvents = { static INameSpaceTreeControlEventsImpl *create_nstc_events(void) { INameSpaceTreeControlEventsImpl *This; - This = HeapAlloc(GetProcessHeap(), 0, sizeof(INameSpaceTreeControlEventsImpl)); + + This = heap_alloc(sizeof(*This)); This->INameSpaceTreeControlEvents_iface.lpVtbl = &vt_NSTCEvents; This->ref = 1;
@@ -2377,8 +2378,8 @@ static void test_events(void) if(!res) { /* Freeing these prematurely causes a crash. */ - HeapFree(GetProcessHeap(), 0, pnstceimpl); - HeapFree(GetProcessHeap(), 0, pnstceimpl2); + heap_free(pnstceimpl); + heap_free(pnstceimpl2); }
IShellItem_Release(psi);