VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/SharedFolders/driver/vbsf.h@ 78280

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

Additions: Use GA_INCLUDED_ and variations_ as header guard prefixes with scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 8.2 KB
Line 
1/* $Id: vbsf.h 76563 2019-01-01 03:53:56Z vboxsync $ */
2/** @file
3 * VirtualBox Windows Guest Shared Folders - File System Driver header file
4 */
5
6/*
7 * Copyright (C) 2012-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 GA_INCLUDED_SRC_WINNT_SharedFolders_driver_vbsf_h
19#define GA_INCLUDED_SRC_WINNT_SharedFolders_driver_vbsf_h
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24/*
25 * This must be defined before including RX headers.
26 */
27#define MINIRDR__NAME VBoxMRx
28#define ___MINIRDR_IMPORTS_NAME (VBoxMRxDeviceObject->RdbssExports)
29
30/*
31 * System and RX headers.
32 */
33#include <iprt/nt/nt.h> /* includes ntifs.h + wdm.h */
34#include <iprt/win/windef.h>
35#ifndef INVALID_HANDLE_VALUE
36# define INVALID_HANDLE_VALUE RTNT_INVALID_HANDLE_VALUE /* (The rx.h definition causes warnings for amd64) */
37#endif
38#include <iprt/nt/rx.h>
39
40/*
41 * VBox shared folders.
42 */
43#include "vbsfhlp.h"
44#include "vbsfshared.h"
45
46extern PRDBSS_DEVICE_OBJECT VBoxMRxDeviceObject;
47
48/*
49 * Maximum drive letters (A - Z).
50 */
51#define _MRX_MAX_DRIVE_LETTERS 26
52
53/*
54 * The shared folders device extension.
55 */
56typedef struct _MRX_VBOX_DEVICE_EXTENSION
57{
58 /* The shared folders device object pointer. */
59 PRDBSS_DEVICE_OBJECT pDeviceObject;
60
61 /*
62 * Keep a list of local connections used.
63 * The size (_MRX_MAX_DRIVE_LETTERS = 26) of the array presents the available drive letters C: - Z: of Windows.
64 */
65 CHAR cLocalConnections[_MRX_MAX_DRIVE_LETTERS];
66 PUNICODE_STRING wszLocalConnectionName[_MRX_MAX_DRIVE_LETTERS];
67 FAST_MUTEX mtxLocalCon;
68
69 /* The HGCM client information. */
70 VBGLSFCLIENT hgcmClient;
71
72 /* Saved pointer to the original IRP_MJ_DEVICE_CONTROL handler. */
73 NTSTATUS (* pfnRDBSSDeviceControl) (PDEVICE_OBJECT pDevObj, PIRP pIrp);
74
75} MRX_VBOX_DEVICE_EXTENSION, *PMRX_VBOX_DEVICE_EXTENSION;
76
77/*
78 * The shared folders NET_ROOT extension.
79 */
80typedef struct _MRX_VBOX_NETROOT_EXTENSION
81{
82 /* The pointert to HGCM client information in device extension. */
83 VBGLSFCLIENT *phgcmClient;
84
85 /* The shared folder map handle of this netroot. */
86 VBGLSFMAP map;
87} MRX_VBOX_NETROOT_EXTENSION, *PMRX_VBOX_NETROOT_EXTENSION;
88
89#define VBOX_FOBX_F_INFO_CREATION_TIME 0x01
90#define VBOX_FOBX_F_INFO_LASTACCESS_TIME 0x02
91#define VBOX_FOBX_F_INFO_LASTWRITE_TIME 0x04
92#define VBOX_FOBX_F_INFO_CHANGE_TIME 0x08
93#define VBOX_FOBX_F_INFO_ATTRIBUTES 0x10
94
95/*
96 * The shared folders file extension.
97 */
98typedef struct _MRX_VBOX_FOBX_
99{
100 SHFLHANDLE hFile;
101 PMRX_SRV_CALL pSrvCall;
102 FILE_BASIC_INFORMATION FileBasicInfo;
103 FILE_STANDARD_INFORMATION FileStandardInfo;
104 BOOLEAN fKeepCreationTime;
105 BOOLEAN fKeepLastAccessTime;
106 BOOLEAN fKeepLastWriteTime;
107 BOOLEAN fKeepChangeTime;
108 BYTE SetFileInfoOnCloseFlags;
109} MRX_VBOX_FOBX, *PMRX_VBOX_FOBX;
110
111#define VBoxMRxGetDeviceExtension(RxContext) \
112 (PMRX_VBOX_DEVICE_EXTENSION)((PBYTE)(RxContext->RxDeviceObject) + sizeof(RDBSS_DEVICE_OBJECT))
113
114#define VBoxMRxGetNetRootExtension(pNetRoot) \
115 (((pNetRoot) == NULL) ? NULL : (PMRX_VBOX_NETROOT_EXTENSION)((pNetRoot)->Context))
116
117#define VBoxMRxGetSrvOpenExtension(pSrvOpen) \
118 (((pSrvOpen) == NULL) ? NULL : (PMRX_VBOX_SRV_OPEN)((pSrvOpen)->Context))
119
120#define VBoxMRxGetFileObjectExtension(pFobx) \
121 (((pFobx) == NULL) ? NULL : (PMRX_VBOX_FOBX)((pFobx)->Context))
122
123/*
124 * Prototypes for the dispatch table routines.
125 */
126NTSTATUS VBoxMRxStart(IN OUT struct _RX_CONTEXT * RxContext,
127 IN OUT PRDBSS_DEVICE_OBJECT RxDeviceObject);
128NTSTATUS VBoxMRxStop(IN OUT struct _RX_CONTEXT * RxContext,
129 IN OUT PRDBSS_DEVICE_OBJECT RxDeviceObject);
130
131NTSTATUS VBoxMRxCreate(IN OUT PRX_CONTEXT RxContext);
132NTSTATUS VBoxMRxCollapseOpen(IN OUT PRX_CONTEXT RxContext);
133NTSTATUS VBoxMRxShouldTryToCollapseThisOpen(IN OUT PRX_CONTEXT RxContext);
134NTSTATUS VBoxMRxFlush(IN OUT PRX_CONTEXT RxContext);
135NTSTATUS VBoxMRxTruncate(IN OUT PRX_CONTEXT RxContext);
136NTSTATUS VBoxMRxCleanupFobx(IN OUT PRX_CONTEXT RxContext);
137NTSTATUS VBoxMRxCloseSrvOpen(IN OUT PRX_CONTEXT RxContext);
138NTSTATUS VBoxMRxDeallocateForFcb(IN OUT PMRX_FCB pFcb);
139NTSTATUS VBoxMRxDeallocateForFobx(IN OUT PMRX_FOBX pFobx);
140NTSTATUS VBoxMRxForceClosed(IN OUT PMRX_SRV_OPEN SrvOpen);
141
142NTSTATUS VBoxMRxQueryDirectory(IN OUT PRX_CONTEXT RxContext);
143NTSTATUS VBoxMRxQueryFileInfo(IN OUT PRX_CONTEXT RxContext);
144NTSTATUS VBoxMRxSetFileInfo(IN OUT PRX_CONTEXT RxContext);
145NTSTATUS VBoxMRxSetFileInfoAtCleanup(IN OUT PRX_CONTEXT RxContext);
146NTSTATUS VBoxMRxQueryEaInfo(IN OUT PRX_CONTEXT RxContext);
147NTSTATUS VBoxMRxSetEaInfo(IN OUT struct _RX_CONTEXT * RxContext);
148NTSTATUS VBoxMRxQuerySdInfo(IN OUT PRX_CONTEXT RxContext);
149NTSTATUS VBoxMRxSetSdInfo(IN OUT struct _RX_CONTEXT * RxContext);
150NTSTATUS VBoxMRxQueryVolumeInfo(IN OUT PRX_CONTEXT RxContext);
151
152NTSTATUS VBoxMRxComputeNewBufferingState(IN OUT PMRX_SRV_OPEN pSrvOpen,
153 IN PVOID pMRxContext,
154 OUT ULONG *pNewBufferingState);
155
156NTSTATUS VBoxMRxRead(IN OUT PRX_CONTEXT RxContext);
157NTSTATUS VBoxMRxWrite(IN OUT PRX_CONTEXT RxContext);
158NTSTATUS VBoxMRxLocks(IN OUT PRX_CONTEXT RxContext);
159NTSTATUS VBoxMRxFsCtl(IN OUT PRX_CONTEXT RxContext);
160NTSTATUS VBoxMRxIoCtl(IN OUT PRX_CONTEXT RxContext);
161NTSTATUS VBoxMRxNotifyChangeDirectory(IN OUT PRX_CONTEXT RxContext);
162
163ULONG NTAPI VBoxMRxExtendStub(IN OUT struct _RX_CONTEXT * RxContext,
164 IN OUT PLARGE_INTEGER pNewFileSize,
165 OUT PLARGE_INTEGER pNewAllocationSize);
166NTSTATUS VBoxMRxCompleteBufferingStateChangeRequest(IN OUT PRX_CONTEXT RxContext,
167 IN OUT PMRX_SRV_OPEN SrvOpen,
168 IN PVOID pContext);
169
170NTSTATUS VBoxMRxCreateVNetRoot(IN OUT PMRX_CREATENETROOT_CONTEXT pContext);
171NTSTATUS VBoxMRxFinalizeVNetRoot(IN OUT PMRX_V_NET_ROOT pVirtualNetRoot,
172 IN PBOOLEAN ForceDisconnect);
173NTSTATUS VBoxMRxFinalizeNetRoot(IN OUT PMRX_NET_ROOT pNetRoot,
174 IN PBOOLEAN ForceDisconnect);
175NTSTATUS VBoxMRxUpdateNetRootState(IN PMRX_NET_ROOT pNetRoot);
176VOID VBoxMRxExtractNetRootName(IN PUNICODE_STRING FilePathName,
177 IN PMRX_SRV_CALL SrvCall,
178 OUT PUNICODE_STRING NetRootName,
179 OUT PUNICODE_STRING RestOfName OPTIONAL);
180
181NTSTATUS VBoxMRxCreateSrvCall(PMRX_SRV_CALL pSrvCall,
182 PMRX_SRVCALL_CALLBACK_CONTEXT pCallbackContext);
183NTSTATUS VBoxMRxSrvCallWinnerNotify(IN OUT PMRX_SRV_CALL pSrvCall,
184 IN BOOLEAN ThisMinirdrIsTheWinner,
185 IN OUT PVOID pSrvCallContext);
186NTSTATUS VBoxMRxFinalizeSrvCall(PMRX_SRV_CALL pSrvCall,
187 BOOLEAN Force);
188
189NTSTATUS VBoxMRxDevFcbXXXControlFile(IN OUT PRX_CONTEXT RxContext);
190
191/*
192 * Support functions.
193 */
194NTSTATUS vbsfDeleteConnection(IN PRX_CONTEXT RxContext,
195 OUT PBOOLEAN PostToFsp);
196NTSTATUS vbsfCreateConnection(IN PRX_CONTEXT RxContext,
197 OUT PBOOLEAN PostToFsp);
198
199NTSTATUS vbsfSetEndOfFile(IN OUT struct _RX_CONTEXT * RxContext,
200 IN OUT PLARGE_INTEGER pNewFileSize,
201 OUT PLARGE_INTEGER pNewAllocationSize);
202NTSTATUS vbsfRename(IN PRX_CONTEXT RxContext,
203 IN FILE_INFORMATION_CLASS FileInformationClass,
204 IN PVOID pBuffer,
205 IN ULONG BufferLength);
206NTSTATUS vbsfRemove(IN PRX_CONTEXT RxContext);
207NTSTATUS vbsfCloseFileHandle(PMRX_VBOX_DEVICE_EXTENSION pDeviceExtension,
208 PMRX_VBOX_NETROOT_EXTENSION pNetRootExtension,
209 PMRX_VBOX_FOBX pVBoxFobx);
210
211#endif /* !GA_INCLUDED_SRC_WINNT_SharedFolders_driver_vbsf_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