Intel® Digital Set Top Box Display Driver 33
User’s Guide for Microsoft* Windows* CE 5.0
int number;//available attributes number
igd_attr_t *attr_list, *current;
/*other types such as igd_list_attr_t, igd_bool_attr_t, igd_string_attr_t
can refer to the implement of igd_range_attr_t as below*/
igd_range_attr_t *range; //(1)
esc_status_t status;
ExtEscape(
Hdc,
ICEGD_ESCAPE_GET_NUM_PD_ATTRIBUTES,
0,
NULL,
sizeof(unsigned int),
(LPSTR)&number);
//the attribute list should contain number entries of igd_attr_t.
attr_list = (igd_attr_t *) calloc(number, sizeof(igd_attr_t));
//now the attr_list is the old configure of port driver
ExtEscape(
Hdc,
ICEGD_ESCAPE_GET_AVAIL_PD_ATTRIBUTES,
0,
NULL,
number * sizeof(igd_attr_t),
(LPSTR) attr_list);
current = attr_list;
for (int i=0; i<number; i++, current++)
{
//choose attribute DACA, and the type of it must be range
if (current->id == 26 && current->type == PD_ATTR_TYPE_RANGE)
{
/*to set the value must force the structure convert from igd_attr_t
to igd_range_attr_t */
range = (igd_range_attr_t *) current;
//(2)
range->current_value = 2;
//(3)
memset(&status, 0, sizeof(esc_status_t));
ExtEscape(
Hdc,
ICEGD_ESCAPE_SET_PD_ATTRIBUTES,
sizeof(igd_attr_t),
(LPCSTR) current,
sizeof(esc_status_t),
(LPSTR) &status);
break;
}
/*if type is list, there will follow some entries, the number of which
is stored in the num_entries of the structure. So the pointer to the
list should jump num_entries to find next attribute*/
if (current->type == PD_ATTR_TYPE_LIST) {
i+= ((igd_list_attr_t *)current)->num_entries;
current += ((igd_list_attr_t *)current)->num_entries;
}
}
free(attr_list);