Date: 09/27/00
- Next message: john <email protected>: "[PHP-DEV] PHP 4.0 Bug #6911: Problem with array_merge(_recursive)"
- Previous message: danielc <email protected>: "[PHP-DEV] PHP 4.0 Bug #6902: "Notice" Errors not working and crashing"
- Next in thread: Howard Cohodas: "RE: [PHP-DEV] COM PropPut() patch - support for write-only properties"
- Reply: Howard Cohodas: "RE: [PHP-DEV] COM PropPut() patch - support for write-only properties"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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 <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: john <email protected>: "[PHP-DEV] PHP 4.0 Bug #6911: Problem with array_merge(_recursive)"
- Previous message: danielc <email protected>: "[PHP-DEV] PHP 4.0 Bug #6902: "Notice" Errors not working and crashing"
- Next in thread: Howard Cohodas: "RE: [PHP-DEV] COM PropPut() patch - support for write-only properties"
- Reply: Howard Cohodas: "RE: [PHP-DEV] COM PropPut() patch - support for write-only properties"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

