ReactOS  0.4.13-dev-698-g77671f0
acpiioct.h
Go to the documentation of this file.
1 #pragma once
2 
3 #ifdef __cplusplus
4 extern "C" {
5 #endif
6 
7 #define ACPI_EVAL_INPUT_BUFFER_SIGNATURE 'BieA'
8 #define ACPI_EVAL_INPUT_BUFFER_SIMPLE_INTEGER_SIGNATURE 'IieA'
9 #define ACPI_EVAL_INPUT_BUFFER_SIMPLE_STRING_SIGNATURE 'SieA'
10 #define ACPI_EVAL_INPUT_BUFFER_COMPLEX_SIGNATURE 'CieA'
11 #define ACPI_EVAL_OUTPUT_BUFFER_SIGNATURE 'BoeA'
12 #if (NTDDI_VERSION >= NTDDI_VISTA)
13 #define ACPI_EVAL_INPUT_BUFFER_SIGNATURE_EX 'AieA'
14 #define ACPI_EVAL_INPUT_BUFFER_SIMPLE_INTEGER_SIGNATURE_EX 'DieA'
15 #define ACPI_EVAL_INPUT_BUFFER_SIMPLE_STRING_SIGNATURE_EX 'EieA'
16 #define ACPI_EVAL_INPUT_BUFFER_COMPLEX_SIGNATURE_EX 'FieA'
17 #define ACPI_ENUM_CHILDREN_OUTPUT_BUFFER_SIGNATURE 'GieA'
18 #define ACPI_ENUM_CHILDREN_INPUT_BUFFER_SIGNATURE 'HieA'
19 #endif
20 
21 #define ACPI_METHOD_ARGUMENT_INTEGER 0x0
22 #define ACPI_METHOD_ARGUMENT_STRING 0x1
23 #define ACPI_METHOD_ARGUMENT_BUFFER 0x2
24 #define ACPI_METHOD_ARGUMENT_PACKAGE 0x3
25 #define ACPI_METHOD_ARGUMENT_PACKAGE_EX 0x4
26 
27 #define ACPI_ACQUIRE_GLOBAL_LOCK_SIGNATURE 'LgaA'
28 #define ACPI_RELEASE_GLOBAL_LOCK_SIGNATURE 'LgrA'
29 
30 #define ACPI_OBJECT_HAS_CHILDREN 0x1
31 
32 #define ENUM_CHILDREN_IMMEDIATE_ONLY 0x1
33 #define ENUM_CHILDREN_MULTILEVEL 0x2
34 #define ENUM_CHILDREN_NAME_IS_FILTER 0x4
35 
36 typedef struct _ACPI_EVAL_INPUT_BUFFER {
38  _ANONYMOUS_UNION union {
43 
46  _ANONYMOUS_UNION union {
52 
55  _ANONYMOUS_UNION union {
62 
63 typedef struct _ACPI_METHOD_ARGUMENT {
66  _ANONYMOUS_UNION union {
72 
75  _ANONYMOUS_UNION union {
83 
84 typedef struct _ACPI_EVAL_OUTPUT_BUFFER {
91 
96 
101 
107 
114 
122 
129 
130 typedef struct _ACPI_ENUM_CHILD {
136 
143 
144 #define ACPI_METHOD_ARGUMENT_LENGTH( DataLength ) \
145  (FIELD_OFFSET(ACPI_METHOD_ARGUMENT, Data) + max(sizeof(ULONG), DataLength))
146 
147 #define ACPI_METHOD_ARGUMENT_LENGTH_FROM_ARGUMENT( Argument ) \
148  (ACPI_METHOD_ARGUMENT_LENGTH(((PACPI_METHOD_ARGUMENT)Argument)->DataLength))
149 
150 #define ACPI_METHOD_NEXT_ARGUMENT( Argument ) \
151  (PACPI_METHOD_ARGUMENT) ( (PUCHAR) Argument + \
152  ACPI_METHOD_ARGUMENT_LENGTH_FROM_ARGUMENT( Argument ) )
153 
154 
155 #define ACPI_METHOD_SET_ARGUMENT_INTEGER( MethodArgument, IntData ) \
156  { MethodArgument->Type = ACPI_METHOD_ARGUMENT_INTEGER; \
157  MethodArgument->DataLength = sizeof(ULONG); \
158  MethodArgument->Argument = IntData; }
159 
160 #define ACPI_METHOD_SET_ARGUMENT_STRING( Argument, StrData ) \
161  { Argument->Type = ACPI_METHOD_ARGUMENT_STRING; \
162  Argument->DataLength = strlen((PCHAR)StrData) + sizeof(UCHAR); \
163  RtlCopyMemory(&Argument->Data[0],(PUCHAR)StrData,Argument->DataLength); }
164 
165 #define ACPI_METHOD_SET_ARGUMENT_BUFFER( Argument, BuffData, BuffLength ) \
166  { Argument->Type = ACPI_METHOD_ARGUMENT_BUFFER; \
167  Argument->DataLength = BuffLength; \
168  RtlCopyMemory(&Argument->Data[0],(PUCHAR)BuffData,Argument->DataLength); }
169 
170 #define ACPI_ENUM_CHILD_LENGTH_FROM_CHILD( Child ) \
171  ( (2* sizeof (ULONG)) + Child->NameLength )
172 
173 #define ACPI_ENUM_CHILD_NEXT( Child ) \
174  (PACPI_ENUM_CHILD) ( (PUCHAR) Child + \
175  ACPI_ENUM_CHILD_LENGTH_FROM_CHILD( Child ) )
176 
177 #define IOCTL_ACPI_ASYNC_EVAL_METHOD CTL_CODE(FILE_DEVICE_ACPI, 0, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
178 #define IOCTL_ACPI_EVAL_METHOD CTL_CODE(FILE_DEVICE_ACPI, 1, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
179 #define IOCTL_ACPI_ACQUIRE_GLOBAL_LOCK CTL_CODE(FILE_DEVICE_ACPI, 4, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
180 #define IOCTL_ACPI_RELEASE_GLOBAL_LOCK CTL_CODE(FILE_DEVICE_ACPI, 5, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
181 
182 #if (NTDDI_VERSION >= NTDDI_VISTA)
183 #define IOCTL_ACPI_EVAL_METHOD_EX CTL_CODE(FILE_DEVICE_ACPI, 6, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
184 #define IOCTL_ACPI_ASYNC_EVAL_METHOD_EX CTL_CODE(FILE_DEVICE_ACPI, 7, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
185 #define IOCTL_ACPI_ENUM_CHILDREN CTL_CODE(FILE_DEVICE_ACPI, 8, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
186 #endif
187 
188 #ifdef __cplusplus
189 }
190 #endif
struct _ACPI_EVAL_INPUT_BUFFER_COMPLEX ACPI_EVAL_INPUT_BUFFER_COMPLEX
#define _Field_size_bytes_(size)
Definition: no_sal2.h:190
struct _ACPI_EVAL_INPUT_BUFFER ACPI_EVAL_INPUT_BUFFER
struct _ACPI_EVAL_INPUT_BUFFER * PACPI_EVAL_INPUT_BUFFER
_ANONYMOUS_UNION union _ACPI_EVAL_INPUT_BUFFER::@1810 DUMMYUNIONNAME
#define ANYSIZE_ARRAY
Definition: typedefs.h:45
ACPI_EVAL_OUTPUT_BUFFER UNALIGNED * PACPI_EVAL_OUTPUT_BUFFER
Definition: acpiioct.h:90
#define _ANONYMOUS_UNION
Definition: ntbasedef.h:30
char CHAR
Definition: xmlstorage.h:175
_Field_size_(StringLength) _Null_terminated_ UCHAR String[ANYSIZE_ARRAY]
struct _ACPI_EVAL_INPUT_BUFFER_SIMPLE_STRING_EX ACPI_EVAL_INPUT_BUFFER_SIMPLE_STRING_EX
static WCHAR String[]
Definition: stringtable.c:55
struct _ACPI_EVAL_INPUT_BUFFER_SIMPLE_STRING ACPI_EVAL_INPUT_BUFFER_SIMPLE_STRING
struct _ACPI_EVAL_INPUT_BUFFER_COMPLEX_EX ACPI_EVAL_INPUT_BUFFER_COMPLEX_EX
_Field_size_bytes_(Length) ACPI_METHOD_ARGUMENT Argument[ANYSIZE_ARRAY]
struct _ACPI_ENUM_CHILD ACPI_ENUM_CHILD
struct _ACPI_EVAL_INPUT_BUFFER_SIMPLE_INTEGER_EX * PACPI_EVAL_INPUT_BUFFER_SIMPLE_INTEGER_EX
_ANONYMOUS_UNION union _ACPI_EVAL_INPUT_BUFFER_SIMPLE_STRING::@1812 DUMMYUNIONNAME
struct _ACPI_EVAL_INPUT_BUFFER_COMPLEX_EX * PACPI_EVAL_INPUT_BUFFER_COMPLEX_EX
_Null_terminated_ CHAR MethodName[256]
Definition: acpiioct.h:99
_Field_size_bytes_(NameLength) _Null_terminated_ CHAR Name[ANYSIZE_ARRAY]
ACPI_ENUM_CHILD UNALIGNED * PACPI_ENUM_CHILD
Definition: acpiioct.h:135
struct _ACPI_ENUM_CHILDREN_INPUT_BUFFER ACPI_ENUM_CHILDREN_INPUT_BUFFER
ULONG NameLength
Definition: acpiioct.h:132
_ANONYMOUS_UNION union _ACPI_EVAL_INPUT_BUFFER_SIMPLE_INTEGER::@1811 DUMMYUNIONNAME
struct _ACPI_EVAL_INPUT_BUFFER_EX ACPI_EVAL_INPUT_BUFFER_EX
struct _ACPI_EVAL_INPUT_BUFFER_SIMPLE_INTEGER ACPI_EVAL_INPUT_BUFFER_SIMPLE_INTEGER
struct _ACPI_METHOD_ARGUMENT ACPI_METHOD_ARGUMENT
#define UNALIGNED
Definition: crtdefs.h:132
struct _ACPI_EVAL_INPUT_BUFFER_SIMPLE_STRING_EX * PACPI_EVAL_INPUT_BUFFER_SIMPLE_STRING_EX
_Null_terminated_ CHAR MethodName[256]
Definition: acpiioct.h:104
ACPI_METHOD_ARGUMENT Argument[ANYSIZE_ARRAY]
Definition: acpiioct.h:81
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
struct _ACPI_EVAL_INPUT_BUFFER_SIMPLE_INTEGER_EX ACPI_EVAL_INPUT_BUFFER_SIMPLE_INTEGER_EX
unsigned __int64 ULONG64
Definition: imports.h:198
unsigned char UCHAR
Definition: xmlstorage.h:181
_Field_size_bytes_(StringLength) _Null_terminated_ UCHAR String[ANYSIZE_ARRAY]
ACPI_ENUM_CHILD Children[ANYSIZE_ARRAY]
Definition: acpiioct.h:140
struct _ACPI_EVAL_INPUT_BUFFER_EX * PACPI_EVAL_INPUT_BUFFER_EX
struct _ACPI_EVAL_INPUT_BUFFER_SIMPLE_STRING * PACPI_EVAL_INPUT_BUFFER_SIMPLE_STRING
_ANONYMOUS_UNION union _ACPI_METHOD_ARGUMENT::@1813 DUMMYUNIONNAME
struct _ACPI_EVAL_INPUT_BUFFER_COMPLEX * PACPI_EVAL_INPUT_BUFFER_COMPLEX
unsigned short USHORT
Definition: pedump.c:61
_Field_size_bytes_(NameLength) _Null_terminated_ CHAR Name[ANYSIZE_ARRAY]
ACPI_METHOD_ARGUMENT UNALIGNED * PACPI_METHOD_ARGUMENT
Definition: acpiioct.h:71
_ANONYMOUS_UNION union _ACPI_EVAL_INPUT_BUFFER_COMPLEX::@1814 DUMMYUNIONNAME
_Field_size_(ArgumentCount) ACPI_METHOD_ARGUMENT Argument[ANYSIZE_ARRAY]
struct _ACPI_EVAL_INPUT_BUFFER_SIMPLE_INTEGER * PACPI_EVAL_INPUT_BUFFER_SIMPLE_INTEGER
ACPI_ENUM_CHILDREN_OUTPUT_BUFFER UNALIGNED * PACPI_ENUM_CHILDREN_OUTPUT_BUFFER
Definition: acpiioct.h:142
struct _ACPI_MANIPULATE_GLOBAL_LOCK_BUFFER ACPI_MANIPULATE_GLOBAL_LOCK_BUFFER
unsigned int ULONG
Definition: retypes.h:1
struct _ACPI_MANIPULATE_GLOBAL_LOCK_BUFFER * PACPI_MANIPULATE_GLOBAL_LOCK_BUFFER
struct _ACPI_EVAL_OUTPUT_BUFFER ACPI_EVAL_OUTPUT_BUFFER
#define _Null_terminated_
Definition: no_sal2.h:320
struct _ACPI_ENUM_CHILDREN_OUTPUT_BUFFER ACPI_ENUM_CHILDREN_OUTPUT_BUFFER
struct _ACPI_ENUM_CHILDREN_INPUT_BUFFER * PACPI_ENUM_CHILDREN_INPUT_BUFFER