VirtualBox

source: vbox/trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR0LibSharedFolders.h@ 39552

Last change on this file since 39552 was 39552, checked in by vboxsync, 13 years ago

Additions/common/VBoxGuestLib/VBoxGuestR0LibSharedFolders: try to fix the Windows build and break Windows guest logging.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.5 KB
Line 
1/** @file
2 * VBoxGuestLib - Central calls header.
3 */
4
5/*
6 * Copyright (C) 2006-2007 Oracle Corporation
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
26#ifndef ___VBoxGuestLib_VBoxGuestR0LibSharedFolders_h
27#define ___VBoxGuestLib_VBoxGuestR0LibSharedFolders_h
28
29#include <VBox/VBoxGuestLib.h>
30#ifndef _NTIFS_
31# ifdef RT_OS_WINDOWS
32# if (_MSC_VER >= 1400) && !defined(VBOX_WITH_PATCHED_DDK)
33# include <iprt/asm.h>
34# define _InterlockedExchange _InterlockedExchange_StupidDDKvsCompilerCrap
35# define _InterlockedExchangeAdd _InterlockedExchangeAdd_StupidDDKvsCompilerCrap
36# define _InterlockedCompareExchange _InterlockedCompareExchange_StupidDDKvsCompilerCrap
37# define _InterlockedAddLargeStatistic _InterlockedAddLargeStatistic_StupidDDKvsCompilerCrap
38# pragma warning(disable : 4163)
39 RT_C_DECLS_BEGIN
40# include <ntddk.h>
41 RT_C_DECLS_END
42# pragma warning(default : 4163)
43# undef _InterlockedExchange
44# undef _InterlockedExchangeAdd
45# undef _InterlockedCompareExchange
46# undef _InterlockedAddLargeStatistic
47# else
48 RT_C_DECLS_BEGIN
49# include <ntddk.h>
50 RT_C_DECLS_END
51# endif
52# endif
53#endif
54
55#if defined(RT_OS_WINDOWS) && 0
56/** @todo remove this legacy and use VBox/log.h and/or iprt/log.h. */
57/* => Done. The next person who needs logging in Windows guests will have the
58 * honour of making it work. */
59# ifdef DEBUG
60# define LOG_ENABLED
61# endif
62# include "VBoxGuestLog.h"
63#endif
64
65#include <iprt/assert.h>
66#define ASSERTVBSF AssertRelease
67
68#include <VBox/shflsvc.h>
69
70typedef struct _VBSFCLIENT
71{
72 uint32_t ulClientID;
73 VBGLHGCMHANDLE handle;
74} VBSFCLIENT;
75typedef VBSFCLIENT *PVBSFCLIENT;
76
77typedef struct _VBSFMAP
78{
79 SHFLROOT root;
80} VBSFMAP, *PVBSFMAP;
81
82
83#define VBSF_DRIVE_LETTER_FIRST L'A'
84#define VBSF_DRIVE_LETTER_LAST L'Z'
85
86#define VBSF_MAX_DRIVES (VBSF_DRIVE_LETTER_LAST - VBSF_DRIVE_LETTER_FIRST)
87
88/* Poller thread flags. */
89#define VBSF_TF_NONE (0x0000)
90#define VBSF_TF_STARTED (0x0001)
91#define VBSF_TF_TERMINATE (0x0002)
92#define VBSF_TF_START_PROCESSING (0x0004)
93
94#define DRIVE_FLAG_WORKING (0x1)
95#define DRIVE_FLAG_LOCKED (0x2)
96#define DRIVE_FLAG_WRITE_PROTECTED (0x4)
97
98#ifdef RT_OS_WINDOWS
99/** Device extension structure for each drive letter we created. */
100typedef struct _VBSFDRIVE
101{
102 /* A pointer to the Driver object we created for the drive. */
103 PDEVICE_OBJECT pDeviceObject;
104
105 /** Root handle to access the drive. */
106 SHFLROOT root;
107
108 /** Informational string - the resource name on host. */
109 WCHAR awcNameHost[256];
110
111 /** Guest drive letter. */
112 WCHAR wcDriveLetter;
113
114 /** DRIVE_FLAG_* */
115 uint32_t u32DriveFlags;
116
117 /** Head of FCB list. */
118 LIST_ENTRY FCBHead;
119
120 /* Synchronise requests directed to the drive. */
121 ERESOURCE DriveResource;
122} VBSFDRIVE;
123typedef VBSFDRIVE *PVBSFDRIVE;
124#endif /* RT_OS_WINDOWS */
125
126/* forward decl */
127struct _MRX_VBOX_DEVICE_EXTENSION;
128typedef struct _MRX_VBOX_DEVICE_EXTENSION *PMRX_VBOX_DEVICE_EXTENSION;
129
130DECLVBGL(int) vboxInit (void);
131DECLVBGL(void) vboxUninit (void);
132DECLVBGL(int) vboxConnect (PVBSFCLIENT pClient);
133DECLVBGL(void) vboxDisconnect (PVBSFCLIENT pClient);
134
135DECLVBGL(int) vboxCallQueryMappings (PVBSFCLIENT pClient, SHFLMAPPING paMappings[], uint32_t *pcMappings);
136
137DECLVBGL(int) vboxCallQueryMapName (PVBSFCLIENT pClient, SHFLROOT root, SHFLSTRING *pString, uint32_t size);
138
139/**
140 * Create a new file or folder or open an existing one in a shared folder. Proxies
141 * to vbsfCreate in the host shared folder service.
142 *
143 * @returns IPRT status code, but see note below
144 * @param pClient Host-guest communication connection
145 * @param pMap The mapping for the shared folder in which the file
146 * or folder is to be created
147 * @param pParsedPath The path of the file or folder relative to the shared
148 * folder
149 * @param pCreateParms Parameters for file/folder creation. See the
150 * structure description in shflsvc.h
151 * @retval pCreateParms See the structure description in shflsvc.h
152 *
153 * @note This function reports errors as follows. The return value is always
154 * VINF_SUCCESS unless an exceptional condition occurs - out of
155 * memory, invalid arguments, etc. If the file or folder could not be
156 * opened or created, pCreateParms->Handle will be set to
157 * SHFL_HANDLE_NIL on return. In this case the value in
158 * pCreateParms->Result provides information as to why (e.g.
159 * SHFL_FILE_EXISTS). pCreateParms->Result is also set on success
160 * as additional information.
161 */
162DECLVBGL(int) vboxCallCreate (PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING pParsedPath, PSHFLCREATEPARMS pCreateParms);
163
164DECLVBGL(int) vboxCallClose (PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE Handle);
165DECLVBGL(int) vboxCallRemove (PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING pParsedPath, uint32_t flags);
166DECLVBGL(int) vboxCallRename (PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING pSrcPath, PSHFLSTRING pDestPath, uint32_t flags);
167DECLVBGL(int) vboxCallFlush (PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile);
168
169DECLVBGL(int) vboxCallRead (PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint32_t *pcbBuffer, uint8_t *pBuffer, bool fLocked);
170DECLVBGL(int) vboxCallWrite (PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint32_t *pcbBuffer, uint8_t *pBuffer, bool fLocked);
171DECLVBGL(int) VbglR0SfWritePhysCont(PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint32_t *pcbBuffer, RTCCPHYS PhysBuffer);
172
173DECLVBGL(int) vboxCallLock (PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint64_t cbSize, uint32_t fLock);
174
175DECLVBGL(int) vboxCallDirInfo (PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile,PSHFLSTRING ParsedPath, uint32_t flags,
176 uint32_t index, uint32_t *pcbBuffer, PSHFLDIRINFO pBuffer, uint32_t *pcFiles);
177DECLVBGL(int) vboxCallFSInfo (PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile, uint32_t flags, uint32_t *pcbBuffer, PSHFLDIRINFO pBuffer);
178
179DECLVBGL(int) vboxCallMapFolder (PVBSFCLIENT pClient, PSHFLSTRING szFolderName, PVBSFMAP pMap);
180DECLVBGL(int) vboxCallUnmapFolder (PVBSFCLIENT pClient, PVBSFMAP pMap);
181DECLVBGL(int) vboxCallSetUtf8 (PVBSFCLIENT pClient);
182
183DECLVBGL(int) vboxReadLink (PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING ParsedPath, uint32_t pcbBuffer, uint8_t *pBuffer);
184DECLVBGL(int) vboxCallSymlink (PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING pNewPath, PSHFLSTRING pOldPath, PSHFLFSOBJINFO pBuffer);
185DECLVBGL(int) vboxCallSetSymlinks (PVBSFCLIENT pClient);
186
187#endif /* !___VBoxGuestLib_VBoxGuestR0LibSharedFolders_h */
188
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