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