static HRESULT exec_fontname(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out) { TRACE("(%p)->(%p %p)\n", This, in, out); if(!This->doc_obj->nscontainer) { update_doc(This, UPDATE_UI); return E_FAIL; } if(in) { char *stra; if(V_VT(in) != VT_BSTR) { FIXME("Unsupported fontname %s\n", debugstr_variant(out)); return E_INVALIDARG; } TRACE("%s\n", debugstr_w(V_BSTR(in))); stra = heap_strdupWtoA(V_BSTR(in)); set_ns_fontname(This, stra); heap_free(stra); update_doc(This, UPDATE_UI); } if(out) { nsICommandParams *nsparam; LPWSTR strw; char *stra; DWORD len; nsresult nsres; V_VT(out) = VT_BSTR; V_BSTR(out) = NULL; nsparam = create_nscommand_params(); nsres = get_ns_command_state(This->doc_obj->nscontainer, NSCMD_FONTFACE, nsparam); if(NS_FAILED(nsres)) return S_OK; nsICommandParams_GetCStringValue(nsparam, NSSTATE_ATTRIBUTE, &stra); nsICommandParams_Release(nsparam); len = MultiByteToWideChar(CP_ACP, 0, stra, -1, NULL, 0); strw = heap_alloc(len*sizeof(WCHAR)); MultiByteToWideChar(CP_ACP, 0, stra, -1, strw, len); nsfree(stra); V_BSTR(out) = SysAllocString(strw); heap_free(strw); } return S_OK; }
void tg_free(trustgroup *tg, int created) { if(created) triggerhook(HOOK_TRUSTS_LOSTGROUP, tg); freesstring(tg->name); freesstring(tg->createdby); freesstring(tg->contact); freesstring(tg->comment); nsfree(POOL_TRUSTS, tg); }
void freehost(host *hp) { nsfree(POOL_NICK, hp); }
void freenick(nick *np) { nsfree(POOL_NICK, np); }
void freescan(scan *sp) { nsfree(POOL_PROXYSCAN, sp); }
void freeextrascan(extrascan *esp) { nsfree(POOL_PROXYSCAN, esp); }
void freefoundproxy(foundproxy *fpp) { nsfree(POOL_PROXYSCAN, fpp); }
void freependingscan(pendingscan *psp) { nsfree(POOL_PROXYSCAN, psp); }
void freecachehost(cachehost *chp) { nsfree(POOL_PROXYSCAN, chp); }
void th_free(trusthost *th) { triggerhook(HOOK_TRUSTS_LOSTHOST, th); nsfree(POOL_TRUSTS, th); }