1 | /** @file
|
---|
2 | * Shared Folders: Main header - Common data and function prototypes definitions.
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2006-2022 Oracle and/or its affiliates.
|
---|
7 | *
|
---|
8 | * This file is part of VirtualBox base platform packages, as
|
---|
9 | * available from https://www.virtualbox.org.
|
---|
10 | *
|
---|
11 | * This program is free software; you can redistribute it and/or
|
---|
12 | * modify it under the terms of the GNU General Public License
|
---|
13 | * as published by the Free Software Foundation, in version 3 of the
|
---|
14 | * License.
|
---|
15 | *
|
---|
16 | * This program is distributed in the hope that it will be useful, but
|
---|
17 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
19 | * General Public License for more details.
|
---|
20 | *
|
---|
21 | * You should have received a copy of the GNU General Public License
|
---|
22 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
23 | *
|
---|
24 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
25 | */
|
---|
26 |
|
---|
27 | #ifndef VBOX_INCLUDED_SRC_SharedFolders_shfl_h
|
---|
28 | #define VBOX_INCLUDED_SRC_SharedFolders_shfl_h
|
---|
29 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
30 | # pragma once
|
---|
31 | #endif
|
---|
32 |
|
---|
33 | #include <VBox/err.h>
|
---|
34 | #include <VBox/hgcmsvc.h>
|
---|
35 | #include <VBox/shflsvc.h>
|
---|
36 |
|
---|
37 | #include <VBox/log.h>
|
---|
38 |
|
---|
39 | /** Shared Folders client flags.
|
---|
40 | * @{
|
---|
41 | */
|
---|
42 | /** Client has queried mappings at least once and, therefore, the service can
|
---|
43 | * process its other requests too. */
|
---|
44 | #define SHFL_CF_MAPPINGS_QUERIED (0x00000001)
|
---|
45 | /** Mappings have been changed since last query. */
|
---|
46 | #define SHFL_CF_MAPPINGS_CHANGED (0x00000002)
|
---|
47 | /** Client uses UTF8 encoding, if not set then unicode 16 bit (UCS2) is used. */
|
---|
48 | #define SHFL_CF_UTF8 (0x00000004)
|
---|
49 | /** Client both supports and wants to use symlinks. */
|
---|
50 | #define SHFL_CF_SYMLINKS (0x00000008)
|
---|
51 | /** The call to SHFL_FN_WAIT_FOR_MAPPINGS_CHANGES will return immediately
|
---|
52 | * because of a SHFL_FN_CANCEL_MAPPINGS_CHANGES_WAITS call. */
|
---|
53 | #define SHFL_CF_CANCEL_NEXT_WAIT (0x00000010)
|
---|
54 | /** @} */
|
---|
55 |
|
---|
56 | /**
|
---|
57 | * @note This structure is dumped directly into the saved state, so care must be
|
---|
58 | * taken when extending it!
|
---|
59 | */
|
---|
60 | typedef struct SHFLCLIENTDATA
|
---|
61 | {
|
---|
62 | /** Client flags */
|
---|
63 | uint32_t fu32Flags;
|
---|
64 | /** Path delimiter. */
|
---|
65 | RTUTF16 PathDelimiter;
|
---|
66 | /** The error style, SHFLERRORSTYLE. */
|
---|
67 | uint8_t enmErrorStyle;
|
---|
68 | /** Set if the client has mapping usage counts.
|
---|
69 | * This is for helping with saved state. */
|
---|
70 | uint8_t fHasMappingCounts;
|
---|
71 | /** Mapping counts for each root ID so we can unmap the folders when the
|
---|
72 | * session disconnects or the VM resets. */
|
---|
73 | uint16_t acMappings[SHFL_MAX_MAPPINGS];
|
---|
74 | } SHFLCLIENTDATA;
|
---|
75 | /** Pointer to a SHFLCLIENTDATA structure. */
|
---|
76 | typedef SHFLCLIENTDATA *PSHFLCLIENTDATA;
|
---|
77 |
|
---|
78 |
|
---|
79 | /** @def SHFL_CLIENT_NEED_WINDOWS_ERROR_STYLE_ADJUST_ON_POSIX
|
---|
80 | * Whether to make windows error style adjustments on a posix host.
|
---|
81 | * This always returns false on windows hosts. */
|
---|
82 | #ifdef RT_OS_WINDOWS
|
---|
83 | # define SHFL_CLIENT_NEED_WINDOWS_ERROR_STYLE_ADJUST_ON_POSIX(a_pClient) (false)
|
---|
84 | #else
|
---|
85 | # define SHFL_CLIENT_NEED_WINDOWS_ERROR_STYLE_ADJUST_ON_POSIX(a_pClient) ((a_pClient)->enmErrorStyle == kShflErrorStyle_Windows)
|
---|
86 | #endif
|
---|
87 |
|
---|
88 | #endif /* !VBOX_INCLUDED_SRC_SharedFolders_shfl_h */
|
---|
89 |
|
---|