VirtualBox

Changeset 86908 in vbox for trunk/include


Ignore:
Timestamp:
Nov 18, 2020 10:56:12 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
141388
Message:

Shared Clipboard/Transfers: Removed clipboard area handling code. bugref:9437

Location:
trunk/include/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/GuestHost/SharedClipboard-transfers.h

    r85121 r86908  
    467467
    468468/**
    469  * Enumeration for specifying a clipboard area object type.
    470  */
    471 typedef enum _SHCLAREAOBJTYPE
    472 {
    473     /** Unknown object type; do not use. */
    474     SHCLAREAOBJTYPE_UNKNOWN = 0,
    475     /** Object is a directory. */
    476     SHCLAREAOBJTYPE_DIR,
    477     /** Object is a file. */
    478     SHCLAREAOBJTYPE_FILE,
    479     /** Object is a symbolic link. */
    480     SHCLAREAOBJTYPE_SYMLINK,
    481     /** The usual 32-bit hack. */
    482     SHCLAREAOBJTYPE_32Bit_Hack = 0x7fffffff
    483 } SHCLAREAOBJTYPE;
    484 
    485 /** Clipboard area ID. A valid area is >= 1.
    486  *  If 0 is specified, the last (most recent) area is meant.
    487  *  Set to UINT32_MAX if not initialized. */
    488 typedef uint32_t SHCLAREAID;
    489 
    490 /** Defines a non-initialized (nil) clipboard area. */
    491 #define NIL_SHCLAREAID       UINT32_MAX
    492 
    493 /** SharedClipboardArea open flags. */
    494 typedef uint32_t SHCLAREAOPENFLAGS;
    495 
    496 /** No clipboard area open flags specified. */
    497 #define SHCLAREA_OPEN_FLAGS_NONE               0
    498 /** The clipboard area must not exist yet. */
    499 #define SHCLAREA_OPEN_FLAGS_MUST_NOT_EXIST     RT_BIT(0)
    500 /** Mask of all valid clipboard area open flags.  */
    501 #define SHCLAREA_OPEN_FLAGS_VALID_MASK         0x1
    502 
    503 /** Defines a clipboard area object state. */
    504 typedef uint32_t SHCLAREAOBJSTATE;
    505 
    506 /** No object state set. */
    507 #define SHCLAREAOBJSTATE_NONE                0
    508 /** The object is considered as being complete (e.g. serialized). */
    509 #define SHCLAREAOBJSTATE_COMPLETE            RT_BIT(0)
    510 
    511 /**
    512  * Lightweight structure to keep a clipboard area object's state.
    513  *
    514  * Note: We don't want to use the ClipboardURIObject class here, as this
    515  *       is too heavy for this purpose.
    516  */
    517 typedef struct _SHCLAREAOBJ
    518 {
    519     SHCLAREAOBJTYPE  enmType;
    520     SHCLAREAOBJSTATE fState;
    521 } SHCLAREAOBJ, *PSHCLAREAOBJ;
    522 
    523 /**
    524  * Class for maintaining a Shared Clipboard area on the host or guest.
    525  *
    526  * This will contain all received files & directories for a single Shared
    527  * Clipboard operation.
    528  *
    529  * In case of a failed Shared Clipboard operation this class can also
    530  * perform a gentle rollback if required.
    531  */
    532 class SharedClipboardArea
    533 {
    534 public:
    535 
    536     SharedClipboardArea(void);
    537     SharedClipboardArea(const char *pszPath, SHCLAREAID uID = NIL_SHCLAREAID,
    538                         SHCLAREAOPENFLAGS fFlags = SHCLAREA_OPEN_FLAGS_NONE);
    539     virtual ~SharedClipboardArea(void);
    540 
    541 public:
    542 
    543     uint32_t AddRef(void);
    544     uint32_t Release(void);
    545 
    546     int Lock(void);
    547     int Unlock(void);
    548 
    549     int AddObject(const char *pszPath, const SHCLAREAOBJ &Obj);
    550     int GetObject(const char *pszPath, PSHCLAREAOBJ pObj);
    551 
    552     int Close(void);
    553     bool IsOpen(void) const;
    554     int OpenEx(const char *pszPath, SHCLAREAID uID = NIL_SHCLAREAID,
    555                SHCLAREAOPENFLAGS fFlags = SHCLAREA_OPEN_FLAGS_NONE);
    556     int OpenTemp(SHCLAREAID uID = NIL_SHCLAREAID,
    557                  SHCLAREAOPENFLAGS fFlags = SHCLAREA_OPEN_FLAGS_NONE);
    558     SHCLAREAID GetID(void) const;
    559     const char *GetDirAbs(void) const;
    560     uint32_t GetRefCount(void);
    561     int Reopen(void);
    562     int Reset(bool fDeleteContent);
    563     int Rollback(void);
    564 
    565 public:
    566 
    567     static int PathConstruct(const char *pszBase, SHCLAREAID uID, char *pszPath, size_t cbPath);
    568 
    569 protected:
    570 
    571     int initInternal(void);
    572     int destroyInternal(void);
    573     int closeInternal(void);
    574 
    575 protected:
    576 
    577     typedef std::map<RTCString, SHCLAREAOBJ> SharedClipboardAreaFsObjMap;
    578 
    579     /** Creation timestamp (in ms). */
    580     uint64_t                     m_tsCreatedMs;
    581     /** Number of references to this instance. */
    582     volatile uint32_t            m_cRefs;
    583     /** Critical section for serializing access. */
    584     RTCRITSECT                   m_CritSect;
    585     /** Open flags. */
    586     uint32_t                     m_fOpen;
    587     /** Directory handle for root clipboard directory. */
    588     RTDIR                        m_hDir;
    589     /** Absolute path to root clipboard directory. */
    590     RTCString                    m_strPathAbs;
    591     /** List for holding created directories in the case of a rollback. */
    592     SharedClipboardAreaFsObjMap  m_mapObj;
    593     /** Associated clipboard area ID. */
    594     SHCLAREAID                   m_uID;
    595 };
    596 
    597 /**
    598469 * Structure for handling a single transfer object context.
    599470 */
     
    862733    /** Map of all objects handles related to this transfer. */
    863734    RTLISTANCHOR             lstObj;
    864     /** The transfer's own (local) area, if any (can be NULL if not needed).
    865      *  The area itself has a clipboard area ID assigned.
    866      *  On the host this area ID gets shared (maintained / locked) across all VMs via VBoxSVC. */
    867     SharedClipboardArea     *pArea;
    868735    /** The transfer's own provider context. */
    869736    SHCLPROVIDERCTX          ProviderCtx;
     
    991858int ShClTransferRootsSet(PSHCLTRANSFER pTransfer, const char *pszRoots, size_t cbRoots);
    992859void ShClTransferReset(PSHCLTRANSFER pTransfer);
    993 SharedClipboardArea *ShClTransferGetArea(PSHCLTRANSFER pTransfer);
    994860
    995861uint32_t ShClTransferRootsCount(PSHCLTRANSFER pTransfer);
     
    1025891
    1026892#endif /* !VBOX_INCLUDED_GuestHost_SharedClipboard_transfers_h */
    1027 
  • trunk/include/VBox/HostServices/VBoxClipboardExt.h

    r85121 r86908  
    3939#define VBOX_CLIPBOARD_EXT_FN_DATA_READ            (2)
    4040#define VBOX_CLIPBOARD_EXT_FN_DATA_WRITE           (3)
    41 /** Registers a new clipboard area.
    42  *  Uses the SHCLEXTAREAPARMS struct. */
    43 #define VBOX_CLIPBOARD_EXT_FN_AREA_REGISTER        (4)
    44 /** Unregisters an existing clipboard area.
    45  *  Uses the SHCLEXTAREAPARMS struct. */
    46 #define VBOX_CLIPBOARD_EXT_FN_AREA_UNREGISTER      (5)
    47 /** Attaches to an existing clipboard area.
    48  *  Uses the SHCLEXTAREAPARMS struct. */
    49 #define VBOX_CLIPBOARD_EXT_FN_AREA_ATTACH          (6)
    50 /** Detaches from an existing clipboard area.
    51  *  Uses the SHCLEXTAREAPARMS struct. */
    52 #define VBOX_CLIPBOARD_EXT_FN_AREA_DETACH          (7)
    5341
    5442typedef DECLCALLBACKTYPE(int, FNVRDPCLIPBOARDEXTCALLBACK,(uint32_t u32Function, uint32_t u32Format, void *pvData, uint32_t cbData));
     
    6654} SHCLEXTPARMS;
    6755
    68 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
    69 typedef uint32_t SHCLEXTAREAREGISTETRFLAGS;
    70 /** No clipboard register area flags specified. */
    71 #define SHCLEXTAREA_REGISTER_FLAGS_NONE        0
    72 
    73 typedef uint32_t SHCLEXTAREAATTACHFLAGS;
    74 /** No clipboard attach area flags specified. */
    75 #define SHCLEXTAREA_ATTACH_FLAGS_NONE          0
    76 
    77 /**
    78  * Structure for keeping clipboard area callback parameters.
    79  */
    80 typedef struct _SHCLEXTAREAPARMS
    81 {
    82     /** The clipboard area's ID the callback is for. */
    83     SHCLAREAID uID;
    84     union
    85     {
    86         struct
    87         {
    88             void                              *pvData;
    89             uint32_t                           cbData;
    90             /** Area register flags; not used yet and must be set to 0. */
    91             SHCLEXTAREAREGISTETRFLAGS fFlags;
    92         } fn_register;
    93         struct
    94         {
    95             /** Area attach flags; not used yet and must be set to 0. */
    96             SHCLEXTAREAATTACHFLAGS    fFlags;
    97         } fn_attach;
    98     } u;
    99 } SHCLEXTAREAPARMS, *PSHCLEXTAREAPARMS;
    100 #endif /* VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS */
    101 
    10256#endif /* !VBOX_INCLUDED_HostServices_VBoxClipboardExt_h */
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette