VirtualBox

Ignore:
Timestamp:
May 2, 2013 12:16:42 PM (12 years ago)
Author:
vboxsync
Message:

VBoxService: More logging for property cache / user enumeration.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServicePropCache.cpp

    r44529 r45874  
    217217{
    218218    AssertPtrReturn(pCache, VERR_INVALID_POINTER);
     219    AssertPtrReturn(pszName, VERR_INVALID_POINTER);
     220
    219221    Assert(pCache->uClientID);
    220     AssertPtrReturn(pszName, VERR_INVALID_POINTER);
    221222
    222223    /*
     
    261262                /* Write the update. */
    262263                rc = vboxServicePropCacheWritePropF(pCache->uClientID, pNode->pszName, pNode->fFlags, pszValue);
    263                 VBoxServiceVerbose(4, "PropCache %p: Written \"%s\"=\"%s\" (flags: %x), rc=%Rrc\n",
     264                VBoxServiceVerbose(4, "[PropCache %p]: Written \"%s\"=\"%s\" (flags: %x), rc=%Rrc\n",
    264265                                   pCache, pNode->pszName, pszValue, pNode->fFlags, rc);
    265                 RTStrFree(pNode->pszValue);
    266                 pNode->pszValue = RTStrDup(pszValue);
    267                 if (!pNode->pszValue)
    268                     rc = VERR_NO_MEMORY;
     266                if (RT_SUCCESS(rc)) /* Only update the node's value on successful write. */
     267                {
     268                    RTStrFree(pNode->pszValue);
     269                    pNode->pszValue = RTStrDup(pszValue);
     270                    if (!pNode->pszValue)
     271                        rc = VERR_NO_MEMORY;
     272                }
    269273            }
    270274            else
     
    276280            if (pNode->pszValue) /* Did we have a value before? Then the value needs to be deleted. */
    277281            {
    278                 /* Delete property (but do not remove from cache) if not deleted yet. */
    279                 RTStrFree(pNode->pszValue);
    280                 pNode->pszValue = NULL;
    281282                rc = vboxServicePropCacheWritePropF(pCache->uClientID, pNode->pszName,
    282283                                                    0, /* Flags */ NULL /* Value */);
    283                 VBoxServiceVerbose(4, "PropCache %p: Deleted \"%s\"=\"%s\" (flags: %x), rc=%Rrc\n",
     284                VBoxServiceVerbose(4, "[PropCache %p]: Deleted \"%s\"=\"%s\" (flags: %x), rc=%Rrc\n",
    284285                                   pCache, pNode->pszName, pNode->pszValue, pNode->fFlags, rc);
     286                if (RT_SUCCESS(rc)) /* Only delete property value on successful Vbgl deletion. */
     287                {
     288                    /* Delete property (but do not remove from cache) if not deleted yet. */
     289                    RTStrFree(pNode->pszValue);
     290                    pNode->pszValue = NULL;
     291                }
    285292            }
    286293            else
     
    291298        RTCritSectLeave(&pCache->CritSect);
    292299    }
     300
     301    VBoxServiceVerbose(4, "[PropCache %p]: Updating \"%s\" resulted in rc=%Rrc\n",
     302                       pCache, pszName, rc);
    293303
    294304    /* Delete temp stuff. */
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