ReactOS  0.4.15-dev-506-ga3ec01c
pdo.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Floppy Disk Controller Driver
3  * LICENSE: GNU GPLv2 only as published by the Free Software Foundation
4  * FILE: drivers/storage/fdc/fdc/pdo.c
5  * PURPOSE: Physical Device Object routines
6  * PROGRAMMERS: Eric Kohl
7  */
8 
9 /* INCLUDES *******************************************************************/
10 
11 #include "fdc.h"
12 
13 #define NDEBUG
14 #include <debug.h>
15 
16 /* FUNCTIONS ******************************************************************/
17 
18 static
23 {
24  PPDO_DEVICE_EXTENSION DeviceExtension;
26 
27  DPRINT("Called\n");
28 
30  DeviceCapabilities = IrpSp->Parameters.DeviceCapabilities.Capabilities;
31 
32  if (DeviceCapabilities->Version != 1)
33  return STATUS_UNSUCCESSFUL;
34 
35  DeviceCapabilities->UniqueID = FALSE;
36  DeviceCapabilities->Address = DeviceExtension->DriveInfo->PeripheralNumber;
37 
38  return STATUS_SUCCESS;
39 }
40 
41 
42 static
48 {
49  PPDO_DEVICE_EXTENSION DeviceExtension;
53 
56 
57  switch (IrpSp->Parameters.QueryId.IdType)
58  {
59  case BusQueryDeviceID:
60  DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryDeviceID\n");
61  SourceString = &DeviceExtension->DeviceId;
62  break;
63 
65  DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryHardwareIDs\n");
66  SourceString = &DeviceExtension->HardwareIds;
67  break;
68 
70  DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryCompatibleIDs\n");
71  SourceString = &DeviceExtension->CompatibleIds;
72  break;
73 
74  case BusQueryInstanceID:
75  DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryInstanceID\n");
76  SourceString = &DeviceExtension->InstanceId;
77  break;
78 
79  default:
80  DPRINT1("IRP_MJ_PNP / IRP_MN_QUERY_ID / unknown query id type 0x%lx\n",
81  IrpSp->Parameters.QueryId.IdType);
82  ASSERT(FALSE);
83  return STATUS_NOT_SUPPORTED;
84  }
85 
88  &String);
89 
90  *Information = (ULONG_PTR)String.Buffer;
91 
92  return Status;
93 }
94 
95 
97 NTAPI
100  IN PIRP Irp)
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 }
196 
197 /* EOF */
#define IRP_MN_CANCEL_REMOVE_DEVICE
#define IN
Definition: typedefs.h:39
#define IRP_MN_QUERY_RESOURCES
PDRIVE_INFO DriveInfo
Definition: fdc.h:93
#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
_In_ PIRP Irp
Definition: csq.h:116
#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
struct _PDO_DEVICE_EXTENSION * PPDO_DEVICE_EXTENSION
UNICODE_STRING HardwareIds
Definition: serenum.h:54
static WCHAR String[]
Definition: stringtable.c:55
#define IRP_MN_EJECT
uint32_t ULONG_PTR
Definition: typedefs.h:64
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
#define IRP_MN_QUERY_REMOVE_DEVICE
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
#define IoCompleteRequest
Definition: irp.c:1240
#define DeviceCapabilities
Definition: wingdi.h:4448
void DPRINT(...)
Definition: polytest.cpp:61
#define IRP_MN_QUERY_STOP_DEVICE
#define RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE
Definition: isapnp.h:82
#define IRP_MN_SURPRISE_REMOVAL
Definition: ntifs_ex.h:408
#define IRP_MN_STOP_DEVICE
if(!(yy_init))
Definition: macro.lex.yy.c:714
NTSTATUS DuplicateUnicodeString(IN ULONG Flags, IN PCUNICODE_STRING SourceString, OUT PUNICODE_STRING DestinationString)
Definition: misc.c:72
#define IRP_MN_START_DEVICE
#define IRP_MN_QUERY_DEVICE_TEXT
UNICODE_STRING DeviceId
Definition: serenum.h:52
NTSTATUS NTAPI FdcPdoPnp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: pdo.c:98
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define IRP_MN_QUERY_BUS_INFORMATION
_Out_ _Inout_ POEM_STRING _In_ PCUNICODE_STRING SourceString
Definition: rtlfuncs.h:1868
* PDEVICE_CAPABILITIES
Definition: iotypes.h:930
Status
Definition: gdiplustypes.h:24
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1569
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4137
#define IRP_MN_QUERY_DEVICE_RELATIONS
#define DPRINT1
Definition: precomp.h:8
#define OUT
Definition: typedefs.h:40
#define IRP_MN_SET_LOCK
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:409
#define IO_NO_INCREMENT
Definition: iotypes.h:568
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define ULONG_PTR
Definition: config.h:101
ULONG PeripheralNumber
Definition: fdc.h:25
UNICODE_STRING CompatibleIds
Definition: serenum.h:55
#define IRP_MN_CANCEL_STOP_DEVICE
#define IRP_MN_DEVICE_USAGE_NOTIFICATION
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:2774
return STATUS_SUCCESS
Definition: btrfs.c:3014
UNICODE_STRING InstanceId
Definition: serenum.h:53
#define IRP_MN_QUERY_PNP_DEVICE_STATE
Iosb Information
Definition: create.c:4353
#define IRP_MN_QUERY_CAPABILITIES