VirtualBox

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

Last change on this file since 75336 was 75336, checked in by vboxsync, 6 years ago

SharedFolders/vbsfRename: Use RTPathRename if both SHFL_RENAME_FILE and SHFL_RENAME_DIR are set (would previously call RTFileMove in this case). Corrected harmless use of wrong flag constants in validation checks.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.4 KB
Line 
1/* $Id: shflhandle.h 75336 2018-11-09 01:25:29Z vboxsync $ */
2/** @file
3 * Shared Folders Host Service - Handles helper functions header.
4 */
5
6/*
7 * Copyright (C) 2006-2017 Oracle Corporation
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
18#ifndef ___SHFLHANDLE_H
19#define ___SHFLHANDLE_H
20
21#include "shfl.h"
22#include <VBox/shflsvc.h>
23#include <iprt/dir.h>
24
25#define SHFL_HF_TYPE_MASK (0x000000FF)
26#define SHFL_HF_TYPE_DIR (0x00000001)
27#define SHFL_HF_TYPE_FILE (0x00000002)
28#define SHFL_HF_TYPE_VOLUME (0x00000004)
29#define SHFL_HF_TYPE_DONTUSE (0x00000080)
30
31#define SHFL_HF_VALID (0x80000000)
32
33#define SHFLHANDLE_MAX (4096)
34
35typedef struct _SHFLHANDLEHDR
36{
37 uint32_t u32Flags;
38} SHFLHANDLEHDR;
39
40#define ShflHandleType(__Handle) BIT_FLAG(((SHFLHANDLEHDR *)(__Handle))->u32Flags, SHFL_HF_TYPE_MASK)
41
42typedef struct _SHFLFILEHANDLE
43{
44 SHFLHANDLEHDR Header;
45 SHFLROOT root; /* Where the handle has been opened. */
46 union
47 {
48 struct
49 {
50 RTFILE Handle;
51 } file;
52 struct
53 {
54 RTDIR Handle;
55 RTDIR SearchHandle;
56 PRTDIRENTRYEX pLastValidEntry; /* last found file in a directory search */
57 } dir;
58 };
59} SHFLFILEHANDLE;
60
61
62SHFLHANDLE vbsfAllocDirHandle(PSHFLCLIENTDATA pClient);
63SHFLHANDLE vbsfAllocFileHandle(PSHFLCLIENTDATA pClient);
64void vbsfFreeFileHandle (PSHFLCLIENTDATA pClient, SHFLHANDLE hHandle);
65
66
67int vbsfInitHandleTable();
68int vbsfFreeHandleTable();
69SHFLHANDLE vbsfAllocHandle(PSHFLCLIENTDATA pClient, uint32_t uType,
70 uintptr_t pvUserData);
71SHFLFILEHANDLE *vbsfQueryFileHandle(PSHFLCLIENTDATA pClient,
72 SHFLHANDLE handle);
73SHFLFILEHANDLE *vbsfQueryDirHandle(PSHFLCLIENTDATA pClient, SHFLHANDLE handle);
74uint32_t vbsfQueryHandleType(PSHFLCLIENTDATA pClient,
75 SHFLHANDLE handle);
76
77#endif /* !___SHFLHANDLE_H */
Note: See TracBrowser for help on using the repository browser.

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