VirtualBox

source: vbox/trunk/src/VBox/HostServices/SharedFolders/shflhandle.h

Last change on this file was 98103, checked in by vboxsync, 16 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.8 KB
Line 
1/* $Id: shflhandle.h 98103 2023-01-17 14:15:46Z vboxsync $ */
2/** @file
3 * Shared Folders Host Service - Handles helper functions header.
4 */
5
6/*
7 * Copyright (C) 2006-2023 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * SPDX-License-Identifier: GPL-3.0-only
26 */
27
28#ifndef VBOX_INCLUDED_SRC_SharedFolders_shflhandle_h
29#define VBOX_INCLUDED_SRC_SharedFolders_shflhandle_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34#include "shfl.h"
35#include <VBox/shflsvc.h>
36#include <iprt/dir.h>
37
38#define SHFL_HF_TYPE_MASK (0x000000FF)
39#define SHFL_HF_TYPE_DIR (0x00000001)
40#define SHFL_HF_TYPE_FILE (0x00000002)
41#define SHFL_HF_TYPE_VOLUME (0x00000004)
42#define SHFL_HF_TYPE_DONTUSE (0x00000080)
43
44#define SHFL_HF_VALID (0x80000000)
45
46#define SHFLHANDLE_MAX (4096)
47
48typedef struct _SHFLHANDLEHDR
49{
50 uint32_t u32Flags;
51} SHFLHANDLEHDR;
52
53#define ShflHandleType(__Handle) BIT_FLAG(((SHFLHANDLEHDR *)(__Handle))->u32Flags, SHFL_HF_TYPE_MASK)
54
55typedef struct _SHFLFILEHANDLE
56{
57 SHFLHANDLEHDR Header;
58 SHFLROOT root; /* Where the handle has been opened. */
59 union
60 {
61 struct
62 {
63 RTFILE Handle;
64 uint64_t fOpenFlags; /**< RTFILE_O_XXX. */
65 } file;
66 struct
67 {
68 RTDIR Handle;
69 RTDIR SearchHandle;
70 PRTDIRENTRYEX pLastValidEntry; /**< last found file in a directory search */
71 } dir;
72 };
73} SHFLFILEHANDLE;
74
75
76SHFLHANDLE vbsfAllocDirHandle(PSHFLCLIENTDATA pClient);
77SHFLHANDLE vbsfAllocFileHandle(PSHFLCLIENTDATA pClient);
78void vbsfFreeFileHandle (PSHFLCLIENTDATA pClient, SHFLHANDLE hHandle);
79
80
81int vbsfInitHandleTable();
82int vbsfFreeHandleTable();
83SHFLHANDLE vbsfAllocHandle(PSHFLCLIENTDATA pClient, uint32_t uType,
84 uintptr_t pvUserData);
85SHFLFILEHANDLE *vbsfQueryFileHandle(PSHFLCLIENTDATA pClient,
86 SHFLHANDLE handle);
87SHFLFILEHANDLE *vbsfQueryDirHandle(PSHFLCLIENTDATA pClient, SHFLHANDLE handle);
88uint32_t vbsfQueryHandleType(PSHFLCLIENTDATA pClient,
89 SHFLHANDLE handle);
90
91#endif /* !VBOX_INCLUDED_SRC_SharedFolders_shflhandle_h */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use