Пример #1
0
static HRESULT WINAPI enumvar_Next(IEnumVARIANT *iface, ULONG celt, VARIANT *var, ULONG *fetched)
{
    EnumVARIANT *enumvar = impl_from_IEnumVARIANT(iface);
    LONG i;

    TRACE("%p,%u,%p,%p\n", iface, celt, var, fetched);

    for (i = 0; i < celt && enumvar->pos < enumvar->folders->count; i++)
    {
        ITaskFolder *folder;
        HRESULT hr;

        hr = TaskFolder_create(enumvar->folders->path, enumvar->folders->list[enumvar->pos++], &folder, FALSE);
        if (hr) return hr;

        if (!var)
        {
            ITaskFolder_Release(folder);
            return E_POINTER;
        }

        V_VT(&var[i]) = VT_DISPATCH;
        V_DISPATCH(&var[i]) = (IDispatch *)folder;
    }

    if (fetched) *fetched = i;

    return i == celt ? S_OK : S_FALSE;
}
Пример #2
0
static HRESULT WINAPI TaskFolder_CreateFolder(ITaskFolder *iface, BSTR path, VARIANT sddl, ITaskFolder **new_folder)
{
    TaskFolder *folder = impl_from_ITaskFolder(iface);
    ITaskFolder *tmp_folder = NULL;
    HRESULT hr;

    TRACE("%p,%s,%s,%p\n", iface, debugstr_w(path), debugstr_variant(&sddl), folder);

    if (!path) return E_INVALIDARG;

    if (!new_folder) new_folder = &tmp_folder;

    if (!is_variant_null(&sddl))
        FIXME("security descriptor %s is ignored\n", debugstr_variant(&sddl));

    hr = TaskFolder_create(folder->path, path, new_folder, TRUE);
    if (tmp_folder)
        ITaskFolder_Release(tmp_folder);

    return hr;
}