ReactOS  0.4.14-dev-317-g96040ec
halpnpdd.c File Reference
#include <hal.h>
#include <debug.h>
Include dependency graph for halpnpdd.c:

Go to the source code of this file.

Classes

struct  _FDO_EXTENSION
 
struct  _PDO_EXTENSION
 

Macros

#define NDEBUG
 

Typedefs

typedef enum _EXTENSION_TYPE EXTENSION_TYPE
 
typedef enum _PDO_TYPE PDO_TYPE
 
typedef struct _FDO_EXTENSION FDO_EXTENSION
 
typedef struct _FDO_EXTENSIONPFDO_EXTENSION
 
typedef struct _PDO_EXTENSION PDO_EXTENSION
 
typedef struct _PDO_EXTENSIONPPDO_EXTENSION
 

Enumerations

enum  _EXTENSION_TYPE { PdoExtensionType = 0xC0, FdoExtensionType, PdoExtensionType = 0xC0, FdoExtensionType }
 
enum  _PDO_TYPE {
  AcpiPdo = 0x80, WdPdo, AcpiPdo = 0x80, WdPdo,
  PDO_TYPE_UNDEFINED = 0, PDO_TYPE_DISK, PDO_TYPE_CONTROL, PDO_TYPE_SILO,
  PDO_TYPE_THIS = 256
}
 

Functions

VOID NTAPI HalpReportDetectedDevices (IN PDRIVER_OBJECT DriverObject, IN PVOID Context, IN ULONG Count)
 
NTSTATUS NTAPI HalpAddDevice (IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT TargetDevice)
 
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)
 
NTSTATUS NTAPI HalpQueryDeviceRelations (IN PDEVICE_OBJECT DeviceObject, IN DEVICE_RELATION_TYPE RelationType, OUT PDEVICE_RELATIONS *DeviceRelations)
 
NTSTATUS NTAPI HalpQueryCapabilities (IN PDEVICE_OBJECT DeviceObject, OUT PDEVICE_CAPABILITIES Capabilities)
 
NTSTATUS NTAPI HalpQueryResources (IN PDEVICE_OBJECT DeviceObject, OUT PCM_RESOURCE_LIST *Resources)
 
NTSTATUS NTAPI HalpQueryResourceRequirements (IN PDEVICE_OBJECT DeviceObject, OUT PIO_RESOURCE_REQUIREMENTS_LIST *Requirements)
 
NTSTATUS NTAPI HalpQueryIdPdo (IN PDEVICE_OBJECT DeviceObject, IN BUS_QUERY_ID_TYPE IdType, OUT PUSHORT *BusQueryId)
 
NTSTATUS NTAPI HalpQueryIdFdo (IN PDEVICE_OBJECT DeviceObject, IN BUS_QUERY_ID_TYPE IdType, OUT PUSHORT *BusQueryId)
 
NTSTATUS NTAPI HalpDispatchPnp (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS NTAPI HalpDispatchWmi (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS NTAPI HalpDispatchPower (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS NTAPI HalpDriverEntry (IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
 
NTSTATUS NTAPI HaliInitPnpDriver (VOID)
 

Variables

PDRIVER_OBJECT HalpDriverObject
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 12 of file halpnpdd.c.

Typedef Documentation

◆ EXTENSION_TYPE

◆ FDO_EXTENSION

◆ PDO_EXTENSION

◆ PDO_TYPE

◆ PFDO_EXTENSION

◆ PPDO_EXTENSION

Enumeration Type Documentation

◆ _EXTENSION_TYPE

Enumerator
PdoExtensionType 
FdoExtensionType 
PdoExtensionType 
FdoExtensionType 

Definition at line 15 of file halpnpdd.c.

16 {
17  PdoExtensionType = 0xC0,
enum _EXTENSION_TYPE EXTENSION_TYPE

◆ _PDO_TYPE

Enumerator
AcpiPdo 
WdPdo 
AcpiPdo 
WdPdo 
PDO_TYPE_UNDEFINED 
PDO_TYPE_DISK 
PDO_TYPE_CONTROL 
PDO_TYPE_SILO 
PDO_TYPE_THIS 

Definition at line 21 of file halpnpdd.c.

22 {
23  AcpiPdo = 0x80,
24  WdPdo
25 } PDO_TYPE;
enum _PDO_TYPE PDO_TYPE
Definition: halpnpdd.c:24

Function Documentation

◆ HaliInitPnpDriver()

NTSTATUS NTAPI HaliInitPnpDriver ( VOID  )

Definition at line 902 of file halpnpdd.c.

903 {
905  UNICODE_STRING DriverString;
906  PAGED_CODE();
907 
908  /* Create the driver */
909  RtlInitUnicodeString(&DriverString, L"\\Driver\\ACPI_HAL");
910  Status = IoCreateDriver(&DriverString, HalpDriverEntry);
911 
912  /* Return status */
913  return Status;
914 }
LONG NTSTATUS
Definition: precomp.h:26
#define PAGED_CODE()
Definition: video.h:57
NTSTATUS NTAPI HalpDriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
Definition: halpnpdd.c:846
static const WCHAR L[]
Definition: oid.c:1250
Status
Definition: gdiplustypes.h:24
NTSTATUS NTAPI IoCreateDriver(IN PUNICODE_STRING DriverName OPTIONAL, IN PDRIVER_INITIALIZE InitializationFunction)
Definition: driver.c:1683
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)

Referenced by HalInitSystem().

◆ HalpAddDevice()

NTSTATUS NTAPI HalpAddDevice ( IN PDRIVER_OBJECT  DriverObject,
IN PDEVICE_OBJECT  TargetDevice 
)

Definition at line 108 of file halpnpdd.c.

110 {
113  PDEVICE_OBJECT DeviceObject, AttachedDevice;
114 
115  DPRINT("HAL: PnP Driver ADD!\n");
116 
117  /* Create the FDO */
119  sizeof(FDO_EXTENSION),
120  NULL,
122  0,
123  FALSE,
124  &DeviceObject);
125  if (!NT_SUCCESS(Status))
126  {
127  /* Should not happen */
128  DbgBreakPoint();
129  return Status;
130  }
131 
132  /* Setup the FDO extension */
134  FdoExtension->ExtensionType = FdoExtensionType;
135  FdoExtension->PhysicalDeviceObject = TargetDevice;
136  FdoExtension->FunctionalDeviceObject = DeviceObject;
137  FdoExtension->ChildPdoList = NULL;
138 
139  /* FDO is done initializing */
141 
142  /* Attach to the physical device object (the bus) */
144  if (!AttachedDevice)
145  {
146  /* Failed, undo everything */
148  return STATUS_NO_SUCH_DEVICE;
149  }
150 
151  /* Save the attachment */
152  FdoExtension->AttachedDeviceObject = AttachedDevice;
153 
154  /* Register for reinitialization to report devices later */
157  FdoExtension);
158 
159  /* Return status */
160  DPRINT("Device added %lx\n", Status);
161  return Status;
162 }
#define DO_DEVICE_INITIALIZING
Definition: env_spec_w32.h:399
_Must_inspect_result_ __drv_aliasesMem PDEVICE_OBJECT _In_ PDEVICE_OBJECT TargetDevice
Definition: iofuncs.h:688
LONG NTSTATUS
Definition: precomp.h:26
void DbgBreakPoint()
Definition: mach.c:553
PDEVICE_OBJECT NTAPI IoAttachDeviceToDeviceStack(IN PDEVICE_OBJECT SourceDevice, IN PDEVICE_OBJECT TargetDevice)
Definition: device.c:966
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
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define STATUS_NO_SUCH_DEVICE
Definition: udferr_usr.h:136
VOID NTAPI IoRegisterBootDriverReinitialization(IN PDRIVER_OBJECT DriverObject, IN PDRIVER_REINITIALIZE ReinitRoutine, IN PVOID Context)
Definition: driver.c:1706
VOID NTAPI HalpReportDetectedDevices(IN PDRIVER_OBJECT DriverObject, IN PVOID Context, IN ULONG Count)
Definition: halpnpdd.c:55
Status
Definition: gdiplustypes.h:24
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1251
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 FILE_DEVICE_BUS_EXTENDER
Definition: winioctl.h:147

Referenced by HalpDriverEntry().

◆ HalpDispatchPnp()

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

Definition at line 634 of file halpnpdd.c.

636 {
637  PIO_STACK_LOCATION IoStackLocation;
638  //PPDO_EXTENSION PdoExtension;
641  UCHAR Minor;
642 
643  /* Get the device extension and stack location */
645  IoStackLocation = IoGetCurrentIrpStackLocation(Irp);
646  Minor = IoStackLocation->MinorFunction;
647 
648  /* FDO? */
649  if (FdoExtension->ExtensionType == FdoExtensionType)
650  {
651  /* Query the IRP type */
652  switch (Minor)
653  {
655 
656  /* Call the worker */
657  DPRINT("Querying device relations for FDO\n");
659  IoStackLocation->Parameters.QueryDeviceRelations.Type,
660  (PVOID)&Irp->IoStatus.Information);
661  break;
662 
664 
665  /* Call the worker */
666  DPRINT("Querying interface for FDO\n");
668  IoStackLocation->Parameters.QueryInterface.InterfaceType,
669  IoStackLocation->Parameters.QueryInterface.Size,
670  IoStackLocation->Parameters.QueryInterface.InterfaceSpecificData,
671  IoStackLocation->Parameters.QueryInterface.Version,
672  IoStackLocation->Parameters.QueryInterface.Interface,
673  (PVOID)&Irp->IoStatus.Information);
674  break;
675 
676 
677  case IRP_MN_QUERY_ID:
678 
679  /* Call the worker */
680  DPRINT("Querying ID for FDO\n");
682  IoStackLocation->Parameters.QueryId.IdType,
683  (PVOID)&Irp->IoStatus.Information);
684  break;
685 
687 
688  /* Call the worker */
689  DPRINT("Querying the capabilities for the FDO\n");
691  IoStackLocation->Parameters.DeviceCapabilities.Capabilities);
692  break;
693 
694  default:
695 
696  DPRINT("Other IRP: %lx\n", Minor);
697  Status = Irp->IoStatus.Status;
698  break;
699  }
700 
701  /* Nowhere for the IRP to go since we also own the PDO */
702  Irp->IoStatus.Status = Status;
704  return Status;
705  }
706  else
707  {
708  /* This is a PDO instead */
709  ASSERT(FdoExtension->ExtensionType == PdoExtensionType);
710  //PdoExtension = (PPDO_EXTENSION)FdoExtension;
711  /* Query the IRP type */
713  switch (Minor)
714  {
715  case IRP_MN_START_DEVICE:
716 
717  /* We only care about a PCI PDO */
718  DPRINT1("Start device received\n");
719  /* Complete the IRP normally */
720  break;
721 
723 
724  /* Check if this is a PCI device */
725  DPRINT1("Remove device received\n");
726 
727  /* We're done */
729  break;
730 
732 
733  /* Inherit whatever status we had */
734  DPRINT1("Surprise removal IRP\n");
735  Status = Irp->IoStatus.Status;
736  break;
737 
739 
740  /* Query the device relations */
741  DPRINT("Querying PDO relations\n");
743  IoStackLocation->Parameters.QueryDeviceRelations.Type,
744  (PVOID)&Irp->IoStatus.Information);
745  break;
746 
748 
749  /* Call the worker */
750  DPRINT("Querying interface for PDO\n");
752  IoStackLocation->Parameters.QueryInterface.InterfaceType,
753  IoStackLocation->Parameters.QueryInterface.Size,
754  IoStackLocation->Parameters.QueryInterface.InterfaceSpecificData,
755  IoStackLocation->Parameters.QueryInterface.Version,
756  IoStackLocation->Parameters.QueryInterface.Interface,
757  (PVOID)&Irp->IoStatus.Information);
758  break;
759 
761 
762  /* Call the worker */
763  DPRINT("Querying the capabilities for the PDO\n");
765  IoStackLocation->Parameters.DeviceCapabilities.Capabilities);
766  break;
767 
769 
770  /* Call the worker */
771  DPRINT("Querying the resources for the PDO\n");
772  Status = HalpQueryResources(DeviceObject, (PVOID)&Irp->IoStatus.Information);
773  break;
774 
776 
777  /* Call the worker */
778  DPRINT("Querying the resource requirements for the PDO\n");
780  (PVOID)&Irp->IoStatus.Information);
781  break;
782 
783  case IRP_MN_QUERY_ID:
784 
785  /* Call the worker */
786  DPRINT("Query the ID for the PDO\n");
788  IoStackLocation->Parameters.QueryId.IdType,
789  (PVOID)&Irp->IoStatus.Information);
790  break;
791 
792  default:
793 
794  /* We don't handle anything else, so inherit the old state */
795  DPRINT("Illegal IRP: %lx\n", Minor);
796  Status = Irp->IoStatus.Status;
797  break;
798  }
799 
800  /* If it's not supported, inherit the old status */
801  if (Status == STATUS_NOT_SUPPORTED) Status = Irp->IoStatus.Status;
802 
803  /* Complete the IRP */
804  DPRINT("IRP completed with status: %lx\n", Status);
805  Irp->IoStatus.Status = Status;
807  return Status;
808  }
809 }
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:166
_Out_opt_ PULONG Minor
Definition: cmfuncs.h:44
NTSTATUS NTAPI HalpQueryIdPdo(IN PDEVICE_OBJECT DeviceObject, IN BUS_QUERY_ID_TYPE IdType, OUT PUSHORT *BusQueryId)
Definition: halpnpdd.c:472
#define IRP_MN_QUERY_RESOURCES
#define IRP_MN_REMOVE_DEVICE
#define IRP_MN_QUERY_ID
_In_ PIRP Irp
Definition: csq.h:116
#define IRP_MN_QUERY_RESOURCE_REQUIREMENTS
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS NTAPI HalpQueryResourceRequirements(IN PDEVICE_OBJECT DeviceObject, OUT PIO_RESOURCE_REQUIREMENTS_LIST *Requirements)
Definition: halpnpdd.c:446
PVOID DeviceExtension
Definition: env_spec_w32.h:418
NTSTATUS NTAPI HalpQueryIdFdo(IN PDEVICE_OBJECT DeviceObject, IN BUS_QUERY_ID_TYPE IdType, OUT PUSHORT *BusQueryId)
Definition: halpnpdd.c:568
#define IoCompleteRequest
Definition: irp.c:1240
void DPRINT(...)
Definition: polytest.cpp:61
#define IRP_MN_SURPRISE_REMOVAL
Definition: ntifs_ex.h:408
#define IRP_MN_START_DEVICE
#define IRP_MN_QUERY_INTERFACE
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
unsigned char UCHAR
Definition: xmlstorage.h:181
Status
Definition: gdiplustypes.h:24
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
NTSTATUS NTAPI HalpQueryResources(IN PDEVICE_OBJECT DeviceObject, OUT PCM_RESOURCE_LIST *Resources)
Definition: halpnpdd.c:355
#define IRP_MN_QUERY_DEVICE_RELATIONS
#define DPRINT1
Definition: precomp.h:8
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
NTSTATUS NTAPI HalpQueryDeviceRelations(IN PDEVICE_OBJECT DeviceObject, IN DEVICE_RELATION_TYPE RelationType, OUT PDEVICE_RELATIONS *DeviceRelations)
Definition: halpnpdd.c:180
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:409
#define IO_NO_INCREMENT
Definition: iotypes.h:566
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:2772
return STATUS_SUCCESS
Definition: btrfs.c:2938
NTSTATUS NTAPI HalpQueryCapabilities(IN PDEVICE_OBJECT DeviceObject, OUT PDEVICE_CAPABILITIES Capabilities)
Definition: halpnpdd.c:298
#define IRP_MN_QUERY_CAPABILITIES

Referenced by HalpDriverEntry().

◆ HalpDispatchPower()

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

Definition at line 822 of file halpnpdd.c.

824 {
826 
827  DPRINT("HAL: PnP Driver Power!\n");
829  if (FdoExtension->ExtensionType == FdoExtensionType)
830  {
833  return PoCallDriver(FdoExtension->AttachedDeviceObject, Irp);
834  }
835  else
836  {
838  Irp->IoStatus.Status = STATUS_SUCCESS;
840  return STATUS_SUCCESS;
841  }
842 }
NTSTATUS NTAPI PoCallDriver(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp)
Definition: power.c:485
_In_ PIRP Irp
Definition: csq.h:116
PVOID DeviceExtension
Definition: env_spec_w32.h:418
#define IoCompleteRequest
Definition: irp.c:1240
void DPRINT(...)
Definition: polytest.cpp:61
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
VOID NTAPI PoStartNextPowerIrp(IN PIRP Irp)
Definition: power.c:626
#define IoSkipCurrentIrpStackLocation(Irp)
Definition: ntifs_ex.h:421
#define IO_NO_INCREMENT
Definition: iotypes.h:566
return STATUS_SUCCESS
Definition: btrfs.c:2938

Referenced by HalpDriverEntry().

◆ HalpDispatchWmi()

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

Definition at line 813 of file halpnpdd.c.

815 {
816  UNIMPLEMENTED_DBGBREAK("HAL: PnP Driver WMI!\n");
817  return STATUS_SUCCESS;
818 }
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57
return STATUS_SUCCESS
Definition: btrfs.c:2938

Referenced by HalpDriverEntry().

◆ HalpDriverEntry()

NTSTATUS NTAPI HalpDriverEntry ( IN PDRIVER_OBJECT  DriverObject,
IN PUNICODE_STRING  RegistryPath 
)

Definition at line 846 of file halpnpdd.c.

848 {
851 
852  DPRINT("HAL: PnP Driver ENTRY!\n");
853 
854  /* This is us */
856 
857  /* Set up add device */
859 
860  /* Set up the callouts */
864 
865  /* Create the PDO */
867  0,
868  NULL,
870  0,
871  FALSE,
872  &TargetDevice);
873  if (!NT_SUCCESS(Status))
874  return Status;
875 
877 
878  /* Set up the device stack */
880  if (!NT_SUCCESS(Status))
881  {
883  return Status;
884  }
885 
886  /* Tell the PnP manager about us */
889  -1,
890  -1,
891  NULL,
892  NULL,
893  FALSE,
894  &TargetDevice);
895 
896  /* Return to kernel */
897  return Status;
898 }
#define DO_DEVICE_INITIALIZING
Definition: env_spec_w32.h:399
_Must_inspect_result_ __drv_aliasesMem PDEVICE_OBJECT _In_ PDEVICE_OBJECT TargetDevice
Definition: iofuncs.h:688
PDRIVER_OBJECT HalpDriverObject
Definition: halpnpdd.c:49
NTSTATUS NTAPI HalpDispatchPower(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: halpnpdd.c:822
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS NTAPI HalpDispatchPnp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: halpnpdd.c:634
NTSTATUS NTAPI IoReportDetectedDevice(IN PDRIVER_OBJECT DriverObject, IN INTERFACE_TYPE LegacyBusType, IN ULONG BusNumber, IN ULONG SlotNumber, IN PCM_RESOURCE_LIST ResourceList, IN PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirements OPTIONAL, IN BOOLEAN ResourceAssigned, IN OUT PDEVICE_OBJECT *DeviceObject OPTIONAL)
Definition: pnpreport.c:162
#define FILE_DEVICE_CONTROLLER
Definition: winioctl.h:109
PDRIVER_EXTENSION DriverExtension
Definition: iotypes.h:2174
smooth NULL
Definition: ftsmooth.c:416
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
void DPRINT(...)
Definition: polytest.cpp:61
NTSTATUS NTAPI HalpDispatchWmi(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: halpnpdd.c:813
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define IRP_MJ_POWER
#define IRP_MJ_SYSTEM_CONTROL
Status
Definition: gdiplustypes.h:24
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1251
PDRIVER_ADD_DEVICE AddDevice
Definition: iotypes.h:2112
NTSTATUS NTAPI HalpAddDevice(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT TargetDevice)
Definition: halpnpdd.c:108
PDRIVER_DISPATCH MajorFunction[IRP_MJ_MAXIMUM_FUNCTION+1]
Definition: iotypes.h:2181
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

Referenced by HaliInitPnpDriver().

◆ HalpQueryCapabilities()

NTSTATUS NTAPI HalpQueryCapabilities ( IN PDEVICE_OBJECT  DeviceObject,
OUT PDEVICE_CAPABILITIES  Capabilities 
)

Definition at line 298 of file halpnpdd.c.

300 {
301  //PPDO_EXTENSION PdoExtension;
303  PAGED_CODE();
304 
305  /* Get the extension and check for valid version */
306  //PdoExtension = DeviceObject->DeviceExtension;
307  ASSERT(Capabilities->Version == 1);
308  if (Capabilities->Version == 1)
309  {
310  /* Can't lock or eject us */
311  Capabilities->LockSupported = FALSE;
312  Capabilities->EjectSupported = FALSE;
313 
314  /* Can't remove or dock us */
315  Capabilities->Removable = FALSE;
316  Capabilities->DockDevice = FALSE;
317 
318  /* Can't access us raw */
319  Capabilities->RawDeviceOK = FALSE;
320 
321  /* We have a unique ID, and don't bother the user */
322  Capabilities->UniqueID = TRUE;
323  Capabilities->SilentInstall = TRUE;
324 
325  /* Fill out the adress */
328 
329  /* Fill out latencies */
330  Capabilities->D1Latency = 0;
331  Capabilities->D2Latency = 0;
332  Capabilities->D3Latency = 0;
333 
334  /* Fill out supported device states */
339 
340  /* Done */
342  }
343  else
344  {
345  /* Fail */
347  }
348 
349  /* Return status */
350  return Status;
351 }
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
#define PAGED_CODE()
Definition: video.h:57
_Must_inspect_result_ typedef _Out_ PHIDP_CAPS Capabilities
Definition: hidclass.h:103
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
Status
Definition: gdiplustypes.h:24
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:409
return STATUS_SUCCESS
Definition: btrfs.c:2938

Referenced by HalpDispatchPnp().

◆ HalpQueryDeviceRelations()

NTSTATUS NTAPI HalpQueryDeviceRelations ( IN PDEVICE_OBJECT  DeviceObject,
IN DEVICE_RELATION_TYPE  RelationType,
OUT PDEVICE_RELATIONS DeviceRelations 
)

Definition at line 180 of file halpnpdd.c.

183 {
184  EXTENSION_TYPE ExtensionType;
187  PDEVICE_RELATIONS PdoRelations, FdoRelations;
188  PDEVICE_OBJECT* ObjectEntry;
189  ULONG i = 0, PdoCount = 0;
190 
191  /* Get FDO device extension and PDO count */
193  ExtensionType = FdoExtension->ExtensionType;
194 
195  /* What do they want? */
196  if (RelationType == BusRelations)
197  {
198  /* This better be an FDO */
199  if (ExtensionType == FdoExtensionType)
200  {
201  /* Count how many PDOs we have */
202  PdoExtension = FdoExtension->ChildPdoList;
203  while (PdoExtension)
204  {
205  /* Next one */
206  PdoExtension = PdoExtension->Next;
207  PdoCount++;
208  }
209 
210  /* Add the PDOs that already exist in the device relations */
211  if (*DeviceRelations)
212  {
213  PdoCount += (*DeviceRelations)->Count;
214  }
215 
216  /* Allocate our structure */
217  FdoRelations = ExAllocatePoolWithTag(PagedPool,
219  Objects) +
220  sizeof(PDEVICE_OBJECT) * PdoCount,
221  TAG_HAL);
222  if (!FdoRelations) return STATUS_INSUFFICIENT_RESOURCES;
223 
224  /* Save our count */
225  FdoRelations->Count = PdoCount;
226 
227  /* Query existing relations */
228  ObjectEntry = FdoRelations->Objects;
229  if (*DeviceRelations)
230  {
231  /* Check if there were any */
232  if ((*DeviceRelations)->Count)
233  {
234  /* Loop them all */
235  do
236  {
237  /* Copy into our structure */
238  *ObjectEntry++ = (*DeviceRelations)->Objects[i];
239  }
240  while (++i < (*DeviceRelations)->Count);
241  }
242 
243  /* Free existing structure */
244  ExFreePool(*DeviceRelations);
245  }
246 
247  /* Now check if we have a PDO list */
248  PdoExtension = FdoExtension->ChildPdoList;
249  if (PdoExtension)
250  {
251  /* Loop the PDOs */
252  do
253  {
254  /* Save our own PDO and reference it */
255  *ObjectEntry++ = PdoExtension->PhysicalDeviceObject;
256  ObReferenceObject(PdoExtension->PhysicalDeviceObject);
257 
258  /* Go to our next PDO */
259  PdoExtension = PdoExtension->Next;
260  }
261  while (PdoExtension);
262  }
263 
264  /* Return the new structure */
265  *DeviceRelations = FdoRelations;
266  return STATUS_SUCCESS;
267  }
268  }
269  else
270  {
271  /* The only other thing we support is a target relation for the PDO */
272  if ((RelationType == TargetDeviceRelation) &&
273  (ExtensionType == PdoExtensionType))
274  {
275  /* Only one entry */
276  PdoRelations = ExAllocatePoolWithTag(PagedPool,
277  sizeof(DEVICE_RELATIONS),
278  TAG_HAL);
279  if (!PdoRelations) return STATUS_INSUFFICIENT_RESOURCES;
280 
281  /* Fill it out and reference us */
282  PdoRelations->Count = 1;
283  PdoRelations->Objects[0] = DeviceObject;
285 
286  /* Return it */
287  *DeviceRelations = PdoRelations;
288  return STATUS_SUCCESS;
289  }
290  }
291 
292  /* We don't support anything else */
293  return STATUS_NOT_SUPPORTED;
294 }
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
PDEVICE_OBJECT Objects[1]
Definition: iotypes.h:2055
EXTENSION_TYPE
Definition: precomp.h:44
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
PVOID DeviceExtension
Definition: env_spec_w32.h:418
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define TAG_HAL
Definition: hal.h:55
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
#define ObReferenceObject
Definition: obfuncs.h:204
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:409
unsigned int ULONG
Definition: retypes.h:1
return STATUS_SUCCESS
Definition: btrfs.c:2938
#define ExFreePool(addr)
Definition: env_spec_w32.h:352

Referenced by HalpDispatchPnp().

◆ HalpQueryIdFdo()

NTSTATUS NTAPI HalpQueryIdFdo ( IN PDEVICE_OBJECT  DeviceObject,
IN BUS_QUERY_ID_TYPE  IdType,
OUT PUSHORT BusQueryId 
)

Definition at line 568 of file halpnpdd.c.

571 {
573  SIZE_T Length;
574  PWCHAR Id;
575  PWCHAR Buffer;
576 
577  /* What kind of ID is being requested? */
578  DPRINT("ID: %d\n", IdType);
579  switch (IdType)
580  {
581  case BusQueryDeviceID:
582  /* HACK */
583  Id = L"Root\\ACPI_HAL";
584  break;
585 
586  case BusQueryHardwareIDs:
587 
588  /* This is our hardware ID */
590  break;
591 
592  case BusQueryInstanceID:
593 
594  /* And our instance ID */
595  Id = L"0";
596  break;
597 
598  default:
599 
600  /* We don't support anything else */
601  return STATUS_NOT_SUPPORTED;
602  }
603 
604  /* Calculate the length */
605  Length = (wcslen(Id) * sizeof(WCHAR)) + sizeof(UNICODE_NULL);
606 
607  /* Allocate the buffer */
609  Length + sizeof(UNICODE_NULL),
610  TAG_HAL);
611  if (Buffer)
612  {
613  /* Copy the string and null-terminate it */
615  Buffer[Length / sizeof(WCHAR)] = UNICODE_NULL;
616 
617  /* Return string */
618  *BusQueryId = Buffer;
620  DPRINT("Returning: %S\n", *BusQueryId);
621  }
622  else
623  {
624  /* Fail */
626  }
627 
628  /* Return status */
629  return Status;
630 }
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
LONG NTSTATUS
Definition: precomp.h:26
uint16_t * PWCHAR
Definition: typedefs.h:54
DWORD Id
#define UNICODE_NULL
void DPRINT(...)
Definition: polytest.cpp:61
Definition: bufpool.h:45
_In_ BUS_QUERY_ID_TYPE IdType
Definition: classpnp.h:357
__wchar_t WCHAR
Definition: xmlstorage.h:180
PWCHAR HalHardwareIdString
Definition: halacpi.c:44
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
static const WCHAR L[]
Definition: oid.c:1250
#define TAG_HAL
Definition: hal.h:55
Status
Definition: gdiplustypes.h:24
ULONG_PTR SIZE_T
Definition: typedefs.h:78
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:409
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
return STATUS_SUCCESS
Definition: btrfs.c:2938
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)

Referenced by HalpDispatchPnp().

◆ HalpQueryIdPdo()

NTSTATUS NTAPI HalpQueryIdPdo ( IN PDEVICE_OBJECT  DeviceObject,
IN BUS_QUERY_ID_TYPE  IdType,
OUT PUSHORT BusQueryId 
)

Definition at line 472 of file halpnpdd.c.

475 {
477  PDO_TYPE PdoType;
478  PWCHAR CurrentId;
479  WCHAR Id[100];
481  SIZE_T Length = 0;
482  PWCHAR Buffer;
483 
484  /* Get the PDO type */
486  PdoType = PdoExtension->PdoType;
487 
488  /* What kind of ID is being requested? */
489  DPRINT("ID: %d\n", IdType);
490  switch (IdType)
491  {
492  case BusQueryDeviceID:
493  case BusQueryHardwareIDs:
494 
495  /* What kind of PDO is this? */
496  if (PdoType == AcpiPdo)
497  {
498  /* ACPI ID */
499  CurrentId = L"ACPI_HAL\\PNP0C08";
500  RtlCopyMemory(Id, CurrentId, (wcslen(CurrentId) * sizeof(WCHAR)) + sizeof(UNICODE_NULL));
501  Length += (wcslen(CurrentId) * sizeof(WCHAR)) + sizeof(UNICODE_NULL);
502 
503  CurrentId = L"*PNP0C08";
504  RtlCopyMemory(&Id[wcslen(Id) + 1], CurrentId, (wcslen(CurrentId) * sizeof(WCHAR)) + sizeof(UNICODE_NULL));
505  Length += (wcslen(CurrentId) * sizeof(WCHAR)) + sizeof(UNICODE_NULL);
506  }
507  else if (PdoType == WdPdo)
508  {
509  /* WatchDog ID */
510  CurrentId = L"ACPI_HAL\\PNP0C18";
511  RtlCopyMemory(Id, CurrentId, (wcslen(CurrentId) * sizeof(WCHAR)) + sizeof(UNICODE_NULL));
512  Length += (wcslen(CurrentId) * sizeof(WCHAR)) + sizeof(UNICODE_NULL);
513 
514  CurrentId = L"*PNP0C18";
515  RtlCopyMemory(&Id[wcslen(Id) + 1], CurrentId, (wcslen(CurrentId) * sizeof(WCHAR)) + sizeof(UNICODE_NULL));
516  Length += (wcslen(CurrentId) * sizeof(WCHAR)) + sizeof(UNICODE_NULL);
517  }
518  else
519  {
520  /* Unknown */
521  return STATUS_NOT_SUPPORTED;
522  }
523  break;
524 
525  case BusQueryInstanceID:
526 
527  /* Instance ID */
528  CurrentId = L"0";
529  RtlCopyMemory(Id, CurrentId, (wcslen(CurrentId) * sizeof(WCHAR)) + sizeof(UNICODE_NULL));
530  Length += (wcslen(CurrentId) * sizeof(WCHAR)) + sizeof(UNICODE_NULL);
531  break;
532 
534  default:
535 
536  /* We don't support anything else */
537  return STATUS_NOT_SUPPORTED;
538  }
539 
540 
541  /* Allocate the buffer */
543  Length + sizeof(UNICODE_NULL),
544  TAG_HAL);
545  if (Buffer)
546  {
547  /* Copy the string and null-terminate it */
549  Buffer[Length / sizeof(WCHAR)] = UNICODE_NULL;
550 
551  /* Return string */
552  *BusQueryId = Buffer;
554  DPRINT("Returning: %S\n", *BusQueryId);
555  }
556  else
557  {
558  /* Fail */
560  }
561 
562  /* Return status */
563  return Status;
564 }
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
LONG NTSTATUS
Definition: precomp.h:26
uint16_t * PWCHAR
Definition: typedefs.h:54
DWORD Id
#define UNICODE_NULL
PVOID DeviceExtension
Definition: env_spec_w32.h:418
void DPRINT(...)
Definition: polytest.cpp:61
Definition: bufpool.h:45
_In_ BUS_QUERY_ID_TYPE IdType
Definition: classpnp.h:357
__wchar_t WCHAR
Definition: xmlstorage.h:180
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
enum _PDO_TYPE PDO_TYPE
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
static const WCHAR L[]
Definition: oid.c:1250
#define TAG_HAL
Definition: hal.h:55
Status
Definition: gdiplustypes.h:24
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
ULONG_PTR SIZE_T
Definition: typedefs.h:78
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:409
Definition: halpnpdd.c:24
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
return STATUS_SUCCESS
Definition: btrfs.c:2938
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)

Referenced by HalpDispatchPnp().

◆ HalpQueryInterface()

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 at line 166 of file halpnpdd.c.

173 {
175  return STATUS_NOT_SUPPORTED;
176 }
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:409
#define UNIMPLEMENTED
Definition: debug.h:114

Referenced by HalpDispatchPnp().

◆ HalpQueryResourceRequirements()

NTSTATUS NTAPI HalpQueryResourceRequirements ( IN PDEVICE_OBJECT  DeviceObject,
OUT PIO_RESOURCE_REQUIREMENTS_LIST Requirements 
)

Definition at line 446 of file halpnpdd.c.

448 {
449  PPDO_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
450  PAGED_CODE();
451 
452  /* Only the ACPI PDO has requirements */
453  if (DeviceExtension->PdoType == AcpiPdo)
454  {
455  /* Query ACPI requirements */
456  return HalpQueryAcpiResourceRequirements(Requirements);
457  }
458  else if (DeviceExtension->PdoType == WdPdo)
459  {
460  /* Watchdog doesn't */
461  return STATUS_NOT_SUPPORTED;
462  }
463  else
464  {
465  /* This shouldn't happen */
466  return STATUS_UNSUCCESSFUL;
467  }
468 }
NTSTATUS NTAPI HalpQueryAcpiResourceRequirements(OUT PIO_RESOURCE_REQUIREMENTS_LIST *Requirements)
Definition: halacpi.c:1016
#define PAGED_CODE()
Definition: video.h:57
PVOID DeviceExtension
Definition: env_spec_w32.h:418
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
PDO_TYPE PdoType
Definition: halpnpdd.c:42
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:409
Definition: halpnpdd.c:24

Referenced by HalpDispatchPnp().

◆ HalpQueryResources()

NTSTATUS NTAPI HalpQueryResources ( IN PDEVICE_OBJECT  DeviceObject,
OUT PCM_RESOURCE_LIST Resources 
)

Definition at line 355 of file halpnpdd.c.

357 {
358  PPDO_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
361  PIO_RESOURCE_REQUIREMENTS_LIST RequirementsList;
364  ULONG i;
365  PAGED_CODE();
366 
367  /* Only the ACPI PDO has requirements */
368  if (DeviceExtension->PdoType == AcpiPdo)
369  {
370  /* Query ACPI requirements */
371  Status = HalpQueryAcpiResourceRequirements(&RequirementsList);
372  if (!NT_SUCCESS(Status)) return Status;
373 
374  ASSERT(RequirementsList->AlternativeLists == 1);
375 
376  /* Allocate the resourcel ist */
378  sizeof(CM_RESOURCE_LIST),
379  TAG_HAL);
380  if (!ResourceList )
381  {
382  /* Fail, no memory */
384  ExFreePoolWithTag(RequirementsList, TAG_HAL);
385  return Status;
386  }
387 
388  /* Initialize it */
390  ResourceList->Count = 1;
391 
392  /* Setup the list fields */
393  ResourceList->List[0].BusNumber = -1;
394  ResourceList->List[0].InterfaceType = PNPBus;
395  ResourceList->List[0].PartialResourceList.Version = 1;
396  ResourceList->List[0].PartialResourceList.Revision = 1;
397  ResourceList->List[0].PartialResourceList.Count = 0;
398 
399  /* Setup the first descriptor */
400  PartialDesc = ResourceList->List[0].PartialResourceList.PartialDescriptors;
401 
402  /* Find the requirement descriptor for the SCI */
403  for (i = 0; i < RequirementsList->List[0].Count; i++)
404  {
405  /* Get this descriptor */
406  Descriptor = &RequirementsList->List[0].Descriptors[i];
407  if (Descriptor->Type == CmResourceTypeInterrupt)
408  {
409  /* Copy requirements descriptor into resource descriptor */
410  PartialDesc->Type = CmResourceTypeInterrupt;
411  PartialDesc->ShareDisposition = Descriptor->ShareDisposition;
412  PartialDesc->Flags = Descriptor->Flags;
413  ASSERT(Descriptor->u.Interrupt.MinimumVector ==
414  Descriptor->u.Interrupt.MaximumVector);
415  PartialDesc->u.Interrupt.Vector = Descriptor->u.Interrupt.MinimumVector;
416  PartialDesc->u.Interrupt.Level = Descriptor->u.Interrupt.MinimumVector;
417  PartialDesc->u.Interrupt.Affinity = 0xFFFFFFFF;
418 
419  ResourceList->List[0].PartialResourceList.Count++;
420 
421  break;
422  }
423  }
424 
425  /* Return resources and success */
427 
428  ExFreePoolWithTag(RequirementsList, TAG_HAL);
429 
430  return STATUS_SUCCESS;
431  }
432  else if (DeviceExtension->PdoType == WdPdo)
433  {
434  /* Watchdog doesn't */
435  return STATUS_NOT_SUPPORTED;
436  }
437  else
438  {
439  /* This shouldn't happen */
440  return STATUS_UNSUCCESSFUL;
441  }
442 }
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS NTAPI HalpQueryAcpiResourceRequirements(OUT PIO_RESOURCE_REQUIREMENTS_LIST *Requirements)
Definition: halacpi.c:1016
union _CM_PARTIAL_RESOURCE_DESCRIPTOR::@378 u
const MUI_LANGUAGE_RESOURCE ResourceList[]
Definition: muilanguages.h:414
#define PAGED_CODE()
Definition: video.h:57
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
PVOID DeviceExtension
Definition: env_spec_w32.h:418
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
IO_RESOURCE_LIST List[1]
Definition: iotypes.h:2393
#define TAG_HAL
Definition: hal.h:55
IO_RESOURCE_DESCRIPTOR Descriptors[1]
Definition: iotypes.h:2383
PDO_TYPE PdoType
Definition: halpnpdd.c:42
Status
Definition: gdiplustypes.h:24
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@378::@381 Interrupt
#define CmResourceTypeInterrupt
Definition: hwresource.cpp:124
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:409
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
Definition: halpnpdd.c:24
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
return STATUS_SUCCESS
Definition: btrfs.c:2938
_In_ PSTORAGE_PROPERTY_ID _Outptr_ PSTORAGE_DESCRIPTOR_HEADER * Descriptor
Definition: classpnp.h:966

Referenced by HalpDispatchPnp().

◆ HalpReportDetectedDevices()

VOID NTAPI HalpReportDetectedDevices ( IN PDRIVER_OBJECT  DriverObject,
IN PVOID  Context,
IN ULONG  Count 
)

Definition at line 55 of file halpnpdd.c.

58 {
64 
65  /* Create the PDO */
67  sizeof(PDO_EXTENSION),
68  NULL,
71  FALSE,
73  if (!NT_SUCCESS(Status))
74  {
75  /* Fail */
76  DPRINT1("HAL: Could not create ACPI device object status=0x%08x\n", Status);
77  return;
78  }
79 
80  /* Setup the PDO device extension */
81  PdoExtension = PdoDeviceObject->DeviceExtension;
82  PdoExtension->ExtensionType = PdoExtensionType;
83  PdoExtension->PhysicalDeviceObject = PdoDeviceObject;
84  PdoExtension->ParentFdoExtension = FdoExtension;
85  PdoExtension->PdoType = AcpiPdo;
86 
87  /* Add the PDO to the head of the list */
88  PdoExtension->Next = FdoExtension->ChildPdoList;
89  FdoExtension->ChildPdoList = PdoExtension;
90 
91  /* Initialization is finished */
93 
94  /* Find the ACPI watchdog table */
95  Wdrt = HalAcpiGetTable(0, 'TRDW');
96  if (Wdrt)
97  {
98  /* FIXME: TODO */
99  DPRINT1("You have an ACPI Watchdog. That's great! You should be proud ;-)\n");
100  }
101 
102  /* This will synchronously load the ACPI driver (needed because we're critical for boot) */
104 }
#define DO_DEVICE_INITIALIZING
Definition: env_spec_w32.h:399
NTSTATUS NTAPI IoSynchronousInvalidateDeviceRelations(IN PDEVICE_OBJECT DeviceObject, IN DEVICE_RELATION_TYPE Type)
Definition: pnpmgr.c:5147
LONG NTSTATUS
Definition: precomp.h:26
PVOID NTAPI HalAcpiGetTable(IN PLOADER_PARAMETER_BLOCK LoaderBlock, IN ULONG Signature)
Definition: halacpi.c:446
_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:89
smooth NULL
Definition: ftsmooth.c:416
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
#define FILE_AUTOGENERATED_DEVICE_NAME
Definition: iotypes.h:138
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
Status
Definition: gdiplustypes.h:24
#define DPRINT1
Definition: precomp.h:8
struct tagContext Context
Definition: acpixf.h:1024
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 FILE_DEVICE_BUS_EXTENDER
Definition: winioctl.h:147

Referenced by HalpAddDevice().

Variable Documentation

◆ HalpDriverObject

PDRIVER_OBJECT HalpDriverObject

Definition at line 49 of file halpnpdd.c.

Referenced by HalpDriverEntry().