Changeset 100666 in vbox for trunk/src/VBox/Additions/common/VBoxGuest
- Timestamp:
- Jul 20, 2023 1:43:35 PM (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibClipboard.cpp
r100663 r100666 2122 2122 LogFlowFuncEnter(); 2123 2123 2124 int rc ;2124 int rc = VINF_SUCCESS; 2125 2125 2126 2126 PSHCLTRANSFER pTransfer = ShClTransferCtxGetTransferById(pTransferCtx, idTransfer); … … 2133 2133 if (RT_SUCCESS(rc)) 2134 2134 { 2135 LogRel(("Shared Clipboard: Transfer %RU 32successfully uninitialized\n", idTransfer));2135 LogRel(("Shared Clipboard: Transfer %RU16 successfully uninitialized\n", idTransfer)); 2136 2136 } 2137 2137 else 2138 LogRel(("Shared Clipboard: Unable to uninitialized transfer %RU32, rc=%Rrc\n", idTransfer, rc)); 2139 } 2140 else 2141 rc = VERR_SHCLPB_TRANSFER_ID_NOT_FOUND; 2142 2143 /* Send a reply in any case. */ 2144 int rc2 = VbglR3ClipboardTransferSendStatus(pCmdCtx, pTransfer, 2145 RT_SUCCESS(rc) 2146 ? SHCLTRANSFERSTATUS_UNINITIALIZED : SHCLTRANSFERSTATUS_ERROR, rc); 2147 2148 /* The host might not have the transfer around anymore at this time, so simply ignore this error. */ 2149 if (rc2 == VERR_SHCLPB_TRANSFER_ID_NOT_FOUND) 2150 rc2 = VINF_SUCCESS; 2151 2152 if (RT_SUCCESS(rc)) 2153 rc = rc2; 2138 LogRel(("Shared Clipboard: Unable to uninitialized transfer %RU16, rc=%Rrc\n", idTransfer, rc)); 2139 } 2154 2140 2155 2141 LogFlowFuncLeaveRC(rc); … … 2213 2199 RT_SUCCESS(rc) 2214 2200 ? SHCLTRANSFERSTATUS_STARTED : SHCLTRANSFERSTATUS_ERROR, rc); 2215 if (RT_SUCCESS(rc))2216 rc = rc2;2217 2218 LogFlowFuncLeaveRC(rc);2219 return rc;2220 }2221 2222 /**2223 * Stops a transfer on the guest side.2224 *2225 * @returns VBox status code, or VERR_NOT_FOUND if transfer has not been found.2226 * @param pCmdCtx Command context to use.2227 * @param pTransferCtx Transfer context to stop transfer for.2228 * @param uTransferID ID of transfer to stop.2229 */2230 static int vbglR3ClipboardTransferStop(PVBGLR3SHCLCMDCTX pCmdCtx, PSHCLTRANSFERCTX pTransferCtx,2231 SHCLTRANSFERID uTransferID)2232 {2233 LogFlowFuncEnter();2234 2235 int rc;2236 2237 PSHCLTRANSFER pTransfer = ShClTransferCtxGetTransferById(pTransferCtx, uTransferID);2238 if (pTransfer)2239 {2240 rc = ShClTransferCtxUnregisterById(pTransferCtx, uTransferID);2241 if (RT_SUCCESS(rc))2242 {2243 LogRel(("Shared Clipboard: Transfer %RU32 successfully stopped\n", uTransferID));2244 }2245 else2246 LogRel(("Shared Clipboard: Unable to stop transfer %RU32, rc=%Rrc\n", uTransferID, rc));2247 }2248 else2249 rc = VERR_SHCLPB_TRANSFER_ID_NOT_FOUND;2250 2251 /* Send a reply in any case. */2252 int rc2 = VbglR3ClipboardTransferSendStatus(pCmdCtx, pTransfer,2253 RT_SUCCESS(rc)2254 ? SHCLTRANSFERSTATUS_COMPLETED : SHCLTRANSFERSTATUS_ERROR, rc);2255 2201 if (RT_SUCCESS(rc)) 2256 2202 rc = rc2; … … 2376 2322 } 2377 2323 2378 case SHCLTRANSFERSTATUS_UNINITIALIZED:2379 {2380 rc = vbglR3ClipboardTransferDestroy(pCmdCtx, pTransferCtx, idTransfer);2381 break;2382 }2383 2384 2324 case SHCLTRANSFERSTATUS_STARTED: 2385 2325 { … … 2388 2328 } 2389 2329 2330 case SHCLTRANSFERSTATUS_UNINITIALIZED: 2331 RT_FALL_THROUGH(); 2390 2332 case SHCLTRANSFERSTATUS_COMPLETED: 2391 2333 RT_FALL_THROUGH(); … … 2396 2338 case SHCLTRANSFERSTATUS_ERROR: 2397 2339 { 2398 rc = vbglR3ClipboardTransfer Stop(pCmdCtx, pTransferCtx, idTransfer);2340 rc = vbglR3ClipboardTransferDestroy(pCmdCtx, pTransferCtx, idTransfer); 2399 2341 break; 2400 2342 }
Note:
See TracChangeset
for help on using the changeset viewer.