VirtualBox

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

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

HostServices: Use VBOX_INCLUDED_SRC_ as header guard prefix with scm.

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