ReactOS  0.4.15-dev-4857-g47842d7
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 }
struct _FDO_DEVICE_EXTENSION * PFDO_DEVICE_EXTENSION
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_In_ PIRP Irp
Definition: csq.h:116
#define ASSERT(a)
Definition: mode.c:44
NTSTATUS NTAPI IoCallDriver(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1218
#define IoSkipCurrentIrpStackLocation(Irp)
Definition: ntifs_ex.h:421

◆ 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 }
#define DO_DEVICE_INITIALIZING
Definition: env_spec_w32.h:399
#define DO_POWER_PAGABLE
LONG NTSTATUS
Definition: precomp.h:26
#define DO_DIRECT_IO
Definition: env_spec_w32.h:396
#define FALSE
Definition: types.h:117
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:64
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
Status
Definition: gdiplustypes.h:24
#define ASSERT(a)
Definition: mode.c:44
NTSTATUS NTAPI IoAttachDeviceToDeviceStackSafe(IN PDEVICE_OBJECT SourceDevice, IN PDEVICE_OBJECT TargetDevice, IN OUT PDEVICE_OBJECT *AttachedToDeviceObject)
Definition: device.c:980
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
_Must_inspect_result_ _In_ WDFDEVICE Fdo
Definition: wdffdo.h:461
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1251
#define NULL
Definition: types.h:112
#define FILE_DEVICE_UNKNOWN
Definition: winioctl.h:140
#define DPRINT1
Definition: precomp.h:8
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
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define FILE_DEVICE_SECURE_OPEN
Definition: cdrw_usr.h:46
#define DPRINT
Definition: sndvol32.h:71
struct _BEEP_DEVICE_EXTENSION * PDEVICE_EXTENSION

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  {
277  case IRP_MN_START_DEVICE:
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 
308  case IRP_MN_STOP_DEVICE:
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 
323  switch (IrpSp->Parameters.QueryDeviceRelations.Type)
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",
336  IrpSp->Parameters.QueryDeviceRelations.Type);
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 }
#define IRP_MN_CANCEL_REMOVE_DEVICE
return STATUS_NOT_SUPPORTED
#define IRP_MN_REMOVE_DEVICE
#define IRP_MN_FILTER_RESOURCE_REQUIREMENTS
BOOLEAN NTAPI IoForwardIrpSynchronously(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1625
DRIVER_DISPATCH ForwardIrpAndForget
Definition: i8042prt.h:341
LONG NTSTATUS
Definition: precomp.h:26
_In_ WDFREQUEST _In_ NTSTATUS _In_ ULONG_PTR Information
Definition: wdfrequest.h:1044
uint32_t ULONG_PTR
Definition: typedefs.h:65
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_In_ PIRP Irp
Definition: csq.h:116
#define IRP_MN_QUERY_REMOVE_DEVICE
#define IoCompleteRequest
Definition: irp.c:1240
#define IRP_MN_QUERY_STOP_DEVICE
Status
Definition: gdiplustypes.h:24
#define IRP_MN_SURPRISE_REMOVAL
Definition: ntifs_ex.h:408
#define IRP_MN_STOP_DEVICE
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define IRP_MN_START_DEVICE
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2793
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4137
#define IRP_MN_QUERY_DEVICE_RELATIONS
#define IO_NO_INCREMENT
Definition: iotypes.h:598
static NTSTATUS ProcessorStartDevice(IN PDEVICE_OBJECT DeviceObject, IN PCM_RESOURCE_LIST ResourceList, IN PCM_RESOURCE_LIST ResourceListTranslated)
Definition: pnp.c:247
#define IRP_MN_CANCEL_STOP_DEVICE
#define DPRINT
Definition: sndvol32.h:71
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:3128

Referenced by DriverEntry().