VirtualBox

source: vbox/trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxCalls.h@ 26742

Last change on this file since 26742 was 26425, checked in by vboxsync, 15 years ago

alternative license for VBoxGuestLib is CDDL

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.2 KB
Line 
1/** @file
2 * VBoxGuestLib - Central calls header.
3 */
4
5/*
6 * Copyright (C) 2006-2007 Sun Microsystems, Inc.
7 *
8 * This file is part of VirtualBox Open Source Edition (OSE), as
9 * available from http://www.virtualbox.org. This file is free software;
10 * you can redistribute it and/or modify it under the terms of the GNU
11 * General Public License (GPL) as published by the Free Software
12 * Foundation, in version 2 as it comes in the "COPYING" file of the
13 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15 *
16 * The contents of this file may alternatively be used under the terms
17 * of the Common Development and Distribution License Version 1.0
18 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
19 * VirtualBox OSE distribution, in which case the provisions of the
20 * CDDL are applicable instead of those of the GPL.
21 *
22 * You may elect to license modified versions of this file under the
23 * terms and conditions of either the GPL or the CDDL or both.
24 *
25 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
26 * Clara, CA 95054 USA or visit http://www.sun.com if you need
27 * additional information or have any questions.
28 */
29
30#ifndef __VBOXCALLS__H
31#define __VBOXCALLS__H
32
33#include <VBox/VBoxGuestLib.h>
34#ifndef _NTIFS_
35# ifdef RT_OS_WINDOWS
36# if (_MSC_VER >= 1400) && !defined(VBOX_WITH_PATCHED_DDK)
37# include <iprt/asm.h>
38# define _InterlockedExchange _InterlockedExchange_StupidDDKvsCompilerCrap
39# define _InterlockedExchangeAdd _InterlockedExchangeAdd_StupidDDKvsCompilerCrap
40# define _InterlockedCompareExchange _InterlockedCompareExchange_StupidDDKvsCompilerCrap
41# define _InterlockedAddLargeStatistic _InterlockedAddLargeStatistic_StupidDDKvsCompilerCrap
42# pragma warning(disable : 4163)
43 RT_C_DECLS_BEGIN
44# include <ntddk.h>
45 RT_C_DECLS_END
46# pragma warning(default : 4163)
47# undef _InterlockedExchange
48# undef _InterlockedExchangeAdd
49# undef _InterlockedCompareExchange
50# undef _InterlockedAddLargeStatistic
51# else
52 RT_C_DECLS_BEGIN
53# include <ntddk.h>
54 RT_C_DECLS_END
55# endif
56# endif
57#endif
58
59#if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS)
60/** @todo remove this legacy and use VBox/log.h and/or iprt/log.h. */
61# ifdef DEBUG
62# define LOG_ENABLED
63# endif
64# include "VBoxGuestLog.h"
65#endif
66
67#include <iprt/assert.h>
68#define ASSERTVBSF AssertRelease
69
70#include <VBox/shflsvc.h>
71
72typedef struct _VBSFCLIENT
73{
74 uint32_t ulClientID;
75 VBGLHGCMHANDLE handle;
76} VBSFCLIENT;
77typedef VBSFCLIENT *PVBSFCLIENT;
78
79typedef struct _VBSFMAP
80{
81 SHFLROOT root;
82} VBSFMAP, *PVBSFMAP;
83
84
85#define VBSF_DRIVE_LETTER_FIRST L'A'
86#define VBSF_DRIVE_LETTER_LAST L'Z'
87
88#define VBSF_MAX_DRIVES (VBSF_DRIVE_LETTER_LAST - VBSF_DRIVE_LETTER_FIRST)
89
90/* Poller thread flags. */
91#define VBSF_TF_NONE (0x0000)
92#define VBSF_TF_STARTED (0x0001)
93#define VBSF_TF_TERMINATE (0x0002)
94#define VBSF_TF_START_PROCESSING (0x0004)
95
96#define DRIVE_FLAG_WORKING (0x1)
97#define DRIVE_FLAG_LOCKED (0x2)
98#define DRIVE_FLAG_WRITE_PROTECTED (0x4)
99
100#ifdef RT_OS_WINDOWS
101/** Device extension structure for each drive letter we created. */
102typedef struct _VBSFDRIVE
103{
104 /* A pointer to the Driver object we created for the drive. */
105 PDEVICE_OBJECT pDeviceObject;
106
107 /** Root handle to access the drive. */
108 SHFLROOT root;
109
110 /** Informational string - the resource name on host. */
111 WCHAR awcNameHost[256];
112
113 /** Guest drive letter. */
114 WCHAR wcDriveLetter;
115
116 /** DRIVE_FLAG_* */
117 uint32_t u32DriveFlags;
118
119 /** Head of FCB list. */
120 LIST_ENTRY FCBHead;
121
122 /* Synchronise requests directed to the drive. */
123 ERESOURCE DriveResource;
124} VBSFDRIVE;
125typedef VBSFDRIVE *PVBSFDRIVE;
126#endif /* RT_OS_WINDOWS */
127
128/* forward decl */
129struct _MRX_VBOX_DEVICE_EXTENSION;
130typedef struct _MRX_VBOX_DEVICE_EXTENSION *PMRX_VBOX_DEVICE_EXTENSION;
131
132DECLVBGL(int) vboxInit (void);
133DECLVBGL(void) vboxUninit (void);
134DECLVBGL(int) vboxConnect (PVBSFCLIENT pClient);
135DECLVBGL(void) vboxDisconnect (PVBSFCLIENT pClient);
136
137DECLVBGL(int) vboxCallQueryMappings (PVBSFCLIENT pClient, SHFLMAPPING paMappings[], uint32_t *pcMappings);
138
139DECLVBGL(int) vboxCallQueryMapName (PVBSFCLIENT pClient, SHFLROOT root, SHFLSTRING *pString, uint32_t size);
140
141/**
142 * Create a new file or folder or open an existing one in a shared folder. Proxies
143 * to vbsfCreate in the host shared folder service.
144 *
145 * @returns IPRT status code, but see note below
146 * @param pClient Host-guest communication connection
147 * @param pMap The mapping for the shared folder in which the file
148 * or folder is to be created
149 * @param pParsedPath The path of the file or folder relative to the shared
150 * folder
151 * @param pCreateParms Parameters for file/folder creation. See the
152 * structure description in shflsvc.h
153 * @retval pCreateParms See the structure description in shflsvc.h
154 *
155 * @note This function reports errors as follows. The return value is always
156 * VINF_SUCCESS unless an exceptional condition occurrs - out of
157 * memory, invalid arguments, etc. If the file or folder could not be
158 * opened or created, pCreateParms->Handle will be set to
159 * SHFL_HANDLE_NIL on return. In this case the value in
160 * pCreateParms->Result provides information as to why (e.g.
161 * SHFL_FILE_EXISTS). pCreateParms->Result is also set on success
162 * as additional information.
163 */
164DECLVBGL(int) vboxCallCreate (PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING pParsedPath, PSHFLCREATEPARMS pCreateParms);
165
166DECLVBGL(int) vboxCallClose (PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE Handle);
167DECLVBGL(int) vboxCallRemove (PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING pParsedPath, uint32_t flags);
168DECLVBGL(int) vboxCallRename (PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING pSrcPath, PSHFLSTRING pDestPath, uint32_t flags);
169DECLVBGL(int) vboxCallFlush (PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile);
170
171DECLVBGL(int) vboxCallRead (PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint32_t *pcbBuffer, uint8_t *pBuffer, bool fLocked);
172DECLVBGL(int) vboxCallWrite (PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint32_t *pcbBuffer, uint8_t *pBuffer, bool fLocked);
173DECLVBGL(int) VbglR0SfWritePhysCont(PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint32_t *pcbBuffer, RTCCPHYS PhysBuffer);
174
175DECLVBGL(int) vboxCallLock (PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint64_t cbSize, uint32_t fLock);
176
177DECLVBGL(int) vboxCallDirInfo (PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile,PSHFLSTRING ParsedPath, uint32_t flags,
178 uint32_t index, uint32_t *pcbBuffer, PSHFLDIRINFO pBuffer, uint32_t *pcFiles);
179DECLVBGL(int) vboxCallFSInfo (PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile, uint32_t flags, uint32_t *pcbBuffer, PSHFLDIRINFO pBuffer);
180
181DECLVBGL(int) vboxCallMapFolder (PVBSFCLIENT pClient, PSHFLSTRING szFolderName, PVBSFMAP pMap);
182DECLVBGL(int) vboxCallUnmapFolder (PVBSFCLIENT pClient, PVBSFMAP pMap);
183DECLVBGL(int) vboxCallSetUtf8 (PVBSFCLIENT pClient);
184
185#endif /* __VBOXCALLS__H */
Note: See TracBrowser for help on using the repository browser.

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