summaryrefslogtreecommitdiff
path: root/ext/win32ole
diff options
context:
space:
mode:
authorsuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-19 16:28:23 +0000
committersuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-19 16:28:23 +0000
commita9b125cf204810a27e9a71d0ae186fe1907ff2da (patch)
tree562c17d5b68aac7cdb8e5b07dd3c345db3872f2b /ext/win32ole
parent535f17f30bf0c61cfd3b22586a30b11c81aed0bf (diff)
* ext/win32ole/win32ole.c (EVENTSINK_Invoke): little refactoring.
* ext/win32ole/win32ole.c (EVENTSINK_GetIDsOfNames): return ITypeInfo::GetIDsOfNames(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/win32ole')
-rw-r--r--ext/win32ole/win32ole.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c
index 16efeba..cf64666 100644
--- a/ext/win32ole/win32ole.c
+++ b/ext/win32ole/win32ole.c
@@ -118,7 +118,7 @@
#define WC2VSTR(x) ole_wc2vstr((x), TRUE)
-#define WIN32OLE_VERSION "1.2.5"
+#define WIN32OLE_VERSION "1.2.6"
typedef HRESULT (STDAPICALLTYPE FNCOCREATEINSTANCEEX)
(REFCLSID, IUnknown*, DWORD, COSERVERINFO*, DWORD, MULTI_QI*);
@@ -7353,13 +7353,19 @@ STDMETHODIMP EVENTSINK_GetTypeInfo(
}
STDMETHODIMP EVENTSINK_GetIDsOfNames(
- PEVENTSINK pEV,
+ PEVENTSINK pEventSink,
REFIID riid,
OLECHAR **szNames,
UINT cNames,
LCID lcid,
DISPID *pDispID
) {
+ ITypeInfo *pTypeInfo;
+ PIEVENTSINKOBJ pEV = (PIEVENTSINKOBJ)pEventSink;
+ pTypeInfo = pEV->pTypeInfo;
+ if (pTypeInfo) {
+ return pTypeInfo->lpVtbl->GetIDsOfNames(pTypeInfo, szNames, cNames, pDispID);
+ }
return DISP_E_UNKNOWNNAME;
}
@@ -7470,8 +7476,9 @@ ary2ptr_dispparams(VALUE ary, DISPPARAMS *pdispparams)
static VALUE
exec_callback(VALUE arg)
{
- VALUE handler = rb_ary_entry(arg, 0);
- VALUE args = rb_ary_entry(arg, 1);
+ VALUE *parg = (VALUE *)arg;
+ VALUE handler = parg[0];
+ VALUE args = parg[1];
return rb_apply(handler, rb_intern("call"), args);
}
@@ -7512,7 +7519,7 @@ STDMETHODIMP EVENTSINK_Invoke(
ITypeInfo *pTypeInfo;
VARIANT *pvar;
VALUE ary, obj, event, handler, args, outargv, ev, result;
- VALUE arg;
+ VALUE arg[2];
VALUE is_outarg;
BOOL is_default_handler = FALSE;
@@ -7554,9 +7561,6 @@ STDMETHODIMP EVENTSINK_Invoke(
outargv = rb_ary_new();
rb_ary_push(args, outargv);
}
- arg = rb_ary_new();
- rb_ary_push(arg, handler);
- rb_ary_push(arg, args);
/*
* if exception raised in event callback,
@@ -7565,7 +7569,9 @@ STDMETHODIMP EVENTSINK_Invoke(
* and the exception raised then error message print
* and exit ruby process by Win32OLE itself.
*/
- result = rb_rescue2(exec_callback, arg,
+ arg[0] = handler;
+ arg[1] = args;
+ result = rb_rescue2(exec_callback, (VALUE)arg,
rescue_callback, Qnil,
rb_eException, (VALUE)0);
if(TYPE(result) == T_HASH) {