Add attributes control, hidden and restricted.

Correctly set the libflags for these attributes.
This commit is contained in:
Huw Davies 2005-01-09 17:59:44 +00:00 committed by Alexandre Julliard
parent bf3cf83e02
commit 634693c114
4 changed files with 27 additions and 0 deletions

View File

@ -228,6 +228,7 @@ static struct keyword {
/* ... */
{"helpstring", tHELPSTRING},
/* ... */
{"hidden", tHIDDEN},
{"hyper", tHYPER},
{"id", tID},
{"idempotent", tIDEMPOTENT},
@ -272,6 +273,7 @@ static struct keyword {
{"readonly", tREADONLY},
{"ref", tREF},
/* ... */
{"restricted", tRESTRICTED},
{"retval", tRETVAL},
/* ... */
{"short", tSHORT},

View File

@ -143,6 +143,7 @@ static type_t std_uhyper = { "MIDL_uhyper" };
%token tHANDLE
%token tHANDLET
%token tHELPSTRING
%token tHIDDEN
%token tHYPER tID tIDEMPOTENT
%token tIIDIS
%token tIMPORT tIMPORTLIB
@ -163,6 +164,7 @@ static type_t std_uhyper = { "MIDL_uhyper" };
%token tPROPGET tPROPPUT
%token tPUBLIC
%token tREADONLY tREF
%token tRESTRICTED
%token tRETVAL
%token tSHORT
%token tSIGNED
@ -346,6 +348,7 @@ attribute:
| tCONTEXTHANDLE { $$ = make_attrv(ATTR_CONTEXTHANDLE, 0); }
| tCONTEXTHANDLENOSERIALIZE { $$ = make_attrv(ATTR_CONTEXTHANDLE, 0); /* RPC_CONTEXT_HANDLE_DONT_SERIALIZE */ }
| tCONTEXTHANDLESERIALIZE { $$ = make_attrv(ATTR_CONTEXTHANDLE, 0); /* RPC_CONTEXT_HANDLE_SERIALIZE */ }
| tCONTROL { $$ = make_attr(ATTR_CONTROL); }
| tDEFAULT { $$ = make_attr(ATTR_DEFAULT); }
| tDEFAULTVALUE '(' expr_const ')' { $$ = make_attrp(ATTR_DEFAULTVALUE, $3); }
| tDEFAULTVALUE '(' aSTRING ')' { $$ = make_attrp(ATTR_DEFAULTVALUE, $3); }
@ -356,6 +359,7 @@ attribute:
| tENTRY '(' expr_const ')' { $$ = make_attrp(ATTR_ENTRY_ORDINAL, $3); }
| tHANDLE { $$ = make_attr(ATTR_HANDLE); }
| tHELPSTRING '(' aSTRING ')' { $$ = make_attrp(ATTR_HELPSTRING, $3); }
| tHIDDEN { $$ = make_attr(ATTR_HIDDEN); }
| tID '(' expr_const ')' { $$ = make_attrp(ATTR_ID, $3); }
| tIDEMPOTENT { $$ = make_attr(ATTR_IDEMPOTENT); }
| tIIDIS '(' ident ')' { $$ = make_attrp(ATTR_IIDIS, $3); }
@ -373,6 +377,7 @@ attribute:
| tPROPPUT { $$ = make_attr(ATTR_PROPPUT); }
| tPUBLIC { $$ = make_attr(ATTR_PUBLIC); }
| tREADONLY { $$ = make_attr(ATTR_READONLY); }
| tRESTRICTED { $$ = make_attr(ATTR_RESTRICTED); }
| tRETVAL { $$ = make_attr(ATTR_RETVAL); }
| tSIZEIS '(' m_exprs ')' { $$ = make_attrp(ATTR_SIZEIS, $3); }
| tSOURCE { $$ = make_attr(ATTR_SOURCE); }

View File

@ -60,6 +60,7 @@ enum attr_type
ATTR_CALLAS,
ATTR_CASE,
ATTR_CONTEXTHANDLE,
ATTR_CONTROL,
ATTR_DEFAULT,
ATTR_DEFAULTVALUE,
ATTR_DLLNAME,
@ -69,6 +70,7 @@ enum attr_type
ATTR_ENTRY_ORDINAL,
ATTR_HANDLE,
ATTR_HELPSTRING,
ATTR_HIDDEN,
ATTR_ID,
ATTR_IDEMPOTENT,
ATTR_IIDIS,
@ -87,6 +89,7 @@ enum attr_type
ATTR_PROPPUT,
ATTR_PUBLIC,
ATTR_READONLY,
ATTR_RESTRICTED,
ATTR_RETVAL,
ATTR_SIZEIS,
ATTR_SOURCE,

View File

@ -1396,7 +1396,24 @@ static void set_lcid(msft_typelib_t *typelib)
static void set_lib_flags(msft_typelib_t *typelib)
{
attr_t *attr;
typelib->typelib_header.flags = 0;
for(attr = typelib->typelib->attrs; attr; attr = NEXT_LINK(attr)) {
switch(attr->type) {
case ATTR_CONTROL:
typelib->typelib_header.flags |= 0x02; /* LIBFLAG_FCONTROL */
break;
case ATTR_HIDDEN:
typelib->typelib_header.flags |= 0x04; /* LIBFLAG_FHIDDEN */
break;
case ATTR_RESTRICTED:
typelib->typelib_header.flags |= 0x01; /* LIBFLAG_FRESTRICTED */
break;
default:
break;
}
}
return;
}