2 * Copyright (c) 2008 Secure Endpoints, Inc.
3 * Copyright (c) 2009-2013 Your File System, Inc.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
9 * - Redistributions of source code must retain the above copyright notice,
10 * this list of conditions and the following disclaimer.
11 * - Redistributions in binary form must reproduce the above copyright notice,
12 * this list of conditions and the following disclaimer in the documentation
13 * and/or other materials provided with the distribution.
14 * - Neither the name of Secure Endpoints Inc. nor the names of its contributors
15 * may be used to endorse or promote products derived from this software without
16 * specific prior written permission from Secure Endpoints, Inc. and
17 * Your File System, Inc.
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
23 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 // The following are forward declarations of structures
39 // which are referenced in the RDR code only by pointer.
40 typedef struct cm_user cm_user_t;
41 typedef struct cm_req cm_req_t;
42 typedef struct cm_fid cm_fid_t;
43 typedef struct cm_scache cm_scache_t;
45 // Function Declarations
46 #include <../common/AFSUserPrototypes.h>
49 RDR_InitReq( IN OUT cm_req_t *reqp, BOOL bWow64);
52 RDR_SetInitParams( OUT AFSRedirectorInitInfo **ppRedirInitInfo,
53 OUT DWORD * pRedirInitInfoLen );
57 RDR_RequestWorkerThread( LPVOID lpParameter);
60 RDR_ProcessWorkerThreads( IN DWORD);
63 RDR_ProcessRequest( AFSCommRequest *RequestBuffer);
66 RDR_EnumerateDirectory( IN cm_user_t *userp,
67 IN AFSFileID ParentID,
68 IN AFSDirQueryCB *QueryCB,
71 IN DWORD ResultBufferLength,
72 IN OUT AFSCommResult **ResultCB);
75 RDR_EvaluateNodeByName( IN cm_user_t *userp,
76 IN AFSFileID ParentID,
79 IN BOOL CaseSensitive,
80 IN BOOL LastComponent,
84 IN DWORD ResultBufferLength,
85 IN OUT AFSCommResult **ResultCB);
88 RDR_EvaluateNodeByID( IN cm_user_t *userp,
89 IN AFSFileID ParentID,
90 IN AFSFileID SourceID,
94 IN DWORD ResultBufferLength,
95 IN OUT AFSCommResult **ResultCB);
98 RDR_CreateFileEntry( IN cm_user_t *userp,
100 IN DWORD FileNameLength,
101 IN AFSFileCreateCB *CreateCB,
104 IN DWORD ResultBufferLength,
105 IN OUT AFSCommResult **ResultCB);
108 RDR_UpdateFileEntry( IN cm_user_t *userp,
110 IN AFSFileUpdateCB *UpdateCB,
112 IN DWORD ResultBufferLength,
113 IN OUT AFSCommResult **ResultCB);
116 RDR_DeleteFileEntry( IN cm_user_t *userp,
117 IN AFSFileID ParentId,
118 IN ULONGLONG ProcessId,
120 IN DWORD FileNameLength,
123 IN DWORD ResultBufferLength,
124 IN OUT AFSCommResult **ResultCB);
127 RDR_RenameFileEntry( IN cm_user_t *userp,
128 IN WCHAR *SourceFileName,
129 IN DWORD SourceFileNameLength,
130 IN AFSFileID SourceFileId,
131 IN AFSFileRenameCB *RenameCB,
133 IN DWORD ResultBufferLength,
134 IN OUT AFSCommResult **ResultCB);
137 RDR_HardLinkFileEntry( IN cm_user_t *userp,
138 IN WCHAR *SourceFileName,
139 IN DWORD SourceFileNameLength,
140 IN AFSFileID SourceFileId,
141 IN AFSFileHardLinkCB *HardLinkCB,
143 IN DWORD ResultBufferLength,
144 IN OUT AFSCommResult **ResultCB);
147 RDR_CreateSymlinkEntry( IN cm_user_t *userp,
150 IN DWORD FileNameLength,
151 IN AFSCreateSymlinkCB *SymlinkCB,
153 IN DWORD ResultBufferLength,
154 IN OUT AFSCommResult **ResultCB);
157 RDR_FlushFileEntry( IN cm_user_t *userp,
160 IN DWORD ResultBufferLength,
161 IN OUT AFSCommResult **ResultCB);
164 RDR_OpenFileEntry( IN cm_user_t *userp,
166 IN AFSFileOpenCB *OpenCB,
169 IN DWORD ResultBufferLength,
170 IN OUT AFSCommResult **ResultCB);
173 RDR_ReleaseFileAccess( IN cm_user_t *userp,
175 IN AFSFileAccessReleaseCB *ReleaseFileCB,
177 IN DWORD ResultBufferLength,
178 IN OUT AFSCommResult **ResultCB);
181 RDR_CleanupFileEntry( IN cm_user_t *userp,
184 IN DWORD FileNameLength,
185 IN AFSFileCleanupCB *CleanupCB,
190 IN DWORD ResultBufferLength,
191 IN OUT AFSCommResult **ResultCB);
194 RDR_RequestFileExtentsAsync( IN cm_user_t *userp,
196 IN AFSRequestExtentsCB *RequestExtentsCB,
198 IN OUT DWORD * ResultBufferLength,
199 IN OUT AFSSetFileExtentsCB **ResultCB);
202 RDR_ReleaseFileExtents( IN cm_user_t *userp,
204 IN AFSReleaseExtentsCB *ReleaseExtentsCB,
206 IN DWORD ResultBufferLength,
207 IN OUT AFSCommResult **ResultCB);
210 RDR_RequestExtentRelease( IN cm_fid_t *fidp,
211 IN LARGE_INTEGER numOfHeldExtents,
212 IN DWORD numOfExtents,
213 IN AFSFileExtentCB *extentList);
216 RDR_ProcessReleaseFileExtentsResult( IN AFSReleaseFileExtentsResultCB *ReleaseFileExtentsResultCB,
217 IN DWORD ResultBufferLength);
220 RDR_ReleaseFailedSetFileExtents( IN cm_user_t *userp,
221 IN AFSSetFileExtentsCB *SetFileExtentsResultCB,
222 IN DWORD ResultBufferLength);
225 RDR_SetFileExtents( IN AFSSetFileExtentsCB *pSetFileExtentsResultCB,
226 IN DWORD dwResultBufferLength);
228 RDR_PioctlOpen( IN cm_user_t *userp,
229 IN AFSFileID ParentId,
230 IN AFSPIOCtlOpenCloseRequestCB *pPioctlCB,
232 IN DWORD ResultBufferLength,
233 IN OUT AFSCommResult **ResultCB);
236 RDR_PioctlClose( IN cm_user_t *userp,
237 IN AFSFileID ParentId,
238 IN AFSPIOCtlOpenCloseRequestCB *pPioctlCB,
240 IN DWORD ResultBufferLength,
241 IN OUT AFSCommResult **ResultCB);
244 RDR_PioctlWrite( IN cm_user_t *userp,
245 IN AFSFileID ParentId,
246 IN AFSPIOCtlIORequestCB *pPioctlCB,
248 IN DWORD ResultBufferLength,
249 IN OUT AFSCommResult **ResultCB);
252 RDR_PioctlRead( IN cm_user_t *userp,
253 IN AFSFileID ParentId,
254 IN AFSPIOCtlIORequestCB *pPioctlCB,
256 IN BOOL bIsLocalSystem,
257 IN DWORD ResultBufferLength,
258 IN OUT AFSCommResult **ResultCB);
261 RDR_ByteRangeLockSync( IN cm_user_t *userp,
263 IN AFSByteRangeLockRequestCB *pBRLRequestCB,
265 IN DWORD ResultBufferLength,
266 IN OUT AFSCommResult **ResultCB);
269 RDR_ByteRangeUnlock( IN cm_user_t *userp,
271 IN AFSByteRangeUnlockRequestCB *pBRURequestCB,
273 IN DWORD ResultBufferLength,
274 IN OUT AFSCommResult **ResultCB);
277 RDR_ByteRangeUnlockAll( IN cm_user_t *userp,
279 IN AFSByteRangeUnlockRequestCB *pBRURequestCB,
281 IN DWORD ResultBufferLength,
282 IN OUT AFSCommResult **ResultCB);
285 RDR_GetVolumeInfo( IN cm_user_t *userp,
288 IN DWORD ResultBufferLength,
289 IN OUT AFSCommResult **ResultCB);
292 RDR_GetVolumeSizeInfo( IN cm_user_t *userp,
295 IN DWORD ResultBufferLength,
296 IN OUT AFSCommResult **ResultCB);
299 RDR_HoldFid( IN cm_user_t *userp,
300 IN AFSHoldFidRequestCB * pHoldFidCB,
302 IN DWORD ResultBufferLength,
303 IN OUT AFSCommResult **ResultCB);
306 RDR_ReleaseFid( IN cm_user_t *userp,
307 IN AFSReleaseFidRequestCB * pReleaseFidCB,
309 IN DWORD ResultBufferLength,
310 IN OUT AFSCommResult **ResultCB);
316 RDR_ShutdownPipe(void);
319 RDR_PipeOpen( IN cm_user_t *userp,
320 IN AFSFileID ParentId,
323 IN AFSPipeOpenCloseRequestCB *pPipeCB,
325 IN DWORD ResultBufferLength,
326 IN OUT AFSCommResult **ResultCB);
329 RDR_PipeClose( IN cm_user_t *userp,
330 IN AFSFileID ParentId,
331 IN AFSPipeOpenCloseRequestCB *pPipeCB,
333 IN DWORD ResultBufferLength,
334 IN OUT AFSCommResult **ResultCB);
337 RDR_PipeWrite( IN cm_user_t *userp,
338 IN AFSFileID ParentId,
339 IN AFSPipeIORequestCB *pPipeCB,
342 IN DWORD ResultBufferLength,
343 IN OUT AFSCommResult **ResultCB);
346 RDR_PipeRead( IN cm_user_t *userp,
347 IN AFSFileID ParentId,
348 IN AFSPipeIORequestCB *pPipeCB,
350 IN DWORD ResultBufferLength,
351 IN OUT AFSCommResult **ResultCB);
354 RDR_PipeSetInfo( IN cm_user_t *userp,
355 IN AFSFileID ParentId,
356 IN AFSPipeInfoRequestCB *pPipeCB,
359 IN DWORD ResultBufferLength,
360 IN OUT AFSCommResult **ResultCB);
363 RDR_PipeQueryInfo( IN cm_user_t *userp,
364 IN AFSFileID ParentId,
365 IN AFSPipeInfoRequestCB *pPipeCB,
367 IN DWORD ResultBufferLength,
368 IN OUT AFSCommResult **ResultCB);
371 RDR_PipeTransceive( IN cm_user_t *userp,
372 IN AFSFileID ParentId,
373 IN AFSPipeIORequestCB *pPipeCB,
376 IN DWORD ResultBufferLength,
377 IN OUT AFSCommResult **ResultCB);
380 RDR_ReadFile( IN cm_user_t *userp,
382 IN LARGE_INTEGER *Offset,
386 IN BOOL bCacheBypass,
387 IN DWORD ResultBufferLength,
388 IN OUT AFSCommResult **ResultCB);
391 RDR_WriteFile( IN cm_user_t *userp,
393 IN AFSFileIOCB *FileIOCB,
394 IN LARGE_INTEGER *Offset,
398 IN BOOL bCacheBypass,
399 IN DWORD ResultBufferLength,
400 IN OUT AFSCommResult **ResultCB);
403 RDR_UserFromCommRequest( IN AFSCommRequest * pRequest);
406 RDR_UserFromAuthGroup( IN GUID *pGuid);
409 RDR_ReleaseUser( IN cm_user_t *userp);
412 RDR_fid2FID( IN cm_fid_t *fid,
413 IN AFSFileID *FileId);
416 RDR_FID2fid( IN AFSFileID *FileId,
423 RDR_ShutdownIoctl(void);