ReactOS  0.4.15-dev-509-g96a357b
pciidex.h File Reference
#include <ntifs.h>
#include <ide.h>
Include dependency graph for pciidex.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _PCIIDEX_DRIVER_EXTENSION
 
struct  _COMMON_DEVICE_EXTENSION
 
struct  _FDO_DEVICE_EXTENSION
 
struct  _PDO_DEVICE_EXTENSION
 

Typedefs

typedef struct _PCIIDEX_DRIVER_EXTENSION PCIIDEX_DRIVER_EXTENSION
 
typedef struct _PCIIDEX_DRIVER_EXTENSIONPPCIIDEX_DRIVER_EXTENSION
 
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 PciIdeXAddDevice (IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT Pdo)
 
NTSTATUS NTAPI PciIdeXFdoPnpDispatch (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS NTAPI PciIdeXGenericCompletion (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Context)
 
NTSTATUS ForwardIrpAndWait (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS NTAPI ForwardIrpAndForget (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS DuplicateUnicodeString (IN ULONG Flags, IN PCUNICODE_STRING SourceString, OUT PUNICODE_STRING DestinationString)
 
NTSTATUS NTAPI PciIdeXPdoPnpDispatch (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 

Variables

DRIVER_ADD_DEVICE PciIdeXAddDevice
 
IO_COMPLETION_ROUTINE PciIdeXGenericCompletion
 

Typedef Documentation

◆ COMMON_DEVICE_EXTENSION

◆ FDO_DEVICE_EXTENSION

◆ PCIIDEX_DRIVER_EXTENSION

◆ PCOMMON_DEVICE_EXTENSION

◆ PDO_DEVICE_EXTENSION

◆ PFDO_DEVICE_EXTENSION

◆ PPCIIDEX_DRIVER_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
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:1868
smooth NULL
Definition: ftsmooth.c:416
#define RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE
Definition: isapnp.h:82
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
_Out_ _Inout_ POEM_STRING _In_ PCUNICODE_STRING SourceString
Definition: rtlfuncs.h:1868
#define RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING
Definition: isapnp.h:83
unsigned short USHORT
Definition: pedump.c:61
#define STATUS_NO_MEMORY
Definition: ntstatus.h:246
return STATUS_SUCCESS
Definition: btrfs.c:3014
unsigned short MaximumLength
Definition: sprintf.c:452

◆ ForwardIrpAndForget()

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

Definition at line 59 of file misc.c.

62 {
64 
65  ASSERT(LowerDevice);
66 
68  return IoCallDriver(LowerDevice, Irp);
69 }
_In_ PIRP Irp
Definition: csq.h:116
struct _FDO_DEVICE_EXTENSION * PFDO_DEVICE_EXTENSION
PVOID DeviceExtension
Definition: env_spec_w32.h:418
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1569
NTSTATUS NTAPI IoCallDriver(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1218
#define IoSkipCurrentIrpStackLocation(Irp)
Definition: ntifs_ex.h:421

Referenced by FdcFdoPnp(), FdoPnp(), PciIdeXFdoPnpDispatch(), PortFdoPnp(), SerenumFdoPnp(), and SermousePnp().

◆ ForwardIrpAndWait()

NTSTATUS ForwardIrpAndWait ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 32 of file fdo.c.

35 {
36  KEVENT Event;
39  ASSERT(LowerDevice);
40 
43 
45 
46  Status = IoCallDriver(LowerDevice, Irp);
47  if (Status == STATUS_PENDING)
48  {
50  if (NT_SUCCESS(Status))
51  Status = Irp->IoStatus.Status;
52  }
53 
54  return Status;
55 }
#define TRUE
Definition: types.h:120
_In_ PIRP Irp
Definition: csq.h:116
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS NTAPI KeWaitForSingleObject(IN PVOID Object, IN KWAIT_REASON WaitReason, IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, IN PLARGE_INTEGER Timeout OPTIONAL)
Definition: wait.c:416
struct _FDO_DEVICE_EXTENSION * PFDO_DEVICE_EXTENSION
#define IoSetCompletionRoutine(_Irp, _CompletionRoutine, _Context, _InvokeOnSuccess, _InvokeOnError, _InvokeOnCancel)
Definition: irp.cpp:498
FORCEINLINE VOID IoCopyCurrentIrpStackLocationToNext(_Inout_ PIRP Irp)
Definition: iofuncs.h:2820
_In_ PVOID _In_ ULONG Event
Definition: iotypes.h:437
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define STATUS_PENDING
Definition: ntstatus.h:82
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
static IO_COMPLETION_ROUTINE ForwardIrpAndWaitCompletion
Definition: fdo.c:17
Status
Definition: gdiplustypes.h:24
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1569
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
NTSTATUS NTAPI IoCallDriver(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1218

Referenced by FdcFdoPnp(), FdoPnp(), FdoPnpControl(), PciIdeXFdoPnpDispatch(), PortFdoStartDevice(), SerenumFdoPnp(), and SermousePnp().

◆ PciIdeXAddDevice()

NTSTATUS NTAPI PciIdeXAddDevice ( IN PDRIVER_OBJECT  DriverObject,
IN PDEVICE_OBJECT  Pdo 
)

Definition at line 106 of file fdo.c.

109 {
111  PFDO_DEVICE_EXTENSION DeviceExtension;
112  PDEVICE_OBJECT Fdo;
114  PCI_COMMON_CONFIG PciConfig;
116 
117  DPRINT("PciIdeXAddDevice(%p %p)\n", DriverObject, Pdo);
118 
121 
123  DriverObject,
124  sizeof(FDO_DEVICE_EXTENSION) + DriverExtension->MiniControllerExtensionSize,
125  NULL,
128  TRUE,
129  &Fdo);
130  if (!NT_SUCCESS(Status))
131  {
132  DPRINT("IoCreateDevice() failed with status 0x%08lx\n", Status);
133  return Status;
134  }
135 
136  DeviceExtension = (PFDO_DEVICE_EXTENSION)Fdo->DeviceExtension;
137  RtlZeroMemory(DeviceExtension, sizeof(FDO_DEVICE_EXTENSION));
138 
139  DeviceExtension->Common.IsFDO = TRUE;
140 
141  Status = IoAttachDeviceToDeviceStackSafe(Fdo, Pdo, &DeviceExtension->LowerDevice);
142  if (!NT_SUCCESS(Status))
143  {
144  DPRINT("IoAttachDeviceToDeviceStackSafe() failed with status 0x%08lx\n", Status);
145  return Status;
146  }
147 
148  Status = GetBusInterface(DeviceExtension);
149  if (!NT_SUCCESS(Status))
150  {
151  DPRINT("GetBusInterface() failed with status 0x%08lx\n", Status);
152  IoDetachDevice(DeviceExtension->LowerDevice);
153  return Status;
154  }
155 
156  BytesRead = (*DeviceExtension->BusInterface->GetBusData)(
157  DeviceExtension->BusInterface->Context,
159  &PciConfig,
160  0,
163  {
164  DPRINT("BusInterface->GetBusData() failed()\n");
165  ReleaseBusInterface(DeviceExtension);
166  IoDetachDevice(DeviceExtension->LowerDevice);
167  return STATUS_IO_DEVICE_ERROR;
168  }
169 
170  DeviceExtension->VendorId = PciConfig.VendorID;
171  DeviceExtension->DeviceId = PciConfig.DeviceID;
172 
173  Fdo->Flags &= ~DO_DEVICE_INITIALIZING;
174 
175  return STATUS_SUCCESS;
176 }
#define DO_DEVICE_INITIALIZING
Definition: env_spec_w32.h:399
#define TRUE
Definition: types.h:120
PBUS_INTERFACE_STANDARD BusInterface
Definition: pciidex.h:23
_In_ PDEVICE_OBJECT Pdo
Definition: classpnp.h:301
LONG NTSTATUS
Definition: precomp.h:26
static NTSTATUS GetBusInterface(IN PFDO_DEVICE_EXTENSION DeviceExtension)
Definition: fdo.c:18
VOID NTAPI IoDetachDevice(IN PDEVICE_OBJECT TargetDevice)
Definition: device.c:1296
struct _FDO_DEVICE_EXTENSION * PFDO_DEVICE_EXTENSION
#define STATUS_IO_DEVICE_ERROR
Definition: udferr_usr.h:179
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
void DPRINT(...)
Definition: polytest.cpp:61
NTSTATUS NTAPI IoAttachDeviceToDeviceStackSafe(IN PDEVICE_OBJECT SourceDevice, IN PDEVICE_OBJECT TargetDevice, IN OUT PDEVICE_OBJECT *AttachedToDeviceObject)
Definition: device.c:980
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
PGET_SET_DEVICE_DATA GetBusData
Definition: iotypes.h:886
#define PCI_WHICHSPACE_CONFIG
Definition: iotypes.h:3290
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
PVOID NTAPI IoGetDriverObjectExtension(IN PDRIVER_OBJECT DriverObject, IN PVOID ClientIdentificationAddress)
Definition: driver.c:1857
PPCI_DRIVER_EXTENSION DriverExtension
Definition: pci.c:41
COMMON_DEVICE_EXTENSION Common
Definition: pci.h:81
Status
Definition: gdiplustypes.h:24
unsigned int ULONG
Definition: retypes.h:1
NTSTATUS NTAPI IoCreateDevice(IN PDRIVER_OBJECT DriverObject, IN ULONG DeviceExtensionSize, IN PUNICODE_STRING DeviceName, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics, IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject)
Definition: device.c:1031
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
static NTSTATUS ReleaseBusInterface(IN PFDO_DEVICE_EXTENSION DeviceExtension)
Definition: fdo.c:89
#define FILE_DEVICE_SECURE_OPEN
Definition: cdrw_usr.h:46
PDEVICE_OBJECT LowerDevice
Definition: i8042prt.h:130
return STATUS_SUCCESS
Definition: btrfs.c:3014
#define FILE_DEVICE_BUS_EXTENDER
Definition: winioctl.h:147
_Must_inspect_result_ _In_ PFILE_OBJECT _In_opt_ PLARGE_INTEGER _In_ ULONG _In_ FLT_IO_OPERATION_FLAGS _Out_opt_ PULONG BytesRead
Definition: fltkernel.h:1255
#define PCI_COMMON_HDR_LENGTH
Definition: iotypes.h:3240

◆ PciIdeXFdoPnpDispatch()

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

Definition at line 402 of file fdo.c.

405 {
407  PIO_STACK_LOCATION Stack;
408  ULONG_PTR Information = Irp->IoStatus.Information;
410 
412  MinorFunction = Stack->MinorFunction;
413 
414  switch (MinorFunction)
415  {
416  case IRP_MN_START_DEVICE: /* 0x00 */
417  {
418  DPRINT("IRP_MJ_PNP / IRP_MN_START_DEVICE\n");
419  /* Call lower driver */
421  if (NT_SUCCESS(Status))
423  break;
424  }
425  case IRP_MN_QUERY_REMOVE_DEVICE: /* 0x01 */
426  {
427  DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_REMOVE_DEVICE\n");
429  break;
430  }
431  case IRP_MN_QUERY_DEVICE_RELATIONS: /* 0x07 */
432  {
433  switch (Stack->Parameters.QueryDeviceRelations.Type)
434  {
435  case BusRelations:
436  {
437  PDEVICE_RELATIONS DeviceRelations = NULL;
438  DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / BusRelations\n");
439  Status = PciIdeXFdoQueryBusRelations(DeviceObject, &DeviceRelations);
440  Information = (ULONG_PTR)DeviceRelations;
441  break;
442  }
443  default:
444  {
445  DPRINT1("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unknown type 0x%lx\n",
446  Stack->Parameters.QueryDeviceRelations.Type);
448  break;
449  }
450  }
451  break;
452  }
453  case IRP_MN_QUERY_PNP_DEVICE_STATE: /* 0x14 */
454  {
455  DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_PNP_DEVICE_STATE\n");
458  break;
459  }
460  case IRP_MN_FILTER_RESOURCE_REQUIREMENTS: /* 0x0d */
461  {
462  DPRINT("IRP_MJ_PNP / IRP_MN_FILTER_RESOURCE_REQUIREMENTS\n");
464  }
465  case IRP_MN_QUERY_CAPABILITIES: /* 0x09 */
466  {
467  DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_CAPABILITIES\n");
469  }
470  default:
471  {
472  DPRINT1("IRP_MJ_PNP / Unknown minor function 0x%lx\n", MinorFunction);
474  }
475  }
476 
477  Irp->IoStatus.Information = Information;
478  Irp->IoStatus.Status = Status;
480  return Status;
481 }
NTSTATUS NTAPI ForwardIrpAndForget(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: fdo.c:66
NTSTATUS NTAPI ForwardIrpAndWait(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: fdo.c:32
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
static NTSTATUS PciIdeXFdoQueryBusRelations(IN PDEVICE_OBJECT DeviceObject, OUT PDEVICE_RELATIONS *pDeviceRelations)
Definition: fdo.c:315
_In_ PIRP Irp
Definition: csq.h:116
#define IRP_MN_FILTER_RESOURCE_REQUIREMENTS
LONG NTSTATUS
Definition: precomp.h:26
uint32_t ULONG_PTR
Definition: typedefs.h:64
#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 NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define IRP_MN_START_DEVICE
#define PNP_DEVICE_NOT_DISABLEABLE
Definition: iotypes.h:971
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
_In_ UCHAR MinorFunction
Definition: pofuncs.h:42
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
static NTSTATUS PciIdeXFdoStartDevice(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: fdo.c:269
#define IRP_MN_QUERY_DEVICE_RELATIONS
#define DPRINT1
Definition: precomp.h:8
unsigned int ULONG
Definition: retypes.h:1
#define IO_NO_INCREMENT
Definition: iotypes.h:568
#define ULONG_PTR
Definition: config.h:101
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:2774
return STATUS_SUCCESS
Definition: btrfs.c:3014
#define IRP_MN_QUERY_PNP_DEVICE_STATE
Iosb Information
Definition: create.c:4353
#define IRP_MN_QUERY_CAPABILITIES

Referenced by _Dispatch_type_().

◆ PciIdeXGenericCompletion()

NTSTATUS NTAPI PciIdeXGenericCompletion ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp,
IN PVOID  Context 
)

Definition at line 15 of file misc.c.

19 {
20  if (Irp->PendingReturned)
23 }
#define STATUS_MORE_PROCESSING_REQUIRED
Definition: shellext.h:68
_In_ PIRP Irp
Definition: csq.h:116
LONG NTAPI KeSetEvent(IN PKEVENT Event, IN KPRIORITY Increment, IN BOOLEAN Wait)
Definition: eventobj.c:159
#define IO_NO_INCREMENT
Definition: iotypes.h:568

Referenced by ForwardIrpAndWait().

◆ PciIdeXPdoPnpDispatch()

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

Definition at line 359 of file pdo.c.

362 {
364  PIO_STACK_LOCATION Stack;
365  ULONG_PTR Information = Irp->IoStatus.Information;
367 
369  MinorFunction = Stack->MinorFunction;
370 
371  switch (MinorFunction)
372  {
373  /* FIXME:
374  * Those are required:
375  * IRP_MN_START_DEVICE (done)
376  * IRP_MN_QUERY_STOP_DEVICE
377  * IRP_MN_STOP_DEVICE
378  * IRP_MN_CANCEL_STOP_DEVICE
379  * IRP_MN_QUERY_REMOVE_DEVICE
380  * IRP_MN_REMOVE_DEVICE
381  * IRP_MN_CANCEL_REMOVE_DEVICE
382  * IRP_MN_SURPRISE_REMOVAL
383  * IRP_MN_QUERY_CAPABILITIES (done)
384  * IRP_MN_QUERY_DEVICE_RELATIONS / TargetDeviceRelations (done)
385  * IRP_MN_QUERY_ID / BusQueryDeviceID (done)
386  * Those may be required/optional:
387  * IRP_MN_DEVICE_USAGE_NOTIFICATION
388  * IRP_MN_QUERY_RESOURCES
389  * IRP_MN_QUERY_RESOURCE_REQUIREMENTS (done)
390  * IRP_MN_QUERY_DEVICE_TEXT
391  * IRP_MN_QUERY_BUS_INFORMATION
392  * IRP_MN_QUERY_INTERFACE
393  * IRP_MN_READ_CONFIG
394  * IRP_MN_WRITE_CONFIG
395  * IRP_MN_EJECT
396  * IRP_MN_SET_LOCK
397  * Those are optional:
398  * IRP_MN_QUERY_DEVICE_RELATIONS / EjectionRelations
399  * IRP_MN_QUERY_ID / BusQueryHardwareIDs (done)
400  * IRP_MN_QUERY_ID / BusQueryCompatibleIDs (done)
401  * IRP_MN_QUERY_ID / BusQueryInstanceID (done)
402  */
403  case IRP_MN_START_DEVICE: /* 0x00 */
404  {
405  DPRINT("IRP_MJ_PNP / IRP_MN_START_DEVICE\n");
407  break;
408  }
409  case IRP_MN_QUERY_REMOVE_DEVICE: /* 0x01 */
410  {
411  DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_REMOVE_DEVICE\n");
413  break;
414  }
415  case IRP_MN_QUERY_DEVICE_RELATIONS: /* 0x07 */
416  {
417  switch (Stack->Parameters.QueryDeviceRelations.Type)
418  {
420  {
421  PDEVICE_RELATIONS DeviceRelations = NULL;
422  DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / TargetDeviceRelation\n");
424  Information = (ULONG_PTR)DeviceRelations;
425  break;
426  }
427  default:
428  {
429  DPRINT1("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unknown type 0x%lx\n",
430  Stack->Parameters.QueryDeviceRelations.Type);
431  Status = Irp->IoStatus.Status;
432  break;
433  }
434  }
435  break;
436  }
437  case IRP_MN_QUERY_CAPABILITIES: /* 0x09 */
438  {
440  ULONG i;
441  DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_CAPABILITIES\n");
442 
443  DeviceCapabilities = (PDEVICE_CAPABILITIES)Stack->Parameters.DeviceCapabilities.Capabilities;
444  /* FIXME: capabilities can change with connected device */
445  DeviceCapabilities->LockSupported = FALSE;
446  DeviceCapabilities->EjectSupported = FALSE;
447  DeviceCapabilities->Removable = TRUE;
448  DeviceCapabilities->DockDevice = FALSE;
449  DeviceCapabilities->UniqueID = FALSE;
450  DeviceCapabilities->SilentInstall = FALSE;
451  DeviceCapabilities->RawDeviceOK = FALSE;
452  DeviceCapabilities->SurpriseRemovalOK = TRUE;
453  DeviceCapabilities->HardwareDisabled = FALSE; /* FIXME */
454  //DeviceCapabilities->NoDisplayInUI = FALSE; /* FIXME */
455  DeviceCapabilities->DeviceState[0] = PowerDeviceD0; /* FIXME */
456  for (i = 0; i < PowerSystemMaximum; i++)
457  DeviceCapabilities->DeviceState[i] = PowerDeviceD3; /* FIXME */
458  //DeviceCapabilities->DeviceWake = PowerDeviceUndefined; /* FIXME */
459  DeviceCapabilities->D1Latency = 0; /* FIXME */
460  DeviceCapabilities->D2Latency = 0; /* FIXME */
461  DeviceCapabilities->D3Latency = 0; /* FIXME */
463  break;
464  }
465  case IRP_MN_QUERY_RESOURCES: /* 0x0a */
466  {
467  /* This IRP is optional; do nothing */
468  Information = Irp->IoStatus.Information;
469  Status = Irp->IoStatus.Status;
470  break;
471  }
472  case IRP_MN_QUERY_RESOURCE_REQUIREMENTS: /* 0x0b */
473  {
474  DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_RESOURCE_REQUIREMENTS\n");
476  break;
477  }
478  case IRP_MN_QUERY_DEVICE_TEXT: /* 0x0c */
479  {
481  break;
482  }
483  case IRP_MN_FILTER_RESOURCE_REQUIREMENTS: /* 0x0d */
484  {
485  DPRINT("IRP_MJ_PNP / IRP_MN_FILTER_RESOURCE_REQUIREMENTS\n");
486  Information = Irp->IoStatus.Information;
487  Status = Irp->IoStatus.Status;
488  break;
489  }
490  case IRP_MN_QUERY_ID: /* 0x13 */
491  {
493  break;
494  }
495  case IRP_MN_QUERY_PNP_DEVICE_STATE: /* 0x14 */
496  {
497  DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_PNP_DEVICE_STATE\n");
500  break;
501  }
502  case IRP_MN_QUERY_BUS_INFORMATION: /* 0x15 */
503  {
504  PPNP_BUS_INFORMATION BusInfo;
505  DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_BUS_INFORMATION\n");
506 
508  if (!BusInfo)
510  else
511  {
512  /*RtlCopyMemory(
513  &BusInfo->BusTypeGuid,
514  &GUID_DEVINTERFACE_XXX,
515  sizeof(GUID));*/
516  BusInfo->LegacyBusType = PNPBus;
517  BusInfo->BusNumber = 0; /* FIXME */
518  Information = (ULONG_PTR)BusInfo;
520  }
521  break;
522  }
523  default:
524  {
525  /* We can't forward request to the lower driver, because
526  * we are a Pdo, so we don't have lower driver... */
527  DPRINT1("IRP_MJ_PNP / Unknown minor function 0x%lx\n", MinorFunction);
528  Information = Irp->IoStatus.Information;
529  Status = Irp->IoStatus.Status;
530  }
531  }
532 
533  Irp->IoStatus.Information = Information;
534  Irp->IoStatus.Status = Status;
536  return Status;
537 }
#define TRUE
Definition: types.h:120
#define IRP_MN_QUERY_RESOURCES
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#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
uint32_t ULONG_PTR
Definition: typedefs.h:64
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define IRP_MN_QUERY_REMOVE_DEVICE
static NTSTATUS PciIdeXPdoQueryResourceRequirements(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, OUT ULONG_PTR *Information)
Definition: pdo.c:211
static NTSTATUS PciIdeXPdoQueryDeviceRelations(IN PDEVICE_OBJECT DeviceObject, OUT PDEVICE_RELATIONS *pDeviceRelations)
Definition: pdo.c:334
smooth NULL
Definition: ftsmooth.c:416
struct _PNP_BUS_INFORMATION * PPNP_BUS_INFORMATION
#define IoCompleteRequest
Definition: irp.c:1240
#define DeviceCapabilities
Definition: wingdi.h:4448
void DPRINT(...)
Definition: polytest.cpp:61
#define IRP_MN_START_DEVICE
#define PNP_DEVICE_NOT_DISABLEABLE
Definition: iotypes.h:971
#define for
Definition: utility.h:88
#define IRP_MN_QUERY_DEVICE_TEXT
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define IRP_MN_QUERY_BUS_INFORMATION
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
_In_ UCHAR MinorFunction
Definition: pofuncs.h:42
* 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
static NTSTATUS PciIdeXPdoQueryDeviceText(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, OUT ULONG_PTR *Information)
Definition: pdo.c:292
#define IRP_MN_QUERY_DEVICE_RELATIONS
#define DPRINT1
Definition: precomp.h:8
static NTSTATUS PciIdeXPdoQueryId(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, OUT ULONG_PTR *Information)
Definition: pdo.c:17
unsigned int ULONG
Definition: retypes.h:1
#define IO_NO_INCREMENT
Definition: iotypes.h:568
#define ULONG_PTR
Definition: config.h:101
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:2774
return STATUS_SUCCESS
Definition: btrfs.c:3014
INTERFACE_TYPE LegacyBusType
Definition: cmtypes.h:365
#define IRP_MN_QUERY_PNP_DEVICE_STATE
Iosb Information
Definition: create.c:4353
#define IRP_MN_QUERY_CAPABILITIES

Referenced by _Dispatch_type_().

Variable Documentation

◆ PciIdeXAddDevice

DRIVER_ADD_DEVICE PciIdeXAddDevice

Definition at line 43 of file pciidex.h.

Referenced by PciIdeXInitialize().

◆ PciIdeXGenericCompletion

IO_COMPLETION_ROUTINE PciIdeXGenericCompletion

Definition at line 56 of file pciidex.h.