summaryrefslogtreecommitdiff
path: root/os_specific/service_layers/oswintbl.c
diff options
context:
space:
mode:
Diffstat (limited to 'os_specific/service_layers/oswintbl.c')
-rw-r--r--os_specific/service_layers/oswintbl.c35
1 files changed, 28 insertions, 7 deletions
diff --git a/os_specific/service_layers/oswintbl.c b/os_specific/service_layers/oswintbl.c
index 30d7ba66b9c7d..db609ee99d127 100644
--- a/os_specific/service_layers/oswintbl.c
+++ b/os_specific/service_layers/oswintbl.c
@@ -132,6 +132,22 @@
static char KeyBuffer[64];
+static char ErrorBuffer[64];
+
+
+/* Little front-end to win FormatMessage */
+
+char *
+OsFormatException (
+ LONG Status)
+{
+
+ ErrorBuffer[0] = 0;
+ FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM, NULL, Status, 0,
+ ErrorBuffer, 64, NULL);
+
+ return (ErrorBuffer);
+}
/******************************************************************************
@@ -169,7 +185,7 @@ OsGetTable (
ACPI_STRCAT (KeyBuffer, Signature);
Status = RegOpenKeyEx (HKEY_LOCAL_MACHINE, KeyBuffer,
- 0L, KEY_ALL_ACCESS, &Handle);
+ 0L, KEY_READ, &Handle);
if (Status != ERROR_SUCCESS)
{
@@ -187,8 +203,9 @@ OsGetTable (
}
else
{
- AcpiOsPrintf ("Could not find %s in registry at %s\n",
- Signature, KeyBuffer);
+ AcpiOsPrintf (
+ "Could not find %s in registry at %s: %s (Status=0x%X)\n",
+ Signature, KeyBuffer, OsFormatException (Status), Status);
return (NULL);
}
}
@@ -212,7 +229,8 @@ OsGetTable (
Status = RegOpenKey (Handle, KeyBuffer, &SubKey);
if (Status != ERROR_SUCCESS)
{
- AcpiOsPrintf ("Could not open %s entry\n", Signature);
+ AcpiOsPrintf ("Could not open %s entry: %s\n",
+ Signature, OsFormatException (Status));
return (NULL);
}
@@ -230,7 +248,8 @@ OsGetTable (
NULL, &Type, NULL, 0);
if (Status != ERROR_SUCCESS)
{
- AcpiOsPrintf ("Could not get %s registry entry\n", Signature);
+ AcpiOsPrintf ("Could not get %s registry entry: %s\n",
+ Signature, OsFormatException (Status));
return (NULL);
}
@@ -246,7 +265,8 @@ OsGetTable (
Status = RegQueryValueEx (Handle, KeyBuffer, NULL, NULL, NULL, &DataSize);
if (Status != ERROR_SUCCESS)
{
- AcpiOsPrintf ("Could not read the %s table size\n", Signature);
+ AcpiOsPrintf ("Could not read the %s table size: %s\n",
+ Signature, OsFormatException (Status));
return (NULL);
}
@@ -264,7 +284,8 @@ OsGetTable (
(UCHAR *) ReturnTable, &DataSize);
if (Status != ERROR_SUCCESS)
{
- AcpiOsPrintf ("Could not read %s data\n", Signature);
+ AcpiOsPrintf ("Could not read %s data: %s\n",
+ Signature, OsFormatException (Status));
AcpiOsFree (ReturnTable);
return (NULL);
}