Discussion:
GetSystemFirmwareTable - Why does this not work?
(too old to reply)
ananda
2006-05-19 21:50:01 UTC
Permalink
#include <windows.h>
#include <string.h>
#include <stdio.h>
#include <iostream.h>

ULONG_PTR
main(ULONG_PTR argc, char *argv[])
/*++
Description: The input to this can be
- a.pat b.pat c.pat abcd\q.pat fgh\m.apt xyz\* pqr\?.pat g.pat
- ListFile with the above list
--*/
{

UCHAR pFirmwareTableBuffer1[0x100];
UCHAR pFirmwareTableBuffer2[0x100];
ULONG_PTR retValue;
ULONG_PTR err;

retValue = EnumSystemFirmwareTables('ACPI', pFirmwareTableBuffer1, 0x100);

printf("Ret vlaue 1= %d\n", retValue);

//
// Return 20 and pFirmwareTableBuffer1 has
// FACP APIC SPCR MCFG OEMB
//

retValue = GetSystemFirmwareTable('ACPI', 'FACP', pFirmwareTableBuffer2,
0x100);

err = GetLastError();
printf("Ret vlaue 2 = %d, Err = %d\n", retValue, err);

//
// Returns 0 and err = 1168 - No elements found - Why should this fail?
//

}

Please help
thanks
ananda
Poppy Cock
2008-12-18 22:17:48 UTC
Permalink
What a moron - you have the endian values wrong on your hex calculations for
the appropriate table offset, based on the table offset calculation section
8.3 of the ACPI 2.0 specification and later.

This is such a begineer's mistake. I can't believe the ignorance.

url:http://ureader.com/msg/1483318.aspx

Loading...