Windows: Call CcDeferWrite rather than loop
[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                IN LONG VolumeReferenceReason,
531                OUT AFSVolumeCB **VolumeCB);
532
533 NTSTATUS
534 AFSRemoveVolume( IN AFSVolumeCB *VolumeCB);
535
536 LONG
537 AFSVolumeIncrement( IN AFSVolumeCB *VolumeCB,
538                     IN LONG         Reason);
539
540 LONG
541 AFSVolumeDecrement( IN AFSVolumeCB *VolumeCB,
542                     IN LONG         Reason);
543
544 NTSTATUS
545 AFSInitRootFcb( IN ULONGLONG ProcessID,
546                 IN AFSVolumeCB *VolumeCB);
547
548 void
549 AFSRemoveRootFcb( IN AFSVolumeCB *VolumeCB);
550
551 NTSTATUS
552 AFSInitCcb( IN OUT AFSCcb **Ccb,
553             IN     AFSDirectoryCB *DirectoryCB,
554             IN     ACCESS_MASK     GrantedAccess,
555             IN     ULONG           FileAccess);
556
557 void
558 AFSRemoveFcb( IN AFSFcb **Fcb);
559
560 void
561 AFSRemoveCcb( IN AFSFcb *Fcb,
562               IN AFSCcb *Ccb);
563
564 NTSTATUS
565 AFSInsertCcb( IN AFSFcb *Fcb,
566               IN AFSCcb *Ccb);
567
568 //
569 // AFSNameSupport.cpp Prototypes
570 //
571
572 NTSTATUS
573 AFSLocateNameEntry( IN GUID *AuthGroup,
574                     IN PFILE_OBJECT FileObject,
575                     IN OUT UNICODE_STRING *RootPathName,
576                     IN UNICODE_STRING *ParsedPathName,
577                     IN AFSNameArrayHdr *NameArray,
578                     IN ULONG Flags,
579                     IN AFSVolumeCB *VolumeCB,
580                     IN AFSDirectoryCB *ParentDirectoryCB,
581                     OUT AFSVolumeCB **OutVolumeCB,
582                     OUT LONG *OutVolumeReferenceReason,
583                     OUT AFSDirectoryCB **OutParentDirectoryCB,
584                     OUT AFSDirectoryCB **OutDirectoryCB,
585                     OUT PUNICODE_STRING ComponentName);
586
587 NTSTATUS
588 AFSCreateDirEntry( IN GUID            *AuthGroup,
589                    IN AFSObjectInfoCB *ParentObjectInfo,
590                    IN AFSDirectoryCB *ParentDirCB,
591                    IN PUNICODE_STRING FileName,
592                    IN PUNICODE_STRING ComponentName,
593                    IN ULONG Attributes,
594                    IN OUT AFSDirectoryCB **DirEntry);
595
596 void
597 AFSInsertDirectoryNode( IN AFSObjectInfoCB *ParentObjectInfo,
598                         IN AFSDirectoryCB *DirEntry,
599                         IN BOOLEAN InsertInEnumList);
600
601 void
602 AFSDeleteDirEntry( IN AFSObjectInfoCB *ParentObjectInfo,
603                    IN AFSDirectoryCB *DirEntry);
604
605 NTSTATUS
606 AFSRemoveDirNodeFromParent( IN AFSObjectInfoCB *ParentObjectInfo,
607                             IN AFSDirectoryCB *DirEntry,
608                             IN BOOLEAN RemoveFromEnumList);
609
610 NTSTATUS
611 AFSFixupTargetName( IN OUT PUNICODE_STRING FileName,
612                     IN OUT PUNICODE_STRING TargetFileName);
613
614 NTSTATUS
615 AFSParseName( IN PIRP Irp,
616               IN GUID *AuthGroup,
617               OUT PUNICODE_STRING FileName,
618               OUT PUNICODE_STRING ParsedFileName,
619               OUT PUNICODE_STRING RootFileName,
620               OUT ULONG *ParseFlags,
621               OUT AFSVolumeCB **VolumeCB,
622               OUT AFSDirectoryCB **ParentDirectoryCB,
623               OUT AFSNameArrayHdr **NameArray);
624
625 NTSTATUS
626 AFSCheckCellName( IN GUID *AuthGroup,
627                   IN UNICODE_STRING *CellName,
628                   OUT AFSDirectoryCB **ShareDirEntry);
629
630 NTSTATUS
631 AFSBuildMountPointTarget( IN GUID *AuthGroup,
632                           IN AFSDirectoryCB *DirectoryCB,
633                           OUT AFSVolumeCB **VolumeCB);
634
635 NTSTATUS
636 AFSBuildRootVolume( IN GUID *AuthGroup,
637                     IN AFSFileID *FileId,
638                     OUT AFSVolumeCB **TargetVolumeCB);
639
640 NTSTATUS
641 AFSProcessDFSLink( IN AFSDirectoryCB *DirEntry,
642                    IN PFILE_OBJECT FileObject,
643                    IN UNICODE_STRING *RemainingPath,
644                    IN GUID *AuthGroup);
645
646 //
647 // AFSNetworkProviderSupport.cpp
648 //
649
650 NTSTATUS
651 AFSAddConnection( IN AFSNetworkProviderConnectionCB *ConnectCB,
652                   IN OUT PULONG ResultStatus,
653                   IN OUT ULONG_PTR *ReturnOutputBufferLength);
654
655 NTSTATUS
656 AFSCancelConnection( IN AFSNetworkProviderConnectionCB *ConnectCB,
657                      IN OUT AFSCancelConnectionResultCB *ConnectionResult,
658                      IN OUT ULONG_PTR *ReturnOutputBufferLength);
659
660 NTSTATUS
661 AFSGetConnection( IN AFSNetworkProviderConnectionCB *ConnectCB,
662                   IN OUT WCHAR *RemoteName,
663                   IN ULONG RemoteNameBufferLength,
664                   IN OUT ULONG_PTR *ReturnOutputBufferLength);
665
666 NTSTATUS
667 AFSListConnections( IN OUT AFSNetworkProviderConnectionCB *ConnectCB,
668                     IN ULONG ConnectionBufferLength,
669                     IN OUT ULONG_PTR *ReturnOutputBufferLength);
670
671 void
672 AFSInitializeConnectionInfo( IN AFSProviderConnectionCB *Connection,
673                              IN ULONG DisplayType);
674
675 AFSProviderConnectionCB *
676 AFSLocateEnumRootEntry( IN UNICODE_STRING *RemoteName);
677
678 NTSTATUS
679 AFSEnumerateConnection( IN OUT AFSNetworkProviderConnectionCB *ConnectCB,
680                         IN AFSProviderConnectionCB *RootConnection,
681                         IN ULONG BufferLength,
682                         OUT PULONG CopiedLength);
683
684 NTSTATUS
685 AFSGetConnectionInfo( IN AFSNetworkProviderConnectionCB *ConnectCB,
686                       IN ULONG BufferLength,
687                       IN OUT ULONG_PTR *ReturnOutputBufferLength);
688
689 BOOLEAN
690 AFSIsDriveMapped( IN WCHAR DriveMapping);
691
692 //
693 // AFSRead.cpp Prototypes
694 //
695
696 NTSTATUS
697 AFSCommonRead( IN PDEVICE_OBJECT DeviceObject,
698                IN PIRP Irp,
699                IN HANDLE OnBehalfOf);
700
701 NTSTATUS
702 AFSRead( IN PDEVICE_OBJECT DeviceObject,
703          IN PIRP Irp);
704
705
706 NTSTATUS
707 AFSIOCtlRead( IN PDEVICE_OBJECT DeviceObject,
708               IN PIRP Irp);
709
710 NTSTATUS
711 AFSShareRead( IN PDEVICE_OBJECT DeviceObject,
712               IN PIRP Irp);
713
714 //
715 // AFSWrite.cpp Prototypes
716 //
717
718 NTSTATUS
719 AFSCommonWrite( IN PDEVICE_OBJECT DeviceObject,
720                 IN PIRP Irp,
721                 IN HANDLE CallingUser,
722                 IN BOOLEAN bRetry);
723
724 NTSTATUS
725 AFSWrite( IN PDEVICE_OBJECT DeviceObject,
726                 IN PIRP Irp);
727
728 NTSTATUS
729 AFSIOCtlWrite( IN PDEVICE_OBJECT DeviceObject,
730                IN PIRP Irp);
731
732 NTSTATUS
733 AFSShareWrite( IN PDEVICE_OBJECT DeviceObject,
734                IN PIRP Irp);
735
736 NTSTATUS
737 AFSDeferWrite( IN PDEVICE_OBJECT DeviceObject,
738                IN PFILE_OBJECT FileObject,
739                IN HANDLE CallingUser,
740                IN PIRP Irp,
741                IN ULONG BytesToWrite,
742                IN BOOLEAN Retrying);
743
744 //
745 // AFSFileInfo.cpp Prototypes
746 //
747
748 NTSTATUS
749 AFSQueryFileInfo( IN PDEVICE_OBJECT DeviceObject,
750                   IN PIRP Irp);
751
752 NTSTATUS
753 AFSQueryBasicInfo( IN PIRP Irp,
754                    IN AFSDirectoryCB *DirectoryCB,
755                    IN OUT PFILE_BASIC_INFORMATION Buffer,
756                    IN OUT PLONG Length);
757
758 NTSTATUS
759 AFSQueryStandardInfo( IN PIRP Irp,
760                       IN AFSDirectoryCB *DirectoryCB,
761                       IN OUT PFILE_STANDARD_INFORMATION Buffer,
762                       IN OUT PLONG Length);
763
764 NTSTATUS
765 AFSQueryInternalInfo( IN PIRP Irp,
766                       IN AFSFcb *Fcb,
767                       IN OUT PFILE_INTERNAL_INFORMATION Buffer,
768                       IN OUT PLONG Length);
769
770 NTSTATUS
771 AFSQueryEaInfo( IN PIRP Irp,
772                 IN AFSDirectoryCB *DirectoryCB,
773                 IN OUT PFILE_EA_INFORMATION Buffer,
774                 IN OUT PLONG Length);
775
776 NTSTATUS
777 AFSQueryPositionInfo( IN PIRP Irp,
778                       IN AFSFcb *Fcb,
779                       IN OUT PFILE_POSITION_INFORMATION Buffer,
780                       IN OUT PLONG Length);
781
782 NTSTATUS
783 AFSQueryNameInfo( IN PIRP Irp,
784                   IN AFSDirectoryCB *DirectoryCB,
785                   IN OUT PFILE_NAME_INFORMATION Buffer,
786                   IN OUT PLONG Length);
787
788 NTSTATUS
789 AFSQueryShortNameInfo( IN PIRP Irp,
790                        IN AFSDirectoryCB *DirectoryCB,
791                        IN OUT PFILE_NAME_INFORMATION Buffer,
792                        IN OUT PLONG Length);
793
794 NTSTATUS
795 AFSQueryNetworkInfo( IN PIRP Irp,
796                      IN AFSDirectoryCB *DirectoryCB,
797                      IN OUT PFILE_NETWORK_OPEN_INFORMATION Buffer,
798                      IN OUT PLONG Length);
799
800 NTSTATUS
801 AFSQueryStreamInfo( IN PIRP Irp,
802                     IN AFSDirectoryCB *DirectoryCB,
803                     IN OUT FILE_STREAM_INFORMATION *Buffer,
804                     IN OUT PLONG Length);
805
806 NTSTATUS
807 AFSQueryAccess( IN PIRP Irp,
808                 IN AFSFcb *Fcb,
809                 IN OUT PFILE_ACCESS_INFORMATION Buffer,
810                 IN OUT PLONG Length);
811
812 NTSTATUS
813 AFSQueryMode( IN PIRP Irp,
814               IN AFSFcb *Fcb,
815               IN OUT PFILE_MODE_INFORMATION Buffer,
816               IN OUT PLONG Length);
817
818 NTSTATUS
819 AFSQueryAlignment( IN PIRP Irp,
820                    IN AFSFcb *Fcb,
821                    IN OUT PFILE_ALIGNMENT_INFORMATION Buffer,
822                    IN OUT PLONG Length);
823
824 NTSTATUS
825 AFSQueryAttribTagInfo( IN PIRP Irp,
826                        IN AFSDirectoryCB *DirectoryCB,
827                        IN OUT FILE_ATTRIBUTE_TAG_INFORMATION *Buffer,
828                        IN OUT PLONG Length);
829
830 NTSTATUS
831 AFSQueryRemoteProtocolInfo( IN PIRP Irp,
832                             IN AFSDirectoryCB *DirectoryCB,
833                             IN OUT FILE_REMOTE_PROTOCOL_INFORMATION *Buffer,
834                             IN OUT PLONG Length);
835
836 NTSTATUS
837 AFSQueryPhysicalNameInfo( IN PIRP Irp,
838                           IN AFSDirectoryCB *DirectoryCB,
839                           IN OUT PFILE_NETWORK_PHYSICAL_NAME_INFORMATION Buffer,
840                           IN OUT PLONG Length);
841
842 NTSTATUS
843 AFSSetFileInfo( IN PDEVICE_OBJECT DeviceObject,
844                 IN PIRP Irp);
845
846 NTSTATUS
847 AFSSetBasicInfo( IN PIRP Irp,
848                  IN AFSDirectoryCB *DirectoryCB);
849
850 NTSTATUS
851 AFSSetDispositionInfo( IN PIRP Irp,
852                        IN AFSDirectoryCB *DirectoryCB);
853
854 NTSTATUS
855 AFSSetRenameInfo( IN PIRP Irp);
856
857 NTSTATUS
858 AFSSetFileLinkInfo( IN PIRP Irp);
859
860 NTSTATUS
861 AFSSetPositionInfo( IN PIRP Irp,
862                     IN AFSDirectoryCB *DirectoryCB);
863
864 NTSTATUS
865 AFSSetAllocationInfo( IN PIRP Irp,
866                       IN AFSDirectoryCB *DirectoryCB);
867
868 NTSTATUS
869 AFSSetEndOfFileInfo( IN PIRP Irp,
870                      IN AFSDirectoryCB *DirectoryCB);
871
872 NTSTATUS
873 AFSProcessShareSetInfo( IN IRP *Irp,
874                         IN AFSFcb *Fcb,
875                         IN AFSCcb *Ccb);
876
877 NTSTATUS
878 AFSProcessShareQueryInfo( IN IRP *Irp,
879                           IN AFSFcb *Fcb,
880                           IN AFSCcb *Ccb);
881
882 NTSTATUS
883 AFSProcessPIOCtlQueryInfo( IN IRP *Irp,
884                            IN AFSFcb *Fcb,
885                            IN AFSCcb *Ccb,
886                            IN OUT LONG *Length);
887
888 //
889 // AFSEa.cpp Prototypes
890 //
891
892 NTSTATUS
893 AFSQueryEA( IN PDEVICE_OBJECT DeviceObject,
894             IN PIRP Irp);
895
896 NTSTATUS
897 AFSSetEA( IN PDEVICE_OBJECT DeviceObject,
898           IN PIRP Irp);
899
900 //
901 // AFSFlushBuffers.cpp Prototypes
902 //
903
904 NTSTATUS
905 AFSFlushBuffers( IN PDEVICE_OBJECT DeviceObject,
906                  IN PIRP Irp);
907
908 //
909 // AFSVolumeInfo.cpp Prototypes
910 //
911
912 NTSTATUS
913 AFSQueryVolumeInfo( IN PDEVICE_OBJECT DeviceObject,
914                     IN PIRP Irp);
915
916 NTSTATUS
917 AFSSetVolumeInfo( IN PDEVICE_OBJECT DeviceObject,
918                   IN PIRP Irp);
919
920 NTSTATUS
921 AFSQueryFsVolumeInfo( IN AFSVolumeInfoCB *VolumeInfo,
922                       IN PFILE_FS_VOLUME_INFORMATION Buffer,
923                       IN OUT PULONG Length);
924
925 NTSTATUS
926 AFSQueryFsSizeInfo( IN AFSVolumeInfoCB *VolumeInfo,
927                     IN PFILE_FS_SIZE_INFORMATION Buffer,
928                     IN OUT PULONG Length);
929
930 NTSTATUS
931 AFSQueryFsDeviceInfo( IN AFSVolumeInfoCB *VolumeInfo,
932                       IN PFILE_FS_DEVICE_INFORMATION Buffer,
933                       IN OUT PULONG Length);
934
935 NTSTATUS
936 AFSQueryFsAttributeInfo( IN AFSVolumeInfoCB *VolumeInfo,
937                          IN PFILE_FS_ATTRIBUTE_INFORMATION Buffer,
938                          IN OUT PULONG Length);
939
940 NTSTATUS
941 AFSQueryFsFullSizeInfo( IN AFSVolumeInfoCB *VolumeInfo,
942                         IN PFILE_FS_FULL_SIZE_INFORMATION Buffer,
943                         IN OUT PULONG Length);
944
945 //
946 // AFSDirControl.cpp Prototypes
947 //
948
949 NTSTATUS
950 AFSDirControl( IN PDEVICE_OBJECT DeviceObject,
951                IN PIRP Irp);
952
953 NTSTATUS
954 AFSQueryDirectory( IN PIRP Irp);
955
956 NTSTATUS
957 AFSNotifyChangeDirectory( IN PIRP Irp);
958
959 AFSDirectoryCB *
960 AFSLocateNextDirEntry( IN AFSObjectInfoCB *ObjectInfo,
961                        IN AFSCcb *Ccb);
962
963 AFSDirectoryCB *
964 AFSLocateDirEntryByIndex( IN AFSObjectInfoCB *ObjectInfo,
965                           IN AFSCcb *Ccb,
966                           IN ULONG DirIndex);
967
968 NTSTATUS
969 AFSSnapshotDirectory( IN AFSFcb *Fcb,
970                       IN AFSCcb *Ccb,
971                       IN BOOLEAN ResetIndex);
972
973 NTSTATUS
974 AFSFsRtlNotifyFullChangeDirectory( IN AFSObjectInfoCB *ObjectInfo,
975                                    IN AFSCcb *Context,
976                                    IN BOOLEAN WatchTree,
977                                    IN ULONG CompletionFilter,
978                                    IN PIRP NotifyIrp);
979
980 void
981 AFSFsRtlNotifyFullReportChange( IN AFSObjectInfoCB *ObjectInfo,
982                                 IN AFSCcb *Ccb,
983                                 IN ULONG NotifyFilter,
984                                 IN ULONG NotificationAction);
985
986 BOOLEAN
987 AFSNotifyReportChangeCallback( IN void *NotifyContext,
988                                IN void *FilterContext);
989
990 BOOLEAN
991 AFSIsNameInSnapshot( IN AFSSnapshotHdr *SnapshotHdr,
992                      IN ULONG HashIndex);
993
994 //
995 // AFSFSControl.cpp Prototypes
996 //
997
998 NTSTATUS
999 AFSFSControl( IN PDEVICE_OBJECT DeviceObject,
1000               IN PIRP Irp);
1001
1002 NTSTATUS
1003 AFSProcessUserFsRequest( IN PIRP Irp);
1004
1005 NTSTATUS
1006 AFSProcessShareFsCtrl( IN IRP *Irp,
1007                        IN AFSFcb *Fcb,
1008                        IN AFSCcb *Ccb);
1009
1010 //
1011 // AFSDevControl.cpp Prototypes
1012 //
1013
1014 NTSTATUS
1015 AFSDevControl( IN PDEVICE_OBJECT DeviceObject,
1016                IN PIRP Irp);
1017
1018 //
1019 // AFSInternalDevControl.cpp Prototypes
1020 //
1021
1022 NTSTATUS
1023 AFSInternalDevControl( IN PDEVICE_OBJECT DeviceObject,
1024                        IN PIRP Irp);
1025
1026 //
1027 // AFSShutdown.cpp Prototypes
1028 //
1029
1030 NTSTATUS
1031 AFSShutdown( IN PDEVICE_OBJECT DeviceObject,
1032              IN PIRP Irp);
1033
1034
1035 NTSTATUS
1036 AFSShutdownFilesystem( void);
1037
1038 //
1039 // AFSLockControl.cpp Prototypes
1040 //
1041
1042 NTSTATUS
1043 AFSLockControl( IN PDEVICE_OBJECT DeviceObject,
1044                 IN PIRP Irp);
1045
1046 //
1047 // AFSCleanup.cpp Prototypes
1048 //
1049
1050 NTSTATUS
1051 AFSCleanup( IN PDEVICE_OBJECT DeviceObject,
1052             IN PIRP Irp);
1053
1054 //
1055 // AFSSecurity.cpp Prototypes
1056 //
1057
1058 NTSTATUS
1059 AFSQuerySecurity( IN PDEVICE_OBJECT DeviceObject,
1060                   IN PIRP Irp);
1061
1062 NTSTATUS
1063 AFSSetSecurity( IN PDEVICE_OBJECT DeviceObject,
1064                 IN PIRP Irp);
1065
1066 //
1067 // AFSSystemControl.cpp Prototypes
1068 //
1069
1070 NTSTATUS
1071 AFSSystemControl( IN PDEVICE_OBJECT DeviceObject,
1072                   IN PIRP Irp);
1073
1074 //
1075 // AFSQuota.cpp Prototypes
1076 //
1077
1078 NTSTATUS
1079 AFSQueryQuota( IN PDEVICE_OBJECT DeviceObject,
1080                IN PIRP Irp);
1081
1082 NTSTATUS
1083 AFSSetQuota( IN PDEVICE_OBJECT DeviceObject,
1084              IN PIRP Irp);
1085
1086 //
1087 // AFSGeneric.cpp Prototypes
1088 //
1089
1090 ULONG
1091 AFSExceptionFilter( IN CHAR *FunctionString,
1092                     IN ULONG Code,
1093                     IN PEXCEPTION_POINTERS ExceptPtrs);
1094
1095 BOOLEAN
1096 AFSAcquireExcl( IN PERESOURCE Resource,
1097                 IN BOOLEAN wait);
1098
1099 BOOLEAN
1100 AFSAcquireSharedStarveExclusive( IN PERESOURCE Resource,
1101                                  IN BOOLEAN Wait);
1102
1103 BOOLEAN
1104 AFSAcquireShared( IN PERESOURCE Resource,
1105                   IN BOOLEAN wait);
1106
1107 void
1108 AFSReleaseResource( IN PERESOURCE Resource);
1109
1110 void
1111 AFSConvertToShared( IN PERESOURCE Resource);
1112
1113 void
1114 AFSCompleteRequest( IN PIRP Irp,
1115                     IN ULONG Status);
1116
1117 ULONG
1118 AFSGenerateCRC( IN PUNICODE_STRING FileName,
1119                 IN BOOLEAN UpperCaseName);
1120
1121 void *
1122 AFSLockSystemBuffer( IN PIRP Irp,
1123                      IN ULONG Length);
1124
1125 void *
1126 AFSLockUserBuffer( IN void *UserBuffer,
1127                    IN ULONG BufferLength,
1128                    OUT MDL ** Mdl);
1129
1130 void *
1131 AFSMapToService( IN PIRP Irp,
1132                  IN ULONG ByteCount);
1133
1134 NTSTATUS
1135 AFSUnmapServiceMappedBuffer( IN void *MappedBuffer,
1136                              IN PMDL Mdl);
1137
1138 NTSTATUS
1139 AFSInitializeLibraryDevice( void);
1140
1141 NTSTATUS
1142 AFSRemoveLibraryDevice( void);
1143
1144 NTSTATUS
1145 AFSDefaultDispatch( IN PDEVICE_OBJECT DeviceObject,
1146                     IN PIRP Irp);
1147
1148 NTSTATUS
1149 AFSInitializeGlobalDirectoryEntries( void);
1150
1151 AFSDirectoryCB *
1152 AFSInitDirEntry( IN AFSObjectInfoCB *ParentObjectInfo,
1153                  IN PUNICODE_STRING FileName,
1154                  IN PUNICODE_STRING TargetName,
1155                  IN AFSDirEnumEntry *DirEnumEntry,
1156                  IN ULONG FileIndex);
1157
1158 BOOLEAN
1159 AFSCheckForReadOnlyAccess( IN ACCESS_MASK DesiredAccess,
1160                            IN BOOLEAN DirectoryEntry);
1161
1162 NTSTATUS
1163 AFSEvaluateNode( IN GUID *AuthGroup,
1164                  IN AFSDirectoryCB *DirEntry);
1165
1166 NTSTATUS
1167 AFSValidateSymLink( IN GUID *AuthGroup,
1168                     IN AFSDirectoryCB *DirEntry);
1169
1170 NTSTATUS
1171 AFSInvalidateCache( IN AFSInvalidateCacheCB *InvalidateCB);
1172
1173 NTSTATUS
1174 AFSInvalidateObject( IN OUT AFSObjectInfoCB **ppObjectInfo,
1175                      IN     ULONG Reason);
1176
1177 BOOLEAN
1178 AFSIsChildOfParent( IN AFSFcb *Dcb,
1179                     IN AFSFcb *Fcb);
1180
1181 inline
1182 ULONGLONG
1183 AFSCreateHighIndex( IN AFSFileID *FileID);
1184
1185 inline
1186 ULONGLONG
1187 AFSCreateLowIndex( IN AFSFileID *FileID);
1188
1189 BOOLEAN
1190 AFSCheckAccess( IN ACCESS_MASK DesiredAccess,
1191                 IN ACCESS_MASK GrantedAccess,
1192                 IN BOOLEAN DirectoryEntry);
1193
1194 NTSTATUS
1195 AFSGetDriverStatus( IN AFSDriverStatusRespCB *DriverStatus);
1196
1197 NTSTATUS
1198 AFSSubstituteSysName( IN UNICODE_STRING *ComponentName,
1199                       IN UNICODE_STRING *SubstituteName,
1200                       IN ULONG StringIndex);
1201
1202 NTSTATUS
1203 AFSSubstituteNameInPath( IN OUT UNICODE_STRING *FullPathName,
1204                          IN OUT UNICODE_STRING *ComponentName,
1205                          IN UNICODE_STRING *SubstituteName,
1206                          IN OUT UNICODE_STRING *RemainingPath,
1207                          IN BOOLEAN FreePathName);
1208
1209 NTSTATUS
1210 AFSInvalidateVolume( IN AFSVolumeCB *VolumeCB,
1211                      IN ULONG Reason);
1212
1213 VOID
1214 AFSInvalidateAllVolumes( VOID);
1215
1216 NTSTATUS
1217 AFSVerifyEntry( IN GUID *AuthGroup,
1218                 IN AFSDirectoryCB *DirectoryCB);
1219
1220 NTSTATUS
1221 AFSSetVolumeState( IN AFSVolumeStatusCB *VolumeStatus);
1222
1223 NTSTATUS
1224 AFSSetNetworkState( IN AFSNetworkStatusCB *NetworkStatus);
1225
1226 NTSTATUS
1227 AFSValidateDirectoryCache( IN AFSObjectInfoCB *ObjectInfo,
1228                            IN GUID *AuthGroup);
1229
1230 BOOLEAN
1231 AFSIsVolumeFID( IN AFSFileID *FileID);
1232
1233 BOOLEAN
1234 AFSIsFinalNode( IN AFSFcb *Fcb);
1235
1236 NTSTATUS
1237 AFSUpdateMetaData( IN AFSDirectoryCB *DirEntry,
1238                    IN AFSDirEnumEntry *DirEnumEntry);
1239
1240 NTSTATUS
1241 AFSValidateEntry( IN AFSDirectoryCB *DirEntry,
1242                   IN GUID *AuthGroup,
1243                   IN BOOLEAN FastCall,
1244                   IN BOOLEAN SafeToPurge);
1245
1246 AFSDirectoryCB *
1247 AFSGetSpecialShareNameEntry( IN UNICODE_STRING *ShareName,
1248                              IN UNICODE_STRING *SecondaryName);
1249
1250 NTSTATUS
1251 AFSInitializeSpecialShareNameList( void);
1252
1253 void
1254 AFSWaitOnQueuedFlushes( IN AFSFcb *Fcb);
1255
1256 void
1257 AFSWaitOnQueuedReleases( void);
1258
1259 BOOLEAN
1260 AFSIsEqualFID( IN AFSFileID *FileId1,
1261                IN AFSFileID *FileId2);
1262
1263 NTSTATUS
1264 AFSResetDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB);
1265
1266 NTSTATUS
1267 AFSEnumerateGlobalRoot( IN GUID *AuthGroup);
1268
1269 BOOLEAN
1270 AFSIsRelativeName( IN UNICODE_STRING *Name);
1271
1272 BOOLEAN
1273 AFSIsAbsoluteAFSName( IN UNICODE_STRING *Name);
1274
1275 void
1276 AFSUpdateName( IN UNICODE_STRING *Name);
1277
1278 NTSTATUS
1279 AFSUpdateTargetName( IN OUT UNICODE_STRING *TargetName,
1280                      IN OUT ULONG *Flags,
1281                      IN WCHAR *NameBuffer,
1282                      IN USHORT NameLength);
1283
1284 AFSNameArrayHdr *
1285 AFSInitNameArray( IN AFSDirectoryCB *DirectoryCB,
1286                   IN ULONG InitialElementCount);
1287
1288 NTSTATUS
1289 AFSPopulateNameArray( IN AFSNameArrayHdr *NameArray,
1290                       IN UNICODE_STRING *Path,
1291                       IN AFSDirectoryCB *DirectoryCB);
1292
1293 NTSTATUS
1294 AFSPopulateNameArrayFromRelatedArray( IN AFSNameArrayHdr *NameArray,
1295                                       IN AFSNameArrayHdr *RelatedNameArray,
1296                                       IN AFSDirectoryCB *DirectoryCB);
1297
1298 NTSTATUS
1299 AFSFreeNameArray( IN AFSNameArrayHdr *NameArray);
1300
1301 NTSTATUS
1302 AFSInsertNextElement( IN AFSNameArrayHdr *NameArray,
1303                       IN AFSDirectoryCB *DirEntry);
1304
1305 AFSDirectoryCB *
1306 AFSBackupEntry( IN AFSNameArrayHdr *NameArray);
1307
1308 AFSDirectoryCB *
1309 AFSGetParentEntry( IN AFSNameArrayHdr *NameArray);
1310
1311 void
1312 AFSResetNameArray( IN AFSNameArrayHdr *NameArray,
1313                    IN AFSDirectoryCB *DirEntry);
1314
1315 void
1316 AFSDumpNameArray( IN IN AFSNameArrayHdr *NameArray);
1317
1318 void
1319 AFSSetEnumerationEvent( IN AFSFcb *Fcb);
1320
1321 void
1322 AFSClearEnumerationEvent( IN AFSFcb *Fcb);
1323
1324 BOOLEAN
1325 AFSIsEnumerationInProcess( IN AFSObjectInfoCB *ObjectInfo);
1326
1327 NTSTATUS
1328 AFSVerifyVolume( IN ULONGLONG ProcessId,
1329                  IN AFSVolumeCB *VolumeCB);
1330
1331 NTSTATUS
1332 AFSInitPIOCtlDirectoryCB( IN AFSObjectInfoCB *ObjectInfo);
1333
1334 NTSTATUS
1335 AFSRetrieveFileAttributes( IN AFSDirectoryCB *ParentDirectoryCB,
1336                            IN AFSDirectoryCB *DirectoryCB,
1337                            IN UNICODE_STRING *ParentPathName,
1338                            IN AFSNameArrayHdr *RelatedNameArray,
1339                            IN GUID           *AuthGroup,
1340                            OUT AFSFileInfoCB *FileInfo);
1341
1342 AFSObjectInfoCB *
1343 AFSAllocateObjectInfo( IN AFSObjectInfoCB *ParentObjectInfo,
1344                        IN ULONGLONG HashIndex);
1345
1346 LONG
1347 AFSObjectInfoIncrement( IN AFSObjectInfoCB *ObjectInfo,
1348                         IN LONG             Reason);
1349
1350 LONG
1351 AFSObjectInfoDecrement( IN AFSObjectInfoCB *ObjectInfo,
1352                         IN LONG             Reason);
1353
1354 void
1355 AFSDeleteObjectInfo( IN AFSObjectInfoCB **ppObjectInfo);
1356
1357 AFSObjectInfoCB *
1358 AFSFindObjectInfo( IN AFSVolumeCB * VolumeCB,
1359                    IN AFSFileID   * FileID);
1360
1361 void
1362 AFSReleaseObjectInfo( IN OUT AFSObjectInfoCB **ppObjectInfo);
1363
1364 NTSTATUS
1365 AFSEvaluateRootEntry( IN AFSDirectoryCB *DirectoryCB,
1366                       OUT AFSDirectoryCB **TargetDirEntry);
1367
1368 NTSTATUS
1369 AFSCleanupFcb( IN AFSFcb *Fcb,
1370                IN BOOLEAN ForceFlush);
1371
1372 NTSTATUS
1373 AFSUpdateDirEntryName( IN AFSDirectoryCB *DirectoryCB,
1374                        IN UNICODE_STRING *NewFileName);
1375
1376 NTSTATUS
1377 AFSReadCacheFile( IN void *ReadBuffer,
1378                   IN LARGE_INTEGER *ReadOffset,
1379                   IN ULONG RequestedDataLength,
1380                   IN OUT PULONG BytesRead);
1381
1382 NTSTATUS
1383 AFSIrpComplete( IN PDEVICE_OBJECT DeviceObject,
1384                 IN PIRP           Irp,
1385                 IN PVOID          Context);
1386
1387 BOOLEAN
1388 AFSIsDirectoryEmptyForDelete( IN AFSFcb *Fcb);
1389
1390 void
1391 AFSRemoveNameEntry( IN AFSObjectInfoCB *ParentObjectInfo,
1392                     IN AFSDirectoryCB *DirEntry);
1393
1394 LARGE_INTEGER
1395 AFSGetAuthenticationId( void);
1396
1397 void
1398 AFSUnwindFileInfo( IN AFSFcb *Fcb,
1399                    IN AFSCcb *Ccb);
1400
1401 BOOLEAN
1402 AFSValidateDirList( IN AFSObjectInfoCB *ObjectInfo);
1403
1404 PFILE_OBJECT
1405 AFSReferenceCacheFileObject( void);
1406
1407 void
1408 AFSReleaseCacheFileObject( IN PFILE_OBJECT CacheFileObject);
1409
1410 NTSTATUS
1411 AFSInitializeLibrary( IN AFSLibraryInitCB *LibraryInit);
1412
1413 NTSTATUS
1414 AFSCloseLibrary( void);
1415
1416 NTSTATUS
1417 AFSDefaultLogMsg( IN ULONG Subsystem,
1418                   IN ULONG Level,
1419                   IN PCCH Format,
1420                   ...);
1421
1422 NTSTATUS
1423 AFSGetObjectStatus( IN AFSGetStatusInfoCB *GetStatusInfo,
1424                     IN ULONG InputBufferLength,
1425                     IN AFSStatusInfoCB *StatusInfo,
1426                     OUT ULONG *ReturnLength);
1427
1428 NTSTATUS
1429 AFSCheckSymlinkAccess( IN AFSDirectoryCB *ParentDirectoryCB,
1430                        IN UNICODE_STRING *ComponentName);
1431
1432 NTSTATUS
1433 AFSRetrieveFinalComponent( IN UNICODE_STRING *FullPathName,
1434                            OUT UNICODE_STRING *ComponentName);
1435
1436 void
1437 AFSDumpTraceFiles_Default( void);
1438
1439 void *
1440 AFSLibExAllocatePoolWithTag( IN POOL_TYPE  PoolType,
1441                              IN SIZE_T  NumberOfBytes,
1442                              IN ULONG  Tag);
1443
1444 BOOLEAN
1445 AFSValidNameFormat( IN UNICODE_STRING *FileName);
1446
1447 NTSTATUS
1448 AFSCreateDefaultSecurityDescriptor( void);
1449
1450 void
1451 AFSRetrieveParentPath( IN UNICODE_STRING *FullFileName,
1452                        OUT UNICODE_STRING *ParentPath);
1453
1454 NTSTATUS
1455 AFSRetrieveValidAuthGroup( IN AFSFcb *Fcb,
1456                            IN AFSObjectInfoCB *ObjectInfo,
1457                            IN BOOLEAN WriteAccess,
1458                            OUT GUID *AuthGroup);
1459
1460 NTSTATUS
1461 AFSPerformObjectInvalidate( IN AFSObjectInfoCB *ObjectInfo,
1462                             IN ULONG InvalidateReason);
1463
1464 //
1465 // AFSWorker.cpp Prototypes
1466 //
1467
1468 NTSTATUS
1469 AFSInitializeWorkerPool( void);
1470
1471 NTSTATUS
1472 AFSRemoveWorkerPool( void);
1473
1474 NTSTATUS
1475 AFSInitWorkerThread( IN AFSWorkQueueContext *PoolContext,
1476                      IN PKSTART_ROUTINE WorkerRoutine);
1477
1478 NTSTATUS
1479 AFSInitVolumeWorker( IN AFSVolumeCB *VolumeCB);
1480
1481 NTSTATUS
1482 AFSShutdownWorkerThread( IN AFSWorkQueueContext *PoolContext);
1483
1484 NTSTATUS
1485 AFSShutdownIOWorkerThread( IN AFSWorkQueueContext *PoolContext);
1486
1487 NTSTATUS
1488 AFSShutdownVolumeWorker( IN AFSVolumeCB *VolumeCB);
1489
1490 void
1491 AFSWorkerThread( IN PVOID Context);
1492
1493 void
1494 AFSIOWorkerThread( IN PVOID Context);
1495
1496 void
1497 AFSPrimaryVolumeWorkerThread( IN PVOID Context);
1498
1499 NTSTATUS
1500 AFSInsertWorkitem( IN AFSWorkItem *WorkItem);
1501
1502 NTSTATUS
1503 AFSInsertIOWorkitem( IN AFSWorkItem *WorkItem);
1504
1505 NTSTATUS
1506 AFSInsertWorkitemAtHead( IN AFSWorkItem *WorkItem);
1507
1508 AFSWorkItem *
1509 AFSRemoveWorkItem( void);
1510
1511 AFSWorkItem *
1512 AFSRemoveIOWorkItem( void);
1513
1514 NTSTATUS
1515 AFSQueueWorkerRequest( IN AFSWorkItem *WorkItem);
1516
1517 NTSTATUS
1518 AFSQueueIOWorkerRequest( IN AFSWorkItem *WorkItem);
1519
1520 NTSTATUS
1521 AFSQueueWorkerRequestAtHead( IN AFSWorkItem *WorkItem);
1522
1523 NTSTATUS
1524 AFSShutdownVolumeWorker( IN AFSVolumeCB *VolumeCB);
1525
1526 NTSTATUS
1527 AFSQueueFlushExtents( IN AFSFcb *Fcb,
1528                       IN GUID *AuthGroup);
1529
1530 NTSTATUS
1531 AFSQueueGlobalRootEnumeration( void);
1532
1533 NTSTATUS
1534 AFSQueuePurgeObject( IN AFSFcb *Fcb);
1535
1536 NTSTATUS
1537 AFSQueueStartIos( IN PFILE_OBJECT CacheFileObject,
1538                   IN UCHAR FunctionCode,
1539                   IN ULONG RequestFLags,
1540                   IN AFSIoRun *IoRuns,
1541                   IN ULONG RunCount,
1542                   IN AFSGatherIo *GatherIo);
1543
1544 NTSTATUS
1545 AFSQueueInvalidateObject( IN AFSObjectInfoCB *ObjectInfo,
1546                           IN ULONG InvalidateReason);
1547
1548 //
1549 // AFSMD5Support.cpp Prototypes
1550 //
1551
1552 void
1553 AFSGenerateMD5( IN char *DataBuffer,
1554                 IN ULONG Length,
1555                 OUT UCHAR *MD5Digest);
1556
1557 };
1558
1559 #endif /* _AFS_COMMON_H */