VirtualBox

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

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

Shared folders flag for appending data to a file. Windows addition only. Todo: Linux additions and IPRT support.

  • 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/** Append data to a file. */
236#define SHFL_CF_APPEND (0x00000008)
237
238/** Open/create action to do if object exists
239 * and if the object does not exists.
240 * REPLACE file means atomically DELETE and CREATE.
241 * OVERWRITE file means truncating the file to 0 and
242 * setting new size.
243 * When opening an existing directory REPLACE and OVERWRITE
244 * actions are considered invalid, and cause returning
245 * FILE_EXISTS with NIL handle.
246 */
247#define SHFL_CF_ACT_MASK_IF_EXISTS (0x000000F0)
248#define SHFL_CF_ACT_MASK_IF_NEW (0x00000F00)
249
250/** What to do if object exists. */
251#define SHFL_CF_ACT_OPEN_IF_EXISTS (0x00000000)
252#define SHFL_CF_ACT_FAIL_IF_EXISTS (0x00000010)
253#define SHFL_CF_ACT_REPLACE_IF_EXISTS (0x00000020)
254#define SHFL_CF_ACT_OVERWRITE_IF_EXISTS (0x00000030)
255
256/** What to do if object does not exist. */
257#define SHFL_CF_ACT_CREATE_IF_NEW (0x00000000)
258#define SHFL_CF_ACT_FAIL_IF_NEW (0x00000100)
259
260/** Read/write requested access for the object. */
261#define SHFL_CF_ACCESS_MASK_RW (0x00003000)
262
263/** No access requested. */
264#define SHFL_CF_ACCESS_NONE (0x00000000)
265/** Read access requested. */
266#define SHFL_CF_ACCESS_READ (0x00001000)
267/** Write access requested. */
268#define SHFL_CF_ACCESS_WRITE (0x00002000)
269/** Read/Write access requested. */
270#define SHFL_CF_ACCESS_READWRITE (SHFL_CF_ACCESS_READ | SHFL_CF_ACCESS_WRITE)
271
272/** Requested share access for the object. */
273#define SHFL_CF_ACCESS_MASK_DENY (0x0000C000)
274
275/** Allow any access. */
276#define SHFL_CF_ACCESS_DENYNONE (0x00000000)
277/** Do not allow read. */
278#define SHFL_CF_ACCESS_DENYREAD (0x00004000)
279/** Do not allow write. */
280#define SHFL_CF_ACCESS_DENYWRITE (0x00008000)
281/** Do not allow access. */
282#define SHFL_CF_ACCESS_DENYALL (SHFL_CF_ACCESS_DENYREAD | SHFL_CF_ACCESS_DENYWRITE)
283
284
285/** @} */
286
287#pragma pack(1)
288typedef struct _SHFLCREATEPARMS
289{
290 /* Returned handle of opened object. */
291 SHFLHANDLE Handle;
292
293 /* Returned result of the operation */
294 SHFLCREATERESULT Result;
295
296 /* SHFL_CF_* */
297 uint32_t CreateFlags;
298
299 /* Attributes of object to create and
300 * returned actual attributes of opened/created object.
301 */
302 RTFSOBJINFO Info;
303
304} SHFLCREATEPARMS;
305#pragma pack()
306
307typedef SHFLCREATEPARMS *PSHFLCREATEPARMS;
308
309
310/** Shared Folders mappings.
311 * @{
312 */
313
314/** The mapping has been added since last query. */
315#define SHFL_MS_NEW (1)
316/** The mapping has been deleted since last query. */
317#define SHFL_MS_DELETED (2)
318
319typedef struct _SHFLMAPPING
320{
321 /** Mapping status. */
322 uint32_t u32Status;
323 /** Root handle. */
324 SHFLROOT root;
325} SHFLMAPPING;
326
327typedef SHFLMAPPING *PSHFLMAPPING;
328
329/** @} */
330
331/** Shared Folder directory information
332 * @{
333 */
334
335typedef struct _SHFLDIRINFO
336{
337 /** Full information about the object. */
338 RTFSOBJINFO Info;
339 /** The length of the short field (number of RTUTF16 chars).
340 * It is 16-bit for reasons of alignment. */
341 uint16_t cucShortName;
342 /** The short name for 8.3 compatability.
343 * Empty string if not available.
344 */
345 RTUTF16 uszShortName[14];
346 /** @todo malc, a description, please. */
347 SHFLSTRING name;
348} SHFLDIRINFO, *PSHFLDIRINFO;
349
350typedef struct _SHFLVOLINFO
351{
352 RTFOFF ullTotalAllocationBytes;
353 RTFOFF ullAvailableAllocationBytes;
354 uint32_t ulBytesPerAllocationUnit;
355 uint32_t ulBytesPerSector;
356 uint32_t ulSerial;
357 RTFSPROPERTIES fsProperties;
358} SHFLVOLINFO, *PSHFLVOLINFO;
359
360/** @} */
361
362/** Function parameter structures.
363 * @{
364 */
365
366/**
367 * SHFL_FN_QUERY_MAPPINGS
368 */
369
370#define SHFL_MF_UCS2 (0x00000000)
371/** Guest uses UTF8 strings, if not set then the strings are unicode (UCS2). */
372#define SHFL_MF_UTF8 (0x00000001)
373
374/** Type of guest system. For future system dependent features. */
375#define SHFL_MF_SYSTEM_MASK (0x0000FF00)
376#define SHFL_MF_SYSTEM_NONE (0x00000000)
377#define SHFL_MF_SYSTEM_WINDOWS (0x00000100)
378#define SHFL_MF_SYSTEM_LINUX (0x00000200)
379
380/** Parameters structure. */
381typedef struct _VBoxSFQueryMappings
382{
383 VBoxGuestHGCMCallInfo callInfo;
384
385 /** 32bit, in:
386 * Flags describing various client needs.
387 */
388 HGCMFunctionParameter flags;
389
390 /** 32bit, in/out:
391 * Number of mappings the client expects.
392 * This is the number of elements in the
393 * mappings array.
394 */
395 HGCMFunctionParameter numberOfMappings;
396
397 /** pointer, in/out:
398 * Points to array of SHFLMAPPING structures.
399 */
400 HGCMFunctionParameter mappings;
401
402} VBoxSFQueryMappings;
403
404/** Number of parameters */
405#define SHFL_CPARMS_QUERY_MAPPINGS (3)
406
407
408
409/**
410 * SHFL_FN_QUERY_MAP_NAME
411 */
412
413/** Parameters structure. */
414typedef struct _VBoxSFQueryMapName
415{
416 VBoxGuestHGCMCallInfo callInfo;
417
418 /** 32bit, in: SHFLROOT
419 * Root handle of the mapping which name is queried.
420 */
421 HGCMFunctionParameter root;
422
423 /** pointer, in/out:
424 * Points to SHFLSTRING buffer.
425 */
426 HGCMFunctionParameter name;
427
428} VBoxSFQueryMapName;
429
430/** Number of parameters */
431#define SHFL_CPARMS_QUERY_MAP_NAME (2)
432
433/**
434 * SHFL_FN_MAP_FOLDER_OLD
435 */
436
437/** Parameters structure. */
438typedef struct _VBoxSFMapFolder_Old
439{
440 VBoxGuestHGCMCallInfo callInfo;
441
442 /** pointer, in:
443 * Points to SHFLSTRING buffer.
444 */
445 HGCMFunctionParameter path;
446
447 /** pointer, out: SHFLROOT
448 * Root handle of the mapping which name is queried.
449 */
450 HGCMFunctionParameter root;
451
452 /** pointer, in: RTUTF16
453 * Path delimiter
454 */
455 HGCMFunctionParameter delimiter;
456
457} VBoxSFMapFolder_Old;
458
459/** Number of parameters */
460#define SHFL_CPARMS_MAP_FOLDER_OLD (3)
461
462/**
463 * SHFL_FN_MAP_FOLDER
464 */
465
466/** Parameters structure. */
467typedef struct _VBoxSFMapFolder
468{
469 VBoxGuestHGCMCallInfo callInfo;
470
471 /** pointer, in:
472 * Points to SHFLSTRING buffer.
473 */
474 HGCMFunctionParameter path;
475
476 /** pointer, out: SHFLROOT
477 * Root handle of the mapping which name is queried.
478 */
479 HGCMFunctionParameter root;
480
481 /** pointer, in: RTUTF16
482 * Path delimiter
483 */
484 HGCMFunctionParameter delimiter;
485
486 /** pointer, in: SHFLROOT
487 * Case senstive flag
488 */
489 HGCMFunctionParameter fCaseSensitive;
490
491} VBoxSFMapFolder;
492
493/** Number of parameters */
494#define SHFL_CPARMS_MAP_FOLDER (4)
495
496/**
497 * SHFL_FN_UNMAP_FOLDER
498 */
499
500/** Parameters structure. */
501typedef struct _VBoxSFUnmapFolder
502{
503 VBoxGuestHGCMCallInfo callInfo;
504
505 /** pointer, in: SHFLROOT
506 * Root handle of the mapping which name is queried.
507 */
508 HGCMFunctionParameter root;
509
510} VBoxSFUnmapFolder;
511
512/** Number of parameters */
513#define SHFL_CPARMS_UNMAP_FOLDER (1)
514
515
516/**
517 * SHFL_FN_CREATE
518 */
519
520/** Parameters structure. */
521typedef struct _VBoxSFCreate
522{
523 VBoxGuestHGCMCallInfo callInfo;
524
525 /** pointer, in: SHFLROOT
526 * Root handle of the mapping which name is queried.
527 */
528 HGCMFunctionParameter root;
529
530 /** pointer, in:
531 * Points to SHFLSTRING buffer.
532 */
533 HGCMFunctionParameter path;
534
535 /** pointer, in/out:
536 * Points to SHFLCREATEPARMS buffer.
537 */
538 HGCMFunctionParameter parms;
539
540} VBoxSFCreate;
541
542/** Number of parameters */
543#define SHFL_CPARMS_CREATE (3)
544
545
546/**
547 * SHFL_FN_CLOSE
548 */
549
550/** Parameters structure. */
551typedef struct _VBoxSFClose
552{
553 VBoxGuestHGCMCallInfo callInfo;
554
555 /** pointer, in: SHFLROOT
556 * Root handle of the mapping which name is queried.
557 */
558 HGCMFunctionParameter root;
559
560
561 /** value64, in:
562 * SHFLHANDLE of object to close.
563 */
564 HGCMFunctionParameter handle;
565
566} VBoxSFClose;
567
568/** Number of parameters */
569#define SHFL_CPARMS_CLOSE (2)
570
571
572/**
573 * SHFL_FN_READ
574 */
575
576/** Parameters structure. */
577typedef struct _VBoxSFRead
578{
579 VBoxGuestHGCMCallInfo callInfo;
580
581 /** pointer, in: SHFLROOT
582 * Root handle of the mapping which name is queried.
583 */
584 HGCMFunctionParameter root;
585
586 /** value64, in:
587 * SHFLHANDLE of object to read from.
588 */
589 HGCMFunctionParameter handle;
590
591 /** value64, in:
592 * Offset to read from.
593 */
594 HGCMFunctionParameter offset;
595
596 /** value64, in/out:
597 * Bytes to read/How many were read.
598 */
599 HGCMFunctionParameter cb;
600
601 /** pointer, out:
602 * Buffer to place data to.
603 */
604 HGCMFunctionParameter buffer;
605
606} VBoxSFRead;
607
608/** Number of parameters */
609#define SHFL_CPARMS_READ (5)
610
611
612
613/**
614 * SHFL_FN_WRITE
615 */
616
617/** Parameters structure. */
618typedef struct _VBoxSFWrite
619{
620 VBoxGuestHGCMCallInfo callInfo;
621
622 /** pointer, in: SHFLROOT
623 * Root handle of the mapping which name is queried.
624 */
625 HGCMFunctionParameter root;
626
627 /** value64, in:
628 * SHFLHANDLE of object to write to.
629 */
630 HGCMFunctionParameter handle;
631
632 /** value64, in:
633 * Offset to write to.
634 */
635 HGCMFunctionParameter offset;
636
637 /** value64, in/out:
638 * Bytes to write/How many were written.
639 */
640 HGCMFunctionParameter cb;
641
642 /** pointer, in:
643 * Data to write.
644 */
645 HGCMFunctionParameter buffer;
646
647} VBoxSFWrite;
648
649/** Number of parameters */
650#define SHFL_CPARMS_WRITE (5)
651
652
653
654/**
655 * SHFL_FN_LOCK
656 */
657
658/** Lock owner is the HGCM client. */
659
660/** Lock mode bit mask. */
661#define SHFL_LOCK_MODE_MASK (0x3)
662/** Cancel lock on the given range. */
663#define SHFL_LOCK_CANCEL (0x0)
664/** Aquire read only lock. Prevent write to the range. */
665#define SHFL_LOCK_SHARED (0x1)
666/** Aquire write lock. Prevent both write and read to the range. */
667#define SHFL_LOCK_EXCLUSIVE (0x2)
668
669/** Do not wait for lock if it can not be acquired at the time. */
670#define SHFL_LOCK_NOWAIT (0x0)
671/** Wait and acquire lock. */
672#define SHFL_LOCK_WAIT (0x4)
673
674/** Lock the specified range. */
675#define SHFL_LOCK_PARTIAL (0x0)
676/** Lock entire object. */
677#define SHFL_LOCK_ENTIRE (0x8)
678
679/** Parameters structure. */
680typedef struct _VBoxSFLock
681{
682 VBoxGuestHGCMCallInfo callInfo;
683
684 /** pointer, in: SHFLROOT
685 * Root handle of the mapping which name is queried.
686 */
687 HGCMFunctionParameter root;
688
689 /** value64, in:
690 * SHFLHANDLE of object to be locked.
691 */
692 HGCMFunctionParameter handle;
693
694 /** value64, in:
695 * Starting offset of lock range.
696 */
697 HGCMFunctionParameter offset;
698
699 /** value64, in:
700 * Length of range.
701 */
702 HGCMFunctionParameter length;
703
704 /** value32, in:
705 * Lock flags SHFL_LOCK_*.
706 */
707 HGCMFunctionParameter flags;
708
709} VBoxSFLock;
710
711/** Number of parameters */
712#define SHFL_CPARMS_LOCK (5)
713
714
715
716/**
717 * SHFL_FN_FLUSH
718 */
719
720/** Parameters structure. */
721typedef struct _VBoxSFFlush
722{
723 VBoxGuestHGCMCallInfo callInfo;
724
725 /** pointer, in: SHFLROOT
726 * Root handle of the mapping which name is queried.
727 */
728 HGCMFunctionParameter root;
729
730 /** value64, in:
731 * SHFLHANDLE of object to be locked.
732 */
733 HGCMFunctionParameter handle;
734
735} VBoxSFFlush;
736
737/** Number of parameters */
738#define SHFL_CPARMS_FLUSH (2)
739
740/**
741 * SHFL_FN_LIST
742 */
743
744/** Listing information includes variable length RTDIRENTRY[EX] structures. */
745
746/** @todo might be necessary for future. */
747#define SHFL_LIST_NONE 0
748#define SHFL_LIST_RETURN_ONE 1
749
750/** Parameters structure. */
751typedef struct _VBoxSFList
752{
753 VBoxGuestHGCMCallInfo callInfo;
754
755 /** pointer, in: SHFLROOT
756 * Root handle of the mapping which name is queried.
757 */
758 HGCMFunctionParameter root;
759
760 /** value64, in:
761 * SHFLHANDLE of object to be listed.
762 */
763 HGCMFunctionParameter handle;
764
765 /** value32, in:
766 * List flags SHFL_LIST_*.
767 */
768 HGCMFunctionParameter flags;
769
770 /** value32, in/out:
771 * Bytes to be used for listing information/How many bytes were used.
772 */
773 HGCMFunctionParameter cb;
774
775 /** pointer, in/optional
776 * Points to SHFLSTRING buffer that specifies a search path.
777 */
778 HGCMFunctionParameter path;
779
780 /** pointer, out:
781 * Buffer to place listing information to. (SHFLDIRINFO)
782 */
783 HGCMFunctionParameter buffer;
784
785 /** value32, in/out:
786 * Indicates a key where the listing must be resumed.
787 * in: 0 means start from begin of object.
788 * out: 0 means listing completed.
789 */
790 HGCMFunctionParameter resumePoint;
791
792 /** pointer, out:
793 * Number of files returned
794 */
795 HGCMFunctionParameter cFiles;
796
797} VBoxSFList;
798
799/** Number of parameters */
800#define SHFL_CPARMS_LIST (8)
801
802
803
804/**
805 * SHFL_FN_INFORMATION
806 */
807
808/** Mask of Set/Get bit. */
809#define SHFL_INFO_MODE_MASK (0x1)
810/** Get information */
811#define SHFL_INFO_GET (0x0)
812/** Set information */
813#define SHFL_INFO_SET (0x1)
814
815/** Get name of the object. */
816#define SHFL_INFO_NAME (0x2)
817/** Set size of object (extend/trucate); only applies to file objects */
818#define SHFL_INFO_SIZE (0x4)
819/** Get/Set file object info. */
820#define SHFL_INFO_FILE (0x8)
821/** Get volume information. */
822#define SHFL_INFO_VOLUME (0x10)
823
824/** @todo different file info structures */
825
826
827/** Parameters structure. */
828typedef struct _VBoxSFInformation
829{
830 VBoxGuestHGCMCallInfo callInfo;
831
832 /** pointer, in: SHFLROOT
833 * Root handle of the mapping which name is queried.
834 */
835 HGCMFunctionParameter root;
836
837 /** value64, in:
838 * SHFLHANDLE of object to be listed.
839 */
840 HGCMFunctionParameter handle;
841
842 /** value32, in:
843 * SHFL_INFO_*
844 */
845 HGCMFunctionParameter flags;
846
847 /** value32, in/out:
848 * Bytes to be used for information/How many bytes were used.
849 */
850 HGCMFunctionParameter cb;
851
852 /** pointer, in/out:
853 * Information to be set/get (RTFSOBJINFO or SHFLSTRING).
854 * Do not forget to set the RTFSOBJINFO::Attr::enmAdditional for Get operation as well.
855 */
856 HGCMFunctionParameter info;
857
858} VBoxSFInformation;
859
860/** Number of parameters */
861#define SHFL_CPARMS_INFORMATION (5)
862
863
864/**
865 * SHFL_FN_REMOVE
866 */
867
868#define SHFL_REMOVE_FILE (0x1)
869#define SHFL_REMOVE_DIR (0x2)
870
871/** Parameters structure. */
872typedef struct _VBoxSFRemove
873{
874 VBoxGuestHGCMCallInfo callInfo;
875
876 /** pointer, in: SHFLROOT
877 * Root handle of the mapping which name is queried.
878 */
879 HGCMFunctionParameter root;
880
881 /** pointer, in:
882 * Points to SHFLSTRING buffer.
883 */
884 HGCMFunctionParameter path;
885
886 /** value32, in:
887 * remove flags (file/directory)
888 */
889 HGCMFunctionParameter flags;
890
891} VBoxSFRemove;
892
893#define SHFL_CPARMS_REMOVE (3)
894
895
896/**
897 * SHFL_FN_RENAME
898 */
899
900#define SHFL_RENAME_FILE (0x1)
901#define SHFL_RENAME_DIR (0x2)
902#define SHFL_RENAME_REPLACE_IF_EXISTS (0x4)
903
904/** Parameters structure. */
905typedef struct _VBoxSFRename
906{
907 VBoxGuestHGCMCallInfo callInfo;
908
909 /** pointer, in: SHFLROOT
910 * Root handle of the mapping which name is queried.
911 */
912 HGCMFunctionParameter root;
913
914 /** pointer, in:
915 * Points to SHFLSTRING src.
916 */
917 HGCMFunctionParameter src;
918
919 /** pointer, in:
920 * Points to SHFLSTRING dest.
921 */
922 HGCMFunctionParameter dest;
923
924 /** value32, in:
925 * rename flags (file/directory)
926 */
927 HGCMFunctionParameter flags;
928
929} VBoxSFRename;
930
931#define SHFL_CPARMS_RENAME (4)
932
933/**
934 * SHFL_FN_ADD_MAPPING
935 */
936
937/** Parameters structure. */
938typedef struct _VBoxSFAddMapping
939{
940 VBoxGuestHGCMCallInfo callInfo;
941
942 /** pointer, in: Folder name
943 * Points to SHFLSTRING buffer.
944 */
945 HGCMFunctionParameter folder;
946
947 /** pointer, in: Mapping name
948 * Points to SHFLSTRING buffer.
949 */
950 HGCMFunctionParameter mapping;
951
952 /** bool, in: Writable
953 * True (default) if the folder is writable.
954 */
955 HGCMFunctionParameter writable;
956
957} VBoxSFAddMapping;
958
959#define SHFL_CPARMS_ADD_MAPPING (3)
960
961
962/**
963 * SHFL_FN_REMOVE_MAPPING
964 */
965
966/** Parameters structure. */
967typedef struct _VBoxSFRemoveMapping
968{
969 VBoxGuestHGCMCallInfo callInfo;
970
971 /** pointer, in: Guest name
972 * Points to SHFLSTRING buffer.
973 */
974 HGCMFunctionParameter path;
975
976} VBoxSFRemoveMapping;
977
978#define SHFL_CPARMS_REMOVE_MAPPING (1)
979
980
981/**
982 * SHFL_FN_SET_STATUS_LED
983 */
984
985/** Parameters structure. */
986typedef struct _VBoxSFSetStatusLed
987{
988 VBoxGuestHGCMCallInfo callInfo;
989
990 /** pointer, in: LED address
991 * Points to PPDMLED buffer.
992 */
993 HGCMFunctionParameter led;
994
995} VBoxSFSetStatusLed;
996
997#define SHFL_CPARMS_SET_STATUS_LED (1)
998
999/** @} */
1000
1001#endif
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use