VirtualBox

Ignore:
Timestamp:
Feb 22, 2016 4:44:07 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
105652
Message:

DnDURIObject.cpp: Use NIL_RTFILE for file objects.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/DragAndDrop/DnDURIObject.cpp

    r58069 r59778  
    66
    77/*
    8  * Copyright (C) 2014-2015 Oracle Corporation
     8 * Copyright (C) 2014-2016 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    5959    {
    6060        case File:
    61             u.m_hFile = NULL;
     61            u.m_hFile = NIL_RTFILE;
    6262            break;
    6363
     
    7777void DnDURIObject::closeInternal(void)
    7878{
    79     switch (m_Type)
    80     {
    81         case File:
    82         {
    83             if (u.m_hFile)
     79    LogFlowThisFuncEnter();
     80    switch (m_Type)
     81    {
     82        case File:
     83        {
     84            if (u.m_hFile != NIL_RTFILE)
    8485            {
    8586                int rc2 = RTFileClose(u.m_hFile);
    8687                AssertRC(rc2);
    8788
    88                 u.m_hFile = NULL;
     89                u.m_hFile = NIL_RTFILE;
    8990            }
    9091            break;
     
    9798            break;
    9899    }
    99 
    100     LogFlowThisFuncLeave();
    101100}
    102101
     
    136135    {
    137136        case File:
    138             fIsOpen = u.m_hFile != NULL;
     137            fIsOpen = u.m_hFile != NIL_RTFILE;
    139138            break;
    140139
     
    181180        && fOpen) /* Opening mode specified? */
    182181    {
     182        LogFlowThisFunc(("strPath=%s, fOpen=0x%x, enmType=%RU32, enmDest=%RU32\n",
     183                         strPath.c_str(), fOpen, enmType, enmDest));
    183184        switch (enmType)
    184185        {
    185186            case File:
    186187            {
    187                 if (!u.m_hFile)
     188                if (u.m_hFile == NIL_RTFILE)
    188189                {
    189190                    /*
     
    192193                     * it over.
    193194                     */
     195                    LogFlowThisFunc(("Opening ...\n"));
    194196                    rc = RTFileOpen(&u.m_hFile, strPath.c_str(), fOpen);
    195                     LogFlowThisFunc(("strPath=%s, fOpen=0x%x, enmType=%RU32, enmDest=%RU32, rc=%Rrc\n",
    196                                      strPath.c_str(), fOpen, enmType, enmDest, rc));
    197197                    if (RT_SUCCESS(rc))
    198198                        rc = RTFileGetSize(u.m_hFile, &m_cbSize);
     
    364364void DnDURIObject::Reset(void)
    365365{
     366    LogFlowThisFuncEnter();
     367
    366368    Close();
    367369
     
    396398                    m_cbProcessed += cbWritten;
    397399            }
    398 
    399400            break;
    400401        }
     
    417418    }
    418419
    419     LogFlowFunc(("Returning strSourcePath=%s, cbWritten=%zu, rc=%Rrc\n", m_strSrcPath.c_str(), cbWritten, rc));
     420    LogFlowThisFunc(("Returning strSourcePath=%s, cbWritten=%zu, rc=%Rrc\n", m_strSrcPath.c_str(), cbWritten, rc));
    420421    return rc;
    421422}
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