I think you don’t really understand ASL/AML. There is no such thing in that
language as a generic “argument 0.” Every object has a type, and a method
can return any type of object. You need to know what type your object is.
Fortunately, the code told you.
As you know from reading my code, outputBuf is of type
ACPI_EVAL_OUTPUT_BUFFER. 12 bytes into that struct is ACPI_METHOD_ARGUMENT,
which I called acpiObj. So acpiObj starts at the byte that you’ve labeled
“c=outputBuf[12]”.
ACPI_METHOD_ARGUMENT itself has a Type field. That’s the type of your
object. In your case, that’s ACPI_METHOD_ARGUMENT_INTEGER. It also has a
Length field. Your output says that the returned integer was 4 bytes long.
(This is all just basic C programming, taken from the definitions of the
structs themselves, in acpiioctl.h. For instance, here’s
ACPI_METHOD_ARGUMENT. By casting, you can make the compiler do this work
for you.)
typedef struct _ACPI_METHOD_ARGUMENT {
USHORT Type;
USHORT DataLength;
union {
ULONG Argument;
UCHAR Data[ANYSIZE_ARRAY];
} DUMMYUNIONNAME;
} ACPI_METHOD_ARGUMENT;
Since you have a 4-byte integer, the value will be in *(PULONG)Data. In
your example below, that was 0.
Jake Oshins
Hyper-V I/O Architect
Windows Kernel Group
This post implies no warranties and confers no rights.
wrote in message news:xxxxx@ntdev…
Hi! Jake,
Have tried the code you provided. And since my ASL method ‘RTN0’ is
simply return an argument ‘0’, I define OUTPUT_BUF_SIZE =
(sizeof(ACPI_EVAL_OUTPUT_BUFFER) + (sizeof(ACPI_METHOD_ARGUMENT))) = 20
Your code is successfully processed and return status = 0! However, we
still cannot recognize the data retrieved from outputDesc and outputBuf :
outputDesc.Type = (1)
outputDesc.u.BufferType = (AeoB)
outputDesc.u.BufferType.Buffer = (AeoB)
outputDesc.u.BufferType.Buffer = (AeoB)
outputDesc.u.BufferType.Length = (28)
outputBuf[0] = (x=41), (c=A)
outputBuf[1] = (x=65), (c=e)
outputBuf[2] = (x=6f), (c=o)
outputBuf[3] = (x=42), (c=B)
outputBuf[4] = (x=14), (c=)
outputBuf[5] = (x=0), (c=outputBuf[6] = (x=0), (c=outputBuf[7] = (x=0),
(c=outputBuf[8] = (x=1), (c=)
outputBuf[9] = (x=0), (c=outputBuf[10] = (x=0), (c=outputBuf[11] = (x=0),
(c=outputBuf[12] = (x=0), (c=outputBuf[13] = (x=0), (c=outputBuf[14] =
(x=4), (c=)
outputBuf[15] = (x=0), (c=outputBuf[16] = (x=0), (c=outputBuf[17] = (x=0),
(c=outputBuf[18] = (x=0), (c=outputBuf[19] = (x=0), (c=outputBuf[20] =
(x=0), (c=outputBuf[21] = (x=0), (c=outputBuf[22] = (x=0), (c=outputBuf[23]
= (x=0), (c=outputBuf[24] = (x=0), (c=outputBuf[25] = (x=0),
(c=outputBuf[26] = (x=0), (c=outputBuf[27] = (x=0), (c=outputBuf[28] =
(x=52), (c=R)
(My outputBuf format :
KdPrintEx((DPFLTR_IHVDRIVER_ID, 0, “outputBuf[%d] = (x=%x), (c=%c)\n”,i,
outputBuf[i], outputBuf[i])); )
Could I have your comment again? Many thanks!
-tftu