VirtualBox

Changeset 82488 in vbox


Ignore:
Timestamp:
Dec 7, 2019 3:42:27 AM (5 years ago)
Author:
vboxsync
Message:

VBoxSharedClipboardSvc: Return VERR_NOT_IMPLEMENTED like we used to do for everything which isn't defined (VERR_ACCESS_DENIED isn't appropriate). This means introducing (and updating) a VBOX_SHCL_GUEST_FN_LAST define in the public header. bugref:9437

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/HostServices/VBoxClipboardSvc.h

    r82486 r82488  
    293293 *
    294294 * @deprecated Replaced by VBOX_SHCL_GUEST_FN_MSG_PEEK_WAIT,
    295  *             VBOX_SHCL_GUEST_FN_MSG_GET, VBOX_SHCL_GUEST_FN_MSG_CANCEL.
     295 *             VBOX_SHCL_GUEST_FN_MSG_GET, VBOX_SHCL_GUEST_FN_CANCEL.
    296296 */
    297297#define VBOX_SHCL_GUEST_FN_GET_HOST_MSG_OLD       1
     
    313313#define VBOX_SHCL_GUEST_FN_DATA_WRITE             4
    314314
    315 /** Does the actual protocol handshake. If this message is not
    316  *  being sent by the guest, the host handles that particular client
    317  *  with the legacy protocol (v0).
     315/** Does the actual protocol handshake.
     316 *
     317 * If this message is not being sent by the guest, the host handles that
     318 * particular client with the legacy protocol (v0).
    318319 *
    319320 * @retval  VINF_SUCCESS on success.
     
    339340/** Query the host ones feature masks.
    340341 *
    341  * That way the guest (client) can get hold of the features
    342  * from the host.  Again, it is prudent to set the 127 bit and observe it being
    343  * cleared on success, as older hosts might return success without doing
    344  * anything.
     342 * That way the guest (client) can get hold of the features from the host.
     343 * Again, it is prudent to set the 127 bit and observe it being cleared on
     344 * success, as older hosts might return success without doing anything.
    345345 *
    346346 * @retval  VINF_SUCCESS on success.
     
    533533 */
    534534#define VBOX_SHCL_GUEST_FN_ERROR                  27
     535
     536/** The last function number (used for validation/sanity).   */
     537#define VBOX_SHCL_GUEST_FN_LAST                   VBOX_SHCL_GUEST_FN_ERROR
    535538/** @} */
    536539
  • trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp

    r82486 r82488  
    17121712             u32ClientID, u32Function, ShClGuestMsgToStr(u32Function), cParms, paParms));
    17131713
    1714 #ifdef DEBUG
    1715     uint32_t i;
    1716 
    1717     for (i = 0; i < cParms; i++)
     1714#ifdef LOG_ENABLED
     1715    for (uint32_t i = 0; i < cParms; i++)
    17181716    {
    17191717        /** @todo parameters other than 32 bit */
     
    18891887            LogRel2(("Shared Clipboard: Operation canceled by guest side\n"));
    18901888
     1889            /** @todo r=bird: What on earth is this?   The only user of this message
     1890             * (VBOX_SHCL_GUEST_FN_CANCEL) is VbglR3ClipboardMsgPeekWait(), where it was
     1891             * copied over from guest control.  What happens here is _nothing_ like what it
     1892             * expects to happen.  See GstCtrlService::clientMsgCancel for a reference.
     1893             */
     1894
    18911895            /* Reset client state and start over. */
    18921896            shclSvcClientStateReset(&pClient->State);
     
    19181922        {
    19191923#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
    1920             if (g_fTransferMode & VBOX_SHCL_TRANSFER_MODE_ENABLED)
    1921             {
    1922                 rc = shClSvcTransferHandler(pClient, callHandle, u32Function, cParms, paParms, tsArrival);
     1924            if (u32Function <= VBOX_SHCL_GUEST_FN_LAST)
     1925            {
     1926                if (g_fTransferMode & VBOX_SHCL_TRANSFER_MODE_ENABLED)
     1927                    rc = shClSvcTransferHandler(pClient, callHandle, u32Function, cParms, paParms, tsArrival);
     1928                else
     1929                {
     1930                    LogRel2(("Shared Clipboard: File transfers are disabled for this VM\n"));
     1931                    rc = VERR_ACCESS_DENIED;
     1932                }
    19231933            }
    19241934            else
    1925             {
    1926                 LogRel2(("Shared Clipboard: File transfers are disabled for this VM\n"));
    1927                 rc = VERR_ACCESS_DENIED;
    1928             }
    1929 #else
    1930             rc = VERR_NOT_SUPPORTED;
    19311935#endif
     1936            {
     1937                LogRel2(("Shared Clipboard: Unknown guest function: %u (%#x)\n", u32Function, u32Function));
     1938                rc = VERR_NOT_IMPLEMENTED;
     1939            }
    19321940            break;
    19331941        }
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