Changeset 82526 in vbox
- Timestamp:
- Dec 9, 2019 9:48:53 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 135388
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/include/VBox/HostServices/VBoxClipboardSvc.h ¶
r82525 r82526 73 73 /** @} */ 74 74 75 75 76 /** @name VBOX_SHCL_HOST_FN_XXX - The service functions which are callable by host. 76 77 * @note These are not sacred and can be modified at will as long as all host … … 86 87 /** Run headless on the host, i.e. do not touch the host clipboard. */ 87 88 #define VBOX_SHCL_HOST_FN_SET_HEADLESS 3 89 88 90 /** Reports cancellation of the current operation to the guest. 89 91 * @since 6.1 - still a todo */ … … 106 108 /** @} */ 107 109 110 108 111 /** @name VBOX_SHCL_HOST_MSG_XXX - The host messages for the guest. 109 112 * @{ 110 113 */ 111 /** Asks the client to quit / terminate. */ 112 #define VBOX_SHCL_HOST_MSG_QUIT 1 113 /** Reads (simple) data from the guest. */ 114 #define VBOX_SHCL_HOST_MSG_READ_DATA 2 114 /** Returned only when the HGCM client session is closed (by different thread). 115 * 116 * This can require no futher host interaction has session has been closed. 117 */ 118 #define VBOX_SHCL_HOST_MSG_QUIT 1 119 /** Request data for a specific format from the guest. 120 * 121 * This takes one parameter (in addition to the message number), a 32-bit 122 * format bit (VBOX_SHCL_FMT_XXX). The guest will respond by issuing a 123 * VBOX_SHCL_GUEST_F_DATA_WRITE. 124 */ 125 #define VBOX_SHCL_HOST_MSG_READ_DATA 2 115 126 /** Reports available clipboard format from host to the guest. 116 127 * Formerly known as VBOX_SHCL_HOST_MSG_REPORT_FORMATS. */ 117 #define VBOX_SHCL_HOST_MSG_FORMATS_REPORT 3 128 #define VBOX_SHCL_HOST_MSG_FORMATS_REPORT 3 129 /** Message PEEK or GET operation was canceled, try again. 130 * @since 6.1.0 131 */ 132 #define VBOX_SHCL_HOST_MSG_CANCELED 4 118 133 119 134 /** Sends a transfer status to the guest side. 120 * 121 * @retval VINF_SUCCESS on success. 122 * @retval VERR_INVALID_CLIENT_ID 123 * @retval VERR_WRONG_PARAMETER_COUNT 124 * @retval VERR_WRONG_PARAMETER_TYPE 125 * @since 6.1 135 * @since 6.1.? 126 136 */ 127 137 #define VBOX_SHCL_HOST_MSG_TRANSFER_STATUS 50 128 138 /** Reads the root list header from the guest. 129 * 130 * @retval VINF_SUCCESS on success. 131 * @retval VERR_INVALID_CLIENT_ID 132 * @retval VERR_WRONG_PARAMETER_COUNT 133 * @retval VERR_WRONG_PARAMETER_TYPE 134 * @since 6.1 139 * @since 6.1.? 135 140 */ 136 141 #define VBOX_SHCL_HOST_MSG_TRANSFER_ROOT_LIST_HDR_READ 51 137 142 /** Writes the root list header to the guest. 138 * 139 * @retval VINF_SUCCESS on success. 140 * @retval VERR_INVALID_CLIENT_ID 141 * @retval VERR_WRONG_PARAMETER_COUNT 142 * @retval VERR_WRONG_PARAMETER_TYPE 143 * @since 6.1 143 * @since 6.1.? 144 144 */ 145 145 #define VBOX_SHCL_HOST_MSG_TRANSFER_ROOT_LIST_HDR_WRITE 52 146 146 /** Reads a root list entry from the guest. 147 * 148 * @retval VINF_SUCCESS on success. 149 * @retval VERR_INVALID_CLIENT_ID 150 * @retval VERR_WRONG_PARAMETER_COUNT 151 * @retval VERR_WRONG_PARAMETER_TYPE 152 * @since 6.1 147 * @since 6.1.? 153 148 */ 154 149 #define VBOX_SHCL_HOST_MSG_TRANSFER_ROOT_LIST_ENTRY_READ 53 155 150 /** Writes a root list entry to the guest. 156 * 157 * @retval VINF_SUCCESS on success. 158 * @retval VERR_INVALID_CLIENT_ID 159 * @retval VERR_WRONG_PARAMETER_COUNT 160 * @retval VERR_WRONG_PARAMETER_TYPE 161 * @since 6.1 151 * @since 6.1.? 162 152 */ 163 153 #define VBOX_SHCL_HOST_MSG_TRANSFER_ROOT_LIST_ENTRY_WRITE 54 164 154 /** Open a transfer list on the guest side. 165 * 166 * @retval VINF_SUCCESS on success. 167 * @retval VERR_INVALID_CLIENT_ID 168 * @retval VERR_WRONG_PARAMETER_COUNT 169 * @retval VERR_WRONG_PARAMETER_TYPE 170 * @since 6.1 155 * @since 6.1.? 171 156 */ 172 157 #define VBOX_SHCL_HOST_MSG_TRANSFER_LIST_OPEN 55 173 158 /** Closes a formerly opened transfer list on the guest side. 174 * 175 * @retval VINF_SUCCESS on success. 176 * @retval VERR_INVALID_CLIENT_ID 177 * @retval VERR_WRONG_PARAMETER_COUNT 178 * @retval VERR_WRONG_PARAMETER_TYPE 179 * @since 6.1 159 * @since 6.1.? 180 160 */ 181 161 #define VBOX_SHCL_HOST_MSG_TRANSFER_LIST_CLOSE 56 182 162 /** Reads a list header from the guest. 183 * 184 * @retval VINF_SUCCESS on success. 185 * @retval VERR_INVALID_CLIENT_ID 186 * @retval VERR_WRONG_PARAMETER_COUNT 187 * @retval VERR_WRONG_PARAMETER_TYPE 188 * @since 6.1 163 * @since 6.1.? 189 164 */ 190 165 #define VBOX_SHCL_HOST_MSG_TRANSFER_LIST_HDR_READ 57 191 166 /** Writes a list header to the guest. 192 * 193 * @retval VINF_SUCCESS on success. 194 * @retval VERR_INVALID_CLIENT_ID 195 * @retval VERR_WRONG_PARAMETER_COUNT 196 * @retval VERR_WRONG_PARAMETER_TYPE 197 * @since 6.1 167 * @since 6.1.? 198 168 */ 199 169 #define VBOX_SHCL_HOST_MSG_TRANSFER_LIST_HDR_WRITE 58 200 170 /** Reads a list entry from the guest. 201 * 202 * @retval VINF_SUCCESS on success. 203 * @retval VERR_INVALID_CLIENT_ID 204 * @retval VERR_WRONG_PARAMETER_COUNT 205 * @retval VERR_WRONG_PARAMETER_TYPE 206 * @since 6.1 171 * @since 6.1.? 207 172 */ 208 173 #define VBOX_SHCL_HOST_MSG_TRANSFER_LIST_ENTRY_READ 59 209 174 /** Writes a list entry to the guest. 210 * 211 * @retval VINF_SUCCESS on success. 212 * @retval VERR_INVALID_CLIENT_ID 213 * @retval VERR_WRONG_PARAMETER_COUNT 214 * @retval VERR_WRONG_PARAMETER_TYPE 215 * @since 6.1 175 * @since 6.1.? 216 176 */ 217 177 #define VBOX_SHCL_HOST_MSG_TRANSFER_LIST_ENTRY_WRITE 60 218 178 /** Open a transfer object on the guest side. 219 * 220 * @retval VINF_SUCCESS on success. 221 * @retval VERR_INVALID_CLIENT_ID 222 * @retval VERR_WRONG_PARAMETER_COUNT 223 * @retval VERR_WRONG_PARAMETER_TYPE 224 * @since 6.1 179 * @since 6.1.? 225 180 */ 226 181 #define VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_OPEN 61 227 182 /** Closes a formerly opened transfer object on the guest side. 228 * 229 * @retval VINF_SUCCESS on success. 230 * @retval VERR_INVALID_CLIENT_ID 231 * @retval VERR_WRONG_PARAMETER_COUNT 232 * @retval VERR_WRONG_PARAMETER_TYPE 233 * @since 6.1 183 * @since 6.1.? 234 184 */ 235 185 #define VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_CLOSE 62 236 186 /** Reads from an object on the guest side. 237 * 238 * @retval VINF_SUCCESS on success. 239 * @retval VERR_INVALID_CLIENT_ID 240 * @retval VERR_WRONG_PARAMETER_COUNT 241 * @retval VERR_WRONG_PARAMETER_TYPE 242 * @since 6.1 187 * @since 6.1.? 243 188 */ 244 189 #define VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_READ 63 245 190 /** Writes to an object on the guest side. 246 * 247 * @retval VINF_SUCCESS on success. 248 * @retval VERR_INVALID_CLIENT_ID 249 * @retval VERR_WRONG_PARAMETER_COUNT 250 * @retval VERR_WRONG_PARAMETER_TYPE 251 * @since 6.1 191 * @since 6.1.? 252 192 */ 253 193 #define VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_WRITE 64 254 194 /** Indicates that the host has canceled a transfer. 255 * 256 * @retval VINF_SUCCESS on success. 257 * @retval VERR_INVALID_CLIENT_ID 258 * @retval VERR_WRONG_PARAMETER_COUNT 259 * @retval VERR_WRONG_PARAMETER_TYPE 260 * @since 6.1 195 * @since 6.1.? 261 196 */ 262 197 #define VBOX_SHCL_HOST_MSG_TRANSFER_CANCEL 65 263 198 /** Indicates that the an unrecoverable error on the host occurred. 264 * 265 * @retval VINF_SUCCESS on success. 266 * @retval VERR_INVALID_CLIENT_ID 267 * @retval VERR_WRONG_PARAMETER_COUNT 268 * @retval VERR_WRONG_PARAMETER_TYPE 269 * @since 6.1 199 * @since 6.1.? 270 200 */ 271 201 #define VBOX_SHCL_HOST_MSG_TRANSFER_ERROR 66 272 202 /** @} */ 273 203 204 274 205 /** @name VBOX_SHCL_GUEST_FN_XXX - The service functions which are called by guest. 275 206 * @{ … … 278 209 * 279 210 * @deprecated Replaced by VBOX_SHCL_GUEST_FN_MSG_PEEK_WAIT, 280 * VBOX_SHCL_GUEST_FN_MSG_GET, VBOX_SHCL_GUEST_FN_CANCEL. 281 */ 282 #define VBOX_SHCL_GUEST_FN_GET_HOST_MSG_OLD 1 211 * VBOX_SHCL_GUEST_FN_MSG_GET, VBOX_SHCL_GUEST_FN_MSG_CANCEL. 212 * @since 1.3.2 213 */ 214 #define VBOX_SHCL_GUEST_FN_MSG_OLD_GET_WAIT 1 283 215 /** Sends a list of available formats to the host. 284 216 * … … 299 231 * @retval VERR_NOT_SUPPORTED if all the formats are unsupported, host 300 232 * clipboard will be empty. 301 */ 302 #define VBOX_SHCL_GUEST_FN_REPORT_FORMATS 2 233 * @since 1.3.2 234 */ 235 #define VBOX_SHCL_GUEST_FN_REPORT_FORMATS 2 303 236 /** Reads data in specified format from the host. 304 237 * … … 320 253 * @retval VERR_WRONG_PARAMETER_COUNT 321 254 * @retval VERR_WRONG_PARAMETER_TYPE 322 */ 323 #define VBOX_SHCL_GUEST_FN_DATA_READ 3 255 * @since 1.3.2 256 */ 257 #define VBOX_SHCL_GUEST_FN_DATA_READ 3 324 258 /** Writes requested data to the host. 325 259 * … … 340 274 * @retval VERR_WRONG_PARAMETER_TYPE 341 275 * @retval VERR_INVALID_CONTEXT if the context ID didn't match up. 342 */ 343 #define VBOX_SHCL_GUEST_FN_DATA_WRITE 4 276 * @since 1.3.2 277 */ 278 #define VBOX_SHCL_GUEST_FN_DATA_WRITE 4 344 279 345 280 /** This is a left-over from the 6.1 dev cycle and will always fail. … … 353 288 * @since 6.1 354 289 */ 355 #define VBOX_SHCL_GUEST_FN_CONNECT 5290 #define VBOX_SHCL_GUEST_FN_CONNECT 5 356 291 /** Report guest side feature flags and retrieve the host ones. 357 292 * … … 364 299 * @retval VERR_WRONG_PARAMETER_COUNT 365 300 * @retval VERR_WRONG_PARAMETER_TYPE 366 * @since 6.1 367 */ 368 #define VBOX_SHCL_GUEST_FN_REPORT_FEATURES 6301 * @since 6.1.0 302 */ 303 #define VBOX_SHCL_GUEST_FN_REPORT_FEATURES 6 369 304 /** Query the host ones feature masks. 370 305 * … … 377 312 * @retval VERR_WRONG_PARAMETER_COUNT 378 313 * @retval VERR_WRONG_PARAMETER_TYPE 379 * @since 6.1 380 */ 381 #define VBOX_SHCL_GUEST_FN_QUERY_FEATURES 7314 * @since 6.1.0 315 */ 316 #define VBOX_SHCL_GUEST_FN_QUERY_FEATURES 7 382 317 /** Peeks at the next message, returning immediately. 383 318 * 384 * @retval VINF_SUCCESS on success. 385 * @retval VERR_INVALID_CLIENT_ID 386 * @retval VERR_WRONG_PARAMETER_COUNT 387 * @retval VERR_WRONG_PARAMETER_TYPE 388 * @since 6.1 389 * @todo r=bird: Either s/_FN_(MSG_)/_MSG_/ or s/_FN_(MSG_)/_FN_/, the place 390 * you copied these from used _MSG_ instead of _FN_ in the general prefix. 391 */ 392 #define VBOX_SHCL_GUEST_FN_MSG_PEEK_NOWAIT 8 319 * Returns two 32-bit parameters, first is the message ID and the second the 320 * parameter count. May optionally return additional 32-bit parameters with the 321 * sizes of respective message parameters. To distinguish buffer sizes from 322 * integer parameters, the latter gets their sizes inverted (uint32_t is ~4U, 323 * uint64_t is ~8U). 324 * 325 * Does also support the VM restore checking as in VBOX_SHCL_GUEST_FN_MSG_PEEK_WAIT 326 * (64-bit param \# 0), see documentation there. 327 * 328 * @retval VINF_SUCCESS if a message was pending and is being returned. 329 * @retval VERR_TRY_AGAIN if no message pending. 330 * @retval VERR_VM_RESTORED if first parameter is a non-zero 64-bit value that 331 * does not match VbglR3GetSessionId() any more. The new value is 332 * returned. 333 * @retval VERR_INVALID_CLIENT_ID 334 * @retval VERR_WRONG_PARAMETER_COUNT 335 * @retval VERR_WRONG_PARAMETER_TYPE 336 * @since 6.1.0 337 */ 338 #define VBOX_SHCL_GUEST_FN_MSG_PEEK_NOWAIT 8 393 339 /** Peeks at the next message, waiting for one to arrive. 394 340 * 395 * @retval VINF_SUCCESS on success. 396 * @retval VERR_INVALID_CLIENT_ID 397 * @retval VERR_WRONG_PARAMETER_COUNT 398 * @retval VERR_WRONG_PARAMETER_TYPE 399 * @since 6.1 400 */ 401 #define VBOX_SHCL_GUEST_FN_MSG_PEEK_WAIT 9 341 * Returns two 32-bit parameters, first is the message ID and the second the 342 * parameter count. May optionally return additional 32-bit parameters with the 343 * sizes of respective message parameters. To distinguish buffer sizes from 344 * integer parameters, the latter gets their sizes inverted (uint32_t is ~4U, 345 * uint64_t is ~8U). 346 * 347 * To facilitate VM restore checking, the first parameter can be a 64-bit 348 * integer holding the VbglR3GetSessionId() value the guest knowns. The 349 * function will then check this before going to sleep and return 350 * VERR_VM_RESTORED if it doesn't match, same thing happens when the VM is 351 * restored. 352 * 353 * @retval VINF_SUCCESS if info about an pending message is being returned. 354 * @retval VINF_TRY_AGAIN and message set to VBOX_SHCL_HOST_MSG_CANCELED if 355 * cancelled by VBOX_SHCL_GUEST_FN_MSG_CANCEL. 356 * @retval VERR_RESOURCE_BUSY if another thread already made a waiting call. 357 * @retval VERR_VM_RESTORED if first parameter is a non-zero 64-bit value that 358 * does not match VbglR3GetSessionId() any more. The new value is 359 * returned. 360 * @retval VERR_INVALID_CLIENT_ID 361 * @retval VERR_WRONG_PARAMETER_COUNT 362 * @retval VERR_WRONG_PARAMETER_TYPE 363 * @note This replaces VBOX_SHCL_GUEST_FN_MSG_OLD_GET_WAIT. 364 * @since 6.1.0 365 */ 366 #define VBOX_SHCL_GUEST_FN_MSG_PEEK_WAIT 9 402 367 /** Gets the next message, returning immediately. 403 368 * 404 * @retval VINF_SUCCESS on success. 405 * @retval VERR_INVALID_CLIENT_ID 406 * @retval VERR_WRONG_PARAMETER_COUNT 407 * @retval VERR_WRONG_PARAMETER_TYPE 408 * @since 6.1 409 */ 410 #define VBOX_SHCL_GUEST_FN_MSG_GET 10 369 * All parameters are specific to the message being retrieved, however if the 370 * first one is an integer value it shall be an input parameter holding the 371 * ID of the message being retrieved. While it would be nice to add a separate 372 * parameter for this purpose, this is done so because the code was liften from 373 * Guest Controls which had backwards compatibilities to consider and we just 374 * kept it like that. 375 * 376 * @retval VINF_SUCCESS if message retrieved and removed from the pending queue. 377 * @retval VERR_TRY_AGAIN if no message pending. 378 * @retval VERR_MISMATCH if the incoming message ID does not match the pending. 379 * @retval VERR_BUFFER_OVERFLOW if a parmeter buffer is too small. The buffer 380 * size was updated to reflect the required size. 381 * @retval VERR_INVALID_CLIENT_ID 382 * @retval VERR_WRONG_PARAMETER_COUNT 383 * @retval VERR_WRONG_PARAMETER_TYPE 384 * @note This replaces VBOX_SHCL_GUEST_FN_MSG_OLD_GET_WAIT. 385 * @since 6.1.0 386 */ 387 #define VBOX_SHCL_GUEST_FN_MSG_GET 10 388 /** Cancels pending calls for this client session. 389 * 390 * This should be used if a VBOX_SHCL_GUEST_FN__MSG_PEEK_WAIT or 391 * VBOX_SHCL_GUEST_FN_MSG_OLD_GET_WAIT call gets interrupted on the client end, 392 * so as to prevent being rebuffed with VERR_RESOURCE_BUSY when restarting the 393 * call. 394 * 395 * @retval VINF_SUCCESS if cancelled any calls. 396 * @retval VWRN_NOT_FOUND if no callers. 397 * @retval VERR_INVALID_CLIENT_ID 398 * @retval VERR_WRONG_PARAMETER_COUNT 399 * @since 6.1.0 400 */ 401 #define VBOX_SHCL_GUEST_FN_MSG_CANCEL 26 402 411 403 /** Replies to a function from the host. 412 404 * … … 415 407 * @retval VERR_WRONG_PARAMETER_COUNT 416 408 * @retval VERR_WRONG_PARAMETER_TYPE 417 * @since 6.1 409 * @since 6.1.x 418 410 */ 419 411 #define VBOX_SHCL_GUEST_FN_REPLY 11 … … 424 416 * @retval VERR_WRONG_PARAMETER_COUNT 425 417 * @retval VERR_WRONG_PARAMETER_TYPE 426 * @since 6.1 418 * @since 6.1.x 427 419 */ 428 420 #define VBOX_SHCL_GUEST_FN_ROOT_LIST_HDR_READ 12 … … 433 425 * @retval VERR_WRONG_PARAMETER_COUNT 434 426 * @retval VERR_WRONG_PARAMETER_TYPE 435 * @since 6.1 427 * @since 6.1.x 436 428 */ 437 429 #define VBOX_SHCL_GUEST_FN_ROOT_LIST_HDR_WRITE 13 … … 442 434 * @retval VERR_WRONG_PARAMETER_COUNT 443 435 * @retval VERR_WRONG_PARAMETER_TYPE 444 * @since 6.1 436 * @since 6.1.x 445 437 */ 446 438 #define VBOX_SHCL_GUEST_FN_ROOT_LIST_ENTRY_READ 14 … … 451 443 * @retval VERR_WRONG_PARAMETER_COUNT 452 444 * @retval VERR_WRONG_PARAMETER_TYPE 453 * @since 6.1 445 * @since 6.1.x 454 446 */ 455 447 #define VBOX_SHCL_GUEST_FN_ROOT_LIST_ENTRY_WRITE 15 … … 460 452 * @retval VERR_WRONG_PARAMETER_COUNT 461 453 * @retval VERR_WRONG_PARAMETER_TYPE 462 * @since 6.1 454 * @since 6.1.x 463 455 */ 464 456 #define VBOX_SHCL_GUEST_FN_LIST_OPEN 16 … … 469 461 * @retval VERR_WRONG_PARAMETER_COUNT 470 462 * @retval VERR_WRONG_PARAMETER_TYPE 471 * @since 6.1 463 * @since 6.1.x 472 464 */ 473 465 #define VBOX_SHCL_GUEST_FN_LIST_CLOSE 17 … … 478 470 * @retval VERR_WRONG_PARAMETER_COUNT 479 471 * @retval VERR_WRONG_PARAMETER_TYPE 480 * @since 6.1 472 * @since 6.1.x 481 473 */ 482 474 #define VBOX_SHCL_GUEST_FN_LIST_HDR_READ 18 … … 487 479 * @retval VERR_WRONG_PARAMETER_COUNT 488 480 * @retval VERR_WRONG_PARAMETER_TYPE 489 * @since 6.1 481 * @since 6.1.x 490 482 */ 491 483 #define VBOX_SHCL_GUEST_FN_LIST_HDR_WRITE 19 … … 496 488 * @retval VERR_WRONG_PARAMETER_COUNT 497 489 * @retval VERR_WRONG_PARAMETER_TYPE 498 * @since 6.1 490 * @since 6.1.x 499 491 */ 500 492 #define VBOX_SHCL_GUEST_FN_LIST_ENTRY_READ 20 … … 505 497 * @retval VERR_WRONG_PARAMETER_COUNT 506 498 * @retval VERR_WRONG_PARAMETER_TYPE 507 * @since 6.1 499 * @since 6.1.x 508 500 */ 509 501 #define VBOX_SHCL_GUEST_FN_LIST_ENTRY_WRITE 21 … … 514 506 * @retval VERR_WRONG_PARAMETER_COUNT 515 507 * @retval VERR_WRONG_PARAMETER_TYPE 516 * @since 6.1 508 * @since 6.1.x 517 509 */ 518 510 #define VBOX_SHCL_GUEST_FN_OBJ_OPEN 22 … … 523 515 * @retval VERR_WRONG_PARAMETER_COUNT 524 516 * @retval VERR_WRONG_PARAMETER_TYPE 525 * @since 6.1 517 * @since 6.1.x 526 518 */ 527 519 #define VBOX_SHCL_GUEST_FN_OBJ_CLOSE 23 … … 532 524 * @retval VERR_WRONG_PARAMETER_COUNT 533 525 * @retval VERR_WRONG_PARAMETER_TYPE 534 * @since 6.1 526 * @since 6.1.x 535 527 */ 536 528 #define VBOX_SHCL_GUEST_FN_OBJ_READ 24 … … 541 533 * @retval VERR_WRONG_PARAMETER_COUNT 542 534 * @retval VERR_WRONG_PARAMETER_TYPE 543 * @since 6.1 535 * @since 6.1.x 544 536 */ 545 537 #define VBOX_SHCL_GUEST_FN_OBJ_WRITE 25 546 /** Reports cancellation of the current operation to the host.547 *548 * @retval VINF_SUCCESS on success.549 * @retval VERR_INVALID_CLIENT_ID550 * @retval VERR_WRONG_PARAMETER_COUNT551 * @retval VERR_WRONG_PARAMETER_TYPE552 * @since 6.1553 */554 #define VBOX_SHCL_GUEST_FN_CANCEL 26555 538 /** Reports an error to the host. 539 * 540 * @todo r=bird: Smells like GUEST_MSG_SKIP 556 541 * 557 542 * @retval VINF_SUCCESS on success. … … 598 583 /** The guest can handle context IDs where applicable. */ 599 584 #define VBOX_SHCL_GF_0_CONTEXT_ID RT_BIT_64(0) 585 /** The guest can copy & paste files and directories. 586 * @since 6.1.? */ 587 #define VBOX_SHCL_GF_0_TRANSFERS RT_BIT_64(1) 600 588 /** Bit that must be set in the 2nd parameter, will be cleared if the host reponds 601 589 * correctly (old hosts might not). */ … … 611 599 * message handling functions. */ 612 600 #define VBOX_SHCL_HF_0_CONTEXT_ID RT_BIT_64(0) 601 /** The host can copy & paste files and directories. 602 * @since 6.1.? */ 603 #define VBOX_SHCL_HF_0_TRANSFERS RT_BIT_64(1) 613 604 /** @} */ 614 605 -
TabularUnified trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibClipboard.cpp ¶
r82525 r82526 333 333 334 334 VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient, 335 VBOX_SHCL_GUEST_FN_ GET_HOST_MSG_OLD, VBOX_SHCL_CPARMS_GET_HOST_MSG_OLD);335 VBOX_SHCL_GUEST_FN_MSG_OLD_GET_WAIT, VBOX_SHCL_CPARMS_GET_HOST_MSG_OLD); 336 336 337 337 VbglHGCMParmUInt32Set(&Msg.msg, 0); … … 515 515 if (rc == VERR_INTERRUPTED) 516 516 { 517 VBGL_HGCM_HDR_INIT(&Msg.Hdr, pCtx->idClient, VBOX_SHCL_GUEST_FN_ CANCEL, 0);517 VBGL_HGCM_HDR_INIT(&Msg.Hdr, pCtx->idClient, VBOX_SHCL_GUEST_FN_MSG_CANCEL, 0); 518 518 int rc2 = VbglR3HGCMCall(&Msg.Hdr, sizeof(Msg.Hdr)); 519 519 AssertRC(rc2); … … 532 532 533 533 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 534 534 535 /** 535 536 * Reads a root list header from the host. … … 2258 2259 return rc; 2259 2260 } 2261 2260 2262 #endif /* VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS */ 2261 2263 -
TabularUnified trunk/src/VBox/GuestHost/SharedClipboard/clipboard-common.cpp ¶
r82513 r82526 893 893 switch (uMsg) 894 894 { 895 RT_CASE_RET_STR(VBOX_SHCL_GUEST_FN_ GET_HOST_MSG_OLD);895 RT_CASE_RET_STR(VBOX_SHCL_GUEST_FN_MSG_OLD_GET_WAIT); 896 896 RT_CASE_RET_STR(VBOX_SHCL_GUEST_FN_REPORT_FORMATS); 897 897 RT_CASE_RET_STR(VBOX_SHCL_GUEST_FN_DATA_READ); … … 903 903 RT_CASE_RET_STR(VBOX_SHCL_GUEST_FN_MSG_PEEK_WAIT); 904 904 RT_CASE_RET_STR(VBOX_SHCL_GUEST_FN_MSG_GET); 905 RT_CASE_RET_STR(VBOX_SHCL_GUEST_FN_MSG_CANCEL); 905 906 RT_CASE_RET_STR(VBOX_SHCL_GUEST_FN_REPLY); 906 907 RT_CASE_RET_STR(VBOX_SHCL_GUEST_FN_ROOT_LIST_HDR_READ); … … 918 919 RT_CASE_RET_STR(VBOX_SHCL_GUEST_FN_OBJ_READ); 919 920 RT_CASE_RET_STR(VBOX_SHCL_GUEST_FN_OBJ_WRITE); 920 RT_CASE_RET_STR(VBOX_SHCL_GUEST_FN_CANCEL);921 921 RT_CASE_RET_STR(VBOX_SHCL_GUEST_FN_ERROR); 922 922 } -
TabularUnified trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-internal.h ¶
r82506 r82526 146 146 RTCList<SHCLCLIENTMSG *> queueMsg; 147 147 /** The client's own event source. 148 * Needed for events which are not bound to a specific transfer. 149 * @todo r=bird: s/Events/EventSrc/ !! */ 150 SHCLEVENTSOURCE Events; 148 * Needed for events which are not bound to a specific transfer. */ 149 SHCLEVENTSOURCE EventSrc; 151 150 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 152 151 /** Transfer contextdata. */ … … 221 220 void shClSvcMsgSetPeekReturn(PSHCLCLIENTMSG pMsg, PVBOXHGCMSVCPARM paDstParms, uint32_t cDstParms); 222 221 int shClSvcMsgAdd(PSHCLCLIENT pClient, PSHCLCLIENTMSG pMsg, bool fAppend); 223 int shClSvcMsgPeek(PSHCLCLIENT pClient, VBOXHGCMCALLHANDLE hCall, uint32_t cParms, VBOXHGCMSVCPARM paParms[], bool fWait);224 int shClSvcMsgGet(PSHCLCLIENT pClient, VBOXHGCMCALLHANDLE hCall, uint32_t cParms, VBOXHGCMSVCPARM paParms[]);225 222 226 223 int shClSvcClientInit(PSHCLCLIENT pClient, uint32_t uClientID); -
TabularUnified trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-transfers.cpp ¶
r82479 r82526 752 752 case VBOX_SHCL_GUEST_FN_REPLY: 753 753 RT_FALL_THROUGH(); 754 case VBOX_SHCL_GUEST_FN_ CANCEL:754 case VBOX_SHCL_GUEST_FN_MSG_CANCEL: 755 755 RT_FALL_THROUGH(); 756 756 case VBOX_SHCL_GUEST_FN_ERROR: -
TabularUnified trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-win.cpp ¶
r82513 r82526 189 189 { 190 190 PSHCLEVENTPAYLOAD pPayload; 191 rc = ShClEventWait(&pCtx->pClient->Event s, uEvent, 30 * 1000, &pPayload);191 rc = ShClEventWait(&pCtx->pClient->EventSrc, uEvent, 30 * 1000, &pPayload); 192 192 if (RT_SUCCESS(rc)) 193 193 { … … 196 196 197 197 /* Detach the payload, as the caller then will own the data. */ 198 ShClEventPayloadDetach(&pCtx->pClient->Event s, uEvent);198 ShClEventPayloadDetach(&pCtx->pClient->EventSrc, uEvent); 199 199 /** 200 200 * @todo r=bird: The payload has already been detached, … … 204 204 } 205 205 206 ShClEventUnregister(&pCtx->pClient->Event s, uEvent);206 ShClEventUnregister(&pCtx->pClient->EventSrc, uEvent); 207 207 } 208 208 -
TabularUnified trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11.cpp ¶
r82480 r82526 194 194 if (pReq) 195 195 { 196 const SHCLEVENTID uEvent = ShClEventIDGenerate(&pClient->Event s);196 const SHCLEVENTID uEvent = ShClEventIDGenerate(&pClient->EventSrc); 197 197 198 198 pReq->pv = pData->pvData; … … 201 201 pReq->uEvent = uEvent; 202 202 203 rc = ShClEventRegister(&pClient->Event s, uEvent);203 rc = ShClEventRegister(&pClient->EventSrc, uEvent); 204 204 if (RT_SUCCESS(rc)) 205 205 { … … 208 208 { 209 209 PSHCLEVENTPAYLOAD pPayload; 210 rc = ShClEventWait(&pClient->Event s, uEvent, 30 * 1000, &pPayload);210 rc = ShClEventWait(&pClient->EventSrc, uEvent, 30 * 1000, &pPayload); 211 211 if (RT_SUCCESS(rc)) 212 212 { … … 218 218 } 219 219 220 ShClEventUnregister(&pClient->Event s, uEvent);220 ShClEventUnregister(&pClient->EventSrc, uEvent); 221 221 } 222 222 } … … 304 304 } 305 305 306 rc2 = ShClEventSignal(&pCtx->pClient->Event s, pReq->uEvent, pPayload);306 rc2 = ShClEventSignal(&pCtx->pClient->EventSrc, pReq->uEvent, pPayload); 307 307 AssertRC(rc2); 308 308 } … … 356 356 { 357 357 PSHCLEVENTPAYLOAD pPayload; 358 rc = ShClEventWait(&pCtx->pClient->Event s, uEvent, 30 * 1000, &pPayload);358 rc = ShClEventWait(&pCtx->pClient->EventSrc, uEvent, 30 * 1000, &pPayload); 359 359 if (RT_SUCCESS(rc)) 360 360 { … … 363 363 364 364 /* Detach the payload, as the caller then will own the data. */ 365 ShClEventPayloadDetach(&pCtx->pClient->Event s, uEvent);365 ShClEventPayloadDetach(&pCtx->pClient->EventSrc, uEvent); 366 366 } 367 367 368 ShClEventUnregister(&pCtx->pClient->Event s, uEvent);368 ShClEventUnregister(&pCtx->pClient->EventSrc, uEvent); 369 369 } 370 370 } … … 399 399 LogFlowFuncEnter(); 400 400 401 SHCLEVENTID uEvent = ShClEventIDGenerate(&pClient->Event s);402 403 int rc = ShClEventRegister(&pClient->Event s, uEvent);401 SHCLEVENTID uEvent = ShClEventIDGenerate(&pClient->EventSrc); 402 403 int rc = ShClEventRegister(&pClient->EventSrc, uEvent); 404 404 if (RT_SUCCESS(rc)) 405 405 { … … 414 414 /* X supplies the data asynchronously, so we need to wait for data to arrive first. */ 415 415 PSHCLEVENTPAYLOAD pPayload; 416 rc = ShClEventWait(&pClient->Event s, uEvent, 30 * 1000, &pPayload);416 rc = ShClEventWait(&pClient->EventSrc, uEvent, 30 * 1000, &pPayload); 417 417 if (RT_SUCCESS(rc)) 418 418 { … … 423 423 } 424 424 425 ShClEventUnregister(&pClient->Event s, uEvent);425 ShClEventUnregister(&pClient->EventSrc, uEvent); 426 426 } 427 427 -
TabularUnified trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp ¶
r82525 r82526 52 52 * 53 53 * There are currently four messages defined. The first is 54 * VBOX_SHCL_GUEST_FN_MSG_GET / VBOX_SHCL_GUEST_FN_ GET_HOST_MSG_OLD, which waits54 * VBOX_SHCL_GUEST_FN_MSG_GET / VBOX_SHCL_GUEST_FN_MSG_OLD_GET_WAIT, which waits 55 55 * for a message from the host. If a host message is sent while the guest is 56 56 * not waiting, it will be queued until the guest requests it. The host code … … 78 78 * Since VBox 6.1 a newer protocol (v1) has been established to also support 79 79 * file transfers. This protocol uses a (per-client) message queue instead 80 * (see VBOX_SHCL_GUEST_FN_ GET_HOST_MSG_OLDvs. VBOX_SHCL_GUEST_FN_GET_HOST_MSG).80 * (see VBOX_SHCL_GUEST_FN_MSG_OLD_GET_WAIT vs. VBOX_SHCL_GUEST_FN_GET_HOST_MSG). 81 81 * 82 82 * To distinguish the old (legacy) or new(er) protocol, the VBOX_SHCL_GUEST_FN_CONNECT … … 295 295 /** Host feature mask (VBOX_SHCL_HF_0_XXX) for VBOX_SHCL_GUEST_FN_REPORT_FEATURES 296 296 * and VBOX_SHCL_GUEST_FN_QUERY_FEATURES. */ 297 static uint64_t const g_fHostFeatures0 = VBOX_SHCL_HF_0_CONTEXT_ID; 297 static uint64_t const g_fHostFeatures0 = VBOX_SHCL_HF_0_CONTEXT_ID 298 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 299 | VBOX_SHCL_HF_0_TRANSFERS 300 #endif 301 ; 298 302 299 303 … … 449 453 450 454 /** 451 * Sets the VBOX_SHCL_GUEST_FN_ GET_HOST_MSG_OLDreturn parameters.455 * Sets the VBOX_SHCL_GUEST_FN_MSG_OLD_GET_WAIT return parameters. 452 456 * 453 457 * This function does the necessary translation between the legacy protocol (<= VBox 6.0) and the new protocols (>= VBox 6.1), … … 587 591 { 588 592 /* Create the client's own event source. */ 589 rc = ShClEventSourceCreate(&pClient->Event s, 0 /* ID, ignored */);593 rc = ShClEventSourceCreate(&pClient->EventSrc, 0 /* ID, ignored */); 590 594 if (RT_SUCCESS(rc)) 591 595 { 592 LogFlowFunc(("[Client %RU32] Using event source %RU32\n", uClientID, pClient->Event s.uID));596 LogFlowFunc(("[Client %RU32] Using event source %RU32\n", uClientID, pClient->EventSrc.uID)); 593 597 594 598 /* Reset the client state. */ … … 621 625 622 626 /* Make sure to send a quit message to the guest so that it can terminate gracefully. */ 627 RTCritSectEnter(&pClient->CritSect); 623 628 if (pClient->Pending.uType) 624 629 { 625 if (pClient->Pending.cParms >= 2) 626 { 630 if (pClient->Pending.cParms > 1) 627 631 HGCMSvcSetU32(&pClient->Pending.paParms[0], VBOX_SHCL_HOST_MSG_QUIT); 632 if (pClient->Pending.cParms > 2) 628 633 HGCMSvcSetU32(&pClient->Pending.paParms[1], 0); 629 }630 634 g_pHelpers->pfnCallComplete(pClient->Pending.hHandle, VINF_SUCCESS); 631 pClient->Pending.uType = 0; 632 } 633 634 ShClEventSourceDestroy(&pClient->Events); 635 pClient->Pending.uType = 0; 636 pClient->Pending.cParms = 0; 637 pClient->Pending.hHandle = NULL; 638 pClient->Pending.paParms = NULL; 639 } 640 RTCritSectLeave(&pClient->CritSect); 641 642 ShClEventSourceDestroy(&pClient->EventSrc); 635 643 636 644 shClSvcClientStateDestroy(&pClient->State); … … 666 674 667 675 /* Reset event source. */ 668 ShClEventSourceReset(&pClient->Event s);676 ShClEventSourceReset(&pClient->EventSrc); 669 677 670 678 /* Reset pending state. */ … … 772 780 * @param fWait Set if we should wait for a message, clear if to return 773 781 * immediately. 774 */ 775 int shClSvcMsgPeek(PSHCLCLIENT pClient, VBOXHGCMCALLHANDLE hCall, uint32_t cParms, VBOXHGCMSVCPARM paParms[], 776 bool fWait) 782 * 783 * @note Caller takes and leave the client's critical section. 784 */ 785 static int shClSvcClientMsgPeek(PSHCLCLIENT pClient, VBOXHGCMCALLHANDLE hCall, uint32_t cParms, VBOXHGCMSVCPARM paParms[], bool fWait) 777 786 { 778 787 /* … … 851 860 852 861 /** 853 * Implements VBOX_SHCL_GUEST_FN_ GET_HOST_MSG_OLD.862 * Implements VBOX_SHCL_GUEST_FN_MSG_OLD_GET_WAIT. 854 863 * 855 864 * @returns VBox status code. … … 861 870 * @param cParms Number of parameters. 862 871 * @param paParms Array of parameters. 863 */ 864 int shClSvcMsgGetOld(PSHCLCLIENT pClient, VBOXHGCMCALLHANDLE hCall, uint32_t cParms, VBOXHGCMSVCPARM paParms[]) 872 * 873 * @note Caller takes and leave the client's critical section. 874 */ 875 static int shClSvcClientMsgOldGet(PSHCLCLIENT pClient, VBOXHGCMCALLHANDLE hCall, uint32_t cParms, VBOXHGCMSVCPARM paParms[]) 865 876 { 866 877 int rc; … … 910 921 pClient->Pending.cParms = cParms; 911 922 pClient->Pending.paParms = paParms; 912 pClient->Pending.uType = VBOX_SHCL_GUEST_FN_ GET_HOST_MSG_OLD;923 pClient->Pending.uType = VBOX_SHCL_GUEST_FN_MSG_OLD_GET_WAIT; 913 924 914 925 rc = VINF_HGCM_ASYNC_EXECUTE; /* The caller must not complete it. */ … … 939 950 * @param cParms Number of parameters. 940 951 * @param paParms Array of parameters. 941 */ 942 int shClSvcMsgGet(PSHCLCLIENT pClient, VBOXHGCMCALLHANDLE hCall, uint32_t cParms, VBOXHGCMSVCPARM paParms[]) 952 * 953 * @note Called from within pClient->CritSect. 954 */ 955 static int shClSvcClientMsgGet(PSHCLCLIENT pClient, VBOXHGCMCALLHANDLE hCall, uint32_t cParms, VBOXHGCMSVCPARM paParms[]) 943 956 { 944 957 /* … … 1048 1061 1049 1062 /** 1063 * Implements VBOX_SHCL_GUEST_FN_MSG_GET. 1064 * 1065 * @returns VBox status code. 1066 * @retval VINF_SUCCESS if message retrieved and removed from the pending queue. 1067 * @retval VERR_TRY_AGAIN if no message pending. 1068 * @retval VERR_MISMATCH if the incoming message ID does not match the pending. 1069 * @retval VINF_HGCM_ASYNC_EXECUTE if message was completed already. 1070 * 1071 * @param pClient The client state. 1072 * @param cParms Number of parameters. 1073 * 1074 * @note Called from within pClient->CritSect. 1075 */ 1076 static int shClSvcClientMsgCancel(PSHCLCLIENT pClient, uint32_t cParms) 1077 { 1078 /* 1079 * Validate the request. 1080 */ 1081 ASSERT_GUEST_MSG_RETURN(cParms == 0, ("cParms=%u!\n", cParms), VERR_WRONG_PARAMETER_COUNT); 1082 1083 /* 1084 * Execute. 1085 */ 1086 if (pClient->Pending.uType != 0) 1087 { 1088 LogFlowFunc(("[Client %RU32] Cancelling waiting thread, isPending=%d, pendingNumParms=%RU32, m_idSession=%x\n", 1089 pClient->State.uClientID, pClient->Pending.uType, pClient->Pending.cParms, pClient->State.uSessionID)); 1090 1091 /* 1092 * The PEEK call is simple: At least two parameters, all set to zero before sleeping. 1093 */ 1094 int rcComplete; 1095 if (pClient->Pending.uType == VBOX_SHCL_GUEST_FN_MSG_PEEK_WAIT) 1096 { 1097 Assert(pClient->Pending.cParms >= 2); 1098 HGCMSvcSetU32(&pClient->Pending.paParms[0], VBOX_SHCL_HOST_MSG_CANCELED); 1099 rcComplete = VINF_TRY_AGAIN; 1100 } 1101 /* 1102 * The MSG_OLD call is complicated, though we're 1103 * generally here to wake up someone who is peeking and have two parameters. 1104 * If there aren't two parameters, fail the call. 1105 */ 1106 else 1107 { 1108 Assert(pClient->Pending.uType == VBOX_SHCL_GUEST_FN_MSG_OLD_GET_WAIT); 1109 if (pClient->Pending.cParms > 0) 1110 HGCMSvcSetU32(&pClient->Pending.paParms[0], VBOX_SHCL_HOST_MSG_CANCELED); 1111 if (pClient->Pending.cParms > 1) 1112 HGCMSvcSetU32(&pClient->Pending.paParms[1], 0); 1113 rcComplete = pClient->Pending.cParms == 2 ? VINF_SUCCESS : VERR_TRY_AGAIN; 1114 } 1115 1116 g_pHelpers->pfnCallComplete(pClient->Pending.hHandle, rcComplete); 1117 1118 pClient->Pending.hHandle = NULL; 1119 pClient->Pending.paParms = NULL; 1120 pClient->Pending.cParms = 0; 1121 pClient->Pending.uType = 0; 1122 return VINF_SUCCESS; 1123 } 1124 return VWRN_NOT_FOUND; 1125 } 1126 1127 1128 /** 1050 1129 * Wakes up a pending client (i.e. waiting for new messages). 1051 1130 * … … 1081 1160 fDonePending = true; 1082 1161 } 1083 else if (pClient->Pending.uType == VBOX_SHCL_GUEST_FN_ GET_HOST_MSG_OLD) /* Legacy, Guest Additions < 6.1. */1162 else if (pClient->Pending.uType == VBOX_SHCL_GUEST_FN_MSG_OLD_GET_WAIT) /* Legacy, Guest Additions < 6.1. */ 1084 1163 { 1085 1164 bool fRemove; … … 1132 1211 * @param puEvent Event ID for waiting for new data. Optional. 1133 1212 */ 1134 int ShClSvcDataReadRequest(PSHCLCLIENT pClient, PSHCLDATAREQ pDataReq, 1135 PSHCLEVENTID puEvent) 1213 int ShClSvcDataReadRequest(PSHCLCLIENT pClient, PSHCLDATAREQ pDataReq, PSHCLEVENTID puEvent) 1136 1214 { 1137 1215 AssertPtrReturn(pClient, VERR_INVALID_POINTER); … … 1147 1225 if (pMsgReadData) 1148 1226 { 1149 const SHCLEVENTID uEvent = ShClEventIDGenerate(&pClient->Event s);1227 const SHCLEVENTID uEvent = ShClEventIDGenerate(&pClient->EventSrc); 1150 1228 1151 1229 LogFlowFunc(("uFmt=0x%x\n", pDataReq->uFmt)); 1152 1230 1153 1231 HGCMSvcSetU64(&pMsgReadData->paParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, 1154 pClient->Event s.uID, uEvent));1232 pClient->EventSrc.uID, uEvent)); 1155 1233 HGCMSvcSetU32(&pMsgReadData->paParms[1], 0 /* fFlags */); 1156 1234 HGCMSvcSetU32(&pMsgReadData->paParms[2], pDataReq->uFmt); … … 1160 1238 if (RT_SUCCESS(rc)) 1161 1239 { 1162 rc = ShClEventRegister(&pClient->Event s, uEvent);1240 rc = ShClEventRegister(&pClient->EventSrc, uEvent); 1163 1241 if (RT_SUCCESS(rc)) 1164 1242 { … … 1170 1248 } 1171 1249 else 1172 ShClEventUnregister(&pClient->Event s, uEvent);1250 ShClEventUnregister(&pClient->EventSrc, uEvent); 1173 1251 } 1174 1252 } … … 1195 1273 /* Older Guest Additions (<= VBox 6.0) did not have any context ID handling, so we ASSUME that the last event registered 1196 1274 * is the one we want to handle (as this all was a synchronous protocol anyway). */ 1197 uEvent = ShClEventGetLast(&pClient->Event s);1275 uEvent = ShClEventGetLast(&pClient->EventSrc); 1198 1276 } 1199 1277 else … … 1208 1286 if (RT_SUCCESS(rc)) 1209 1287 { 1210 rc = ShClEventSignal(&pClient->Event s, uEvent, pPayload);1288 rc = ShClEventSignal(&pClient->EventSrc, uEvent, pPayload); 1211 1289 if (RT_FAILURE(rc)) 1212 1290 ShClPayloadFree(pPayload); … … 1253 1331 if (pMsg) 1254 1332 { 1255 const SHCLEVENTID uEvent = ShClEventIDGenerate(&pClient->Event s);1333 const SHCLEVENTID uEvent = ShClEventIDGenerate(&pClient->EventSrc); 1256 1334 1257 1335 HGCMSvcSetU64(&pMsg->paParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, 1258 pClient->Event s.uID, uEvent));1336 pClient->EventSrc.uID, uEvent)); 1259 1337 HGCMSvcSetU32(&pMsg->paParms[1], fFormats); 1260 1338 HGCMSvcSetU32(&pMsg->paParms[2], fFlags); … … 1295 1373 * Handles the VBOX_SHCL_GUEST_FN_REPORT_FORMATS message from the guest. 1296 1374 */ 1297 static int shClSvc GuestReportFormats(PSHCLCLIENT pClient, uint32_t cParms, VBOXHGCMSVCPARM paParms[])1375 static int shClSvcClientReportFormats(PSHCLCLIENT pClient, uint32_t cParms, VBOXHGCMSVCPARM paParms[]) 1298 1376 { 1299 1377 /* … … 1390 1468 * Handles the VBOX_SHCL_GUEST_FN_DATA_READ message from the guest. 1391 1469 */ 1392 static int shClSvc GetDataRead(PSHCLCLIENT pClient, uint32_t cParms, VBOXHGCMSVCPARM paParms[])1470 static int shClSvcClientReadData(PSHCLCLIENT pClient, uint32_t cParms, VBOXHGCMSVCPARM paParms[]) 1393 1471 { 1394 1472 LogFlowFuncEnter(); … … 1552 1630 } 1553 1631 1554 int shClSvc GetDataWrite(PSHCLCLIENT pClient, uint32_t cParms, VBOXHGCMSVCPARM paParms[])1632 int shClSvcClientWriteData(PSHCLCLIENT pClient, uint32_t cParms, VBOXHGCMSVCPARM paParms[]) 1555 1633 { 1556 1634 LogFlowFuncEnter(); … … 1591 1669 ASSERT_GUEST_RETURN(paParms[iParm].type == VBOX_HGCM_SVC_PARM_64BIT, VERR_WRONG_PARAMETER_TYPE); 1592 1670 cmdCtx.uContextID = paParms[iParm].u.uint64; 1593 uint64_t const idCtxExpected = VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, pClient->Event s.uID,1671 uint64_t const idCtxExpected = VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, pClient->EventSrc.uID, 1594 1672 VBOX_SHCL_CONTEXTID_GET_EVENT(cmdCtx.uContextID)); 1595 1673 ASSERT_GUEST_MSG_RETURN(cmdCtx.uContextID == idCtxExpected, … … 1676 1754 * @param pRc Where to store the received error code. 1677 1755 */ 1678 static int shClSvc GetError(uint32_t cParms, VBOXHGCMSVCPARM paParms[], int *pRc)1756 static int shClSvcClientError(uint32_t cParms, VBOXHGCMSVCPARM paParms[], int *pRc) 1679 1757 { 1680 1758 AssertPtrReturn(paParms, VERR_INVALID_PARAMETER); … … 1823 1901 { 1824 1902 RT_NOREF(u32ClientID, pvClient, tsArrival); 1825 1826 int rc = VINF_SUCCESS;1827 1828 1903 PSHCLCLIENT pClient = (PSHCLCLIENT)pvClient; 1829 1904 AssertPtr(pClient); 1830 1905 1906 #ifdef LOG_ENABLED 1831 1907 LogFunc(("u32ClientID=%RU32, fn=%RU32 (%s), cParms=%RU32, paParms=%p\n", 1832 1908 u32ClientID, u32Function, ShClGuestMsgToStr(u32Function), cParms, paParms)); 1833 1834 #ifdef LOG_ENABLED1835 1909 for (uint32_t i = 0; i < cParms; i++) 1836 1910 { … … 1838 1912 LogFunc((" paParms[%d]: type %RU32 - value %RU32\n", i, paParms[i].type, paParms[i].u.uint32)); 1839 1913 } 1840 #endif1841 1842 1914 LogFunc(("Client state: fFlags=0x%x, fGuestFeatures0=0x%x, fGuestFeatures1=0x%x\n", 1843 1915 pClient->State.fFlags, pClient->State.fGuestFeatures0, pClient->State.fGuestFeatures1)); 1844 1916 #endif 1917 1918 int rc; 1845 1919 switch (u32Function) 1846 1920 { 1847 case VBOX_SHCL_GUEST_FN_GET_HOST_MSG_OLD: 1848 rc = shClSvcMsgGetOld(pClient, callHandle, cParms, paParms); 1921 case VBOX_SHCL_GUEST_FN_MSG_OLD_GET_WAIT: 1922 RTCritSectEnter(&pClient->CritSect); 1923 rc = shClSvcClientMsgOldGet(pClient, callHandle, cParms, paParms); 1924 RTCritSectLeave(&pClient->CritSect); 1849 1925 break; 1850 1926 … … 1863 1939 1864 1940 case VBOX_SHCL_GUEST_FN_MSG_PEEK_NOWAIT: 1865 rc = shClSvcMsgPeek(pClient, callHandle, cParms, paParms, false /*fWait*/); 1941 RTCritSectEnter(&pClient->CritSect); 1942 rc = shClSvcClientMsgPeek(pClient, callHandle, cParms, paParms, false /*fWait*/); 1943 RTCritSectLeave(&pClient->CritSect); 1866 1944 break; 1867 1945 1868 1946 case VBOX_SHCL_GUEST_FN_MSG_PEEK_WAIT: 1869 rc = shClSvcMsgPeek(pClient, callHandle, cParms, paParms, true /*fWait*/); 1947 RTCritSectEnter(&pClient->CritSect); 1948 rc = shClSvcClientMsgPeek(pClient, callHandle, cParms, paParms, true /*fWait*/); 1949 RTCritSectLeave(&pClient->CritSect); 1870 1950 break; 1871 1951 1872 1952 case VBOX_SHCL_GUEST_FN_MSG_GET: 1873 rc = shClSvcMsgGet(pClient, callHandle, cParms, paParms); 1953 RTCritSectEnter(&pClient->CritSect); 1954 rc = shClSvcClientMsgGet(pClient, callHandle, cParms, paParms); 1955 RTCritSectLeave(&pClient->CritSect); 1874 1956 break; 1875 1957 1958 case VBOX_SHCL_GUEST_FN_MSG_CANCEL: 1959 RTCritSectEnter(&pClient->CritSect); 1960 rc = shClSvcClientMsgCancel(pClient, cParms); 1961 RTCritSectLeave(&pClient->CritSect); 1962 break; 1963 1876 1964 case VBOX_SHCL_GUEST_FN_REPORT_FORMATS: 1877 rc = shClSvc GuestReportFormats(pClient, cParms, paParms);1965 rc = shClSvcClientReportFormats(pClient, cParms, paParms); 1878 1966 break; 1879 1967 1880 1968 case VBOX_SHCL_GUEST_FN_DATA_READ: 1881 rc = shClSvc GetDataRead(pClient, cParms, paParms);1969 rc = shClSvcClientReadData(pClient, cParms, paParms); 1882 1970 break; 1883 1971 1884 1972 case VBOX_SHCL_GUEST_FN_DATA_WRITE: 1885 rc = shClSvc GetDataWrite(pClient, cParms, paParms);1973 rc = shClSvcClientWriteData(pClient, cParms, paParms); 1886 1974 break; 1887 1975 1888 case VBOX_SHCL_GUEST_FN_CANCEL:1889 {1890 LogRel2(("Shared Clipboard: Operation canceled by guest side\n"));1891 1892 /** @todo r=bird: What on earth is this? The only user of this message1893 * (VBOX_SHCL_GUEST_FN_CANCEL) is VbglR3ClipboardMsgPeekWait(), where it was1894 * copied over from guest control. What happens here is _nothing_ like what it1895 * expects to happen. See GstCtrlService::clientMsgCancel for a reference.1896 */1897 1898 /* Reset client state and start over. */1899 shclSvcClientStateReset(&pClient->State);1900 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS1901 shClSvcClientTransfersReset(pClient);1902 #endif1903 /** @todo Do we need to do anything else here? */1904 break;1905 }1906 1907 1976 case VBOX_SHCL_GUEST_FN_ERROR: 1908 1977 { 1909 1978 int rcGuest; 1910 rc = shClSvc GetError(cParms,paParms, &rcGuest);1979 rc = shClSvcClientError(cParms,paParms, &rcGuest); 1911 1980 if (RT_SUCCESS(rc)) 1912 1981 { … … 1925 1994 { 1926 1995 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 1927 if (u32Function <= VBOX_SHCL_GUEST_FN_LAST) 1996 if ( u32Function <= VBOX_SHCL_GUEST_FN_LAST 1997 && (pClient->State.fGuestFeatures0 & VBOX_SHCL_GF_0_CONTEXT_ID) ) 1928 1998 { 1929 1999 if (g_fTransferMode & VBOX_SHCL_TRANSFER_MODE_ENABLED) -
TabularUnified trunk/src/VBox/HostServices/SharedClipboard/testcase/tstClipboardServiceHost.cpp ¶
r82447 r82526 139 139 } 140 140 141 /* Does testing of VBOX_SHCL_GUEST_FN_ GET_HOST_MSG_OLD, needed for providing compatibility to older Guest Additions clients. */141 /* Does testing of VBOX_SHCL_GUEST_FN_MSG_OLD_GET_WAIT, needed for providing compatibility to older Guest Additions clients. */ 142 142 static void testGetHostMsgOld(void) 143 143 { … … 147 147 int rc; 148 148 149 RTTestISub("Setting up VBOX_SHCL_GUEST_FN_ GET_HOST_MSG_OLDtest");149 RTTestISub("Setting up VBOX_SHCL_GUEST_FN_MSG_OLD_GET_WAIT test"); 150 150 rc = setupTable(&table); 151 151 RTTESTI_CHECK_MSG_RETV(RT_SUCCESS(rc), ("rc=%Rrc\n", rc)); … … 163 163 call.rc = VERR_TRY_AGAIN; 164 164 table.pfnConnect(NULL, 1 /* clientId */, &g_Client, 0, 0); 165 table.pfnCall(NULL, &call, 1 /* clientId */, &g_Client, VBOX_SHCL_GUEST_FN_ GET_HOST_MSG_OLD, 2, parms, 0);165 table.pfnCall(NULL, &call, 1 /* clientId */, &g_Client, VBOX_SHCL_GUEST_FN_MSG_OLD_GET_WAIT, 2, parms, 0); 166 166 RTTESTI_CHECK_RC(call.rc, VERR_TRY_AGAIN); /* This should get updated only when the guest call completes. */ 167 167 testMsgAddReadData(&g_Client, VBOX_SHCL_FMT_UNICODETEXT); … … 170 170 RTTESTI_CHECK_RC_OK(call.rc); 171 171 call.rc = VERR_TRY_AGAIN; 172 table.pfnCall(NULL, &call, 1 /* clientId */, &g_Client, VBOX_SHCL_GUEST_FN_ GET_HOST_MSG_OLD, 2, parms, 0);172 table.pfnCall(NULL, &call, 1 /* clientId */, &g_Client, VBOX_SHCL_GUEST_FN_MSG_OLD_GET_WAIT, 2, parms, 0); 173 173 RTTESTI_CHECK_RC(call.rc, VERR_TRY_AGAIN); /* This call should not complete yet. */ 174 174 … … 179 179 HGCMSvcSetU32(&parms[1], 0); 180 180 call.rc = VERR_TRY_AGAIN; 181 table.pfnCall(NULL, &call, 1 /* clientId */, &g_Client, VBOX_SHCL_GUEST_FN_ GET_HOST_MSG_OLD, 2, parms, 0);181 table.pfnCall(NULL, &call, 1 /* clientId */, &g_Client, VBOX_SHCL_GUEST_FN_MSG_OLD_GET_WAIT, 2, parms, 0); 182 182 RTTESTI_CHECK(parms[0].u.uint32 == VBOX_SHCL_HOST_MSG_READ_DATA); 183 183 RTTESTI_CHECK(parms[1].u.uint32 == VBOX_SHCL_FMT_HTML); 184 184 RTTESTI_CHECK_RC_OK(call.rc); 185 185 call.rc = VERR_TRY_AGAIN; 186 table.pfnCall(NULL, &call, 1 /* clientId */, &g_Client, VBOX_SHCL_GUEST_FN_ GET_HOST_MSG_OLD, 2, parms, 0);186 table.pfnCall(NULL, &call, 1 /* clientId */, &g_Client, VBOX_SHCL_GUEST_FN_MSG_OLD_GET_WAIT, 2, parms, 0); 187 187 RTTESTI_CHECK_RC(call.rc, VERR_TRY_AGAIN); /* This call should not complete yet. */ 188 188 … … 192 192 HGCMSvcSetU32(&parms[1], 0); 193 193 call.rc = VERR_TRY_AGAIN; 194 table.pfnCall(NULL, &call, 1 /* clientId */, &g_Client, VBOX_SHCL_GUEST_FN_ GET_HOST_MSG_OLD, 2, parms, 0);194 table.pfnCall(NULL, &call, 1 /* clientId */, &g_Client, VBOX_SHCL_GUEST_FN_MSG_OLD_GET_WAIT, 2, parms, 0); 195 195 RTTESTI_CHECK_RC(call.rc, VERR_TRY_AGAIN); /* This should get updated only when the guest call completes. */ 196 196 testMsgAddReadData(&g_Client, VBOX_SHCL_FMT_UNICODETEXT | VBOX_SHCL_FMT_HTML); … … 199 199 RTTESTI_CHECK_RC_OK(call.rc); 200 200 call.rc = VERR_TRY_AGAIN; 201 table.pfnCall(NULL, &call, 1 /* clientId */, &g_Client, VBOX_SHCL_GUEST_FN_ GET_HOST_MSG_OLD, 2, parms, 0);201 table.pfnCall(NULL, &call, 1 /* clientId */, &g_Client, VBOX_SHCL_GUEST_FN_MSG_OLD_GET_WAIT, 2, parms, 0); 202 202 RTTESTI_CHECK(parms[0].u.uint32 == VBOX_SHCL_HOST_MSG_READ_DATA); 203 203 RTTESTI_CHECK(parms[1].u.uint32 == VBOX_SHCL_FMT_HTML); 204 204 RTTESTI_CHECK_RC_OK(call.rc); 205 205 call.rc = VERR_TRY_AGAIN; 206 table.pfnCall(NULL, &call, 1 /* clientId */, &g_Client, VBOX_SHCL_GUEST_FN_ GET_HOST_MSG_OLD, 2, parms, 0);206 table.pfnCall(NULL, &call, 1 /* clientId */, &g_Client, VBOX_SHCL_GUEST_FN_MSG_OLD_GET_WAIT, 2, parms, 0); 207 207 RTTESTI_CHECK_RC(call.rc, VERR_TRY_AGAIN); /* This call should not complete yet. */ 208 208 … … 213 213 HGCMSvcSetU32(&parms[1], 0); 214 214 call.rc = VERR_TRY_AGAIN; 215 table.pfnCall(NULL, &call, 1 /* clientId */, &g_Client, VBOX_SHCL_GUEST_FN_ GET_HOST_MSG_OLD, 2, parms, 0);215 table.pfnCall(NULL, &call, 1 /* clientId */, &g_Client, VBOX_SHCL_GUEST_FN_MSG_OLD_GET_WAIT, 2, parms, 0); 216 216 RTTESTI_CHECK(parms[0].u.uint32 == VBOX_SHCL_HOST_MSG_READ_DATA); 217 217 RTTESTI_CHECK(parms[1].u.uint32 == VBOX_SHCL_FMT_UNICODETEXT); 218 218 RTTESTI_CHECK_RC_OK(call.rc); 219 219 call.rc = VERR_TRY_AGAIN; 220 table.pfnCall(NULL, &call, 1 /* clientId */, &g_Client, VBOX_SHCL_GUEST_FN_ GET_HOST_MSG_OLD, 2, parms, 0);220 table.pfnCall(NULL, &call, 1 /* clientId */, &g_Client, VBOX_SHCL_GUEST_FN_MSG_OLD_GET_WAIT, 2, parms, 0); 221 221 RTTESTI_CHECK(parms[0].u.uint32 == VBOX_SHCL_HOST_MSG_READ_DATA); 222 222 RTTESTI_CHECK(parms[1].u.uint32 == VBOX_SHCL_FMT_HTML); 223 223 RTTESTI_CHECK_RC_OK(call.rc); 224 224 call.rc = VERR_TRY_AGAIN; 225 table.pfnCall(NULL, &call, 1 /* clientId */, &g_Client, VBOX_SHCL_GUEST_FN_ GET_HOST_MSG_OLD, 2, parms, 0);225 table.pfnCall(NULL, &call, 1 /* clientId */, &g_Client, VBOX_SHCL_GUEST_FN_MSG_OLD_GET_WAIT, 2, parms, 0); 226 226 RTTESTI_CHECK_RC(call.rc, VERR_TRY_AGAIN); /* This call should not complete yet. */ 227 227 table.pfnDisconnect(NULL, 1 /* clientId */, &g_Client);
Note:
See TracChangeset
for help on using the changeset viewer.