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