Author: cgutman
Date: Mon Aug 15 04:07:40 2011
New Revision: 53252
URL:
http://svn.reactos.org/svn/reactos?rev=53252&view=rev
Log:
[HAL]
- Also report the *PNP style IDs
- Don't hang when a power IRP is received
Modified:
trunk/reactos/hal/halx86/generic/acpi/halpnpdd.c
Modified: trunk/reactos/hal/halx86/generic/acpi/halpnpdd.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/acpi/ha…
==============================================================================
--- trunk/reactos/hal/halx86/generic/acpi/halpnpdd.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/generic/acpi/halpnpdd.c [iso-8859-1] Mon Aug 15 04:07:40
2011
@@ -463,9 +463,10 @@
{
PPDO_EXTENSION PdoExtension;
PDO_TYPE PdoType;
- PWCHAR Id;
+ PWCHAR CurrentId;
+ WCHAR Id[100];
NTSTATUS Status;
- ULONG Length;
+ ULONG Length = 0;
PWCHAR Buffer;
/* Get the PDO type */
@@ -482,13 +483,25 @@
/* What kind of PDO is this? */
if (PdoType == AcpiPdo)
{
- /* PCI ID */
- Id = L"ACPI_HAL\\PNP0C08";
+ /* ACPI ID */
+ CurrentId = L"ACPI_HAL\\PNP0C08";
+ RtlCopyMemory(Id, CurrentId, (wcslen(CurrentId) * sizeof(WCHAR)) +
sizeof(UNICODE_NULL));
+ Length += (wcslen(CurrentId) * sizeof(WCHAR)) + sizeof(UNICODE_NULL);
+
+ CurrentId = L"*PNP0C08";
+ RtlCopyMemory(&Id[wcslen(Id) + 1], CurrentId, (wcslen(CurrentId) *
sizeof(WCHAR)) + sizeof(UNICODE_NULL));
+ Length += (wcslen(CurrentId) * sizeof(WCHAR)) + sizeof(UNICODE_NULL);
}
else if (PdoType == WdPdo)
{
/* WatchDog ID */
- Id = L"ACPI_HAL\\PNP0C18";
+ CurrentId = L"ACPI_HAL\\PNP0C18";
+ RtlCopyMemory(Id, CurrentId, (wcslen(CurrentId) * sizeof(WCHAR)) +
sizeof(UNICODE_NULL));
+ Length += (wcslen(CurrentId) * sizeof(WCHAR)) + sizeof(UNICODE_NULL);
+
+ CurrentId = L"*PNP0C18";
+ RtlCopyMemory(&Id[wcslen(Id) + 1], CurrentId, (wcslen(CurrentId) *
sizeof(WCHAR)) + sizeof(UNICODE_NULL));
+ Length += (wcslen(CurrentId) * sizeof(WCHAR)) + sizeof(UNICODE_NULL);
}
else
{
@@ -498,9 +511,11 @@
break;
case BusQueryInstanceID:
-
- /* And our instance ID */
- Id = L"0";
+
+ /* Instance ID */
+ CurrentId = L"0";
+ RtlCopyMemory(Id, CurrentId, (wcslen(CurrentId) * sizeof(WCHAR)) +
sizeof(UNICODE_NULL));
+ Length += (wcslen(CurrentId) * sizeof(WCHAR)) + sizeof(UNICODE_NULL);
break;
case BusQueryCompatibleIDs:
@@ -509,9 +524,7 @@
/* We don't support anything else */
return STATUS_NOT_SUPPORTED;
}
-
- /* Calculate the length */
- Length = (wcslen(Id) * sizeof(WCHAR)) + sizeof(UNICODE_NULL);
+
/* Allocate the buffer */
Buffer = ExAllocatePoolWithTag(PagedPool,
@@ -815,7 +828,6 @@
IN PIRP Irp)
{
DbgPrint("HAL: PnP Driver Power!\n");
- while (TRUE);
return STATUS_SUCCESS;
}