Changeset 98666 in vbox for trunk/src/VBox/Main
- Timestamp:
- Feb 21, 2023 8:46:29 AM (2 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/GuestCtrlImplPrivate.h
r98665 r98666 1227 1227 public: 1228 1228 1229 uint32_t ContextID(void) { return mCID; }; 1230 int GuestResult(void) { return mGuestRc; } 1231 int Result(void) { return mVrc; } 1232 GuestWaitEventPayload &Payload(void) { return mPayload; } 1233 int SignalInternal(int vrc, int vrcGuest, const GuestWaitEventPayload *pPayload); 1234 int Wait(RTMSINTERVAL uTimeoutMS); 1229 uint32_t ContextID(void) const { return mCID; }; 1230 int GuestResult(void) const { return mGuestRc; } 1231 bool HasGuestError(void) const { return mVrc == VERR_GSTCTL_GUEST_ERROR; } 1232 int Result(void) const { return mVrc; } 1233 GuestWaitEventPayload &Payload(void) { return mPayload; } 1234 int SignalInternal(int vrc, int vrcGuest, const GuestWaitEventPayload *pPayload); 1235 int Wait(RTMSINTERVAL uTimeoutMS); 1235 1236 1236 1237 protected: … … 1273 1274 int Init(uint32_t uCID, const GuestEventTypes &lstEvents); 1274 1275 int Cancel(void); 1275 const ComPtr<IEvent> Event(void) { return mEvent; } 1276 bool HasGuestError(void) const { return mVrc == VERR_GSTCTL_GUEST_ERROR; } 1277 int GetGuestError(void) const { return mGuestRc; } 1276 const ComPtr<IEvent> Event(void) const { return mEvent; } 1278 1277 int SignalExternal(IEvent *pEvent); 1279 const GuestEventTypes &Types(void) { return mEventTypes; }1280 size_t TypeCount(void) { return mEventTypes.size(); }1278 const GuestEventTypes &Types(void) const { return mEventTypes; } 1279 size_t TypeCount(void) const { return mEventTypes.size(); } 1281 1280 1282 1281 protected: -
trunk/src/VBox/Main/src-client/GuestCtrlPrivate.cpp
r98544 r98666 1800 1800 * @returns VBox status code. 1801 1801 * @retval VERR_GSTCTL_GUEST_ERROR may be returned, call GuestResult() to get 1802 * the actual result .1802 * the actual result from the guest side. 1803 1803 * 1804 1804 * @param msTimeout Timeout (in ms) to wait. -
trunk/src/VBox/Main/src-client/GuestDirectoryImpl.cpp
r98643 r98666 756 756 } 757 757 else if (pEvent->HasGuestError()) /* Return guest vrc if available. */ 758 vrc = pEvent->G etGuestError();758 vrc = pEvent->GuestResult(); 759 759 } 760 760 -
trunk/src/VBox/Main/src-client/GuestFileImpl.cpp
r98526 r98666 967 967 } 968 968 else if (pEvent->HasGuestError()) /* Return guest vrc if available. */ 969 vrc = pEvent->G etGuestError();969 vrc = pEvent->GuestResult(); 970 970 } 971 971 … … 1039 1039 } 1040 1040 else if (pEvent->HasGuestError()) /* Return guest vrc if available. */ 1041 vrc = pEvent->G etGuestError();1041 vrc = pEvent->GuestResult(); 1042 1042 } 1043 1043 … … 1109 1109 } 1110 1110 else if (pEvent->HasGuestError()) /* Return guest vrc if available. */ 1111 vrc = pEvent->G etGuestError();1111 vrc = pEvent->GuestResult(); 1112 1112 } 1113 1113 … … 1433 1433 } 1434 1434 else if (pEvent->HasGuestError()) /* Return guest vrc if available. */ 1435 vrc = pEvent->G etGuestError();1435 vrc = pEvent->GuestResult(); 1436 1436 } 1437 1437 … … 1508 1508 } 1509 1509 else if (pEvent->HasGuestError()) /* Return guest vrc if available. */ 1510 vrc = pEvent->G etGuestError();1510 vrc = pEvent->GuestResult(); 1511 1511 } 1512 1512 … … 1834 1834 vrc = VWRN_GSTCTL_OBJECTSTATE_CHANGED; 1835 1835 } 1836 if (RT_FAILURE(vrc) && pWaitEvent->HasGuestError()) /* Return guest vrc if available. */ 1837 vrc = pWaitEvent->GetGuestError(); 1836 1837 if (pWaitEvent->HasGuestError()) /* Return guest vrc if available. */ 1838 vrc = pWaitEvent->GuestResult(); 1838 1839 } 1839 1840 -
trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp
r98614 r98666 1880 1880 } 1881 1881 /* waitForEvent may also return VERR_GSTCTL_GUEST_ERROR like we do above, so make pvrcGuest is set. */ 1882 else if ( vrc == VERR_GSTCTL_GUEST_ERROR&& pvrcGuest)1882 else if (pEvent->HasGuestError() && pvrcGuest) 1883 1883 *pvrcGuest = pEvent->GuestResult(); 1884 1884 Assert(vrc != VERR_GSTCTL_GUEST_ERROR || !pvrcGuest || *pvrcGuest != (int)0xcccccccc); -
trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp
r98665 r98666 1182 1182 { 1183 1183 vrc = pEvent->Wait(30 * 1000); 1184 if ( vrc == VERR_GSTCTL_GUEST_ERROR 1185 && pvrcGuest) 1184 if (pEvent->HasGuestError() && pvrcGuest) 1186 1185 *pvrcGuest = pEvent->GuestResult(); 1187 1186 } … … 1273 1272 else 1274 1273 { 1275 if (vrc == VERR_GSTCTL_GUEST_ERROR) 1276 { 1277 if (pvrcGuest) 1278 *pvrcGuest = pEvent->GuestResult(); 1279 } 1274 if (pEvent->HasGuestError() && pvrcGuest) 1275 *pvrcGuest = pEvent->GuestResult(); 1280 1276 } 1281 1277 } … … 2017 2013 else 2018 2014 { 2019 if (vrc == VERR_GSTCTL_GUEST_ERROR) 2020 { 2021 if (pvrcGuest) 2022 *pvrcGuest = pEvent->GuestResult(); 2023 } 2015 if (pEvent->HasGuestError() && pvrcGuest) 2016 *pvrcGuest = pEvent->GuestResult(); 2024 2017 } 2025 2018 } … … 2873 2866 { 2874 2867 vrc = pEvent->Wait(30 * 1000); 2875 if ( vrc == VERR_GSTCTL_GUEST_ERROR 2876 && pvrcGuest) 2868 if (pEvent->HasGuestError() && pvrcGuest) 2877 2869 *pvrcGuest = pEvent->GuestResult(); 2878 2870 } … … 2923 2915 else 2924 2916 { 2925 if (vrc == VERR_GSTCTL_GUEST_ERROR) 2926 { 2927 if (pvrcGuest) 2928 *pvrcGuest = pEvent->GuestResult(); 2929 } 2917 if (pEvent->HasGuestError() && pvrcGuest) 2918 *pvrcGuest = pEvent->GuestResult(); 2930 2919 } 2931 2920 } … … 2976 2965 else 2977 2966 { 2978 if (vrc == VERR_GSTCTL_GUEST_ERROR) 2979 { 2980 if (pvrcGuest) 2981 *pvrcGuest = pEvent->GuestResult(); 2982 } 2967 if (pEvent->HasGuestError() && pvrcGuest) 2968 *pvrcGuest = pEvent->GuestResult(); 2983 2969 } 2984 2970 } … … 3362 3348 if (RT_FAILURE(vrc)) 3363 3349 { 3364 if ( vrc == VERR_GSTCTL_GUEST_ERROR)3350 if (pEvent->HasGuestError()) 3365 3351 vrcGuest = pEvent->GuestResult(); 3366 3352 } … … 3370 3356 { 3371 3357 LogRel(("Guest Control: Shutting down guest failed, vrc=%Rrc\n", vrc == VERR_GSTCTL_GUEST_ERROR ? vrcGuest : vrc)); 3372 if ( vrc == VERR_GSTCTL_GUEST_ERROR 3373 && pvrcGuest) 3358 if (pEvent->HasGuestError() && pvrcGuest) 3374 3359 *pvrcGuest = vrcGuest; 3375 3360 } … … 3684 3669 } 3685 3670 /* waitForEvent may also return VERR_GSTCTL_GUEST_ERROR like we do above, so make pvrcGuest is set. */ 3686 else if ( vrc == VERR_GSTCTL_GUEST_ERROR&& pvrcGuest)3671 else if (pEvent->HasGuestError() && pvrcGuest) 3687 3672 *pvrcGuest = pEvent->GuestResult(); 3688 3673 Assert(vrc != VERR_GSTCTL_GUEST_ERROR || !pvrcGuest || *pvrcGuest != (int)0xcccccccc);
Note:
See TracChangeset
for help on using the changeset viewer.