Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: MIT */
0002 /*
0003  * VirtualBox Shared Folders: host interface definition.
0004  *
0005  * Copyright (C) 2006-2018 Oracle Corporation
0006  */
0007 
0008 #ifndef SHFL_HOSTINTF_H
0009 #define SHFL_HOSTINTF_H
0010 
0011 #include <linux/vbox_vmmdev_types.h>
0012 
0013 /* The max in/out buffer size for a FN_READ or FN_WRITE call */
0014 #define SHFL_MAX_RW_COUNT           (16 * SZ_1M)
0015 
0016 /*
0017  * Structures shared between guest and the service
0018  * can be relocated and use offsets to point to variable
0019  * length parts.
0020  *
0021  * Shared folders protocol works with handles.
0022  * Before doing any action on a file system object,
0023  * one have to obtain the object handle via a SHFL_FN_CREATE
0024  * request. A handle must be closed with SHFL_FN_CLOSE.
0025  */
0026 
0027 enum {
0028     SHFL_FN_QUERY_MAPPINGS = 1, /* Query mappings changes. */
0029     SHFL_FN_QUERY_MAP_NAME = 2, /* Query map name. */
0030     SHFL_FN_CREATE = 3,     /* Open/create object. */
0031     SHFL_FN_CLOSE = 4,      /* Close object handle. */
0032     SHFL_FN_READ = 5,       /* Read object content. */
0033     SHFL_FN_WRITE = 6,      /* Write new object content. */
0034     SHFL_FN_LOCK = 7,       /* Lock/unlock a range in the object. */
0035     SHFL_FN_LIST = 8,       /* List object content. */
0036     SHFL_FN_INFORMATION = 9,    /* Query/set object information. */
0037     /* Note function number 10 is not used! */
0038     SHFL_FN_REMOVE = 11,        /* Remove object */
0039     SHFL_FN_MAP_FOLDER_OLD = 12,    /* Map folder (legacy) */
0040     SHFL_FN_UNMAP_FOLDER = 13,  /* Unmap folder */
0041     SHFL_FN_RENAME = 14,        /* Rename object */
0042     SHFL_FN_FLUSH = 15,     /* Flush file */
0043     SHFL_FN_SET_UTF8 = 16,      /* Select UTF8 filename encoding */
0044     SHFL_FN_MAP_FOLDER = 17,    /* Map folder */
0045     SHFL_FN_READLINK = 18,      /* Read symlink dest (as of VBox 4.0) */
0046     SHFL_FN_SYMLINK = 19,       /* Create symlink (as of VBox 4.0) */
0047     SHFL_FN_SET_SYMLINKS = 20,  /* Ask host to show symlinks (4.0+) */
0048 };
0049 
0050 /* Root handles for a mapping are of type u32, Root handles are unique. */
0051 #define SHFL_ROOT_NIL       UINT_MAX
0052 
0053 /* Shared folders handle for an opened object are of type u64. */
0054 #define SHFL_HANDLE_NIL     ULLONG_MAX
0055 
0056 /* Hardcoded maximum length (in chars) of a shared folder name. */
0057 #define SHFL_MAX_LEN         (256)
0058 /* Hardcoded maximum number of shared folder mapping available to the guest. */
0059 #define SHFL_MAX_MAPPINGS    (64)
0060 
0061 /** Shared folder string buffer structure. */
0062 struct shfl_string {
0063     /** Allocated size of the string member in bytes. */
0064     u16 size;
0065 
0066     /** Length of string without trailing nul in bytes. */
0067     u16 length;
0068 
0069     /** UTF-8 or UTF-16 string. Nul terminated. */
0070     union {
0071         u8 utf8[2];
0072         u16 utf16[1];
0073         u16 ucs2[1]; /* misnomer, use utf16. */
0074     } string;
0075 };
0076 VMMDEV_ASSERT_SIZE(shfl_string, 6);
0077 
0078 /* The size of shfl_string w/o the string part. */
0079 #define SHFLSTRING_HEADER_SIZE  4
0080 
0081 /* Calculate size of the string. */
0082 static inline u32 shfl_string_buf_size(const struct shfl_string *string)
0083 {
0084     return string ? SHFLSTRING_HEADER_SIZE + string->size : 0;
0085 }
0086 
0087 /* Set user id on execution (S_ISUID). */
0088 #define SHFL_UNIX_ISUID             0004000U
0089 /* Set group id on execution (S_ISGID). */
0090 #define SHFL_UNIX_ISGID             0002000U
0091 /* Sticky bit (S_ISVTX / S_ISTXT). */
0092 #define SHFL_UNIX_ISTXT             0001000U
0093 
0094 /* Owner readable (S_IRUSR). */
0095 #define SHFL_UNIX_IRUSR             0000400U
0096 /* Owner writable (S_IWUSR). */
0097 #define SHFL_UNIX_IWUSR             0000200U
0098 /* Owner executable (S_IXUSR). */
0099 #define SHFL_UNIX_IXUSR             0000100U
0100 
0101 /* Group readable (S_IRGRP). */
0102 #define SHFL_UNIX_IRGRP             0000040U
0103 /* Group writable (S_IWGRP). */
0104 #define SHFL_UNIX_IWGRP             0000020U
0105 /* Group executable (S_IXGRP). */
0106 #define SHFL_UNIX_IXGRP             0000010U
0107 
0108 /* Other readable (S_IROTH). */
0109 #define SHFL_UNIX_IROTH             0000004U
0110 /* Other writable (S_IWOTH). */
0111 #define SHFL_UNIX_IWOTH             0000002U
0112 /* Other executable (S_IXOTH). */
0113 #define SHFL_UNIX_IXOTH             0000001U
0114 
0115 /* Named pipe (fifo) (S_IFIFO). */
0116 #define SHFL_TYPE_FIFO              0010000U
0117 /* Character device (S_IFCHR). */
0118 #define SHFL_TYPE_DEV_CHAR          0020000U
0119 /* Directory (S_IFDIR). */
0120 #define SHFL_TYPE_DIRECTORY         0040000U
0121 /* Block device (S_IFBLK). */
0122 #define SHFL_TYPE_DEV_BLOCK         0060000U
0123 /* Regular file (S_IFREG). */
0124 #define SHFL_TYPE_FILE              0100000U
0125 /* Symbolic link (S_IFLNK). */
0126 #define SHFL_TYPE_SYMLINK           0120000U
0127 /* Socket (S_IFSOCK). */
0128 #define SHFL_TYPE_SOCKET            0140000U
0129 /* Whiteout (S_IFWHT). */
0130 #define SHFL_TYPE_WHITEOUT          0160000U
0131 /* Type mask (S_IFMT). */
0132 #define SHFL_TYPE_MASK              0170000U
0133 
0134 /* Checks the mode flags indicate a directory (S_ISDIR). */
0135 #define SHFL_IS_DIRECTORY(m)   (((m) & SHFL_TYPE_MASK) == SHFL_TYPE_DIRECTORY)
0136 /* Checks the mode flags indicate a symbolic link (S_ISLNK). */
0137 #define SHFL_IS_SYMLINK(m)     (((m) & SHFL_TYPE_MASK) == SHFL_TYPE_SYMLINK)
0138 
0139 /** The available additional information in a shfl_fsobjattr object. */
0140 enum shfl_fsobjattr_add {
0141     /** No additional information is available / requested. */
0142     SHFLFSOBJATTRADD_NOTHING = 1,
0143     /**
0144      * The additional unix attributes (shfl_fsobjattr::u::unix_attr) are
0145      *  available / requested.
0146      */
0147     SHFLFSOBJATTRADD_UNIX,
0148     /**
0149      * The additional extended attribute size (shfl_fsobjattr::u::size) is
0150      *  available / requested.
0151      */
0152     SHFLFSOBJATTRADD_EASIZE,
0153     /**
0154      * The last valid item (inclusive).
0155      * The valid range is SHFLFSOBJATTRADD_NOTHING thru
0156      * SHFLFSOBJATTRADD_LAST.
0157      */
0158     SHFLFSOBJATTRADD_LAST = SHFLFSOBJATTRADD_EASIZE,
0159 
0160     /** The usual 32-bit hack. */
0161     SHFLFSOBJATTRADD_32BIT_SIZE_HACK = 0x7fffffff
0162 };
0163 
0164 /**
0165  * Additional unix Attributes, these are available when
0166  * shfl_fsobjattr.additional == SHFLFSOBJATTRADD_UNIX.
0167  */
0168 struct shfl_fsobjattr_unix {
0169     /**
0170      * The user owning the filesystem object (st_uid).
0171      * This field is ~0U if not supported.
0172      */
0173     u32 uid;
0174 
0175     /**
0176      * The group the filesystem object is assigned (st_gid).
0177      * This field is ~0U if not supported.
0178      */
0179     u32 gid;
0180 
0181     /**
0182      * Number of hard links to this filesystem object (st_nlink).
0183      * This field is 1 if the filesystem doesn't support hardlinking or
0184      * the information isn't available.
0185      */
0186     u32 hardlinks;
0187 
0188     /**
0189      * The device number of the device which this filesystem object resides
0190      * on (st_dev). This field is 0 if this information is not available.
0191      */
0192     u32 inode_id_device;
0193 
0194     /**
0195      * The unique identifier (within the filesystem) of this filesystem
0196      * object (st_ino). Together with inode_id_device, this field can be
0197      * used as a OS wide unique id, when both their values are not 0.
0198      * This field is 0 if the information is not available.
0199      */
0200     u64 inode_id;
0201 
0202     /**
0203      * User flags (st_flags).
0204      * This field is 0 if this information is not available.
0205      */
0206     u32 flags;
0207 
0208     /**
0209      * The current generation number (st_gen).
0210      * This field is 0 if this information is not available.
0211      */
0212     u32 generation_id;
0213 
0214     /**
0215      * The device number of a char. or block device type object (st_rdev).
0216      * This field is 0 if the file isn't a char. or block device or when
0217      * the OS doesn't use the major+minor device idenfication scheme.
0218      */
0219     u32 device;
0220 } __packed;
0221 
0222 /** Extended attribute size. */
0223 struct shfl_fsobjattr_easize {
0224     /** Size of EAs. */
0225     s64 cb;
0226 } __packed;
0227 
0228 /** Shared folder filesystem object attributes. */
0229 struct shfl_fsobjattr {
0230     /** Mode flags (st_mode). SHFL_UNIX_*, SHFL_TYPE_*, and SHFL_DOS_*. */
0231     u32 mode;
0232 
0233     /** The additional attributes available. */
0234     enum shfl_fsobjattr_add additional;
0235 
0236     /**
0237      * Additional attributes.
0238      *
0239      * Unless explicitly specified to an API, the API can provide additional
0240      * data as it is provided by the underlying OS.
0241      */
0242     union {
0243         struct shfl_fsobjattr_unix unix_attr;
0244         struct shfl_fsobjattr_easize size;
0245     } __packed u;
0246 } __packed;
0247 VMMDEV_ASSERT_SIZE(shfl_fsobjattr, 44);
0248 
0249 struct shfl_timespec {
0250     s64 ns_relative_to_unix_epoch;
0251 };
0252 
0253 /** Filesystem object information structure. */
0254 struct shfl_fsobjinfo {
0255     /**
0256      * Logical size (st_size).
0257      * For normal files this is the size of the file.
0258      * For symbolic links, this is the length of the path name contained
0259      * in the symbolic link.
0260      * For other objects this fields needs to be specified.
0261      */
0262     s64 size;
0263 
0264     /** Disk allocation size (st_blocks * DEV_BSIZE). */
0265     s64 allocated;
0266 
0267     /** Time of last access (st_atime). */
0268     struct shfl_timespec access_time;
0269 
0270     /** Time of last data modification (st_mtime). */
0271     struct shfl_timespec modification_time;
0272 
0273     /**
0274      * Time of last status change (st_ctime).
0275      * If not available this is set to modification_time.
0276      */
0277     struct shfl_timespec change_time;
0278 
0279     /**
0280      * Time of file birth (st_birthtime).
0281      * If not available this is set to change_time.
0282      */
0283     struct shfl_timespec birth_time;
0284 
0285     /** Attributes. */
0286     struct shfl_fsobjattr attr;
0287 
0288 } __packed;
0289 VMMDEV_ASSERT_SIZE(shfl_fsobjinfo, 92);
0290 
0291 /**
0292  * result of an open/create request.
0293  * Along with handle value the result code
0294  * identifies what has happened while
0295  * trying to open the object.
0296  */
0297 enum shfl_create_result {
0298     SHFL_NO_RESULT,
0299     /** Specified path does not exist. */
0300     SHFL_PATH_NOT_FOUND,
0301     /** Path to file exists, but the last component does not. */
0302     SHFL_FILE_NOT_FOUND,
0303     /** File already exists and either has been opened or not. */
0304     SHFL_FILE_EXISTS,
0305     /** New file was created. */
0306     SHFL_FILE_CREATED,
0307     /** Existing file was replaced or overwritten. */
0308     SHFL_FILE_REPLACED
0309 };
0310 
0311 /* No flags. Initialization value. */
0312 #define SHFL_CF_NONE                  (0x00000000)
0313 
0314 /*
0315  * Only lookup the object, do not return a handle. When this is set all other
0316  * flags are ignored.
0317  */
0318 #define SHFL_CF_LOOKUP                (0x00000001)
0319 
0320 /*
0321  * Open parent directory of specified object.
0322  * Useful for the corresponding Windows FSD flag
0323  * and for opening paths like \\dir\\*.* to search the 'dir'.
0324  */
0325 #define SHFL_CF_OPEN_TARGET_DIRECTORY (0x00000002)
0326 
0327 /* Create/open a directory. */
0328 #define SHFL_CF_DIRECTORY             (0x00000004)
0329 
0330 /*
0331  *  Open/create action to do if object exists
0332  *  and if the object does not exists.
0333  *  REPLACE file means atomically DELETE and CREATE.
0334  *  OVERWRITE file means truncating the file to 0 and
0335  *  setting new size.
0336  *  When opening an existing directory REPLACE and OVERWRITE
0337  *  actions are considered invalid, and cause returning
0338  *  FILE_EXISTS with NIL handle.
0339  */
0340 #define SHFL_CF_ACT_MASK_IF_EXISTS      (0x000000f0)
0341 #define SHFL_CF_ACT_MASK_IF_NEW         (0x00000f00)
0342 
0343 /* What to do if object exists. */
0344 #define SHFL_CF_ACT_OPEN_IF_EXISTS      (0x00000000)
0345 #define SHFL_CF_ACT_FAIL_IF_EXISTS      (0x00000010)
0346 #define SHFL_CF_ACT_REPLACE_IF_EXISTS   (0x00000020)
0347 #define SHFL_CF_ACT_OVERWRITE_IF_EXISTS (0x00000030)
0348 
0349 /* What to do if object does not exist. */
0350 #define SHFL_CF_ACT_CREATE_IF_NEW       (0x00000000)
0351 #define SHFL_CF_ACT_FAIL_IF_NEW         (0x00000100)
0352 
0353 /* Read/write requested access for the object. */
0354 #define SHFL_CF_ACCESS_MASK_RW          (0x00003000)
0355 
0356 /* No access requested. */
0357 #define SHFL_CF_ACCESS_NONE             (0x00000000)
0358 /* Read access requested. */
0359 #define SHFL_CF_ACCESS_READ             (0x00001000)
0360 /* Write access requested. */
0361 #define SHFL_CF_ACCESS_WRITE            (0x00002000)
0362 /* Read/Write access requested. */
0363 #define SHFL_CF_ACCESS_READWRITE    (0x00003000)
0364 
0365 /* Requested share access for the object. */
0366 #define SHFL_CF_ACCESS_MASK_DENY        (0x0000c000)
0367 
0368 /* Allow any access. */
0369 #define SHFL_CF_ACCESS_DENYNONE         (0x00000000)
0370 /* Do not allow read. */
0371 #define SHFL_CF_ACCESS_DENYREAD         (0x00004000)
0372 /* Do not allow write. */
0373 #define SHFL_CF_ACCESS_DENYWRITE        (0x00008000)
0374 /* Do not allow access. */
0375 #define SHFL_CF_ACCESS_DENYALL          (0x0000c000)
0376 
0377 /* Requested access to attributes of the object. */
0378 #define SHFL_CF_ACCESS_MASK_ATTR        (0x00030000)
0379 
0380 /* No access requested. */
0381 #define SHFL_CF_ACCESS_ATTR_NONE        (0x00000000)
0382 /* Read access requested. */
0383 #define SHFL_CF_ACCESS_ATTR_READ        (0x00010000)
0384 /* Write access requested. */
0385 #define SHFL_CF_ACCESS_ATTR_WRITE       (0x00020000)
0386 /* Read/Write access requested. */
0387 #define SHFL_CF_ACCESS_ATTR_READWRITE   (0x00030000)
0388 
0389 /*
0390  * The file is opened in append mode.
0391  * Ignored if SHFL_CF_ACCESS_WRITE is not set.
0392  */
0393 #define SHFL_CF_ACCESS_APPEND           (0x00040000)
0394 
0395 /** Create parameters buffer struct for SHFL_FN_CREATE call */
0396 struct shfl_createparms {
0397     /** Returned handle of opened object. */
0398     u64 handle;
0399 
0400     /** Returned result of the operation */
0401     enum shfl_create_result result;
0402 
0403     /** SHFL_CF_* */
0404     u32 create_flags;
0405 
0406     /**
0407      * Attributes of object to create and
0408      * returned actual attributes of opened/created object.
0409      */
0410     struct shfl_fsobjinfo info;
0411 } __packed;
0412 
0413 /** Shared Folder directory information */
0414 struct shfl_dirinfo {
0415     /** Full information about the object. */
0416     struct shfl_fsobjinfo info;
0417     /**
0418      * The length of the short field (number of UTF16 chars).
0419      * It is 16-bit for reasons of alignment.
0420      */
0421     u16 short_name_len;
0422     /**
0423      * The short name for 8.3 compatibility.
0424      * Empty string if not available.
0425      */
0426     u16 short_name[14];
0427     struct shfl_string name;
0428 };
0429 
0430 /** Shared folder filesystem properties. */
0431 struct shfl_fsproperties {
0432     /**
0433      * The maximum size of a filesystem object name.
0434      * This does not include the '\\0'.
0435      */
0436     u32 max_component_len;
0437 
0438     /**
0439      * True if the filesystem is remote.
0440      * False if the filesystem is local.
0441      */
0442     bool remote;
0443 
0444     /**
0445      * True if the filesystem is case sensitive.
0446      * False if the filesystem is case insensitive.
0447      */
0448     bool case_sensitive;
0449 
0450     /**
0451      * True if the filesystem is mounted read only.
0452      * False if the filesystem is mounted read write.
0453      */
0454     bool read_only;
0455 
0456     /**
0457      * True if the filesystem can encode unicode object names.
0458      * False if it can't.
0459      */
0460     bool supports_unicode;
0461 
0462     /**
0463      * True if the filesystem is compresses.
0464      * False if it isn't or we don't know.
0465      */
0466     bool compressed;
0467 
0468     /**
0469      * True if the filesystem compresses of individual files.
0470      * False if it doesn't or we don't know.
0471      */
0472     bool file_compression;
0473 };
0474 VMMDEV_ASSERT_SIZE(shfl_fsproperties, 12);
0475 
0476 struct shfl_volinfo {
0477     s64 total_allocation_bytes;
0478     s64 available_allocation_bytes;
0479     u32 bytes_per_allocation_unit;
0480     u32 bytes_per_sector;
0481     u32 serial;
0482     struct shfl_fsproperties properties;
0483 };
0484 
0485 
0486 /** SHFL_FN_MAP_FOLDER Parameters structure. */
0487 struct shfl_map_folder {
0488     /**
0489      * pointer, in:
0490      * Points to struct shfl_string buffer.
0491      */
0492     struct vmmdev_hgcm_function_parameter path;
0493 
0494     /**
0495      * pointer, out: SHFLROOT (u32)
0496      * Root handle of the mapping which name is queried.
0497      */
0498     struct vmmdev_hgcm_function_parameter root;
0499 
0500     /**
0501      * pointer, in: UTF16
0502      * Path delimiter
0503      */
0504     struct vmmdev_hgcm_function_parameter delimiter;
0505 
0506     /**
0507      * pointer, in: SHFLROOT (u32)
0508      * Case senstive flag
0509      */
0510     struct vmmdev_hgcm_function_parameter case_sensitive;
0511 
0512 };
0513 
0514 /* Number of parameters */
0515 #define SHFL_CPARMS_MAP_FOLDER (4)
0516 
0517 
0518 /** SHFL_FN_UNMAP_FOLDER Parameters structure. */
0519 struct shfl_unmap_folder {
0520     /**
0521      * pointer, in: SHFLROOT (u32)
0522      * Root handle of the mapping which name is queried.
0523      */
0524     struct vmmdev_hgcm_function_parameter root;
0525 
0526 };
0527 
0528 /* Number of parameters */
0529 #define SHFL_CPARMS_UNMAP_FOLDER (1)
0530 
0531 
0532 /** SHFL_FN_CREATE Parameters structure. */
0533 struct shfl_create {
0534     /**
0535      * pointer, in: SHFLROOT (u32)
0536      * Root handle of the mapping which name is queried.
0537      */
0538     struct vmmdev_hgcm_function_parameter root;
0539 
0540     /**
0541      * pointer, in:
0542      * Points to struct shfl_string buffer.
0543      */
0544     struct vmmdev_hgcm_function_parameter path;
0545 
0546     /**
0547      * pointer, in/out:
0548      * Points to struct shfl_createparms buffer.
0549      */
0550     struct vmmdev_hgcm_function_parameter parms;
0551 
0552 };
0553 
0554 /* Number of parameters */
0555 #define SHFL_CPARMS_CREATE (3)
0556 
0557 
0558 /** SHFL_FN_CLOSE Parameters structure. */
0559 struct shfl_close {
0560     /**
0561      * pointer, in: SHFLROOT (u32)
0562      * Root handle of the mapping which name is queried.
0563      */
0564     struct vmmdev_hgcm_function_parameter root;
0565 
0566     /**
0567      * value64, in:
0568      * SHFLHANDLE (u64) of object to close.
0569      */
0570     struct vmmdev_hgcm_function_parameter handle;
0571 
0572 };
0573 
0574 /* Number of parameters */
0575 #define SHFL_CPARMS_CLOSE (2)
0576 
0577 
0578 /** SHFL_FN_READ Parameters structure. */
0579 struct shfl_read {
0580     /**
0581      * pointer, in: SHFLROOT (u32)
0582      * Root handle of the mapping which name is queried.
0583      */
0584     struct vmmdev_hgcm_function_parameter root;
0585 
0586     /**
0587      * value64, in:
0588      * SHFLHANDLE (u64) of object to read from.
0589      */
0590     struct vmmdev_hgcm_function_parameter handle;
0591 
0592     /**
0593      * value64, in:
0594      * Offset to read from.
0595      */
0596     struct vmmdev_hgcm_function_parameter offset;
0597 
0598     /**
0599      * value64, in/out:
0600      * Bytes to read/How many were read.
0601      */
0602     struct vmmdev_hgcm_function_parameter cb;
0603 
0604     /**
0605      * pointer, out:
0606      * Buffer to place data to.
0607      */
0608     struct vmmdev_hgcm_function_parameter buffer;
0609 
0610 };
0611 
0612 /* Number of parameters */
0613 #define SHFL_CPARMS_READ (5)
0614 
0615 
0616 /** SHFL_FN_WRITE Parameters structure. */
0617 struct shfl_write {
0618     /**
0619      * pointer, in: SHFLROOT (u32)
0620      * Root handle of the mapping which name is queried.
0621      */
0622     struct vmmdev_hgcm_function_parameter root;
0623 
0624     /**
0625      * value64, in:
0626      * SHFLHANDLE (u64) of object to write to.
0627      */
0628     struct vmmdev_hgcm_function_parameter handle;
0629 
0630     /**
0631      * value64, in:
0632      * Offset to write to.
0633      */
0634     struct vmmdev_hgcm_function_parameter offset;
0635 
0636     /**
0637      * value64, in/out:
0638      * Bytes to write/How many were written.
0639      */
0640     struct vmmdev_hgcm_function_parameter cb;
0641 
0642     /**
0643      * pointer, in:
0644      * Data to write.
0645      */
0646     struct vmmdev_hgcm_function_parameter buffer;
0647 
0648 };
0649 
0650 /* Number of parameters */
0651 #define SHFL_CPARMS_WRITE (5)
0652 
0653 
0654 /*
0655  * SHFL_FN_LIST
0656  * Listing information includes variable length RTDIRENTRY[EX] structures.
0657  */
0658 
0659 #define SHFL_LIST_NONE          0
0660 #define SHFL_LIST_RETURN_ONE        1
0661 
0662 /** SHFL_FN_LIST Parameters structure. */
0663 struct shfl_list {
0664     /**
0665      * pointer, in: SHFLROOT (u32)
0666      * Root handle of the mapping which name is queried.
0667      */
0668     struct vmmdev_hgcm_function_parameter root;
0669 
0670     /**
0671      * value64, in:
0672      * SHFLHANDLE (u64) of object to be listed.
0673      */
0674     struct vmmdev_hgcm_function_parameter handle;
0675 
0676     /**
0677      * value32, in:
0678      * List flags SHFL_LIST_*.
0679      */
0680     struct vmmdev_hgcm_function_parameter flags;
0681 
0682     /**
0683      * value32, in/out:
0684      * Bytes to be used for listing information/How many bytes were used.
0685      */
0686     struct vmmdev_hgcm_function_parameter cb;
0687 
0688     /**
0689      * pointer, in/optional
0690      * Points to struct shfl_string buffer that specifies a search path.
0691      */
0692     struct vmmdev_hgcm_function_parameter path;
0693 
0694     /**
0695      * pointer, out:
0696      * Buffer to place listing information to. (struct shfl_dirinfo)
0697      */
0698     struct vmmdev_hgcm_function_parameter buffer;
0699 
0700     /**
0701      * value32, in/out:
0702      * Indicates a key where the listing must be resumed.
0703      * in: 0 means start from begin of object.
0704      * out: 0 means listing completed.
0705      */
0706     struct vmmdev_hgcm_function_parameter resume_point;
0707 
0708     /**
0709      * pointer, out:
0710      * Number of files returned
0711      */
0712     struct vmmdev_hgcm_function_parameter file_count;
0713 };
0714 
0715 /* Number of parameters */
0716 #define SHFL_CPARMS_LIST (8)
0717 
0718 
0719 /** SHFL_FN_READLINK Parameters structure. */
0720 struct shfl_readLink {
0721     /**
0722      * pointer, in: SHFLROOT (u32)
0723      * Root handle of the mapping which name is queried.
0724      */
0725     struct vmmdev_hgcm_function_parameter root;
0726 
0727     /**
0728      * pointer, in:
0729      * Points to struct shfl_string buffer.
0730      */
0731     struct vmmdev_hgcm_function_parameter path;
0732 
0733     /**
0734      * pointer, out:
0735      * Buffer to place data to.
0736      */
0737     struct vmmdev_hgcm_function_parameter buffer;
0738 
0739 };
0740 
0741 /* Number of parameters */
0742 #define SHFL_CPARMS_READLINK (3)
0743 
0744 
0745 /* SHFL_FN_INFORMATION */
0746 
0747 /* Mask of Set/Get bit. */
0748 #define SHFL_INFO_MODE_MASK    (0x1)
0749 /* Get information */
0750 #define SHFL_INFO_GET          (0x0)
0751 /* Set information */
0752 #define SHFL_INFO_SET          (0x1)
0753 
0754 /* Get name of the object. */
0755 #define SHFL_INFO_NAME         (0x2)
0756 /* Set size of object (extend/trucate); only applies to file objects */
0757 #define SHFL_INFO_SIZE         (0x4)
0758 /* Get/Set file object info. */
0759 #define SHFL_INFO_FILE         (0x8)
0760 /* Get volume information. */
0761 #define SHFL_INFO_VOLUME       (0x10)
0762 
0763 /** SHFL_FN_INFORMATION Parameters structure. */
0764 struct shfl_information {
0765     /**
0766      * pointer, in: SHFLROOT (u32)
0767      * Root handle of the mapping which name is queried.
0768      */
0769     struct vmmdev_hgcm_function_parameter root;
0770 
0771     /**
0772      * value64, in:
0773      * SHFLHANDLE (u64) of object to be listed.
0774      */
0775     struct vmmdev_hgcm_function_parameter handle;
0776 
0777     /**
0778      * value32, in:
0779      * SHFL_INFO_*
0780      */
0781     struct vmmdev_hgcm_function_parameter flags;
0782 
0783     /**
0784      * value32, in/out:
0785      * Bytes to be used for information/How many bytes were used.
0786      */
0787     struct vmmdev_hgcm_function_parameter cb;
0788 
0789     /**
0790      * pointer, in/out:
0791      * Information to be set/get (shfl_fsobjinfo or shfl_string). Do not
0792      * forget to set the shfl_fsobjinfo::attr::additional for a get
0793      * operation as well.
0794      */
0795     struct vmmdev_hgcm_function_parameter info;
0796 
0797 };
0798 
0799 /* Number of parameters */
0800 #define SHFL_CPARMS_INFORMATION (5)
0801 
0802 
0803 /* SHFL_FN_REMOVE */
0804 
0805 #define SHFL_REMOVE_FILE        (0x1)
0806 #define SHFL_REMOVE_DIR         (0x2)
0807 #define SHFL_REMOVE_SYMLINK     (0x4)
0808 
0809 /** SHFL_FN_REMOVE Parameters structure. */
0810 struct shfl_remove {
0811     /**
0812      * pointer, in: SHFLROOT (u32)
0813      * Root handle of the mapping which name is queried.
0814      */
0815     struct vmmdev_hgcm_function_parameter root;
0816 
0817     /**
0818      * pointer, in:
0819      * Points to struct shfl_string buffer.
0820      */
0821     struct vmmdev_hgcm_function_parameter path;
0822 
0823     /**
0824      * value32, in:
0825      * remove flags (file/directory)
0826      */
0827     struct vmmdev_hgcm_function_parameter flags;
0828 
0829 };
0830 
0831 #define SHFL_CPARMS_REMOVE  (3)
0832 
0833 
0834 /* SHFL_FN_RENAME */
0835 
0836 #define SHFL_RENAME_FILE                (0x1)
0837 #define SHFL_RENAME_DIR                 (0x2)
0838 #define SHFL_RENAME_REPLACE_IF_EXISTS   (0x4)
0839 
0840 /** SHFL_FN_RENAME Parameters structure. */
0841 struct shfl_rename {
0842     /**
0843      * pointer, in: SHFLROOT (u32)
0844      * Root handle of the mapping which name is queried.
0845      */
0846     struct vmmdev_hgcm_function_parameter root;
0847 
0848     /**
0849      * pointer, in:
0850      * Points to struct shfl_string src.
0851      */
0852     struct vmmdev_hgcm_function_parameter src;
0853 
0854     /**
0855      * pointer, in:
0856      * Points to struct shfl_string dest.
0857      */
0858     struct vmmdev_hgcm_function_parameter dest;
0859 
0860     /**
0861      * value32, in:
0862      * rename flags (file/directory)
0863      */
0864     struct vmmdev_hgcm_function_parameter flags;
0865 
0866 };
0867 
0868 #define SHFL_CPARMS_RENAME  (4)
0869 
0870 
0871 /** SHFL_FN_SYMLINK Parameters structure. */
0872 struct shfl_symlink {
0873     /**
0874      * pointer, in: SHFLROOT (u32)
0875      * Root handle of the mapping which name is queried.
0876      */
0877     struct vmmdev_hgcm_function_parameter root;
0878 
0879     /**
0880      * pointer, in:
0881      * Points to struct shfl_string of path for the new symlink.
0882      */
0883     struct vmmdev_hgcm_function_parameter new_path;
0884 
0885     /**
0886      * pointer, in:
0887      * Points to struct shfl_string of destination for symlink.
0888      */
0889     struct vmmdev_hgcm_function_parameter old_path;
0890 
0891     /**
0892      * pointer, out:
0893      * Information about created symlink.
0894      */
0895     struct vmmdev_hgcm_function_parameter info;
0896 
0897 };
0898 
0899 #define SHFL_CPARMS_SYMLINK  (4)
0900 
0901 #endif