Commit b6bfd6d3 authored by Andrew Eikum's avatar Andrew Eikum Committed by Alexandre Julliard

oleaut32: Assign MEMBERIDs to vardescs without one.

parent 341ff65b
...@@ -4032,6 +4032,7 @@ static void test_SetVarHelpContext(void) ...@@ -4032,6 +4032,7 @@ static void test_SetVarHelpContext(void)
ok(hr == TYPE_E_ELEMENTNOTFOUND, "got %08x\n", hr); ok(hr == TYPE_E_ELEMENTNOTFOUND, "got %08x\n", hr);
memset(&desc, 0, sizeof(desc)); memset(&desc, 0, sizeof(desc));
desc.memid = MEMBERID_NIL;
desc.elemdescVar.tdesc.vt = VT_INT; desc.elemdescVar.tdesc.vt = VT_INT;
desc.varkind = VAR_CONST; desc.varkind = VAR_CONST;
...@@ -4067,6 +4068,7 @@ static void test_SetVarHelpContext(void) ...@@ -4067,6 +4068,7 @@ static void test_SetVarHelpContext(void)
hr = ITypeInfo_GetVarDesc(ti, 0, &pdesc); hr = ITypeInfo_GetVarDesc(ti, 0, &pdesc);
ok(hr == S_OK, "got %08x\n", hr); ok(hr == S_OK, "got %08x\n", hr);
ok(pdesc->memid == 0x40000000, "got wrong memid: %x\n", pdesc->memid);
ok(pdesc->elemdescVar.tdesc.vt == VT_INT, "got wrong vardesc type: %u\n", pdesc->elemdescVar.tdesc.vt); ok(pdesc->elemdescVar.tdesc.vt == VT_INT, "got wrong vardesc type: %u\n", pdesc->elemdescVar.tdesc.vt);
ok(pdesc->varkind == VAR_CONST, "got wrong varkind: %u\n", pdesc->varkind); ok(pdesc->varkind == VAR_CONST, "got wrong varkind: %u\n", pdesc->varkind);
ok(V_VT(U(pdesc)->lpvarValue) == VT_INT, "got wrong value type: %u\n", V_VT(U(pdesc)->lpvarValue)); ok(V_VT(U(pdesc)->lpvarValue) == VT_INT, "got wrong value type: %u\n", V_VT(U(pdesc)->lpvarValue));
...@@ -4191,6 +4193,7 @@ static void test_SetVarDocString(void) ...@@ -4191,6 +4193,7 @@ static void test_SetVarDocString(void)
ok(hr == E_INVALIDARG, "got %08x\n", hr); ok(hr == E_INVALIDARG, "got %08x\n", hr);
memset(&desc, 0, sizeof(desc)); memset(&desc, 0, sizeof(desc));
desc.memid = MEMBERID_NIL;
desc.elemdescVar.tdesc.vt = VT_INT; desc.elemdescVar.tdesc.vt = VT_INT;
desc.varkind = VAR_CONST; desc.varkind = VAR_CONST;
...@@ -4229,6 +4232,7 @@ static void test_SetVarDocString(void) ...@@ -4229,6 +4232,7 @@ static void test_SetVarDocString(void)
hr = ITypeInfo_GetVarDesc(ti, 0, &pdesc); hr = ITypeInfo_GetVarDesc(ti, 0, &pdesc);
ok(hr == S_OK, "got %08x\n", hr); ok(hr == S_OK, "got %08x\n", hr);
ok(pdesc->memid == 0x40000000, "got wrong memid: %x\n", pdesc->memid);
ok(pdesc->elemdescVar.tdesc.vt == VT_INT, "got wrong vardesc type: %u\n", pdesc->elemdescVar.tdesc.vt); ok(pdesc->elemdescVar.tdesc.vt == VT_INT, "got wrong vardesc type: %u\n", pdesc->elemdescVar.tdesc.vt);
ok(pdesc->varkind == VAR_CONST, "got wrong varkind: %u\n", pdesc->varkind); ok(pdesc->varkind == VAR_CONST, "got wrong varkind: %u\n", pdesc->varkind);
ok(V_VT(U(pdesc)->lpvarValue) == VT_INT, "got wrong value type: %u\n", V_VT(U(pdesc)->lpvarValue)); ok(V_VT(U(pdesc)->lpvarValue) == VT_INT, "got wrong value type: %u\n", V_VT(U(pdesc)->lpvarValue));
......
...@@ -10737,6 +10737,33 @@ static HRESULT WINAPI ICreateTypeInfo2_fnLayOut(ICreateTypeInfo2 *iface) ...@@ -10737,6 +10737,33 @@ static HRESULT WINAPI ICreateTypeInfo2_fnLayOut(ICreateTypeInfo2 *iface)
if (user_vft > This->cbSizeVft) if (user_vft > This->cbSizeVft)
This->cbSizeVft = user_vft + This->pTypeLib->ptr_size; This->cbSizeVft = user_vft + This->pTypeLib->ptr_size;
for(i = 0; i < This->cVars; ++i){
TLBVarDesc *var_desc = &This->vardescs[i];
if(var_desc->vardesc.memid == MEMBERID_NIL){
UINT j = 0;
BOOL reset = FALSE;
TLBVarDesc *iter;
var_desc->vardesc.memid = 0x40000000 + (depth << 16) + i;
iter = This->vardescs;
while (j < This->cVars) {
if (iter != var_desc && iter->vardesc.memid == var_desc->vardesc.memid) {
if (!reset) {
var_desc->vardesc.memid = 0x40000000 + (depth << 16) + This->cVars;
reset = TRUE;
} else
++var_desc->vardesc.memid;
iter = This->vardescs;
j = 0;
} else {
++iter;
++j;
}
}
}
}
ITypeInfo_Release(tinfo); ITypeInfo_Release(tinfo);
return hres; return hres;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment