VirtualBox

Changeset 76958 in vbox


Ignore:
Timestamp:
Jan 23, 2019 6:23:04 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
128342
Message:

Guest Control: Unifying terminology for (client/host) commands, functions and messages; it's all about messages now. Renaming, no functional changes.

Location:
trunk
Files:
15 edited

Legend:

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

    r76585 r76958  
    8787typedef struct VBoxGuestCtrlHostCbCtx
    8888{
    89     /** HGCM Function number. */
    90     uint32_t uFunction;
     89    /** HGCM message number. */
     90    uint32_t uMessage;
    9191    /** The context ID. */
    9292    uint32_t uContextID;
     
    126126
    127127/**
    128  * The service functions which are callable by host.
    129  */
    130 enum eHostFn
     128 * The service messages which are callable by host.
     129 */
     130enum eHostMsg
    131131{
    132132    /**
    133133     * The host asks the client to cancel all pending waits and exit.
    134134     */
    135     HOST_CANCEL_PENDING_WAITS = 0,
     135    HOST_MSG_CANCEL_PENDING_WAITS = 0,
    136136    /**
    137137     * The host wants to create a guest session.
    138138     */
    139     HOST_SESSION_CREATE = 20,
     139    HOST_MSG_SESSION_CREATE = 20,
    140140    /**
    141141     * The host wants to close a guest session.
    142142     */
    143     HOST_SESSION_CLOSE = 21,
     143    HOST_MSG_SESSION_CLOSE = 21,
    144144    /**
    145145     * The host wants to execute something in the guest. This can be a command line
    146146     * or starting a program.
    147      ** Note: Legacy (VBox < 4.3) command.
    148      */
    149     HOST_EXEC_CMD = 100,
     147     ** Note: Legacy (VBox < 4.3) message.
     148     */
     149    HOST_MSG_EXEC_CMD = 100,
    150150    /**
    151151     * Sends input data for stdin to a running process executed by HOST_EXEC_CMD.
    152      ** Note: Legacy (VBox < 4.3) command.
    153      */
    154     HOST_EXEC_SET_INPUT = 101,
     152     ** Note: Legacy (VBox < 4.3) message.
     153     */
     154    HOST_MSG_EXEC_SET_INPUT = 101,
    155155    /**
    156156     * Gets the current status of a running process, e.g.
    157157     * new data on stdout/stderr, process terminated etc.
    158      * @note Legacy (VBox < 4.3) command.
    159      */
    160     HOST_EXEC_GET_OUTPUT = 102,
     158     * @note Legacy (VBox < 4.3) message.
     159     */
     160    HOST_MSG_EXEC_GET_OUTPUT = 102,
    161161    /**
    162162     * Terminates a running guest process.
    163163     */
    164     HOST_EXEC_TERMINATE = 110,
     164    HOST_MSG_EXEC_TERMINATE = 110,
    165165    /**
    166166     * Waits for a certain event to happen. This can be an input, output
    167167     * or status event.
    168168     */
    169     HOST_EXEC_WAIT_FOR = 120,
     169    HOST_MSG_EXEC_WAIT_FOR = 120,
    170170    /**
    171171     * Opens a guest file.
    172172     */
    173     HOST_FILE_OPEN = 240,
     173    HOST_MSG_FILE_OPEN = 240,
    174174    /**
    175175     * Closes a guest file.
    176176     */
    177     HOST_FILE_CLOSE = 241,
     177    HOST_MSG_FILE_CLOSE = 241,
    178178    /**
    179179     * Reads from an opened guest file.
    180180     */
    181     HOST_FILE_READ = 250,
     181    HOST_MSG_FILE_READ = 250,
    182182    /**
    183183     * Reads from an opened guest file at
    184184     * a specified offset.
    185185     */
    186     HOST_FILE_READ_AT = 251,
     186    HOST_MSG_FILE_READ_AT = 251,
    187187    /**
    188188     * Write to an opened guest file.
    189189     */
    190     HOST_FILE_WRITE = 260,
     190    HOST_MSG_FILE_WRITE = 260,
    191191    /**
    192192     * Write to an opened guest file at
    193193     * a specified offset.
    194194     */
    195     HOST_FILE_WRITE_AT = 261,
     195    HOST_MSG_FILE_WRITE_AT = 261,
    196196    /**
    197197     * Changes the read & write position of an opened guest file.
    198198     */
    199     HOST_FILE_SEEK = 270,
     199    HOST_MSG_FILE_SEEK = 270,
    200200    /**
    201201     * Gets the current file position of an opened guest file.
    202202     */
    203     HOST_FILE_TELL = 271,
     203    HOST_MSG_FILE_TELL = 271,
    204204    /**
    205205     * Removes a directory on the guest.
    206206     */
    207     HOST_DIR_REMOVE = 320,
     207    HOST_MSG_DIR_REMOVE = 320,
    208208    /**
    209209     * Renames a path on the guest.
    210210     */
    211     HOST_PATH_RENAME = 330,
     211    HOST_MSG_PATH_RENAME = 330,
    212212    /**
    213213     * Retrieves the user's documents directory.
    214214     */
    215     HOST_PATH_USER_DOCUMENTS = 331,
     215    HOST_MSG_PATH_USER_DOCUMENTS = 331,
    216216    /**
    217217     * Retrieves the user's home directory.
    218218     */
    219     HOST_PATH_USER_HOME = 332
     219    HOST_MSG_PATH_USER_HOME = 332
    220220};
    221221
    222222
    223223/**
    224  * Translates a guest control host function function enum to at string.
     224 * Translates a guest control host message enum to a string.
     225 *
    225226 * @returns Enum string name.
    226  * @param   enmFunction     The function name to translate.
    227  */
    228 DECLINLINE(const char *) GstCtrlHostFnName(enum eHostFn enmFunction)
    229 {
    230     switch (enmFunction)
     227 * @param   enmMsg              The message to translate.
     228 */
     229DECLINLINE(const char *) GstCtrlHostMsgtoStr(enum eHostMsg enmMsg)
     230{
     231    switch (enmMsg)
    231232    {
    232         RT_CASE_RET_STR(HOST_CANCEL_PENDING_WAITS);
    233         RT_CASE_RET_STR(HOST_SESSION_CREATE);
    234         RT_CASE_RET_STR(HOST_SESSION_CLOSE);
    235         RT_CASE_RET_STR(HOST_EXEC_CMD);
    236         RT_CASE_RET_STR(HOST_EXEC_SET_INPUT);
    237         RT_CASE_RET_STR(HOST_EXEC_GET_OUTPUT);
    238         RT_CASE_RET_STR(HOST_EXEC_TERMINATE);
    239         RT_CASE_RET_STR(HOST_EXEC_WAIT_FOR);
    240         RT_CASE_RET_STR(HOST_FILE_OPEN);
    241         RT_CASE_RET_STR(HOST_FILE_CLOSE);
    242         RT_CASE_RET_STR(HOST_FILE_READ);
    243         RT_CASE_RET_STR(HOST_FILE_READ_AT);
    244         RT_CASE_RET_STR(HOST_FILE_WRITE);
    245         RT_CASE_RET_STR(HOST_FILE_WRITE_AT);
    246         RT_CASE_RET_STR(HOST_FILE_SEEK);
    247         RT_CASE_RET_STR(HOST_FILE_TELL);
    248         RT_CASE_RET_STR(HOST_DIR_REMOVE);
    249         RT_CASE_RET_STR(HOST_PATH_RENAME);
    250         RT_CASE_RET_STR(HOST_PATH_USER_DOCUMENTS);
    251         RT_CASE_RET_STR(HOST_PATH_USER_HOME);
     233        RT_CASE_RET_STR(HOST_MSG_CANCEL_PENDING_WAITS);
     234        RT_CASE_RET_STR(HOST_MSG_SESSION_CREATE);
     235        RT_CASE_RET_STR(HOST_MSG_SESSION_CLOSE);
     236        RT_CASE_RET_STR(HOST_MSG_EXEC_CMD);
     237        RT_CASE_RET_STR(HOST_MSG_EXEC_SET_INPUT);
     238        RT_CASE_RET_STR(HOST_MSG_EXEC_GET_OUTPUT);
     239        RT_CASE_RET_STR(HOST_MSG_EXEC_TERMINATE);
     240        RT_CASE_RET_STR(HOST_MSG_EXEC_WAIT_FOR);
     241        RT_CASE_RET_STR(HOST_MSG_FILE_OPEN);
     242        RT_CASE_RET_STR(HOST_MSG_FILE_CLOSE);
     243        RT_CASE_RET_STR(HOST_MSG_FILE_READ);
     244        RT_CASE_RET_STR(HOST_MSG_FILE_READ_AT);
     245        RT_CASE_RET_STR(HOST_MSG_FILE_WRITE);
     246        RT_CASE_RET_STR(HOST_MSG_FILE_WRITE_AT);
     247        RT_CASE_RET_STR(HOST_MSG_FILE_SEEK);
     248        RT_CASE_RET_STR(HOST_MSG_FILE_TELL);
     249        RT_CASE_RET_STR(HOST_MSG_DIR_REMOVE);
     250        RT_CASE_RET_STR(HOST_MSG_PATH_RENAME);
     251        RT_CASE_RET_STR(HOST_MSG_PATH_USER_DOCUMENTS);
     252        RT_CASE_RET_STR(HOST_MSG_PATH_USER_HOME);
    252253    }
    253254    return "Unknown";
     
    256257
    257258/**
    258  * The service functions which are called by guest.
     259 * The service messages which are callable by the guest.
    259260 *
    260  * @note The function numbers cannot be changed.  Please use the first non-zero
    261  *       number that's not in use when adding new functions.
     261 * @note The message numbers cannot be changed.  Please use the first non-zero
     262 *       number that's not in use when adding new messages.
    262263 *
    263  * @note Remember to update service.cpp when adding new functions/events for
    264  *       Main, as it validates all incoming commands before passing them on.
    265  */
    266 enum eGuestFn
     264 * @note Remember to update service.cpp when adding new messages for Main,
     265 *       as it validates all incoming messages before passing them on.
     266 */
     267enum eGuestMsg
    267268{
    268269    /** Guest waits for a new message the host wants to process on the guest side.
    269270     * This is a blocking call and can be deferred.
    270271     *
    271      * @note This command is rather odd.  The above description isn't really
     272     * @note This message is rather odd.  The above description isn't really
    272273     *       correct.  Yes, it (1) waits for a new message and will return the
    273274     *       mesage number and parameter count when one is available.   However, it
     
    303304     *
    304305     * @note This is a host side notification message that has no business in this
    305      *       enum.  The guest cannot use this function number, host will reject it.
    306      */
    307     GUEST_DISCONNECTED = 3,
     306     *       enum.  The guest cannot use this message number, host will reject it.
     307     */
     308    GUEST_MSG_DISCONNECTED = 3,
    308309    /** Sets a message filter to only get messages which have a certain
    309310     * context ID scheme (that is, a specific session, object etc).
     
    391392     * This skips the current message, replying to the main backend as best it can.
    392393     * Takes between zero and two parameters.  The first parameter is the 32-bit
    393      * VBox status code to pass onto Main when skipping the command, defaults to
     394     * VBox status code to pass onto Main when skipping the message, defaults to
    394395     * VERR_NOT_SUPPORTED.  The second parameter is the 32-bit message ID of the
    395      * command to skip, by default whatever is first in the queue is removed.  This
     396     * message to skip, by default whatever is first in the queue is removed.  This
    396397     * is also the case if UINT32_MAX is specified.
    397398     *
     
    407408     * Skips the current assigned message returned by GUEST_MSG_WAIT.
    408409     * Needed for telling the host service to not keep stale
    409      * host commands in the queue.
     410     * host messages in the queue.
    410411     * @deprecated  Replaced by GUEST_MSG_SKIP.
    411412     */
     
    433434     * @since   6.0
    434435     */
    435     GUEST_MAKE_ME_MASTER = 13,
     436    GUEST_MSG_MAKE_ME_MASTER = 13,
    436437    /** Prepares the starting of a session.
    437438     *
     
    455456     * @since   6.0
    456457     */
    457     GUEST_SESSION_PREPARE = 14,
     458    GUEST_MSG_SESSION_PREPARE = 14,
    458459    /** Cancels a prepared session.
    459460     *
     
    470471     * @since   6.0
    471472     */
    472     GUEST_SESSION_CANCEL_PREPARED = 15,
     473    GUEST_MSG_SESSION_CANCEL_PREPARED = 15,
    473474    /** Accepts a prepared session.
    474475     *
     
    490491     * @since   6.0
    491492     */
    492     GUEST_SESSION_ACCEPT = 16,
     493    GUEST_MSG_SESSION_ACCEPT = 16,
    493494    /**
    494495     * Guest reports back a guest session status.
    495496     * @todo proper docs.
    496497     */
    497     GUEST_SESSION_NOTIFY = 20,
     498    GUEST_MSG_SESSION_NOTIFY = 20,
    498499    /**
    499500     * Guest wants to close a specific guest session.
    500501     * @todo proper docs.
    501502     */
    502     GUEST_SESSION_CLOSE = 21,
     503    GUEST_MSG_SESSION_CLOSE = 21,
    503504
    504505    /**
     
    506507     * @todo proper docs.
    507508     */
    508     GUEST_EXEC_OUTPUT = 100,
     509    GUEST_MSG_EXEC_OUTPUT = 100,
    509510    /**
    510511     * Guest sends a status update of an executed process to the host.
    511512     * @todo proper docs.
    512513     */
    513     GUEST_EXEC_STATUS = 101,
     514    GUEST_MSG_EXEC_STATUS = 101,
    514515    /**
    515516     * Guests sends an input status notification to the host.
    516517     * @todo proper docs.
    517518     */
    518     GUEST_EXEC_INPUT_STATUS = 102,
     519    GUEST_MSG_EXEC_INPUT_STATUS = 102,
    519520    /**
    520521     * Guest notifies the host about some I/O event. This can be
     
    524525     * @todo proper docs.
    525526     */
    526     GUEST_EXEC_IO_NOTIFY = 210,
     527    GUEST_MSG_EXEC_IO_NOTIFY = 210,
    527528    /**
    528529     * Guest notifies the host about some directory event.
    529530     * @todo proper docs.
    530531     */
    531     GUEST_DIR_NOTIFY = 230,
     532    GUEST_MSG_DIR_NOTIFY = 230,
    532533    /**
    533534     * Guest notifies the host about some file event.
    534535     * @todo proper docs.
    535536     */
    536     GUEST_FILE_NOTIFY = 240
     537    GUEST_MSG_FILE_NOTIFY = 240
    537538};
    538539
    539540/**
    540  * Translates a guest control host function function enum to at string.
     541 * Translates a guest control guest message enum to a string.
     542 *
    541543 * @returns Enum string name.
    542  * @param   enmFunction     The function name to translate.
    543  */
    544 DECLINLINE(const char *) GstCtrlGuestFnName(enum eGuestFn enmFunction)
    545 {
    546     switch (enmFunction)
     544 * @param   enmMsg              The message to translate.
     545 */
     546DECLINLINE(const char *) GstCtrlGuestMsgToStr(enum eGuestMsg enmMsg)
     547{
     548    switch (enmMsg)
    547549    {
    548550        RT_CASE_RET_STR(GUEST_MSG_WAIT);
    549551        RT_CASE_RET_STR(GUEST_MSG_CANCEL);
    550         RT_CASE_RET_STR(GUEST_DISCONNECTED);
     552        RT_CASE_RET_STR(GUEST_MSG_DISCONNECTED);
    551553        RT_CASE_RET_STR(GUEST_MSG_FILTER_SET);
    552554        RT_CASE_RET_STR(GUEST_MSG_FILTER_UNSET);
     
    558560        RT_CASE_RET_STR(GUEST_MSG_PROGRESS_UPDATE);
    559561        RT_CASE_RET_STR(GUEST_MSG_SKIP);
    560         RT_CASE_RET_STR(GUEST_MAKE_ME_MASTER);
    561         RT_CASE_RET_STR(GUEST_SESSION_PREPARE);
    562         RT_CASE_RET_STR(GUEST_SESSION_CANCEL_PREPARED);
    563         RT_CASE_RET_STR(GUEST_SESSION_ACCEPT);
    564         RT_CASE_RET_STR(GUEST_SESSION_NOTIFY);
    565         RT_CASE_RET_STR(GUEST_SESSION_CLOSE);
    566         RT_CASE_RET_STR(GUEST_EXEC_OUTPUT);
    567         RT_CASE_RET_STR(GUEST_EXEC_STATUS);
    568         RT_CASE_RET_STR(GUEST_EXEC_INPUT_STATUS);
    569         RT_CASE_RET_STR(GUEST_EXEC_IO_NOTIFY);
    570         RT_CASE_RET_STR(GUEST_DIR_NOTIFY);
    571         RT_CASE_RET_STR(GUEST_FILE_NOTIFY);
     562        RT_CASE_RET_STR(GUEST_MSG_MAKE_ME_MASTER);
     563        RT_CASE_RET_STR(GUEST_MSG_SESSION_PREPARE);
     564        RT_CASE_RET_STR(GUEST_MSG_SESSION_CANCEL_PREPARED);
     565        RT_CASE_RET_STR(GUEST_MSG_SESSION_ACCEPT);
     566        RT_CASE_RET_STR(GUEST_MSG_SESSION_NOTIFY);
     567        RT_CASE_RET_STR(GUEST_MSG_SESSION_CLOSE);
     568        RT_CASE_RET_STR(GUEST_MSG_EXEC_OUTPUT);
     569        RT_CASE_RET_STR(GUEST_MSG_EXEC_STATUS);
     570        RT_CASE_RET_STR(GUEST_MSG_EXEC_INPUT_STATUS);
     571        RT_CASE_RET_STR(GUEST_MSG_EXEC_IO_NOTIFY);
     572        RT_CASE_RET_STR(GUEST_MSG_DIR_NOTIFY);
     573        RT_CASE_RET_STR(GUEST_MSG_FILE_NOTIFY);
    572574    }
    573575    return "Unknown";
     
    655657
    656658/**
    657  * Waits for a host command to arrive. The structure then contains the
     659 * Waits for a host message to arrive. The structure then contains the
    658660 * actual message type + required number of parameters needed to successfully
    659  * retrieve that host command (in a next round).
    660  */
    661 typedef struct HGCMMsgCmdWaitFor
    662 {
    663     VBGLIOCHGCMCALL hdr;
    664     /**
    665      * The returned command the host wants to
    666      * run on the guest.
    667      */
     661 * retrieve that host message (in a next round).
     662 */
     663typedef struct HGCMMsgWaitFor
     664{
     665    VBGLIOCHGCMCALL hdr;
     666    /** The returned message the host wants to run on the guest. */
    668667    HGCMFunctionParameter msg;       /* OUT uint32_t */
    669668    /** Number of parameters the message needs. */
    670669    HGCMFunctionParameter num_parms; /* OUT uint32_t */
    671 } HGCMMsgCmdWaitFor;
    672 
    673 /**
    674  * Asks the guest control host service to set a command
     670} HGCMMsgWaitFor;
     671
     672/**
     673 * Asks the guest control host service to set a message
    675674 * filter for this client. This filter will then only
    676675 * deliver messages to the client which match the
    677676 * wanted context ID (ranges).
    678677 */
    679 typedef struct HGCMMsgCmdFilterSet
    680 {
    681     VBGLIOCHGCMCALL hdr;
    682     /** Value to filter for after filter mask
    683      *  was applied. */
     678typedef struct HGCMMsgFilterSet
     679{
     680    VBGLIOCHGCMCALL hdr;
     681    /** Value to filter for after filter mask was applied. */
    684682    HGCMFunctionParameter value;         /* IN uint32_t */
    685683    /** Mask to add to the current set filter. */
     
    689687    /** Filter flags; currently unused. */
    690688    HGCMFunctionParameter flags;         /* IN uint32_t */
    691 } HGCMMsgCmdFilterSet;
     689} HGCMMsgFilterSet;
    692690
    693691/**
     
    695693 * a previously set message filter again.
    696694 */
    697 typedef struct HGCMMsgCmdFilterUnset
     695typedef struct HGCMMsgFilterUnset
    698696{
    699697    VBGLIOCHGCMCALL hdr;
    700698    /** Unset flags; currently unused. */
    701699    HGCMFunctionParameter flags;    /* IN uint32_t */
    702 } HGCMMsgCmdFilterUnset;
     700} HGCMMsgFilterUnset;
    703701
    704702/**
    705703 * Asks the guest control host service to skip the
    706  * currently assigned host command returned by
     704 * currently assigned host message returned by
    707705 * VbglR3GuestCtrlMsgWaitFor().
    708706 */
    709 typedef struct HGCMMsgCmdSkip
     707typedef struct HGCMMsgSkip
    710708{
    711709    VBGLIOCHGCMCALL hdr;
    712710    /** Skip flags; currently unused. */
    713711    HGCMFunctionParameter flags;    /* IN uint32_t */
    714 } HGCMMsgCmdSkip;
     712} HGCMMsgSkip;
    715713
    716714/**
     
    723721} HGCMMsgCancelPendingWaits;
    724722
    725 typedef struct HGCMMsgCmdReply
     723typedef struct HGCMMsgReply
    726724{
    727725    VBGLIOCHGCMCALL hdr;
     
    734732    /** Optional payload to this reply. */
    735733    HGCMFunctionParameter payload;
    736 } HGCMMsgCmdReply;
     734} HGCMMsgReply;
    737735
    738736/**
  • trunk/src/VBox

    • Property svn:mergeinfo
      •  

        old new  
        88/branches/VBox-5.0/src/VBox:104938,104943,104950,104987-104988,104990,106453
        99/branches/VBox-5.1/src/VBox:112367,116543,116550,116568,116573
        10 /branches/VBox-5.2/src/VBox:119536,120083,120099,120213,120221,120239,123597-123598,123600-123601,123755,124263,124273,124277-124279,124284-124286,124288-124290,125768,125779-125780,125812
         10/branches/VBox-5.2/src/VBox:119536,120083,120099,120213,120221,120239,123597-123598,123600-123601,123755,124263,124273,124277-124279,124284-124286,124288-124290,125768,125779-125780,125812,127158-127159,127162-127167,127180
        1111/branches/andy/draganddrop/src/VBox:90781-91268
        1212/branches/andy/guestctrl20/src/VBox:78916,78930
  • trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibGuestCtrl.cpp

    r76553 r76958  
    9494    AssertPtrReturn(pcParameters, VERR_INVALID_POINTER);
    9595
    96     HGCMMsgCmdWaitFor Msg;
     96    HGCMMsgWaitFor Msg;
    9797    VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient,
    98                        GUEST_MSG_WAIT,      /* Tell the host we want our next command. */
     98                       GUEST_MSG_WAIT,      /* Tell the host we want our next message. */
    9999                       2);                  /* Just peek for the next message! */
    100100    VbglHGCMParmUInt32Set(&Msg.msg, 0);
     
    103103    /*
    104104     * We should always get a VERR_TOO_MUCH_DATA response here, see
    105      * guestControl::HostCommand::Peek() and its caller ClientState::SendReply().
     105     * guestControl::HostMessage::Peek() and its caller ClientState::SendReply().
    106106     * We accept success too here, in case someone decide to make the protocol
    107107     * slightly more sane.
     
    166166    /*
    167167     * Seems we get VINF_SUCCESS back from the host if we try unsupported
    168      * guest control functions, so we need to supply some random message
     168     * guest control messages, so we need to supply some random message
    169169     * parameters and check that they change.
    170170     */
     
    301301    {
    302302        VBGLIOCHGCMCALL Hdr;
    303         VBGL_HGCM_HDR_INIT(&Hdr, idClient, GUEST_MAKE_ME_MASTER, 0);
     303        VBGL_HGCM_HDR_INIT(&Hdr, idClient, GUEST_MSG_MAKE_ME_MASTER, 0);
    304304        rc = VbglR3HGCMCall(&Hdr, sizeof(Hdr));
    305305    } while (rc == VERR_INTERRUPTED);
     
    403403
    404404/**
    405  * Asks the host guest control service to set a command filter to this
    406  * client so that it only will receive certain commands in the future.
     405 * Asks the host guest control service to set a message filter to this
     406 * client so that it only will receive certain messages in the future.
    407407 * The filter(s) are a bitmask for the context IDs, served from the host.
    408408 *
     
    415415VBGLR3DECL(int) VbglR3GuestCtrlMsgFilterSet(uint32_t idClient, uint32_t uValue, uint32_t uMaskAdd, uint32_t uMaskRemove)
    416416{
    417     HGCMMsgCmdFilterSet Msg;
     417    HGCMMsgFilterSet Msg;
    418418
    419419    /* Tell the host we want to set a filter. */
     
    443443    /* Everything else is optional. */
    444444
    445     HGCMMsgCmdReply Msg;
     445    HGCMMsgReply Msg;
    446446    VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, GUEST_MSG_REPLY, 4);
    447447    VbglHGCMParmUInt32Set(&Msg.context, pCtx->uContextID);
     
    491491VBGLR3DECL(int) VbglR3GuestCtrlMsgSkipOld(uint32_t idClient)
    492492{
    493     HGCMMsgCmdSkip Msg;
    494 
    495     /* Tell the host we want to skip the current assigned command. */
     493    HGCMMsgSkip Msg;
     494
     495    /* Tell the host we want to skip the current assigned message. */
    496496    VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient, GUEST_MSG_SKIP_OLD, 1);
    497497    VbglHGCMParmUInt32Set(&Msg.flags, 0 /* Flags, unused */);
     
    530530            HGCMFunctionParameter   pKey;
    531531        } Msg;
    532         VBGL_HGCM_HDR_INIT(&Msg.Hdr, idClient, GUEST_SESSION_PREPARE, 2);
     532        VBGL_HGCM_HDR_INIT(&Msg.Hdr, idClient, GUEST_MSG_SESSION_PREPARE, 2);
    533533        VbglHGCMParmUInt32Set(&Msg.idSession, idSession);
    534534        VbglHGCMParmPtrSet(&Msg.pKey, (void *)pvKey, cbKey);
     
    555555            HGCMFunctionParameter   pKey;
    556556        } Msg;
    557         VBGL_HGCM_HDR_INIT(&Msg.Hdr, idClient, GUEST_SESSION_ACCEPT, 2);
     557        VBGL_HGCM_HDR_INIT(&Msg.Hdr, idClient, GUEST_MSG_SESSION_ACCEPT, 2);
    558558        VbglHGCMParmUInt32Set(&Msg.idSession, idSession);
    559559        VbglHGCMParmPtrSet(&Msg.pKey, (void *)pvKey, cbKey);
     
    579579            HGCMFunctionParameter   idSession;
    580580        } Msg;
    581         VBGL_HGCM_HDR_INIT(&Msg.Hdr, idClient, GUEST_SESSION_CANCEL_PREPARED, 1);
     581        VBGL_HGCM_HDR_INIT(&Msg.Hdr, idClient, GUEST_MSG_SESSION_CANCEL_PREPARED, 1);
    582582        VbglHGCMParmUInt32Set(&Msg.idSession, idSession);
    583583        rc = VbglR3HGCMCall(&Msg.Hdr, sizeof(Msg));
     
    601601
    602602    HGCMMsgSessionClose Msg;
    603     VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, GUEST_SESSION_CLOSE, pCtx->uNumParms);
     603    VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, GUEST_MSG_SESSION_CLOSE, pCtx->uNumParms);
    604604    VbglHGCMParmUInt32Set(&Msg.context, pCtx->uContextID);
    605605    VbglHGCMParmUInt32Set(&Msg.flags, fFlags);
     
    614614
    615615    HGCMMsgSessionNotify Msg;
    616     VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, GUEST_SESSION_NOTIFY, 3);
     616    VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, GUEST_MSG_SESSION_NOTIFY, 3);
    617617    VbglHGCMParmUInt32Set(&Msg.context, pCtx->uContextID);
    618618    VbglHGCMParmUInt32Set(&Msg.type, uType);
     
    647647        HGCMMsgSessionOpen Msg;
    648648        VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, vbglR3GuestCtrlGetMsgFunctionNo(pCtx->uClientID), pCtx->uNumParms);
    649         VbglHGCMParmUInt32Set(&Msg.context, HOST_SESSION_CREATE);
     649        VbglHGCMParmUInt32Set(&Msg.context, HOST_MSG_SESSION_CREATE);
    650650        VbglHGCMParmUInt32Set(&Msg.protocol, 0);
    651651        VbglHGCMParmPtrSet(&Msg.username, pszUser, cbUser);
     
    685685        HGCMMsgSessionClose Msg;
    686686        VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, vbglR3GuestCtrlGetMsgFunctionNo(pCtx->uClientID), pCtx->uNumParms);
    687         VbglHGCMParmUInt32Set(&Msg.context, HOST_SESSION_CLOSE);
     687        VbglHGCMParmUInt32Set(&Msg.context, HOST_MSG_SESSION_CLOSE);
    688688        VbglHGCMParmUInt32Set(&Msg.flags, 0);
    689689
     
    724724        HGCMMsgPathRename Msg;
    725725        VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, vbglR3GuestCtrlGetMsgFunctionNo(pCtx->uClientID), pCtx->uNumParms);
    726         VbglHGCMParmUInt32Set(&Msg.context, HOST_PATH_RENAME);
     726        VbglHGCMParmUInt32Set(&Msg.context, HOST_MSG_PATH_RENAME);
    727727        VbglHGCMParmPtrSet(&Msg.source, pszSource, cbSource);
    728728        VbglHGCMParmPtrSet(&Msg.dest, pszDest, cbDest);
     
    754754        HGCMMsgPathUserDocuments Msg;
    755755        VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, vbglR3GuestCtrlGetMsgFunctionNo(pCtx->uClientID), pCtx->uNumParms);
    756         VbglHGCMParmUInt32Set(&Msg.context, HOST_PATH_USER_DOCUMENTS);
     756        VbglHGCMParmUInt32Set(&Msg.context, HOST_MSG_PATH_USER_DOCUMENTS);
    757757
    758758        rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg));
     
    777777        HGCMMsgPathUserHome Msg;
    778778        VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, vbglR3GuestCtrlGetMsgFunctionNo(pCtx->uClientID), pCtx->uNumParms);
    779         VbglHGCMParmUInt32Set(&Msg.context, HOST_PATH_USER_HOME);
     779        VbglHGCMParmUInt32Set(&Msg.context, HOST_MSG_PATH_USER_HOME);
    780780
    781781        rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg));
     
    819819        HGCMMsgProcExec Msg;
    820820        VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, vbglR3GuestCtrlGetMsgFunctionNo(pCtx->uClientID), pCtx->uNumParms);
    821         VbglHGCMParmUInt32Set(&Msg.context, HOST_EXEC_CMD);
     821        VbglHGCMParmUInt32Set(&Msg.context, HOST_MSG_EXEC_CMD);
    822822        VbglHGCMParmPtrSet(&Msg.cmd, pszCmd, cbCmd);
    823823        VbglHGCMParmUInt32Set(&Msg.flags, 0);
     
    894894        HGCMMsgProcOutput Msg;
    895895        VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, vbglR3GuestCtrlGetMsgFunctionNo(pCtx->uClientID), pCtx->uNumParms);
    896         VbglHGCMParmUInt32Set(&Msg.context, HOST_EXEC_GET_OUTPUT);
     896        VbglHGCMParmUInt32Set(&Msg.context, HOST_MSG_EXEC_GET_OUTPUT);
    897897        VbglHGCMParmUInt32Set(&Msg.pid, 0);
    898898        VbglHGCMParmUInt32Set(&Msg.handle, 0);
     
    936936        HGCMMsgProcInput Msg;
    937937        VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, vbglR3GuestCtrlGetMsgFunctionNo(pCtx->uClientID), pCtx->uNumParms);
    938         VbglHGCMParmUInt32Set(&Msg.context, HOST_EXEC_SET_INPUT);
     938        VbglHGCMParmUInt32Set(&Msg.context, HOST_MSG_EXEC_SET_INPUT);
    939939        VbglHGCMParmUInt32Set(&Msg.pid, 0);
    940940        VbglHGCMParmUInt32Set(&Msg.flags, 0);
     
    978978        HGCMMsgDirRemove Msg;
    979979        VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, vbglR3GuestCtrlGetMsgFunctionNo(pCtx->uClientID), pCtx->uNumParms);
    980         VbglHGCMParmUInt32Set(&Msg.context, HOST_DIR_REMOVE);
     980        VbglHGCMParmUInt32Set(&Msg.context, HOST_MSG_DIR_REMOVE);
    981981        VbglHGCMParmPtrSet(&Msg.path, pszPath, cbPath);
    982982        VbglHGCMParmUInt32Set(&Msg.flags, 0);
     
    10231023        HGCMMsgFileOpen Msg;
    10241024        VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, vbglR3GuestCtrlGetMsgFunctionNo(pCtx->uClientID), pCtx->uNumParms);
    1025         VbglHGCMParmUInt32Set(&Msg.context, HOST_FILE_OPEN);
     1025        VbglHGCMParmUInt32Set(&Msg.context, HOST_MSG_FILE_OPEN);
    10261026        VbglHGCMParmPtrSet(&Msg.filename, pszFileName, cbFileName);
    10271027        VbglHGCMParmPtrSet(&Msg.openmode, pszAccess, cbAccess);
     
    10581058        HGCMMsgFileClose Msg;
    10591059        VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, vbglR3GuestCtrlGetMsgFunctionNo(pCtx->uClientID), pCtx->uNumParms);
    1060         VbglHGCMParmUInt32Set(&Msg.context, HOST_FILE_CLOSE);
     1060        VbglHGCMParmUInt32Set(&Msg.context, HOST_MSG_FILE_CLOSE);
    10611061        VbglHGCMParmUInt32Set(&Msg.handle, 0);
    10621062
     
    10881088        HGCMMsgFileRead Msg;
    10891089        VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, vbglR3GuestCtrlGetMsgFunctionNo(pCtx->uClientID), pCtx->uNumParms);
    1090         VbglHGCMParmUInt32Set(&Msg.context, HOST_FILE_READ);
     1090        VbglHGCMParmUInt32Set(&Msg.context, HOST_MSG_FILE_READ);
    10911091        VbglHGCMParmUInt32Set(&Msg.handle, 0);
    10921092        VbglHGCMParmUInt32Set(&Msg.size, 0);
     
    11211121        HGCMMsgFileReadAt Msg;
    11221122        VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, vbglR3GuestCtrlGetMsgFunctionNo(pCtx->uClientID), pCtx->uNumParms);
    1123         VbglHGCMParmUInt32Set(&Msg.context, HOST_FILE_READ_AT);
     1123        VbglHGCMParmUInt32Set(&Msg.context, HOST_MSG_FILE_READ_AT);
    11241124        VbglHGCMParmUInt32Set(&Msg.handle, 0);
    11251125        VbglHGCMParmUInt32Set(&Msg.offset, 0);
     
    11581158        HGCMMsgFileWrite Msg;
    11591159        VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, vbglR3GuestCtrlGetMsgFunctionNo(pCtx->uClientID), pCtx->uNumParms);
    1160         VbglHGCMParmUInt32Set(&Msg.context, HOST_FILE_WRITE);
     1160        VbglHGCMParmUInt32Set(&Msg.context, HOST_MSG_FILE_WRITE);
    11611161        VbglHGCMParmUInt32Set(&Msg.handle, 0);
    11621162        VbglHGCMParmPtrSet(&Msg.data, pvData, cbData);
     
    11981198        HGCMMsgFileWriteAt Msg;
    11991199        VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, vbglR3GuestCtrlGetMsgFunctionNo(pCtx->uClientID), pCtx->uNumParms);
    1200         VbglHGCMParmUInt32Set(&Msg.context, HOST_FILE_WRITE_AT);
     1200        VbglHGCMParmUInt32Set(&Msg.context, HOST_MSG_FILE_WRITE_AT);
    12011201        VbglHGCMParmUInt32Set(&Msg.handle, 0);
    12021202        VbglHGCMParmPtrSet(&Msg.data, pvData, cbData);
     
    12391239        HGCMMsgFileSeek Msg;
    12401240        VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, vbglR3GuestCtrlGetMsgFunctionNo(pCtx->uClientID), pCtx->uNumParms);
    1241         VbglHGCMParmUInt32Set(&Msg.context, HOST_FILE_SEEK);
     1241        VbglHGCMParmUInt32Set(&Msg.context, HOST_MSG_FILE_SEEK);
    12421242        VbglHGCMParmUInt32Set(&Msg.handle, 0);
    12431243        VbglHGCMParmUInt32Set(&Msg.method, 0);
     
    12721272        HGCMMsgFileTell Msg;
    12731273        VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, vbglR3GuestCtrlGetMsgFunctionNo(pCtx->uClientID), pCtx->uNumParms);
    1274         VbglHGCMParmUInt32Set(&Msg.context, HOST_FILE_TELL);
     1274        VbglHGCMParmUInt32Set(&Msg.context, HOST_MSG_FILE_TELL);
    12751275        VbglHGCMParmUInt32Set(&Msg.handle, 0);
    12761276
     
    13011301        HGCMMsgProcTerminate Msg;
    13021302        VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, vbglR3GuestCtrlGetMsgFunctionNo(pCtx->uClientID), pCtx->uNumParms);
    1303         VbglHGCMParmUInt32Set(&Msg.context, HOST_EXEC_TERMINATE);
     1303        VbglHGCMParmUInt32Set(&Msg.context, HOST_MSG_EXEC_TERMINATE);
    13041304        VbglHGCMParmUInt32Set(&Msg.pid, 0);
    13051305
     
    13311331        HGCMMsgProcWaitFor Msg;
    13321332        VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, vbglR3GuestCtrlGetMsgFunctionNo(pCtx->uClientID), pCtx->uNumParms);
    1333         VbglHGCMParmUInt32Set(&Msg.context, HOST_EXEC_WAIT_FOR);
     1333        VbglHGCMParmUInt32Set(&Msg.context, HOST_MSG_EXEC_WAIT_FOR);
    13341334        VbglHGCMParmUInt32Set(&Msg.pid, 0);
    13351335        VbglHGCMParmUInt32Set(&Msg.flags, 0);
     
    13551355
    13561356    HGCMReplyFileNotify Msg;
    1357     VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, GUEST_FILE_NOTIFY, 4);
     1357    VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, GUEST_MSG_FILE_NOTIFY, 4);
    13581358    VbglHGCMParmUInt32Set(&Msg.context, pCtx->uContextID);
    13591359    VbglHGCMParmUInt32Set(&Msg.type, GUEST_FILE_NOTIFYTYPE_OPEN);
     
    13711371
    13721372    HGCMReplyFileNotify Msg;
    1373     VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, GUEST_FILE_NOTIFY, 3);
     1373    VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, GUEST_MSG_FILE_NOTIFY, 3);
    13741374    VbglHGCMParmUInt32Set(&Msg.context, pCtx->uContextID);
    13751375    VbglHGCMParmUInt32Set(&Msg.type, GUEST_FILE_NOTIFYTYPE_CLOSE);
     
    13851385
    13861386    HGCMReplyFileNotify Msg;
    1387     VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, GUEST_FILE_NOTIFY, 3);
     1387    VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, GUEST_MSG_FILE_NOTIFY, 3);
    13881388    VbglHGCMParmUInt32Set(&Msg.context, pCtx->uContextID);
    13891389    VbglHGCMParmUInt32Set(&Msg.type, GUEST_FILE_NOTIFYTYPE_ERROR);
     
    14011401
    14021402    HGCMReplyFileNotify Msg;
    1403     VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, GUEST_FILE_NOTIFY, 4);
     1403    VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, GUEST_MSG_FILE_NOTIFY, 4);
    14041404    VbglHGCMParmUInt32Set(&Msg.context, pCtx->uContextID);
    14051405    VbglHGCMParmUInt32Set(&Msg.type, GUEST_FILE_NOTIFYTYPE_READ);
     
    14171417
    14181418    HGCMReplyFileNotify Msg;
    1419     VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, GUEST_FILE_NOTIFY, 4);
     1419    VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, GUEST_MSG_FILE_NOTIFY, 4);
    14201420    VbglHGCMParmUInt32Set(&Msg.context, pCtx->uContextID);
    14211421    VbglHGCMParmUInt32Set(&Msg.type, GUEST_FILE_NOTIFYTYPE_WRITE);
     
    14331433
    14341434    HGCMReplyFileNotify Msg;
    1435     VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, GUEST_FILE_NOTIFY, 4);
     1435    VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, GUEST_MSG_FILE_NOTIFY, 4);
    14361436    VbglHGCMParmUInt32Set(&Msg.context, pCtx->uContextID);
    14371437    VbglHGCMParmUInt32Set(&Msg.type, GUEST_FILE_NOTIFYTYPE_SEEK);
     
    14491449
    14501450    HGCMReplyFileNotify Msg;
    1451     VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, GUEST_FILE_NOTIFY, 4);
     1451    VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, GUEST_MSG_FILE_NOTIFY, 4);
    14521452    VbglHGCMParmUInt32Set(&Msg.context, pCtx->uContextID);
    14531453    VbglHGCMParmUInt32Set(&Msg.type, GUEST_FILE_NOTIFYTYPE_TELL);
     
    14721472
    14731473    HGCMMsgProcStatus Msg;
    1474     VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, GUEST_EXEC_STATUS, 5);
     1474    VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, GUEST_MSG_EXEC_STATUS, 5);
    14751475    VbglHGCMParmUInt32Set(&Msg.context, pCtx->uContextID);
    14761476    VbglHGCMParmUInt32Set(&Msg.pid, uPID);
     
    14961496
    14971497    HGCMMsgProcOutput Msg;
    1498     VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, GUEST_EXEC_OUTPUT, 5);
     1498    VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, GUEST_MSG_EXEC_OUTPUT, 5);
    14991499    VbglHGCMParmUInt32Set(&Msg.context, pCtx->uContextID);
    15001500    VbglHGCMParmUInt32Set(&Msg.pid, uPID);
     
    15201520
    15211521    HGCMMsgProcStatusInput Msg;
    1522     VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, GUEST_EXEC_INPUT_STATUS, 5);
     1522    VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, GUEST_MSG_EXEC_INPUT_STATUS, 5);
    15231523    VbglHGCMParmUInt32Set(&Msg.context, pCtx->uContextID);
    15241524    VbglHGCMParmUInt32Set(&Msg.pid, uPID);
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControl.cpp

    r76553 r76958  
    245245    Assert(g_idControlSvcClient > 0);
    246246
    247     /* Allocate a scratch buffer for commands which also send
     247    /* Allocate a scratch buffer for messages which also send
    248248     * payload data with them. */
    249249    uint32_t cbScratchBuf = _64K; /** @todo Make buffer size configurable via guest properties/argv! */
     
    264264            cRetrievalFailed = 0; /* Reset failed retrieval count. */
    265265            VGSvcVerbose(4, "idMsg=%RU32 (%s) (%RU32 parms) retrieved\n",
    266                          idMsg, GstCtrlHostFnName((eHostFn)idMsg), ctxHost.uNumParms);
     266                         idMsg, GstCtrlHostMsgtoStr((eHostMsg)idMsg), ctxHost.uNumParms);
    267267
    268268            /*
     
    271271            switch (idMsg)
    272272            {
    273                 case HOST_CANCEL_PENDING_WAITS:
     273                case HOST_MSG_CANCEL_PENDING_WAITS:
    274274                    VGSvcVerbose(1, "We were asked to quit ...\n");
    275275                    break;
    276276
    277                 case HOST_SESSION_CREATE:
     277                case HOST_MSG_SESSION_CREATE:
    278278                    rc = vgsvcGstCtrlHandleSessionOpen(&ctxHost);
    279279                    break;
    280280
    281281                /* This message is also sent to the child session process (by the host). */
    282                 case HOST_SESSION_CLOSE:
     282                case HOST_MSG_SESSION_CLOSE:
    283283                    rc = vgsvcGstCtrlHandleSessionClose(&ctxHost);
    284284                    break;
     
    289289                        rc = VbglR3GuestCtrlMsgSkip(g_idControlSvcClient, VERR_NOT_SUPPORTED, idMsg);
    290290                        VGSvcVerbose(1, "Skipped unexpected message idMsg=%RU32 (%s), cParms=%RU32 (rc=%Rrc)\n",
    291                                      idMsg, GstCtrlHostFnName((eHostFn)idMsg), ctxHost.uNumParms, rc);
     291                                     idMsg, GstCtrlHostMsgtoStr((eHostMsg)idMsg), ctxHost.uNumParms, rc);
    292292                    }
    293293                    else
     
    300300
    301301            /* Do we need to shutdown? */
    302             if (idMsg == HOST_CANCEL_PENDING_WAITS)
     302            if (idMsg == HOST_MSG_CANCEL_PENDING_WAITS)
    303303                break;
    304304
     
    561561#endif
    562562    "    --control-interval      Specifies the interval at which to check for\n"
    563     "                            new control commands. The default is 1000 ms.\n"
     563    "                            new control messages. The default is 1000 ms.\n"
    564564    ,
    565565    /* methods */
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlSession.cpp

    r76553 r76958  
    939939                                                *ppvScratchBuf, RT_MIN(cbInput, *pcbScratchBuf));
    940940            if (RT_FAILURE(rc))
    941                 VGSvcError("Error handling input command for PID=%RU32, rc=%Rrc\n", uPID, rc);
     941                VGSvcError("Error handling input message for PID=%RU32, rc=%Rrc\n", uPID, rc);
    942942            VGSvcGstCtrlProcessRelease(pProcess);
    943943        }
     
    11291129    switch (uMsg)
    11301130    {
    1131         case HOST_SESSION_CLOSE:
     1131        case HOST_MSG_SESSION_CLOSE:
    11321132            /* Shutdown (this spawn). */
    11331133            rc = VGSvcGstCtrlSessionClose(pSession);
     
    11351135            break;
    11361136
    1137         case HOST_DIR_REMOVE:
     1137        case HOST_MSG_DIR_REMOVE:
    11381138            if (fImpersonated)
    11391139                rc = vgsvcGstCtrlSessionHandleDirRemove(pSession, pHostCtx);
    11401140            break;
    11411141
    1142         case HOST_EXEC_CMD:
     1142        case HOST_MSG_EXEC_CMD:
    11431143            rc = vgsvcGstCtrlSessionHandleProcExec(pSession, pHostCtx);
    11441144            break;
    11451145
    1146         case HOST_EXEC_SET_INPUT:
     1146        case HOST_MSG_EXEC_SET_INPUT:
    11471147            rc = vgsvcGstCtrlSessionHandleProcInput(pSession, pHostCtx, ppvScratchBuf, pcbScratchBuf);
    11481148            break;
    11491149
    1150         case HOST_EXEC_GET_OUTPUT:
     1150        case HOST_MSG_EXEC_GET_OUTPUT:
    11511151            rc = vgsvcGstCtrlSessionHandleProcOutput(pSession, pHostCtx);
    11521152            break;
    11531153
    1154         case HOST_EXEC_TERMINATE:
     1154        case HOST_MSG_EXEC_TERMINATE:
    11551155            rc = vgsvcGstCtrlSessionHandleProcTerminate(pSession, pHostCtx);
    11561156            break;
    11571157
    1158         case HOST_EXEC_WAIT_FOR:
     1158        case HOST_MSG_EXEC_WAIT_FOR:
    11591159            rc = vgsvcGstCtrlSessionHandleProcWaitFor(pSession, pHostCtx);
    11601160            break;
    11611161
    1162         case HOST_FILE_OPEN:
     1162        case HOST_MSG_FILE_OPEN:
    11631163            if (fImpersonated)
    11641164                rc = vgsvcGstCtrlSessionHandleFileOpen(pSession, pHostCtx);
    11651165            break;
    11661166
    1167         case HOST_FILE_CLOSE:
     1167        case HOST_MSG_FILE_CLOSE:
    11681168            if (fImpersonated)
    11691169                rc = vgsvcGstCtrlSessionHandleFileClose(pSession, pHostCtx);
    11701170            break;
    11711171
    1172         case HOST_FILE_READ:
     1172        case HOST_MSG_FILE_READ:
    11731173            if (fImpersonated)
    11741174                rc = vgsvcGstCtrlSessionHandleFileRead(pSession, pHostCtx, ppvScratchBuf, pcbScratchBuf);
    11751175            break;
    11761176
    1177         case HOST_FILE_READ_AT:
     1177        case HOST_MSG_FILE_READ_AT:
    11781178            if (fImpersonated)
    11791179                rc = vgsvcGstCtrlSessionHandleFileReadAt(pSession, pHostCtx, ppvScratchBuf, pcbScratchBuf);
    11801180            break;
    11811181
    1182         case HOST_FILE_WRITE:
     1182        case HOST_MSG_FILE_WRITE:
    11831183            if (fImpersonated)
    11841184                rc = vgsvcGstCtrlSessionHandleFileWrite(pSession, pHostCtx, ppvScratchBuf, pcbScratchBuf);
    11851185            break;
    11861186
    1187         case HOST_FILE_WRITE_AT:
     1187        case HOST_MSG_FILE_WRITE_AT:
    11881188            if (fImpersonated)
    11891189                rc = vgsvcGstCtrlSessionHandleFileWriteAt(pSession, pHostCtx, ppvScratchBuf, pcbScratchBuf);
    11901190            break;
    11911191
    1192         case HOST_FILE_SEEK:
     1192        case HOST_MSG_FILE_SEEK:
    11931193            if (fImpersonated)
    11941194                rc = vgsvcGstCtrlSessionHandleFileSeek(pSession, pHostCtx);
    11951195            break;
    11961196
    1197         case HOST_FILE_TELL:
     1197        case HOST_MSG_FILE_TELL:
    11981198            if (fImpersonated)
    11991199                rc = vgsvcGstCtrlSessionHandleFileTell(pSession, pHostCtx);
    12001200            break;
    12011201
    1202         case HOST_PATH_RENAME:
     1202        case HOST_MSG_PATH_RENAME:
    12031203            if (fImpersonated)
    12041204                rc = vgsvcGstCtrlSessionHandlePathRename(pSession, pHostCtx);
    12051205            break;
    12061206
    1207         case HOST_PATH_USER_DOCUMENTS:
     1207        case HOST_MSG_PATH_USER_DOCUMENTS:
    12081208            if (fImpersonated)
    12091209                rc = vgsvcGstCtrlSessionHandlePathUserDocuments(pSession, pHostCtx);
    12101210            break;
    12111211
    1212         case HOST_PATH_USER_HOME:
     1212        case HOST_MSG_PATH_USER_HOME:
    12131213            if (fImpersonated)
    12141214                rc = vgsvcGstCtrlSessionHandlePathUserHome(pSession, pHostCtx);
     
    15291529        {
    15301530            /*
    1531              * Allocate a scratch buffer for commands which also send payload data with them.
     1531             * Allocate a scratch buffer for messages which also send payload data with them.
    15321532             * This buffer may grow if the host sends us larger chunks of data.
    15331533             */
  • trunk/src/VBox/HostServices/GuestControl/service.cpp

    r76956 r76958  
    1818/** @page pg_svc_guest_control   Guest Control HGCM Service
    1919 *
    20  * This service acts as a proxy for handling and buffering host command requests
     20 * This service acts as a proxy for handling and buffering host message requests
    2121 * and clients on the guest. It tries to be as transparent as possible to let
    2222 * the guest (client) and host side do their protocol handling as desired.
     
    2626 *           which wants to control something on the guest.
    2727 * - Client: A client (e.g. VBoxService) running inside the guest OS waiting for
    28  *           new host commands to perform. There can be multiple clients connected
     28 *           new host messages to perform. There can be multiple clients connected
    2929 *           to this service. A client is represented by its unique HGCM client ID.
    3030 * - Context ID: An (almost) unique ID automatically generated on the host (Main API)
     
    3333 *               an indicator which it can refer to later. This context ID gets
    3434 *               internally bound by the service to a client which actually processes
    35  *               the command in order to have a relationship between client<->context ID(s).
    36  *
    37  * The host can trigger commands which get buffered by the service (with full HGCM
     35 *               the message in order to have a relationship between client<->context ID(s).
     36 *
     37 * The host can trigger messages which get buffered by the service (with full HGCM
    3838 * parameter info). As soon as a client connects (or is ready to do some new work)
    39  * it gets a buffered host command to process it. This command then will be immediately
    40  * removed from the command list. If there are ready clients but no new commands to be
     39 * it gets a buffered host message  to process it. This message then will be immediately
     40 * removed from the message list. If there are ready clients but no new messages to be
    4141 * processed, these clients will be set into a deferred state (that is being blocked
    42  * to return until a new command is available).
     42 * to return until a new host message is available).
    4343 *
    4444 * If a client needs to inform the host that something happened, it can send a
     
    104104
    105105/**
    106  * Structure for holding a buffered host command which has
     106 * Structure for holding a buffered host message which has
    107107 * not been processed yet.
    108108 *
    109109 * @todo r=bird: It would be nice if we could decide on _one_ term for what the
    110110 *       host passes to the guest.  We currently have:
    111  *          - The enum is called eHostFn, implying it's a function
    112  *          - The guest retrieves messages, if the eGuestFn enum is anything to
    113  *            go by: GUEST_MSG_GET, GUEST_MSG_CANCEL, GUEST_MSG_XXX
    114  *          - Here it's called a host command.
    115  *          - But this HostCommand structure has a mMsgType rather than command
    116  *            number/enum value, impliying it's a message.
    117  */
    118 typedef struct HostCommand
    119 {
    120     /** Entry on the ClientState::m_HostCmdList list. */
     111 *          - The enum is called eHostMsg, implying it's a function
     112 */
     113typedef struct HostMsg
     114{
     115    /** Entry on the ClientState::m_HostMsgList list. */
    121116    RTLISTNODE      m_ListEntry;
    122117    union
     
    125120         * See VBOX_GUESTCTRL_DST_XXX.  */
    126121        uint64_t    m_idContextAndDst;
    127         /** The context ID this command belongs to (extracted from the first parameter). */
     122        /** The context ID this message belongs to (extracted from the first parameter). */
    128123        uint32_t    m_idContext;
    129124    };
    130125    /** Dynamic structure for holding the HGCM parms */
    131     uint32_t mMsgType;
     126    uint32_t mType;
    132127    /** Number of HGCM parameters. */
    133128    uint32_t mParmCount;
     
    137132    bool m_f60BetaHackInPlay;
    138133
    139     HostCommand()
     134    HostMsg()
    140135        : m_idContextAndDst(0)
    141         , mMsgType(UINT32_MAX)
     136        , mType(UINT32_MAX)
    142137        , mParmCount(0)
    143138        , mpParms(NULL)
     
    148143
    149144    /**
    150      * Releases the host command, properly deleting it if no further references.
     145     * Releases the host message, properly deleting it if no further references.
    151146     */
    152147    void Delete(void)
    153148    {
    154         LogFlowThisFunc(("[Cmd %RU32 (%s)] destroying\n", mMsgType, GstCtrlHostFnName((eHostFn)mMsgType)));
     149        LogFlowThisFunc(("[Msg %RU32 (%s)] destroying\n", mType, GstCtrlHostMsgtoStr((eHostMsg)mType)));
    155150        Assert(m_ListEntry.pNext == NULL);
    156151        if (mpParms)
     
    171166
    172167    /**
    173      * Initializes the command.
     168     * Initializes the message.
    174169     *
    175170     * The specified parameters are copied and any buffers referenced by it
     
    177172     *
    178173     * @returns VBox status code.
    179      * @param   idFunction  The host function (message) number, eHostFn.
     174     * @param   idMsg       The host message number, eHostMsg.
    180175     * @param   cParms      Number of parameters in the HGCM request.
    181176     * @param   paParms     Array of parameters.
    182177     */
    183     int Init(uint32_t idFunction, uint32_t cParms, VBOXHGCMSVCPARM paParms[])
    184     {
    185         LogFlowThisFunc(("[Cmd %RU32 (%s)] Allocating cParms=%RU32, paParms=%p\n",
    186                          idFunction, GstCtrlHostFnName((eHostFn)idFunction), cParms, paParms));
     178    int Init(uint32_t idMsg, uint32_t cParms, VBOXHGCMSVCPARM paParms[])
     179    {
     180        LogFlowThisFunc(("[Msg %RU32 (%s)] Allocating cParms=%RU32, paParms=%p\n",
     181                         idMsg, GstCtrlHostMsgtoStr((eHostMsg)idMsg), cParms, paParms));
    187182        Assert(mpParms == NULL);
    188183        Assert(mParmCount == 0);
     
    197192
    198193        /*
    199          * The first parameter is the context ID and the command destiation mask.
     194         * The first parameter is the context ID and the message destination mask.
    200195         */
    201196        if (paParms[0].type == VBOX_HGCM_SVC_PARM_64BIT)
     
    206201        else if (paParms[0].type == VBOX_HGCM_SVC_PARM_32BIT)
    207202        {
    208             AssertMsgFailed(("idFunction=%u %s - caller must set dst!\n", idFunction, GstCtrlHostFnName((eHostFn)idFunction)));
     203            AssertMsgFailed(("idMsg=%u %s - caller must set dst!\n", idMsg, GstCtrlHostMsgtoStr((eHostMsg)idMsg)));
    209204            m_idContextAndDst = paParms[0].u.uint32 | VBOX_GUESTCTRL_DST_BOTH;
    210205        }
     
    215210         * Just make a copy of the parameters and any buffers.
    216211         */
    217         mMsgType   = idFunction;
     212        mType   = idMsg;
    218213        mParmCount = cParms;
    219214        mpParms    = (VBOXHGCMSVCPARM *)RTMemAllocZ(sizeof(VBOXHGCMSVCPARM) * mParmCount);
     
    244239
    245240                default:
    246                     AssertMsgFailedReturn(("idFunction=%u (%s) parameter #%u: type=%u\n",
    247                                            idFunction, GstCtrlHostFnName((eHostFn)idFunction), i, paParms[i].type),
     241                    AssertMsgFailedReturn(("idMsg=%u (%s) parameter #%u: type=%u\n",
     242                                           idMsg, GstCtrlHostMsgtoStr((eHostMsg)idMsg), i, paParms[i].type),
    248243                                          VERR_WRONG_PARAMETER_TYPE);
    249244            }
     
    271266        Assert(cDstParms >= 2);
    272267        if (paDstParms[0].type == VBOX_HGCM_SVC_PARM_32BIT)
    273             paDstParms[0].u.uint32 = mMsgType;
     268            paDstParms[0].u.uint32 = mType;
    274269        else
    275             paDstParms[0].u.uint64 = mMsgType;
     270            paDstParms[0].u.uint64 = mType;
    276271        paDstParms[1].u.uint32 = mParmCount;
    277272
     
    301296    int CopyTo(VBOXHGCMSVCPARM paDstParms[], uint32_t cDstParms) const
    302297    {
    303         LogFlowThisFunc(("[Cmd %RU32] mParmCount=%RU32, m_idContext=%RU32 (Session %RU32)\n",
    304                          mMsgType, mParmCount, m_idContext, VBOX_GUESTCTRL_CONTEXTID_GET_SESSION(m_idContext)));
     298        LogFlowThisFunc(("[Msg %RU32] mParmCount=%RU32, m_idContext=%RU32 (Session %RU32)\n",
     299                         mType, mParmCount, m_idContext, VBOX_GUESTCTRL_CONTEXTID_GET_SESSION(m_idContext)));
    305300
    306301        int rc = VINF_SUCCESS;
     
    386381        int rc;
    387382
    388         LogFlowThisFunc(("[Cmd %RU32] mParmCount=%RU32, mpParms=%p\n", mMsgType, mParmCount, mpParms));
    389 
    390         /* Does the current host command need more parameter space which
     383        LogFlowThisFunc(("[Msg %RU32] mParmCount=%RU32, mpParms=%p\n", mType, mParmCount, mpParms));
     384
     385        /* Does the current host message need more parameter space which
    391386         * the client does not provide yet? */
    392387        if (mParmCount > pReq->mNumParms)
    393388        {
    394             LogFlowThisFunc(("[Cmd %RU32] Requires %RU32 parms, only got %RU32 from client\n",
    395                              mMsgType, mParmCount, pReq->mNumParms));
     389            LogFlowThisFunc(("[Msg %RU32] Requires %RU32 parms, only got %RU32 from client\n",
     390                             mType, mParmCount, pReq->mNumParms));
    396391            /*
    397392             * So this call apparently failed because the guest wanted to peek
    398393             * how much parameters it has to supply in order to successfully retrieve
    399              * this command. Let's tell him so!
     394             * this message. Let's tell him so!
    400395             */
    401396            rc = VERR_TOO_MUCH_DATA;
     
    424419        AssertPtrReturn(pReq, VERR_INVALID_POINTER);
    425420
    426         LogFlowThisFunc(("[Cmd %RU32] mParmCount=%RU32, mpParms=%p\n", mMsgType, mParmCount, mpParms));
     421        LogFlowThisFunc(("[Msg %RU32] mParmCount=%RU32, mpParms=%p\n", mType, mParmCount, mpParms));
    427422
    428423        if (pReq->mNumParms >= 2)
    429424        {
    430             HGCMSvcSetU32(&pReq->mParms[0], mMsgType);   /* Message ID */
     425            HGCMSvcSetU32(&pReq->mParms[0], mType);   /* Message ID */
    431426            HGCMSvcSetU32(&pReq->mParms[1], mParmCount); /* Required parameters for message */
    432427        }
     
    438433         * Always return VERR_TOO_MUCH_DATA data here to
    439434         * keep it compatible with older clients and to
    440          * have correct accounting (mHostRc + mHostCmdTries).
     435         * have correct accounting (mHostRc + mHostMsgTries).
    441436         */
    442437        return VERR_TOO_MUCH_DATA;
     
    444439
    445440    /** @} */
    446 } HostCommand;
     441} HostMsg;
    447442
    448443/**
    449444 * Per-client structure used for book keeping/state tracking a
    450  * certain host command.
     445 * certain host message.
    451446 */
    452447typedef struct ClientContext
    453448{
    454     /* Pointer to list node of this command. */
    455     HostCommand *mpHostCmd;
     449    /* Pointer to list node of this message. */
     450    HostMsg *mpHostMsg;
    456451    /** The standard constructor. */
    457     ClientContext(void) : mpHostCmd(NULL) {}
     452    ClientContext(void) : mpHostMsg(NULL) {}
    458453    /** Internal constrcutor. */
    459     ClientContext(HostCommand *pHostCmd) : mpHostCmd(pHostCmd) {}
     454    ClientContext(HostMsg *pHostMsg) : mpHostMsg(pHostMsg) {}
    460455} ClientContext;
    461456typedef std::map< uint32_t, ClientContext > ClientContextMap;
     
    467462{
    468463    PVBOXHGCMSVCHELPERS     m_pSvcHelpers;
    469     /** Host command list to process (HostCommand). */
    470     RTLISTANCHOR            m_HostCmdList;
     464    /** Host message list to process (HostMsg). */
     465    RTLISTANCHOR            m_HostMsgList;
    471466    /** The HGCM client ID. */
    472467    uint32_t                m_idClient;
     
    482477    /** Pending client call (GUEST_MSG_PEEK_WAIT or GUEST_MSG_WAIT), zero if none pending.
    483478     *
    484      * This means the client waits for a new host command to reply and won't return
    485      * from the waiting call until a new host command is available. */
    486     guestControl::eGuestFn  m_enmIsPending;
     479     * This means the client waits for a new host message to reply and won't return
     480     * from the waiting call until a new host message is available. */
     481    guestControl::eGuestMsg m_enmPendingMsg;
    487482    /** Pending peek/wait request details. */
    488483    ClientRequest           m_PendingReq;
     
    496491        , m_fRestored(false)
    497492        , m_fPendingCancel(false)
    498         , m_enmIsPending((guestControl::eGuestFn)0)
    499         , mHostCmdRc(VINF_SUCCESS)
    500         , mHostCmdTries(0)
     493        , m_enmPendingMsg((guestControl::eGuestMsg)0)
     494        , mHostMsgRc(VINF_SUCCESS)
     495        , mHostMsgTries(0)
    501496        , mPeekCount(0)
    502497    {
    503         RTListInit(&m_HostCmdList);
     498        RTListInit(&m_HostMsgList);
    504499    }
    505500
     
    511506        , m_fRestored(false)
    512507        , m_fPendingCancel(false)
    513         , m_enmIsPending((guestControl::eGuestFn)0)
    514         , mHostCmdRc(VINF_SUCCESS)
    515         , mHostCmdTries(0)
     508        , m_enmPendingMsg((guestControl::eGuestMsg)0)
     509        , mHostMsgRc(VINF_SUCCESS)
     510        , mHostMsgTries(0)
    516511        , mPeekCount(0)
    517512    {
    518         RTListInit(&m_HostCmdList);
     513        RTListInit(&m_HostMsgList);
    519514    }
    520515
    521516    /**
    522      * Used by for Service::hostProcessCommand().
    523      */
    524     void EnqueueCommand(HostCommand *pHostCmd)
    525     {
    526         AssertPtr(pHostCmd);
    527         RTListAppend(&m_HostCmdList, &pHostCmd->m_ListEntry);
     517     * Used by for Service::hostProcessMessage().
     518     */
     519    void EnqueueMessage(HostMsg *pHostMsg)
     520    {
     521        AssertPtr(pHostMsg);
     522        RTListAppend(&m_HostMsgList, &pHostMsg->m_ListEntry);
    528523    }
    529524
    530525    /**
    531      * Used by for Service::hostProcessCommand().
     526     * Used by for Service::hostProcessMessage().
    532527     *
    533528     * @note This wakes up both GUEST_MSG_WAIT and GUEST_MSG_PEEK_WAIT sleepers.
     
    537532        int rc = VINF_NO_CHANGE;
    538533
    539         if (m_enmIsPending != 0)
     534        if (m_enmPendingMsg != 0)
    540535        {
    541536            LogFlowFunc(("[Client %RU32] Waking up ...\n", m_idClient));
     
    543538            rc = VINF_SUCCESS;
    544539
    545             HostCommand *pFirstCmd = RTListGetFirstCpp(&m_HostCmdList, HostCommand, m_ListEntry);
    546             if (pFirstCmd)
     540            HostMsg *pFirstMsg = RTListGetFirstCpp(&m_HostMsgList, HostMsg, m_ListEntry);
     541            if (pFirstMsg)
    547542            {
    548                 LogFlowThisFunc(("[Client %RU32] Current host command is %RU32 (CID=%#RX32, cParms=%RU32)\n",
    549                                  m_idClient, pFirstCmd->mMsgType, pFirstCmd->m_idContext, pFirstCmd->mParmCount));
    550 
    551                 if (m_enmIsPending == GUEST_MSG_PEEK_WAIT)
     543                LogFlowThisFunc(("[Client %RU32] Current host message is %RU32 (CID=%#RX32, cParms=%RU32)\n",
     544                                 m_idClient, pFirstMsg->mType, pFirstMsg->m_idContext, pFirstMsg->mParmCount));
     545
     546                if (m_enmPendingMsg == GUEST_MSG_PEEK_WAIT)
    552547                {
    553                     pFirstCmd->setPeekReturn(m_PendingReq.mParms, m_PendingReq.mNumParms);
     548                    pFirstMsg->setPeekReturn(m_PendingReq.mParms, m_PendingReq.mNumParms);
    554549                    rc = m_pSvcHelpers->pfnCallComplete(m_PendingReq.mHandle, VINF_SUCCESS);
    555550
     
    557552                    m_PendingReq.mParms    = NULL;
    558553                    m_PendingReq.mNumParms = 0;
    559                     m_enmIsPending         = (guestControl::eGuestFn)0;
     554                    m_enmPendingMsg         = (guestControl::eGuestMsg)0;
    560555                }
    561                 else if (m_enmIsPending == GUEST_MSG_WAIT)
    562                     rc = OldRun(&m_PendingReq, pFirstCmd);
     556                else if (m_enmPendingMsg == GUEST_MSG_WAIT)
     557                    rc = OldRun(&m_PendingReq, pFirstMsg);
    563558                else
    564                     AssertMsgFailed(("m_enmIsPending=%d\n", m_enmIsPending));
     559                    AssertMsgFailed(("m_enmIsPending=%d\n", m_enmPendingMsg));
    565560            }
    566561            else
    567                 AssertMsgFailed(("Waking up client ID=%RU32 with no host command in queue is a bad idea\n", m_idClient));
     562                AssertMsgFailed(("Waking up client ID=%RU32 with no host message in queue is a bad idea\n", m_idClient));
    568563
    569564            return rc;
     
    581576    {
    582577        LogFlowFunc(("[Client %RU32] Cancelling waiting thread, isPending=%d, pendingNumParms=%RU32, m_idSession=%x\n",
    583                      m_idClient, m_enmIsPending, m_PendingReq.mNumParms, m_idSession));
     578                     m_idClient, m_enmPendingMsg, m_PendingReq.mNumParms, m_idSession));
    584579
    585580        /*
     
    587582         */
    588583        int rcComplete;
    589         if (m_enmIsPending == GUEST_MSG_PEEK_WAIT)
    590         {
    591             HGCMSvcSetU32(&m_PendingReq.mParms[0], HOST_CANCEL_PENDING_WAITS);
     584        if (m_enmPendingMsg == GUEST_MSG_PEEK_WAIT)
     585        {
     586            HGCMSvcSetU32(&m_PendingReq.mParms[0], HOST_MSG_CANCEL_PENDING_WAITS);
    592587            rcComplete = VINF_TRY_AGAIN;
    593588        }
     
    597592         * aren't two parameters, fail the call.
    598593         */
    599         else if (m_enmIsPending != 0)
    600         {
    601             Assert(m_enmIsPending == GUEST_MSG_WAIT);
     594        else if (m_enmPendingMsg != 0)
     595        {
     596            Assert(m_enmPendingMsg == GUEST_MSG_WAIT);
    602597            if (m_PendingReq.mNumParms > 0)
    603                 HGCMSvcSetU32(&m_PendingReq.mParms[0], HOST_CANCEL_PENDING_WAITS);
     598                HGCMSvcSetU32(&m_PendingReq.mParms[0], HOST_MSG_CANCEL_PENDING_WAITS);
    604599            if (m_PendingReq.mNumParms > 1)
    605600                HGCMSvcSetU32(&m_PendingReq.mParms[1], 0);
     
    620615        m_PendingReq.mParms    = NULL;
    621616        m_PendingReq.mNumParms = 0;
    622         m_enmIsPending            = (guestControl::eGuestFn)0;
     617        m_enmPendingMsg            = (guestControl::eGuestMsg)0;
    623618        m_fPendingCancel      = false;
    624619        return VINF_SUCCESS;
     
    633628     */
    634629
    635     /** Last (most recent) rc after handling the host command. */
    636     int mHostCmdRc;
    637     /** How many GUEST_MSG_WAIT calls the client has issued to retrieve one command.
     630    /** Last (most recent) rc after handling the host message. */
     631    int mHostMsgRc;
     632    /** How many GUEST_MSG_WAIT calls the client has issued to retrieve one message.
    638633     *
    639634     * This is used as a heuristic to remove a message that the client appears not
    640635     * to be able to successfully retrieve.  */
    641     uint32_t mHostCmdTries;
     636    uint32_t mHostMsgTries;
    642637    /** Number of times we've peeked at a pending message.
    643638     *
    644639     * This is necessary for being compatible with older Guest Additions.  In case
    645      * there are commands which only have two (2) parameters and therefore would fit
     640     * there are messages which only have two (2) parameters and therefore would fit
    646641     * into the GUEST_MSG_WAIT reply immediately, we now can make sure that the
    647642     * client first gets back the GUEST_MSG_WAIT results first.
     
    650645
    651646    /**
    652      * Ditches the first host command and crazy GUEST_MSG_WAIT state.
     647     * Ditches the first host message and crazy GUEST_MSG_WAIT state.
    653648     *
    654649     * @note Only used by GUEST_MSG_WAIT scenarios.
    655650     */
    656     void OldDitchFirstHostCmd()
    657     {
    658         HostCommand *pFirstCmd = RTListGetFirstCpp(&m_HostCmdList, HostCommand, m_ListEntry);
    659         Assert(pFirstCmd);
    660         RTListNodeRemove(&pFirstCmd->m_ListEntry);
    661         pFirstCmd->Delete();
     651    void OldDitchFirstHostMsg()
     652    {
     653        HostMsg *pFirstMsg = RTListGetFirstCpp(&m_HostMsgList, HostMsg, m_ListEntry);
     654        Assert(pFirstMsg);
     655        RTListNodeRemove(&pFirstMsg->m_ListEntry);
     656        pFirstMsg->Delete();
    662657
    663658        /* Reset state else. */
    664         mHostCmdRc    = VINF_SUCCESS;
    665         mHostCmdTries = 0;
     659        mHostMsgRc    = VINF_SUCCESS;
     660        mHostMsgTries = 0;
    666661        mPeekCount    = 0;
    667662    }
     
    672667     * @note Only used by GUEST_MSG_WAIT scenarios.
    673668     */
    674     int OldRun(ClientRequest const *pReq, HostCommand *pHostCmd)
     669    int OldRun(ClientRequest const *pReq, HostMsg *pHostMsg)
    675670    {
    676671        AssertPtrReturn(pReq, VERR_INVALID_POINTER);
    677         AssertPtrReturn(pHostCmd, VERR_INVALID_POINTER);
    678         Assert(RTListNodeIsFirst(&m_HostCmdList, &pHostCmd->m_ListEntry));
    679 
    680         LogFlowFunc(("[Client %RU32] pReq=%p, mHostCmdRc=%Rrc, mHostCmdTries=%RU32, mPeekCount=%RU32\n",
    681                       m_idClient, pReq, mHostCmdRc, mHostCmdTries, mPeekCount));
    682 
    683         int rc = mHostCmdRc = OldSendReply(pReq, pHostCmd);
    684 
    685         LogFlowThisFunc(("[Client %RU32] Processing command %RU32 ended with rc=%Rrc\n", m_idClient, pHostCmd->mMsgType, mHostCmdRc));
     672        AssertPtrReturn(pHostMsg, VERR_INVALID_POINTER);
     673        Assert(RTListNodeIsFirst(&m_HostMsgList, &pHostMsg->m_ListEntry));
     674
     675        LogFlowFunc(("[Client %RU32] pReq=%p, mHostMsgRc=%Rrc, mHostMsgTries=%RU32, mPeekCount=%RU32\n",
     676                      m_idClient, pReq, mHostMsgRc, mHostMsgTries, mPeekCount));
     677
     678        int rc = mHostMsgRc = OldSendReply(pReq, pHostMsg);
     679
     680        LogFlowThisFunc(("[Client %RU32] Processing host message %RU32 ended with rc=%Rrc\n",
     681                         m_idClient, pHostMsg->mType, mHostMsgRc));
    686682
    687683        bool fRemove = false;
    688684        if (RT_FAILURE(rc))
    689685        {
    690             mHostCmdTries++;
     686            mHostMsgTries++;
    691687
    692688            /*
     
    695691             *
    696692             * Note: Due to legacy reasons this the retry counter has to be even because on
    697              *       every peek there will be the actual command retrieval from the client side.
    698              *       To not get the actual command if the client actually only wants to peek for
    699              *       the next command, there needs to be two rounds per try, e.g. 3 rounds = 6 tries.
     693             *       every peek there will be the actual message retrieval from the client side.
     694             *       To not get the actual message if the client actually only wants to peek for
     695             *       the next message, there needs to be two rounds per try, e.g. 3 rounds = 6 tries.
    700696             */
    701697            /** @todo Fix the mess stated above. GUEST_MSG_WAIT should be become GUEST_MSG_PEEK, *only*
    702              *        (and every time) returning the next upcoming host command (if any, blocking). Then
     698             *        (and every time) returning the next upcoming host message (if any, blocking). Then
    703699             *        it's up to the client what to do next, either peeking again or getting the actual
    704              *        host command via an own GUEST_ type message.
     700             *        host message via an own GUEST_ type message.
    705701             */
    706702            if (   rc == VERR_TOO_MUCH_DATA
    707703                || rc == VERR_CANCELLED)
    708704            {
    709                 if (mHostCmdTries == 6)
     705                if (mHostMsgTries == 6)
    710706                    fRemove = true;
    711707            }
    712708            /* Client did not understand the message or something else weird happened. Try again one
    713709             * more time and drop it if it didn't get handled then. */
    714             else if (mHostCmdTries > 1)
     710            else if (mHostMsgTries > 1)
    715711                fRemove = true;
    716712        }
     
    718714            fRemove = true; /* Everything went fine, remove it. */
    719715
    720         LogFlowThisFunc(("[Client %RU32] Tried command %RU32 for %RU32 times, (last result=%Rrc, fRemove=%RTbool)\n",
    721                          m_idClient, pHostCmd->mMsgType, mHostCmdTries, rc, fRemove));
     716        LogFlowThisFunc(("[Client %RU32] Tried host message %RU32 for %RU32 times, (last result=%Rrc, fRemove=%RTbool)\n",
     717                         m_idClient, pHostMsg->mType, mHostMsgTries, rc, fRemove));
    722718
    723719        if (fRemove)
    724720        {
    725             Assert(RTListNodeIsFirst(&m_HostCmdList, &pHostCmd->m_ListEntry));
    726             OldDitchFirstHostCmd();
     721            Assert(RTListNodeIsFirst(&m_HostMsgList, &pHostMsg->m_ListEntry));
     722            OldDitchFirstHostMsg();
    727723        }
    728724
     
    739735
    740736        /*
    741          * If the host command list is empty, the request must wait for one to be posted.
     737         * If the host message list is empty, the request must wait for one to be posted.
    742738         */
    743         HostCommand *pFirstCmd = RTListGetFirstCpp(&m_HostCmdList, HostCommand, m_ListEntry);
    744         if (!pFirstCmd)
     739        HostMsg *pFirstMsg = RTListGetFirstCpp(&m_HostMsgList, HostMsg, m_ListEntry);
     740        if (!pFirstMsg)
    745741        {
    746742            if (!m_fPendingCancel)
    747743            {
    748744                /* Go to sleep. */
    749                 ASSERT_GUEST_RETURN(m_enmIsPending == 0, VERR_WRONG_ORDER);
     745                ASSERT_GUEST_RETURN(m_enmPendingMsg == 0, VERR_WRONG_ORDER);
    750746                m_PendingReq = *pReq;
    751                 m_enmIsPending  = GUEST_MSG_WAIT;
     747                m_enmPendingMsg  = GUEST_MSG_WAIT;
    752748                LogFlowFunc(("[Client %RU32] Is now in pending mode\n", m_idClient));
    753749                return VINF_HGCM_ASYNC_EXECUTE;
     
    757753            m_fPendingCancel = false;
    758754            if (pReq->mNumParms > 0)
    759                 HGCMSvcSetU32(&pReq->mParms[0], HOST_CANCEL_PENDING_WAITS);
     755                HGCMSvcSetU32(&pReq->mParms[0], HOST_MSG_CANCEL_PENDING_WAITS);
    760756            if (pReq->mNumParms > 1)
    761757                HGCMSvcSetU32(&pReq->mParms[1], 0);
     
    764760
    765761        /*
    766          * Return first host command.
     762         * Return first host message.
    767763         */
    768         return OldRun(pReq, pFirstCmd);
     764        return OldRun(pReq, pFirstMsg);
    769765    }
    770766
     
    774770     */
    775771    int OldSendReply(ClientRequest const *pReq,
    776                      HostCommand         *pHostCmd)
     772                     HostMsg         *pHostMsg)
    777773    {
    778774        AssertPtrReturn(pReq, VERR_INVALID_POINTER);
    779         AssertPtrReturn(pHostCmd, VERR_INVALID_POINTER);
     775        AssertPtrReturn(pHostMsg, VERR_INVALID_POINTER);
    780776
    781777        /* In case of VERR_CANCELLED. */
     
    785781        /* If the client is in pending mode, always send back
    786782         * the peek result first. */
    787         if (m_enmIsPending)
    788         {
    789             Assert(m_enmIsPending == GUEST_MSG_WAIT);
    790             rc = pHostCmd->Peek(pReq);
     783        if (m_enmPendingMsg)
     784        {
     785            Assert(m_enmPendingMsg == GUEST_MSG_WAIT);
     786            rc = pHostMsg->Peek(pReq);
    791787            mPeekCount++;
    792788        }
     
    794790        {
    795791            /* If this is the very first peek, make sure to *always* give back the peeking answer
    796              * instead of the actual command, even if this command would fit into the current
     792             * instead of the actual message, even if this message would fit into the current
    797793             * connection buffer. */
    798794            if (!mPeekCount)
    799795            {
    800                 rc = pHostCmd->Peek(pReq);
     796                rc = pHostMsg->Peek(pReq);
    801797                mPeekCount++;
    802798            }
    803799            else
    804800            {
    805                 /* Try assigning the host command to the client and store the
     801                /* Try assigning the host message to the client and store the
    806802                 * result code for later use. */
    807                 rc = pHostCmd->Assign(pReq);
     803                rc = pHostMsg->Assign(pReq);
    808804                if (RT_FAILURE(rc)) /* If something failed, let the client peek (again). */
    809805                {
    810                     rc = pHostCmd->Peek(pReq);
     806                    rc = pHostMsg->Peek(pReq);
    811807                    mPeekCount++;
    812808                }
     
    817813
    818814        /* Reset pending status. */
    819         m_enmIsPending = (guestControl::eGuestFn)0;
     815        m_enmPendingMsg = (guestControl::eGuestMsg)0;
    820816
    821817        /* In any case the client did something, so complete
     
    831827        }
    832828
    833         LogFlowThisFunc(("[Client %RU32] Command %RU32 ended with %Rrc (mPeekCount=%RU32, pReq=%p)\n",
    834                          m_idClient, pHostCmd->mMsgType, rc, mPeekCount, pReq));
     829        LogFlowThisFunc(("[Client %RU32] Message %RU32 ended with %Rrc (mPeekCount=%RU32, pReq=%p)\n",
     830                         m_idClient, pHostMsg->mType, rc, mPeekCount, pReq));
    835831        return rc;
    836832    }
     
    867863    typedef GstCtrlService SELF;
    868864    /** HGCM helper functions. */
    869     PVBOXHGCMSVCHELPERS mpHelpers;
     865    PVBOXHGCMSVCHELPERS     mpHelpers;
    870866    /** Callback function supplied by the host for notification of updates to properties. */
    871     PFNHGCMSVCEXT mpfnHostCallback;
     867    PFNHGCMSVCEXT           mpfnHostCallback;
    872868    /** User data pointer to be supplied to the host callback function. */
    873     void *mpvHostData;
     869    void                   *mpvHostData;
    874870    /** Map containing all connected clients, key is HGCM client ID. */
    875     ClientStateMap  m_ClientStateMap;
     871    ClientStateMap          m_ClientStateMap;
    876872    /** Session ID -> client state. */
    877     ClientStateMap  m_SessionIdMap;
     873    ClientStateMap          m_SessionIdMap;
    878874    /** The current master client, NULL if none. */
    879     ClientState    *m_pMasterClient;
     875    ClientState            *m_pMasterClient;
    880876    /** The master HGCM client ID, UINT32_MAX if none. */
    881     uint32_t        m_idMasterClient;
     877    uint32_t                m_idMasterClient;
    882878    /** Set if we're in legacy mode (pre 6.0). */
    883     bool            m_fLegacyMode;
     879    bool                    m_fLegacyMode;
    884880    /** Number of prepared sessions. */
    885     uint32_t        m_cPreparedSessions;
     881    uint32_t                m_cPreparedSessions;
    886882    /** List of prepared session (GstCtrlPreparedSession). */
    887     RTLISTANCHOR    m_PreparedSessions;
     883    RTLISTANCHOR            m_PreparedSessions;
    888884
    889885public:
     
    921917    int clientSessionAccept(ClientState *pClient, VBOXHGCMCALLHANDLE hCall, uint32_t cParms, VBOXHGCMSVCPARM paParms[]);
    922918    int clientSessionCloseOther(ClientState *pClient, uint32_t cParms, VBOXHGCMSVCPARM paParms[]);
    923     int clientToMain(ClientState *pClient, uint32_t idFunction, uint32_t cParms, VBOXHGCMSVCPARM paParms[]);
     919    int clientToMain(ClientState *pClient, uint32_t idMsg, uint32_t cParms, VBOXHGCMSVCPARM paParms[]);
    924920
    925921    int clientMsgOldGet(ClientState *pClient, VBOXHGCMCALLHANDLE hCall, uint32_t cParms, VBOXHGCMSVCPARM paParms[]);
     
    927923    int clientMsgOldSkip(ClientState *pClient, VBOXHGCMCALLHANDLE hCall, uint32_t cParms);
    928924
    929     int hostCallback(uint32_t idFunction, uint32_t cParms, VBOXHGCMSVCPARM paParms[]);
    930     int hostProcessCommand(uint32_t idFunction, uint32_t cParms, VBOXHGCMSVCPARM paParms[]);
     925    int hostCallback(uint32_t idMsg, uint32_t cParms, VBOXHGCMSVCPARM paParms[]);
     926    int hostProcessMessage(uint32_t idMsg, uint32_t cParms, VBOXHGCMSVCPARM paParms[]);
    931927
    932928    DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP(GstCtrlService);
     
    10251021
    10261022    /*
    1027      * Cancel all pending host commands, replying with GUEST_DISCONNECTED if final recipient.
    1028      */
    1029     HostCommand *pCurCmd, *pNextCmd;
    1030     RTListForEachSafeCpp(&pClient->m_HostCmdList, pCurCmd, pNextCmd, HostCommand, m_ListEntry)
    1031     {
    1032         RTListNodeRemove(&pCurCmd->m_ListEntry);
     1023     * Cancel all pending host messages, replying with GUEST_DISCONNECTED if final recipient.
     1024     */
     1025    HostMsg *pCurMsg, *pNextMsg;
     1026    RTListForEachSafeCpp(&pClient->m_HostMsgList, pCurMsg, pNextMsg, HostMsg, m_ListEntry)
     1027    {
     1028        RTListNodeRemove(&pCurMsg->m_ListEntry);
    10331029
    10341030        VBOXHGCMSVCPARM Parm;
    1035         HGCMSvcSetU32(&Parm, pCurCmd->m_idContext);
    1036         int rc2 = pThis->hostCallback(GUEST_DISCONNECTED, 1, &Parm);
    1037         LogFlowFunc(("Cancelled host command %u (%s) with idContext=%#x -> %Rrc\n",
    1038                      pCurCmd->mMsgType, GstCtrlHostFnName((eHostFn)pCurCmd->mMsgType), pCurCmd->m_idContext, rc2));
     1031        HGCMSvcSetU32(&Parm, pCurMsg->m_idContext);
     1032        int rc2 = pThis->hostCallback(GUEST_MSG_DISCONNECTED, 1, &Parm);
     1033        LogFlowFunc(("Cancelled host message %u (%s) with idContext=%#x -> %Rrc\n",
     1034                     pCurMsg->mType, GstCtrlHostMsgtoStr((eHostMsg)pCurMsg->mType), pCurMsg->m_idContext, rc2));
    10391035        RT_NOREF(rc2);
    10401036
    1041         pCurCmd->Delete();
     1037        pCurMsg->Delete();
    10421038    }
    10431039
     
    10791075 * A client asks for the next message to process.
    10801076 *
    1081  * This either fills in a pending host command into the client's parameter space
     1077 * This either fills in a pending host message into the client's parameter space
    10821078 * or defers the guest call until we have something from the host.
    10831079 *
     
    12061202
    12071203    /*
    1208      * Return information about the first command if one is pending in the list.
    1209      */
    1210     HostCommand *pFirstCmd = RTListGetFirstCpp(&pClient->m_HostCmdList, HostCommand, m_ListEntry);
    1211     if (pFirstCmd)
    1212     {
    1213         pFirstCmd->setPeekReturn(paParms, cParms);
     1204     * Return information about the first message if one is pending in the list.
     1205     */
     1206    HostMsg *pFirstMsg = RTListGetFirstCpp(&pClient->m_HostMsgList, HostMsg, m_ListEntry);
     1207    if (pFirstMsg)
     1208    {
     1209        pFirstMsg->setPeekReturn(paParms, cParms);
    12141210        LogFlowFunc(("[Client %RU32] GUEST_MSG_PEEK_XXXX -> VINF_SUCCESS (idMsg=%u (%s), cParms=%u)\n",
    1215                      pClient->m_idClient, pFirstCmd->mMsgType, GstCtrlHostFnName((eHostFn)pFirstCmd->mMsgType), pFirstCmd->mParmCount));
     1211                     pClient->m_idClient, pFirstMsg->mType, GstCtrlHostMsgtoStr((eHostMsg)pFirstMsg->mType), pFirstMsg->mParmCount));
    12161212        return VINF_SUCCESS;
    12171213    }
     
    12291225     * Wait for the host to queue a message for this client.
    12301226     */
    1231     ASSERT_GUEST_MSG_RETURN(pClient->m_enmIsPending == 0, ("Already pending! (idClient=%RU32)\n", pClient->m_idClient),
     1227    ASSERT_GUEST_MSG_RETURN(pClient->m_enmPendingMsg == 0, ("Already pending! (idClient=%RU32)\n", pClient->m_idClient),
    12321228                            VERR_RESOURCE_BUSY);
    12331229    pClient->m_PendingReq.mHandle   = hCall;
    12341230    pClient->m_PendingReq.mNumParms = cParms;
    12351231    pClient->m_PendingReq.mParms    = paParms;
    1236     pClient->m_enmIsPending         = GUEST_MSG_PEEK_WAIT;
     1232    pClient->m_enmPendingMsg         = GUEST_MSG_PEEK_WAIT;
    12371233    LogFlowFunc(("[Client %RU32] Is now in pending mode...\n", pClient->m_idClient));
    12381234    return VINF_HGCM_ASYNC_EXECUTE;
     
    12701266
    12711267    /*
    1272      * Return information about the first command if one is pending in the list.
    1273      */
    1274     HostCommand *pFirstCmd = RTListGetFirstCpp(&pClient->m_HostCmdList, HostCommand, m_ListEntry);
    1275     if (pFirstCmd)
    1276     {
    1277 
    1278         ASSERT_GUEST_MSG_RETURN(pFirstCmd->mMsgType == idMsgExpected || idMsgExpected == UINT32_MAX,
     1268     * Return information about the first message if one is pending in the list.
     1269     */
     1270    HostMsg *pFirstMsg = RTListGetFirstCpp(&pClient->m_HostMsgList, HostMsg, m_ListEntry);
     1271    if (pFirstMsg)
     1272    {
     1273
     1274        ASSERT_GUEST_MSG_RETURN(pFirstMsg->mType == idMsgExpected || idMsgExpected == UINT32_MAX,
    12791275                                ("idMsg=%u (%s) cParms=%u, caller expected %u (%s) and %u\n",
    1280                                  pFirstCmd->mMsgType, GstCtrlHostFnName((eHostFn)pFirstCmd->mMsgType), pFirstCmd->mParmCount,
    1281                                  idMsgExpected, GstCtrlHostFnName((eHostFn)idMsgExpected), cParms),
     1276                                 pFirstMsg->mType, GstCtrlHostMsgtoStr((eHostMsg)pFirstMsg->mType), pFirstMsg->mParmCount,
     1277                                 idMsgExpected, GstCtrlHostMsgtoStr((eHostMsg)idMsgExpected), cParms),
    12821278                                VERR_MISMATCH);
    1283         ASSERT_GUEST_MSG_RETURN(pFirstCmd->mParmCount == cParms,
     1279        ASSERT_GUEST_MSG_RETURN(pFirstMsg->mParmCount == cParms,
    12841280                                ("idMsg=%u (%s) cParms=%u, caller expected %u (%s) and %u\n",
    1285                                  pFirstCmd->mMsgType, GstCtrlHostFnName((eHostFn)pFirstCmd->mMsgType), pFirstCmd->mParmCount,
    1286                                  idMsgExpected, GstCtrlHostFnName((eHostFn)idMsgExpected), cParms),
     1281                                 pFirstMsg->mType, GstCtrlHostMsgtoStr((eHostMsg)pFirstMsg->mType), pFirstMsg->mParmCount,
     1282                                 idMsgExpected, GstCtrlHostMsgtoStr((eHostMsg)idMsgExpected), cParms),
    12871283                                VERR_WRONG_PARAMETER_COUNT);
    12881284
    12891285        /* Check the parameter types. */
    12901286        for (uint32_t i = 0; i < cParms; i++)
    1291             ASSERT_GUEST_MSG_RETURN(pFirstCmd->mpParms[i].type == paParms[i].type,
    1292                                     ("param #%u: type %u, caller expected %u (idMsg=%u %s)\n", i, pFirstCmd->mpParms[i].type,
    1293                                      paParms[i].type, pFirstCmd->mMsgType, GstCtrlHostFnName((eHostFn)pFirstCmd->mMsgType)),
     1287            ASSERT_GUEST_MSG_RETURN(pFirstMsg->mpParms[i].type == paParms[i].type,
     1288                                    ("param #%u: type %u, caller expected %u (idMsg=%u %s)\n", i, pFirstMsg->mpParms[i].type,
     1289                                     paParms[i].type, pFirstMsg->mType, GstCtrlHostMsgtoStr((eHostMsg)pFirstMsg->mType)),
    12941290                                    VERR_WRONG_PARAMETER_TYPE);
    12951291
     
    13021298        int rc = VINF_SUCCESS;
    13031299        for (uint32_t i = 0; i < cParms; i++)
    1304             switch (pFirstCmd->mpParms[i].type)
     1300            switch (pFirstMsg->mpParms[i].type)
    13051301            {
    13061302                case VBOX_HGCM_SVC_PARM_32BIT:
    1307                     paParms[i].u.uint32 = pFirstCmd->mpParms[i].u.uint32;
     1303                    paParms[i].u.uint32 = pFirstMsg->mpParms[i].u.uint32;
    13081304                    break;
    13091305
    13101306                case VBOX_HGCM_SVC_PARM_64BIT:
    1311                     paParms[i].u.uint64 = pFirstCmd->mpParms[i].u.uint64;
     1307                    paParms[i].u.uint64 = pFirstMsg->mpParms[i].u.uint64;
    13121308                    break;
    13131309
    13141310                case VBOX_HGCM_SVC_PARM_PTR:
    13151311                {
    1316                     uint32_t const cbSrc = pFirstCmd->mpParms[i].u.pointer.size;
     1312                    uint32_t const cbSrc = pFirstMsg->mpParms[i].u.pointer.size;
    13171313                    uint32_t const cbDst = paParms[i].u.pointer.size;
    13181314                    paParms[i].u.pointer.size = cbSrc; /** @todo Check if this is safe in other layers...
    13191315                                                        * Update: Safe, yes, but VMMDevHGCM doesn't pass it along. */
    13201316                    if (cbSrc <= cbDst)
    1321                         memcpy(paParms[i].u.pointer.addr, pFirstCmd->mpParms[i].u.pointer.addr, cbSrc);
     1317                        memcpy(paParms[i].u.pointer.addr, pFirstMsg->mpParms[i].u.pointer.addr, cbSrc);
    13221318                    else
    13231319                        rc = VERR_BUFFER_OVERFLOW;
     
    13261322
    13271323                default:
    1328                     AssertMsgFailed(("#%u: %u\n", i, pFirstCmd->mpParms[i].type));
     1324                    AssertMsgFailed(("#%u: %u\n", i, pFirstMsg->mpParms[i].type));
    13291325                    rc = VERR_INTERNAL_ERROR;
    13301326                    break;
     
    13331329        {
    13341330            /*
    1335              * Complete the command and remove the pending message unless the
     1331             * Complete the message and remove the pending message unless the
    13361332             * guest raced us and cancelled this call in the meantime.
    13371333             */
     
    13401336            if (rc != VERR_CANCELLED)
    13411337            {
    1342                 RTListNodeRemove(&pFirstCmd->m_ListEntry);
    1343                 pFirstCmd->Delete();
     1338                RTListNodeRemove(&pFirstMsg->m_ListEntry);
     1339                pFirstMsg->Delete();
    13441340            }
    13451341            else
     
    13771373     * Execute.
    13781374     */
    1379     if (pClient->m_enmIsPending != 0)
     1375    if (pClient->m_enmPendingMsg != 0)
    13801376    {
    13811377        pClient->CancelWaiting();
     
    14221418     * Do the job.
    14231419     */
    1424     HostCommand *pFirstCmd = RTListGetFirstCpp(&pClient->m_HostCmdList, HostCommand, m_ListEntry);
    1425     if (pFirstCmd)
    1426     {
    1427         if (   pFirstCmd->mMsgType == idMsg
     1420    HostMsg *pFirstMsg = RTListGetFirstCpp(&pClient->m_HostMsgList, HostMsg, m_ListEntry);
     1421    if (pFirstMsg)
     1422    {
     1423        if (   pFirstMsg->mType == idMsg
    14281424            || idMsg == UINT32_MAX)
    14291425        {
     
    14321428            {
    14331429                /*
    1434                  * Remove the command from the queue.
     1430                 * Remove the message from the queue.
    14351431                 */
    1436                 Assert(RTListNodeIsFirst(&pClient->m_HostCmdList, &pFirstCmd->m_ListEntry) );
    1437                 RTListNodeRemove(&pFirstCmd->m_ListEntry);
     1432                Assert(RTListNodeIsFirst(&pClient->m_HostMsgList, &pFirstMsg->m_ListEntry) );
     1433                RTListNodeRemove(&pFirstMsg->m_ListEntry);
    14381434
    14391435                /*
     
    14411437                 */
    14421438                VBOXHGCMSVCPARM aReplyParams[5];
    1443                 HGCMSvcSetU32(&aReplyParams[0], pFirstCmd->m_idContext);
    1444                 switch (pFirstCmd->mMsgType)
     1439                HGCMSvcSetU32(&aReplyParams[0], pFirstMsg->m_idContext);
     1440                switch (pFirstMsg->mType)
    14451441                {
    1446                     case HOST_EXEC_CMD:
     1442                    case HOST_MSG_EXEC_CMD:
    14471443                        HGCMSvcSetU32(&aReplyParams[1], 0);              /* pid */
    14481444                        HGCMSvcSetU32(&aReplyParams[2], PROC_STS_ERROR); /* status */
    14491445                        HGCMSvcSetU32(&aReplyParams[3], rcSkip);         /* flags / whatever */
    14501446                        HGCMSvcSetPv(&aReplyParams[4], NULL, 0);         /* data buffer */
    1451                         hostCallback(GUEST_EXEC_STATUS, 5, aReplyParams);
     1447                        hostCallback(GUEST_MSG_EXEC_STATUS, 5, aReplyParams);
    14521448                        break;
    14531449
    1454                     case HOST_SESSION_CREATE:
     1450                    case HOST_MSG_SESSION_CREATE:
    14551451                        HGCMSvcSetU32(&aReplyParams[1], GUEST_SESSION_NOTIFYTYPE_ERROR);    /* type */
    14561452                        HGCMSvcSetU32(&aReplyParams[2], rcSkip);                            /* result */
    1457                         hostCallback(GUEST_SESSION_NOTIFY, 3, aReplyParams);
     1453                        hostCallback(GUEST_MSG_SESSION_NOTIFY, 3, aReplyParams);
    14581454                        break;
    14591455
    1460                     case HOST_EXEC_SET_INPUT:
    1461                         HGCMSvcSetU32(&aReplyParams[1], pFirstCmd->mParmCount >= 2 ? pFirstCmd->mpParms[1].u.uint32 : 0);
     1456                    case HOST_MSG_EXEC_SET_INPUT:
     1457                        HGCMSvcSetU32(&aReplyParams[1], pFirstMsg->mParmCount >= 2 ? pFirstMsg->mpParms[1].u.uint32 : 0);
    14621458                        HGCMSvcSetU32(&aReplyParams[2], INPUT_STS_ERROR);   /* status */
    14631459                        HGCMSvcSetU32(&aReplyParams[3], rcSkip);            /* flags / whatever */
    14641460                        HGCMSvcSetU32(&aReplyParams[4], 0);                 /* bytes consumed */
    1465                         hostCallback(GUEST_EXEC_INPUT_STATUS, 5, aReplyParams);
     1461                        hostCallback(GUEST_MSG_EXEC_INPUT_STATUS, 5, aReplyParams);
    14661462                        break;
    14671463
    1468                     case HOST_FILE_OPEN:
     1464                    case HOST_MSG_FILE_OPEN:
    14691465                        HGCMSvcSetU32(&aReplyParams[1], GUEST_FILE_NOTIFYTYPE_OPEN); /* type*/
    14701466                        HGCMSvcSetU32(&aReplyParams[2], rcSkip);                     /* rc */
    1471                         HGCMSvcSetU32(&aReplyParams[3], VBOX_GUESTCTRL_CONTEXTID_GET_OBJECT(pFirstCmd->m_idContext)); /* handle */
    1472                         hostCallback(GUEST_FILE_NOTIFY, 4, aReplyParams);
     1467                        HGCMSvcSetU32(&aReplyParams[3], VBOX_GUESTCTRL_CONTEXTID_GET_OBJECT(pFirstMsg->m_idContext)); /* handle */
     1468                        hostCallback(GUEST_MSG_FILE_NOTIFY, 4, aReplyParams);
    14731469                        break;
    1474                     case HOST_FILE_CLOSE:
     1470                    case HOST_MSG_FILE_CLOSE:
    14751471                        HGCMSvcSetU32(&aReplyParams[1], GUEST_FILE_NOTIFYTYPE_ERROR); /* type*/
    14761472                        HGCMSvcSetU32(&aReplyParams[2], rcSkip);                      /* rc */
    1477                         hostCallback(GUEST_FILE_NOTIFY, 3, aReplyParams);
     1473                        hostCallback(GUEST_MSG_FILE_NOTIFY, 3, aReplyParams);
    14781474                        break;
    1479                     case HOST_FILE_READ:
    1480                     case HOST_FILE_READ_AT:
     1475                    case HOST_MSG_FILE_READ:
     1476                    case HOST_MSG_FILE_READ_AT:
    14811477                        HGCMSvcSetU32(&aReplyParams[1], GUEST_FILE_NOTIFYTYPE_READ);  /* type */
    14821478                        HGCMSvcSetU32(&aReplyParams[2], rcSkip);                      /* rc */
    14831479                        HGCMSvcSetPv(&aReplyParams[3], NULL, 0);                      /* data buffer */
    1484                         hostCallback(GUEST_FILE_NOTIFY, 4, aReplyParams);
     1480                        hostCallback(GUEST_MSG_FILE_NOTIFY, 4, aReplyParams);
    14851481                        break;
    1486                     case HOST_FILE_WRITE:
    1487                     case HOST_FILE_WRITE_AT:
     1482                    case HOST_MSG_FILE_WRITE:
     1483                    case HOST_MSG_FILE_WRITE_AT:
    14881484                        HGCMSvcSetU32(&aReplyParams[1], GUEST_FILE_NOTIFYTYPE_WRITE); /* type */
    14891485                        HGCMSvcSetU32(&aReplyParams[2], rcSkip);                      /* rc */
    14901486                        HGCMSvcSetU32(&aReplyParams[3], 0);                           /* bytes written */
    1491                         hostCallback(GUEST_FILE_NOTIFY, 4, aReplyParams);
     1487                        hostCallback(GUEST_MSG_FILE_NOTIFY, 4, aReplyParams);
    14921488                        break;
    1493                     case HOST_FILE_SEEK:
     1489                    case HOST_MSG_FILE_SEEK:
    14941490                        HGCMSvcSetU32(&aReplyParams[1], GUEST_FILE_NOTIFYTYPE_SEEK);  /* type */
    14951491                        HGCMSvcSetU32(&aReplyParams[2], rcSkip);                      /* rc */
    14961492                        HGCMSvcSetU64(&aReplyParams[3], 0);                           /* actual */
    1497                         hostCallback(GUEST_FILE_NOTIFY, 4, aReplyParams);
     1493                        hostCallback(GUEST_MSG_FILE_NOTIFY, 4, aReplyParams);
    14981494                        break;
    1499                     case HOST_FILE_TELL:
     1495                    case HOST_MSG_FILE_TELL:
    15001496                        HGCMSvcSetU32(&aReplyParams[1], GUEST_FILE_NOTIFYTYPE_TELL);  /* type */
    15011497                        HGCMSvcSetU32(&aReplyParams[2], rcSkip);                      /* rc */
    15021498                        HGCMSvcSetU64(&aReplyParams[3], 0);                           /* actual */
    1503                         hostCallback(GUEST_FILE_NOTIFY, 4, aReplyParams);
     1499                        hostCallback(GUEST_MSG_FILE_NOTIFY, 4, aReplyParams);
    15041500                        break;
    15051501
    1506                     case HOST_EXEC_GET_OUTPUT: /** @todo This can't be right/work. */
    1507                     case HOST_EXEC_TERMINATE:  /** @todo This can't be right/work. */
    1508                     case HOST_EXEC_WAIT_FOR:   /** @todo This can't be right/work. */
    1509                     case HOST_PATH_USER_DOCUMENTS:
    1510                     case HOST_PATH_USER_HOME:
    1511                     case HOST_PATH_RENAME:
    1512                     case HOST_DIR_REMOVE:
     1502                    case HOST_MSG_EXEC_GET_OUTPUT: /** @todo This can't be right/work. */
     1503                    case HOST_MSG_EXEC_TERMINATE:  /** @todo This can't be right/work. */
     1504                    case HOST_MSG_EXEC_WAIT_FOR:   /** @todo This can't be right/work. */
     1505                    case HOST_MSG_PATH_USER_DOCUMENTS:
     1506                    case HOST_MSG_PATH_USER_HOME:
     1507                    case HOST_MSG_PATH_RENAME:
     1508                    case HOST_MSG_DIR_REMOVE:
    15131509                    default:
    1514                         HGCMSvcSetU32(&aReplyParams[1], pFirstCmd->mMsgType);
     1510                        HGCMSvcSetU32(&aReplyParams[1], pFirstMsg->mType);
    15151511                        HGCMSvcSetU32(&aReplyParams[2], (uint32_t)rcSkip);
    15161512                        HGCMSvcSetPv(&aReplyParams[3], NULL, 0);
     
    15201516
    15211517                /*
    1522                  * Free the command.
     1518                 * Free the message.
    15231519                 */
    1524                 pFirstCmd->Delete();
     1520                pFirstMsg->Delete();
    15251521            }
    15261522            else
     
    15281524            return VINF_HGCM_ASYNC_EXECUTE; /* The caller must not complete it. */
    15291525        }
    1530         LogFunc(("Warning: GUEST_MSG_SKIP mismatch! Found %u, caller expected %u!\n", pFirstCmd->mMsgType, idMsg));
     1526        LogFunc(("Warning: GUEST_MSG_SKIP mismatch! Found %u, caller expected %u!\n", pFirstMsg->mType, idMsg));
    15311527        return VERR_MISMATCH;
    15321528    }
     
    15961592
    15971593    /*
    1598      * Try complete the command.
     1594     * Try complete the message.
    15991595     */
    16001596    int rc = mpHelpers->pfnCallComplete(hCall, VINF_SUCCESS);
     
    17861782
    17871783    /*
    1788      * Forward the command to the destiation.
     1784     * Forward the message to the destiation.
    17891785     * Since we modify the first parameter, we must make a copy of the parameters.
    17901786     */
     
    17921788    HGCMSvcSetU64(&aParms[0], idContext | VBOX_GUESTCTRL_DST_SESSION);
    17931789    HGCMSvcSetU32(&aParms[1], fFlags);
    1794     int rc = hostProcessCommand(HOST_SESSION_CLOSE, RT_ELEMENTS(aParms), aParms);
     1790    int rc = hostProcessMessage(HOST_MSG_SESSION_CLOSE, RT_ELEMENTS(aParms), aParms);
    17951791
    17961792    LogFlowFunc(("Closing guest context ID=%RU32 (from client ID=%RU32) returned with rc=%Rrc\n", idContext, pClient->m_idClient, rc));
     
    18711867
    18721868/**
    1873  * For compatibility with old additions only - skip the current command w/o
     1869 * For compatibility with old additions only - skip the current message w/o
    18741870 * calling main code.
    18751871 *
     
    18991895     *       So, we have to track whether they issued a MSG_REPLY or not.  Wonderful.
    19001896     */
    1901     HostCommand *pFirstCmd = RTListGetFirstCpp(&pClient->m_HostCmdList, HostCommand, m_ListEntry);
    1902     if (pFirstCmd)
    1903     {
    1904         uint32_t const idMsg             = pFirstCmd->mMsgType;
    1905         bool const     f60BetaHackInPlay = pFirstCmd->m_f60BetaHackInPlay;
     1897    HostMsg *pFirstMsg = RTListGetFirstCpp(&pClient->m_HostMsgList, HostMsg, m_ListEntry);
     1898    if (pFirstMsg)
     1899    {
     1900        uint32_t const idMsg             = pFirstMsg->mType;
     1901        bool const     f60BetaHackInPlay = pFirstMsg->m_f60BetaHackInPlay;
    19061902        int            rc;
    19071903        if (!f60BetaHackInPlay)
     
    19091905        else
    19101906        {
    1911             RTListNodeRemove(&pFirstCmd->m_ListEntry);
    1912             pFirstCmd->Delete();
     1907            RTListNodeRemove(&pFirstMsg->m_ListEntry);
     1908            pFirstMsg->Delete();
    19131909            rc = VINF_SUCCESS;
    19141910        }
     
    19171913        if (RT_SUCCESS(rc))
    19181914        {
    1919             pClient->mHostCmdRc    = VINF_SUCCESS;
    1920             pClient->mHostCmdTries = 0;
     1915            pClient->mHostMsgRc    = VINF_SUCCESS;
     1916            pClient->mHostMsgTries = 0;
    19211917            pClient->mPeekCount    = 0;
    19221918        }
    19231919
    19241920        LogFlowFunc(("[Client %RU32] Legacy message skipping: Skipped %u (%s)%s!\n",
    1925                      pClient->m_idClient, idMsg, GstCtrlHostFnName((eHostFn)idMsg), f60BetaHackInPlay ? " hack style" : ""));
     1921                     pClient->m_idClient, idMsg, GstCtrlHostMsgtoStr((eHostMsg)idMsg), f60BetaHackInPlay ? " hack style" : ""));
    19261922        NOREF(idMsg);
    19271923        return rc;
     
    19391935 * @returns VBox status code.
    19401936 * @param   pClient         The client state.
    1941  * @param   idFunction      Function (event) that occured.
     1937 * @param   idMsg           Message ID that occured.
    19421938 * @param   cParms          Number of parameters.
    19431939 * @param   paParms         Array of parameters.
    19441940 */
    1945 int GstCtrlService::clientToMain(ClientState *pClient, uint32_t idFunction, uint32_t cParms, VBOXHGCMSVCPARM paParms[])
     1941int GstCtrlService::clientToMain(ClientState *pClient, uint32_t idMsg, uint32_t cParms, VBOXHGCMSVCPARM paParms[])
    19461942{
    19471943    /*
     
    19581954                            || (   m_fLegacyMode                                /* (see bugref:9313#c16) */
    19591955                                && pClient->m_idSession == UINT32_MAX
    1960                                 && (   idFunction == GUEST_EXEC_STATUS
    1961                                     || idFunction == GUEST_SESSION_NOTIFY)),
    1962                             ("idSession=%u (CID=%#x) m_idSession=%u idClient=%u idFunction=%u (%s)\n", idSession, idContext,
    1963                              pClient->m_idSession, pClient->m_idClient, idFunction, GstCtrlGuestFnName((eGuestFn)idFunction)),
     1956                                && (   idMsg == GUEST_MSG_EXEC_STATUS
     1957                                    || idMsg == GUEST_MSG_SESSION_NOTIFY)),
     1958                            ("idSession=%u (CID=%#x) m_idSession=%u idClient=%u idMsg=%u (%s)\n", idSession, idContext,
     1959                             pClient->m_idSession, pClient->m_idClient, idMsg, GstCtrlGuestMsgToStr((eGuestMsg)idMsg)),
    19641960                            VERR_ACCESS_DENIED);
    19651961
     
    19671963     * It seems okay, so make the call.
    19681964     */
    1969     return hostCallback(idFunction, cParms, paParms);
     1965    return hostCallback(idMsg, cParms, paParms);
    19701966}
    19711967
     
    19811977/*static*/ DECLCALLBACK(void)
    19821978GstCtrlService::svcCall(void *pvService, VBOXHGCMCALLHANDLE hCall, uint32_t idClient, void *pvClient,
    1983                         uint32_t idFunction, uint32_t cParms, VBOXHGCMSVCPARM paParms[], uint64_t tsArrival)
    1984 {
    1985     LogFlowFunc(("[Client %RU32] idFunction=%RU32 (%s), cParms=%RU32, paParms=0x%p\n",
    1986                  idClient, idFunction, GstCtrlGuestFnName((eGuestFn)idFunction), cParms, paParms));
     1979                        uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[], uint64_t tsArrival)
     1980{
     1981    LogFlowFunc(("[Client %RU32] u32Function=%RU32 (%s), cParms=%RU32, paParms=0x%p\n",
     1982                 idClient, u32Function, GstCtrlGuestMsgToStr((eGuestMsg)u32Function), cParms, paParms));
    19871983    RT_NOREF(tsArrival, idClient);
    19881984
     
    20001996     */
    20011997    int rc;
    2002     switch (idFunction)
    2003     {
    2004         case GUEST_MAKE_ME_MASTER:
     1998    switch (u32Function)
     1999    {
     2000        case GUEST_MSG_MAKE_ME_MASTER:
    20052001            LogFlowFunc(("[Client %RU32] GUEST_MAKE_ME_MASTER\n", idClient));
    20062002            rc = pThis->clientMakeMeMaster(pClient, hCall, cParms);
     
    20262022            rc = pThis->clientMsgSkip(pClient, hCall, cParms, paParms);
    20272023            break;
    2028         case GUEST_SESSION_PREPARE:
     2024        case GUEST_MSG_SESSION_PREPARE:
    20292025            LogFlowFunc(("[Client %RU32] GUEST_SESSION_PREPARE\n", idClient));
    20302026            rc = pThis->clientSessionPrepare(pClient, hCall, cParms, paParms);
    20312027            break;
    2032         case GUEST_SESSION_CANCEL_PREPARED:
     2028        case GUEST_MSG_SESSION_CANCEL_PREPARED:
    20332029            LogFlowFunc(("[Client %RU32] GUEST_SESSION_CANCEL_PREPARED\n", idClient));
    20342030            rc = pThis->clientSessionCancelPrepared(pClient, cParms, paParms);
    20352031            break;
    2036         case GUEST_SESSION_ACCEPT:
     2032        case GUEST_MSG_SESSION_ACCEPT:
    20372033            LogFlowFunc(("[Client %RU32] GUEST_SESSION_ACCEPT\n", idClient));
    20382034            rc = pThis->clientSessionAccept(pClient, hCall, cParms, paParms);
    20392035            break;
    2040         case GUEST_SESSION_CLOSE:
     2036        case GUEST_MSG_SESSION_CLOSE:
    20412037            LogFlowFunc(("[Client %RU32] GUEST_SESSION_CLOSE\n", idClient));
    20422038            rc = pThis->clientSessionCloseOther(pClient, cParms, paParms);
     
    20492045            if (cParms >= 3 && paParms[2].u.uint32 == (uint32_t)VERR_NOT_SUPPORTED)
    20502046            {
    2051                 HostCommand *pFirstCmd = RTListGetFirstCpp(&pClient->m_HostCmdList, HostCommand, m_ListEntry);
    2052                 if (pFirstCmd && pFirstCmd->m_idContext == paParms[0].u.uint32)
    2053                     pFirstCmd->m_f60BetaHackInPlay = true;
     2047                HostMsg *pFirstMsg = RTListGetFirstCpp(&pClient->m_HostMsgList, HostMsg, m_ListEntry);
     2048                if (pFirstMsg && pFirstMsg->m_idContext == paParms[0].u.uint32)
     2049                    pFirstMsg->m_f60BetaHackInPlay = true;
    20542050            }
    20552051            RT_FALL_THROUGH();
    20562052        case GUEST_MSG_PROGRESS_UPDATE:
    2057         case GUEST_SESSION_NOTIFY:
    2058         case GUEST_EXEC_OUTPUT:
    2059         case GUEST_EXEC_STATUS:
    2060         case GUEST_EXEC_INPUT_STATUS:
    2061         case GUEST_EXEC_IO_NOTIFY:
    2062         case GUEST_DIR_NOTIFY:
    2063         case GUEST_FILE_NOTIFY:
    2064             LogFlowFunc(("[Client %RU32] %s\n", idClient, GstCtrlGuestFnName((eGuestFn)idFunction)));
    2065             rc = pThis->clientToMain(pClient, idFunction, cParms, paParms);
     2053        case GUEST_MSG_SESSION_NOTIFY:
     2054        case GUEST_MSG_EXEC_OUTPUT:
     2055        case GUEST_MSG_EXEC_STATUS:
     2056        case GUEST_MSG_EXEC_INPUT_STATUS:
     2057        case GUEST_MSG_EXEC_IO_NOTIFY:
     2058        case GUEST_MSG_DIR_NOTIFY:
     2059        case GUEST_MSG_FILE_NOTIFY:
     2060            LogFlowFunc(("[Client %RU32] %s\n", idClient, GstCtrlGuestMsgToStr((eGuestMsg)u32Function)));
     2061            rc = pThis->clientToMain(pClient, u32Function /* Msg */, cParms, paParms);
    20662062            Assert(rc != VINF_HGCM_ASYNC_EXECUTE);
    20672063            break;
    20682064
    20692065        /*
    2070          * The remaining commands are here for compatibility with older guest additions:
     2066         * The remaining messages are here for compatibility with older Guest Additions:
    20712067         */
    20722068        case GUEST_MSG_WAIT:
     
    20972093         */
    20982094        default:
    2099             ASSERT_GUEST_MSG_FAILED(("idFunction=%d (%#x)\n", idFunction, idFunction));
     2095            ASSERT_GUEST_MSG_FAILED(("u32Function=%RU32 (%#x)\n", u32Function, u32Function));
    21002096            rc = VERR_INVALID_FUNCTION;
    21012097            break;
     
    21172113 *
    21182114 * @returns VBox status code.
    2119  * @param   idFunction      Function (event) that occured.
     2115 * @param   u32Function     Message ID that occured.
    21202116 * @param   cParms          Number of parameters.
    21212117 * @param   paParms         Array of parameters.
    21222118 */
    2123 int GstCtrlService::hostCallback(uint32_t idFunction, uint32_t cParms, VBOXHGCMSVCPARM paParms[])
    2124 {
    2125     LogFlowFunc(("idFunction=%u (%s), cParms=%ld, paParms=%p\n", idFunction, GstCtrlGuestFnName((eGuestFn)idFunction), cParms, paParms));
     2119int GstCtrlService::hostCallback(uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[])
     2120{
     2121    LogFlowFunc(("u32Function=%RU32 (%s), cParms=%ld, paParms=%p\n",
     2122                 u32Function, GstCtrlGuestMsgToStr((eGuestMsg)u32Function), cParms, paParms));
    21262123
    21272124    int rc;
     
    21292126    {
    21302127        VBOXGUESTCTRLHOSTCALLBACK data(cParms, paParms);
    2131         rc = mpfnHostCallback(mpvHostData, idFunction, &data, sizeof(data));
     2128        rc = mpfnHostCallback(mpvHostData, u32Function, &data, sizeof(data));
    21322129    }
    21332130    else
     
    21402137
    21412138/**
    2142  * Processes a command received from the host side and re-routes it to
     2139 * Processes a message received from the host side and re-routes it to
    21432140 * a connect client on the guest.
    21442141 *
    21452142 * @returns VBox status code.
    2146  * @param   idFunction  Function code to process.
     2143 * @param   idMsg   Message ID to process.
    21472144 * @param   cParms      Number of parameters.
    21482145 * @param   paParms     Array of parameters.
    21492146 */
    2150 int GstCtrlService::hostProcessCommand(uint32_t idFunction, uint32_t cParms, VBOXHGCMSVCPARM paParms[])
    2151 {
    2152     /*
    2153      * If no client is connected at all we don't buffer any host commands
     2147int GstCtrlService::hostProcessMessage(uint32_t idMsg, uint32_t cParms, VBOXHGCMSVCPARM paParms[])
     2148{
     2149    /*
     2150     * If no client is connected at all we don't buffer any host messages
    21542151     * and immediately return an error to the host.  This avoids the host
    21552152     * waiting for a response from the guest side in case VBoxService on
     
    21582155    if (m_ClientStateMap.empty())
    21592156    {
    2160         LogFlow(("GstCtrlService::hostProcessCommand: VERR_NOT_FOUND!\n"));
     2157        LogFlow(("GstCtrlService::hostProcessMessage: VERR_NOT_FOUND!\n"));
    21612158        return VERR_NOT_FOUND;
    21622159    }
    21632160
    21642161    /*
    2165      * Create a host command for each destination.
     2162     * Create a host message for each destination.
    21662163     * Note! There is currently only one scenario in which we send a host
    2167      *       command to two recipients.
    2168      */
    2169     HostCommand *pHostCmd = new (std::nothrow) HostCommand();
    2170     AssertReturn(pHostCmd, VERR_NO_MEMORY);
    2171     int rc = pHostCmd->Init(idFunction, cParms, paParms);
     2164     *       message to two recipients.
     2165     */
     2166    HostMsg *pHostMsg = new (std::nothrow) HostMsg();
     2167    AssertReturn(pHostMsg, VERR_NO_MEMORY);
     2168    int rc = pHostMsg->Init(idMsg, cParms, paParms);
    21722169    if (RT_SUCCESS(rc))
    21732170    {
    2174         uint64_t const fDestinations = pHostCmd->m_idContextAndDst & VBOX_GUESTCTRL_DST_BOTH;
    2175         HostCommand   *pHostCmd2     = NULL;
     2171        uint64_t const fDestinations = pHostMsg->m_idContextAndDst & VBOX_GUESTCTRL_DST_BOTH;
     2172        HostMsg       *pHostMsg2     = NULL;
    21762173        if (fDestinations != VBOX_GUESTCTRL_DST_BOTH)
    21772174        { /* likely */ }
    21782175        else
    21792176        {
    2180             pHostCmd2 = new (std::nothrow) HostCommand();
    2181             if (pHostCmd2)
    2182                 rc = pHostCmd2->Init(idFunction, cParms, paParms);
     2177            pHostMsg2 = new (std::nothrow) HostMsg();
     2178            if (pHostMsg2)
     2179                rc = pHostMsg2->Init(idMsg, cParms, paParms);
    21832180            else
    21842181                rc = VERR_NO_MEMORY;
     
    21862183        if (RT_SUCCESS(rc))
    21872184        {
    2188             LogFlowFunc(("Handling host command m_idContextAndDst=%#RX64, idFunction=%RU32, cParms=%RU32, paParms=%p, cClients=%zu\n",
    2189                          pHostCmd->m_idContextAndDst, idFunction, cParms, paParms, m_ClientStateMap.size()));
     2185            LogFlowFunc(("Handling host message m_idContextAndDst=%#RX64, idMsg=%RU32, cParms=%RU32, paParms=%p, cClients=%zu\n",
     2186                         pHostMsg->m_idContextAndDst, idMsg, cParms, paParms, m_ClientStateMap.size()));
    21902187
    21912188            /*
     
    21982195            if (fDestinations & VBOX_GUESTCTRL_DST_SESSION)
    21992196            {
    2200                 uint32_t const idSession = VBOX_GUESTCTRL_CONTEXTID_GET_SESSION(pHostCmd->m_idContext);
     2197                uint32_t const idSession = VBOX_GUESTCTRL_CONTEXTID_GET_SESSION(pHostMsg->m_idContext);
    22012198                ClientStateMap::iterator It = m_SessionIdMap.find(idSession);
    22022199                if (It != m_SessionIdMap.end())
     
    22042201                    ClientState *pClient = It->second;
    22052202                    Assert(pClient->m_idSession == idSession);
    2206                     RTListAppend(&pClient->m_HostCmdList, &pHostCmd->m_ListEntry);
    2207                     pHostCmd  = pHostCmd2;
    2208                     pHostCmd2 = NULL;
     2203                    RTListAppend(&pClient->m_HostMsgList, &pHostMsg->m_ListEntry);
     2204                    pHostMsg  = pHostMsg2;
     2205                    pHostMsg2 = NULL;
    22092206
    22102207                    int rc2 = pClient->Wakeup();
     
    22152212                else
    22162213                {
    2217                     LogFunc(("No client with session ID %u was found! (idFunction=%d %s)\n",
    2218                              idSession, idFunction, GstCtrlHostFnName((eHostFn)idFunction)));
     2214                    LogFunc(("No client with session ID %u was found! (idMsg=%d %s)\n",
     2215                             idSession, idMsg, GstCtrlHostMsgtoStr((eHostMsg)idMsg)));
    22192216                    rc = !(fDestinations & VBOX_GUESTCTRL_DST_ROOT_SVC) ? VERR_NOT_FOUND : VWRN_NOT_FOUND;
    22202217                }
     
    22252222                && RT_SUCCESS(rc))
    22262223            {
    2227                 Assert(pHostCmd);
     2224                Assert(pHostMsg);
    22282225                if (m_pMasterClient)
    22292226                {
    2230                     RTListAppend(&m_pMasterClient->m_HostCmdList, &pHostCmd->m_ListEntry);
    2231                     pHostCmd = NULL;
     2227                    RTListAppend(&m_pMasterClient->m_HostMsgList, &pHostMsg->m_ListEntry);
     2228                    pHostMsg = NULL;
    22322229
    22332230                    int rc2 = m_pMasterClient->Wakeup();
     
    22402237        }
    22412238
    2242         /* Drop unset commands */
    2243         if (pHostCmd2)
    2244             pHostCmd2->Delete();
    2245     }
    2246     if (pHostCmd)
    2247         pHostCmd->Delete();
     2239        /* Drop unset messages. */
     2240        if (pHostMsg2)
     2241            pHostMsg2->Delete();
     2242    }
     2243    if (pHostMsg)
     2244        pHostMsg->Delete();
    22482245
    22492246    if (RT_FAILURE(rc))
    2250         LogFunc(("Failed %Rrc (idFunction=%u, cParms=%u)\n", rc, idFunction, cParms));
     2247        LogFunc(("Failed %Rrc (idMsg=%u, cParms=%u)\n", rc, idMsg, cParms));
    22512248    return rc;
    22522249}
     
    22552252/**
    22562253 * @interface_method_impl{VBOXHGCMSVCFNTABLE,pfnHostCall,
    2257  *  Wraps to the hostProcessCommand() member function.}
     2254 *  Wraps to the hostProcessMessage() member function.}
    22582255 */
    22592256/*static*/ DECLCALLBACK(int)
     
    22642261    AssertPtrReturn(pThis, VERR_INVALID_POINTER);
    22652262
    2266     LogFlowFunc(("fn=%RU32, cParms=%RU32, paParms=0x%p\n", u32Function, cParms, paParms));
    2267     AssertReturn(u32Function != HOST_CANCEL_PENDING_WAITS, VERR_INVALID_FUNCTION);
    2268     return pThis->hostProcessCommand(u32Function, cParms, paParms);
     2263    LogFlowFunc(("u32Function=%RU32, cParms=%RU32, paParms=0x%p\n", u32Function, cParms, paParms));
     2264    AssertReturn(u32Function != HOST_MSG_CANCEL_PENDING_WAITS, VERR_INVALID_FUNCTION);
     2265    return pThis->hostProcessMessage(u32Function, cParms, paParms);
    22692266}
    22702267
  • trunk/src/VBox/HostServices/GuestControl/testcase/tstGuestControlSvc.cpp

    r76553 r76958  
    179179
    180180        /** Client connected, invalid parameters given. */
    181         { HOST_EXEC_CMD, 1024, 0, true, VERR_INVALID_POINTER },
    182         { HOST_EXEC_CMD, 1, 0, true, VERR_INVALID_POINTER },
    183         { HOST_EXEC_CMD, -1, 0, true, VERR_INVALID_POINTER },
     181        { HOST_MSG_EXEC_CMD, 1024, 0, true, VERR_INVALID_POINTER },
     182        { HOST_MSG_EXEC_CMD, 1, 0, true, VERR_INVALID_POINTER },
     183        { HOST_MSG_EXEC_CMD, -1, 0, true, VERR_INVALID_POINTER },
    184184
    185185        /** Client connected, parameters given. */
    186         { HOST_CANCEL_PENDING_WAITS, 1, &aParms[0], true, VINF_SUCCESS },
    187         { HOST_EXEC_CMD, 1, &aParms[0], true, VINF_SUCCESS },
    188         { HOST_EXEC_SET_INPUT, 1, &aParms[0], true, VINF_SUCCESS },
    189         { HOST_EXEC_GET_OUTPUT, 1, &aParms[0], true, VINF_SUCCESS },
     186        { HOST_MSG_CANCEL_PENDING_WAITS, 1, &aParms[0], true, VINF_SUCCESS },
     187        { HOST_MSG_EXEC_CMD, 1, &aParms[0], true, VINF_SUCCESS },
     188        { HOST_MSG_EXEC_SET_INPUT, 1, &aParms[0], true, VINF_SUCCESS },
     189        { HOST_MSG_EXEC_GET_OUTPUT, 1, &aParms[0], true, VINF_SUCCESS },
    190190
    191191        /** Client connected, unknown command + valid parameters given. */
     
    221221        HGCMSvcSetStr(&aParmsHost[2], "baz");
    222222
    223         rc = pTable->pfnHostCall(pTable->pvService, HOST_EXEC_CMD, 3, &aParmsHost[0]);
     223        rc = pTable->pfnHostCall(pTable->pvService, HOST_MSG_EXEC_CMD, 3, &aParmsHost[0]);
    224224        RTTEST_CHECK_RC_RET(g_hTest, rc, VINF_SUCCESS, rc);
    225225
  • trunk/src/VBox/Main/include/GuestCtrlImplPrivate.h

    r76562 r76958  
    11791179    int bindToSession(Console *pConsole, GuestSession *pSession, uint32_t uObjectID);
    11801180    int registerWaitEvent(const GuestEventTypes &lstEvents, GuestWaitEvent **ppEvent);
    1181     int sendCommand(uint32_t uFunction, uint32_t cParms, PVBOXHGCMSVCPARM paParms);
     1181    int sendMessage(uint32_t uFunction, uint32_t cParms, PVBOXHGCMSVCPARM paParms);
    11821182
    11831183protected:
  • trunk/src/VBox/Main/include/GuestSessionImpl.h

    r76562 r76958  
    325325    inline bool             i_processExists(uint32_t uProcessID, ComObjPtr<GuestProcess> *pProcess);
    326326    inline int              i_processGetByPID(ULONG uPID, ComObjPtr<GuestProcess> *pProcess);
    327     int                     i_sendCommand(uint32_t uFunction, uint32_t uParms, PVBOXHGCMSVCPARM paParms,
     327    int                     i_sendMessage(uint32_t uFunction, uint32_t uParms, PVBOXHGCMSVCPARM paParms,
    328328                                          uint64_t fDst = VBOX_GUESTCTRL_DST_SESSION);
    329329    static HRESULT          i_setErrorExternal(VirtualBoxBase *pInterface, int guestRc);
  • trunk/src/VBox/Main/src-client/GuestCtrlImpl.cpp

    r76553 r76958  
    6161
    6262/**
    63  * Static callback function for receiving updates on guest control commands
     63 * Static callback function for receiving updates on guest control messages
    6464 * from the guest. Acts as a dispatcher for the actual class instance.
    6565 *
     
    7272 *          return locations.  However, there is no explaination for this attitude
    7373 *          thowards error handling.   Further, it creates a slight problem since
    74  *          the service would route all function calls it didn't recognize here,
    75  *          thereby making any undefined functions confusingly return VINF_SUCCESS.
     74 *          the service would route all message calls it didn't recognize here,
     75 *          thereby making any undefined messages confusingly return VINF_SUCCESS.
    7676 *
    7777 *          In my humble opinion, if the guest gives us incorrect input it should
     
    8585/* static */
    8686DECLCALLBACK(int) Guest::i_notifyCtrlDispatcher(void    *pvExtension,
    87                                                 uint32_t idFunction,
     87                                                uint32_t idMessage,
    8888                                                void    *pvData,
    8989                                                uint32_t cbData)
     
    9595     * changes to the object state.
    9696     */
    97     Log2Func(("pvExtension=%p, idFunction=%RU32, pvParms=%p, cbParms=%RU32\n", pvExtension, idFunction, pvData, cbData));
     97    Log2Func(("pvExtension=%p, idMessage=%RU32, pvParms=%p, cbParms=%RU32\n", pvExtension, idMessage, pvData, cbData));
    9898
    9999    ComObjPtr<Guest> pGuest = reinterpret_cast<Guest *>(pvExtension);
     
    110110
    111111    /*
    112      * For guest control 2.0 using the legacy commands we need to do the following here:
     112     * For guest control 2.0 using the legacy messages we need to do the following here:
    113113     * - Get the callback header to access the context ID
    114114     * - Get the context ID of the callback
     
    123123    uint32_t const idContext = pSvcCb->mpaParms[0].u.uint32;
    124124
    125     VBOXGUESTCTRLHOSTCBCTX CtxCb = { idFunction, idContext };
     125    VBOXGUESTCTRLHOSTCBCTX CtxCb = { idMessage, idContext };
    126126    int rc = pGuest->i_dispatchToSession(&CtxCb, pSvcCb);
    127127
     
    142142    AssertPtrReturn(pSvcCb, VERR_INVALID_POINTER);
    143143
    144     Log2Func(("uFunction=%RU32, uContextID=%RU32, uProtocol=%RU32\n", pCtxCb->uFunction, pCtxCb->uContextID, pCtxCb->uProtocol));
     144    Log2Func(("uMessage=%RU32, uContextID=%RU32, uProtocol=%RU32\n", pCtxCb->uMessage, pCtxCb->uContextID, pCtxCb->uProtocol));
    145145
    146146    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    170170        bool fDispatch = true;
    171171        rc = VERR_INVALID_FUNCTION;
    172         if (   pCtxCb->uFunction == GUEST_EXEC_STATUS
     172        if (   pCtxCb->uMessage == GUEST_MSG_EXEC_STATUS
    173173            && pSvcCb->mParms    >= 5)
    174174        {
     
    183183                && (int32_t)dataCb.uFlags == VERR_TOO_MUCH_DATA)
    184184            {
    185                 LogFlowFunc(("Requested command with too much data, skipping dispatching ...\n"));
     185                LogFlowFunc(("Requested message with too much data, skipping dispatching ...\n"));
    186186                Assert(dataCb.uPID == 0);
    187187                fDispatch = false;
     
    191191#endif
    192192        {
    193             switch (pCtxCb->uFunction)
     193            switch (pCtxCb->uMessage)
    194194            {
    195                 case GUEST_DISCONNECTED:
     195                case GUEST_MSG_DISCONNECTED:
    196196                    rc = pSession->i_dispatchToThis(pCtxCb, pSvcCb);
    197197                    break;
    198198
    199199                /* Process stuff. */
    200                 case GUEST_EXEC_STATUS:
    201                 case GUEST_EXEC_OUTPUT:
    202                 case GUEST_EXEC_INPUT_STATUS:
    203                 case GUEST_EXEC_IO_NOTIFY:
     200                case GUEST_MSG_EXEC_STATUS:
     201                case GUEST_MSG_EXEC_OUTPUT:
     202                case GUEST_MSG_EXEC_INPUT_STATUS:
     203                case GUEST_MSG_EXEC_IO_NOTIFY:
    204204                    rc = pSession->i_dispatchToObject(pCtxCb, pSvcCb);
    205205                    break;
    206206
    207207                /* File stuff. */
    208                 case GUEST_FILE_NOTIFY:
     208                case GUEST_MSG_FILE_NOTIFY:
    209209                    rc = pSession->i_dispatchToObject(pCtxCb, pSvcCb);
    210210                    break;
    211211
    212212                /* Session stuff. */
    213                 case GUEST_SESSION_NOTIFY:
     213                case GUEST_MSG_SESSION_NOTIFY:
    214214                    rc = pSession->i_dispatchToThis(pCtxCb, pSvcCb);
    215215                    break;
  • trunk/src/VBox/Main/src-client/GuestCtrlPrivate.cpp

    r76553 r76958  
    813813    try
    814814    {
    815         Log2Func(("uFunc=%RU32, cParms=%RU32\n", pCtxCb->uFunction, pSvcCb->mParms));
    816 
    817         switch (pCtxCb->uFunction)
     815        Log2Func(("uFunc=%RU32, cParms=%RU32\n", pCtxCb->uMessage, pSvcCb->mParms));
     816
     817        switch (pCtxCb->uMessage)
    818818        {
    819819            case GUEST_MSG_PROGRESS_UPDATE:
     
    14131413}
    14141414
    1415 int GuestObject::sendCommand(uint32_t uFunction, uint32_t cParms, PVBOXHGCMSVCPARM paParms)
     1415int GuestObject::sendMessage(uint32_t uMessage, uint32_t cParms, PVBOXHGCMSVCPARM paParms)
    14161416{
    14171417#ifndef VBOX_GUESTCTRL_TEST_CASE
     
    14321432
    14331433        /* Make the call. */
    1434         LogFlowThisFunc(("uFunction=%RU32, cParms=%RU32\n", uFunction, cParms));
    1435         vrc = pVMMDev->hgcmHostCall(HGCMSERVICE_NAME, uFunction, cParms, paParms);
     1434        LogFlowThisFunc(("uMessage=%RU32, cParms=%RU32\n", uMessage, cParms));
     1435        vrc = pVMMDev->hgcmHostCall(HGCMSERVICE_NAME, uMessage, cParms, paParms);
    14361436        if (RT_FAILURE(vrc))
    14371437        {
     
    14431443
    14441444    /* Not needed within testcases. */
    1445     RT_NOREF(uFunction, cParms, paParms);
     1445    RT_NOREF(uMessage, cParms, paParms);
    14461446    int vrc = VINF_SUCCESS;
    14471447#endif
  • trunk/src/VBox/Main/src-client/GuestDirectoryImpl.cpp

    r76553 r76958  
    170170
    171171    LogFlowThisFunc(("strPath=%s, uContextID=%RU32, uFunction=%RU32, pSvcCb=%p\n",
    172                      mData.mOpenInfo.mPath.c_str(), pCbCtx->uContextID, pCbCtx->uFunction, pSvcCb));
     172                     mData.mOpenInfo.mPath.c_str(), pCbCtx->uContextID, pCbCtx->uMessage, pSvcCb));
    173173
    174174    int vrc;
    175     switch (pCbCtx->uFunction)
    176     {
    177         case GUEST_DIR_NOTIFY:
     175    switch (pCbCtx->uMessage)
     176    {
     177        case GUEST_MSG_DIR_NOTIFY:
    178178        {
    179179            int idx = 1; /* Current parameter index. */
  • trunk/src/VBox/Main/src-client/GuestFileImpl.cpp

    r76553 r76958  
    333333
    334334    LogFlowThisFunc(("strName=%s, uContextID=%RU32, uFunction=%RU32, pSvcCb=%p\n",
    335                      mData.mOpenInfo.mFilename.c_str(), pCbCtx->uContextID, pCbCtx->uFunction, pSvcCb));
     335                     mData.mOpenInfo.mFilename.c_str(), pCbCtx->uContextID, pCbCtx->uMessage, pSvcCb));
    336336
    337337    int vrc;
    338     switch (pCbCtx->uFunction)
    339     {
    340         case GUEST_DISCONNECTED:
     338    switch (pCbCtx->uMessage)
     339    {
     340        case GUEST_MSG_DISCONNECTED:
    341341            vrc = i_onGuestDisconnected(pCbCtx, pSvcCb);
    342342            break;
    343343
    344         case GUEST_FILE_NOTIFY:
     344        case GUEST_MSG_FILE_NOTIFY:
    345345            vrc = i_onFileNotify(pCbCtx, pSvcCb);
    346346            break;
     
    386386    HGCMSvcSetU32(&paParms[i++], mObjectID /* Guest file ID */);
    387387
    388     vrc = sendCommand(HOST_FILE_CLOSE, i, paParms);
     388    vrc = sendMessage(HOST_MSG_FILE_CLOSE, i, paParms);
    389389    if (RT_SUCCESS(vrc))
    390390        vrc = i_waitForStatusChange(pEvent, 30 * 1000 /* Timeout in ms */,
     
    730730    alock.release(); /* Drop write lock before sending. */
    731731
    732     vrc = sendCommand(HOST_FILE_OPEN, i, paParms);
     732    vrc = sendMessage(HOST_MSG_FILE_OPEN, i, paParms);
    733733    if (RT_SUCCESS(vrc))
    734734        vrc = i_waitForStatusChange(pEvent, uTimeoutMS, NULL /* FileStatus */, prcGuest);
     
    785785    alock.release(); /* Drop write lock before sending. */
    786786
    787     vrc = sendCommand(HOST_FILE_READ, i, paParms);
     787    vrc = sendMessage(HOST_MSG_FILE_READ, i, paParms);
    788788    if (RT_SUCCESS(vrc))
    789789    {
     
    845845    alock.release(); /* Drop write lock before sending. */
    846846
    847     vrc = sendCommand(HOST_FILE_READ_AT, i, paParms);
     847    vrc = sendMessage(HOST_MSG_FILE_READ_AT, i, paParms);
    848848    if (RT_SUCCESS(vrc))
    849849    {
     
    907907    alock.release(); /* Drop write lock before sending. */
    908908
    909     vrc = sendCommand(HOST_FILE_SEEK, i, paParms);
     909    vrc = sendMessage(HOST_MSG_FILE_SEEK, i, paParms);
    910910    if (RT_SUCCESS(vrc))
    911911    {
     
    11711171    alock.release(); /* Drop write lock before sending. */
    11721172
    1173     vrc = sendCommand(HOST_FILE_WRITE, i, paParms);
     1173    vrc = sendMessage(HOST_MSG_FILE_WRITE, i, paParms);
    11741174    if (RT_SUCCESS(vrc))
    11751175    {
     
    12351235    alock.release(); /* Drop write lock before sending. */
    12361236
    1237     vrc = sendCommand(HOST_FILE_WRITE_AT, i, paParms);
     1237    vrc = sendMessage(HOST_MSG_FILE_WRITE_AT, i, paParms);
    12381238    if (RT_SUCCESS(vrc))
    12391239    {
  • trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp

    r76553 r76958  
    416416    AssertPtrReturn(pSvcCb, VERR_INVALID_POINTER);
    417417#ifdef DEBUG
    418     LogFlowThisFunc(("uPID=%RU32, uContextID=%RU32, uFunction=%RU32, pSvcCb=%p\n",
    419                      mData.mPID, pCbCtx->uContextID, pCbCtx->uFunction, pSvcCb));
     418    LogFlowThisFunc(("uPID=%RU32, uContextID=%RU32, uMessage=%RU32, pSvcCb=%p\n",
     419                     mData.mPID, pCbCtx->uContextID, pCbCtx->uMessage, pSvcCb));
    420420#endif
    421421
    422422    int vrc;
    423     switch (pCbCtx->uFunction)
    424     {
    425         case GUEST_DISCONNECTED:
     423    switch (pCbCtx->uMessage)
     424    {
     425        case GUEST_MSG_DISCONNECTED:
    426426        {
    427427            vrc = i_onGuestDisconnected(pCbCtx, pSvcCb);
     
    429429        }
    430430
    431         case GUEST_EXEC_STATUS:
     431        case GUEST_MSG_EXEC_STATUS:
    432432        {
    433433            vrc = i_onProcessStatusChange(pCbCtx, pSvcCb);
     
    435435        }
    436436
    437         case GUEST_EXEC_OUTPUT:
     437        case GUEST_MSG_EXEC_OUTPUT:
    438438        {
    439439            vrc = i_onProcessOutput(pCbCtx, pSvcCb);
     
    441441        }
    442442
    443         case GUEST_EXEC_INPUT_STATUS:
     443        case GUEST_MSG_EXEC_INPUT_STATUS:
    444444        {
    445445            vrc = i_onProcessInputStatus(pCbCtx, pSvcCb);
     
    916916        alock.release(); /* Drop the write lock before sending. */
    917917
    918         vrc = sendCommand(HOST_EXEC_GET_OUTPUT, i, paParms);
     918        vrc = sendMessage(HOST_MSG_EXEC_GET_OUTPUT, i, paParms);
    919919    }
    920920
     
    11321132        rLock.release(); /* Drop the write lock before sending. */
    11331133
    1134         vrc = sendCommand(HOST_EXEC_CMD, i, paParms);
     1134        vrc = sendMessage(HOST_MSG_EXEC_CMD, i, paParms);
    11351135        if (RT_FAILURE(vrc))
    11361136        {
     
    12511251            alock.release(); /* Drop the write lock before sending. */
    12521252
    1253             vrc = sendCommand(HOST_EXEC_TERMINATE, i, paParms);
     1253            vrc = sendMessage(HOST_MSG_EXEC_TERMINATE, i, paParms);
    12541254            if (RT_SUCCESS(vrc))
    12551255                vrc = i_waitForStatusChange(pEvent, uTimeoutMS,
     
    17331733
    17341734    uint32_t cbProcessed = 0;
    1735     vrc = sendCommand(HOST_EXEC_SET_INPUT, i, paParms);
     1735    vrc = sendMessage(HOST_MSG_EXEC_SET_INPUT, i, paParms);
    17361736    if (RT_SUCCESS(vrc))
    17371737    {
  • trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp

    r76553 r76958  
    718718    alock.release(); /* Drop the write lock before waiting. */
    719719
    720     vrc = i_sendCommand(HOST_SESSION_CLOSE, i, paParms, VBOX_GUESTCTRL_DST_BOTH);
     720    vrc = i_sendMessage(HOST_MSG_SESSION_CLOSE, i, paParms, VBOX_GUESTCTRL_DST_BOTH);
    721721    if (RT_SUCCESS(vrc))
    722722        vrc = i_waitForStatusChange(pEvent, GuestSessionWaitForFlag_Terminate, uTimeoutMS,
     
    10731073    alock.release(); /* Drop write lock before sending. */
    10741074
    1075     vrc = i_sendCommand(HOST_DIR_REMOVE, i, paParms);
     1075    vrc = i_sendMessage(HOST_MSG_DIR_REMOVE, i, paParms);
    10761076    if (RT_SUCCESS(vrc))
    10771077    {
     
    13141314    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    13151315
    1316     LogFlowThisFunc(("sessionID=%RU32, CID=%RU32, uFunction=%RU32, pSvcCb=%p\n",
    1317                      mData.mSession.mID, pCbCtx->uContextID, pCbCtx->uFunction, pSvcCb));
     1316    LogFlowThisFunc(("sessionID=%RU32, CID=%RU32, uMessage=%RU32, pSvcCb=%p\n",
     1317                     mData.mSession.mID, pCbCtx->uContextID, pCbCtx->uMessage, pSvcCb));
    13181318    int rc;
    1319     switch (pCbCtx->uFunction)
    1320     {
    1321         case GUEST_DISCONNECTED:
     1319    switch (pCbCtx->uMessage)
     1320    {
     1321        case GUEST_MSG_DISCONNECTED:
    13221322            /** @todo Handle closing all guest objects. */
    13231323            rc = VERR_INTERNAL_ERROR;
    13241324            break;
    13251325
    1326         case GUEST_SESSION_NOTIFY: /* Guest Additions >= 4.3.0. */
     1326        case GUEST_MSG_SESSION_NOTIFY: /* Guest Additions >= 4.3.0. */
    13271327        {
    13281328            rc = i_onSessionStatusChange(pCbCtx, pSvcCb);
     
    19471947    alock.release(); /* Drop write lock before sending. */
    19481948
    1949     vrc = i_sendCommand(HOST_SESSION_CREATE, i, paParms, VBOX_GUESTCTRL_DST_ROOT_SVC);
     1949    vrc = i_sendMessage(HOST_MSG_SESSION_CREATE, i, paParms, VBOX_GUESTCTRL_DST_ROOT_SVC);
    19501950    if (RT_SUCCESS(vrc))
    19511951    {
     
    21362136    alock.release(); /* Drop write lock before sending. */
    21372137
    2138     vrc = i_sendCommand(HOST_PATH_RENAME, i, paParms);
     2138    vrc = i_sendMessage(HOST_MSG_PATH_RENAME, i, paParms);
    21392139    if (RT_SUCCESS(vrc))
    21402140    {
     
    21772177    alock.release(); /* Drop write lock before sending. */
    21782178
    2179     vrc = i_sendCommand(HOST_PATH_USER_DOCUMENTS, i, paParms);
     2179    vrc = i_sendMessage(HOST_MSG_PATH_USER_DOCUMENTS, i, paParms);
    21802180    if (RT_SUCCESS(vrc))
    21812181    {
     
    22272227    alock.release(); /* Drop write lock before sending. */
    22282228
    2229     vrc = i_sendCommand(HOST_PATH_USER_HOME, i, paParms);
     2229    vrc = i_sendMessage(HOST_MSG_PATH_USER_HOME, i, paParms);
    22302230    if (RT_SUCCESS(vrc))
    22312231    {
     
    24372437}
    24382438
    2439 int GuestSession::i_sendCommand(uint32_t uFunction, uint32_t uParms, PVBOXHGCMSVCPARM paParms,
     2439int GuestSession::i_sendMessage(uint32_t uMessage, uint32_t uParms, PVBOXHGCMSVCPARM paParms,
    24402440                                uint64_t fDst /*= VBOX_GUESTCTRL_DST_SESSION*/)
    24412441{
     
    24502450    AssertPtr(pVMMDev);
    24512451
    2452     LogFlowThisFunc(("uFunction=%RU32 (%s), uParms=%RU32\n", uFunction, GstCtrlHostFnName((guestControl::eHostFn)uFunction), uParms));
     2452    LogFlowThisFunc(("uMessage=%RU32 (%s), uParms=%RU32\n", uMessage, GstCtrlHostMsgtoStr((guestControl::eHostMsg)uMessage), uParms));
    24532453
    24542454    /* HACK ALERT! We extend the first parameter to 64-bit and use the
     
    24602460
    24612461    /* Make the call. */
    2462     int vrc = pVMMDev->hgcmHostCall(HGCMSERVICE_NAME, uFunction, uParms, paParms);
     2462    int vrc = pVMMDev->hgcmHostCall(HGCMSERVICE_NAME, uMessage, uParms, paParms);
    24632463    if (RT_FAILURE(vrc))
    24642464    {
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