Changeset 85407 in vbox for trunk/src/VBox/HostServices
- Timestamp:
- Jul 22, 2020 8:45:18 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/DragAndDrop/VBoxDragAndDropSvc.cpp
r85403 r85407 407 407 uint32_t cbTemp = 0; \ 408 408 rc = HGCMSvcGetU32(&a_ParmUInt32, &cbTemp); \ 409 ASSERT_GUEST_ STMT(RT_SUCCESS(rc) && cbTemp == a_SizeExpected, rc = VERR_INVALID_PARAMETER); \409 ASSERT_GUEST_BREAK(RT_SUCCESS(rc) && cbTemp == a_SizeExpected); \ 410 410 } while (0) 411 411 412 /* Gets the context ID from the first parameter and store it into the data header. 413 * Then increments idxParm by one if more than one parameter is available. */ 414 #define GET_CONTEXT_ID_PARM0() \ 415 if (fHasCtxID) \ 416 { \ 417 ASSERT_GUEST_BREAK(cParms >= 1); \ 418 rc = HGCMSvcGetU32(&paParms[0], &data.hdr.uContextID); \ 419 ASSERT_GUEST_BREAK(RT_SUCCESS(rc)); \ 420 if (cParms > 1) \ 421 idxParm++; \ 422 } 423 412 424 if (rc == VINF_SUCCESS) /* Note: rc might be VINF_HGCM_ASYNC_EXECUTE! */ 413 425 { 414 426 LogFlowFunc(("Client %RU32: Protocol v%RU32\n", pClient->GetClientID(), pClient->GetProtocolVer())); 415 427 416 rc = VERR_INVALID_PARAMETER; /* Play safe. */ 428 rc = VERR_INVALID_PARAMETER; /* Play safe by default. */ 429 430 /* Whether the client's advertised protocol sends context IDs with commands. */ 431 const bool fHasCtxID = pClient->GetProtocolVer() >= 3; 432 433 /* Current parameter index to process. */ 434 unsigned idxParm = 0; 417 435 418 436 switch (u32Function) … … 475 493 { 476 494 LogFlowFunc(("GUEST_DND_CONNECT\n")); 477 if (cParms >= 2) 478 { 479 const uint8_t idxProto = cParms >= 3 ? 1 : 0; 480 481 VBOXDNDCBCONNECTMSGDATA data; 482 RT_ZERO(data); 483 data.hdr.uMagic = CB_MAGIC_DND_CONNECT; 484 if (cParms >= 3) 485 rc = HGCMSvcGetU32(&paParms[0], &data.hdr.uContextID); 486 else /* Older protocols don't have a context ID. */ 487 rc = VINF_SUCCESS; 488 if (RT_SUCCESS(rc)) 489 rc = HGCMSvcGetU32(&paParms[idxProto], &data.uProtocol); 490 if (RT_SUCCESS(rc)) 491 rc = HGCMSvcGetU32(&paParms[idxProto + 1], &data.uFlags); 492 if (RT_SUCCESS(rc)) 493 { 494 unsigned uProtocolVer = 3; /* The protocol version we're going to use. */ 495 496 /* Make sure we're only setting a protocl version we're supporting on the host. */ 497 if (data.uProtocol > uProtocolVer) 498 data.uProtocol = uProtocolVer; 499 500 pClient->SetProtocolVer(data.uProtocol); 501 502 /* Return the highest protocol version we're supporting. */ 503 paParms[idxProto].u.uint32 = data.uProtocol; 504 505 LogFlowFunc(("Client %RU32 is now using protocol v%RU32\n", pClient->GetClientID(), pClient->GetProtocolVer())); 506 DO_HOST_CALLBACK(); 507 } 508 } 495 496 ASSERT_GUEST_BREAK(cParms >= 2); 497 498 VBOXDNDCBCONNECTMSGDATA data; 499 RT_ZERO(data); 500 501 rc = HGCMSvcGetU32(&paParms[idxParm++], &data.hdr.uContextID); \ 502 ASSERT_GUEST_RC_BREAK(rc); 503 rc = HGCMSvcGetU32(&paParms[idxParm++], &data.uProtocol); 504 ASSERT_GUEST_RC_BREAK(rc); 505 rc = HGCMSvcGetU32(&paParms[idxParm], &data.uFlags); 506 ASSERT_GUEST_RC_BREAK(rc); 507 508 unsigned uProtocolVer = 3; /* The protocol version we're going to use. */ 509 510 /* Make sure we're only setting a protocl version we're supporting on the host. */ 511 if (data.uProtocol > uProtocolVer) 512 data.uProtocol = uProtocolVer; 513 514 pClient->SetProtocolVer(data.uProtocol); 515 516 /* Return the highest protocol version we're supporting. */ 517 AssertBreak(idxParm); 518 ASSERT_GUEST_BREAK(idxParm); 519 paParms[idxParm - 1].u.uint32 = data.uProtocol; 520 521 LogFlowFunc(("Client %RU32 is now using protocol v%RU32\n", pClient->GetClientID(), pClient->GetProtocolVer())); 522 523 DO_HOST_CALLBACK(); 509 524 break; 510 525 } … … 512 527 { 513 528 LogFlowFunc(("GUEST_DND_HG_ACK_OP\n")); 529 530 ASSERT_GUEST_BREAK(cParms >= 2); 514 531 515 532 VBOXDNDCBHGACKOPDATA data; 516 533 RT_ZERO(data); 517 534 data.hdr.uMagic = CB_MAGIC_DND_HG_ACK_OP; 535 536 GET_CONTEXT_ID_PARM0(); 537 rc = HGCMSvcGetU32(&paParms[idxParm], &data.uAction); /* Get drop action. */ 538 ASSERT_GUEST_RC_BREAK(rc); 539 540 DO_HOST_CALLBACK(); 541 break; 542 } 543 case GUEST_DND_HG_REQ_DATA: 544 { 545 LogFlowFunc(("GUEST_DND_HG_REQ_DATA\n")); 546 547 VBOXDNDCBHGREQDATADATA data; 548 RT_ZERO(data); 549 data.hdr.uMagic = CB_MAGIC_DND_HG_REQ_DATA; 518 550 519 551 switch (pClient->GetProtocolVer()) … … 521 553 case 3: 522 554 { 523 if (cParms == 2) 524 { 525 rc = HGCMSvcGetU32(&paParms[0], &data.hdr.uContextID); 526 if (RT_SUCCESS(rc)) 527 rc = HGCMSvcGetU32(&paParms[1], &data.uAction); /* Get drop action. */ 528 } 555 ASSERT_GUEST_BREAK(cParms == 3); 556 GET_CONTEXT_ID_PARM0(); 557 rc = HGCMSvcGetPv(&paParms[idxParm++], (void **)&data.pszFormat, &data.cbFormat); 558 ASSERT_GUEST_RC_BREAK(rc); 559 VERIFY_BUFFER_SIZE_UINT32(paParms[idxParm], data.cbFormat); 529 560 break; 530 561 } 531 562 532 563 case 2: 564 RT_FALL_THROUGH(); 533 565 default: 534 566 { 535 if (cParms == 1) 536 rc = HGCMSvcGetU32(&paParms[0], &data.uAction); /* Get drop action. */ 567 ASSERT_GUEST_BREAK(cParms == 1); 568 rc = HGCMSvcGetPv(&paParms[idxParm], (void**)&data.pszFormat, &data.cbFormat); 569 ASSERT_GUEST_RC_BREAK(rc); 537 570 break; 538 571 } … … 542 575 break; 543 576 } 544 case GUEST_DND_HG_REQ_DATA: 545 { 546 LogFlowFunc(("GUEST_DND_HG_REQ_DATA\n")); 547 548 VBOXDNDCBHGREQDATADATA data; 577 case GUEST_DND_HG_EVT_PROGRESS: 578 { 579 LogFlowFunc(("GUEST_DND_HG_EVT_PROGRESS\n")); 580 581 ASSERT_GUEST_BREAK(cParms >= 3); 582 583 VBOXDNDCBHGEVTPROGRESSDATA data; 549 584 RT_ZERO(data); 550 data.hdr.uMagic = CB_MAGIC_DND_HG_REQ_DATA; 585 data.hdr.uMagic = CB_MAGIC_DND_HG_EVT_PROGRESS; 586 587 GET_CONTEXT_ID_PARM0(); 588 rc = HGCMSvcGetU32(&paParms[idxParm++], &data.uStatus); 589 ASSERT_GUEST_RC_BREAK(rc); 590 rc = HGCMSvcGetU32(&paParms[idxParm++], &data.uPercentage); 591 ASSERT_GUEST_RC_BREAK(rc); 592 rc = HGCMSvcGetU32(&paParms[idxParm], &data.rc); 593 ASSERT_GUEST_RC_BREAK(rc); 594 595 DO_HOST_CALLBACK(); 596 break; 597 } 598 #ifdef VBOX_WITH_DRAG_AND_DROP_GH 599 case GUEST_DND_GH_ACK_PENDING: 600 { 601 LogFlowFunc(("GUEST_DND_GH_ACK_PENDING\n")); 602 603 VBOXDNDCBGHACKPENDINGDATA data; 604 RT_ZERO(data); 605 data.hdr.uMagic = CB_MAGIC_DND_GH_ACK_PENDING; 551 606 552 607 switch (pClient->GetProtocolVer()) … … 554 609 case 3: 555 610 { 556 if (cParms == 3) 557 { 558 rc = HGCMSvcGetU32(&paParms[0], &data.hdr.uContextID); 559 if (RT_SUCCESS(rc)) 560 rc = HGCMSvcGetPv(&paParms[1], (void **)&data.pszFormat, &data.cbFormat); 561 VERIFY_BUFFER_SIZE_UINT32(paParms[2], data.cbFormat); 562 } 611 ASSERT_GUEST_BREAK(cParms == 5); 612 GET_CONTEXT_ID_PARM0(); 613 rc = HGCMSvcGetU32(&paParms[idxParm++], &data.uDefAction); 614 ASSERT_GUEST_RC_BREAK(rc); 615 rc = HGCMSvcGetU32(&paParms[idxParm++], &data.uAllActions); 616 ASSERT_GUEST_RC_BREAK(rc); 617 rc = HGCMSvcGetPv(&paParms[idxParm++], (void**)&data.pszFormat, &data.cbFormat); 618 ASSERT_GUEST_RC_BREAK(rc); 619 VERIFY_BUFFER_SIZE_UINT32(paParms[idxParm], data.cbFormat); 563 620 break; 564 621 } … … 567 624 default: 568 625 { 569 if (cParms == 1) 570 rc = HGCMSvcGetPv(&paParms[0], (void**)&data.pszFormat, &data.cbFormat); 626 ASSERT_GUEST_BREAK(cParms == 3); 627 rc = HGCMSvcGetU32(&paParms[idxParm++], &data.uDefAction); 628 ASSERT_GUEST_RC_BREAK(rc); 629 rc = HGCMSvcGetU32(&paParms[idxParm++], &data.uAllActions); 630 ASSERT_GUEST_RC_BREAK(rc); 631 rc = HGCMSvcGetPv(&paParms[idxParm], (void**)&data.pszFormat, &data.cbFormat); 632 ASSERT_GUEST_RC_BREAK(rc); 571 633 break; 572 634 } … … 576 638 break; 577 639 } 578 case GUEST_DND_HG_EVT_PROGRESS: 579 { 580 LogFlowFunc(("GUEST_DND_HG_EVT_PROGRESS\n")); 581 582 VBOXDNDCBHGEVTPROGRESSDATA data; 640 /* New since protocol v3. */ 641 case GUEST_DND_GH_SND_DATA_HDR: 642 { 643 LogFlowFunc(("GUEST_DND_GH_SND_DATA_HDR\n")); 644 645 ASSERT_GUEST_BREAK(cParms == 12); 646 647 VBOXDNDCBSNDDATAHDRDATA data; 583 648 RT_ZERO(data); 584 data.hdr.uMagic = CB_MAGIC_DND_HG_EVT_PROGRESS; 649 data.hdr.uMagic = CB_MAGIC_DND_GH_SND_DATA_HDR; 650 651 GET_CONTEXT_ID_PARM0(); 652 rc = HGCMSvcGetU32(&paParms[idxParm++], &data.data.uFlags); 653 ASSERT_GUEST_RC_BREAK(rc); 654 rc = HGCMSvcGetU32(&paParms[idxParm++], &data.data.uScreenId); 655 ASSERT_GUEST_RC_BREAK(rc); 656 rc = HGCMSvcGetU64(&paParms[idxParm++], &data.data.cbTotal); 657 ASSERT_GUEST_RC_BREAK(rc); 658 rc = HGCMSvcGetU32(&paParms[idxParm++], &data.data.cbMeta); 659 ASSERT_GUEST_RC_BREAK(rc); 660 ASSERT_GUEST_BREAK(data.data.cbMeta <= data.data.cbTotal); 661 rc = HGCMSvcGetPv(&paParms[idxParm++], &data.data.pvMetaFmt, &data.data.cbMetaFmt); 662 ASSERT_GUEST_RC_BREAK(rc); 663 VERIFY_BUFFER_SIZE_UINT32(paParms[idxParm++], data.data.cbMetaFmt); 664 rc = HGCMSvcGetU64(&paParms[idxParm++], &data.data.cObjects); 665 ASSERT_GUEST_RC_BREAK(rc); 666 rc = HGCMSvcGetU32(&paParms[idxParm++], &data.data.enmCompression); 667 ASSERT_GUEST_RC_BREAK(rc); 668 rc = HGCMSvcGetU32(&paParms[idxParm++], (uint32_t *)&data.data.enmChecksumType); 669 ASSERT_GUEST_RC_BREAK(rc); 670 rc = HGCMSvcGetPv(&paParms[idxParm++], &data.data.pvChecksum, &data.data.cbChecksum); 671 ASSERT_GUEST_RC_BREAK(rc); 672 VERIFY_BUFFER_SIZE_UINT32(paParms[idxParm], data.data.cbChecksum); 673 674 DO_HOST_CALLBACK(); 675 break; 676 } 677 case GUEST_DND_GH_SND_DATA: 678 { 679 LogFlowFunc(("GUEST_DND_GH_SND_DATA\n")); 585 680 586 681 switch (pClient->GetProtocolVer()) … … 588 683 case 3: 589 684 { 590 if (cParms == 4) 591 { 592 rc = HGCMSvcGetU32(&paParms[0], &data.hdr.uContextID); 593 if (RT_SUCCESS(rc)) 594 rc = HGCMSvcGetU32(&paParms[1], &data.uStatus); 595 if (RT_SUCCESS(rc)) 596 rc = HGCMSvcGetU32(&paParms[2], &data.uPercentage); 597 if (RT_SUCCESS(rc)) 598 rc = HGCMSvcGetU32(&paParms[3], &data.rc); 599 } 685 ASSERT_GUEST_BREAK(cParms == 5); 686 687 VBOXDNDCBSNDDATADATA data; 688 RT_ZERO(data); 689 data.hdr.uMagic = CB_MAGIC_DND_GH_SND_DATA; 690 691 GET_CONTEXT_ID_PARM0(); 692 rc = HGCMSvcGetPv(&paParms[idxParm++], (void**)&data.data.u.v3.pvData, &data.data.u.v3.cbData); 693 ASSERT_GUEST_RC_BREAK(rc); 694 VERIFY_BUFFER_SIZE_UINT32(paParms[idxParm++], data.data.u.v3.cbData); 695 rc = HGCMSvcGetPv(&paParms[idxParm++], (void**)&data.data.u.v3.pvChecksum, &data.data.u.v3.cbChecksum); 696 ASSERT_GUEST_RC_BREAK(rc); 697 VERIFY_BUFFER_SIZE_UINT32(paParms[idxParm], data.data.u.v3.cbChecksum); 698 699 DO_HOST_CALLBACK(); 600 700 break; 601 701 } … … 604 704 default: 605 705 { 606 if (cParms == 3) 607 { 608 rc = HGCMSvcGetU32(&paParms[0], &data.uStatus); 609 if (RT_SUCCESS(rc)) 610 rc = HGCMSvcGetU32(&paParms[1], &data.uPercentage); 611 if (RT_SUCCESS(rc)) 612 rc = HGCMSvcGetU32(&paParms[2], &data.rc); 613 } 706 ASSERT_GUEST_BREAK(cParms == 2); 707 708 VBOXDNDCBSNDDATADATA data; 709 RT_ZERO(data); 710 data.hdr.uMagic = CB_MAGIC_DND_GH_SND_DATA; 711 712 rc = HGCMSvcGetPv(&paParms[idxParm++], (void**)&data.data.u.v1.pvData, &data.data.u.v1.cbData); 713 ASSERT_GUEST_RC_BREAK(rc); 714 rc = HGCMSvcGetU32(&paParms[idxParm], &data.data.u.v1.cbTotalSize); 715 ASSERT_GUEST_RC_BREAK(rc); 716 717 DO_HOST_CALLBACK(); 614 718 break; 615 719 } 616 720 } 617 618 DO_HOST_CALLBACK();619 break;620 }621 #ifdef VBOX_WITH_DRAG_AND_DROP_GH622 case GUEST_DND_GH_ACK_PENDING:623 {624 LogFlowFunc(("GUEST_DND_GH_ACK_PENDING\n"));625 626 VBOXDNDCBGHACKPENDINGDATA data;627 RT_ZERO(data);628 data.hdr.uMagic = CB_MAGIC_DND_GH_ACK_PENDING;629 630 switch (pClient->GetProtocolVer())631 {632 case 3:633 {634 if (cParms == 5)635 {636 rc = HGCMSvcGetU32(&paParms[0], &data.hdr.uContextID);637 if (RT_SUCCESS(rc))638 rc = HGCMSvcGetU32(&paParms[1], &data.uDefAction);639 if (RT_SUCCESS(rc))640 rc = HGCMSvcGetU32(&paParms[2], &data.uAllActions);641 if (RT_SUCCESS(rc))642 rc = HGCMSvcGetPv(&paParms[3], (void**)&data.pszFormat, &data.cbFormat);643 VERIFY_BUFFER_SIZE_UINT32(paParms[4], data.cbFormat);644 }645 break;646 }647 648 case 2:649 default:650 {651 if (cParms == 3)652 {653 rc = HGCMSvcGetU32(&paParms[0], &data.uDefAction);654 if (RT_SUCCESS(rc))655 rc = HGCMSvcGetU32(&paParms[1], &data.uAllActions);656 if (RT_SUCCESS(rc))657 rc = HGCMSvcGetPv(&paParms[2], (void**)&data.pszFormat, &data.cbFormat);658 }659 break;660 }661 }662 663 DO_HOST_CALLBACK();664 break;665 }666 /* New since protocol v3. */667 case GUEST_DND_GH_SND_DATA_HDR:668 {669 LogFlowFunc(("GUEST_DND_GH_SND_DATA_HDR\n"));670 if (cParms == 12)671 {672 VBOXDNDCBSNDDATAHDRDATA data;673 RT_ZERO(data);674 data.hdr.uMagic = CB_MAGIC_DND_GH_SND_DATA_HDR;675 rc = HGCMSvcGetU32(&paParms[0], &data.hdr.uContextID);676 if (RT_SUCCESS(rc))677 rc = HGCMSvcGetU32(&paParms[1], &data.data.uFlags);678 if (RT_SUCCESS(rc))679 rc = HGCMSvcGetU32(&paParms[2], &data.data.uScreenId);680 if (RT_SUCCESS(rc))681 rc = HGCMSvcGetU64(&paParms[3], &data.data.cbTotal);682 if (RT_SUCCESS(rc))683 rc = HGCMSvcGetU32(&paParms[4], &data.data.cbMeta);684 if (RT_SUCCESS(rc))685 rc = HGCMSvcGetPv(&paParms[5], &data.data.pvMetaFmt, &data.data.cbMetaFmt);686 VERIFY_BUFFER_SIZE_UINT32(paParms[6], data.data.cbMetaFmt);687 if (RT_SUCCESS(rc))688 rc = HGCMSvcGetU64(&paParms[7], &data.data.cObjects);689 if (RT_SUCCESS(rc))690 rc = HGCMSvcGetU32(&paParms[8], &data.data.enmCompression);691 if (RT_SUCCESS(rc))692 rc = HGCMSvcGetU32(&paParms[9], (uint32_t *)&data.data.enmChecksumType);693 if (RT_SUCCESS(rc))694 rc = HGCMSvcGetPv(&paParms[10], &data.data.pvChecksum, &data.data.cbChecksum);695 VERIFY_BUFFER_SIZE_UINT32(paParms[11], data.data.cbChecksum);696 LogFlowFunc(("fFlags=0x%x, cbTotalSize=%RU64, cObj=%RU64\n",697 data.data.uFlags, data.data.cbTotal, data.data.cObjects));698 DO_HOST_CALLBACK();699 }700 break;701 }702 case GUEST_DND_GH_SND_DATA:703 {704 LogFlowFunc(("GUEST_DND_GH_SND_DATA\n"));705 switch (pClient->GetProtocolVer())706 {707 case 3:708 {709 if (cParms == 5)710 {711 VBOXDNDCBSNDDATADATA data;712 RT_ZERO(data);713 data.hdr.uMagic = CB_MAGIC_DND_GH_SND_DATA;714 rc = HGCMSvcGetU32(&paParms[0], &data.hdr.uContextID);715 if (RT_SUCCESS(rc))716 rc = HGCMSvcGetPv(&paParms[1], (void**)&data.data.u.v3.pvData, &data.data.u.v3.cbData);717 VERIFY_BUFFER_SIZE_UINT32(paParms[2], data.data.u.v3.cbData);718 if (RT_SUCCESS(rc))719 rc = HGCMSvcGetPv(&paParms[3], (void**)&data.data.u.v3.pvChecksum, &data.data.u.v3.cbChecksum);720 VERIFY_BUFFER_SIZE_UINT32(paParms[4], data.data.u.v3.cbChecksum);721 DO_HOST_CALLBACK();722 }723 break;724 }725 726 case 2:727 default:728 {729 if (cParms == 2)730 {731 VBOXDNDCBSNDDATADATA data;732 RT_ZERO(data);733 data.hdr.uMagic = CB_MAGIC_DND_GH_SND_DATA;734 rc = HGCMSvcGetPv(&paParms[0], (void**)&data.data.u.v1.pvData, &data.data.u.v1.cbData);735 if (RT_SUCCESS(rc))736 rc = HGCMSvcGetU32(&paParms[1], &data.data.u.v1.cbTotalSize);737 DO_HOST_CALLBACK();738 }739 break;740 }741 }742 721 break; 743 722 } … … 745 724 { 746 725 LogFlowFunc(("GUEST_DND_GH_SND_DIR\n")); 726 727 ASSERT_GUEST_BREAK(cParms >= 3); 747 728 748 729 VBOXDNDCBSNDDIRDATA data; … … 750 731 data.hdr.uMagic = CB_MAGIC_DND_GH_SND_DIR; 751 732 752 switch (pClient->GetProtocolVer()) 753 { 754 case 3: 755 { 756 if (cParms == 4) 757 { 758 rc = HGCMSvcGetU32(&paParms[0], &data.hdr.uContextID); 759 if (RT_SUCCESS(rc)) 760 rc = HGCMSvcGetPv(&paParms[1], (void**)&data.pszPath, &data.cbPath); 761 VERIFY_BUFFER_SIZE_UINT32(paParms[2], data.cbPath); 762 if (RT_SUCCESS(rc)) 763 rc = HGCMSvcGetU32(&paParms[3], &data.fMode); 764 } 765 break; 766 } 767 768 case 2: 769 default: 770 { 771 if (cParms == 3) 772 { 773 rc = HGCMSvcGetPv(&paParms[0], (void**)&data.pszPath, &data.cbPath); 774 VERIFY_BUFFER_SIZE_UINT32(paParms[1], data.cbPath); 775 if (RT_SUCCESS(rc)) 776 rc = HGCMSvcGetU32(&paParms[2], &data.fMode); 777 } 778 break; 779 } 780 } 733 GET_CONTEXT_ID_PARM0(); 734 rc = HGCMSvcGetPv(&paParms[idxParm++], (void**)&data.pszPath, &data.cbPath); 735 ASSERT_GUEST_RC_BREAK(rc); 736 VERIFY_BUFFER_SIZE_UINT32(paParms[idxParm++], data.cbPath); 737 rc = HGCMSvcGetU32(&paParms[idxParm], &data.fMode); 738 ASSERT_GUEST_RC_BREAK(rc); 781 739 782 740 DO_HOST_CALLBACK(); … … 787 745 { 788 746 LogFlowFunc(("GUEST_DND_GH_SND_FILE_HDR\n")); 789 if (cParms == 6) 790 { 791 VBOXDNDCBSNDFILEHDRDATA data; 792 RT_ZERO(data); 793 data.hdr.uMagic = CB_MAGIC_DND_GH_SND_FILE_HDR; 794 795 rc = HGCMSvcGetU32(&paParms[0], &data.hdr.uContextID); 796 if (RT_SUCCESS(rc)) 797 rc = HGCMSvcGetPv(&paParms[1], (void**)&data.pszFilePath, &data.cbFilePath); 798 VERIFY_BUFFER_SIZE_UINT32(paParms[2], data.cbFilePath); 799 if (RT_SUCCESS(rc)) 800 rc = HGCMSvcGetU32(&paParms[3], &data.fFlags); 801 if (RT_SUCCESS(rc)) 802 rc = HGCMSvcGetU32(&paParms[4], &data.fMode); 803 if (RT_SUCCESS(rc)) 804 rc = HGCMSvcGetU64(&paParms[5], &data.cbSize); 805 806 LogFlowFunc(("pszPath=%s, cbPath=%RU32, fMode=0x%x, cbSize=%RU64\n", 807 data.pszFilePath, data.cbFilePath, data.fMode, data.cbSize)); 808 DO_HOST_CALLBACK(); 809 } 747 748 ASSERT_GUEST_BREAK(cParms == 6); 749 750 VBOXDNDCBSNDFILEHDRDATA data; 751 RT_ZERO(data); 752 data.hdr.uMagic = CB_MAGIC_DND_GH_SND_FILE_HDR; 753 754 GET_CONTEXT_ID_PARM0(); 755 rc = HGCMSvcGetPv(&paParms[idxParm++], (void**)&data.pszFilePath, &data.cbFilePath); 756 ASSERT_GUEST_RC_BREAK(rc); 757 VERIFY_BUFFER_SIZE_UINT32(paParms[idxParm++], data.cbFilePath); 758 rc = HGCMSvcGetU32(&paParms[idxParm++], &data.fFlags); 759 ASSERT_GUEST_RC_BREAK(rc); 760 rc = HGCMSvcGetU32(&paParms[idxParm++], &data.fMode); 761 ASSERT_GUEST_RC_BREAK(rc); 762 rc = HGCMSvcGetU64(&paParms[idxParm], &data.cbSize); 763 ASSERT_GUEST_RC_BREAK(rc); 764 765 DO_HOST_CALLBACK(); 810 766 break; 811 767 } … … 819 775 case 3: 820 776 { 821 if (cParms == 5) 822 { 823 VBOXDNDCBSNDFILEDATADATA data; 824 RT_ZERO(data); 825 data.hdr.uMagic = CB_MAGIC_DND_GH_SND_FILE_DATA; 826 827 rc = HGCMSvcGetU32(&paParms[0], &data.hdr.uContextID); 828 if (RT_SUCCESS(rc)) 829 rc = HGCMSvcGetPv(&paParms[1], (void**)&data.pvData, &data.cbData); 830 VERIFY_BUFFER_SIZE_UINT32(paParms[2], data.cbData); 831 if (RT_SUCCESS(rc)) 832 rc = HGCMSvcGetPv(&paParms[3], (void**)&data.u.v3.pvChecksum, &data.u.v3.cbChecksum); 833 VERIFY_BUFFER_SIZE_UINT32(paParms[4], data.u.v3.cbChecksum); 834 835 LogFlowFunc(("pvData=0x%p, cbData=%RU32\n", data.pvData, data.cbData)); 836 DO_HOST_CALLBACK(); 837 } 777 ASSERT_GUEST_BREAK(cParms == 5); 778 779 VBOXDNDCBSNDFILEDATADATA data; 780 RT_ZERO(data); 781 data.hdr.uMagic = CB_MAGIC_DND_GH_SND_FILE_DATA; 782 783 GET_CONTEXT_ID_PARM0(); 784 rc = HGCMSvcGetPv(&paParms[idxParm++], (void**)&data.pvData, &data.cbData); 785 ASSERT_GUEST_RC_BREAK(rc); 786 VERIFY_BUFFER_SIZE_UINT32(paParms[idxParm++], data.cbData); 787 rc = HGCMSvcGetPv(&paParms[idxParm++], (void**)&data.u.v3.pvChecksum, &data.u.v3.cbChecksum); 788 ASSERT_GUEST_RC_BREAK(rc); 789 VERIFY_BUFFER_SIZE_UINT32(paParms[idxParm], data.u.v3.cbChecksum); 790 791 DO_HOST_CALLBACK(); 838 792 break; 839 793 } … … 841 795 case 2: 842 796 { 843 if (cParms == 3) 844 { 845 VBOXDNDCBSNDFILEDATADATA data; 846 RT_ZERO(data); 847 data.hdr.uMagic = CB_MAGIC_DND_GH_SND_FILE_DATA; 848 rc = HGCMSvcGetU32(&paParms[0], &data.hdr.uContextID); 849 if (RT_SUCCESS(rc)) 850 rc = HGCMSvcGetPv(&paParms[1], (void**)&data.pvData, &data.cbData); 851 VERIFY_BUFFER_SIZE_UINT32(paParms[2], data.cbData); 852 853 LogFlowFunc(("cbData=%RU32, pvData=0x%p\n", data.cbData, data.pvData)); 854 DO_HOST_CALLBACK(); 855 } 797 ASSERT_GUEST_BREAK(cParms == 3); 798 799 VBOXDNDCBSNDFILEDATADATA data; 800 RT_ZERO(data); 801 data.hdr.uMagic = CB_MAGIC_DND_GH_SND_FILE_DATA; 802 803 GET_CONTEXT_ID_PARM0(); 804 rc = HGCMSvcGetPv(&paParms[idxParm++], (void**)&data.pvData, &data.cbData); 805 ASSERT_GUEST_RC_BREAK(rc); 806 VERIFY_BUFFER_SIZE_UINT32(paParms[idxParm], data.cbData); 807 808 DO_HOST_CALLBACK(); 856 809 break; 857 810 } … … 859 812 default: 860 813 { 861 if (cParms == 5) 862 { 863 VBOXDNDCBSNDFILEDATADATA data; 864 RT_ZERO(data); 865 data.hdr.uMagic = CB_MAGIC_DND_GH_SND_FILE_DATA; 866 rc = HGCMSvcGetPv(&paParms[0], (void**)&data.u.v1.pszFilePath, &data.u.v1.cbFilePath); 867 VERIFY_BUFFER_SIZE_UINT32(paParms[1], data.u.v1.cbFilePath); 868 if (RT_SUCCESS(rc)) 869 rc = HGCMSvcGetPv(&paParms[2], (void**)&data.pvData, &data.cbData); 870 VERIFY_BUFFER_SIZE_UINT32(paParms[3], data.cbData); 871 if (RT_SUCCESS(rc)) 872 rc = HGCMSvcGetU32(&paParms[4], &data.u.v1.fMode); 873 874 LogFlowFunc(("pszFilePath=%s, cbData=%RU32, pvData=0x%p, fMode=0x%x\n", 875 data.u.v1.pszFilePath, data.cbData, data.pvData, data.u.v1.fMode)); 876 DO_HOST_CALLBACK(); 877 } 814 ASSERT_GUEST_BREAK(cParms == 5); 815 816 VBOXDNDCBSNDFILEDATADATA data; 817 RT_ZERO(data); 818 data.hdr.uMagic = CB_MAGIC_DND_GH_SND_FILE_DATA; 819 820 rc = HGCMSvcGetPv(&paParms[idxParm++], (void**)&data.u.v1.pszFilePath, &data.u.v1.cbFilePath); 821 ASSERT_GUEST_RC_BREAK(rc); 822 VERIFY_BUFFER_SIZE_UINT32(paParms[idxParm++], data.u.v1.cbFilePath); 823 rc = HGCMSvcGetPv(&paParms[idxParm++], (void**)&data.pvData, &data.cbData); 824 ASSERT_GUEST_RC_BREAK(rc); 825 VERIFY_BUFFER_SIZE_UINT32(paParms[idxParm++], data.cbData); 826 rc = HGCMSvcGetU32(&paParms[idxParm], &data.u.v1.fMode); 827 ASSERT_GUEST_RC_BREAK(rc); 828 829 DO_HOST_CALLBACK(); 878 830 break; 879 831 } … … 885 837 LogFlowFunc(("GUEST_DND_GH_EVT_ERROR\n")); 886 838 839 ASSERT_GUEST_BREAK(cParms >= 1); 840 887 841 VBOXDNDCBEVTERRORDATA data; 888 842 RT_ZERO(data); 889 843 data.hdr.uMagic = CB_MAGIC_DND_GH_EVT_ERROR; 890 844 891 switch (pClient->GetProtocolVer()) 892 { 893 case 3: 894 { 895 if (cParms == 2) 896 { 897 rc = HGCMSvcGetU32(&paParms[0], &data.hdr.uContextID); 898 if (RT_SUCCESS(rc)) 899 { 900 uint32_t rcOp; 901 rc = HGCMSvcGetU32(&paParms[1], &rcOp); 902 if (RT_SUCCESS(rc)) 903 data.rc = rcOp; 904 } 905 } 906 break; 907 } 908 909 case 2: 910 default: 911 { 912 if (cParms == 1) 913 { 914 uint32_t rcOp; 915 rc = HGCMSvcGetU32(&paParms[0], &rcOp); 916 if (RT_SUCCESS(rc)) 917 data.rc = (int32_t)rcOp; 918 } 919 break; 920 } 921 } 845 GET_CONTEXT_ID_PARM0(); 846 rc = HGCMSvcGetU32(&paParms[idxParm], (uint32_t *)&data.rc); 847 ASSERT_GUEST_RC_BREAK(rc); 922 848 923 849 DO_HOST_CALLBACK();
Note:
See TracChangeset
for help on using the changeset viewer.