From a4cc5bf299f7b998e300aa08a8961355ec360c8c Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 17 Jul 2006 21:21:21 +0200 Subject: [PATCH] mshtml: Wrap more Heap* function by inline functions. --- dlls/mshtml/htmlbody.c | 4 ++-- dlls/mshtml/htmldoc.c | 6 +++--- dlls/mshtml/htmlelem.c | 26 +++++++++++++------------- dlls/mshtml/htmlinput.c | 4 ++-- dlls/mshtml/htmlnode.c | 4 ++-- dlls/mshtml/htmlselect.c | 4 ++-- dlls/mshtml/htmltextarea.c | 4 ++-- 7 files changed, 26 insertions(+), 26 deletions(-) diff --git a/dlls/mshtml/htmlbody.c b/dlls/mshtml/htmlbody.c index 0ad554ec3f9..b557906251c 100644 --- a/dlls/mshtml/htmlbody.c +++ b/dlls/mshtml/htmlbody.c @@ -385,7 +385,7 @@ static void HTMLBodyElement_destructor(IUnknown *iface) HTMLBodyElement *This = HTMLBODY_THIS(iface); nsIDOMHTMLBodyElement_Release(This->nsbody); - HeapFree(GetProcessHeap(), 0, This); + mshtml_free(This); } static const IHTMLBodyElementVtbl HTMLBodyElementVtbl = { @@ -435,7 +435,7 @@ static const IHTMLBodyElementVtbl HTMLBodyElementVtbl = { void HTMLBodyElement_Create(HTMLElement *element) { - HTMLBodyElement *ret = HeapAlloc(GetProcessHeap(), 0, sizeof(HTMLBodyElement)); + HTMLBodyElement *ret = mshtml_alloc(sizeof(HTMLBodyElement)); nsresult nsres; ret->lpHTMLBodyElementVtbl = &HTMLBodyElementVtbl; diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 2bf8522e54a..e3c7e32cb53 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -162,7 +162,7 @@ static ULONG WINAPI HTMLDocument_Release(IHTMLDocument2 *iface) if(This->nscontainer) NSContainer_Release(This->nscontainer); - HeapFree(GetProcessHeap(), 0, This); + mshtml_free(This); UNLOCK_MODULE(); } @@ -1066,7 +1066,7 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject) TRACE("(%p %s %p)\n", pUnkOuter, debugstr_guid(riid), ppvObject); - ret = HeapAlloc(GetProcessHeap(), 0, sizeof(HTMLDocument)); + ret = mshtml_alloc(sizeof(HTMLDocument)); ret->lpHTMLDocument2Vtbl = &HTMLDocumentVtbl; ret->ref = 0; ret->nscontainer = NULL; @@ -1074,7 +1074,7 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject) hres = IHTMLDocument_QueryInterface(HTMLDOC(ret), riid, ppvObject); if(FAILED(hres)) { - HeapFree(GetProcessHeap(), 0, ret); + mshtml_free(ret); return hres; } diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index c49555c7fe9..48a073a544d 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -48,7 +48,7 @@ static void elem_vector_add(elem_vector *buf, HTMLElement *elem) { if(buf->len == buf->size) { buf->size <<= 1; - buf->buf = HeapReAlloc(GetProcessHeap(), 0, buf->buf, buf->size*sizeof(HTMLElement**)); + buf->buf = mshtml_realloc(buf->buf, buf->size*sizeof(HTMLElement**)); } buf->buf[buf->len++] = elem; @@ -158,7 +158,7 @@ static HRESULT WINAPI HTMLElement_getAttribute(IHTMLElement *iface, BSTR strAttr if(NS_SUCCEEDED(nsres)) { nsAString_GetData(&value_str, &value, NULL); V_VT(AttributeValue) = VT_BSTR; - V_BSTR(AttributeValue) = SysAllocString(value);; + V_BSTR(AttributeValue) = SysAllocString(value); TRACE("attr_value=%s\n", debugstr_w(V_BSTR(AttributeValue))); }else { ERR("GetAttribute failed: %08lx\n", nsres); @@ -804,15 +804,15 @@ static HRESULT WINAPI HTMLElement_get_all(IHTMLElement *iface, IDispatch **p) TRACE("(%p)->(%p)\n", This, p); - buf.buf = HeapAlloc(GetProcessHeap(), 0, buf.size*sizeof(HTMLElement**)); + buf.buf = mshtml_alloc(buf.size*sizeof(HTMLElement**)); create_all_list(This->node->doc, This, &buf); if(!buf.len) { - HeapFree(GetProcessHeap(), 0, buf.buf); + mshtml_free(buf.buf); buf.buf = NULL; }else if(buf.size > buf.len) { - buf.buf = HeapReAlloc(GetProcessHeap(), 0, buf.buf, buf.len*sizeof(HTMLElement**)); + buf.buf = mshtml_realloc(buf.buf, buf.len*sizeof(HTMLElement**)); } return HTMLElementCollection_Create((IUnknown*)HTMLELEM(This), buf.buf, buf.len, p); @@ -828,7 +828,7 @@ static void HTMLElement_destructor(IUnknown *iface) if(This->nselem) nsIDOMHTMLElement_Release(This->nselem); - HeapFree(GetProcessHeap(), 0, This); + mshtml_free(This); } #undef HTMLELEM_THIS @@ -968,7 +968,7 @@ void HTMLElement_Create(HTMLDOMNode *node) static const WCHAR wszSELECT[] = {'S','E','L','E','C','T',0}; static const WCHAR wszTEXTAREA[] = {'T','E','X','T','A','R','E','A',0}; - ret = HeapAlloc(GetProcessHeap(), 0, sizeof(HTMLElement)); + ret = mshtml_alloc(sizeof(HTMLElement)); ret->lpHTMLElementVtbl = &HTMLElementVtbl; ret->node = node; ret->impl = NULL; @@ -1061,8 +1061,8 @@ static ULONG WINAPI HTMLElementCollection_Release(IHTMLElementCollection *iface) if(!ref) { IUnknown_Release(This->ref_unk); - HeapFree(GetProcessHeap(), 0, This->elems); - HeapFree(GetProcessHeap(), 0, This); + mshtml_free(This->elems); + mshtml_free(This); } return ref; @@ -1177,7 +1177,7 @@ static HRESULT WINAPI HTMLElementCollection_tags(IHTMLElementCollection *iface, TRACE("(%p)->(%s %p)\n", This, debugstr_w(V_BSTR(&tagName)), pdisp); - buf.buf = HeapAlloc(GetProcessHeap(), 0, buf.size*sizeof(HTMLElement*)); + buf.buf = mshtml_alloc(buf.size*sizeof(HTMLElement*)); nsAString_Init(&tag_str, NULL); @@ -1198,10 +1198,10 @@ static HRESULT WINAPI HTMLElementCollection_tags(IHTMLElementCollection *iface, TRACE("fount %ld tags\n", buf.len); if(!buf.len) { - HeapFree(GetProcessHeap(), 0, buf.buf); + mshtml_free(buf.buf); buf.buf = NULL; }else if(buf.size > buf.len) { - buf.buf = HeapReAlloc(GetProcessHeap(), 0, buf.buf, buf.len); + buf.buf = mshtml_realloc(buf.buf, buf.len*sizeof(HTMLElement*)); } return HTMLElementCollection_Create(This->ref_unk, buf.buf, buf.len, pdisp); @@ -1228,7 +1228,7 @@ static const IHTMLElementCollectionVtbl HTMLElementCollectionVtbl = { static HRESULT HTMLElementCollection_Create(IUnknown *ref_unk, HTMLElement **elems, DWORD len, IDispatch **p) { - HTMLElementCollection *ret = HeapAlloc(GetProcessHeap(), 0, sizeof(HTMLElementCollection)); + HTMLElementCollection *ret = mshtml_alloc(sizeof(HTMLElementCollection)); ret->lpHTMLElementCollectionVtbl = &HTMLElementCollectionVtbl; ret->ref = 1; diff --git a/dlls/mshtml/htmlinput.c b/dlls/mshtml/htmlinput.c index 1b1f6d5a1e6..531288ac606 100644 --- a/dlls/mshtml/htmlinput.c +++ b/dlls/mshtml/htmlinput.c @@ -657,7 +657,7 @@ static void HTMLInputElement_destructor(IUnknown *iface) HTMLInputElement *This = HTMLINPUT_THIS(iface); nsIDOMHTMLInputElement_Release(This->nsinput); - HeapFree(GetProcessHeap(), 0, This); + mshtml_free(This); } #undef HTMLINPUT_THIS @@ -739,7 +739,7 @@ static const IHTMLInputElementVtbl HTMLInputElementVtbl = { void HTMLInputElement_Create(HTMLElement *element) { - HTMLInputElement *ret = HeapAlloc(GetProcessHeap(), 0, sizeof(HTMLInputElement)); + HTMLInputElement *ret = mshtml_alloc(sizeof(HTMLInputElement)); nsresult nsres; ret->lpHTMLInputElementVtbl = &HTMLInputElementVtbl; diff --git a/dlls/mshtml/htmlnode.c b/dlls/mshtml/htmlnode.c index 6e16454d694..513d99b326e 100644 --- a/dlls/mshtml/htmlnode.c +++ b/dlls/mshtml/htmlnode.c @@ -333,7 +333,7 @@ HTMLDOMNode *get_node(HTMLDocument *This, nsIDOMNode *nsnode) if(iter) return iter; - ret = HeapAlloc(GetProcessHeap(), 0, sizeof(HTMLDOMNode)); + ret = mshtml_alloc(sizeof(HTMLDOMNode)); ret->lpHTMLDOMNodeVtbl = &HTMLDOMNodeVtbl; ret->node_type = NT_UNKNOWN; ret->impl.unk = NULL; @@ -367,6 +367,6 @@ void release_nodes(HTMLDocument *This) if(iter->destructor) iter->destructor(iter->impl.unk); nsIDOMNode_Release(iter->nsnode); - HeapFree(GetProcessHeap(), 0, iter); + mshtml_free(iter); } } diff --git a/dlls/mshtml/htmlselect.c b/dlls/mshtml/htmlselect.c index 639e26fed59..607cc4141d6 100644 --- a/dlls/mshtml/htmlselect.c +++ b/dlls/mshtml/htmlselect.c @@ -342,7 +342,7 @@ static void HTMLSelectElement_destructor(IUnknown *iface) HTMLSelectElement *This = HTMLSELECT_THIS(iface); nsIDOMHTMLSelectElement_Release(This->nsselect); - HeapFree(GetProcessHeap(), 0, This); + mshtml_free(This); } static const IHTMLSelectElementVtbl HTMLSelectElementVtbl = { @@ -381,7 +381,7 @@ static const IHTMLSelectElementVtbl HTMLSelectElementVtbl = { void HTMLSelectElement_Create(HTMLElement *element) { - HTMLSelectElement *ret = HeapAlloc(GetProcessHeap(), 0, sizeof(HTMLSelectElement)); + HTMLSelectElement *ret = mshtml_alloc(sizeof(HTMLSelectElement)); nsresult nsres; ret->lpHTMLSelectElementVtbl = &HTMLSelectElementVtbl; diff --git a/dlls/mshtml/htmltextarea.c b/dlls/mshtml/htmltextarea.c index 1bc8ecc84da..26d1061c237 100644 --- a/dlls/mshtml/htmltextarea.c +++ b/dlls/mshtml/htmltextarea.c @@ -354,7 +354,7 @@ static void HTMLTextAreaElement_destructor(IUnknown *iface) HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface); nsIDOMHTMLTextAreaElement_Release(This->nstextarea); - HeapFree(GetProcessHeap(), 0, This); + mshtml_free(This); } #undef HTMLTXTAREA_THIS @@ -397,7 +397,7 @@ static const IHTMLTextAreaElementVtbl HTMLTextAreaElementVtbl = { void HTMLTextAreaElement_Create(HTMLElement *element) { - HTMLTextAreaElement *ret = HeapAlloc(GetProcessHeap(), 0, sizeof(HTMLTextAreaElement)); + HTMLTextAreaElement *ret = mshtml_alloc(sizeof(HTMLTextAreaElement)); nsresult nsres; ret->lpHTMLTextAreaElementVtbl = &HTMLTextAreaElementVtbl;