Added cache manager prototypes.
[reactos.git] / reactos / include / ddk / iofuncs.h
1 #ifndef _INCLUDE_DDK_IOFUNCS_H
2 #define _INCLUDE_DDK_IOFUNCS_H
3 /* $Id: iofuncs.h,v 1.13 2000/06/12 14:51:26 ekohl Exp $ */
4
5 /* --- EXPORTED BY NTOSKRNL --- */
6
7 /**********************************************************************
8 * NAME EXPORTED
9 * IoAcquireCancelSpinLock@4
10 *
11 * DESCRIPTION
12 * Synchronizes cancelable-state transistions for IRPs in a
13 * multiprocessor-safe way.
14 *
15 * ARGUMENTS
16 * Irpl
17 * Variable to store the current IRQ level.
18 *
19 * RETURN VALUE
20 * None.
21 *
22 * REVISIONS
23 *
24 */
25 VOID
26 STDCALL
27 IoAcquireCancelSpinLock (
28 PKIRQL Irpl
29 );
30 VOID
31 STDCALL
32 IoAcquireVpbSpinLock (
33 PKIRQL Irpl
34 );
35 /**********************************************************************
36 * NAME EXPORTED
37 * IoAllocateAdapterChannel@
38 *
39 * DESCRIPTION
40 * Allocates an adaptor object for a DMA operation on the target
41 * device.
42 *
43 * ARGUMENTS
44 * Adaptor
45 * Adapter channel or busmaster adapter to be allocated;
46 *
47 * DeviceObject
48 * Target device for DMA;
49 *
50 * NumberOfMapRegisters
51 * Number of map registers;
52 *
53 * ExecutionRoutine
54 * Routine to be called when the adaptor is available;
55 *
56 * Context
57 * Driver defined contex that will be passed to the
58 * execution routine.
59 *
60 * RETURN VALUE
61 * Success or failure code.
62 *
63 * REVISIONS
64 *
65 */
66 NTSTATUS
67 STDCALL
68 IoAllocateAdapterChannel (
69 PADAPTER_OBJECT AdaperObject,
70 PDEVICE_OBJECT DeviceObject,
71 ULONG NumberOfMapRegisters,
72 PDRIVER_CONTROL ExecutionRoutine,
73 PVOID Context
74 );
75 /**********************************************************************
76 * NAME EXPORTED
77 * IoAllocateController@16
78 *
79 * DESCRIPTION
80 * Sets up a call to a driver supplied controller object as
81 * soon as it is available.
82 *
83 * ARGUMENTS
84 * ControllerObject
85 * Driver created controller object;
86 *
87 * DeviceObject
88 * Target device;
89 *
90 * ExecutionObject
91 * Routine to be called;
92 *
93 * Context
94 * Driver determined context to be based to the
95 * routine.
96 *
97 * RETURN VALUE
98 * None.
99 *
100 * REVISIONS
101 *
102 */
103 VOID
104 STDCALL
105 IoAllocateController (
106 PCONTROLLER_OBJECT ControllerObject,
107 PDEVICE_OBJECT DeviceObject,
108 PDRIVER_CONTROL ExecutionRoutine,
109 PVOID Context
110 );
111 /**********************************************************************
112 * NAME EXPORTED
113 * IoAllocateErrorLogEntry@8
114 *
115 * DESCRIPTION
116 * Allocates an error log packet.
117 *
118 * ARGUMENTS
119 * IoObject
120 * Object which found the error;
121 *
122 * EntrySize
123 * Size in bytes of the packet to be allocated.
124 *
125 * RETURN VALUE
126 * On success, a pointer to the allocated packet.
127 * On failure, it returns NULL.
128 */
129 PVOID
130 STDCALL
131 IoAllocateErrorLogEntry (
132 PVOID IoObject,
133 UCHAR EntrySize
134 );
135 /**********************************************************************
136 * NAME EXPORTED
137 * IoAllocateIrp@8
138 *
139 * DESCRIPTION
140 * Allocates an IRP.
141 *
142 * ARGUMENTS
143 * StackSize
144 * Number of stack locations to allocate;
145 *
146 * ChargeQuota
147 * Who knows.
148 *
149 * RETURN VALUE
150 * On success, the allocated IRP. On failure, NULL.
151 */
152 PIRP
153 STDCALL
154 IoAllocateIrp (
155 CCHAR StackSize,
156 BOOLEAN ChargeQuota
157 );
158 /**********************************************************************
159 * NAME EXPORTED
160 * IoAllocateMdl@20
161 *
162 * DESCRIPTION
163 * Allocates an MDL large enough to map the supplied buffer.
164 *
165 * ARGUMENTS
166 * VirtualAddress
167 * Base virtual address of the buffer to be mapped;
168 *
169 * Length
170 * Length of the buffer to be mapped;
171 *
172 * SecondaryBuffer
173 * Whether the buffer is primary or secondary;
174 *
175 * ChargeQuota
176 * Charge non-paged pool quota to current thread;
177 *
178 * Irp
179 * Optional irp to be associated with the MDL.
180 *
181 * RETURN VALUE
182 * On success, the allocated MDL; on failure, NULL.
183 */
184 PMDL
185 STDCALL
186 IoAllocateMdl (
187 PVOID VirtualAddress,
188 ULONG Length,
189 BOOLEAN SecondaryBuffer,
190 BOOLEAN ChargeQuota,
191 PIRP Irp
192 );
193
194 /**********************************************************************
195 * NAME MACRO
196 * IoAssignArcName
197 *
198 * DESCRIPTION
199 * Creates a symbolic link between the ARC name of a physical
200 * device and the name of the corresponding device object
201 *
202 * ARGUMENTS
203 * ArcName
204 * ARC name of the device
205 *
206 * DeviceName
207 * Name of the device object
208 *
209 * NOTES
210 * VOID
211 * IoAssignArcName (
212 * PUNICODE_STRING ArcName,
213 * PUNICODE_STRING DeviceName
214 * );
215 */
216 #define IoAssignArcName (ArcName, DeviceName) \
217 (IoCreateSymbolicLink ((ArcName), (DeviceName)))
218
219 /**********************************************************************
220 * NAME EXPORTED
221 * IoAssignResources@24
222 *
223 * DESCRIPTION
224 * Takes a list of requested hardware resources and allocates
225 * them.
226 *
227 * ARGUMENTS
228 * RegisterPath
229 * ?
230 *
231 * DriverClassName
232 * ?
233 *
234 * DriverObject
235 * Driver object passed to the DriverEntry routine;
236 *
237 * DeviceObject
238 * ?
239 *
240 * RequestedResources
241 * List of resources.
242 *
243 * RETURN VALUE
244 */
245 NTSTATUS
246 STDCALL
247 IoAssignResources (
248 PUNICODE_STRING RegistryPath,
249 PUNICODE_STRING DriverClassName,
250 PDRIVER_OBJECT DriverObject,
251 PDEVICE_OBJECT DeviceObject,
252 PIO_RESOURCE_REQUIREMENTS_LIST RequestedResources,
253 PCM_RESOURCE_LIST * AllocatedResources
254 );
255 /*
256 * FUNCTION: Attaches the callers device object to a named target device
257 * ARGUMENTS:
258 * SourceDevice = caller's device
259 * TargetDevice = Name of the target device
260 * AttachedDevice = Caller allocated storage. On return contains
261 * a pointer to the target device
262 * RETURNS: Success or failure code
263 */
264 NTSTATUS
265 STDCALL
266 IoAttachDevice (
267 PDEVICE_OBJECT SourceDevice,
268 PUNICODE_STRING TargetDevice,
269 PDEVICE_OBJECT * AttachedDevice
270 );
271 /*
272 * FUNCTION: Obsolete
273 * ARGUMENTS:
274 * SourceDevice = device to attach
275 * TargetDevice = device to be attached to
276 * RETURNS: Success or failure code
277 */
278 NTSTATUS
279 STDCALL
280 IoAttachDeviceByPointer (
281 PDEVICE_OBJECT SourceDevice,
282 PDEVICE_OBJECT TargetDevice
283 );
284 /*
285 * FUNCTION: Attaches the callers device to the highest device in the chain
286 * ARGUMENTS:
287 * SourceDevice = caller's device
288 * TargetDevice = Device to attach
289 * RETURNS: On success the previously highest device
290 * On failure NULL
291 */
292 PDEVICE_OBJECT
293 STDCALL
294 IoAttachDeviceToDeviceStack (
295 PDEVICE_OBJECT SourceDevice,
296 PDEVICE_OBJECT TargetDevice
297 );
298 /*
299 * FUNCTION: Builds a irp to be sent to lower level drivers
300 * ARGUMENTS:
301 * MajorFunction = Major function code to be set in the IRP
302 * DeviceObject = Next lower device object
303 * Buffer = Buffer (only required for some major function codes)
304 * Length = Length in bytes of the buffer
305 * StartingOffset = Starting offset on the target device
306 * IoStatusBlock = Storage for status about the operation (optional)
307 * RETURNS: On success the IRP allocated
308 * On failure NULL
309 */
310 PIRP
311 STDCALL
312 IoBuildAsynchronousFsdRequest (
313 ULONG MajorFunction,
314 PDEVICE_OBJECT DeviceObject,
315 PVOID Buffer,
316 ULONG Length,
317 PLARGE_INTEGER StartingOffset,
318 PIO_STATUS_BLOCK IoStatusBlock
319 );
320 /*
321 * FUNCTION: Allocates and sets up an IRP for a device control request
322 * ARGUMENTS:
323 * IoControlCode = Type of request
324 * DeviceObject = Target device
325 * InputBuffer = Optional input buffer to the driver
326 * InputBufferLength = Length of the input buffer
327 * OutputBuffer = Optional output buffer
328 * OutputBufferLength = Length of the output buffer
329 * InternalDeviceIoControl = TRUE if the request is internal
330 * Event = Initialized event for the caller to wait for the request
331 * to be completed
332 * IoStatusBlock = I/O status block to be set when the request is
333 * completed
334 * RETURNS: Returns the IRP created
335 */
336 PIRP
337 STDCALL
338 IoBuildDeviceIoControlRequest (
339 ULONG IoControlCode,
340 PDEVICE_OBJECT DeviceObject,
341 PVOID InputBuffer,
342 ULONG InputBufferLength,
343 PVOID OutputBuffer,
344 ULONG OutputBufferLength,
345 BOOLEAN InternalDeviceIoControl,
346 PKEVENT Event,
347 PIO_STATUS_BLOCK IoStatusBlock
348 );
349 VOID
350 STDCALL
351 IoBuildPartialMdl (
352 PMDL SourceMdl,
353 PMDL TargetMdl,
354 PVOID VirtualAddress,
355 ULONG Length
356 );
357 PIRP
358 STDCALL
359 IoBuildSynchronousFsdRequest (
360 ULONG MajorFunction,
361 PDEVICE_OBJECT DeviceObject,
362 PVOID Buffer,
363 ULONG Length,
364 PLARGE_INTEGER StartingOffset,
365 PKEVENT Event,
366 PIO_STATUS_BLOCK IoStatusBlock
367 );
368 NTSTATUS
369 STDCALL
370 IoCallDriver (
371 PDEVICE_OBJECT DeviceObject,
372 PIRP Irp
373 );
374 BOOLEAN
375 STDCALL
376 IoCancelIrp (
377 PIRP Irp
378 );
379 VOID
380 STDCALL
381 IoCheckDesiredAccess (
382 DWORD Unknown0,
383 DWORD Unknown1
384 );
385 NTSTATUS
386 STDCALL
387 IoCheckEaBufferValidity (
388 DWORD Unknown0,
389 DWORD Unknown1,
390 DWORD Unknown2
391 );
392 NTSTATUS
393 STDCALL
394 IoCheckFunctionAccess (
395 DWORD Unknown0,
396 DWORD Unknown1,
397 DWORD Unknown2,
398 DWORD Unknown3,
399 DWORD Unknown4,
400 DWORD Unknown5
401 );
402 NTSTATUS
403 STDCALL
404 IoCheckShareAccess (
405 ACCESS_MASK DesiredAccess,
406 ULONG DesiredShareAccess,
407 PFILE_OBJECT FileObject,
408 PSHARE_ACCESS ShareAccess,
409 BOOLEAN Update
410 );
411 VOID
412 STDCALL
413 IoCompleteRequest (
414 PIRP Irp,
415 CCHAR PriorityBoost
416 );
417 NTSTATUS
418 STDCALL
419 IoConnectInterrupt (
420 PKINTERRUPT * InterruptObject,
421 PKSERVICE_ROUTINE ServiceRoutine,
422 PVOID ServiceContext,
423 PKSPIN_LOCK SpinLock,
424 ULONG Vector,
425 KIRQL Irql,
426 KIRQL SynchronizeIrql,
427 KINTERRUPT_MODE InterruptMode,
428 BOOLEAN ShareVector,
429 KAFFINITY ProcessorEnableMask,
430 BOOLEAN FloatingSave
431 );
432 PCONTROLLER_OBJECT
433 STDCALL
434 IoCreateController (
435 ULONG Size
436 );
437 /*
438 * FUNCTION: Allocates memory for and intializes a device object for use for
439 * a driver
440 * ARGUMENTS:
441 * DriverObject : Driver object passed by iomgr when the driver was
442 * loaded
443 * DeviceExtensionSize : Number of bytes for the device extension
444 * DeviceName : Unicode name of device
445 * DeviceType : Device type
446 * DeviceCharacteristics : Bit mask of device characteristics
447 * Exclusive : True if only one thread can access the device at a
448 * time
449 * RETURNS:
450 * Success or failure
451 * DeviceObject : Contains a pointer to allocated device object
452 * if the call succeeded
453 * NOTES: See the DDK documentation for more information
454 */
455 NTSTATUS
456 STDCALL
457 IoCreateDevice (
458 PDRIVER_OBJECT DriverObject,
459 ULONG DeviceExtensionSize,
460 PUNICODE_STRING DeviceName,
461 DEVICE_TYPE DeviceType,
462 ULONG DeviceCharacteristics,
463 BOOLEAN Exclusive,
464 PDEVICE_OBJECT * DeviceObject
465 );
466 NTSTATUS
467 STDCALL
468 IoCreateFile (
469 OUT PHANDLE FileHandle,
470 IN ACCESS_MASK DesiredAccess,
471 IN POBJECT_ATTRIBUTES ObjectAttributes,
472 OUT PIO_STATUS_BLOCK IoStatusBlock,
473 IN PLARGE_INTEGER AllocationSize OPTIONAL,
474 IN ULONG FileAttributes,
475 IN ULONG ShareAccess,
476 IN ULONG CreateDisposition,
477 IN ULONG CreateOptions,
478 IN PVOID EaBuffer OPTIONAL,
479 IN ULONG EaLength,
480 IN CREATE_FILE_TYPE CreateFileType,
481 IN PVOID ExtraCreateParameters OPTIONAL,
482 IN ULONG Options
483 );
484 PKEVENT
485 STDCALL
486 IoCreateNotificationEvent (
487 PUNICODE_STRING EventName,
488 PHANDLE EventHandle
489 );
490 PFILE_OBJECT
491 STDCALL
492 IoCreateStreamFileObject (
493 PFILE_OBJECT FileObject,
494 PDEVICE_OBJECT DeviceObject
495 );
496 NTSTATUS
497 STDCALL
498 IoCreateSymbolicLink (
499 PUNICODE_STRING SymbolicLinkName,
500 PUNICODE_STRING DeviceName
501 );
502 PKEVENT
503 STDCALL
504 IoCreateSynchronizationEvent (
505 PUNICODE_STRING EventName,
506 PHANDLE EventHandle
507 );
508 NTSTATUS
509 STDCALL
510 IoCreateUnprotectedSymbolicLink (
511 PUNICODE_STRING SymbolicLinkName,
512 PUNICODE_STRING DeviceName
513 );
514
515 /*
516 * FUNCTION:
517 * Deletes a symbolic link between the ARC name of a physical
518 * device and the name of the corresponding device object
519 *
520 * ARGUMENTS:
521 * ArcName = ARC name of the device
522 *
523 * NOTES:
524 * VOID
525 * IoDeassignArcName (
526 * PUNICODE_STRING ArcName
527 * );
528 */
529 #define IoDeassignArcName(ArcName) \
530 IoDeleteSymbolicLink((ArcName))
531
532 VOID
533 STDCALL
534 IoDeleteController (
535 PCONTROLLER_OBJECT ControllerObject
536 );
537 VOID
538 STDCALL
539 IoDeleteDevice (
540 PDEVICE_OBJECT DeviceObject
541 );
542 NTSTATUS
543 STDCALL
544 IoDeleteSymbolicLink (
545 PUNICODE_STRING SymbolicLinkName
546 );
547 VOID
548 STDCALL
549 IoDetachDevice (
550 PDEVICE_OBJECT TargetDevice
551 );
552 VOID
553 STDCALL
554 IoDisconnectInterrupt (
555 PKINTERRUPT InterruptObject
556 );
557 VOID
558 STDCALL
559 IoEnqueueIrp (
560 PIRP Irp
561 );
562 VOID
563 STDCALL
564 IoFastQueryNetworkAttributes (
565 DWORD Unknown0,
566 DWORD Unknown1,
567 DWORD Unknown2,
568 DWORD Unknown3,
569 DWORD Unknown4
570 );
571 VOID
572 STDCALL
573 IoFreeController (
574 PCONTROLLER_OBJECT ControllerObject
575 );
576 VOID
577 STDCALL
578 IoFreeIrp (
579 PIRP Irp
580 );
581 VOID
582 STDCALL
583 IoFreeMdl (
584 PMDL Mdl
585 );
586 PDEVICE_OBJECT
587 STDCALL
588 IoGetAttachedDevice (
589 PDEVICE_OBJECT DeviceObject
590 );
591 PDEVICE_OBJECT
592 STDCALL
593 IoGetBaseFileSystemDeviceObject (
594 IN PFILE_OBJECT FileObject
595 );
596 PCONFIGURATION_INFORMATION
597 STDCALL
598 IoGetConfigurationInformation (
599 VOID
600 );
601
602 /*
603 * FUNCTION: Gets a pointer to the callers location in the I/O stack in
604 * the given IRP
605 * ARGUMENTS:
606 * Irp = Points to the IRP
607 * RETURNS: A pointer to the stack location
608 *
609 * NOTES:
610 * PIO_STACK_LOCATION
611 * IoGetCurrentIrpStackLocation (PIRP Irp)
612 */
613 #define IoGetCurrentIrpStackLocation(Irp) \
614 (&(Irp)->Stack[(ULONG)((Irp)->CurrentLocation)])
615
616 /* original macro */
617 /*
618 #define IoGetCurrentIrpStackLocation(Irp) \
619 ((Irp)->Tail.Overlay.CurrentStackLocation)
620 */
621 PEPROCESS
622 STDCALL
623 IoGetCurrentProcess (
624 VOID
625 );
626 NTSTATUS
627 STDCALL
628 IoGetDeviceObjectPointer (
629 PUNICODE_STRING ObjectName,
630 ACCESS_MASK DesiredAccess,
631 PFILE_OBJECT * FileObject,
632 PDEVICE_OBJECT * DeviceObject
633 );
634 PDEVICE_OBJECT
635 STDCALL
636 IoGetDeviceToVerify (
637 PETHREAD Thread
638 );
639 PGENERIC_MAPPING
640 STDCALL
641 IoGetFileObjectGenericMapping (
642 VOID
643 );
644
645 #define IoGetFunctionCodeFromCtlCode(ControlCode) \
646 ((ControlCode >> 2) & 0x00000FFF)
647
648 PVOID
649 STDCALL
650 IoGetInitialStack (
651 VOID
652 );
653
654 /*
655 * FUNCTION: Gives a higher level driver access to the next lower driver's
656 * I/O stack location
657 * ARGUMENTS:
658 * Irp = points to the irp
659 * RETURNS: A pointer to the stack location
660 *
661 * NOTES:
662 * PIO_STACK_LOCATION
663 * IoGetNextIrpStackLocation (PIRP Irp)
664 */
665 #define IoGetNextIrpStackLocation(Irp) \
666 (&(Irp)->Stack[(Irp)->CurrentLocation-1])
667
668 /* original macro */
669 /*
670 #define IoGetNextIrpStackLocation(Irp) \
671 ((Irp)->Tail.Overlay.CurrentStackLocation-1)
672 */
673
674 PDEVICE_OBJECT
675 STDCALL
676 IoGetRelatedDeviceObject (
677 PFILE_OBJECT FileObject
678 );
679 PEPROCESS
680 STDCALL
681 IoGetRequestorProcess (
682 IN PIRP Irp
683 );
684 VOID
685 STDCALL
686 IoGetStackLimits (
687 PVOID * Minimum, /* guess */
688 PVOID * Maximum /* guess */
689 );
690 PIRP
691 STDCALL
692 IoGetTopLevelIrp (
693 VOID
694 );
695
696 #define IoInitializeDpcRequest(DeviceObject, DpcRoutine) \
697 (KeInitializeDpc(&(DeviceObject)->Dpc, \
698 (PKDEFERRED_ROUTINE)(DpcRoutine), \
699 (DeviceObject)))
700
701 /*
702 * FUNCTION: Initalizes an irp allocated by the caller
703 * ARGUMENTS:
704 * Irp = IRP to initalize
705 * PacketSize = Size in bytes of the IRP
706 * StackSize = Number of stack locations in the IRP
707 */
708 VOID
709 STDCALL
710 IoInitializeIrp (
711 PIRP Irp,
712 USHORT PacketSize,
713 CCHAR StackSize
714 );
715 NTSTATUS
716 STDCALL
717 IoInitializeTimer (
718 PDEVICE_OBJECT DeviceObject,
719 PIO_TIMER_ROUTINE TimerRoutine,
720 PVOID Context
721 );
722
723 /*
724 * NOTES:
725 * BOOLEAN
726 * IsErrorUserInduced (NTSTATUS Status)
727 */
728 #define IoIsErrorUserInduced(Status) \
729 ((BOOLEAN)(((Status) == STATUS_DEVICE_NOT_READY) || \
730 ((Status) == STATUS_IO_TIMEOUT) || \
731 ((Status) == STATUS_MEDIA_WRITE_PROTECTED) || \
732 ((Status) == STATUS_NO_MEDIA_IN_DRIVE) || \
733 ((Status) == STATUS_VERIFY_REQUIRED) || \
734 ((Status) == STATUS_UNRECOGNIZED_MEDIA) || \
735 ((Status) == STATUS_WRONG_VOLUME)))
736
737 BOOLEAN
738 STDCALL
739 IoIsOperationSynchronous (
740 IN PIRP Irp
741 );
742 BOOLEAN
743 STDCALL
744 IoIsSystemThread (
745 PVOID Unknown0
746 );
747 PIRP
748 STDCALL
749 IoMakeAssociatedIrp (
750 PIRP Irp,
751 CCHAR StackSize
752 );
753
754 /*
755 * FUNCTION: Marks the specified irp, indicating further processing will
756 * be required by other driver routines
757 * ARGUMENTS:
758 * Irp = Irp to mark
759 * NOTES:
760 * VOID
761 * IoMarkIrpPending (PIRP Irp)
762 */
763 #define IoMarkIrpPending(Irp) \
764 (IoGetCurrentIrpStackLocation(Irp)->Control |= SL_PENDING_RETURNED)
765
766
767 NTSTATUS
768 STDCALL
769 IoOpenDeviceInstanceKey (
770 DWORD Unknown0,
771 DWORD Unknown1,
772 DWORD Unknown2,
773 DWORD Unknown3,
774 DWORD Unknown4
775 );
776 NTSTATUS
777 STDCALL
778 IoPageRead (
779 PFILE_OBJECT FileObject,
780 PMDL Mdl,
781 PLARGE_INTEGER Offset,
782 PIO_STATUS_BLOCK StatusBlock
783 );
784 NTSTATUS
785 STDCALL
786 IoQueryDeviceDescription (
787 PINTERFACE_TYPE BusType,
788 PULONG BusNumber,
789 PCONFIGURATION_TYPE ControllerType,
790 PULONG ControllerNumber,
791 PCONFIGURATION_TYPE PeripheralType,
792 PULONG PeripheralNumber,
793 PIO_QUERY_DEVICE_ROUTINE CalloutRoutine,
794 PVOID Context
795 );
796 DWORD
797 STDCALL
798 IoQueryDeviceEnumInfo (
799 DWORD Unknown0,
800 DWORD Unknown1
801 );
802 // IoQueryFileInformation: confirmed - Undocumented because it does not require a valid file handle
803 NTSTATUS
804 STDCALL
805 IoQueryFileInformation (
806 IN PFILE_OBJECT FileObject,
807 IN FILE_INFORMATION_CLASS FileInformationClass,
808 IN ULONG Length,
809 OUT PVOID FileInformation,
810 OUT PULONG ReturnedLength
811 );
812 NTSTATUS
813 STDCALL
814 IoQueryVolumeInformation (
815 IN PFILE_OBJECT FileObject,
816 IN FS_INFORMATION_CLASS FsInformationClass,
817 IN ULONG Length,
818 OUT PVOID FsInformation,
819 OUT PULONG ReturnedLength
820 );
821 VOID
822 STDCALL
823 IoQueueThreadIrp (
824 PVOID Unknown0
825 );
826 VOID
827 STDCALL
828 IoRaiseHardError (
829 PIRP Irp,
830 PVPB Vpb,
831 PDEVICE_OBJECT RealDeviceObject
832 );
833 BOOLEAN
834 STDCALL
835 IoRaiseInformationalHardError (
836 NTSTATUS ErrorStatus,
837 PUNICODE_STRING String,
838 PKTHREAD Thread
839 );
840 VOID
841 STDCALL
842 IoRegisterDriverReinitialization (
843 PDRIVER_OBJECT DriverObject,
844 PDRIVER_REINITIALIZE ReinitRoutine,
845 PVOID Context
846 );
847 VOID
848 STDCALL
849 IoRegisterFileSystem (
850 PDEVICE_OBJECT DeviceObject
851 );
852 #if (_WIN32_WINNT >= 0x0400)
853 NTSTATUS
854 STDCALL
855 IoRegisterFsRegistrationChange (
856 IN PDRIVER_OBJECT DriverObject,
857 IN PFSDNOTIFICATIONPROC FSDNotificationProc
858 );
859 #endif // (_WIN32_WINNT >= 0x0400)
860 NTSTATUS
861 STDCALL
862 IoRegisterShutdownNotification (
863 PDEVICE_OBJECT DeviceObject
864 );
865 VOID
866 STDCALL
867 IoReleaseCancelSpinLock (
868 IN KIRQL Irql
869 );
870 VOID
871 STDCALL
872 IoReleaseVpbSpinLock (
873 IN KIRQL Irql
874 );
875 VOID
876 STDCALL
877 IoRemoveShareAccess (
878 PFILE_OBJECT FileObject,
879 PSHARE_ACCESS ShareAccess
880 );
881 NTSTATUS
882 STDCALL
883 IoReportHalResourceUsage (
884 PUNICODE_STRING HalDescription,
885 ULONG Unknown1,
886 ULONG Unknown2,
887 ULONG Unknown3
888 );
889 NTSTATUS
890 STDCALL
891 IoReportResourceUsage (
892 PUNICODE_STRING DriverClassName,
893 PDRIVER_OBJECT DriverObject,
894 PCM_RESOURCE_LIST DriverList,
895 ULONG DriverListSize,
896 PDEVICE_OBJECT DeviceObject,
897 PCM_RESOURCE_LIST DeviceList,
898 ULONG DeviceListSize,
899 BOOLEAN OverrideConflict,
900 PBOOLEAN ConflictDetected
901 );
902
903 #define IoRequestDpc(DeviceObject, Irp, Context) \
904 (KeInsertQueueDpc(&(DeviceObject)->Dpc,(Irp),(Context)))
905
906 #define IoSetCancelRoutine(Irp, NewCancelRoutine) \
907 ((PDRIVER_CANCEL)InterlockedExchange((PULONG)&(Irp)->CancelRoutine, \
908 (ULONG)(NewCancelRoutine)));
909
910 #define IoSetCompletionRoutine (Irp,Routine,Context,Success,Error,Cancel) \
911 { \
912 PIO_STACK_LOCATION param; \
913 assert((Success)||(Error)||(Cancel)?(Routine)!=NULL:TRUE); \
914 param = IoGetNextIrpStackLocation((Irp)); \
915 param->CompletionRoutine=(Routine); \
916 param->CompletionContext=(Context); \
917 param->Control = 0; \
918 if ((Success)) \
919 param->Control = SL_INVOKE_ON_SUCCESS; \
920 if ((Error)) \
921 param->Control |= SL_INVOKE_ON_ERROR; \
922 if ((Cancel)) \
923 param->Control |= SL_INVOKE_ON_CANCEL; \
924 }
925
926 VOID
927 STDCALL
928 IoSetDeviceToVerify (
929 DWORD Unknown0,
930 DWORD Unknown1
931 );
932 VOID
933 STDCALL
934 IoSetHardErrorOrVerifyDevice (
935 PIRP Irp,
936 PDEVICE_OBJECT DeviceObject
937 );
938 NTSTATUS
939 STDCALL
940 IoSetInformation (
941 IN PFILE_OBJECT FileObject,
942 IN FILE_INFORMATION_CLASS FileInformationClass,
943 IN ULONG Length,
944 OUT PVOID FileInformation
945 );
946
947 #define IoSetNextIrpStackLocation(Irp) \
948 { \
949 (Irp)->CurrentLocation--; \
950 (Irp)->Tail.Overlay.CurrentStackLocation--; \
951 }
952
953 VOID
954 STDCALL
955 IoSetShareAccess (
956 ACCESS_MASK DesiredAccess,
957 ULONG DesiredShareAccess,
958 PFILE_OBJECT FileObject,
959 PSHARE_ACCESS ShareAccess
960 );
961 BOOLEAN
962 STDCALL
963 IoSetThreadHardErrorMode (
964 IN BOOLEAN HardErrorEnabled
965 );
966 VOID
967 STDCALL
968 IoSetTopLevelIrp (
969 IN PIRP Irp
970 );
971
972 /*
973 * FUNCTION: Determines the size of an IRP
974 * ARGUMENTS:
975 * StackSize = number of stack locations in the IRP
976 * RETURNS: The size of the IRP in bytes
977 USHORT
978 IoSizeOfIrp (CCHAR StackSize)
979 */
980 #define IoSizeOfIrp(StackSize) \
981 ((USHORT)(sizeof(IRP)+(((StackSize)-1)*sizeof(IO_STACK_LOCATION))))
982
983 /* original macro */
984 /*
985 #define IoSizeOfIrp(StackSize) \
986 ((USHORT)(sizeof(IRP)+((StackSize)*sizeof(IO_STACK_LOCATION))))
987 */
988
989 /*
990 * FUNCTION: Dequeues the next IRP from the device's associated queue and
991 * calls its StartIo routine
992 * ARGUMENTS:
993 * DeviceObject = Device object
994 * Cancelable = True if IRPs in the queue can be cancelled
995 */
996 VOID
997 STDCALL
998 IoStartNextPacket (
999 PDEVICE_OBJECT DeviceObject,
1000 BOOLEAN Cancelable
1001 );
1002 VOID
1003 STDCALL
1004 IoStartNextPacketByKey (
1005 PDEVICE_OBJECT DeviceObject,
1006 BOOLEAN Cancelable,
1007 ULONG Key
1008 );
1009 /*
1010 * FUNCTION: Calls the drivers StartIO routine with the IRP or queues it if
1011 * the device is busy
1012 * ARGUMENTS:
1013 * DeviceObject = Device to pass the IRP to
1014 * Irp = Irp to be processed
1015 * Key = Optional value for where to insert the IRP
1016 * CancelFunction = Entry point for a driver supplied cancel function
1017 */
1018 VOID
1019 STDCALL
1020 IoStartPacket (
1021 PDEVICE_OBJECT DeviceObject,
1022 PIRP Irp,
1023 PULONG Key,
1024 PDRIVER_CANCEL CancelFunction
1025 );
1026 VOID
1027 STDCALL
1028 IoStartTimer (
1029 PDEVICE_OBJECT DeviceObject
1030 );
1031 VOID
1032 STDCALL
1033 IoStopTimer (
1034 PDEVICE_OBJECT DeviceObject
1035 );
1036 NTSTATUS
1037 STDCALL
1038 IoSynchronousPageWrite (
1039 DWORD Unknown0,
1040 DWORD Unknown1,
1041 DWORD Unknown2,
1042 DWORD Unknown3,
1043 DWORD Unknown4
1044 );
1045 PEPROCESS
1046 STDCALL
1047 IoThreadToProcess (
1048 IN PETHREAD Thread
1049 );
1050 VOID
1051 STDCALL
1052 IoUnregisterFileSystem (
1053 IN PDEVICE_OBJECT DeviceObject
1054 );
1055 #if (_WIN32_WINNT >= 0x0400)
1056 VOID
1057 STDCALL
1058 IoUnregisterFsRegistrationChange (
1059 DWORD Unknown0,
1060 DWORD Unknown1
1061 );
1062 #endif // (_WIN32_WINNT >= 0x0400)
1063 VOID
1064 STDCALL
1065 IoUnregisterShutdownNotification (
1066 PDEVICE_OBJECT DeviceObject
1067 );
1068 VOID
1069 STDCALL
1070 IoUpdateShareAccess (
1071 IN PFILE_OBJECT FileObject,
1072 IN PSHARE_ACCESS ShareAccess
1073 );
1074 NTSTATUS
1075 STDCALL
1076 IoVerifyVolume (
1077 IN PDEVICE_OBJECT DeviceObject,
1078 IN BOOLEAN AllowRawMount
1079 );
1080 VOID
1081 STDCALL
1082 IoWriteErrorLogEntry (
1083 PVOID ElEntry
1084 );
1085 /*
1086 * FUNCTION: Sends an irp to the next lower driver
1087 */
1088 NTSTATUS
1089 FASTCALL
1090 IofCallDriver (
1091 PDEVICE_OBJECT DeviceObject,
1092 PIRP Irp
1093 );
1094 /*
1095 * FUNCTION: Indicates the caller has finished all processing for a given
1096 * I/O request and is returning the given IRP to the I/O manager
1097 * ARGUMENTS:
1098 * Irp = Irp to be cancelled
1099 * PriorityBoost = Increment by which to boost the priority of the
1100 * thread making the request
1101 */
1102 VOID
1103 FASTCALL
1104 IofCompleteRequest (
1105 PIRP Irp,
1106 CCHAR PriorityBoost
1107 );
1108
1109 /* --- EXPORTED BY HAL --- */
1110
1111 VOID
1112 STDCALL
1113 IoAssignDriveLetters (
1114 DWORD Unknown0,
1115 DWORD Unknown1,
1116 DWORD Unknown2,
1117 DWORD Unknown3
1118 );
1119 BOOLEAN
1120 STDCALL
1121 IoFlushAdapterBuffers (
1122 PADAPTER_OBJECT AdapterObject,
1123 PMDL Mdl,
1124 PVOID MapRegisterBase,
1125 PVOID CurrentVa,
1126 ULONG Length,
1127 BOOLEAN WriteToDevice
1128 );
1129 VOID
1130 STDCALL
1131 IoFreeAdapterChannel (
1132 PADAPTER_OBJECT AdapterObject
1133 );
1134 VOID
1135 STDCALL
1136 IoFreeMapRegisters (
1137 PADAPTER_OBJECT AdapterObject,
1138 PVOID MapRegisterBase,
1139 ULONG NumberOfMapRegisters
1140 );
1141 PHYSICAL_ADDRESS
1142 STDCALL
1143 IoMapTransfer (
1144 PADAPTER_OBJECT AdapterObject,
1145 PMDL Mdl,
1146 PVOID MapRegisterBase,
1147 PVOID CurrentVa,
1148 PULONG Length,
1149 BOOLEAN WriteToDevice
1150 );
1151 NTSTATUS
1152 STDCALL
1153 IoReadPartitionTable (
1154 PDEVICE_OBJECT DeviceObject,
1155 ULONG SectorSize,
1156 BOOLEAN ReturnedRecognizedPartitions,
1157 struct _DRIVE_LAYOUT_INFORMATION ** PBuffer
1158 );
1159 NTSTATUS
1160 STDCALL
1161 IoSetPartitionInformation (
1162 PDEVICE_OBJECT DeviceObject,
1163 ULONG SectorSize,
1164 ULONG PartitionNumber,
1165 ULONG PartitionType
1166 );
1167 NTSTATUS
1168 STDCALL
1169 IoWritePartitionTable (
1170 PDEVICE_OBJECT DeviceObject,
1171 ULONG SectorSize,
1172 ULONG SectorsPerTrack,
1173 ULONG NumberOfHeads,
1174 struct _DRIVE_LAYOUT_INFORMATION* PBuffer
1175 );
1176
1177
1178 /* --- --- --- INTERNAL or REACTOS ONLY --- --- --- */
1179
1180
1181
1182 /*
1183 * FUNCTION: Registers the driver with WMI
1184 * ARGUMENTS:
1185 * DeviceObject = Device to register
1186 * Action = Action to take
1187 * RETURNS: Status (?)
1188 */
1189 //NTSTATUS IoWMIRegistrationControl(DeviceObject, WMIREGACTION Action);
1190
1191
1192 /*
1193 * FUNCTION: Returns a pointer to the callers
1194 * stack location in the irp
1195 */
1196 /*
1197 PIO_STACK_LOCATION
1198 IoGetCurrentIrpStackLocation (
1199 IRP * irp
1200 );
1201 */
1202 /*
1203 ULONG
1204 IoGetFunctionCodeFromCtlCode (
1205 ULONG ControlCode
1206 );
1207 */
1208 /*
1209 * FUNCTION:
1210 */
1211 /*
1212 PIO_STACK_LOCATION
1213 IoGetNextIrpStackLocation (
1214 IRP * irp
1215 );
1216 */
1217 /*
1218 VOID
1219 IoInitializeDpcRequest (
1220 PDEVICE_OBJECT DeviceObject,
1221 PIO_DPC_ROUTINE DpcRoutine
1222 );
1223 */
1224 /*
1225 BOOLEAN
1226 IoIsErrorUserInduced (
1227 NTSTATUS Status
1228 );
1229 */
1230 BOOLEAN
1231 IoIsTotalDeviceFailure (
1232 NTSTATUS Status
1233 );
1234 /*
1235 * FUNCTION: Marks an IRP as pending
1236 * ARGUMENTS:
1237 * Irp = Irp to mark
1238 * NOTE: If a driver doesn't complete the irp in its dispatch routine it
1239 * must mark it pending otherwise the I/O manager will complete it on
1240 * return from the dispatch routine.
1241 */
1242 /*
1243 VOID
1244 IoMarkIrpPending (
1245 PIRP Irp
1246 );
1247 */
1248 /*
1249 VOID
1250 IoRequestDpc (
1251 PDEVICE_OBJECT DeviceObject,
1252 PIRP Irp,
1253 PVOID Context
1254 );
1255 */
1256 /*
1257 PDRIVER_CANCEL
1258 IoSetCancelRoutine (
1259 PIRP Irp,
1260 PDRIVER_CANCEL CancelRoutine
1261 );
1262 */
1263 /*
1264 VOID
1265 IoSetCompletionRoutine (
1266 PIRP Irp,
1267 PIO_COMPLETION_ROUTINE CompletionRoutine,
1268 PVOID Context,
1269 BOOLEAN InvokeOnSuccess,
1270 BOOLEAN InvokeOnError,
1271 BOOLEAN InvokeOnCancel
1272 );
1273 */
1274 /*
1275 VOID
1276 IoSetNextIrpStackLocation (
1277 PIRP Irp
1278 );
1279 */
1280 /*
1281 * FUNCTION: Determines the size of an IRP
1282 * ARGUMENTS:
1283 * StackSize = number of stack locations in the IRP
1284 * RETURNS: The size of the IRP in bytes
1285 */
1286 /*
1287 USHORT
1288 IoSizeOfIrp (
1289 CCHAR StackSize
1290 );
1291 */
1292 #if 0
1293 // Preliminary guess
1294 NTKERNELAPI
1295 NTSTATUS
1296 IoQueryFileVolumeInformation (
1297 IN PFILE_OBJECT FileObject,
1298 IN FS_INFORMATION_CLASS FsInformationClass,
1299 IN ULONG Length,
1300 OUT PVOID FsInformation,
1301 OUT PULONG ReturnedLength
1302 );
1303 #endif
1304
1305 #endif /* ndef _INCLUDE_DDK_IOFUNCS_H */