Exemple #1
0
/* Test Next by requesting multiple files at a time */
static void test_Next_walkList_2(void)
{
    HRESULT hres;
    IBackgroundCopyFile *files[NUM_FILES];
    ULONG fetched;
    ULONG i;

    for (i = 0; i < test_fileCount; i++)
        files[i] = NULL;

    fetched = 0;
    hres = IEnumBackgroundCopyFiles_Next(test_enumFiles, test_fileCount, files, &fetched);
    ok(hres == S_OK, "Next failed: %08x\n", hres);
    if(hres != S_OK)
    {
        skip("Unable to get file from test_enumFiles\n");
        return;
    }
    ok(fetched == test_fileCount, "Next returned the incorrect number of files: %08x\n", hres);

    for (i = 0; i < test_fileCount; i++)
    {
        ok(files[i] != NULL, "Next returned NULL\n");
        if (files[i])
            IBackgroundCopyFile_Release(files[i]);
    }
}
Exemple #2
0
/* Test Next by requesting one file at a time */
static void test_Next_walkList_1(void)
{
    HRESULT hres;
    IBackgroundCopyFile *file;
    ULONG fetched;
    ULONG i;

    /* Fetch the available files */
    for (i = 0; i < test_fileCount; i++)
    {
        file = NULL;
        fetched = 0;
        hres = IEnumBackgroundCopyFiles_Next(test_enumFiles, 1, &file, &fetched);
        ok(hres == S_OK, "Next failed: %08x\n", hres);
        if(hres != S_OK)
        {
            skip("Unable to get file from test_enumFiles\n");
            return;
        }
        ok(fetched == 1, "Next returned the incorrect number of files: %08x\n", hres);
        ok(file != NULL, "Next returned NULL\n");
        if (file)
            IBackgroundCopyFile_Release(file);
    }

    /* Attempt to fetch one more than the number of available files */
    fetched = 0;
    hres = IEnumBackgroundCopyFiles_Next(test_enumFiles, 1, &file, &fetched);
    ok(hres == S_FALSE, "Next off end of available files failed: %08x\n", hres);
    ok(fetched == 0, "Next returned the incorrect number of files: %08x\n", hres);
}
Exemple #3
0
static ULONG WINAPI DLBindStatusCallback_Release(IBindStatusCallback *iface)
{
    DLBindStatusCallback *This = impl_from_IBindStatusCallback(iface);
    ULONG ref = InterlockedDecrement(&This->ref);

    if (ref == 0)
    {
        IBackgroundCopyFile_Release(&This->file->IBackgroundCopyFile_iface);
        HeapFree(GetProcessHeap(), 0, This);
    }

    return ref;
}
Exemple #4
0
/* Test Next with a NULL pceltFetched*/
static void test_Next_walkListNull(void)
{
    HRESULT hres;
    IBackgroundCopyFile *file;
    ULONG i;

    /* Fetch the available files */
    for (i = 0; i < test_fileCount; i++)
    {
        hres = IEnumBackgroundCopyFiles_Next(test_enumFiles, 1, &file, NULL);
        ok(hres == S_OK, "Next failed: %08x\n", hres);
        IBackgroundCopyFile_Release(file);
    }

    /* Attempt to fetch one more than the number of available files */
    hres = IEnumBackgroundCopyFiles_Next(test_enumFiles, 1, &file, NULL);
    ok(hres == S_FALSE, "Next off end of available files failed: %08x\n", hres);
}