VirtualBox

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

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

VBOXSF: update timestamps when a file handle is closed.

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