mshtml: Wrap more Heap* function by inline functions.
This commit is contained in:
parent
a05672e55f
commit
a4cc5bf299
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue