ReactOS 0.4.15-dev-8241-g63935f8
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 NULL
Definition: types.h:112
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define PagedPool
Definition: env_spec_w32.h:308
#define RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING
Definition: green.h:16
#define RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE
Definition: green.h:15
#define I8042PRT_TAG
Definition: i8042prt.h:12
_Out_ _Inout_ POEM_STRING _In_ PCUNICODE_STRING SourceString
Definition: rtlfuncs.h:1910
_Out_ _Inout_ POEM_STRING DestinationString
Definition: rtlfuncs.h:1909
#define UNICODE_NULL
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
unsigned short USHORT
Definition: pedump.c:61
#define STATUS_SUCCESS
Definition: shellext.h:65
unsigned short Length
Definition: sprintf.c:451
void * Buffer
Definition: sprintf.c:453
unsigned short MaximumLength
Definition: sprintf.c:452
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ FdcFdoPnp()

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

Definition at line 444 of file fdo.c.

447{
450 PDEVICE_RELATIONS DeviceRelations = NULL;
453
454 DPRINT("FdcFdoPnp()\n");
455
457
458 switch (IrpSp->MinorFunction)
459 {
461 DPRINT(" IRP_MN_START_DEVICE received\n");
462
463 /* Call lower driver */
465 FdoExtension = DeviceObject->DeviceExtension;
466
467 if (IoForwardIrpSynchronously(FdoExtension->LowerDevice, Irp))
468 {
469 Status = Irp->IoStatus.Status;
470 if (NT_SUCCESS(Status))
471 {
473 IrpSp->Parameters.StartDevice.AllocatedResources,
474 IrpSp->Parameters.StartDevice.AllocatedResourcesTranslated);
475 }
476 }
477
478 break;
479
481 DPRINT(" IRP_MN_QUERY_REMOVE_DEVICE\n");
482 break;
483
485 DPRINT(" IRP_MN_REMOVE_DEVICE received\n");
486 break;
487
489 DPRINT(" IRP_MN_CANCEL_REMOVE_DEVICE\n");
490 break;
491
493 DPRINT(" IRP_MN_STOP_DEVICE received\n");
494 break;
495
497 DPRINT(" IRP_MN_QUERY_STOP_DEVICE received\n");
498 break;
499
501 DPRINT(" IRP_MN_CANCEL_STOP_DEVICE\n");
502 break;
503
505 DPRINT(" IRP_MN_QUERY_DEVICE_RELATIONS\n");
506
508 {
509 case BusRelations:
510 DPRINT(" IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / BusRelations\n");
511 Status = FdcFdoQueryBusRelations(DeviceObject, &DeviceRelations);
512 Information = (ULONG_PTR)DeviceRelations;
513 break;
514
515 case RemovalRelations:
516 DPRINT(" IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / RemovalRelations\n");
518
519 default:
520 DPRINT(" IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unknown type 0x%lx\n",
523 }
524 break;
525
527 DPRINT(" IRP_MN_SURPRISE_REMOVAL received\n");
528 break;
529
530 default:
531 DPRINT(" Unknown IOCTL 0x%lx\n", IrpSp->MinorFunction);
533 }
534
535 Irp->IoStatus.Information = Information;
536 Irp->IoStatus.Status = Status;
538
539 return Status;
540}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
LONG NTSTATUS
Definition: precomp.h:26
_In_ PIRP Irp
Definition: csq.h:116
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4137
#define ULONG_PTR
Definition: config.h:101
@ FdoExtension
Definition: precomp.h:48
Status
Definition: gdiplustypes.h:25
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
#define DPRINT
Definition: sndvol32.h:73
static NTSTATUS FdcFdoStartDevice(IN PDEVICE_OBJECT DeviceObject, IN PCM_RESOURCE_LIST ResourceList, IN PCM_RESOURCE_LIST ResourceListTranslated)
Definition: fdo.c:36
static NTSTATUS FdcFdoQueryBusRelations(IN PDEVICE_OBJECT DeviceObject, OUT PDEVICE_RELATIONS *DeviceRelations)
Definition: fdo.c:279
struct _IO_STACK_LOCATION::@3991::@4016 QueryDeviceRelations
struct _IO_STACK_LOCATION::@3991::@4028 StartDevice
union _IO_STACK_LOCATION::@1573 Parameters
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_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_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 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
161 DPRINT("IRP_MN_START_DEVICE received\n");
162 break;
163
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 DPRINT1
Definition: precomp.h:8
static NTSTATUS FdcPdoQueryCapabilities(IN PDEVICE_OBJECT DeviceObject, PIO_STACK_LOCATION IrpSp)
Definition: pdo.c:20
static NTSTATUS FdcPdoQueryId(IN PDEVICE_OBJECT DeviceObject, IN PIO_STACK_LOCATION IrpSp, OUT ULONG_PTR *Information)
Definition: pdo.c:44
#define IRP_MN_QUERY_PNP_DEVICE_STATE
#define IRP_MN_EJECT
#define IRP_MN_DEVICE_USAGE_NOTIFICATION
#define IRP_MN_QUERY_RESOURCE_REQUIREMENTS
#define IRP_MN_QUERY_ID
#define IRP_MN_FILTER_RESOURCE_REQUIREMENTS
#define IRP_MN_QUERY_DEVICE_TEXT
#define IRP_MN_QUERY_CAPABILITIES
#define IRP_MN_QUERY_RESOURCES
#define IRP_MN_SET_LOCK
#define IRP_MN_QUERY_BUS_INFORMATION

Referenced by FdcPnp().