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,
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_FlushFileEntry( IN cm_user_t *userp,
150 IN DWORD ResultBufferLength,
151 IN OUT AFSCommResult **ResultCB);
154 RDR_OpenFileEntry( IN cm_user_t *userp,
156 IN AFSFileOpenCB *OpenCB,
159 IN DWORD ResultBufferLength,
160 IN OUT AFSCommResult **ResultCB);
163 RDR_ReleaseFileAccess( IN cm_user_t *userp,
165 IN AFSFileAccessReleaseCB *ReleaseFileCB,
167 IN DWORD ResultBufferLength,
168 IN OUT AFSCommResult **ResultCB);
171 RDR_CleanupFileEntry( IN cm_user_t *userp,
174 IN DWORD FileNameLength,
175 IN AFSFileCleanupCB *CleanupCB,
180 IN DWORD ResultBufferLength,
181 IN OUT AFSCommResult **ResultCB);
184 RDR_RequestFileExtentsAsync( IN cm_user_t *userp,
186 IN AFSRequestExtentsCB *RequestExtentsCB,
188 IN OUT DWORD * ResultBufferLength,
189 IN OUT AFSSetFileExtentsCB **ResultCB);
192 RDR_ReleaseFileExtents( IN cm_user_t *userp,
194 IN AFSReleaseExtentsCB *ReleaseExtentsCB,
196 IN DWORD ResultBufferLength,
197 IN OUT AFSCommResult **ResultCB);
200 RDR_RequestExtentRelease( IN cm_fid_t *fidp,
201 IN LARGE_INTEGER numOfHeldExtents,
202 IN DWORD numOfExtents,
203 IN AFSFileExtentCB *extentList);
206 RDR_ProcessReleaseFileExtentsResult( IN AFSReleaseFileExtentsResultCB *ReleaseFileExtentsResultCB,
207 IN DWORD ResultBufferLength);
210 RDR_ReleaseFailedSetFileExtents( IN cm_user_t *userp,
211 IN AFSSetFileExtentsCB *SetFileExtentsResultCB,
212 IN DWORD ResultBufferLength);
215 RDR_SetFileExtents( IN AFSSetFileExtentsCB *pSetFileExtentsResultCB,
216 IN DWORD dwResultBufferLength);
218 RDR_PioctlOpen( IN cm_user_t *userp,
219 IN AFSFileID ParentId,
220 IN AFSPIOCtlOpenCloseRequestCB *pPioctlCB,
222 IN DWORD ResultBufferLength,
223 IN OUT AFSCommResult **ResultCB);
226 RDR_PioctlClose( IN cm_user_t *userp,
227 IN AFSFileID ParentId,
228 IN AFSPIOCtlOpenCloseRequestCB *pPioctlCB,
230 IN DWORD ResultBufferLength,
231 IN OUT AFSCommResult **ResultCB);
234 RDR_PioctlWrite( IN cm_user_t *userp,
235 IN AFSFileID ParentId,
236 IN AFSPIOCtlIORequestCB *pPioctlCB,
238 IN DWORD ResultBufferLength,
239 IN OUT AFSCommResult **ResultCB);
242 RDR_PioctlRead( IN cm_user_t *userp,
243 IN AFSFileID ParentId,
244 IN AFSPIOCtlIORequestCB *pPioctlCB,
246 IN BOOL bIsLocalSystem,
247 IN DWORD ResultBufferLength,
248 IN OUT AFSCommResult **ResultCB);
251 RDR_ByteRangeLockSync( IN cm_user_t *userp,
253 IN AFSByteRangeLockRequestCB *pBRLRequestCB,
255 IN DWORD ResultBufferLength,
256 IN OUT AFSCommResult **ResultCB);
259 RDR_ByteRangeUnlock( IN cm_user_t *userp,
261 IN AFSByteRangeUnlockRequestCB *pBRURequestCB,
263 IN DWORD ResultBufferLength,
264 IN OUT AFSCommResult **ResultCB);
267 RDR_ByteRangeUnlockAll( IN cm_user_t *userp,
269 IN AFSByteRangeUnlockRequestCB *pBRURequestCB,
271 IN DWORD ResultBufferLength,
272 IN OUT AFSCommResult **ResultCB);
275 RDR_GetVolumeInfo( IN cm_user_t *userp,
278 IN DWORD ResultBufferLength,
279 IN OUT AFSCommResult **ResultCB);
282 RDR_GetVolumeSizeInfo( IN cm_user_t *userp,
285 IN DWORD ResultBufferLength,
286 IN OUT AFSCommResult **ResultCB);
289 RDR_HoldFid( IN cm_user_t *userp,
290 IN AFSHoldFidRequestCB * pHoldFidCB,
292 IN DWORD ResultBufferLength,
293 IN OUT AFSCommResult **ResultCB);
296 RDR_ReleaseFid( IN cm_user_t *userp,
297 IN AFSReleaseFidRequestCB * pReleaseFidCB,
299 IN DWORD ResultBufferLength,
300 IN OUT AFSCommResult **ResultCB);
306 RDR_ShutdownPipe(void);
309 RDR_PipeOpen( IN cm_user_t *userp,
310 IN AFSFileID ParentId,
313 IN AFSPipeOpenCloseRequestCB *pPipeCB,
315 IN DWORD ResultBufferLength,
316 IN OUT AFSCommResult **ResultCB);
319 RDR_PipeClose( IN cm_user_t *userp,
320 IN AFSFileID ParentId,
321 IN AFSPipeOpenCloseRequestCB *pPipeCB,
323 IN DWORD ResultBufferLength,
324 IN OUT AFSCommResult **ResultCB);
327 RDR_PipeWrite( IN cm_user_t *userp,
328 IN AFSFileID ParentId,
329 IN AFSPipeIORequestCB *pPipeCB,
332 IN DWORD ResultBufferLength,
333 IN OUT AFSCommResult **ResultCB);
336 RDR_PipeRead( IN cm_user_t *userp,
337 IN AFSFileID ParentId,
338 IN AFSPipeIORequestCB *pPipeCB,
340 IN DWORD ResultBufferLength,
341 IN OUT AFSCommResult **ResultCB);
344 RDR_PipeSetInfo( IN cm_user_t *userp,
345 IN AFSFileID ParentId,
346 IN AFSPipeInfoRequestCB *pPipeCB,
349 IN DWORD ResultBufferLength,
350 IN OUT AFSCommResult **ResultCB);
353 RDR_PipeQueryInfo( IN cm_user_t *userp,
354 IN AFSFileID ParentId,
355 IN AFSPipeInfoRequestCB *pPipeCB,
357 IN DWORD ResultBufferLength,
358 IN OUT AFSCommResult **ResultCB);
361 RDR_PipeTransceive( IN cm_user_t *userp,
362 IN AFSFileID ParentId,
363 IN AFSPipeIORequestCB *pPipeCB,
366 IN DWORD ResultBufferLength,
367 IN OUT AFSCommResult **ResultCB);
370 RDR_UserFromCommRequest( IN AFSCommRequest * pRequest);
373 RDR_UserFromAuthGroup( IN GUID *pGuid);
376 RDR_ReleaseUser( IN cm_user_t *userp);
379 RDR_fid2FID( IN cm_fid_t *fid,
380 IN AFSFileID *FileId);
383 RDR_FID2fid( IN AFSFileID *FileId,
390 RDR_ShutdownIoctl(void);