Exemple #1
0
static HRESULT WINAPI HTMLElement2_get_dir(IHTMLElement2 *iface, BSTR *p)
{
    HTMLElement *This = HTMLELEM2_THIS(iface);

    TRACE("(%p)->(%p)\n", This, p);

    *p = NULL;

    if(This->nselem) {
        nsAString dir_str;
        nsresult nsres;

        nsAString_Init(&dir_str, NULL);

        nsres = nsIDOMHTMLElement_GetDir(This->nselem, &dir_str);
        if(NS_SUCCEEDED(nsres)) {
            const PRUnichar *dir;
            nsAString_GetData(&dir_str, &dir);
            if(*dir)
                *p = SysAllocString(dir);
        }else {
            ERR("GetDir failed: %08x\n", nsres);
        }

        nsAString_Finish(&dir_str);
    }

    TRACE("ret %s\n", debugstr_w(*p));
    return S_OK;
}
Exemple #2
0
static HRESULT WINAPI HTMLElement2_get_dir(IHTMLElement2 *iface, BSTR *p)
{
    HTMLElement *This = impl_from_IHTMLElement2(iface);
    nsAString dir_str;
    nsresult nsres;

    TRACE("(%p)->(%p)\n", This, p);

    if(!This->nselem) {
        *p = NULL;
        return S_OK;
    }

    nsres = nsIDOMHTMLElement_GetDir(This->nselem, &dir_str);
    return return_nsstr(nsres, &dir_str, p);
}