summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Richards <rrichards@php.net>2006-12-24 12:32:10 +0000
committerRob Richards <rrichards@php.net>2006-12-24 12:32:10 +0000
commit47fb655a56890845393f77b3a73f61433c752c49 (patch)
tree72ce60841cffd7fb5765c46061b3e2527abf3433
parenta03f730875b551a569cdad4a44c7349a0669efe3 (diff)
downloadphp-git-47fb655a56890845393f77b3a73f61433c752c49.tar.gz
fix bug #33734 and related (Something strange with COM Object)
- caused by fix in com_handlers.c rev 1.22.2.5
-rw-r--r--ext/com_dotnet/com_com.c14
-rw-r--r--ext/com_dotnet/com_handlers.c10
-rw-r--r--ext/com_dotnet/com_saproxy.c4
-rw-r--r--ext/com_dotnet/php_com_dotnet_internal.h6
4 files changed, 17 insertions, 17 deletions
diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c
index 2f17455400..f5466fc57c 100644
--- a/ext/com_dotnet/com_com.c
+++ b/ext/com_dotnet/com_com.c
@@ -338,7 +338,7 @@ PHP_FUNCTION(com_get_active_object)
/* 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 @@ HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member,
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 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, char *name, int namelen,
}
/* 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_byref(php_com_dotnet_object *obj, char *name, int namelen,
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 @@ int php_com_do_invoke_by_id(php_com_dotnet_object *obj, DISPID dispid,
}
/* 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_by_id(php_com_dotnet_object *obj, DISPID dispid,
}
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 @@ int php_com_do_invoke(php_com_dotnet_object *obj, char *name, int namelen,
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()
diff --git a/ext/com_dotnet/com_handlers.c b/ext/com_dotnet/com_handlers.c
index 6ca7061cb2..e831d26c26 100644
--- a/ext/com_dotnet/com_handlers.c
+++ b/ext/com_dotnet/com_handlers.c
@@ -49,7 +49,7 @@ static zval *com_property_read(zval *object, zval *member, int type TSRMLS_DC)
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 @@ static void com_property_write(zval *object, zval *member, zval *value TSRMLS_DC
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 @@ static zval *com_read_dimension(zval *object, zval *offset, int type TSRMLS_DC)
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 @@ static void com_write_dimension(zval *object, zval *offset, zval *value TSRMLS_D
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 @@ static int com_object_cast(zval *readobj, zval *writeobj, int type TSRMLS_DC)
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 {
diff --git a/ext/com_dotnet/com_saproxy.c b/ext/com_dotnet/com_saproxy.c
index 8cc0c5e64b..4e29fc1fab 100644
--- a/ext/com_dotnet/com_saproxy.c
+++ b/ext/com_dotnet/com_saproxy.c
@@ -120,7 +120,7 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type TSRMLS_
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 @@ static void saproxy_write_dimension(zval *object, zval *offset, zval *value TSRM
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);
}
diff --git a/ext/com_dotnet/php_com_dotnet_internal.h b/ext/com_dotnet/php_com_dotnet_internal.h
index 2cd0c2b960..e780fdb3ac 100644
--- a/ext/com_dotnet/php_com_dotnet_internal.h
+++ b/ext/com_dotnet/php_com_dotnet_internal.h
@@ -102,13 +102,13 @@ PHP_FUNCTION(com_load_typelib);
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);