VirtualBox

Changeset 43581 in vbox


Ignore:
Timestamp:
Oct 9, 2012 2:18:00 PM (12 years ago)
Author:
vboxsync
Message:

VBoxServiceClipboard-os2.cpp: Tell PM not to try send any WM_QUIT messsages on shutdown as we might hang the shutdown process otherwise. Must disconnect the HGCM service on stop, or the listener thread will not quit and hang the shutting down of the service.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceClipboard-os2.cpp

    r40128 r43581  
    55
    66/*
    7  * Copyright (C) 2007 Oracle Corporation
     7 * Copyright (C) 2007-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    170170    if (g_hmqCtrl != NULLHANDLE)
    171171    {
     172        WinCancelShutdown(g_hmqCtrl, TRUE); /* We don't care about shutdown */
     173
    172174        /*
    173175         * Create the 'nothing-changed' format.
     
    811813        if (g_hmqListener != NULLHANDLE)
    812814        {
     815            WinCancelShutdown(g_hmqListener, TRUE); /* We don't care about shutdown */
     816
    813817            /*
    814818             * Tell the worker thread that we're good.
     
    903907        if (g_hmqWorker != NULLHANDLE)
    904908        {
     909            if (g_hmqWorker != g_hmqCtrl)
     910                WinCancelShutdown(g_hmqWorker, TRUE); /* We don't care about shutdown */
     911
    905912            /*
    906913             * Create the object window.
     
    949956                            QMSG qmsg;
    950957                            while (WinGetMsg(g_habWorker, &qmsg, NULLHANDLE, NULLHANDLE, 0))
     958                            {
     959                                if (qmsg.msg != WM_TIMER)
     960                                    VBoxServiceVerbose(6, "WinGetMsg -> hwnd=%p msg=%#x mp1=%p mp2=%p time=%#x ptl=%d,%d rsrv=%#x\n",
     961                                                       qmsg.hwnd, qmsg.msg, qmsg.mp1, qmsg.mp2, qmsg.time, qmsg.ptl.x, qmsg.ptl.y, qmsg.reserved); 
    951962                                WinDispatchMsg(g_habWorker, &qmsg);
     963                            }
    952964                            VBoxServiceVerbose(2, "clipboard: Exited PM message loop. *pfShutdown=%RTbool\n", *pfShutdown);
    953965
     
    9971009        &&  !WinPostQueueMsg(g_hmqWorker, WM_QUIT, NULL, NULL))
    9981010        VBoxServiceError("WinPostQueueMsg(g_hmqWorker, WM_QUIT, 0,0) failed, lasterr=%lx\n", WinGetLastError(g_habCtrl));
     1011
     1012    /* Must disconnect the clipboard here otherwise the listner won't quit and
     1013       the service shutdown will not stop. */
     1014    if (g_u32ClientId != 0)
     1015    {
     1016        if (g_hmqWorker != NULLHANDLE)
     1017            RTThreadSleep(32);      /* fudge */
     1018
     1019        VBoxServiceVerbose(4, "clipboard: disconnecting %#x\n", g_u32ClientId);
     1020        int rc = VbglR3ClipboardDisconnect(g_u32ClientId);
     1021        if (RT_SUCCESS(rc))
     1022            g_u32ClientId = 0;
     1023        else
     1024            VBoxServiceError("clipboard: VbglR3ClipboardDisconnect(%#x) -> %Rrc\n", g_u32ClientId, rc);
     1025    }
    9991026}
    10001027
     
    10031030static DECLCALLBACK(void) VBoxServiceClipboardOS2Term(void)
    10041031{
    1005     VBoxServiceVerbose(4, "clipboard: disconnecting %#x\n", g_u32ClientId);
    1006     VbglR3ClipboardDisconnect(g_u32ClientId);
    1007     g_u32ClientId = 0;
     1032    if (g_u32ClientId != 0)
     1033    {
     1034        VBoxServiceVerbose(4, "clipboard: disconnecting %#x\n", g_u32ClientId);
     1035        int rc = VbglR3ClipboardDisconnect(g_u32ClientId);
     1036        if (RT_SUCCESS(rc))
     1037            g_u32ClientId = 0;
     1038        else
     1039            VBoxServiceError("clipboard: VbglR3ClipboardDisconnect(%#x) -> %Rrc\n", g_u32ClientId, rc);
     1040    }
    10081041    WinDestroyMsgQueue(g_hmqCtrl);
    10091042    g_hmqCtrl = NULLHANDLE;
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