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