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