VirtualBox

Ignore:
Timestamp:
May 12, 2010 1:27:04 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
61504
Message:

GuestProperties: Try make sure the timestamp is somewhat unique because the code is making assumptions about this (RTTimeNow granularity is very coarse on windows). Fixed several derefernces of rend in getOldNotificationInternal that VC++'s strictness checks pointed out. Also cleaned up the method, dropping the unncessary and somewhat historical/puzzling RT_SUCCESS(rc) bits.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/GuestProperties/testcase/tstGuestPropSvc.cpp

    r28800 r29394  
    727727    int rc = VINF_SUCCESS;
    728728    VBOXHGCMCALLHANDLE_TYPEDEF callHandle = { VINF_SUCCESS };
    729     char chBuffer[MAX_NAME_LEN + MAX_VALUE_LEN + MAX_FLAGS_LEN];
     729    char achBuffer[MAX_NAME_LEN + MAX_VALUE_LEN + MAX_FLAGS_LEN];
    730730    static char szPattern[] = "";
    731731
     
    739739    paParms[0].setPointer ((void *) szPattern, sizeof(szPattern));
    740740    paParms[1].setUInt64 (u64Timestamp);
    741     paParms[2].setPointer ((void *) chBuffer, getNotifications[0].cchBuffer - 1);
     741    paParms[2].setPointer ((void *) achBuffer, getNotifications[0].cchBuffer - 1);
    742742    pTable->pfnCall(pTable->pvService, &callHandle, 0, NULL,
    743743                    GET_NOTIFICATION, 4, paParms);
     
    760760        paParms[0].setPointer ((void *) szPattern, sizeof(szPattern));
    761761        paParms[1].setUInt64 (u64Timestamp);
    762         paParms[2].setPointer ((void *) chBuffer, sizeof(chBuffer));
     762        paParms[2].setPointer ((void *) achBuffer, sizeof(achBuffer));
    763763        pTable->pfnCall(pTable->pvService, &callHandle, 0, NULL,
    764764                        GET_NOTIFICATION, 4, paParms);
     
    768768            || RT_FAILURE(paParms[3].getUInt32 (&u32Size))
    769769            || u32Size != getNotifications[i].cchBuffer
    770             || memcmp(chBuffer, getNotifications[i].pchBuffer, u32Size) != 0
     770            || memcmp(achBuffer, getNotifications[i].pchBuffer, u32Size) != 0
    771771           )
    772772        {
    773             RTPrintf("Failed to get notification for property '%s'.\n",
    774                      getNotifications[i].pchBuffer);
     773            RTPrintf("Failed to get notification for property '%s' (rc=%Rrc).\n",
     774                     getNotifications[i].pchBuffer, rc);
    775775            rc = VERR_UNRESOLVED_ERROR;
    776776        }
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