VirtualBox

Changeset 82478 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Dec 6, 2019 11:57:37 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
135330
Message:

GuestHost/SharedClipboard-transfers.h: Removed/disabled a bunch more unnecessary SHCL_OBJ_CF_XXX flags and added code to reject invalid/unsupported flags. This will probably break older GAs from the RC and beta, but whatever. So, while at it, eliminated the stupid #pragma pack(1) stuff we've inherited from shared folders / whatever / iprt around the SHCLFSOBJATTR structure. bugref:9437

File:
1 edited

Legend:

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

    r82465 r82478  
    8686
    8787/** Specifies an invalid Shared Clipboard list handle. */
    88 #define SHCLLISTHANDLE_INVALID        ((SHCLLISTHANDLE)~0LL)
     88#define SHCLLISTHANDLE_INVALID        ((SHCLLISTHANDLE)UINT64_MAX)
    8989
    9090/** A Shared Clipboard object handle. */
     
    9494
    9595/** Specifies an invalid Shared Clipboard object handle. */
    96 #define SHCLOBJHANDLE_INVALID         ((SHCLOBJHANDLE)~0LL)
     96#define SHCLOBJHANDLE_INVALID         ((SHCLOBJHANDLE)UINT64_MAX)
    9797
    9898/** @} */
     
    101101 *  @{
    102102 */
    103 
    104103/** No flags. Initialization value. */
    105 #define SHCL_OBJ_CF_NONE                  (0x00000000)
    106 
     104#define SHCL_OBJ_CF_NONE                    UINT32_C(0x00000000)
     105
     106#if 0 /* These probably won't be needed either */
    107107/** Lookup only the object, do not return a handle. All other flags are ignored. */
    108 #define SHCL_OBJ_CF_LOOKUP                (0x00000001)
    109 
     108#define SHCL_OBJ_CF_LOOKUP                  UINT32_C(0x00000001)
    110109/** Create/open a directory. */
    111 #define SHCL_OBJ_CF_DIRECTORY             (0x00000004)
     110#define SHCL_OBJ_CF_DIRECTORY               UINT32_C(0x00000004)
     111#endif
    112112
    113113/** Read/write requested access for the object. */
    114 #define SHCL_OBJ_CF_ACCESS_MASK_RW          (0x00001000)
    115 
     114#define SHCL_OBJ_CF_ACCESS_MASK_RW          UINT32_C(0x00001000)
    116115/** No access requested. */
    117 #define SHCL_OBJ_CF_ACCESS_NONE             (0x00000000)
     116#define SHCL_OBJ_CF_ACCESS_NONE             UINT32_C(0x00000000)
    118117/** Read access requested. */
    119 #define SHCL_OBJ_CF_ACCESS_READ             (0x00001000)
     118#define SHCL_OBJ_CF_ACCESS_READ             UINT32_C(0x00001000)
    120119
    121120/** Requested share access for the object. */
    122 #define SHCL_OBJ_CF_ACCESS_MASK_DENY        (0x0000C000)
    123 
     121#define SHCL_OBJ_CF_ACCESS_MASK_DENY        UINT32_C(0x00008000)
    124122/** Allow any access. */
    125 #define SHCL_OBJ_CF_ACCESS_DENYNONE         (0x00000000)
    126 /** Do not allow read. */
    127 #define SHCL_OBJ_CF_ACCESS_DENYREAD         (0x00004000)
     123#define SHCL_OBJ_CF_ACCESS_DENYNONE         UINT32_C(0x00000000)
    128124/** Do not allow write. */
    129 #define SHCL_OBJ_CF_ACCESS_DENYWRITE        (0x00008000)
    130 /** Do not allow access. */
    131 #define SHCL_OBJ_CF_ACCESS_DENYALL          (SHCL_OBJ_CF_ACCESS_DENYREAD | SHCL_OBJ_CF_ACCESS_DENYWRITE)
     125#define SHCL_OBJ_CF_ACCESS_DENYWRITE        UINT32_C(0x00008000)
    132126
    133127/** Requested access to attributes of the object. */
    134 #define SHCL_OBJ_CF_ACCESS_MASK_ATTR        (0x00030000)
    135 
     128#define SHCL_OBJ_CF_ACCESS_MASK_ATTR        UINT32_C(0x00010000)
    136129/** No access requested. */
    137 #define SHCL_OBJ_CF_ACCESS_ATTR_NONE        (0x00000000)
     130#define SHCL_OBJ_CF_ACCESS_ATTR_NONE        UINT32_C(0x00000000)
    138131/** Read access requested. */
    139 #define SHCL_OBJ_CF_ACCESS_ATTR_READ        (0x00010000)
    140 
     132#define SHCL_OBJ_CF_ACCESS_ATTR_READ        UINT32_C(0x00010000)
     133
     134/** Valid bits. */
     135#define SHCL_OBJ_CF_VALID_MASK              UINT32_C(0x00018000)
    141136/** @} */
    142137
    143 /** Result of an open request.
    144  *  Along with handle value the result code
    145  *  identifies what has happened while
    146  *  trying to open the object.
    147  */
    148 typedef enum _SHCLCREATERESULT
    149 {
    150     SHCL_CREATERESULT_NONE,
    151     /** Specified path does not exist. */
    152     SHCL_CREATERESULT_PATH_NOT_FOUND,
    153     /** Path to file exists, but the last component does not. */
    154     SHCL_CREATERESULT_FILE_NOT_FOUND,
    155     /** Blow the type up to 32-bit. */
    156     SHCL_CREATERESULT_32BIT_HACK = 0x7fffffff
    157 } SHCLCREATERESULT;
    158 AssertCompile(SHCL_CREATERESULT_NONE == 0);
    159 AssertCompileSize(SHCLCREATERESULT, 4);
    160 
    161138/**
    162139 * The available additional information in a SHCLFSOBJATTR object.
     140 * @sa RTFSOBJATTRADD
    163141 */
    164142typedef enum _SHCLFSOBJATTRADD
     
    191169/**
    192170 * Shared Clipboard filesystem object attributes.
    193  */
    194 #pragma pack(1)
     171 *
     172 * @sa RTFSOBJATTR
     173 */
    195174typedef struct _SHCLFSOBJATTR
    196175{
     
    263242            RTFOFF          cb;
    264243        } EASize;
     244
     245        /** Padding the structure to a multiple of 8 bytes. */
     246        uint64_t au64Padding[5];
    265247    } u;
    266248} SHCLFSOBJATTR;
    267 #pragma pack()
    268 AssertCompileSize(SHCLFSOBJATTR, 44);
     249AssertCompileSize(SHCLFSOBJATTR, 48);
    269250/** Pointer to a Shared Clipboard filesystem object attributes structure. */
    270251typedef SHCLFSOBJATTR *PSHCLFSOBJATTR;
     
    274255/**
    275256 * Shared Clipboard file system object information structure.
    276  */
    277 #pragma pack(1)
     257 *
     258 * @sa RTFSOBJINFO
     259 */
    278260typedef struct _SHCLFSOBJINFO
    279261{
     
    311293
    312294} SHCLFSOBJINFO;
    313 #pragma pack()
    314 AssertCompileSize(SHCLFSOBJINFO, 92);
     295AssertCompileSize(SHCLFSOBJINFO, 96);
    315296/** Pointer to a Shared Clipboard filesystem object information structure. */
    316297typedef SHCLFSOBJINFO *PSHCLFSOBJINFO;
     
    319300typedef const SHCLFSOBJINFO *PCSHCLFSOBJINFO;
    320301
    321 #pragma pack(1)
    322302/**
    323303 * Structure for keeping object open/create parameters.
     
    337317    SHCLFSOBJINFO    ObjInfo;
    338318} SHCLOBJOPENCREATEPARMS, *PSHCLOBJOPENCREATEPARMS;
    339 #pragma pack()
    340319
    341320/**
     
    537516
    538517/**
    539  * Class for maintaining a Shared Clipboard area
    540  * on the host or guest. This will contain all received files & directories
    541  * for a single Shared Clipboard operation.
     518 * Class for maintaining a Shared Clipboard area on the host or guest.
     519 *
     520 * This will contain all received files & directories for a single Shared
     521 * Clipboard operation.
    542522 *
    543523 * In case of a failed Shared Clipboard operation this class can also
     
    632612    SHCLTRANSFEROBJSTATE State;
    633613} SHCLTRANSFEROBJ, *PSHCLTRANSFEROBJ;
    634 
    635 /** Defines a transfer ID. */
    636 typedef uint16_t SHCLTRANSFERID;
    637614
    638615/**
     
    743720 * This is handed in to the provider implementation callbacks.
    744721 */
    745     typedef struct _SHCLPROVIDERCTX
     722typedef struct _SHCLPROVIDERCTX
    746723{
    747724    /** Pointer to the related Shared Clipboard transfer. */
     
    752729
    753730/** @todo r=bird: These macros must go as they do no lend themselves to writing
    754  *        sane documentation.  Use the DECLCALLBACK macro instead, as you
     731 *        sane documentation.  Use the DECLCALLBACKMEMBER macro instead, as you
    755732 *        probably do not need the function and function pointer typedefs.
    756733 *
     
    913890    /** The node member for using this struct in a RTList. */
    914891    RTLISTNODE               Node;
    915     /** Critical section for serializing access. */
    916     RTCRITSECT               CritSect;
    917892    /** The transfer's state (for SSM, later). */
    918893    SHCLTRANSFERSTATE        State;
     894    /** Absolute path to root entries. */
     895    char                    *pszPathRootAbs;
    919896    /** Timeout (in ms) for waiting of events. Default is 30s. */
    920897    RTMSINTERVAL             uTimeoutMs;
    921     /** Absolute path to root entries. */
    922     char                    *pszPathRootAbs;
    923898    /** Maximum data chunk size (in bytes) to transfer. Default is 64K. */
    924899    uint32_t                 cbMaxChunkSize;
     
    961936    /** Contains thread-related attributes. */
    962937    SHCLTRANSFERTHREAD       Thread;
     938    /** Critical section for serializing access. */
     939    RTCRITSECT               CritSect;
    963940} SHCLTRANSFER, *PSHCLTRANSFER;
    964941
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