VirtualBox

Changeset 57654 in vbox for trunk/src/VBox/Additions/common


Ignore:
Timestamp:
Sep 8, 2015 1:16:17 PM (9 years ago)
Author:
vboxsync
Message:

DnD: Moved allocation of DNDDIRDROPPEDFILES into DnDDirDroppedFilesCreateAndOpen(Temp|Ex). Untested.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibDragAndDrop.cpp

    r57500 r57654  
    373373     * Create and query the (unique) drop target directory in the user's temporary directory.
    374374     */
    375     DNDDIRDROPPEDFILES dirDroppedFiles;
     375    PDNDDIRDROPPEDFILES pDroppedFiles;
    376376    const char *pszDropDir = NULL;
    377     int rc = DnDDirDroppedFilesCreateAndOpenTemp(&dirDroppedFiles);
    378     if (RT_SUCCESS(rc))
    379         pszDropDir = DnDDirDroppedFilesGetDirAbs(&dirDroppedFiles);
     377    int rc = DnDDirDroppedFilesCreateAndOpenTemp(0 /* fFlags */, &pDroppedFiles);
     378    if (RT_SUCCESS(rc))
     379        pszDropDir = DnDDirDroppedFilesGetDirAbs(pDroppedFiles);
    380380
    381381    /*
     
    421421                        rc = RTDirCreate(pszPathAbs, fCreationMode, 0);
    422422                        if (RT_SUCCESS(rc))
    423                             rc = DnDDirDroppedAddDir(&dirDroppedFiles, pszPathAbs);
     423                            rc = DnDDirDroppedAddDir(pDroppedFiles, pszPathAbs);
    424424
    425425                        RTStrFree(pszPathAbs);
     
    488488                                if (RT_SUCCESS(rc))
    489489                                {
    490                                     rc = DnDDirDroppedAddFile(&dirDroppedFiles, strPathAbs.c_str());
     490                                    rc = DnDDirDroppedAddFile(pDroppedFiles, strPathAbs.c_str());
    491491                                    if (RT_SUCCESS(rc))
    492492                                    {
     
    571571    if (RT_FAILURE(rc))
    572572    {
    573         int rc2 = DnDDirDroppedFilesRollback(&dirDroppedFiles);
     573        int rc2 = DnDDirDroppedFilesRollback(pDroppedFiles);
    574574        AssertRC(rc2); /* Not fatal, don't report back to host. */
    575575    }
     
    620620     * by the client's drag'n drop operation lateron.
    621621     */
    622     int rc2 = DnDDirDroppedFilesClose(&dirDroppedFiles, false);
     622    int rc2 = DnDDirDroppedFilesClose(pDroppedFiles, false);
    623623    if (RT_FAILURE(rc2)) /* Not fatal, don't report back to host. */
    624624        LogFlowFunc(("Closing dropped files directory failed with %Rrc\n", rc2));
     625
     626    DnDDirDroppedFilesDestroy(pDroppedFiles);
    625627
    626628    LogFlowFuncLeaveRC(rc);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette