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