ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

Definition at line 171 of file enum_files.c.

Referenced by BITS_IBackgroundCopyJob_EnumFiles().

{
    EnumBackgroundCopyFilesImpl *This;
    BackgroundCopyFileImpl *file;
    BackgroundCopyJobImpl *job = (BackgroundCopyJobImpl *) iCopyJob;
    ULONG i;

    TRACE("%p, %p)\n", ppObj, job);

    This = HeapAlloc(GetProcessHeap(), 0, sizeof *This);
    if (!This)
        return E_OUTOFMEMORY;

    This->lpVtbl = &BITS_IEnumBackgroundCopyFiles_Vtbl;
    This->ref = 1;

    /* Create array of files */
    This->indexFiles = 0;
    EnterCriticalSection(&job->cs);
    This->numFiles = list_count(&job->files);
    This->files = NULL;
    if (This->numFiles > 0)
    {
        This->files = HeapAlloc(GetProcessHeap(), 0,
                                This->numFiles * sizeof This->files[0]);
        if (!This->files)
        {
            LeaveCriticalSection(&job->cs);
            HeapFree(GetProcessHeap(), 0, This);
            return E_OUTOFMEMORY;
        }
    }

    i = 0;
    LIST_FOR_EACH_ENTRY(file, &job->files, BackgroundCopyFileImpl, entryFromJob)
    {
        file->lpVtbl->AddRef((IBackgroundCopyFile *) file);
        This->files[i] = (IBackgroundCopyFile *) file;
        ++i;
    }
    LeaveCriticalSection(&job->cs);

    *ppObj = &This->lpVtbl;
    return S_OK;
}

Generated on Sat May 26 2012 05:15:41 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.