9af1fa761f5e2f6c46bacb34358c6d406b49e88e
[openafs.git] / src / WINNT / afsrdr / kernel / fs / 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 //
84 // AFSInit.cpp Prototypes
85 //
86
87 NTSTATUS
88 DriverEntry( IN PDRIVER_OBJECT DriverObj,
89              IN PUNICODE_STRING RegPath);
90
91 void
92 AFSUnload( IN PDRIVER_OBJECT DriverObject);
93
94 //
95 // AFSAuthGroupSupport.cpp
96 //
97
98 void
99 AFSRetrieveAuthGroup( IN ULONGLONG ProcessId,
100                       IN ULONGLONG ThreadId,
101                       OUT GUID *AuthGroup);
102
103 BOOLEAN
104 AFSIsLocalSystemAuthGroup( IN GUID *AuthGroup);
105
106 BOOLEAN
107 AFSIsLocalSystemSID( IN UNICODE_STRING *SIDString);
108
109 BOOLEAN
110 AFSIsNoPAGAuthGroup( IN GUID *AuthGroup);
111
112 NTSTATUS
113 AFSCreateSetProcessAuthGroup( AFSAuthGroupRequestCB *CreateSetAuthGroup);
114
115 NTSTATUS
116 AFSQueryProcessAuthGroupList( IN GUID *GUIDList,
117                               IN ULONG BufferLength,
118                               OUT ULONG_PTR *ReturnLength);
119
120 NTSTATUS
121 AFSSetActiveProcessAuthGroup( IN AFSAuthGroupRequestCB *ActiveAuthGroup);
122
123 NTSTATUS
124 AFSResetActiveProcessAuthGroup( IN AFSAuthGroupRequestCB *ActiveAuthGroup);
125
126 NTSTATUS
127 AFSCreateAuthGroupForSIDorLogonSession( IN AFSAuthGroupRequestCB *AuthGroupRequestCB,
128                                         IN BOOLEAN bLogonSession);
129
130 NTSTATUS
131 AFSQueryAuthGroup( IN AFSAuthGroupRequestCB *AuthGroupRequestCB,
132                    OUT GUID *AuthGroupGUID,
133                    OUT ULONG_PTR *ReturnLength);
134
135 //
136 // AFSBTreeSupport.cpp Prototypes
137 //
138
139 NTSTATUS
140 AFSLocateHashEntry( IN AFSBTreeEntry *TopNode,
141                     IN ULONGLONG HashIndex,
142                     IN OUT AFSBTreeEntry **TreeEntry);
143
144 NTSTATUS
145 AFSInsertHashEntry( IN AFSBTreeEntry *TopNode,
146                     IN AFSBTreeEntry *FileIDEntry);
147
148 NTSTATUS
149 AFSRemoveHashEntry( IN AFSBTreeEntry **TopNode,
150                     IN AFSBTreeEntry *FileIDEntry);
151
152 //
153 // AFSCommSupport.cpp Prototypes
154 //
155
156 NTSTATUS
157 AFSReleaseFid( IN AFSFileID *FileId);
158
159 NTSTATUS
160 AFSProcessRequest( IN ULONG RequestType,
161                    IN ULONG RequestFlags,
162                    IN GUID *AuthGroup,
163                    IN PUNICODE_STRING FileName,
164                    IN AFSFileID *FileId,
165                    IN void  *Data,
166                    IN ULONG DataLength,
167                    IN OUT void *ResultBuffer,
168                    IN OUT PULONG ResultBufferLength);
169
170 NTSTATUS
171 AFSProcessControlRequest( IN PIRP Irp);
172
173 NTSTATUS
174 AFSInitIrpPool( void);
175
176 void
177 AFSCleanupIrpPool( void);
178
179 NTSTATUS
180 AFSProcessIrpRequest( IN PIRP Irp);
181
182 NTSTATUS
183 AFSProcessIrpResult( IN PIRP Irp);
184
185 NTSTATUS
186 AFSInsertRequest( IN AFSCommSrvcCB *CommSrvc,
187                   IN AFSPoolEntry *Entry);
188
189 //
190 // AFSCreate.cpp Prototypes
191 //
192
193 NTSTATUS
194 AFSCreate( IN PDEVICE_OBJECT DeviceObject,
195            IN PIRP Irp);
196
197 NTSTATUS
198 AFSCommonCreate( IN PDEVICE_OBJECT DeviceObject,
199                  IN PIRP Irp);
200
201 NTSTATUS
202 AFSControlDeviceCreate( IN PIRP Irp);
203
204 NTSTATUS
205 AFSOpenRedirector( IN PIRP Irp);
206
207 NTSTATUS
208 AFSInitRdrFcb( OUT AFSFcb **RdrFcb);
209
210 void
211 AFSRemoveRdrFcb( IN OUT AFSFcb **RdrFcb);
212
213 //
214 // AFSClose.cpp Prototypes
215 //
216
217 NTSTATUS
218 AFSClose( IN PDEVICE_OBJECT DeviceObject,
219           IN PIRP Irp);
220
221 NTSTATUS
222 AFSCommonClose( IN PDEVICE_OBJECT DeviceObject,
223                 IN PIRP Irp);
224
225 //
226 // AFSNetworkProviderSupport.cpp
227 //
228
229 NTSTATUS
230 AFSAddConnectionEx( IN UNICODE_STRING *RemoteName,
231                     IN ULONG DisplayType,
232                     IN ULONG Flags);
233
234 void
235 AFSInitializeConnectionInfo( IN AFSProviderConnectionCB *Connection,
236                              IN ULONG DisplayType);
237
238 //
239 // AFSRead.cpp Prototypes
240 //
241
242 NTSTATUS
243 AFSRead( IN PDEVICE_OBJECT DeviceObject,
244          IN PIRP Irp);
245
246 //
247 // AFSWrite.cpp Prototypes
248 //
249
250 NTSTATUS
251 AFSWrite( IN PDEVICE_OBJECT DeviceObject,
252                 IN PIRP Irp);
253
254 //
255 // AFSFileInfo.cpp Prototypes
256 //
257
258 NTSTATUS
259 AFSQueryFileInfo( IN PDEVICE_OBJECT DeviceObject,
260                   IN PIRP Irp);
261
262 NTSTATUS
263 AFSSetFileInfo( IN PDEVICE_OBJECT DeviceObject,
264                 IN PIRP Irp);
265
266 //
267 // AFSEa.cpp Prototypes
268 //
269
270 NTSTATUS
271 AFSQueryEA( IN PDEVICE_OBJECT DeviceObject,
272             IN PIRP Irp);
273
274 NTSTATUS
275 AFSSetEA( IN PDEVICE_OBJECT DeviceObject,
276           IN PIRP Irp);
277
278 //
279 // AFSFlushBuffers.cpp Prototypes
280 //
281
282 NTSTATUS
283 AFSFlushBuffers( IN PDEVICE_OBJECT DeviceObject,
284                  IN PIRP Irp);
285
286 //
287 // AFSVolumeInfo.cpp Prototypes
288 //
289
290 NTSTATUS
291 AFSQueryVolumeInfo( IN PDEVICE_OBJECT DeviceObject,
292                     IN PIRP Irp);
293
294 NTSTATUS
295 AFSSetVolumeInfo( IN PDEVICE_OBJECT DeviceObject,
296                   IN PIRP Irp);
297
298 NTSTATUS
299 AFSSetVolumeInfo( IN PDEVICE_OBJECT DeviceObject,
300                   IN PIRP Irp);
301
302 //
303 // AFSDirControl.cpp Prototypes
304 //
305
306 NTSTATUS
307 AFSDirControl( IN PDEVICE_OBJECT DeviceObject,
308                IN PIRP Irp);
309
310 //
311 // AFSFSControl.cpp Prototypes
312 //
313
314 NTSTATUS
315 AFSFSControl( IN PDEVICE_OBJECT DeviceObject,
316               IN PIRP Irp);
317
318 //
319 // AFSDevControl.cpp Prototypes
320 //
321
322 NTSTATUS
323 AFSDevControl( IN PDEVICE_OBJECT DeviceObject,
324                IN PIRP Irp);
325
326 //
327 // AFSInternalDevControl.cpp Prototypes
328 //
329
330 NTSTATUS
331 AFSInternalDevControl( IN PDEVICE_OBJECT DeviceObject,
332                        IN PIRP Irp);
333
334 //
335 // AFSShutdown.cpp Prototypes
336 //
337
338 NTSTATUS
339 AFSShutdown( IN PDEVICE_OBJECT DeviceObject,
340              IN PIRP Irp);
341
342
343 NTSTATUS
344 AFSShutdownFilesystem( void);
345
346 //
347 // AFSLockControl.cpp Prototypes
348 //
349
350 NTSTATUS
351 AFSLockControl( IN PDEVICE_OBJECT DeviceObject,
352                 IN PIRP Irp);
353
354 //
355 // AFSCleanup.cpp Prototypes
356 //
357
358 NTSTATUS
359 AFSCleanup( IN PDEVICE_OBJECT DeviceObject,
360             IN PIRP Irp);
361
362 NTSTATUS
363 AFSCommonCleanup( IN PDEVICE_OBJECT DeviceObject,
364                   IN PIRP Irp);
365
366 //
367 // AFSSecurity.cpp Prototypes
368 //
369
370 NTSTATUS
371 AFSQuerySecurity( IN PDEVICE_OBJECT DeviceObject,
372                   IN PIRP Irp);
373
374 NTSTATUS
375 AFSSetSecurity( IN PDEVICE_OBJECT DeviceObject,
376                 IN PIRP Irp);
377
378 //
379 // AFSSystemControl.cpp Prototypes
380 //
381
382 NTSTATUS
383 AFSSystemControl( IN PDEVICE_OBJECT DeviceObject,
384                   IN PIRP Irp);
385
386 //
387 // AFSQuota.cpp Prototypes
388 //
389
390 NTSTATUS
391 AFSQueryQuota( IN PDEVICE_OBJECT DeviceObject,
392                IN PIRP Irp);
393
394 NTSTATUS
395 AFSSetQuota( IN PDEVICE_OBJECT DeviceObject,
396              IN PIRP Irp);
397
398 //
399 // AFSGeneric.cpp Prototypes
400 //
401
402 ULONG
403 AFSExceptionFilter( IN CHAR *FunctionString,
404                     IN ULONG Code,
405                     IN PEXCEPTION_POINTERS ExceptPtrs);
406
407 BOOLEAN
408 AFSAcquireExcl( IN PERESOURCE Resource,
409                 IN BOOLEAN wait);
410
411 BOOLEAN
412 AFSAcquireSharedStarveExclusive( IN PERESOURCE Resource,
413                                  IN BOOLEAN Wait);
414
415 BOOLEAN
416 AFSAcquireShared( IN PERESOURCE Resource,
417                   IN BOOLEAN wait);
418
419 void
420 AFSReleaseResource( IN PERESOURCE Resource);
421
422 void
423 AFSConvertToShared( IN PERESOURCE Resource);
424
425 void
426 AFSCompleteRequest( IN PIRP Irp,
427                     IN ULONG Status);
428
429 NTSTATUS
430 AFSReadRegistry( IN PUNICODE_STRING RegistryPath);
431
432 NTSTATUS
433 AFSUpdateRegistryParameter( IN PUNICODE_STRING ValueName,
434                             IN ULONG ValueType,
435                             IN void *ValueData,
436                             IN ULONG ValueDataLength);
437
438 NTSTATUS
439 AFSInitializeControlDevice( void);
440
441 NTSTATUS
442 AFSRemoveControlDevice( void);
443
444 NTSTATUS
445 AFSDefaultDispatch( IN PDEVICE_OBJECT DeviceObject,
446                     IN PIRP Irp);
447
448 NTSTATUS
449 AFSIrpComplete( IN PDEVICE_OBJECT DeviceObject,
450                 IN PIRP           Irp,
451                 IN PVOID          Context);
452
453 void
454 AFSInitServerStrings( void);
455
456 NTSTATUS
457 AFSReadServerName( void);
458
459 NTSTATUS
460 AFSReadMountRootName( void);
461
462 NTSTATUS
463 AFSSetSysNameInformation( IN AFSSysNameNotificationCB *SysNameInfo,
464                           IN ULONG SysNameInfoBufferLength);
465
466 void
467 AFSResetSysNameList( IN AFSSysNameCB *SysNameList);
468
469 NTSTATUS
470 AFSSendDeviceIoControl( IN DEVICE_OBJECT *TargetDeviceObject,
471                         IN ULONG IOControl,
472                         IN void *InputBuffer,
473                         IN ULONG InputBufferLength,
474                         IN OUT void *OutputBuffer,
475                         IN ULONG OutputBufferLength,
476                         OUT ULONG *ResultLength);
477
478 void *
479 AFSExAllocatePoolWithTag( IN POOL_TYPE  PoolType,
480                           IN SIZE_T  NumberOfBytes,
481                           IN ULONG  Tag);
482
483 void
484 AFSExFreePoolWithTag( IN void *Buffer, IN ULONG Tag);
485
486 NTSTATUS
487 AFSShutdownRedirector( void);
488
489 BOOLEAN
490 AFSAcquireFcbForLazyWrite( IN PVOID Fcb,
491                            IN BOOLEAN Wait);
492
493 VOID
494 AFSReleaseFcbFromLazyWrite( IN PVOID Fcb);
495
496 BOOLEAN
497 AFSAcquireFcbForReadAhead( IN PVOID Fcb,
498                            IN BOOLEAN Wait);
499
500 VOID
501 AFSReleaseFcbFromReadAhead( IN PVOID Fcb);
502
503 NTSTATUS
504 AFSGetCallerSID( OUT UNICODE_STRING *SIDString,
505                  OUT BOOLEAN *pbImpersonation);
506
507 ULONG
508 AFSGetSessionId( IN HANDLE ProcessId,
509                  OUT BOOLEAN *pbImpersonation);
510
511 NTSTATUS
512 AFSCheckThreadDacl( OUT GUID *AuthGroup);
513
514 NTSTATUS
515 AFSProcessSetProcessDacl( IN AFSProcessCB *ProcessCB);
516
517 //
518 // Prototypes in AFSFastIoSupprt.cpp
519 //
520
521 BOOLEAN
522 AFSFastIoCheckIfPossible( IN struct _FILE_OBJECT *FileObject,
523                           IN PLARGE_INTEGER FileOffset,
524                           IN ULONG Length,
525                           IN BOOLEAN Wait,
526                           IN ULONG LockKey,
527                           IN BOOLEAN CheckForReadOperation,
528                           OUT PIO_STATUS_BLOCK IoStatus,
529                           IN struct _DEVICE_OBJECT *DeviceObject);
530
531 BOOLEAN
532 AFSFastIoRead( IN struct _FILE_OBJECT *FileObject,
533                IN PLARGE_INTEGER FileOffset,
534                IN ULONG Length,
535                IN BOOLEAN Wait,
536                IN ULONG LockKey,
537                OUT PVOID Buffer,
538                OUT PIO_STATUS_BLOCK IoStatus,
539                IN struct _DEVICE_OBJECT *DeviceObject);
540
541 BOOLEAN
542 AFSFastIoWrite( IN struct _FILE_OBJECT *FileObject,
543                 IN PLARGE_INTEGER FileOffset,
544                 IN ULONG Length,
545                 IN BOOLEAN Wait,
546                 IN ULONG LockKey,
547                 IN PVOID Buffer,
548                 OUT PIO_STATUS_BLOCK IoStatus,
549                 IN struct _DEVICE_OBJECT *DeviceObject);
550
551 BOOLEAN
552 AFSFastIoQueryBasicInfo( IN struct _FILE_OBJECT *FileObject,
553                          IN BOOLEAN Wait,
554                          OUT PFILE_BASIC_INFORMATION Buffer,
555                          OUT PIO_STATUS_BLOCK IoStatus,
556                          IN struct _DEVICE_OBJECT *DeviceObject);
557
558 BOOLEAN
559 AFSFastIoQueryStandardInfo( IN struct _FILE_OBJECT *FileObject,
560                             IN BOOLEAN Wait,
561                             OUT PFILE_STANDARD_INFORMATION Buffer,
562                             OUT PIO_STATUS_BLOCK IoStatus,
563                             IN struct _DEVICE_OBJECT *DeviceObject);
564
565 BOOLEAN
566 AFSFastIoLock( IN struct _FILE_OBJECT *FileObject,
567                IN PLARGE_INTEGER FileOffset,
568                IN PLARGE_INTEGER Length,
569                IN PEPROCESS ProcessId,
570                IN ULONG Key,
571                IN BOOLEAN FailImmediately,
572                IN BOOLEAN ExclusiveLock,
573                OUT PIO_STATUS_BLOCK IoStatus,
574                IN struct _DEVICE_OBJECT *DeviceObject);
575
576 BOOLEAN
577 AFSFastIoUnlockSingle( IN struct _FILE_OBJECT *FileObject,
578                        IN PLARGE_INTEGER FileOffset,
579                        IN PLARGE_INTEGER Length,
580                        IN PEPROCESS ProcessId,
581                        IN ULONG Key,
582                        OUT PIO_STATUS_BLOCK IoStatus,
583                        IN struct _DEVICE_OBJECT *DeviceObject);
584
585 BOOLEAN
586 AFSFastIoUnlockAll( IN struct _FILE_OBJECT *FileObject,
587                     IN PEPROCESS ProcessId,
588                     OUT PIO_STATUS_BLOCK IoStatus,
589                     IN struct _DEVICE_OBJECT *DeviceObject);
590
591 BOOLEAN
592 AFSFastIoUnlockAllByKey( IN struct _FILE_OBJECT *FileObject,
593                          IN PVOID ProcessId,
594                          IN ULONG Key,
595                          OUT PIO_STATUS_BLOCK IoStatus,
596                          IN struct _DEVICE_OBJECT *DeviceObject);
597
598 BOOLEAN
599 AFSFastIoDevCtrl( IN struct _FILE_OBJECT *FileObject,
600                   IN BOOLEAN Wait,
601                   IN PVOID InputBuffer OPTIONAL,
602                   IN ULONG InputBufferLength,
603                   OUT PVOID OutputBuffer OPTIONAL,
604                   IN ULONG OutputBufferLength,
605                   IN ULONG IoControlCode,
606                   OUT PIO_STATUS_BLOCK IoStatus,
607                   IN struct _DEVICE_OBJECT *DeviceObject);
608
609 VOID
610 AFSFastIoAcquireFile( IN struct _FILE_OBJECT *FileObject);
611
612 VOID
613 AFSFastIoReleaseFile( IN struct _FILE_OBJECT *FileObject);
614
615 VOID
616 AFSFastIoDetachDevice( IN struct _DEVICE_OBJECT *SourceDevice,
617                        IN struct _DEVICE_OBJECT *TargetDevice);
618
619 BOOLEAN
620 AFSFastIoQueryNetworkOpenInfo( IN struct _FILE_OBJECT *FileObject,
621                                IN BOOLEAN Wait,
622                                OUT struct _FILE_NETWORK_OPEN_INFORMATION *Buffer,
623                                OUT struct _IO_STATUS_BLOCK *IoStatus,
624                                IN struct _DEVICE_OBJECT *DeviceObject);
625
626 BOOLEAN
627 AFSFastIoMdlRead( IN struct _FILE_OBJECT *FileObject,
628                   IN PLARGE_INTEGER FileOffset,
629                   IN ULONG Length,
630                   IN ULONG LockKey,
631                   OUT PMDL *MdlChain,
632                   OUT PIO_STATUS_BLOCK IoStatus,
633                   IN struct _DEVICE_OBJECT *DeviceObject);
634
635 BOOLEAN
636 AFSFastIoMdlReadComplete( IN struct _FILE_OBJECT *FileObject,
637                           IN PMDL MdlChain,
638                           IN struct _DEVICE_OBJECT *DeviceObject);
639
640 BOOLEAN
641 AFSFastIoPrepareMdlWrite( IN struct _FILE_OBJECT *FileObject,
642                           IN PLARGE_INTEGER FileOffset,
643                           IN ULONG Length,
644                           IN ULONG LockKey,
645                           OUT PMDL *MdlChain,
646                           OUT PIO_STATUS_BLOCK IoStatus,
647                           IN struct _DEVICE_OBJECT *DeviceObject);
648
649 BOOLEAN
650 AFSFastIoMdlWriteComplete( IN struct _FILE_OBJECT *FileObject,
651                            IN PLARGE_INTEGER FileOffset,
652                            IN PMDL MdlChain,
653                            IN struct _DEVICE_OBJECT *DeviceObject);
654
655 NTSTATUS
656 AFSFastIoAcquireForModWrite( IN struct _FILE_OBJECT *FileObject,
657                              IN PLARGE_INTEGER EndingOffset,
658                              OUT struct _ERESOURCE **ResourceToRelease,
659                              IN struct _DEVICE_OBJECT *DeviceObject);
660
661 NTSTATUS
662 AFSFastIoReleaseForModWrite( IN struct _FILE_OBJECT *FileObject,
663                              IN struct _ERESOURCE *ResourceToRelease,
664                              IN struct _DEVICE_OBJECT *DeviceObject);
665
666 NTSTATUS
667 AFSFastIoAcquireForCCFlush( IN struct _FILE_OBJECT *FileObject,
668                             IN struct _DEVICE_OBJECT *DeviceObject);
669
670 NTSTATUS
671 AFSFastIoReleaseForCCFlush( IN struct _FILE_OBJECT *FileObject,
672                             IN struct _DEVICE_OBJECT *DeviceObject);
673
674 BOOLEAN
675 AFSFastIoReadCompressed( IN struct _FILE_OBJECT *FileObject,
676                          IN PLARGE_INTEGER FileOffset,
677                          IN ULONG Length,
678                          IN ULONG LockKey,
679                          OUT PVOID Buffer,
680                          OUT PMDL *MdlChain,
681                          OUT PIO_STATUS_BLOCK IoStatus,
682                          OUT struct _COMPRESSED_DATA_INFO *CompressedDataInfo,
683                          IN ULONG CompressedDataInfoLength,
684                          IN struct _DEVICE_OBJECT *DeviceObject);
685
686 BOOLEAN
687 AFSFastIoWriteCompressed( IN struct _FILE_OBJECT *FileObject,
688                           IN PLARGE_INTEGER FileOffset,
689                           IN ULONG Length,
690                           IN ULONG LockKey,
691                           IN PVOID Buffer,
692                           OUT PMDL *MdlChain,
693                           OUT PIO_STATUS_BLOCK IoStatus,
694                           IN struct _COMPRESSED_DATA_INFO *CompressedDataInfo,
695                           IN ULONG CompressedDataInfoLength,
696                           IN struct _DEVICE_OBJECT *DeviceObject);
697
698 BOOLEAN
699 AFSFastIoMdlReadCompleteCompressed( IN struct _FILE_OBJECT *FileObject,
700                                     IN PMDL MdlChain,
701                                     IN struct _DEVICE_OBJECT *DeviceObject);
702
703 BOOLEAN
704 AFSFastIoMdlWriteCompleteCompressed( IN struct _FILE_OBJECT *FileObject,
705                                      IN PLARGE_INTEGER FileOffset,
706                                      IN PMDL MdlChain,
707                                      IN struct _DEVICE_OBJECT *DeviceObject);
708
709 BOOLEAN
710 AFSFastIoQueryOpen( IN struct _IRP *Irp,
711                     OUT PFILE_NETWORK_OPEN_INFORMATION NetworkInformation,
712                     IN struct _DEVICE_OBJECT *DeviceObject);
713
714 //
715 // AFSLibrarySupport.cpp Prototypes
716 //
717
718 NTSTATUS
719 AFSLoadLibrary( IN ULONG Flags,
720                 IN UNICODE_STRING *ServicePath);
721
722 NTSTATUS
723 AFSUnloadLibrary( IN BOOLEAN CancelQueue);
724
725 NTSTATUS
726 AFSCheckLibraryState( IN PIRP Irp);
727
728 NTSTATUS
729 AFSClearLibraryRequest( void);
730
731 NTSTATUS
732 AFSQueueLibraryRequest( IN PIRP Irp);
733
734 NTSTATUS
735 AFSProcessQueuedResults( IN BOOLEAN CancelRequest);
736
737 NTSTATUS
738 AFSSubmitLibraryRequest( IN PIRP Irp);
739
740 NTSTATUS
741 AFSInitializeLibrary( IN AFSFileID *GlobalRootFid,
742                       IN BOOLEAN QueueRootEnumeration);
743
744 //
745 // AFSRDRSupport.cpp Prototypes
746 //
747
748 NTSTATUS
749 AFSInitRDRDevice( void);
750
751 NTSTATUS
752 AFSRDRDeviceControl( IN PDEVICE_OBJECT DeviceObject,
753                      IN PIRP Irp);
754
755 NTSTATUS
756 AFSInitializeRedirector( IN AFSRedirectorInitInfo *CacheFileInfo);
757
758 NTSTATUS
759 AFSCloseRedirector( void);
760
761 //
762 // AFSLogSupport.cpp
763 //
764
765 NTSTATUS
766 AFSDbgLogMsg( IN ULONG Subsystem,
767               IN ULONG Level,
768               IN PCCH Format,
769               ...);
770
771 NTSTATUS
772 AFSInitializeDbgLog( void);
773
774 NTSTATUS
775 AFSTearDownDbgLog( void);
776
777 NTSTATUS
778 AFSConfigureTrace( IN AFSTraceConfigCB *TraceInfo);
779
780 NTSTATUS
781 AFSGetTraceBuffer( IN ULONG TraceBufferLength,
782                    OUT void *TraceBuffer,
783                    OUT ULONG_PTR *CopiedLength);
784
785 void
786 AFSTagInitialLogEntry( void);
787
788 void
789 AFSDumpTraceFiles( void);
790
791 NTSTATUS
792 AFSInitializeDumpFile( void);
793
794 //
795 // AFSProcessSupport.cpp Prototypes
796 //
797
798 void
799 AFSProcessNotify( IN HANDLE  ParentId,
800                   IN HANDLE  ProcessId,
801                   IN BOOLEAN  Create);
802
803 void
804 AFSProcessNotifyEx( IN OUT PEPROCESS Process,
805                     IN     HANDLE ProcessId,
806                     IN OUT PPS_CREATE_NOTIFY_INFO CreateInfo);
807
808 void
809 AFSProcessCreate( IN HANDLE ParentId,
810                   IN HANDLE ProcessId,
811                   IN HANDLE CreatingProcessId,
812                   IN HANDLE CreatingThreadId);
813
814 void
815 AFSProcessDestroy( IN HANDLE ProcessId);
816
817 GUID *
818 AFSValidateProcessEntry( IN HANDLE  ProcessId,
819                          IN BOOLEAN bProcessTreeLocked);
820
821 BOOLEAN
822 AFSIs64BitProcess( IN ULONGLONG ProcessId);
823
824 AFSProcessCB *
825 AFSInitializeProcessCB( IN ULONGLONG ParentProcessId,
826                         IN ULONGLONG ProcessId);
827
828 AFSThreadCB *
829 AFSInitializeThreadCB( IN AFSProcessCB *ProcessCB,
830                        IN ULONGLONG ThreadId);
831
832 };
833
834 #endif /* _AFS_COMMON_H */