From: Wez Furlong Date: Sat, 13 Aug 2005 19:03:58 +0000 (+0000) Subject: unicode enable COM parameters (but not method/property names yet) X-Git-Tag: PRE_NEW_OCI8_EXTENSION~277 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=77b183386c80252431db3e7923684cea884dc008;p=php unicode enable COM parameters (but not method/property names yet) --- diff --git a/ext/com_dotnet/com_handlers.c b/ext/com_dotnet/com_handlers.c index 1564924125..c53c11808a 100644 --- a/ext/com_dotnet/com_handlers.c +++ b/ext/com_dotnet/com_handlers.c @@ -522,6 +522,7 @@ static int com_object_cast(zval *readobj, zval *writeobj, int type, int should_f vt = VT_BOOL; break; case IS_STRING: + case IS_UNICODE: vt = VT_BSTR; break; default: diff --git a/ext/com_dotnet/com_variant.c b/ext/com_dotnet/com_variant.c index 6030ae915a..7c3ea12c5a 100644 --- a/ext/com_dotnet/com_variant.c +++ b/ext/com_dotnet/com_variant.c @@ -157,6 +157,11 @@ PHPAPI void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_D efree(olestring); break; + case IS_UNICODE: + V_VT(v) = VT_BSTR; + V_BSTR(v) = SysAllocString(Z_USTRVAL_P(z)); + break; + case IS_RESOURCE: case IS_CONSTANT: case IS_CONSTANT_ARRAY: @@ -211,12 +216,8 @@ PHPAPI int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC ZVAL_BOOL(z, V_BOOL(v) ? 1 : 0); break; case VT_BSTR: - olestring = V_BSTR(v); - if (olestring) { - Z_TYPE_P(z) = IS_STRING; - Z_STRVAL_P(z) = php_com_olestring_to_string(olestring, - &Z_STRLEN_P(z), codepage TSRMLS_CC); - olestring = NULL; + if (V_BSTR(v)) { + ZVAL_UNICODE(z, V_BSTR(v), 1); } break; case VT_UNKNOWN: