ReactOS 0.4.16-dev-197-g92996da
pdo.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS PCI Bus Driver
3 * LICENSE: BSD - See COPYING.ARM in the top level directory
4 * FILE: drivers/bus/pci/pdo.c
5 * PURPOSE: PDO Device Management
6 * PROGRAMMERS: ReactOS Portable Systems Group
7 */
8
9/* INCLUDES *******************************************************************/
10
11#include <pci.h>
12
13#define NDEBUG
14#include <debug.h>
15
16/* GLOBALS ********************************************************************/
17
19
21C_ASSERT(FIELD_OFFSET(PCI_FDO_EXTENSION, TentativeNextState) == FIELD_OFFSET(PCI_PDO_EXTENSION, TentativeNextState));
23
25{
31};
32
34{
61};
62
64{
73};
74
75/* FUNCTIONS ******************************************************************/
76
80 IN PIO_STACK_LOCATION IoStackLocation,
81 IN PPCI_PDO_EXTENSION DeviceExtension)
82{
84 UNREFERENCED_PARAMETER(IoStackLocation);
85 UNREFERENCED_PARAMETER(DeviceExtension);
86
89}
90
94 IN PIO_STACK_LOCATION IoStackLocation,
95 IN PPCI_PDO_EXTENSION DeviceExtension)
96{
98 UNREFERENCED_PARAMETER(IoStackLocation);
99 UNREFERENCED_PARAMETER(DeviceExtension);
100
103}
104
106NTAPI
108 IN PIO_STACK_LOCATION IoStackLocation,
109 IN PPCI_PDO_EXTENSION DeviceExtension)
110{
112 UNREFERENCED_PARAMETER(IoStackLocation);
113 UNREFERENCED_PARAMETER(DeviceExtension);
114
117}
118
120NTAPI
122 IN PIO_STACK_LOCATION IoStackLocation,
123 IN PPCI_PDO_EXTENSION DeviceExtension)
124{
126 BOOLEAN Changed, DoReset;
128 PAGED_CODE();
129
131
132 DoReset = FALSE;
133
134 /* Begin entering the start phase */
135 Status = PciBeginStateTransition((PVOID)DeviceExtension, PciStarted);
136 if (!NT_SUCCESS(Status)) return Status;
137
138 /* Check if this is a VGA device */
139 if (((DeviceExtension->BaseClass == PCI_CLASS_PRE_20) &&
140 (DeviceExtension->SubClass == PCI_SUBCLASS_PRE_20_VGA)) ||
141 ((DeviceExtension->BaseClass == PCI_CLASS_DISPLAY_CTLR) &&
142 (DeviceExtension->SubClass == PCI_SUBCLASS_VID_VGA_CTLR)))
143 {
144 /* Always force it on */
145 DeviceExtension->CommandEnables |= (PCI_ENABLE_IO_SPACE |
147 }
148
149 /* Check if native IDE is enabled and it owns the I/O ports */
150 if (DeviceExtension->IoSpaceUnderNativeIdeControl)
151 {
152 /* Then don't allow I/O access */
153 DeviceExtension->CommandEnables &= ~PCI_ENABLE_IO_SPACE;
154 }
155
156 /* Always enable bus mastering */
157 DeviceExtension->CommandEnables |= PCI_ENABLE_BUS_MASTER;
158
159 /* Check if the OS assigned resources differ from the PCI configuration */
160 Changed = PciComputeNewCurrentSettings(DeviceExtension,
161 IoStackLocation->Parameters.
162 StartDevice.AllocatedResources);
163 if (Changed)
164 {
165 /* Remember this for later */
166 DeviceExtension->MovedDevice = TRUE;
167 }
168 else
169 {
170 /* All good */
171 DPRINT1("PCI - START not changing resource settings.\n");
172 }
173
174 /* Check if the device was sleeping */
175 if (DeviceExtension->PowerState.CurrentDeviceState != PowerDeviceD0)
176 {
177 /* Power it up */
180 FALSE);
181 if (!NT_SUCCESS(Status))
182 {
183 /* Powerup fail, fail the request */
184 PciCancelStateTransition((PVOID)DeviceExtension, PciStarted);
186 }
187
188 /* Tell the power manager that the device is powered up */
189 PowerState.DeviceState = PowerDeviceD0;
190 PoSetPowerState(DeviceExtension->PhysicalDeviceObject,
192 PowerState);
193
194 /* Update internal state */
195 DeviceExtension->PowerState.CurrentDeviceState = PowerDeviceD0;
196
197 /* This device's resources and decodes will need to be reset */
198 DoReset = TRUE;
199 }
200
201 /* Update resource information now that the device is powered up and active */
202 Status = PciSetResources(DeviceExtension, DoReset, TRUE);
203 if (!NT_SUCCESS(Status))
204 {
205 /* That failed, so cancel the transition */
206 PciCancelStateTransition((PVOID)DeviceExtension, PciStarted);
207 }
208 else
209 {
210 /* Fully commit, as the device is now started up and ready to go */
211 PciCommitStateTransition((PVOID)DeviceExtension, PciStarted);
212 }
213
214 /* Return the result of the start request */
215 return Status;
216}
217
219NTAPI
221 IN PIO_STACK_LOCATION IoStackLocation,
222 IN PPCI_PDO_EXTENSION DeviceExtension)
223{
225 UNREFERENCED_PARAMETER(IoStackLocation);
226 UNREFERENCED_PARAMETER(DeviceExtension);
227
230}
231
233NTAPI
235 IN PIO_STACK_LOCATION IoStackLocation,
236 IN PPCI_PDO_EXTENSION DeviceExtension)
237{
239 UNREFERENCED_PARAMETER(IoStackLocation);
240 UNREFERENCED_PARAMETER(DeviceExtension);
241
244}
245
247NTAPI
249 IN PIO_STACK_LOCATION IoStackLocation,
250 IN PPCI_PDO_EXTENSION DeviceExtension)
251{
253 UNREFERENCED_PARAMETER(IoStackLocation);
254 UNREFERENCED_PARAMETER(DeviceExtension);
255
258}
259
261NTAPI
263 IN PIO_STACK_LOCATION IoStackLocation,
264 IN PPCI_PDO_EXTENSION DeviceExtension)
265{
267 UNREFERENCED_PARAMETER(IoStackLocation);
268 UNREFERENCED_PARAMETER(DeviceExtension);
269
272}
273
275NTAPI
277 IN PIO_STACK_LOCATION IoStackLocation,
278 IN PPCI_PDO_EXTENSION DeviceExtension)
279{
281 UNREFERENCED_PARAMETER(IoStackLocation);
282 UNREFERENCED_PARAMETER(DeviceExtension);
283
286}
287
289NTAPI
291 IN PIO_STACK_LOCATION IoStackLocation,
292 IN PPCI_PDO_EXTENSION DeviceExtension)
293{
295 UNREFERENCED_PARAMETER(IoStackLocation);
296 UNREFERENCED_PARAMETER(DeviceExtension);
297
300}
301
303NTAPI
305 IN PIO_STACK_LOCATION IoStackLocation,
306 IN PPCI_PDO_EXTENSION DeviceExtension)
307{
309 UNREFERENCED_PARAMETER(IoStackLocation);
310 UNREFERENCED_PARAMETER(DeviceExtension);
311
314}
315
317NTAPI
319 IN PIO_STACK_LOCATION IoStackLocation,
320 IN PPCI_PDO_EXTENSION DeviceExtension)
321{
323 PAGED_CODE();
324
325 /* Are ejection relations being queried? */
326 if (IoStackLocation->Parameters.QueryDeviceRelations.Type == EjectionRelations)
327 {
328 /* Call the worker function */
329 Status = PciQueryEjectionRelations(DeviceExtension,
331 IoStatus.Information);
332 }
333 else if (IoStackLocation->Parameters.QueryDeviceRelations.Type == TargetDeviceRelation)
334 {
335 /* The only other relation supported is the target device relation */
336 Status = PciQueryTargetDeviceRelations(DeviceExtension,
338 IoStatus.Information);
339 }
340 else
341 {
342 /* All other relations are unsupported */
344 }
345
346 /* Return either the result of the worker function, or unsupported status */
347 return Status;
348}
349
351NTAPI
353 IN PIO_STACK_LOCATION IoStackLocation,
354 IN PPCI_PDO_EXTENSION DeviceExtension)
355{
356 PAGED_CODE();
357
359
360 /* Call the worker function */
361 return PciQueryCapabilities(DeviceExtension,
362 IoStackLocation->
363 Parameters.DeviceCapabilities.Capabilities);
364}
365
367NTAPI
369 IN PIO_STACK_LOCATION IoStackLocation,
370 IN PPCI_PDO_EXTENSION DeviceExtension)
371{
372 PAGED_CODE();
373
374 UNREFERENCED_PARAMETER(IoStackLocation);
375
376 /* Call the worker function */
377 return PciQueryResources(DeviceExtension,
378 (PCM_RESOURCE_LIST*)&Irp->IoStatus.Information);
379}
380
382NTAPI
384 IN PIO_STACK_LOCATION IoStackLocation,
385 IN PPCI_PDO_EXTENSION DeviceExtension)
386{
387 PAGED_CODE();
388
389 UNREFERENCED_PARAMETER(IoStackLocation);
390
391 /* Call the worker function */
392 return PciQueryRequirements(DeviceExtension,
394 IoStatus.Information);
395}
396
398NTAPI
400 IN PIO_STACK_LOCATION IoStackLocation,
401 IN PPCI_PDO_EXTENSION DeviceExtension)
402{
403 PAGED_CODE();
404
405 /* Call the worker function */
406 return PciQueryDeviceText(DeviceExtension,
407 IoStackLocation->
408 Parameters.QueryDeviceText.DeviceTextType,
409 IoStackLocation->
410 Parameters.QueryDeviceText.LocaleId,
411 (PWCHAR*)&Irp->IoStatus.Information);
412}
413
415NTAPI
417 IN PIO_STACK_LOCATION IoStackLocation,
418 IN PPCI_PDO_EXTENSION DeviceExtension)
419{
420 PAGED_CODE();
421
422 /* Call the worker function */
423 return PciQueryId(DeviceExtension,
424 IoStackLocation->Parameters.QueryId.IdType,
425 (PWCHAR*)&Irp->IoStatus.Information);
426}
427
429NTAPI
431 IN PIO_STACK_LOCATION IoStackLocation,
432 IN PPCI_PDO_EXTENSION DeviceExtension)
433{
434 PAGED_CODE();
435
436 UNREFERENCED_PARAMETER(IoStackLocation);
437
438 /* Call the worker function */
439 return PciQueryBusInformation(DeviceExtension,
441 IoStatus.Information);
442}
443
445NTAPI
447 IN PIO_STACK_LOCATION IoStackLocation,
448 IN PPCI_PDO_EXTENSION DeviceExtension)
449{
451 UNREFERENCED_PARAMETER(IoStackLocation);
452 UNREFERENCED_PARAMETER(DeviceExtension);
453
456}
457
459NTAPI
461 IN PIO_STACK_LOCATION IoStackLocation,
462 IN PPCI_PDO_EXTENSION DeviceExtension)
463{
465 UNREFERENCED_PARAMETER(IoStackLocation);
466 UNREFERENCED_PARAMETER(DeviceExtension);
467
470}
471
473NTAPI
475 IN PIO_STACK_LOCATION IoStackLocation,
476 IN PPCI_PDO_EXTENSION DeviceExtension)
477{
479 UNREFERENCED_PARAMETER(IoStackLocation);
480 UNREFERENCED_PARAMETER(DeviceExtension);
481
484}
485
487NTAPI
489 IN PIO_STACK_LOCATION IoStackLocation,
490 IN PPCI_PDO_EXTENSION DeviceExtension)
491{
493 UNREFERENCED_PARAMETER(IoStackLocation);
494 UNREFERENCED_PARAMETER(DeviceExtension);
495
498}
499
501NTAPI
503 IN PIO_STACK_LOCATION IoStackLocation,
504 IN PPCI_PDO_EXTENSION DeviceExtension)
505{
507 UNREFERENCED_PARAMETER(IoStackLocation);
508 UNREFERENCED_PARAMETER(DeviceExtension);
509
512}
513
515NTAPI
517 IN PIO_STACK_LOCATION IoStackLocation,
518 IN PPCI_PDO_EXTENSION DeviceExtension)
519{
521 UNREFERENCED_PARAMETER(IoStackLocation);
522 UNREFERENCED_PARAMETER(DeviceExtension);
523
526}
527
529NTAPI
531 IN PCI_SLOT_NUMBER Slot,
533{
534 WCHAR DeviceName[32];
535 UNICODE_STRING DeviceString;
539 ULONG SequenceNumber;
540 PAGED_CODE();
541
542 /* Pick an atomically unique sequence number for this device */
544
545 /* Create the standard PCI device name for a PDO */
546 swprintf(DeviceName, L"\\Device\\NTPNP_PCI%04d", SequenceNumber);
547 RtlInitUnicodeString(&DeviceString, DeviceName);
548
549 /* Create the actual device now */
550 Status = IoCreateDevice(DeviceExtension->FunctionalDeviceObject->DriverObject,
551 sizeof(PCI_PDO_EXTENSION),
552 &DeviceString,
554 0,
555 0,
556 &DeviceObject);
558
559 /* Get the extension for it */
560 PdoExtension = (PPCI_PDO_EXTENSION)DeviceObject->DeviceExtension;
561 DPRINT1("PCI: New PDO (b=0x%x, d=0x%x, f=0x%x) @ %p, ext @ %p\n",
562 DeviceExtension->BaseBus,
563 Slot.u.bits.DeviceNumber,
564 Slot.u.bits.FunctionNumber,
566 DeviceObject->DeviceExtension);
567
568 /* Configure the extension */
569 PdoExtension->ExtensionType = PciPdoExtensionType;
570 PdoExtension->IrpDispatchTable = &PciPdoDispatchTable;
571 PdoExtension->PhysicalDeviceObject = DeviceObject;
572 PdoExtension->Slot = Slot;
573 PdoExtension->PowerState.CurrentSystemState = PowerDeviceD0;
574 PdoExtension->PowerState.CurrentDeviceState = PowerDeviceD0;
575 PdoExtension->ParentFdoExtension = DeviceExtension;
576
577 /* Initialize the lock for arbiters and other interfaces */
579
580 /* Initialize the state machine */
582
583 /* Add the PDO to the parent's list */
584 PdoExtension->Next = NULL;
585 PciInsertEntryAtTail((PSINGLE_LIST_ENTRY)&DeviceExtension->ChildPdoList,
587 &DeviceExtension->ChildListLock);
588
589 /* And finally return it to the caller */
591 return STATUS_SUCCESS;
592}
593
594/* EOF */
#define PAGED_CODE()
unsigned char BOOLEAN
#define InterlockedIncrement
Definition: armddk.h:53
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
#define UNIMPLEMENTED
Definition: debug.h:118
NTSTATUS NTAPI PciPdoCreate(IN PPCI_FDO_EXTENSION DeviceExtension, IN PCI_SLOT_NUMBER Slot, OUT PDEVICE_OBJECT *PdoDeviceObject)
Definition: pdo.c:530
NTSTATUS NTAPI PciPdoIrpStopDevice(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:262
PCI_MN_DISPATCH_TABLE PciPdoDispatchPowerTable[]
Definition: pdo.c:24
NTSTATUS NTAPI PciPdoSetPowerState(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:93
NTSTATUS NTAPI PciPdoIrpCancelStopDevice(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:290
PCI_MJ_DISPATCH_TABLE PciPdoDispatchTable
Definition: pdo.c:63
NTSTATUS NTAPI PciPdoIrpSurpriseRemoval(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:502
NTSTATUS NTAPI PciPdoIrpQueryInterface(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:304
NTSTATUS NTAPI PciPdoIrpQueryResourceRequirements(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:383
LONG PciPdoSequenceNumber
Definition: pdo.c:18
NTSTATUS NTAPI PciPdoIrpQueryDeviceText(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:399
NTSTATUS NTAPI PciPdoIrpCancelRemoveDevice(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:248
NTSTATUS NTAPI PciPdoIrpQueryDeviceState(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:474
NTSTATUS NTAPI PciPdoIrpReadConfig(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:446
NTSTATUS NTAPI PciPdoIrpQueryLegacyBusInformation(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:516
NTSTATUS NTAPI PciPdoIrpRemoveDevice(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:234
NTSTATUS NTAPI PciPdoIrpQueryId(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:416
NTSTATUS NTAPI PciPdoIrpQueryPower(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:107
NTSTATUS NTAPI PciPdoIrpQueryDeviceRelations(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:318
NTSTATUS NTAPI PciPdoIrpWriteConfig(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:460
PCI_MN_DISPATCH_TABLE PciPdoDispatchPnpTable[]
Definition: pdo.c:33
NTSTATUS NTAPI PciPdoIrpQueryCapabilities(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:352
NTSTATUS NTAPI PciPdoIrpStartDevice(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:121
NTSTATUS NTAPI PciPdoIrpQueryRemoveDevice(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:220
NTSTATUS NTAPI PciPdoIrpDeviceUsageNotification(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:488
NTSTATUS NTAPI PciPdoIrpQueryStopDevice(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:276
NTSTATUS NTAPI PciPdoIrpQueryResources(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:368
NTSTATUS NTAPI PciPdoWaitWake(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:79
NTSTATUS NTAPI PciPdoIrpQueryBusInformation(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_PDO_EXTENSION DeviceExtension)
Definition: pdo.c:430
_In_ PIRP Irp
Definition: csq.h:116
#define STATUS_NOT_SUPPORTED
Definition: d3dkmdt.h:48
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define swprintf
Definition: precomp.h:40
NTSTATUS NTAPI PciIrpNotSupported(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_FDO_EXTENSION DeviceExtension)
Definition: dispatch.c:261
NTSTATUS NTAPI PciIrpInvalidDeviceRequest(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PPCI_FDO_EXTENSION DeviceExtension)
Definition: dispatch.c:277
NTSTATUS NTAPI PciSetResources(IN PPCI_PDO_EXTENSION PdoExtension, IN BOOLEAN DoReset, IN BOOLEAN SomethingSomethingDarkSide)
Definition: enum.c:2155
NTSTATUS NTAPI PciQueryEjectionRelations(IN PPCI_PDO_EXTENSION PdoExtension, IN OUT PDEVICE_RELATIONS *pDeviceRelations)
Definition: enum.c:538
NTSTATUS NTAPI PciQueryRequirements(IN PPCI_PDO_EXTENSION PdoExtension, IN OUT PIO_RESOURCE_REQUIREMENTS_LIST *RequirementsList)
Definition: enum.c:583
NTSTATUS NTAPI PciQueryTargetDeviceRelations(IN PPCI_PDO_EXTENSION PdoExtension, IN OUT PDEVICE_RELATIONS *pDeviceRelations)
Definition: enum.c:511
BOOLEAN NTAPI PciComputeNewCurrentSettings(IN PPCI_PDO_EXTENSION PdoExtension, IN PCM_RESOURCE_LIST ResourceList)
Definition: enum.c:55
NTSTATUS NTAPI PciQueryResources(IN PPCI_PDO_EXTENSION PdoExtension, OUT PCM_RESOURCE_LIST *Buffer)
Definition: enum.c:354
VOID NTAPI PciInsertEntryAtTail(IN PSINGLE_LIST_ENTRY ListHead, IN PPCI_FDO_EXTENSION DeviceExtension, IN PKEVENT Lock)
Definition: utils.c:400
@ PciStarted
Definition: pci.h:130
NTSTATUS NTAPI PciQueryId(IN PPCI_PDO_EXTENSION DeviceExtension, IN BUS_QUERY_ID_TYPE QueryType, OUT PWCHAR *Buffer)
Definition: id.c:200
struct _PCI_PDO_EXTENSION * PPCI_PDO_EXTENSION
NTSTATUS NTAPI PciCancelStateTransition(IN PPCI_FDO_EXTENSION DeviceExtension, IN PCI_STATE NewState)
Definition: state.c:145
NTSTATUS NTAPI PciQueryCapabilities(IN PPCI_PDO_EXTENSION PdoExtension, IN OUT PDEVICE_CAPABILITIES DeviceCapability)
Definition: utils.c:1727
NTSTATUS NTAPI PciBeginStateTransition(IN PPCI_FDO_EXTENSION DeviceExtension, IN PCI_STATE NewState)
Definition: state.c:97
@ IRP_COMPLETE
Definition: pci.h:143
@ IRP_DISPATCH
Definition: pci.h:146
NTSTATUS NTAPI PciQueryDeviceText(IN PPCI_PDO_EXTENSION PdoExtension, IN DEVICE_TEXT_TYPE QueryType, IN ULONG Locale, OUT PWCHAR *Buffer)
Definition: id.c:394
NTSTATUS NTAPI PciQueryBusInformation(IN PPCI_PDO_EXTENSION PdoExtension, IN PPNP_BUS_INFORMATION *Buffer)
Definition: utils.c:1316
NTSTATUS(NTAPI * PCI_DISPATCH_FUNCTION)(IN PIRP Irp, IN PIO_STACK_LOCATION IoStackLocation, IN PVOID DeviceExtension)
Definition: pci.h:325
NTSTATUS NTAPI PciSetPowerManagedDevicePowerState(IN PPCI_PDO_EXTENSION DeviceExtension, IN DEVICE_POWER_STATE DeviceState, IN BOOLEAN IrpSet)
Definition: power.c:121
VOID NTAPI PciCommitStateTransition(IN PPCI_FDO_EXTENSION DeviceExtension, IN PCI_STATE NewState)
Definition: state.c:181
VOID NTAPI PciInitializeState(IN PPCI_FDO_EXTENSION DeviceExtension)
Definition: state.c:88
@ PciPdoExtensionType
Definition: pci.h:94
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57
@ PdoExtension
Definition: precomp.h:49
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
Status
Definition: gdiplustypes.h:25
_Outptr_ PUSB_DEVICE_HANDLE _In_ PUSB_DEVICE_HANDLE _In_ USHORT _In_ PUSB_PORT_PATH _Out_ PUSB_CD_ERROR_INFORMATION _In_ USHORT _In_ PDEVICE_OBJECT PdoDeviceObject
Definition: hubbusif.h:95
#define C_ASSERT(e)
Definition: intsafe.h:73
#define ASSERT(a)
Definition: mode.c:44
__in UCHAR __in POWER_STATE __in_opt PVOID __in PIO_STATUS_BLOCK IoStatus
Definition: mxum.h:159
static BOOL StartDevice(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DevInfoData OPTIONAL, IN BOOL bEnable, IN DWORD HardwareProfile OPTIONAL, OUT BOOL *bNeedReboot OPTIONAL)
Definition: wizard.c:173
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
@ SynchronizationEvent
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
POWER_STATE NTAPI PoSetPowerState(IN PDEVICE_OBJECT DeviceObject, IN POWER_STATE_TYPE Type, IN POWER_STATE State)
Definition: power.c:729
@ DevicePowerState
Definition: ntpoapi.h:63
@ PowerDeviceD0
Definition: ntpoapi.h:49
#define STATUS_DEVICE_POWER_FAILURE
Definition: ntstatus.h:394
#define L(x)
Definition: ntvdm.h:50
long LONG
Definition: pedump.c:60
#define FILE_DEVICE_BUS_EXTENDER
Definition: winioctl.h:87
#define STATUS_SUCCESS
Definition: shellext.h:65
Definition: ntbasedef.h:628
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
uint16_t * PWCHAR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_In_ WDFDEVICE _Out_ PWDF_DEVICE_STATE DeviceState
Definition: wdfdevice.h:1999
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ WDF_DEVICE_POWER_STATE PowerState
Definition: wdfdevice.h:3034
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Definition: wdfdevice.h:3275
_Must_inspect_result_ _In_ WDFQUEUE _In_opt_ WDFREQUEST _In_opt_ WDFFILEOBJECT _Inout_opt_ PWDF_REQUEST_PARAMETERS Parameters
Definition: wdfio.h:869
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550
@ EjectionRelations
Definition: iotypes.h:2153
@ TargetDeviceRelation
Definition: iotypes.h:2156
#define PCI_ENABLE_BUS_MASTER
Definition: iotypes.h:3618
#define PCI_ENABLE_IO_SPACE
Definition: iotypes.h:3616
#define PCI_ENABLE_MEMORY_SPACE
Definition: iotypes.h:3617
#define PCI_CLASS_PRE_20
Definition: iotypes.h:4103
#define PCI_SUBCLASS_VID_VGA_CTLR
Definition: iotypes.h:4144
#define PCI_SUBCLASS_PRE_20_VGA
Definition: iotypes.h:4125
#define PCI_CLASS_DISPLAY_CTLR
Definition: iotypes.h:4106
#define IRP_MN_QUERY_POWER
#define IRP_MN_QUERY_LEGACY_BUS_INFORMATION
Definition: iotypes.h:4427
__wchar_t WCHAR
Definition: xmlstorage.h:180