ReactOS  0.4.13-dev-563-g0561610
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 72 of file misc.c.

76 {
81  {
83  }
84 
85 
86  if ((SourceString->Length == 0)
89  {
93  }
94  else
95  {
96  USHORT DestMaxLength = SourceString->Length;
97 
99  DestMaxLength += sizeof(UNICODE_NULL);
100 
102  if (DestinationString->Buffer == NULL)
103  return STATUS_NO_MEMORY;
104 
107  DestinationString->MaximumLength = DestMaxLength;
108 
111  }
112 
113  return STATUS_SUCCESS;
114 }
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#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
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
void * Buffer
Definition: sprintf.c:453
#define UNICODE_NULL
_Out_ _Inout_ POEM_STRING DestinationString
Definition: rtlfuncs.h:1869
smooth NULL
Definition: ftsmooth.c:416
__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:1869
unsigned short USHORT
Definition: pedump.c:61
#define STATUS_NO_MEMORY
Definition: ntstatus.h:246
return STATUS_SUCCESS
Definition: btrfs.c:2777
unsigned short MaximumLength
Definition: sprintf.c:452

◆ FdcFdoPnp()

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

Definition at line 491 of file fdo.c.

494 {
496  PDEVICE_RELATIONS DeviceRelations = NULL;
499 
500  DPRINT("FdcFdoPnp()\n");
501 
503 
504  switch (IrpSp->MinorFunction)
505  {
506  case IRP_MN_START_DEVICE:
507  DPRINT(" IRP_MN_START_DEVICE received\n");
508  /* Call lower driver */
510  if (NT_SUCCESS(Status))
511  {
513  IrpSp->Parameters.StartDevice.AllocatedResources,
514  IrpSp->Parameters.StartDevice.AllocatedResourcesTranslated);
515  }
516  break;
517 
519  DPRINT(" IRP_MN_QUERY_REMOVE_DEVICE\n");
520  break;
521 
523  DPRINT(" IRP_MN_REMOVE_DEVICE received\n");
524  break;
525 
527  DPRINT(" IRP_MN_CANCEL_REMOVE_DEVICE\n");
528  break;
529 
530  case IRP_MN_STOP_DEVICE:
531  DPRINT(" IRP_MN_STOP_DEVICE received\n");
532  break;
533 
535  DPRINT(" IRP_MN_QUERY_STOP_DEVICE received\n");
536  break;
537 
539  DPRINT(" IRP_MN_CANCEL_STOP_DEVICE\n");
540  break;
541 
543  DPRINT(" IRP_MN_QUERY_DEVICE_RELATIONS\n");
544 
545  switch (IrpSp->Parameters.QueryDeviceRelations.Type)
546  {
547  case BusRelations:
548  DPRINT(" IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / BusRelations\n");
549  Status = FdcFdoQueryBusRelations(DeviceObject, &DeviceRelations);
550  Information = (ULONG_PTR)DeviceRelations;
551  break;
552 
553  case RemovalRelations:
554  DPRINT(" IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / RemovalRelations\n");
556 
557  default:
558  DPRINT(" IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unknown type 0x%lx\n",
559  IrpSp->Parameters.QueryDeviceRelations.Type);
561  }
562  break;
563 
565  DPRINT(" IRP_MN_SURPRISE_REMOVAL received\n");
566  break;
567 
568  default:
569  DPRINT(" Unknown IOCTL 0x%lx\n", IrpSp->MinorFunction);
571  }
572 
573  Irp->IoStatus.Information = Information;
574  Irp->IoStatus.Status = Status;
576 
577  return Status;
578 }
#define IRP_MN_CANCEL_REMOVE_DEVICE
#define IRP_MN_REMOVE_DEVICE
NTSTATUS NTAPI ForwardIrpAndWait(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: fdo.c:32
_In_ PIRP Irp
Definition: csq.h:116
LONG NTSTATUS
Definition: precomp.h:26
static NTSTATUS FdcFdoStartDevice(IN PDEVICE_OBJECT DeviceObject, IN PCM_RESOURCE_LIST ResourceList, IN PCM_RESOURCE_LIST ResourceListTranslated)
Definition: fdo.c:83
uint32_t ULONG_PTR
Definition: typedefs.h:63
#define IRP_MN_QUERY_REMOVE_DEVICE
smooth NULL
Definition: ftsmooth.c:416
#define IoCompleteRequest
Definition: irp.c:1240
void DPRINT(...)
Definition: polytest.cpp:61
#define IRP_MN_QUERY_STOP_DEVICE
static NTSTATUS FdcFdoQueryBusRelations(IN PDEVICE_OBJECT DeviceObject, OUT PDEVICE_RELATIONS *DeviceRelations)
Definition: fdo.c:326
#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
NTSTATUS NTAPI ForwardIrpAndForget(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: fdo.c:66
Status
Definition: gdiplustypes.h:24
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4157
#define IRP_MN_QUERY_DEVICE_RELATIONS
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:409
#define IO_NO_INCREMENT
Definition: iotypes.h:565
#define ULONG_PTR
Definition: config.h:101
#define IRP_MN_CANCEL_STOP_DEVICE
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:2771
Iosb Information
Definition: create.c:4377

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
_In_ PIRP Irp
Definition: csq.h:116
#define IRP_MN_FILTER_RESOURCE_REQUIREMENTS
#define IRP_MN_QUERY_RESOURCE_REQUIREMENTS
LONG NTSTATUS
Definition: precomp.h:26
static NTSTATUS FdcPdoQueryCapabilities(IN PDEVICE_OBJECT DeviceObject, PIO_STACK_LOCATION IrpSp)
Definition: pdo.c:20
#define IRP_MN_EJECT
uint32_t ULONG_PTR
Definition: typedefs.h:63
static NTSTATUS FdcPdoQueryId(IN PDEVICE_OBJECT DeviceObject, IN PIO_STACK_LOCATION IrpSp, OUT ULONG_PTR *Information)
Definition: pdo.c:44
#define IRP_MN_QUERY_REMOVE_DEVICE
#define IoCompleteRequest
Definition: irp.c:1240
void DPRINT(...)
Definition: polytest.cpp:61
#define IRP_MN_QUERY_STOP_DEVICE
#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
Status
Definition: gdiplustypes.h:24
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4157
#define IRP_MN_QUERY_DEVICE_RELATIONS
#define DPRINT1
Definition: precomp.h:8
#define IRP_MN_SET_LOCK
#define IO_NO_INCREMENT
Definition: iotypes.h:565
#define IRP_MN_CANCEL_STOP_DEVICE
#define IRP_MN_DEVICE_USAGE_NOTIFICATION
return STATUS_SUCCESS
Definition: btrfs.c:2777
#define IRP_MN_QUERY_PNP_DEVICE_STATE
Iosb Information
Definition: create.c:4377
#define IRP_MN_QUERY_CAPABILITIES

Referenced by FdcPnp().