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