1 /* SPDX-License-Identifier: MIT */ 2 /* 3 * VirtualBox Shared Folders: host interface definition. 4 * 5 * Copyright (C) 2006-2018 Oracle Corporation 6 */ 7 8 #ifndef SHFL_HOSTINTF_H 9 #define SHFL_HOSTINTF_H 10 11 #include <linux/vbox_vmmdev_types.h> 12 13 /* The max in/out buffer size for a FN_READ or FN_WRITE call */ 14 #define SHFL_MAX_RW_COUNT (16 * SZ_1M) 15 16 /* 17 * Structures shared between guest and the service 18 * can be relocated and use offsets to point to variable 19 * length parts. 20 * 21 * Shared folders protocol works with handles. 22 * Before doing any action on a file system object, 23 * one have to obtain the object handle via a SHFL_FN_CREATE 24 * request. A handle must be closed with SHFL_FN_CLOSE. 25 */ 26 27 enum { 28 SHFL_FN_QUERY_MAPPINGS = 1, /* Query mappings changes. */ 29 SHFL_FN_QUERY_MAP_NAME = 2, /* Query map name. */ 30 SHFL_FN_CREATE = 3, /* Open/create object. */ 31 SHFL_FN_CLOSE = 4, /* Close object handle. */ 32 SHFL_FN_READ = 5, /* Read object content. */ 33 SHFL_FN_WRITE = 6, /* Write new object content. */ 34 SHFL_FN_LOCK = 7, /* Lock/unlock a range in the object. */ 35 SHFL_FN_LIST = 8, /* List object content. */ 36 SHFL_FN_INFORMATION = 9, /* Query/set object information. */ 37 /* Note function number 10 is not used! */ 38 SHFL_FN_REMOVE = 11, /* Remove object */ 39 SHFL_FN_MAP_FOLDER_OLD = 12, /* Map folder (legacy) */ 40 SHFL_FN_UNMAP_FOLDER = 13, /* Unmap folder */ 41 SHFL_FN_RENAME = 14, /* Rename object */ 42 SHFL_FN_FLUSH = 15, /* Flush file */ 43 SHFL_FN_SET_UTF8 = 16, /* Select UTF8 filename encoding */ 44 SHFL_FN_MAP_FOLDER = 17, /* Map folder */ 45 SHFL_FN_READLINK = 18, /* Read symlink dest (as of VBox 4.0) */ 46 SHFL_FN_SYMLINK = 19, /* Create symlink (as of VBox 4.0) */ 47 SHFL_FN_SET_SYMLINKS = 20, /* Ask host to show symlinks (4.0+) */ 48 }; 49 50 /* Root handles for a mapping are of type u32, Root handles are unique. */ 51 #define SHFL_ROOT_NIL UINT_MAX 52 53 /* Shared folders handle for an opened object are of type u64. */ 54 #define SHFL_HANDLE_NIL ULLONG_MAX 55 56 /* Hardcoded maximum length (in chars) of a shared folder name. */ 57 #define SHFL_MAX_LEN (256) 58 /* Hardcoded maximum number of shared folder mapping available to the guest. */ 59 #define SHFL_MAX_MAPPINGS (64) 60 61 /** Shared folder string buffer structure. */ 62 struct shfl_string { 63 /** Allocated size of the string member in bytes. */ 64 u16 size; 65 66 /** Length of string without trailing nul in bytes. */ 67 u16 length; 68 69 /** UTF-8 or UTF-16 string. Nul terminated. */ 70 union { 71 u8 legacy_padding[2]; 72 DECLARE_FLEX_ARRAY(u8, utf8); 73 DECLARE_FLEX_ARRAY(u16, utf16); 74 } string; 75 }; 76 VMMDEV_ASSERT_SIZE(shfl_string, 6); 77 78 /* The size of shfl_string w/o the string part. */ 79 #define SHFLSTRING_HEADER_SIZE 4 80 81 /* Calculate size of the string. */ 82 static inline u32 shfl_string_buf_size(const struct shfl_string *string) 83 { 84 return string ? SHFLSTRING_HEADER_SIZE + string->size : 0; 85 } 86 87 /* Set user id on execution (S_ISUID). */ 88 #define SHFL_UNIX_ISUID 0004000U 89 /* Set group id on execution (S_ISGID). */ 90 #define SHFL_UNIX_ISGID 0002000U 91 /* Sticky bit (S_ISVTX / S_ISTXT). */ 92 #define SHFL_UNIX_ISTXT 0001000U 93 94 /* Owner readable (S_IRUSR). */ 95 #define SHFL_UNIX_IRUSR 0000400U 96 /* Owner writable (S_IWUSR). */ 97 #define SHFL_UNIX_IWUSR 0000200U 98 /* Owner executable (S_IXUSR). */ 99 #define SHFL_UNIX_IXUSR 0000100U 100 101 /* Group readable (S_IRGRP). */ 102 #define SHFL_UNIX_IRGRP 0000040U 103 /* Group writable (S_IWGRP). */ 104 #define SHFL_UNIX_IWGRP 0000020U 105 /* Group executable (S_IXGRP). */ 106 #define SHFL_UNIX_IXGRP 0000010U 107 108 /* Other readable (S_IROTH). */ 109 #define SHFL_UNIX_IROTH 0000004U 110 /* Other writable (S_IWOTH). */ 111 #define SHFL_UNIX_IWOTH 0000002U 112 /* Other executable (S_IXOTH). */ 113 #define SHFL_UNIX_IXOTH 0000001U 114 115 /* Named pipe (fifo) (S_IFIFO). */ 116 #define SHFL_TYPE_FIFO 0010000U 117 /* Character device (S_IFCHR). */ 118 #define SHFL_TYPE_DEV_CHAR 0020000U 119 /* Directory (S_IFDIR). */ 120 #define SHFL_TYPE_DIRECTORY 0040000U 121 /* Block device (S_IFBLK). */ 122 #define SHFL_TYPE_DEV_BLOCK 0060000U 123 /* Regular file (S_IFREG). */ 124 #define SHFL_TYPE_FILE 0100000U 125 /* Symbolic link (S_IFLNK). */ 126 #define SHFL_TYPE_SYMLINK 0120000U 127 /* Socket (S_IFSOCK). */ 128 #define SHFL_TYPE_SOCKET 0140000U 129 /* Whiteout (S_IFWHT). */ 130 #define SHFL_TYPE_WHITEOUT 0160000U 131 /* Type mask (S_IFMT). */ 132 #define SHFL_TYPE_MASK 0170000U 133 134 /* Checks the mode flags indicate a directory (S_ISDIR). */ 135 #define SHFL_IS_DIRECTORY(m) (((m) & SHFL_TYPE_MASK) == SHFL_TYPE_DIRECTORY) 136 /* Checks the mode flags indicate a symbolic link (S_ISLNK). */ 137 #define SHFL_IS_SYMLINK(m) (((m) & SHFL_TYPE_MASK) == SHFL_TYPE_SYMLINK) 138 139 /** The available additional information in a shfl_fsobjattr object. */ 140 enum shfl_fsobjattr_add { 141 /** No additional information is available / requested. */ 142 SHFLFSOBJATTRADD_NOTHING = 1, 143 /** 144 * The additional unix attributes (shfl_fsobjattr::u::unix_attr) are 145 * available / requested. 146 */ 147 SHFLFSOBJATTRADD_UNIX, 148 /** 149 * The additional extended attribute size (shfl_fsobjattr::u::size) is 150 * available / requested. 151 */ 152 SHFLFSOBJATTRADD_EASIZE, 153 /** 154 * The last valid item (inclusive). 155 * The valid range is SHFLFSOBJATTRADD_NOTHING thru 156 * SHFLFSOBJATTRADD_LAST. 157 */ 158 SHFLFSOBJATTRADD_LAST = SHFLFSOBJATTRADD_EASIZE, 159 160 /** The usual 32-bit hack. */ 161 SHFLFSOBJATTRADD_32BIT_SIZE_HACK = 0x7fffffff 162 }; 163 164 /** 165 * Additional unix Attributes, these are available when 166 * shfl_fsobjattr.additional == SHFLFSOBJATTRADD_UNIX. 167 */ 168 struct shfl_fsobjattr_unix { 169 /** 170 * The user owning the filesystem object (st_uid). 171 * This field is ~0U if not supported. 172 */ 173 u32 uid; 174 175 /** 176 * The group the filesystem object is assigned (st_gid). 177 * This field is ~0U if not supported. 178 */ 179 u32 gid; 180 181 /** 182 * Number of hard links to this filesystem object (st_nlink). 183 * This field is 1 if the filesystem doesn't support hardlinking or 184 * the information isn't available. 185 */ 186 u32 hardlinks; 187 188 /** 189 * The device number of the device which this filesystem object resides 190 * on (st_dev). This field is 0 if this information is not available. 191 */ 192 u32 inode_id_device; 193 194 /** 195 * The unique identifier (within the filesystem) of this filesystem 196 * object (st_ino). Together with inode_id_device, this field can be 197 * used as a OS wide unique id, when both their values are not 0. 198 * This field is 0 if the information is not available. 199 */ 200 u64 inode_id; 201 202 /** 203 * User flags (st_flags). 204 * This field is 0 if this information is not available. 205 */ 206 u32 flags; 207 208 /** 209 * The current generation number (st_gen). 210 * This field is 0 if this information is not available. 211 */ 212 u32 generation_id; 213 214 /** 215 * The device number of a char. or block device type object (st_rdev). 216 * This field is 0 if the file isn't a char. or block device or when 217 * the OS doesn't use the major+minor device idenfication scheme. 218 */ 219 u32 device; 220 } __packed; 221 222 /** Extended attribute size. */ 223 struct shfl_fsobjattr_easize { 224 /** Size of EAs. */ 225 s64 cb; 226 } __packed; 227 228 /** Shared folder filesystem object attributes. */ 229 struct shfl_fsobjattr { 230 /** Mode flags (st_mode). SHFL_UNIX_*, SHFL_TYPE_*, and SHFL_DOS_*. */ 231 u32 mode; 232 233 /** The additional attributes available. */ 234 enum shfl_fsobjattr_add additional; 235 236 /** 237 * Additional attributes. 238 * 239 * Unless explicitly specified to an API, the API can provide additional 240 * data as it is provided by the underlying OS. 241 */ 242 union { 243 struct shfl_fsobjattr_unix unix_attr; 244 struct shfl_fsobjattr_easize size; 245 } __packed u; 246 } __packed; 247 VMMDEV_ASSERT_SIZE(shfl_fsobjattr, 44); 248 249 struct shfl_timespec { 250 s64 ns_relative_to_unix_epoch; 251 }; 252 253 /** Filesystem object information structure. */ 254 struct shfl_fsobjinfo { 255 /** 256 * Logical size (st_size). 257 * For normal files this is the size of the file. 258 * For symbolic links, this is the length of the path name contained 259 * in the symbolic link. 260 * For other objects this fields needs to be specified. 261 */ 262 s64 size; 263 264 /** Disk allocation size (st_blocks * DEV_BSIZE). */ 265 s64 allocated; 266 267 /** Time of last access (st_atime). */ 268 struct shfl_timespec access_time; 269 270 /** Time of last data modification (st_mtime). */ 271 struct shfl_timespec modification_time; 272 273 /** 274 * Time of last status change (st_ctime). 275 * If not available this is set to modification_time. 276 */ 277 struct shfl_timespec change_time; 278 279 /** 280 * Time of file birth (st_birthtime). 281 * If not available this is set to change_time. 282 */ 283 struct shfl_timespec birth_time; 284 285 /** Attributes. */ 286 struct shfl_fsobjattr attr; 287 288 } __packed; 289 VMMDEV_ASSERT_SIZE(shfl_fsobjinfo, 92); 290 291 /** 292 * result of an open/create request. 293 * Along with handle value the result code 294 * identifies what has happened while 295 * trying to open the object. 296 */ 297 enum shfl_create_result { 298 SHFL_NO_RESULT, 299 /** Specified path does not exist. */ 300 SHFL_PATH_NOT_FOUND, 301 /** Path to file exists, but the last component does not. */ 302 SHFL_FILE_NOT_FOUND, 303 /** File already exists and either has been opened or not. */ 304 SHFL_FILE_EXISTS, 305 /** New file was created. */ 306 SHFL_FILE_CREATED, 307 /** Existing file was replaced or overwritten. */ 308 SHFL_FILE_REPLACED 309 }; 310 311 /* No flags. Initialization value. */ 312 #define SHFL_CF_NONE (0x00000000) 313 314 /* 315 * Only lookup the object, do not return a handle. When this is set all other 316 * flags are ignored. 317 */ 318 #define SHFL_CF_LOOKUP (0x00000001) 319 320 /* 321 * Open parent directory of specified object. 322 * Useful for the corresponding Windows FSD flag 323 * and for opening paths like \\dir\\*.* to search the 'dir'. 324 */ 325 #define SHFL_CF_OPEN_TARGET_DIRECTORY (0x00000002) 326 327 /* Create/open a directory. */ 328 #define SHFL_CF_DIRECTORY (0x00000004) 329 330 /* 331 * Open/create action to do if object exists 332 * and if the object does not exists. 333 * REPLACE file means atomically DELETE and CREATE. 334 * OVERWRITE file means truncating the file to 0 and 335 * setting new size. 336 * When opening an existing directory REPLACE and OVERWRITE 337 * actions are considered invalid, and cause returning 338 * FILE_EXISTS with NIL handle. 339 */ 340 #define SHFL_CF_ACT_MASK_IF_EXISTS (0x000000f0) 341 #define SHFL_CF_ACT_MASK_IF_NEW (0x00000f00) 342 343 /* What to do if object exists. */ 344 #define SHFL_CF_ACT_OPEN_IF_EXISTS (0x00000000) 345 #define SHFL_CF_ACT_FAIL_IF_EXISTS (0x00000010) 346 #define SHFL_CF_ACT_REPLACE_IF_EXISTS (0x00000020) 347 #define SHFL_CF_ACT_OVERWRITE_IF_EXISTS (0x00000030) 348 349 /* What to do if object does not exist. */ 350 #define SHFL_CF_ACT_CREATE_IF_NEW (0x00000000) 351 #define SHFL_CF_ACT_FAIL_IF_NEW (0x00000100) 352 353 /* Read/write requested access for the object. */ 354 #define SHFL_CF_ACCESS_MASK_RW (0x00003000) 355 356 /* No access requested. */ 357 #define SHFL_CF_ACCESS_NONE (0x00000000) 358 /* Read access requested. */ 359 #define SHFL_CF_ACCESS_READ (0x00001000) 360 /* Write access requested. */ 361 #define SHFL_CF_ACCESS_WRITE (0x00002000) 362 /* Read/Write access requested. */ 363 #define SHFL_CF_ACCESS_READWRITE (0x00003000) 364 365 /* Requested share access for the object. */ 366 #define SHFL_CF_ACCESS_MASK_DENY (0x0000c000) 367 368 /* Allow any access. */ 369 #define SHFL_CF_ACCESS_DENYNONE (0x00000000) 370 /* Do not allow read. */ 371 #define SHFL_CF_ACCESS_DENYREAD (0x00004000) 372 /* Do not allow write. */ 373 #define SHFL_CF_ACCESS_DENYWRITE (0x00008000) 374 /* Do not allow access. */ 375 #define SHFL_CF_ACCESS_DENYALL (0x0000c000) 376 377 /* Requested access to attributes of the object. */ 378 #define SHFL_CF_ACCESS_MASK_ATTR (0x00030000) 379 380 /* No access requested. */ 381 #define SHFL_CF_ACCESS_ATTR_NONE (0x00000000) 382 /* Read access requested. */ 383 #define SHFL_CF_ACCESS_ATTR_READ (0x00010000) 384 /* Write access requested. */ 385 #define SHFL_CF_ACCESS_ATTR_WRITE (0x00020000) 386 /* Read/Write access requested. */ 387 #define SHFL_CF_ACCESS_ATTR_READWRITE (0x00030000) 388 389 /* 390 * The file is opened in append mode. 391 * Ignored if SHFL_CF_ACCESS_WRITE is not set. 392 */ 393 #define SHFL_CF_ACCESS_APPEND (0x00040000) 394 395 /** Create parameters buffer struct for SHFL_FN_CREATE call */ 396 struct shfl_createparms { 397 /** Returned handle of opened object. */ 398 u64 handle; 399 400 /** Returned result of the operation */ 401 enum shfl_create_result result; 402 403 /** SHFL_CF_* */ 404 u32 create_flags; 405 406 /** 407 * Attributes of object to create and 408 * returned actual attributes of opened/created object. 409 */ 410 struct shfl_fsobjinfo info; 411 } __packed; 412 413 /** Shared Folder directory information */ 414 struct shfl_dirinfo { 415 /** Full information about the object. */ 416 struct shfl_fsobjinfo info; 417 /** 418 * The length of the short field (number of UTF16 chars). 419 * It is 16-bit for reasons of alignment. 420 */ 421 u16 short_name_len; 422 /** 423 * The short name for 8.3 compatibility. 424 * Empty string if not available. 425 */ 426 u16 short_name[14]; 427 struct shfl_string name; 428 }; 429 430 /** Shared folder filesystem properties. */ 431 struct shfl_fsproperties { 432 /** 433 * The maximum size of a filesystem object name. 434 * This does not include the '\\0'. 435 */ 436 u32 max_component_len; 437 438 /** 439 * True if the filesystem is remote. 440 * False if the filesystem is local. 441 */ 442 bool remote; 443 444 /** 445 * True if the filesystem is case sensitive. 446 * False if the filesystem is case insensitive. 447 */ 448 bool case_sensitive; 449 450 /** 451 * True if the filesystem is mounted read only. 452 * False if the filesystem is mounted read write. 453 */ 454 bool read_only; 455 456 /** 457 * True if the filesystem can encode unicode object names. 458 * False if it can't. 459 */ 460 bool supports_unicode; 461 462 /** 463 * True if the filesystem is compresses. 464 * False if it isn't or we don't know. 465 */ 466 bool compressed; 467 468 /** 469 * True if the filesystem compresses of individual files. 470 * False if it doesn't or we don't know. 471 */ 472 bool file_compression; 473 }; 474 VMMDEV_ASSERT_SIZE(shfl_fsproperties, 12); 475 476 struct shfl_volinfo { 477 s64 total_allocation_bytes; 478 s64 available_allocation_bytes; 479 u32 bytes_per_allocation_unit; 480 u32 bytes_per_sector; 481 u32 serial; 482 struct shfl_fsproperties properties; 483 }; 484 485 486 /** SHFL_FN_MAP_FOLDER Parameters structure. */ 487 struct shfl_map_folder { 488 /** 489 * pointer, in: 490 * Points to struct shfl_string buffer. 491 */ 492 struct vmmdev_hgcm_function_parameter path; 493 494 /** 495 * pointer, out: SHFLROOT (u32) 496 * Root handle of the mapping which name is queried. 497 */ 498 struct vmmdev_hgcm_function_parameter root; 499 500 /** 501 * pointer, in: UTF16 502 * Path delimiter 503 */ 504 struct vmmdev_hgcm_function_parameter delimiter; 505 506 /** 507 * pointer, in: SHFLROOT (u32) 508 * Case senstive flag 509 */ 510 struct vmmdev_hgcm_function_parameter case_sensitive; 511 512 }; 513 514 /* Number of parameters */ 515 #define SHFL_CPARMS_MAP_FOLDER (4) 516 517 518 /** SHFL_FN_UNMAP_FOLDER Parameters structure. */ 519 struct shfl_unmap_folder { 520 /** 521 * pointer, in: SHFLROOT (u32) 522 * Root handle of the mapping which name is queried. 523 */ 524 struct vmmdev_hgcm_function_parameter root; 525 526 }; 527 528 /* Number of parameters */ 529 #define SHFL_CPARMS_UNMAP_FOLDER (1) 530 531 532 /** SHFL_FN_CREATE Parameters structure. */ 533 struct shfl_create { 534 /** 535 * pointer, in: SHFLROOT (u32) 536 * Root handle of the mapping which name is queried. 537 */ 538 struct vmmdev_hgcm_function_parameter root; 539 540 /** 541 * pointer, in: 542 * Points to struct shfl_string buffer. 543 */ 544 struct vmmdev_hgcm_function_parameter path; 545 546 /** 547 * pointer, in/out: 548 * Points to struct shfl_createparms buffer. 549 */ 550 struct vmmdev_hgcm_function_parameter parms; 551 552 }; 553 554 /* Number of parameters */ 555 #define SHFL_CPARMS_CREATE (3) 556 557 558 /** SHFL_FN_CLOSE Parameters structure. */ 559 struct shfl_close { 560 /** 561 * pointer, in: SHFLROOT (u32) 562 * Root handle of the mapping which name is queried. 563 */ 564 struct vmmdev_hgcm_function_parameter root; 565 566 /** 567 * value64, in: 568 * SHFLHANDLE (u64) of object to close. 569 */ 570 struct vmmdev_hgcm_function_parameter handle; 571 572 }; 573 574 /* Number of parameters */ 575 #define SHFL_CPARMS_CLOSE (2) 576 577 578 /** SHFL_FN_READ Parameters structure. */ 579 struct shfl_read { 580 /** 581 * pointer, in: SHFLROOT (u32) 582 * Root handle of the mapping which name is queried. 583 */ 584 struct vmmdev_hgcm_function_parameter root; 585 586 /** 587 * value64, in: 588 * SHFLHANDLE (u64) of object to read from. 589 */ 590 struct vmmdev_hgcm_function_parameter handle; 591 592 /** 593 * value64, in: 594 * Offset to read from. 595 */ 596 struct vmmdev_hgcm_function_parameter offset; 597 598 /** 599 * value64, in/out: 600 * Bytes to read/How many were read. 601 */ 602 struct vmmdev_hgcm_function_parameter cb; 603 604 /** 605 * pointer, out: 606 * Buffer to place data to. 607 */ 608 struct vmmdev_hgcm_function_parameter buffer; 609 610 }; 611 612 /* Number of parameters */ 613 #define SHFL_CPARMS_READ (5) 614 615 616 /** SHFL_FN_WRITE Parameters structure. */ 617 struct shfl_write { 618 /** 619 * pointer, in: SHFLROOT (u32) 620 * Root handle of the mapping which name is queried. 621 */ 622 struct vmmdev_hgcm_function_parameter root; 623 624 /** 625 * value64, in: 626 * SHFLHANDLE (u64) of object to write to. 627 */ 628 struct vmmdev_hgcm_function_parameter handle; 629 630 /** 631 * value64, in: 632 * Offset to write to. 633 */ 634 struct vmmdev_hgcm_function_parameter offset; 635 636 /** 637 * value64, in/out: 638 * Bytes to write/How many were written. 639 */ 640 struct vmmdev_hgcm_function_parameter cb; 641 642 /** 643 * pointer, in: 644 * Data to write. 645 */ 646 struct vmmdev_hgcm_function_parameter buffer; 647 648 }; 649 650 /* Number of parameters */ 651 #define SHFL_CPARMS_WRITE (5) 652 653 654 /* 655 * SHFL_FN_LIST 656 * Listing information includes variable length RTDIRENTRY[EX] structures. 657 */ 658 659 #define SHFL_LIST_NONE 0 660 #define SHFL_LIST_RETURN_ONE 1 661 662 /** SHFL_FN_LIST Parameters structure. */ 663 struct shfl_list { 664 /** 665 * pointer, in: SHFLROOT (u32) 666 * Root handle of the mapping which name is queried. 667 */ 668 struct vmmdev_hgcm_function_parameter root; 669 670 /** 671 * value64, in: 672 * SHFLHANDLE (u64) of object to be listed. 673 */ 674 struct vmmdev_hgcm_function_parameter handle; 675 676 /** 677 * value32, in: 678 * List flags SHFL_LIST_*. 679 */ 680 struct vmmdev_hgcm_function_parameter flags; 681 682 /** 683 * value32, in/out: 684 * Bytes to be used for listing information/How many bytes were used. 685 */ 686 struct vmmdev_hgcm_function_parameter cb; 687 688 /** 689 * pointer, in/optional 690 * Points to struct shfl_string buffer that specifies a search path. 691 */ 692 struct vmmdev_hgcm_function_parameter path; 693 694 /** 695 * pointer, out: 696 * Buffer to place listing information to. (struct shfl_dirinfo) 697 */ 698 struct vmmdev_hgcm_function_parameter buffer; 699 700 /** 701 * value32, in/out: 702 * Indicates a key where the listing must be resumed. 703 * in: 0 means start from begin of object. 704 * out: 0 means listing completed. 705 */ 706 struct vmmdev_hgcm_function_parameter resume_point; 707 708 /** 709 * pointer, out: 710 * Number of files returned 711 */ 712 struct vmmdev_hgcm_function_parameter file_count; 713 }; 714 715 /* Number of parameters */ 716 #define SHFL_CPARMS_LIST (8) 717 718 719 /** SHFL_FN_READLINK Parameters structure. */ 720 struct shfl_readLink { 721 /** 722 * pointer, in: SHFLROOT (u32) 723 * Root handle of the mapping which name is queried. 724 */ 725 struct vmmdev_hgcm_function_parameter root; 726 727 /** 728 * pointer, in: 729 * Points to struct shfl_string buffer. 730 */ 731 struct vmmdev_hgcm_function_parameter path; 732 733 /** 734 * pointer, out: 735 * Buffer to place data to. 736 */ 737 struct vmmdev_hgcm_function_parameter buffer; 738 739 }; 740 741 /* Number of parameters */ 742 #define SHFL_CPARMS_READLINK (3) 743 744 745 /* SHFL_FN_INFORMATION */ 746 747 /* Mask of Set/Get bit. */ 748 #define SHFL_INFO_MODE_MASK (0x1) 749 /* Get information */ 750 #define SHFL_INFO_GET (0x0) 751 /* Set information */ 752 #define SHFL_INFO_SET (0x1) 753 754 /* Get name of the object. */ 755 #define SHFL_INFO_NAME (0x2) 756 /* Set size of object (extend/trucate); only applies to file objects */ 757 #define SHFL_INFO_SIZE (0x4) 758 /* Get/Set file object info. */ 759 #define SHFL_INFO_FILE (0x8) 760 /* Get volume information. */ 761 #define SHFL_INFO_VOLUME (0x10) 762 763 /** SHFL_FN_INFORMATION Parameters structure. */ 764 struct shfl_information { 765 /** 766 * pointer, in: SHFLROOT (u32) 767 * Root handle of the mapping which name is queried. 768 */ 769 struct vmmdev_hgcm_function_parameter root; 770 771 /** 772 * value64, in: 773 * SHFLHANDLE (u64) of object to be listed. 774 */ 775 struct vmmdev_hgcm_function_parameter handle; 776 777 /** 778 * value32, in: 779 * SHFL_INFO_* 780 */ 781 struct vmmdev_hgcm_function_parameter flags; 782 783 /** 784 * value32, in/out: 785 * Bytes to be used for information/How many bytes were used. 786 */ 787 struct vmmdev_hgcm_function_parameter cb; 788 789 /** 790 * pointer, in/out: 791 * Information to be set/get (shfl_fsobjinfo or shfl_string). Do not 792 * forget to set the shfl_fsobjinfo::attr::additional for a get 793 * operation as well. 794 */ 795 struct vmmdev_hgcm_function_parameter info; 796 797 }; 798 799 /* Number of parameters */ 800 #define SHFL_CPARMS_INFORMATION (5) 801 802 803 /* SHFL_FN_REMOVE */ 804 805 #define SHFL_REMOVE_FILE (0x1) 806 #define SHFL_REMOVE_DIR (0x2) 807 #define SHFL_REMOVE_SYMLINK (0x4) 808 809 /** SHFL_FN_REMOVE Parameters structure. */ 810 struct shfl_remove { 811 /** 812 * pointer, in: SHFLROOT (u32) 813 * Root handle of the mapping which name is queried. 814 */ 815 struct vmmdev_hgcm_function_parameter root; 816 817 /** 818 * pointer, in: 819 * Points to struct shfl_string buffer. 820 */ 821 struct vmmdev_hgcm_function_parameter path; 822 823 /** 824 * value32, in: 825 * remove flags (file/directory) 826 */ 827 struct vmmdev_hgcm_function_parameter flags; 828 829 }; 830 831 #define SHFL_CPARMS_REMOVE (3) 832 833 834 /* SHFL_FN_RENAME */ 835 836 #define SHFL_RENAME_FILE (0x1) 837 #define SHFL_RENAME_DIR (0x2) 838 #define SHFL_RENAME_REPLACE_IF_EXISTS (0x4) 839 840 /** SHFL_FN_RENAME Parameters structure. */ 841 struct shfl_rename { 842 /** 843 * pointer, in: SHFLROOT (u32) 844 * Root handle of the mapping which name is queried. 845 */ 846 struct vmmdev_hgcm_function_parameter root; 847 848 /** 849 * pointer, in: 850 * Points to struct shfl_string src. 851 */ 852 struct vmmdev_hgcm_function_parameter src; 853 854 /** 855 * pointer, in: 856 * Points to struct shfl_string dest. 857 */ 858 struct vmmdev_hgcm_function_parameter dest; 859 860 /** 861 * value32, in: 862 * rename flags (file/directory) 863 */ 864 struct vmmdev_hgcm_function_parameter flags; 865 866 }; 867 868 #define SHFL_CPARMS_RENAME (4) 869 870 871 /** SHFL_FN_SYMLINK Parameters structure. */ 872 struct shfl_symlink { 873 /** 874 * pointer, in: SHFLROOT (u32) 875 * Root handle of the mapping which name is queried. 876 */ 877 struct vmmdev_hgcm_function_parameter root; 878 879 /** 880 * pointer, in: 881 * Points to struct shfl_string of path for the new symlink. 882 */ 883 struct vmmdev_hgcm_function_parameter new_path; 884 885 /** 886 * pointer, in: 887 * Points to struct shfl_string of destination for symlink. 888 */ 889 struct vmmdev_hgcm_function_parameter old_path; 890 891 /** 892 * pointer, out: 893 * Information about created symlink. 894 */ 895 struct vmmdev_hgcm_function_parameter info; 896 897 }; 898 899 #define SHFL_CPARMS_SYMLINK (4) 900 901 #endif 902