]> granicus.if.org Git - php/commitdiff
fix EX usage
authorAnatol Belski <ab@php.net>
Fri, 3 Oct 2014 17:16:53 +0000 (19:16 +0200)
committerAnatol Belski <ab@php.net>
Fri, 3 Oct 2014 17:23:34 +0000 (19:23 +0200)
ext/com_dotnet/com_com.c
ext/com_dotnet/com_handlers.c
ext/com_dotnet/php_com_dotnet_internal.h

index 6bcf8a218ccd4c53e32cbd094a68357c6fc013c3..5f0b8ff69790587a6367ee0ff11b8d1c05d5d899 100644 (file)
@@ -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);
index 36480d4ebcfad4ede63825bf8224a5f02cbcbd4c..74a3920e34fa5992c38bfa0e25f951224ad61f42 100644 (file)
@@ -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);
index c7e3a5ad7803ad4dc1379f72730be56a089465a9..e79e6f586da7d59fbb9ee607c70236e2bc71d8ee 100644 (file)
@@ -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 */