vbscript: Store class_desc_t in vbdisp_t.

This commit is contained in:
Jacek Caban 2011-09-15 14:18:43 +02:00 committed by Alexandre Julliard
parent fb57bc21b8
commit efc59d1b19
3 changed files with 9 additions and 4 deletions

View File

@ -463,7 +463,7 @@ static HRESULT interp_new(exec_ctx_t *ctx)
return E_FAIL;
}
hres = create_vbdisp(&obj);
hres = create_vbdisp(class_desc, &obj);
if(FAILED(hres))
return hres;

View File

@ -184,7 +184,7 @@ static IDispatchExVtbl DispatchExVtbl = {
DispatchEx_GetNameSpaceParent
};
HRESULT create_vbdisp(vbdisp_t **ret)
HRESULT create_vbdisp(const class_desc_t *desc, vbdisp_t **ret)
{
vbdisp_t *vbdisp;
@ -194,6 +194,7 @@ HRESULT create_vbdisp(vbdisp_t **ret)
vbdisp->IDispatchEx_iface.lpVtbl = &DispatchExVtbl;
vbdisp->ref = 1;
vbdisp->desc = desc;
*ret = vbdisp;
return S_OK;
@ -201,7 +202,8 @@ HRESULT create_vbdisp(vbdisp_t **ret)
HRESULT init_global(script_ctx_t *ctx)
{
return create_vbdisp(&ctx->script_obj);
ctx->script_desc.ctx = ctx;
return create_vbdisp(&ctx->script_desc, &ctx->script_obj);
}
HRESULT disp_get_id(IDispatch *disp, BSTR name, DISPID *id)

View File

@ -65,6 +65,8 @@ typedef struct {
IDispatchEx IDispatchEx_iface;
LONG ref;
const class_desc_t *desc;
} vbdisp_t;
typedef enum {
@ -74,7 +76,7 @@ typedef enum {
VBDISP_ANY
} vbdisp_invoke_type_t;
HRESULT create_vbdisp(vbdisp_t**);
HRESULT create_vbdisp(const class_desc_t*,vbdisp_t**);
HRESULT disp_get_id(IDispatch*,BSTR,DISPID*);
HRESULT disp_call(script_ctx_t*,IDispatch*,DISPID,DISPPARAMS*,VARIANT*);
HRESULT disp_propput(script_ctx_t*,IDispatch*,DISPID,VARIANT*);
@ -101,6 +103,7 @@ struct _script_ctx_t {
IDispatch *host_global;
class_desc_t script_desc;
vbdisp_t *script_obj;
dynamic_var_t *global_vars;