Commit a084d1db authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

mshtml: Rename the wrappers around HeapAlloc() &Co to use the new standard naming.

parent d457af74
...@@ -152,9 +152,9 @@ static HRESULT WINAPI ConnectionPoint_Advise(IConnectionPoint *iface, IUnknown * ...@@ -152,9 +152,9 @@ static HRESULT WINAPI ConnectionPoint_Advise(IConnectionPoint *iface, IUnknown *
} }
if(i == This->sinks_size) if(i == This->sinks_size)
This->sinks = mshtml_realloc(This->sinks,(++This->sinks_size)*sizeof(*This->sinks)); This->sinks = heap_realloc(This->sinks,(++This->sinks_size)*sizeof(*This->sinks));
}else { }else {
This->sinks = mshtml_alloc(sizeof(*This->sinks)); This->sinks = heap_alloc(sizeof(*This->sinks));
This->sinks_size = 1; This->sinks_size = 1;
i = 0; i = 0;
} }
...@@ -223,7 +223,7 @@ static void ConnectionPoint_Destroy(ConnectionPoint *This) ...@@ -223,7 +223,7 @@ static void ConnectionPoint_Destroy(ConnectionPoint *This)
IUnknown_Release(This->sinks[i].unk); IUnknown_Release(This->sinks[i].unk);
} }
mshtml_free(This->sinks); heap_free(This->sinks);
} }
#define CONPTCONT_THIS(iface) DEFINE_THIS(ConnectionPointContainer, ConnectionPointContainer, iface) #define CONPTCONT_THIS(iface) DEFINE_THIS(ConnectionPointContainer, ConnectionPointContainer, iface)
......
...@@ -569,12 +569,12 @@ static HRESULT exec_fontname(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, ...@@ -569,12 +569,12 @@ static HRESULT exec_fontname(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in,
TRACE("%s\n", debugstr_w(V_BSTR(in))); TRACE("%s\n", debugstr_w(V_BSTR(in)));
len = WideCharToMultiByte(CP_ACP, 0, V_BSTR(in), -1, NULL, 0, NULL, NULL); len = WideCharToMultiByte(CP_ACP, 0, V_BSTR(in), -1, NULL, 0, NULL, NULL);
stra = mshtml_alloc(len); stra = heap_alloc(len);
WideCharToMultiByte(CP_ACP, 0, V_BSTR(in), -1, stra, -1, NULL, NULL); WideCharToMultiByte(CP_ACP, 0, V_BSTR(in), -1, stra, -1, NULL, NULL);
set_ns_fontname(This->nscontainer, stra); set_ns_fontname(This->nscontainer, stra);
mshtml_free(stra); heap_free(stra);
update_doc(This, UPDATE_UI); update_doc(This, UPDATE_UI);
} }
...@@ -599,12 +599,12 @@ static HRESULT exec_fontname(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, ...@@ -599,12 +599,12 @@ static HRESULT exec_fontname(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in,
nsICommandParams_Release(nsparam); nsICommandParams_Release(nsparam);
len = MultiByteToWideChar(CP_ACP, 0, stra, -1, NULL, 0); len = MultiByteToWideChar(CP_ACP, 0, stra, -1, NULL, 0);
strw = mshtml_alloc(len*sizeof(WCHAR)); strw = heap_alloc(len*sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, stra, -1, strw, -1); MultiByteToWideChar(CP_ACP, 0, stra, -1, strw, -1);
nsfree(stra); nsfree(stra);
V_BSTR(out) = SysAllocString(strw); V_BSTR(out) = SysAllocString(strw);
mshtml_free(strw); heap_free(strw);
} }
return S_OK; return S_OK;
......
...@@ -484,7 +484,7 @@ static const NodeImplVtbl HTMLAnchorElementImplVtbl = { ...@@ -484,7 +484,7 @@ static const NodeImplVtbl HTMLAnchorElementImplVtbl = {
HTMLElement *HTMLAnchorElement_Create(nsIDOMHTMLElement *nselem) HTMLElement *HTMLAnchorElement_Create(nsIDOMHTMLElement *nselem)
{ {
HTMLAnchorElement *ret = mshtml_alloc(sizeof(HTMLAnchorElement)); HTMLAnchorElement *ret = heap_alloc(sizeof(HTMLAnchorElement));
HTMLElement_Init(&ret->element); HTMLElement_Init(&ret->element);
......
...@@ -490,7 +490,7 @@ static const NodeImplVtbl HTMLBodyElementImplVtbl = { ...@@ -490,7 +490,7 @@ static const NodeImplVtbl HTMLBodyElementImplVtbl = {
HTMLElement *HTMLBodyElement_Create(nsIDOMHTMLElement *nselem) HTMLElement *HTMLBodyElement_Create(nsIDOMHTMLElement *nselem)
{ {
HTMLBodyElement *ret = mshtml_alloc(sizeof(HTMLBodyElement)); HTMLBodyElement *ret = heap_alloc(sizeof(HTMLBodyElement));
nsresult nsres; nsresult nsres;
TRACE("(%p)->(%p)\n", ret, nselem); TRACE("(%p)->(%p)\n", ret, nselem);
......
...@@ -194,7 +194,7 @@ static ULONG WINAPI HTMLDocument_Release(IHTMLDocument2 *iface) ...@@ -194,7 +194,7 @@ static ULONG WINAPI HTMLDocument_Release(IHTMLDocument2 *iface)
if(This->nscontainer) if(This->nscontainer)
NSContainer_Release(This->nscontainer); NSContainer_Release(This->nscontainer);
mshtml_free(This); heap_free(This);
UNLOCK_MODULE(); UNLOCK_MODULE();
} }
...@@ -1176,7 +1176,7 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject) ...@@ -1176,7 +1176,7 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject)
TRACE("(%p %s %p)\n", pUnkOuter, debugstr_guid(riid), ppvObject); TRACE("(%p %s %p)\n", pUnkOuter, debugstr_guid(riid), ppvObject);
ret = mshtml_alloc(sizeof(HTMLDocument)); ret = heap_alloc(sizeof(HTMLDocument));
ret->lpHTMLDocument2Vtbl = &HTMLDocumentVtbl; ret->lpHTMLDocument2Vtbl = &HTMLDocumentVtbl;
ret->ref = 0; ret->ref = 0;
ret->nscontainer = NULL; ret->nscontainer = NULL;
...@@ -1191,7 +1191,7 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject) ...@@ -1191,7 +1191,7 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject)
hres = IHTMLDocument_QueryInterface(HTMLDOC(ret), riid, ppvObject); hres = IHTMLDocument_QueryInterface(HTMLDOC(ret), riid, ppvObject);
if(FAILED(hres)) { if(FAILED(hres)) {
mshtml_free(ret); heap_free(ret);
return hres; return hres;
} }
......
...@@ -50,7 +50,7 @@ static void elem_vector_add(elem_vector *buf, HTMLElement *elem) ...@@ -50,7 +50,7 @@ static void elem_vector_add(elem_vector *buf, HTMLElement *elem)
{ {
if(buf->len == buf->size) { if(buf->len == buf->size) {
buf->size <<= 1; buf->size <<= 1;
buf->buf = mshtml_realloc(buf->buf, buf->size*sizeof(HTMLElement**)); buf->buf = heap_realloc(buf->buf, buf->size*sizeof(HTMLElement**));
} }
buf->buf[buf->len++] = elem; buf->buf[buf->len++] = elem;
...@@ -59,10 +59,10 @@ static void elem_vector_add(elem_vector *buf, HTMLElement *elem) ...@@ -59,10 +59,10 @@ static void elem_vector_add(elem_vector *buf, HTMLElement *elem)
static void elem_vector_normalize(elem_vector *buf) static void elem_vector_normalize(elem_vector *buf)
{ {
if(!buf->len) { if(!buf->len) {
mshtml_free(buf->buf); heap_free(buf->buf);
buf->buf = NULL; buf->buf = NULL;
}else if(buf->size > buf->len) { }else if(buf->size > buf->len) {
buf->buf = mshtml_realloc(buf->buf, buf->len*sizeof(HTMLElement**)); buf->buf = heap_realloc(buf->buf, buf->len*sizeof(HTMLElement**));
} }
buf->size = buf->len; buf->size = buf->len;
...@@ -1059,7 +1059,7 @@ static void create_child_list(HTMLDocument *doc, HTMLElement *elem, elem_vector ...@@ -1059,7 +1059,7 @@ static void create_child_list(HTMLDocument *doc, HTMLElement *elem, elem_vector
return; return;
buf->size = list_len; buf->size = list_len;
buf->buf = mshtml_alloc(buf->size*sizeof(HTMLElement**)); buf->buf = heap_alloc(buf->size*sizeof(HTMLElement**));
for(i=0; i<list_len; i++) { for(i=0; i<list_len; i++) {
nsres = nsIDOMNodeList_Item(nsnode_list, i, &iter); nsres = nsIDOMNodeList_Item(nsnode_list, i, &iter);
...@@ -1129,7 +1129,7 @@ static HRESULT WINAPI HTMLElement_get_all(IHTMLElement *iface, IDispatch **p) ...@@ -1129,7 +1129,7 @@ static HRESULT WINAPI HTMLElement_get_all(IHTMLElement *iface, IDispatch **p)
TRACE("(%p)->(%p)\n", This, p); TRACE("(%p)->(%p)\n", This, p);
buf.buf = mshtml_alloc(buf.size*sizeof(HTMLElement**)); buf.buf = heap_alloc(buf.size*sizeof(HTMLElement**));
create_all_list(This->node.doc, &This->node, &buf); create_all_list(This->node.doc, &This->node, &buf);
elem_vector_normalize(&buf); elem_vector_normalize(&buf);
...@@ -1336,7 +1336,7 @@ HTMLElement *HTMLElement_Create(nsIDOMNode *nsnode) ...@@ -1336,7 +1336,7 @@ HTMLElement *HTMLElement_Create(nsIDOMNode *nsnode)
ret = HTMLTextAreaElement_Create(nselem); ret = HTMLTextAreaElement_Create(nselem);
if(!ret) { if(!ret) {
ret = mshtml_alloc(sizeof(HTMLElement)); ret = heap_alloc(sizeof(HTMLElement));
HTMLElement_Init(ret); HTMLElement_Init(ret);
} }
...@@ -1407,8 +1407,8 @@ static ULONG WINAPI HTMLElementCollection_Release(IHTMLElementCollection *iface) ...@@ -1407,8 +1407,8 @@ static ULONG WINAPI HTMLElementCollection_Release(IHTMLElementCollection *iface)
if(!ref) { if(!ref) {
IUnknown_Release(This->ref_unk); IUnknown_Release(This->ref_unk);
mshtml_free(This->elems); heap_free(This->elems);
mshtml_free(This); heap_free(This);
} }
return ref; return ref;
...@@ -1563,7 +1563,7 @@ static HRESULT WINAPI HTMLElementCollection_item(IHTMLElementCollection *iface, ...@@ -1563,7 +1563,7 @@ static HRESULT WINAPI HTMLElementCollection_item(IHTMLElementCollection *iface,
}else { }else {
elem_vector buf = {NULL, 0, 8}; elem_vector buf = {NULL, 0, 8};
buf.buf = mshtml_alloc(buf.size*sizeof(HTMLElement*)); buf.buf = heap_alloc(buf.size*sizeof(HTMLElement*));
for(i=0; i<This->len; i++) { for(i=0; i<This->len; i++) {
if(is_elem_name(This->elems[i], V_BSTR(&name))) if(is_elem_name(This->elems[i], V_BSTR(&name)))
...@@ -1579,7 +1579,7 @@ static HRESULT WINAPI HTMLElementCollection_item(IHTMLElementCollection *iface, ...@@ -1579,7 +1579,7 @@ static HRESULT WINAPI HTMLElementCollection_item(IHTMLElementCollection *iface,
IDispatch_AddRef(*pdisp); IDispatch_AddRef(*pdisp);
} }
mshtml_free(buf.buf); heap_free(buf.buf);
} }
return S_OK; return S_OK;
...@@ -1606,7 +1606,7 @@ static HRESULT WINAPI HTMLElementCollection_tags(IHTMLElementCollection *iface, ...@@ -1606,7 +1606,7 @@ static HRESULT WINAPI HTMLElementCollection_tags(IHTMLElementCollection *iface,
TRACE("(%p)->(%s %p)\n", This, debugstr_w(V_BSTR(&tagName)), pdisp); TRACE("(%p)->(%s %p)\n", This, debugstr_w(V_BSTR(&tagName)), pdisp);
buf.buf = mshtml_alloc(buf.size*sizeof(HTMLElement*)); buf.buf = heap_alloc(buf.size*sizeof(HTMLElement*));
nsAString_Init(&tag_str, NULL); nsAString_Init(&tag_str, NULL);
...@@ -1653,7 +1653,7 @@ IHTMLElementCollection *create_all_collection(HTMLDOMNode *node) ...@@ -1653,7 +1653,7 @@ IHTMLElementCollection *create_all_collection(HTMLDOMNode *node)
{ {
elem_vector buf = {NULL, 0, 8}; elem_vector buf = {NULL, 0, 8};
buf.buf = mshtml_alloc(buf.size*sizeof(HTMLElement**)); buf.buf = heap_alloc(buf.size*sizeof(HTMLElement**));
elem_vector_add(&buf, HTMLELEM_NODE_THIS(node)); elem_vector_add(&buf, HTMLELEM_NODE_THIS(node));
create_all_list(node->doc, node, &buf); create_all_list(node->doc, node, &buf);
...@@ -1665,7 +1665,7 @@ IHTMLElementCollection *create_all_collection(HTMLDOMNode *node) ...@@ -1665,7 +1665,7 @@ IHTMLElementCollection *create_all_collection(HTMLDOMNode *node)
static IHTMLElementCollection *HTMLElementCollection_Create(IUnknown *ref_unk, static IHTMLElementCollection *HTMLElementCollection_Create(IUnknown *ref_unk,
HTMLElement **elems, DWORD len) HTMLElement **elems, DWORD len)
{ {
HTMLElementCollection *ret = mshtml_alloc(sizeof(HTMLElementCollection)); HTMLElementCollection *ret = heap_alloc(sizeof(HTMLElementCollection));
ret->lpHTMLElementCollectionVtbl = &HTMLElementCollectionVtbl; ret->lpHTMLElementCollectionVtbl = &HTMLElementCollectionVtbl;
ret->ref = 1; ret->ref = 1;
......
...@@ -1059,7 +1059,7 @@ static const NodeImplVtbl HTMLInputElementImplVtbl = { ...@@ -1059,7 +1059,7 @@ static const NodeImplVtbl HTMLInputElementImplVtbl = {
HTMLElement *HTMLInputElement_Create(nsIDOMHTMLElement *nselem) HTMLElement *HTMLInputElement_Create(nsIDOMHTMLElement *nselem)
{ {
HTMLInputElement *ret = mshtml_alloc(sizeof(HTMLInputElement)); HTMLInputElement *ret = heap_alloc(sizeof(HTMLInputElement));
nsresult nsres; nsresult nsres;
HTMLElement_Init(&ret->element); HTMLElement_Init(&ret->element);
......
...@@ -66,7 +66,7 @@ static ULONG WINAPI HTMLDOMNode_Release(IHTMLDOMNode *iface) ...@@ -66,7 +66,7 @@ static ULONG WINAPI HTMLDOMNode_Release(IHTMLDOMNode *iface)
if(!ref) { if(!ref) {
This->vtbl->destructor(This); This->vtbl->destructor(This);
mshtml_free(This); heap_free(This);
} }
return ref; return ref;
...@@ -354,7 +354,7 @@ static HTMLDOMNode *create_node(HTMLDocument *doc, nsIDOMNode *nsnode) ...@@ -354,7 +354,7 @@ static HTMLDOMNode *create_node(HTMLDocument *doc, nsIDOMNode *nsnode)
ret = &HTMLElement_Create(nsnode)->node; ret = &HTMLElement_Create(nsnode)->node;
break; break;
default: default:
ret = mshtml_alloc(sizeof(HTMLDOMNode)); ret = heap_alloc(sizeof(HTMLDOMNode));
ret->vtbl = &HTMLDOMNodeImplVtbl; ret->vtbl = &HTMLDOMNodeImplVtbl;
} }
......
...@@ -337,7 +337,7 @@ static const NodeImplVtbl HTMLOptionElementImplVtbl = { ...@@ -337,7 +337,7 @@ static const NodeImplVtbl HTMLOptionElementImplVtbl = {
HTMLElement *HTMLOptionElement_Create(nsIDOMHTMLElement *nselem) HTMLElement *HTMLOptionElement_Create(nsIDOMHTMLElement *nselem)
{ {
HTMLOptionElement *ret = mshtml_alloc(sizeof(HTMLOptionElement)); HTMLOptionElement *ret = heap_alloc(sizeof(HTMLOptionElement));
nsresult nsres; nsresult nsres;
HTMLElement_Init(&ret->element); HTMLElement_Init(&ret->element);
...@@ -399,7 +399,7 @@ static ULONG WINAPI HTMLOptionElementFactory_Release(IHTMLOptionElementFactory * ...@@ -399,7 +399,7 @@ static ULONG WINAPI HTMLOptionElementFactory_Release(IHTMLOptionElementFactory *
TRACE("(%p) ref=%d\n", This, ref); TRACE("(%p) ref=%d\n", This, ref);
if(!ref) if(!ref)
mshtml_free(This); heap_free(This);
return ref; return ref;
} }
...@@ -512,7 +512,7 @@ HTMLOptionElementFactory *HTMLOptionElementFactory_Create(HTMLDocument *doc) ...@@ -512,7 +512,7 @@ HTMLOptionElementFactory *HTMLOptionElementFactory_Create(HTMLDocument *doc)
{ {
HTMLOptionElementFactory *ret; HTMLOptionElementFactory *ret;
ret = mshtml_alloc(sizeof(HTMLOptionElementFactory)); ret = heap_alloc(sizeof(HTMLOptionElementFactory));
ret->lpHTMLOptionElementFactoryVtbl = &HTMLOptionElementFactoryVtbl; ret->lpHTMLOptionElementFactoryVtbl = &HTMLOptionElementFactoryVtbl;
ret->ref = 1; ret->ref = 1;
......
...@@ -426,7 +426,7 @@ static const NodeImplVtbl HTMLSelectElementImplVtbl = { ...@@ -426,7 +426,7 @@ static const NodeImplVtbl HTMLSelectElementImplVtbl = {
HTMLElement *HTMLSelectElement_Create(nsIDOMHTMLElement *nselem) HTMLElement *HTMLSelectElement_Create(nsIDOMHTMLElement *nselem)
{ {
HTMLSelectElement *ret = mshtml_alloc(sizeof(HTMLSelectElement)); HTMLSelectElement *ret = heap_alloc(sizeof(HTMLSelectElement));
nsresult nsres; nsresult nsres;
HTMLElement_Init(&ret->element); HTMLElement_Init(&ret->element);
......
...@@ -193,7 +193,7 @@ static ULONG WINAPI HTMLStyle_Release(IHTMLStyle *iface) ...@@ -193,7 +193,7 @@ static ULONG WINAPI HTMLStyle_Release(IHTMLStyle *iface)
TRACE("(%p) ref=%d\n", This, ref); TRACE("(%p) ref=%d\n", This, ref);
if(!ref) if(!ref)
mshtml_free(This); heap_free(This);
return ref; return ref;
} }
...@@ -1736,7 +1736,7 @@ static const IHTMLStyleVtbl HTMLStyleVtbl = { ...@@ -1736,7 +1736,7 @@ static const IHTMLStyleVtbl HTMLStyleVtbl = {
IHTMLStyle *HTMLStyle_Create(nsIDOMCSSStyleDeclaration *nsstyle) IHTMLStyle *HTMLStyle_Create(nsIDOMCSSStyleDeclaration *nsstyle)
{ {
HTMLStyle *ret = mshtml_alloc(sizeof(HTMLStyle)); HTMLStyle *ret = heap_alloc(sizeof(HTMLStyle));
ret->lpHTMLStyleVtbl = &HTMLStyleVtbl; ret->lpHTMLStyleVtbl = &HTMLStyleVtbl;
ret->ref = 1; ret->ref = 1;
......
...@@ -103,7 +103,7 @@ static ULONG WINAPI HTMLStyleSheetsCollection_Release(IHTMLStyleSheetsCollection ...@@ -103,7 +103,7 @@ static ULONG WINAPI HTMLStyleSheetsCollection_Release(IHTMLStyleSheetsCollection
TRACE("(%p) ref=%d\n", This, ref); TRACE("(%p) ref=%d\n", This, ref);
if(!ref) if(!ref)
mshtml_free(This); heap_free(This);
return ref; return ref;
} }
...@@ -221,7 +221,7 @@ static const IHTMLStyleSheetsCollectionVtbl HTMLStyleSheetsCollectionVtbl = { ...@@ -221,7 +221,7 @@ static const IHTMLStyleSheetsCollectionVtbl HTMLStyleSheetsCollectionVtbl = {
IHTMLStyleSheetsCollection *HTMLStyleSheetsCollection_Create(nsIDOMStyleSheetList *nslist) IHTMLStyleSheetsCollection *HTMLStyleSheetsCollection_Create(nsIDOMStyleSheetList *nslist)
{ {
HTMLStyleSheetsCollection *ret = mshtml_alloc(sizeof(HTMLStyleSheetsCollection)); HTMLStyleSheetsCollection *ret = heap_alloc(sizeof(HTMLStyleSheetsCollection));
ret->lpHTMLStyleSheetsCollectionVtbl = &HTMLStyleSheetsCollectionVtbl; ret->lpHTMLStyleSheetsCollectionVtbl = &HTMLStyleSheetsCollectionVtbl;
ret->ref = 1; ret->ref = 1;
...@@ -279,7 +279,7 @@ static ULONG WINAPI HTMLStyleSheet_Release(IHTMLStyleSheet *iface) ...@@ -279,7 +279,7 @@ static ULONG WINAPI HTMLStyleSheet_Release(IHTMLStyleSheet *iface)
TRACE("(%p) ref=%d\n", This, ref); TRACE("(%p) ref=%d\n", This, ref);
if(!ref) if(!ref)
mshtml_free(This); heap_free(This);
return ref; return ref;
} }
...@@ -505,7 +505,7 @@ static const IHTMLStyleSheetVtbl HTMLStyleSheetVtbl = { ...@@ -505,7 +505,7 @@ static const IHTMLStyleSheetVtbl HTMLStyleSheetVtbl = {
IHTMLStyleSheet *HTMLStyleSheet_Create(nsIDOMStyleSheet *nsstylesheet) IHTMLStyleSheet *HTMLStyleSheet_Create(nsIDOMStyleSheet *nsstylesheet)
{ {
HTMLStyleSheet *ret = mshtml_alloc(sizeof(HTMLStyleSheet)); HTMLStyleSheet *ret = heap_alloc(sizeof(HTMLStyleSheet));
nsresult nsres; nsresult nsres;
ret->lpHTMLStyleSheetVtbl = &HTMLStyleSheetVtbl; ret->lpHTMLStyleSheetVtbl = &HTMLStyleSheetVtbl;
......
...@@ -550,7 +550,7 @@ static const NodeImplVtbl HTMLTableImplVtbl = { ...@@ -550,7 +550,7 @@ static const NodeImplVtbl HTMLTableImplVtbl = {
HTMLElement *HTMLTable_Create(nsIDOMHTMLElement *nselem) HTMLElement *HTMLTable_Create(nsIDOMHTMLElement *nselem)
{ {
HTMLTable *ret = mshtml_alloc(sizeof(HTMLTable)); HTMLTable *ret = heap_alloc(sizeof(HTMLTable));
HTMLElement_Init(&ret->element); HTMLElement_Init(&ret->element);
......
...@@ -406,7 +406,7 @@ static const NodeImplVtbl HTMLTextAreaElementImplVtbl = { ...@@ -406,7 +406,7 @@ static const NodeImplVtbl HTMLTextAreaElementImplVtbl = {
HTMLElement *HTMLTextAreaElement_Create(nsIDOMHTMLElement *nselem) HTMLElement *HTMLTextAreaElement_Create(nsIDOMHTMLElement *nselem)
{ {
HTMLTextAreaElement *ret = mshtml_alloc(sizeof(HTMLTextAreaElement)); HTMLTextAreaElement *ret = heap_alloc(sizeof(HTMLTextAreaElement));
nsresult nsres; nsresult nsres;
HTMLElement_Init(&ret->element); HTMLElement_Init(&ret->element);
......
...@@ -89,7 +89,7 @@ static ULONG WINAPI HTMLWindow2_Release(IHTMLWindow2 *iface) ...@@ -89,7 +89,7 @@ static ULONG WINAPI HTMLWindow2_Release(IHTMLWindow2 *iface)
if(!ref) { if(!ref) {
list_remove(&This->entry); list_remove(&This->entry);
mshtml_free(This); heap_free(This);
} }
return ref; return ref;
...@@ -775,12 +775,12 @@ static void astr_to_nswstr(const char *str, nsAString *nsstr) ...@@ -775,12 +775,12 @@ static void astr_to_nswstr(const char *str, nsAString *nsstr)
int len; int len;
len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0); len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
wstr = mshtml_alloc(len*sizeof(WCHAR)); wstr = heap_alloc(len*sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, str, -1, wstr, len); MultiByteToWideChar(CP_ACP, 0, str, -1, wstr, len);
nsAString_Init(nsstr, wstr); nsAString_Init(nsstr, wstr);
mshtml_free(wstr); heap_free(wstr);
} }
static nsresult call_js_func(nsIScriptContainer *script_container, nsISupports *target, static nsresult call_js_func(nsIScriptContainer *script_container, nsISupports *target,
...@@ -867,7 +867,7 @@ void setup_nswindow(HTMLWindow *This) ...@@ -867,7 +867,7 @@ void setup_nswindow(HTMLWindow *This)
HTMLWindow *HTMLWindow_Create(HTMLDocument *doc) HTMLWindow *HTMLWindow_Create(HTMLDocument *doc)
{ {
HTMLWindow *ret = mshtml_alloc(sizeof(HTMLWindow)); HTMLWindow *ret = heap_alloc(sizeof(HTMLWindow));
ret->lpHTMLWindow2Vtbl = &HTMLWindow2Vtbl; ret->lpHTMLWindow2Vtbl = &HTMLWindow2Vtbl;
ret->ref = 1; ret->ref = 1;
......
...@@ -66,7 +66,7 @@ static void clean_up(void) ...@@ -66,7 +66,7 @@ static void clean_up(void)
if(tmp_file_name) { if(tmp_file_name) {
DeleteFileW(tmp_file_name); DeleteFileW(tmp_file_name);
mshtml_free(tmp_file_name); heap_free(tmp_file_name);
tmp_file_name = NULL; tmp_file_name = NULL;
} }
...@@ -112,7 +112,7 @@ static void set_registry(LPCSTR install_dir) ...@@ -112,7 +112,7 @@ static void set_registry(LPCSTR install_dir)
} }
len = MultiByteToWideChar(CP_ACP, 0, install_dir, -1, NULL, 0)-1; len = MultiByteToWideChar(CP_ACP, 0, install_dir, -1, NULL, 0)-1;
gecko_path = mshtml_alloc((len+1)*sizeof(WCHAR)+sizeof(wszWineGecko)); gecko_path = heap_alloc((len+1)*sizeof(WCHAR)+sizeof(wszWineGecko));
MultiByteToWideChar(CP_ACP, 0, install_dir, -1, gecko_path, (len+1)*sizeof(WCHAR)); MultiByteToWideChar(CP_ACP, 0, install_dir, -1, gecko_path, (len+1)*sizeof(WCHAR));
if (len && gecko_path[len-1] != '\\') if (len && gecko_path[len-1] != '\\')
...@@ -123,7 +123,7 @@ static void set_registry(LPCSTR install_dir) ...@@ -123,7 +123,7 @@ static void set_registry(LPCSTR install_dir)
size = len*sizeof(WCHAR)+sizeof(wszWineGecko); size = len*sizeof(WCHAR)+sizeof(wszWineGecko);
res = RegSetValueExW(hkey, wszGeckoPath, 0, REG_SZ, (LPVOID)gecko_path, res = RegSetValueExW(hkey, wszGeckoPath, 0, REG_SZ, (LPVOID)gecko_path,
len*sizeof(WCHAR)+sizeof(wszWineGecko)); len*sizeof(WCHAR)+sizeof(wszWineGecko));
mshtml_free(gecko_path); heap_free(gecko_path);
RegCloseKey(hkey); RegCloseKey(hkey);
if(res != ERROR_SUCCESS) if(res != ERROR_SUCCESS)
ERR("Failed to set GeckoPath value: %08x\n", res); ERR("Failed to set GeckoPath value: %08x\n", res);
...@@ -161,13 +161,13 @@ static BOOL install_cab(LPCWSTR file_name) ...@@ -161,13 +161,13 @@ static BOOL install_cab(LPCWSTR file_name)
pExtractFilesA = (typeof(ExtractFilesA)*)GetProcAddress(advpack, "ExtractFiles"); pExtractFilesA = (typeof(ExtractFilesA)*)GetProcAddress(advpack, "ExtractFiles");
len = WideCharToMultiByte(CP_ACP, 0, file_name, -1, NULL, 0, NULL, NULL); len = WideCharToMultiByte(CP_ACP, 0, file_name, -1, NULL, 0, NULL, NULL);
file_name_a = mshtml_alloc(len); file_name_a = heap_alloc(len);
WideCharToMultiByte(CP_ACP, 0, file_name, -1, file_name_a, -1, NULL, NULL); WideCharToMultiByte(CP_ACP, 0, file_name, -1, file_name_a, -1, NULL, NULL);
/* FIXME: Use unicode version (not yet implemented) */ /* FIXME: Use unicode version (not yet implemented) */
hres = pExtractFilesA(file_name_a, install_dir, 0, NULL, NULL, 0); hres = pExtractFilesA(file_name_a, install_dir, 0, NULL, NULL, 0);
FreeLibrary(advpack); FreeLibrary(advpack);
mshtml_free(file_name_a); heap_free(file_name_a);
if(FAILED(hres)) { if(FAILED(hres)) {
ERR("Could not extract package: %08x\n", hres); ERR("Could not extract package: %08x\n", hres);
clean_up(); clean_up();
...@@ -213,7 +213,7 @@ static BOOL install_from_unix_file(const char *file_name) ...@@ -213,7 +213,7 @@ static BOOL install_from_unix_file(const char *file_name)
ret = install_cab(dos_file_name); ret = install_cab(dos_file_name);
mshtml_free(dos_file_name); heap_free(dos_file_name);
return ret; return ret;
} }
...@@ -229,10 +229,10 @@ static BOOL install_from_registered_dir(void) ...@@ -229,10 +229,10 @@ static BOOL install_from_registered_dir(void)
if(res != ERROR_SUCCESS) if(res != ERROR_SUCCESS)
return FALSE; return FALSE;
file_name = mshtml_alloc(size+sizeof(GECKO_FILE_NAME)); file_name = heap_alloc(size+sizeof(GECKO_FILE_NAME));
res = RegQueryValueExA(hkey, "GeckoCabDir", NULL, &type, (PBYTE)file_name, &size); res = RegQueryValueExA(hkey, "GeckoCabDir", NULL, &type, (PBYTE)file_name, &size);
if(res == ERROR_MORE_DATA) { if(res == ERROR_MORE_DATA) {
file_name = mshtml_realloc(file_name, size+sizeof(GECKO_FILE_NAME)); file_name = heap_realloc(file_name, size+sizeof(GECKO_FILE_NAME));
res = RegQueryValueExA(hkey, "GeckoCabDir", NULL, &type, (PBYTE)file_name, &size); res = RegQueryValueExA(hkey, "GeckoCabDir", NULL, &type, (PBYTE)file_name, &size);
} }
RegCloseKey(hkey); RegCloseKey(hkey);
...@@ -245,7 +245,7 @@ static BOOL install_from_registered_dir(void) ...@@ -245,7 +245,7 @@ static BOOL install_from_registered_dir(void)
ret = install_from_unix_file(file_name); ret = install_from_unix_file(file_name);
mshtml_free(file_name); heap_free(file_name);
return ret; return ret;
} }
...@@ -266,14 +266,14 @@ static BOOL install_from_default_dir(void) ...@@ -266,14 +266,14 @@ static BOOL install_from_default_dir(void)
len = strlen(data_dir); len = strlen(data_dir);
len2 = strlen(subdir); len2 = strlen(subdir);
file_name = mshtml_alloc(len+len2+sizeof(GECKO_FILE_NAME)); file_name = heap_alloc(len+len2+sizeof(GECKO_FILE_NAME));
memcpy(file_name, data_dir, len); memcpy(file_name, data_dir, len);
memcpy(file_name+len, subdir, len2); memcpy(file_name+len, subdir, len2);
memcpy(file_name+len+len2, GECKO_FILE_NAME, sizeof(GECKO_FILE_NAME)); memcpy(file_name+len+len2, GECKO_FILE_NAME, sizeof(GECKO_FILE_NAME));
ret = install_from_unix_file(file_name); ret = install_from_unix_file(file_name);
mshtml_free(file_name); heap_free(file_name);
return ret; return ret;
} }
...@@ -307,7 +307,7 @@ static HRESULT WINAPI InstallCallback_OnStartBinding(IBindStatusCallback *iface, ...@@ -307,7 +307,7 @@ static HRESULT WINAPI InstallCallback_OnStartBinding(IBindStatusCallback *iface,
GetTempPathW(sizeof(tmp_dir)/sizeof(WCHAR), tmp_dir); GetTempPathW(sizeof(tmp_dir)/sizeof(WCHAR), tmp_dir);
tmp_file_name = mshtml_alloc(MAX_PATH*sizeof(WCHAR)); tmp_file_name = heap_alloc(MAX_PATH*sizeof(WCHAR));
GetTempFileNameW(tmp_dir, NULL, 0, tmp_file_name); GetTempFileNameW(tmp_dir, NULL, 0, tmp_file_name);
TRACE("creating temp file %s\n", debugstr_w(tmp_file_name)); TRACE("creating temp file %s\n", debugstr_w(tmp_file_name));
...@@ -433,12 +433,12 @@ static LPWSTR get_url(void) ...@@ -433,12 +433,12 @@ static LPWSTR get_url(void)
if(res != ERROR_SUCCESS) if(res != ERROR_SUCCESS)
return NULL; return NULL;
url = mshtml_alloc(size); url = heap_alloc(size);
res = RegQueryValueExW(hkey, wszGeckoUrl, NULL, &type, (LPBYTE)url, &size); res = RegQueryValueExW(hkey, wszGeckoUrl, NULL, &type, (LPBYTE)url, &size);
RegCloseKey(hkey); RegCloseKey(hkey);
if(res != ERROR_SUCCESS || type != REG_SZ) { if(res != ERROR_SUCCESS || type != REG_SZ) {
mshtml_free(url); heap_free(url);
return NULL; return NULL;
} }
...@@ -459,7 +459,7 @@ static DWORD WINAPI download_proc(PVOID arg) ...@@ -459,7 +459,7 @@ static DWORD WINAPI download_proc(PVOID arg)
HRESULT hres; HRESULT hres;
CreateURLMoniker(NULL, url, &mon); CreateURLMoniker(NULL, url, &mon);
mshtml_free(url); heap_free(url);
url = NULL; url = NULL;
CreateAsyncBindCtx(0, &InstallCallback, 0, &bctx); CreateAsyncBindCtx(0, &InstallCallback, 0, &bctx);
......
...@@ -106,11 +106,11 @@ static ULONG WINAPI HtmlLoadOptions_Release(IHtmlLoadOptions *iface) ...@@ -106,11 +106,11 @@ static ULONG WINAPI HtmlLoadOptions_Release(IHtmlLoadOptions *iface)
last = iter; last = iter;
iter = iter->next; iter = iter->next;
mshtml_free(last->buffer); heap_free(last->buffer);
mshtml_free(last); heap_free(last);
} }
mshtml_free(This); heap_free(This);
} }
return ref; return ref;
...@@ -159,13 +159,13 @@ static HRESULT WINAPI HtmlLoadOptions_SetOption(IHtmlLoadOptions *iface, DWORD d ...@@ -159,13 +159,13 @@ static HRESULT WINAPI HtmlLoadOptions_SetOption(IHtmlLoadOptions *iface, DWORD d
} }
if(!iter) { if(!iter) {
iter = mshtml_alloc(sizeof(load_opt)); iter = heap_alloc(sizeof(load_opt));
iter->next = This->opts; iter->next = This->opts;
This->opts = iter; This->opts = iter;
iter->option = dwOption; iter->option = dwOption;
}else { }else {
mshtml_free(iter->buffer); heap_free(iter->buffer);
} }
if(!cbBuf) { if(!cbBuf) {
...@@ -176,7 +176,7 @@ static HRESULT WINAPI HtmlLoadOptions_SetOption(IHtmlLoadOptions *iface, DWORD d ...@@ -176,7 +176,7 @@ static HRESULT WINAPI HtmlLoadOptions_SetOption(IHtmlLoadOptions *iface, DWORD d
} }
iter->size = cbBuf; iter->size = cbBuf;
iter->buffer = mshtml_alloc(cbBuf); iter->buffer = heap_alloc(cbBuf);
memcpy(iter->buffer, pBuffer, iter->size); memcpy(iter->buffer, pBuffer, iter->size);
return S_OK; return S_OK;
...@@ -199,7 +199,7 @@ HRESULT HTMLLoadOptions_Create(IUnknown *pUnkOuter, REFIID riid, void** ppv) ...@@ -199,7 +199,7 @@ HRESULT HTMLLoadOptions_Create(IUnknown *pUnkOuter, REFIID riid, void** ppv)
TRACE("(%p %s %p)\n", pUnkOuter, debugstr_guid(riid), ppv); TRACE("(%p %s %p)\n", pUnkOuter, debugstr_guid(riid), ppv);
ret = mshtml_alloc(sizeof(HTMLLoadOptions)); ret = heap_alloc(sizeof(HTMLLoadOptions));
ret->lpHtmlLoadOptionsVtbl = &HtmlLoadOptionsVtbl; ret->lpHtmlLoadOptionsVtbl = &HtmlLoadOptionsVtbl;
ret->ref = 1; ret->ref = 1;
......
...@@ -103,7 +103,7 @@ static void thread_detach(void) ...@@ -103,7 +103,7 @@ static void thread_detach(void)
if(thread_data->thread_hwnd) if(thread_data->thread_hwnd)
DestroyWindow(thread_data->thread_hwnd); DestroyWindow(thread_data->thread_hwnd);
mshtml_free(thread_data); heap_free(thread_data);
} }
static void process_detach(void) static void process_detach(void)
...@@ -192,7 +192,7 @@ static ULONG WINAPI ClassFactory_Release(IClassFactory *iface) ...@@ -192,7 +192,7 @@ static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
TRACE("(%p) ref = %u\n", This, ref); TRACE("(%p) ref = %u\n", This, ref);
if(!ref) { if(!ref) {
mshtml_free(This); heap_free(This);
UNLOCK_MODULE(); UNLOCK_MODULE();
} }
...@@ -228,7 +228,7 @@ static const IClassFactoryVtbl HTMLClassFactoryVtbl = { ...@@ -228,7 +228,7 @@ static const IClassFactoryVtbl HTMLClassFactoryVtbl = {
static HRESULT ClassFactory_Create(REFIID riid, void **ppv, CreateInstanceFunc fnCreateInstance) static HRESULT ClassFactory_Create(REFIID riid, void **ppv, CreateInstanceFunc fnCreateInstance)
{ {
ClassFactory *ret = mshtml_alloc(sizeof(ClassFactory)); ClassFactory *ret = heap_alloc(sizeof(ClassFactory));
HRESULT hres; HRESULT hres;
ret->lpVtbl = &HTMLClassFactoryVtbl; ret->lpVtbl = &HTMLClassFactoryVtbl;
...@@ -239,7 +239,7 @@ static HRESULT ClassFactory_Create(REFIID riid, void **ppv, CreateInstanceFunc f ...@@ -239,7 +239,7 @@ static HRESULT ClassFactory_Create(REFIID riid, void **ppv, CreateInstanceFunc f
if(SUCCEEDED(hres)) { if(SUCCEEDED(hres)) {
LOCK_MODULE(); LOCK_MODULE();
}else { }else {
mshtml_free(ret); heap_free(ret);
*ppv = NULL; *ppv = NULL;
} }
return hres; return hres;
...@@ -416,7 +416,7 @@ static HRESULT register_server(BOOL do_register) ...@@ -416,7 +416,7 @@ static HRESULT register_server(BOOL do_register)
INF_SET_ID(LIBID_MSHTML); INF_SET_ID(LIBID_MSHTML);
for(i=0; i < sizeof(pse)/sizeof(pse[0]); i++) { for(i=0; i < sizeof(pse)/sizeof(pse[0]); i++) {
pse[i].pszValue = mshtml_alloc(39); pse[i].pszValue = heap_alloc(39);
sprintf(pse[i].pszValue, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", sprintf(pse[i].pszValue, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
clsids[i]->Data1, clsids[i]->Data2, clsids[i]->Data3, clsids[i]->Data4[0], clsids[i]->Data1, clsids[i]->Data2, clsids[i]->Data3, clsids[i]->Data4[0],
clsids[i]->Data4[1], clsids[i]->Data4[2], clsids[i]->Data4[3], clsids[i]->Data4[4], clsids[i]->Data4[1], clsids[i]->Data4[2], clsids[i]->Data4[3], clsids[i]->Data4[4],
...@@ -432,7 +432,7 @@ static HRESULT register_server(BOOL do_register) ...@@ -432,7 +432,7 @@ static HRESULT register_server(BOOL do_register)
hres = pRegInstall(hInst, do_register ? "RegisterDll" : "UnregisterDll", &strtable); hres = pRegInstall(hInst, do_register ? "RegisterDll" : "UnregisterDll", &strtable);
for(i=0; i < sizeof(pse)/sizeof(pse[0]); i++) for(i=0; i < sizeof(pse)/sizeof(pse[0]); i++)
mshtml_free(pse[i].pszValue); heap_free(pse[i].pszValue);
if(FAILED(hres)) { if(FAILED(hres)) {
ERR("RegInstall failed: %08x\n", hres); ERR("RegInstall failed: %08x\n", hres);
......
...@@ -541,22 +541,22 @@ extern LONG module_ref; ...@@ -541,22 +541,22 @@ extern LONG module_ref;
/* memory allocation functions */ /* memory allocation functions */
static inline void *mshtml_alloc(size_t len) static inline void *heap_alloc(size_t len)
{ {
return HeapAlloc(GetProcessHeap(), 0, len); return HeapAlloc(GetProcessHeap(), 0, len);
} }
static inline void *mshtml_alloc_zero(size_t len) static inline void *heap_alloc_zero(size_t len)
{ {
return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len); return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
} }
static inline void *mshtml_realloc(void *mem, size_t len) static inline void *heap_realloc(void *mem, size_t len)
{ {
return HeapReAlloc(GetProcessHeap(), 0, mem, len); return HeapReAlloc(GetProcessHeap(), 0, mem, len);
} }
static inline BOOL mshtml_free(void *mem) static inline BOOL heap_free(void *mem)
{ {
return HeapFree(GetProcessHeap(), 0, mem); return HeapFree(GetProcessHeap(), 0, mem);
} }
......
...@@ -88,7 +88,7 @@ static nsrefcnt NSAPI nsInputStream_Release(nsIInputStream *iface) ...@@ -88,7 +88,7 @@ static nsrefcnt NSAPI nsInputStream_Release(nsIInputStream *iface)
TRACE("(%p) ref=%d\n", This, ref); TRACE("(%p) ref=%d\n", This, ref);
if(!ref) if(!ref)
mshtml_free(This); heap_free(This);
return ref; return ref;
} }
...@@ -176,7 +176,7 @@ static const nsIInputStreamVtbl nsInputStreamVtbl = { ...@@ -176,7 +176,7 @@ static const nsIInputStreamVtbl nsInputStreamVtbl = {
static nsProtocolStream *create_nsprotocol_stream(void) static nsProtocolStream *create_nsprotocol_stream(void)
{ {
nsProtocolStream *ret = mshtml_alloc(sizeof(nsProtocolStream)); nsProtocolStream *ret = heap_alloc(sizeof(nsProtocolStream));
ret->lpInputStreamVtbl = &nsInputStreamVtbl; ret->lpInputStreamVtbl = &nsInputStreamVtbl;
ret->ref = 1; ret->ref = 1;
...@@ -212,7 +212,7 @@ static HRESULT read_stream_data(BSCallback *This, IStream *stream) ...@@ -212,7 +212,7 @@ static HRESULT read_stream_data(BSCallback *This, IStream *stream)
break; break;
if(!This->readed && This->nsstream->buf_size >= 2 && *(WORD*)This->nsstream->buf == 0xfeff) { if(!This->readed && This->nsstream->buf_size >= 2 && *(WORD*)This->nsstream->buf == 0xfeff) {
This->nschannel->charset = mshtml_alloc(sizeof(UTF16_STR)); This->nschannel->charset = heap_alloc(sizeof(UTF16_STR));
memcpy(This->nschannel->charset, UTF16_STR, sizeof(UTF16_STR)); memcpy(This->nschannel->charset, UTF16_STR, sizeof(UTF16_STR));
} }
...@@ -330,8 +330,8 @@ static ULONG WINAPI BindStatusCallback_Release(IBindStatusCallback *iface) ...@@ -330,8 +330,8 @@ static ULONG WINAPI BindStatusCallback_Release(IBindStatusCallback *iface)
if(This->binding) if(This->binding)
IBinding_Release(This->binding); IBinding_Release(This->binding);
list_remove(&This->entry); list_remove(&This->entry);
mshtml_free(This->headers); heap_free(This->headers);
mshtml_free(This); heap_free(This);
} }
return ref; return ref;
...@@ -383,10 +383,10 @@ static HRESULT WINAPI BindStatusCallback_OnProgress(IBindStatusCallback *iface, ...@@ -383,10 +383,10 @@ static HRESULT WINAPI BindStatusCallback_OnProgress(IBindStatusCallback *iface,
if(!This->nschannel) if(!This->nschannel)
return S_OK; return S_OK;
mshtml_free(This->nschannel->content); heap_free(This->nschannel->content);
len = WideCharToMultiByte(CP_ACP, 0, szStatusText, -1, NULL, 0, NULL, NULL); len = WideCharToMultiByte(CP_ACP, 0, szStatusText, -1, NULL, 0, NULL, NULL);
This->nschannel->content = mshtml_alloc(len*sizeof(WCHAR)); This->nschannel->content = heap_alloc(len*sizeof(WCHAR));
WideCharToMultiByte(CP_ACP, 0, szStatusText, -1, This->nschannel->content, -1, NULL, NULL); WideCharToMultiByte(CP_ACP, 0, szStatusText, -1, This->nschannel->content, -1, NULL, NULL);
} }
} }
...@@ -425,7 +425,7 @@ static HRESULT WINAPI BindStatusCallback_OnStopBinding(IBindStatusCallback *ifac ...@@ -425,7 +425,7 @@ static HRESULT WINAPI BindStatusCallback_OnStopBinding(IBindStatusCallback *ifac
return S_OK; return S_OK;
if(This->doc && This->doc->bscallback == This && !This->doc->nscontainer) { if(This->doc && This->doc->bscallback == This && !This->doc->nscontainer) {
task_t *task = mshtml_alloc(sizeof(task_t)); task_t *task = heap_alloc(sizeof(task_t));
task->doc = This->doc; task->doc = This->doc;
task->task_id = TASK_PARSECOMPLETE; task->task_id = TASK_PARSECOMPLETE;
...@@ -662,7 +662,7 @@ static const IServiceProviderVtbl ServiceProviderVtbl = { ...@@ -662,7 +662,7 @@ static const IServiceProviderVtbl ServiceProviderVtbl = {
BSCallback *create_bscallback(IMoniker *mon) BSCallback *create_bscallback(IMoniker *mon)
{ {
BSCallback *ret = mshtml_alloc(sizeof(BSCallback)); BSCallback *ret = heap_alloc(sizeof(BSCallback));
ret->lpBindStatusCallbackVtbl = &BindStatusCallbackVtbl; ret->lpBindStatusCallbackVtbl = &BindStatusCallbackVtbl;
ret->lpServiceProviderVtbl = &ServiceProviderVtbl; ret->lpServiceProviderVtbl = &ServiceProviderVtbl;
...@@ -750,9 +750,9 @@ static void parse_post_data(nsIInputStream *post_data_stream, LPWSTR *headers_re ...@@ -750,9 +750,9 @@ static void parse_post_data(nsIInputStream *post_data_stream, LPWSTR *headers_re
len = MultiByteToWideChar(CP_ACP, 0, ptr2, ptr-ptr2, NULL, 0); len = MultiByteToWideChar(CP_ACP, 0, ptr2, ptr-ptr2, NULL, 0);
if(headers) if(headers)
headers = mshtml_realloc(headers,(headers_len+len+1)*sizeof(WCHAR)); headers = heap_realloc(headers,(headers_len+len+1)*sizeof(WCHAR));
else else
headers = mshtml_alloc((len+1)*sizeof(WCHAR)); headers = heap_alloc((len+1)*sizeof(WCHAR));
len = MultiByteToWideChar(CP_ACP, 0, ptr2, ptr-ptr2, headers+headers_len, -1); len = MultiByteToWideChar(CP_ACP, 0, ptr2, ptr-ptr2, headers+headers_len, -1);
headers_len += len; headers_len += len;
...@@ -895,7 +895,7 @@ HRESULT load_stream(BSCallback *bscallback, IStream *stream) ...@@ -895,7 +895,7 @@ HRESULT load_stream(BSCallback *bscallback, IStream *stream)
add_nsrequest(bscallback); add_nsrequest(bscallback);
if(bscallback->nschannel) { if(bscallback->nschannel) {
bscallback->nschannel->content = mshtml_alloc(sizeof(text_html)); bscallback->nschannel->content = heap_alloc(sizeof(text_html));
memcpy(bscallback->nschannel->content, text_html, sizeof(text_html)); memcpy(bscallback->nschannel->content, text_html, sizeof(text_html));
} }
......
...@@ -874,7 +874,7 @@ static nsrefcnt NSAPI nsWebBrowserChrome_Release(nsIWebBrowserChrome *iface) ...@@ -874,7 +874,7 @@ static nsrefcnt NSAPI nsWebBrowserChrome_Release(nsIWebBrowserChrome *iface)
if(!ref) { if(!ref) {
if(This->parent) if(This->parent)
nsIWebBrowserChrome_Release(NSWBCHROME(This->parent)); nsIWebBrowserChrome_Release(NSWBCHROME(This->parent));
mshtml_free(This); heap_free(This);
} }
return ref; return ref;
...@@ -1558,7 +1558,7 @@ NSContainer *NSContainer_Create(HTMLDocument *doc, NSContainer *parent) ...@@ -1558,7 +1558,7 @@ NSContainer *NSContainer_Create(HTMLDocument *doc, NSContainer *parent)
if(!load_gecko(FALSE)) if(!load_gecko(FALSE))
return NULL; return NULL;
ret = mshtml_alloc(sizeof(NSContainer)); ret = heap_alloc(sizeof(NSContainer));
ret->lpWebBrowserChromeVtbl = &nsWebBrowserChromeVtbl; ret->lpWebBrowserChromeVtbl = &nsWebBrowserChromeVtbl;
ret->lpContextMenuListenerVtbl = &nsContextMenuListenerVtbl; ret->lpContextMenuListenerVtbl = &nsContextMenuListenerVtbl;
......
...@@ -146,7 +146,7 @@ static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event ...@@ -146,7 +146,7 @@ static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event
if(This->doc->usermode == EDITMODE) if(This->doc->usermode == EDITMODE)
handle_edit_load(This->doc); handle_edit_load(This->doc);
task = mshtml_alloc(sizeof(task_t)); task = heap_alloc(sizeof(task_t));
task->doc = This->doc; task->doc = This->doc;
task->task_id = TASK_PARSECOMPLETE; task->task_id = TASK_PARSECOMPLETE;
......
...@@ -204,9 +204,9 @@ static nsrefcnt NSAPI nsChannel_Release(nsIHttpChannel *iface) ...@@ -204,9 +204,9 @@ static nsrefcnt NSAPI nsChannel_Release(nsIHttpChannel *iface)
nsIInterfaceRequestor_Release(This->notif_callback); nsIInterfaceRequestor_Release(This->notif_callback);
if(This->original_uri) if(This->original_uri)
nsIURI_Release(This->original_uri); nsIURI_Release(This->original_uri);
mshtml_free(This->content); heap_free(This->content);
mshtml_free(This->charset); heap_free(This->charset);
mshtml_free(This); heap_free(This);
} }
return ref; return ref;
...@@ -735,7 +735,7 @@ static nsresult async_open(nsChannel *This, NSContainer *container, nsIStreamLis ...@@ -735,7 +735,7 @@ static nsresult async_open(nsChannel *This, NSContainer *container, nsIStreamLis
bscallback->nscontext = context; bscallback->nscontext = context;
} }
task = mshtml_alloc(sizeof(task_t)); task = heap_alloc(sizeof(task_t));
task->doc = container->doc; task->doc = container->doc;
task->task_id = TASK_START_BINDING; task->task_id = TASK_START_BINDING;
...@@ -1190,8 +1190,8 @@ static nsrefcnt NSAPI nsURI_Release(nsIWineURI *iface) ...@@ -1190,8 +1190,8 @@ static nsrefcnt NSAPI nsURI_Release(nsIWineURI *iface)
nsIWebBrowserChrome_Release(NSWBCHROME(This->container)); nsIWebBrowserChrome_Release(NSWBCHROME(This->container));
if(This->uri) if(This->uri)
nsIURI_Release(This->uri); nsIURI_Release(This->uri);
mshtml_free(This->wine_url); heap_free(This->wine_url);
mshtml_free(This); heap_free(This);
} }
return ref; return ref;
...@@ -1655,11 +1655,11 @@ static nsresult NSAPI nsURI_SetWineURL(nsIWineURI *iface, LPCWSTR aURL) ...@@ -1655,11 +1655,11 @@ static nsresult NSAPI nsURI_SetWineURL(nsIWineURI *iface, LPCWSTR aURL)
TRACE("(%p)->(%s)\n", This, debugstr_w(aURL)); TRACE("(%p)->(%s)\n", This, debugstr_w(aURL));
mshtml_free(This->wine_url); heap_free(This->wine_url);
if(aURL) { if(aURL) {
int len = strlenW(aURL)+1; int len = strlenW(aURL)+1;
This->wine_url = mshtml_alloc(len*sizeof(WCHAR)); This->wine_url = heap_alloc(len*sizeof(WCHAR));
memcpy(This->wine_url, aURL, len*sizeof(WCHAR)); memcpy(This->wine_url, aURL, len*sizeof(WCHAR));
/* FIXME: Always use wine url */ /* FIXME: Always use wine url */
...@@ -1717,7 +1717,7 @@ static const nsIWineURIVtbl nsWineURIVtbl = { ...@@ -1717,7 +1717,7 @@ static const nsIWineURIVtbl nsWineURIVtbl = {
static nsresult create_uri(nsIURI *uri, NSContainer *container, nsIWineURI **_retval) static nsresult create_uri(nsIURI *uri, NSContainer *container, nsIWineURI **_retval)
{ {
nsURI *ret = mshtml_alloc(sizeof(nsURI)); nsURI *ret = heap_alloc(sizeof(nsURI));
ret->lpWineURIVtbl = &nsWineURIVtbl; ret->lpWineURIVtbl = &nsWineURIVtbl;
ret->ref = 1; ret->ref = 1;
...@@ -1794,7 +1794,7 @@ static nsrefcnt NSAPI nsProtocolHandler_Release(nsIProtocolHandler *iface) ...@@ -1794,7 +1794,7 @@ static nsrefcnt NSAPI nsProtocolHandler_Release(nsIProtocolHandler *iface)
if(!ref) { if(!ref) {
if(This->nshandler) if(This->nshandler)
nsIProtocolHandler_Release(This->nshandler); nsIProtocolHandler_Release(This->nshandler);
mshtml_free(This); heap_free(This);
} }
return ref; return ref;
...@@ -1887,7 +1887,7 @@ static const nsIProtocolHandlerVtbl nsProtocolHandlerVtbl = { ...@@ -1887,7 +1887,7 @@ static const nsIProtocolHandlerVtbl nsProtocolHandlerVtbl = {
static nsIProtocolHandler *create_protocol_handler(nsIProtocolHandler *nshandler) static nsIProtocolHandler *create_protocol_handler(nsIProtocolHandler *nshandler)
{ {
nsProtocolHandler *ret = mshtml_alloc(sizeof(nsProtocolHandler)); nsProtocolHandler *ret = heap_alloc(sizeof(nsProtocolHandler));
ret->lpProtocolHandlerVtbl = &nsProtocolHandlerVtbl; ret->lpProtocolHandlerVtbl = &nsProtocolHandlerVtbl;
ret->ref = 1; ret->ref = 1;
...@@ -2092,7 +2092,7 @@ static nsresult NSAPI nsIOService_NewChannelFromURI(nsIIOService *iface, nsIURI ...@@ -2092,7 +2092,7 @@ static nsresult NSAPI nsIOService_NewChannelFromURI(nsIIOService *iface, nsIURI
return channel ? NS_OK : NS_ERROR_UNEXPECTED; return channel ? NS_OK : NS_ERROR_UNEXPECTED;
} }
ret = mshtml_alloc(sizeof(nsChannel)); ret = heap_alloc(sizeof(nsChannel));
ret->lpHttpChannelVtbl = &nsChannelVtbl; ret->lpHttpChannelVtbl = &nsChannelVtbl;
ret->lpUploadChannelVtbl = &nsUploadChannelVtbl; ret->lpUploadChannelVtbl = &nsUploadChannelVtbl;
......
...@@ -136,7 +136,7 @@ static nsIInputStream *get_post_data_stream(IBindCtx *bctx) ...@@ -136,7 +136,7 @@ static nsIInputStream *get_post_data_stream(IBindCtx *bctx)
static const char content_length[] = "Content-Length: %u\r\n\r\n"; static const char content_length[] = "Content-Length: %u\r\n\r\n";
data = mshtml_alloc(headers_len+post_len+sizeof(content_length)+8); data = heap_alloc(headers_len+post_len+sizeof(content_length)+8);
if(headers_len) { if(headers_len) {
WideCharToMultiByte(CP_ACP, 0, headers, -1, data, -1, NULL, NULL); WideCharToMultiByte(CP_ACP, 0, headers, -1, data, -1, NULL, NULL);
...@@ -281,7 +281,7 @@ static HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, BO ...@@ -281,7 +281,7 @@ static HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, BO
bscallback = create_bscallback(mon); bscallback = create_bscallback(mon);
if(This->frame) { if(This->frame) {
task = mshtml_alloc(sizeof(task_t)); task = heap_alloc(sizeof(task_t));
task->doc = This; task->doc = This;
task->task_id = TASK_SETPROGRESS; task->task_id = TASK_SETPROGRESS;
...@@ -290,7 +290,7 @@ static HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, BO ...@@ -290,7 +290,7 @@ static HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, BO
push_task(task); push_task(task);
} }
task = mshtml_alloc(sizeof(task_t)); task = heap_alloc(sizeof(task_t));
task->doc = This; task->doc = This;
task->task_id = TASK_SETDOWNLOADSTATE; task->task_id = TASK_SETDOWNLOADSTATE;
...@@ -366,7 +366,7 @@ static HRESULT get_doc_string(HTMLDocument *This, char **str, DWORD *len) ...@@ -366,7 +366,7 @@ static HRESULT get_doc_string(HTMLDocument *This, char **str, DWORD *len)
TRACE("%s\n", debugstr_w(strw)); TRACE("%s\n", debugstr_w(strw));
*len = WideCharToMultiByte(CP_ACP, 0, strw, -1, NULL, 0, NULL, NULL); *len = WideCharToMultiByte(CP_ACP, 0, strw, -1, NULL, 0, NULL, NULL);
*str = mshtml_alloc(*len); *str = heap_alloc(*len);
WideCharToMultiByte(CP_ACP, 0, strw, -1, *str, *len, NULL, NULL); WideCharToMultiByte(CP_ACP, 0, strw, -1, *str, *len, NULL, NULL);
nsAString_Finish(&nsstr); nsAString_Finish(&nsstr);
...@@ -700,7 +700,7 @@ static HRESULT WINAPI PersistStreamInit_Save(IPersistStreamInit *iface, LPSTREAM ...@@ -700,7 +700,7 @@ static HRESULT WINAPI PersistStreamInit_Save(IPersistStreamInit *iface, LPSTREAM
if(FAILED(hres)) if(FAILED(hres))
FIXME("Write failed: %08x\n", hres); FIXME("Write failed: %08x\n", hres);
mshtml_free(str); heap_free(str);
return S_OK; return S_OK;
} }
......
...@@ -213,8 +213,8 @@ static ULONG WINAPI AboutProtocol_Release(IInternetProtocol *iface) ...@@ -213,8 +213,8 @@ static ULONG WINAPI AboutProtocol_Release(IInternetProtocol *iface)
TRACE("(%p) ref=%x\n", iface, ref); TRACE("(%p) ref=%x\n", iface, ref);
if(!ref) { if(!ref) {
mshtml_free(This->data); heap_free(This->data);
mshtml_free(This); heap_free(This);
UNLOCK_MODULE(); UNLOCK_MODULE();
} }
...@@ -259,7 +259,7 @@ static HRESULT WINAPI AboutProtocol_Start(IInternetProtocol *iface, LPCWSTR szUr ...@@ -259,7 +259,7 @@ static HRESULT WINAPI AboutProtocol_Start(IInternetProtocol *iface, LPCWSTR szUr
This->data_len = sizeof(html_begin)+sizeof(html_end)-sizeof(WCHAR) This->data_len = sizeof(html_begin)+sizeof(html_end)-sizeof(WCHAR)
+ (text ? strlenW(text)*sizeof(WCHAR) : 0); + (text ? strlenW(text)*sizeof(WCHAR) : 0);
This->data = mshtml_alloc(This->data_len); This->data = heap_alloc(This->data_len);
memcpy(This->data, html_begin, sizeof(html_begin)); memcpy(This->data, html_begin, sizeof(html_begin));
if(text) if(text)
...@@ -387,7 +387,7 @@ static HRESULT WINAPI AboutProtocolFactory_CreateInstance(IClassFactory *iface, ...@@ -387,7 +387,7 @@ static HRESULT WINAPI AboutProtocolFactory_CreateInstance(IClassFactory *iface,
TRACE("(%p)->(%p %s %p)\n", iface, pUnkOuter, debugstr_guid(riid), ppv); TRACE("(%p)->(%p %s %p)\n", iface, pUnkOuter, debugstr_guid(riid), ppv);
ret = mshtml_alloc(sizeof(AboutProtocol)); ret = heap_alloc(sizeof(AboutProtocol));
ret->lpInternetProtocolVtbl = &AboutProtocolVtbl; ret->lpInternetProtocolVtbl = &AboutProtocolVtbl;
ret->ref = 0; ret->ref = 0;
...@@ -409,7 +409,7 @@ static HRESULT WINAPI AboutProtocolFactory_CreateInstance(IClassFactory *iface, ...@@ -409,7 +409,7 @@ static HRESULT WINAPI AboutProtocolFactory_CreateInstance(IClassFactory *iface,
if(SUCCEEDED(hres)) if(SUCCEEDED(hres))
LOCK_MODULE(); LOCK_MODULE();
else else
mshtml_free(ret); heap_free(ret);
return hres; return hres;
} }
...@@ -542,8 +542,8 @@ static ULONG WINAPI ResProtocol_Release(IInternetProtocol *iface) ...@@ -542,8 +542,8 @@ static ULONG WINAPI ResProtocol_Release(IInternetProtocol *iface)
TRACE("(%p) ref=%x\n", iface, ref); TRACE("(%p) ref=%x\n", iface, ref);
if(!ref) { if(!ref) {
mshtml_free(This->data); heap_free(This->data);
mshtml_free(This); heap_free(This);
UNLOCK_MODULE(); UNLOCK_MODULE();
} }
...@@ -573,11 +573,11 @@ static HRESULT WINAPI ResProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl, ...@@ -573,11 +573,11 @@ static HRESULT WINAPI ResProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl,
ReleaseBindInfo(&bindinfo); ReleaseBindInfo(&bindinfo);
len = strlenW(szUrl)+16; len = strlenW(szUrl)+16;
url = mshtml_alloc(len*sizeof(WCHAR)); url = heap_alloc(len*sizeof(WCHAR));
hres = CoInternetParseUrl(szUrl, PARSE_ENCODE, 0, url, len, &len, 0); hres = CoInternetParseUrl(szUrl, PARSE_ENCODE, 0, url, len, &len, 0);
if(FAILED(hres)) { if(FAILED(hres)) {
WARN("CoInternetParseUrl failed: %08x\n", hres); WARN("CoInternetParseUrl failed: %08x\n", hres);
mshtml_free(url); heap_free(url);
IInternetProtocolSink_ReportResult(pOIProtSink, hres, 0, NULL); IInternetProtocolSink_ReportResult(pOIProtSink, hres, 0, NULL);
return hres; return hres;
} }
...@@ -585,7 +585,7 @@ static HRESULT WINAPI ResProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl, ...@@ -585,7 +585,7 @@ static HRESULT WINAPI ResProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl,
if(len < sizeof(wszRes)/sizeof(wszRes[0]) || memcmp(url, wszRes, sizeof(wszRes))) { if(len < sizeof(wszRes)/sizeof(wszRes[0]) || memcmp(url, wszRes, sizeof(wszRes))) {
WARN("Wrong protocol of url: %s\n", debugstr_w(url)); WARN("Wrong protocol of url: %s\n", debugstr_w(url));
IInternetProtocolSink_ReportResult(pOIProtSink, E_INVALIDARG, 0, NULL); IInternetProtocolSink_ReportResult(pOIProtSink, E_INVALIDARG, 0, NULL);
mshtml_free(url); heap_free(url);
return E_INVALIDARG; return E_INVALIDARG;
} }
...@@ -593,7 +593,7 @@ static HRESULT WINAPI ResProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl, ...@@ -593,7 +593,7 @@ static HRESULT WINAPI ResProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl,
if(!(url_file = strrchrW(url_dll, '/'))) { if(!(url_file = strrchrW(url_dll, '/'))) {
WARN("wrong url: %s\n", debugstr_w(url)); WARN("wrong url: %s\n", debugstr_w(url));
IInternetProtocolSink_ReportResult(pOIProtSink, MK_E_SYNTAX, 0, NULL); IInternetProtocolSink_ReportResult(pOIProtSink, MK_E_SYNTAX, 0, NULL);
mshtml_free(url); heap_free(url);
return MK_E_SYNTAX; return MK_E_SYNTAX;
} }
...@@ -602,7 +602,7 @@ static HRESULT WINAPI ResProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl, ...@@ -602,7 +602,7 @@ static HRESULT WINAPI ResProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl,
if(!hdll) { if(!hdll) {
WARN("Could not open dll: %s\n", debugstr_w(url_dll)); WARN("Could not open dll: %s\n", debugstr_w(url_dll));
IInternetProtocolSink_ReportResult(pOIProtSink, HRESULT_FROM_WIN32(GetLastError()), 0, NULL); IInternetProtocolSink_ReportResult(pOIProtSink, HRESULT_FROM_WIN32(GetLastError()), 0, NULL);
mshtml_free(url); heap_free(url);
return HRESULT_FROM_WIN32(GetLastError()); return HRESULT_FROM_WIN32(GetLastError());
} }
...@@ -617,25 +617,25 @@ static HRESULT WINAPI ResProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl, ...@@ -617,25 +617,25 @@ static HRESULT WINAPI ResProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl,
WARN("Could not find resource\n"); WARN("Could not find resource\n");
IInternetProtocolSink_ReportResult(pOIProtSink, IInternetProtocolSink_ReportResult(pOIProtSink,
HRESULT_FROM_WIN32(GetLastError()), 0, NULL); HRESULT_FROM_WIN32(GetLastError()), 0, NULL);
mshtml_free(url); heap_free(url);
return HRESULT_FROM_WIN32(GetLastError()); return HRESULT_FROM_WIN32(GetLastError());
} }
} }
if(This->data) { if(This->data) {
WARN("data already loaded\n"); WARN("data already loaded\n");
mshtml_free(This->data); heap_free(This->data);
} }
This->data_len = SizeofResource(hdll, src); This->data_len = SizeofResource(hdll, src);
This->data = mshtml_alloc(This->data_len); This->data = heap_alloc(This->data_len);
memcpy(This->data, LoadResource(hdll, src), This->data_len); memcpy(This->data, LoadResource(hdll, src), This->data_len);
This->cur = 0; This->cur = 0;
FreeLibrary(hdll); FreeLibrary(hdll);
hres = FindMimeFromData(NULL, url_file, NULL, 0, NULL, 0, &mime, 0); hres = FindMimeFromData(NULL, url_file, NULL, 0, NULL, 0, &mime, 0);
mshtml_free(url); heap_free(url);
if(SUCCEEDED(hres)) { if(SUCCEEDED(hres)) {
IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_MIMETYPEAVAILABLE, mime); IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_MIMETYPEAVAILABLE, mime);
CoTaskMemFree(mime); CoTaskMemFree(mime);
...@@ -763,7 +763,7 @@ static HRESULT WINAPI ResProtocolFactory_CreateInstance(IClassFactory *iface, IU ...@@ -763,7 +763,7 @@ static HRESULT WINAPI ResProtocolFactory_CreateInstance(IClassFactory *iface, IU
TRACE("(%p)->(%p %s %p)\n", iface, pUnkOuter, debugstr_guid(riid), ppv); TRACE("(%p)->(%p %s %p)\n", iface, pUnkOuter, debugstr_guid(riid), ppv);
ret = mshtml_alloc(sizeof(ResProtocol)); ret = heap_alloc(sizeof(ResProtocol));
ret->lpInternetProtocolVtbl = &ResProtocolVtbl; ret->lpInternetProtocolVtbl = &ResProtocolVtbl;
ret->ref = 0; ret->ref = 0;
ret->data = NULL; ret->data = NULL;
...@@ -784,7 +784,7 @@ static HRESULT WINAPI ResProtocolFactory_CreateInstance(IClassFactory *iface, IU ...@@ -784,7 +784,7 @@ static HRESULT WINAPI ResProtocolFactory_CreateInstance(IClassFactory *iface, IU
if(SUCCEEDED(hres)) if(SUCCEEDED(hres))
LOCK_MODULE(); LOCK_MODULE();
else else
mshtml_free(ret); heap_free(ret);
return hres; return hres;
} }
......
...@@ -100,7 +100,7 @@ static ULONG WINAPI HTMLSelectionObject_Release(IHTMLSelectionObject *iface) ...@@ -100,7 +100,7 @@ static ULONG WINAPI HTMLSelectionObject_Release(IHTMLSelectionObject *iface)
nsISelection_Release(This->nsselection); nsISelection_Release(This->nsselection);
if(This->doc) if(This->doc)
list_remove(&This->entry); list_remove(&This->entry);
mshtml_free(This); heap_free(This);
} }
return ref; return ref;
...@@ -243,7 +243,7 @@ static const IHTMLSelectionObjectVtbl HTMLSelectionObjectVtbl = { ...@@ -243,7 +243,7 @@ static const IHTMLSelectionObjectVtbl HTMLSelectionObjectVtbl = {
IHTMLSelectionObject *HTMLSelectionObject_Create(HTMLDocument *doc, nsISelection *nsselection) IHTMLSelectionObject *HTMLSelectionObject_Create(HTMLDocument *doc, nsISelection *nsselection)
{ {
HTMLSelectionObject *ret = mshtml_alloc(sizeof(HTMLSelectionObject)); HTMLSelectionObject *ret = heap_alloc(sizeof(HTMLSelectionObject));
ret->lpHTMLSelectionObjectVtbl = &HTMLSelectionObjectVtbl; ret->lpHTMLSelectionObjectVtbl = &HTMLSelectionObjectVtbl;
ret->ref = 1; ret->ref = 1;
......
...@@ -81,7 +81,7 @@ static ULONG WINAPI OleUndoManager_Release(IOleUndoManager *iface) ...@@ -81,7 +81,7 @@ static ULONG WINAPI OleUndoManager_Release(IOleUndoManager *iface)
TRACE("(%p) ref=%d\n", This, ref); TRACE("(%p) ref=%d\n", This, ref);
if(!ref) if(!ref)
mshtml_free(This); heap_free(This);
return ref; return ref;
} }
...@@ -195,7 +195,7 @@ static const IOleUndoManagerVtbl OleUndoManagerVtbl = { ...@@ -195,7 +195,7 @@ static const IOleUndoManagerVtbl OleUndoManagerVtbl = {
static IOleUndoManager *create_undomgr(void) static IOleUndoManager *create_undomgr(void)
{ {
UndoManager *ret = mshtml_alloc(sizeof(UndoManager)); UndoManager *ret = heap_alloc(sizeof(UndoManager));
ret->lpOleUndoManagerVtbl = &OleUndoManagerVtbl; ret->lpOleUndoManagerVtbl = &OleUndoManagerVtbl;
ret->ref = 1; ret->ref = 1;
......
...@@ -82,7 +82,7 @@ void remove_doc_tasks(const HTMLDocument *doc) ...@@ -82,7 +82,7 @@ void remove_doc_tasks(const HTMLDocument *doc)
while(iter->next && iter->next->doc == doc) { while(iter->next && iter->next->doc == doc) {
tmp = iter->next; tmp = iter->next;
iter->next = tmp->next; iter->next = tmp->next;
mshtml_free(tmp); heap_free(tmp);
} }
if(!iter->next) if(!iter->next)
...@@ -248,7 +248,7 @@ static LRESULT WINAPI hidden_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa ...@@ -248,7 +248,7 @@ static LRESULT WINAPI hidden_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
break; break;
process_task(task); process_task(task);
mshtml_free(task); heap_free(task);
} }
return 0; return 0;
...@@ -305,7 +305,7 @@ thread_data_t *get_thread_data(BOOL create) ...@@ -305,7 +305,7 @@ thread_data_t *get_thread_data(BOOL create)
thread_data = TlsGetValue(mshtml_tls); thread_data = TlsGetValue(mshtml_tls);
if(!thread_data && create) { if(!thread_data && create) {
thread_data = mshtml_alloc_zero(sizeof(thread_data_t)); thread_data = heap_alloc_zero(sizeof(thread_data_t));
TlsSetValue(mshtml_tls, thread_data); TlsSetValue(mshtml_tls, thread_data);
} }
......
...@@ -160,20 +160,20 @@ static inline void wstrbuf_init(wstrbuf_t *buf) ...@@ -160,20 +160,20 @@ static inline void wstrbuf_init(wstrbuf_t *buf)
{ {
buf->len = 0; buf->len = 0;
buf->size = 16; buf->size = 16;
buf->buf = mshtml_alloc(buf->size * sizeof(WCHAR)); buf->buf = heap_alloc(buf->size * sizeof(WCHAR));
*buf->buf = 0; *buf->buf = 0;
} }
static inline void wstrbuf_finish(wstrbuf_t *buf) static inline void wstrbuf_finish(wstrbuf_t *buf)
{ {
mshtml_free(buf->buf); heap_free(buf->buf);
} }
static void wstrbuf_append_len(wstrbuf_t *buf, LPCWSTR str, int len) static void wstrbuf_append_len(wstrbuf_t *buf, LPCWSTR str, int len)
{ {
if(buf->len+len >= buf->size) { if(buf->len+len >= buf->size) {
buf->size = 2*buf->len+len; buf->size = 2*buf->len+len;
buf->buf = mshtml_realloc(buf->buf, buf->size * sizeof(WCHAR)); buf->buf = heap_realloc(buf->buf, buf->size * sizeof(WCHAR));
} }
memcpy(buf->buf+buf->len, str, len*sizeof(WCHAR)); memcpy(buf->buf+buf->len, str, len*sizeof(WCHAR));
...@@ -195,7 +195,7 @@ static void wstrbuf_append_nodetxt(wstrbuf_t *buf, LPCWSTR str, int len) ...@@ -195,7 +195,7 @@ static void wstrbuf_append_nodetxt(wstrbuf_t *buf, LPCWSTR str, int len)
if(buf->len+len >= buf->size) { if(buf->len+len >= buf->size) {
buf->size = 2*buf->len+len; buf->size = 2*buf->len+len;
buf->buf = mshtml_realloc(buf->buf, buf->size * sizeof(WCHAR)); buf->buf = heap_realloc(buf->buf, buf->size * sizeof(WCHAR));
} }
if(buf->len && isspaceW(buf->buf[buf->len-1])) { if(buf->len && isspaceW(buf->buf[buf->len-1])) {
...@@ -979,7 +979,7 @@ static ULONG WINAPI HTMLTxtRange_Release(IHTMLTxtRange *iface) ...@@ -979,7 +979,7 @@ static ULONG WINAPI HTMLTxtRange_Release(IHTMLTxtRange *iface)
nsISelection_Release(This->nsrange); nsISelection_Release(This->nsrange);
if(This->doc) if(This->doc)
list_remove(&This->entry); list_remove(&This->entry);
mshtml_free(This); heap_free(This);
} }
return ref; return ref;
...@@ -1757,7 +1757,7 @@ static const IOleCommandTargetVtbl OleCommandTargetVtbl = { ...@@ -1757,7 +1757,7 @@ static const IOleCommandTargetVtbl OleCommandTargetVtbl = {
IHTMLTxtRange *HTMLTxtRange_Create(HTMLDocument *doc, nsIDOMRange *nsrange) IHTMLTxtRange *HTMLTxtRange_Create(HTMLDocument *doc, nsIDOMRange *nsrange)
{ {
HTMLTxtRange *ret = mshtml_alloc(sizeof(HTMLTxtRange)); HTMLTxtRange *ret = heap_alloc(sizeof(HTMLTxtRange));
ret->lpHTMLTxtRangeVtbl = &HTMLTxtRangeVtbl; ret->lpHTMLTxtRangeVtbl = &HTMLTxtRangeVtbl;
ret->lpOleCommandTargetVtbl = &OleCommandTargetVtbl; ret->lpOleCommandTargetVtbl = &OleCommandTargetVtbl;
......
...@@ -368,7 +368,7 @@ static LRESULT WINAPI tooltips_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l ...@@ -368,7 +368,7 @@ static LRESULT WINAPI tooltips_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
static void create_tooltips_window(HTMLDocument *This) static void create_tooltips_window(HTMLDocument *This)
{ {
tooltip_data *data = mshtml_alloc(sizeof(*data)); tooltip_data *data = heap_alloc(sizeof(*data));
This->tooltips_hwnd = CreateWindowExW(0, TOOLTIPS_CLASSW, NULL, TTS_NOPREFIX | WS_POPUP, This->tooltips_hwnd = CreateWindowExW(0, TOOLTIPS_CLASSW, NULL, TTS_NOPREFIX | WS_POPUP,
CW_USEDEFAULT, CW_USEDEFAULT, 10, 10, This->hwnd, NULL, hInst, NULL); CW_USEDEFAULT, CW_USEDEFAULT, 10, 10, This->hwnd, NULL, hInst, NULL);
......
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