ReactOS 0.4.16-dev-91-g764881a
utils.c File Reference
#include "partmgr.h"
Include dependency graph for utils.c:

Go to the source code of this file.

Functions

NTSTATUS NTAPI ForwardIrpAndForget (_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp)
 
NTSTATUS IssueSyncIoControlRequest (_In_ UINT32 IoControlCode, _In_ PDEVICE_OBJECT DeviceObject, _In_ PVOID InputBuffer, _In_ ULONG InputBufferLength, _In_ PVOID OutputBuffer, _In_ ULONG OutputBufferLength, _In_ BOOLEAN InternalDeviceIoControl)
 

Function Documentation

◆ ForwardIrpAndForget()

NTSTATUS NTAPI ForwardIrpAndForget ( _In_ PDEVICE_OBJECT  DeviceObject,
_In_ PIRP  Irp 
)

Definition at line 5 of file utils.c.

8{
9 // this part of a structure is identical in both FDO and PDO
10 PDEVICE_OBJECT LowerDevice = ((PFDO_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice;
11
12 ASSERT(LowerDevice);
13
15 return IoCallDriver(LowerDevice, Irp);
16}
_In_ PIRP Irp
Definition: csq.h:116
#define ASSERT(a)
Definition: mode.c:44
#define IoSkipCurrentIrpStackLocation(Irp)
Definition: ntifs_ex.h:421
#define IoCallDriver
Definition: irp.c:1225
struct _FDO_EXTENSION * PFDO_EXTENSION
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055

◆ IssueSyncIoControlRequest()

NTSTATUS IssueSyncIoControlRequest ( _In_ UINT32  IoControlCode,
_In_ PDEVICE_OBJECT  DeviceObject,
_In_ PVOID  InputBuffer,
_In_ ULONG  InputBufferLength,
_In_ PVOID  OutputBuffer,
_In_ ULONG  OutputBufferLength,
_In_ BOOLEAN  InternalDeviceIoControl 
)

Definition at line 19 of file utils.c.

27{
28 PIRP Irp;
32 PAGED_CODE();
33
34 /* Allocate a non-paged event */
36 if (!Event)
37 {
39 }
40
41 /* Initialize it */
43
44 /* Build the IRP */
52 Event,
54 if (!Irp)
55 {
56 /* Fail, free the event */
59 }
60
61 /* Call the driver and check if it's pending */
64 {
65 /* Wait on the driver */
68 }
69
70 /* Free the event and return the Status */
72 return Status;
73}
#define PAGED_CODE()
LONG NTSTATUS
Definition: precomp.h:26
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
Definition: env_spec_w32.h:478
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
#define NonPagedPool
Definition: env_spec_w32.h:307
Status
Definition: gdiplustypes.h:25
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
static OUT PIO_STATUS_BLOCK IoStatusBlock
Definition: pipe.c:75
#define KernelMode
Definition: asm.h:34
@ NotificationEvent
PIRP NTAPI IoBuildDeviceIoControlRequest(IN ULONG IoControlCode, IN PDEVICE_OBJECT DeviceObject, IN PVOID InputBuffer, IN ULONG InputBufferLength, IN PVOID OutputBuffer, IN ULONG OutputBufferLength, IN BOOLEAN InternalDeviceIoControl, IN PKEVENT Event, IN PIO_STATUS_BLOCK IoStatusBlock)
Definition: irp.c:881
#define STATUS_PENDING
Definition: ntstatus.h:82
#define TAG_PARTMGR
Definition: partmgr.h:23
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_In_ WDFREQUEST _In_ size_t _In_ size_t _In_ ULONG IoControlCode
Definition: wdfio.h:325
_In_ WDFREQUEST _In_ size_t OutputBufferLength
Definition: wdfio.h:320
_In_ WDFREQUEST _In_ size_t _In_ size_t InputBufferLength
Definition: wdfio.h:322
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR OutputBuffer
Definition: wdfiotarget.h:863
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR InputBuffer
Definition: wdfiotarget.h:953
_Must_inspect_result_ __drv_aliasesMem _In_ PDEVICE_OBJECT _In_opt_ PVOID _In_ ULONG _Out_opt_ PVOID _In_ ULONG _In_ BOOLEAN InternalDeviceIoControl
Definition: iofuncs.h:720
@ Executive
Definition: ketypes.h:415

Referenced by FdoHandleStartDevice(), FdoIoctlDiskGetDriveGeometryEx(), PartMgrRefreshDiskData(), and VolumeDeleteMountPoints().