Manually applying Gunnars patch became it's easier this way - and a good chance to...
[reactos.git] / reactos / include / ddk / fsfuncs.h
1 #ifndef __INCLUDE_DDK_FSFUNCS_H
2 #define __INCLUDE_DDK_FSFUNCS_H
3 /* $Id: fsfuncs.h,v 1.17 2002/11/07 02:44:49 robd Exp $ */
4 #define FlagOn(x,f) ((x) & (f))
5
6 VOID
7 STDCALL
8 FsRtlFreeFileLock(
9 IN PFILE_LOCK FileLock
10 );
11
12 PFILE_LOCK
13 STDCALL
14 FsRtlAllocateFileLock (
15 IN PCOMPLETE_LOCK_IRP_ROUTINE CompleteLockIrpRoutine OPTIONAL,
16 IN PUNLOCK_ROUTINE UnlockRoutine OPTIONAL
17 );
18
19 #define FsRtlAreThereCurrentFileLocks(FL) (((FL)->FastIoIsQuestionable))
20
21 BOOLEAN STDCALL
22 FsRtlAddLargeMcbEntry(IN PLARGE_MCB Mcb,
23 IN LONGLONG Vbn,
24 IN LONGLONG Lbn,
25 IN LONGLONG SectorCount);
26
27 VOID STDCALL
28 FsRtlAddMcbEntry(
29 DWORD Unknown0,
30 DWORD Unknown1,
31 DWORD Unknown2,
32 DWORD Unknown3
33 );
34
35 VOID STDCALL
36 FsRtlAddToTunnelCache (
37 IN PTUNNEL Cache,
38 IN ULONGLONG DirectoryKey,
39 IN PUNICODE_STRING ShortName,
40 IN PUNICODE_STRING LongName,
41 IN BOOLEAN KeyByShortName,
42 IN ULONG DataLength,
43 IN PVOID Data
44 );
45
46 PVOID STDCALL
47 FsRtlAllocatePool (
48 IN POOL_TYPE PoolType,
49 IN ULONG NumberOfBytes
50 );
51
52 PVOID STDCALL
53 FsRtlAllocatePoolWithQuota (
54 IN POOL_TYPE PoolType,
55 IN ULONG NumberOfBytes
56 );
57
58 PVOID STDCALL
59 FsRtlAllocatePoolWithQuotaTag (
60 IN POOL_TYPE PoolType,
61 IN ULONG NumberOfBytes,
62 IN ULONG Tag
63 );
64 PVOID
65 STDCALL
66 FsRtlAllocatePoolWithTag (
67 IN POOL_TYPE PoolType,
68 IN ULONG NumberOfBytes,
69 IN ULONG Tag
70 );
71 DWORD
72 STDCALL
73 FsRtlAllocateResource (
74 VOID
75 );
76 BOOLEAN
77 STDCALL
78 FsRtlAreNamesEqual (
79 IN PUNICODE_STRING Name1,
80 IN PUNICODE_STRING Name2,
81 IN BOOLEAN IgnoreCase,
82 IN PWCHAR UpcaseTable OPTIONAL
83 );
84 DWORD
85 STDCALL
86 FsRtlBalanceReads (
87 DWORD Unknown0
88 );
89 BOOLEAN
90 STDCALL
91 FsRtlCheckLockForReadAccess (
92 IN PFILE_LOCK FileLock,
93 IN PIRP Irp
94 );
95 BOOLEAN
96 STDCALL
97 FsRtlCheckLockForWriteAccess (
98 IN PFILE_LOCK FileLock,
99 IN PIRP Irp
100 );
101
102 NTSTATUS STDCALL
103 FsRtlCheckOplock(IN POPLOCK Oplock,
104 IN PIRP Irp,
105 IN PVOID Context,
106 IN POPLOCK_WAIT_COMPLETE_ROUTINE CompletionRoutine OPTIONAL,
107 IN POPLOCK_FS_PREPOST_IRP PostIrpRoutine OPTIONAL);
108
109 BOOLEAN
110 STDCALL
111 FsRtlCopyRead (
112 IN PFILE_OBJECT FileObject,
113 IN PLARGE_INTEGER FileOffset,
114 IN ULONG Length,
115 IN BOOLEAN Wait,
116 IN ULONG LockKey,
117 OUT PVOID Buffer,
118 OUT PIO_STATUS_BLOCK IoStatus,
119 IN PDEVICE_OBJECT DeviceObject
120 );
121 BOOLEAN
122 STDCALL
123 FsRtlCopyWrite (
124 IN PFILE_OBJECT FileObject,
125 IN PLARGE_INTEGER FileOffset,
126 IN ULONG Length,
127 IN BOOLEAN Wait,
128 IN ULONG LockKey,
129 IN PVOID Buffer,
130 OUT PIO_STATUS_BLOCK IoStatus,
131 IN PDEVICE_OBJECT DeviceObject
132 );
133
134 BOOLEAN STDCALL
135 FsRtlCurrentBatchOplock(IN POPLOCK Oplock);
136
137 VOID STDCALL
138 FsRtlDeleteKeyFromTunnelCache(IN PTUNNEL Cache,
139 IN ULONGLONG DirectoryKey);
140
141 VOID STDCALL
142 FsRtlDeleteTunnelCache(IN PTUNNEL Cache);
143
144 VOID STDCALL
145 FsRtlDeregisterUncProvider(IN HANDLE Handle);
146
147 VOID
148 STDCALL
149 FsRtlDissectDbcs (
150 DWORD Unknown0,
151 DWORD Unknown1,
152 DWORD Unknown2,
153 DWORD Unknown3
154 );
155 VOID
156 STDCALL
157 FsRtlDissectName (
158 DWORD Unknown0,
159 DWORD Unknown1,
160 DWORD Unknown2,
161 DWORD Unknown3
162 );
163 BOOLEAN
164 STDCALL
165 FsRtlDoesDbcsContainWildCards (
166 IN DWORD Unknown0
167 );
168 BOOLEAN
169 STDCALL
170 FsRtlDoesNameContainWildCards (
171 IN PUNICODE_STRING Name
172 );
173 BOOLEAN
174 STDCALL
175 FsRtlFastCheckLockForRead (
176 IN PFILE_LOCK FileLock,
177 IN PLARGE_INTEGER FileOffset,
178 IN PLARGE_INTEGER Length,
179 IN ULONG Key,
180 IN PFILE_OBJECT FileObject,
181 IN PEPROCESS Process
182 );
183 BOOLEAN
184 STDCALL
185 FsRtlFastCheckLockForWrite (
186 IN PFILE_LOCK FileLock,
187 IN PLARGE_INTEGER FileOffset,
188 IN PLARGE_INTEGER Length,
189 IN ULONG Key,
190 IN PFILE_OBJECT FileObject,
191 IN PEPROCESS Process
192 );
193 NTSTATUS
194 STDCALL
195 FsRtlFastUnlockAll (
196 IN PFILE_LOCK FileLock,
197 IN PFILE_OBJECT FileObject,
198 IN PEPROCESS Process,
199 IN PVOID Context OPTIONAL
200 );
201 NTSTATUS
202 STDCALL
203 FsRtlFastUnlockAllByKey (
204 IN PFILE_LOCK FileLock,
205 IN PFILE_OBJECT FileObject,
206 IN PEPROCESS Process,
207 IN DWORD Key,
208 IN PVOID Context OPTIONAL
209 );
210 NTSTATUS
211 STDCALL
212 FsRtlFastUnlockSingle (
213 IN PFILE_LOCK FileLock,
214 IN PFILE_OBJECT FileObject,
215 IN PLARGE_INTEGER FileOffset,
216 IN PLARGE_INTEGER Length,
217 IN PEPROCESS Process,
218 IN ULONG Key,
219 IN PVOID Context OPTIONAL,
220 IN BOOLEAN AlreadySynchronized
221 );
222 VOID
223 STDCALL
224 FsRtlFindInTunnelCache (
225 IN PTUNNEL Cache,
226 IN ULONGLONG DirectoryKey,
227 IN PUNICODE_STRING Name,
228 OUT PUNICODE_STRING ShortName,
229 OUT PUNICODE_STRING LongName,
230 IN OUT PULONG DataLength,
231 OUT PVOID Data
232 );
233 NTSTATUS
234 STDCALL
235 FsRtlGetFileSize (
236 IN PFILE_OBJECT FileObject,
237 IN OUT PLARGE_INTEGER FileSize
238 );
239 PFILE_LOCK_INFO
240 STDCALL
241 FsRtlGetNextFileLock (
242 IN PFILE_LOCK FileLock,
243 IN BOOLEAN Restart
244 );
245
246 BOOLEAN STDCALL
247 FsRtlGetNextLargeMcbEntry(IN PLARGE_MCB Mcb,
248 IN ULONG RunIndex,
249 OUT PLONGLONG Vbn,
250 OUT PLONGLONG Lbn,
251 OUT PLONGLONG SectorCount);
252
253 VOID
254 STDCALL
255 FsRtlGetNextMcbEntry (
256 DWORD Unknown0,
257 DWORD Unknown1,
258 DWORD Unknown2,
259 DWORD Unknown3,
260 DWORD Unknown4
261 );
262 #define FsRtlEnterFileSystem KeEnterCriticalRegion
263 #define FsRtlExitFileSystem KeLeaveCriticalRegion
264 VOID
265 STDCALL
266 FsRtlInitializeFileLock (
267 IN PFILE_LOCK FileLock,
268 IN PCOMPLETE_LOCK_IRP_ROUTINE CompleteLockIrpRoutine OPTIONAL,
269 IN PUNLOCK_ROUTINE UnlockRoutine OPTIONAL
270 );
271
272 VOID STDCALL
273 FsRtlInitializeLargeMcb(IN PLARGE_MCB Mcb,
274 IN POOL_TYPE PoolType);
275
276 VOID
277 STDCALL
278 FsRtlInitializeMcb (
279 DWORD Unknown0,
280 DWORD Unknown1
281 );
282
283 VOID STDCALL
284 FsRtlInitializeOplock(IN OUT POPLOCK Oplock);
285
286 VOID
287 STDCALL
288 FsRtlInitializeTunnelCache (
289 IN PTUNNEL Cache
290 );
291 BOOLEAN
292 STDCALL
293 FsRtlIsDbcsInExpression (
294 DWORD Unknown0,
295 DWORD Unknown1
296 );
297 BOOLEAN
298 STDCALL
299 FsRtlIsFatDbcsLegal (
300 DWORD Unknown0,
301 DWORD Unknown1,
302 DWORD Unknown2,
303 DWORD Unknown3,
304 DWORD Unknown4
305 );
306 BOOLEAN
307 STDCALL
308 FsRtlIsHpfsDbcsLegal (
309 DWORD Unknown0,
310 DWORD Unknown1,
311 DWORD Unknown2,
312 DWORD Unknown3,
313 DWORD Unknown4
314 );
315 BOOLEAN
316 STDCALL
317 FsRtlIsNameInExpression (
318 IN PUNICODE_STRING Expression,
319 IN PUNICODE_STRING Name,
320 IN BOOLEAN IgnoreCase,
321 IN PWCHAR UpcaseTable OPTIONAL
322 );
323
324 BOOLEAN STDCALL
325 FsRtlIsNtstatusExpected(IN NTSTATUS NtStatus);
326
327 BOOLEAN STDCALL
328 FsRtlIsTotalDeviceFailure(IN NTSTATUS NtStatus);
329
330 #define FsRtlIsUnicodeCharacterWild(C) ( \
331 (((C) >= 0x40) ? \
332 FALSE : \
333 FlagOn((*FsRtlLegalAnsiCharacterArray)[(C)], FSRTL_WILD_CHARACTER )) \
334 )
335
336 BOOLEAN STDCALL
337 FsRtlLookupLargeMcbEntry(IN PLARGE_MCB Mcb,
338 IN LONGLONG Vbn,
339 OUT PLONGLONG Lbn OPTIONAL,
340 OUT PLONGLONG SectorCountFromLbn OPTIONAL,
341 OUT PLONGLONG StartingLbn OPTIONAL,
342 OUT PLONGLONG SectorCountFromStartingLbn OPTIONAL,
343 OUT PULONG Index OPTIONAL);
344
345 BOOLEAN STDCALL
346 FsRtlLookupLastLargeMcbEntry(IN PLARGE_MCB Mcb,
347 OUT PLONGLONG Vbn,
348 OUT PLONGLONG Lbn);
349
350 VOID
351 STDCALL
352 FsRtlLookupLastMcbEntry (
353 DWORD Unknown0,
354 DWORD Unknown1,
355 DWORD Unknown2
356 );
357 VOID
358 STDCALL
359 FsRtlLookupMcbEntry (
360 DWORD Unknown0,
361 DWORD Unknown1,
362 DWORD Unknown2,
363 DWORD Unknown3,
364 DWORD Unknown4
365 );
366 BOOLEAN
367 STDCALL
368 FsRtlMdlRead (
369 IN PFILE_OBJECT FileObject,
370 IN PLARGE_INTEGER FileOffset,
371 IN ULONG Length,
372 IN ULONG LockKey,
373 OUT PMDL *MdlChain,
374 OUT PIO_STATUS_BLOCK IoStatus
375 );
376 BOOLEAN
377 STDCALL
378 FsRtlMdlReadComplete (
379 IN PFILE_OBJECT FileObject,
380 IN OUT PMDL MdlChain
381 );
382 BOOLEAN
383 STDCALL
384 FsRtlMdlReadCompleteDev (
385 IN PFILE_OBJECT FileObject,
386 IN PMDL MdlChain,
387 IN PDEVICE_OBJECT DeviceObject
388 );
389 BOOLEAN
390 STDCALL
391 FsRtlMdlReadDev (
392 IN PFILE_OBJECT FileObject,
393 IN PLARGE_INTEGER FileOffset,
394 IN ULONG Length,
395 IN ULONG LockKey,
396 OUT PMDL *MdlChain,
397 OUT PIO_STATUS_BLOCK IoStatus,
398 IN PDEVICE_OBJECT DeviceObject
399 );
400 BOOLEAN
401 STDCALL
402 FsRtlMdlWriteComplete (
403 IN PFILE_OBJECT FileObject,
404 IN PLARGE_INTEGER FileOffset,
405 IN PMDL MdlChain
406 );
407 BOOLEAN
408 STDCALL
409 FsRtlMdlWriteCompleteDev (
410 IN PFILE_OBJECT FileObject,
411 IN PLARGE_INTEGER FileOffset,
412 IN PMDL MdlChain,
413 IN PDEVICE_OBJECT DeviceObject
414 );
415 VOID
416 STDCALL
417 FsRtlNotifyChangeDirectory (
418 IN PNOTIFY_SYNC NotifySync,
419 IN PVOID FsContext,
420 IN PSTRING FullDirectoryName,
421 IN PLIST_ENTRY NotifyList,
422 IN BOOLEAN WatchTree,
423 IN ULONG CompletionFilter,
424 IN PIRP NotifyIrp
425 );
426 VOID
427 STDCALL
428 FsRtlNotifyCleanup (
429 IN PNOTIFY_SYNC NotifySync,
430 IN PLIST_ENTRY NotifyList,
431 IN PVOID FsContext
432 );
433 typedef
434 BOOLEAN (*PCHECK_FOR_TRAVERSE_ACCESS) (
435 IN PVOID NotifyContext,
436 IN PVOID TargetContext,
437 IN PSECURITY_SUBJECT_CONTEXT SubjectContext
438 );
439 VOID
440 STDCALL
441 FsRtlNotifyFullChangeDirectory (
442 IN PNOTIFY_SYNC NotifySync,
443 IN PLIST_ENTRY NotifyList,
444 IN PVOID FsContext,
445 IN PSTRING FullDirectoryName,
446 IN BOOLEAN WatchTree,
447 IN BOOLEAN IgnoreBuffer,
448 IN ULONG CompletionFilter,
449 IN PIRP NotifyIrp,
450 IN PCHECK_FOR_TRAVERSE_ACCESS TraverseCallback OPTIONAL,
451 IN PSECURITY_SUBJECT_CONTEXT SubjectContext OPTIONAL
452 );
453 VOID
454 STDCALL
455 FsRtlNotifyFullReportChange (
456 IN PNOTIFY_SYNC NotifySync,
457 IN PLIST_ENTRY NotifyList,
458 IN PSTRING FullTargetName,
459 IN USHORT TargetNameOffset,
460 IN PSTRING StreamName OPTIONAL,
461 IN PSTRING NormalizedParentName OPTIONAL,
462 IN ULONG FilterMatch,
463 IN ULONG Action,
464 IN PVOID TargetContext
465 );
466 VOID
467 STDCALL
468 FsRtlNotifyUninitializeSync (
469 IN OUT PNOTIFY_SYNC * NotifySync
470 );
471 VOID
472 STDCALL
473 FsRtlNotifyReportChange (
474 IN PNOTIFY_SYNC NotifySync,
475 IN PLIST_ENTRY NotifyList,
476 IN PSTRING FullTargetName,
477 IN PUSHORT FileNamePartLength,
478 IN ULONG FilterMatch
479 );
480
481 VOID STDCALL
482 FsRtlNotifyInitializeSync(IN OUT PNOTIFY_SYNC *NotifySync);
483
484 NTSTATUS STDCALL
485 FsRtlNotifyVolumeEvent(IN PFILE_OBJECT FileObject,
486 IN ULONG EventCode);
487
488 NTSTATUS STDCALL
489 FsRtlOplockFsctrl(IN POPLOCK Oplock,
490 IN PIRP Irp,
491 IN ULONG OpenCount);
492
493 BOOLEAN STDCALL
494 FsRtlOplockIsFastIoPossible(IN POPLOCK Oplock);
495
496 BOOLEAN
497 STDCALL
498 FsRtlPrepareMdlWrite (
499 IN PFILE_OBJECT FileObject,
500 IN PLARGE_INTEGER FileOffset,
501 IN ULONG Length,
502 IN ULONG LockKey,
503 OUT PMDL *MdlChain,
504 OUT PIO_STATUS_BLOCK IoStatus
505 );
506 BOOLEAN
507 STDCALL
508 FsRtlPrepareMdlWriteDev (
509 IN PFILE_OBJECT FileObject,
510 IN PLARGE_INTEGER FileOffset,
511 IN ULONG Length,
512 IN ULONG LockKey,
513 OUT PMDL *MdlChain,
514 OUT PIO_STATUS_BLOCK IoStatus,
515 IN PDEVICE_OBJECT DeviceObject
516 );
517
518 NTSTATUS STDCALL
519 FsRtlNormalizeNtstatus(IN NTSTATUS NtStatusToNormalize,
520 IN NTSTATUS NormalizedNtStatus);
521
522 ULONG STDCALL
523 FsRtlNumberOfRunsInLargeMcb(IN PLARGE_MCB Mcb);
524
525 VOID
526 STDCALL
527 FsRtlNumberOfRunsInMcb (
528 DWORD Unknown0
529 );
530 VOID
531 STDCALL
532 FsRtlPostPagingFileStackOverflow (
533 DWORD Unknown0,
534 DWORD Unknown1,
535 DWORD Unknown2
536 );
537 VOID
538 STDCALL
539 FsRtlPostStackOverflow (
540 DWORD Unknown0,
541 DWORD Unknown1,
542 DWORD Unknown2
543 );
544 BOOLEAN
545 STDCALL
546 FsRtlPrivateLock (
547 IN PFILE_LOCK FileLock,
548 IN PFILE_OBJECT FileObject,
549 IN PLARGE_INTEGER FileOffset,
550 IN PLARGE_INTEGER Length,
551 IN PEPROCESS Process,
552 IN ULONG Key,
553 IN BOOLEAN FailImmediately,
554 IN BOOLEAN ExclusiveLock,
555 OUT PIO_STATUS_BLOCK IoStatus,
556 IN PIRP Irp OPTIONAL,
557 IN PVOID Context,
558 IN BOOLEAN AlreadySynchronized
559 );
560 NTSTATUS
561 STDCALL
562 FsRtlProcessFileLock (
563 IN PFILE_LOCK FileLock,
564 IN PIRP Irp,
565 IN PVOID Context OPTIONAL
566 );
567
568 NTSTATUS STDCALL
569 FsRtlRegisterUncProvider(IN OUT PHANDLE Handle,
570 IN PUNICODE_STRING RedirectorDeviceName,
571 IN BOOLEAN MailslotsSupported);
572
573 VOID STDCALL
574 FsRtlRemoveLargeMcbEntry(IN PLARGE_MCB Mcb,
575 IN LONGLONG Vbn,
576 IN LONGLONG SectorCount);
577
578 VOID
579 STDCALL
580 FsRtlRemoveMcbEntry (
581 DWORD Unknown0,
582 DWORD Unknown1,
583 DWORD Unknown2
584 );
585
586 BOOLEAN STDCALL
587 FsRtlSplitLargeMcb(IN PLARGE_MCB Mcb,
588 IN LONGLONG Vbn,
589 IN LONGLONG Amount);
590
591 NTSTATUS
592 STDCALL
593 FsRtlSyncVolumes (
594 DWORD Unknown0,
595 DWORD Unknown1,
596 DWORD Unknown2
597 );
598
599 VOID STDCALL
600 FsRtlTruncateLargeMcb(IN PLARGE_MCB Mcb,
601 IN LONGLONG Vbn);
602
603 VOID
604 STDCALL
605 FsRtlTruncateMcb (
606 DWORD Unknown0,
607 DWORD Unknown1
608 );
609 VOID
610 STDCALL
611 FsRtlUninitializeFileLock (
612 IN PFILE_LOCK FileLock
613 );
614
615 VOID STDCALL
616 FsRtlUninitializeLargeMcb(IN PLARGE_MCB Mcb);
617
618 VOID
619 STDCALL
620 FsRtlUninitializeMcb (
621 DWORD Unknown0
622 );
623
624 VOID STDCALL
625 FsRtlUninitializeOplock(IN POPLOCK Oplock);
626
627 #endif /* __INCLUDE_DDK_FSFUNCS_H */