rrichards               Sun Dec 24 12:32:10 2006 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/com_dotnet     com_com.c com_handlers.c com_saproxy.c 
                                php_com_dotnet_internal.h 
  Log:
  fix bug #33734 and related (Something strange with COM Object)
   - caused by fix in com_handlers.c rev 1.22.2.5
  
http://cvs.php.net/viewvc.cgi/php-src/ext/com_dotnet/com_com.c?r1=1.16.2.2.2.2&r2=1.16.2.2.2.3&diff_format=u
Index: php-src/ext/com_dotnet/com_com.c
diff -u php-src/ext/com_dotnet/com_com.c:1.16.2.2.2.2 
php-src/ext/com_dotnet/com_com.c:1.16.2.2.2.3
--- php-src/ext/com_dotnet/com_com.c:1.16.2.2.2.2       Fri Nov 17 11:40:52 2006
+++ php-src/ext/com_dotnet/com_com.c    Sun Dec 24 12:32:10 2006
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: com_com.c,v 1.16.2.2.2.2 2006/11/17 11:40:52 dmitry Exp $ */
+/* $Id: com_com.c,v 1.16.2.2.2.3 2006/12/24 12:32:10 rrichards Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -338,7 +338,7 @@
 /* Performs an Invoke on the given com object.
  * returns a failure code and creates an exception if there was an error */
 HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member,
-               WORD flags, DISPPARAMS *disp_params, VARIANT *v, int silent 
TSRMLS_DC)
+               WORD flags, DISPPARAMS *disp_params, VARIANT *v, int silent, 
int allow_noarg TSRMLS_DC)
 {
        HRESULT hr;
        unsigned int arg_err;
@@ -389,7 +389,7 @@
                                break;
 
                        case DISP_E_BADPARAMCOUNT:
-                               if ((disp_params->cArgs + 
disp_params->cNamedArgs == 0) && (flags == DISPATCH_PROPERTYGET)) {
+                               if ((disp_params->cArgs + 
disp_params->cNamedArgs == 0) && (allow_noarg == 1)) {
                                        /* if getting a property and they are 
missing all parameters,
                                         * we want to create a proxy object for 
them; so lets not create an
                                         * exception here */
@@ -545,7 +545,7 @@
        }
 
        /* this will create an exception if needed */
-       hr = php_com_invoke_helper(obj, dispid, flags, &disp_params, v, 0 
TSRMLS_CC);   
+       hr = php_com_invoke_helper(obj, dispid, flags, &disp_params, v, 0, 0 
TSRMLS_CC);        
 
        /* release variants */
        if (vargs) {
@@ -583,7 +583,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 
TSRMLS_DC)
+               WORD flags,     VARIANT *v, int nargs, zval **args, int silent, 
int allow_noarg TSRMLS_DC)
 {
        DISPID altdispid;
        DISPPARAMS disp_params;
@@ -612,7 +612,7 @@
        }
 
        /* this will create an exception if needed */
-       hr = php_com_invoke_helper(obj, dispid, flags, &disp_params, v, silent 
TSRMLS_CC);      
+       hr = php_com_invoke_helper(obj, dispid, flags, &disp_params, v, silent, 
allow_noarg TSRMLS_CC); 
 
        /* release variants */
        if (vargs) {
@@ -630,7 +630,7 @@
 }
 
 int php_com_do_invoke(php_com_dotnet_object *obj, char *name, int namelen,
-               WORD flags,     VARIANT *v, int nargs, zval **args TSRMLS_DC)
+               WORD flags,     VARIANT *v, int nargs, zval **args, int 
allow_noarg TSRMLS_DC)
 {
        DISPID dispid;
        HRESULT hr;
@@ -648,7 +648,7 @@
                return FAILURE;
        }
 
-       return php_com_do_invoke_by_id(obj, dispid, flags, v, nargs, args, 0 
TSRMLS_CC);
+       return php_com_do_invoke_by_id(obj, dispid, flags, v, nargs, args, 0, 
allow_noarg TSRMLS_CC);
 }
 
 /* {{{ proto string com_create_guid()
http://cvs.php.net/viewvc.cgi/php-src/ext/com_dotnet/com_handlers.c?r1=1.30.2.5.2.4&r2=1.30.2.5.2.5&diff_format=u
Index: php-src/ext/com_dotnet/com_handlers.c
diff -u php-src/ext/com_dotnet/com_handlers.c:1.30.2.5.2.4 
php-src/ext/com_dotnet/com_handlers.c:1.30.2.5.2.5
--- php-src/ext/com_dotnet/com_handlers.c:1.30.2.5.2.4  Sun Dec 24 10:00:58 2006
+++ php-src/ext/com_dotnet/com_handlers.c       Sun Dec 24 12:32:10 2006
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: com_handlers.c,v 1.30.2.5.2.4 2006/12/24 10:00:58 rrichards Exp $ */
+/* $Id: com_handlers.c,v 1.30.2.5.2.5 2006/12/24 12:32:10 rrichards Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -49,7 +49,7 @@
                convert_to_string_ex(&member);
 
                res = php_com_do_invoke(obj, Z_STRVAL_P(member), 
Z_STRLEN_P(member),
-                               DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, 0, 
NULL TSRMLS_CC);
+                               DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, 0, 
NULL, 1 TSRMLS_CC);
 
                if (res == SUCCESS) {
                        php_com_zval_from_variant(return_value, &v, 
obj->code_page TSRMLS_CC);
@@ -76,7 +76,7 @@
 
                convert_to_string_ex(&member);
                if (SUCCESS == php_com_do_invoke(obj, Z_STRVAL_P(member), 
Z_STRLEN_P(member),
-                               DISPATCH_PROPERTYPUT|DISPATCH_PROPERTYPUTREF, 
&v, 1, &value TSRMLS_CC)) {
+                               DISPATCH_PROPERTYPUT|DISPATCH_PROPERTYPUTREF, 
&v, 1, &value, 0 TSRMLS_CC)) {
                        VariantClear(&v);
                }
        } else {
@@ -101,7 +101,7 @@
                VariantInit(&v);
 
                if (SUCCESS == php_com_do_invoke_by_id(obj, DISPID_VALUE,
-                               DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, 1, 
&offset, 0 TSRMLS_CC)) {
+                               DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, 1, 
&offset, 0, 0 TSRMLS_CC)) {
                        php_com_zval_from_variant(return_value, &v, 
obj->code_page TSRMLS_CC);
                        VariantClear(&v);
                }
@@ -140,7 +140,7 @@
                VariantInit(&v);
 
                if (SUCCESS == php_com_do_invoke_by_id(obj, DISPID_VALUE,
-                               DISPATCH_METHOD|DISPATCH_PROPERTYPUT, &v, 2, 
args, 0 TSRMLS_CC)) {
+                               DISPATCH_METHOD|DISPATCH_PROPERTYPUT, &v, 2, 
args, 0, 0 TSRMLS_CC)) {
                        VariantClear(&v);
                }
        } else if (V_ISARRAY(&obj->v)) {
@@ -499,7 +499,7 @@
 
        if (V_VT(&obj->v) == VT_DISPATCH) {
                if (SUCCESS != php_com_do_invoke_by_id(obj, DISPID_VALUE,
-                               DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, 0, 
NULL, 1 TSRMLS_CC)) {
+                               DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, 0, 
NULL, 1, 0 TSRMLS_CC)) {
                        VariantCopy(&v, &obj->v);
                }
        } else {
http://cvs.php.net/viewvc.cgi/php-src/ext/com_dotnet/com_saproxy.c?r1=1.15.2.2.2.1&r2=1.15.2.2.2.2&diff_format=u
Index: php-src/ext/com_dotnet/com_saproxy.c
diff -u php-src/ext/com_dotnet/com_saproxy.c:1.15.2.2.2.1 
php-src/ext/com_dotnet/com_saproxy.c:1.15.2.2.2.2
--- php-src/ext/com_dotnet/com_saproxy.c:1.15.2.2.2.1   Wed May 10 14:39:10 2006
+++ php-src/ext/com_dotnet/com_saproxy.c        Sun Dec 24 12:32:10 2006
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: com_saproxy.c,v 1.15.2.2.2.1 2006/05/10 14:39:10 rrichards Exp $ */
+/* $Id: com_saproxy.c,v 1.15.2.2.2.2 2006/12/24 12:32:10 rrichards Exp $ */
 
 /* This module implements a SafeArray proxy which is used internally
  * by the engine when resolving multi-dimensional array accesses on
@@ -120,7 +120,7 @@
 
                res = php_com_do_invoke(proxy->obj, 
Z_STRVAL_P(proxy->indices[0]),
                                Z_STRLEN_P(proxy->indices[0]), 
DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v,
-                               proxy->dimensions, args TSRMLS_CC);
+                               proxy->dimensions, args, 0 TSRMLS_CC);
 
                if (res == SUCCESS) {
                        php_com_zval_from_variant(return_value, &v, 
proxy->obj->code_page TSRMLS_CC);
@@ -233,7 +233,7 @@
                VariantInit(&v);
                if (SUCCESS == php_com_do_invoke(proxy->obj, 
Z_STRVAL_P(proxy->indices[0]),
                                        Z_STRLEN_P(proxy->indices[0]), 
DISPATCH_PROPERTYPUT, &v, proxy->dimensions + 1,
-                                       args TSRMLS_CC)) {
+                                       args, 0 TSRMLS_CC)) {
                        VariantClear(&v);
                }
 
http://cvs.php.net/viewvc.cgi/php-src/ext/com_dotnet/php_com_dotnet_internal.h?r1=1.14.2.3.2.1&r2=1.14.2.3.2.2&diff_format=u
Index: php-src/ext/com_dotnet/php_com_dotnet_internal.h
diff -u php-src/ext/com_dotnet/php_com_dotnet_internal.h:1.14.2.3.2.1 
php-src/ext/com_dotnet/php_com_dotnet_internal.h:1.14.2.3.2.2
--- php-src/ext/com_dotnet/php_com_dotnet_internal.h:1.14.2.3.2.1       Wed May 
10 14:39:10 2006
+++ php-src/ext/com_dotnet/php_com_dotnet_internal.h    Sun Dec 24 12:32:10 2006
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_com_dotnet_internal.h,v 1.14.2.3.2.1 2006/05/10 14:39:10 rrichards 
Exp $ */
+/* $Id: php_com_dotnet_internal.h,v 1.14.2.3.2.2 2006/12/24 12:32:10 rrichards 
Exp $ */
 
 #ifndef PHP_COM_DOTNET_INTERNAL_H
 #define PHP_COM_DOTNET_INTERNAL_H
@@ -102,13 +102,13 @@
 PHP_FUNCTION(com_get_active_object);
 
 HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member,
-               WORD flags, DISPPARAMS *disp_params, VARIANT *v, int silent 
TSRMLS_DC);
+               WORD flags, DISPPARAMS *disp_params, VARIANT *v, int silent, 
int allow_noarg TSRMLS_DC);
 HRESULT php_com_get_id_of_name(php_com_dotnet_object *obj, char *name,
                int namelen, DISPID *dispid TSRMLS_DC);
 int php_com_do_invoke_by_id(php_com_dotnet_object *obj, DISPID dispid,
-               WORD flags,     VARIANT *v, int nargs, zval **args, int silent 
TSRMLS_DC);
+               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 TSRMLS_DC);
+               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,
                WORD flags,     VARIANT *v, int nargs, zval ***args TSRMLS_DC);
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to