ReactOS  0.4.15-dev-5122-g72bdbdd
pci.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS PCI Bus driver
3  * FILE: pci.c
4  * PURPOSE: Driver entry
5  * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
6  * UPDATE HISTORY:
7  * 10-09-2001 CSH Created
8  */
9 
10 #include "pci.h"
11 
12 #include <stdio.h>
13 
14 #define NDEBUG
15 #include <debug.h>
16 
19 
20 static DRIVER_ADD_DEVICE PciAddDevice;
22 
25 
28 
29 /*** PUBLIC ******************************************************************/
30 
34 
35 /*** PRIVATE *****************************************************************/
36 
37 static NTSTATUS
38 NTAPI
41  IN PIRP Irp)
42 {
45 
47  DPRINT("Called. IRP is at (0x%p)\n", Irp);
48 
49  Irp->IoStatus.Information = 0;
50 
52  switch (IrpSp->Parameters.DeviceIoControl.IoControlCode)
53  {
54  default:
55  DPRINT("Unknown IOCTL 0x%X\n", IrpSp->Parameters.DeviceIoControl.IoControlCode);
57  break;
58  }
59 
60  if (Status != STATUS_PENDING)
61  {
62  Irp->IoStatus.Status = Status;
63 
64  DPRINT("Completing IRP at 0x%p\n", Irp);
65 
67  }
68 
69  DPRINT("Leaving. Status 0x%X\n", Status);
70 
71  return Status;
72 }
73 
74 
75 static NTSTATUS
76 NTAPI
79  IN PIRP Irp)
80 /*
81  * FUNCTION: Handle Plug and Play IRPs
82  * ARGUMENTS:
83  * DeviceObject = Pointer to PDO or FDO
84  * Irp = Pointer to IRP that should be handled
85  * RETURNS:
86  * Status
87  */
88 {
89  PCOMMON_DEVICE_EXTENSION DeviceExtension;
91 
92  DeviceExtension = (PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
93 
94  DPRINT("IsFDO %u\n", DeviceExtension->IsFDO);
95 
96  if (DeviceExtension->IsFDO)
97  {
99  }
100  else
101  {
103  }
104 
105  return Status;
106 }
107 
108 
109 static NTSTATUS
110 NTAPI
113  IN PIRP Irp)
114 /*
115  * FUNCTION: Handle power management IRPs
116  * ARGUMENTS:
117  * DeviceObject = Pointer to PDO or FDO
118  * Irp = Pointer to IRP that should be handled
119  * RETURNS:
120  * Status
121  */
122 {
123  PCOMMON_DEVICE_EXTENSION DeviceExtension;
125 
126  DeviceExtension = (PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
127 
128  if (DeviceExtension->IsFDO)
129  {
131  }
132  else
133  {
135  }
136 
137  return Status;
138 }
139 
140 
141 static NTSTATUS
142 NTAPI
146 {
147  PFDO_DEVICE_EXTENSION DeviceExtension;
150 
151  DPRINT("Called\n");
152  if (PhysicalDeviceObject == NULL)
153  return STATUS_SUCCESS;
154 
156  sizeof(FDO_DEVICE_EXTENSION),
157  NULL,
160  TRUE,
161  &Fdo);
162  if (!NT_SUCCESS(Status))
163  {
164  DPRINT("IoCreateDevice() failed with status 0x%X\n", Status);
165  return Status;
166  }
167 
168  DeviceExtension = (PFDO_DEVICE_EXTENSION)Fdo->DeviceExtension;
169 
170  RtlZeroMemory(DeviceExtension, sizeof(FDO_DEVICE_EXTENSION));
171 
172  DeviceExtension->Common.IsFDO = TRUE;
173 
174  DeviceExtension->Ldo = IoAttachDeviceToDeviceStack(Fdo,
176 
177  DeviceExtension->State = dsStopped;
178 
179  Fdo->Flags &= ~DO_DEVICE_INITIALIZING;
180 
181  //Fdo->Flags |= DO_POWER_PAGABLE;
182 
183  DPRINT("Done AddDevice\n");
184 
185  return STATUS_SUCCESS;
186 }
187 
188 DRIVER_UNLOAD PciUnload;
189 
190 VOID
191 NTAPI
194 {
195  /* The driver object extension is destroyed by the I/O manager */
197 }
198 
199 static
200 CODE_SEG("INIT")
201 VOID
203 {
204  ULONG i;
206  WCHAR KeyNameBuffer[16];
209 
212  QueryTable[0].Name = L"Bus";
215  QueryTable[1].Name = L"Slot";
217 
218  for (i = 0; i < RTL_NUMBER_OF(PciDebuggingDevice); ++i)
219  {
220  PCI_SLOT_NUMBER PciSlot;
221 
222  RtlStringCbPrintfW(KeyNameBuffer, sizeof(KeyNameBuffer), L"PCI\\Debug\\%d", i);
223 
225  KeyNameBuffer,
226  QueryTable,
227  NULL,
228  NULL);
229  if (!NT_SUCCESS(Status))
230  return;
231 
233 
234  PciSlot.u.AsULONG = SlotNumber;
235  PciDebuggingDevice[i].DeviceNumber = PciSlot.u.bits.DeviceNumber;
236  PciDebuggingDevice[i].FunctionNumber = PciSlot.u.bits.FunctionNumber;
239 
240  DPRINT1("PCI debugging device %02x:%02x.%x\n",
241  BusNumber,
242  PciSlot.u.bits.DeviceNumber,
243  PciSlot.u.bits.FunctionNumber);
244  }
245 }
246 
247 CODE_SEG("INIT")
248 NTSTATUS
249 NTAPI
253 {
255 
257  DPRINT("Peripheral Component Interconnect Bus Driver\n");
258 
260  DriverObject->MajorFunction[IRP_MJ_PNP] = PciPnpControl;
261  DriverObject->MajorFunction[IRP_MJ_POWER] = PciPowerControl;
262  DriverObject->DriverExtension->AddDevice = PciAddDevice;
263  DriverObject->DriverUnload = PciUnload;
264 
266  DriverObject,
267  sizeof(PCI_DRIVER_EXTENSION),
269  if (!NT_SUCCESS(Status))
270  return Status;
271 
273 
276 
278 
279  return STATUS_SUCCESS;
280 }
281 
282 
283 NTSTATUS
286 {
287  WCHAR Buffer[256];
288 
290  L"PCI\\VEN_%04X&DEV_%04X&SUBSYS_%08X&REV_%02X",
291  Device->PciConfig.VendorID,
292  Device->PciConfig.DeviceID,
293  (Device->PciConfig.u.type0.SubSystemID << 16) +
294  Device->PciConfig.u.type0.SubVendorID,
295  Device->PciConfig.RevisionID);
296 
298 }
299 
300 
301 NTSTATUS
304 {
305  WCHAR Buffer[3];
306 
307  swprintf(Buffer, L"%02X", Device->SlotNumber.u.AsULONG & 0xff);
308 
310 }
311 
312 
313 NTSTATUS
316 {
317  WCHAR Buffer[256];
318  UNICODE_STRING BufferU;
319  ULONG Index;
320 
321  Index = 0;
322  Index += swprintf(&Buffer[Index],
323  L"PCI\\VEN_%04X&DEV_%04X&SUBSYS_%08X&REV_%02X",
324  Device->PciConfig.VendorID,
325  Device->PciConfig.DeviceID,
326  (Device->PciConfig.u.type0.SubSystemID << 16) +
327  Device->PciConfig.u.type0.SubVendorID,
328  Device->PciConfig.RevisionID);
329  Index++;
330 
331  Index += swprintf(&Buffer[Index],
332  L"PCI\\VEN_%04X&DEV_%04X&SUBSYS_%08X",
333  Device->PciConfig.VendorID,
334  Device->PciConfig.DeviceID,
335  (Device->PciConfig.u.type0.SubSystemID << 16) +
336  Device->PciConfig.u.type0.SubVendorID);
337  Index++;
338 
339  Index += swprintf(&Buffer[Index],
340  L"PCI\\VEN_%04X&DEV_%04X&CC_%02X%02X%02X",
341  Device->PciConfig.VendorID,
342  Device->PciConfig.DeviceID,
343  Device->PciConfig.BaseClass,
344  Device->PciConfig.SubClass,
345  Device->PciConfig.ProgIf);
346  Index++;
347 
348  Index += swprintf(&Buffer[Index],
349  L"PCI\\VEN_%04X&DEV_%04X&CC_%02X%02X",
350  Device->PciConfig.VendorID,
351  Device->PciConfig.DeviceID,
352  Device->PciConfig.BaseClass,
353  Device->PciConfig.SubClass);
354  Index++;
355 
357 
358  BufferU.Length = BufferU.MaximumLength = (USHORT) Index * sizeof(WCHAR);
359  BufferU.Buffer = Buffer;
360 
361  return PciDuplicateUnicodeString(0, &BufferU, HardwareIDs);
362 }
363 
364 
365 NTSTATUS
368 {
369  WCHAR Buffer[256];
370  UNICODE_STRING BufferU;
371  ULONG Index;
372 
373  Index = 0;
374  Index += swprintf(&Buffer[Index],
375  L"PCI\\VEN_%04X&DEV_%04X&REV_%02X",
376  Device->PciConfig.VendorID,
377  Device->PciConfig.DeviceID,
378  Device->PciConfig.RevisionID);
379  Index++;
380 
381  Index += swprintf(&Buffer[Index],
382  L"PCI\\VEN_%04X&DEV_%04X",
383  Device->PciConfig.VendorID,
384  Device->PciConfig.DeviceID);
385  Index++;
386 
387  Index += swprintf(&Buffer[Index],
388  L"PCI\\VEN_%04X&CC_%02X%02X%02X",
389  Device->PciConfig.VendorID,
390  Device->PciConfig.BaseClass,
391  Device->PciConfig.SubClass,
392  Device->PciConfig.ProgIf);
393  Index++;
394 
395  Index += swprintf(&Buffer[Index],
396  L"PCI\\VEN_%04X&CC_%02X%02X",
397  Device->PciConfig.VendorID,
398  Device->PciConfig.BaseClass,
399  Device->PciConfig.SubClass);
400  Index++;
401 
402  Index += swprintf(&Buffer[Index],
403  L"PCI\\VEN_%04X",
404  Device->PciConfig.VendorID);
405  Index++;
406 
407  Index += swprintf(&Buffer[Index],
408  L"PCI\\CC_%02X%02X%02X",
409  Device->PciConfig.BaseClass,
410  Device->PciConfig.SubClass,
411  Device->PciConfig.ProgIf);
412  Index++;
413 
414  Index += swprintf(&Buffer[Index],
415  L"PCI\\CC_%02X%02X",
416  Device->PciConfig.BaseClass,
417  Device->PciConfig.SubClass);
418  Index++;
419 
421 
422  BufferU.Length = BufferU.MaximumLength = (USHORT)Index * sizeof(WCHAR);
423  BufferU.Buffer = Buffer;
424 
425  return PciDuplicateUnicodeString(0, &BufferU, CompatibleIDs);
426 }
427 
428 
429 NTSTATUS
432 {
434 
435  switch (Device->PciConfig.BaseClass)
436  {
437  case PCI_CLASS_PRE_20:
438  switch (Device->PciConfig.SubClass)
439  {
441  Description = L"VGA device";
442  break;
443 
444  default:
446  Description = L"PCI device";
447  break;
448  }
449  break;
450 
452  switch (Device->PciConfig.SubClass)
453  {
455  Description = L"SCSI controller";
456  break;
457 
459  Description = L"IDE controller";
460  break;
461 
463  Description = L"Floppy disk controller";
464  break;
465 
467  Description = L"IPI controller";
468  break;
469 
471  Description = L"RAID controller";
472  break;
473 
474  default:
475  Description = L"Mass storage controller";
476  break;
477  }
478  break;
479 
481  switch (Device->PciConfig.SubClass)
482  {
484  Description = L"Ethernet controller";
485  break;
486 
488  Description = L"Token-Ring controller";
489  break;
490 
492  Description = L"FDDI controller";
493  break;
494 
496  Description = L"ATM controller";
497  break;
498 
499  default:
500  Description = L"Network controller";
501  break;
502  }
503  break;
504 
506  switch (Device->PciConfig.SubClass)
507  {
509  Description = L"VGA display controller";
510  break;
511 
513  Description = L"XGA display controller";
514  break;
515 
517  Description = L"Multimedia display controller";
518  break;
519 
520  default:
521  Description = L"Other display controller";
522  break;
523  }
524  break;
525 
527  switch (Device->PciConfig.SubClass)
528  {
530  Description = L"Multimedia video device";
531  break;
532 
534  Description = L"Multimedia audio device";
535  break;
536 
538  Description = L"Multimedia telephony device";
539  break;
540 
541  default:
542  Description = L"Other multimedia device";
543  break;
544  }
545  break;
546 
548  switch (Device->PciConfig.SubClass)
549  {
551  Description = L"PCI Memory";
552  break;
553 
555  Description = L"PCI Flash Memory";
556  break;
557 
558  default:
559  Description = L"Other memory controller";
560  break;
561  }
562  break;
563 
565  switch (Device->PciConfig.SubClass)
566  {
568  Description = L"PCI-Host bridge";
569  break;
570 
571  case PCI_SUBCLASS_BR_ISA:
572  Description = L"PCI-ISA bridge";
573  break;
574 
576  Description = L"PCI-EISA bridge";
577  break;
578 
579  case PCI_SUBCLASS_BR_MCA:
580  Description = L"PCI-Micro Channel bridge";
581  break;
582 
584  Description = L"PCI-PCI bridge";
585  break;
586 
588  Description = L"PCI-PCMCIA bridge";
589  break;
590 
592  Description = L"PCI-NUBUS bridge";
593  break;
594 
596  Description = L"PCI-CARDBUS bridge";
597  break;
598 
599  default:
600  Description = L"Other bridge device";
601  break;
602  }
603  break;
604 
606  switch (Device->PciConfig.SubClass)
607  {
608 
609  default:
610  Description = L"Communication device";
611  break;
612  }
613  break;
614 
616  switch (Device->PciConfig.SubClass)
617  {
618 
619  default:
620  Description = L"System device";
621  break;
622  }
623  break;
624 
625  case PCI_CLASS_INPUT_DEV:
626  switch (Device->PciConfig.SubClass)
627  {
628 
629  default:
630  Description = L"Input device";
631  break;
632  }
633  break;
634 
636  switch (Device->PciConfig.SubClass)
637  {
638 
639  default:
640  Description = L"Docking station";
641  break;
642  }
643  break;
644 
645  case PCI_CLASS_PROCESSOR:
646  switch (Device->PciConfig.SubClass)
647  {
648 
649  default:
650  Description = L"Processor";
651  break;
652  }
653  break;
654 
656  switch (Device->PciConfig.SubClass)
657  {
659  Description = L"FireWire controller";
660  break;
661 
663  Description = L"ACCESS bus controller";
664  break;
665 
666  case PCI_SUBCLASS_SB_SSA:
667  Description = L"SSA controller";
668  break;
669 
670  case PCI_SUBCLASS_SB_USB:
671  Description = L"USB controller";
672  break;
673 
675  Description = L"Fibre Channel controller";
676  break;
677 
679  Description = L"SMBus controller";
680  break;
681 
682  default:
683  Description = L"Other serial bus controller";
684  break;
685  }
686  break;
687 
688  default:
689  Description = L"Other PCI Device";
690  break;
691  }
692 
694 }
695 
696 
697 NTSTATUS
700 {
701  WCHAR Buffer[256];
702 
704  L"PCI-Bus %lu, Device %u, Function %u",
705  Device->BusNumber,
706  Device->SlotNumber.u.bits.DeviceNumber,
707  Device->SlotNumber.u.bits.FunctionNumber);
708 
710 }
711 
712 NTSTATUS
714  IN ULONG Flags,
717 {
718  if (SourceString == NULL ||
719  DestinationString == NULL ||
723  Flags >= 4)
724  {
726  }
727 
728  if ((SourceString->Length == 0) &&
731  {
735  }
736  else
737  {
738  USHORT DestMaxLength = SourceString->Length;
739 
741  DestMaxLength += sizeof(UNICODE_NULL);
742 
744  if (DestinationString->Buffer == NULL)
745  return STATUS_NO_MEMORY;
746 
749  DestinationString->MaximumLength = DestMaxLength;
750 
753  }
754 
755  return STATUS_SUCCESS;
756 }
757 
758 /* EOF */
#define DO_DEVICE_INITIALIZING
Definition: env_spec_w32.h:399
_In_ WDFIORESREQLIST _In_ ULONG SlotNumber
Definition: wdfresource.h:65
#define PCI_SUBCLASS_NET_TOKEN_RING_CTLR
Definition: iotypes.h:4137
const uint16_t * PCWSTR
Definition: typedefs.h:57
_In_ PCWSTR _Inout_ _At_ QueryTable _Pre_unknown_ PRTL_QUERY_REGISTRY_TABLE QueryTable
Definition: rtlfuncs.h:4182
#define IN
Definition: typedefs.h:39
#define PCI_SUBCLASS_NET_ETHERNET_CTLR
Definition: iotypes.h:4136
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define PCI_CLASS_SERIAL_BUS_CTLR
Definition: iotypes.h:4115
NTSYSAPI NTSTATUS WINAPI RtlQueryRegistryValues(ULONG, PCWSTR, PRTL_QUERY_REGISTRY_TABLE, PVOID, PVOID)
NTSTATUS NTAPI IoAllocateDriverObjectExtension(IN PDRIVER_OBJECT DriverObject, IN PVOID ClientIdentificationAddress, IN ULONG DriverObjectExtensionSize, OUT PVOID *DriverObjectExtension)
Definition: driver.c:1797
#define PCI_SUBCLASS_VID_3D_CTLR
Definition: iotypes.h:4146
USHORT MaximumLength
Definition: env_spec_w32.h:370
#define PCI_SUBCLASS_MSC_SCSI_BUS_CTLR
Definition: iotypes.h:4128
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
#define PCI_SUBCLASS_SB_USB
Definition: iotypes.h:4207
#define TRUE
Definition: types.h:120
NTSTATUS PciCreateDeviceDescriptionString(PUNICODE_STRING DeviceDescription, PPCI_DEVICE Device)
Definition: pci.c:430
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING
Definition: green.h:16
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
#define PCI_SUBCLASS_MEM_RAM
Definition: iotypes.h:4156
NTSTATUS PciDuplicateUnicodeString(IN ULONG Flags, IN PCUNICODE_STRING SourceString, OUT PUNICODE_STRING DestinationString)
Definition: pci.c:713
LONG NTSTATUS
Definition: precomp.h:26
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:213
struct _PCI_SLOT_NUMBER::@3804::@3805 bits
unsigned short Length
Definition: sprintf.c:451
#define PCI_CLASS_MULTIMEDIA_DEV
Definition: iotypes.h:4107
static const WCHAR Description[]
Definition: oid.c:1266
PDEVICE_OBJECT PhysicalDeviceObject
Definition: btrfs_drv.h:1157
#define PCI_SUBCLASS_MEM_FLASH
Definition: iotypes.h:4157
#define RTL_REGISTRY_SERVICES
Definition: nt_native.h:162
if(dx==0 &&dy==0)
Definition: linetemp.h:174
#define PCI_SUBCLASS_PRE_20_NON_VGA
Definition: iotypes.h:4124
PDEVICE_OBJECT Ldo
Definition: pci.h:98
#define PCI_SUBCLASS_MM_TELEPHONY_DEV
Definition: iotypes.h:4152
struct _FDO_DEVICE_EXTENSION * PFDO_DEVICE_EXTENSION
#define PCI_SUBCLASS_MM_AUDIO_DEV
Definition: iotypes.h:4151
#define PCI_SUBCLASS_SB_FIBRE_CHANNEL
Definition: iotypes.h:4208
#define PCI_SUBCLASS_SB_SMBUS
Definition: iotypes.h:4209
NTSTATUS PdoPnpControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: pdo.c:1500
#define PCI_SUBCLASS_BR_CARDBUS
Definition: iotypes.h:4168
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
return STATUS_NOT_IMPLEMENTED
void * Buffer
Definition: sprintf.c:453
#define L(x)
Definition: ntvdm.h:50
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING DeviceDescription
Definition: wdfpdo.h:430
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
#define PCI_SUBCLASS_NET_ATM_CTLR
Definition: iotypes.h:4139
#define FALSE
Definition: types.h:117
#define UNICODE_NULL
_In_ PIRP Irp
Definition: csq.h:116
#define PCI_SUBCLASS_MSC_FLOPPY_CTLR
Definition: iotypes.h:4130
static DRIVER_DISPATCH PciPnpControl
Definition: pci.c:26
static VOID PciLocateKdDevices(VOID)
Definition: pci.c:202
PDEVICE_OBJECT NTAPI IoAttachDeviceToDeviceStack(IN PDEVICE_OBJECT SourceDevice, IN PDEVICE_OBJECT TargetDevice)
Definition: device.c:966
NTSTATUS PdoPowerControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: pdo.c:1623
FORCEINLINE VOID KeInitializeSpinLock(_Out_ PKSPIN_LOCK SpinLock)
Definition: kefuncs.h:240
#define PCI_SUBCLASS_MSC_IPI_CTLR
Definition: iotypes.h:4131
unsigned char BOOLEAN
#define PCI_SUBCLASS_MSC_RAID_CTLR
Definition: iotypes.h:4132
_Out_ _Inout_ POEM_STRING DestinationString
Definition: rtlfuncs.h:1895
#define IoCompleteRequest
Definition: irp.c:1240
Definition: bufpool.h:45
#define PCI_SUBCLASS_NET_FDDI_CTLR
Definition: iotypes.h:4138
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:156
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
NTSTATUS PciCreateHardwareIDsString(PUNICODE_STRING HardwareIDs, PPCI_DEVICE Device)
Definition: pci.c:314
#define PCI_SUBCLASS_VID_VGA_CTLR
Definition: iotypes.h:4144
Status
Definition: gdiplustypes.h:24
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define STATUS_PENDING
Definition: ntstatus.h:82
NTSTRSAFEVAPI RtlStringCbPrintfW(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cbDest, _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat,...)
Definition: ntstrsafe.h:1173
_In_ WDFCOLLECTION _In_ ULONG Index
KSPIN_LOCK BusListLock
Definition: pci.h:108
struct _COMMON_DEVICE_EXTENSION * PCOMMON_DEVICE_EXTENSION
PCI_DEVICE_STATE State
Definition: pci.h:90
#define PCI_SUBCLASS_BR_MCA
Definition: iotypes.h:4164
NTSTATUS NTAPI DriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
Definition: pci.c:250
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING InstanceID
Definition: wdfpdo.h:306
#define RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE
Definition: green.h:15
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
_Must_inspect_result_ _In_ WDFDEVICE Fdo
Definition: wdffdo.h:461
#define PCI_CLASS_DISPLAY_CTLR
Definition: iotypes.h:4106
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define IRP_MJ_POWER
_Out_ _Inout_ POEM_STRING _In_ PCUNICODE_STRING SourceString
Definition: rtlfuncs.h:1895
LIST_ENTRY BusListHead
Definition: pci.h:106
#define PCI_SUBCLASS_BR_PCMCIA
Definition: iotypes.h:4166
#define TAG_PCI
Definition: pci.h:8
#define PCI_CLASS_MEMORY_CTLR
Definition: iotypes.h:4108
NTSTATUS PciCreateInstanceIDString(PUNICODE_STRING InstanceID, PPCI_DEVICE Device)
Definition: pci.c:302
#define PCI_SUBCLASS_BR_PCI_TO_PCI
Definition: iotypes.h:4165
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING DeviceID
Definition: wdfpdo.h:275
BOOLEAN HasDebuggingDevice
Definition: pci.c:32
#define PCI_SUBCLASS_MSC_IDE_CTLR
Definition: iotypes.h:4129
int _cdecl swprintf(const WCHAR *,...)
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
DRIVER_DISPATCH(nfs41_FsdDispatch)
COMMON_DEVICE_EXTENSION Common
Definition: pci.h:84
#define PCI_CLASS_SIMPLE_COMMS_CTLR
Definition: iotypes.h:4110
NTSTATUS FdoPowerControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: fdo.c:594
#define PCI_SUBCLASS_SB_SSA
Definition: iotypes.h:4206
PCI_TYPE1_CFG_CYCLE_BITS PciDebuggingDevice[2]
Definition: pci.c:33
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2793
#define PCI_CLASS_NETWORK_CTLR
Definition: iotypes.h:4105
static DRIVER_DISPATCH PciPowerControl
Definition: pci.c:23
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
unsigned short USHORT
Definition: pedump.c:61
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
NTSTATUS PciCreateDeviceIDString(PUNICODE_STRING DeviceID, PPCI_DEVICE Device)
Definition: pci.c:284
static DRIVER_ADD_DEVICE PciAddDevice
Definition: pci.c:20
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4137
#define PCI_SUBCLASS_MM_VIDEO_DEV
Definition: iotypes.h:4150
#define PCI_SUBCLASS_VID_XGA_CTLR
Definition: iotypes.h:4145
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
NTSTATUS PciCreateCompatibleIDsString(PUNICODE_STRING CompatibleIDs, PPCI_DEVICE Device)
Definition: pci.c:366
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING _In_ PCUNICODE_STRING DeviceLocation
Definition: wdfpdo.h:430
#define PCI_SUBCLASS_SB_IEEE1394
Definition: iotypes.h:4204
NTSTATUS PciCreateDeviceLocationString(PUNICODE_STRING DeviceLocation, PPCI_DEVICE Device)
Definition: pci.c:698
#define NULL
Definition: types.h:112
static DRIVER_DISPATCH PciDispatchDeviceControl
Definition: pci.c:17
#define PCI_CLASS_INPUT_DEV
Definition: iotypes.h:4112
NTSTATUS FdoPnpControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: fdo.c:469
#define PCI_SUBCLASS_BR_NUBUS
Definition: iotypes.h:4167
#define DPRINT1
Definition: precomp.h:8
#define PCI_SUBCLASS_PRE_20_VGA
Definition: iotypes.h:4125
#define PCI_CLASS_DOCKING_STATION
Definition: iotypes.h:4113
#define OUT
Definition: typedefs.h:40
PPCI_DRIVER_EXTENSION DriverExtension
Definition: pci.c:31
unsigned int ULONG
Definition: retypes.h:1
#define IO_NO_INCREMENT
Definition: iotypes.h:598
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:262
#define PCI_SUBCLASS_BR_HOST
Definition: iotypes.h:4161
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
DRIVER_UNLOAD PciUnload
Definition: pci.c:188
#define PCI_CLASS_PROCESSOR
Definition: iotypes.h:4114
#define FILE_DEVICE_SECURE_OPEN
Definition: cdrw_usr.h:46
#define PCI_CLASS_BRIDGE_DEV
Definition: iotypes.h:4109
#define STATUS_SUCCESS
Definition: shellext.h:65
#define PCI_SUBCLASS_BR_ISA
Definition: iotypes.h:4162
#define DPRINT
Definition: sndvol32.h:71
#define PCI_SUBCLASS_SB_ACCESS
Definition: iotypes.h:4205
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:3128
#define PCI_CLASS_BASE_SYSTEM_DEV
Definition: iotypes.h:4111
#define FILE_DEVICE_BUS_EXTENDER
Definition: winioctl.h:148
unsigned short MaximumLength
Definition: sprintf.c:452
#define PCI_SUBCLASS_BR_EISA
Definition: iotypes.h:4163
#define RTL_QUERY_REGISTRY_REQUIRED
Definition: nt_native.h:132
union _PCI_SLOT_NUMBER::@3804 u
static CODE_SEG("PAGE")
Definition: isapnp.c:1482
#define RTL_QUERY_REGISTRY_DIRECT
Definition: nt_native.h:144
#define PCI_CLASS_MASS_STORAGE_CTLR
Definition: iotypes.h:4104
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52
#define PCI_CLASS_PRE_20
Definition: iotypes.h:4103