jscript: Added QueryService(SID_VariantConversion) implementation.

oldstable
Jacek Caban 2012-03-12 12:12:40 +01:00 committed by Alexandre Julliard
parent bac7c1ef36
commit c6360c3e6e
3 changed files with 16 additions and 2 deletions

View File

@ -72,6 +72,7 @@ void script_release(script_ctx_t *ctx)
jsheap_free(&ctx->tmp_heap);
SysFreeString(ctx->last_match);
ctx->jscaller->ctx = NULL;
IServiceProvider_Release(&ctx->jscaller->IServiceProvider_iface);
heap_free(ctx);
@ -411,8 +412,10 @@ static ULONG WINAPI JScript_Release(IActiveScript *iface)
if(!ref) {
if(This->ctx && This->ctx->state != SCRIPTSTATE_CLOSED)
IActiveScript_Close(&This->IActiveScript_iface);
if(This->ctx)
if(This->ctx) {
This->ctx->active_script = NULL;
script_release(This->ctx);
}
heap_free(This);
unlock_module();
}
@ -709,6 +712,7 @@ static HRESULT WINAPI JScriptParse_InitNew(IActiveScriptParse *iface)
ctx->ref = 1;
ctx->state = SCRIPTSTATE_UNINITIALIZED;
ctx->active_script = &This->IActiveScript_iface;
ctx->safeopt = This->safeopt;
ctx->version = This->version;
jsheap_init(&ctx->tmp_heap);

View File

@ -293,6 +293,7 @@ struct _script_ctx_t {
LONG ref;
SCRIPTSTATE state;
IActiveScript *active_script;
exec_ctx_t *exec_ctx;
named_item_t *named_items;

View File

@ -20,6 +20,7 @@
#include "wine/port.h"
#include <math.h>
#include <assert.h>
#include "jscript.h"
#include "engine.h"
@ -769,8 +770,10 @@ static ULONG WINAPI JSCaller_Release(IServiceProvider *iface)
TRACE("(%p) ref=%d\n", This, ref);
if(!ref)
if(!ref) {
assert(!This->ctx);
heap_free(This);
}
return ref;
}
@ -780,6 +783,11 @@ static HRESULT WINAPI JSCaller_QueryService(IServiceProvider *iface, REFGUID gui
{
JSCaller *This = impl_from_IServiceProvider(iface);
if(IsEqualGUID(guidService, &SID_VariantConversion) && This->ctx && This->ctx->active_script) {
TRACE("(%p)->(SID_VariantConversion)\n", This);
return IActiveScript_QueryInterface(This->ctx->active_script, riid, ppv);
}
FIXME("(%p)->(%s %s %p)\n", This, debugstr_guid(guidService), debugstr_guid(riid), ppv);
*ppv = NULL;
@ -803,6 +811,7 @@ HRESULT create_jscaller(script_ctx_t *ctx)
ret->IServiceProvider_iface.lpVtbl = &ServiceProviderVtbl;
ret->ref = 1;
ret->ctx = ctx;
ctx->jscaller = ret;
return S_OK;