Changeset 55527 in vbox for trunk/src/VBox/HostServices/DragAndDrop/service.cpp
- Timestamp:
- Apr 29, 2015 4:14:05 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/DragAndDrop/service.cpp
r55422 r55527 320 320 #endif 321 321 322 #define DO_HOST_CALLBACK(); \ 323 if ( RT_SUCCESS(rc) \ 324 && m_pfnHostCallback) \ 325 { \ 326 rc = m_pfnHostCallback(m_pvHostData, u32Function, &data, sizeof(data)); \ 327 } 328 322 329 if (rc == VINF_SUCCESS) /* Note: rc might be VINF_HGCM_ASYNC_EXECUTE! */ 323 330 { … … 391 398 { 392 399 uint32_t uProtocol; 393 paParms[0].getUInt32(&uProtocol); /* Get protocol version. */394 395 rc = pClient->setProtocol(uProtocol);400 rc = paParms[0].getUInt32(&uProtocol); /* Get protocol version. */ 401 if (RT_SUCCESS(rc)) 402 rc = pClient->setProtocol(uProtocol); 396 403 if (RT_SUCCESS(rc)) 397 404 { … … 414 421 DragAndDropSvc::VBOXDNDCBHGACKOPDATA data; 415 422 data.hdr.u32Magic = DragAndDropSvc::CB_MAGIC_DND_HG_ACK_OP; 416 paParms[0].getUInt32(&data.uAction); /* Get drop action. */ 417 if (m_pfnHostCallback) 418 rc = m_pfnHostCallback(m_pvHostData, u32Function, &data, sizeof(data)); 423 rc = paParms[0].getUInt32(&data.uAction); /* Get drop action. */ 424 DO_HOST_CALLBACK(); 419 425 } 420 426 break; … … 431 437 data.hdr.u32Magic = DragAndDropSvc::CB_MAGIC_DND_HG_REQ_DATA; 432 438 uint32_t cTmp; 433 paParms[0].getPointer((void**)&data.pszFormat, &cTmp); 434 if (m_pfnHostCallback) 435 rc = m_pfnHostCallback(m_pvHostData, u32Function, &data, sizeof(data)); 439 rc = paParms[0].getPointer((void**)&data.pszFormat, &cTmp); 440 DO_HOST_CALLBACK(); 436 441 } 437 442 break; … … 449 454 DragAndDropSvc::VBOXDNDCBHGEVTPROGRESSDATA data; 450 455 data.hdr.u32Magic = DragAndDropSvc::CB_MAGIC_DND_HG_EVT_PROGRESS; 451 paParms[0].getUInt32(&data.uStatus); 452 paParms[1].getUInt32(&data.uPercentage); 453 paParms[2].getUInt32(&data.rc); 454 if (m_pfnHostCallback) 455 rc = m_pfnHostCallback(m_pvHostData, u32Function, &data, sizeof(data)); 456 rc = paParms[0].getUInt32(&data.uStatus); 457 if (RT_SUCCESS(rc)) 458 rc = paParms[1].getUInt32(&data.uPercentage); 459 if (RT_SUCCESS(rc)) 460 rc = paParms[2].getUInt32(&data.rc); 461 DO_HOST_CALLBACK(); 456 462 } 457 463 break; … … 470 476 DragAndDropSvc::VBOXDNDCBGHACKPENDINGDATA data; 471 477 data.hdr.u32Magic = DragAndDropSvc::CB_MAGIC_DND_GH_ACK_PENDING; 472 paParms[0].getUInt32(&data.uDefAction); 473 paParms[1].getUInt32(&data.uAllActions); 474 uint32_t cTmp; 475 paParms[2].getPointer((void**)&data.pszFormat, &cTmp); 476 if (m_pfnHostCallback) 477 rc = m_pfnHostCallback(m_pvHostData, u32Function, &data, sizeof(data)); 478 rc = paParms[0].getUInt32(&data.uDefAction); 479 if (RT_SUCCESS(rc)) 480 rc = paParms[1].getUInt32(&data.uAllActions); 481 if (RT_SUCCESS(rc)) 482 { 483 uint32_t cTmp; 484 rc = paParms[2].getPointer((void**)&data.pszFormat, &cTmp); 485 } 486 DO_HOST_CALLBACK(); 478 487 } 479 488 break; … … 490 499 DragAndDropSvc::VBOXDNDCBSNDDATADATA data; 491 500 data.hdr.u32Magic = DragAndDropSvc::CB_MAGIC_DND_GH_SND_DATA; 492 paParms[0].getPointer((void**)&data.pvData, &data.cbData);493 paParms[1].getUInt32(&data.cbTotalSize);494 if (m_pfnHostCallback)495 rc = m_pfnHostCallback(m_pvHostData, u32Function, &data, sizeof(data));501 rc = paParms[0].getPointer((void**)&data.pvData, &data.cbData); 502 if (RT_SUCCESS(rc)) 503 rc = paParms[1].getUInt32(&data.cbTotalSize); 504 DO_HOST_CALLBACK(); 496 505 } 497 506 break; … … 510 519 data.hdr.u32Magic = DragAndDropSvc::CB_MAGIC_DND_GH_SND_DIR; 511 520 uint32_t cTmp; 512 paParms[0].getPointer((void**)&data.pszPath, &cTmp); 513 paParms[1].getUInt32(&data.cbPath); 514 paParms[2].getUInt32(&data.fMode); 521 rc = paParms[0].getPointer((void**)&data.pszPath, &cTmp); 522 if (RT_SUCCESS(rc)) 523 rc = paParms[1].getUInt32(&data.cbPath); 524 if (RT_SUCCESS(rc)) 525 rc = paParms[2].getUInt32(&data.fMode); 515 526 516 527 LogFlowFunc(("pszPath=%s, cbPath=%RU32, fMode=0x%x\n", data.pszPath, data.cbPath, data.fMode)); 517 if (m_pfnHostCallback) 518 rc = m_pfnHostCallback(m_pvHostData, u32Function, &data, sizeof(data)); 528 DO_HOST_CALLBACK(); 519 529 } 520 530 break; … … 538 548 uint32_t cTmp; 539 549 /* paParms[0] is context ID; unused yet. */ 540 paParms[1].getPointer((void**)&data.pszFilePath, &cTmp); 541 paParms[2].getUInt32(&data.cbFilePath); 542 paParms[3].getUInt32(&data.fFlags); 543 paParms[4].getUInt32(&data.fMode); 544 paParms[5].getUInt64(&data.cbSize); 550 rc = paParms[1].getPointer((void**)&data.pszFilePath, &cTmp); 551 if (RT_SUCCESS(rc)) 552 rc = paParms[2].getUInt32(&data.cbFilePath); 553 if (RT_SUCCESS(rc)) 554 rc = paParms[3].getUInt32(&data.fFlags); 555 if (RT_SUCCESS(rc)) 556 rc = paParms[4].getUInt32(&data.fMode); 557 if (RT_SUCCESS(rc)) 558 rc = paParms[5].getUInt64(&data.cbSize); 545 559 546 560 LogFlowFunc(("pszPath=%s, cbPath=%RU32, fMode=0x%x, cbSize=%RU64\n", 547 561 data.pszFilePath, data.cbFilePath, data.fMode, data.cbSize)); 548 549 if (m_pfnHostCallback) 550 rc = m_pfnHostCallback(m_pvHostData, u32Function, &data, sizeof(data)); 562 DO_HOST_CALLBACK(); 551 563 } 552 564 break; … … 572 584 data.hdr.u32Magic = DragAndDropSvc::CB_MAGIC_DND_GH_SND_FILE_DATA; 573 585 /* paParms[0] is context ID; unused yet. */ 574 paParms[1].getPointer((void**)&data.pvData, &data.cbData); 575 paParms[2].getUInt32(&data.cbData); 586 rc = paParms[1].getPointer((void**)&data.pvData, &data.cbData); 587 if (RT_SUCCESS(rc)) 588 rc = paParms[2].getUInt32(&data.cbData); 576 589 577 590 LogFlowFunc(("cbData=%RU32, pvData=0x%p\n", data.cbData, data.pvData)); 578 579 if (m_pfnHostCallback) 580 rc = m_pfnHostCallback(m_pvHostData, u32Function, &data, sizeof(data)); 591 DO_HOST_CALLBACK(); 581 592 } 582 593 break; … … 598 609 data.hdr.u32Magic = DragAndDropSvc::CB_MAGIC_DND_GH_SND_FILE_DATA; 599 610 uint32_t cTmp; 600 paParms[0].getPointer((void**)&data.u.v1.pszFilePath, &cTmp); 601 paParms[1].getUInt32(&data.u.v1.cbFilePath); 602 paParms[2].getPointer((void**)&data.pvData, &cTmp); 603 paParms[3].getUInt32(&data.cbData); 604 paParms[4].getUInt32(&data.u.v1.fMode); 611 rc = paParms[0].getPointer((void**)&data.u.v1.pszFilePath, &cTmp); 612 if (RT_SUCCESS(rc)) 613 rc = paParms[1].getUInt32(&data.u.v1.cbFilePath); 614 if (RT_SUCCESS(rc)) 615 rc = paParms[2].getPointer((void**)&data.pvData, &cTmp); 616 if (RT_SUCCESS(rc)) 617 rc = paParms[3].getUInt32(&data.cbData); 618 if (RT_SUCCESS(rc)) 619 rc = paParms[4].getUInt32(&data.u.v1.fMode); 605 620 606 621 LogFlowFunc(("pszFilePath=%s, cbData=%RU32, pvData=0x%p, fMode=0x%x\n", 607 622 data.u.v1.pszFilePath, data.cbData, data.pvData, data.u.v1.fMode)); 608 609 if (m_pfnHostCallback) 610 rc = m_pfnHostCallback(m_pvHostData, u32Function, &data, sizeof(data)); 623 DO_HOST_CALLBACK(); 611 624 } 612 625 break; … … 627 640 628 641 uint32_t rcOp; 629 paParms[0].getUInt32(&rcOp);630 data.rc = rcOp;631 632 if (m_pfnHostCallback) 633 rc = m_pfnHostCallback(m_pvHostData, u32Function, &data, sizeof(data));642 rc = paParms[0].getUInt32(&rcOp); 643 if (RT_SUCCESS(rc)) 644 data.rc = rcOp; 645 646 DO_HOST_CALLBACK(); 634 647 } 635 648 break;
Note:
See TracChangeset
for help on using the changeset viewer.