Windows: RDR File System Framework driver
[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 //
208 // AFSClose.cpp Prototypes
209 //
210
211 NTSTATUS
212 AFSClose( IN PDEVICE_OBJECT DeviceObject,
213           IN PIRP Irp);
214
215 NTSTATUS
216 AFSCommonClose( IN PDEVICE_OBJECT DeviceObject,
217                 IN PIRP Irp);
218
219 //
220 // AFSNetworkProviderSupport.cpp
221 //
222
223 NTSTATUS
224 AFSAddConnectionEx( IN UNICODE_STRING *RemoteName,
225                     IN ULONG DisplayType,
226                     IN ULONG Flags);
227
228 void
229 AFSInitializeConnectionInfo( IN AFSProviderConnectionCB *Connection,
230                              IN ULONG DisplayType);
231
232 //
233 // AFSRead.cpp Prototypes
234 //
235
236 NTSTATUS
237 AFSRead( IN PDEVICE_OBJECT DeviceObject,
238          IN PIRP Irp);
239
240 //
241 // AFSWrite.cpp Prototypes
242 //
243
244 NTSTATUS
245 AFSWrite( IN PDEVICE_OBJECT DeviceObject,
246                 IN PIRP Irp);
247
248 //
249 // AFSFileInfo.cpp Prototypes
250 //
251
252 NTSTATUS
253 AFSQueryFileInfo( IN PDEVICE_OBJECT DeviceObject,
254                   IN PIRP Irp);
255
256 NTSTATUS
257 AFSSetFileInfo( IN PDEVICE_OBJECT DeviceObject,
258                 IN PIRP Irp);
259
260 //
261 // AFSEa.cpp Prototypes
262 //
263
264 NTSTATUS
265 AFSQueryEA( IN PDEVICE_OBJECT DeviceObject,
266             IN PIRP Irp);
267
268 NTSTATUS
269 AFSSetEA( IN PDEVICE_OBJECT DeviceObject,
270           IN PIRP Irp);
271
272 //
273 // AFSFlushBuffers.cpp Prototypes
274 //
275
276 NTSTATUS
277 AFSFlushBuffers( IN PDEVICE_OBJECT DeviceObject,
278                  IN PIRP Irp);
279
280 //
281 // AFSVolumeInfo.cpp Prototypes
282 //
283
284 NTSTATUS
285 AFSQueryVolumeInfo( IN PDEVICE_OBJECT DeviceObject,
286                     IN PIRP Irp);
287
288 NTSTATUS
289 AFSSetVolumeInfo( IN PDEVICE_OBJECT DeviceObject,
290                   IN PIRP Irp);
291
292 NTSTATUS
293 AFSSetVolumeInfo( IN PDEVICE_OBJECT DeviceObject,
294                   IN PIRP Irp);
295
296 //
297 // AFSDirControl.cpp Prototypes
298 //
299
300 NTSTATUS
301 AFSDirControl( IN PDEVICE_OBJECT DeviceObject,
302                IN PIRP Irp);
303
304 //
305 // AFSFSControl.cpp Prototypes
306 //
307
308 NTSTATUS
309 AFSFSControl( IN PDEVICE_OBJECT DeviceObject,
310               IN PIRP Irp);
311
312 //
313 // AFSDevControl.cpp Prototypes
314 //
315
316 NTSTATUS
317 AFSDevControl( IN PDEVICE_OBJECT DeviceObject,
318                IN PIRP Irp);
319
320 //
321 // AFSInternalDevControl.cpp Prototypes
322 //
323
324 NTSTATUS
325 AFSInternalDevControl( IN PDEVICE_OBJECT DeviceObject,
326                        IN PIRP Irp);
327
328 //
329 // AFSShutdown.cpp Prototypes
330 //
331
332 NTSTATUS
333 AFSShutdown( IN PDEVICE_OBJECT DeviceObject,
334              IN PIRP Irp);
335
336
337 NTSTATUS
338 AFSShutdownFilesystem( void);
339
340 //
341 // AFSLockControl.cpp Prototypes
342 //
343
344 NTSTATUS
345 AFSLockControl( IN PDEVICE_OBJECT DeviceObject,
346                 IN PIRP Irp);
347
348 //
349 // AFSCleanup.cpp Prototypes
350 //
351
352 NTSTATUS
353 AFSCleanup( IN PDEVICE_OBJECT DeviceObject,
354             IN PIRP Irp);
355
356 NTSTATUS
357 AFSCommonCleanup( IN PDEVICE_OBJECT DeviceObject,
358                   IN PIRP Irp);
359
360 //
361 // AFSSecurity.cpp Prototypes
362 //
363
364 NTSTATUS
365 AFSQuerySecurity( IN PDEVICE_OBJECT DeviceObject,
366                   IN PIRP Irp);
367
368 NTSTATUS
369 AFSSetSecurity( IN PDEVICE_OBJECT DeviceObject,
370                 IN PIRP Irp);
371
372 //
373 // AFSSystemControl.cpp Prototypes
374 //
375
376 NTSTATUS
377 AFSSystemControl( IN PDEVICE_OBJECT DeviceObject,
378                   IN PIRP Irp);
379
380 //
381 // AFSQuota.cpp Prototypes
382 //
383
384 NTSTATUS
385 AFSQueryQuota( IN PDEVICE_OBJECT DeviceObject,
386                IN PIRP Irp);
387
388 NTSTATUS
389 AFSSetQuota( IN PDEVICE_OBJECT DeviceObject,
390              IN PIRP Irp);
391
392 //
393 // AFSGeneric.cpp Prototypes
394 //
395
396 ULONG
397 AFSExceptionFilter( IN ULONG Code,
398                     IN PEXCEPTION_POINTERS ExceptPtrs);
399
400 BOOLEAN
401 AFSAcquireExcl( IN PERESOURCE Resource,
402                 IN BOOLEAN wait);
403
404 BOOLEAN
405 AFSAcquireSharedStarveExclusive( IN PERESOURCE Resource,
406                                  IN BOOLEAN Wait);
407
408 BOOLEAN
409 AFSAcquireShared( IN PERESOURCE Resource,
410                   IN BOOLEAN wait);
411
412 void
413 AFSReleaseResource( IN PERESOURCE Resource);
414
415 void
416 AFSConvertToShared( IN PERESOURCE Resource);
417
418 void
419 AFSCompleteRequest( IN PIRP Irp,
420                     IN ULONG Status);
421
422 NTSTATUS
423 AFSReadRegistry( IN PUNICODE_STRING RegistryPath);
424
425 NTSTATUS
426 AFSUpdateRegistryParameter( IN PUNICODE_STRING ValueName,
427                             IN ULONG ValueType,
428                             IN void *ValueData,
429                             IN ULONG ValueDataLength);
430
431 NTSTATUS
432 AFSInitializeControlDevice( void);
433
434 NTSTATUS
435 AFSRemoveControlDevice( void);
436
437 NTSTATUS
438 AFSDefaultDispatch( IN PDEVICE_OBJECT DeviceObject,
439                     IN PIRP Irp);
440
441 NTSTATUS
442 AFSIrpComplete( IN PDEVICE_OBJECT DeviceObject,
443                 IN PIRP           Irp,
444                 IN PVOID          Context);
445
446 void
447 AFSInitServerStrings( void);
448
449 NTSTATUS
450 AFSReadServerName( void);
451
452 NTSTATUS
453 AFSSetSysNameInformation( IN AFSSysNameNotificationCB *SysNameInfo,
454                           IN ULONG SysNameInfoBufferLength);
455
456 void
457 AFSResetSysNameList( IN AFSSysNameCB *SysNameList);
458
459 NTSTATUS
460 AFSSendDeviceIoControl( IN DEVICE_OBJECT *TargetDeviceObject,
461                         IN ULONG IOControl,
462                         IN void *InputBuffer,
463                         IN ULONG InputBufferLength,
464                         IN OUT void *OutputBuffer,
465                         IN ULONG OutputBufferLength,
466                         OUT ULONG *ResultLength);
467
468 void *
469 AFSExAllocatePoolWithTag( IN POOL_TYPE  PoolType,
470                           IN SIZE_T  NumberOfBytes,
471                           IN ULONG  Tag);
472
473 void
474 AFSExFreePool( IN void *Buffer);
475
476 NTSTATUS
477 AFSShutdownRedirector( void);
478
479 BOOLEAN
480 AFSAcquireFcbForLazyWrite( IN PVOID Fcb,
481                            IN BOOLEAN Wait);
482
483 VOID
484 AFSReleaseFcbFromLazyWrite( IN PVOID Fcb);
485
486 BOOLEAN
487 AFSAcquireFcbForReadAhead( IN PVOID Fcb,
488                            IN BOOLEAN Wait);
489
490 VOID
491 AFSReleaseFcbFromReadAhead( IN PVOID Fcb);
492
493 NTSTATUS
494 AFSGetCallerSID( OUT UNICODE_STRING *SIDString,
495                  OUT BOOLEAN *pbImpersonation);
496
497 ULONG
498 AFSGetSessionId( IN HANDLE ProcessId,
499                  OUT BOOLEAN *pbImpersonation);
500
501 NTSTATUS
502 AFSCheckThreadDacl( OUT GUID *AuthGroup);
503
504 NTSTATUS
505 AFSProcessSetProcessDacl( IN AFSProcessCB *ProcessCB);
506
507 //
508 // Prototypes in AFSFastIoSupprt.cpp
509 //
510
511 BOOLEAN
512 AFSFastIoCheckIfPossible( IN struct _FILE_OBJECT *FileObject,
513                           IN PLARGE_INTEGER FileOffset,
514                           IN ULONG Length,
515                           IN BOOLEAN Wait,
516                           IN ULONG LockKey,
517                           IN BOOLEAN CheckForReadOperation,
518                           OUT PIO_STATUS_BLOCK IoStatus,
519                           IN struct _DEVICE_OBJECT *DeviceObject);
520
521 BOOLEAN
522 AFSFastIoRead( IN struct _FILE_OBJECT *FileObject,
523                IN PLARGE_INTEGER FileOffset,
524                IN ULONG Length,
525                IN BOOLEAN Wait,
526                IN ULONG LockKey,
527                OUT PVOID Buffer,
528                OUT PIO_STATUS_BLOCK IoStatus,
529                IN struct _DEVICE_OBJECT *DeviceObject);
530
531 BOOLEAN
532 AFSFastIoWrite( IN struct _FILE_OBJECT *FileObject,
533                 IN PLARGE_INTEGER FileOffset,
534                 IN ULONG Length,
535                 IN BOOLEAN Wait,
536                 IN ULONG LockKey,
537                 IN PVOID Buffer,
538                 OUT PIO_STATUS_BLOCK IoStatus,
539                 IN struct _DEVICE_OBJECT *DeviceObject);
540
541 BOOLEAN
542 AFSFastIoQueryBasicInfo( IN struct _FILE_OBJECT *FileObject,
543                          IN BOOLEAN Wait,
544                          OUT PFILE_BASIC_INFORMATION Buffer,
545                          OUT PIO_STATUS_BLOCK IoStatus,
546                          IN struct _DEVICE_OBJECT *DeviceObject);
547
548 BOOLEAN
549 AFSFastIoQueryStandardInfo( IN struct _FILE_OBJECT *FileObject,
550                             IN BOOLEAN Wait,
551                             OUT PFILE_STANDARD_INFORMATION Buffer,
552                             OUT PIO_STATUS_BLOCK IoStatus,
553                             IN struct _DEVICE_OBJECT *DeviceObject);
554
555 BOOLEAN
556 AFSFastIoLock( IN struct _FILE_OBJECT *FileObject,
557                IN PLARGE_INTEGER FileOffset,
558                IN PLARGE_INTEGER Length,
559                IN PEPROCESS ProcessId,
560                IN ULONG Key,
561                IN BOOLEAN FailImmediately,
562                IN BOOLEAN ExclusiveLock,
563                OUT PIO_STATUS_BLOCK IoStatus,
564                IN struct _DEVICE_OBJECT *DeviceObject);
565
566 BOOLEAN
567 AFSFastIoUnlockSingle( IN struct _FILE_OBJECT *FileObject,
568                        IN PLARGE_INTEGER FileOffset,
569                        IN PLARGE_INTEGER Length,
570                        IN PEPROCESS ProcessId,
571                        IN ULONG Key,
572                        OUT PIO_STATUS_BLOCK IoStatus,
573                        IN struct _DEVICE_OBJECT *DeviceObject);
574
575 BOOLEAN
576 AFSFastIoUnlockAll( IN struct _FILE_OBJECT *FileObject,
577                     IN PEPROCESS ProcessId,
578                     OUT PIO_STATUS_BLOCK IoStatus,
579                     IN struct _DEVICE_OBJECT *DeviceObject);
580
581 BOOLEAN
582 AFSFastIoUnlockAllByKey( IN struct _FILE_OBJECT *FileObject,
583                          IN PVOID ProcessId,
584                          IN ULONG Key,
585                          OUT PIO_STATUS_BLOCK IoStatus,
586                          IN struct _DEVICE_OBJECT *DeviceObject);
587
588 BOOLEAN
589 AFSFastIoDevCtrl( IN struct _FILE_OBJECT *FileObject,
590                   IN BOOLEAN Wait,
591                   IN PVOID InputBuffer OPTIONAL,
592                   IN ULONG InputBufferLength,
593                   OUT PVOID OutputBuffer OPTIONAL,
594                   IN ULONG OutputBufferLength,
595                   IN ULONG IoControlCode,
596                   OUT PIO_STATUS_BLOCK IoStatus,
597                   IN struct _DEVICE_OBJECT *DeviceObject);
598
599 VOID
600 AFSFastIoAcquireFile( IN struct _FILE_OBJECT *FileObject);
601
602 VOID
603 AFSFastIoReleaseFile( IN struct _FILE_OBJECT *FileObject);
604
605 VOID
606 AFSFastIoDetachDevice( IN struct _DEVICE_OBJECT *SourceDevice,
607                        IN struct _DEVICE_OBJECT *TargetDevice);
608
609 BOOLEAN
610 AFSFastIoQueryNetworkOpenInfo( IN struct _FILE_OBJECT *FileObject,
611                                IN BOOLEAN Wait,
612                                OUT struct _FILE_NETWORK_OPEN_INFORMATION *Buffer,
613                                OUT struct _IO_STATUS_BLOCK *IoStatus,
614                                IN struct _DEVICE_OBJECT *DeviceObject);
615
616 BOOLEAN
617 AFSFastIoMdlRead( IN struct _FILE_OBJECT *FileObject,
618                   IN PLARGE_INTEGER FileOffset,
619                   IN ULONG Length,
620                   IN ULONG LockKey,
621                   OUT PMDL *MdlChain,
622                   OUT PIO_STATUS_BLOCK IoStatus,
623                   IN struct _DEVICE_OBJECT *DeviceObject);
624
625 BOOLEAN
626 AFSFastIoMdlReadComplete( IN struct _FILE_OBJECT *FileObject,
627                           IN PMDL MdlChain,
628                           IN struct _DEVICE_OBJECT *DeviceObject);
629
630 BOOLEAN
631 AFSFastIoPrepareMdlWrite( IN struct _FILE_OBJECT *FileObject,
632                           IN PLARGE_INTEGER FileOffset,
633                           IN ULONG Length,
634                           IN ULONG LockKey,
635                           OUT PMDL *MdlChain,
636                           OUT PIO_STATUS_BLOCK IoStatus,
637                           IN struct _DEVICE_OBJECT *DeviceObject);
638
639 BOOLEAN
640 AFSFastIoMdlWriteComplete( IN struct _FILE_OBJECT *FileObject,
641                            IN PLARGE_INTEGER FileOffset,
642                            IN PMDL MdlChain,
643                            IN struct _DEVICE_OBJECT *DeviceObject);
644
645 NTSTATUS
646 AFSFastIoAcquireForModWrite( IN struct _FILE_OBJECT *FileObject,
647                              IN PLARGE_INTEGER EndingOffset,
648                              OUT struct _ERESOURCE **ResourceToRelease,
649                              IN struct _DEVICE_OBJECT *DeviceObject);
650
651 NTSTATUS
652 AFSFastIoReleaseForModWrite( IN struct _FILE_OBJECT *FileObject,
653                              IN struct _ERESOURCE *ResourceToRelease,
654                              IN struct _DEVICE_OBJECT *DeviceObject);
655
656 NTSTATUS
657 AFSFastIoAcquireForCCFlush( IN struct _FILE_OBJECT *FileObject,
658                             IN struct _DEVICE_OBJECT *DeviceObject);
659
660 NTSTATUS
661 AFSFastIoReleaseForCCFlush( IN struct _FILE_OBJECT *FileObject,
662                             IN struct _DEVICE_OBJECT *DeviceObject);
663
664 BOOLEAN
665 AFSFastIoReadCompressed( IN struct _FILE_OBJECT *FileObject,
666                          IN PLARGE_INTEGER FileOffset,
667                          IN ULONG Length,
668                          IN ULONG LockKey,
669                          OUT PVOID Buffer,
670                          OUT PMDL *MdlChain,
671                          OUT PIO_STATUS_BLOCK IoStatus,
672                          OUT struct _COMPRESSED_DATA_INFO *CompressedDataInfo,
673                          IN ULONG CompressedDataInfoLength,
674                          IN struct _DEVICE_OBJECT *DeviceObject);
675
676 BOOLEAN
677 AFSFastIoWriteCompressed( IN struct _FILE_OBJECT *FileObject,
678                           IN PLARGE_INTEGER FileOffset,
679                           IN ULONG Length,
680                           IN ULONG LockKey,
681                           IN PVOID Buffer,
682                           OUT PMDL *MdlChain,
683                           OUT PIO_STATUS_BLOCK IoStatus,
684                           IN struct _COMPRESSED_DATA_INFO *CompressedDataInfo,
685                           IN ULONG CompressedDataInfoLength,
686                           IN struct _DEVICE_OBJECT *DeviceObject);
687
688 BOOLEAN
689 AFSFastIoMdlReadCompleteCompressed( IN struct _FILE_OBJECT *FileObject,
690                                     IN PMDL MdlChain,
691                                     IN struct _DEVICE_OBJECT *DeviceObject);
692
693 BOOLEAN
694 AFSFastIoMdlWriteCompleteCompressed( IN struct _FILE_OBJECT *FileObject,
695                                      IN PLARGE_INTEGER FileOffset,
696                                      IN PMDL MdlChain,
697                                      IN struct _DEVICE_OBJECT *DeviceObject);
698
699 BOOLEAN
700 AFSFastIoQueryOpen( IN struct _IRP *Irp,
701                     OUT PFILE_NETWORK_OPEN_INFORMATION NetworkInformation,
702                     IN struct _DEVICE_OBJECT *DeviceObject);
703
704 //
705 // AFSLibrarySupport.cpp Prototypes
706 //
707
708 NTSTATUS
709 AFSLoadLibrary( IN ULONG Flags,
710                 IN UNICODE_STRING *ServicePath);
711
712 NTSTATUS
713 AFSUnloadLibrary( IN BOOLEAN CancelQueue);
714
715 NTSTATUS
716 AFSCheckLibraryState( IN PIRP Irp);
717
718 NTSTATUS
719 AFSClearLibraryRequest( void);
720
721 NTSTATUS
722 AFSQueueLibraryRequest( IN PIRP Irp);
723
724 NTSTATUS
725 AFSProcessQueuedResults( IN BOOLEAN CancelRequest);
726
727 NTSTATUS
728 AFSSubmitLibraryRequest( IN PIRP Irp);
729
730 NTSTATUS
731 AFSInitializeLibrary( IN AFSFileID *GlobalRootFid,
732                       IN BOOLEAN QueueRootEnumeration);
733
734 //
735 // AFSRDRSupport.cpp Prototypes
736 //
737
738 NTSTATUS
739 AFSInitRDRDevice( void);
740
741 NTSTATUS
742 AFSRDRDeviceControl( IN PDEVICE_OBJECT DeviceObject,
743                      IN PIRP Irp);
744
745 NTSTATUS
746 AFSInitializeRedirector( IN AFSRedirectorInitInfo *CacheFileInfo);
747
748 NTSTATUS
749 AFSCloseRedirector( void);
750
751 //
752 // AFSLogSupport.cpp
753 //
754
755 NTSTATUS
756 AFSDbgLogMsg( IN ULONG Subsystem,
757               IN ULONG Level,
758               IN PCCH Format,
759               ...);
760
761 NTSTATUS
762 AFSInitializeDbgLog( void);
763
764 NTSTATUS
765 AFSTearDownDbgLog( void);
766
767 NTSTATUS
768 AFSConfigureTrace( IN AFSTraceConfigCB *TraceInfo);
769
770 NTSTATUS
771 AFSGetTraceBuffer( IN ULONG TraceBufferLength,
772                    OUT void *TraceBuffer,
773                    OUT ULONG_PTR *CopiedLength);
774
775 void
776 AFSTagInitialLogEntry( void);
777
778 void
779 AFSDumpTraceFiles( void);
780
781 NTSTATUS
782 AFSInitializeDumpFile( void);
783
784 //
785 // AFSProcessSupport.cpp Prototypes
786 //
787
788 void
789 AFSProcessNotify( IN HANDLE  ParentId,
790                   IN HANDLE  ProcessId,
791                   IN BOOLEAN  Create);
792
793 GUID *
794 AFSValidateProcessEntry( void);
795
796 BOOLEAN
797 AFSIs64BitProcess( IN ULONGLONG ProcessId);
798
799 AFSProcessCB *
800 AFSInitializeProcessCB( IN ULONGLONG ParentProcessId,
801                         IN ULONGLONG ProcessId);
802
803 AFSThreadCB *
804 AFSInitializeThreadCB( IN AFSProcessCB *ProcessCB,
805                        IN ULONGLONG ThreadId);
806
807 };
808
809 #endif /* _AFS_COMMON_H */