VirtualBox

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

Last change on this file since 7944 was 7424, checked in by vboxsync, 17 years ago

RTUCS2 -> RTUTF16

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

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