ReactOS 0.4.15-dev-8419-g7f0e8a3
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
18static
23{
24 PPDO_DEVICE_EXTENSION DeviceExtension;
26
27 DPRINT("Called\n");
28
29 DeviceExtension = (PPDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
31
32 if (DeviceCapabilities->Version != 1)
34
35 DeviceCapabilities->UniqueID = FALSE;
36 DeviceCapabilities->Address = DeviceExtension->DriveInfo->PeripheralNumber;
37
38 return STATUS_SUCCESS;
39}
40
41
42static
48{
49 PPDO_DEVICE_EXTENSION DeviceExtension;
53
54 DeviceExtension = (PPDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
56
57 switch (IrpSp->Parameters.QueryId.IdType)
58 {
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
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);
84 }
85
88 &String);
89
90 *Information = (ULONG_PTR)String.Buffer;
91
92 return Status;
93}
94
95
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
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}
196
197/* EOF */
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
_In_ PIRP Irp
Definition: csq.h:116
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
struct _PDO_DEVICE_EXTENSION * PPDO_DEVICE_EXTENSION
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4137
#define ULONG_PTR
Definition: config.h:101
Status
Definition: gdiplustypes.h:25
#define RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE
Definition: green.h:15
NTSTATUS DuplicateUnicodeString(IN ULONG Flags, IN PCUNICODE_STRING SourceString, OUT PUNICODE_STRING DestinationString)
Definition: misc.c:31
if(dx< 0)
Definition: linetemp.h:194
#define ASSERT(a)
Definition: mode.c:44
_Out_ _Inout_ POEM_STRING _In_ PCUNICODE_STRING SourceString
Definition: rtlfuncs.h:1922
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define IRP_MN_SURPRISE_REMOVAL
Definition: ntifs_ex.h:408
#define IoCompleteRequest
Definition: irp.c:1240
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:423
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:73
static NTSTATUS FdcPdoQueryCapabilities(IN PDEVICE_OBJECT DeviceObject, PIO_STACK_LOCATION IrpSp)
Definition: pdo.c:20
NTSTATUS NTAPI FdcPdoPnp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: pdo.c:98
static NTSTATUS FdcPdoQueryId(IN PDEVICE_OBJECT DeviceObject, IN PIO_STACK_LOCATION IrpSp, OUT ULONG_PTR *Information)
Definition: pdo.c:44
ULONG PeripheralNumber
Definition: fdc.h:25
struct _IO_STACK_LOCATION::@3976::@4003 DeviceCapabilities
union _IO_STACK_LOCATION::@1567 Parameters
struct _IO_STACK_LOCATION::@3976::@4007 QueryId
UNICODE_STRING InstanceId
Definition: serenum.h:53
UNICODE_STRING HardwareIds
Definition: serenum.h:54
UNICODE_STRING CompatibleIds
Definition: serenum.h:55
PDRIVE_INFO DriveInfo
Definition: fdc.h:93
UNICODE_STRING DeviceId
Definition: serenum.h:52
#define NTAPI
Definition: typedefs.h:36
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define IN
Definition: typedefs.h:39
#define OUT
Definition: typedefs.h:40
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2433
_In_ WDFREQUEST _In_ NTSTATUS _In_ ULONG_PTR Information
Definition: wdfrequest.h:1049
#define DeviceCapabilities
Definition: wingdi.h:4449
#define IRP_MN_CANCEL_STOP_DEVICE
#define IRP_MN_QUERY_PNP_DEVICE_STATE
#define IRP_MN_EJECT
#define IO_NO_INCREMENT
Definition: iotypes.h:598
#define IRP_MN_START_DEVICE
#define IRP_MN_DEVICE_USAGE_NOTIFICATION
#define IRP_MN_QUERY_RESOURCE_REQUIREMENTS
#define IRP_MN_QUERY_ID
#define IRP_MN_REMOVE_DEVICE
#define IRP_MN_FILTER_RESOURCE_REQUIREMENTS
#define IRP_MN_QUERY_DEVICE_RELATIONS
#define IRP_MN_QUERY_STOP_DEVICE
#define IRP_MN_QUERY_DEVICE_TEXT
#define IRP_MN_QUERY_CAPABILITIES
#define IRP_MN_QUERY_RESOURCES
* PDEVICE_CAPABILITIES
Definition: iotypes.h:965
#define IRP_MN_CANCEL_REMOVE_DEVICE
#define IRP_MN_STOP_DEVICE
#define IRP_MN_SET_LOCK
@ BusQueryCompatibleIDs
Definition: iotypes.h:2938
@ BusQueryInstanceID
Definition: iotypes.h:2939
@ BusQueryDeviceID
Definition: iotypes.h:2936
@ BusQueryHardwareIDs
Definition: iotypes.h:2937
#define IRP_MN_QUERY_BUS_INFORMATION
#define IRP_MN_QUERY_REMOVE_DEVICE