VirtualBox

source: vbox/trunk/include/VBox/shflsvc.h@ 8155

Last change on this file since 8155 was 8155, checked in by vboxsync, 16 years ago

The Big Sun Rebranding Header Change

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 22.5 KB
Line 
1/** @file
2 * Shared Folders:
3 * Common header for host service and guest clients.
4 */
5
6/*
7 * Copyright (C) 2006-2007 Sun Microsystems, Inc.
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * The contents of this file may alternatively be used under the terms
18 * of the Common Development and Distribution License Version 1.0
19 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20 * VirtualBox OSE distribution, in which case the provisions of the
21 * CDDL are applicable instead of those of the GPL.
22 *
23 * You may elect to license modified versions of this file under the
24 * terms and conditions of either the GPL or the CDDL or both.
25 *
26 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
27 * Clara, CA 95054 USA or visit http://www.sun.com if you need
28 * additional information or have any questions.
29 */
30
31#ifndef ___VBox_shflsvc_h
32#define ___VBox_shflsvc_h
33
34#include <VBox/types.h>
35#include <VBox/VBoxGuest.h>
36#include <VBox/hgcmsvc.h>
37#include <iprt/fs.h>
38
39
40/** Some bit flag manipulation macros. to be moved to VBox/cdefs.h? */
41#ifndef BIT_FLAG
42#define BIT_FLAG(__Field,__Flag) ((__Field) & (__Flag))
43#endif
44
45#ifndef BIT_FLAG_SET
46#define BIT_FLAG_SET(__Field,__Flag) ((__Field) |= (__Flag))
47#endif
48
49#ifndef BIT_FLAG_CLEAR
50#define BIT_FLAG_CLEAR(__Field,__Flag) ((__Field) &= ~(__Flag))
51#endif
52
53
54/**
55 * Structures shared between guest and the service
56 * can be relocated and use offsets to point to variable
57 * length parts.
58 */
59
60/**
61 * Shared folders protocol works with handles.
62 * Before doing any action on a file system object,
63 * one have to obtain the object handle via a SHFL_FN_CREATE
64 * request. A handle must be closed with SHFL_FN_CLOSE.
65 */
66
67/** Shared Folders service functions. (guest)
68 * @{
69 */
70
71/** Query mappings changes. */
72#define SHFL_FN_QUERY_MAPPINGS (1)
73/** Query mappings changes. */
74#define SHFL_FN_QUERY_MAP_NAME (2)
75/** Open/create object. */
76#define SHFL_FN_CREATE (3)
77/** Close object handle. */
78#define SHFL_FN_CLOSE (4)
79/** Read object content. */
80#define SHFL_FN_READ (5)
81/** Write new object content. */
82#define SHFL_FN_WRITE (6)
83/** Lock/unlock a range in the object. */
84#define SHFL_FN_LOCK (7)
85/** List object content. */
86#define SHFL_FN_LIST (8)
87/** Query/set object information. */
88#define SHFL_FN_INFORMATION (9)
89/** Remove object */
90#define SHFL_FN_REMOVE (11)
91/** Map folder (legacy) */
92#define SHFL_FN_MAP_FOLDER_OLD (12)
93/** Unmap folder */
94#define SHFL_FN_UNMAP_FOLDER (13)
95/** Rename object (possibly moving it to another directory) */
96#define SHFL_FN_RENAME (14)
97/** Flush file */
98#define SHFL_FN_FLUSH (15)
99/** @todo macl, a description, please. */
100#define SHFL_FN_SET_UTF8 (16)
101/** Map folder */
102#define SHFL_FN_MAP_FOLDER (17)
103
104/** @} */
105
106/** Shared Folders service functions. (host)
107 * @{
108 */
109
110/** Add shared folder mapping. */
111#define SHFL_FN_ADD_MAPPING (1)
112/** Remove shared folder mapping. */
113#define SHFL_FN_REMOVE_MAPPING (2)
114/** Set the led status light address */
115#define SHFL_FN_SET_STATUS_LED (3)
116
117/** @} */
118
119/** Root handle for a mapping. Root handles are unique.
120 * @note
121 * Function parameters structures consider
122 * the root handle as 32 bit value. If the typedef
123 * will be changed, then function parameters must be
124 * changed accordingly. All those parameters are marked
125 * with SHFLROOT in comments.
126 */
127typedef uint32_t SHFLROOT;
128
129
130/** A shared folders handle for an opened object. */
131typedef uint64_t SHFLHANDLE;
132
133#define SHFL_HANDLE_NIL ((SHFLHANDLE)~0LL)
134#define SHFL_HANDLE_ROOT ((SHFLHANDLE)0LL)
135
136/** Hardcoded maximum number of shared folder mapping available to the guest. */
137#define SHFL_MAX_MAPPINGS (64)
138
139/** Shared Folders strings. They can be either UTF8 or Unicode.
140 * @{
141 */
142
143typedef struct _SHFLSTRING
144{
145 /** Size of string String buffer in bytes. */
146 uint16_t u16Size;
147
148 /** Length of string without trailing nul in bytes. */
149 uint16_t u16Length;
150
151 /** UTF8 or Unicode16 string. Nul terminated. */
152 union
153 {
154 uint8_t utf8[1];
155 uint16_t ucs2[1];
156 } String;
157} SHFLSTRING;
158
159typedef SHFLSTRING *PSHFLSTRING;
160
161/** Calculate size of the string. */
162DECLINLINE(uint32_t) ShflStringSizeOfBuffer (PSHFLSTRING pString)
163{
164 return pString? sizeof (SHFLSTRING) - sizeof (pString->String) + pString->u16Size: 0;
165}
166
167DECLINLINE(uint32_t) ShflStringLength (PSHFLSTRING pString)
168{
169 return pString? pString->u16Length: 0;
170}
171
172DECLINLINE(PSHFLSTRING) ShflStringInitBuffer(void *pvBuffer, uint32_t u32Size)
173{
174 PSHFLSTRING pString = NULL;
175
176 uint32_t u32HeaderSize = sizeof (SHFLSTRING) - sizeof (pString->String);
177
178 /* Check that the buffer size is big enough to hold a zero sized string
179 * and is not too big to fit into 16 bit variables.
180 */
181 if (u32Size >= u32HeaderSize && u32Size - u32HeaderSize <= 0xFFFF)
182 {
183 pString = (PSHFLSTRING)pvBuffer;
184 pString->u16Size = u32Size - u32HeaderSize;
185 pString->u16Length = 0;
186 }
187
188 return pString;
189}
190
191/** @} */
192
193
194/** Result of an open/create request.
195 * Along with handle value the result code
196 * identifies what has happened while
197 * trying to open the object.
198 */
199typedef enum _SHFLCREATERESULT
200{
201 SHFL_NO_RESULT,
202 /** Specified path does not exist. */
203 SHFL_PATH_NOT_FOUND,
204 /** Path to file exists, but the last component does not. */
205 SHFL_FILE_NOT_FOUND,
206 /** File already exists and either has been opened or not. */
207 SHFL_FILE_EXISTS,
208 /** New file was created. */
209 SHFL_FILE_CREATED,
210 /** Existing file was replaced or overwritten. */
211 SHFL_FILE_REPLACED
212} SHFLCREATERESULT;
213
214
215/** Open/create flags.
216 * @{
217 */
218
219/** No flags. Initialization value. */
220#define SHFL_CF_NONE (0x00000000)
221
222/** Lookup only the object, do not return a handle. All other flags are ignored. */
223#define SHFL_CF_LOOKUP (0x00000001)
224
225/** Open parent directory of specified object.
226 * Useful for the corresponding Windows FSD flag
227 * and for opening paths like \\dir\\*.* to search the 'dir'.
228 * @todo possibly not needed???
229 */
230#define SHFL_CF_OPEN_TARGET_DIRECTORY (0x00000002)
231
232/** Create/open a directory. */
233#define SHFL_CF_DIRECTORY (0x00000004)
234
235/** Open/create action to do if object exists
236 * and if the object does not exists.
237 * REPLACE file means atomically DELETE and CREATE.
238 * OVERWRITE file means truncating the file to 0 and
239 * setting new size.
240 * When opening an existing directory REPLACE and OVERWRITE
241 * actions are considered invalid, and cause returning
242 * FILE_EXISTS with NIL handle.
243 */
244#define SHFL_CF_ACT_MASK_IF_EXISTS (0x000000F0)
245#define SHFL_CF_ACT_MASK_IF_NEW (0x00000F00)
246
247/** What to do if object exists. */
248#define SHFL_CF_ACT_OPEN_IF_EXISTS (0x00000000)
249#define SHFL_CF_ACT_FAIL_IF_EXISTS (0x00000010)
250#define SHFL_CF_ACT_REPLACE_IF_EXISTS (0x00000020)
251#define SHFL_CF_ACT_OVERWRITE_IF_EXISTS (0x00000030)
252
253/** What to do if object does not exist. */
254#define SHFL_CF_ACT_CREATE_IF_NEW (0x00000000)
255#define SHFL_CF_ACT_FAIL_IF_NEW (0x00000100)
256
257/** Read/write requested access for the object. */
258#define SHFL_CF_ACCESS_MASK_RW (0x00003000)
259
260/** No access requested. */
261#define SHFL_CF_ACCESS_NONE (0x00000000)
262/** Read access requested. */
263#define SHFL_CF_ACCESS_READ (0x00001000)
264/** Write access requested. */
265#define SHFL_CF_ACCESS_WRITE (0x00002000)
266/** Read/Write access requested. */
267#define SHFL_CF_ACCESS_READWRITE (SHFL_CF_ACCESS_READ | SHFL_CF_ACCESS_WRITE)
268
269/** Requested share access for the object. */
270#define SHFL_CF_ACCESS_MASK_DENY (0x0000C000)
271
272/** Allow any access. */
273#define SHFL_CF_ACCESS_DENYNONE (0x00000000)
274/** Do not allow read. */
275#define SHFL_CF_ACCESS_DENYREAD (0x00004000)
276/** Do not allow write. */
277#define SHFL_CF_ACCESS_DENYWRITE (0x00008000)
278/** Do not allow access. */
279#define SHFL_CF_ACCESS_DENYALL (SHFL_CF_ACCESS_DENYREAD | SHFL_CF_ACCESS_DENYWRITE)
280
281
282/** @} */
283
284#pragma pack(1)
285typedef struct _SHFLCREATEPARMS
286{
287 /* Returned handle of opened object. */
288 SHFLHANDLE Handle;
289
290 /* Returned result of the operation */
291 SHFLCREATERESULT Result;
292
293 /* SHFL_CF_* */
294 uint32_t CreateFlags;
295
296 /* Attributes of object to create and
297 * returned actual attributes of opened/created object.
298 */
299 RTFSOBJINFO Info;
300
301} SHFLCREATEPARMS;
302#pragma pack()
303
304typedef SHFLCREATEPARMS *PSHFLCREATEPARMS;
305
306
307/** Shared Folders mappings.
308 * @{
309 */
310
311/** The mapping has been added since last query. */
312#define SHFL_MS_NEW (1)
313/** The mapping has been deleted since last query. */
314#define SHFL_MS_DELETED (2)
315
316typedef struct _SHFLMAPPING
317{
318 /** Mapping status. */
319 uint32_t u32Status;
320 /** Root handle. */
321 SHFLROOT root;
322} SHFLMAPPING;
323
324typedef SHFLMAPPING *PSHFLMAPPING;
325
326/** @} */
327
328/** Shared Folder directory information
329 * @{
330 */
331
332typedef struct _SHFLDIRINFO
333{
334 /** Full information about the object. */
335 RTFSOBJINFO Info;
336 /** The length of the short field (number of RTUTF16 chars).
337 * It is 16-bit for reasons of alignment. */
338 uint16_t cucShortName;
339 /** The short name for 8.3 compatability.
340 * Empty string if not available.
341 */
342 RTUTF16 uszShortName[14];
343 /** @todo malc, a description, please. */
344 SHFLSTRING name;
345} SHFLDIRINFO, *PSHFLDIRINFO;
346
347typedef struct _SHFLVOLINFO
348{
349 RTFOFF ullTotalAllocationBytes;
350 RTFOFF ullAvailableAllocationBytes;
351 uint32_t ulBytesPerAllocationUnit;
352 uint32_t ulBytesPerSector;
353 uint32_t ulSerial;
354 RTFSPROPERTIES fsProperties;
355} SHFLVOLINFO, *PSHFLVOLINFO;
356
357/** @} */
358
359/** Function parameter structures.
360 * @{
361 */
362
363/**
364 * SHFL_FN_QUERY_MAPPINGS
365 */
366
367#define SHFL_MF_UCS2 (0x00000000)
368/** Guest uses UTF8 strings, if not set then the strings are unicode (UCS2). */
369#define SHFL_MF_UTF8 (0x00000001)
370
371/** Type of guest system. For future system dependent features. */
372#define SHFL_MF_SYSTEM_MASK (0x0000FF00)
373#define SHFL_MF_SYSTEM_NONE (0x00000000)
374#define SHFL_MF_SYSTEM_WINDOWS (0x00000100)
375#define SHFL_MF_SYSTEM_LINUX (0x00000200)
376
377/** Parameters structure. */
378typedef struct _VBoxSFQueryMappings
379{
380 VBoxGuestHGCMCallInfo callInfo;
381
382 /** 32bit, in:
383 * Flags describing various client needs.
384 */
385 HGCMFunctionParameter flags;
386
387 /** 32bit, in/out:
388 * Number of mappings the client expects.
389 * This is the number of elements in the
390 * mappings array.
391 */
392 HGCMFunctionParameter numberOfMappings;
393
394 /** pointer, in/out:
395 * Points to array of SHFLMAPPING structures.
396 */
397 HGCMFunctionParameter mappings;
398
399} VBoxSFQueryMappings;
400
401/** Number of parameters */
402#define SHFL_CPARMS_QUERY_MAPPINGS (3)
403
404
405
406/**
407 * SHFL_FN_QUERY_MAP_NAME
408 */
409
410/** Parameters structure. */
411typedef struct _VBoxSFQueryMapName
412{
413 VBoxGuestHGCMCallInfo callInfo;
414
415 /** 32bit, in: SHFLROOT
416 * Root handle of the mapping which name is queried.
417 */
418 HGCMFunctionParameter root;
419
420 /** pointer, in/out:
421 * Points to SHFLSTRING buffer.
422 */
423 HGCMFunctionParameter name;
424
425} VBoxSFQueryMapName;
426
427/** Number of parameters */
428#define SHFL_CPARMS_QUERY_MAP_NAME (2)
429
430/**
431 * SHFL_FN_MAP_FOLDER_OLD
432 */
433
434/** Parameters structure. */
435typedef struct _VBoxSFMapFolder_Old
436{
437 VBoxGuestHGCMCallInfo callInfo;
438
439 /** pointer, in:
440 * Points to SHFLSTRING buffer.
441 */
442 HGCMFunctionParameter path;
443
444 /** pointer, out: SHFLROOT
445 * Root handle of the mapping which name is queried.
446 */
447 HGCMFunctionParameter root;
448
449 /** pointer, in: RTUTF16
450 * Path delimiter
451 */
452 HGCMFunctionParameter delimiter;
453
454} VBoxSFMapFolder_Old;
455
456/** Number of parameters */
457#define SHFL_CPARMS_MAP_FOLDER_OLD (3)
458
459/**
460 * SHFL_FN_MAP_FOLDER
461 */
462
463/** Parameters structure. */
464typedef struct _VBoxSFMapFolder
465{
466 VBoxGuestHGCMCallInfo callInfo;
467
468 /** pointer, in:
469 * Points to SHFLSTRING buffer.
470 */
471 HGCMFunctionParameter path;
472
473 /** pointer, out: SHFLROOT
474 * Root handle of the mapping which name is queried.
475 */
476 HGCMFunctionParameter root;
477
478 /** pointer, in: RTUTF16
479 * Path delimiter
480 */
481 HGCMFunctionParameter delimiter;
482
483 /** pointer, in: SHFLROOT
484 * Case senstive flag
485 */
486 HGCMFunctionParameter fCaseSensitive;
487
488} VBoxSFMapFolder;
489
490/** Number of parameters */
491#define SHFL_CPARMS_MAP_FOLDER (4)
492
493/**
494 * SHFL_FN_UNMAP_FOLDER
495 */
496
497/** Parameters structure. */
498typedef struct _VBoxSFUnmapFolder
499{
500 VBoxGuestHGCMCallInfo callInfo;
501
502 /** pointer, in: SHFLROOT
503 * Root handle of the mapping which name is queried.
504 */
505 HGCMFunctionParameter root;
506
507} VBoxSFUnmapFolder;
508
509/** Number of parameters */
510#define SHFL_CPARMS_UNMAP_FOLDER (1)
511
512
513/**
514 * SHFL_FN_CREATE
515 */
516
517/** Parameters structure. */
518typedef struct _VBoxSFCreate
519{
520 VBoxGuestHGCMCallInfo callInfo;
521
522 /** pointer, in: SHFLROOT
523 * Root handle of the mapping which name is queried.
524 */
525 HGCMFunctionParameter root;
526
527 /** pointer, in:
528 * Points to SHFLSTRING buffer.
529 */
530 HGCMFunctionParameter path;
531
532 /** pointer, in/out:
533 * Points to SHFLCREATEPARMS buffer.
534 */
535 HGCMFunctionParameter parms;
536
537} VBoxSFCreate;
538
539/** Number of parameters */
540#define SHFL_CPARMS_CREATE (3)
541
542
543/**
544 * SHFL_FN_CLOSE
545 */
546
547/** Parameters structure. */
548typedef struct _VBoxSFClose
549{
550 VBoxGuestHGCMCallInfo callInfo;
551
552 /** pointer, in: SHFLROOT
553 * Root handle of the mapping which name is queried.
554 */
555 HGCMFunctionParameter root;
556
557
558 /** value64, in:
559 * SHFLHANDLE of object to close.
560 */
561 HGCMFunctionParameter handle;
562
563} VBoxSFClose;
564
565/** Number of parameters */
566#define SHFL_CPARMS_CLOSE (2)
567
568
569/**
570 * SHFL_FN_READ
571 */
572
573/** Parameters structure. */
574typedef struct _VBoxSFRead
575{
576 VBoxGuestHGCMCallInfo callInfo;
577
578 /** pointer, in: SHFLROOT
579 * Root handle of the mapping which name is queried.
580 */
581 HGCMFunctionParameter root;
582
583 /** value64, in:
584 * SHFLHANDLE of object to read from.
585 */
586 HGCMFunctionParameter handle;
587
588 /** value64, in:
589 * Offset to read from.
590 */
591 HGCMFunctionParameter offset;
592
593 /** value64, in/out:
594 * Bytes to read/How many were read.
595 */
596 HGCMFunctionParameter cb;
597
598 /** pointer, out:
599 * Buffer to place data to.
600 */
601 HGCMFunctionParameter buffer;
602
603} VBoxSFRead;
604
605/** Number of parameters */
606#define SHFL_CPARMS_READ (5)
607
608
609
610/**
611 * SHFL_FN_WRITE
612 */
613
614/** Parameters structure. */
615typedef struct _VBoxSFWrite
616{
617 VBoxGuestHGCMCallInfo callInfo;
618
619 /** pointer, in: SHFLROOT
620 * Root handle of the mapping which name is queried.
621 */
622 HGCMFunctionParameter root;
623
624 /** value64, in:
625 * SHFLHANDLE of object to write to.
626 */
627 HGCMFunctionParameter handle;
628
629 /** value64, in:
630 * Offset to write to.
631 */
632 HGCMFunctionParameter offset;
633
634 /** value64, in/out:
635 * Bytes to write/How many were written.
636 */
637 HGCMFunctionParameter cb;
638
639 /** pointer, in:
640 * Data to write.
641 */
642 HGCMFunctionParameter buffer;
643
644} VBoxSFWrite;
645
646/** Number of parameters */
647#define SHFL_CPARMS_WRITE (5)
648
649
650
651/**
652 * SHFL_FN_LOCK
653 */
654
655/** Lock owner is the HGCM client. */
656
657/** Lock mode bit mask. */
658#define SHFL_LOCK_MODE_MASK (0x3)
659/** Cancel lock on the given range. */
660#define SHFL_LOCK_CANCEL (0x0)
661/** Aquire read only lock. Prevent write to the range. */
662#define SHFL_LOCK_SHARED (0x1)
663/** Aquire write lock. Prevent both write and read to the range. */
664#define SHFL_LOCK_EXCLUSIVE (0x2)
665
666/** Do not wait for lock if it can not be acquired at the time. */
667#define SHFL_LOCK_NOWAIT (0x0)
668/** Wait and acquire lock. */
669#define SHFL_LOCK_WAIT (0x4)
670
671/** Lock the specified range. */
672#define SHFL_LOCK_PARTIAL (0x0)
673/** Lock entire object. */
674#define SHFL_LOCK_ENTIRE (0x8)
675
676/** Parameters structure. */
677typedef struct _VBoxSFLock
678{
679 VBoxGuestHGCMCallInfo callInfo;
680
681 /** pointer, in: SHFLROOT
682 * Root handle of the mapping which name is queried.
683 */
684 HGCMFunctionParameter root;
685
686 /** value64, in:
687 * SHFLHANDLE of object to be locked.
688 */
689 HGCMFunctionParameter handle;
690
691 /** value64, in:
692 * Starting offset of lock range.
693 */
694 HGCMFunctionParameter offset;
695
696 /** value64, in:
697 * Length of range.
698 */
699 HGCMFunctionParameter length;
700
701 /** value32, in:
702 * Lock flags SHFL_LOCK_*.
703 */
704 HGCMFunctionParameter flags;
705
706} VBoxSFLock;
707
708/** Number of parameters */
709#define SHFL_CPARMS_LOCK (5)
710
711
712
713/**
714 * SHFL_FN_FLUSH
715 */
716
717/** Parameters structure. */
718typedef struct _VBoxSFFlush
719{
720 VBoxGuestHGCMCallInfo callInfo;
721
722 /** pointer, in: SHFLROOT
723 * Root handle of the mapping which name is queried.
724 */
725 HGCMFunctionParameter root;
726
727 /** value64, in:
728 * SHFLHANDLE of object to be locked.
729 */
730 HGCMFunctionParameter handle;
731
732} VBoxSFFlush;
733
734/** Number of parameters */
735#define SHFL_CPARMS_FLUSH (2)
736
737/**
738 * SHFL_FN_LIST
739 */
740
741/** Listing information includes variable length RTDIRENTRY[EX] structures. */
742
743/** @todo might be necessary for future. */
744#define SHFL_LIST_NONE 0
745#define SHFL_LIST_RETURN_ONE 1
746
747/** Parameters structure. */
748typedef struct _VBoxSFList
749{
750 VBoxGuestHGCMCallInfo callInfo;
751
752 /** pointer, in: SHFLROOT
753 * Root handle of the mapping which name is queried.
754 */
755 HGCMFunctionParameter root;
756
757 /** value64, in:
758 * SHFLHANDLE of object to be listed.
759 */
760 HGCMFunctionParameter handle;
761
762 /** value32, in:
763 * List flags SHFL_LIST_*.
764 */
765 HGCMFunctionParameter flags;
766
767 /** value32, in/out:
768 * Bytes to be used for listing information/How many bytes were used.
769 */
770 HGCMFunctionParameter cb;
771
772 /** pointer, in/optional
773 * Points to SHFLSTRING buffer that specifies a search path.
774 */
775 HGCMFunctionParameter path;
776
777 /** pointer, out:
778 * Buffer to place listing information to. (SHFLDIRINFO)
779 */
780 HGCMFunctionParameter buffer;
781
782 /** value32, in/out:
783 * Indicates a key where the listing must be resumed.
784 * in: 0 means start from begin of object.
785 * out: 0 means listing completed.
786 */
787 HGCMFunctionParameter resumePoint;
788
789 /** pointer, out:
790 * Number of files returned
791 */
792 HGCMFunctionParameter cFiles;
793
794} VBoxSFList;
795
796/** Number of parameters */
797#define SHFL_CPARMS_LIST (8)
798
799
800
801/**
802 * SHFL_FN_INFORMATION
803 */
804
805/** Mask of Set/Get bit. */
806#define SHFL_INFO_MODE_MASK (0x1)
807/** Get information */
808#define SHFL_INFO_GET (0x0)
809/** Set information */
810#define SHFL_INFO_SET (0x1)
811
812/** Get name of the object. */
813#define SHFL_INFO_NAME (0x2)
814/** Set size of object (extend/trucate); only applies to file objects */
815#define SHFL_INFO_SIZE (0x4)
816/** Get/Set file object info. */
817#define SHFL_INFO_FILE (0x8)
818/** Get volume information. */
819#define SHFL_INFO_VOLUME (0x10)
820
821/** @todo different file info structures */
822
823
824/** Parameters structure. */
825typedef struct _VBoxSFInformation
826{
827 VBoxGuestHGCMCallInfo callInfo;
828
829 /** pointer, in: SHFLROOT
830 * Root handle of the mapping which name is queried.
831 */
832 HGCMFunctionParameter root;
833
834 /** value64, in:
835 * SHFLHANDLE of object to be listed.
836 */
837 HGCMFunctionParameter handle;
838
839 /** value32, in:
840 * SHFL_INFO_*
841 */
842 HGCMFunctionParameter flags;
843
844 /** value32, in/out:
845 * Bytes to be used for information/How many bytes were used.
846 */
847 HGCMFunctionParameter cb;
848
849 /** pointer, in/out:
850 * Information to be set/get (RTFSOBJINFO or SHFLSTRING).
851 * Do not forget to set the RTFSOBJINFO::Attr::enmAdditional for Get operation as well.
852 */
853 HGCMFunctionParameter info;
854
855} VBoxSFInformation;
856
857/** Number of parameters */
858#define SHFL_CPARMS_INFORMATION (5)
859
860
861/**
862 * SHFL_FN_REMOVE
863 */
864
865#define SHFL_REMOVE_FILE (0x1)
866#define SHFL_REMOVE_DIR (0x2)
867
868/** Parameters structure. */
869typedef struct _VBoxSFRemove
870{
871 VBoxGuestHGCMCallInfo callInfo;
872
873 /** pointer, in: SHFLROOT
874 * Root handle of the mapping which name is queried.
875 */
876 HGCMFunctionParameter root;
877
878 /** pointer, in:
879 * Points to SHFLSTRING buffer.
880 */
881 HGCMFunctionParameter path;
882
883 /** value32, in:
884 * remove flags (file/directory)
885 */
886 HGCMFunctionParameter flags;
887
888} VBoxSFRemove;
889
890#define SHFL_CPARMS_REMOVE (3)
891
892
893/**
894 * SHFL_FN_RENAME
895 */
896
897#define SHFL_RENAME_FILE (0x1)
898#define SHFL_RENAME_DIR (0x2)
899#define SHFL_RENAME_REPLACE_IF_EXISTS (0x4)
900
901/** Parameters structure. */
902typedef struct _VBoxSFRename
903{
904 VBoxGuestHGCMCallInfo callInfo;
905
906 /** pointer, in: SHFLROOT
907 * Root handle of the mapping which name is queried.
908 */
909 HGCMFunctionParameter root;
910
911 /** pointer, in:
912 * Points to SHFLSTRING src.
913 */
914 HGCMFunctionParameter src;
915
916 /** pointer, in:
917 * Points to SHFLSTRING dest.
918 */
919 HGCMFunctionParameter dest;
920
921 /** value32, in:
922 * rename flags (file/directory)
923 */
924 HGCMFunctionParameter flags;
925
926} VBoxSFRename;
927
928#define SHFL_CPARMS_RENAME (4)
929
930/**
931 * SHFL_FN_ADD_MAPPING
932 */
933
934/** Parameters structure. */
935typedef struct _VBoxSFAddMapping
936{
937 VBoxGuestHGCMCallInfo callInfo;
938
939 /** pointer, in: Folder name
940 * Points to SHFLSTRING buffer.
941 */
942 HGCMFunctionParameter folder;
943
944 /** pointer, in: Mapping name
945 * Points to SHFLSTRING buffer.
946 */
947 HGCMFunctionParameter mapping;
948
949 /** bool, in: Writable
950 * True (default) if the folder is writable.
951 */
952 HGCMFunctionParameter writable;
953
954} VBoxSFAddMapping;
955
956#define SHFL_CPARMS_ADD_MAPPING (3)
957
958
959/**
960 * SHFL_FN_REMOVE_MAPPING
961 */
962
963/** Parameters structure. */
964typedef struct _VBoxSFRemoveMapping
965{
966 VBoxGuestHGCMCallInfo callInfo;
967
968 /** pointer, in: Guest name
969 * Points to SHFLSTRING buffer.
970 */
971 HGCMFunctionParameter path;
972
973} VBoxSFRemoveMapping;
974
975#define SHFL_CPARMS_REMOVE_MAPPING (1)
976
977
978/**
979 * SHFL_FN_SET_STATUS_LED
980 */
981
982/** Parameters structure. */
983typedef struct _VBoxSFSetStatusLed
984{
985 VBoxGuestHGCMCallInfo callInfo;
986
987 /** pointer, in: LED address
988 * Points to PPDMLED buffer.
989 */
990 HGCMFunctionParameter led;
991
992} VBoxSFSetStatusLed;
993
994#define SHFL_CPARMS_SET_STATUS_LED (1)
995
996/** @} */
997
998#endif
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use