FW: [PHP-DEV] COM PropPut() patch - support for write-only properties
| From: | Howard Cohodas | Date: | Mon, 02 Oct 2000 04:59:02 +0000 |
| Subject: | FW: [PHP-DEV] COM PropPut() patch - support for write-only properties | ||
| Groups: | php.qa | ||
| Request: | Send a blank email to php-qa+get-1361@lists.php.net to get a copy of this message | ||
Can this be added to 4.0.3?
Howard A. Cohodas
Design Knowledge Technologies Inc.
Phone: (011)(330)492-9900
FAX: (011)(330)492-1100
otfGIF Encoder: http://www.dkt.com/otfGIF
-----Original Message-----
From: Howard Cohodas [mailto:Howard.Cohodas@dkt.com]
Sent: Wednesday, September 27, 2000 1:48 PM
To: Serge Golovin; php-dev@lists.php.net
Subject: RE: [PHP-DEV] COM PropPut() patch - support for write-only
properties
This seems directly on point to http://bugs.php.net/?id=6447.
Howard A. Cohodas
Design Knowledge Technologies Inc.
Phone: (011)(330)492-9900
FAX: (011)(330)492-1100
otfGIF Encoder: http://www.dkt.com/otfGIF
-----Original Message-----
From: Serge Golovin [mailto:res@digt.com]
Sent: Wednesday, September 27, 2000 9:45 AM
To: php-dev@lists.php.net
Subject: [PHP-DEV] COM PropPut() patch - support for write-only properties
Hello developers,
In on of our projects we use some COM component with a property that is
available only for writing, i.e. has only propput method. With the PHP's
PropPut() function we received an COM error. I looked into that and found
that implementation puts a property and gets it to form a return value for
PropPut(), which is unacceptable with write-only properties.
So, the proposed patch fixes this problem. PropPut() now should return a
value passed to it.
I am not on the list, so if somebody will followup, please write to me
directly, too.
And here is the patch (I based it on 4.0.2 release, there may be updated
version in CVS but http://cvs.php.net/ doesnt seem to be
responding):
diff -u COM.c COM.c.new
--- COM.c Wed Sep 27 13:06:00 2000
+++ COM.c.new Wed Sep 27 12:24:57 2000
@@ -667,7 +667,6 @@
HRESULT hr;
OLECHAR *propname;
char *error_message;
- VARIANTARG var_result;
DISPPARAMS dispparams;
VARIANTARG new_value;
DISPID mydispid = DISPID_PROPERTYPUT;
@@ -698,13 +697,6 @@
LOCALE_SYSTEM_DEFAULT, DISPATCH_PROPERTYPUT,
&dispparams, NULL, NULL, 0);
- dispparams.cArgs = 0;
- dispparams.cNamedArgs = 0;
-
- hr = i_dispatch->lpVtbl->Invoke(i_dispatch, dispid, &IID_NULL,
- LOCALE_SYSTEM_DEFAULT, DISPATCH_PROPERTYGET,
- &dispparams, &var_result, NULL, 0);
-
if (FAILED(hr)) {
error_message = php_COM_error_message(hr);
php_error(E_WARNING,"PropPut() failed: %s\n", error_message);
@@ -713,7 +705,7 @@
RETURN_FALSE;
}
- php_variant_to_pval(&var_result, return_value, 0);
+ php_variant_to_pval(&new_value, return_value, 0);
efree(propname);
}
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
For additional commands, e-mail: php-dev-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
For additional commands, e-mail: php-dev-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net