Changeset 99403 in vbox for trunk/src/VBox
- Timestamp:
- Apr 14, 2023 2:57:12 PM (23 months ago)
- svn:sync-xref-src-repo-rev:
- 156853
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/SharedClipboard/clipboard-transfers.cpp
r98103 r99403 1 1 /* $Id$ */ 2 2 /** @file 3 * Shared Clipboard: Common Shared Clipboard transfer handling code.3 * Shared Clipboard: Common clipboard transfer handling code. 4 4 */ 5 5 … … 67 67 * Frees a transfer root list. 68 68 * 69 * @param pRootList transfer root list to free. The pointer will be69 * @param pRootList Transfer root list to free. The pointer will be 70 70 * invalid after returning from this function. 71 71 */ … … 247 247 * 248 248 * @param pListEntry Transfer list header structure to free. 249 * The pointer will be invalid on return. 249 250 */ 250 251 void ShClTransferListHdrFree(PSHCLLISTHDR pListHdr) … … 273 274 PSHCLLISTHDR pListHdrDup = (PSHCLLISTHDR)RTMemAlloc(sizeof(SHCLLISTHDR)); 274 275 if (pListHdrDup) 275 {276 276 *pListHdrDup = *pListHdr; 277 }278 277 279 278 return pListHdrDup; … … 337 336 } 338 337 338 /** 339 * (Deep-)Copies a transfer list open parameters structure from one into another. 340 * 341 * @returns VBox status code. 342 * @param pDst Destination parameters to copy to. 343 * @param pSrc Source parameters to copy from. 344 */ 339 345 int ShClTransferListOpenParmsCopy(PSHCLLISTOPENPARMS pDst, PSHCLLISTOPENPARMS pSrc) 340 346 { … … 443 449 * Creates (allocates) and initializes a clipboard list entry structure. 444 450 * 451 * @returns VBox status code. 445 452 * @param ppDirData Where to return the created clipboard list entry structure on success. 446 453 */ … … 461 468 * Frees a clipboard list entry structure. 462 469 * 463 * @param pListEntry Clipboard list entry structure to free. 470 * @param pListEntry Clipboard list entry structure to free. 471 * The pointer will be invalid on return. 464 472 */ 465 473 void ShClTransferListEntryFree(PSHCLLISTENTRY pListEntry) … … 473 481 474 482 /** 475 * (Deep) Copies a clipboard list entry structure. 476 * 477 * @returns VBox status code. 478 * @param pListEntry Clipboard list entry to copy. 483 * (Deep-)Copies a clipboard list entry structure. 484 * 485 * @returns VBox status code. 486 * @param pDst Destination list entry to copy to. 487 * @param pSrc Source list entry to copy from. 479 488 */ 480 489 int ShClTransferListEntryCopy(PSHCLLISTENTRY pDst, PSHCLLISTENTRY pSrc) … … 633 642 * 634 643 * @returns VBox status code. 635 * @param pObjCtx transfer object context to initialize.644 * @param pObjCtx Transfer object context to initialize. 636 645 */ 637 646 int ShClTransferObjCtxInit(PSHCLCLIENTTRANSFEROBJCTX pObjCtx) … … 649 658 * Destroys a transfer object context. 650 659 * 651 * @param pObjCtx transfer object context to destroy.660 * @param pObjCtx Transfer object context to destroy. 652 661 */ 653 662 void ShClTransferObjCtxDestroy(PSHCLCLIENTTRANSFEROBJCTX pObjCtx) … … 662 671 * 663 672 * @returns \c true if valid, \c false if not. 664 * @param pObjCtx transfer object context to check.673 * @param pObjCtx Transfer object context to check. 665 674 */ 666 675 bool ShClTransferObjCtxIsValid(PSHCLCLIENTTRANSFEROBJCTX pObjCtx) … … 711 720 * 712 721 * @returns VBox status code. 713 * @param pParms transfer object open parameters structure to initialize.722 * @param pParms Transfer object open parameters structure to initialize. 714 723 */ 715 724 int ShClTransferObjOpenParmsInit(PSHCLOBJOPENCREATEPARMS pParms) … … 768 777 * Destroys a transfer object open parameters structure. 769 778 * 770 * @param pParms transfer object open parameters structure to destroy.779 * @param pParms Transfer object open parameters structure to destroy. 771 780 */ 772 781 void ShClTransferObjOpenParmsDestroy(PSHCLOBJOPENCREATEPARMS pParms) … … 1092 1101 * 1093 1102 * @returns Duplicated object data chunk on success, or NULL on failure. 1094 * @param pDataChunk transfer object data chunk to duplicate.1103 * @param pDataChunk Transfer object data chunk to duplicate. 1095 1104 */ 1096 1105 PSHCLOBJDATACHUNK ShClTransferObjDataChunkDup(PSHCLOBJDATACHUNK pDataChunk) 1097 1106 { 1098 if (!pDataChunk) 1099 return NULL; 1107 AssertPtrReturn(pDataChunk, NULL); 1100 1108 1101 1109 PSHCLOBJDATACHUNK pDataChunkDup = (PSHCLOBJDATACHUNK)RTMemAllocZ(sizeof(SHCLOBJDATACHUNK)); … … 1109 1117 pDataChunkDup->uHandle = pDataChunk->uHandle; 1110 1118 pDataChunkDup->pvData = RTMemDup(pDataChunk->pvData, pDataChunk->cbData); 1119 AssertPtrReturn(pDataChunkDup->pvData, NULL); 1111 1120 pDataChunkDup->cbData = pDataChunk->cbData; 1112 1121 } … … 1118 1127 * Destroys a transfer object data chunk. 1119 1128 * 1120 * @param pDataChunk transfer object data chunk to destroy.1129 * @param pDataChunk Transfer object data chunk to destroy. 1121 1130 */ 1122 1131 void ShClTransferObjDataChunkDestroy(PSHCLOBJDATACHUNK pDataChunk) … … 1141 1150 * Frees a transfer object data chunk. 1142 1151 * 1143 * @param pDataChunk transfer object data chunk to free. The handed-in pointer will1144 * be invalid after calling this function.1152 * @param pDataChunk Transfer object data chunk to free. 1153 * The pointer will be invalid on return. 1145 1154 */ 1146 1155 void ShClTransferObjDataChunkFree(PSHCLOBJDATACHUNK pDataChunk) … … 1159 1168 * 1160 1169 * @returns VBox status code. 1161 * @param ppTransfer Where to return the created Shared Clipboard transfer struct.1170 * @param ppTransfer Where to return the created clipboard transfer struct. 1162 1171 * Must be destroyed by ShClTransferDestroy(). 1163 1172 */ … … 1220 1229 1221 1230 /** 1222 * Destroys a clipboard transfer context struct.1231 * Destroys a clipboard transfer. 1223 1232 * 1224 1233 * @returns VBox status code. … … 1245 1254 1246 1255 /** 1247 * Initializes a Shared Clipboard transfer object.1256 * Initializes a clipboard transfer. 1248 1257 * 1249 1258 * @returns VBox status code. … … 1278 1287 1279 1288 /** 1280 * Returns a specific list handle info of a transfer.1289 * Returns a specific list handle info of a clipboard transfer. 1281 1290 * 1282 1291 * @returns Pointer to list handle info if found, or NULL if not found. … … 1428 1437 1429 1438 /** 1430 * Opens a list.1439 * Opens a transfer list. 1431 1440 * 1432 1441 * @returns VBox status code. … … 1552 1561 1553 1562 /** 1554 * Closes a list.1563 * Closes a transfer list. 1555 1564 * 1556 1565 * @returns VBox status code. … … 1614 1623 1615 1624 /** 1616 * Adds a file to a list heaer.1625 * Adds a file to a transfer list header. 1617 1626 * 1618 1627 * @returns VBox status code. … … 1622 1631 static int shclTransferListHdrAddFile(PSHCLLISTHDR pHdr, const char *pszPath) 1623 1632 { 1633 AssertPtrReturn(pHdr, VERR_INVALID_POINTER); 1634 AssertPtrReturn(pszPath, VERR_INVALID_POINTER); 1635 1624 1636 uint64_t cbSize = 0; 1625 1637 int rc = RTFileQuerySizeByPath(pszPath, &cbSize); … … 1635 1647 1636 1648 /** 1637 * Builds a list header, internal version.1649 * Builds a transfer list header, internal version. 1638 1650 * 1639 1651 * @returns VBox status code. 1640 1652 * @param pHdr Where to store the build list header. 1641 * @param pcszSrcPath Source path of list. 1642 * @param pcszDstPath Destination path of list. 1643 * @param pcszDstBase Destination base path. 1644 * @param cchDstBase Number of charaters of destination base path. 1653 * @param pcszPathAbs Absolute path to use for building the transfer list. 1645 1654 */ 1646 1655 static int shclTransferListHdrFromDir(PSHCLLISTHDR pHdr, const char *pcszPathAbs) … … 1728 1737 1729 1738 /** 1730 * Retrieves the header of a Shared Clipboardlist.1739 * Retrieves the header of a transfer list. 1731 1740 * 1732 1741 * @returns VBox status code. … … 1806 1815 1807 1816 /** 1808 * Returns the current transfer object for a Shared Clipboardtransfer list.1817 * Returns the current transfer object of a transfer list. 1809 1818 * 1810 1819 * Currently not implemented and wil return NULL. … … 1812 1821 * @returns Pointer to transfer object, or NULL if not found / invalid. 1813 1822 * @param pTransfer Clipboard transfer to return transfer object for. 1814 * @param hList Handle of Shared Clipboard transfer list to get object for.1823 * @param hList Handle of clipboard transfer list to get object for. 1815 1824 * @param uIdx Index of object to get. 1816 1825 */ … … 1828 1837 1829 1838 /** 1830 * Reads a single Shared Clipboardlist entry.1839 * Reads a single transfer list entry. 1831 1840 * 1832 1841 * @returns VBox status code or VERR_NO_MORE_FILES if the end of the list has been reached. … … 1993 2002 1994 2003 /** 1995 * Returns whether a given list handle is valid or not.2004 * Returns whether a given transfer list handle is valid or not. 1996 2005 * 1997 2006 * @returns \c true if list handle is valid, \c false if not. … … 2052 2061 2053 2062 /** 2054 * Sets or unsets the callback table to be used for a Shared Clipboard transfer.2063 * Sets or unsets the callback table to be used for a clipboard transfer. 2055 2064 * 2056 2065 * @returns VBox status code. … … 2094 2103 2095 2104 /** 2096 * Clears (resets) the root list of a Shared Clipboard transfer.2105 * Clears (resets) the root list of a clipboard transfer. 2097 2106 * 2098 2107 * @param pTransfer Transfer to clear transfer root list for. … … 2123 2132 2124 2133 /** 2125 * Resets a Shared Clipboard transfer.2134 * Resets a clipboard transfer. 2126 2135 * 2127 2136 * @param pTransfer Clipboard transfer to reset. … … 2255 2264 2256 2265 /** 2257 * Returns the root entries of a Shared Clipboard transfer.2266 * Returns the root entries of a clipboard transfer. 2258 2267 * 2259 2268 * @returns VBox status code. … … 2325 2334 2326 2335 /** 2327 * Sets transfer root list entries for a giventransfer.2336 * Sets root list entries for a given clipboard transfer. 2328 2337 * 2329 2338 * @returns VBox status code. … … 2440 2449 2441 2450 /** 2442 * Returns the transfer's ID.2451 * Returns the clipboard transfer's ID. 2443 2452 * 2444 2453 * @returns The transfer's ID. … … 2453 2462 2454 2463 /** 2455 * Returns the transfer's direction.2464 * Returns the clipboard transfer's direction. 2456 2465 * 2457 2466 * @returns The transfer's direction. … … 2495 2504 2496 2505 /** 2497 * Runs a started Shared Clipboard transfer in a dedicated thread.2506 * Runs a started clipboard transfer in a dedicated thread. 2498 2507 * 2499 2508 * @returns VBox status code. … … 2554 2563 2555 2564 /** 2556 * Creates a thread for a Shared Clipboard transfer.2565 * Creates a thread for a clipboard transfer. 2557 2566 * 2558 2567 * @returns VBox status code. … … 2595 2604 2596 2605 /** 2597 * Destroys a thread of a Shared Clipboard transfer.2606 * Destroys the thread of a clipboard transfer. 2598 2607 * 2599 2608 * @returns VBox status code. … … 2622 2631 2623 2632 /** 2624 * Initializes a Shared Clipboard transfer context.2633 * Initializes a clipboard transfer context. 2625 2634 * 2626 2635 * @returns VBox status code. … … 2654 2663 2655 2664 /** 2656 * Destroys a Shared Clipboard transfer context struct.2665 * Destroys a clipboard transfer context. 2657 2666 * 2658 2667 * @param pTransferCtx Transfer context to destroy. … … 2684 2693 2685 2694 /** 2686 * Resets a Shared Clipboard transfer.2695 * Resets a clipboard transfer context. 2687 2696 * 2688 2697 * @param pTransferCtx Transfer context to reset. … … 2704 2713 2705 2714 /** 2706 * Returns a specific Shared Clipboard transfer, internal version.2707 * 2708 * @returns Shared Clipboard transfer, or NULL if not found.2715 * Returns a specific clipboard transfer, internal version. 2716 * 2717 * @returns Clipboard transfer found, or NULL if not found. 2709 2718 * @param pTransferCtx Transfer context to return transfer for. 2710 2719 * @param uID ID of the transfer to return. … … 2723 2732 2724 2733 /** 2725 * Returns a specific Shared Clipboard transfer by index, internal version.2726 * 2727 * @returns Shared Clipboard transfer, or NULL if not found.2734 * Returns a specific clipboard transfer by index, internal version. 2735 * 2736 * @returns Clipboard transfer found, or NULL if not found. 2728 2737 * @param pTransferCtx Transfer context to return transfer for. 2729 2738 * @param uIdx Index of the transfer to return. … … 2745 2754 2746 2755 /** 2747 * Returns a Shared Clipboard transfer for a specific transfer ID.2748 * 2749 * @returns Shared Clipboard transfer, or NULL if not found.2756 * Returns a clipboard transfer for a specific transfer ID. 2757 * 2758 * @returns Clipboard transfer found, or NULL if not found. 2750 2759 * @param pTransferCtx Transfer context to return transfer for. 2751 2760 * @param uID ID of the transfer to return. … … 2757 2766 2758 2767 /** 2759 * Returns a Shared Clipboard transfer for a specific list index.2760 * 2761 * @returns Shared Clipboard transfer, or NULL if not found.2768 * Returns a clipboard transfer for a specific list index. 2769 * 2770 * @returns Clipboard transfer found, or NULL if not found. 2762 2771 * @param pTransferCtx Transfer context to return transfer for. 2763 2772 * @param uIdx List index of the transfer to return. … … 2769 2778 2770 2779 /** 2771 * Returns the number of running Shared Clipboard transfers.2780 * Returns the number of running clipboard transfers for a given transfer context. 2772 2781 * 2773 2782 * @returns Number of running transfers. … … 2781 2790 2782 2791 /** 2783 * Returns the number of total Shared Clipboard transfers.2792 * Returns the number of total clipboard transfers for a given transfer context. 2784 2793 * 2785 2794 * @returns Number of total transfers. … … 2793 2802 2794 2803 /** 2795 * Registers a Shared Clipboard transfer with a transfer context, i.e. allocates a transfer ID.2804 * Registers a clipboard transfer with a transfer context, i.e. allocates a transfer ID. 2796 2805 * 2797 2806 * @return VBox status code. … … 2852 2861 2853 2862 /** 2854 * Registers a Shared Clipboard transfer with a transfer context by specifying an ID for the transfer.2863 * Registers a clipboard transfer with a transfer context by specifying an ID for the transfer. 2855 2864 * 2856 2865 * @return VBox status code. … … 3112 3121 3113 3122 /** 3114 * Translates a Shared Clipboard transfer status (SHCLTRANSFERSTATUS_XXX) into a string.3123 * Translates a clipboard transfer status (SHCLTRANSFERSTATUS_XXX) into a string. 3115 3124 * 3116 3125 * @returns Transfer status string name. … … 3131 3140 return "Unknown"; 3132 3141 } 3142
Note:
See TracChangeset
for help on using the changeset viewer.