f85396078fecad6659cf4189da3b63b14a813267
[openafs.git] / src / WINNT / afsrdr / kernel / lib / Include / AFSCommon.h
1 /*
2  * Copyright (c) 2008, 2009, 2010, 2011 Kernel Drivers, LLC.
3  * Copyright (c) 2009, 2010, 2011 Your File System, Inc.
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  *
10  * - Redistributions of source code must retain the above copyright notice,
11  *   this list of conditions and the following disclaimer.
12  * - Redistributions in binary form must reproduce the above copyright
13  *   notice,
14  *   this list of conditions and the following disclaimer in the
15  *   documentation
16  *   and/or other materials provided with the distribution.
17  * - Neither the names of Kernel Drivers, LLC and Your File System, Inc.
18  *   nor the names of their contributors may be used to endorse or promote
19  *   products derived from this software without specific prior written
20  *   permission from Kernel Drivers, LLC and Your File System, Inc.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
24  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
25  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
26  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
27  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
28  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
29  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33  */
34
35 #ifndef _AFS_COMMON_H
36 #define _AFS_COMMON_H
37
38 //
39 // File: AFSCommon.h
40 //
41
42 extern "C"
43 {
44
45 #define AFS_KERNEL_MODE
46
47 #include <ntifs.h>
48 #include <wdmsec.h> // for IoCreateDeviceSecure
49 #include <initguid.h>
50 #include <ntintsafe.h>
51
52 #include "AFSDefines.h"
53
54 #include "AFSUserDefines.h"
55
56 #include "AFSUserIoctl.h"
57
58 #include "AFSUserStructs.h"
59
60 #include "AFSRedirCommonDefines.h"
61
62 #include "AFSRedirCommonStructs.h"
63
64 #include "AFSStructs.h"
65
66 #include "AFSProvider.h"
67
68 #ifndef NO_EXTERN
69 #include "AFSExtern.h"
70 #endif
71
72 #define NTSTRSAFE_LIB
73 #include "ntstrsafe.h"
74
75 NTSTATUS
76 ZwQueryInformationProcess(
77   __in       HANDLE ProcessHandle,
78   __in       PROCESSINFOCLASS ProcessInformationClass,
79   __out      PVOID ProcessInformation,
80   __in       ULONG ProcessInformationLength,
81   __out_opt  PULONG ReturnLength
82 );
83
84 NTSYSAPI
85 NTSTATUS
86 NTAPI
87 RtlAbsoluteToSelfRelativeSD( IN PSECURITY_DESCRIPTOR  AbsoluteSecurityDescriptor,
88                              OUT PSECURITY_DESCRIPTOR  SelfRelativeSecurityDescriptor,
89                              IN OUT PULONG  BufferLength );
90
91 #ifndef FILE_OPEN_REPARSE_POINT
92 #define FILE_OPEN_REPARSE_POINT                 0x00200000
93 #endif
94 //
95 // AFSBTreeSupport.cpp Prototypes
96 //
97
98 NTSTATUS
99 AFSLocateCaseSensitiveDirEntry( IN AFSDirectoryCB *RootNode,
100                                 IN ULONG Index,
101                                 IN OUT AFSDirectoryCB **DirEntry);
102
103 NTSTATUS
104 AFSLocateCaseInsensitiveDirEntry( IN AFSDirectoryCB *RootNode,
105                                   IN ULONG Index,
106                                   IN OUT AFSDirectoryCB **DirEntry);
107
108 NTSTATUS
109 AFSInsertCaseSensitiveDirEntry( IN AFSDirectoryCB *RootNode,
110                                 IN AFSDirectoryCB *DirEntry);
111
112 NTSTATUS
113 AFSInsertCaseInsensitiveDirEntry( IN AFSDirectoryCB *RootNode,
114                                   IN AFSDirectoryCB *DirEntry);
115
116 NTSTATUS
117 AFSRemoveCaseSensitiveDirEntry( IN AFSDirectoryCB **RootNode,
118                                 IN AFSDirectoryCB *DirEntry);
119
120 NTSTATUS
121 AFSRemoveCaseInsensitiveDirEntry( IN AFSDirectoryCB **RootNode,
122                                   IN AFSDirectoryCB *DirEntry);
123
124 NTSTATUS
125 AFSLocateShortNameDirEntry( IN AFSDirectoryCB *RootNode,
126                             IN ULONG Index,
127                             IN OUT AFSDirectoryCB **DirEntry);
128
129 NTSTATUS
130 AFSInsertShortNameDirEntry( IN AFSDirectoryCB *RootNode,
131                             IN AFSDirectoryCB *DirEntry);
132
133 NTSTATUS
134 AFSRemoveShortNameDirEntry( IN AFSDirectoryCB **RootNode,
135                             IN AFSDirectoryCB *DirEntry);
136
137 NTSTATUS
138 AFSLocateHashEntry( IN AFSBTreeEntry *TopNode,
139                     IN ULONGLONG HashIndex,
140                     IN OUT AFSBTreeEntry **TreeEntry);
141
142 NTSTATUS
143 AFSInsertHashEntry( IN AFSBTreeEntry *TopNode,
144                     IN AFSBTreeEntry *FileIDEntry);
145
146 NTSTATUS
147 AFSRemoveHashEntry( IN AFSBTreeEntry **TopNode,
148                     IN AFSBTreeEntry *FileIDEntry);
149
150 //
151 // AFSInit.cpp Prototypes
152 //
153
154 NTSTATUS
155 DriverEntry( IN PDRIVER_OBJECT DriverObj,
156              IN PUNICODE_STRING RegPath);
157
158 void
159 AFSUnload( IN PDRIVER_OBJECT DriverObject);
160
161 //
162 // AFSCommSupport.cpp Prototypes
163 //
164
165 NTSTATUS
166 AFSEnumerateDirectory( IN GUID *AuthGroup,
167                        IN AFSObjectInfoCB *ObjectInfoCB,
168                        IN BOOLEAN   FastQuery);
169
170 NTSTATUS
171 AFSEnumerateDirectoryNoResponse( IN GUID *AuthGroup,
172                                  IN AFSFileID *FileId);
173
174 NTSTATUS
175 AFSVerifyDirectoryContent( IN AFSObjectInfoCB *ObjectInfo,
176                            IN GUID *AuthGroup);
177
178 NTSTATUS
179 AFSNotifyFileCreate( IN GUID            *AuthGroup,
180                      IN AFSObjectInfoCB *ParentObjectInfo,
181                      IN PLARGE_INTEGER FileSize,
182                      IN ULONG FileAttributes,
183                      IN UNICODE_STRING *FileName,
184                      OUT AFSDirectoryCB **DirNode);
185
186 NTSTATUS
187 AFSUpdateFileInformation( IN AFSFileID *ParentFid,
188                           IN AFSObjectInfoCB *ObjectInfo,
189                           IN GUID *AuthGroup);
190
191 NTSTATUS
192 AFSNotifyDelete( IN AFSDirectoryCB *DirectoryCB,
193                  IN GUID           *AuthGroup,
194                  IN BOOLEAN         CheckOnly);
195
196 NTSTATUS
197 AFSNotifyRename( IN AFSObjectInfoCB *ObjectInfo,
198                  IN GUID            *AuthGroup,
199                  IN AFSObjectInfoCB *ParentObjectInfo,
200                  IN AFSObjectInfoCB *TargetParentObjectInfo,
201                  IN AFSDirectoryCB *DirectoryCB,
202                  IN UNICODE_STRING *TargetName,
203                  OUT AFSFileID  *UpdatedFID);
204
205 NTSTATUS
206 AFSNotifyHardLink( IN AFSObjectInfoCB *ObjectInfo,
207                    IN GUID            *AuthGroup,
208                    IN AFSObjectInfoCB *ParentObjectInfo,
209                    IN AFSObjectInfoCB *TargetParentObjectInfo,
210                    IN AFSDirectoryCB  *SourceDirectoryCB,
211                    IN UNICODE_STRING  *TargetName,
212                    IN BOOLEAN          bReplaceIfExists,
213                    OUT AFSDirectoryCB **TargetDirectoryCB);
214
215 NTSTATUS
216 AFSEvaluateTargetByID( IN AFSObjectInfoCB *ObjectInfo,
217                        IN GUID *AuthGroup,
218                        IN BOOLEAN FastCall,
219                        OUT AFSDirEnumEntry **DirEnumEntry);
220
221 NTSTATUS
222 AFSEvaluateTargetByName( IN GUID *AuthGroup,
223                          IN AFSObjectInfoCB *ParentObjectInfo,
224                          IN PUNICODE_STRING SourceName,
225                          IN ULONG Flags,
226                          OUT AFSDirEnumEntry **DirEnumEntry);
227
228 NTSTATUS
229 AFSRetrieveVolumeInformation( IN GUID *AuthGroup,
230                               IN AFSFileID *FileID,
231                               OUT AFSVolumeInfoCB *VolumeInformation);
232
233 NTSTATUS
234 AFSRetrieveVolumeSizeInformation( IN GUID *AuthGroup,
235                                   IN AFSFileID *FileID,
236                                   OUT AFSVolumeSizeInfoCB *VolumeSizeInformation);
237
238 NTSTATUS
239 AFSNotifyPipeTransceive( IN AFSCcb *Ccb,
240                          IN ULONG InputLength,
241                          IN ULONG OutputLength,
242                          IN void *InputDataBuffer,
243                          OUT void *OutputDataBuffer,
244                          OUT ULONG *BytesReturned);
245
246 NTSTATUS
247 AFSNotifySetPipeInfo( IN AFSCcb *Ccb,
248                       IN ULONG InformationClass,
249                       IN ULONG InputLength,
250                       IN void *DataBuffer);
251
252 NTSTATUS
253 AFSNotifyQueryPipeInfo( IN AFSCcb *Ccb,
254                         IN ULONG InformationClass,
255                         IN ULONG OutputLength,
256                         IN void *DataBuffer,
257                         OUT ULONG *BytesReturned);
258
259 NTSTATUS
260 AFSReleaseFid( IN AFSFileID *FileId);
261
262 BOOLEAN
263 AFSIsExtentRequestQueued( IN AFSFileID *FileID,
264                           IN LARGE_INTEGER *ExtentOffset,
265                           IN ULONG Length);
266
267 NTSTATUS
268 AFSCreateSymlink( IN GUID *AuthGroup,
269                   IN AFSObjectInfoCB *ParentObjectInfo,
270                   IN UNICODE_STRING *FileName,
271                   IN AFSObjectInfoCB *ObjectInfo,
272                   IN UNICODE_STRING *TargetName);
273
274 //
275 // AFSCreate.cpp Prototypes
276 //
277
278 NTSTATUS
279 AFSCreate( IN PDEVICE_OBJECT DeviceObject,
280            IN PIRP Irp);
281
282 NTSTATUS
283 AFSCommonCreate( IN PDEVICE_OBJECT DeviceObject,
284                  IN PIRP Irp);
285
286 NTSTATUS
287 AFSOpenRedirector( IN PIRP Irp,
288                    IN AFSFcb **Fcb,
289                    IN AFSCcb **Ccb);
290
291 NTSTATUS
292 AFSOpenAFSRoot( IN PIRP Irp,
293                 IN AFSFcb **Fcb,
294                 IN AFSCcb **Ccb);
295
296 NTSTATUS
297 AFSOpenRoot( IN PIRP Irp,
298              IN AFSVolumeCB *VolumeCB,
299              IN GUID *AuthGroup,
300              OUT AFSFcb **Fcb,
301              OUT AFSCcb **Ccb);
302
303 NTSTATUS
304 AFSProcessCreate( IN PIRP               Irp,
305                   IN GUID              *AuthGroup,
306                   IN AFSVolumeCB       *VolumeCB,
307                   IN AFSDirectoryCB    *ParentDirCB,
308                   IN PUNICODE_STRING    FileName,
309                   IN PUNICODE_STRING    ComponentName,
310                   IN PUNICODE_STRING    FullFileName,
311                   OUT AFSFcb          **Fcb,
312                   OUT AFSCcb          **Ccb);
313
314 NTSTATUS
315 AFSOpenTargetDirectory( IN PIRP Irp,
316                         IN AFSVolumeCB *VolumeCB,
317                         IN AFSDirectoryCB *ParentDirectoryCB,
318                         IN AFSDirectoryCB *TargetDirectoryCB,
319                         IN UNICODE_STRING *TargetName,
320                         OUT AFSFcb **Fcb,
321                         OUT AFSCcb **Ccb);
322
323 NTSTATUS
324 AFSProcessOpen( IN PIRP Irp,
325                 IN GUID *AuthGroup,
326                 IN AFSVolumeCB *VolumeCB,
327                 IN AFSDirectoryCB *ParentDirCB,
328                 IN AFSDirectoryCB *DirectoryCB,
329                 IN BOOLEAN bOpenedReparsePoint,
330                 OUT AFSFcb **Fcb,
331                 OUT AFSCcb **Ccb);
332
333 NTSTATUS
334 AFSProcessOverwriteSupersede( IN PDEVICE_OBJECT DeviceObject,
335                               IN PIRP           Irp,
336                               IN AFSVolumeCB   *VolumeCB,
337                               IN GUID          *AuthGroup,
338                               IN AFSDirectoryCB *ParentDirCB,
339                               IN AFSDirectoryCB *DirectoryCB,
340                               OUT AFSFcb       **Fcb,
341                               OUT AFSCcb       **Ccb);
342
343 NTSTATUS
344 AFSControlDeviceCreate( IN PIRP Irp);
345
346 NTSTATUS
347 AFSOpenIOCtlFcb( IN PIRP Irp,
348                  IN GUID *AuthGroup,
349                  IN AFSDirectoryCB *ParentDirCB,
350                  OUT AFSFcb **Fcb,
351                  OUT AFSCcb **Ccb);
352
353 NTSTATUS
354 AFSOpenSpecialShareFcb( IN PIRP Irp,
355                         IN GUID *AuthGroup,
356                         IN AFSDirectoryCB *DirectoryCB,
357                         OUT AFSFcb **Fcb,
358                         OUT AFSCcb **Ccb);
359
360 //
361 // AFSExtentsSupport.cpp Prototypes
362 //
363 VOID
364 AFSLockForExtentsTrim( IN AFSFcb *Fcb);
365
366 PAFSExtent
367 AFSExtentForOffset( IN AFSFcb *Fcb,
368                     IN PLARGE_INTEGER Offset,
369                     IN BOOLEAN ReturnPrevious);
370 BOOLEAN
371 AFSExtentContains( IN AFSExtent *Extent, IN PLARGE_INTEGER Offset);
372
373
374 NTSTATUS
375 AFSRequestExtents( IN  AFSFcb *Fcb,
376                    IN  AFSCcb *Ccb,
377                    IN  PLARGE_INTEGER Offset,
378                    IN  ULONG Size,
379                    OUT BOOLEAN *FullyMApped);
380
381 BOOLEAN AFSDoExtentsMapRegion(IN AFSFcb *Fcb,
382                               IN PLARGE_INTEGER Offset,
383                               IN ULONG Size,
384                               IN OUT AFSExtent **FirstExtent,
385                               OUT AFSExtent **LastExtent);
386
387 NTSTATUS
388 AFSRequestExtentsAsync( IN AFSFcb *Fcb,
389                         IN AFSCcb *Ccb,
390                         IN PLARGE_INTEGER Offset,
391                         IN ULONG Size);
392
393 NTSTATUS
394 AFSWaitForExtentMapping ( IN AFSFcb *Fcb,
395                           IN AFSCcb *Ccb);
396
397 NTSTATUS
398 AFSProcessSetFileExtents( IN AFSSetFileExtentsCB *SetExtents );
399
400 NTSTATUS
401 AFSProcessReleaseFileExtents( IN PIRP Irp);
402
403 NTSTATUS
404 AFSProcessExtentFailure( PIRP Irp);
405
406 NTSTATUS
407 AFSProcessSetExtents( IN AFSFcb *pFcb,
408                       IN ULONG   Count,
409                       IN AFSFileExtentCB *Result);
410
411 NTSTATUS
412 AFSFlushExtents( IN AFSFcb *pFcb,
413                  IN GUID *AuthGroup);
414
415 NTSTATUS
416 AFSReleaseExtentsWithFlush( IN AFSFcb *Fcb,
417                             IN GUID *AuthGroup,
418                             IN BOOLEAN bReleaseAll);
419
420 NTSTATUS
421 AFSReleaseCleanExtents( IN AFSFcb *Fcb,
422                         IN GUID *AuthGroup);
423
424 VOID
425 AFSMarkDirty( IN AFSFcb *pFcb,
426               IN AFSExtent *StartExtent,
427               IN ULONG ExtentsCount,
428               IN LARGE_INTEGER *StartingByte,
429               IN BOOLEAN DerefExtents);
430
431 VOID
432 AFSTearDownFcbExtents( IN AFSFcb *Fcb,
433                        IN GUID *AuthGroup);
434
435 VOID
436 AFSDeleteFcbExtents( IN AFSFcb *Fcb);
437
438 void
439 AFSTrimExtents( IN AFSFcb *Fcb,
440                 IN PLARGE_INTEGER FileSize);
441
442 void
443 AFSTrimSpecifiedExtents( IN AFSFcb *Fcb,
444                          IN ULONG   Count,
445                          IN AFSFileExtentCB *Result);
446
447 void
448 AFSReferenceActiveExtents( IN AFSExtent *StartExtent,
449                            IN ULONG ExtentsCount);
450
451 void
452 AFSDereferenceActiveExtents( IN AFSExtent *StartExtent,
453                              IN ULONG ExtentsCount);
454
455 void
456 AFSRemoveEntryDirtyList( IN AFSFcb *Fcb,
457                          IN AFSExtent *Extent);
458
459 AFSExtent *
460 ExtentFor( PLIST_ENTRY le, ULONG SkipList );
461
462 AFSExtent *
463 NextExtent( AFSExtent *Extent, ULONG SkipList );
464
465 ULONG
466 AFSConstructCleanByteRangeList( AFSFcb * pFcb,
467                                 AFSByteRange ** pByteRangeList);
468
469 #if GEN_MD5
470 void
471 AFSSetupMD5Hash( IN AFSFcb *Fcb,
472                  IN AFSExtent *StartExtent,
473                  IN ULONG ExtentsCount,
474                  IN void *SystemBuffer,
475                  IN LARGE_INTEGER *ByteOffset,
476                  IN ULONG ByteCount);
477 #endif
478
479 //
480 //
481 // AFSIoSupp.cpp Prototypes
482 //
483 NTSTATUS
484 AFSGetExtents( IN  AFSFcb *pFcb,
485                IN  PLARGE_INTEGER Offset,
486                IN  ULONG Length,
487                IN  AFSExtent *From,
488                OUT ULONG *ExtentCount,
489                OUT ULONG *RunCount);
490
491 NTSTATUS
492 AFSSetupIoRun( IN PDEVICE_OBJECT CacheDevice,
493                IN PIRP           MasterIrp,
494                IN PVOID          SystemBuffer,
495                IN OUT AFSIoRun  *IoRun,
496                IN PLARGE_INTEGER Start,
497                IN ULONG          Length,
498                IN AFSExtent     *From,
499                IN OUT ULONG     *RunCount);
500
501 NTSTATUS
502 AFSStartIos( IN FILE_OBJECT     *CacheFileObject,
503              IN UCHAR            FunctionCode,
504              IN ULONG            IrpFlags,
505              IN AFSIoRun        *IoRun,
506              IN ULONG            Count,
507              IN OUT AFSGatherIo *Gather);
508
509 VOID
510 AFSCompleteIo( IN AFSGatherIo *Gather,
511                IN NTSTATUS Status);
512
513 NTSTATUS
514 AFSProcessExtentRun( IN PVOID          SystemBuffer,
515                      IN PLARGE_INTEGER Start,
516                      IN ULONG          Length,
517                      IN AFSExtent     *From,
518                      IN BOOLEAN        WriteRequest);
519
520 //
521 // AFSClose.cpp Prototypes
522 //
523
524
525 NTSTATUS
526 AFSClose( IN PDEVICE_OBJECT DeviceObject,
527           IN PIRP Irp);
528
529 //
530 // AFSFcbSupport.cpp Prototypes
531 //
532
533 NTSTATUS
534 AFSInitFcb( IN AFSDirectoryCB   *DirEntry);
535
536 NTSTATUS
537 AFSInitRootFcb( IN ULONGLONG ProcessID,
538                 IN AFSVolumeCB *VolumeCB);
539
540 void
541 AFSRemoveRootFcb( IN AFSVolumeCB *VolumeCB);
542
543 NTSTATUS
544 AFSInitCcb( IN OUT AFSCcb **Ccb,
545             IN     AFSDirectoryCB *DirectoryCB,
546             IN     ACCESS_MASK     GrantedAccess,
547             IN     ULONG           FileAccess);
548
549 void
550 AFSRemoveFcb( IN AFSFcb **Fcb);
551
552 void
553 AFSRemoveCcb( IN AFSFcb *Fcb,
554               IN AFSCcb *Ccb);
555
556 NTSTATUS
557 AFSInsertCcb( IN AFSFcb *Fcb,
558               IN AFSCcb *Ccb);
559
560 //
561 // AFSNameSupport.cpp Prototypes
562 //
563
564 NTSTATUS
565 AFSLocateNameEntry( IN GUID *AuthGroup,
566                     IN PFILE_OBJECT FileObject,
567                     IN OUT UNICODE_STRING *RootPathName,
568                     IN UNICODE_STRING *ParsedPathName,
569                     IN AFSNameArrayHdr *NameArray,
570                     IN ULONG Flags,
571                     IN AFSVolumeCB *VolumeCB,
572                     IN AFSDirectoryCB *ParentDirectoryCB,
573                     OUT AFSVolumeCB **OutVolumeCB,
574                     OUT LONG *OutVolumeReferenceReason,
575                     OUT AFSDirectoryCB **OutParentDirectoryCB,
576                     OUT AFSDirectoryCB **OutDirectoryCB,
577                     OUT PUNICODE_STRING ComponentName,
578                     OUT PUNICODE_STRING TargetName);
579
580 NTSTATUS
581 AFSCreateDirEntry( IN GUID            *AuthGroup,
582                    IN AFSObjectInfoCB *ParentObjectInfo,
583                    IN AFSDirectoryCB *ParentDirCB,
584                    IN PUNICODE_STRING FileName,
585                    IN PUNICODE_STRING ComponentName,
586                    IN ULONG Attributes,
587                    IN OUT AFSDirectoryCB **DirEntry);
588
589 void
590 AFSInsertDirectoryNode( IN AFSObjectInfoCB *ParentObjectInfo,
591                         IN AFSDirectoryCB *DirEntry,
592                         IN BOOLEAN InsertInEnumList);
593
594 void
595 AFSDeleteDirEntry( IN AFSObjectInfoCB *ParentObjectInfo,
596                    IN AFSDirectoryCB **ppDirEntry);
597
598 NTSTATUS
599 AFSRemoveDirNodeFromParent( IN AFSObjectInfoCB *ParentObjectInfo,
600                             IN AFSDirectoryCB *DirEntry,
601                             IN BOOLEAN RemoveFromEnumList);
602
603 NTSTATUS
604 AFSFixupTargetName( IN OUT PUNICODE_STRING FileName,
605                     IN OUT PUNICODE_STRING TargetFileName);
606
607 NTSTATUS
608 AFSParseName( IN PIRP Irp,
609               IN GUID *AuthGroup,
610               OUT PUNICODE_STRING FileName,
611               OUT PUNICODE_STRING ParsedFileName,
612               OUT PUNICODE_STRING RootFileName,
613               OUT ULONG *ParseFlags,
614               OUT AFSVolumeCB **VolumeCB,
615               OUT AFSDirectoryCB **ParentDirectoryCB,
616               OUT AFSNameArrayHdr **NameArray);
617
618 NTSTATUS
619 AFSCheckCellName( IN GUID *AuthGroup,
620                   IN UNICODE_STRING *CellName,
621                   OUT AFSDirectoryCB **ShareDirEntry);
622
623 NTSTATUS
624 AFSBuildMountPointTarget( IN GUID *AuthGroup,
625                           IN AFSDirectoryCB *DirectoryCB,
626                           OUT AFSVolumeCB **VolumeCB);
627
628 NTSTATUS
629 AFSBuildRootVolume( IN GUID *AuthGroup,
630                     IN AFSFileID *FileId,
631                     OUT AFSVolumeCB **TargetVolumeCB);
632
633 NTSTATUS
634 AFSProcessDFSLink( IN AFSDirectoryCB *DirEntry,
635                    IN PFILE_OBJECT FileObject,
636                    IN PUNICODE_STRING RemainingPath,
637                    IN GUID *AuthGroup,
638                    OUT PUNICODE_STRING TargetName);
639
640 //
641 // AFSNetworkProviderSupport.cpp
642 //
643
644 NTSTATUS
645 AFSAddConnection( IN AFSNetworkProviderConnectionCB *ConnectCB,
646                   IN OUT PULONG ResultStatus,
647                   IN OUT ULONG_PTR *ReturnOutputBufferLength);
648
649 NTSTATUS
650 AFSCancelConnection( IN AFSNetworkProviderConnectionCB *ConnectCB,
651                      IN OUT AFSCancelConnectionResultCB *ConnectionResult,
652                      IN OUT ULONG_PTR *ReturnOutputBufferLength);
653
654 NTSTATUS
655 AFSGetConnection( IN AFSNetworkProviderConnectionCB *ConnectCB,
656                   IN OUT WCHAR *RemoteName,
657                   IN ULONG RemoteNameBufferLength,
658                   IN OUT ULONG_PTR *ReturnOutputBufferLength);
659
660 NTSTATUS
661 AFSListConnections( IN OUT AFSNetworkProviderConnectionCB *ConnectCB,
662                     IN ULONG ConnectionBufferLength,
663                     IN OUT ULONG_PTR *ReturnOutputBufferLength);
664
665 void
666 AFSInitializeConnectionInfo( IN AFSProviderConnectionCB *Connection,
667                              IN ULONG DisplayType);
668
669 AFSProviderConnectionCB *
670 AFSLocateEnumRootEntry( IN UNICODE_STRING *RemoteName);
671
672 NTSTATUS
673 AFSEnumerateConnection( IN OUT AFSNetworkProviderConnectionCB *ConnectCB,
674                         IN AFSProviderConnectionCB *RootConnection,
675                         IN ULONG BufferLength,
676                         OUT PULONG CopiedLength);
677
678 NTSTATUS
679 AFSGetConnectionInfo( IN AFSNetworkProviderConnectionCB *ConnectCB,
680                       IN ULONG BufferLength,
681                       IN OUT ULONG_PTR *ReturnOutputBufferLength);
682
683 BOOLEAN
684 AFSIsDriveMapped( IN WCHAR DriveMapping);
685
686 //
687 // AFSRead.cpp Prototypes
688 //
689
690 NTSTATUS
691 AFSCommonRead( IN PDEVICE_OBJECT DeviceObject,
692                IN PIRP Irp,
693                IN HANDLE OnBehalfOf);
694
695 NTSTATUS
696 AFSRead( IN PDEVICE_OBJECT DeviceObject,
697          IN PIRP Irp);
698
699
700 NTSTATUS
701 AFSIOCtlRead( IN PDEVICE_OBJECT DeviceObject,
702               IN PIRP Irp);
703
704 NTSTATUS
705 AFSShareRead( IN PDEVICE_OBJECT DeviceObject,
706               IN PIRP Irp);
707
708 //
709 // AFSWrite.cpp Prototypes
710 //
711
712 NTSTATUS
713 AFSCommonWrite( IN PDEVICE_OBJECT DeviceObject,
714                 IN PIRP Irp,
715                 IN HANDLE CallingUser,
716                 IN BOOLEAN bRetry);
717
718 NTSTATUS
719 AFSWrite( IN PDEVICE_OBJECT DeviceObject,
720                 IN PIRP Irp);
721
722 NTSTATUS
723 AFSIOCtlWrite( IN PDEVICE_OBJECT DeviceObject,
724                IN PIRP Irp);
725
726 NTSTATUS
727 AFSShareWrite( IN PDEVICE_OBJECT DeviceObject,
728                IN PIRP Irp);
729
730 NTSTATUS
731 AFSDeferWrite( IN PDEVICE_OBJECT DeviceObject,
732                IN PFILE_OBJECT FileObject,
733                IN HANDLE CallingUser,
734                IN PIRP Irp,
735                IN ULONG BytesToWrite,
736                IN BOOLEAN Retrying);
737
738 //
739 // AFSFileInfo.cpp Prototypes
740 //
741
742 NTSTATUS
743 AFSQueryFileInfo( IN PDEVICE_OBJECT DeviceObject,
744                   IN PIRP Irp);
745
746 NTSTATUS
747 AFSQueryBasicInfo( IN PIRP Irp,
748                    IN AFSDirectoryCB *DirectoryCB,
749                    IN OUT PFILE_BASIC_INFORMATION Buffer,
750                    IN OUT PLONG Length);
751
752 NTSTATUS
753 AFSQueryStandardInfo( IN PIRP Irp,
754                       IN AFSDirectoryCB *DirectoryCB,
755                       IN OUT PFILE_STANDARD_INFORMATION Buffer,
756                       IN OUT PLONG Length);
757
758 NTSTATUS
759 AFSQueryInternalInfo( IN PIRP Irp,
760                       IN AFSFcb *Fcb,
761                       IN OUT PFILE_INTERNAL_INFORMATION Buffer,
762                       IN OUT PLONG Length);
763
764 NTSTATUS
765 AFSQueryEaInfo( IN PIRP Irp,
766                 IN AFSDirectoryCB *DirectoryCB,
767                 IN OUT PFILE_EA_INFORMATION Buffer,
768                 IN OUT PLONG Length);
769
770 NTSTATUS
771 AFSQueryPositionInfo( IN PIRP Irp,
772                       IN AFSFcb *Fcb,
773                       IN OUT PFILE_POSITION_INFORMATION Buffer,
774                       IN OUT PLONG Length);
775
776 NTSTATUS
777 AFSQueryNameInfo( IN PIRP Irp,
778                   IN AFSDirectoryCB *DirectoryCB,
779                   IN OUT PFILE_NAME_INFORMATION Buffer,
780                   IN OUT PLONG Length);
781
782 NTSTATUS
783 AFSQueryShortNameInfo( IN PIRP Irp,
784                        IN AFSDirectoryCB *DirectoryCB,
785                        IN OUT PFILE_NAME_INFORMATION Buffer,
786                        IN OUT PLONG Length);
787
788 NTSTATUS
789 AFSQueryNetworkInfo( IN PIRP Irp,
790                      IN AFSDirectoryCB *DirectoryCB,
791                      IN OUT PFILE_NETWORK_OPEN_INFORMATION Buffer,
792                      IN OUT PLONG Length);
793
794 NTSTATUS
795 AFSQueryStreamInfo( IN PIRP Irp,
796                     IN AFSDirectoryCB *DirectoryCB,
797                     IN OUT FILE_STREAM_INFORMATION *Buffer,
798                     IN OUT PLONG Length);
799
800 NTSTATUS
801 AFSQueryAccess( IN PIRP Irp,
802                 IN AFSFcb *Fcb,
803                 IN OUT PFILE_ACCESS_INFORMATION Buffer,
804                 IN OUT PLONG Length);
805
806 NTSTATUS
807 AFSQueryMode( IN PIRP Irp,
808               IN AFSFcb *Fcb,
809               IN OUT PFILE_MODE_INFORMATION Buffer,
810               IN OUT PLONG Length);
811
812 NTSTATUS
813 AFSQueryAlignment( IN PIRP Irp,
814                    IN AFSFcb *Fcb,
815                    IN OUT PFILE_ALIGNMENT_INFORMATION Buffer,
816                    IN OUT PLONG Length);
817
818 NTSTATUS
819 AFSQueryAttribTagInfo( IN PIRP Irp,
820                        IN AFSDirectoryCB *DirectoryCB,
821                        IN OUT FILE_ATTRIBUTE_TAG_INFORMATION *Buffer,
822                        IN OUT PLONG Length);
823
824 NTSTATUS
825 AFSQueryRemoteProtocolInfo( IN PIRP Irp,
826                             IN AFSDirectoryCB *DirectoryCB,
827                             IN OUT FILE_REMOTE_PROTOCOL_INFORMATION *Buffer,
828                             IN OUT PLONG Length);
829
830 NTSTATUS
831 AFSQueryPhysicalNameInfo( IN PIRP Irp,
832                           IN AFSDirectoryCB *DirectoryCB,
833                           IN OUT PFILE_NETWORK_PHYSICAL_NAME_INFORMATION Buffer,
834                           IN OUT PLONG Length);
835
836 NTSTATUS
837 AFSSetFileInfo( IN PDEVICE_OBJECT DeviceObject,
838                 IN PIRP Irp);
839
840 NTSTATUS
841 AFSSetBasicInfo( IN PIRP Irp,
842                  IN AFSDirectoryCB *DirectoryCB,
843                  OUT BOOLEAN *bUpdateFileInfo);
844
845 NTSTATUS
846 AFSSetDispositionInfo( IN PIRP Irp,
847                        IN AFSDirectoryCB *DirectoryCB);
848
849 NTSTATUS
850 AFSSetRenameInfo( IN PIRP Irp);
851
852 NTSTATUS
853 AFSSetFileLinkInfo( IN PIRP Irp);
854
855 NTSTATUS
856 AFSSetPositionInfo( IN PIRP Irp,
857                     IN AFSDirectoryCB *DirectoryCB);
858
859 NTSTATUS
860 AFSSetAllocationInfo( IN PIRP Irp,
861                       IN AFSDirectoryCB *DirectoryCB);
862
863 NTSTATUS
864 AFSSetEndOfFileInfo( IN PIRP Irp,
865                      IN AFSDirectoryCB *DirectoryCB);
866
867 NTSTATUS
868 AFSProcessShareSetInfo( IN IRP *Irp,
869                         IN AFSFcb *Fcb,
870                         IN AFSCcb *Ccb);
871
872 NTSTATUS
873 AFSProcessShareQueryInfo( IN IRP *Irp,
874                           IN AFSFcb *Fcb,
875                           IN AFSCcb *Ccb);
876
877 NTSTATUS
878 AFSProcessPIOCtlQueryInfo( IN IRP *Irp,
879                            IN AFSFcb *Fcb,
880                            IN AFSCcb *Ccb,
881                            IN OUT LONG *Length);
882
883 //
884 // AFSEa.cpp Prototypes
885 //
886
887 NTSTATUS
888 AFSQueryEA( IN PDEVICE_OBJECT DeviceObject,
889             IN PIRP Irp);
890
891 NTSTATUS
892 AFSSetEA( IN PDEVICE_OBJECT DeviceObject,
893           IN PIRP Irp);
894
895 //
896 // AFSFlushBuffers.cpp Prototypes
897 //
898
899 NTSTATUS
900 AFSFlushBuffers( IN PDEVICE_OBJECT DeviceObject,
901                  IN PIRP Irp);
902
903 //
904 // AFSVolume.cpp Prototypes
905 //
906
907 NTSTATUS
908 AFSInitVolume( IN GUID *AuthGroup,
909                IN AFSFileID *RootFid,
910                IN LONG VolumeReferenceReason,
911                OUT AFSVolumeCB **VolumeCB);
912
913 NTSTATUS
914 AFSRemoveVolume( IN AFSVolumeCB *VolumeCB);
915
916 LONG
917 AFSVolumeIncrement( IN AFSVolumeCB *VolumeCB,
918                     IN LONG         Reason);
919
920 LONG
921 AFSVolumeDecrement( IN AFSVolumeCB *VolumeCB,
922                     IN LONG         Reason);
923
924 //
925 // AFSVolumeInfo.cpp Prototypes
926 //
927
928 NTSTATUS
929 AFSQueryVolumeInfo( IN PDEVICE_OBJECT DeviceObject,
930                     IN PIRP Irp);
931
932 NTSTATUS
933 AFSSetVolumeInfo( IN PDEVICE_OBJECT DeviceObject,
934                   IN PIRP Irp);
935
936 NTSTATUS
937 AFSQueryFsVolumeInfo( IN AFSVolumeInfoCB *VolumeInfo,
938                       IN PFILE_FS_VOLUME_INFORMATION Buffer,
939                       IN BOOLEAN bDosDevice,
940                       IN OUT PULONG Length);
941
942 NTSTATUS
943 AFSQueryFsSizeInfo( IN AFSVolumeInfoCB *VolumeInfo,
944                     IN PFILE_FS_SIZE_INFORMATION Buffer,
945                     IN OUT PULONG Length);
946
947 NTSTATUS
948 AFSQueryFsDeviceInfo( IN AFSVolumeInfoCB *VolumeInfo,
949                       IN PFILE_FS_DEVICE_INFORMATION Buffer,
950                       IN OUT PULONG Length);
951
952 NTSTATUS
953 AFSQueryFsAttributeInfo( IN AFSVolumeInfoCB *VolumeInfo,
954                          IN PFILE_FS_ATTRIBUTE_INFORMATION Buffer,
955                          IN OUT PULONG Length);
956
957 NTSTATUS
958 AFSQueryFsFullSizeInfo( IN AFSVolumeInfoCB *VolumeInfo,
959                         IN PFILE_FS_FULL_SIZE_INFORMATION Buffer,
960                         IN OUT PULONG Length);
961
962 //
963 // AFSDirControl.cpp Prototypes
964 //
965
966 NTSTATUS
967 AFSDirControl( IN PDEVICE_OBJECT DeviceObject,
968                IN PIRP Irp);
969
970 NTSTATUS
971 AFSQueryDirectory( IN PIRP Irp);
972
973 NTSTATUS
974 AFSNotifyChangeDirectory( IN PIRP Irp);
975
976 AFSDirectoryCB *
977 AFSLocateNextDirEntry( IN AFSObjectInfoCB *ObjectInfo,
978                        IN AFSCcb *Ccb);
979
980 AFSDirectoryCB *
981 AFSLocateDirEntryByIndex( IN AFSObjectInfoCB *ObjectInfo,
982                           IN AFSCcb *Ccb,
983                           IN ULONG DirIndex);
984
985 NTSTATUS
986 AFSSnapshotDirectory( IN AFSFcb *Fcb,
987                       IN AFSCcb *Ccb,
988                       IN BOOLEAN ResetIndex);
989
990 NTSTATUS
991 AFSFsRtlNotifyFullChangeDirectory( IN AFSObjectInfoCB *ObjectInfo,
992                                    IN AFSCcb *Context,
993                                    IN BOOLEAN WatchTree,
994                                    IN ULONG CompletionFilter,
995                                    IN PIRP NotifyIrp);
996
997 void
998 AFSFsRtlNotifyFullReportChange( IN AFSObjectInfoCB *ObjectInfo,
999                                 IN AFSCcb *Ccb,
1000                                 IN ULONG NotifyFilter,
1001                                 IN ULONG NotificationAction);
1002
1003 BOOLEAN
1004 AFSNotifyReportChangeCallback( IN void *NotifyContext,
1005                                IN void *FilterContext);
1006
1007 BOOLEAN
1008 AFSIsNameInSnapshot( IN AFSSnapshotHdr *SnapshotHdr,
1009                      IN ULONG HashIndex);
1010
1011 NTSTATUS
1012 AFSProcessDirectoryQueryDirect( IN AFSFcb *Fcb,
1013                                 IN AFSCcb *Ccb,
1014                                 IN IRP *Irp);
1015
1016 //
1017 // AFSFSControl.cpp Prototypes
1018 //
1019
1020 NTSTATUS
1021 AFSFSControl( IN PDEVICE_OBJECT DeviceObject,
1022               IN PIRP Irp);
1023
1024 NTSTATUS
1025 AFSProcessUserFsRequest( IN PIRP Irp);
1026
1027 NTSTATUS
1028 AFSProcessShareFsCtrl( IN IRP *Irp,
1029                        IN AFSFcb *Fcb,
1030                        IN AFSCcb *Ccb);
1031
1032 //
1033 // AFSDevControl.cpp Prototypes
1034 //
1035
1036 NTSTATUS
1037 AFSDevControl( IN PDEVICE_OBJECT DeviceObject,
1038                IN PIRP Irp);
1039
1040 //
1041 // AFSInternalDevControl.cpp Prototypes
1042 //
1043
1044 NTSTATUS
1045 AFSInternalDevControl( IN PDEVICE_OBJECT DeviceObject,
1046                        IN PIRP Irp);
1047
1048 //
1049 // AFSShutdown.cpp Prototypes
1050 //
1051
1052 NTSTATUS
1053 AFSShutdown( IN PDEVICE_OBJECT DeviceObject,
1054              IN PIRP Irp);
1055
1056
1057 NTSTATUS
1058 AFSShutdownFilesystem( void);
1059
1060 //
1061 // AFSLockControl.cpp Prototypes
1062 //
1063
1064 NTSTATUS
1065 AFSLockControl( IN PDEVICE_OBJECT DeviceObject,
1066                 IN PIRP Irp);
1067
1068 //
1069 // AFSCleanup.cpp Prototypes
1070 //
1071
1072 NTSTATUS
1073 AFSCleanup( IN PDEVICE_OBJECT DeviceObject,
1074             IN PIRP Irp);
1075
1076 //
1077 // AFSSecurity.cpp Prototypes
1078 //
1079
1080 NTSTATUS
1081 AFSQuerySecurity( IN PDEVICE_OBJECT DeviceObject,
1082                   IN PIRP Irp);
1083
1084 NTSTATUS
1085 AFSSetSecurity( IN PDEVICE_OBJECT DeviceObject,
1086                 IN PIRP Irp);
1087
1088 //
1089 // AFSSystemControl.cpp Prototypes
1090 //
1091
1092 NTSTATUS
1093 AFSSystemControl( IN PDEVICE_OBJECT DeviceObject,
1094                   IN PIRP Irp);
1095
1096 //
1097 // AFSQuota.cpp Prototypes
1098 //
1099
1100 NTSTATUS
1101 AFSQueryQuota( IN PDEVICE_OBJECT DeviceObject,
1102                IN PIRP Irp);
1103
1104 NTSTATUS
1105 AFSSetQuota( IN PDEVICE_OBJECT DeviceObject,
1106              IN PIRP Irp);
1107
1108 //
1109 // AFSGeneric.cpp Prototypes
1110 //
1111
1112 ULONG
1113 AFSExceptionFilter( IN CHAR *FunctionString,
1114                     IN ULONG Code,
1115                     IN PEXCEPTION_POINTERS ExceptPtrs);
1116
1117 BOOLEAN
1118 AFSAcquireExcl( IN PERESOURCE Resource,
1119                 IN BOOLEAN wait);
1120
1121 BOOLEAN
1122 AFSAcquireSharedStarveExclusive( IN PERESOURCE Resource,
1123                                  IN BOOLEAN Wait);
1124
1125 BOOLEAN
1126 AFSAcquireShared( IN PERESOURCE Resource,
1127                   IN BOOLEAN wait);
1128
1129 void
1130 AFSReleaseResource( IN PERESOURCE Resource);
1131
1132 void
1133 AFSConvertToShared( IN PERESOURCE Resource);
1134
1135 void
1136 AFSCompleteRequest( IN PIRP Irp,
1137                     IN ULONG Status);
1138
1139 ULONG
1140 AFSGenerateCRC( IN PUNICODE_STRING FileName,
1141                 IN BOOLEAN UpperCaseName);
1142
1143 void *
1144 AFSLockSystemBuffer( IN PIRP Irp,
1145                      IN ULONG Length);
1146
1147 void *
1148 AFSLockUserBuffer( IN void *UserBuffer,
1149                    IN ULONG BufferLength,
1150                    OUT MDL ** Mdl);
1151
1152 void *
1153 AFSMapToService( IN PIRP Irp,
1154                  IN ULONG ByteCount);
1155
1156 NTSTATUS
1157 AFSUnmapServiceMappedBuffer( IN void *MappedBuffer,
1158                              IN PMDL Mdl);
1159
1160 NTSTATUS
1161 AFSInitializeLibraryDevice( void);
1162
1163 NTSTATUS
1164 AFSRemoveLibraryDevice( void);
1165
1166 NTSTATUS
1167 AFSDefaultDispatch( IN PDEVICE_OBJECT DeviceObject,
1168                     IN PIRP Irp);
1169
1170 NTSTATUS
1171 AFSInitializeGlobalDirectoryEntries( void);
1172
1173 AFSDirectoryCB *
1174 AFSInitDirEntry( IN AFSObjectInfoCB *ParentObjectInfo,
1175                  IN PUNICODE_STRING FileName,
1176                  IN PUNICODE_STRING TargetName,
1177                  IN AFSDirEnumEntry *DirEnumEntry,
1178                  IN ULONG FileIndex);
1179
1180 BOOLEAN
1181 AFSCheckForReadOnlyAccess( IN ACCESS_MASK DesiredAccess,
1182                            IN BOOLEAN DirectoryEntry);
1183
1184 NTSTATUS
1185 AFSEvaluateNode( IN GUID *AuthGroup,
1186                  IN AFSDirectoryCB *DirEntry);
1187
1188 NTSTATUS
1189 AFSValidateSymLink( IN GUID *AuthGroup,
1190                     IN AFSDirectoryCB *DirEntry);
1191
1192 NTSTATUS
1193 AFSInvalidateCache( IN AFSInvalidateCacheCB *InvalidateCB);
1194
1195 NTSTATUS
1196 AFSInvalidateObject( IN OUT AFSObjectInfoCB **ppObjectInfo,
1197                      IN     ULONG Reason);
1198
1199 BOOLEAN
1200 AFSIsChildOfParent( IN AFSFcb *Dcb,
1201                     IN AFSFcb *Fcb);
1202
1203 inline
1204 ULONGLONG
1205 AFSCreateHighIndex( IN AFSFileID *FileID);
1206
1207 inline
1208 ULONGLONG
1209 AFSCreateLowIndex( IN AFSFileID *FileID);
1210
1211 BOOLEAN
1212 AFSCheckAccess( IN ACCESS_MASK DesiredAccess,
1213                 IN ACCESS_MASK GrantedAccess,
1214                 IN BOOLEAN DirectoryEntry);
1215
1216 NTSTATUS
1217 AFSGetDriverStatus( IN AFSDriverStatusRespCB *DriverStatus);
1218
1219 NTSTATUS
1220 AFSSubstituteSysName( IN UNICODE_STRING *ComponentName,
1221                       IN UNICODE_STRING *SubstituteName,
1222                       IN ULONG StringIndex);
1223
1224 NTSTATUS
1225 AFSSubstituteNameInPath( IN OUT UNICODE_STRING *FullPathName,
1226                          IN OUT UNICODE_STRING *ComponentName,
1227                          IN UNICODE_STRING *SubstituteName,
1228                          IN OUT UNICODE_STRING *RemainingPath,
1229                          IN BOOLEAN FreePathName);
1230
1231 NTSTATUS
1232 AFSInvalidateVolume( IN AFSVolumeCB *VolumeCB,
1233                      IN ULONG Reason);
1234
1235 VOID
1236 AFSInvalidateAllVolumes( VOID);
1237
1238 NTSTATUS
1239 AFSVerifyEntry( IN GUID *AuthGroup,
1240                 IN AFSDirectoryCB *DirectoryCB,
1241                 IN BOOLEAN bFollowMountPoint);
1242
1243 NTSTATUS
1244 AFSSetVolumeState( IN AFSVolumeStatusCB *VolumeStatus);
1245
1246 NTSTATUS
1247 AFSSetNetworkState( IN AFSNetworkStatusCB *NetworkStatus);
1248
1249 NTSTATUS
1250 AFSValidateDirectoryCache( IN AFSObjectInfoCB *ObjectInfo,
1251                            IN GUID *AuthGroup);
1252
1253 BOOLEAN
1254 AFSIsVolumeFID( IN AFSFileID *FileID);
1255
1256 BOOLEAN
1257 AFSIsFinalNode( IN AFSFcb *Fcb);
1258
1259 NTSTATUS
1260 AFSUpdateMetaData( IN AFSDirectoryCB *DirEntry,
1261                    IN AFSDirEnumEntry *DirEnumEntry);
1262
1263 NTSTATUS
1264 AFSValidateEntry( IN AFSDirectoryCB *DirEntry,
1265                   IN GUID *AuthGroup,
1266                   IN BOOLEAN FastCall,
1267                   IN BOOLEAN SafeToPurge);
1268
1269 AFSDirectoryCB *
1270 AFSGetSpecialShareNameEntry( IN UNICODE_STRING *ShareName,
1271                              IN UNICODE_STRING *SecondaryName);
1272
1273 NTSTATUS
1274 AFSInitializeSpecialShareNameList( void);
1275
1276 void
1277 AFSWaitOnQueuedFlushes( IN AFSFcb *Fcb);
1278
1279 void
1280 AFSWaitOnQueuedReleases( void);
1281
1282 BOOLEAN
1283 AFSIsEqualFID( IN AFSFileID *FileId1,
1284                IN AFSFileID *FileId2);
1285
1286 NTSTATUS
1287 AFSResetDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB);
1288
1289 NTSTATUS
1290 AFSEnumerateGlobalRoot( IN GUID *AuthGroup);
1291
1292 BOOLEAN
1293 AFSIsRelativeName( IN UNICODE_STRING *Name);
1294
1295 BOOLEAN
1296 AFSIsAbsoluteAFSName( IN UNICODE_STRING *Name);
1297
1298 void
1299 AFSUpdateName( IN UNICODE_STRING *Name);
1300
1301 NTSTATUS
1302 AFSUpdateTargetName( IN OUT UNICODE_STRING *TargetName,
1303                      IN OUT ULONG *Flags,
1304                      IN WCHAR *NameBuffer,
1305                      IN USHORT NameLength);
1306
1307 void
1308 AFSSetEnumerationEvent( IN AFSFcb *Fcb);
1309
1310 void
1311 AFSClearEnumerationEvent( IN AFSFcb *Fcb);
1312
1313 BOOLEAN
1314 AFSIsEnumerationInProcess( IN AFSObjectInfoCB *ObjectInfo);
1315
1316 NTSTATUS
1317 AFSVerifyVolume( IN ULONGLONG ProcessId,
1318                  IN AFSVolumeCB *VolumeCB);
1319
1320 NTSTATUS
1321 AFSInitPIOCtlDirectoryCB( IN AFSObjectInfoCB *ObjectInfo);
1322
1323 NTSTATUS
1324 AFSRetrieveFileAttributes( IN AFSDirectoryCB *ParentDirectoryCB,
1325                            IN AFSDirectoryCB *DirectoryCB,
1326                            IN UNICODE_STRING *ParentPathName,
1327                            IN AFSNameArrayHdr *RelatedNameArray,
1328                            IN GUID           *AuthGroup,
1329                            OUT AFSFileInfoCB *FileInfo);
1330
1331 AFSObjectInfoCB *
1332 AFSAllocateObjectInfo( IN AFSObjectInfoCB *ParentObjectInfo,
1333                        IN ULONGLONG HashIndex);
1334
1335 LONG
1336 AFSObjectInfoIncrement( IN AFSObjectInfoCB *ObjectInfo,
1337                         IN LONG             Reason);
1338
1339 LONG
1340 AFSObjectInfoDecrement( IN AFSObjectInfoCB *ObjectInfo,
1341                         IN LONG             Reason);
1342
1343 void
1344 AFSDeleteObjectInfo( IN AFSObjectInfoCB **ppObjectInfo);
1345
1346 AFSObjectInfoCB *
1347 AFSFindObjectInfo( IN AFSVolumeCB * VolumeCB,
1348                    IN AFSFileID   * FileID,
1349                    IN BOOLEAN       bUpdateLastUse);
1350
1351 void
1352 AFSReleaseObjectInfo( IN OUT AFSObjectInfoCB **ppObjectInfo);
1353
1354 NTSTATUS
1355 AFSEvaluateRootEntry( IN AFSDirectoryCB *DirectoryCB,
1356                       OUT AFSDirectoryCB **TargetDirEntry);
1357
1358 NTSTATUS
1359 AFSCleanupFcb( IN AFSFcb *Fcb,
1360                IN BOOLEAN ForceFlush);
1361
1362 NTSTATUS
1363 AFSUpdateDirEntryName( IN AFSDirectoryCB *DirectoryCB,
1364                        IN UNICODE_STRING *NewFileName);
1365
1366 NTSTATUS
1367 AFSReadCacheFile( IN void *ReadBuffer,
1368                   IN LARGE_INTEGER *ReadOffset,
1369                   IN ULONG RequestedDataLength,
1370                   IN OUT PULONG BytesRead);
1371
1372 NTSTATUS
1373 AFSIrpComplete( IN PDEVICE_OBJECT DeviceObject,
1374                 IN PIRP           Irp,
1375                 IN PVOID          Context);
1376
1377 BOOLEAN
1378 AFSIsDirectoryEmptyForDelete( IN AFSFcb *Fcb);
1379
1380 void
1381 AFSRemoveNameEntry( IN AFSObjectInfoCB *ParentObjectInfo,
1382                     IN AFSDirectoryCB *DirEntry);
1383
1384 LARGE_INTEGER
1385 AFSGetAuthenticationId( void);
1386
1387 void
1388 AFSUnwindFileInfo( IN AFSFcb *Fcb,
1389                    IN AFSCcb *Ccb);
1390
1391 BOOLEAN
1392 AFSValidateDirList( IN AFSObjectInfoCB *ObjectInfo);
1393
1394 PFILE_OBJECT
1395 AFSReferenceCacheFileObject( void);
1396
1397 void
1398 AFSReleaseCacheFileObject( IN PFILE_OBJECT CacheFileObject);
1399
1400 NTSTATUS
1401 AFSInitializeLibrary( IN AFSLibraryInitCB *LibraryInit);
1402
1403 NTSTATUS
1404 AFSCloseLibrary( void);
1405
1406 NTSTATUS
1407 AFSDefaultLogMsg( IN ULONG Subsystem,
1408                   IN ULONG Level,
1409                   IN PCCH Format,
1410                   ...);
1411
1412 NTSTATUS
1413 AFSGetObjectStatus( IN AFSGetStatusInfoCB *GetStatusInfo,
1414                     IN ULONG InputBufferLength,
1415                     IN AFSStatusInfoCB *StatusInfo,
1416                     OUT ULONG *ReturnLength);
1417
1418 NTSTATUS
1419 AFSCheckSymlinkAccess( IN AFSDirectoryCB *ParentDirectoryCB,
1420                        IN UNICODE_STRING *ComponentName);
1421
1422 NTSTATUS
1423 AFSRetrieveFinalComponent( IN UNICODE_STRING *FullPathName,
1424                            OUT UNICODE_STRING *ComponentName);
1425
1426 void
1427 AFSDumpTraceFiles_Default( void);
1428
1429 void *
1430 AFSLibExAllocatePoolWithTag( IN POOL_TYPE  PoolType,
1431                              IN SIZE_T  NumberOfBytes,
1432                              IN ULONG  Tag);
1433
1434 #define AFSLibExFreePool(x)          ExFreePool(x)
1435
1436 #define AFSLibExFreePoolWithTag(x,y) ExFreePoolWithTag(x,y)
1437
1438 BOOLEAN
1439 AFSValidNameFormat( IN UNICODE_STRING *FileName);
1440
1441 NTSTATUS
1442 AFSCreateDefaultSecurityDescriptor( void);
1443
1444 void
1445 AFSRetrieveParentPath( IN UNICODE_STRING *FullFileName,
1446                        OUT UNICODE_STRING *ParentPath);
1447
1448 NTSTATUS
1449 AFSRetrieveValidAuthGroup( IN AFSFcb *Fcb,
1450                            IN AFSObjectInfoCB *ObjectInfo,
1451                            IN BOOLEAN WriteAccess,
1452                            OUT GUID *AuthGroup);
1453
1454 NTSTATUS
1455 AFSPerformObjectInvalidate( IN AFSObjectInfoCB *ObjectInfo,
1456                             IN ULONG InvalidateReason);
1457
1458 BOOLEAN
1459 AFSIgnoreReparsePointToFile( void);
1460
1461 NTSTATUS
1462 AFSRetrieveTargetFileInfo( IN PUNICODE_STRING TargetName,
1463                            OUT AFSFileInfoCB *FileInfo);
1464
1465 //
1466 // AFSNameArray.cpp Prototypes
1467 //
1468
1469 AFSNameArrayHdr *
1470 AFSInitNameArray( IN AFSDirectoryCB *DirectoryCB,
1471                   IN ULONG InitialElementCount);
1472
1473 NTSTATUS
1474 AFSPopulateNameArray( IN AFSNameArrayHdr *NameArray,
1475                       IN UNICODE_STRING *Path,
1476                       IN AFSDirectoryCB *DirectoryCB);
1477
1478 NTSTATUS
1479 AFSPopulateNameArrayFromRelatedArray( IN AFSNameArrayHdr *NameArray,
1480                                       IN AFSNameArrayHdr *RelatedNameArray,
1481                                       IN AFSDirectoryCB *DirectoryCB);
1482
1483 NTSTATUS
1484 AFSFreeNameArray( IN AFSNameArrayHdr *NameArray);
1485
1486 NTSTATUS
1487 AFSInsertNextElement( IN AFSNameArrayHdr *NameArray,
1488                       IN AFSDirectoryCB *DirEntry);
1489
1490 AFSDirectoryCB *
1491 AFSBackupEntry( IN AFSNameArrayHdr *NameArray);
1492
1493 AFSDirectoryCB *
1494 AFSGetParentEntry( IN AFSNameArrayHdr *NameArray);
1495
1496 void
1497 AFSResetNameArray( IN AFSNameArrayHdr *NameArray,
1498                    IN AFSDirectoryCB *DirEntry);
1499
1500 void
1501 AFSDumpNameArray( IN IN AFSNameArrayHdr *NameArray);
1502
1503 //
1504 // AFSWorker.cpp Prototypes
1505 //
1506
1507 NTSTATUS
1508 AFSInitializeWorkerPool( void);
1509
1510 NTSTATUS
1511 AFSRemoveWorkerPool( void);
1512
1513 NTSTATUS
1514 AFSInitWorkerThread( IN AFSWorkQueueContext *PoolContext,
1515                      IN PKSTART_ROUTINE WorkerRoutine);
1516
1517 NTSTATUS
1518 AFSInitVolumeWorker( IN AFSVolumeCB *VolumeCB);
1519
1520 NTSTATUS
1521 AFSShutdownWorkerThread( IN AFSWorkQueueContext *PoolContext);
1522
1523 NTSTATUS
1524 AFSShutdownIOWorkerThread( IN AFSWorkQueueContext *PoolContext);
1525
1526 NTSTATUS
1527 AFSShutdownVolumeWorker( IN AFSVolumeCB *VolumeCB);
1528
1529 void
1530 AFSWorkerThread( IN PVOID Context);
1531
1532 void
1533 AFSIOWorkerThread( IN PVOID Context);
1534
1535 void
1536 AFSPrimaryVolumeWorkerThread( IN PVOID Context);
1537
1538 NTSTATUS
1539 AFSInsertWorkitem( IN AFSWorkItem *WorkItem);
1540
1541 NTSTATUS
1542 AFSInsertIOWorkitem( IN AFSWorkItem *WorkItem);
1543
1544 NTSTATUS
1545 AFSInsertWorkitemAtHead( IN AFSWorkItem *WorkItem);
1546
1547 AFSWorkItem *
1548 AFSRemoveWorkItem( void);
1549
1550 AFSWorkItem *
1551 AFSRemoveIOWorkItem( void);
1552
1553 NTSTATUS
1554 AFSQueueWorkerRequest( IN AFSWorkItem *WorkItem);
1555
1556 NTSTATUS
1557 AFSQueueIOWorkerRequest( IN AFSWorkItem *WorkItem);
1558
1559 NTSTATUS
1560 AFSQueueWorkerRequestAtHead( IN AFSWorkItem *WorkItem);
1561
1562 NTSTATUS
1563 AFSShutdownVolumeWorker( IN AFSVolumeCB *VolumeCB);
1564
1565 NTSTATUS
1566 AFSQueueFlushExtents( IN AFSFcb *Fcb,
1567                       IN GUID *AuthGroup);
1568
1569 NTSTATUS
1570 AFSQueueGlobalRootEnumeration( void);
1571
1572 NTSTATUS
1573 AFSQueuePurgeObject( IN AFSFcb *Fcb);
1574
1575 NTSTATUS
1576 AFSQueueStartIos( IN PFILE_OBJECT CacheFileObject,
1577                   IN UCHAR FunctionCode,
1578                   IN ULONG RequestFLags,
1579                   IN AFSIoRun *IoRuns,
1580                   IN ULONG RunCount,
1581                   IN AFSGatherIo *GatherIo);
1582
1583 NTSTATUS
1584 AFSQueueInvalidateObject( IN AFSObjectInfoCB *ObjectInfo,
1585                           IN ULONG InvalidateReason);
1586
1587 //
1588 // AFSMD5Support.cpp Prototypes
1589 //
1590
1591 void
1592 AFSGenerateMD5( IN char *DataBuffer,
1593                 IN ULONG Length,
1594                 OUT UCHAR *MD5Digest);
1595
1596 };
1597
1598 #endif /* _AFS_COMMON_H */