ReactOS 0.4.15-dev-8433-ge87f1d5
halpnpdd.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS HAL
3 * LICENSE: BSD - See COPYING.ARM in the top level directory
4 * FILE: hal/halx86/legacy/halpnpdd.c
5 * PURPOSE: HAL Plug and Play Device Driver
6 * PROGRAMMERS: ReactOS Portable Systems Group
7 */
8
9/* INCLUDES *******************************************************************/
10
11#include <hal.h>
12#define NDEBUG
13#include <debug.h>
14
15typedef enum _EXTENSION_TYPE
16{
20
21typedef enum _PDO_TYPE
22{
23 AcpiPdo = 0x80,
24 WdPdo
26
27typedef struct _FDO_EXTENSION
28{
35
36typedef struct _PDO_EXTENSION
37{
39 struct _PDO_EXTENSION* Next;
46
47/* GLOBALS ********************************************************************/
48
50
51/* PRIVATE FUNCTIONS **********************************************************/
52
57{
61 PDEVICE_OBJECT DeviceObject, AttachedDevice;
63// PDESCRIPTION_HEADER Wdrt;
64
65 DPRINT("HAL: PnP Driver ADD!\n");
66
67 /* Create the FDO */
69 sizeof(FDO_EXTENSION),
70 NULL,
72 0,
73 FALSE,
75 if (!NT_SUCCESS(Status))
76 {
77 /* Should not happen */
79 return Status;
80 }
81
82 /* Setup the FDO extension */
83 FdoExtension = DeviceObject->DeviceExtension;
84 FdoExtension->ExtensionType = FdoExtensionType;
85 FdoExtension->PhysicalDeviceObject = TargetDevice;
86 FdoExtension->FunctionalDeviceObject = DeviceObject;
87 FdoExtension->ChildPdoList = NULL;
88
89 /* FDO is done initializing */
90 DeviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
91
92 /* Attach to the physical device object (the bus) */
94 if (!AttachedDevice)
95 {
96 /* Failed, undo everything */
99 }
100
101 /* Save the attachment */
102 FdoExtension->AttachedDeviceObject = AttachedDevice;
103
104 /* Create the PDO */
106 sizeof(PDO_EXTENSION),
107 NULL,
110 FALSE,
112 if (!NT_SUCCESS(Status))
113 {
114 /* Fail */
115 DPRINT1("HAL: Could not create ACPI device object status=0x%08x\n", Status);
116 return Status;
117 }
118
119 /* Setup the PDO device extension */
120 PdoExtension = PdoDeviceObject->DeviceExtension;
121 PdoExtension->ExtensionType = PdoExtensionType;
122 PdoExtension->PhysicalDeviceObject = PdoDeviceObject;
123 PdoExtension->ParentFdoExtension = FdoExtension;
124 PdoExtension->PdoType = AcpiPdo;
125
126 /* Add the PDO to the head of the list */
127 PdoExtension->Next = FdoExtension->ChildPdoList;
128 FdoExtension->ChildPdoList = PdoExtension;
129
130 /* Initialization is finished */
131 PdoDeviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
132
133 /* Return status */
134 DPRINT("Device added %lx\n", Status);
135 return Status;
136}
137
139NTAPI
144 IN ULONG InterfaceBufferSize,
147{
148 DPRINT1("HalpQueryInterface({%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}) is UNIMPLEMENTED\n",
149 InterfaceType->Data1, InterfaceType->Data2, InterfaceType->Data3,
150 InterfaceType->Data4[0], InterfaceType->Data4[1],
151 InterfaceType->Data4[2], InterfaceType->Data4[3],
152 InterfaceType->Data4[4], InterfaceType->Data4[5],
153 InterfaceType->Data4[6], InterfaceType->Data4[7]);
155}
156
158NTAPI
161 OUT PDEVICE_RELATIONS* DeviceRelations)
162{
166 PDEVICE_RELATIONS PdoRelations, FdoRelations;
167 PDEVICE_OBJECT* ObjectEntry;
168 ULONG i = 0, PdoCount = 0;
169
170 /* Get FDO device extension and PDO count */
171 FdoExtension = DeviceObject->DeviceExtension;
172 ExtensionType = FdoExtension->ExtensionType;
173
174 /* What do they want? */
176 {
177 /* This better be an FDO */
179 {
180 /* Count how many PDOs we have */
181 PdoExtension = FdoExtension->ChildPdoList;
182 while (PdoExtension)
183 {
184 /* Next one */
186 PdoCount++;
187 }
188
189 /* Add the PDOs that already exist in the device relations */
190 if (*DeviceRelations)
191 {
192 PdoCount += (*DeviceRelations)->Count;
193 }
194
195 /* Allocate our structure */
196 FdoRelations = ExAllocatePoolWithTag(PagedPool,
198 Objects) +
199 sizeof(PDEVICE_OBJECT) * PdoCount,
200 TAG_HAL);
201 if (!FdoRelations) return STATUS_INSUFFICIENT_RESOURCES;
202
203 /* Save our count */
204 FdoRelations->Count = PdoCount;
205
206 /* Query existing relations */
207 ObjectEntry = FdoRelations->Objects;
208 if (*DeviceRelations)
209 {
210 /* Check if there were any */
211 if ((*DeviceRelations)->Count)
212 {
213 /* Loop them all */
214 do
215 {
216 /* Copy into our structure */
217 *ObjectEntry++ = (*DeviceRelations)->Objects[i];
218 }
219 while (++i < (*DeviceRelations)->Count);
220 }
221
222 /* Free existing structure */
223 ExFreePool(*DeviceRelations);
224 }
225
226 /* Now check if we have a PDO list */
227 PdoExtension = FdoExtension->ChildPdoList;
228 if (PdoExtension)
229 {
230 /* Loop the PDOs */
231 do
232 {
233 /* Save our own PDO and reference it */
234 *ObjectEntry++ = PdoExtension->PhysicalDeviceObject;
235 ObReferenceObject(PdoExtension->PhysicalDeviceObject);
236
237 /* Go to our next PDO */
239 }
240 while (PdoExtension);
241 }
242
243 /* Return the new structure */
244 *DeviceRelations = FdoRelations;
245 return STATUS_SUCCESS;
246 }
247 }
248 else
249 {
250 /* The only other thing we support is a target relation for the PDO */
253 {
254 /* Only one entry */
255 PdoRelations = ExAllocatePoolWithTag(PagedPool,
256 sizeof(DEVICE_RELATIONS),
257 TAG_HAL);
258 if (!PdoRelations) return STATUS_INSUFFICIENT_RESOURCES;
259
260 /* Fill it out and reference us */
261 PdoRelations->Count = 1;
262 PdoRelations->Objects[0] = DeviceObject;
264
265 /* Return it */
266 *DeviceRelations = PdoRelations;
267 return STATUS_SUCCESS;
268 }
269 }
270
271 /* We don't support anything else */
273}
274
276NTAPI
279{
280 //PPDO_EXTENSION PdoExtension;
282 PAGED_CODE();
283
284 /* Get the extension and check for valid version */
285 //PdoExtension = DeviceObject->DeviceExtension;
286 ASSERT(Capabilities->Version == 1);
287 if (Capabilities->Version == 1)
288 {
289 /* Can't lock or eject us */
290 Capabilities->LockSupported = FALSE;
291 Capabilities->EjectSupported = FALSE;
292
293 /* Can't remove or dock us */
294 Capabilities->Removable = FALSE;
295 Capabilities->DockDevice = FALSE;
296
297 /* Can't access us raw */
298 Capabilities->RawDeviceOK = FALSE;
299
300 /* We have a unique ID, and don't bother the user */
301 Capabilities->UniqueID = TRUE;
302 Capabilities->SilentInstall = TRUE;
303
304 /* Fill out the address */
307
308 /* Fill out latencies */
309 Capabilities->D1Latency = 0;
310 Capabilities->D2Latency = 0;
311 Capabilities->D3Latency = 0;
312
313 /* Fill out supported device states */
318
319 /* Done */
321 }
322 else
323 {
324 /* Fail */
326 }
327
328 /* Return status */
329 return Status;
330}
331
333NTAPI
336{
337 PPDO_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
340// PIO_RESOURCE_REQUIREMENTS_LIST RequirementsList;
341// PIO_RESOURCE_DESCRIPTOR Descriptor;
342// PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDesc;
343// ULONG i;
344 PAGED_CODE();
345
346 /* Only the ACPI PDO has requirements */
347 if (DeviceExtension->PdoType == AcpiPdo)
348 {
349#if 0
350 /* Query ACPI requirements */
352 if (!NT_SUCCESS(Status)) return Status;
353
354 ASSERT(RequirementsList->AlternativeLists == 1);
355#endif
356
357 /* Allocate the resourcel ist */
359 sizeof(CM_RESOURCE_LIST),
360 TAG_HAL);
361 if (!ResourceList )
362 {
363 /* Fail, no memory */
365// ExFreePoolWithTag(RequirementsList, TAG_HAL);
366 return Status;
367 }
368
369 /* Initialize it */
371 ResourceList->Count = 1;
372
373 /* Setup the list fields */
374 ResourceList->List[0].BusNumber = 0;
375 ResourceList->List[0].InterfaceType = PCIBus;
376 ResourceList->List[0].PartialResourceList.Version = 1;
377 ResourceList->List[0].PartialResourceList.Revision = 1;
378 ResourceList->List[0].PartialResourceList.Count = 0;
379
380 /* Setup the first descriptor */
381 //PartialDesc = ResourceList->List[0].PartialResourceList.PartialDescriptors;
382
383 /* Find the requirement descriptor for the SCI */
384#if 0
385 for (i = 0; i < RequirementsList->List[0].Count; i++)
386 {
387 /* Get this descriptor */
388 Descriptor = &RequirementsList->List[0].Descriptors[i];
390 {
391 /* Copy requirements descriptor into resource descriptor */
392 PartialDesc->Type = CmResourceTypeInterrupt;
393 PartialDesc->ShareDisposition = Descriptor->ShareDisposition;
394 PartialDesc->Flags = Descriptor->Flags;
395 ASSERT(Descriptor->u.Interrupt.MinimumVector ==
396 Descriptor->u.Interrupt.MaximumVector);
397 PartialDesc->u.Interrupt.Vector = Descriptor->u.Interrupt.MinimumVector;
398 PartialDesc->u.Interrupt.Level = Descriptor->u.Interrupt.MinimumVector;
399 PartialDesc->u.Interrupt.Affinity = 0xFFFFFFFF;
400
401 ResourceList->List[0].PartialResourceList.Count++;
402
403 break;
404 }
405 }
406#endif
407
408 /* Return resources and success */
410
411// ExFreePoolWithTag(RequirementsList, TAG_HAL);
412
413 return STATUS_SUCCESS;
414 }
415 else if (DeviceExtension->PdoType == WdPdo)
416 {
417 /* Watchdog doesn't */
419 }
420 else
421 {
422 /* This shouldn't happen */
423 return STATUS_UNSUCCESSFUL;
424 }
425}
426
428NTAPI
431{
432 PPDO_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
433 PAGED_CODE();
434
435 /* Only the ACPI PDO has requirements */
436 if (DeviceExtension->PdoType == AcpiPdo)
437 {
438 /* Query ACPI requirements */
439// return HalpQueryAcpiResourceRequirements(Requirements);
440 return STATUS_SUCCESS;
441 }
442 else if (DeviceExtension->PdoType == WdPdo)
443 {
444 /* Watchdog doesn't */
446 }
447 else
448 {
449 /* This shouldn't happen */
450 return STATUS_UNSUCCESSFUL;
451 }
452}
453
455NTAPI
458 OUT PUSHORT *BusQueryId)
459{
462 PWCHAR CurrentId;
463 WCHAR Id[100];
465 ULONG Length = 0;
467
468 /* Get the PDO type */
469 PdoExtension = DeviceObject->DeviceExtension;
470 PdoType = PdoExtension->PdoType;
471
472 /* What kind of ID is being requested? */
473 DPRINT("ID: %d\n", IdType);
474 switch (IdType)
475 {
476 case BusQueryDeviceID:
478
479 /* What kind of PDO is this? */
480 if (PdoType == AcpiPdo)
481 {
482 /* ACPI ID */
483 CurrentId = L"PCI_HAL\\PNP0A03";
484 RtlCopyMemory(Id, CurrentId, (wcslen(CurrentId) * sizeof(WCHAR)) + sizeof(UNICODE_NULL));
485 Length += (wcslen(CurrentId) * sizeof(WCHAR)) + sizeof(UNICODE_NULL);
486
487 CurrentId = L"*PNP0A03";
488 RtlCopyMemory(&Id[wcslen(Id) + 1], CurrentId, (wcslen(CurrentId) * sizeof(WCHAR)) + sizeof(UNICODE_NULL));
489 Length += (wcslen(CurrentId) * sizeof(WCHAR)) + sizeof(UNICODE_NULL);
490 }
491#if 0
492 else if (PdoType == WdPdo)
493 {
494 /* WatchDog ID */
495 CurrentId = L"ACPI_HAL\\PNP0C18";
496 RtlCopyMemory(Id, CurrentId, (wcslen(CurrentId) * sizeof(WCHAR)) + sizeof(UNICODE_NULL));
497 Length += (wcslen(CurrentId) * sizeof(WCHAR)) + sizeof(UNICODE_NULL);
498
499 CurrentId = L"*PNP0C18";
500 RtlCopyMemory(&Id[wcslen(Id) + 1], CurrentId, (wcslen(CurrentId) * sizeof(WCHAR)) + sizeof(UNICODE_NULL));
501 Length += (wcslen(CurrentId) * sizeof(WCHAR)) + sizeof(UNICODE_NULL);
502 }
503#endif
504 else
505 {
506 /* Unknown */
508 }
509 break;
510
512
513 /* Instance ID */
514 CurrentId = L"0";
515 RtlCopyMemory(Id, CurrentId, (wcslen(CurrentId) * sizeof(WCHAR)) + sizeof(UNICODE_NULL));
516 Length += (wcslen(CurrentId) * sizeof(WCHAR)) + sizeof(UNICODE_NULL);
517 break;
518
520 default:
521
522 /* We don't support anything else */
524 }
525
526 /* Allocate the buffer */
528 Length + sizeof(UNICODE_NULL),
529 TAG_HAL);
530 if (Buffer)
531 {
532 /* Copy the string and null-terminate it */
534 Buffer[Length / sizeof(WCHAR)] = UNICODE_NULL;
535
536 /* Return string */
537 *BusQueryId = Buffer;
539 DPRINT("Returning: %S\n", *BusQueryId);
540 }
541 else
542 {
543 /* Fail */
545 }
546
547 /* Return status */
548 return Status;
549}
550
552NTAPI
555 OUT PUSHORT *BusQueryId)
556{
559 PWCHAR Id;
561
562 /* What kind of ID is being requested? */
563 DPRINT("ID: %d\n", IdType);
564 switch (IdType)
565 {
566 case BusQueryDeviceID:
568
569 /* This is our hardware ID */
571 break;
572
574
575 /* And our instance ID */
576 Id = L"0";
577 break;
578
579 default:
580
581 /* We don't support anything else */
583 }
584
585 /* Calculate the length */
586 Length = (wcslen(Id) * sizeof(WCHAR)) + sizeof(UNICODE_NULL);
587
588 /* Allocate the buffer */
590 Length + sizeof(UNICODE_NULL),
591 TAG_HAL);
592 if (Buffer)
593 {
594 /* Copy the string and null-terminate it */
596 Buffer[Length / sizeof(WCHAR)] = UNICODE_NULL;
597
598 /* Return string */
599 *BusQueryId = Buffer;
601 DPRINT("Returning: %S\n", *BusQueryId);
602 }
603 else
604 {
605 /* Fail */
607 }
608
609 /* Return status */
610 return Status;
611}
612
614NTAPI
616 IN PIRP Irp)
617{
618 PIO_STACK_LOCATION IoStackLocation;
619 //PPDO_EXTENSION PdoExtension;
622 UCHAR Minor;
623
624 /* Get the device extension and stack location */
625 FdoExtension = DeviceObject->DeviceExtension;
626 IoStackLocation = IoGetCurrentIrpStackLocation(Irp);
627 Minor = IoStackLocation->MinorFunction;
628
629 /* FDO? */
630 if (FdoExtension->ExtensionType == FdoExtensionType)
631 {
632 /* Query the IRP type */
633 switch (Minor)
634 {
636
637 /* Call the worker */
638 DPRINT("Querying device relations for FDO\n");
640 IoStackLocation->Parameters.QueryDeviceRelations.Type,
641 (PVOID)&Irp->IoStatus.Information);
642 break;
643
645
646 /* Call the worker */
647 DPRINT("Querying interface for FDO\n");
649 IoStackLocation->Parameters.QueryInterface.InterfaceType,
650 IoStackLocation->Parameters.QueryInterface.Size,
651 IoStackLocation->Parameters.QueryInterface.InterfaceSpecificData,
652 IoStackLocation->Parameters.QueryInterface.Version,
653 IoStackLocation->Parameters.QueryInterface.Interface,
654 (PVOID)&Irp->IoStatus.Information);
655 break;
656
657 case IRP_MN_QUERY_ID:
658
659 /* Call the worker */
660 DPRINT("Querying ID for FDO\n");
662 IoStackLocation->Parameters.QueryId.IdType,
663 (PVOID)&Irp->IoStatus.Information);
664 break;
665
667
668 /* Call the worker */
669 DPRINT("Querying the capabilities for the FDO\n");
671 IoStackLocation->Parameters.DeviceCapabilities.Capabilities);
672 break;
673
674 default:
675
676 DPRINT("Other IRP: %lx\n", Minor);
678 break;
679 }
680
681 /* What happpened? */
683 {
684 /* Set the IRP status, unless this isn't understood */
686 {
687 Irp->IoStatus.Status = Status;
688 }
689
690 /* Pass it on */
692 return IoCallDriver(FdoExtension->AttachedDeviceObject, Irp);
693 }
694
695 /* Otherwise, we failed, so set the status and complete the request */
696 DPRINT1("IRP failed with status: %lx\n", Status);
697 Irp->IoStatus.Status = Status;
699 return Status;
700 }
701 else
702 {
703 /* This is a PDO instead */
704 ASSERT(FdoExtension->ExtensionType == PdoExtensionType);
705 //PdoExtension = (PPDO_EXTENSION)FdoExtension;
706
707 /* Query the IRP type */
709 switch (Minor)
710 {
712
713 /* We only care about a PCI PDO */
714 DPRINT("Start device received\n");
715 /* Complete the IRP normally */
716 break;
717
719
720 /* Check if this is a PCI device */
721 DPRINT("Remove device received\n");
722
723 /* We're done */
725 break;
726
728
729 /* Inherit whatever status we had */
730 DPRINT("Surprise removal IRP\n");
731 Status = Irp->IoStatus.Status;
732 break;
733
735
736 /* Query the device relations */
737 DPRINT("Querying PDO relations\n");
739 IoStackLocation->Parameters.QueryDeviceRelations.Type,
740 (PVOID)&Irp->IoStatus.Information);
741 break;
742
744
745 /* Call the worker */
746 DPRINT("Querying interface for PDO\n");
748 IoStackLocation->Parameters.QueryInterface.InterfaceType,
749 IoStackLocation->Parameters.QueryInterface.Size,
750 IoStackLocation->Parameters.QueryInterface.InterfaceSpecificData,
751 IoStackLocation->Parameters.QueryInterface.Version,
752 IoStackLocation->Parameters.QueryInterface.Interface,
753 (PVOID)&Irp->IoStatus.Information);
754 break;
755
757
758 /* Call the worker */
759 DPRINT("Querying the capabilities for the PDO\n");
761 IoStackLocation->Parameters.DeviceCapabilities.Capabilities);
762 break;
763
765
766 /* Call the worker */
767 DPRINT("Querying the resources for the PDO\n");
768 Status = HalpQueryResources(DeviceObject, (PVOID)&Irp->IoStatus.Information);
769 break;
770
772
773 /* Call the worker */
774 DPRINT("Querying the resource requirements for the PDO\n");
776 (PVOID)&Irp->IoStatus.Information);
777 break;
778
779 case IRP_MN_QUERY_ID:
780
781 /* Call the worker */
782 DPRINT("Query the ID for the PDO\n");
784 IoStackLocation->Parameters.QueryId.IdType,
785 (PVOID)&Irp->IoStatus.Information);
786 break;
787
789
790 /* Inherit whatever status we had */
791 DPRINT("Query text for the PDO\n");
792 Status = Irp->IoStatus.Status;
793 break;
794
796
797 /* Inherit whatever status we had */
798 DPRINT("Filter resource requirements for the PDO\n");
799 Status = Irp->IoStatus.Status;
800 break;
801
803
804 /* Inherit whatever status we had */
805 DPRINT("Query device state for the PDO\n");
806 Status = Irp->IoStatus.Status;
807 break;
808
810
811 /* Inherit whatever status we had */
812 DPRINT("Query bus information for the PDO\n");
813 Status = Irp->IoStatus.Status;
814 break;
815
816 default:
817
818 /* We don't handle anything else, so inherit the old state */
819 DPRINT1("Illegal IRP: %lx\n", Minor);
820 Status = Irp->IoStatus.Status;
821 break;
822 }
823
824 /* If it's not supported, inherit the old status */
825 if (Status == STATUS_NOT_SUPPORTED) Status = Irp->IoStatus.Status;
826
827 /* Complete the IRP */
828 DPRINT("IRP completed with status: %lx\n", Status);
829 Irp->IoStatus.Status = Status;
831 return Status;
832 }
833}
834
836NTAPI
838 IN PIRP Irp)
839{
840 UNIMPLEMENTED_DBGBREAK("HAL: PnP Driver WMI!\n");
841 return STATUS_SUCCESS;
842}
843
845NTAPI
847 IN PIRP Irp)
848{
850
851 DPRINT1("HAL: PnP Driver Power!\n");
852 FdoExtension = DeviceObject->DeviceExtension;
853 if (FdoExtension->ExtensionType == FdoExtensionType)
854 {
857 return PoCallDriver(FdoExtension->AttachedDeviceObject, Irp);
858 }
859 else
860 {
862 Irp->IoStatus.Status = STATUS_SUCCESS;
864 return STATUS_SUCCESS;
865 }
866}
867
869NTAPI
872{
875
876 DPRINT("HAL: PnP Driver ENTRY!\n");
877
878 /* This is us */
880
881 /* Set up add device */
883
884 /* Set up the callouts */
885 DriverObject->MajorFunction[IRP_MJ_PNP] = HalpDispatchPnp;
888
889 /* Create the PDO and tell the PnP manager about us*/
892 -1,
893 -1,
894 NULL,
895 NULL,
896 FALSE,
897 &TargetDevice);
898 if (!NT_SUCCESS(Status))
899 return Status;
900
901 TargetDevice->Flags &= ~DO_DEVICE_INITIALIZING;
902
903 /* Set up the device stack */
905 if (!NT_SUCCESS(Status))
906 {
908 return Status;
909 }
910
911 /* Return to kernel */
912 return Status;
913}
914
916NTAPI
918{
920 UNICODE_STRING DriverString;
921 PAGED_CODE();
922
923 /* Create the driver */
924 RtlInitUnicodeString(&DriverString, L"\\Driver\\PCI_HAL");
925 Status = IoCreateDriver(&DriverString, HalpDriverEntry);
926
927 /* Return status */
928 return Status;
929}
930
931/* EOF */
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define PAGED_CODE()
DWORD Id
NTSTATUS NTAPI HalpQueryResources(IN PDEVICE_OBJECT DeviceObject, OUT PCM_RESOURCE_LIST *Resources)
Definition: halpnpdd.c:357
enum _PDO_TYPE PDO_TYPE
struct _FDO_EXTENSION * PFDO_EXTENSION
_EXTENSION_TYPE
Definition: halpnpdd.c:20
@ PdoExtensionType
Definition: halpnpdd.c:21
@ FdoExtensionType
Definition: halpnpdd.c:22
NTSTATUS NTAPI HalpQueryResourceRequirements(IN PDEVICE_OBJECT DeviceObject, OUT PIO_RESOURCE_REQUIREMENTS_LIST *Requirements)
Definition: halpnpdd.c:448
NTSTATUS NTAPI HalpQueryInterface(IN PDEVICE_OBJECT DeviceObject, IN CONST GUID *InterfaceType, IN USHORT Version, IN PVOID InterfaceSpecificData, IN ULONG InterfaceBufferSize, IN PINTERFACE Interface, OUT PULONG Length)
Definition: halpnpdd.c:152
NTSTATUS NTAPI HalpQueryIdPdo(IN PDEVICE_OBJECT DeviceObject, IN BUS_QUERY_ID_TYPE IdType, OUT PUSHORT *BusQueryId)
Definition: halpnpdd.c:474
NTSTATUS NTAPI HalpDispatchPower(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: halpnpdd.c:835
NTSTATUS NTAPI HalpDriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
Definition: halpnpdd.c:859
NTSTATUS NTAPI HalpDispatchWmi(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: halpnpdd.c:826
NTSTATUS NTAPI HalpQueryIdFdo(IN PDEVICE_OBJECT DeviceObject, IN BUS_QUERY_ID_TYPE IdType, OUT PUSHORT *BusQueryId)
Definition: halpnpdd.c:570
NTSTATUS NTAPI HalpQueryCapabilities(IN PDEVICE_OBJECT DeviceObject, OUT PDEVICE_CAPABILITIES Capabilities)
Definition: halpnpdd.c:300
enum _EXTENSION_TYPE EXTENSION_TYPE
NTSTATUS NTAPI HalpAddDevice(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT TargetDevice)
Definition: halpnpdd.c:59
struct _PDO_EXTENSION PDO_EXTENSION
NTSTATUS NTAPI HaliInitPnpDriver(VOID)
Definition: halpnpdd.c:906
struct _FDO_EXTENSION FDO_EXTENSION
NTSTATUS NTAPI HalpQueryDeviceRelations(IN PDEVICE_OBJECT DeviceObject, IN DEVICE_RELATION_TYPE RelationType, OUT PDEVICE_RELATIONS *DeviceRelations)
Definition: halpnpdd.c:182
PDRIVER_OBJECT HalpDriverObject
Definition: halpnpdd.c:53
_PDO_TYPE
Definition: halpnpdd.c:26
@ AcpiPdo
Definition: halpnpdd.c:27
@ WdPdo
Definition: halpnpdd.c:28
struct _PDO_EXTENSION * PPDO_EXTENSION
NTSTATUS NTAPI HalpDispatchPnp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: halpnpdd.c:632
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
Definition: bufpool.h:45
_In_ BUS_QUERY_ID_TYPE IdType
Definition: classpnp.h:374
_In_ PIRP Irp
Definition: csq.h:116
#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 UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57
EXTENSION_TYPE
Definition: precomp.h:45
@ PdoExtension
Definition: precomp.h:49
@ FdoExtension
Definition: precomp.h:48
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
#define PagedPool
Definition: env_spec_w32.h:308
Status
Definition: gdiplustypes.h:25
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 TAG_HAL
Definition: hal.h:61
PWCHAR HalHardwareIdString
Definition: halacpi.c:44
NTSTATUS NTAPI HalpQueryAcpiResourceRequirements(OUT PIO_RESOURCE_REQUIREMENTS_LIST *Requirements)
Definition: halacpi.c:1016
_Must_inspect_result_ typedef _Out_ PHIDP_CAPS Capabilities
Definition: hidclass.h:103
_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
@ InterfaceTypeUndefined
Definition: hwresource.cpp:136
@ PCIBus
Definition: hwresource.cpp:142
#define CmResourceTypeInterrupt
Definition: hwresource.cpp:124
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
NTSYSAPI void WINAPI DbgBreakPoint(void)
#define ASSERT(a)
Definition: mode.c:44
#define FILE_AUTOGENERATED_DEVICE_NAME
Definition: iotypes.h:138
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define UNICODE_NULL
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define IRP_MN_SURPRISE_REMOVAL
Definition: ntifs_ex.h:408
#define IoSkipCurrentIrpStackLocation(Irp)
Definition: ntifs_ex.h:421
PDEVICE_OBJECT NTAPI IoAttachDeviceToDeviceStack(IN PDEVICE_OBJECT SourceDevice, IN PDEVICE_OBJECT TargetDevice)
Definition: device.c:966
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
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1251
NTSTATUS NTAPI IoCreateDriver(_In_opt_ PUNICODE_STRING DriverName, _In_ PDRIVER_INITIALIZE InitializationFunction)
Definition: driver.c:1576
#define IoCompleteRequest
Definition: irp.c:1240
#define IoCallDriver
Definition: irp.c:1225
VOID NTAPI PoStartNextPowerIrp(IN PIRP Irp)
Definition: power.c:758
@ PowerSystemSleeping3
Definition: ntpoapi.h:39
@ PowerSystemShutdown
Definition: ntpoapi.h:41
@ PowerSystemWorking
Definition: ntpoapi.h:36
@ PowerSystemHibernate
Definition: ntpoapi.h:40
@ PowerDeviceD0
Definition: ntpoapi.h:49
@ PowerDeviceD3
Definition: ntpoapi.h:52
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:423
#define L(x)
Definition: ntvdm.h:50
#define CONST
Definition: pedump.c:81
long LONG
Definition: pedump.c:60
unsigned short USHORT
Definition: pedump.c:61
NTSTATUS NTAPI IoReportDetectedDevice(_In_ PDRIVER_OBJECT DriverObject, _In_ INTERFACE_TYPE LegacyBusType, _In_ ULONG BusNumber, _In_ ULONG SlotNumber, _In_opt_ PCM_RESOURCE_LIST ResourceList, _In_opt_ PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirements, _In_ BOOLEAN ResourceAssigned, _Inout_ PDEVICE_OBJECT *DeviceObject)
Definition: pnpreport.c:148
#define FILE_DEVICE_BUS_EXTENDER
Definition: winioctl.h:87
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:73
PDEVICE_OBJECT Objects[1]
Definition: iotypes.h:2163
PDRIVER_ADD_DEVICE AddDevice
Definition: iotypes.h:2220
PDRIVER_EXTENSION DriverExtension
Definition: iotypes.h:2282
PDEVICE_OBJECT FunctionalDeviceObject
Definition: halpnpdd.c:36
PDEVICE_OBJECT AttachedDeviceObject
Definition: halpnpdd.c:37
EXTENSION_TYPE ExtensionType
Definition: halpnpdd.c:33
struct _PDO_EXTENSION * ChildPdoList
Definition: halpnpdd.c:34
PDEVICE_OBJECT PhysicalDeviceObject
Definition: halpnpdd.c:35
struct _IO_STACK_LOCATION::@3976::@4003 DeviceCapabilities
union _IO_STACK_LOCATION::@1567 Parameters
struct _IO_STACK_LOCATION::@3976::@4002 QueryInterface
struct _IO_STACK_LOCATION::@3976::@4007 QueryId
struct _IO_STACK_LOCATION::@3976::@4001 QueryDeviceRelations
PDEVICE_OBJECT PhysicalDeviceObject
Definition: halpnpdd.c:44
PDESCRIPTION_HEADER WdTable
Definition: halpnpdd.c:47
struct _PDO_EXTENSION * Next
Definition: halpnpdd.c:43
PFDO_EXTENSION ParentFdoExtension
Definition: halpnpdd.c:45
LONG InterfaceReferenceCount
Definition: halpnpdd.c:48
EXTENSION_TYPE ExtensionType
Definition: halpnpdd.c:42
PDO_TYPE PdoType
Definition: halpnpdd.c:46
uint32_t * PULONG
Definition: typedefs.h:59
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define NTAPI
Definition: typedefs.h:36
uint16_t * PUSHORT
Definition: typedefs.h:56
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#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
#define STATUS_NO_SUCH_DEVICE
Definition: udferr_usr.h:136
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_In_ DEVICE_RELATION_TYPE RelationType
Definition: wdfdevice.h:1059
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:215
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE Interface
Definition: wdffdo.h:465
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID InterfaceType
Definition: wdffdo.h:463
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE _In_ USHORT _In_ USHORT Version
Definition: wdffdo.h:469
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE _In_ USHORT _In_ USHORT _In_opt_ PVOID InterfaceSpecificData
Definition: wdffdo.h:472
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
Definition: wdfresource.h:309
_In_ WDFIORESREQLIST RequirementsList
Definition: wdfresource.h:65
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: wdfresource.h:342
_Out_opt_ PULONG Minor
Definition: cmfuncs.h:44
_Must_inspect_result_ __drv_aliasesMem PDEVICE_OBJECT _In_ PDEVICE_OBJECT TargetDevice
Definition: iofuncs.h:691
@ BusRelations
Definition: iotypes.h:2152
@ TargetDeviceRelation
Definition: iotypes.h:2156
#define IRP_MN_QUERY_PNP_DEVICE_STATE
enum _BUS_QUERY_ID_TYPE BUS_QUERY_ID_TYPE
#define IO_NO_INCREMENT
Definition: iotypes.h:598
#define IRP_MN_QUERY_INTERFACE
#define IRP_MN_START_DEVICE
#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_MJ_SYSTEM_CONTROL
#define IRP_MN_QUERY_DEVICE_TEXT
#define IRP_MN_QUERY_CAPABILITIES
#define IRP_MN_QUERY_RESOURCES
* PDEVICE_CAPABILITIES
Definition: iotypes.h:965
#define IRP_MJ_POWER
@ BusQueryCompatibleIDs
Definition: iotypes.h:2938
@ BusQueryInstanceID
Definition: iotypes.h:2939
@ BusQueryDeviceID
Definition: iotypes.h:2936
@ BusQueryHardwareIDs
Definition: iotypes.h:2937
enum _DEVICE_RELATION_TYPE DEVICE_RELATION_TYPE
#define IRP_MN_QUERY_BUS_INFORMATION
#define ObReferenceObject
Definition: obfuncs.h:204
unsigned char UCHAR
Definition: xmlstorage.h:181
__wchar_t WCHAR
Definition: xmlstorage.h:180