* ext/win32ole/win32ole.c (EVENTSINK_Invoke): use rb_protect
instead of rb_rescue2. [ruby-dev:35595] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8ceaf90948
commit
4e554319dd
@ -1,3 +1,8 @@
|
|||||||
|
Sun Jul 20 16:00:37 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
|
||||||
|
|
||||||
|
* ext/win32ole/win32ole.c (EVENTSINK_Invoke): use rb_protect
|
||||||
|
instead of rb_rescue2. [ruby-dev:35595]
|
||||||
|
|
||||||
Sun Jul 20 01:23:24 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
|
Sun Jul 20 01:23:24 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
|
||||||
|
|
||||||
* ext/win32ole/win32ole.c (EVENTSINK_Invoke): little refactoring.
|
* ext/win32ole/win32ole.c (EVENTSINK_Invoke): little refactoring.
|
||||||
|
@ -118,7 +118,7 @@
|
|||||||
|
|
||||||
#define WC2VSTR(x) ole_wc2vstr((x), TRUE)
|
#define WC2VSTR(x) ole_wc2vstr((x), TRUE)
|
||||||
|
|
||||||
#define WIN32OLE_VERSION "1.2.6"
|
#define WIN32OLE_VERSION "1.2.7"
|
||||||
|
|
||||||
typedef HRESULT (STDAPICALLTYPE FNCOCREATEINSTANCEEX)
|
typedef HRESULT (STDAPICALLTYPE FNCOCREATEINSTANCEEX)
|
||||||
(REFCLSID, IUnknown*, DWORD, COSERVERINFO*, DWORD, MULTI_QI*);
|
(REFCLSID, IUnknown*, DWORD, COSERVERINFO*, DWORD, MULTI_QI*);
|
||||||
@ -7522,6 +7522,7 @@ STDMETHODIMP EVENTSINK_Invoke(
|
|||||||
VALUE arg[2];
|
VALUE arg[2];
|
||||||
VALUE is_outarg;
|
VALUE is_outarg;
|
||||||
BOOL is_default_handler = FALSE;
|
BOOL is_default_handler = FALSE;
|
||||||
|
int state;
|
||||||
|
|
||||||
PIEVENTSINKOBJ pEV = (PIEVENTSINKOBJ)pEventSink;
|
PIEVENTSINKOBJ pEV = (PIEVENTSINKOBJ)pEventSink;
|
||||||
pTypeInfo = pEV->pTypeInfo;
|
pTypeInfo = pEV->pTypeInfo;
|
||||||
@ -7571,13 +7572,14 @@ STDMETHODIMP EVENTSINK_Invoke(
|
|||||||
*/
|
*/
|
||||||
arg[0] = handler;
|
arg[0] = handler;
|
||||||
arg[1] = args;
|
arg[1] = args;
|
||||||
result = rb_rescue2(exec_callback, (VALUE)arg,
|
result = rb_protect(exec_callback, (VALUE)arg, &state);
|
||||||
rescue_callback, Qnil,
|
if (state != 0) {
|
||||||
rb_eException, (VALUE)0);
|
rescue_callback(Qnil);
|
||||||
|
}
|
||||||
if(TYPE(result) == T_HASH) {
|
if(TYPE(result) == T_HASH) {
|
||||||
hash2ptr_dispparams(result, pTypeInfo, dispid, pdispparams);
|
hash2ptr_dispparams(result, pTypeInfo, dispid, pdispparams);
|
||||||
result = hash2result(result);
|
result = hash2result(result);
|
||||||
}else if (is_outarg == Qtrue && outargv != Qnil) {
|
}else if (is_outarg == Qtrue && TYPE(outargv) == T_ARRAY) {
|
||||||
ary2ptr_dispparams(outargv, pdispparams);
|
ary2ptr_dispparams(outargv, pdispparams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user