widl: Handle LPSTR in typelibs.
This commit is contained in:
parent
5861d08426
commit
d82b384859
|
@ -126,8 +126,9 @@ static int kw_cmp_func(const void *s1, const void *s2)
|
|||
return strcmp(KWP(s1)->kw, KWP(s2)->kw);
|
||||
}
|
||||
|
||||
static unsigned short builtin_vt(const char *kw)
|
||||
static unsigned short builtin_vt(const type_t *t)
|
||||
{
|
||||
const char *kw = t->name;
|
||||
struct oatype key, *kwp;
|
||||
key.kw = kw;
|
||||
#ifdef KW_BSEARCH
|
||||
|
@ -145,6 +146,13 @@ static unsigned short builtin_vt(const char *kw)
|
|||
if (kwp) {
|
||||
return kwp->vt;
|
||||
}
|
||||
if (is_string_type (t->attrs, t))
|
||||
switch (t->ref->type)
|
||||
{
|
||||
case RPC_FC_CHAR: return VT_LPSTR;
|
||||
case RPC_FC_WCHAR: return VT_LPWSTR;
|
||||
default: break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -160,7 +168,7 @@ unsigned short get_type_vt(type_t *t)
|
|||
|
||||
chat("get_type_vt: %p type->name %s\n", t, t->name);
|
||||
if (t->name) {
|
||||
vt = builtin_vt(t->name);
|
||||
vt = builtin_vt(t);
|
||||
if (vt) return vt;
|
||||
}
|
||||
|
||||
|
|
|
@ -852,6 +852,13 @@ static int encode_type(
|
|||
*encoded_type = default_type;
|
||||
break;
|
||||
|
||||
case VT_LPSTR:
|
||||
case VT_LPWSTR:
|
||||
*encoded_type = 0xfffe0000 | vt;
|
||||
*width = 4;
|
||||
*alignment = 4;
|
||||
break;
|
||||
|
||||
case VT_PTR:
|
||||
{
|
||||
int next_vt;
|
||||
|
|
Loading…
Reference in New Issue