- Timestamp:
- Mar 12, 2018 4:24:27 PM (7 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/GuestProcessImpl.h
r71299 r71301 188 188 { 189 189 /** Return code from the guest side for executing the process tool. */ 190 int rcGuest;190 int rcGuest; 191 191 /** The process tool's returned exit code. */ 192 192 int32_t iExitCode; -
trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp
r71299 r71301 2045 2045 } 2046 2046 2047 /** 2048 * Static helper function to start and wait for a certain toolbox tool. 2049 * 2050 * This function most likely is the one you want to use in the first place if you 2051 * want to just use a toolbox tool and wait for its result. See runEx() if you also 2052 * needs its output. 2053 * 2054 * @return VBox status code. 2055 * @param pGuestSession Guest control session to use for starting the toolbox tool in. 2056 * @param startupInfo Startup information about the toolbox tool. 2057 * @param prcGuest Where to store the toolbox tool's specific error code in case 2058 * VERR_GSTCTL_GUEST_ERROR is returned. 2059 */ 2047 2060 /* static */ 2048 2061 int GuestProcessTool::run( GuestSession *pGuestSession, … … 2056 2069 if (RT_SUCCESS(vrc)) 2057 2070 { 2058 if (errorInfo.rcGuest == VWRN_GSTCTL_PROCESS_EXIT_CODE) 2059 rcGuest = GuestProcessTool::exitCodeToRc(startupInfo, errorInfo.iExitCode); 2060 else 2061 rcGuest = errorInfo.rcGuest; 2062 2063 if (prcGuest) 2064 *prcGuest = rcGuest; 2065 } 2066 2071 /* Make sure to check the error information we got from the guest tool. */ 2072 if (GuestProcess::i_isGuestError(errorInfo.rcGuest)) 2073 { 2074 if (errorInfo.rcGuest == VWRN_GSTCTL_PROCESS_EXIT_CODE) /* Translate exit code to a meaningful error code. */ 2075 rcGuest = GuestProcessTool::exitCodeToRc(startupInfo, errorInfo.iExitCode); 2076 else /* At least return something. */ 2077 rcGuest = errorInfo.rcGuest; 2078 2079 if (prcGuest) 2080 *prcGuest = rcGuest; 2081 2082 vrc = VERR_GSTCTL_GUEST_ERROR; 2083 } 2084 } 2085 2086 LogFlowFunc(("Returned rc=%Rrc, rcGuest=%Rrc, iExitCode=%d\n", vrc, errorInfo.rcGuest, errorInfo.iExitCode)); 2067 2087 return vrc; 2068 2088 } 2069 2089 2070 2090 /** 2071 * Static helper function to start and wait for a certain toolbox tool. 2091 * Static helper function to start and wait for a certain toolbox tool, returning 2092 * extended error information from the guest. 2072 2093 * 2073 * @return IPRTstatus code.2094 * @return VBox status code. 2074 2095 * @param pGuestSession Guest control session to use for starting the toolbox tool in. 2075 2096 * @param startupInfo Startup information about the toolbox tool. … … 2082 2103 { 2083 2104 return runExErrorInfo(pGuestSession, startupInfo, 2084 NULL /* paStrmOutObjects */, 0 /* cStrmOutObjects */, 2085 errorInfo); 2105 NULL /* paStrmOutObjects */, 0 /* cStrmOutObjects */, errorInfo); 2086 2106 } 2087 2107 … … 2110 2130 if (RT_SUCCESS(vrc)) 2111 2131 { 2112 if (errorInfo.rcGuest == VWRN_GSTCTL_PROCESS_EXIT_CODE) 2113 rcGuest = GuestProcessTool::exitCodeToRc(startupInfo, errorInfo.iExitCode); 2114 else 2115 rcGuest = errorInfo.rcGuest; 2116 2117 /* Return VERR_GSTCTL_GUEST_ERROR if we retrieved a guest return code. */ 2118 if (RT_FAILURE(rcGuest)) 2132 /* Make sure to check the error information we got from the guest tool. */ 2133 if (GuestProcess::i_isGuestError(errorInfo.rcGuest)) 2134 { 2135 if (errorInfo.rcGuest == VWRN_GSTCTL_PROCESS_EXIT_CODE) /* Translate exit code to a meaningful error code. */ 2136 rcGuest = GuestProcessTool::exitCodeToRc(startupInfo, errorInfo.iExitCode); 2137 else /* At least return something. */ 2138 rcGuest = errorInfo.rcGuest; 2139 2140 if (prcGuest) 2141 *prcGuest = rcGuest; 2142 2119 2143 vrc = VERR_GSTCTL_GUEST_ERROR; 2120 2121 if (prcGuest) 2122 *prcGuest = rcGuest; 2123 } 2124 2144 } 2145 } 2146 2147 LogFlowFunc(("Returned rc=%Rrc, rcGuest=%Rrc, iExitCode=%d\n", vrc, errorInfo.rcGuest, errorInfo.iExitCode)); 2125 2148 return vrc; 2126 2149 } … … 2133 2156 * on stdout and can be used on the host side to retrieve more information about the actual command issued on the guest side. 2134 2157 * 2135 * @return IPRTstatus code.2158 * @return VBox status code. 2136 2159 * @param pGuestSession Guest control session to use for starting the toolbox tool in. 2137 2160 * @param startupInfo Startup information about the toolbox tool.
Note:
See TracChangeset
for help on using the changeset viewer.