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