Windows: Performing async work after cache invalidation
[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
404 BOOLEAN
405 AFSTearDownFcbExtents( IN AFSFcb *Fcb,
406                        IN GUID *AuthGroup);
407
408 void
409 AFSTrimExtents( IN AFSFcb *Fcb,
410                 IN PLARGE_INTEGER FileSize);
411
412 void
413 AFSTrimSpecifiedExtents( IN AFSFcb *Fcb,
414                          IN ULONG   Count,
415                          IN AFSFileExtentCB *Result);
416
417 void
418 AFSReferenceActiveExtents( IN AFSExtent *StartExtent,
419                            IN ULONG ExtentsCount);
420
421 void
422 AFSDereferenceActiveExtents( IN AFSExtent *StartExtent,
423                              IN ULONG ExtentsCount);
424
425 void
426 AFSRemoveEntryDirtyList( IN AFSFcb *Fcb,
427                          IN AFSExtent *Extent);
428
429 AFSExtent *
430 ExtentFor( PLIST_ENTRY le, ULONG SkipList );
431
432 #if GEN_MD5
433 void
434 AFSSetupMD5Hash( IN AFSFcb *Fcb,
435                  IN AFSExtent *StartExtent,
436                  IN ULONG ExtentsCount,
437                  IN void *SystemBuffer,
438                  IN LARGE_INTEGER *ByteOffset,
439                  IN ULONG ByteCount);
440 #endif
441
442 //
443 //
444 // AFSIoSupp.cpp Prototypes
445 //
446 NTSTATUS
447 AFSGetExtents( IN  AFSFcb *pFcb,
448                IN  PLARGE_INTEGER Offset,
449                IN  ULONG Length,
450                IN  AFSExtent *From,
451                OUT ULONG *ExtentCount,
452                OUT ULONG *RunCount);
453
454 NTSTATUS
455 AFSSetupIoRun( IN PDEVICE_OBJECT CacheDevice,
456                IN PIRP           MasterIrp,
457                IN PVOID          SystemBuffer,
458                IN OUT AFSIoRun  *IoRun,
459                IN PLARGE_INTEGER Start,
460                IN ULONG          Length,
461                IN AFSExtent     *From,
462                IN OUT ULONG     *RunCount);
463
464 NTSTATUS
465 AFSStartIos( IN FILE_OBJECT     *CacheFileObject,
466              IN UCHAR            FunctionCode,
467              IN ULONG            IrpFlags,
468              IN AFSIoRun        *IoRun,
469              IN ULONG            Count,
470              IN OUT AFSGatherIo *Gather);
471
472 VOID
473 AFSCompleteIo( IN AFSGatherIo *Gather,
474                IN NTSTATUS Status);
475
476 NTSTATUS
477 AFSProcessExtentRun( IN PVOID          SystemBuffer,
478                      IN PLARGE_INTEGER Start,
479                      IN ULONG          Length,
480                      IN AFSExtent     *From,
481                      IN BOOLEAN        WriteRequest);
482
483 //
484 // AFSClose.cpp Prototypes
485 //
486
487 NTSTATUS
488 AFSClose( IN PDEVICE_OBJECT DeviceObject,
489           IN PIRP Irp);
490
491 //
492 // AFSFcbSupport.cpp Prototypes
493 //
494
495 NTSTATUS
496 AFSInitFcb( IN AFSDirectoryCB   *DirEntry,
497             IN OUT AFSFcb     **Fcb);
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 BOOLEAN
1118 AFSIsChildOfParent( IN AFSFcb *Dcb,
1119                     IN AFSFcb *Fcb);
1120
1121 inline
1122 ULONGLONG
1123 AFSCreateHighIndex( IN AFSFileID *FileID);
1124
1125 inline
1126 ULONGLONG
1127 AFSCreateLowIndex( IN AFSFileID *FileID);
1128
1129 BOOLEAN
1130 AFSCheckAccess( IN ACCESS_MASK DesiredAccess,
1131                 IN ACCESS_MASK GrantedAccess,
1132                 IN BOOLEAN DirectoryEntry);
1133
1134 NTSTATUS
1135 AFSGetDriverStatus( IN AFSDriverStatusRespCB *DriverStatus);
1136
1137 NTSTATUS
1138 AFSSubstituteSysName( IN UNICODE_STRING *ComponentName,
1139                       IN UNICODE_STRING *SubstituteName,
1140                       IN ULONG StringIndex);
1141
1142 NTSTATUS
1143 AFSSubstituteNameInPath( IN OUT UNICODE_STRING *FullPathName,
1144                          IN OUT UNICODE_STRING *ComponentName,
1145                          IN UNICODE_STRING *SubstituteName,
1146                          IN OUT UNICODE_STRING *RemainingPath,
1147                          IN BOOLEAN FreePathName);
1148
1149 NTSTATUS
1150 AFSInvalidateVolume( IN AFSVolumeCB *VolumeCB,
1151                      IN ULONG Reason);
1152
1153 NTSTATUS
1154 AFSVerifyEntry( IN GUID *AuthGroup,
1155                 IN AFSDirectoryCB *DirectoryCB);
1156
1157 NTSTATUS
1158 AFSSetVolumeState( IN AFSVolumeStatusCB *VolumeStatus);
1159
1160 NTSTATUS
1161 AFSSetNetworkState( IN AFSNetworkStatusCB *NetworkStatus);
1162
1163 NTSTATUS
1164 AFSValidateDirectoryCache( IN AFSObjectInfoCB *ObjectInfo,
1165                            IN GUID *AuthGroup);
1166
1167 BOOLEAN
1168 AFSIsVolumeFID( IN AFSFileID *FileID);
1169
1170 BOOLEAN
1171 AFSIsFinalNode( IN AFSFcb *Fcb);
1172
1173 NTSTATUS
1174 AFSUpdateMetaData( IN AFSDirectoryCB *DirEntry,
1175                    IN AFSDirEnumEntry *DirEnumEntry);
1176
1177 NTSTATUS
1178 AFSValidateEntry( IN AFSDirectoryCB *DirEntry,
1179                   IN GUID *AuthGroup,
1180                   IN BOOLEAN PurgeContent,
1181                   IN BOOLEAN FastCall);
1182
1183 AFSDirectoryCB *
1184 AFSGetSpecialShareNameEntry( IN UNICODE_STRING *ShareName,
1185                              IN UNICODE_STRING *SecondaryName);
1186
1187 NTSTATUS
1188 AFSInitializeSpecialShareNameList( void);
1189
1190 void
1191 AFSWaitOnQueuedFlushes( IN AFSFcb *Fcb);
1192
1193 void
1194 AFSWaitOnQueuedReleases( void);
1195
1196 BOOLEAN
1197 AFSIsEqualFID( IN AFSFileID *FileId1,
1198                IN AFSFileID *FileId2);
1199
1200 NTSTATUS
1201 AFSResetDirectoryContent( IN AFSObjectInfoCB *ObjectInfoCB);
1202
1203 NTSTATUS
1204 AFSEnumerateGlobalRoot( IN GUID *AuthGroup);
1205
1206 BOOLEAN
1207 AFSIsRelativeName( IN UNICODE_STRING *Name);
1208
1209 void
1210 AFSUpdateName( IN UNICODE_STRING *Name);
1211
1212 NTSTATUS
1213 AFSUpdateTargetName( IN OUT UNICODE_STRING *TargetName,
1214                      IN OUT ULONG *Flags,
1215                      IN WCHAR *NameBuffer,
1216                      IN USHORT NameLength);
1217
1218 AFSNameArrayHdr *
1219 AFSInitNameArray( IN AFSDirectoryCB *DirectoryCB,
1220                   IN ULONG InitialElementCount);
1221
1222 NTSTATUS
1223 AFSPopulateNameArray( IN AFSNameArrayHdr *NameArray,
1224                       IN UNICODE_STRING *Path,
1225                       IN AFSDirectoryCB *DirectoryCB);
1226
1227 NTSTATUS
1228 AFSPopulateNameArrayFromRelatedArray( IN AFSNameArrayHdr *NameArray,
1229                                       IN AFSNameArrayHdr *RelatedNameArray,
1230                                       IN AFSDirectoryCB *DirectoryCB);
1231
1232 NTSTATUS
1233 AFSFreeNameArray( IN AFSNameArrayHdr *NameArray);
1234
1235 NTSTATUS
1236 AFSInsertNextElement( IN AFSNameArrayHdr *NameArray,
1237                       IN AFSDirectoryCB *DirEntry);
1238
1239 void
1240 AFSReplaceCurrentElement( IN AFSNameArrayHdr *NameArray,
1241                           IN AFSDirectoryCB *DirectoryCB);
1242
1243 AFSDirectoryCB *
1244 AFSBackupEntry( IN AFSNameArrayHdr *NameArray);
1245
1246 AFSDirectoryCB *
1247 AFSGetParentEntry( IN AFSNameArrayHdr *NameArray);
1248
1249 void
1250 AFSResetNameArray( IN AFSNameArrayHdr *NameArray,
1251                    IN AFSDirectoryCB *DirEntry);
1252
1253 void
1254 AFSDumpNameArray( IN IN AFSNameArrayHdr *NameArray);
1255
1256 void
1257 AFSSetEnumerationEvent( IN AFSFcb *Fcb);
1258
1259 void
1260 AFSClearEnumerationEvent( IN AFSFcb *Fcb);
1261
1262 BOOLEAN
1263 AFSIsEnumerationInProcess( IN AFSObjectInfoCB *ObjectInfo);
1264
1265 NTSTATUS
1266 AFSVerifyVolume( IN ULONGLONG ProcessId,
1267                  IN AFSVolumeCB *VolumeCB);
1268
1269 NTSTATUS
1270 AFSInitPIOCtlDirectoryCB( IN AFSObjectInfoCB *ObjectInfo);
1271
1272 NTSTATUS
1273 AFSRetrieveFileAttributes( IN AFSDirectoryCB *ParentDirectoryCB,
1274                            IN AFSDirectoryCB *DirectoryCB,
1275                            IN UNICODE_STRING *ParentPathName,
1276                            IN AFSNameArrayHdr *RelatedNameArray,
1277                            IN GUID           *AuthGroup,
1278                            OUT AFSFileInfoCB *FileInfo);
1279
1280 AFSObjectInfoCB *
1281 AFSAllocateObjectInfo( IN AFSObjectInfoCB *ParentObjectInfo,
1282                        IN ULONGLONG HashIndex);
1283
1284 void
1285 AFSDeleteObjectInfo( IN AFSObjectInfoCB *ObjectInfo);
1286
1287 NTSTATUS
1288 AFSEvaluateRootEntry( IN AFSDirectoryCB *DirectoryCB,
1289                       OUT AFSDirectoryCB **TargetDirEntry);
1290
1291 NTSTATUS
1292 AFSCleanupFcb( IN AFSFcb *Fcb,
1293                IN BOOLEAN ForceFlush);
1294
1295 NTSTATUS
1296 AFSUpdateDirEntryName( IN AFSDirectoryCB *DirectoryCB,
1297                        IN UNICODE_STRING *NewFileName);
1298
1299 NTSTATUS
1300 AFSReadCacheFile( IN void *ReadBuffer,
1301                   IN LARGE_INTEGER *ReadOffset,
1302                   IN ULONG RequestedDataLength,
1303                   IN OUT PULONG BytesRead);
1304
1305 NTSTATUS
1306 AFSIrpComplete( IN PDEVICE_OBJECT DeviceObject,
1307                 IN PIRP           Irp,
1308                 IN PVOID          Context);
1309
1310 BOOLEAN
1311 AFSIsDirectoryEmptyForDelete( IN AFSFcb *Fcb);
1312
1313 void
1314 AFSRemoveNameEntry( IN AFSObjectInfoCB *ParentObjectInfo,
1315                     IN AFSDirectoryCB *DirEntry);
1316
1317 LARGE_INTEGER
1318 AFSGetAuthenticationId( void);
1319
1320 void
1321 AFSUnwindFileInfo( IN AFSFcb *Fcb,
1322                    IN AFSCcb *Ccb);
1323
1324 BOOLEAN
1325 AFSValidateDirList( IN AFSObjectInfoCB *ObjectInfo);
1326
1327 PFILE_OBJECT
1328 AFSReferenceCacheFileObject( void);
1329
1330 void
1331 AFSReleaseCacheFileObject( IN PFILE_OBJECT CacheFileObject);
1332
1333 NTSTATUS
1334 AFSInitializeLibrary( IN AFSLibraryInitCB *LibraryInit);
1335
1336 NTSTATUS
1337 AFSCloseLibrary( void);
1338
1339 NTSTATUS
1340 AFSDefaultLogMsg( IN ULONG Subsystem,
1341                   IN ULONG Level,
1342                   IN PCCH Format,
1343                   ...);
1344
1345 NTSTATUS
1346 AFSGetObjectStatus( IN AFSGetStatusInfoCB *GetStatusInfo,
1347                     IN ULONG InputBufferLength,
1348                     IN AFSStatusInfoCB *StatusInfo,
1349                     OUT ULONG *ReturnLength);
1350
1351 NTSTATUS
1352 AFSCheckSymlinkAccess( IN AFSDirectoryCB *ParentDirectoryCB,
1353                        IN UNICODE_STRING *ComponentName);
1354
1355 NTSTATUS
1356 AFSRetrieveFinalComponent( IN UNICODE_STRING *FullPathName,
1357                            OUT UNICODE_STRING *ComponentName);
1358
1359 void
1360 AFSDumpTraceFiles_Default( void);
1361
1362 void *
1363 AFSLibExAllocatePoolWithTag( IN POOL_TYPE  PoolType,
1364                              IN SIZE_T  NumberOfBytes,
1365                              IN ULONG  Tag);
1366
1367 BOOLEAN
1368 AFSValidNameFormat( IN UNICODE_STRING *FileName);
1369
1370 NTSTATUS
1371 AFSCreateDefaultSecurityDescriptor( void);
1372
1373 void
1374 AFSRetrieveParentPath( IN UNICODE_STRING *FullFileName,
1375                        OUT UNICODE_STRING *ParentPath);
1376
1377 NTSTATUS
1378 AFSRetrieveValidAuthGroup( IN AFSFcb *Fcb,
1379                            IN AFSObjectInfoCB *ObjectInfo,
1380                            IN BOOLEAN WriteAccess,
1381                            OUT GUID *AuthGroup);
1382
1383 NTSTATUS
1384 AFSPerformObjectInvalidate( IN AFSObjectInfoCB *ObjectInfo,
1385                             IN ULONG InvalidateReason);
1386
1387 //
1388 // AFSWorker.cpp Prototypes
1389 //
1390
1391 NTSTATUS
1392 AFSInitializeWorkerPool( void);
1393
1394 NTSTATUS
1395 AFSRemoveWorkerPool( void);
1396
1397 NTSTATUS
1398 AFSInitWorkerThread( IN AFSWorkQueueContext *PoolContext,
1399                      IN PKSTART_ROUTINE WorkerRoutine);
1400
1401 NTSTATUS
1402 AFSInitVolumeWorker( IN AFSVolumeCB *VolumeCB);
1403
1404 NTSTATUS
1405 AFSShutdownWorkerThread( IN AFSWorkQueueContext *PoolContext);
1406
1407 NTSTATUS
1408 AFSShutdownIOWorkerThread( IN AFSWorkQueueContext *PoolContext);
1409
1410 NTSTATUS
1411 AFSShutdownVolumeWorker( IN AFSVolumeCB *VolumeCB);
1412
1413 void
1414 AFSWorkerThread( IN PVOID Context);
1415
1416 void
1417 AFSIOWorkerThread( IN PVOID Context);
1418
1419 void
1420 AFSPrimaryVolumeWorkerThread( IN PVOID Context);
1421
1422 void
1423 AFSVolumeWorkerThread( IN PVOID Context);
1424
1425 NTSTATUS
1426 AFSInsertWorkitem( IN AFSWorkItem *WorkItem);
1427
1428 NTSTATUS
1429 AFSInsertIOWorkitem( IN AFSWorkItem *WorkItem);
1430
1431 NTSTATUS
1432 AFSInsertWorkitemAtHead( IN AFSWorkItem *WorkItem);
1433
1434 AFSWorkItem *
1435 AFSRemoveWorkItem( void);
1436
1437 AFSWorkItem *
1438 AFSRemoveIOWorkItem( void);
1439
1440 NTSTATUS
1441 AFSQueueWorkerRequest( IN AFSWorkItem *WorkItem);
1442
1443 NTSTATUS
1444 AFSQueueIOWorkerRequest( IN AFSWorkItem *WorkItem);
1445
1446 NTSTATUS
1447 AFSQueueWorkerRequestAtHead( IN AFSWorkItem *WorkItem);
1448
1449 NTSTATUS
1450 AFSShutdownVolumeWorker( IN AFSVolumeCB *VolumeCB);
1451
1452 NTSTATUS
1453 AFSQueueFlushExtents( IN AFSFcb *Fcb,
1454                       IN GUID *AuthGroup);
1455
1456 NTSTATUS
1457 AFSQueueAsyncRead( IN PDEVICE_OBJECT DeviceObject,
1458                    IN PIRP Irp,
1459                    IN HANDLE CallerProcess);
1460
1461 NTSTATUS
1462 AFSQueueAsyncWrite( IN PDEVICE_OBJECT DeviceObject,
1463                     IN PIRP Irp,
1464                     IN HANDLE CallerProcess);
1465
1466 NTSTATUS
1467 AFSQueueGlobalRootEnumeration( void);
1468
1469 NTSTATUS
1470 AFSQueuePurgeObject( IN AFSFcb *Fcb);
1471
1472 NTSTATUS
1473 AFSQueueStartIos( IN PFILE_OBJECT CacheFileObject,
1474                   IN UCHAR FunctionCode,
1475                   IN ULONG RequestFLags,
1476                   IN AFSIoRun *IoRuns,
1477                   IN ULONG RunCount,
1478                   IN AFSGatherIo *GatherIo);
1479
1480 NTSTATUS
1481 AFSQueueInvalidateObject( IN AFSObjectInfoCB *ObjectInfo,
1482                           IN ULONG InvalidateReason);
1483
1484 //
1485 // AFSMD5Support.cpp Prototypes
1486 //
1487
1488 void
1489 AFSGenerateMD5( IN char *DataBuffer,
1490                 IN ULONG Length,
1491                 OUT UCHAR *MD5Digest);
1492
1493 };
1494
1495 #endif /* _AFS_COMMON_H */