32915d4567c9a19e31be759bc2cda9a00570dd3f
[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                          OUT AFSDirEnumEntry **DirEnumEntry);
226
227 NTSTATUS
228 AFSRetrieveVolumeInformation( IN GUID *AuthGroup,
229                               IN AFSFileID *FileID,
230                               OUT AFSVolumeInfoCB *VolumeInformation);
231
232 NTSTATUS
233 AFSRetrieveVolumeSizeInformation( IN GUID *AuthGroup,
234                                   IN AFSFileID *FileID,
235                                   OUT AFSVolumeSizeInfoCB *VolumeSizeInformation);
236
237 NTSTATUS
238 AFSNotifyPipeTransceive( IN AFSCcb *Ccb,
239                          IN ULONG InputLength,
240                          IN ULONG OutputLength,
241                          IN void *InputDataBuffer,
242                          OUT void *OutputDataBuffer,
243                          OUT ULONG *BytesReturned);
244
245 NTSTATUS
246 AFSNotifySetPipeInfo( IN AFSCcb *Ccb,
247                       IN ULONG InformationClass,
248                       IN ULONG InputLength,
249                       IN void *DataBuffer);
250
251 NTSTATUS
252 AFSNotifyQueryPipeInfo( IN AFSCcb *Ccb,
253                         IN ULONG InformationClass,
254                         IN ULONG OutputLength,
255                         IN void *DataBuffer,
256                         OUT ULONG *BytesReturned);
257
258 NTSTATUS
259 AFSReleaseFid( IN AFSFileID *FileId);
260
261 BOOLEAN
262 AFSIsExtentRequestQueued( IN AFSFileID *FileID,
263                           IN LARGE_INTEGER *ExtentOffset,
264                           IN ULONG Length);
265
266 //
267 // AFSCreate.cpp Prototypes
268 //
269
270 NTSTATUS
271 AFSCreate( IN PDEVICE_OBJECT DeviceObject,
272            IN PIRP Irp);
273
274 NTSTATUS
275 AFSCommonCreate( IN PDEVICE_OBJECT DeviceObject,
276                  IN PIRP Irp);
277
278 NTSTATUS
279 AFSOpenRedirector( IN PIRP Irp,
280                    IN AFSFcb **Fcb,
281                    IN AFSCcb **Ccb);
282
283 NTSTATUS
284 AFSOpenAFSRoot( IN PIRP Irp,
285                 IN AFSFcb **Fcb,
286                 IN AFSCcb **Ccb);
287
288 NTSTATUS
289 AFSOpenRoot( IN PIRP Irp,
290              IN AFSVolumeCB *VolumeCB,
291              IN GUID *AuthGroup,
292              OUT AFSFcb **Fcb,
293              OUT AFSCcb **Ccb);
294
295 NTSTATUS
296 AFSProcessCreate( IN PIRP               Irp,
297                   IN GUID              *AuthGroup,
298                   IN AFSVolumeCB       *VolumeCB,
299                   IN AFSDirectoryCB    *ParentDirCB,
300                   IN PUNICODE_STRING    FileName,
301                   IN PUNICODE_STRING    ComponentName,
302                   IN PUNICODE_STRING    FullFileName,
303                   OUT AFSFcb          **Fcb,
304                   OUT AFSCcb          **Ccb);
305
306 NTSTATUS
307 AFSOpenTargetDirectory( IN PIRP Irp,
308                         IN AFSVolumeCB *VolumeCB,
309                         IN AFSDirectoryCB *ParentDirectoryCB,
310                         IN AFSDirectoryCB *TargetDirectoryCB,
311                         IN UNICODE_STRING *TargetName,
312                         OUT AFSFcb **Fcb,
313                         OUT AFSCcb **Ccb);
314
315 NTSTATUS
316 AFSProcessOpen( IN PIRP Irp,
317                 IN GUID *AuthGroup,
318                 IN AFSVolumeCB *VolumeCB,
319                 IN AFSDirectoryCB *ParentDirCB,
320                 IN AFSDirectoryCB *DirectoryCB,
321                 OUT AFSFcb **Fcb,
322                 OUT AFSCcb **Ccb);
323
324 NTSTATUS
325 AFSProcessOverwriteSupersede( IN PDEVICE_OBJECT DeviceObject,
326                               IN PIRP           Irp,
327                               IN AFSVolumeCB   *VolumeCB,
328                               IN GUID          *AuthGroup,
329                               IN AFSDirectoryCB *ParentDirCB,
330                               IN AFSDirectoryCB *DirectoryCB,
331                               OUT AFSFcb       **Fcb,
332                               OUT AFSCcb       **Ccb);
333
334 NTSTATUS
335 AFSControlDeviceCreate( IN PIRP Irp);
336
337 NTSTATUS
338 AFSOpenIOCtlFcb( IN PIRP Irp,
339                  IN GUID *AuthGroup,
340                  IN AFSDirectoryCB *ParentDirCB,
341                  OUT AFSFcb **Fcb,
342                  OUT AFSCcb **Ccb);
343
344 NTSTATUS
345 AFSOpenSpecialShareFcb( IN PIRP Irp,
346                         IN GUID *AuthGroup,
347                         IN AFSDirectoryCB *DirectoryCB,
348                         OUT AFSFcb **Fcb,
349                         OUT AFSCcb **Ccb);
350
351 //
352 // AFSExtentsSupport.cpp Prototypes
353 //
354 VOID
355 AFSLockForExtentsTrim( IN AFSFcb *Fcb);
356
357 PAFSExtent
358 AFSExtentForOffset( IN AFSFcb *Fcb,
359                     IN PLARGE_INTEGER Offset,
360                     IN BOOLEAN ReturnPrevious);
361 BOOLEAN
362 AFSExtentContains( IN AFSExtent *Extent, IN PLARGE_INTEGER Offset);
363
364
365 NTSTATUS
366 AFSRequestExtents( IN  AFSFcb *Fcb,
367                    IN  AFSCcb *Ccb,
368                    IN  PLARGE_INTEGER Offset,
369                    IN  ULONG Size,
370                    OUT BOOLEAN *FullyMApped);
371
372 BOOLEAN AFSDoExtentsMapRegion(IN AFSFcb *Fcb,
373                               IN PLARGE_INTEGER Offset,
374                               IN ULONG Size,
375                               IN OUT AFSExtent **FirstExtent,
376                               OUT AFSExtent **LastExtent);
377
378 NTSTATUS
379 AFSRequestExtentsAsync( IN AFSFcb *Fcb,
380                         IN AFSCcb *Ccb,
381                         IN PLARGE_INTEGER Offset,
382                         IN ULONG Size);
383
384 NTSTATUS
385 AFSWaitForExtentMapping ( IN AFSFcb *Fcb,
386                           IN AFSCcb *Ccb);
387
388 NTSTATUS
389 AFSProcessSetFileExtents( IN AFSSetFileExtentsCB *SetExtents );
390
391 NTSTATUS
392 AFSProcessReleaseFileExtents( IN PIRP Irp);
393
394 NTSTATUS
395 AFSProcessExtentFailure( PIRP Irp);
396
397 NTSTATUS
398 AFSProcessSetExtents( IN AFSFcb *pFcb,
399                       IN ULONG   Count,
400                       IN AFSFileExtentCB *Result);
401
402 NTSTATUS
403 AFSFlushExtents( IN AFSFcb *pFcb,
404                  IN GUID *AuthGroup);
405
406 NTSTATUS
407 AFSReleaseExtentsWithFlush( IN AFSFcb *Fcb,
408                             IN GUID *AuthGroup,
409                             IN BOOLEAN bReleaseAll);
410
411 NTSTATUS
412 AFSReleaseCleanExtents( IN AFSFcb *Fcb,
413                         IN GUID *AuthGroup);
414
415 VOID
416 AFSMarkDirty( IN AFSFcb *pFcb,
417               IN AFSExtent *StartExtent,
418               IN ULONG ExtentsCount,
419               IN LARGE_INTEGER *StartingByte,
420               IN BOOLEAN DerefExtents);
421
422 VOID
423 AFSTearDownFcbExtents( IN AFSFcb *Fcb,
424                        IN GUID *AuthGroup);
425
426 VOID
427 AFSDeleteFcbExtents( IN AFSFcb *Fcb);
428
429 void
430 AFSTrimExtents( IN AFSFcb *Fcb,
431                 IN PLARGE_INTEGER FileSize);
432
433 void
434 AFSTrimSpecifiedExtents( IN AFSFcb *Fcb,
435                          IN ULONG   Count,
436                          IN AFSFileExtentCB *Result);
437
438 void
439 AFSReferenceActiveExtents( IN AFSExtent *StartExtent,
440                            IN ULONG ExtentsCount);
441
442 void
443 AFSDereferenceActiveExtents( IN AFSExtent *StartExtent,
444                              IN ULONG ExtentsCount);
445
446 void
447 AFSRemoveEntryDirtyList( IN AFSFcb *Fcb,
448                          IN AFSExtent *Extent);
449
450 AFSExtent *
451 ExtentFor( PLIST_ENTRY le, ULONG SkipList );
452
453 AFSExtent *
454 NextExtent( AFSExtent *Extent, ULONG SkipList );
455
456 ULONG
457 AFSConstructCleanByteRangeList( AFSFcb * pFcb,
458                                 AFSByteRange ** pByteRangeList);
459
460 #if GEN_MD5
461 void
462 AFSSetupMD5Hash( IN AFSFcb *Fcb,
463                  IN AFSExtent *StartExtent,
464                  IN ULONG ExtentsCount,
465                  IN void *SystemBuffer,
466                  IN LARGE_INTEGER *ByteOffset,
467                  IN ULONG ByteCount);
468 #endif
469
470 //
471 //
472 // AFSIoSupp.cpp Prototypes
473 //
474 NTSTATUS
475 AFSGetExtents( IN  AFSFcb *pFcb,
476                IN  PLARGE_INTEGER Offset,
477                IN  ULONG Length,
478                IN  AFSExtent *From,
479                OUT ULONG *ExtentCount,
480                OUT ULONG *RunCount);
481
482 NTSTATUS
483 AFSSetupIoRun( IN PDEVICE_OBJECT CacheDevice,
484                IN PIRP           MasterIrp,
485                IN PVOID          SystemBuffer,
486                IN OUT AFSIoRun  *IoRun,
487                IN PLARGE_INTEGER Start,
488                IN ULONG          Length,
489                IN AFSExtent     *From,
490                IN OUT ULONG     *RunCount);
491
492 NTSTATUS
493 AFSStartIos( IN FILE_OBJECT     *CacheFileObject,
494              IN UCHAR            FunctionCode,
495              IN ULONG            IrpFlags,
496              IN AFSIoRun        *IoRun,
497              IN ULONG            Count,
498              IN OUT AFSGatherIo *Gather);
499
500 VOID
501 AFSCompleteIo( IN AFSGatherIo *Gather,
502                IN NTSTATUS Status);
503
504 NTSTATUS
505 AFSProcessExtentRun( IN PVOID          SystemBuffer,
506                      IN PLARGE_INTEGER Start,
507                      IN ULONG          Length,
508                      IN AFSExtent     *From,
509                      IN BOOLEAN        WriteRequest);
510
511 //
512 // AFSClose.cpp Prototypes
513 //
514
515
516 NTSTATUS
517 AFSClose( IN PDEVICE_OBJECT DeviceObject,
518           IN PIRP Irp);
519
520 //
521 // AFSFcbSupport.cpp Prototypes
522 //
523
524 NTSTATUS
525 AFSInitFcb( IN AFSDirectoryCB   *DirEntry);
526
527 NTSTATUS
528 AFSInitVolume( IN GUID *AuthGroup,
529                IN AFSFileID *RootFid,
530                OUT AFSVolumeCB **VolumeCB);
531
532 NTSTATUS
533 AFSRemoveVolume( IN AFSVolumeCB *VolumeCB);
534
535 NTSTATUS
536 AFSInitRootFcb( IN ULONGLONG ProcessID,
537                 IN AFSVolumeCB *VolumeCB);
538
539 void
540 AFSRemoveRootFcb( IN AFSFcb *RootFcb);
541
542 NTSTATUS
543 AFSInitCcb( IN OUT AFSCcb **Ccb,
544             IN     AFSDirectoryCB *DirectoryCB,
545             IN     ACCESS_MASK     GrantedAccess,
546             IN     ULONG           FileAccess);
547
548 void
549 AFSRemoveFcb( IN AFSFcb **Fcb);
550
551 void
552 AFSRemoveCcb( IN AFSFcb *Fcb,
553               IN AFSCcb *Ccb);
554
555 NTSTATUS
556 AFSInsertCcb( IN AFSFcb *Fcb,
557               IN AFSCcb *Ccb);
558
559 //
560 // AFSNameSupport.cpp Prototypes
561 //
562
563 NTSTATUS
564 AFSLocateNameEntry( IN GUID *AuthGroup,
565                     IN PFILE_OBJECT FileObject,
566                     IN UNICODE_STRING *RootPathName,
567                     IN UNICODE_STRING *ParsedPathName,
568                     IN AFSNameArrayHdr *NameArray,
569                     IN ULONG Flags,
570                     IN OUT AFSVolumeCB **VolumeCB,
571                     IN OUT AFSDirectoryCB **ParentDirectoryCB,
572                     OUT AFSDirectoryCB **DirectoryCB,
573                     OUT PUNICODE_STRING ComponentName);
574
575 NTSTATUS
576 AFSCreateDirEntry( IN GUID            *AuthGroup,
577                    IN AFSObjectInfoCB *ParentObjectInfo,
578                    IN AFSDirectoryCB *ParentDirCB,
579                    IN PUNICODE_STRING FileName,
580                    IN PUNICODE_STRING ComponentName,
581                    IN ULONG Attributes,
582                    IN OUT AFSDirectoryCB **DirEntry);
583
584 void
585 AFSInsertDirectoryNode( IN AFSObjectInfoCB *ParentObjectInfo,
586                         IN AFSDirectoryCB *DirEntry,
587                         IN BOOLEAN InsertInEnumList);
588
589 NTSTATUS
590 AFSDeleteDirEntry( IN AFSObjectInfoCB *ParentObjectInfo,
591                    IN AFSDirectoryCB *DirEntry);
592
593 NTSTATUS
594 AFSRemoveDirNodeFromParent( IN AFSObjectInfoCB *ParentObjectInfo,
595                             IN AFSDirectoryCB *DirEntry,
596                             IN BOOLEAN RemoveFromEnumList);
597
598 NTSTATUS
599 AFSFixupTargetName( IN OUT PUNICODE_STRING FileName,
600                     IN OUT PUNICODE_STRING TargetFileName);
601
602 NTSTATUS
603 AFSParseName( IN PIRP Irp,
604               IN GUID *AuthGroup,
605               OUT PUNICODE_STRING FileName,
606               OUT PUNICODE_STRING ParsedFileName,
607               OUT PUNICODE_STRING RootFileName,
608               OUT ULONG *ParseFlags,
609               OUT AFSVolumeCB **VolumeCB,
610               OUT AFSDirectoryCB **ParentDirectoryCB,
611               OUT AFSNameArrayHdr **NameArray);
612
613 NTSTATUS
614 AFSCheckCellName( IN GUID *AuthGroup,
615                   IN UNICODE_STRING *CellName,
616                   OUT AFSDirectoryCB **ShareDirEntry);
617
618 NTSTATUS
619 AFSBuildMountPointTarget( IN GUID *AuthGroup,
620                           IN AFSDirectoryCB *DirectoryCB,
621                           OUT AFSVolumeCB **VolumeCB);
622
623 NTSTATUS
624 AFSBuildRootVolume( IN GUID *AuthGroup,
625                     IN AFSFileID *FileId,
626                     OUT AFSVolumeCB **TargetVolumeCB);
627
628 NTSTATUS
629 AFSProcessDFSLink( IN AFSDirectoryCB *DirEntry,
630                    IN PFILE_OBJECT FileObject,
631                    IN UNICODE_STRING *RemainingPath,
632                    IN GUID *AuthGroup);
633
634 //
635 // AFSNetworkProviderSupport.cpp
636 //
637
638 NTSTATUS
639 AFSAddConnection( IN AFSNetworkProviderConnectionCB *ConnectCB,
640                   IN OUT PULONG ResultStatus,
641                   IN OUT ULONG_PTR *ReturnOutputBufferLength);
642
643 NTSTATUS
644 AFSCancelConnection( IN AFSNetworkProviderConnectionCB *ConnectCB,
645                      IN OUT AFSCancelConnectionResultCB *ConnectionResult,
646                      IN OUT ULONG_PTR *ReturnOutputBufferLength);
647
648 NTSTATUS
649 AFSGetConnection( IN AFSNetworkProviderConnectionCB *ConnectCB,
650                   IN OUT WCHAR *RemoteName,
651                   IN ULONG RemoteNameBufferLength,
652                   IN OUT ULONG_PTR *ReturnOutputBufferLength);
653
654 NTSTATUS
655 AFSListConnections( IN OUT AFSNetworkProviderConnectionCB *ConnectCB,
656                     IN ULONG ConnectionBufferLength,
657                     IN OUT ULONG_PTR *ReturnOutputBufferLength);
658
659 void
660 AFSInitializeConnectionInfo( IN AFSProviderConnectionCB *Connection,
661                              IN ULONG DisplayType);
662
663 AFSProviderConnectionCB *
664 AFSLocateEnumRootEntry( IN UNICODE_STRING *RemoteName);
665
666 NTSTATUS
667 AFSEnumerateConnection( IN OUT AFSNetworkProviderConnectionCB *ConnectCB,
668                         IN AFSProviderConnectionCB *RootConnection,
669                         IN ULONG BufferLength,
670                         OUT PULONG CopiedLength);
671
672 NTSTATUS
673 AFSGetConnectionInfo( IN AFSNetworkProviderConnectionCB *ConnectCB,
674                       IN ULONG BufferLength,
675                       IN OUT ULONG_PTR *ReturnOutputBufferLength);
676
677 BOOLEAN
678 AFSIsDriveMapped( IN WCHAR DriveMapping);
679
680 //
681 // AFSRead.cpp Prototypes
682 //
683
684 NTSTATUS
685 AFSCommonRead( IN PDEVICE_OBJECT DeviceObject,
686                IN PIRP Irp,
687                IN HANDLE OnBehalfOf);
688
689 NTSTATUS
690 AFSRead( IN PDEVICE_OBJECT DeviceObject,
691          IN PIRP Irp);
692
693
694 NTSTATUS
695 AFSIOCtlRead( IN PDEVICE_OBJECT DeviceObject,
696               IN PIRP Irp);
697
698 NTSTATUS
699 AFSShareRead( IN PDEVICE_OBJECT DeviceObject,
700               IN PIRP Irp);
701
702 //
703 // AFSWrite.cpp Prototypes
704 //
705
706 NTSTATUS
707 AFSCommonWrite( IN PDEVICE_OBJECT DeviceObject,
708           IN PIRP Irp,
709           IN HANDLE CallingUser);
710
711 NTSTATUS
712 AFSWrite( IN PDEVICE_OBJECT DeviceObject,
713                 IN PIRP Irp);
714
715 NTSTATUS
716 AFSIOCtlWrite( IN PDEVICE_OBJECT DeviceObject,
717                IN PIRP Irp);
718
719 NTSTATUS
720 AFSShareWrite( IN PDEVICE_OBJECT DeviceObject,
721                IN PIRP Irp);
722
723 //
724 // AFSFileInfo.cpp Prototypes
725 //
726
727 NTSTATUS
728 AFSQueryFileInfo( IN PDEVICE_OBJECT DeviceObject,
729                   IN PIRP Irp);
730
731 NTSTATUS
732 AFSQueryBasicInfo( IN PIRP Irp,
733                    IN AFSDirectoryCB *DirectoryCB,
734                    IN OUT PFILE_BASIC_INFORMATION Buffer,
735                    IN OUT PLONG Length);
736
737 NTSTATUS
738 AFSQueryStandardInfo( IN PIRP Irp,
739                       IN AFSDirectoryCB *DirectoryCB,
740                       IN OUT PFILE_STANDARD_INFORMATION Buffer,
741                       IN OUT PLONG Length);
742
743 NTSTATUS
744 AFSQueryInternalInfo( IN PIRP Irp,
745                       IN AFSFcb *Fcb,
746                       IN OUT PFILE_INTERNAL_INFORMATION Buffer,
747                       IN OUT PLONG Length);
748
749 NTSTATUS
750 AFSQueryEaInfo( IN PIRP Irp,
751                 IN AFSDirectoryCB *DirectoryCB,
752                 IN OUT PFILE_EA_INFORMATION Buffer,
753                 IN OUT PLONG Length);
754
755 NTSTATUS
756 AFSQueryPositionInfo( IN PIRP Irp,
757                       IN AFSFcb *Fcb,
758                       IN OUT PFILE_POSITION_INFORMATION Buffer,
759                       IN OUT PLONG Length);
760
761 NTSTATUS
762 AFSQueryNameInfo( IN PIRP Irp,
763                   IN AFSDirectoryCB *DirectoryCB,
764                   IN OUT PFILE_NAME_INFORMATION Buffer,
765                   IN OUT PLONG Length);
766
767 NTSTATUS
768 AFSQueryShortNameInfo( IN PIRP Irp,
769                        IN AFSDirectoryCB *DirectoryCB,
770                        IN OUT PFILE_NAME_INFORMATION Buffer,
771                        IN OUT PLONG Length);
772
773 NTSTATUS
774 AFSQueryNetworkInfo( IN PIRP Irp,
775                      IN AFSDirectoryCB *DirectoryCB,
776                      IN OUT PFILE_NETWORK_OPEN_INFORMATION Buffer,
777                      IN OUT PLONG Length);
778
779 NTSTATUS
780 AFSQueryStreamInfo( IN PIRP Irp,
781                     IN AFSDirectoryCB *DirectoryCB,
782                     IN OUT FILE_STREAM_INFORMATION *Buffer,
783                     IN OUT PLONG Length);
784
785 NTSTATUS
786 AFSQueryAccess( IN PIRP Irp,
787                 IN AFSFcb *Fcb,
788                 IN OUT PFILE_ACCESS_INFORMATION Buffer,
789                 IN OUT PLONG Length);
790
791 NTSTATUS
792 AFSQueryMode( IN PIRP Irp,
793               IN AFSFcb *Fcb,
794               IN OUT PFILE_MODE_INFORMATION Buffer,
795               IN OUT PLONG Length);
796
797 NTSTATUS
798 AFSQueryAlignment( IN PIRP Irp,
799                    IN AFSFcb *Fcb,
800                    IN OUT PFILE_ALIGNMENT_INFORMATION Buffer,
801                    IN OUT PLONG Length);
802
803 NTSTATUS
804 AFSQueryAttribTagInfo( IN PIRP Irp,
805                        IN AFSDirectoryCB *DirectoryCB,
806                        IN OUT FILE_ATTRIBUTE_TAG_INFORMATION *Buffer,
807                        IN OUT PLONG Length);
808
809 NTSTATUS
810 AFSQueryRemoteProtocolInfo( IN PIRP Irp,
811                             IN AFSDirectoryCB *DirectoryCB,
812                             IN OUT FILE_REMOTE_PROTOCOL_INFORMATION *Buffer,
813                             IN OUT PLONG Length);
814
815 NTSTATUS
816 AFSQueryPhysicalNameInfo( IN PIRP Irp,
817                           IN AFSDirectoryCB *DirectoryCB,
818                           IN OUT PFILE_NETWORK_PHYSICAL_NAME_INFORMATION Buffer,
819                           IN OUT PLONG Length);
820
821 NTSTATUS
822 AFSSetFileInfo( IN PDEVICE_OBJECT DeviceObject,
823                 IN PIRP Irp);
824
825 NTSTATUS
826 AFSSetBasicInfo( IN PIRP Irp,
827                  IN AFSDirectoryCB *DirectoryCB);
828
829 NTSTATUS
830 AFSSetDispositionInfo( IN PIRP Irp,
831                        IN AFSDirectoryCB *DirectoryCB);
832
833 NTSTATUS
834 AFSSetRenameInfo( IN PIRP Irp);
835
836 NTSTATUS
837 AFSSetFileLinkInfo( IN PIRP Irp);
838
839 NTSTATUS
840 AFSSetPositionInfo( IN PIRP Irp,
841                     IN AFSDirectoryCB *DirectoryCB);
842
843 NTSTATUS
844 AFSSetAllocationInfo( IN PIRP Irp,
845                       IN AFSDirectoryCB *DirectoryCB);
846
847 NTSTATUS
848 AFSSetEndOfFileInfo( IN PIRP Irp,
849                      IN AFSDirectoryCB *DirectoryCB);
850
851 NTSTATUS
852 AFSProcessShareSetInfo( IN IRP *Irp,
853                         IN AFSFcb *Fcb,
854                         IN AFSCcb *Ccb);
855
856 NTSTATUS
857 AFSProcessShareQueryInfo( IN IRP *Irp,
858                           IN AFSFcb *Fcb,
859                           IN AFSCcb *Ccb);
860
861 NTSTATUS
862 AFSProcessPIOCtlQueryInfo( IN IRP *Irp,
863                            IN AFSFcb *Fcb,
864                            IN AFSCcb *Ccb,
865                            IN OUT LONG *Length);
866
867 //
868 // AFSEa.cpp Prototypes
869 //
870
871 NTSTATUS
872 AFSQueryEA( IN PDEVICE_OBJECT DeviceObject,
873             IN PIRP Irp);
874
875 NTSTATUS
876 AFSSetEA( IN PDEVICE_OBJECT DeviceObject,
877           IN PIRP Irp);
878
879 //
880 // AFSFlushBuffers.cpp Prototypes
881 //
882
883 NTSTATUS
884 AFSFlushBuffers( IN PDEVICE_OBJECT DeviceObject,
885                  IN PIRP Irp);
886
887 //
888 // AFSVolumeInfo.cpp Prototypes
889 //
890
891 NTSTATUS
892 AFSQueryVolumeInfo( IN PDEVICE_OBJECT DeviceObject,
893                     IN PIRP Irp);
894
895 NTSTATUS
896 AFSSetVolumeInfo( IN PDEVICE_OBJECT DeviceObject,
897                   IN PIRP Irp);
898
899 NTSTATUS
900 AFSQueryFsVolumeInfo( IN AFSVolumeInfoCB *VolumeInfo,
901                       IN PFILE_FS_VOLUME_INFORMATION Buffer,
902                       IN OUT PULONG Length);
903
904 NTSTATUS
905 AFSQueryFsSizeInfo( IN AFSVolumeInfoCB *VolumeInfo,
906                     IN PFILE_FS_SIZE_INFORMATION Buffer,
907                     IN OUT PULONG Length);
908
909 NTSTATUS
910 AFSQueryFsDeviceInfo( IN AFSVolumeInfoCB *VolumeInfo,
911                       IN PFILE_FS_DEVICE_INFORMATION Buffer,
912                       IN OUT PULONG Length);
913
914 NTSTATUS
915 AFSQueryFsAttributeInfo( IN AFSVolumeInfoCB *VolumeInfo,
916                          IN PFILE_FS_ATTRIBUTE_INFORMATION Buffer,
917                          IN OUT PULONG Length);
918
919 NTSTATUS
920 AFSQueryFsFullSizeInfo( IN AFSVolumeInfoCB *VolumeInfo,
921                         IN PFILE_FS_FULL_SIZE_INFORMATION Buffer,
922                         IN OUT PULONG Length);
923
924 //
925 // AFSDirControl.cpp Prototypes
926 //
927
928 NTSTATUS
929 AFSDirControl( IN PDEVICE_OBJECT DeviceObject,
930                IN PIRP Irp);
931
932 NTSTATUS
933 AFSQueryDirectory( IN PIRP Irp);
934
935 NTSTATUS
936 AFSNotifyChangeDirectory( IN PIRP Irp);
937
938 AFSDirectoryCB *
939 AFSLocateNextDirEntry( IN AFSObjectInfoCB *ObjectInfo,
940                        IN AFSCcb *Ccb);
941
942 AFSDirectoryCB *
943 AFSLocateDirEntryByIndex( IN AFSObjectInfoCB *ObjectInfo,
944                           IN AFSCcb *Ccb,
945                           IN ULONG DirIndex);
946
947 NTSTATUS
948 AFSSnapshotDirectory( IN AFSFcb *Fcb,
949                       IN AFSCcb *Ccb,
950                       IN BOOLEAN ResetIndex);
951
952 NTSTATUS
953 AFSFsRtlNotifyFullChangeDirectory( IN AFSObjectInfoCB *ObjectInfo,
954                                    IN AFSCcb *Context,
955                                    IN BOOLEAN WatchTree,
956                                    IN ULONG CompletionFilter,
957                                    IN PIRP NotifyIrp);
958
959 void
960 AFSFsRtlNotifyFullReportChange( IN AFSObjectInfoCB *ObjectInfo,
961                                 IN AFSCcb *Ccb,
962                                 IN ULONG NotifyFilter,
963                                 IN ULONG NotificationAction);
964
965 BOOLEAN
966 AFSNotifyReportChangeCallback( IN void *NotifyContext,
967                                IN void *FilterContext);
968
969 BOOLEAN
970 AFSIsNameInSnapshot( IN AFSSnapshotHdr *SnapshotHdr,
971                      IN ULONG HashIndex);
972
973 //
974 // AFSFSControl.cpp Prototypes
975 //
976
977 NTSTATUS
978 AFSFSControl( IN PDEVICE_OBJECT DeviceObject,
979               IN PIRP Irp);
980
981 NTSTATUS
982 AFSProcessUserFsRequest( IN PIRP Irp);
983
984 NTSTATUS
985 AFSProcessShareFsCtrl( IN IRP *Irp,
986                        IN AFSFcb *Fcb,
987                        IN AFSCcb *Ccb);
988
989 //
990 // AFSDevControl.cpp Prototypes
991 //
992
993 NTSTATUS
994 AFSDevControl( IN PDEVICE_OBJECT DeviceObject,
995                IN PIRP Irp);
996
997 //
998 // AFSInternalDevControl.cpp Prototypes
999 //
1000
1001 NTSTATUS
1002 AFSInternalDevControl( IN PDEVICE_OBJECT DeviceObject,
1003                        IN PIRP Irp);
1004
1005 //
1006 // AFSShutdown.cpp Prototypes
1007 //
1008
1009 NTSTATUS
1010 AFSShutdown( IN PDEVICE_OBJECT DeviceObject,
1011              IN PIRP Irp);
1012
1013
1014 NTSTATUS
1015 AFSShutdownFilesystem( void);
1016
1017 //
1018 // AFSLockControl.cpp Prototypes
1019 //
1020
1021 NTSTATUS
1022 AFSLockControl( IN PDEVICE_OBJECT DeviceObject,
1023                 IN PIRP Irp);
1024
1025 //
1026 // AFSCleanup.cpp Prototypes
1027 //
1028
1029 NTSTATUS
1030 AFSCleanup( IN PDEVICE_OBJECT DeviceObject,
1031             IN PIRP Irp);
1032
1033 //
1034 // AFSSecurity.cpp Prototypes
1035 //
1036
1037 NTSTATUS
1038 AFSQuerySecurity( IN PDEVICE_OBJECT DeviceObject,
1039                   IN PIRP Irp);
1040
1041 NTSTATUS
1042 AFSSetSecurity( IN PDEVICE_OBJECT DeviceObject,
1043                 IN PIRP Irp);
1044
1045 //
1046 // AFSSystemControl.cpp Prototypes
1047 //
1048
1049 NTSTATUS
1050 AFSSystemControl( IN PDEVICE_OBJECT DeviceObject,
1051                   IN PIRP Irp);
1052
1053 //
1054 // AFSQuota.cpp Prototypes
1055 //
1056
1057 NTSTATUS
1058 AFSQueryQuota( IN PDEVICE_OBJECT DeviceObject,
1059                IN PIRP Irp);
1060
1061 NTSTATUS
1062 AFSSetQuota( IN PDEVICE_OBJECT DeviceObject,
1063              IN PIRP Irp);
1064
1065 //
1066 // AFSGeneric.cpp Prototypes
1067 //
1068
1069 ULONG
1070 AFSExceptionFilter( IN CHAR *FunctionString,
1071                     IN ULONG Code,
1072                     IN PEXCEPTION_POINTERS ExceptPtrs);
1073
1074 BOOLEAN
1075 AFSAcquireExcl( IN PERESOURCE Resource,
1076                 IN BOOLEAN wait);
1077
1078 BOOLEAN
1079 AFSAcquireSharedStarveExclusive( IN PERESOURCE Resource,
1080                                  IN BOOLEAN Wait);
1081
1082 BOOLEAN
1083 AFSAcquireShared( IN PERESOURCE Resource,
1084                   IN BOOLEAN wait);
1085
1086 void
1087 AFSReleaseResource( IN PERESOURCE Resource);
1088
1089 void
1090 AFSConvertToShared( IN PERESOURCE Resource);
1091
1092 void
1093 AFSCompleteRequest( IN PIRP Irp,
1094                     IN ULONG Status);
1095
1096 ULONG
1097 AFSGenerateCRC( IN PUNICODE_STRING FileName,
1098                 IN BOOLEAN UpperCaseName);
1099
1100 void *
1101 AFSLockSystemBuffer( IN PIRP Irp,
1102                      IN ULONG Length);
1103
1104 void *
1105 AFSLockUserBuffer( IN void *UserBuffer,
1106                    IN ULONG BufferLength,
1107                    OUT MDL ** Mdl);
1108
1109 void *
1110 AFSMapToService( IN PIRP Irp,
1111                  IN ULONG ByteCount);
1112
1113 NTSTATUS
1114 AFSUnmapServiceMappedBuffer( IN void *MappedBuffer,
1115                              IN PMDL Mdl);
1116
1117 NTSTATUS
1118 AFSInitializeLibraryDevice( void);
1119
1120 NTSTATUS
1121 AFSRemoveLibraryDevice( void);
1122
1123 NTSTATUS
1124 AFSDefaultDispatch( IN PDEVICE_OBJECT DeviceObject,
1125                     IN PIRP Irp);
1126
1127 NTSTATUS
1128 AFSInitializeGlobalDirectoryEntries( void);
1129
1130 AFSDirectoryCB *
1131 AFSInitDirEntry( IN AFSObjectInfoCB *ParentObjectInfo,
1132                  IN PUNICODE_STRING FileName,
1133                  IN PUNICODE_STRING TargetName,
1134                  IN AFSDirEnumEntry *DirEnumEntry,
1135                  IN ULONG FileIndex);
1136
1137 BOOLEAN
1138 AFSCheckForReadOnlyAccess( IN ACCESS_MASK DesiredAccess,
1139                            IN BOOLEAN DirectoryEntry);
1140
1141 NTSTATUS
1142 AFSEvaluateNode( IN GUID *AuthGroup,
1143                  IN AFSDirectoryCB *DirEntry);
1144
1145 NTSTATUS
1146 AFSValidateSymLink( IN GUID *AuthGroup,
1147                     IN AFSDirectoryCB *DirEntry);
1148
1149 NTSTATUS
1150 AFSInvalidateCache( IN AFSInvalidateCacheCB *InvalidateCB);
1151
1152 NTSTATUS
1153 AFSInvalidateObject( IN OUT AFSObjectInfoCB **ppObjectInfo,
1154                      IN     ULONG Reason);
1155
1156 BOOLEAN
1157 AFSIsChildOfParent( IN AFSFcb *Dcb,
1158                     IN AFSFcb *Fcb);
1159
1160 inline
1161 ULONGLONG
1162 AFSCreateHighIndex( IN AFSFileID *FileID);
1163
1164 inline
1165 ULONGLONG
1166 AFSCreateLowIndex( IN AFSFileID *FileID);
1167
1168 BOOLEAN
1169 AFSCheckAccess( IN ACCESS_MASK DesiredAccess,
1170                 IN ACCESS_MASK GrantedAccess,
1171                 IN BOOLEAN DirectoryEntry);
1172
1173 NTSTATUS
1174 AFSGetDriverStatus( IN AFSDriverStatusRespCB *DriverStatus);
1175
1176 NTSTATUS
1177 AFSSubstituteSysName( IN UNICODE_STRING *ComponentName,
1178                       IN UNICODE_STRING *SubstituteName,
1179                       IN ULONG StringIndex);
1180
1181 NTSTATUS
1182 AFSSubstituteNameInPath( IN OUT UNICODE_STRING *FullPathName,
1183                          IN OUT UNICODE_STRING *ComponentName,
1184                          IN UNICODE_STRING *SubstituteName,
1185                          IN OUT UNICODE_STRING *RemainingPath,
1186                          IN BOOLEAN FreePathName);
1187
1188 NTSTATUS
1189 AFSInvalidateVolume( IN AFSVolumeCB *VolumeCB,
1190                      IN ULONG Reason);
1191
1192 VOID
1193 AFSInvalidateAllVolumes( VOID);
1194
1195 NTSTATUS
1196 AFSVerifyEntry( IN GUID *AuthGroup,
1197                 IN AFSDirectoryCB *DirectoryCB);
1198
1199 NTSTATUS
1200 AFSSetVolumeState( IN AFSVolumeStatusCB *VolumeStatus);
1201
1202 NTSTATUS
1203 AFSSetNetworkState( IN AFSNetworkStatusCB *NetworkStatus);
1204
1205 NTSTATUS
1206 AFSValidateDirectoryCache( IN AFSObjectInfoCB *ObjectInfo,
1207                            IN GUID *AuthGroup);
1208
1209 BOOLEAN
1210 AFSIsVolumeFID( IN AFSFileID *FileID);
1211
1212 BOOLEAN
1213 AFSIsFinalNode( IN AFSFcb *Fcb);
1214
1215 NTSTATUS
1216 AFSUpdateMetaData( IN AFSDirectoryCB *DirEntry,
1217                    IN AFSDirEnumEntry *DirEnumEntry);
1218
1219 NTSTATUS
1220 AFSValidateEntry( IN AFSDirectoryCB *DirEntry,
1221                   IN GUID *AuthGroup,
1222                   IN BOOLEAN FastCall,
1223                   IN BOOLEAN SafeToPurge);
1224
1225 AFSDirectoryCB *
1226 AFSGetSpecialShareNameEntry( IN UNICODE_STRING *ShareName,
1227                              IN UNICODE_STRING *SecondaryName);
1228
1229 NTSTATUS
1230 AFSInitializeSpecialShareNameList( void);
1231
1232 void
1233 AFSWaitOnQueuedFlushes( IN AFSFcb *Fcb);
1234
1235 void
1236 AFSWaitOnQueuedReleases( void);
1237
1238 BOOLEAN
1239 AFSIsEqualFID( IN AFSFileID *FileId1,
1240                IN AFSFileID *FileId2);
1241
1242 NTSTATUS
1243 AFSResetDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB);
1244
1245 NTSTATUS
1246 AFSEnumerateGlobalRoot( IN GUID *AuthGroup);
1247
1248 BOOLEAN
1249 AFSIsRelativeName( IN UNICODE_STRING *Name);
1250
1251 BOOLEAN
1252 AFSIsAbsoluteAFSName( IN UNICODE_STRING *Name);
1253
1254 void
1255 AFSUpdateName( IN UNICODE_STRING *Name);
1256
1257 NTSTATUS
1258 AFSUpdateTargetName( IN OUT UNICODE_STRING *TargetName,
1259                      IN OUT ULONG *Flags,
1260                      IN WCHAR *NameBuffer,
1261                      IN USHORT NameLength);
1262
1263 AFSNameArrayHdr *
1264 AFSInitNameArray( IN AFSDirectoryCB *DirectoryCB,
1265                   IN ULONG InitialElementCount);
1266
1267 NTSTATUS
1268 AFSPopulateNameArray( IN AFSNameArrayHdr *NameArray,
1269                       IN UNICODE_STRING *Path,
1270                       IN AFSDirectoryCB *DirectoryCB);
1271
1272 NTSTATUS
1273 AFSPopulateNameArrayFromRelatedArray( IN AFSNameArrayHdr *NameArray,
1274                                       IN AFSNameArrayHdr *RelatedNameArray,
1275                                       IN AFSDirectoryCB *DirectoryCB);
1276
1277 NTSTATUS
1278 AFSFreeNameArray( IN AFSNameArrayHdr *NameArray);
1279
1280 NTSTATUS
1281 AFSInsertNextElement( IN AFSNameArrayHdr *NameArray,
1282                       IN AFSDirectoryCB *DirEntry);
1283
1284 AFSDirectoryCB *
1285 AFSBackupEntry( IN AFSNameArrayHdr *NameArray);
1286
1287 AFSDirectoryCB *
1288 AFSGetParentEntry( IN AFSNameArrayHdr *NameArray);
1289
1290 void
1291 AFSResetNameArray( IN AFSNameArrayHdr *NameArray,
1292                    IN AFSDirectoryCB *DirEntry);
1293
1294 void
1295 AFSDumpNameArray( IN IN AFSNameArrayHdr *NameArray);
1296
1297 void
1298 AFSSetEnumerationEvent( IN AFSFcb *Fcb);
1299
1300 void
1301 AFSClearEnumerationEvent( IN AFSFcb *Fcb);
1302
1303 BOOLEAN
1304 AFSIsEnumerationInProcess( IN AFSObjectInfoCB *ObjectInfo);
1305
1306 NTSTATUS
1307 AFSVerifyVolume( IN ULONGLONG ProcessId,
1308                  IN AFSVolumeCB *VolumeCB);
1309
1310 NTSTATUS
1311 AFSInitPIOCtlDirectoryCB( IN AFSObjectInfoCB *ObjectInfo);
1312
1313 NTSTATUS
1314 AFSRetrieveFileAttributes( IN AFSDirectoryCB *ParentDirectoryCB,
1315                            IN AFSDirectoryCB *DirectoryCB,
1316                            IN UNICODE_STRING *ParentPathName,
1317                            IN AFSNameArrayHdr *RelatedNameArray,
1318                            IN GUID           *AuthGroup,
1319                            OUT AFSFileInfoCB *FileInfo);
1320
1321 AFSObjectInfoCB *
1322 AFSAllocateObjectInfo( IN AFSObjectInfoCB *ParentObjectInfo,
1323                        IN ULONGLONG HashIndex);
1324
1325 LONG
1326 AFSObjectInfoIncrement( IN AFSObjectInfoCB *ObjectInfo);
1327
1328 LONG
1329 AFSObjectInfoDecrement( IN AFSObjectInfoCB *ObjectInfo);
1330
1331 void
1332 AFSDeleteObjectInfo( IN AFSObjectInfoCB *ObjectInfo);
1333
1334 NTSTATUS
1335 AFSEvaluateRootEntry( IN AFSDirectoryCB *DirectoryCB,
1336                       OUT AFSDirectoryCB **TargetDirEntry);
1337
1338 NTSTATUS
1339 AFSCleanupFcb( IN AFSFcb *Fcb,
1340                IN BOOLEAN ForceFlush);
1341
1342 NTSTATUS
1343 AFSUpdateDirEntryName( IN AFSDirectoryCB *DirectoryCB,
1344                        IN UNICODE_STRING *NewFileName);
1345
1346 NTSTATUS
1347 AFSReadCacheFile( IN void *ReadBuffer,
1348                   IN LARGE_INTEGER *ReadOffset,
1349                   IN ULONG RequestedDataLength,
1350                   IN OUT PULONG BytesRead);
1351
1352 NTSTATUS
1353 AFSIrpComplete( IN PDEVICE_OBJECT DeviceObject,
1354                 IN PIRP           Irp,
1355                 IN PVOID          Context);
1356
1357 BOOLEAN
1358 AFSIsDirectoryEmptyForDelete( IN AFSFcb *Fcb);
1359
1360 void
1361 AFSRemoveNameEntry( IN AFSObjectInfoCB *ParentObjectInfo,
1362                     IN AFSDirectoryCB *DirEntry);
1363
1364 LARGE_INTEGER
1365 AFSGetAuthenticationId( void);
1366
1367 void
1368 AFSUnwindFileInfo( IN AFSFcb *Fcb,
1369                    IN AFSCcb *Ccb);
1370
1371 BOOLEAN
1372 AFSValidateDirList( IN AFSObjectInfoCB *ObjectInfo);
1373
1374 PFILE_OBJECT
1375 AFSReferenceCacheFileObject( void);
1376
1377 void
1378 AFSReleaseCacheFileObject( IN PFILE_OBJECT CacheFileObject);
1379
1380 NTSTATUS
1381 AFSInitializeLibrary( IN AFSLibraryInitCB *LibraryInit);
1382
1383 NTSTATUS
1384 AFSCloseLibrary( void);
1385
1386 NTSTATUS
1387 AFSDefaultLogMsg( IN ULONG Subsystem,
1388                   IN ULONG Level,
1389                   IN PCCH Format,
1390                   ...);
1391
1392 NTSTATUS
1393 AFSGetObjectStatus( IN AFSGetStatusInfoCB *GetStatusInfo,
1394                     IN ULONG InputBufferLength,
1395                     IN AFSStatusInfoCB *StatusInfo,
1396                     OUT ULONG *ReturnLength);
1397
1398 NTSTATUS
1399 AFSCheckSymlinkAccess( IN AFSDirectoryCB *ParentDirectoryCB,
1400                        IN UNICODE_STRING *ComponentName);
1401
1402 NTSTATUS
1403 AFSRetrieveFinalComponent( IN UNICODE_STRING *FullPathName,
1404                            OUT UNICODE_STRING *ComponentName);
1405
1406 void
1407 AFSDumpTraceFiles_Default( void);
1408
1409 void *
1410 AFSLibExAllocatePoolWithTag( IN POOL_TYPE  PoolType,
1411                              IN SIZE_T  NumberOfBytes,
1412                              IN ULONG  Tag);
1413
1414 BOOLEAN
1415 AFSValidNameFormat( IN UNICODE_STRING *FileName);
1416
1417 NTSTATUS
1418 AFSCreateDefaultSecurityDescriptor( void);
1419
1420 void
1421 AFSRetrieveParentPath( IN UNICODE_STRING *FullFileName,
1422                        OUT UNICODE_STRING *ParentPath);
1423
1424 NTSTATUS
1425 AFSRetrieveValidAuthGroup( IN AFSFcb *Fcb,
1426                            IN AFSObjectInfoCB *ObjectInfo,
1427                            IN BOOLEAN WriteAccess,
1428                            OUT GUID *AuthGroup);
1429
1430 NTSTATUS
1431 AFSPerformObjectInvalidate( IN AFSObjectInfoCB *ObjectInfo,
1432                             IN ULONG InvalidateReason);
1433
1434 //
1435 // AFSWorker.cpp Prototypes
1436 //
1437
1438 NTSTATUS
1439 AFSInitializeWorkerPool( void);
1440
1441 NTSTATUS
1442 AFSRemoveWorkerPool( void);
1443
1444 NTSTATUS
1445 AFSInitWorkerThread( IN AFSWorkQueueContext *PoolContext,
1446                      IN PKSTART_ROUTINE WorkerRoutine);
1447
1448 NTSTATUS
1449 AFSInitVolumeWorker( IN AFSVolumeCB *VolumeCB);
1450
1451 NTSTATUS
1452 AFSShutdownWorkerThread( IN AFSWorkQueueContext *PoolContext);
1453
1454 NTSTATUS
1455 AFSShutdownIOWorkerThread( IN AFSWorkQueueContext *PoolContext);
1456
1457 NTSTATUS
1458 AFSShutdownVolumeWorker( IN AFSVolumeCB *VolumeCB);
1459
1460 void
1461 AFSWorkerThread( IN PVOID Context);
1462
1463 void
1464 AFSIOWorkerThread( IN PVOID Context);
1465
1466 void
1467 AFSPrimaryVolumeWorkerThread( IN PVOID Context);
1468
1469 NTSTATUS
1470 AFSInsertWorkitem( IN AFSWorkItem *WorkItem);
1471
1472 NTSTATUS
1473 AFSInsertIOWorkitem( IN AFSWorkItem *WorkItem);
1474
1475 NTSTATUS
1476 AFSInsertWorkitemAtHead( IN AFSWorkItem *WorkItem);
1477
1478 AFSWorkItem *
1479 AFSRemoveWorkItem( void);
1480
1481 AFSWorkItem *
1482 AFSRemoveIOWorkItem( void);
1483
1484 NTSTATUS
1485 AFSQueueWorkerRequest( IN AFSWorkItem *WorkItem);
1486
1487 NTSTATUS
1488 AFSQueueIOWorkerRequest( IN AFSWorkItem *WorkItem);
1489
1490 NTSTATUS
1491 AFSQueueWorkerRequestAtHead( IN AFSWorkItem *WorkItem);
1492
1493 NTSTATUS
1494 AFSShutdownVolumeWorker( IN AFSVolumeCB *VolumeCB);
1495
1496 NTSTATUS
1497 AFSQueueFlushExtents( IN AFSFcb *Fcb,
1498                       IN GUID *AuthGroup);
1499
1500 NTSTATUS
1501 AFSQueueGlobalRootEnumeration( void);
1502
1503 NTSTATUS
1504 AFSQueuePurgeObject( IN AFSFcb *Fcb);
1505
1506 NTSTATUS
1507 AFSQueueStartIos( IN PFILE_OBJECT CacheFileObject,
1508                   IN UCHAR FunctionCode,
1509                   IN ULONG RequestFLags,
1510                   IN AFSIoRun *IoRuns,
1511                   IN ULONG RunCount,
1512                   IN AFSGatherIo *GatherIo);
1513
1514 NTSTATUS
1515 AFSQueueInvalidateObject( IN AFSObjectInfoCB *ObjectInfo,
1516                           IN ULONG InvalidateReason);
1517
1518 //
1519 // AFSMD5Support.cpp Prototypes
1520 //
1521
1522 void
1523 AFSGenerateMD5( IN char *DataBuffer,
1524                 IN ULONG Length,
1525                 OUT UCHAR *MD5Digest);
1526
1527 };
1528
1529 #endif /* _AFS_COMMON_H */