VirtualBox

Changeset 8781 in vbox for trunk


Ignore:
Timestamp:
May 12, 2008 12:51:19 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
30771
Message:

Windows guest HGCM optimization: use a preallocated timeout variable.

Location:
trunk/src/VBox/Additions/WINNT/VBoxGuest
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/VBoxGuest/NTLegacy.cpp

    r8155 r8781  
    242242        // initialize the event notification semaphore
    243243        KeInitializeEvent(&pDevExt->keventNotification, NotificationEvent, FALSE);
     244
     245        /* Preallocated constant timeout 250ms for HGCM async waiter. */
     246        pDevExt->HGCMWaitTimeout.QuadPart  = 250;
     247        pDevExt->HGCMWaitTimeout.QuadPart *= -10000;     /* relative in 100ns units */
    244248    }
    245249
  • trunk/src/VBox/Additions/WINNT/VBoxGuest/VBoxGuest.cpp

    r8776 r8781  
    343343{
    344344    PVBOXGUESTDEVEXT pDevExt = (PVBOXGUESTDEVEXT)pvData;
    345     PLARGE_INTEGER pTimeout;
    346345
    347346    dprintf(("VBoxHGCMCallback\n"));
     
    350349     * call; introduce a timeout to make sure we don't wait indefinitely.
    351350     */
    352     pTimeout = (PLARGE_INTEGER)VbglPhysHeapAlloc(sizeof(LARGE_INTEGER));
    353     Assert(pTimeout);
    354     if (!pTimeout)
    355         return;
    356        
    357     pTimeout->QuadPart  = 250;
    358     pTimeout->QuadPart *= -10000;     /* relative in 100ns units */
    359 
    360351
    361352    while ((pHeader->fu32Flags & VBOX_HGCM_REQ_DONE) == 0)
     
    370361                                             UserMode,
    371362                                             FALSE, /* Not Alertable */
    372                                              pTimeout
     363                                             &pDevExt->HGCMWaitTimeout
    373364                                            );
    374365        dprintf(("VBoxHGCMCallback: Wait returned %d fu32Flags=%x\n", rc, pHeader->fu32Flags));
     
    385376        dprintf(("VBoxHGCMCallback: fu32Flags = %08X\n", pHeader->fu32Flags));
    386377    }
    387     VbglPhysHeapFree(pTimeout);   
    388378    return;
    389379}
  • trunk/src/VBox/Additions/WINNT/VBoxGuest/VBoxGuestPnP.cpp

    r8155 r8781  
    240240                KeInitializeEvent(&pDevExt->keventNotification, NotificationEvent, FALSE);
    241241
     242                /* Preallocated constant timeout 250ms for HGCM async waiter. */
     243                pDevExt->HGCMWaitTimeout.QuadPart  = 250;
     244                pDevExt->HGCMWaitTimeout.QuadPart *= -10000;     /* relative in 100ns units */
     245
    242246                VBoxInitMemBalloon(pDevExt);
    243247
  • trunk/src/VBox/Additions/WINNT/VBoxGuest/VBoxGuest_Internal.h

    r8155 r8781  
    187187    KEVENT keventNotification;
    188188
     189    LARGE_INTEGER HGCMWaitTimeout;
     190
    189191    /* Old Windows session id */
    190192    ULONG   ulOldActiveConsoleId;
Note: See TracChangeset for help on using the changeset viewer.

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