ReactOS 0.4.15-dev-7681-g776c3a3
io.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Kernel - Vista+ APIs
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Io functions of Vista+
5 * COPYRIGHT: 2016 Pierre Schweitzer (pierre@reactos.org)
6 * 2020 Victor Perevertkin (victor.perevertkin@reactos.org)
7 */
8
9#include <ntdef.h>
10#include <ntifs.h>
11
13{
18
19#define TAG_IOWI 'IWOI'
20
25 OUT PECP_LIST *ExtraCreateParameter)
26{
27 /* Check we have a create operation */
29 {
31 }
32
33 /* If so, return user buffer */
34 *ExtraCreateParameter = Irp->UserBuffer;
35 return STATUS_SUCCESS;
36}
37
38_Function_class_(IO_WORKITEM_ROUTINE)
39static
40VOID
42IopWorkItemExCallback(
44 PVOID Ctx)
45{
47
48 context->WorkItemRoutineEx(DeviceObject, context->Context, context->WorkItem);
50}
51
53VOID
60{
62 newContext->WorkItem = IoWorkItem;
63 newContext->WorkItemRoutineEx = WorkerRoutine;
64 newContext->Context = Context;
65
66 IoQueueWorkItem(IoWorkItem, IopWorkItemExCallback, QueueType, newContext);
67}
68
74IoSetDevicePropertyData(
82{
84}
85
91IoGetDevicePropertyData(
100{
102}
103
108IoSetDeviceInterfacePropertyData(
111 _In_ LCID Lcid,
116{
118}
119
122NTAPI
124 _In_ PIRP Irp)
125{
126 return IoPriorityNormal;
127}
128
130VOID
132 _Inout_ PIRP MasterIrp,
134{
135 NTSTATUS MasterStatus = MasterIrp->IoStatus.Status;
136
138 {
139 return;
140 }
141
143 (MasterStatus == STATUS_SUCCESS && !NT_SUCCESS(Status)) ||
144 (!NT_SUCCESS(MasterStatus) && !NT_SUCCESS(Status) && Status > MasterStatus))
145 {
146 MasterIrp->IoStatus.Status = Status;
147 }
148}
Type
Definition: Type.h:7
LONG NTSTATUS
Definition: precomp.h:26
#define __drv_aliasesMem
Definition: btrfs_drv.h:203
_In_ PIRP Irp
Definition: csq.h:116
ULONG DEVPROPTYPE
Definition: devpropdef.h:24
ULONG * PDEVPROPTYPE
Definition: devpropdef.h:24
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define _IRQL_requires_max_(irql)
Definition: driverspecs.h:230
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
#define BooleanFlagOn(F, SF)
Definition: ext2fs.h:183
_Must_inspect_result_ _In_ PFLT_CALLBACK_DATA _In_ PFLT_DEFERRED_IO_WORKITEM_ROUTINE _In_ WORK_QUEUE_TYPE QueueType
Definition: fltkernel.h:1978
_Must_inspect_result_ _In_ PFLT_CALLBACK_DATA _In_ PFLT_DEFERRED_IO_WORKITEM_ROUTINE WorkerRoutine
Definition: fltkernel.h:1977
Status
Definition: gdiplustypes.h:25
VOID NTAPI IoQueueWorkItem(IN PIO_WORKITEM IoWorkItem, IN PIO_WORKITEM_ROUTINE WorkerRoutine, IN WORK_QUEUE_TYPE QueueType, IN PVOID Context)
Definition: iowork.c:40
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
#define _Function_class_(x)
Definition: ms_sal.h:2946
#define _Inout_
Definition: ms_sal.h:378
#define _Must_inspect_result_
Definition: ms_sal.h:558
#define _Out_
Definition: ms_sal.h:345
#define _In_
Definition: ms_sal.h:308
#define _In_reads_bytes_opt_(size)
Definition: ms_sal.h:322
#define _In_opt_
Definition: ms_sal.h:309
#define _Reserved_
Definition: ms_sal.h:295
#define STATUS_FT_READ_FROM_COPY
Definition: ntstatus.h:167
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:239
#define CONST
Definition: pedump.c:81
DWORD LCID
Definition: nls.h:13
struct _EX_WORKITEM_CONTEXT EX_WORKITEM_CONTEXT
#define TAG_IOWI
Definition: io.c:19
NTKRNLVISTAAPI IO_PRIORITY_HINT NTAPI IoGetIoPriorityHint(_In_ PIRP Irp)
Definition: io.c:123
NTKRNLVISTAAPI NTSTATUS NTAPI IoGetIrpExtraCreateParameter(IN PIRP Irp, OUT PECP_LIST *ExtraCreateParameter)
Definition: io.c:24
struct _EX_WORKITEM_CONTEXT * PEX_WORKITEM_CONTEXT
NTKRNLVISTAAPI VOID IoSetMasterIrpStatus(_Inout_ PIRP MasterIrp, _In_ NTSTATUS Status)
Definition: io.c:131
NTKRNLVISTAAPI VOID NTAPI IoQueueWorkItemEx(_Inout_ PIO_WORKITEM IoWorkItem, _In_ PIO_WORKITEM_ROUTINE_EX WorkerRoutine, _In_ WORK_QUEUE_TYPE QueueType, _In_opt_ __drv_aliasesMem PVOID Context)
Definition: io.c:55
#define STATUS_SUCCESS
Definition: shellext.h:65
PVOID Context
Definition: io.c:16
PIO_WORKITEM WorkItem
Definition: io.c:14
PIO_WORKITEM_ROUTINE_EX WorkItemRoutineEx
Definition: io.c:15
Definition: http.c:7252
uint32_t * PULONG
Definition: typedefs.h:59
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define STATUS_VERIFY_REQUIRED
Definition: udferr_usr.h:130
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING SymbolicLinkName
Definition: wdfdevice.h:3739
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ ULONG _Out_ PVOID _Out_ PULONG RequiredSize
Definition: wdfdevice.h:4439
WDF_EXTERN_C_START typedef _Must_inspect_result_ _In_ WDFDRIVER _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ PDEVICE_OBJECT _In_opt_ PDEVICE_OBJECT _In_opt_ PDEVICE_OBJECT Pdo
Definition: wdfminiport.h:72
#define NTKRNLVISTAAPI
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
enum _WORK_QUEUE_TYPE WORK_QUEUE_TYPE
_In_ CONST DEVPROPKEY * PropertyKey
Definition: iofuncs.h:2414
_In_ CONST DEVPROPKEY _In_ LCID Lcid
Definition: iofuncs.h:2415
_In_opt_ PVOID _In_ PIO_WORKITEM IoWorkItem
Definition: iotypes.h:521
@ IoPriorityNormal
Definition: iotypes.h:1233
#define IRP_CREATE_OPERATION
IO_WORKITEM_ROUTINE_EX * PIO_WORKITEM_ROUTINE_EX
Definition: iotypes.h:522
enum _IO_PRIORITY_HINT IO_PRIORITY_HINT
@ NonPagedPoolMustSucceed
Definition: ketypes.h:880