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