com php-src: fix EX usage: ext/com_dotnet/com_com.c ext /com_dotnet/com_handlers.c ext/com_dotnet/php_com _dotnet_internal.h
| From: | Anatol Belski | Date: | Fri, 03 Oct 2014 17:23:34 +0000 |
| Subject: | com php-src: fix EX usage: ext/com_dotnet/com_com.c ext /com_dotnet/com_handlers.c ext/com_dotnet/php_com _dotnet_internal.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-82071@lists.php.net to get a copy of this message | ||
Commit: ea5f6eaf195f097fa35ed0172e1486664243199e
Author: Anatol Belski <ab@php.net> Fri, 3 Oct 2014 19:16:53 +0200
Parents: 647ebe6bf214d1a30627bab1758b66262d2f780f
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ea5f6eaf195f097fa35ed0172e1486664243199e
Log:
fix EX usage
Changed paths:
M ext/com_dotnet/com_com.c
M ext/com_dotnet/com_handlers.c
M ext/com_dotnet/php_com_dotnet_internal.h
Diff:
diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c
index 6bcf8a2..5f0b8ff 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 36480d4..74a3920 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 c7e3a5a..e79e6f5 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 */