ReactOS  0.4.15-dev-5455-g015cd25
pdo.c File Reference
#include "fdc.h"
#include <debug.h>
Include dependency graph for pdo.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

static NTSTATUS FdcPdoQueryCapabilities (IN PDEVICE_OBJECT DeviceObject, PIO_STACK_LOCATION IrpSp)
 
static NTSTATUS FdcPdoQueryId (IN PDEVICE_OBJECT DeviceObject, IN PIO_STACK_LOCATION IrpSp, OUT ULONG_PTR *Information)
 
NTSTATUS NTAPI FdcPdoPnp (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 13 of file pdo.c.

Function Documentation

◆ 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
#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
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4137
#define IRP_MN_QUERY_CAPABILITIES

Referenced by FdcPnp().

◆ FdcPdoQueryCapabilities()

static NTSTATUS FdcPdoQueryCapabilities ( IN PDEVICE_OBJECT  DeviceObject,
PIO_STACK_LOCATION  IrpSp 
)
static

Definition at line 20 of file pdo.c.

23 {
24  PPDO_DEVICE_EXTENSION DeviceExtension;
26 
27  DPRINT("Called\n");
28 
29  DeviceExtension = (PPDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
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 }
PDRIVE_INFO DriveInfo
Definition: fdc.h:93
struct _PDO_DEVICE_EXTENSION * PPDO_DEVICE_EXTENSION
if(dx==0 &&dy==0)
Definition: linetemp.h:174
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
#define FALSE
Definition: types.h:117
#define DeviceCapabilities
Definition: wingdi.h:4449
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
* PDEVICE_CAPABILITIES
Definition: iotypes.h:965
ULONG PeripheralNumber
Definition: fdc.h:25
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:71
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:3128
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4137

Referenced by FdcPdoPnp().

◆ FdcPdoQueryId()

static NTSTATUS FdcPdoQueryId ( IN PDEVICE_OBJECT  DeviceObject,
IN PIO_STACK_LOCATION  IrpSp,
OUT ULONG_PTR Information 
)
static

Definition at line 44 of file pdo.c.

48 {
49  PPDO_DEVICE_EXTENSION DeviceExtension;
53 
54  DeviceExtension = (PPDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
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 }
return STATUS_NOT_SUPPORTED
LONG NTSTATUS
Definition: precomp.h:26
struct _PDO_DEVICE_EXTENSION * PPDO_DEVICE_EXTENSION
UNICODE_STRING HardwareIds
Definition: serenum.h:54
_In_ WDFREQUEST _In_ NTSTATUS _In_ ULONG_PTR Information
Definition: wdfrequest.h:1044
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2430
#define FALSE
Definition: types.h:117
Status
Definition: gdiplustypes.h:24
#define ASSERT(a)
Definition: mode.c:44
NTSTATUS DuplicateUnicodeString(IN ULONG Flags, IN PCUNICODE_STRING SourceString, OUT PUNICODE_STRING DestinationString)
Definition: misc.c:31
#define RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE
Definition: green.h:15
UNICODE_STRING DeviceId
Definition: serenum.h:52
_Out_ _Inout_ POEM_STRING _In_ PCUNICODE_STRING SourceString
Definition: rtlfuncs.h:1909
#define NULL
Definition: types.h:112
#define DPRINT1
Definition: precomp.h:8
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define ULONG_PTR
Definition: config.h:101
UNICODE_STRING CompatibleIds
Definition: serenum.h:55
#define DPRINT
Definition: sndvol32.h:71
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:3128
UNICODE_STRING InstanceId
Definition: serenum.h:53
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4137

Referenced by FdcPdoPnp().