ReactOS  0.4.15-dev-3717-g292e6a4
fdc.h File Reference
#include <ntifs.h>
Include dependency graph for fdc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _DRIVE_INFO
 
struct  _CONTROLLER_INFO
 
struct  _COMMON_DEVICE_EXTENSION
 
struct  _FDO_DEVICE_EXTENSION
 
struct  _PDO_DEVICE_EXTENSION
 

Macros

#define MAX_DEVICE_NAME   255
 
#define MAX_ARC_PATH_LEN   255
 
#define MAX_DRIVES_PER_CONTROLLER   4
 
#define MAX_CONTROLLERS   4
 
#define FDC_TAG   'acdF'
 

Typedefs

typedef struct _DRIVE_INFO DRIVE_INFO
 
typedef struct _DRIVE_INFOPDRIVE_INFO
 
typedef struct _CONTROLLER_INFO CONTROLLER_INFO
 
typedef struct _CONTROLLER_INFOPCONTROLLER_INFO
 
typedef struct _COMMON_DEVICE_EXTENSION COMMON_DEVICE_EXTENSION
 
typedef struct _COMMON_DEVICE_EXTENSIONPCOMMON_DEVICE_EXTENSION
 
typedef struct _FDO_DEVICE_EXTENSION FDO_DEVICE_EXTENSION
 
typedef struct _FDO_DEVICE_EXTENSIONPFDO_DEVICE_EXTENSION
 
typedef struct _PDO_DEVICE_EXTENSION PDO_DEVICE_EXTENSION
 
typedef struct _PDO_DEVICE_EXTENSIONPPDO_DEVICE_EXTENSION
 

Functions

NTSTATUS NTAPI FdcFdoPnp (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS DuplicateUnicodeString (IN ULONG Flags, IN PCUNICODE_STRING SourceString, OUT PUNICODE_STRING DestinationString)
 
NTSTATUS NTAPI FdcPdoPnp (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 

Macro Definition Documentation

◆ FDC_TAG

#define FDC_TAG   'acdF'

Definition at line 102 of file fdc.h.

◆ MAX_ARC_PATH_LEN

#define MAX_ARC_PATH_LEN   255

Definition at line 15 of file fdc.h.

◆ MAX_CONTROLLERS

#define MAX_CONTROLLERS   4

Definition at line 17 of file fdc.h.

◆ MAX_DEVICE_NAME

#define MAX_DEVICE_NAME   255

Definition at line 14 of file fdc.h.

◆ MAX_DRIVES_PER_CONTROLLER

#define MAX_DRIVES_PER_CONTROLLER   4

Definition at line 16 of file fdc.h.

Typedef Documentation

◆ COMMON_DEVICE_EXTENSION

◆ CONTROLLER_INFO

◆ DRIVE_INFO

◆ FDO_DEVICE_EXTENSION

◆ PCOMMON_DEVICE_EXTENSION

◆ PCONTROLLER_INFO

◆ PDO_DEVICE_EXTENSION

◆ PDRIVE_INFO

◆ PFDO_DEVICE_EXTENSION

◆ PPDO_DEVICE_EXTENSION

Function Documentation

◆ DuplicateUnicodeString()

NTSTATUS DuplicateUnicodeString ( IN ULONG  Flags,
IN PCUNICODE_STRING  SourceString,
OUT PUNICODE_STRING  DestinationString 
)

Definition at line 31 of file misc.c.

35 {
40  {
42  }
43 
44 
45  if ((SourceString->Length == 0)
48  {
52  }
53  else
54  {
55  USHORT DestMaxLength = SourceString->Length;
56 
58  DestMaxLength += sizeof(UNICODE_NULL);
59 
62  return STATUS_NO_MEMORY;
63 
66  DestinationString->MaximumLength = DestMaxLength;
67 
70  }
71 
72  return STATUS_SUCCESS;
73 }
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING
Definition: green.h:16
unsigned short Length
Definition: sprintf.c:451
#define I8042PRT_TAG
Definition: i8042prt.h:12
void * Buffer
Definition: sprintf.c:453
#define UNICODE_NULL
_Out_ _Inout_ POEM_STRING DestinationString
Definition: rtlfuncs.h:1868
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE
Definition: green.h:15
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
_Out_ _Inout_ POEM_STRING _In_ PCUNICODE_STRING SourceString
Definition: rtlfuncs.h:1868
unsigned short USHORT
Definition: pedump.c:61
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
#define NULL
Definition: types.h:112
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define STATUS_SUCCESS
Definition: shellext.h:65
unsigned short MaximumLength
Definition: sprintf.c:452

◆ FdcFdoPnp()

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

Definition at line 446 of file fdo.c.

449 {
452  PDEVICE_RELATIONS DeviceRelations = NULL;
455 
456  DPRINT("FdcFdoPnp()\n");
457 
459 
460  switch (IrpSp->MinorFunction)
461  {
462  case IRP_MN_START_DEVICE:
463  DPRINT(" IRP_MN_START_DEVICE received\n");
464 
465  /* Call lower driver */
467  FdoExtension = DeviceObject->DeviceExtension;
468 
469  if (IoForwardIrpSynchronously(FdoExtension->LowerDevice, Irp))
470  {
471  Status = Irp->IoStatus.Status;
472  if (NT_SUCCESS(Status))
473  {
475  IrpSp->Parameters.StartDevice.AllocatedResources,
476  IrpSp->Parameters.StartDevice.AllocatedResourcesTranslated);
477  }
478  }
479 
480  break;
481 
483  DPRINT(" IRP_MN_QUERY_REMOVE_DEVICE\n");
484  break;
485 
487  DPRINT(" IRP_MN_REMOVE_DEVICE received\n");
488  break;
489 
491  DPRINT(" IRP_MN_CANCEL_REMOVE_DEVICE\n");
492  break;
493 
494  case IRP_MN_STOP_DEVICE:
495  DPRINT(" IRP_MN_STOP_DEVICE received\n");
496  break;
497 
499  DPRINT(" IRP_MN_QUERY_STOP_DEVICE received\n");
500  break;
501 
503  DPRINT(" IRP_MN_CANCEL_STOP_DEVICE\n");
504  break;
505 
507  DPRINT(" IRP_MN_QUERY_DEVICE_RELATIONS\n");
508 
509  switch (IrpSp->Parameters.QueryDeviceRelations.Type)
510  {
511  case BusRelations:
512  DPRINT(" IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / BusRelations\n");
513  Status = FdcFdoQueryBusRelations(DeviceObject, &DeviceRelations);
514  Information = (ULONG_PTR)DeviceRelations;
515  break;
516 
517  case RemovalRelations:
518  DPRINT(" IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / RemovalRelations\n");
520 
521  default:
522  DPRINT(" IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unknown type 0x%lx\n",
523  IrpSp->Parameters.QueryDeviceRelations.Type);
525  }
526  break;
527 
529  DPRINT(" IRP_MN_SURPRISE_REMOVAL received\n");
530  break;
531 
532  default:
533  DPRINT(" Unknown IOCTL 0x%lx\n", IrpSp->MinorFunction);
535  }
536 
537  Irp->IoStatus.Information = Information;
538  Irp->IoStatus.Status = Status;
540 
541  return Status;
542 }
#define IRP_MN_CANCEL_REMOVE_DEVICE
return STATUS_NOT_SUPPORTED
#define IRP_MN_REMOVE_DEVICE
NTSTATUS NTAPI ForwardIrpAndForget(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: fdo.c:21
BOOLEAN NTAPI IoForwardIrpSynchronously(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1625
LONG NTSTATUS
Definition: precomp.h:26
static NTSTATUS FdcFdoQueryBusRelations(IN PDEVICE_OBJECT DeviceObject, OUT PDEVICE_RELATIONS *DeviceRelations)
Definition: fdo.c:281
_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
static NTSTATUS FdcFdoStartDevice(IN PDEVICE_OBJECT DeviceObject, IN PCM_RESOURCE_LIST ResourceList, IN PCM_RESOURCE_LIST ResourceListTranslated)
Definition: fdo.c:38
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2793
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4137
#define NULL
Definition: types.h:112
#define IRP_MN_QUERY_DEVICE_RELATIONS
#define IO_NO_INCREMENT
Definition: iotypes.h:598
#define ULONG_PTR
Definition: config.h:101
#define IRP_MN_CANCEL_STOP_DEVICE
#define DPRINT
Definition: sndvol32.h:71
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:3128

Referenced by FdcPnp().

◆ FdcPdoPnp()

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

Definition at line 98 of file pdo.c.

101 {
105 
106  DPRINT("FdcPdoPnp()\n");
107 
108  Status = Irp->IoStatus.Status;
109 
111 
112  switch (IrpSp->MinorFunction)
113  {
115  DPRINT1("Unimplemented IRP_MN_DEVICE_USAGE_NOTIFICATION received\n");
116  break;
117 
118  case IRP_MN_EJECT:
119  DPRINT1("Unimplemented IRP_MN_EJECT received\n");
120  break;
121 
123  DPRINT("IRP_MN_QUERY_BUS_INFORMATION received\n");
124  break;
125 
127  DPRINT("IRP_MN_QUERY_CAPABILITIES received\n");
129  break;
130 
132  DPRINT("IRP_MN_QUERY_DEVICE_RELATIONS received\n");
133  break;
134 
136  DPRINT("IRP_MN_QUERY_DEVICE_TEXT received\n");
137  break;
138 
139  case IRP_MN_QUERY_ID:
140  DPRINT("IRP_MN_QUERY_ID received\n");
142  break;
143 
145  DPRINT1("Unimplemented IRP_MN_QUERY_ID received\n");
146  break;
147 
149  DPRINT("IRP_MN_QUERY_RESOURCE_REQUIREMENTS received\n");
150  break;
151 
153  DPRINT("IRP_MN_QUERY_RESOURCES received\n");
154  break;
155 
156  case IRP_MN_SET_LOCK:
157  DPRINT1("Unimplemented IRP_MN_SET_LOCK received\n");
158  break;
159 
160  case IRP_MN_START_DEVICE:
161  DPRINT("IRP_MN_START_DEVICE received\n");
162  break;
163 
166  case IRP_MN_STOP_DEVICE:
171  break;
172 
174  DPRINT("IRP_MN_REMOVE_DEVICE received\n");
175  break;
176 
178  DPRINT("IRP_MN_FILTER_RESOURCE_REQUIREMENTS received\n");
179  /* Nothing to do */
180  Irp->IoStatus.Status = Status;
181  break;
182 
183  default:
184  DPRINT1("Unknown IOCTL 0x%lx\n", IrpSp->MinorFunction);
185  break;
186  }
187 
188  Irp->IoStatus.Information = Information;
189  Irp->IoStatus.Status = Status;
191 
192  DPRINT("Leaving. Status 0x%X\n", Status);
193 
194  return Status;
195 }
#define IRP_MN_CANCEL_REMOVE_DEVICE
#define IRP_MN_QUERY_RESOURCES
#define IRP_MN_REMOVE_DEVICE
#define IRP_MN_QUERY_ID
static NTSTATUS FdcPdoQueryId(IN PDEVICE_OBJECT DeviceObject, IN PIO_STACK_LOCATION IrpSp, OUT ULONG_PTR *Information)
Definition: pdo.c:44
#define IRP_MN_FILTER_RESOURCE_REQUIREMENTS
static NTSTATUS FdcPdoQueryCapabilities(IN PDEVICE_OBJECT DeviceObject, PIO_STACK_LOCATION IrpSp)
Definition: pdo.c:20
#define IRP_MN_QUERY_RESOURCE_REQUIREMENTS
LONG NTSTATUS
Definition: precomp.h:26
#define IRP_MN_EJECT
_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 IRP_MN_START_DEVICE
#define IRP_MN_QUERY_DEVICE_TEXT
#define IRP_MN_QUERY_BUS_INFORMATION
__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 DPRINT1
Definition: precomp.h:8
#define IRP_MN_SET_LOCK
#define IO_NO_INCREMENT
Definition: iotypes.h:598
#define IRP_MN_CANCEL_STOP_DEVICE
#define STATUS_SUCCESS
Definition: shellext.h:65
#define IRP_MN_DEVICE_USAGE_NOTIFICATION
#define DPRINT
Definition: sndvol32.h:71
#define IRP_MN_QUERY_PNP_DEVICE_STATE
#define IRP_MN_QUERY_CAPABILITIES

Referenced by FdcPnp().