Changeset 76958 in vbox
- Timestamp:
- Jan 23, 2019 6:23:04 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 128342
- Location:
- trunk
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/HostServices/GuestControlSvc.h
r76585 r76958 87 87 typedef struct VBoxGuestCtrlHostCbCtx 88 88 { 89 /** HGCM Functionnumber. */90 uint32_t u Function;89 /** HGCM message number. */ 90 uint32_t uMessage; 91 91 /** The context ID. */ 92 92 uint32_t uContextID; … … 126 126 127 127 /** 128 * The service functions which are callable by host.129 */ 130 enum eHost Fn128 * The service messages which are callable by host. 129 */ 130 enum eHostMsg 131 131 { 132 132 /** 133 133 * The host asks the client to cancel all pending waits and exit. 134 134 */ 135 HOST_ CANCEL_PENDING_WAITS = 0,135 HOST_MSG_CANCEL_PENDING_WAITS = 0, 136 136 /** 137 137 * The host wants to create a guest session. 138 138 */ 139 HOST_ SESSION_CREATE = 20,139 HOST_MSG_SESSION_CREATE = 20, 140 140 /** 141 141 * The host wants to close a guest session. 142 142 */ 143 HOST_ SESSION_CLOSE = 21,143 HOST_MSG_SESSION_CLOSE = 21, 144 144 /** 145 145 * The host wants to execute something in the guest. This can be a command line 146 146 * 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, 150 150 /** 151 151 * 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, 155 155 /** 156 156 * Gets the current status of a running process, e.g. 157 157 * 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, 161 161 /** 162 162 * Terminates a running guest process. 163 163 */ 164 HOST_ EXEC_TERMINATE = 110,164 HOST_MSG_EXEC_TERMINATE = 110, 165 165 /** 166 166 * Waits for a certain event to happen. This can be an input, output 167 167 * or status event. 168 168 */ 169 HOST_ EXEC_WAIT_FOR = 120,169 HOST_MSG_EXEC_WAIT_FOR = 120, 170 170 /** 171 171 * Opens a guest file. 172 172 */ 173 HOST_ FILE_OPEN = 240,173 HOST_MSG_FILE_OPEN = 240, 174 174 /** 175 175 * Closes a guest file. 176 176 */ 177 HOST_ FILE_CLOSE = 241,177 HOST_MSG_FILE_CLOSE = 241, 178 178 /** 179 179 * Reads from an opened guest file. 180 180 */ 181 HOST_ FILE_READ = 250,181 HOST_MSG_FILE_READ = 250, 182 182 /** 183 183 * Reads from an opened guest file at 184 184 * a specified offset. 185 185 */ 186 HOST_ FILE_READ_AT = 251,186 HOST_MSG_FILE_READ_AT = 251, 187 187 /** 188 188 * Write to an opened guest file. 189 189 */ 190 HOST_ FILE_WRITE = 260,190 HOST_MSG_FILE_WRITE = 260, 191 191 /** 192 192 * Write to an opened guest file at 193 193 * a specified offset. 194 194 */ 195 HOST_ FILE_WRITE_AT = 261,195 HOST_MSG_FILE_WRITE_AT = 261, 196 196 /** 197 197 * Changes the read & write position of an opened guest file. 198 198 */ 199 HOST_ FILE_SEEK = 270,199 HOST_MSG_FILE_SEEK = 270, 200 200 /** 201 201 * Gets the current file position of an opened guest file. 202 202 */ 203 HOST_ FILE_TELL = 271,203 HOST_MSG_FILE_TELL = 271, 204 204 /** 205 205 * Removes a directory on the guest. 206 206 */ 207 HOST_ DIR_REMOVE = 320,207 HOST_MSG_DIR_REMOVE = 320, 208 208 /** 209 209 * Renames a path on the guest. 210 210 */ 211 HOST_ PATH_RENAME = 330,211 HOST_MSG_PATH_RENAME = 330, 212 212 /** 213 213 * Retrieves the user's documents directory. 214 214 */ 215 HOST_ PATH_USER_DOCUMENTS = 331,215 HOST_MSG_PATH_USER_DOCUMENTS = 331, 216 216 /** 217 217 * Retrieves the user's home directory. 218 218 */ 219 HOST_ PATH_USER_HOME = 332219 HOST_MSG_PATH_USER_HOME = 332 220 220 }; 221 221 222 222 223 223 /** 224 * Translates a guest control host function function enum to at string. 224 * Translates a guest control host message enum to a string. 225 * 225 226 * @returns Enum string name. 226 * @param enm Function The function name to translate.227 */ 228 DECLINLINE(const char *) GstCtrlHost FnName(enum eHostFn enmFunction)229 { 230 switch (enm Function)227 * @param enmMsg The message to translate. 228 */ 229 DECLINLINE(const char *) GstCtrlHostMsgtoStr(enum eHostMsg enmMsg) 230 { 231 switch (enmMsg) 231 232 { 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); 252 253 } 253 254 return "Unknown"; … … 256 257 257 258 /** 258 * The service functions which are called byguest.259 * The service messages which are callable by the guest. 259 260 * 260 * @note The functionnumbers cannot be changed. Please use the first non-zero261 * 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. 262 263 * 263 * @note Remember to update service.cpp when adding new functions/events for264 * Main, as it validates all incoming commands before passing them on.265 */ 266 enum eGuest Fn264 * @note Remember to update service.cpp when adding new messages for Main, 265 * as it validates all incoming messages before passing them on. 266 */ 267 enum eGuestMsg 267 268 { 268 269 /** Guest waits for a new message the host wants to process on the guest side. 269 270 * This is a blocking call and can be deferred. 270 271 * 271 * @note This commandis rather odd. The above description isn't really272 * @note This message is rather odd. The above description isn't really 272 273 * correct. Yes, it (1) waits for a new message and will return the 273 274 * mesage number and parameter count when one is available. However, it … … 303 304 * 304 305 * @note This is a host side notification message that has no business in this 305 * enum. The guest cannot use this functionnumber, 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, 308 309 /** Sets a message filter to only get messages which have a certain 309 310 * context ID scheme (that is, a specific session, object etc). … … 391 392 * This skips the current message, replying to the main backend as best it can. 392 393 * 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 to394 * VBox status code to pass onto Main when skipping the message, defaults to 394 395 * VERR_NOT_SUPPORTED. The second parameter is the 32-bit message ID of the 395 * commandto skip, by default whatever is first in the queue is removed. This396 * message to skip, by default whatever is first in the queue is removed. This 396 397 * is also the case if UINT32_MAX is specified. 397 398 * … … 407 408 * Skips the current assigned message returned by GUEST_MSG_WAIT. 408 409 * Needed for telling the host service to not keep stale 409 * host commands in the queue.410 * host messages in the queue. 410 411 * @deprecated Replaced by GUEST_MSG_SKIP. 411 412 */ … … 433 434 * @since 6.0 434 435 */ 435 GUEST_M AKE_ME_MASTER = 13,436 GUEST_MSG_MAKE_ME_MASTER = 13, 436 437 /** Prepares the starting of a session. 437 438 * … … 455 456 * @since 6.0 456 457 */ 457 GUEST_ SESSION_PREPARE = 14,458 GUEST_MSG_SESSION_PREPARE = 14, 458 459 /** Cancels a prepared session. 459 460 * … … 470 471 * @since 6.0 471 472 */ 472 GUEST_ SESSION_CANCEL_PREPARED = 15,473 GUEST_MSG_SESSION_CANCEL_PREPARED = 15, 473 474 /** Accepts a prepared session. 474 475 * … … 490 491 * @since 6.0 491 492 */ 492 GUEST_ SESSION_ACCEPT = 16,493 GUEST_MSG_SESSION_ACCEPT = 16, 493 494 /** 494 495 * Guest reports back a guest session status. 495 496 * @todo proper docs. 496 497 */ 497 GUEST_ SESSION_NOTIFY = 20,498 GUEST_MSG_SESSION_NOTIFY = 20, 498 499 /** 499 500 * Guest wants to close a specific guest session. 500 501 * @todo proper docs. 501 502 */ 502 GUEST_ SESSION_CLOSE = 21,503 GUEST_MSG_SESSION_CLOSE = 21, 503 504 504 505 /** … … 506 507 * @todo proper docs. 507 508 */ 508 GUEST_ EXEC_OUTPUT = 100,509 GUEST_MSG_EXEC_OUTPUT = 100, 509 510 /** 510 511 * Guest sends a status update of an executed process to the host. 511 512 * @todo proper docs. 512 513 */ 513 GUEST_ EXEC_STATUS = 101,514 GUEST_MSG_EXEC_STATUS = 101, 514 515 /** 515 516 * Guests sends an input status notification to the host. 516 517 * @todo proper docs. 517 518 */ 518 GUEST_ EXEC_INPUT_STATUS = 102,519 GUEST_MSG_EXEC_INPUT_STATUS = 102, 519 520 /** 520 521 * Guest notifies the host about some I/O event. This can be … … 524 525 * @todo proper docs. 525 526 */ 526 GUEST_ EXEC_IO_NOTIFY = 210,527 GUEST_MSG_EXEC_IO_NOTIFY = 210, 527 528 /** 528 529 * Guest notifies the host about some directory event. 529 530 * @todo proper docs. 530 531 */ 531 GUEST_ DIR_NOTIFY = 230,532 GUEST_MSG_DIR_NOTIFY = 230, 532 533 /** 533 534 * Guest notifies the host about some file event. 534 535 * @todo proper docs. 535 536 */ 536 GUEST_ FILE_NOTIFY = 240537 GUEST_MSG_FILE_NOTIFY = 240 537 538 }; 538 539 539 540 /** 540 * Translates a guest control host function function enum to at string. 541 * Translates a guest control guest message enum to a string. 542 * 541 543 * @returns Enum string name. 542 * @param enm Function The function name to translate.543 */ 544 DECLINLINE(const char *) GstCtrlGuest FnName(enum eGuestFn enmFunction)545 { 546 switch (enm Function)544 * @param enmMsg The message to translate. 545 */ 546 DECLINLINE(const char *) GstCtrlGuestMsgToStr(enum eGuestMsg enmMsg) 547 { 548 switch (enmMsg) 547 549 { 548 550 RT_CASE_RET_STR(GUEST_MSG_WAIT); 549 551 RT_CASE_RET_STR(GUEST_MSG_CANCEL); 550 RT_CASE_RET_STR(GUEST_ DISCONNECTED);552 RT_CASE_RET_STR(GUEST_MSG_DISCONNECTED); 551 553 RT_CASE_RET_STR(GUEST_MSG_FILTER_SET); 552 554 RT_CASE_RET_STR(GUEST_MSG_FILTER_UNSET); … … 558 560 RT_CASE_RET_STR(GUEST_MSG_PROGRESS_UPDATE); 559 561 RT_CASE_RET_STR(GUEST_MSG_SKIP); 560 RT_CASE_RET_STR(GUEST_M AKE_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); 572 574 } 573 575 return "Unknown"; … … 655 657 656 658 /** 657 * Waits for a host commandto arrive. The structure then contains the659 * Waits for a host message to arrive. The structure then contains the 658 660 * 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 */ 663 typedef struct HGCMMsgWaitFor 664 { 665 VBGLIOCHGCMCALL hdr; 666 /** The returned message the host wants to run on the guest. */ 668 667 HGCMFunctionParameter msg; /* OUT uint32_t */ 669 668 /** Number of parameters the message needs. */ 670 669 HGCMFunctionParameter num_parms; /* OUT uint32_t */ 671 } HGCMMsg CmdWaitFor;672 673 /** 674 * Asks the guest control host service to set a command670 } HGCMMsgWaitFor; 671 672 /** 673 * Asks the guest control host service to set a message 675 674 * filter for this client. This filter will then only 676 675 * deliver messages to the client which match the 677 676 * wanted context ID (ranges). 678 677 */ 679 typedef struct HGCMMsgCmdFilterSet 680 { 681 VBGLIOCHGCMCALL hdr; 682 /** Value to filter for after filter mask 683 * was applied. */ 678 typedef struct HGCMMsgFilterSet 679 { 680 VBGLIOCHGCMCALL hdr; 681 /** Value to filter for after filter mask was applied. */ 684 682 HGCMFunctionParameter value; /* IN uint32_t */ 685 683 /** Mask to add to the current set filter. */ … … 689 687 /** Filter flags; currently unused. */ 690 688 HGCMFunctionParameter flags; /* IN uint32_t */ 691 } HGCMMsg CmdFilterSet;689 } HGCMMsgFilterSet; 692 690 693 691 /** … … 695 693 * a previously set message filter again. 696 694 */ 697 typedef struct HGCMMsg CmdFilterUnset695 typedef struct HGCMMsgFilterUnset 698 696 { 699 697 VBGLIOCHGCMCALL hdr; 700 698 /** Unset flags; currently unused. */ 701 699 HGCMFunctionParameter flags; /* IN uint32_t */ 702 } HGCMMsg CmdFilterUnset;700 } HGCMMsgFilterUnset; 703 701 704 702 /** 705 703 * Asks the guest control host service to skip the 706 * currently assigned host commandreturned by704 * currently assigned host message returned by 707 705 * VbglR3GuestCtrlMsgWaitFor(). 708 706 */ 709 typedef struct HGCMMsg CmdSkip707 typedef struct HGCMMsgSkip 710 708 { 711 709 VBGLIOCHGCMCALL hdr; 712 710 /** Skip flags; currently unused. */ 713 711 HGCMFunctionParameter flags; /* IN uint32_t */ 714 } HGCMMsg CmdSkip;712 } HGCMMsgSkip; 715 713 716 714 /** … … 723 721 } HGCMMsgCancelPendingWaits; 724 722 725 typedef struct HGCMMsg CmdReply723 typedef struct HGCMMsgReply 726 724 { 727 725 VBGLIOCHGCMCALL hdr; … … 734 732 /** Optional payload to this reply. */ 735 733 HGCMFunctionParameter payload; 736 } HGCMMsg CmdReply;734 } HGCMMsgReply; 737 735 738 736 /** -
trunk/src/VBox
- Property svn:mergeinfo
-
old new 8 8 /branches/VBox-5.0/src/VBox:104938,104943,104950,104987-104988,104990,106453 9 9 /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 11 11 /branches/andy/draganddrop/src/VBox:90781-91268 12 12 /branches/andy/guestctrl20/src/VBox:78916,78930
-
- Property svn:mergeinfo
-
trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibGuestCtrl.cpp
r76553 r76958 94 94 AssertPtrReturn(pcParameters, VERR_INVALID_POINTER); 95 95 96 HGCMMsg CmdWaitFor Msg;96 HGCMMsgWaitFor Msg; 97 97 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. */ 99 99 2); /* Just peek for the next message! */ 100 100 VbglHGCMParmUInt32Set(&Msg.msg, 0); … … 103 103 /* 104 104 * We should always get a VERR_TOO_MUCH_DATA response here, see 105 * guestControl::Host Command::Peek() and its caller ClientState::SendReply().105 * guestControl::HostMessage::Peek() and its caller ClientState::SendReply(). 106 106 * We accept success too here, in case someone decide to make the protocol 107 107 * slightly more sane. … … 166 166 /* 167 167 * Seems we get VINF_SUCCESS back from the host if we try unsupported 168 * guest control functions, so we need to supply some random message168 * guest control messages, so we need to supply some random message 169 169 * parameters and check that they change. 170 170 */ … … 301 301 { 302 302 VBGLIOCHGCMCALL Hdr; 303 VBGL_HGCM_HDR_INIT(&Hdr, idClient, GUEST_M AKE_ME_MASTER, 0);303 VBGL_HGCM_HDR_INIT(&Hdr, idClient, GUEST_MSG_MAKE_ME_MASTER, 0); 304 304 rc = VbglR3HGCMCall(&Hdr, sizeof(Hdr)); 305 305 } while (rc == VERR_INTERRUPTED); … … 403 403 404 404 /** 405 * Asks the host guest control service to set a commandfilter to this406 * 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. 407 407 * The filter(s) are a bitmask for the context IDs, served from the host. 408 408 * … … 415 415 VBGLR3DECL(int) VbglR3GuestCtrlMsgFilterSet(uint32_t idClient, uint32_t uValue, uint32_t uMaskAdd, uint32_t uMaskRemove) 416 416 { 417 HGCMMsg CmdFilterSet Msg;417 HGCMMsgFilterSet Msg; 418 418 419 419 /* Tell the host we want to set a filter. */ … … 443 443 /* Everything else is optional. */ 444 444 445 HGCMMsg CmdReply Msg;445 HGCMMsgReply Msg; 446 446 VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, GUEST_MSG_REPLY, 4); 447 447 VbglHGCMParmUInt32Set(&Msg.context, pCtx->uContextID); … … 491 491 VBGLR3DECL(int) VbglR3GuestCtrlMsgSkipOld(uint32_t idClient) 492 492 { 493 HGCMMsg CmdSkip 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. */ 496 496 VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient, GUEST_MSG_SKIP_OLD, 1); 497 497 VbglHGCMParmUInt32Set(&Msg.flags, 0 /* Flags, unused */); … … 530 530 HGCMFunctionParameter pKey; 531 531 } 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); 533 533 VbglHGCMParmUInt32Set(&Msg.idSession, idSession); 534 534 VbglHGCMParmPtrSet(&Msg.pKey, (void *)pvKey, cbKey); … … 555 555 HGCMFunctionParameter pKey; 556 556 } 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); 558 558 VbglHGCMParmUInt32Set(&Msg.idSession, idSession); 559 559 VbglHGCMParmPtrSet(&Msg.pKey, (void *)pvKey, cbKey); … … 579 579 HGCMFunctionParameter idSession; 580 580 } 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); 582 582 VbglHGCMParmUInt32Set(&Msg.idSession, idSession); 583 583 rc = VbglR3HGCMCall(&Msg.Hdr, sizeof(Msg)); … … 601 601 602 602 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); 604 604 VbglHGCMParmUInt32Set(&Msg.context, pCtx->uContextID); 605 605 VbglHGCMParmUInt32Set(&Msg.flags, fFlags); … … 614 614 615 615 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); 617 617 VbglHGCMParmUInt32Set(&Msg.context, pCtx->uContextID); 618 618 VbglHGCMParmUInt32Set(&Msg.type, uType); … … 647 647 HGCMMsgSessionOpen Msg; 648 648 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); 650 650 VbglHGCMParmUInt32Set(&Msg.protocol, 0); 651 651 VbglHGCMParmPtrSet(&Msg.username, pszUser, cbUser); … … 685 685 HGCMMsgSessionClose Msg; 686 686 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); 688 688 VbglHGCMParmUInt32Set(&Msg.flags, 0); 689 689 … … 724 724 HGCMMsgPathRename Msg; 725 725 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); 727 727 VbglHGCMParmPtrSet(&Msg.source, pszSource, cbSource); 728 728 VbglHGCMParmPtrSet(&Msg.dest, pszDest, cbDest); … … 754 754 HGCMMsgPathUserDocuments Msg; 755 755 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); 757 757 758 758 rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg)); … … 777 777 HGCMMsgPathUserHome Msg; 778 778 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); 780 780 781 781 rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg)); … … 819 819 HGCMMsgProcExec Msg; 820 820 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); 822 822 VbglHGCMParmPtrSet(&Msg.cmd, pszCmd, cbCmd); 823 823 VbglHGCMParmUInt32Set(&Msg.flags, 0); … … 894 894 HGCMMsgProcOutput Msg; 895 895 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); 897 897 VbglHGCMParmUInt32Set(&Msg.pid, 0); 898 898 VbglHGCMParmUInt32Set(&Msg.handle, 0); … … 936 936 HGCMMsgProcInput Msg; 937 937 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); 939 939 VbglHGCMParmUInt32Set(&Msg.pid, 0); 940 940 VbglHGCMParmUInt32Set(&Msg.flags, 0); … … 978 978 HGCMMsgDirRemove Msg; 979 979 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); 981 981 VbglHGCMParmPtrSet(&Msg.path, pszPath, cbPath); 982 982 VbglHGCMParmUInt32Set(&Msg.flags, 0); … … 1023 1023 HGCMMsgFileOpen Msg; 1024 1024 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); 1026 1026 VbglHGCMParmPtrSet(&Msg.filename, pszFileName, cbFileName); 1027 1027 VbglHGCMParmPtrSet(&Msg.openmode, pszAccess, cbAccess); … … 1058 1058 HGCMMsgFileClose Msg; 1059 1059 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); 1061 1061 VbglHGCMParmUInt32Set(&Msg.handle, 0); 1062 1062 … … 1088 1088 HGCMMsgFileRead Msg; 1089 1089 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); 1091 1091 VbglHGCMParmUInt32Set(&Msg.handle, 0); 1092 1092 VbglHGCMParmUInt32Set(&Msg.size, 0); … … 1121 1121 HGCMMsgFileReadAt Msg; 1122 1122 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); 1124 1124 VbglHGCMParmUInt32Set(&Msg.handle, 0); 1125 1125 VbglHGCMParmUInt32Set(&Msg.offset, 0); … … 1158 1158 HGCMMsgFileWrite Msg; 1159 1159 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); 1161 1161 VbglHGCMParmUInt32Set(&Msg.handle, 0); 1162 1162 VbglHGCMParmPtrSet(&Msg.data, pvData, cbData); … … 1198 1198 HGCMMsgFileWriteAt Msg; 1199 1199 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); 1201 1201 VbglHGCMParmUInt32Set(&Msg.handle, 0); 1202 1202 VbglHGCMParmPtrSet(&Msg.data, pvData, cbData); … … 1239 1239 HGCMMsgFileSeek Msg; 1240 1240 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); 1242 1242 VbglHGCMParmUInt32Set(&Msg.handle, 0); 1243 1243 VbglHGCMParmUInt32Set(&Msg.method, 0); … … 1272 1272 HGCMMsgFileTell Msg; 1273 1273 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); 1275 1275 VbglHGCMParmUInt32Set(&Msg.handle, 0); 1276 1276 … … 1301 1301 HGCMMsgProcTerminate Msg; 1302 1302 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); 1304 1304 VbglHGCMParmUInt32Set(&Msg.pid, 0); 1305 1305 … … 1331 1331 HGCMMsgProcWaitFor Msg; 1332 1332 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); 1334 1334 VbglHGCMParmUInt32Set(&Msg.pid, 0); 1335 1335 VbglHGCMParmUInt32Set(&Msg.flags, 0); … … 1355 1355 1356 1356 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); 1358 1358 VbglHGCMParmUInt32Set(&Msg.context, pCtx->uContextID); 1359 1359 VbglHGCMParmUInt32Set(&Msg.type, GUEST_FILE_NOTIFYTYPE_OPEN); … … 1371 1371 1372 1372 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); 1374 1374 VbglHGCMParmUInt32Set(&Msg.context, pCtx->uContextID); 1375 1375 VbglHGCMParmUInt32Set(&Msg.type, GUEST_FILE_NOTIFYTYPE_CLOSE); … … 1385 1385 1386 1386 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); 1388 1388 VbglHGCMParmUInt32Set(&Msg.context, pCtx->uContextID); 1389 1389 VbglHGCMParmUInt32Set(&Msg.type, GUEST_FILE_NOTIFYTYPE_ERROR); … … 1401 1401 1402 1402 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); 1404 1404 VbglHGCMParmUInt32Set(&Msg.context, pCtx->uContextID); 1405 1405 VbglHGCMParmUInt32Set(&Msg.type, GUEST_FILE_NOTIFYTYPE_READ); … … 1417 1417 1418 1418 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); 1420 1420 VbglHGCMParmUInt32Set(&Msg.context, pCtx->uContextID); 1421 1421 VbglHGCMParmUInt32Set(&Msg.type, GUEST_FILE_NOTIFYTYPE_WRITE); … … 1433 1433 1434 1434 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); 1436 1436 VbglHGCMParmUInt32Set(&Msg.context, pCtx->uContextID); 1437 1437 VbglHGCMParmUInt32Set(&Msg.type, GUEST_FILE_NOTIFYTYPE_SEEK); … … 1449 1449 1450 1450 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); 1452 1452 VbglHGCMParmUInt32Set(&Msg.context, pCtx->uContextID); 1453 1453 VbglHGCMParmUInt32Set(&Msg.type, GUEST_FILE_NOTIFYTYPE_TELL); … … 1472 1472 1473 1473 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); 1475 1475 VbglHGCMParmUInt32Set(&Msg.context, pCtx->uContextID); 1476 1476 VbglHGCMParmUInt32Set(&Msg.pid, uPID); … … 1496 1496 1497 1497 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); 1499 1499 VbglHGCMParmUInt32Set(&Msg.context, pCtx->uContextID); 1500 1500 VbglHGCMParmUInt32Set(&Msg.pid, uPID); … … 1520 1520 1521 1521 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); 1523 1523 VbglHGCMParmUInt32Set(&Msg.context, pCtx->uContextID); 1524 1524 VbglHGCMParmUInt32Set(&Msg.pid, uPID); -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControl.cpp
r76553 r76958 245 245 Assert(g_idControlSvcClient > 0); 246 246 247 /* Allocate a scratch buffer for commands which also send247 /* Allocate a scratch buffer for messages which also send 248 248 * payload data with them. */ 249 249 uint32_t cbScratchBuf = _64K; /** @todo Make buffer size configurable via guest properties/argv! */ … … 264 264 cRetrievalFailed = 0; /* Reset failed retrieval count. */ 265 265 VGSvcVerbose(4, "idMsg=%RU32 (%s) (%RU32 parms) retrieved\n", 266 idMsg, GstCtrlHost FnName((eHostFn)idMsg), ctxHost.uNumParms);266 idMsg, GstCtrlHostMsgtoStr((eHostMsg)idMsg), ctxHost.uNumParms); 267 267 268 268 /* … … 271 271 switch (idMsg) 272 272 { 273 case HOST_ CANCEL_PENDING_WAITS:273 case HOST_MSG_CANCEL_PENDING_WAITS: 274 274 VGSvcVerbose(1, "We were asked to quit ...\n"); 275 275 break; 276 276 277 case HOST_ SESSION_CREATE:277 case HOST_MSG_SESSION_CREATE: 278 278 rc = vgsvcGstCtrlHandleSessionOpen(&ctxHost); 279 279 break; 280 280 281 281 /* This message is also sent to the child session process (by the host). */ 282 case HOST_ SESSION_CLOSE:282 case HOST_MSG_SESSION_CLOSE: 283 283 rc = vgsvcGstCtrlHandleSessionClose(&ctxHost); 284 284 break; … … 289 289 rc = VbglR3GuestCtrlMsgSkip(g_idControlSvcClient, VERR_NOT_SUPPORTED, idMsg); 290 290 VGSvcVerbose(1, "Skipped unexpected message idMsg=%RU32 (%s), cParms=%RU32 (rc=%Rrc)\n", 291 idMsg, GstCtrlHost FnName((eHostFn)idMsg), ctxHost.uNumParms, rc);291 idMsg, GstCtrlHostMsgtoStr((eHostMsg)idMsg), ctxHost.uNumParms, rc); 292 292 } 293 293 else … … 300 300 301 301 /* Do we need to shutdown? */ 302 if (idMsg == HOST_ CANCEL_PENDING_WAITS)302 if (idMsg == HOST_MSG_CANCEL_PENDING_WAITS) 303 303 break; 304 304 … … 561 561 #endif 562 562 " --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" 564 564 , 565 565 /* methods */ -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlSession.cpp
r76553 r76958 939 939 *ppvScratchBuf, RT_MIN(cbInput, *pcbScratchBuf)); 940 940 if (RT_FAILURE(rc)) 941 VGSvcError("Error handling input commandfor PID=%RU32, rc=%Rrc\n", uPID, rc);941 VGSvcError("Error handling input message for PID=%RU32, rc=%Rrc\n", uPID, rc); 942 942 VGSvcGstCtrlProcessRelease(pProcess); 943 943 } … … 1129 1129 switch (uMsg) 1130 1130 { 1131 case HOST_ SESSION_CLOSE:1131 case HOST_MSG_SESSION_CLOSE: 1132 1132 /* Shutdown (this spawn). */ 1133 1133 rc = VGSvcGstCtrlSessionClose(pSession); … … 1135 1135 break; 1136 1136 1137 case HOST_ DIR_REMOVE:1137 case HOST_MSG_DIR_REMOVE: 1138 1138 if (fImpersonated) 1139 1139 rc = vgsvcGstCtrlSessionHandleDirRemove(pSession, pHostCtx); 1140 1140 break; 1141 1141 1142 case HOST_ EXEC_CMD:1142 case HOST_MSG_EXEC_CMD: 1143 1143 rc = vgsvcGstCtrlSessionHandleProcExec(pSession, pHostCtx); 1144 1144 break; 1145 1145 1146 case HOST_ EXEC_SET_INPUT:1146 case HOST_MSG_EXEC_SET_INPUT: 1147 1147 rc = vgsvcGstCtrlSessionHandleProcInput(pSession, pHostCtx, ppvScratchBuf, pcbScratchBuf); 1148 1148 break; 1149 1149 1150 case HOST_ EXEC_GET_OUTPUT:1150 case HOST_MSG_EXEC_GET_OUTPUT: 1151 1151 rc = vgsvcGstCtrlSessionHandleProcOutput(pSession, pHostCtx); 1152 1152 break; 1153 1153 1154 case HOST_ EXEC_TERMINATE:1154 case HOST_MSG_EXEC_TERMINATE: 1155 1155 rc = vgsvcGstCtrlSessionHandleProcTerminate(pSession, pHostCtx); 1156 1156 break; 1157 1157 1158 case HOST_ EXEC_WAIT_FOR:1158 case HOST_MSG_EXEC_WAIT_FOR: 1159 1159 rc = vgsvcGstCtrlSessionHandleProcWaitFor(pSession, pHostCtx); 1160 1160 break; 1161 1161 1162 case HOST_ FILE_OPEN:1162 case HOST_MSG_FILE_OPEN: 1163 1163 if (fImpersonated) 1164 1164 rc = vgsvcGstCtrlSessionHandleFileOpen(pSession, pHostCtx); 1165 1165 break; 1166 1166 1167 case HOST_ FILE_CLOSE:1167 case HOST_MSG_FILE_CLOSE: 1168 1168 if (fImpersonated) 1169 1169 rc = vgsvcGstCtrlSessionHandleFileClose(pSession, pHostCtx); 1170 1170 break; 1171 1171 1172 case HOST_ FILE_READ:1172 case HOST_MSG_FILE_READ: 1173 1173 if (fImpersonated) 1174 1174 rc = vgsvcGstCtrlSessionHandleFileRead(pSession, pHostCtx, ppvScratchBuf, pcbScratchBuf); 1175 1175 break; 1176 1176 1177 case HOST_ FILE_READ_AT:1177 case HOST_MSG_FILE_READ_AT: 1178 1178 if (fImpersonated) 1179 1179 rc = vgsvcGstCtrlSessionHandleFileReadAt(pSession, pHostCtx, ppvScratchBuf, pcbScratchBuf); 1180 1180 break; 1181 1181 1182 case HOST_ FILE_WRITE:1182 case HOST_MSG_FILE_WRITE: 1183 1183 if (fImpersonated) 1184 1184 rc = vgsvcGstCtrlSessionHandleFileWrite(pSession, pHostCtx, ppvScratchBuf, pcbScratchBuf); 1185 1185 break; 1186 1186 1187 case HOST_ FILE_WRITE_AT:1187 case HOST_MSG_FILE_WRITE_AT: 1188 1188 if (fImpersonated) 1189 1189 rc = vgsvcGstCtrlSessionHandleFileWriteAt(pSession, pHostCtx, ppvScratchBuf, pcbScratchBuf); 1190 1190 break; 1191 1191 1192 case HOST_ FILE_SEEK:1192 case HOST_MSG_FILE_SEEK: 1193 1193 if (fImpersonated) 1194 1194 rc = vgsvcGstCtrlSessionHandleFileSeek(pSession, pHostCtx); 1195 1195 break; 1196 1196 1197 case HOST_ FILE_TELL:1197 case HOST_MSG_FILE_TELL: 1198 1198 if (fImpersonated) 1199 1199 rc = vgsvcGstCtrlSessionHandleFileTell(pSession, pHostCtx); 1200 1200 break; 1201 1201 1202 case HOST_ PATH_RENAME:1202 case HOST_MSG_PATH_RENAME: 1203 1203 if (fImpersonated) 1204 1204 rc = vgsvcGstCtrlSessionHandlePathRename(pSession, pHostCtx); 1205 1205 break; 1206 1206 1207 case HOST_ PATH_USER_DOCUMENTS:1207 case HOST_MSG_PATH_USER_DOCUMENTS: 1208 1208 if (fImpersonated) 1209 1209 rc = vgsvcGstCtrlSessionHandlePathUserDocuments(pSession, pHostCtx); 1210 1210 break; 1211 1211 1212 case HOST_ PATH_USER_HOME:1212 case HOST_MSG_PATH_USER_HOME: 1213 1213 if (fImpersonated) 1214 1214 rc = vgsvcGstCtrlSessionHandlePathUserHome(pSession, pHostCtx); … … 1529 1529 { 1530 1530 /* 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. 1532 1532 * This buffer may grow if the host sends us larger chunks of data. 1533 1533 */ -
trunk/src/VBox/HostServices/GuestControl/service.cpp
r76956 r76958 18 18 /** @page pg_svc_guest_control Guest Control HGCM Service 19 19 * 20 * This service acts as a proxy for handling and buffering host commandrequests20 * This service acts as a proxy for handling and buffering host message requests 21 21 * and clients on the guest. It tries to be as transparent as possible to let 22 22 * the guest (client) and host side do their protocol handling as desired. … … 26 26 * which wants to control something on the guest. 27 27 * - Client: A client (e.g. VBoxService) running inside the guest OS waiting for 28 * new host commands to perform. There can be multiple clients connected28 * new host messages to perform. There can be multiple clients connected 29 29 * to this service. A client is represented by its unique HGCM client ID. 30 30 * - Context ID: An (almost) unique ID automatically generated on the host (Main API) … … 33 33 * an indicator which it can refer to later. This context ID gets 34 34 * internally bound by the service to a client which actually processes 35 * the commandin 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 HGCM35 * 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 38 38 * 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 commandthen will be immediately40 * removed from the command list. If there are ready clients but no new commands to be39 * 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 41 41 * processed, these clients will be set into a deferred state (that is being blocked 42 * to return until a new commandis available).42 * to return until a new host message is available). 43 43 * 44 44 * If a client needs to inform the host that something happened, it can send a … … 104 104 105 105 /** 106 * Structure for holding a buffered host commandwhich has106 * Structure for holding a buffered host message which has 107 107 * not been processed yet. 108 108 * 109 109 * @todo r=bird: It would be nice if we could decide on _one_ term for what the 110 110 * 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 */ 113 typedef struct HostMsg 114 { 115 /** Entry on the ClientState::m_HostMsgList list. */ 121 116 RTLISTNODE m_ListEntry; 122 117 union … … 125 120 * See VBOX_GUESTCTRL_DST_XXX. */ 126 121 uint64_t m_idContextAndDst; 127 /** The context ID this commandbelongs to (extracted from the first parameter). */122 /** The context ID this message belongs to (extracted from the first parameter). */ 128 123 uint32_t m_idContext; 129 124 }; 130 125 /** Dynamic structure for holding the HGCM parms */ 131 uint32_t m MsgType;126 uint32_t mType; 132 127 /** Number of HGCM parameters. */ 133 128 uint32_t mParmCount; … … 137 132 bool m_f60BetaHackInPlay; 138 133 139 Host Command()134 HostMsg() 140 135 : m_idContextAndDst(0) 141 , m MsgType(UINT32_MAX)136 , mType(UINT32_MAX) 142 137 , mParmCount(0) 143 138 , mpParms(NULL) … … 148 143 149 144 /** 150 * Releases the host command, properly deleting it if no further references.145 * Releases the host message, properly deleting it if no further references. 151 146 */ 152 147 void Delete(void) 153 148 { 154 LogFlowThisFunc(("[ Cmd %RU32 (%s)] destroying\n", mMsgType, GstCtrlHostFnName((eHostFn)mMsgType)));149 LogFlowThisFunc(("[Msg %RU32 (%s)] destroying\n", mType, GstCtrlHostMsgtoStr((eHostMsg)mType))); 155 150 Assert(m_ListEntry.pNext == NULL); 156 151 if (mpParms) … … 171 166 172 167 /** 173 * Initializes the command.168 * Initializes the message. 174 169 * 175 170 * The specified parameters are copied and any buffers referenced by it … … 177 172 * 178 173 * @returns VBox status code. 179 * @param id Function The host function (message) number, eHostFn.174 * @param idMsg The host message number, eHostMsg. 180 175 * @param cParms Number of parameters in the HGCM request. 181 176 * @param paParms Array of parameters. 182 177 */ 183 int Init(uint32_t id Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[])184 { 185 LogFlowThisFunc(("[ Cmd%RU32 (%s)] Allocating cParms=%RU32, paParms=%p\n",186 id Function, 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)); 187 182 Assert(mpParms == NULL); 188 183 Assert(mParmCount == 0); … … 197 192 198 193 /* 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. 200 195 */ 201 196 if (paParms[0].type == VBOX_HGCM_SVC_PARM_64BIT) … … 206 201 else if (paParms[0].type == VBOX_HGCM_SVC_PARM_32BIT) 207 202 { 208 AssertMsgFailed(("id Function=%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))); 209 204 m_idContextAndDst = paParms[0].u.uint32 | VBOX_GUESTCTRL_DST_BOTH; 210 205 } … … 215 210 * Just make a copy of the parameters and any buffers. 216 211 */ 217 m MsgType = idFunction;212 mType = idMsg; 218 213 mParmCount = cParms; 219 214 mpParms = (VBOXHGCMSVCPARM *)RTMemAllocZ(sizeof(VBOXHGCMSVCPARM) * mParmCount); … … 244 239 245 240 default: 246 AssertMsgFailedReturn(("id Function=%u (%s) parameter #%u: type=%u\n",247 id Function, 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), 248 243 VERR_WRONG_PARAMETER_TYPE); 249 244 } … … 271 266 Assert(cDstParms >= 2); 272 267 if (paDstParms[0].type == VBOX_HGCM_SVC_PARM_32BIT) 273 paDstParms[0].u.uint32 = m MsgType;268 paDstParms[0].u.uint32 = mType; 274 269 else 275 paDstParms[0].u.uint64 = m MsgType;270 paDstParms[0].u.uint64 = mType; 276 271 paDstParms[1].u.uint32 = mParmCount; 277 272 … … 301 296 int CopyTo(VBOXHGCMSVCPARM paDstParms[], uint32_t cDstParms) const 302 297 { 303 LogFlowThisFunc(("[ Cmd%RU32] mParmCount=%RU32, m_idContext=%RU32 (Session %RU32)\n",304 m MsgType, 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))); 305 300 306 301 int rc = VINF_SUCCESS; … … 386 381 int rc; 387 382 388 LogFlowThisFunc(("[ Cmd %RU32] mParmCount=%RU32, mpParms=%p\n", mMsgType, mParmCount, mpParms));389 390 /* Does the current host commandneed more parameter space which383 LogFlowThisFunc(("[Msg %RU32] mParmCount=%RU32, mpParms=%p\n", mType, mParmCount, mpParms)); 384 385 /* Does the current host message need more parameter space which 391 386 * the client does not provide yet? */ 392 387 if (mParmCount > pReq->mNumParms) 393 388 { 394 LogFlowThisFunc(("[ Cmd%RU32] Requires %RU32 parms, only got %RU32 from client\n",395 m MsgType, mParmCount, pReq->mNumParms));389 LogFlowThisFunc(("[Msg %RU32] Requires %RU32 parms, only got %RU32 from client\n", 390 mType, mParmCount, pReq->mNumParms)); 396 391 /* 397 392 * So this call apparently failed because the guest wanted to peek 398 393 * 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! 400 395 */ 401 396 rc = VERR_TOO_MUCH_DATA; … … 424 419 AssertPtrReturn(pReq, VERR_INVALID_POINTER); 425 420 426 LogFlowThisFunc(("[ Cmd %RU32] mParmCount=%RU32, mpParms=%p\n", mMsgType, mParmCount, mpParms));421 LogFlowThisFunc(("[Msg %RU32] mParmCount=%RU32, mpParms=%p\n", mType, mParmCount, mpParms)); 427 422 428 423 if (pReq->mNumParms >= 2) 429 424 { 430 HGCMSvcSetU32(&pReq->mParms[0], m MsgType); /* Message ID */425 HGCMSvcSetU32(&pReq->mParms[0], mType); /* Message ID */ 431 426 HGCMSvcSetU32(&pReq->mParms[1], mParmCount); /* Required parameters for message */ 432 427 } … … 438 433 * Always return VERR_TOO_MUCH_DATA data here to 439 434 * keep it compatible with older clients and to 440 * have correct accounting (mHostRc + mHost CmdTries).435 * have correct accounting (mHostRc + mHostMsgTries). 441 436 */ 442 437 return VERR_TOO_MUCH_DATA; … … 444 439 445 440 /** @} */ 446 } Host Command;441 } HostMsg; 447 442 448 443 /** 449 444 * Per-client structure used for book keeping/state tracking a 450 * certain host command.445 * certain host message. 451 446 */ 452 447 typedef struct ClientContext 453 448 { 454 /* Pointer to list node of this command. */455 Host Command *mpHostCmd;449 /* Pointer to list node of this message. */ 450 HostMsg *mpHostMsg; 456 451 /** The standard constructor. */ 457 ClientContext(void) : mpHost Cmd(NULL) {}452 ClientContext(void) : mpHostMsg(NULL) {} 458 453 /** Internal constrcutor. */ 459 ClientContext(Host Command *pHostCmd) : mpHostCmd(pHostCmd) {}454 ClientContext(HostMsg *pHostMsg) : mpHostMsg(pHostMsg) {} 460 455 } ClientContext; 461 456 typedef std::map< uint32_t, ClientContext > ClientContextMap; … … 467 462 { 468 463 PVBOXHGCMSVCHELPERS m_pSvcHelpers; 469 /** Host command list to process (HostCommand). */470 RTLISTANCHOR m_Host CmdList;464 /** Host message list to process (HostMsg). */ 465 RTLISTANCHOR m_HostMsgList; 471 466 /** The HGCM client ID. */ 472 467 uint32_t m_idClient; … … 482 477 /** Pending client call (GUEST_MSG_PEEK_WAIT or GUEST_MSG_WAIT), zero if none pending. 483 478 * 484 * This means the client waits for a new host commandto reply and won't return485 * from the waiting call until a new host commandis available. */486 guestControl::eGuest Fn 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; 487 482 /** Pending peek/wait request details. */ 488 483 ClientRequest m_PendingReq; … … 496 491 , m_fRestored(false) 497 492 , m_fPendingCancel(false) 498 , m_enm IsPending((guestControl::eGuestFn)0)499 , mHost CmdRc(VINF_SUCCESS)500 , mHost CmdTries(0)493 , m_enmPendingMsg((guestControl::eGuestMsg)0) 494 , mHostMsgRc(VINF_SUCCESS) 495 , mHostMsgTries(0) 501 496 , mPeekCount(0) 502 497 { 503 RTListInit(&m_Host CmdList);498 RTListInit(&m_HostMsgList); 504 499 } 505 500 … … 511 506 , m_fRestored(false) 512 507 , m_fPendingCancel(false) 513 , m_enm IsPending((guestControl::eGuestFn)0)514 , mHost CmdRc(VINF_SUCCESS)515 , mHost CmdTries(0)508 , m_enmPendingMsg((guestControl::eGuestMsg)0) 509 , mHostMsgRc(VINF_SUCCESS) 510 , mHostMsgTries(0) 516 511 , mPeekCount(0) 517 512 { 518 RTListInit(&m_Host CmdList);513 RTListInit(&m_HostMsgList); 519 514 } 520 515 521 516 /** 522 * Used by for Service::hostProcess Command().523 */ 524 void Enqueue Command(HostCommand *pHostCmd)525 { 526 AssertPtr(pHost Cmd);527 RTListAppend(&m_Host CmdList, &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); 528 523 } 529 524 530 525 /** 531 * Used by for Service::hostProcess Command().526 * Used by for Service::hostProcessMessage(). 532 527 * 533 528 * @note This wakes up both GUEST_MSG_WAIT and GUEST_MSG_PEEK_WAIT sleepers. … … 537 532 int rc = VINF_NO_CHANGE; 538 533 539 if (m_enm IsPending != 0)534 if (m_enmPendingMsg != 0) 540 535 { 541 536 LogFlowFunc(("[Client %RU32] Waking up ...\n", m_idClient)); … … 543 538 rc = VINF_SUCCESS; 544 539 545 Host Command *pFirstCmd = RTListGetFirstCpp(&m_HostCmdList, HostCommand, m_ListEntry);546 if (pFirst Cmd)540 HostMsg *pFirstMsg = RTListGetFirstCpp(&m_HostMsgList, HostMsg, m_ListEntry); 541 if (pFirstMsg) 547 542 { 548 LogFlowThisFunc(("[Client %RU32] Current host commandis %RU32 (CID=%#RX32, cParms=%RU32)\n",549 m_idClient, pFirst Cmd->mMsgType, pFirstCmd->m_idContext, pFirstCmd->mParmCount));550 551 if (m_enm IsPending == 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) 552 547 { 553 pFirst Cmd->setPeekReturn(m_PendingReq.mParms, m_PendingReq.mNumParms);548 pFirstMsg->setPeekReturn(m_PendingReq.mParms, m_PendingReq.mNumParms); 554 549 rc = m_pSvcHelpers->pfnCallComplete(m_PendingReq.mHandle, VINF_SUCCESS); 555 550 … … 557 552 m_PendingReq.mParms = NULL; 558 553 m_PendingReq.mNumParms = 0; 559 m_enm IsPending = (guestControl::eGuestFn)0;554 m_enmPendingMsg = (guestControl::eGuestMsg)0; 560 555 } 561 else if (m_enm IsPending == GUEST_MSG_WAIT)562 rc = OldRun(&m_PendingReq, pFirst Cmd);556 else if (m_enmPendingMsg == GUEST_MSG_WAIT) 557 rc = OldRun(&m_PendingReq, pFirstMsg); 563 558 else 564 AssertMsgFailed(("m_enmIsPending=%d\n", m_enm IsPending));559 AssertMsgFailed(("m_enmIsPending=%d\n", m_enmPendingMsg)); 565 560 } 566 561 else 567 AssertMsgFailed(("Waking up client ID=%RU32 with no host commandin 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)); 568 563 569 564 return rc; … … 581 576 { 582 577 LogFlowFunc(("[Client %RU32] Cancelling waiting thread, isPending=%d, pendingNumParms=%RU32, m_idSession=%x\n", 583 m_idClient, m_enm IsPending, m_PendingReq.mNumParms, m_idSession));578 m_idClient, m_enmPendingMsg, m_PendingReq.mNumParms, m_idSession)); 584 579 585 580 /* … … 587 582 */ 588 583 int rcComplete; 589 if (m_enm IsPending == 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); 592 587 rcComplete = VINF_TRY_AGAIN; 593 588 } … … 597 592 * aren't two parameters, fail the call. 598 593 */ 599 else if (m_enm IsPending != 0)600 { 601 Assert(m_enm IsPending == GUEST_MSG_WAIT);594 else if (m_enmPendingMsg != 0) 595 { 596 Assert(m_enmPendingMsg == GUEST_MSG_WAIT); 602 597 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); 604 599 if (m_PendingReq.mNumParms > 1) 605 600 HGCMSvcSetU32(&m_PendingReq.mParms[1], 0); … … 620 615 m_PendingReq.mParms = NULL; 621 616 m_PendingReq.mNumParms = 0; 622 m_enm IsPending = (guestControl::eGuestFn)0;617 m_enmPendingMsg = (guestControl::eGuestMsg)0; 623 618 m_fPendingCancel = false; 624 619 return VINF_SUCCESS; … … 633 628 */ 634 629 635 /** Last (most recent) rc after handling the host command. */636 int mHost CmdRc;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. 638 633 * 639 634 * This is used as a heuristic to remove a message that the client appears not 640 635 * to be able to successfully retrieve. */ 641 uint32_t mHost CmdTries;636 uint32_t mHostMsgTries; 642 637 /** Number of times we've peeked at a pending message. 643 638 * 644 639 * 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 fit640 * there are messages which only have two (2) parameters and therefore would fit 646 641 * into the GUEST_MSG_WAIT reply immediately, we now can make sure that the 647 642 * client first gets back the GUEST_MSG_WAIT results first. … … 650 645 651 646 /** 652 * Ditches the first host commandand crazy GUEST_MSG_WAIT state.647 * Ditches the first host message and crazy GUEST_MSG_WAIT state. 653 648 * 654 649 * @note Only used by GUEST_MSG_WAIT scenarios. 655 650 */ 656 void OldDitchFirstHost Cmd()657 { 658 Host Command *pFirstCmd = RTListGetFirstCpp(&m_HostCmdList, HostCommand, m_ListEntry);659 Assert(pFirst Cmd);660 RTListNodeRemove(&pFirst Cmd->m_ListEntry);661 pFirst Cmd->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(); 662 657 663 658 /* Reset state else. */ 664 mHost CmdRc = VINF_SUCCESS;665 mHost CmdTries = 0;659 mHostMsgRc = VINF_SUCCESS; 660 mHostMsgTries = 0; 666 661 mPeekCount = 0; 667 662 } … … 672 667 * @note Only used by GUEST_MSG_WAIT scenarios. 673 668 */ 674 int OldRun(ClientRequest const *pReq, Host Command *pHostCmd)669 int OldRun(ClientRequest const *pReq, HostMsg *pHostMsg) 675 670 { 676 671 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)); 686 682 687 683 bool fRemove = false; 688 684 if (RT_FAILURE(rc)) 689 685 { 690 mHost CmdTries++;686 mHostMsgTries++; 691 687 692 688 /* … … 695 691 * 696 692 * Note: Due to legacy reasons this the retry counter has to be even because on 697 * every peek there will be the actual commandretrieval from the client side.698 * To not get the actual commandif the client actually only wants to peek for699 * 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. 700 696 */ 701 697 /** @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). Then698 * (and every time) returning the next upcoming host message (if any, blocking). Then 703 699 * it's up to the client what to do next, either peeking again or getting the actual 704 * host commandvia an own GUEST_ type message.700 * host message via an own GUEST_ type message. 705 701 */ 706 702 if ( rc == VERR_TOO_MUCH_DATA 707 703 || rc == VERR_CANCELLED) 708 704 { 709 if (mHost CmdTries == 6)705 if (mHostMsgTries == 6) 710 706 fRemove = true; 711 707 } 712 708 /* Client did not understand the message or something else weird happened. Try again one 713 709 * more time and drop it if it didn't get handled then. */ 714 else if (mHost CmdTries > 1)710 else if (mHostMsgTries > 1) 715 711 fRemove = true; 716 712 } … … 718 714 fRemove = true; /* Everything went fine, remove it. */ 719 715 720 LogFlowThisFunc(("[Client %RU32] Tried command%RU32 for %RU32 times, (last result=%Rrc, fRemove=%RTbool)\n",721 m_idClient, pHost Cmd->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)); 722 718 723 719 if (fRemove) 724 720 { 725 Assert(RTListNodeIsFirst(&m_Host CmdList, &pHostCmd->m_ListEntry));726 OldDitchFirstHost Cmd();721 Assert(RTListNodeIsFirst(&m_HostMsgList, &pHostMsg->m_ListEntry)); 722 OldDitchFirstHostMsg(); 727 723 } 728 724 … … 739 735 740 736 /* 741 * If the host commandlist 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. 742 738 */ 743 Host Command *pFirstCmd = RTListGetFirstCpp(&m_HostCmdList, HostCommand, m_ListEntry);744 if (!pFirst Cmd)739 HostMsg *pFirstMsg = RTListGetFirstCpp(&m_HostMsgList, HostMsg, m_ListEntry); 740 if (!pFirstMsg) 745 741 { 746 742 if (!m_fPendingCancel) 747 743 { 748 744 /* Go to sleep. */ 749 ASSERT_GUEST_RETURN(m_enm IsPending == 0, VERR_WRONG_ORDER);745 ASSERT_GUEST_RETURN(m_enmPendingMsg == 0, VERR_WRONG_ORDER); 750 746 m_PendingReq = *pReq; 751 m_enm IsPending = GUEST_MSG_WAIT;747 m_enmPendingMsg = GUEST_MSG_WAIT; 752 748 LogFlowFunc(("[Client %RU32] Is now in pending mode\n", m_idClient)); 753 749 return VINF_HGCM_ASYNC_EXECUTE; … … 757 753 m_fPendingCancel = false; 758 754 if (pReq->mNumParms > 0) 759 HGCMSvcSetU32(&pReq->mParms[0], HOST_ CANCEL_PENDING_WAITS);755 HGCMSvcSetU32(&pReq->mParms[0], HOST_MSG_CANCEL_PENDING_WAITS); 760 756 if (pReq->mNumParms > 1) 761 757 HGCMSvcSetU32(&pReq->mParms[1], 0); … … 764 760 765 761 /* 766 * Return first host command.762 * Return first host message. 767 763 */ 768 return OldRun(pReq, pFirst Cmd);764 return OldRun(pReq, pFirstMsg); 769 765 } 770 766 … … 774 770 */ 775 771 int OldSendReply(ClientRequest const *pReq, 776 Host Command *pHostCmd)772 HostMsg *pHostMsg) 777 773 { 778 774 AssertPtrReturn(pReq, VERR_INVALID_POINTER); 779 AssertPtrReturn(pHost Cmd, VERR_INVALID_POINTER);775 AssertPtrReturn(pHostMsg, VERR_INVALID_POINTER); 780 776 781 777 /* In case of VERR_CANCELLED. */ … … 785 781 /* If the client is in pending mode, always send back 786 782 * the peek result first. */ 787 if (m_enm IsPending)788 { 789 Assert(m_enm IsPending == GUEST_MSG_WAIT);790 rc = pHost Cmd->Peek(pReq);783 if (m_enmPendingMsg) 784 { 785 Assert(m_enmPendingMsg == GUEST_MSG_WAIT); 786 rc = pHostMsg->Peek(pReq); 791 787 mPeekCount++; 792 788 } … … 794 790 { 795 791 /* 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 commandwould fit into the current792 * instead of the actual message, even if this message would fit into the current 797 793 * connection buffer. */ 798 794 if (!mPeekCount) 799 795 { 800 rc = pHost Cmd->Peek(pReq);796 rc = pHostMsg->Peek(pReq); 801 797 mPeekCount++; 802 798 } 803 799 else 804 800 { 805 /* Try assigning the host commandto the client and store the801 /* Try assigning the host message to the client and store the 806 802 * result code for later use. */ 807 rc = pHost Cmd->Assign(pReq);803 rc = pHostMsg->Assign(pReq); 808 804 if (RT_FAILURE(rc)) /* If something failed, let the client peek (again). */ 809 805 { 810 rc = pHost Cmd->Peek(pReq);806 rc = pHostMsg->Peek(pReq); 811 807 mPeekCount++; 812 808 } … … 817 813 818 814 /* Reset pending status. */ 819 m_enm IsPending = (guestControl::eGuestFn)0;815 m_enmPendingMsg = (guestControl::eGuestMsg)0; 820 816 821 817 /* In any case the client did something, so complete … … 831 827 } 832 828 833 LogFlowThisFunc(("[Client %RU32] Command%RU32 ended with %Rrc (mPeekCount=%RU32, pReq=%p)\n",834 m_idClient, pHost Cmd->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)); 835 831 return rc; 836 832 } … … 867 863 typedef GstCtrlService SELF; 868 864 /** HGCM helper functions. */ 869 PVBOXHGCMSVCHELPERS mpHelpers;865 PVBOXHGCMSVCHELPERS mpHelpers; 870 866 /** Callback function supplied by the host for notification of updates to properties. */ 871 PFNHGCMSVCEXT mpfnHostCallback;867 PFNHGCMSVCEXT mpfnHostCallback; 872 868 /** User data pointer to be supplied to the host callback function. */ 873 void *mpvHostData;869 void *mpvHostData; 874 870 /** Map containing all connected clients, key is HGCM client ID. */ 875 ClientStateMap m_ClientStateMap;871 ClientStateMap m_ClientStateMap; 876 872 /** Session ID -> client state. */ 877 ClientStateMap m_SessionIdMap;873 ClientStateMap m_SessionIdMap; 878 874 /** The current master client, NULL if none. */ 879 ClientState *m_pMasterClient;875 ClientState *m_pMasterClient; 880 876 /** The master HGCM client ID, UINT32_MAX if none. */ 881 uint32_t m_idMasterClient;877 uint32_t m_idMasterClient; 882 878 /** Set if we're in legacy mode (pre 6.0). */ 883 bool m_fLegacyMode;879 bool m_fLegacyMode; 884 880 /** Number of prepared sessions. */ 885 uint32_t m_cPreparedSessions;881 uint32_t m_cPreparedSessions; 886 882 /** List of prepared session (GstCtrlPreparedSession). */ 887 RTLISTANCHOR m_PreparedSessions;883 RTLISTANCHOR m_PreparedSessions; 888 884 889 885 public: … … 921 917 int clientSessionAccept(ClientState *pClient, VBOXHGCMCALLHANDLE hCall, uint32_t cParms, VBOXHGCMSVCPARM paParms[]); 922 918 int clientSessionCloseOther(ClientState *pClient, uint32_t cParms, VBOXHGCMSVCPARM paParms[]); 923 int clientToMain(ClientState *pClient, uint32_t id Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[]);919 int clientToMain(ClientState *pClient, uint32_t idMsg, uint32_t cParms, VBOXHGCMSVCPARM paParms[]); 924 920 925 921 int clientMsgOldGet(ClientState *pClient, VBOXHGCMCALLHANDLE hCall, uint32_t cParms, VBOXHGCMSVCPARM paParms[]); … … 927 923 int clientMsgOldSkip(ClientState *pClient, VBOXHGCMCALLHANDLE hCall, uint32_t cParms); 928 924 929 int hostCallback(uint32_t id Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[]);930 int hostProcess Command(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[]); 931 927 932 928 DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP(GstCtrlService); … … 1025 1021 1026 1022 /* 1027 * Cancel all pending host commands, replying with GUEST_DISCONNECTED if final recipient.1028 */ 1029 Host Command *pCurCmd, *pNextCmd;1030 RTListForEachSafeCpp(&pClient->m_Host CmdList, pCurCmd, pNextCmd, HostCommand, m_ListEntry)1031 { 1032 RTListNodeRemove(&pCur Cmd->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); 1033 1029 1034 1030 VBOXHGCMSVCPARM Parm; 1035 HGCMSvcSetU32(&Parm, pCur Cmd->m_idContext);1036 int rc2 = pThis->hostCallback(GUEST_ DISCONNECTED, 1, &Parm);1037 LogFlowFunc(("Cancelled host command%u (%s) with idContext=%#x -> %Rrc\n",1038 pCur Cmd->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)); 1039 1035 RT_NOREF(rc2); 1040 1036 1041 pCur Cmd->Delete();1037 pCurMsg->Delete(); 1042 1038 } 1043 1039 … … 1079 1075 * A client asks for the next message to process. 1080 1076 * 1081 * This either fills in a pending host commandinto the client's parameter space1077 * This either fills in a pending host message into the client's parameter space 1082 1078 * or defers the guest call until we have something from the host. 1083 1079 * … … 1206 1202 1207 1203 /* 1208 * Return information about the first commandif one is pending in the list.1209 */ 1210 Host Command *pFirstCmd = RTListGetFirstCpp(&pClient->m_HostCmdList, HostCommand, m_ListEntry);1211 if (pFirst Cmd)1212 { 1213 pFirst Cmd->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); 1214 1210 LogFlowFunc(("[Client %RU32] GUEST_MSG_PEEK_XXXX -> VINF_SUCCESS (idMsg=%u (%s), cParms=%u)\n", 1215 pClient->m_idClient, pFirst Cmd->mMsgType, GstCtrlHostFnName((eHostFn)pFirstCmd->mMsgType), pFirstCmd->mParmCount));1211 pClient->m_idClient, pFirstMsg->mType, GstCtrlHostMsgtoStr((eHostMsg)pFirstMsg->mType), pFirstMsg->mParmCount)); 1216 1212 return VINF_SUCCESS; 1217 1213 } … … 1229 1225 * Wait for the host to queue a message for this client. 1230 1226 */ 1231 ASSERT_GUEST_MSG_RETURN(pClient->m_enm IsPending == 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), 1232 1228 VERR_RESOURCE_BUSY); 1233 1229 pClient->m_PendingReq.mHandle = hCall; 1234 1230 pClient->m_PendingReq.mNumParms = cParms; 1235 1231 pClient->m_PendingReq.mParms = paParms; 1236 pClient->m_enm IsPending = GUEST_MSG_PEEK_WAIT;1232 pClient->m_enmPendingMsg = GUEST_MSG_PEEK_WAIT; 1237 1233 LogFlowFunc(("[Client %RU32] Is now in pending mode...\n", pClient->m_idClient)); 1238 1234 return VINF_HGCM_ASYNC_EXECUTE; … … 1270 1266 1271 1267 /* 1272 * Return information about the first commandif one is pending in the list.1273 */ 1274 Host Command *pFirstCmd = RTListGetFirstCpp(&pClient->m_HostCmdList, HostCommand, m_ListEntry);1275 if (pFirst Cmd)1276 { 1277 1278 ASSERT_GUEST_MSG_RETURN(pFirst Cmd->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, 1279 1275 ("idMsg=%u (%s) cParms=%u, caller expected %u (%s) and %u\n", 1280 pFirst Cmd->mMsgType, GstCtrlHostFnName((eHostFn)pFirstCmd->mMsgType), pFirstCmd->mParmCount,1281 idMsgExpected, GstCtrlHost FnName((eHostFn)idMsgExpected), cParms),1276 pFirstMsg->mType, GstCtrlHostMsgtoStr((eHostMsg)pFirstMsg->mType), pFirstMsg->mParmCount, 1277 idMsgExpected, GstCtrlHostMsgtoStr((eHostMsg)idMsgExpected), cParms), 1282 1278 VERR_MISMATCH); 1283 ASSERT_GUEST_MSG_RETURN(pFirst Cmd->mParmCount == cParms,1279 ASSERT_GUEST_MSG_RETURN(pFirstMsg->mParmCount == cParms, 1284 1280 ("idMsg=%u (%s) cParms=%u, caller expected %u (%s) and %u\n", 1285 pFirst Cmd->mMsgType, GstCtrlHostFnName((eHostFn)pFirstCmd->mMsgType), pFirstCmd->mParmCount,1286 idMsgExpected, GstCtrlHost FnName((eHostFn)idMsgExpected), cParms),1281 pFirstMsg->mType, GstCtrlHostMsgtoStr((eHostMsg)pFirstMsg->mType), pFirstMsg->mParmCount, 1282 idMsgExpected, GstCtrlHostMsgtoStr((eHostMsg)idMsgExpected), cParms), 1287 1283 VERR_WRONG_PARAMETER_COUNT); 1288 1284 1289 1285 /* Check the parameter types. */ 1290 1286 for (uint32_t i = 0; i < cParms; i++) 1291 ASSERT_GUEST_MSG_RETURN(pFirst Cmd->mpParms[i].type == paParms[i].type,1292 ("param #%u: type %u, caller expected %u (idMsg=%u %s)\n", i, pFirst Cmd->mpParms[i].type,1293 paParms[i].type, pFirst Cmd->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)), 1294 1290 VERR_WRONG_PARAMETER_TYPE); 1295 1291 … … 1302 1298 int rc = VINF_SUCCESS; 1303 1299 for (uint32_t i = 0; i < cParms; i++) 1304 switch (pFirst Cmd->mpParms[i].type)1300 switch (pFirstMsg->mpParms[i].type) 1305 1301 { 1306 1302 case VBOX_HGCM_SVC_PARM_32BIT: 1307 paParms[i].u.uint32 = pFirst Cmd->mpParms[i].u.uint32;1303 paParms[i].u.uint32 = pFirstMsg->mpParms[i].u.uint32; 1308 1304 break; 1309 1305 1310 1306 case VBOX_HGCM_SVC_PARM_64BIT: 1311 paParms[i].u.uint64 = pFirst Cmd->mpParms[i].u.uint64;1307 paParms[i].u.uint64 = pFirstMsg->mpParms[i].u.uint64; 1312 1308 break; 1313 1309 1314 1310 case VBOX_HGCM_SVC_PARM_PTR: 1315 1311 { 1316 uint32_t const cbSrc = pFirst Cmd->mpParms[i].u.pointer.size;1312 uint32_t const cbSrc = pFirstMsg->mpParms[i].u.pointer.size; 1317 1313 uint32_t const cbDst = paParms[i].u.pointer.size; 1318 1314 paParms[i].u.pointer.size = cbSrc; /** @todo Check if this is safe in other layers... 1319 1315 * Update: Safe, yes, but VMMDevHGCM doesn't pass it along. */ 1320 1316 if (cbSrc <= cbDst) 1321 memcpy(paParms[i].u.pointer.addr, pFirst Cmd->mpParms[i].u.pointer.addr, cbSrc);1317 memcpy(paParms[i].u.pointer.addr, pFirstMsg->mpParms[i].u.pointer.addr, cbSrc); 1322 1318 else 1323 1319 rc = VERR_BUFFER_OVERFLOW; … … 1326 1322 1327 1323 default: 1328 AssertMsgFailed(("#%u: %u\n", i, pFirst Cmd->mpParms[i].type));1324 AssertMsgFailed(("#%u: %u\n", i, pFirstMsg->mpParms[i].type)); 1329 1325 rc = VERR_INTERNAL_ERROR; 1330 1326 break; … … 1333 1329 { 1334 1330 /* 1335 * Complete the commandand remove the pending message unless the1331 * Complete the message and remove the pending message unless the 1336 1332 * guest raced us and cancelled this call in the meantime. 1337 1333 */ … … 1340 1336 if (rc != VERR_CANCELLED) 1341 1337 { 1342 RTListNodeRemove(&pFirst Cmd->m_ListEntry);1343 pFirst Cmd->Delete();1338 RTListNodeRemove(&pFirstMsg->m_ListEntry); 1339 pFirstMsg->Delete(); 1344 1340 } 1345 1341 else … … 1377 1373 * Execute. 1378 1374 */ 1379 if (pClient->m_enm IsPending != 0)1375 if (pClient->m_enmPendingMsg != 0) 1380 1376 { 1381 1377 pClient->CancelWaiting(); … … 1422 1418 * Do the job. 1423 1419 */ 1424 Host Command *pFirstCmd = RTListGetFirstCpp(&pClient->m_HostCmdList, HostCommand, m_ListEntry);1425 if (pFirst Cmd)1426 { 1427 if ( pFirst Cmd->mMsgType == idMsg1420 HostMsg *pFirstMsg = RTListGetFirstCpp(&pClient->m_HostMsgList, HostMsg, m_ListEntry); 1421 if (pFirstMsg) 1422 { 1423 if ( pFirstMsg->mType == idMsg 1428 1424 || idMsg == UINT32_MAX) 1429 1425 { … … 1432 1428 { 1433 1429 /* 1434 * Remove the commandfrom the queue.1430 * Remove the message from the queue. 1435 1431 */ 1436 Assert(RTListNodeIsFirst(&pClient->m_Host CmdList, &pFirstCmd->m_ListEntry) );1437 RTListNodeRemove(&pFirst Cmd->m_ListEntry);1432 Assert(RTListNodeIsFirst(&pClient->m_HostMsgList, &pFirstMsg->m_ListEntry) ); 1433 RTListNodeRemove(&pFirstMsg->m_ListEntry); 1438 1434 1439 1435 /* … … 1441 1437 */ 1442 1438 VBOXHGCMSVCPARM aReplyParams[5]; 1443 HGCMSvcSetU32(&aReplyParams[0], pFirst Cmd->m_idContext);1444 switch (pFirst Cmd->mMsgType)1439 HGCMSvcSetU32(&aReplyParams[0], pFirstMsg->m_idContext); 1440 switch (pFirstMsg->mType) 1445 1441 { 1446 case HOST_ EXEC_CMD:1442 case HOST_MSG_EXEC_CMD: 1447 1443 HGCMSvcSetU32(&aReplyParams[1], 0); /* pid */ 1448 1444 HGCMSvcSetU32(&aReplyParams[2], PROC_STS_ERROR); /* status */ 1449 1445 HGCMSvcSetU32(&aReplyParams[3], rcSkip); /* flags / whatever */ 1450 1446 HGCMSvcSetPv(&aReplyParams[4], NULL, 0); /* data buffer */ 1451 hostCallback(GUEST_ EXEC_STATUS, 5, aReplyParams);1447 hostCallback(GUEST_MSG_EXEC_STATUS, 5, aReplyParams); 1452 1448 break; 1453 1449 1454 case HOST_ SESSION_CREATE:1450 case HOST_MSG_SESSION_CREATE: 1455 1451 HGCMSvcSetU32(&aReplyParams[1], GUEST_SESSION_NOTIFYTYPE_ERROR); /* type */ 1456 1452 HGCMSvcSetU32(&aReplyParams[2], rcSkip); /* result */ 1457 hostCallback(GUEST_ SESSION_NOTIFY, 3, aReplyParams);1453 hostCallback(GUEST_MSG_SESSION_NOTIFY, 3, aReplyParams); 1458 1454 break; 1459 1455 1460 case HOST_ EXEC_SET_INPUT:1461 HGCMSvcSetU32(&aReplyParams[1], pFirst Cmd->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); 1462 1458 HGCMSvcSetU32(&aReplyParams[2], INPUT_STS_ERROR); /* status */ 1463 1459 HGCMSvcSetU32(&aReplyParams[3], rcSkip); /* flags / whatever */ 1464 1460 HGCMSvcSetU32(&aReplyParams[4], 0); /* bytes consumed */ 1465 hostCallback(GUEST_ EXEC_INPUT_STATUS, 5, aReplyParams);1461 hostCallback(GUEST_MSG_EXEC_INPUT_STATUS, 5, aReplyParams); 1466 1462 break; 1467 1463 1468 case HOST_ FILE_OPEN:1464 case HOST_MSG_FILE_OPEN: 1469 1465 HGCMSvcSetU32(&aReplyParams[1], GUEST_FILE_NOTIFYTYPE_OPEN); /* type*/ 1470 1466 HGCMSvcSetU32(&aReplyParams[2], rcSkip); /* rc */ 1471 HGCMSvcSetU32(&aReplyParams[3], VBOX_GUESTCTRL_CONTEXTID_GET_OBJECT(pFirst Cmd->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); 1473 1469 break; 1474 case HOST_ FILE_CLOSE:1470 case HOST_MSG_FILE_CLOSE: 1475 1471 HGCMSvcSetU32(&aReplyParams[1], GUEST_FILE_NOTIFYTYPE_ERROR); /* type*/ 1476 1472 HGCMSvcSetU32(&aReplyParams[2], rcSkip); /* rc */ 1477 hostCallback(GUEST_ FILE_NOTIFY, 3, aReplyParams);1473 hostCallback(GUEST_MSG_FILE_NOTIFY, 3, aReplyParams); 1478 1474 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: 1481 1477 HGCMSvcSetU32(&aReplyParams[1], GUEST_FILE_NOTIFYTYPE_READ); /* type */ 1482 1478 HGCMSvcSetU32(&aReplyParams[2], rcSkip); /* rc */ 1483 1479 HGCMSvcSetPv(&aReplyParams[3], NULL, 0); /* data buffer */ 1484 hostCallback(GUEST_ FILE_NOTIFY, 4, aReplyParams);1480 hostCallback(GUEST_MSG_FILE_NOTIFY, 4, aReplyParams); 1485 1481 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: 1488 1484 HGCMSvcSetU32(&aReplyParams[1], GUEST_FILE_NOTIFYTYPE_WRITE); /* type */ 1489 1485 HGCMSvcSetU32(&aReplyParams[2], rcSkip); /* rc */ 1490 1486 HGCMSvcSetU32(&aReplyParams[3], 0); /* bytes written */ 1491 hostCallback(GUEST_ FILE_NOTIFY, 4, aReplyParams);1487 hostCallback(GUEST_MSG_FILE_NOTIFY, 4, aReplyParams); 1492 1488 break; 1493 case HOST_ FILE_SEEK:1489 case HOST_MSG_FILE_SEEK: 1494 1490 HGCMSvcSetU32(&aReplyParams[1], GUEST_FILE_NOTIFYTYPE_SEEK); /* type */ 1495 1491 HGCMSvcSetU32(&aReplyParams[2], rcSkip); /* rc */ 1496 1492 HGCMSvcSetU64(&aReplyParams[3], 0); /* actual */ 1497 hostCallback(GUEST_ FILE_NOTIFY, 4, aReplyParams);1493 hostCallback(GUEST_MSG_FILE_NOTIFY, 4, aReplyParams); 1498 1494 break; 1499 case HOST_ FILE_TELL:1495 case HOST_MSG_FILE_TELL: 1500 1496 HGCMSvcSetU32(&aReplyParams[1], GUEST_FILE_NOTIFYTYPE_TELL); /* type */ 1501 1497 HGCMSvcSetU32(&aReplyParams[2], rcSkip); /* rc */ 1502 1498 HGCMSvcSetU64(&aReplyParams[3], 0); /* actual */ 1503 hostCallback(GUEST_ FILE_NOTIFY, 4, aReplyParams);1499 hostCallback(GUEST_MSG_FILE_NOTIFY, 4, aReplyParams); 1504 1500 break; 1505 1501 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: 1513 1509 default: 1514 HGCMSvcSetU32(&aReplyParams[1], pFirst Cmd->mMsgType);1510 HGCMSvcSetU32(&aReplyParams[1], pFirstMsg->mType); 1515 1511 HGCMSvcSetU32(&aReplyParams[2], (uint32_t)rcSkip); 1516 1512 HGCMSvcSetPv(&aReplyParams[3], NULL, 0); … … 1520 1516 1521 1517 /* 1522 * Free the command.1518 * Free the message. 1523 1519 */ 1524 pFirst Cmd->Delete();1520 pFirstMsg->Delete(); 1525 1521 } 1526 1522 else … … 1528 1524 return VINF_HGCM_ASYNC_EXECUTE; /* The caller must not complete it. */ 1529 1525 } 1530 LogFunc(("Warning: GUEST_MSG_SKIP mismatch! Found %u, caller expected %u!\n", pFirst Cmd->mMsgType, idMsg));1526 LogFunc(("Warning: GUEST_MSG_SKIP mismatch! Found %u, caller expected %u!\n", pFirstMsg->mType, idMsg)); 1531 1527 return VERR_MISMATCH; 1532 1528 } … … 1596 1592 1597 1593 /* 1598 * Try complete the command.1594 * Try complete the message. 1599 1595 */ 1600 1596 int rc = mpHelpers->pfnCallComplete(hCall, VINF_SUCCESS); … … 1786 1782 1787 1783 /* 1788 * Forward the commandto the destiation.1784 * Forward the message to the destiation. 1789 1785 * Since we modify the first parameter, we must make a copy of the parameters. 1790 1786 */ … … 1792 1788 HGCMSvcSetU64(&aParms[0], idContext | VBOX_GUESTCTRL_DST_SESSION); 1793 1789 HGCMSvcSetU32(&aParms[1], fFlags); 1794 int rc = hostProcess Command(HOST_SESSION_CLOSE, RT_ELEMENTS(aParms), aParms);1790 int rc = hostProcessMessage(HOST_MSG_SESSION_CLOSE, RT_ELEMENTS(aParms), aParms); 1795 1791 1796 1792 LogFlowFunc(("Closing guest context ID=%RU32 (from client ID=%RU32) returned with rc=%Rrc\n", idContext, pClient->m_idClient, rc)); … … 1871 1867 1872 1868 /** 1873 * For compatibility with old additions only - skip the current commandw/o1869 * For compatibility with old additions only - skip the current message w/o 1874 1870 * calling main code. 1875 1871 * … … 1899 1895 * So, we have to track whether they issued a MSG_REPLY or not. Wonderful. 1900 1896 */ 1901 Host Command *pFirstCmd = RTListGetFirstCpp(&pClient->m_HostCmdList, HostCommand, m_ListEntry);1902 if (pFirst Cmd)1903 { 1904 uint32_t const idMsg = pFirst Cmd->mMsgType;1905 bool const f60BetaHackInPlay = pFirst Cmd->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; 1906 1902 int rc; 1907 1903 if (!f60BetaHackInPlay) … … 1909 1905 else 1910 1906 { 1911 RTListNodeRemove(&pFirst Cmd->m_ListEntry);1912 pFirst Cmd->Delete();1907 RTListNodeRemove(&pFirstMsg->m_ListEntry); 1908 pFirstMsg->Delete(); 1913 1909 rc = VINF_SUCCESS; 1914 1910 } … … 1917 1913 if (RT_SUCCESS(rc)) 1918 1914 { 1919 pClient->mHost CmdRc = VINF_SUCCESS;1920 pClient->mHost CmdTries = 0;1915 pClient->mHostMsgRc = VINF_SUCCESS; 1916 pClient->mHostMsgTries = 0; 1921 1917 pClient->mPeekCount = 0; 1922 1918 } 1923 1919 1924 1920 LogFlowFunc(("[Client %RU32] Legacy message skipping: Skipped %u (%s)%s!\n", 1925 pClient->m_idClient, idMsg, GstCtrlHost FnName((eHostFn)idMsg), f60BetaHackInPlay ? " hack style" : ""));1921 pClient->m_idClient, idMsg, GstCtrlHostMsgtoStr((eHostMsg)idMsg), f60BetaHackInPlay ? " hack style" : "")); 1926 1922 NOREF(idMsg); 1927 1923 return rc; … … 1939 1935 * @returns VBox status code. 1940 1936 * @param pClient The client state. 1941 * @param id Function Function (event)that occured.1937 * @param idMsg Message ID that occured. 1942 1938 * @param cParms Number of parameters. 1943 1939 * @param paParms Array of parameters. 1944 1940 */ 1945 int GstCtrlService::clientToMain(ClientState *pClient, uint32_t id Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[])1941 int GstCtrlService::clientToMain(ClientState *pClient, uint32_t idMsg, uint32_t cParms, VBOXHGCMSVCPARM paParms[]) 1946 1942 { 1947 1943 /* … … 1958 1954 || ( m_fLegacyMode /* (see bugref:9313#c16) */ 1959 1955 && pClient->m_idSession == UINT32_MAX 1960 && ( id Function == GUEST_EXEC_STATUS1961 || id Function == GUEST_SESSION_NOTIFY)),1962 ("idSession=%u (CID=%#x) m_idSession=%u idClient=%u id Function=%u (%s)\n", idSession, idContext,1963 pClient->m_idSession, pClient->m_idClient, id Function, 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)), 1964 1960 VERR_ACCESS_DENIED); 1965 1961 … … 1967 1963 * It seems okay, so make the call. 1968 1964 */ 1969 return hostCallback(id Function, cParms, paParms);1965 return hostCallback(idMsg, cParms, paParms); 1970 1966 } 1971 1967 … … 1981 1977 /*static*/ DECLCALLBACK(void) 1982 1978 GstCtrlService::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)); 1987 1983 RT_NOREF(tsArrival, idClient); 1988 1984 … … 2000 1996 */ 2001 1997 int rc; 2002 switch ( idFunction)2003 { 2004 case GUEST_M AKE_ME_MASTER:1998 switch (u32Function) 1999 { 2000 case GUEST_MSG_MAKE_ME_MASTER: 2005 2001 LogFlowFunc(("[Client %RU32] GUEST_MAKE_ME_MASTER\n", idClient)); 2006 2002 rc = pThis->clientMakeMeMaster(pClient, hCall, cParms); … … 2026 2022 rc = pThis->clientMsgSkip(pClient, hCall, cParms, paParms); 2027 2023 break; 2028 case GUEST_ SESSION_PREPARE:2024 case GUEST_MSG_SESSION_PREPARE: 2029 2025 LogFlowFunc(("[Client %RU32] GUEST_SESSION_PREPARE\n", idClient)); 2030 2026 rc = pThis->clientSessionPrepare(pClient, hCall, cParms, paParms); 2031 2027 break; 2032 case GUEST_ SESSION_CANCEL_PREPARED:2028 case GUEST_MSG_SESSION_CANCEL_PREPARED: 2033 2029 LogFlowFunc(("[Client %RU32] GUEST_SESSION_CANCEL_PREPARED\n", idClient)); 2034 2030 rc = pThis->clientSessionCancelPrepared(pClient, cParms, paParms); 2035 2031 break; 2036 case GUEST_ SESSION_ACCEPT:2032 case GUEST_MSG_SESSION_ACCEPT: 2037 2033 LogFlowFunc(("[Client %RU32] GUEST_SESSION_ACCEPT\n", idClient)); 2038 2034 rc = pThis->clientSessionAccept(pClient, hCall, cParms, paParms); 2039 2035 break; 2040 case GUEST_ SESSION_CLOSE:2036 case GUEST_MSG_SESSION_CLOSE: 2041 2037 LogFlowFunc(("[Client %RU32] GUEST_SESSION_CLOSE\n", idClient)); 2042 2038 rc = pThis->clientSessionCloseOther(pClient, cParms, paParms); … … 2049 2045 if (cParms >= 3 && paParms[2].u.uint32 == (uint32_t)VERR_NOT_SUPPORTED) 2050 2046 { 2051 Host Command *pFirstCmd = RTListGetFirstCpp(&pClient->m_HostCmdList, HostCommand, m_ListEntry);2052 if (pFirst Cmd && pFirstCmd->m_idContext == paParms[0].u.uint32)2053 pFirst Cmd->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; 2054 2050 } 2055 2051 RT_FALL_THROUGH(); 2056 2052 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, GstCtrlGuest FnName((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); 2066 2062 Assert(rc != VINF_HGCM_ASYNC_EXECUTE); 2067 2063 break; 2068 2064 2069 2065 /* 2070 * The remaining commands are here for compatibility with older guest additions:2066 * The remaining messages are here for compatibility with older Guest Additions: 2071 2067 */ 2072 2068 case GUEST_MSG_WAIT: … … 2097 2093 */ 2098 2094 default: 2099 ASSERT_GUEST_MSG_FAILED((" idFunction=%d (%#x)\n", idFunction, idFunction));2095 ASSERT_GUEST_MSG_FAILED(("u32Function=%RU32 (%#x)\n", u32Function, u32Function)); 2100 2096 rc = VERR_INVALID_FUNCTION; 2101 2097 break; … … 2117 2113 * 2118 2114 * @returns VBox status code. 2119 * @param idFunction Function (event)that occured.2115 * @param u32Function Message ID that occured. 2120 2116 * @param cParms Number of parameters. 2121 2117 * @param paParms Array of parameters. 2122 2118 */ 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)); 2119 int 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)); 2126 2123 2127 2124 int rc; … … 2129 2126 { 2130 2127 VBOXGUESTCTRLHOSTCALLBACK data(cParms, paParms); 2131 rc = mpfnHostCallback(mpvHostData, idFunction, &data, sizeof(data));2128 rc = mpfnHostCallback(mpvHostData, u32Function, &data, sizeof(data)); 2132 2129 } 2133 2130 else … … 2140 2137 2141 2138 /** 2142 * Processes a commandreceived from the host side and re-routes it to2139 * Processes a message received from the host side and re-routes it to 2143 2140 * a connect client on the guest. 2144 2141 * 2145 2142 * @returns VBox status code. 2146 * @param id Function Function codeto process.2143 * @param idMsg Message ID to process. 2147 2144 * @param cParms Number of parameters. 2148 2145 * @param paParms Array of parameters. 2149 2146 */ 2150 int GstCtrlService::hostProcess Command(uint32_t idFunction, uint32_t cParms, VBOXHGCMSVCPARM paParms[])2151 { 2152 /* 2153 * If no client is connected at all we don't buffer any host commands2147 int 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 2154 2151 * and immediately return an error to the host. This avoids the host 2155 2152 * waiting for a response from the guest side in case VBoxService on … … 2158 2155 if (m_ClientStateMap.empty()) 2159 2156 { 2160 LogFlow(("GstCtrlService::hostProcess Command: VERR_NOT_FOUND!\n"));2157 LogFlow(("GstCtrlService::hostProcessMessage: VERR_NOT_FOUND!\n")); 2161 2158 return VERR_NOT_FOUND; 2162 2159 } 2163 2160 2164 2161 /* 2165 * Create a host commandfor each destination.2162 * Create a host message for each destination. 2166 2163 * Note! There is currently only one scenario in which we send a host 2167 * commandto two recipients.2168 */ 2169 Host Command *pHostCmd = new (std::nothrow) HostCommand();2170 AssertReturn(pHost Cmd, VERR_NO_MEMORY);2171 int rc = pHost Cmd->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); 2172 2169 if (RT_SUCCESS(rc)) 2173 2170 { 2174 uint64_t const fDestinations = pHost Cmd->m_idContextAndDst & VBOX_GUESTCTRL_DST_BOTH;2175 Host Command *pHostCmd2 = NULL;2171 uint64_t const fDestinations = pHostMsg->m_idContextAndDst & VBOX_GUESTCTRL_DST_BOTH; 2172 HostMsg *pHostMsg2 = NULL; 2176 2173 if (fDestinations != VBOX_GUESTCTRL_DST_BOTH) 2177 2174 { /* likely */ } 2178 2175 else 2179 2176 { 2180 pHost Cmd2 = new (std::nothrow) HostCommand();2181 if (pHost Cmd2)2182 rc = pHost Cmd2->Init(idFunction, cParms, paParms);2177 pHostMsg2 = new (std::nothrow) HostMsg(); 2178 if (pHostMsg2) 2179 rc = pHostMsg2->Init(idMsg, cParms, paParms); 2183 2180 else 2184 2181 rc = VERR_NO_MEMORY; … … 2186 2183 if (RT_SUCCESS(rc)) 2187 2184 { 2188 LogFlowFunc(("Handling host command m_idContextAndDst=%#RX64, idFunction=%RU32, cParms=%RU32, paParms=%p, cClients=%zu\n",2189 pHost Cmd->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())); 2190 2187 2191 2188 /* … … 2198 2195 if (fDestinations & VBOX_GUESTCTRL_DST_SESSION) 2199 2196 { 2200 uint32_t const idSession = VBOX_GUESTCTRL_CONTEXTID_GET_SESSION(pHost Cmd->m_idContext);2197 uint32_t const idSession = VBOX_GUESTCTRL_CONTEXTID_GET_SESSION(pHostMsg->m_idContext); 2201 2198 ClientStateMap::iterator It = m_SessionIdMap.find(idSession); 2202 2199 if (It != m_SessionIdMap.end()) … … 2204 2201 ClientState *pClient = It->second; 2205 2202 Assert(pClient->m_idSession == idSession); 2206 RTListAppend(&pClient->m_Host CmdList, &pHostCmd->m_ListEntry);2207 pHost Cmd = pHostCmd2;2208 pHost Cmd2 = NULL;2203 RTListAppend(&pClient->m_HostMsgList, &pHostMsg->m_ListEntry); 2204 pHostMsg = pHostMsg2; 2205 pHostMsg2 = NULL; 2209 2206 2210 2207 int rc2 = pClient->Wakeup(); … … 2215 2212 else 2216 2213 { 2217 LogFunc(("No client with session ID %u was found! (id Function=%d %s)\n",2218 idSession, id Function, GstCtrlHostFnName((eHostFn)idFunction)));2214 LogFunc(("No client with session ID %u was found! (idMsg=%d %s)\n", 2215 idSession, idMsg, GstCtrlHostMsgtoStr((eHostMsg)idMsg))); 2219 2216 rc = !(fDestinations & VBOX_GUESTCTRL_DST_ROOT_SVC) ? VERR_NOT_FOUND : VWRN_NOT_FOUND; 2220 2217 } … … 2225 2222 && RT_SUCCESS(rc)) 2226 2223 { 2227 Assert(pHost Cmd);2224 Assert(pHostMsg); 2228 2225 if (m_pMasterClient) 2229 2226 { 2230 RTListAppend(&m_pMasterClient->m_Host CmdList, &pHostCmd->m_ListEntry);2231 pHost Cmd= NULL;2227 RTListAppend(&m_pMasterClient->m_HostMsgList, &pHostMsg->m_ListEntry); 2228 pHostMsg = NULL; 2232 2229 2233 2230 int rc2 = m_pMasterClient->Wakeup(); … … 2240 2237 } 2241 2238 2242 /* Drop unset commands*/2243 if (pHost Cmd2)2244 pHost Cmd2->Delete();2245 } 2246 if (pHost Cmd)2247 pHost Cmd->Delete();2239 /* Drop unset messages. */ 2240 if (pHostMsg2) 2241 pHostMsg2->Delete(); 2242 } 2243 if (pHostMsg) 2244 pHostMsg->Delete(); 2248 2245 2249 2246 if (RT_FAILURE(rc)) 2250 LogFunc(("Failed %Rrc (id Function=%u, cParms=%u)\n", rc, idFunction, cParms));2247 LogFunc(("Failed %Rrc (idMsg=%u, cParms=%u)\n", rc, idMsg, cParms)); 2251 2248 return rc; 2252 2249 } … … 2255 2252 /** 2256 2253 * @interface_method_impl{VBOXHGCMSVCFNTABLE,pfnHostCall, 2257 * Wraps to the hostProcess Command() member function.}2254 * Wraps to the hostProcessMessage() member function.} 2258 2255 */ 2259 2256 /*static*/ DECLCALLBACK(int) … … 2264 2261 AssertPtrReturn(pThis, VERR_INVALID_POINTER); 2265 2262 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->hostProcess Command(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); 2269 2266 } 2270 2267 -
trunk/src/VBox/HostServices/GuestControl/testcase/tstGuestControlSvc.cpp
r76553 r76958 179 179 180 180 /** 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 }, 184 184 185 185 /** 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 }, 190 190 191 191 /** Client connected, unknown command + valid parameters given. */ … … 221 221 HGCMSvcSetStr(&aParmsHost[2], "baz"); 222 222 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]); 224 224 RTTEST_CHECK_RC_RET(g_hTest, rc, VINF_SUCCESS, rc); 225 225 -
trunk/src/VBox/Main/include/GuestCtrlImplPrivate.h
r76562 r76958 1179 1179 int bindToSession(Console *pConsole, GuestSession *pSession, uint32_t uObjectID); 1180 1180 int registerWaitEvent(const GuestEventTypes &lstEvents, GuestWaitEvent **ppEvent); 1181 int send Command(uint32_t uFunction, uint32_t cParms, PVBOXHGCMSVCPARM paParms);1181 int sendMessage(uint32_t uFunction, uint32_t cParms, PVBOXHGCMSVCPARM paParms); 1182 1182 1183 1183 protected: -
trunk/src/VBox/Main/include/GuestSessionImpl.h
r76562 r76958 325 325 inline bool i_processExists(uint32_t uProcessID, ComObjPtr<GuestProcess> *pProcess); 326 326 inline int i_processGetByPID(ULONG uPID, ComObjPtr<GuestProcess> *pProcess); 327 int i_send Command(uint32_t uFunction, uint32_t uParms, PVBOXHGCMSVCPARM paParms,327 int i_sendMessage(uint32_t uFunction, uint32_t uParms, PVBOXHGCMSVCPARM paParms, 328 328 uint64_t fDst = VBOX_GUESTCTRL_DST_SESSION); 329 329 static HRESULT i_setErrorExternal(VirtualBoxBase *pInterface, int guestRc); -
trunk/src/VBox/Main/src-client/GuestCtrlImpl.cpp
r76553 r76958 61 61 62 62 /** 63 * Static callback function for receiving updates on guest control commands63 * Static callback function for receiving updates on guest control messages 64 64 * from the guest. Acts as a dispatcher for the actual class instance. 65 65 * … … 72 72 * return locations. However, there is no explaination for this attitude 73 73 * thowards error handling. Further, it creates a slight problem since 74 * the service would route all functioncalls 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. 76 76 * 77 77 * In my humble opinion, if the guest gives us incorrect input it should … … 85 85 /* static */ 86 86 DECLCALLBACK(int) Guest::i_notifyCtrlDispatcher(void *pvExtension, 87 uint32_t id Function,87 uint32_t idMessage, 88 88 void *pvData, 89 89 uint32_t cbData) … … 95 95 * changes to the object state. 96 96 */ 97 Log2Func(("pvExtension=%p, id Function=%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)); 98 98 99 99 ComObjPtr<Guest> pGuest = reinterpret_cast<Guest *>(pvExtension); … … 110 110 111 111 /* 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: 113 113 * - Get the callback header to access the context ID 114 114 * - Get the context ID of the callback … … 123 123 uint32_t const idContext = pSvcCb->mpaParms[0].u.uint32; 124 124 125 VBOXGUESTCTRLHOSTCBCTX CtxCb = { id Function, idContext };125 VBOXGUESTCTRLHOSTCBCTX CtxCb = { idMessage, idContext }; 126 126 int rc = pGuest->i_dispatchToSession(&CtxCb, pSvcCb); 127 127 … … 142 142 AssertPtrReturn(pSvcCb, VERR_INVALID_POINTER); 143 143 144 Log2Func(("u Function=%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)); 145 145 146 146 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); … … 170 170 bool fDispatch = true; 171 171 rc = VERR_INVALID_FUNCTION; 172 if ( pCtxCb->u Function == GUEST_EXEC_STATUS172 if ( pCtxCb->uMessage == GUEST_MSG_EXEC_STATUS 173 173 && pSvcCb->mParms >= 5) 174 174 { … … 183 183 && (int32_t)dataCb.uFlags == VERR_TOO_MUCH_DATA) 184 184 { 185 LogFlowFunc(("Requested commandwith too much data, skipping dispatching ...\n"));185 LogFlowFunc(("Requested message with too much data, skipping dispatching ...\n")); 186 186 Assert(dataCb.uPID == 0); 187 187 fDispatch = false; … … 191 191 #endif 192 192 { 193 switch (pCtxCb->u Function)193 switch (pCtxCb->uMessage) 194 194 { 195 case GUEST_ DISCONNECTED:195 case GUEST_MSG_DISCONNECTED: 196 196 rc = pSession->i_dispatchToThis(pCtxCb, pSvcCb); 197 197 break; 198 198 199 199 /* 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: 204 204 rc = pSession->i_dispatchToObject(pCtxCb, pSvcCb); 205 205 break; 206 206 207 207 /* File stuff. */ 208 case GUEST_ FILE_NOTIFY:208 case GUEST_MSG_FILE_NOTIFY: 209 209 rc = pSession->i_dispatchToObject(pCtxCb, pSvcCb); 210 210 break; 211 211 212 212 /* Session stuff. */ 213 case GUEST_ SESSION_NOTIFY:213 case GUEST_MSG_SESSION_NOTIFY: 214 214 rc = pSession->i_dispatchToThis(pCtxCb, pSvcCb); 215 215 break; -
trunk/src/VBox/Main/src-client/GuestCtrlPrivate.cpp
r76553 r76958 813 813 try 814 814 { 815 Log2Func(("uFunc=%RU32, cParms=%RU32\n", pCtxCb->u Function, pSvcCb->mParms));816 817 switch (pCtxCb->u Function)815 Log2Func(("uFunc=%RU32, cParms=%RU32\n", pCtxCb->uMessage, pSvcCb->mParms)); 816 817 switch (pCtxCb->uMessage) 818 818 { 819 819 case GUEST_MSG_PROGRESS_UPDATE: … … 1413 1413 } 1414 1414 1415 int GuestObject::send Command(uint32_t uFunction, uint32_t cParms, PVBOXHGCMSVCPARM paParms)1415 int GuestObject::sendMessage(uint32_t uMessage, uint32_t cParms, PVBOXHGCMSVCPARM paParms) 1416 1416 { 1417 1417 #ifndef VBOX_GUESTCTRL_TEST_CASE … … 1432 1432 1433 1433 /* Make the call. */ 1434 LogFlowThisFunc(("u Function=%RU32, cParms=%RU32\n", uFunction, cParms));1435 vrc = pVMMDev->hgcmHostCall(HGCMSERVICE_NAME, u Function, cParms, paParms);1434 LogFlowThisFunc(("uMessage=%RU32, cParms=%RU32\n", uMessage, cParms)); 1435 vrc = pVMMDev->hgcmHostCall(HGCMSERVICE_NAME, uMessage, cParms, paParms); 1436 1436 if (RT_FAILURE(vrc)) 1437 1437 { … … 1443 1443 1444 1444 /* Not needed within testcases. */ 1445 RT_NOREF(u Function, cParms, paParms);1445 RT_NOREF(uMessage, cParms, paParms); 1446 1446 int vrc = VINF_SUCCESS; 1447 1447 #endif -
trunk/src/VBox/Main/src-client/GuestDirectoryImpl.cpp
r76553 r76958 170 170 171 171 LogFlowThisFunc(("strPath=%s, uContextID=%RU32, uFunction=%RU32, pSvcCb=%p\n", 172 mData.mOpenInfo.mPath.c_str(), pCbCtx->uContextID, pCbCtx->u Function, pSvcCb));172 mData.mOpenInfo.mPath.c_str(), pCbCtx->uContextID, pCbCtx->uMessage, pSvcCb)); 173 173 174 174 int vrc; 175 switch (pCbCtx->u Function)176 { 177 case GUEST_ DIR_NOTIFY:175 switch (pCbCtx->uMessage) 176 { 177 case GUEST_MSG_DIR_NOTIFY: 178 178 { 179 179 int idx = 1; /* Current parameter index. */ -
trunk/src/VBox/Main/src-client/GuestFileImpl.cpp
r76553 r76958 333 333 334 334 LogFlowThisFunc(("strName=%s, uContextID=%RU32, uFunction=%RU32, pSvcCb=%p\n", 335 mData.mOpenInfo.mFilename.c_str(), pCbCtx->uContextID, pCbCtx->u Function, pSvcCb));335 mData.mOpenInfo.mFilename.c_str(), pCbCtx->uContextID, pCbCtx->uMessage, pSvcCb)); 336 336 337 337 int vrc; 338 switch (pCbCtx->u Function)339 { 340 case GUEST_ DISCONNECTED:338 switch (pCbCtx->uMessage) 339 { 340 case GUEST_MSG_DISCONNECTED: 341 341 vrc = i_onGuestDisconnected(pCbCtx, pSvcCb); 342 342 break; 343 343 344 case GUEST_ FILE_NOTIFY:344 case GUEST_MSG_FILE_NOTIFY: 345 345 vrc = i_onFileNotify(pCbCtx, pSvcCb); 346 346 break; … … 386 386 HGCMSvcSetU32(&paParms[i++], mObjectID /* Guest file ID */); 387 387 388 vrc = send Command(HOST_FILE_CLOSE, i, paParms);388 vrc = sendMessage(HOST_MSG_FILE_CLOSE, i, paParms); 389 389 if (RT_SUCCESS(vrc)) 390 390 vrc = i_waitForStatusChange(pEvent, 30 * 1000 /* Timeout in ms */, … … 730 730 alock.release(); /* Drop write lock before sending. */ 731 731 732 vrc = send Command(HOST_FILE_OPEN, i, paParms);732 vrc = sendMessage(HOST_MSG_FILE_OPEN, i, paParms); 733 733 if (RT_SUCCESS(vrc)) 734 734 vrc = i_waitForStatusChange(pEvent, uTimeoutMS, NULL /* FileStatus */, prcGuest); … … 785 785 alock.release(); /* Drop write lock before sending. */ 786 786 787 vrc = send Command(HOST_FILE_READ, i, paParms);787 vrc = sendMessage(HOST_MSG_FILE_READ, i, paParms); 788 788 if (RT_SUCCESS(vrc)) 789 789 { … … 845 845 alock.release(); /* Drop write lock before sending. */ 846 846 847 vrc = send Command(HOST_FILE_READ_AT, i, paParms);847 vrc = sendMessage(HOST_MSG_FILE_READ_AT, i, paParms); 848 848 if (RT_SUCCESS(vrc)) 849 849 { … … 907 907 alock.release(); /* Drop write lock before sending. */ 908 908 909 vrc = send Command(HOST_FILE_SEEK, i, paParms);909 vrc = sendMessage(HOST_MSG_FILE_SEEK, i, paParms); 910 910 if (RT_SUCCESS(vrc)) 911 911 { … … 1171 1171 alock.release(); /* Drop write lock before sending. */ 1172 1172 1173 vrc = send Command(HOST_FILE_WRITE, i, paParms);1173 vrc = sendMessage(HOST_MSG_FILE_WRITE, i, paParms); 1174 1174 if (RT_SUCCESS(vrc)) 1175 1175 { … … 1235 1235 alock.release(); /* Drop write lock before sending. */ 1236 1236 1237 vrc = send Command(HOST_FILE_WRITE_AT, i, paParms);1237 vrc = sendMessage(HOST_MSG_FILE_WRITE_AT, i, paParms); 1238 1238 if (RT_SUCCESS(vrc)) 1239 1239 { -
trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp
r76553 r76958 416 416 AssertPtrReturn(pSvcCb, VERR_INVALID_POINTER); 417 417 #ifdef DEBUG 418 LogFlowThisFunc(("uPID=%RU32, uContextID=%RU32, u Function=%RU32, pSvcCb=%p\n",419 mData.mPID, pCbCtx->uContextID, pCbCtx->u Function, pSvcCb));418 LogFlowThisFunc(("uPID=%RU32, uContextID=%RU32, uMessage=%RU32, pSvcCb=%p\n", 419 mData.mPID, pCbCtx->uContextID, pCbCtx->uMessage, pSvcCb)); 420 420 #endif 421 421 422 422 int vrc; 423 switch (pCbCtx->u Function)424 { 425 case GUEST_ DISCONNECTED:423 switch (pCbCtx->uMessage) 424 { 425 case GUEST_MSG_DISCONNECTED: 426 426 { 427 427 vrc = i_onGuestDisconnected(pCbCtx, pSvcCb); … … 429 429 } 430 430 431 case GUEST_ EXEC_STATUS:431 case GUEST_MSG_EXEC_STATUS: 432 432 { 433 433 vrc = i_onProcessStatusChange(pCbCtx, pSvcCb); … … 435 435 } 436 436 437 case GUEST_ EXEC_OUTPUT:437 case GUEST_MSG_EXEC_OUTPUT: 438 438 { 439 439 vrc = i_onProcessOutput(pCbCtx, pSvcCb); … … 441 441 } 442 442 443 case GUEST_ EXEC_INPUT_STATUS:443 case GUEST_MSG_EXEC_INPUT_STATUS: 444 444 { 445 445 vrc = i_onProcessInputStatus(pCbCtx, pSvcCb); … … 916 916 alock.release(); /* Drop the write lock before sending. */ 917 917 918 vrc = send Command(HOST_EXEC_GET_OUTPUT, i, paParms);918 vrc = sendMessage(HOST_MSG_EXEC_GET_OUTPUT, i, paParms); 919 919 } 920 920 … … 1132 1132 rLock.release(); /* Drop the write lock before sending. */ 1133 1133 1134 vrc = send Command(HOST_EXEC_CMD, i, paParms);1134 vrc = sendMessage(HOST_MSG_EXEC_CMD, i, paParms); 1135 1135 if (RT_FAILURE(vrc)) 1136 1136 { … … 1251 1251 alock.release(); /* Drop the write lock before sending. */ 1252 1252 1253 vrc = send Command(HOST_EXEC_TERMINATE, i, paParms);1253 vrc = sendMessage(HOST_MSG_EXEC_TERMINATE, i, paParms); 1254 1254 if (RT_SUCCESS(vrc)) 1255 1255 vrc = i_waitForStatusChange(pEvent, uTimeoutMS, … … 1733 1733 1734 1734 uint32_t cbProcessed = 0; 1735 vrc = send Command(HOST_EXEC_SET_INPUT, i, paParms);1735 vrc = sendMessage(HOST_MSG_EXEC_SET_INPUT, i, paParms); 1736 1736 if (RT_SUCCESS(vrc)) 1737 1737 { -
trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp
r76553 r76958 718 718 alock.release(); /* Drop the write lock before waiting. */ 719 719 720 vrc = i_send Command(HOST_SESSION_CLOSE, i, paParms, VBOX_GUESTCTRL_DST_BOTH);720 vrc = i_sendMessage(HOST_MSG_SESSION_CLOSE, i, paParms, VBOX_GUESTCTRL_DST_BOTH); 721 721 if (RT_SUCCESS(vrc)) 722 722 vrc = i_waitForStatusChange(pEvent, GuestSessionWaitForFlag_Terminate, uTimeoutMS, … … 1073 1073 alock.release(); /* Drop write lock before sending. */ 1074 1074 1075 vrc = i_send Command(HOST_DIR_REMOVE, i, paParms);1075 vrc = i_sendMessage(HOST_MSG_DIR_REMOVE, i, paParms); 1076 1076 if (RT_SUCCESS(vrc)) 1077 1077 { … … 1314 1314 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1315 1315 1316 LogFlowThisFunc(("sessionID=%RU32, CID=%RU32, u Function=%RU32, pSvcCb=%p\n",1317 mData.mSession.mID, pCbCtx->uContextID, pCbCtx->u Function, pSvcCb));1316 LogFlowThisFunc(("sessionID=%RU32, CID=%RU32, uMessage=%RU32, pSvcCb=%p\n", 1317 mData.mSession.mID, pCbCtx->uContextID, pCbCtx->uMessage, pSvcCb)); 1318 1318 int rc; 1319 switch (pCbCtx->u Function)1320 { 1321 case GUEST_ DISCONNECTED:1319 switch (pCbCtx->uMessage) 1320 { 1321 case GUEST_MSG_DISCONNECTED: 1322 1322 /** @todo Handle closing all guest objects. */ 1323 1323 rc = VERR_INTERNAL_ERROR; 1324 1324 break; 1325 1325 1326 case GUEST_ SESSION_NOTIFY: /* Guest Additions >= 4.3.0. */1326 case GUEST_MSG_SESSION_NOTIFY: /* Guest Additions >= 4.3.0. */ 1327 1327 { 1328 1328 rc = i_onSessionStatusChange(pCbCtx, pSvcCb); … … 1947 1947 alock.release(); /* Drop write lock before sending. */ 1948 1948 1949 vrc = i_send Command(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); 1950 1950 if (RT_SUCCESS(vrc)) 1951 1951 { … … 2136 2136 alock.release(); /* Drop write lock before sending. */ 2137 2137 2138 vrc = i_send Command(HOST_PATH_RENAME, i, paParms);2138 vrc = i_sendMessage(HOST_MSG_PATH_RENAME, i, paParms); 2139 2139 if (RT_SUCCESS(vrc)) 2140 2140 { … … 2177 2177 alock.release(); /* Drop write lock before sending. */ 2178 2178 2179 vrc = i_send Command(HOST_PATH_USER_DOCUMENTS, i, paParms);2179 vrc = i_sendMessage(HOST_MSG_PATH_USER_DOCUMENTS, i, paParms); 2180 2180 if (RT_SUCCESS(vrc)) 2181 2181 { … … 2227 2227 alock.release(); /* Drop write lock before sending. */ 2228 2228 2229 vrc = i_send Command(HOST_PATH_USER_HOME, i, paParms);2229 vrc = i_sendMessage(HOST_MSG_PATH_USER_HOME, i, paParms); 2230 2230 if (RT_SUCCESS(vrc)) 2231 2231 { … … 2437 2437 } 2438 2438 2439 int GuestSession::i_send Command(uint32_t uFunction, uint32_t uParms, PVBOXHGCMSVCPARM paParms,2439 int GuestSession::i_sendMessage(uint32_t uMessage, uint32_t uParms, PVBOXHGCMSVCPARM paParms, 2440 2440 uint64_t fDst /*= VBOX_GUESTCTRL_DST_SESSION*/) 2441 2441 { … … 2450 2450 AssertPtr(pVMMDev); 2451 2451 2452 LogFlowThisFunc(("u Function=%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)); 2453 2453 2454 2454 /* HACK ALERT! We extend the first parameter to 64-bit and use the … … 2460 2460 2461 2461 /* Make the call. */ 2462 int vrc = pVMMDev->hgcmHostCall(HGCMSERVICE_NAME, u Function, uParms, paParms);2462 int vrc = pVMMDev->hgcmHostCall(HGCMSERVICE_NAME, uMessage, uParms, paParms); 2463 2463 if (RT_FAILURE(vrc)) 2464 2464 {
Note:
See TracChangeset
for help on using the changeset viewer.