Changeset 45109 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Mar 20, 2013 4:41:00 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 84401
- Location:
- trunk/src/VBox/Additions/common
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibGuestCtrl.cpp
r45018 r45109 186 186 187 187 188 VBGLR3DECL(int) VbglR3GuestCtrlSessionNotify( uint32_t uClientId, uint32_t uContext,188 VBGLR3DECL(int) VbglR3GuestCtrlSessionNotify(PVBGLR3GUESTCTRLCMDCTX pCtx, 189 189 uint32_t uType, uint32_t uResult) 190 190 { 191 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); 192 191 193 HGCMMsgSessionNotify Msg; 192 194 193 195 Msg.hdr.result = VERR_WRONG_ORDER; 194 Msg.hdr.u32ClientID = uClientId;196 Msg.hdr.u32ClientID = pCtx->uClientID; 195 197 Msg.hdr.u32Function = GUEST_SESSION_NOTIFY; 196 198 Msg.hdr.cParms = 3; 197 199 198 VbglHGCMParmUInt32Set(&Msg.context, uContext);200 VbglHGCMParmUInt32Set(&Msg.context, pCtx->uContextID); 199 201 VbglHGCMParmUInt32Set(&Msg.type, uType); 200 202 VbglHGCMParmUInt32Set(&Msg.result, uResult); … … 215 217 * 216 218 * @return IPRT status code. 217 * @param p HostCtx Host context.219 * @param pCtx Host context. 218 220 ** @todo Docs! 219 221 */ 220 VBGLR3DECL(int) VbglR3GuestCtrlSessionGetOpen(PVBGLR3GUESTCTRL HOSTCTX pHostCtx,222 VBGLR3DECL(int) VbglR3GuestCtrlSessionGetOpen(PVBGLR3GUESTCTRLCMDCTX pCtx, 221 223 uint32_t *puProtocol, 222 224 char *pszUser, uint32_t cbUser, … … 225 227 uint32_t *puFlags, uint32_t *puSessionID) 226 228 { 227 AssertPtrReturn(p HostCtx, VERR_INVALID_POINTER);228 AssertReturn(p HostCtx->uNumParms == 6, VERR_INVALID_PARAMETER);229 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); 230 AssertReturn(pCtx->uNumParms == 6, VERR_INVALID_PARAMETER); 229 231 230 232 AssertPtrReturn(puProtocol, VERR_INVALID_POINTER); … … 237 239 238 240 Msg.hdr.result = VERR_WRONG_ORDER; 239 Msg.hdr.u32ClientID = p HostCtx->uClientID;240 Msg.hdr.u32Function = GUEST_MSG_WAIT; 241 Msg.hdr.cParms = p HostCtx->uNumParms;241 Msg.hdr.u32ClientID = pCtx->uClientID; 242 Msg.hdr.u32Function = GUEST_MSG_WAIT; 243 Msg.hdr.cParms = pCtx->uNumParms; 242 244 243 245 VbglHGCMParmUInt32Set(&Msg.context, 0); … … 258 260 else 259 261 { 260 Msg.context.GetUInt32(&p HostCtx->uContextID);262 Msg.context.GetUInt32(&pCtx->uContextID); 261 263 Msg.protocol.GetUInt32(puProtocol); 262 264 Msg.flags.GetUInt32(puFlags); 263 265 264 266 if (puSessionID) 265 *puSessionID = VBOX_GUESTCTRL_CONTEXTID_GET_SESSION(p HostCtx->uContextID);267 *puSessionID = VBOX_GUESTCTRL_CONTEXTID_GET_SESSION(pCtx->uContextID); 266 268 } 267 269 } … … 275 277 * 276 278 * @return IPRT status code. 277 * @param p HostCtx Host context.279 * @param pCtx Host context. 278 280 ** @todo Docs! 279 281 */ 280 VBGLR3DECL(int) VbglR3GuestCtrlSessionGetClose(PVBGLR3GUESTCTRL HOSTCTX pHostCtx, uint32_t *puFlags, uint32_t *puSessionID)281 { 282 AssertPtrReturn(p HostCtx, VERR_INVALID_POINTER);283 AssertReturn(p HostCtx->uNumParms == 2, VERR_INVALID_PARAMETER);282 VBGLR3DECL(int) VbglR3GuestCtrlSessionGetClose(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t *puFlags, uint32_t *puSessionID) 283 { 284 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); 285 AssertReturn(pCtx->uNumParms == 2, VERR_INVALID_PARAMETER); 284 286 285 287 AssertPtrReturn(puFlags, VERR_INVALID_POINTER); … … 288 290 289 291 Msg.hdr.result = VERR_WRONG_ORDER; 290 Msg.hdr.u32ClientID = p HostCtx->uClientID;291 Msg.hdr.u32Function = GUEST_MSG_WAIT; 292 Msg.hdr.cParms = p HostCtx->uNumParms;292 Msg.hdr.u32ClientID = pCtx->uClientID; 293 Msg.hdr.u32Function = GUEST_MSG_WAIT; 294 Msg.hdr.cParms = pCtx->uNumParms; 293 295 294 296 VbglHGCMParmUInt32Set(&Msg.context, 0); … … 305 307 else 306 308 { 307 Msg.context.GetUInt32(&p HostCtx->uContextID);309 Msg.context.GetUInt32(&pCtx->uContextID); 308 310 Msg.flags.GetUInt32(puFlags); 309 311 310 312 if (puSessionID) 311 *puSessionID = VBOX_GUESTCTRL_CONTEXTID_GET_SESSION(p HostCtx->uContextID);313 *puSessionID = VBOX_GUESTCTRL_CONTEXTID_GET_SESSION(pCtx->uContextID); 312 314 } 313 315 } … … 326 328 ** @todo Move the parameters in an own struct! 327 329 */ 328 VBGLR3DECL(int) VbglR3GuestCtrlProcGetStart(PVBGLR3GUESTCTRL HOSTCTX pHostCtx,330 VBGLR3DECL(int) VbglR3GuestCtrlProcGetStart(PVBGLR3GUESTCTRLCMDCTX pCtx, 329 331 char *pszCmd, uint32_t cbCmd, 330 332 uint32_t *puFlags, … … 337 339 uint64_t *puAffinity, uint32_t cbAffinity, uint32_t *pcAffinity) 338 340 { 339 AssertPtrReturn(p HostCtx, VERR_INVALID_POINTER);341 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); 340 342 341 343 AssertPtrReturn(pszCmd, VERR_INVALID_POINTER); … … 351 353 352 354 Msg.hdr.result = VERR_WRONG_ORDER; 353 Msg.hdr.u32ClientID = p HostCtx->uClientID;354 Msg.hdr.u32Function = GUEST_MSG_WAIT; 355 Msg.hdr.cParms = p HostCtx->uNumParms;355 Msg.hdr.u32ClientID = pCtx->uClientID; 356 Msg.hdr.u32Function = GUEST_MSG_WAIT; 357 Msg.hdr.cParms = pCtx->uNumParms; 356 358 357 359 VbglHGCMParmUInt32Set(&Msg.context, 0); … … 363 365 VbglHGCMParmUInt32Set(&Msg.cb_env, 0); 364 366 VbglHGCMParmPtrSet(&Msg.env, pszEnv, *pcbEnv); 365 if (p HostCtx->uProtocol < 2)367 if (pCtx->uProtocol < 2) 366 368 { 367 369 AssertPtrReturn(pszUser, VERR_INVALID_POINTER); … … 395 397 else 396 398 { 397 Msg.context.GetUInt32(&p HostCtx->uContextID);399 Msg.context.GetUInt32(&pCtx->uContextID); 398 400 Msg.flags.GetUInt32(puFlags); 399 401 Msg.num_args.GetUInt32(pcArgs); 400 402 Msg.num_env.GetUInt32(pcEnvVars); 401 403 Msg.cb_env.GetUInt32(pcbEnv); 402 if (p HostCtx->uProtocol < 2)404 if (pCtx->uProtocol < 2) 403 405 { 404 406 Msg.u.v1.timeout.GetUInt32(puTimeoutMS); … … 424 426 ** @todo Docs! 425 427 */ 426 VBGLR3DECL(int) VbglR3GuestCtrlProcGetOutput(PVBGLR3GUESTCTRL HOSTCTX pHostCtx,428 VBGLR3DECL(int) VbglR3GuestCtrlProcGetOutput(PVBGLR3GUESTCTRLCMDCTX pCtx, 427 429 uint32_t *puPID, uint32_t *puHandle, uint32_t *puFlags) 428 430 { 429 AssertPtrReturn(p HostCtx, VERR_INVALID_POINTER);430 AssertReturn(p HostCtx->uNumParms == 4, VERR_INVALID_PARAMETER);431 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); 432 AssertReturn(pCtx->uNumParms == 4, VERR_INVALID_PARAMETER); 431 433 432 434 AssertPtrReturn(puPID, VERR_INVALID_POINTER); … … 437 439 438 440 Msg.hdr.result = VERR_WRONG_ORDER; 439 Msg.hdr.u32ClientID = p HostCtx->uClientID;440 Msg.hdr.u32Function = GUEST_MSG_WAIT; 441 Msg.hdr.cParms = p HostCtx->uNumParms;441 Msg.hdr.u32ClientID = pCtx->uClientID; 442 Msg.hdr.u32Function = GUEST_MSG_WAIT; 443 Msg.hdr.cParms = pCtx->uNumParms; 442 444 443 445 VbglHGCMParmUInt32Set(&Msg.context, 0); … … 456 458 else 457 459 { 458 Msg.context.GetUInt32(&p HostCtx->uContextID);460 Msg.context.GetUInt32(&pCtx->uContextID); 459 461 Msg.pid.GetUInt32(puPID); 460 462 Msg.handle.GetUInt32(puHandle); … … 475 477 ** @todo Docs! 476 478 */ 477 VBGLR3DECL(int) VbglR3GuestCtrlProcGetInput(PVBGLR3GUESTCTRL HOSTCTX pHostCtx,479 VBGLR3DECL(int) VbglR3GuestCtrlProcGetInput(PVBGLR3GUESTCTRLCMDCTX pCtx, 478 480 uint32_t *puPID, uint32_t *puFlags, 479 481 void *pvData, uint32_t cbData, 480 482 uint32_t *pcbSize) 481 483 { 482 AssertPtrReturn(p HostCtx, VERR_INVALID_POINTER);483 AssertReturn(p HostCtx->uNumParms == 5, VERR_INVALID_PARAMETER);484 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); 485 AssertReturn(pCtx->uNumParms == 5, VERR_INVALID_PARAMETER); 484 486 485 487 AssertPtrReturn(puPID, VERR_INVALID_POINTER); … … 491 493 492 494 Msg.hdr.result = VERR_WRONG_ORDER; 493 Msg.hdr.u32ClientID = p HostCtx->uClientID;494 Msg.hdr.u32Function = GUEST_MSG_WAIT; 495 Msg.hdr.cParms = p HostCtx->uNumParms;495 Msg.hdr.u32ClientID = pCtx->uClientID; 496 Msg.hdr.u32Function = GUEST_MSG_WAIT; 497 Msg.hdr.cParms = pCtx->uNumParms; 496 498 497 499 VbglHGCMParmUInt32Set(&Msg.context, 0); … … 511 513 else 512 514 { 513 Msg.context.GetUInt32(&p HostCtx->uContextID);515 Msg.context.GetUInt32(&pCtx->uContextID); 514 516 Msg.pid.GetUInt32(puPID); 515 517 Msg.flags.GetUInt32(puFlags); … … 521 523 522 524 523 VBGLR3DECL(int) VbglR3GuestCtrlFileGetOpen(PVBGLR3GUESTCTRL HOSTCTX pHostCtx,525 VBGLR3DECL(int) VbglR3GuestCtrlFileGetOpen(PVBGLR3GUESTCTRLCMDCTX pCtx, 524 526 char *pszFileName, uint32_t cbFileName, 525 527 char *pszOpenMode, uint32_t cbOpenMode, … … 528 530 uint64_t *puOffset) 529 531 { 530 AssertPtrReturn(p HostCtx, VERR_INVALID_POINTER);531 AssertReturn(p HostCtx->uNumParms == 6, VERR_INVALID_PARAMETER);532 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); 533 AssertReturn(pCtx->uNumParms == 6, VERR_INVALID_PARAMETER); 532 534 533 535 AssertPtrReturn(pszFileName, VERR_INVALID_POINTER); … … 543 545 544 546 Msg.hdr.result = VERR_WRONG_ORDER; 545 Msg.hdr.u32ClientID = p HostCtx->uClientID;546 Msg.hdr.u32Function = GUEST_MSG_WAIT; 547 Msg.hdr.cParms = p HostCtx->uNumParms;547 Msg.hdr.u32ClientID = pCtx->uClientID; 548 Msg.hdr.u32Function = GUEST_MSG_WAIT; 549 Msg.hdr.cParms = pCtx->uNumParms; 548 550 549 551 VbglHGCMParmUInt32Set(&Msg.context, 0); … … 564 566 else 565 567 { 566 Msg.context.GetUInt32(&p HostCtx->uContextID);568 Msg.context.GetUInt32(&pCtx->uContextID); 567 569 Msg.creationmode.GetUInt32(puCreationMode); 568 570 Msg.offset.GetUInt64(puOffset); … … 573 575 574 576 575 VBGLR3DECL(int) VbglR3GuestCtrlFileGetClose(PVBGLR3GUESTCTRL HOSTCTX pHostCtx, uint32_t *puHandle)576 { 577 AssertPtrReturn(p HostCtx, VERR_INVALID_POINTER);578 579 AssertReturn(p HostCtx->uNumParms == 2, VERR_INVALID_PARAMETER);577 VBGLR3DECL(int) VbglR3GuestCtrlFileGetClose(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t *puHandle) 578 { 579 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); 580 581 AssertReturn(pCtx->uNumParms == 2, VERR_INVALID_PARAMETER); 580 582 AssertPtrReturn(puHandle, VERR_INVALID_POINTER); 581 583 … … 583 585 584 586 Msg.hdr.result = VERR_WRONG_ORDER; 585 Msg.hdr.u32ClientID = p HostCtx->uClientID;586 Msg.hdr.u32Function = GUEST_MSG_WAIT; 587 Msg.hdr.cParms = p HostCtx->uNumParms;587 Msg.hdr.u32ClientID = pCtx->uClientID; 588 Msg.hdr.u32Function = GUEST_MSG_WAIT; 589 Msg.hdr.cParms = pCtx->uNumParms; 588 590 589 591 VbglHGCMParmUInt32Set(&Msg.context, 0); … … 600 602 else 601 603 { 602 Msg.context.GetUInt32(&p HostCtx->uContextID);604 Msg.context.GetUInt32(&pCtx->uContextID); 603 605 Msg.handle.GetUInt32(puHandle); 604 606 } … … 608 610 609 611 610 VBGLR3DECL(int) VbglR3GuestCtrlFileGetRead(PVBGLR3GUESTCTRL HOSTCTX pHostCtx,612 VBGLR3DECL(int) VbglR3GuestCtrlFileGetRead(PVBGLR3GUESTCTRLCMDCTX pCtx, 611 613 uint32_t *puHandle, uint32_t *puToRead) 612 614 { 613 AssertPtrReturn(p HostCtx, VERR_INVALID_POINTER);614 615 AssertReturn(p HostCtx->uNumParms == 4, VERR_INVALID_PARAMETER);615 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); 616 617 AssertReturn(pCtx->uNumParms == 3, VERR_INVALID_PARAMETER); 616 618 AssertPtrReturn(puHandle, VERR_INVALID_POINTER); 617 619 AssertPtrReturn(puToRead, VERR_INVALID_POINTER); … … 620 622 621 623 Msg.hdr.result = VERR_WRONG_ORDER; 622 Msg.hdr.u32ClientID = p HostCtx->uClientID;623 Msg.hdr.u32Function = GUEST_MSG_WAIT; 624 Msg.hdr.cParms = p HostCtx->uNumParms;624 Msg.hdr.u32ClientID = pCtx->uClientID; 625 Msg.hdr.u32Function = GUEST_MSG_WAIT; 626 Msg.hdr.cParms = pCtx->uNumParms; 625 627 626 628 VbglHGCMParmUInt32Set(&Msg.context, 0); … … 638 640 else 639 641 { 640 Msg.context.GetUInt32(&p HostCtx->uContextID);642 Msg.context.GetUInt32(&pCtx->uContextID); 641 643 Msg.handle.GetUInt32(puHandle); 642 644 Msg.size.GetUInt32(puToRead); … … 647 649 648 650 649 VBGLR3DECL(int) VbglR3GuestCtrlFileGetReadAt(PVBGLR3GUESTCTRL HOSTCTX pHostCtx,651 VBGLR3DECL(int) VbglR3GuestCtrlFileGetReadAt(PVBGLR3GUESTCTRLCMDCTX pCtx, 650 652 uint32_t *puHandle, uint32_t *puToRead, uint64_t *puOffset) 651 653 { 652 AssertPtrReturn(p HostCtx, VERR_INVALID_POINTER);653 654 AssertReturn(p HostCtx->uNumParms == 5, VERR_INVALID_PARAMETER);654 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); 655 656 AssertReturn(pCtx->uNumParms == 4, VERR_INVALID_PARAMETER); 655 657 AssertPtrReturn(puHandle, VERR_INVALID_POINTER); 656 658 AssertPtrReturn(puToRead, VERR_INVALID_POINTER); 657 659 658 HGCMMsgFileRead Msg;659 660 Msg.hdr.result = VERR_WRONG_ORDER; 661 Msg.hdr.u32ClientID = p HostCtx->uClientID;662 Msg.hdr.u32Function = GUEST_MSG_WAIT; 663 Msg.hdr.cParms = p HostCtx->uNumParms;660 HGCMMsgFileReadAt Msg; 661 662 Msg.hdr.result = VERR_WRONG_ORDER; 663 Msg.hdr.u32ClientID = pCtx->uClientID; 664 Msg.hdr.u32Function = GUEST_MSG_WAIT; 665 Msg.hdr.cParms = pCtx->uNumParms; 664 666 665 667 VbglHGCMParmUInt32Set(&Msg.context, 0); 666 668 VbglHGCMParmUInt32Set(&Msg.handle, 0); 669 VbglHGCMParmUInt32Set(&Msg.offset, 0); 667 670 VbglHGCMParmUInt32Set(&Msg.size, 0); 668 671 … … 677 680 else 678 681 { 679 Msg.context.GetUInt32(&p HostCtx->uContextID);682 Msg.context.GetUInt32(&pCtx->uContextID); 680 683 Msg.handle.GetUInt32(puHandle); 684 Msg.offset.GetUInt64(puOffset); 681 685 Msg.size.GetUInt32(puToRead); 682 686 } … … 686 690 687 691 688 VBGLR3DECL(int) VbglR3GuestCtrlFileGetWrite(PVBGLR3GUESTCTRL HOSTCTX pHostCtx, uint32_t *puHandle,692 VBGLR3DECL(int) VbglR3GuestCtrlFileGetWrite(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t *puHandle, 689 693 void *pvData, uint32_t cbData, uint32_t *pcbSize) 690 694 { 691 AssertPtrReturn(p HostCtx, VERR_INVALID_POINTER);692 693 AssertReturn(p HostCtx->uNumParms == 4, VERR_INVALID_PARAMETER);695 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); 696 697 AssertReturn(pCtx->uNumParms == 4, VERR_INVALID_PARAMETER); 694 698 AssertPtrReturn(puHandle, VERR_INVALID_POINTER); 695 699 AssertPtrReturn(pvData, VERR_INVALID_POINTER); … … 700 704 701 705 Msg.hdr.result = VERR_WRONG_ORDER; 702 Msg.hdr.u32ClientID = p HostCtx->uClientID;703 Msg.hdr.u32Function = GUEST_MSG_WAIT; 704 Msg.hdr.cParms = p HostCtx->uNumParms;706 Msg.hdr.u32ClientID = pCtx->uClientID; 707 Msg.hdr.u32Function = GUEST_MSG_WAIT; 708 Msg.hdr.cParms = pCtx->uNumParms; 705 709 706 710 VbglHGCMParmUInt32Set(&Msg.context, 0); … … 719 723 else 720 724 { 721 Msg.context.GetUInt32(&p HostCtx->uContextID);725 Msg.context.GetUInt32(&pCtx->uContextID); 722 726 Msg.handle.GetUInt32(puHandle); 723 727 Msg.size.GetUInt32(pcbSize); … … 728 732 729 733 730 VBGLR3DECL(int) VbglR3GuestCtrlFileGetWriteAt(PVBGLR3GUESTCTRL HOSTCTX pHostCtx, uint32_t *puHandle,734 VBGLR3DECL(int) VbglR3GuestCtrlFileGetWriteAt(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t *puHandle, 731 735 void *pvData, uint32_t cbData, uint32_t *pcbSize, uint64_t *puOffset) 732 736 { 733 AssertPtrReturn(p HostCtx, VERR_INVALID_POINTER);734 735 AssertReturn(p HostCtx->uNumParms == 5, VERR_INVALID_PARAMETER);737 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); 738 739 AssertReturn(pCtx->uNumParms == 5, VERR_INVALID_PARAMETER); 736 740 AssertPtrReturn(puHandle, VERR_INVALID_POINTER); 737 741 AssertPtrReturn(pvData, VERR_INVALID_POINTER); … … 742 746 743 747 Msg.hdr.result = VERR_WRONG_ORDER; 744 Msg.hdr.u32ClientID = p HostCtx->uClientID;745 Msg.hdr.u32Function = GUEST_MSG_WAIT; 746 Msg.hdr.cParms = p HostCtx->uNumParms;748 Msg.hdr.u32ClientID = pCtx->uClientID; 749 Msg.hdr.u32Function = GUEST_MSG_WAIT; 750 Msg.hdr.cParms = pCtx->uNumParms; 747 751 748 752 VbglHGCMParmUInt32Set(&Msg.context, 0); … … 762 766 else 763 767 { 764 Msg.context.GetUInt32(&p HostCtx->uContextID);768 Msg.context.GetUInt32(&pCtx->uContextID); 765 769 Msg.handle.GetUInt32(puHandle); 766 770 Msg.size.GetUInt32(pcbSize); … … 771 775 772 776 773 VBGLR3DECL(int) VbglR3GuestCtrlFileGetSeek(PVBGLR3GUESTCTRL HOSTCTX pHostCtx,777 VBGLR3DECL(int) VbglR3GuestCtrlFileGetSeek(PVBGLR3GUESTCTRLCMDCTX pCtx, 774 778 uint32_t *puHandle, uint32_t *puSeekMethod, uint64_t *puOffset) 775 779 { 776 AssertPtrReturn(p HostCtx, VERR_INVALID_POINTER);777 778 AssertReturn(p HostCtx->uNumParms == 4, VERR_INVALID_PARAMETER);780 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); 781 782 AssertReturn(pCtx->uNumParms == 4, VERR_INVALID_PARAMETER); 779 783 AssertPtrReturn(puHandle, VERR_INVALID_POINTER); 780 784 AssertPtrReturn(puSeekMethod, VERR_INVALID_POINTER); … … 784 788 785 789 Msg.hdr.result = VERR_WRONG_ORDER; 786 Msg.hdr.u32ClientID = p HostCtx->uClientID;787 Msg.hdr.u32Function = GUEST_MSG_WAIT; 788 Msg.hdr.cParms = p HostCtx->uNumParms;790 Msg.hdr.u32ClientID = pCtx->uClientID; 791 Msg.hdr.u32Function = GUEST_MSG_WAIT; 792 Msg.hdr.cParms = pCtx->uNumParms; 789 793 790 794 VbglHGCMParmUInt32Set(&Msg.context, 0); … … 803 807 else 804 808 { 805 Msg.context.GetUInt32(&p HostCtx->uContextID);809 Msg.context.GetUInt32(&pCtx->uContextID); 806 810 Msg.handle.GetUInt32(puHandle); 807 811 Msg.method.GetUInt32(puSeekMethod); … … 813 817 814 818 815 VBGLR3DECL(int) VbglR3GuestCtrlFileGetTell(PVBGLR3GUESTCTRL HOSTCTX pHostCtx, uint32_t *puHandle)816 { 817 AssertPtrReturn(p HostCtx, VERR_INVALID_POINTER);818 819 AssertReturn(p HostCtx->uNumParms == 2, VERR_INVALID_PARAMETER);819 VBGLR3DECL(int) VbglR3GuestCtrlFileGetTell(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t *puHandle) 820 { 821 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); 822 823 AssertReturn(pCtx->uNumParms == 2, VERR_INVALID_PARAMETER); 820 824 AssertPtrReturn(puHandle, VERR_INVALID_POINTER); 821 825 … … 823 827 824 828 Msg.hdr.result = VERR_WRONG_ORDER; 825 Msg.hdr.u32ClientID = p HostCtx->uClientID;826 Msg.hdr.u32Function = GUEST_MSG_WAIT; 827 Msg.hdr.cParms = p HostCtx->uNumParms;829 Msg.hdr.u32ClientID = pCtx->uClientID; 830 Msg.hdr.u32Function = GUEST_MSG_WAIT; 831 Msg.hdr.cParms = pCtx->uNumParms; 828 832 829 833 VbglHGCMParmUInt32Set(&Msg.context, 0); … … 840 844 else 841 845 { 842 Msg.context.GetUInt32(&p HostCtx->uContextID);846 Msg.context.GetUInt32(&pCtx->uContextID); 843 847 Msg.handle.GetUInt32(puHandle); 844 848 } … … 848 852 849 853 850 VBGLR3DECL(int) VbglR3GuestCtrlProcGetTerminate(PVBGLR3GUESTCTRL HOSTCTX pHostCtx, uint32_t *puPID)851 { 852 AssertPtrReturn(p HostCtx, VERR_INVALID_POINTER);853 854 AssertReturn(p HostCtx->uNumParms == 2, VERR_INVALID_PARAMETER);854 VBGLR3DECL(int) VbglR3GuestCtrlProcGetTerminate(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t *puPID) 855 { 856 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); 857 858 AssertReturn(pCtx->uNumParms == 2, VERR_INVALID_PARAMETER); 855 859 AssertPtrReturn(puPID, VERR_INVALID_POINTER); 856 860 … … 858 862 859 863 Msg.hdr.result = VERR_WRONG_ORDER; 860 Msg.hdr.u32ClientID = p HostCtx->uClientID;861 Msg.hdr.u32Function = GUEST_MSG_WAIT; 862 Msg.hdr.cParms = p HostCtx->uNumParms;864 Msg.hdr.u32ClientID = pCtx->uClientID; 865 Msg.hdr.u32Function = GUEST_MSG_WAIT; 866 Msg.hdr.cParms = pCtx->uNumParms; 863 867 864 868 VbglHGCMParmUInt32Set(&Msg.context, 0); … … 875 879 else 876 880 { 877 Msg.context.GetUInt32(&p HostCtx->uContextID);881 Msg.context.GetUInt32(&pCtx->uContextID); 878 882 Msg.pid.GetUInt32(puPID); 879 883 } … … 883 887 884 888 885 VBGLR3DECL(int) VbglR3GuestCtrlProcGetWaitFor(PVBGLR3GUESTCTRLHOSTCTX pHostCtx, uint32_t *puPID, uint32_t *puWaitFlags, uint32_t *puTimeoutMS) 886 { 887 AssertPtrReturn(pHostCtx, VERR_INVALID_POINTER); 888 889 AssertReturn(pHostCtx->uNumParms == 5, VERR_INVALID_PARAMETER); 889 VBGLR3DECL(int) VbglR3GuestCtrlProcGetWaitFor(PVBGLR3GUESTCTRLCMDCTX pCtx, 890 uint32_t *puPID, uint32_t *puWaitFlags, uint32_t *puTimeoutMS) 891 { 892 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); 893 894 AssertReturn(pCtx->uNumParms == 5, VERR_INVALID_PARAMETER); 890 895 AssertPtrReturn(puPID, VERR_INVALID_POINTER); 891 896 … … 893 898 894 899 Msg.hdr.result = VERR_WRONG_ORDER; 895 Msg.hdr.u32ClientID = p HostCtx->uClientID;896 Msg.hdr.u32Function = GUEST_MSG_WAIT; 897 Msg.hdr.cParms = p HostCtx->uNumParms;900 Msg.hdr.u32ClientID = pCtx->uClientID; 901 Msg.hdr.u32Function = GUEST_MSG_WAIT; 902 Msg.hdr.cParms = pCtx->uNumParms; 898 903 899 904 VbglHGCMParmUInt32Set(&Msg.context, 0); … … 912 917 else 913 918 { 914 Msg.context.GetUInt32(&p HostCtx->uContextID);919 Msg.context.GetUInt32(&pCtx->uContextID); 915 920 Msg.pid.GetUInt32(puPID); 916 921 Msg.flags.GetUInt32(puWaitFlags); … … 922 927 923 928 924 VBGLR3DECL(int) VbglR3GuestCtrlFileNotify(uint32_t uClientId, uint32_t uContext, 925 uint32_t uType, 926 void *pvPayload, uint32_t cbPayload) 927 { 928 AssertPtrReturn(pvPayload, VERR_INVALID_POINTER); 929 AssertReturn(cbPayload, VERR_INVALID_PARAMETER); 930 931 HGCMMsgFileNotify Msg; 932 933 Msg.hdr.result = VERR_WRONG_ORDER; 934 Msg.hdr.u32ClientID = uClientId; 935 //Msg.hdr.u32Function = GUEST_FILE_NOTIFY; 929 VBGLR3DECL(int) VbglR3GuestCtrlFileCbOpen(PVBGLR3GUESTCTRLCMDCTX pCtx, 930 uint32_t uRc, uint32_t uFileHandle) 931 { 932 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); 933 934 HGCMReplyFileNotify Msg; 935 936 Msg.hdr.result = VERR_WRONG_ORDER; 937 Msg.hdr.u32ClientID = pCtx->uClientID; 938 Msg.hdr.u32Function = GUEST_FILE_NOTIFY; 939 Msg.hdr.cParms = 4; 940 941 VbglHGCMParmUInt32Set(&Msg.context, pCtx->uContextID); 942 VbglHGCMParmUInt32Set(&Msg.type, GUEST_FILE_NOTIFYTYPE_OPEN); 943 VbglHGCMParmUInt32Set(&Msg.rc, uRc); 944 945 VbglHGCMParmUInt32Set(&Msg.u.open.handle, uFileHandle); 946 947 int rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_HGCM_CALL(sizeof(Msg)), &Msg, sizeof(Msg)); 948 if (RT_SUCCESS(rc)) 949 { 950 int rc2 = Msg.hdr.result; 951 if (RT_FAILURE(rc2)) 952 rc = rc2; 953 } 954 return rc; 955 } 956 957 958 VBGLR3DECL(int) VbglR3GuestCtrlFileCbClose(PVBGLR3GUESTCTRLCMDCTX pCtx, 959 uint32_t uRc) 960 { 961 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); 962 963 HGCMReplyFileNotify Msg; 964 965 Msg.hdr.result = VERR_WRONG_ORDER; 966 Msg.hdr.u32ClientID = pCtx->uClientID; 967 Msg.hdr.u32Function = GUEST_FILE_NOTIFY; 936 968 Msg.hdr.cParms = 3; 937 969 938 VbglHGCMParmUInt32Set(&Msg.context, uContext); 939 VbglHGCMParmUInt32Set(&Msg.type, uType); 940 VbglHGCMParmPtrSet(&Msg.payload, pvPayload, cbPayload); 970 VbglHGCMParmUInt32Set(&Msg.context, pCtx->uContextID); 971 VbglHGCMParmUInt32Set(&Msg.type, GUEST_FILE_NOTIFYTYPE_CLOSE); 972 VbglHGCMParmUInt32Set(&Msg.rc, uRc); 973 974 int rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_HGCM_CALL(sizeof(Msg)), &Msg, sizeof(Msg)); 975 if (RT_SUCCESS(rc)) 976 { 977 int rc2 = Msg.hdr.result; 978 if (RT_FAILURE(rc2)) 979 rc = rc2; 980 } 981 return rc; 982 } 983 984 985 VBGLR3DECL(int) VbglR3GuestCtrlFileCbRead(PVBGLR3GUESTCTRLCMDCTX pCtx, 986 uint32_t uRc, 987 void *pvData, uint32_t cbData) 988 { 989 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); 990 991 HGCMReplyFileNotify Msg; 992 993 Msg.hdr.result = VERR_WRONG_ORDER; 994 Msg.hdr.u32ClientID = pCtx->uClientID; 995 Msg.hdr.u32Function = GUEST_FILE_NOTIFY; 996 Msg.hdr.cParms = 4; 997 998 VbglHGCMParmUInt32Set(&Msg.context, pCtx->uContextID); 999 VbglHGCMParmUInt32Set(&Msg.type, GUEST_FILE_NOTIFYTYPE_READ); 1000 VbglHGCMParmUInt32Set(&Msg.rc, uRc); 1001 1002 VbglHGCMParmPtrSet(&Msg.u.read.data, pvData, cbData); 1003 1004 int rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_HGCM_CALL(sizeof(Msg)), &Msg, sizeof(Msg)); 1005 if (RT_SUCCESS(rc)) 1006 { 1007 int rc2 = Msg.hdr.result; 1008 if (RT_FAILURE(rc2)) 1009 rc = rc2; 1010 } 1011 return rc; 1012 } 1013 1014 1015 VBGLR3DECL(int) VbglR3GuestCtrlFileCbWrite(PVBGLR3GUESTCTRLCMDCTX pCtx, 1016 uint32_t uRc, uint32_t uWritten) 1017 { 1018 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); 1019 1020 HGCMReplyFileNotify Msg; 1021 1022 Msg.hdr.result = VERR_WRONG_ORDER; 1023 Msg.hdr.u32ClientID = pCtx->uClientID; 1024 Msg.hdr.u32Function = GUEST_FILE_NOTIFY; 1025 Msg.hdr.cParms = 4; 1026 1027 VbglHGCMParmUInt32Set(&Msg.context, pCtx->uContextID); 1028 VbglHGCMParmUInt32Set(&Msg.type, GUEST_FILE_NOTIFYTYPE_WRITE); 1029 VbglHGCMParmUInt32Set(&Msg.rc, uRc); 1030 1031 VbglHGCMParmUInt32Set(&Msg.u.write.written, uWritten); 1032 1033 int rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_HGCM_CALL(sizeof(Msg)), &Msg, sizeof(Msg)); 1034 if (RT_SUCCESS(rc)) 1035 { 1036 int rc2 = Msg.hdr.result; 1037 if (RT_FAILURE(rc2)) 1038 rc = rc2; 1039 } 1040 return rc; 1041 } 1042 1043 1044 VBGLR3DECL(int) VbglR3GuestCtrlFileCbSeek(PVBGLR3GUESTCTRLCMDCTX pCtx, 1045 uint32_t uRc, uint64_t uOffActual) 1046 { 1047 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); 1048 1049 HGCMReplyFileNotify Msg; 1050 1051 Msg.hdr.result = VERR_WRONG_ORDER; 1052 Msg.hdr.u32ClientID = pCtx->uClientID; 1053 Msg.hdr.u32Function = GUEST_FILE_NOTIFY; 1054 Msg.hdr.cParms = 4; 1055 1056 VbglHGCMParmUInt32Set(&Msg.context, pCtx->uContextID); 1057 VbglHGCMParmUInt32Set(&Msg.type, GUEST_FILE_NOTIFYTYPE_SEEK); 1058 VbglHGCMParmUInt32Set(&Msg.rc, uRc); 1059 1060 VbglHGCMParmUInt64Set(&Msg.u.seek.offset, uOffActual); 1061 1062 int rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_HGCM_CALL(sizeof(Msg)), &Msg, sizeof(Msg)); 1063 if (RT_SUCCESS(rc)) 1064 { 1065 int rc2 = Msg.hdr.result; 1066 if (RT_FAILURE(rc2)) 1067 rc = rc2; 1068 } 1069 return rc; 1070 } 1071 1072 1073 VBGLR3DECL(int) VbglR3GuestCtrlFileCbTell(PVBGLR3GUESTCTRLCMDCTX pCtx, 1074 uint32_t uRc, uint64_t uOffActual) 1075 { 1076 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); 1077 1078 HGCMReplyFileNotify Msg; 1079 1080 Msg.hdr.result = VERR_WRONG_ORDER; 1081 Msg.hdr.u32ClientID = pCtx->uClientID; 1082 Msg.hdr.u32Function = GUEST_FILE_NOTIFY; 1083 Msg.hdr.cParms = 4; 1084 1085 VbglHGCMParmUInt32Set(&Msg.context, pCtx->uContextID); 1086 VbglHGCMParmUInt32Set(&Msg.type, GUEST_FILE_NOTIFYTYPE_TELL); 1087 VbglHGCMParmUInt32Set(&Msg.rc, uRc); 1088 1089 VbglHGCMParmUInt64Set(&Msg.u.tell.offset, uOffActual); 941 1090 942 1091 int rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_HGCM_CALL(sizeof(Msg)), &Msg, sizeof(Msg)); … … 957 1106 ** @todo Docs! 958 1107 */ 959 VBGLR3DECL(int) VbglR3GuestCtrlProcCbStatus(uint32_t u32ClientID, 960 uint32_t u32Context, 961 uint32_t u32PID, 962 uint32_t u32Status, 963 uint32_t u32Flags, 964 void *pvData, 965 uint32_t cbData) 966 { 1108 VBGLR3DECL(int) VbglR3GuestCtrlProcCbStatus(PVBGLR3GUESTCTRLCMDCTX pCtx, 1109 uint32_t uPID, uint32_t uStatus, uint32_t uFlags, 1110 void *pvData, uint32_t cbData) 1111 { 1112 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); 1113 967 1114 HGCMMsgProcStatus Msg; 968 1115 969 1116 Msg.hdr.result = VERR_WRONG_ORDER; 970 Msg.hdr.u32ClientID = u32ClientID;1117 Msg.hdr.u32ClientID = pCtx->uClientID; 971 1118 Msg.hdr.u32Function = GUEST_EXEC_STATUS; 972 1119 Msg.hdr.cParms = 5; 973 1120 974 VbglHGCMParmUInt32Set(&Msg.context, u32Context);975 VbglHGCMParmUInt32Set(&Msg.pid, u 32PID);976 VbglHGCMParmUInt32Set(&Msg.status, u 32Status);977 VbglHGCMParmUInt32Set(&Msg.flags, u 32Flags);1121 VbglHGCMParmUInt32Set(&Msg.context, pCtx->uContextID); 1122 VbglHGCMParmUInt32Set(&Msg.pid, uPID); 1123 VbglHGCMParmUInt32Set(&Msg.status, uStatus); 1124 VbglHGCMParmUInt32Set(&Msg.flags, uFlags); 978 1125 VbglHGCMParmPtrSet(&Msg.data, pvData, cbData); 979 1126 … … 995 1142 ** @todo Docs! 996 1143 */ 997 VBGLR3DECL(int) VbglR3GuestCtrlProcCbOutput(uint32_t u32ClientID, 998 uint32_t u32Context, 999 uint32_t u32PID, 1000 uint32_t u32Handle, 1001 uint32_t u32Flags, 1002 void *pvData, 1003 uint32_t cbData) 1004 { 1144 VBGLR3DECL(int) VbglR3GuestCtrlProcCbOutput(PVBGLR3GUESTCTRLCMDCTX pCtx, 1145 uint32_t uPID,uint32_t uHandle, uint32_t uFlags, 1146 void *pvData, uint32_t cbData) 1147 { 1148 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); 1149 1005 1150 HGCMMsgProcOutput Msg; 1006 1151 1007 1152 Msg.hdr.result = VERR_WRONG_ORDER; 1008 Msg.hdr.u32ClientID = u32ClientID;1153 Msg.hdr.u32ClientID = pCtx->uClientID; 1009 1154 Msg.hdr.u32Function = GUEST_EXEC_OUTPUT; 1010 1155 Msg.hdr.cParms = 5; 1011 1156 1012 VbglHGCMParmUInt32Set(&Msg.context, u32Context);1013 VbglHGCMParmUInt32Set(&Msg.pid, u 32PID);1014 VbglHGCMParmUInt32Set(&Msg.handle, u 32Handle);1015 VbglHGCMParmUInt32Set(&Msg.flags, u 32Flags);1157 VbglHGCMParmUInt32Set(&Msg.context, pCtx->uContextID); 1158 VbglHGCMParmUInt32Set(&Msg.pid, uPID); 1159 VbglHGCMParmUInt32Set(&Msg.handle, uHandle); 1160 VbglHGCMParmUInt32Set(&Msg.flags, uFlags); 1016 1161 VbglHGCMParmPtrSet(&Msg.data, pvData, cbData); 1017 1162 … … 1033 1178 ** @todo Docs! 1034 1179 */ 1035 VBGLR3DECL(int) VbglR3GuestCtrlProcCbStatusInput(uint32_t u32ClientID, 1036 uint32_t u32Context, 1037 uint32_t u32PID, 1038 uint32_t u32Status, 1039 uint32_t u32Flags, 1040 uint32_t cbWritten) 1041 { 1180 VBGLR3DECL(int) VbglR3GuestCtrlProcCbStatusInput(PVBGLR3GUESTCTRLCMDCTX pCtx, 1181 uint32_t uPID, uint32_t uStatus, 1182 uint32_t uFlags, uint32_t cbWritten) 1183 { 1184 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); 1185 1042 1186 HGCMMsgProcStatusInput Msg; 1043 1187 1044 1188 Msg.hdr.result = VERR_WRONG_ORDER; 1045 Msg.hdr.u32ClientID = u32ClientID;1189 Msg.hdr.u32ClientID = pCtx->uClientID; 1046 1190 Msg.hdr.u32Function = GUEST_EXEC_INPUT_STATUS; 1047 1191 Msg.hdr.cParms = 5; 1048 1192 1049 VbglHGCMParmUInt32Set(&Msg.context, u32Context);1050 VbglHGCMParmUInt32Set(&Msg.pid, u 32PID);1051 VbglHGCMParmUInt32Set(&Msg.status, u 32Status);1052 VbglHGCMParmUInt32Set(&Msg.flags, u 32Flags);1193 VbglHGCMParmUInt32Set(&Msg.context, pCtx->uContextID); 1194 VbglHGCMParmUInt32Set(&Msg.pid, uPID); 1195 VbglHGCMParmUInt32Set(&Msg.status, uStatus); 1196 VbglHGCMParmUInt32Set(&Msg.flags, uFlags); 1053 1197 VbglHGCMParmUInt32Set(&Msg.written, cbWritten); 1054 1198 -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControl.cpp
r45010 r45109 68 68 * Internal Functions * 69 69 *******************************************************************************/ 70 static int gstcntlHandleSessionOpen(PVBGLR3GUESTCTRL HOSTCTX pHostCtx);71 static int gstcntlHandleSessionClose(PVBGLR3GUESTCTRL HOSTCTX pHostCtx);70 static int gstcntlHandleSessionOpen(PVBGLR3GUESTCTRLCMDCTX pHostCtx); 71 static int gstcntlHandleSessionClose(PVBGLR3GUESTCTRLCMDCTX pHostCtx); 72 72 static void VBoxServiceControlShutdown(void); 73 73 … … 198 198 AssertPtrReturn(pvScratchBuf, VERR_NO_MEMORY); 199 199 200 VBGLR3GUESTCTRLHOSTCTX ctxHost = { g_uControlSvcClientID, 201 1 /* Default protocol version */ }; 200 VBGLR3GUESTCTRLCMDCTX ctxHost = { g_uControlSvcClientID }; 201 /* Set default protocol version to 1. */ 202 ctxHost.uProtocol = 1; 203 202 204 for (;;) 203 205 { … … 301 303 302 304 303 static int gstcntlHandleSessionOpen(PVBGLR3GUESTCTRL HOSTCTX pHostCtx)305 static int gstcntlHandleSessionOpen(PVBGLR3GUESTCTRLCMDCTX pHostCtx) 304 306 { 305 307 AssertPtrReturn(pHostCtx, VERR_INVALID_POINTER); … … 329 331 /* Report back on failure. On success this will be done 330 332 * by the forked session thread. */ 331 int rc2 = VbglR3GuestCtrlSessionNotify(pHostCtx ->uClientID, pHostCtx->uContextID,333 int rc2 = VbglR3GuestCtrlSessionNotify(pHostCtx, 332 334 GUEST_SESSION_NOTIFYTYPE_ERROR, rc /* uint32_t vs. int */); 333 335 if (RT_FAILURE(rc2)) … … 343 345 344 346 345 static int gstcntlHandleSessionClose(PVBGLR3GUESTCTRL HOSTCTX pHostCtx)347 static int gstcntlHandleSessionClose(PVBGLR3GUESTCTRLCMDCTX pHostCtx) 346 348 { 347 349 AssertPtrReturn(pHostCtx, VERR_INVALID_POINTER); … … 368 370 /* Report back on failure. On success this will be done 369 371 * by the forked session thread. */ 370 int rc2 = VbglR3GuestCtrlSessionNotify(pHostCtx ->uClientID, pHostCtx->uContextID,372 int rc2 = VbglR3GuestCtrlSessionNotify(pHostCtx, 371 373 GUEST_SESSION_NOTIFYTYPE_ERROR, rc); 372 374 if (RT_FAILURE(rc2)) -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControl.h
r45010 r45109 385 385 extern int GstCntlSessionDestroy(PVBOXSERVICECTRLSESSION pSession); 386 386 extern int GstCntlSessionInit(PVBOXSERVICECTRLSESSION pSession, uint32_t uFlags); 387 extern int GstCntlSessionHandler(PVBOXSERVICECTRLSESSION pSession, uint32_t uMsg, PVBGLR3GUESTCTRL HOSTCTX pHostCtx, void *pvScratchBuf, size_t cbScratchBuf, volatile bool *pfShutdown);387 extern int GstCntlSessionHandler(PVBOXSERVICECTRLSESSION pSession, uint32_t uMsg, PVBGLR3GUESTCTRLCMDCTX pHostCtx, void *pvScratchBuf, size_t cbScratchBuf, volatile bool *pfShutdown); 388 388 extern int GstCntlSessionListSet(PVBOXSERVICECTRLSESSION pSession, PVBOXSERVICECTRLPROCESS pThread, VBOXSERVICECTRLTHREADLISTTYPE enmList); 389 389 extern int GstCntlSessionProcessStartAllowed(const PVBOXSERVICECTRLSESSION pSession, bool *pbAllowed); … … 401 401 extern void GstCntlProcessRequestFree(PVBOXSERVICECTRLREQUEST pReq); 402 402 /* Per-session functions. */ 403 extern int gstcntlHandleFileOpen(uint32_t idClient, uint32_t cParms); 404 extern int gstcntlHandleFileClose(uint32_t idClient, uint32_t cParms); 405 extern int gstcntlHandleFileRead(uint32_t idClient, uint32_t cParms, void *pvScratchBuf, size_t cbScratchBuf); 406 extern int gstcntlHandleFileReadAt(uint32_t idClient, uint32_t cParms, void *pvScratchBuf, size_t cbScratchBuf); 407 extern int gstcntlHandleFileWrite(uint32_t idClient, uint32_t cParms, void *pvScratchBuf, size_t cbScratchBuf); 408 extern int gstcntlHandleFileWriteAt(uint32_t idClient, uint32_t cParms, void *pvScratchBuf, size_t cbScratchBuf); 409 extern int gstcntlHandleFileSeek(uint32_t idClient, uint32_t cParms); 410 extern int gstcntlHandleFileTell(uint32_t idClient, uint32_t cParms); 411 extern int GstCntlSessionHandleProcExec(const PVBOXSERVICECTRLSESSION pSession, PVBGLR3GUESTCTRLHOSTCTX pHostCtx); 412 extern int GstCntlSessionHandleProcInput(const PVBOXSERVICECTRLSESSION pSession, PVBGLR3GUESTCTRLHOSTCTX pHostCtx, void *pvScratchBuf, size_t cbScratchBuf); 413 extern int GstCntlSessionHandleProcOutput(const PVBOXSERVICECTRLSESSION pSession, PVBGLR3GUESTCTRLHOSTCTX pHostCtx); 414 extern int GstCntlSessionHandleProcTerminate(const PVBOXSERVICECTRLSESSION pSession, PVBGLR3GUESTCTRLHOSTCTX pHostCtx); 415 extern int GstCntlSessionHandleProcWaitFor(const PVBOXSERVICECTRLSESSION pSession, PVBGLR3GUESTCTRLHOSTCTX pHostCtx); 403 extern int GstCntlSessionHandleProcExec(const PVBOXSERVICECTRLSESSION pSession, PVBGLR3GUESTCTRLCMDCTX pHostCtx); 404 extern int GstCntlSessionHandleProcInput(const PVBOXSERVICECTRLSESSION pSession, PVBGLR3GUESTCTRLCMDCTX pHostCtx, void *pvScratchBuf, size_t cbScratchBuf); 405 extern int GstCntlSessionHandleProcOutput(const PVBOXSERVICECTRLSESSION pSession, PVBGLR3GUESTCTRLCMDCTX pHostCtx); 406 extern int GstCntlSessionHandleProcTerminate(const PVBOXSERVICECTRLSESSION pSession, PVBGLR3GUESTCTRLCMDCTX pHostCtx); 407 extern int GstCntlSessionHandleProcWaitFor(const PVBOXSERVICECTRLSESSION pSession, PVBGLR3GUESTCTRLCMDCTX pHostCtx); 416 408 417 409 RT_C_DECLS_END -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlProcess.cpp
r45017 r45109 650 650 VBoxServiceVerbose(2, "[PID %u]: Process \"%s\" started, CID=%u, User=%s\n", 651 651 pThread->uPID, pThread->pszCmd, pThread->uContextID, pThread->pszUser); 652 rc = VbglR3GuestCtrlProcCbStatus(pThread->uClientID, pThread->uContextID, 652 VBGLR3GUESTCTRLCMDCTX ctx = { pThread->uClientID, pThread->uContextID }; 653 rc = VbglR3GuestCtrlProcCbStatus(&ctx, 653 654 pThread->uPID, PROC_STS_STARTED, 0 /* u32Flags */, 654 655 NULL /* pvData */, 0 /* cbData */); … … 925 926 if (!(pThread->uFlags & EXECUTEPROCESSFLAG_WAIT_START)) 926 927 { 927 rc2 = VbglR3GuestCtrlProcCbStatus(pThread->uClientID, pThread->uContextID, 928 VBGLR3GUESTCTRLCMDCTX ctx = { pThread->uClientID, pThread->uContextID }; 929 rc2 = VbglR3GuestCtrlProcCbStatus(&ctx, 928 930 pThread->uPID, uStatus, uFlags, 929 931 NULL /* pvData */, 0 /* cbData */); … … 1746 1748 if (RT_FAILURE(rc)) 1747 1749 { 1748 rc2 = VbglR3GuestCtrlProcCbStatus(pProcess->uClientID, pProcess->uContextID, pProcess->uPID, 1749 PROC_STS_ERROR, rc, 1750 VBGLR3GUESTCTRLCMDCTX ctx = { pProcess->uClientID, pProcess->uContextID }; 1751 rc2 = VbglR3GuestCtrlProcCbStatus(&ctx, 1752 pProcess->uPID, PROC_STS_ERROR, rc, 1750 1753 NULL /* pvData */, 0 /* cbData */); 1751 1754 if (RT_FAILURE(rc2)) -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlSession.cpp
r45076 r45109 55 55 static PVBOXSERVICECTRLFILE gstcntlSessionGetFile(const PVBOXSERVICECTRLSESSION pSession, uint32_t uHandle); 56 56 static int gstcntlSessionGetOutput(const PVBOXSERVICECTRLSESSION pSession, uint32_t uPID, uint32_t uCID, uint32_t uHandleId, uint32_t cMsTimeout, void *pvBuf, uint32_t cbBuf, uint32_t *pcbRead); 57 static int gstcntlSessionHandleFileOpen(PVBOXSERVICECTRLSESSION pSession, PVBGLR3GUESTCTRL HOSTCTX pHostCtx);58 static int gstcntlSessionHandleFileClose(const PVBOXSERVICECTRLSESSION pSession, PVBGLR3GUESTCTRL HOSTCTX pHostCtx);59 static int gstcntlSessionHandleFileRead(const PVBOXSERVICECTRLSESSION pSession, PVBGLR3GUESTCTRL HOSTCTX pHostCtx);60 static int gstcntlSessionHandleFileWrite(const PVBOXSERVICECTRLSESSION pSession, PVBGLR3GUESTCTRL HOSTCTX pHostCtx, void *pvScratchBuf, size_t cbScratchBuf);61 static int gstcntlSessionHandleFileSeek(const PVBOXSERVICECTRLSESSION pSession, PVBGLR3GUESTCTRL HOSTCTX pHostCtx);62 static int gstcntlSessionHandleFileTell(const PVBOXSERVICECTRLSESSION pSession, PVBGLR3GUESTCTRL HOSTCTX pHostCtx);57 static int gstcntlSessionHandleFileOpen(PVBOXSERVICECTRLSESSION pSession, PVBGLR3GUESTCTRLCMDCTX pHostCtx); 58 static int gstcntlSessionHandleFileClose(const PVBOXSERVICECTRLSESSION pSession, PVBGLR3GUESTCTRLCMDCTX pHostCtx); 59 static int gstcntlSessionHandleFileRead(const PVBOXSERVICECTRLSESSION pSession, PVBGLR3GUESTCTRLCMDCTX pHostCtx); 60 static int gstcntlSessionHandleFileWrite(const PVBOXSERVICECTRLSESSION pSession, PVBGLR3GUESTCTRLCMDCTX pHostCtx, void *pvScratchBuf, size_t cbScratchBuf); 61 static int gstcntlSessionHandleFileSeek(const PVBOXSERVICECTRLSESSION pSession, PVBGLR3GUESTCTRLCMDCTX pHostCtx); 62 static int gstcntlSessionHandleFileTell(const PVBOXSERVICECTRLSESSION pSession, PVBGLR3GUESTCTRLCMDCTX pHostCtx); 63 63 static int gstcntlSessionSetInput(const PVBOXSERVICECTRLSESSION pSession, uint32_t uPID, uint32_t uCID, bool fPendingClose, void *pvBuf, uint32_t cbBuf, uint32_t *pcbWritten); 64 64 static DECLCALLBACK(int) gstcntlSessionThread(RTTHREAD ThreadSelf, void *pvUser); … … 142 142 143 143 static int gstcntlSessionHandleFileOpen(PVBOXSERVICECTRLSESSION pSession, 144 PVBGLR3GUESTCTRL HOSTCTX pHostCtx)144 PVBGLR3GUESTCTRLCMDCTX pHostCtx) 145 145 { 146 146 AssertPtrReturn(pSession, VERR_INVALID_POINTER); … … 208 208 209 209 /* Report back in any case. */ 210 CALLBACKPAYLOAD_FILE_NOTIFY_OPEN cplOpen = { rc, uHandle }; 211 int rc2 = VbglR3GuestCtrlFileNotify(pHostCtx->uClientID, pHostCtx->uContextID, 212 GUEST_FILE_NOTIFYTYPE_OPEN, &cplOpen, sizeof(cplOpen)); 210 int rc2 = VbglR3GuestCtrlFileCbOpen(pHostCtx, rc, uHandle); 213 211 if (RT_FAILURE(rc2)) 214 212 VBoxServiceError("[File %s]: Failed to report file open status, rc=%Rrc\n", … … 223 221 224 222 static int gstcntlSessionHandleFileClose(const PVBOXSERVICECTRLSESSION pSession, 225 PVBGLR3GUESTCTRL HOSTCTX pHostCtx)223 PVBGLR3GUESTCTRLCMDCTX pHostCtx) 226 224 { 227 225 AssertPtrReturn(pSession, VERR_INVALID_POINTER); … … 242 240 243 241 /* Report back in any case. */ 244 CALLBACKPAYLOAD_FILE_NOTIFY_CLOSE cplClose = { rc }; 245 int rc2 = VbglR3GuestCtrlFileNotify(pHostCtx->uClientID, pHostCtx->uContextID, 246 GUEST_FILE_NOTIFYTYPE_CLOSE, &cplClose, sizeof(cplClose)); 242 int rc2 = VbglR3GuestCtrlFileCbClose(pHostCtx, rc); 247 243 if (RT_FAILURE(rc2)) 248 244 VBoxServiceError("Failed to report file close status, rc=%Rrc\n", rc2); … … 255 251 256 252 static int gstcntlSessionHandleFileRead(const PVBOXSERVICECTRLSESSION pSession, 257 PVBGLR3GUESTCTRL HOSTCTX pHostCtx,253 PVBGLR3GUESTCTRLCMDCTX pHostCtx, 258 254 void *pvScratchBuf, size_t cbScratchBuf) 259 255 { … … 292 288 293 289 /* Report back in any case. */ 294 CALLBACKPAYLOAD_FILE_NOTIFY_READ cplRead = { rc, (uint32_t)cbRead, pvDataRead }; 295 int rc2 = VbglR3GuestCtrlFileNotify(pHostCtx->uClientID, pHostCtx->uContextID, 296 GUEST_FILE_NOTIFYTYPE_READ, &cplRead, sizeof(cplRead)); 290 int rc2 = VbglR3GuestCtrlFileCbRead(pHostCtx, rc, pvDataRead, (uint32_t)cbRead); 297 291 if ( cbToRead > cbScratchBuf 298 292 && pvDataRead) … … 309 303 310 304 static int gstcntlSessionHandleFileReadAt(const PVBOXSERVICECTRLSESSION pSession, 311 PVBGLR3GUESTCTRL HOSTCTX pHostCtx,305 PVBGLR3GUESTCTRLCMDCTX pHostCtx, 312 306 void *pvScratchBuf, size_t cbScratchBuf) 313 307 { … … 347 341 348 342 /* Report back in any case. */ 349 CALLBACKPAYLOAD_FILE_NOTIFY_READ cplRead = { rc, (uint32_t)cbRead, pvDataRead }; 350 int rc2 = VbglR3GuestCtrlFileNotify(pHostCtx->uClientID, pHostCtx->uContextID, 351 GUEST_FILE_NOTIFYTYPE_READ, &cplRead, sizeof(cplRead)); 343 int rc2 = VbglR3GuestCtrlFileCbRead(pHostCtx, rc, pvDataRead, (uint32_t)cbRead); 352 344 if ( cbToRead > cbScratchBuf 353 345 && pvDataRead) … … 364 356 365 357 static int gstcntlSessionHandleFileWrite(const PVBOXSERVICECTRLSESSION pSession, 366 PVBGLR3GUESTCTRL HOSTCTX pHostCtx,358 PVBGLR3GUESTCTRLCMDCTX pHostCtx, 367 359 void *pvScratchBuf, size_t cbScratchBuf) 368 360 { … … 390 382 391 383 /* Report back in any case. */ 392 CALLBACKPAYLOAD_FILE_NOTIFY_WRITE cplWrite = { rc, (uint32_t)cbWritten }; 393 int rc2 = VbglR3GuestCtrlFileNotify(pHostCtx->uClientID, pHostCtx->uContextID, 394 GUEST_FILE_NOTIFYTYPE_WRITE, &cplWrite, sizeof(cplWrite)); 384 int rc2 = VbglR3GuestCtrlFileCbWrite(pHostCtx, rc, (uint32_t)cbWritten); 395 385 if (RT_FAILURE(rc2)) 396 386 VBoxServiceError("Failed to report file write status, rc=%Rrc\n", rc2); … … 403 393 404 394 static int gstcntlSessionHandleFileWriteAt(const PVBOXSERVICECTRLSESSION pSession, 405 PVBGLR3GUESTCTRL HOSTCTX pHostCtx,395 PVBGLR3GUESTCTRLCMDCTX pHostCtx, 406 396 void *pvScratchBuf, size_t cbScratchBuf) 407 397 { … … 430 420 431 421 /* Report back in any case. */ 432 CALLBACKPAYLOAD_FILE_NOTIFY_WRITE cplWrite = { rc, (uint32_t)cbWritten }; 433 int rc2 = VbglR3GuestCtrlFileNotify(pHostCtx->uClientID, pHostCtx->uContextID, 434 GUEST_FILE_NOTIFYTYPE_WRITE, &cplWrite, sizeof(cplWrite)); 422 int rc2 = VbglR3GuestCtrlFileCbWrite(pHostCtx, rc, (uint32_t)cbWritten); 435 423 if (RT_FAILURE(rc2)) 436 424 VBoxServiceError("Failed to report file write status, rc=%Rrc\n", rc2); … … 443 431 444 432 static int gstcntlSessionHandleFileSeek(const PVBOXSERVICECTRLSESSION pSession, 445 PVBGLR3GUESTCTRL HOSTCTX pHostCtx)433 PVBGLR3GUESTCTRLCMDCTX pHostCtx) 446 434 { 447 435 AssertPtrReturn(pSession, VERR_INVALID_POINTER); … … 489 477 490 478 /* Report back in any case. */ 491 CALLBACKPAYLOAD_FILE_NOTFIY_SEEK cplSeek = { rc, uOffsetActual }; 492 int rc2 = VbglR3GuestCtrlFileNotify(pHostCtx->uClientID, pHostCtx->uContextID, 493 GUEST_FILE_NOTIFYTYPE_SEEK, &cplSeek, sizeof(cplSeek)); 479 int rc2 = VbglR3GuestCtrlFileCbSeek(pHostCtx, rc, uOffsetActual); 494 480 if (RT_FAILURE(rc2)) 495 481 VBoxServiceError("Failed to report file seek status, rc=%Rrc\n", rc2); … … 502 488 503 489 static int gstcntlSessionHandleFileTell(const PVBOXSERVICECTRLSESSION pSession, 504 PVBGLR3GUESTCTRL HOSTCTX pHostCtx)490 PVBGLR3GUESTCTRLCMDCTX pHostCtx) 505 491 { 506 492 AssertPtrReturn(pSession, VERR_INVALID_POINTER); … … 522 508 523 509 /* Report back in any case. */ 524 CALLBACKPAYLOAD_FILE_NOTFIY_TELL cplTell = { rc, uOffsetActual }; 525 int rc2 = VbglR3GuestCtrlFileNotify(pHostCtx->uClientID, pHostCtx->uContextID, 526 GUEST_FILE_NOTIFYTYPE_TELL, &cplTell, sizeof(cplTell)); 510 int rc2 = VbglR3GuestCtrlFileCbTell(pHostCtx, rc, uOffsetActual); 527 511 if (RT_FAILURE(rc2)) 528 512 VBoxServiceError("Failed to report file tell status, rc=%Rrc\n", rc2); … … 542 526 */ 543 527 int GstCntlSessionHandleProcExec(PVBOXSERVICECTRLSESSION pSession, 544 PVBGLR3GUESTCTRL HOSTCTX pHostCtx)528 PVBGLR3GUESTCTRLCMDCTX pHostCtx) 545 529 { 546 530 AssertPtrReturn(pSession, VERR_INVALID_POINTER); … … 626 610 * from the host. The host in case has to deal with that! 627 611 */ 628 int rc2 = VbglR3GuestCtrlProcCbStatus(pHostCtx->uClientID, pHostCtx->uContextID, 629 0 /* PID, invalid */, 612 int rc2 = VbglR3GuestCtrlProcCbStatus(pHostCtx, 0 /* PID, invalid */, 630 613 PROC_STS_ERROR, rc, 631 614 NULL /* pvData */, 0 /* cbData */); … … 651 634 */ 652 635 int GstCntlSessionHandleProcInput(PVBOXSERVICECTRLSESSION pSession, 653 PVBGLR3GUESTCTRL HOSTCTX pHostCtx,636 PVBGLR3GUESTCTRLCMDCTX pHostCtx, 654 637 void *pvScratchBuf, size_t cbScratchBuf) 655 638 { … … 732 715 * regardless whether we got data or not! Otherwise the progress object 733 716 * on the host never will get completed! */ 734 rc = VbglR3GuestCtrlProcCbStatusInput(pHostCtx ->uClientID, pHostCtx->uContextID, uPID,717 rc = VbglR3GuestCtrlProcCbStatusInput(pHostCtx, uPID, 735 718 uStatus, uFlags, (uint32_t)cbWritten); 736 719 … … 748 731 */ 749 732 int GstCntlSessionHandleProcOutput(PVBOXSERVICECTRLSESSION pSession, 750 PVBGLR3GUESTCTRL HOSTCTX pHostCtx)733 PVBGLR3GUESTCTRLCMDCTX pHostCtx) 751 734 { 752 735 AssertPtrReturn(pSession, VERR_INVALID_POINTER); … … 800 783 * regardless whether we got data or not! Otherwise the progress object 801 784 * on the host never will get completed! */ 802 int rc2 = VbglR3GuestCtrlProcCbOutput(pHostCtx ->uClientID, pHostCtx->uContextID, uPID, uHandleID, uFlags,785 int rc2 = VbglR3GuestCtrlProcCbOutput(pHostCtx, uPID, uHandleID, uFlags, 803 786 pBuf, cbRead); 804 787 if (RT_SUCCESS(rc)) … … 821 804 822 805 int GstCntlSessionHandleProcTerminate(const PVBOXSERVICECTRLSESSION pSession, 823 PVBGLR3GUESTCTRL HOSTCTX pHostCtx)806 PVBGLR3GUESTCTRLCMDCTX pHostCtx) 824 807 { 825 808 AssertPtrReturn(pSession, VERR_INVALID_POINTER); … … 853 836 854 837 int GstCntlSessionHandleProcWaitFor(const PVBOXSERVICECTRLSESSION pSession, 855 PVBGLR3GUESTCTRL HOSTCTX pHostCtx)838 PVBGLR3GUESTCTRLCMDCTX pHostCtx) 856 839 { 857 840 AssertPtrReturn(pSession, VERR_INVALID_POINTER); … … 888 871 889 872 int GstCntlSessionHandler(PVBOXSERVICECTRLSESSION pSession, 890 uint32_t uMsg, PVBGLR3GUESTCTRL HOSTCTX pHostCtx,873 uint32_t uMsg, PVBGLR3GUESTCTRLCMDCTX pHostCtx, 891 874 void *pvScratchBuf, size_t cbScratchBuf, 892 875 volatile bool *pfShutdown) … … 1136 1119 /* Report final status. */ 1137 1120 Assert(uSessionStatus != GUEST_SESSION_NOTIFYTYPE_UNDEFINED); 1138 rc2 = VbglR3GuestCtrlSessionNotify(uClientID,1139 VBOX_GUESTCTRL_CONTEXTID_MAKE_SESSION(uSessionID),1121 VBGLR3GUESTCTRLCMDCTX ctx = { uClientID, VBOX_GUESTCTRL_CONTEXTID_MAKE_SESSION(uSessionID) }; 1122 rc2 = VbglR3GuestCtrlSessionNotify(&ctx, 1140 1123 uSessionStatus, uSessionRc); 1141 1124 if (RT_FAILURE(rc2)) … … 1187 1170 1188 1171 /* Report started status. */ 1189 int rc2 = VbglR3GuestCtrlSessionNotify(uClientID,1190 VBOX_GUESTCTRL_CONTEXTID_MAKE_SESSION(pSession->StartupInfo.uSessionID),1172 VBGLR3GUESTCTRLCMDCTX ctx = { uClientID, VBOX_GUESTCTRL_CONTEXTID_MAKE_SESSION(pSession->StartupInfo.uSessionID) }; 1173 int rc2 = VbglR3GuestCtrlSessionNotify(&ctx, 1191 1174 GUEST_SESSION_NOTIFYTYPE_STARTED, VINF_SUCCESS); 1192 1175 if (RT_FAILURE(rc2)) … … 1211 1194 bool fShutdown = false; 1212 1195 1213 VBGLR3GUESTCTRL HOSTCTX ctxHost = { uClientID,1214 1196 VBGLR3GUESTCTRLCMDCTX ctxHost = { uClientID, 0 /* Context ID, zeroed */, 1197 pSession->StartupInfo.uProtocol }; 1215 1198 for (;;) 1216 1199 {
Note:
See TracChangeset
for help on using the changeset viewer.