sync widl to wine 1.1.27

svn path=/trunk/; revision=42510
This commit is contained in:
Christoph von Wittich 2009-08-08 12:40:21 +00:00
parent 220177d4de
commit 4c4e558887
7 changed files with 619 additions and 569 deletions

View file

@ -534,19 +534,37 @@ unsigned int lhash_val_of_name_sys( syskind_t skind, LCID lcid, LPCSTR lpStr)
case LANG_SWEDISH: case LANG_SYRIAC: case LANG_TAMIL:
case LANG_TATAR: case LANG_TELUGU: case LANG_THAI:
case LANG_UKRAINIAN: case LANG_URDU: case LANG_UZBEK:
#ifndef __REACTOS__
case LANG_VIETNAMESE: case LANG_GAELIC: case LANG_MALTESE:
case LANG_TAJIK: case LANG_ROMANSH: case LANG_IRISH:
case LANG_SAMI: case LANG_UPPER_SORBIAN: case LANG_SUTU:
case LANG_TSONGA: case LANG_TSWANA: case LANG_VENDA:
case LANG_XHOSA: case LANG_ZULU: case LANG_ESPERANTO:
case LANG_WALON: case LANG_CORNISH: case LANG_WELSH:
case LANG_BRETON:
#else
case LANG_VIETNAMESE: case LANG_MALTESE: case LANG_IRISH:
case LANG_SAMI: case LANG_UPPER_SORBIAN: case LANG_TSWANA:
case LANG_SAMI: case LANG_UPPER_SORBIAN: case LANG_TSWANA:
case LANG_XHOSA: case LANG_ZULU: case LANG_WELSH:
case LANG_BRETON:
/* some languages not in all windows versions or ReactOS */
#ifdef LANG_GAELIC
case LANG_GAELIC:
#endif
#ifdef LANG_TAJIK
case LANG_TAJIK:
#endif
#ifdef LANG_ROMANSH
case LANG_ROMANSH:
#endif
#ifdef LANG_SUTU
case LANG_SUTU:
#endif
#ifdef LANG_TSONGA
case LANG_TSONGA:
#endif
#ifdef LANG_VENDA
case LANG_VENDA:
#endif
#ifdef LANG_ESPERANTO
case LANG_ESPERANTO:
#endif
#ifdef LANG_WALON
case LANG_WALON:
#endif
#ifdef LANG_CORNISH
case LANG_CORNISH:
#endif
nOffset = 16;
pnLookup = Lookup_16;

File diff suppressed because it is too large Load diff

View file

@ -509,6 +509,7 @@ attribute: { $$ = NULL; }
| tINPUTSYNC { $$ = make_attr(ATTR_INPUTSYNC); }
| tLENGTHIS '(' m_exprs ')' { $$ = make_attrp(ATTR_LENGTHIS, $3); }
| tLCID '(' expr_int_const ')' { $$ = make_attrp(ATTR_LIBLCID, $3); }
| tLCID { $$ = make_attr(ATTR_PARAMLCID); }
| tLOCAL { $$ = make_attr(ATTR_LOCAL); }
| tNONBROWSABLE { $$ = make_attr(ATTR_NONBROWSABLE); }
| tNONCREATABLE { $$ = make_attr(ATTR_NONCREATABLE); }
@ -1919,6 +1920,7 @@ struct allowed_attr allowed_attr[] =
/* ATTR_OLEAUTOMATION */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "oleautomation" },
/* ATTR_OPTIONAL */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "optional" },
/* ATTR_OUT */ { 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "out" },
/* ATTR_PARAMLCID */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "lcid" },
/* ATTR_POINTERDEFAULT */ { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "pointer_default" },
/* ATTR_POINTERTYPE */ { 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, "ref, unique or ptr" },
/* ATTR_PROPGET */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "propget" },

View file

@ -624,7 +624,8 @@ static void write_proxy(type_t *iface, unsigned int *proc_offset)
count = count_methods(iface);
/* proxy vtable */
print_proxy( "static const CINTERFACE_PROXY_VTABLE(%d) _%sProxyVtbl =\n", count, iface->name);
print_proxy( "static %sCINTERFACE_PROXY_VTABLE(%d) _%sProxyVtbl =\n",
need_delegation_indirect(iface) ? "" : "const ", count, iface->name);
print_proxy( "{\n");
indent++;
print_proxy( "{\n");

View file

@ -59,6 +59,7 @@ struct expr_eval_routine
const expr_t *expr;
};
static unsigned int field_memsize(const type_t *type, unsigned int *offset);
static unsigned int fields_memsize(const var_list_t *fields, unsigned int *align);
static unsigned int write_struct_tfs(FILE *file, type_t *type, const char *name, unsigned int *tfsoff);
static int write_embedded_types(FILE *file, const attr_list_t *attrs, type_t *type,
@ -978,14 +979,13 @@ static unsigned int write_conf_or_var_desc(FILE *file, const type_t *structure,
if (fields) LIST_FOR_EACH_ENTRY( var, fields, const var_t, entry )
{
unsigned int align = 0;
/* FIXME: take alignment into account */
unsigned int size = field_memsize( var->type, &offset );
if (var->name && !strcmp(var->name, subexpr->u.sval))
{
correlation_variable = var->type;
break;
}
offset += type_memsize(var->type, &align);
offset += size;
}
if (!correlation_variable)
error("write_conf_or_var_desc: couldn't find variable %s in structure\n",
@ -1081,9 +1081,18 @@ static unsigned int write_conf_or_var_desc(FILE *file, const type_t *structure,
return 4;
}
/* return size and start offset of a data field based on current offset */
static unsigned int field_memsize(const type_t *type, unsigned int *offset)
{
unsigned int align = 0;
unsigned int size = type_memsize( type, &align );
*offset = ROUND_SIZE( *offset, align );
return size;
}
static unsigned int fields_memsize(const var_list_t *fields, unsigned int *align)
{
int have_align = FALSE;
unsigned int size = 0;
const var_t *v;
@ -1092,11 +1101,7 @@ static unsigned int fields_memsize(const var_list_t *fields, unsigned int *align
{
unsigned int falign = 0;
unsigned int fsize = type_memsize(v->type, &falign);
if (!have_align)
{
*align = falign;
have_align = TRUE;
}
if (*align < falign) *align = falign;
size = ROUND_SIZE(size, falign);
size += fsize;
}
@ -1128,7 +1133,7 @@ static unsigned int union_memsize(const var_list_t *fields, unsigned int *pmaxa)
int get_padding(const var_list_t *fields)
{
unsigned short offset = 0;
int salign = -1;
unsigned int salign = 1;
const var_t *f;
if (!fields)
@ -1139,8 +1144,7 @@ int get_padding(const var_list_t *fields)
type_t *ft = f->type;
unsigned int align = 0;
unsigned int size = type_memsize(ft, &align);
if (salign == -1)
salign = align;
if (align > salign) salign = align;
offset = ROUND_SIZE(offset, align);
offset += size;
}
@ -1190,14 +1194,11 @@ unsigned int type_memsize(const type_t *t, unsigned int *align)
case TYPE_ENUM:
switch (get_enum_fc(t))
{
case RPC_FC_ENUM16:
case RPC_FC_ENUM32:
size = 4;
if (size > *align) *align = size;
break;
case RPC_FC_ENUM16:
size = 2;
if (size > *align) *align = size;
break;
default:
error("type_memsize: Unknown enum type\n");
size = 0;
@ -1517,12 +1518,15 @@ static void write_descriptors(FILE *file, type_t *type, unsigned int *tfsoff)
if (fs) LIST_FOR_EACH_ENTRY(f, fs, var_t, entry)
{
unsigned int align = 0;
type_t *ft = f->type;
unsigned int size = field_memsize( ft, &offset );
if (type_get_type(ft) == TYPE_UNION && is_attr(f->attrs, ATTR_SWITCHIS))
{
short reloff;
unsigned int absoff = ft->typestring_offset;
short reloff = absoff - (*tfsoff + 6);
if (is_attr(ft->attrs, ATTR_SWITCHTYPE))
absoff += 8; /* we already have a corr descr, skip it */
reloff = absoff - (*tfsoff + 6);
print_file(file, 0, "/* %d */\n", *tfsoff);
print_file(file, 2, "0x%x,\t/* FC_NON_ENCAPSULATED_UNION */\n", RPC_FC_NON_ENCAPSULATED_UNION);
print_file(file, 2, "0x%x,\t/* FIXME: always FC_LONG */\n", RPC_FC_LONG);
@ -1532,9 +1536,7 @@ static void write_descriptors(FILE *file, type_t *type, unsigned int *tfsoff)
reloff, reloff, absoff);
*tfsoff += 8;
}
/* FIXME: take alignment into account */
offset += type_memsize(ft, &align);
offset += size;
}
}
@ -2199,19 +2201,19 @@ static void write_struct_members(FILE *file, const type_t *type,
{
const var_t *field;
unsigned short offset = 0;
int salign = -1;
unsigned int salign = 1;
int padding;
var_list_t *fields = type_struct_get_fields(type);
if (fields) LIST_FOR_EACH_ENTRY( field, fields, const var_t, entry )
{
type_t *ft = field->type;
unsigned int align = 0;
unsigned int size = type_memsize(ft, &align);
if (salign < align) salign = align;
if (!is_conformant_array(ft) || type_array_is_decl_as_ptr(ft))
{
unsigned int align = 0;
unsigned int size = type_memsize(ft, &align);
if (salign == -1)
salign = align;
if ((align - 1) & offset)
{
unsigned char fc = 0;
@ -2313,8 +2315,7 @@ static unsigned int write_struct_tfs(FILE *file, type_t *type,
/* On the sizing pass, type->ptrdesc may be zero, but it's ok as
nothing is written to file yet. On the actual writing pass,
this will have been updated. */
unsigned int absoff = type_get_real_type(type)->ptrdesc ?
type_get_real_type(type)->ptrdesc : *tfsoff;
unsigned int absoff = type->ptrdesc ? type->ptrdesc : *tfsoff;
int reloff = absoff - *tfsoff;
assert( reloff >= 0 );
print_file(file, 2, "NdrFcShort(0x%hx),\t/* Offset= %d (%u) */\n",
@ -2340,7 +2341,7 @@ static unsigned int write_struct_tfs(FILE *file, type_t *type,
{
const var_t *f;
type_get_real_type(type)->ptrdesc = *tfsoff;
type->ptrdesc = *tfsoff;
if (fields) LIST_FOR_EACH_ENTRY(f, fields, const var_t, entry)
{
type_t *ft = f->type;
@ -2365,8 +2366,8 @@ static unsigned int write_struct_tfs(FILE *file, type_t *type,
write_nonsimple_pointer(file, f->attrs, ft, FALSE, offset, tfsoff);
}
}
if (type_get_real_type(type)->ptrdesc == *tfsoff)
type_get_real_type(type)->ptrdesc = 0;
if (type->ptrdesc == *tfsoff)
type->ptrdesc = 0;
}
current_structure = save_current_structure;
@ -2509,6 +2510,7 @@ static unsigned int write_union_tfs(FILE *file, type_t *type, unsigned int *tfso
*tfsoff += write_conf_or_var_desc(file, NULL, *tfsoff, st, &dummy_expr );
print_file(file, 2, "NdrFcShort(0x2),\t/* Offset= 2 (%u) */\n", *tfsoff + 2);
*tfsoff += 2;
print_file(file, 0, "/* %u */\n", *tfsoff);
}
print_file(file, 2, "NdrFcShort(0x%hx),\t/* %d */\n", size, size);
@ -3989,6 +3991,19 @@ void write_exceptions( FILE *file )
fprintf( file, " __DECL_EXCEPTION_FRAME\n");
fprintf( file, "};\n");
fprintf( file, "\n");
fprintf( file, "static inline void __widl_unwind_target(void)\n" );
fprintf( file, "{\n");
fprintf( file, " struct __exception_frame *exc_frame = (struct __exception_frame *)__wine_get_frame();\n" );
fprintf( file, " if (exc_frame->finally_level > exc_frame->filter_level)\n" );
fprintf( file, " {\n");
fprintf( file, " exc_frame->abnormal_termination = 1;\n");
fprintf( file, " exc_frame->finally( exc_frame );\n");
fprintf( file, " __wine_pop_frame( &exc_frame->frame );\n");
fprintf( file, " }\n");
fprintf( file, " exc_frame->filter_level = 0;\n");
fprintf( file, " siglongjmp( exc_frame->jmp, 1 );\n");
fprintf( file, "}\n");
fprintf( file, "\n");
fprintf( file, "static DWORD __widl_exception_handler( EXCEPTION_RECORD *record,\n");
fprintf( file, " EXCEPTION_REGISTRATION_RECORD *frame,\n");
fprintf( file, " CONTEXT *context,\n");
@ -4007,17 +4022,7 @@ void write_exceptions( FILE *file )
fprintf( file, " }\n" );
fprintf( file, " exc_frame->code = record->ExceptionCode;\n");
fprintf( file, " if (exc_frame->filter_level && exc_frame->filter( record, exc_frame ) == EXCEPTION_EXECUTE_HANDLER)\n" );
fprintf( file, " {\n");
fprintf( file, " __wine_rtl_unwind( frame, record );\n");
fprintf( file, " if (exc_frame->finally_level > exc_frame->filter_level)\n" );
fprintf( file, " {\n");
fprintf( file, " exc_frame->abnormal_termination = 1;\n");
fprintf( file, " exc_frame->finally( exc_frame );\n");
fprintf( file, " __wine_pop_frame( frame );\n");
fprintf( file, " }\n");
fprintf( file, " exc_frame->filter_level = 0;\n");
fprintf( file, " siglongjmp( exc_frame->jmp, 1 );\n");
fprintf( file, " }\n");
fprintf( file, " __wine_rtl_unwind( frame, record, __widl_unwind_target );\n");
fprintf( file, " return ExceptionContinueSearch;\n");
fprintf( file, "}\n");
fprintf( file, "\n");

View file

@ -129,6 +129,7 @@ enum attr_type
ATTR_OLEAUTOMATION,
ATTR_OPTIONAL,
ATTR_OUT,
ATTR_PARAMLCID,
ATTR_POINTERDEFAULT,
ATTR_POINTERTYPE,
ATTR_PROPGET,

View file

@ -139,7 +139,7 @@ static void ctl2_init_header(
typelib->typelib_header.magic1 = 0x5446534d;
typelib->typelib_header.magic2 = 0x00010002;
typelib->typelib_header.posguid = -1;
typelib->typelib_header.lcid = 0x0409; /* or do we use the current one? */
typelib->typelib_header.lcid = 0x0409;
typelib->typelib_header.lcid2 = 0x0;
typelib->typelib_header.varflags = 0x40;
typelib->typelib_header.version = 0;
@ -1265,6 +1265,7 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, var_t *func, int index)
unsigned int funckind, invokekind = 1 /* INVOKE_FUNC */;
int help_context = 0, help_string_context = 0, help_string_offset = -1;
int entry = -1, entry_is_ord = 0;
int lcid_retval_count = 0;
chat("add_func_desc(%p,%d)\n", typeinfo, index);
@ -1495,9 +1496,13 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, var_t *func, int index)
case ATTR_OUT:
paramflags |= 0x02; /* PARAMFLAG_FOUT */
break;
case ATTR_PARAMLCID:
paramflags |= 0x04; /* PARAMFLAG_LCID */
lcid_retval_count++;
break;
case ATTR_RETVAL:
paramflags |= 0x08; /* PARAMFLAG_FRETVAL */
typedata[4] |= 0x4000;
lcid_retval_count++;
break;
default:
chat("unhandled param attr %d\n", attr->type);
@ -1507,10 +1512,16 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, var_t *func, int index)
paramdata[1] = -1;
paramdata[2] = paramflags;
typedata[3] += decoded_size << 16;
i++;
}
}
if(lcid_retval_count == 1)
typedata[4] |= 0x4000;
else if(lcid_retval_count == 2)
typedata[4] |= 0x8000;
if(typeinfo->funcs_allocated == 0) {
typeinfo->funcs_allocated = 10;
typeinfo->func_indices = xmalloc(typeinfo->funcs_allocated * sizeof(int));
@ -2349,7 +2360,11 @@ static void set_help_string_context(msft_typelib_t *typelib)
static void set_lcid(msft_typelib_t *typelib)
{
const expr_t *lcid_expr = get_attrp( typelib->typelib->attrs, ATTR_LIBLCID );
typelib->typelib_header.lcid2 = lcid_expr ? lcid_expr->cval : 0x0;
if(lcid_expr)
{
typelib->typelib_header.lcid = lcid_expr->cval;
typelib->typelib_header.lcid2 = lcid_expr->cval;
}
}
static void set_lib_flags(msft_typelib_t *typelib)