VirtualBox

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

Last change on this file since 71930 was 69753, checked in by vboxsync, 7 years ago

iprt/dir: Morphing PRTDIR into a handle named RTDIR. (Been wanting to correct this for years. Don't know why I makde it a pointer rather than an abstrct handle like everything else.)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.3 KB
Line 
1/** @file
2 *
3 * Shared Folders:
4 * Handles helper functions header.
5 */
6
7/*
8 * Copyright (C) 2006-2017 Oracle Corporation
9 *
10 * This file is part of VirtualBox Open Source Edition (OSE), as
11 * available from http://www.virtualbox.org. This file is free software;
12 * you can redistribute it and/or modify it under the terms of the GNU
13 * General Public License (GPL) as published by the Free Software
14 * Foundation, in version 2 as it comes in the "COPYING" file of the
15 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17 */
18
19#ifndef __SHFLHANDLE__H
20#define __SHFLHANDLE__H
21
22#include "shfl.h"
23#include <VBox/shflsvc.h>
24#include <iprt/dir.h>
25
26#define SHFL_HF_TYPE_MASK (0x000000FF)
27#define SHFL_HF_TYPE_DIR (0x00000001)
28#define SHFL_HF_TYPE_FILE (0x00000002)
29#define SHFL_HF_TYPE_VOLUME (0x00000004)
30#define SHFL_HF_TYPE_DONTUSE (0x00000080)
31
32#define SHFL_HF_VALID (0x80000000)
33
34#define SHFLHANDLE_MAX (4096)
35
36typedef struct _SHFLHANDLEHDR
37{
38 uint32_t u32Flags;
39} SHFLHANDLEHDR;
40
41#define ShflHandleType(__Handle) BIT_FLAG(((SHFLHANDLEHDR *)(__Handle))->u32Flags, SHFL_HF_TYPE_MASK)
42
43typedef struct _SHFLFILEHANDLE
44{
45 SHFLHANDLEHDR Header;
46 SHFLROOT root; /* Where the handle has been opened. */
47 union
48 {
49 struct
50 {
51 RTFILE Handle;
52 } file;
53 struct
54 {
55 RTDIR Handle;
56 RTDIR SearchHandle;
57 PRTDIRENTRYEX pLastValidEntry; /* last found file in a directory search */
58 } dir;
59 };
60} SHFLFILEHANDLE;
61
62
63SHFLHANDLE vbsfAllocDirHandle(PSHFLCLIENTDATA pClient);
64SHFLHANDLE vbsfAllocFileHandle(PSHFLCLIENTDATA pClient);
65void vbsfFreeFileHandle (PSHFLCLIENTDATA pClient, SHFLHANDLE hHandle);
66
67
68int vbsfInitHandleTable();
69int vbsfFreeHandleTable();
70SHFLHANDLE vbsfAllocHandle(PSHFLCLIENTDATA pClient, uint32_t uType,
71 uintptr_t pvUserData);
72SHFLFILEHANDLE *vbsfQueryFileHandle(PSHFLCLIENTDATA pClient,
73 SHFLHANDLE handle);
74SHFLFILEHANDLE *vbsfQueryDirHandle(PSHFLCLIENTDATA pClient, SHFLHANDLE handle);
75uint32_t vbsfQueryHandleType(PSHFLCLIENTDATA pClient,
76 SHFLHANDLE handle);
77
78#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