ReactOS 0.4.16-dev-91-g764881a
processr.h File Reference
#include <ntddk.h>
Include dependency graph for processr.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _DEVICE_EXTENSION
 

Typedefs

typedef struct _DEVICE_EXTENSION DEVICE_EXTENSION
 
typedef struct _DEVICE_EXTENSIONPDEVICE_EXTENSION
 

Functions

NTSTATUS NTAPI ForwardIrpAndForget (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS NTAPI ProcessorPnp (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS NTAPI ProcessorAddDevice (IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT Pdo)
 

Typedef Documentation

◆ DEVICE_EXTENSION

◆ PDEVICE_EXTENSION

Function Documentation

◆ ForwardIrpAndForget()

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

Definition at line 18 of file misc.c.

21{
22 PDEVICE_OBJECT LowerDevice = ((PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice;
23
24 ASSERT(LowerDevice);
25
27 return IoCallDriver(LowerDevice, Irp);
28}
_In_ PIRP Irp
Definition: csq.h:116
struct _FDO_DEVICE_EXTENSION * PFDO_DEVICE_EXTENSION
#define ASSERT(a)
Definition: mode.c:44
#define IoSkipCurrentIrpStackLocation(Irp)
Definition: ntifs_ex.h:421
#define IoCallDriver
Definition: irp.c:1225
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055

◆ ProcessorAddDevice()

NTSTATUS NTAPI ProcessorAddDevice ( IN PDRIVER_OBJECT  DriverObject,
IN PDEVICE_OBJECT  Pdo 
)

Definition at line 364 of file pnp.c.

367{
368 PDEVICE_EXTENSION DeviceExtension = NULL;
371
372 DPRINT("ProcessorAddDevice()\n");
373
375 ASSERT(Pdo);
376
377 /* Create functional device object */
379 sizeof(DEVICE_EXTENSION),
380 NULL,
383 FALSE,
384 &Fdo);
385 if (NT_SUCCESS(Status))
386 {
387 DeviceExtension = (PDEVICE_EXTENSION)Fdo->DeviceExtension;
388 RtlZeroMemory(DeviceExtension, sizeof(DEVICE_EXTENSION));
389
390 DeviceExtension->DeviceObject = Fdo;
391
392 Status = IoAttachDeviceToDeviceStackSafe(Fdo, Pdo, &DeviceExtension->LowerDevice);
393 if (!NT_SUCCESS(Status))
394 {
395 DPRINT1("IoAttachDeviceToDeviceStackSafe() failed with status 0x%08lx\n", Status);
397 return Status;
398 }
399
400 Fdo->Flags |= DO_DIRECT_IO;
401 Fdo->Flags |= DO_POWER_PAGABLE;
402
403 Fdo->Flags &= ~DO_DEVICE_INITIALIZING;
404 }
405
406 return Status;
407}
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
#define FILE_DEVICE_SECURE_OPEN
Definition: cdrw_usr.h:46
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
struct _BEEP_DEVICE_EXTENSION * PDEVICE_EXTENSION
#define DO_DIRECT_IO
Definition: env_spec_w32.h:396
Status
Definition: gdiplustypes.h:25
NTSTATUS NTAPI IoCreateDevice(IN PDRIVER_OBJECT DriverObject, IN ULONG DeviceExtensionSize, IN PUNICODE_STRING DeviceName, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics, IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject)
Definition: device.c:1031
NTSTATUS NTAPI IoAttachDeviceToDeviceStackSafe(IN PDEVICE_OBJECT SourceDevice, IN PDEVICE_OBJECT TargetDevice, IN OUT PDEVICE_OBJECT *AttachedToDeviceObject)
Definition: device.c:980
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1251
#define FILE_DEVICE_UNKNOWN
Definition: winioctl.h:79
#define DPRINT
Definition: sndvol32.h:73
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
_Must_inspect_result_ _In_ WDFDEVICE Fdo
Definition: wdffdo.h:461
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 DO_POWER_PAGABLE

Referenced by DriverEntry().

◆ ProcessorPnp()

NTSTATUS NTAPI ProcessorPnp ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 262 of file pnp.c.

265{
266 PDEVICE_EXTENSION DeviceExtension;
270
271 DPRINT("ProcessorPnp()\n");
272
274
275 switch (IrpSp->MinorFunction)
276 {
278 DPRINT(" IRP_MN_START_DEVICE received\n");
279
280 /* Call lower driver */
281 DeviceExtension = DeviceObject->DeviceExtension;
283
284 if (IoForwardIrpSynchronously(DeviceExtension->LowerDevice, Irp))
285 {
286 Status = Irp->IoStatus.Status;
287 if (NT_SUCCESS(Status))
288 {
290 IrpSp->Parameters.StartDevice.AllocatedResources,
291 IrpSp->Parameters.StartDevice.AllocatedResourcesTranslated);
292 }
293 }
294 break;
295
297 DPRINT(" IRP_MN_QUERY_REMOVE_DEVICE\n");
299
301 DPRINT(" IRP_MN_REMOVE_DEVICE received\n");
303
305 DPRINT(" IRP_MN_CANCEL_REMOVE_DEVICE\n");
307
309 DPRINT(" IRP_MN_STOP_DEVICE received\n");
311
313 DPRINT(" IRP_MN_QUERY_STOP_DEVICE received\n");
315
317 DPRINT(" IRP_MN_CANCEL_STOP_DEVICE\n");
319
321 DPRINT(" IRP_MN_QUERY_DEVICE_RELATIONS\n");
322
324 {
325 case BusRelations:
326 DPRINT(" IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / BusRelations\n");
328 break;
329
330 case RemovalRelations:
331 DPRINT(" IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / RemovalRelations\n");
333
334 default:
335 DPRINT(" IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unknown type 0x%lx\n",
338 }
339 break;
340
342 DPRINT(" IRP_MN_SURPRISE_REMOVAL received\n");
344
345 case IRP_MN_FILTER_RESOURCE_REQUIREMENTS: /* (optional) 0xd */
346 DPRINT(" IRP_MN_FILTER_RESOURCE_REQUIREMENTS\n");
348
349 default:
350 DPRINT(" Unknown IOCTL 0x%lx\n", IrpSp->MinorFunction);
352 }
353
354 Irp->IoStatus.Information = Information;
355 Irp->IoStatus.Status = Status;
357
358 return Status;
359}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4137
static NTSTATUS ProcessorStartDevice(IN PDEVICE_OBJECT DeviceObject, IN PCM_RESOURCE_LIST ResourceList, IN PCM_RESOURCE_LIST ResourceListTranslated)
Definition: pnp.c:247
DRIVER_DISPATCH ForwardIrpAndForget
Definition: i8042prt.h:341
#define IRP_MN_SURPRISE_REMOVAL
Definition: ntifs_ex.h:408
#define IoCompleteRequest
Definition: irp.c:1240
BOOLEAN NTAPI IoForwardIrpSynchronously(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1625
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:423
struct _IO_STACK_LOCATION::@3974::@4011 StartDevice
struct _IO_STACK_LOCATION::@3974::@3999 QueryDeviceRelations
union _IO_STACK_LOCATION::@1575 Parameters
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
_In_ WDFREQUEST _In_ NTSTATUS _In_ ULONG_PTR Information
Definition: wdfrequest.h:1049
#define IRP_MN_CANCEL_STOP_DEVICE
@ RemovalRelations
Definition: iotypes.h:2155
@ BusRelations
Definition: iotypes.h:2152
#define IO_NO_INCREMENT
Definition: iotypes.h:598
#define IRP_MN_START_DEVICE
#define IRP_MN_REMOVE_DEVICE
#define IRP_MN_FILTER_RESOURCE_REQUIREMENTS
#define IRP_MN_QUERY_DEVICE_RELATIONS
#define IRP_MN_QUERY_STOP_DEVICE
#define IRP_MN_CANCEL_REMOVE_DEVICE
#define IRP_MN_STOP_DEVICE
#define IRP_MN_QUERY_REMOVE_DEVICE

Referenced by DriverEntry().