[75336] | 1 | /* $Id: shflhandle.h 98103 2023-01-17 14:15:46Z vboxsync $ */
|
---|
[3338] | 2 | /** @file
|
---|
[75336] | 3 | * Shared Folders Host Service - Handles helper functions header.
|
---|
[3338] | 4 | */
|
---|
| 5 |
|
---|
| 6 | /*
|
---|
[98103] | 7 | * Copyright (C) 2006-2023 Oracle and/or its affiliates.
|
---|
[3338] | 8 | *
|
---|
[96407] | 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
|
---|
[3338] | 26 | */
|
---|
| 27 |
|
---|
[76570] | 28 | #ifndef VBOX_INCLUDED_SRC_SharedFolders_shflhandle_h
|
---|
| 29 | #define VBOX_INCLUDED_SRC_SharedFolders_shflhandle_h
|
---|
[76526] | 30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
| 31 | # pragma once
|
---|
| 32 | #endif
|
---|
[3338] | 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 |
|
---|
| 48 | typedef struct _SHFLHANDLEHDR
|
---|
| 49 | {
|
---|
| 50 | uint32_t u32Flags;
|
---|
| 51 | } SHFLHANDLEHDR;
|
---|
| 52 |
|
---|
| 53 | #define ShflHandleType(__Handle) BIT_FLAG(((SHFLHANDLEHDR *)(__Handle))->u32Flags, SHFL_HF_TYPE_MASK)
|
---|
| 54 |
|
---|
| 55 | typedef struct _SHFLFILEHANDLE
|
---|
| 56 | {
|
---|
| 57 | SHFLHANDLEHDR Header;
|
---|
[65288] | 58 | SHFLROOT root; /* Where the handle has been opened. */
|
---|
[3338] | 59 | union
|
---|
| 60 | {
|
---|
| 61 | struct
|
---|
| 62 | {
|
---|
| 63 | RTFILE Handle;
|
---|
[77243] | 64 | uint64_t fOpenFlags; /**< RTFILE_O_XXX. */
|
---|
[3338] | 65 | } file;
|
---|
| 66 | struct
|
---|
| 67 | {
|
---|
[69753] | 68 | RTDIR Handle;
|
---|
| 69 | RTDIR SearchHandle;
|
---|
[77243] | 70 | PRTDIRENTRYEX pLastValidEntry; /**< last found file in a directory search */
|
---|
[3338] | 71 | } dir;
|
---|
| 72 | };
|
---|
| 73 | } SHFLFILEHANDLE;
|
---|
| 74 |
|
---|
| 75 |
|
---|
[39544] | 76 | SHFLHANDLE vbsfAllocDirHandle(PSHFLCLIENTDATA pClient);
|
---|
| 77 | SHFLHANDLE vbsfAllocFileHandle(PSHFLCLIENTDATA pClient);
|
---|
| 78 | void vbsfFreeFileHandle (PSHFLCLIENTDATA pClient, SHFLHANDLE hHandle);
|
---|
[3338] | 79 |
|
---|
| 80 |
|
---|
| 81 | int vbsfInitHandleTable();
|
---|
| 82 | int vbsfFreeHandleTable();
|
---|
[39544] | 83 | SHFLHANDLE vbsfAllocHandle(PSHFLCLIENTDATA pClient, uint32_t uType,
|
---|
| 84 | uintptr_t pvUserData);
|
---|
| 85 | SHFLFILEHANDLE *vbsfQueryFileHandle(PSHFLCLIENTDATA pClient,
|
---|
| 86 | SHFLHANDLE handle);
|
---|
| 87 | SHFLFILEHANDLE *vbsfQueryDirHandle(PSHFLCLIENTDATA pClient, SHFLHANDLE handle);
|
---|
| 88 | uint32_t vbsfQueryHandleType(PSHFLCLIENTDATA pClient,
|
---|
| 89 | SHFLHANDLE handle);
|
---|
[3338] | 90 |
|
---|
[76570] | 91 | #endif /* !VBOX_INCLUDED_SRC_SharedFolders_shflhandle_h */
|
---|