Changeset 81559 in vbox
- Timestamp:
- Oct 28, 2019 10:09:35 AM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 134298
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/HostServices/VBoxClipboardSvc.h
r81451 r81559 32 32 * Protocol changelog: 33 33 * 34 * Protocol v0 (VBox < 6.1, deprecated):34 * VBox < 6.1, deprecated: 35 35 * | First, initial implementation since feature was developed. 36 36 * Has no protocol handshake / versioning support, the client's … … 39 39 * not have the ability to control / handle parallel transfers. 40 40 * 41 * Protocol v1 (VBox >= 6.1):42 * + Adds protocol versioningand context IDs for parallel,41 * VBox >= 6.1: 42 * + Adds host/guest feature flags and context IDs for parallel, 43 43 * asynchronous transfers. 44 * | Keeps backwards-compatbility with protocol v0 clients by translating45 * messages to protocol v0, to not break compatibility with older46 * Guest Additions (VBox < 6.1).44 * | Keeps backwards-compatbility with by translating messages to 45 * the older protocol (< 6.1), to not break compatibility with older 46 * Guest Additions. 47 47 */ 48 48 … … 65 65 * We're using it as a version field with the high bit set. 66 66 */ 67 /** Older saved states (VBox < 6.1). Includes protocol v0state. */67 /** Older saved states (VBox < 6.1). Includes legacy protocol state. */ 68 68 #define VBOX_SHCL_SSM_VER_0 UINT32_C(0x80000002) 69 /** Protocol v1 is being used. */69 /** New saved state (VBox >= 6.1). */ 70 70 #define VBOX_SHCL_SSM_VER_1 UINT32_C(0x80000003) 71 71 … … 98 98 #define VBOX_SHCL_HOST_FN_SET_MODE 1 99 99 /** Sets the current Shared Clipboard (file) transfers mode. 100 * Operates on the VBOX_SHCL_TRANSFERS_ defines. */ 100 * Operates on the VBOX_SHCL_TRANSFERS_ defines. 101 * 102 * @since 6.1 103 */ 101 104 #define VBOX_SHCL_HOST_FN_SET_TRANSFER_MODE 2 102 105 /** Run headless on the host, i.e. do not touch the host clipboard. */ 103 106 #define VBOX_SHCL_HOST_FN_SET_HEADLESS 3 104 /** Reports cancellation of the current operation to the guest. */ 107 /** Reports cancellation of the current operation to the guest. 108 * @since 6.1 109 */ 105 110 #define VBOX_SHCL_HOST_FN_CANCEL 4 106 /** Reports an error to the guest. */ 111 /** Reports an error to the guest. 112 * @since 6.1 113 */ 107 114 #define VBOX_SHCL_HOST_FN_ERROR 5 108 /** Reports that a new clipboard area has been registered. */ 115 /** Reports that a new clipboard area has been registered. 116 * @since 6.1 117 */ 109 118 #define VBOX_SHCL_HOST_FN_AREA_REGISTER 6 110 /** Reports that a clipboard area has been unregistered. */ 119 /** Reports that a clipboard area has been unregistered. 120 * @since 6.1 121 */ 111 122 #define VBOX_SHCL_HOST_FN_AREA_UNREGISTER 7 112 /** Reports that a client (host / guest) has attached to a clipboard area. */ 123 /** Reports that a client (host / guest) has attached to a clipboard area. 124 * @since 6.1 125 */ 113 126 #define VBOX_SHCL_HOST_FN_AREA_ATTACH 8 114 /** Reports that a client (host / guest) has detached from a clipboard area. */ 127 /** Reports that a client (host / guest) has detached from a clipboard area. 128 * @since 6.1 129 */ 115 130 #define VBOX_SHCL_HOST_FN_AREA_DETACH 9 116 131 … … 126 141 #define VBOX_SHCL_HOST_MSG_FORMATS_REPORT 3 127 142 128 /** Sends a transfer status to the guest side. */ 143 /** Sends a transfer status to the guest side. 144 * 145 * @retval VINF_SUCCESS on success. 146 * @retval VERR_INVALID_CLIENT_ID 147 * @retval VERR_WRONG_PARAMETER_COUNT 148 * @retval VERR_WRONG_PARAMETER_TYPE 149 * @since 6.1 150 */ 129 151 #define VBOX_SHCL_HOST_MSG_TRANSFER_STATUS 50 130 /** Reads the root list header from the guest. */ 152 /** Reads the root list header from the guest. 153 * 154 * @retval VINF_SUCCESS on success. 155 * @retval VERR_INVALID_CLIENT_ID 156 * @retval VERR_WRONG_PARAMETER_COUNT 157 * @retval VERR_WRONG_PARAMETER_TYPE 158 * @since 6.1 159 */ 131 160 #define VBOX_SHCL_HOST_MSG_TRANSFER_ROOT_LIST_HDR_READ 51 132 /** Writes the root list header to the guest. */ 161 /** Writes the root list header to the guest. 162 * 163 * @retval VINF_SUCCESS on success. 164 * @retval VERR_INVALID_CLIENT_ID 165 * @retval VERR_WRONG_PARAMETER_COUNT 166 * @retval VERR_WRONG_PARAMETER_TYPE 167 * @since 6.1 168 */ 133 169 #define VBOX_SHCL_HOST_MSG_TRANSFER_ROOT_LIST_HDR_WRITE 52 134 /** Reads a root list entry from the guest. */ 170 /** Reads a root list entry from the guest. 171 * 172 * @retval VINF_SUCCESS on success. 173 * @retval VERR_INVALID_CLIENT_ID 174 * @retval VERR_WRONG_PARAMETER_COUNT 175 * @retval VERR_WRONG_PARAMETER_TYPE 176 * @since 6.1 177 */ 135 178 #define VBOX_SHCL_HOST_MSG_TRANSFER_ROOT_LIST_ENTRY_READ 53 136 /** Writes a root list entry to the guest. */ 179 /** Writes a root list entry to the guest. 180 * 181 * @retval VINF_SUCCESS on success. 182 * @retval VERR_INVALID_CLIENT_ID 183 * @retval VERR_WRONG_PARAMETER_COUNT 184 * @retval VERR_WRONG_PARAMETER_TYPE 185 * @since 6.1 186 */ 137 187 #define VBOX_SHCL_HOST_MSG_TRANSFER_ROOT_LIST_ENTRY_WRITE 54 138 /** Open a transfer list on the guest side. */ 188 /** Open a transfer list on the guest side. 189 * 190 * @retval VINF_SUCCESS on success. 191 * @retval VERR_INVALID_CLIENT_ID 192 * @retval VERR_WRONG_PARAMETER_COUNT 193 * @retval VERR_WRONG_PARAMETER_TYPE 194 * @since 6.1 195 */ 139 196 #define VBOX_SHCL_HOST_MSG_TRANSFER_LIST_OPEN 55 140 /** Closes a formerly opened transfer list on the guest side. */ 197 /** Closes a formerly opened transfer list on the guest side. 198 * 199 * @retval VINF_SUCCESS on success. 200 * @retval VERR_INVALID_CLIENT_ID 201 * @retval VERR_WRONG_PARAMETER_COUNT 202 * @retval VERR_WRONG_PARAMETER_TYPE 203 * @since 6.1 204 */ 141 205 #define VBOX_SHCL_HOST_MSG_TRANSFER_LIST_CLOSE 56 142 /** Reads a list header from the guest. */ 206 /** Reads a list header from the guest. 207 * 208 * @retval VINF_SUCCESS on success. 209 * @retval VERR_INVALID_CLIENT_ID 210 * @retval VERR_WRONG_PARAMETER_COUNT 211 * @retval VERR_WRONG_PARAMETER_TYPE 212 * @since 6.1 213 */ 143 214 #define VBOX_SHCL_HOST_MSG_TRANSFER_LIST_HDR_READ 57 144 /** Writes a list header to the guest. */ 215 /** Writes a list header to the guest. 216 * 217 * @retval VINF_SUCCESS on success. 218 * @retval VERR_INVALID_CLIENT_ID 219 * @retval VERR_WRONG_PARAMETER_COUNT 220 * @retval VERR_WRONG_PARAMETER_TYPE 221 * @since 6.1 222 */ 145 223 #define VBOX_SHCL_HOST_MSG_TRANSFER_LIST_HDR_WRITE 58 146 /** Reads a list entry from the guest. */ 224 /** Reads a list entry from the guest. 225 * 226 * @retval VINF_SUCCESS on success. 227 * @retval VERR_INVALID_CLIENT_ID 228 * @retval VERR_WRONG_PARAMETER_COUNT 229 * @retval VERR_WRONG_PARAMETER_TYPE 230 * @since 6.1 231 */ 147 232 #define VBOX_SHCL_HOST_MSG_TRANSFER_LIST_ENTRY_READ 59 148 /** Writes a list entry to the guest. */ 233 /** Writes a list entry to the guest. 234 * 235 * @retval VINF_SUCCESS on success. 236 * @retval VERR_INVALID_CLIENT_ID 237 * @retval VERR_WRONG_PARAMETER_COUNT 238 * @retval VERR_WRONG_PARAMETER_TYPE 239 * @since 6.1 240 */ 149 241 #define VBOX_SHCL_HOST_MSG_TRANSFER_LIST_ENTRY_WRITE 60 150 /** Open a transfer object on the guest side. */ 242 /** Open a transfer object on the guest side. 243 * 244 * @retval VINF_SUCCESS on success. 245 * @retval VERR_INVALID_CLIENT_ID 246 * @retval VERR_WRONG_PARAMETER_COUNT 247 * @retval VERR_WRONG_PARAMETER_TYPE 248 * @since 6.1 249 */ 151 250 #define VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_OPEN 61 152 /** Closes a formerly opened transfer object on the guest side. */ 251 /** Closes a formerly opened transfer object on the guest side. 252 * 253 * @retval VINF_SUCCESS on success. 254 * @retval VERR_INVALID_CLIENT_ID 255 * @retval VERR_WRONG_PARAMETER_COUNT 256 * @retval VERR_WRONG_PARAMETER_TYPE 257 * @since 6.1 258 */ 153 259 #define VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_CLOSE 62 154 /** Reads from an object on the guest side. */ 260 /** Reads from an object on the guest side. 261 * 262 * @retval VINF_SUCCESS on success. 263 * @retval VERR_INVALID_CLIENT_ID 264 * @retval VERR_WRONG_PARAMETER_COUNT 265 * @retval VERR_WRONG_PARAMETER_TYPE 266 * @since 6.1 267 */ 155 268 #define VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_READ 63 156 /** Writes to an object on the guest side. */ 269 /** Writes to an object on the guest side. 270 * 271 * @retval VINF_SUCCESS on success. 272 * @retval VERR_INVALID_CLIENT_ID 273 * @retval VERR_WRONG_PARAMETER_COUNT 274 * @retval VERR_WRONG_PARAMETER_TYPE 275 * @since 6.1 276 */ 157 277 #define VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_WRITE 64 158 /** Indicates that the host has canceled a transfer. */ 278 /** Indicates that the host has canceled a transfer. 279 * 280 * @retval VINF_SUCCESS on success. 281 * @retval VERR_INVALID_CLIENT_ID 282 * @retval VERR_WRONG_PARAMETER_COUNT 283 * @retval VERR_WRONG_PARAMETER_TYPE 284 * @since 6.1 285 */ 159 286 #define VBOX_SHCL_HOST_MSG_TRANSFER_CANCEL 65 160 /** Indicates that the an unrecoverable error on the host occurred . */ 287 /** Indicates that the an unrecoverable error on the host occurred. 288 * 289 * @retval VINF_SUCCESS on success. 290 * @retval VERR_INVALID_CLIENT_ID 291 * @retval VERR_WRONG_PARAMETER_COUNT 292 * @retval VERR_WRONG_PARAMETER_TYPE 293 * @since 6.1 294 */ 161 295 #define VBOX_SHCL_HOST_MSG_TRANSFER_ERROR 66 162 296 … … 165 299 */ 166 300 /** Calls the host and waits (blocking) for an host event VBOX_SHCL_HOST_MSG_*. 167 * Note: This is the old message which still is being used for the non-URI Shared Clipboard transfers,168 * to not break compatibility with olderGuest Additions / VBox versions. */301 * Deprecated, do not use anymore. Kept to not break compatibility with older 302 * Guest Additions / VBox versions. */ 169 303 #define VBOX_SHCL_GUEST_FN_GET_HOST_MSG_OLD 1 170 304 /** Sends a list of available formats to the host. … … 180 314 * with the legacy protocol (v0). 181 315 * 182 * New since protocol v1. */ 316 * @retval VINF_SUCCESS on success. 317 * @retval VERR_INVALID_CLIENT_ID 318 * @retval VERR_WRONG_PARAMETER_COUNT 319 * @retval VERR_WRONG_PARAMETER_TYPE 320 * @since 6.1 321 */ 183 322 #define VBOX_SHCL_GUEST_FN_CONNECT 5 184 323 /** Report guest side feature flags and retrieve the host ones. … … 192 331 * 193 332 * @retval VINF_SUCCESS on success. 194 * @retval VERR_ACCESS_DENIED it not master.195 333 * @retval VERR_INVALID_CLIENT_ID 196 334 * @retval VERR_WRONG_PARAMETER_COUNT … … 214 352 #define VBOX_SHCL_GUEST_FN_QUERY_FEATURES 7 215 353 /** Peeks at the next message, returning immediately. 216 * New since protocol v1. */ 354 * 355 * @retval VINF_SUCCESS on success. 356 * @retval VERR_INVALID_CLIENT_ID 357 * @retval VERR_WRONG_PARAMETER_COUNT 358 * @retval VERR_WRONG_PARAMETER_TYPE 359 * @since 6.1 360 */ 217 361 #define VBOX_SHCL_GUEST_FN_MSG_PEEK_NOWAIT 8 218 362 /** Peeks at the next message, waiting for one to arrive. 219 * New since protocol v1. */ 363 * 364 * @retval VINF_SUCCESS on success. 365 * @retval VERR_INVALID_CLIENT_ID 366 * @retval VERR_WRONG_PARAMETER_COUNT 367 * @retval VERR_WRONG_PARAMETER_TYPE 368 * @since 6.1 369 */ 220 370 #define VBOX_SHCL_GUEST_FN_MSG_PEEK_WAIT 9 221 371 /** Gets the next message, returning immediately. 222 * New since protocol v1. */ 372 * 373 * @retval VINF_SUCCESS on success. 374 * @retval VERR_INVALID_CLIENT_ID 375 * @retval VERR_WRONG_PARAMETER_COUNT 376 * @retval VERR_WRONG_PARAMETER_TYPE 377 * @since 6.1 378 */ 223 379 #define VBOX_SHCL_GUEST_FN_MSG_GET 10 224 380 /** Replies to a function from the host. 225 * New since protocol v1. */ 381 * 382 * @retval VINF_SUCCESS on success. 383 * @retval VERR_INVALID_CLIENT_ID 384 * @retval VERR_WRONG_PARAMETER_COUNT 385 * @retval VERR_WRONG_PARAMETER_TYPE 386 * @since 6.1 387 */ 226 388 #define VBOX_SHCL_GUEST_FN_REPLY 11 227 /** Reports the available root entries of a transfer. 228 * New since protocol v1. */ 389 /** Gets the root list header from the host. 390 * 391 * @retval VINF_SUCCESS on success. 392 * @retval VERR_INVALID_CLIENT_ID 393 * @retval VERR_WRONG_PARAMETER_COUNT 394 * @retval VERR_WRONG_PARAMETER_TYPE 395 * @since 6.1 396 */ 229 397 #define VBOX_SHCL_GUEST_FN_ROOT_LIST_HDR_READ 12 230 /** Reports the available root entries of a transfer. 231 * New since protocol v1. */ 398 /** Sends the root list header to the host. 399 * 400 * @retval VINF_SUCCESS on success. 401 * @retval VERR_INVALID_CLIENT_ID 402 * @retval VERR_WRONG_PARAMETER_COUNT 403 * @retval VERR_WRONG_PARAMETER_TYPE 404 * @since 6.1 405 */ 232 406 #define VBOX_SHCL_GUEST_FN_ROOT_LIST_HDR_WRITE 13 233 /** Reports the available root entries of a transfer. 234 * New since protocol v1. */ 407 /** Gets a root list root entry from the host. 408 * 409 * @retval VINF_SUCCESS on success. 410 * @retval VERR_INVALID_CLIENT_ID 411 * @retval VERR_WRONG_PARAMETER_COUNT 412 * @retval VERR_WRONG_PARAMETER_TYPE 413 * @since 6.1 414 */ 235 415 #define VBOX_SHCL_GUEST_FN_ROOT_LIST_ENTRY_READ 14 236 /** Reports the available root entries of a transfer. 237 * New since protocol v1. */ 416 /** Sends a root list root entry to the host. 417 * 418 * @retval VINF_SUCCESS on success. 419 * @retval VERR_INVALID_CLIENT_ID 420 * @retval VERR_WRONG_PARAMETER_COUNT 421 * @retval VERR_WRONG_PARAMETER_TYPE 422 * @since 6.1 423 */ 238 424 #define VBOX_SHCL_GUEST_FN_ROOT_LIST_ENTRY_WRITE 15 239 425 /** Opens / gets a list handle from the host. 240 * New since protocol v1. */ 426 * 427 * @retval VINF_SUCCESS on success. 428 * @retval VERR_INVALID_CLIENT_ID 429 * @retval VERR_WRONG_PARAMETER_COUNT 430 * @retval VERR_WRONG_PARAMETER_TYPE 431 * @since 6.1 432 */ 241 433 #define VBOX_SHCL_GUEST_FN_LIST_OPEN 16 242 434 /** Closes a list handle from the host. 243 * New since protocol v1. */ 435 * 436 * @retval VINF_SUCCESS on success. 437 * @retval VERR_INVALID_CLIENT_ID 438 * @retval VERR_WRONG_PARAMETER_COUNT 439 * @retval VERR_WRONG_PARAMETER_TYPE 440 * @since 6.1 441 */ 244 442 #define VBOX_SHCL_GUEST_FN_LIST_CLOSE 17 245 443 /** Reads a list header from the host. 246 * New since protocol v1. */ 444 * 445 * @retval VINF_SUCCESS on success. 446 * @retval VERR_INVALID_CLIENT_ID 447 * @retval VERR_WRONG_PARAMETER_COUNT 448 * @retval VERR_WRONG_PARAMETER_TYPE 449 * @since 6.1 450 */ 247 451 #define VBOX_SHCL_GUEST_FN_LIST_HDR_READ 18 248 452 /** Writes a list header to the host. 249 * New since protocol v1. */ 453 * 454 * @retval VINF_SUCCESS on success. 455 * @retval VERR_INVALID_CLIENT_ID 456 * @retval VERR_WRONG_PARAMETER_COUNT 457 * @retval VERR_WRONG_PARAMETER_TYPE 458 * @since 6.1 459 */ 250 460 #define VBOX_SHCL_GUEST_FN_LIST_HDR_WRITE 19 251 /** New since protocol v1. */ 461 /** Reads a list entry from the host. 462 * 463 * @retval VINF_SUCCESS on success. 464 * @retval VERR_INVALID_CLIENT_ID 465 * @retval VERR_WRONG_PARAMETER_COUNT 466 * @retval VERR_WRONG_PARAMETER_TYPE 467 * @since 6.1 468 */ 252 469 #define VBOX_SHCL_GUEST_FN_LIST_ENTRY_READ 20 253 /** New since protocol v1. */ 470 /** Sends a list entry to the host. 471 * 472 * @retval VINF_SUCCESS on success. 473 * @retval VERR_INVALID_CLIENT_ID 474 * @retval VERR_WRONG_PARAMETER_COUNT 475 * @retval VERR_WRONG_PARAMETER_TYPE 476 * @since 6.1 477 */ 254 478 #define VBOX_SHCL_GUEST_FN_LIST_ENTRY_WRITE 21 255 /** New since protocol v1. */ 479 /** Opens an object on the host. 480 * 481 * @retval VINF_SUCCESS on success. 482 * @retval VERR_INVALID_CLIENT_ID 483 * @retval VERR_WRONG_PARAMETER_COUNT 484 * @retval VERR_WRONG_PARAMETER_TYPE 485 * @since 6.1 486 */ 256 487 #define VBOX_SHCL_GUEST_FN_OBJ_OPEN 22 257 /** New since protocol v1. */ 488 /** Closes an object on the host. 489 * 490 * @retval VINF_SUCCESS on success. 491 * @retval VERR_INVALID_CLIENT_ID 492 * @retval VERR_WRONG_PARAMETER_COUNT 493 * @retval VERR_WRONG_PARAMETER_TYPE 494 * @since 6.1 495 */ 258 496 #define VBOX_SHCL_GUEST_FN_OBJ_CLOSE 23 259 /** New since protocol v1. */ 497 /** Reads from an object on the host. 498 * 499 * @retval VINF_SUCCESS on success. 500 * @retval VERR_INVALID_CLIENT_ID 501 * @retval VERR_WRONG_PARAMETER_COUNT 502 * @retval VERR_WRONG_PARAMETER_TYPE 503 * @since 6.1 504 */ 260 505 #define VBOX_SHCL_GUEST_FN_OBJ_READ 24 261 /** New since protocol v1. */ 506 /** Writes to an object on the host. 507 * 508 * @retval VINF_SUCCESS on success. 509 * @retval VERR_INVALID_CLIENT_ID 510 * @retval VERR_WRONG_PARAMETER_COUNT 511 * @retval VERR_WRONG_PARAMETER_TYPE 512 * @since 6.1 513 */ 262 514 #define VBOX_SHCL_GUEST_FN_OBJ_WRITE 25 263 515 /** Reports cancellation of the current operation to the host. 264 * New since protocol v1. */ 516 * 517 * @retval VINF_SUCCESS on success. 518 * @retval VERR_INVALID_CLIENT_ID 519 * @retval VERR_WRONG_PARAMETER_COUNT 520 * @retval VERR_WRONG_PARAMETER_TYPE 521 * @since 6.1 522 */ 265 523 #define VBOX_SHCL_GUEST_FN_CANCEL 26 266 524 /** Reports an error to the host. 267 * New since protocol v1. */ 525 * 526 * @retval VINF_SUCCESS on success. 527 * @retval VERR_INVALID_CLIENT_ID 528 * @retval VERR_WRONG_PARAMETER_COUNT 529 * @retval VERR_WRONG_PARAMETER_TYPE 530 * @since 6.1 531 */ 268 532 #define VBOX_SHCL_GUEST_FN_ERROR 27 269 533 … … 276 540 /** No flags set. */ 277 541 #define VBOX_SHCL_GF_NONE 0 542 /** Guest can handle context IDs (uint64_t, in paParam[0]). */ 543 #define VBOX_SHCL_GF_0_CONTEXT_ID RT_BIT_64(0) 278 544 /** Bit that must be set in the 2nd parameter, will be cleared if the host reponds 279 545 * correctly (old hosts might not). */ … … 313 579 * Message for doing the protocol negotiation between the host 314 580 * and the guest. Not available on older (VBox <= 6.0) hosts. 581 * 582 * This message acts as a beacon between the old protocol (VBox <= 6.0) and 583 * the new protocol (>= VBox 6.1). Newer features are getting introduced soley via 584 * the guest / host feature flags then. 315 585 */ 316 586 typedef struct _VBoxShClConnect … … 318 588 VBGLIOCHGCMCALL hdr; 319 589 320 /** uint32_t, out: Protocol version. */321 HGCMFunctionParameter uProtocolVer;322 /** uint32_t, out: Protocol flags, unused at the moment. */323 HGCMFunctionParameter uProtocolFlags;324 590 /** uint32_t, out: Maximum chunk size for data transfers. */ 325 591 HGCMFunctionParameter cbChunkSize; … … 330 596 } VBoxShClConnect; 331 597 332 #define VBOX_SHCL_CPARMS_CONNECT 5598 #define VBOX_SHCL_CPARMS_CONNECT 3 333 599 334 600 /** … … 349 615 struct 350 616 { 351 /** uint64_t, in: Context ID. */617 /** uint64_t, out: Context ID. */ 352 618 HGCMFunctionParameter uContext; 353 /** uint32_t, out: 619 /** uint32_t, out: VBOX_SHCL_FMT_*. */ 354 620 HGCMFunctionParameter uFormats; 355 /** uint32_t, in: Format flags. */621 /** uint32_t, out: Format flags. */ 356 622 HGCMFunctionParameter fFlags; 357 623 } v1; -
trunk/include/VBox/VBoxGuestLib.h
r81352 r81559 605 605 /** IN/OUT: Context ID to retrieve or to use. */ 606 606 uint64_t uContextID; 607 /** IN: Protocol version to use. */608 uint32_t uProtocolVer;609 /** IN: Protocol flags. Currently unused. */610 uint32_t uProtocolFlags;611 607 /** IN: Maximum chunk size (in bytes). */ 612 608 uint32_t cbChunkSize; 609 /** Flag indicating whether to use the legacy protocol (<= VBox 6.1) or not. 610 * This is determined in VbglR3ClipboardConnectEx(). */ 611 bool fUseLegacyProtocol; 612 /** IN: Host feature flags (of type VBOX_SHCL_HF_XXX). */ 613 uint64_t fHostFeatures; 613 614 /** OUT: Number of parameters retrieved. */ 614 615 uint32_t uNumParms; -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxClipboard.cpp
r81369 r81559 960 960 const PSHCLWINCTX pWinCtx = &pCtx->Win; 961 961 962 LogRel2(("Shared Clipboard: Worker loop running , using protocol v%RU32\n", pCtx->CmdCtx.uProtocolVer));962 LogRel2(("Shared Clipboard: Worker loop running\n")); 963 963 964 964 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS … … 975 975 int rc; 976 976 977 LogFlowFunc(("uProtocolVer=%RU32\n", pCtx->CmdCtx.uProtocolVer));978 979 977 uint32_t uMsg; 980 978 uint32_t uFormats; … … 985 983 PVBGLR3CLIPBOARDEVENT pEvent = NULL; 986 984 987 LogFlowFunc(("Waiting for host message ( protocol v%RU32) ...\n", pCtx->CmdCtx.uProtocolVer));988 989 if (pCtx->CmdCtx. uProtocolVer == 0) /* Legacy protocol */985 LogFlowFunc(("Waiting for host message (fHostFeatures=%#RX64) ...\n", pCtx->CmdCtx.fHostFeatures)); 986 987 if (pCtx->CmdCtx.fUseLegacyProtocol) 990 988 { 991 989 rc = VbglR3ClipboardGetHostMsgOld(pCtx->CmdCtx.uClientID, &uMsg, &uFormats); … … 1030 1028 } 1031 1029 } 1032 else /* Protocol >= v1. */1030 else /* Host service has peeking for messages support. */ 1033 1031 { 1034 1032 pEvent = (PVBGLR3CLIPBOARDEVENT)RTMemAllocZ(sizeof(VBGLR3CLIPBOARDEVENT)); -
trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibClipboard.cpp
r81460 r81559 94 94 VBOX_SHCL_GUEST_FN_CONNECT, VBOX_SHCL_CPARMS_CONNECT); 95 95 96 VbglHGCMParmUInt32Set(&Msg.uProtocolVer, 0);97 VbglHGCMParmUInt32Set(&Msg.uProtocolFlags, 0);98 96 VbglHGCMParmUInt32Set(&Msg.cbChunkSize, 0); 99 97 VbglHGCMParmUInt32Set(&Msg.enmCompression, 0); … … 103 101 if (RT_SUCCESS(rc)) 104 102 { 105 rc = VbglHGCMParmUInt32Get(&Msg.uProtocolVer, &pCtx->uProtocolVer); 106 if (RT_SUCCESS(rc)) 107 rc = VbglHGCMParmUInt32Get(&Msg.uProtocolFlags, &pCtx->uProtocolFlags); 108 if (RT_SUCCESS(rc)) 109 rc = VbglHGCMParmUInt32Get(&Msg.cbChunkSize, &pCtx->cbChunkSize); 103 rc = VbglHGCMParmUInt32Get(&Msg.cbChunkSize, &pCtx->cbChunkSize); 110 104 111 105 /** @todo Add / handle checksum + compression type. */ … … 116 110 * Report features to the host. 117 111 */ 118 uint64_t fHostFeatures0Ignored; 119 rc = VbglR3ClipboardReportFeatures(pCtx->uClientID, VBOX_SHCL_GF_NONE /* None yet */, 120 &fHostFeatures0Ignored); 112 const uint64_t fGuestFeatures = VBOX_SHCL_GF_0_CONTEXT_ID; 113 114 rc = VbglR3ClipboardReportFeatures(pCtx->uClientID, fGuestFeatures, 115 &pCtx->fHostFeatures); 121 116 if (RT_SUCCESS(rc)) 122 LogRel2(("Shared Clipboard: Host features: %#RX64\n", fHostFeatures0Ignored));117 LogRel2(("Shared Clipboard: Host features: %#RX64\n", pCtx->fHostFeatures)); 123 118 else 124 119 LogRel(("Shared Clipboard: Warning! Feature reporing failed: %Rrc\n", rc)); 120 121 pCtx->fUseLegacyProtocol = false; 125 122 } 126 123 } … … 128 125 { 129 126 /* If the above call fails, make sure to use some sane defaults for 130 * the old (legacy) protocol. */ 131 pCtx->uProtocolVer = 0; 132 pCtx->uProtocolFlags = 0; 133 pCtx->cbChunkSize = _64K; 127 * the old (legacy, VBox <= 6.1) protocol. */ 128 pCtx->fUseLegacyProtocol = true; 129 pCtx->cbChunkSize = _64K; /* Use 64KB as chunk size by default. */ 134 130 135 131 rc = VINF_SUCCESS; /* Failing above is not fatal. */ 136 132 } 137 133 138 LogFlowFunc(("uProtocolVer=%RU32, cbChunkSize=%RU32\n", pCtx->uProtocolVer, pCtx->cbChunkSize)); 139 140 LogRel2(("Shared Clipboard: Client %RU32 connected, using protocol v%RU32 (cbChunkSize=%RU32)\n", 141 pCtx->uClientID, pCtx->uProtocolVer, pCtx->cbChunkSize)); 142 134 LogFlowFunc(("fHostFeatures=%#RX64, cbChunkSize=%RU32\n", pCtx->fHostFeatures, pCtx->cbChunkSize)); 135 136 LogRel2(("Shared Clipboard: Client %RU32 connected (cbChunkSize=%RU32, fUseLegacyProtocol=%RTbool)\n", 137 pCtx->uClientID, pCtx->cbChunkSize, pCtx->fUseLegacyProtocol)); 143 138 } 144 139 … … 194 189 RT_ZERO(Msg); 195 190 196 if (pCtx->uProtocolVer >= 1) 197 { 198 VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, 199 VBOX_SHCL_GUEST_FN_MSG_GET, 3); 200 201 Msg.u.v1.uContext.SetUInt64(VBOX_SHCL_HOST_MSG_FORMATS_REPORT); 202 Msg.u.v1.uFormats.SetUInt32(0); 203 Msg.u.v1.fFlags.SetUInt32(0); 204 } 191 VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, VBOX_SHCL_GUEST_FN_MSG_GET, 3); 192 193 Msg.u.v1.uContext.SetUInt64(VBOX_SHCL_HOST_MSG_FORMATS_REPORT); 194 Msg.u.v1.uFormats.SetUInt32(0); 195 Msg.u.v1.fFlags.SetUInt32(0); 205 196 206 197 int rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg)); … … 256 247 257 248 /** 258 * Get a host message, legacy version ( protocol v0). Do not use anymore.249 * Get a host message, legacy version (which does not have VBOX_SHCL_GUEST_FN_MSG_GET). Do not use anymore. 259 250 * 260 251 * Note: This is the old message which still is being used for the non-URI Shared Clipboard transfers, … … 2218 2209 2219 2210 #ifdef LOG_ENABLED 2220 LogFunc(("Handling idMsg=%RU32 (%s) , protocol v%RU32\n", idMsg, ShClHostMsgToStr(idMsg), pCtx->uProtocolVer));2211 LogFunc(("Handling idMsg=%RU32 (%s)\n", idMsg, ShClHostMsgToStr(idMsg))); 2221 2212 #endif 2222 2213 switch (idMsg) … … 2308 2299 LogFlowFunc(("uFormats=0x%x\n", pFormats->uFormats)); 2309 2300 2310 if (pCtx-> uProtocolVer == 0)2301 if (pCtx->fUseLegacyProtocol) 2311 2302 { 2312 2303 VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, VBOX_SHCL_GUEST_FN_FORMATS_REPORT, 1); … … 2402 2393 int rc; 2403 2394 2404 if (pCtx-> uProtocolVer == 0)2395 if (pCtx->fUseLegacyProtocol) 2405 2396 { 2406 2397 rc = VbglR3ClipboardWriteData(pCtx->uClientID, pData->uFormat, pData->pvData, pData->cbData); -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-internal.h
r81451 r81559 88 88 /** The client's session ID. */ 89 89 SHCLSESSIONID uSessionID; 90 /** Optional protocol version the client uses. Set to 0 by default. */91 uint32_t uProtocolVer;92 90 /** Guest feature flags, VBOX_SHCL_GF_0_XXX. */ 93 91 uint64_t fGuestFeatures0; … … 96 94 /** Maximum chunk size to use for data transfers. Set to _64K by default. */ 97 95 uint32_t cbChunkSize; 96 /** Where the transfer sources its data from. */ 98 97 SHCLSOURCE enmSource; 99 98 /** The client's transfers state. */ -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp
r81460 r81559 422 422 * Sets the VBOX_SHCL_GUEST_FN_GET_HOST_MSG_OLD return parameters. 423 423 * 424 * This function does the necessary translation between the legacy protocol ( v0) and the new protocols (>= v1),424 * This function does the necessary translation between the legacy protocol (<= VBox 6.0) and the new protocols (>= VBox 6.1), 425 425 * as messages are always stored as >= v1 messages in the message queue. 426 426 * … … 1113 1113 1114 1114 SHCLEVENTID uEvent; 1115 if ( pClient->State.uProtocolVer == 0)1116 { 1117 /* Protocol v0did not have any context ID handling, so we ASSUME that the last event registered1115 if (!(pClient->State.fGuestFeatures0 & VBOX_SHCL_GF_0_CONTEXT_ID)) /* Legacy */ 1116 { 1117 /* Older Guest Additions (<= VBox 6.0) did not have any context ID handling, so we ASSUME that the last event registered 1118 1118 * is the one we want to handle (as this all was a synchronous protocol anyway). */ 1119 1119 uEvent = ShClEventGetLast(&pClient->Events); … … 1204 1204 RT_ZERO(cmdCtx); 1205 1205 1206 if ( pClient->State.uProtocolVer == 0) /* Legacy protocol*/1206 if (!(pClient->State.fGuestFeatures0 & VBOX_SHCL_GF_0_CONTEXT_ID)) /* Legacy */ 1207 1207 { 1208 1208 if (cParms < 2) … … 1431 1431 AssertPtr(pClient); 1432 1432 1433 LogFunc(("u32ClientID=%RU32 (proto %RU32), fn=%RU32 (%s), cParms=%RU32, paParms=%p\n",1434 u32ClientID, pClient->State.uProtocolVer,u32Function, ShClGuestMsgToStr(u32Function), cParms, paParms));1433 LogFunc(("u32ClientID=%RU32, fn=%RU32 (%s), cParms=%RU32, paParms=%p\n", 1434 u32ClientID, u32Function, ShClGuestMsgToStr(u32Function), cParms, paParms)); 1435 1435 1436 1436 #ifdef DEBUG … … 1458 1458 rc = VERR_INVALID_PARAMETER; 1459 1459 } 1460 else if ( paParms[0].type != VBOX_HGCM_SVC_PARM_32BIT /* uProtocolVer */ 1461 || paParms[1].type != VBOX_HGCM_SVC_PARM_32BIT /* uProtocolFlags */ 1462 || paParms[2].type != VBOX_HGCM_SVC_PARM_32BIT /* cbChunkSize */ 1463 || paParms[3].type != VBOX_HGCM_SVC_PARM_32BIT /* enmCompression */ 1464 || paParms[4].type != VBOX_HGCM_SVC_PARM_32BIT) /* enmChecksumType */ 1460 else if ( paParms[0].type != VBOX_HGCM_SVC_PARM_32BIT /* cbChunkSize */ 1461 || paParms[1].type != VBOX_HGCM_SVC_PARM_32BIT /* enmCompression */ 1462 || paParms[2].type != VBOX_HGCM_SVC_PARM_32BIT) /* enmChecksumType */ 1465 1463 { 1466 1464 rc = VERR_INVALID_PARAMETER; … … 1472 1470 else 1473 1471 { 1474 /* Update the protocol version and tell the guest. */ 1475 pClient->State.uProtocolVer = 1; 1476 1477 LogFlowFunc(("Now using protocol v%RU32\n", pClient->State.uProtocolVer)); 1478 1479 HGCMSvcSetU32(&paParms[0], pClient->State.uProtocolVer); 1480 HGCMSvcSetU32(&paParms[1], 0 /* Procotol flags, not used yet */); 1481 HGCMSvcSetU32(&paParms[2], pClient->State.cbChunkSize); 1482 HGCMSvcSetU32(&paParms[3], 0 /* Compression type, not used yet */); 1483 HGCMSvcSetU32(&paParms[4], 0 /* Checksum type, not used yet */); 1472 /* Report back supported chunk size to the guest. */ 1473 HGCMSvcSetU32(&paParms[0], _64K); /* Chunk size */ /** @todo Make chunk size dynamic. */ 1484 1474 1485 1475 rc = VINF_SUCCESS; … … 1523 1513 uint32_t uFormats = 0; 1524 1514 1525 if ( pClient->State.uProtocolVer == 0)1515 if (!(pClient->State.fGuestFeatures0 & VBOX_SHCL_GF_0_CONTEXT_ID)) /* Legacy */ 1526 1516 { 1527 1517 if (cParms != 1) … … 1799 1789 LogFlowFuncEnter(); 1800 1790 1801 pClientState->uProtocolVer = 0;1802 1791 pClientState->fGuestFeatures0 = VBOX_SHCL_GF_NONE; 1803 1792 pClientState->fGuestFeatures1 = VBOX_SHCL_GF_NONE; … … 1900 1889 static SSMFIELD const s_aShClSSMClientState[] = 1901 1890 { 1902 SSMFIELD_ENTRY(SHCLCLIENTSTATE, uProtocolVer), 1903 SSMFIELD_ENTRY(SHCLCLIENTSTATE, cbChunkSize), 1904 SSMFIELD_ENTRY(SHCLCLIENTSTATE, enmSource), 1891 /** Note: Saving the session ID not necessary, as they're not persistent across state save/restore. */ 1892 SSMFIELD_ENTRY (SHCLCLIENTSTATE, fGuestFeatures0), 1893 SSMFIELD_ENTRY (SHCLCLIENTSTATE, fGuestFeatures1), 1894 SSMFIELD_ENTRY (SHCLCLIENTSTATE, cbChunkSize), 1895 SSMFIELD_ENTRY (SHCLCLIENTSTATE, enmSource), 1905 1896 SSMFIELD_ENTRY_TERM() 1906 1897 }; … … 1909 1900 * SSM descriptor table for the SHCLCLIENTURISTATE structure. 1910 1901 */ 1911 static SSMFIELD const s_aShClSSMClient URIState[] =1902 static SSMFIELD const s_aShClSSMClientTransferState[] = 1912 1903 { 1913 1904 SSMFIELD_ENTRY(SHCLCLIENTTRANSFERSTATE, enmTransferDir), … … 1938 1929 static DECLCALLBACK(int) svcSaveState(void *, uint32_t u32ClientID, void *pvClient, PSSMHANDLE pSSM) 1939 1930 { 1940 RT_NOREF(u32ClientID);1931 LogFlowFuncEnter(); 1941 1932 1942 1933 #ifndef UNIT_TEST … … 1947 1938 * Pending requests, if any, will be completed in svcDisconnect. 1948 1939 */ 1940 RT_NOREF(u32ClientID); 1949 1941 LogFunc(("u32ClientID=%RU32\n", u32ClientID)); 1950 1942 … … 1958 1950 AssertRCReturn(rc, rc); 1959 1951 1960 rc = SSMR3PutStructEx(pSSM, &pClient->State.Transfers, sizeof(pClient->State.Transfers), 0 /*fFlags*/, &s_aShClSSMClient URIState[0], NULL);1952 rc = SSMR3PutStructEx(pSSM, &pClient->State.Transfers, sizeof(pClient->State.Transfers), 0 /*fFlags*/, &s_aShClSSMClientTransferState[0], NULL); 1961 1953 AssertRCReturn(rc, rc); 1962 1954 … … 2026 2018 static DECLCALLBACK(int) svcLoadState(void *, uint32_t u32ClientID, void *pvClient, PSSMHANDLE pSSM, uint32_t uVersion) 2027 2019 { 2020 LogFlowFuncEnter(); 2021 2028 2022 #ifndef UNIT_TEST 2023 2029 2024 RT_NOREF(u32ClientID, uVersion); 2030 2031 LogFunc(("u32ClientID=%RU32\n", u32ClientID));2032 2025 2033 2026 PSHCLCLIENT pClient = (PSHCLCLIENT)pvClient; … … 2038 2031 int rc = SSMR3GetU32(pSSM, &lenOrVer); 2039 2032 AssertRCReturn(rc, rc); 2033 2034 LogFunc(("u32ClientID=%RU32, lenOrVer=%#RX64\n", u32ClientID, lenOrVer)); 2035 2040 2036 if (lenOrVer == VBOX_SHCL_SSM_VER_0) 2041 2037 { … … 2044 2040 else if (lenOrVer == VBOX_SHCL_SSM_VER_1) 2045 2041 { 2046 rc = SSMR3GetStructEx(pSSM, &pClient->State, sizeof(pClient->State), 0 /*fFlags*/, &s_aShClSSMClientState[0], NULL); 2042 rc = SSMR3GetStructEx(pSSM, &pClient->State, sizeof(pClient->State), 0 /* fFlags */, 2043 &s_aShClSSMClientState[0], NULL); 2047 2044 AssertRCReturn(rc, rc); 2048 2045 2049 rc = SSMR3GetStructEx(pSSM, &pClient->State.Transfers, sizeof(pClient->State.Transfers), 0 /*fFlags*/, &s_aShClSSMClientURIState[0], NULL); 2046 rc = SSMR3GetStructEx(pSSM, &pClient->State.Transfers, sizeof(pClient->State.Transfers), 0 /* fFlags */, 2047 &s_aShClSSMClientTransferState[0], NULL); 2050 2048 AssertRCReturn(rc, rc); 2051 2049 … … 2192 2190 int rc = VINF_SUCCESS; 2193 2191 2194 LogFlowFunc(("p table=%p\n", pTable));2195 2196 if (! pTable)2192 LogFlowFunc(("pTable=%p\n", pTable)); 2193 2194 if (!VALID_PTR(pTable)) 2197 2195 { 2198 2196 rc = VERR_INVALID_PARAMETER; … … 2200 2198 else 2201 2199 { 2202 LogFunc(("p table->cbSize = %d, ptable->u32Version = 0x%08X\n", pTable->cbSize, pTable->u32Version));2200 LogFunc(("pTable->cbSize = %d, ptable->u32Version = 0x%08X\n", pTable->cbSize, pTable->u32Version)); 2203 2201 2204 2202 if ( pTable->cbSize != sizeof (VBOXHGCMSVCFNTABLE) 2205 2203 || pTable->u32Version != VBOX_HGCM_SVC_VERSION) 2206 2204 { 2207 rc = VERR_ INVALID_PARAMETER;2205 rc = VERR_VERSION_MISMATCH; 2208 2206 } 2209 2207 else … … 2213 2211 pTable->cbClient = sizeof(SHCLCLIENT); 2214 2212 2215 pTable->pfnUnload = svcUnload;2216 pTable->pfnConnect = svcConnect;2217 pTable->pfnDisconnect = svcDisconnect;2218 pTable->pfnCall = svcCall;2219 pTable->pfnHostCall = svcHostCall;2220 pTable->pfnSaveState = svcSaveState;2221 pTable->pfnLoadState = svcLoadState;2222 pTable->pfnRegisterExtension 2223 pTable->pfnNotify = NULL;2224 pTable->pvService = NULL;2213 pTable->pfnUnload = svcUnload; 2214 pTable->pfnConnect = svcConnect; 2215 pTable->pfnDisconnect = svcDisconnect; 2216 pTable->pfnCall = svcCall; 2217 pTable->pfnHostCall = svcHostCall; 2218 pTable->pfnSaveState = svcSaveState; 2219 pTable->pfnLoadState = svcLoadState; 2220 pTable->pfnRegisterExtension = svcRegisterExtension; 2221 pTable->pfnNotify = NULL; 2222 pTable->pvService = NULL; 2225 2223 2226 2224 /* Service specific initialization. */ … … 2229 2227 } 2230 2228 2229 LogFlowFunc(("Returning %Rrc\n", rc)); 2231 2230 return rc; 2232 2231 }
Note:
See TracChangeset
for help on using the changeset viewer.