2 * Copyright (c) 2008 Secure Endpoints, Inc.
3 * Copyright (c) 2009-2011 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,
83 IN DWORD ResultBufferLength,
84 IN OUT AFSCommResult **ResultCB);
87 RDR_EvaluateNodeByID( IN cm_user_t *userp,
88 IN AFSFileID ParentID,
89 IN AFSFileID SourceID,
93 IN DWORD ResultBufferLength,
94 IN OUT AFSCommResult **ResultCB);
97 RDR_CreateFileEntry( IN cm_user_t *userp,
99 IN DWORD FileNameLength,
100 IN AFSFileCreateCB *CreateCB,
103 IN DWORD ResultBufferLength,
104 IN OUT AFSCommResult **ResultCB);
107 RDR_UpdateFileEntry( IN cm_user_t *userp,
109 IN AFSFileUpdateCB *UpdateCB,
111 IN DWORD ResultBufferLength,
112 IN OUT AFSCommResult **ResultCB);
115 RDR_DeleteFileEntry( IN cm_user_t *userp,
116 IN AFSFileID ParentId,
117 IN ULONGLONG ProcessId,
119 IN DWORD FileNameLength,
122 IN DWORD ResultBufferLength,
123 IN OUT AFSCommResult **ResultCB);
126 RDR_RenameFileEntry( IN cm_user_t *userp,
127 IN WCHAR *SourceFileName,
128 IN DWORD SourceFileNameLength,
129 IN AFSFileID SourceFileId,
130 IN AFSFileRenameCB *RenameCB,
132 IN DWORD ResultBufferLength,
133 IN OUT AFSCommResult **ResultCB);
136 RDR_FlushFileEntry( IN cm_user_t *userp,
139 IN DWORD ResultBufferLength,
140 IN OUT AFSCommResult **ResultCB);
143 RDR_OpenFileEntry( IN cm_user_t *userp,
145 IN AFSFileOpenCB *OpenCB,
148 IN DWORD ResultBufferLength,
149 IN OUT AFSCommResult **ResultCB);
152 RDR_ReleaseFileAccess( IN cm_user_t *userp,
154 IN AFSFileAccessReleaseCB *ReleaseFileCB,
156 IN DWORD ResultBufferLength,
157 IN OUT AFSCommResult **ResultCB);
160 RDR_CleanupFileEntry( IN cm_user_t *userp,
163 IN DWORD FileNameLength,
164 IN AFSFileCleanupCB *CleanupCB,
169 IN DWORD ResultBufferLength,
170 IN OUT AFSCommResult **ResultCB);
173 RDR_RequestFileExtentsAsync( IN cm_user_t *userp,
175 IN AFSRequestExtentsCB *RequestExtentsCB,
177 IN OUT DWORD * ResultBufferLength,
178 IN OUT AFSSetFileExtentsCB **ResultCB);
181 RDR_ReleaseFileExtents( IN cm_user_t *userp,
183 IN AFSReleaseExtentsCB *ReleaseExtentsCB,
185 IN DWORD ResultBufferLength,
186 IN OUT AFSCommResult **ResultCB);
189 RDR_RequestExtentRelease( IN cm_fid_t *fidp,
190 IN LARGE_INTEGER numOfHeldExtents,
191 IN DWORD numOfExtents,
192 IN AFSFileExtentCB *extentList);
195 RDR_ProcessReleaseFileExtentsResult( IN AFSReleaseFileExtentsResultCB *ReleaseFileExtentsResultCB,
196 IN DWORD ResultBufferLength);
199 RDR_ReleaseFailedSetFileExtents( IN cm_user_t *userp,
200 IN AFSSetFileExtentsCB *SetFileExtentsResultCB,
201 IN DWORD ResultBufferLength);
204 RDR_SetFileExtents( IN AFSSetFileExtentsCB *pSetFileExtentsResultCB,
205 IN DWORD dwResultBufferLength);
207 RDR_PioctlOpen( IN cm_user_t *userp,
208 IN AFSFileID ParentId,
209 IN AFSPIOCtlOpenCloseRequestCB *pPioctlCB,
211 IN DWORD ResultBufferLength,
212 IN OUT AFSCommResult **ResultCB);
215 RDR_PioctlClose( IN cm_user_t *userp,
216 IN AFSFileID ParentId,
217 IN AFSPIOCtlOpenCloseRequestCB *pPioctlCB,
219 IN DWORD ResultBufferLength,
220 IN OUT AFSCommResult **ResultCB);
223 RDR_PioctlWrite( IN cm_user_t *userp,
224 IN AFSFileID ParentId,
225 IN AFSPIOCtlIORequestCB *pPioctlCB,
227 IN DWORD ResultBufferLength,
228 IN OUT AFSCommResult **ResultCB);
231 RDR_PioctlRead( IN cm_user_t *userp,
232 IN AFSFileID ParentId,
233 IN AFSPIOCtlIORequestCB *pPioctlCB,
235 IN BOOL bIsLocalSystem,
236 IN DWORD ResultBufferLength,
237 IN OUT AFSCommResult **ResultCB);
240 RDR_ByteRangeLockSync( IN cm_user_t *userp,
242 IN AFSByteRangeLockRequestCB *pBRLRequestCB,
244 IN DWORD ResultBufferLength,
245 IN OUT AFSCommResult **ResultCB);
248 RDR_ByteRangeUnlock( IN cm_user_t *userp,
250 IN AFSByteRangeUnlockRequestCB *pBRURequestCB,
252 IN DWORD ResultBufferLength,
253 IN OUT AFSCommResult **ResultCB);
256 RDR_ByteRangeUnlockAll( IN cm_user_t *userp,
258 IN AFSByteRangeUnlockRequestCB *pBRURequestCB,
260 IN DWORD ResultBufferLength,
261 IN OUT AFSCommResult **ResultCB);
264 RDR_GetVolumeInfo( IN cm_user_t *userp,
267 IN DWORD ResultBufferLength,
268 IN OUT AFSCommResult **ResultCB);
271 RDR_GetVolumeSizeInfo( IN cm_user_t *userp,
274 IN DWORD ResultBufferLength,
275 IN OUT AFSCommResult **ResultCB);
278 RDR_HoldFid( IN cm_user_t *userp,
279 IN AFSHoldFidRequestCB * pHoldFidCB,
281 IN DWORD ResultBufferLength,
282 IN OUT AFSCommResult **ResultCB);
285 RDR_ReleaseFid( IN cm_user_t *userp,
286 IN AFSReleaseFidRequestCB * pReleaseFidCB,
288 IN DWORD ResultBufferLength,
289 IN OUT AFSCommResult **ResultCB);
295 RDR_ShutdownPipe(void);
298 RDR_PipeOpen( IN cm_user_t *userp,
299 IN AFSFileID ParentId,
302 IN AFSPipeOpenCloseRequestCB *pPipeCB,
304 IN DWORD ResultBufferLength,
305 IN OUT AFSCommResult **ResultCB);
308 RDR_PipeClose( IN cm_user_t *userp,
309 IN AFSFileID ParentId,
310 IN AFSPipeOpenCloseRequestCB *pPipeCB,
312 IN DWORD ResultBufferLength,
313 IN OUT AFSCommResult **ResultCB);
316 RDR_PipeWrite( IN cm_user_t *userp,
317 IN AFSFileID ParentId,
318 IN AFSPipeIORequestCB *pPipeCB,
321 IN DWORD ResultBufferLength,
322 IN OUT AFSCommResult **ResultCB);
325 RDR_PipeRead( IN cm_user_t *userp,
326 IN AFSFileID ParentId,
327 IN AFSPipeIORequestCB *pPipeCB,
329 IN DWORD ResultBufferLength,
330 IN OUT AFSCommResult **ResultCB);
333 RDR_PipeSetInfo( IN cm_user_t *userp,
334 IN AFSFileID ParentId,
335 IN AFSPipeInfoRequestCB *pPipeCB,
338 IN DWORD ResultBufferLength,
339 IN OUT AFSCommResult **ResultCB);
342 RDR_PipeQueryInfo( IN cm_user_t *userp,
343 IN AFSFileID ParentId,
344 IN AFSPipeInfoRequestCB *pPipeCB,
346 IN DWORD ResultBufferLength,
347 IN OUT AFSCommResult **ResultCB);
350 RDR_PipeTransceive( IN cm_user_t *userp,
351 IN AFSFileID ParentId,
352 IN AFSPipeIORequestCB *pPipeCB,
355 IN DWORD ResultBufferLength,
356 IN OUT AFSCommResult **ResultCB);
359 RDR_UserFromCommRequest( IN AFSCommRequest * pRequest);
362 RDR_UserFromAuthGroup( IN GUID *pGuid);
365 RDR_ReleaseUser( IN cm_user_t *userp);
368 RDR_fid2FID( IN cm_fid_t *fid,
369 IN AFSFileID *FileId);
372 RDR_FID2fid( IN AFSFileID *FileId,
379 RDR_ShutdownIoctl(void);