From ea5f6eaf195f097fa35ed0172e1486664243199e Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Fri, 3 Oct 2014 19:16:53 +0200 Subject: [PATCH] fix EX usage --- ext/com_dotnet/com_com.c | 7 +++---- ext/com_dotnet/com_handlers.c | 2 +- ext/com_dotnet/php_com_dotnet_internal.h | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c index 6bcf8a218c..5f0b8ff697 100644 --- a/ext/com_dotnet/com_com.c +++ b/ext/com_dotnet/com_com.c @@ -464,7 +464,7 @@ HRESULT php_com_get_id_of_name(php_com_dotnet_object *obj, char *name, } /* the core of COM */ -int php_com_do_invoke_byref(php_com_dotnet_object *obj, char *name, int namelen, +int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function *f, WORD flags, VARIANT *v, int nargs, zval *args TSRMLS_DC) { DISPID dispid, altdispid; @@ -472,20 +472,19 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, char *name, int namelen, HRESULT hr; VARIANT *vargs = NULL, *byref_vals = NULL; int i, byref_count = 0, j; - zend_internal_function *f = (zend_internal_function*)EX(func); /* assumption: that the active function (f) is the function we generated for the engine */ if (!f || f->arg_info == NULL) { f = NULL; } - hr = php_com_get_id_of_name(obj, name, namelen, &dispid TSRMLS_CC); + hr = php_com_get_id_of_name(obj, f->function_name->val, f->function_name->len, &dispid TSRMLS_CC); if (FAILED(hr)) { char *winerr = NULL; char *msg = NULL; winerr = php_win32_error_to_msg(hr); - spprintf(&msg, 0, "Unable to lookup `%s': %s", name, winerr); + spprintf(&msg, 0, "Unable to lookup `%s': %s", f->function_name->val, winerr); LocalFree(winerr); php_com_throw_exception(hr, msg TSRMLS_CC); efree(msg); diff --git a/ext/com_dotnet/com_handlers.c b/ext/com_dotnet/com_handlers.c index 36480d4ebc..74a3920e34 100644 --- a/ext/com_dotnet/com_handlers.c +++ b/ext/com_dotnet/com_handlers.c @@ -378,7 +378,7 @@ static int com_call_method(zend_string *method, zend_object *object, INTERNAL_FU VariantInit(&v); - if (SUCCESS == php_com_do_invoke_byref(obj, method->val, method->len, DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, nargs, args TSRMLS_CC)) { + if (SUCCESS == php_com_do_invoke_byref(obj, (zend_internal_function*)EX(func), DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, nargs, args TSRMLS_CC)) { php_com_zval_from_variant(return_value, &v, obj->code_page TSRMLS_CC); ret = SUCCESS; VariantClear(&v); diff --git a/ext/com_dotnet/php_com_dotnet_internal.h b/ext/com_dotnet/php_com_dotnet_internal.h index c7e3a5ad78..e79e6f586d 100644 --- a/ext/com_dotnet/php_com_dotnet_internal.h +++ b/ext/com_dotnet/php_com_dotnet_internal.h @@ -109,7 +109,7 @@ int php_com_do_invoke_by_id(php_com_dotnet_object *obj, DISPID dispid, WORD flags, VARIANT *v, int nargs, zval *args, int silent, int allow_noarg TSRMLS_DC); int php_com_do_invoke(php_com_dotnet_object *obj, char *name, int namelen, WORD flags, VARIANT *v, int nargs, zval *args, int allow_noarg TSRMLS_DC); -int php_com_do_invoke_byref(php_com_dotnet_object *obj, char *name, int namelen, +int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function *f, WORD flags, VARIANT *v, int nargs, zval *args TSRMLS_DC); /* com_wrapper.c */ -- 2.40.0