ADL (AMD Display Library) Public APIs  Version 17.1
structures.h
Go to the documentation of this file.
1 // Transitional representation of an XML File
2 
3 #ifndef STRUCTURES_H_
4 #define STRUCTURES_H_
5 
6 #define AP_KEY "AA1027cp"
7 #define EMPTY 0xFFFFFFFF
8 #define PROPERTYNAMESIZE 16
9 #define DIGEST_SIZE 20
10 #define XML_MAX_LINE 16384
11 
12 #define CURRENT_BLOB_FILE_VERSION (1)
13 
14 // ENUM's
15 typedef enum PRIVACYTYPES {
16  Undefined = 0,
17  Defined = 1, // 0x0001
18  ProfilesOnly = 3, // 0x0011
19  ApplicationsOnly = 5, // 0x0101
20  ApplicationsAndProfiles = 7 // 0x0111
22 
23 typedef enum DATATYPES {
32 
33 // Common typedef's for transitional and compacts
34 
35 typedef struct TABLES{
36  unsigned int Offset; // In units of QWORDs relative to start of Buffer
37  unsigned int Length; // In units of QWORDs relative to start of Buffer
39 
40 typedef struct STRINGS{
41  unsigned int Offset; // In units of QWORDs relative to start of Buffer
42  unsigned int Length; // In units of BYTES relative to start of Buffer, not including NUL in case of "wchar_ts" (though buffer contains it)
44 
45 typedef struct ELEMENTS{
46  unsigned int Index; // In units of QWORDs relative to start of Buffer
48 
49 typedef struct BLOBS{
50  unsigned int Size; // In units of QWORDs of the VALUE of this datum
52 
53 // interim typedef's
54 
55 typedef struct DRIVER {
56  wchar_t* NameOfDriver;
58 
62 
63 typedef struct PROPERTY {
65  wchar_t* NameOfProperty;
68 
73 
74 typedef struct AREA {
77  struct AREA* NextArea;
78 
80 } AREA;
81 
82 typedef struct VALUE {
83  wchar_t* DataOfValue; // this is the data of the value, a text node in XML
84  int iLengthOfValue; // Length of Value in sizeof(wchar_t)
85  PROPERTY* PropertyOfValue; // pointer to the actual property entry
86  struct VALUE* NextValue;
87 
90 
91 typedef struct PROFILE {
97 
98  // store strings offset and length
103 
104 typedef struct USE {
106  DRIVER* DriverOfTheProfileToUse; // normalized pointer
107  struct USE* NextUse;
108 
111 } USE;
112 
113 typedef struct APPLICATION {
114  wchar_t* TitleOfApplicationRecord; // "named string"
115  wchar_t* FilenameOfThisApplication; // "general string"
116  wchar_t* PartialPathOfApplication; // "general string"
117  wchar_t* Version; // "numerical string" ???
120 
124  STRINGS strsVersion; // "numerical string" ???
127 
128 typedef struct CUSTOMISATIONS {
132  wchar_t* Content;
133  wchar_t* Release;
134  wchar_t* Format;
135 
140 
141 // Start of compact data types
142 
143 typedef struct DRIVER_COMPACT {
146 #if defined (LINUX)
147 } __attribute__ ((packed)) __attribute__ ((aligned (1))) DRIVER_COMPACT; // This is needed for Linux because structure is aligned different from Windows by default. Using single byte alignment to match Windows
148 #else
150 #endif
151 
152 typedef struct PROPERTY_COMPACT {
157 #if defined (LINUX)
158 } __attribute__ ((packed)) __attribute__ ((aligned (1))) PROPERTY_COMPACT; // This is needed for Linux because structure is aligned different from Windows by default. Using single byte alignment to match Windows
159 #else
161 #endif
162 
163 typedef struct AREA_COMPACT {
166 #if defined (LINUX)
167 } __attribute__ ((packed)) __attribute__ ((aligned (1))) AREA_COMPACT; // This is needed for Linux because structure is aligned different from Windows by default. Using single byte alignment to match Windows
168 #else
169 } AREA_COMPACT;
170 #endif
171 
172 typedef struct VALUE_COMPACT {
175 #if defined (LINUX)
176 } __attribute__ ((packed)) __attribute__ ((aligned (1))) VALUE_COMPACT; // This is needed for Linux because structure is aligned different from Windows by default. Using single byte alignment to match Windows
177 #else
178 } VALUE_COMPACT;
179 #endif
180 
181 typedef struct PROFILE_COMPACT {
189 #if defined (LINUX)
190 } __attribute__ ((packed)) __attribute__ ((aligned (1))) PROFILE_COMPACT; // This is needed for Linux because structure is aligned different from Windows by default. Using single byte alignment to match Windows
191 #else
193 #endif
194 
195 typedef struct USE_COMPACT {
198 #if defined (LINUX)
199 } __attribute__ ((packed)) __attribute__ ((aligned (1))) USE_COMPACT; // This is needed for Linux because structure is aligned different from Windows by default. Using single byte alignment to match Windows
200 #else
201 } USE_COMPACT;
202 #endif
203 
204 typedef struct APPLICATION_COMPACT {
210 #if defined (LINUX)
211 } __attribute__ ((packed)) __attribute__ ((aligned (1))) APPLICATION_COMPACT; // This is needed for Linux because structure is aligned different from Windows by default. Using single byte alignment to match Windows
212 #else
214 #endif
215 
216 typedef struct BODY {
224  unsigned long long Buffer[1];
225 #if defined (LINUX)
226 } __attribute__ ((packed)) __attribute__ ((aligned (1))) BODY; // This is needed for Linux because structure is aligned different from Windows by default. Using single byte alignment to match Windows
227 #else
228 } BODY;
229 #endif
230 
231 typedef struct HEADER {
232  unsigned char PreAmble[4];
233  unsigned int Version;
234  unsigned char Digest[DIGEST_SIZE];
236 #if defined (LINUX)
237 } __attribute__ ((packed)) __attribute__ ((aligned (1))) HEADER; // This is needed for Linux because structure is aligned different from Windows by default. Using single byte alignment to match Windows
238 #else
239 } HEADER;
240 #endif
241 
242 typedef struct BINFILE {
245 #if defined (LINUX)
246 } __attribute__ ((packed)) __attribute__ ((aligned (1))) BINFILE; // This is needed for Linux because structure is aligned different from Windows by default. Using single byte alignment to match Windows
247 #else
248 } BINFILE;
249 #endif
250 
251 // end of all data types
252 
253 // Local structures
254 // Internal type used to store interim string table and used for look up.
255 typedef struct WORDITEM{
256  wchar_t *WordItem; // one actual array item data, can add more of these if needed
257  STRINGS Strings; // STRINGS representation of the string in the local COMPACT string table
259 
260 
261 #endif // STRUCTURES_H_
AREA::DriverComponent
DRIVER * DriverComponent
Definition: structures.h:75
BODY
Definition: structures.h:216
APPLICATION::TitleOfApplicationRecord
wchar_t * TitleOfApplicationRecord
Definition: structures.h:114
DT_Stringed
@ DT_Stringed
Definition: structures.h:30
VALUE::NextValue
struct VALUE * NextValue
Definition: structures.h:86
CUSTOMISATIONS
Definition: structures.h:128
TABLES::Length
unsigned int Length
Definition: structures.h:37
DRIVER
Definition: structures.h:55
USE::elmUse
ELEMENTS elmUse
Definition: structures.h:110
TABLES
struct TABLES TABLES
PROFILE
struct PROFILE PROFILE
APPLICATION::NextApplication
struct APPLICATION * NextApplication
Definition: structures.h:119
APPLICATION::Version
wchar_t * Version
Definition: structures.h:117
APPLICATION::strsPartialPathOfApplication
STRINGS strsPartialPathOfApplication
Definition: structures.h:123
ApplicationsAndProfiles
@ ApplicationsAndProfiles
Definition: structures.h:20
VALUE
Definition: structures.h:82
APPLICATION_COMPACT
Definition: structures.h:204
APPLICATION::PartialPathOfApplication
wchar_t * PartialPathOfApplication
Definition: structures.h:116
PROPERTY
struct PROPERTY PROPERTY
VALUE
struct VALUE VALUE
PROFILE::strsNameOfThisProfile
STRINGS strsNameOfThisProfile
Definition: structures.h:99
BODY::Area
TABLES Area
Definition: structures.h:220
VALUE_COMPACT
Definition: structures.h:172
BODY::Profile
TABLES Profile
Definition: structures.h:221
APPLICATION::strsFilenameOfThisApplication
STRINGS strsFilenameOfThisApplication
Definition: structures.h:122
PROPERTY_COMPACT
Definition: structures.h:152
Undefined
@ Undefined
Definition: structures.h:16
CUSTOMISATIONS::strsRelease
STRINGS strsRelease
Definition: structures.h:137
WORDITEM
Definition: structures.h:255
PROFILE::NotesAboutThisProfile
wchar_t * NotesAboutThisProfile
Definition: structures.h:94
PROPERTY_COMPACT::NextPropertyForThisDriver
ELEMENTS NextPropertyForThisDriver
Definition: structures.h:156
DT_Dword
@ DT_Dword
Definition: structures.h:27
CUSTOMISATIONS::strsFormat
STRINGS strsFormat
Definition: structures.h:138
APPLICATION_COMPACT::FirstUseForThisApplication
ELEMENTS FirstUseForThisApplication
Definition: structures.h:209
APPLICATION::HeadUse
USE * HeadUse
Definition: structures.h:118
BLOBS
Definition: structures.h:49
AREA::NextArea
struct AREA * NextArea
Definition: structures.h:77
AREA
Definition: structures.h:74
DRIVER::strsNameOfDriver
STRINGS strsNameOfDriver
Definition: structures.h:59
TABLES
Definition: structures.h:35
APPLICATION_COMPACT::VersionNumberOfThisApplication
STRINGS VersionNumberOfThisApplication
Definition: structures.h:208
PROFILE::NameOfThisProfile
wchar_t * NameOfThisProfile
Definition: structures.h:93
DT_Boolean
@ DT_Boolean
Definition: structures.h:28
HEADER::Version
unsigned int Version
Definition: structures.h:233
PROPERTY_COMPACT::SetOfValidEnumeratedStringsTokenised
STRINGS SetOfValidEnumeratedStringsTokenised
Definition: structures.h:155
PROFILE_COMPACT::NotesAboutThisProfile
STRINGS NotesAboutThisProfile
Definition: structures.h:184
DRIVER_COMPACT::Privacy
PRIVACYTYPES Privacy
Definition: structures.h:145
PROFILE_COMPACT
Definition: structures.h:181
DRIVER::Privacy
PRIVACYTYPES Privacy
Definition: structures.h:57
VALUE::DataOfValue
wchar_t * DataOfValue
Definition: structures.h:83
DRIVER::elmDriver
ELEMENTS elmDriver
Definition: structures.h:60
CUSTOMISATIONS::Content
wchar_t * Content
Definition: structures.h:132
APPLICATION_COMPACT::PartialPathWhereThisApplicationResides
STRINGS PartialPathWhereThisApplicationResides
Definition: structures.h:207
USE
struct USE USE
DRIVER_COMPACT
Definition: structures.h:143
PROFILE_COMPACT::FirstValueOfThisProfile
struct VALUE_COMPACT FirstValueOfThisProfile
Definition: structures.h:188
PROPERTY::NextProperty
struct PROPERTY * NextProperty
Definition: structures.h:67
CUSTOMISATIONS::Format
wchar_t * Format
Definition: structures.h:134
BODY::Driver
TABLES Driver
Definition: structures.h:218
USE::NameOfTheProfileToUse
wchar_t * NameOfTheProfileToUse
Definition: structures.h:105
PROPERTYNAMESIZE
#define PROPERTYNAMESIZE
Definition: structures.h:8
TABLES::Offset
unsigned int Offset
Definition: structures.h:36
PROPERTY::elmProperty
ELEMENTS elmProperty
Definition: structures.h:71
__attribute__
struct DRIVER_COMPACT __attribute__((packed)) __attribute__((aligned(1))) DRIVER_COMPACT
AREA::HeadProperty
PROPERTY * HeadProperty
Definition: structures.h:76
CUSTOMISATIONS::HeadProfile
PROFILE * HeadProfile
Definition: structures.h:130
WORDITEM::Strings
STRINGS Strings
Definition: structures.h:257
BODY::Buffer
unsigned long long Buffer[1]
Definition: structures.h:224
WORDITEM
struct WORDITEM WORDITEM
PROFILE::DriverThisProfileBelongsTo
DRIVER * DriverThisProfileBelongsTo
Definition: structures.h:92
ApplicationsOnly
@ ApplicationsOnly
Definition: structures.h:19
PROPERTY::strsNameOfProperty
STRINGS strsNameOfProperty
Definition: structures.h:69
DRIVER::NameOfDriver
wchar_t * NameOfDriver
Definition: structures.h:56
BODY::Property
TABLES Property
Definition: structures.h:219
DT_Unknown
@ DT_Unknown
Definition: structures.h:24
APPLICATION::strsTitleOfApplicationRecord
STRINGS strsTitleOfApplicationRecord
Definition: structures.h:121
BODY::Application
TABLES Application
Definition: structures.h:223
USE::strsNameOfTheProfileToUse
STRINGS strsNameOfTheProfileToUse
Definition: structures.h:109
APPLICATION_COMPACT::FilenameOfThisApplication
STRINGS FilenameOfThisApplication
Definition: structures.h:206
APPLICATION_COMPACT::TitleGivenToThisApplicationRecord
STRINGS TitleGivenToThisApplicationRecord
Definition: structures.h:205
PRIVACYTYPES
PRIVACYTYPES
Definition: structures.h:15
DT_Enumerated
@ DT_Enumerated
Definition: structures.h:29
BINFILE
Definition: structures.h:242
PROPERTY_COMPACT::NameOfThisProperty
STRINGS NameOfThisProperty
Definition: structures.h:154
PROFILE_COMPACT::AggregateSizeOfTheValues
unsigned int AggregateSizeOfTheValues
Definition: structures.h:186
CUSTOMISATIONS::HeadApplication
APPLICATION * HeadApplication
Definition: structures.h:131
DIGEST_SIZE
#define DIGEST_SIZE
Definition: structures.h:9
BINFILE::Body
BODY Body
Definition: structures.h:244
PROPERTY::strsSetOfValidEnumStringsTokenised
STRINGS strsSetOfValidEnumStringsTokenised
Definition: structures.h:70
AREA_COMPACT
Definition: structures.h:163
HEADER::Digest
unsigned char Digest[20]
Definition: structures.h:234
CUSTOMISATIONS::Release
wchar_t * Release
Definition: structures.h:133
PROFILE::elmProfile
ELEMENTS elmProfile
Definition: structures.h:101
HEADER::Release
STRINGS Release
Definition: structures.h:235
AREA_COMPACT::FirstPropertyForThisDriver
ELEMENTS FirstPropertyForThisDriver
Definition: structures.h:165
PROFILE_COMPACT::NameOfThisProfile
STRINGS NameOfThisProfile
Definition: structures.h:183
CUSTOMISATIONS::HeadArea
AREA * HeadArea
Definition: structures.h:129
PROFILE
Definition: structures.h:91
AREA::elmArea
ELEMENTS elmArea
Definition: structures.h:79
VALUE::strsDataOfValue
STRINGS strsDataOfValue
Definition: structures.h:88
USE_COMPACT::NextUseForThisApplication
ELEMENTS NextUseForThisApplication
Definition: structures.h:197
PROPERTY::DataType
DATATYPES DataType
Definition: structures.h:64
STRINGS::Offset
unsigned int Offset
Definition: structures.h:41
VALUE::PropertyOfValue
PROPERTY * PropertyOfValue
Definition: structures.h:85
Defined
@ Defined
Definition: structures.h:17
APPLICATION
struct APPLICATION APPLICATION
WORDITEM::WordItem
wchar_t * WordItem
Definition: structures.h:256
BLOBS::Size
unsigned int Size
Definition: structures.h:50
HEADER
Definition: structures.h:231
APPLICATION::strsVersion
STRINGS strsVersion
Definition: structures.h:124
BLOBS
struct BLOBS BLOBS
VALUE::iLengthOfValue
int iLengthOfValue
Definition: structures.h:84
DRIVER_COMPACT::NameOfThisDriver
STRINGS NameOfThisDriver
Definition: structures.h:144
STRINGS::Length
unsigned int Length
Definition: structures.h:42
APPLICATION
Definition: structures.h:113
PROPERTY::NameOfProperty
wchar_t * NameOfProperty
Definition: structures.h:65
APPLICATION::elmApplication
ELEMENTS elmApplication
Definition: structures.h:125
VALUE_COMPACT::ValueSizeFollowedByActualDatum
BLOBS ValueSizeFollowedByActualDatum
Definition: structures.h:174
PROPERTY
Definition: structures.h:63
PROFILE::HeadValue
VALUE * HeadValue
Definition: structures.h:95
PROFILE::strsNotesAboutThisProfile
STRINGS strsNotesAboutThisProfile
Definition: structures.h:100
PROPERTY::SetOfValidEnumStringsTokenised
wchar_t * SetOfValidEnumStringsTokenised
Definition: structures.h:66
BINFILE::Header
HEADER Header
Definition: structures.h:243
ELEMENTS
Definition: structures.h:45
ProfilesOnly
@ ProfilesOnly
Definition: structures.h:18
ELEMENTS::Index
unsigned int Index
Definition: structures.h:46
BODY::Words
TABLES Words
Definition: structures.h:217
USE_COMPACT::TheProfileToUse
ELEMENTS TheProfileToUse
Definition: structures.h:196
USE_COMPACT
Definition: structures.h:195
CUSTOMISATIONS::strsContent
STRINGS strsContent
Definition: structures.h:136
DT_Binary
@ DT_Binary
Definition: structures.h:25
DT_Qword
@ DT_Qword
Definition: structures.h:26
PROFILE::NextProfile
struct PROFILE * NextProfile
Definition: structures.h:96
ELEMENTS
struct ELEMENTS ELEMENTS
PROFILE_COMPACT::NumberOfValuesInThisProfile
unsigned int NumberOfValuesInThisProfile
Definition: structures.h:187
USE::NextUse
struct USE * NextUse
Definition: structures.h:107
PROFILE_COMPACT::FirstNameValuePairForThisProfile
ELEMENTS FirstNameValuePairForThisProfile
Definition: structures.h:185
APPLICATION::FilenameOfThisApplication
wchar_t * FilenameOfThisApplication
Definition: structures.h:115
USE
Definition: structures.h:104
CUSTOMISATIONS
struct CUSTOMISATIONS CUSTOMISATIONS
BODY::Use
TABLES Use
Definition: structures.h:222
STRINGS
struct STRINGS STRINGS
USE::DriverOfTheProfileToUse
DRIVER * DriverOfTheProfileToUse
Definition: structures.h:106
PROFILE_COMPACT::TheDriverThisProfileBelongsTo
ELEMENTS TheDriverThisProfileBelongsTo
Definition: structures.h:182
STRINGS
Definition: structures.h:40
HEADER::PreAmble
unsigned char PreAmble[4]
Definition: structures.h:232
AREA_COMPACT::TheDriverThisSetOfAreaBelongsTo
ELEMENTS TheDriverThisSetOfAreaBelongsTo
Definition: structures.h:164
DATATYPES
DATATYPES
Definition: structures.h:23
VALUE_COMPACT::NameOfThisProperty
char NameOfThisProperty[16]
Definition: structures.h:173
AREA
struct AREA AREA
PROPERTY_COMPACT::DataTypeOfThisProperty
DATATYPES DataTypeOfThisProperty
Definition: structures.h:153
DRIVER
struct DRIVER DRIVER

Copyright © 2009-2020 Advanced Micro Devices, Inc. All rights reserved.