VirtualBox

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

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

forgot this

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

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