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