VirtualBox

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

Last change on this file since 55401 was 55401, checked in by vboxsync, 10 years ago

added a couple of missing Id headers

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