1281 int *typedata, typedata_size;
1282 int i,
id, next_idx;
1284 int num_params = 0, num_optional = 0, num_defaults = 0;
1286 unsigned char *namedata;
1288 unsigned int funcflags = 0, callconv = 4 ;
1289 unsigned int funckind, invokekind = 1 ;
1290 int help_context = 0, help_string_context = 0, help_string_offset = -1;
1291 int entry = -1, entry_is_ord = 0;
1292 int lcid_retval_count = 0;
1296 id = ((0x6000 | (
typeinfo->typeinfo->datatype2 & 0xffff)) << 16) |
index;
1311 chat(
"add_func_desc: skipping local function\n");
1327 chat(
"add_func_desc: num of params %d\n", num_params);
1333 switch(
attr->type) {
1347 extra_attr =
max(extra_attr, 3);
1356 extra_attr =
max(extra_attr, 1);
1357 help_context =
expr->
u.lval;
1360 extra_attr =
max(extra_attr, 2);
1364 extra_attr =
max(extra_attr, 6);
1365 help_string_context =
expr->
u.lval;
1374 funcflags |= 0x1000;
1407 if (num_optional || num_defaults)
1408 warning(
"add_func_desc: ignoring vararg in function with optional or defaultvalue params\n");
1418 typedata_size = 0x18 + extra_attr *
sizeof(
int) + (num_params * (num_defaults ? 16 : 12));
1422 typeinfo->func_data_allocated = 0x100;
1426 if(
typeinfo->func_data[0] + typedata_size +
sizeof(
int) >
typeinfo->func_data_allocated) {
1428 typeinfo->func_data[0] + typedata_size +
sizeof(
int));
1433 typeinfo->func_data[0] += typedata_size;
1438 for(
i = 0;
i < (
typeinfo->typeinfo->cElement & 0xffff);
i++) {
1439 if(name_offset ==
typeinfo->func_names[
i]) {
1447 for(
i = 0;
i < (
typeinfo->typeinfo->cElement & 0xffff);
i++) {
1457 typedata[0] = typedata_size | (
index << 16);
1460 typedata[2] = funcflags;
1462 typedata[4] = (next_idx << 16) | (callconv << 8) | (invokekind << 3) | funckind;
1463 if(num_defaults) typedata[4] |= 0x1000;
1464 if(entry_is_ord) typedata[4] |= 0x2000;
1465 typedata[5] = (num_optional << 16) | num_params;
1469 typedata[3] += (16 * num_params) << 16;
1470 typedata[3] += (24 * num_defaults) << 16;
1472 switch(extra_attr) {
1473 case 6: typedata[11] = help_string_context;
1474 case 5: typedata[10] = -1;
1475 case 4: typedata[9] = -1;
1476 case 3: typedata[8] =
entry;
1477 case 2: typedata[7] = help_string_offset;
1478 case 1: typedata[6] = help_context;
1482 warning(
"unknown number of optional attrs\n");
1491 int *paramdata = typedata + 6 + extra_attr + (num_defaults ? num_params : 0) +
i * 3;
1492 int *defaultdata = num_defaults ? typedata + 6 + extra_attr +
i :
NULL;
1494 if(defaultdata) *defaultdata = -1;
1498 switch(
attr->type) {
1516 lcid_retval_count++;
1520 lcid_retval_count++;
1523 chat(
"unhandled param attr %d\n",
attr->type);
1528 paramdata[2] = paramflags;
1535 if(lcid_retval_count == 1)
1536 typedata[4] |= 0x4000;
1537 else if(lcid_retval_count == 2)
1538 typedata[4] |= 0x8000;
1540 if(
typeinfo->funcs_allocated == 0) {
1565 typeinfo->typeinfo->res3 += 0x38 + num_params * 0x10;
1566 if(num_defaults)
typeinfo->typeinfo->res3 += num_params * 0x4;
1569 if(funckind != 0x3 )
1576 if (*((
INT *)namedata) == -1) {
1577 *((
INT *)namedata) =
typeinfo->typelib->typelib_typeinfo_offsets[
typeinfo->typeinfo->typekind >> 16];
1579 namedata[9] |= 0x10;
1581 namedata[9] &= ~0x10;
1584 namedata[9] |= 0x20;
1592 if(
i != num_params - 1 || (invokekind != 0x4 && invokekind != 0x8 ))
1594 int *paramdata = typedata + 6 + extra_attr + (num_defaults ? num_params : 0) +
i * 3;
static var_list_t * type_get_function_args(const type_t *func_type)
static int ctl2_alloc_string(msft_typelib_t *typelib, const char *string)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
void * xrealloc(void *oldmem, size_t size)
_In_ fcb _In_ chunk _In_ uint64_t _In_ uint64_t _In_ bool _In_opt_ void _In_opt_ PIRP _In_ LIST_ENTRY _In_ uint8_t _In_ uint64_t decoded_size
unsigned int pointer_size
static int ctl2_alloc_name(msft_typelib_t *typelib, const char *name)
static void write_default_value(msft_typelib_t *typelib, type_t *type, expr_t *expr, int *out)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static int encode_var(msft_typelib_t *typelib, type_t *type, var_t *var, int *encoded_type, int *decoded_size)
static type_t * type_function_get_rettype(const type_t *type)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *