Changeset 76958 in vbox for trunk/include/VBox/HostServices
- Timestamp:
- Jan 23, 2019 6:23:04 PM (6 years ago)
- File:
-
- 1 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 /**
Note:
See TracChangeset
for help on using the changeset viewer.