VirtualBox

Ignore:
Timestamp:
Nov 12, 2007 2:35:27 PM (17 years ago)
Author:
vboxsync
Message:

KeWaitForSingleObject must use UserMode or else a kill signal won't abort the wait.

File:
1 edited

Legend:

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

    r5606 r5707  
    339339{
    340340    PVBOXGUESTDEVEXT pDevExt = (PVBOXGUESTDEVEXT)pvData;
    341     LARGE_INTEGER timeout;
     341    PLARGE_INTEGER pTimeout;
    342342
    343343    dprintf(("VBoxHGCMCallback\n"));
     
    346346     * call; introduce a timeout to make sure we don't wait indefinitely.
    347347     */
    348     timeout.QuadPart  = 250;
    349     timeout.QuadPart *= -10000;     /* relative in 100ns units */
     348    pTimeout = (PLARGE_INTEGER)VbglPhysHeapAlloc(sizeof(LARGE_INTEGER));
     349    Assert(pTimeout);
     350    if (!pTimeout)
     351        return;
     352       
     353    pTimeout->QuadPart  = 250;
     354    pTimeout->QuadPart *= -10000;     /* relative in 100ns units */
     355
    350356
    351357    while ((pHeader->fu32Flags & VBOX_HGCM_REQ_DONE) == 0)
    352358    {
     359        /* Specifying UserMode so killing the user process will abort the wait. */
    353360        NTSTATUS rc = KeWaitForSingleObject (&pDevExt->keventNotification, Executive,
    354                                              KernelMode, TRUE, &timeout
     361                                             UserMode, TRUE, pTimeout
    355362                                            );
    356363        dprintf(("VBoxHGCMCallback: Wait returned %d fu32Flags=%x\n", rc, pHeader->fu32Flags));
     
    367374        dprintf(("VBoxHGCMCallback: fu32Flags = %08X\n", pHeader->fu32Flags));
    368375    }
    369    
     376    VbglPhysHeapFree(pTimeout);   
    370377    return;
    371378}
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