From ff39e51fdf5b17a20b4ac447e66c3048f03c29d3 Mon Sep 17 00:00:00 2001 From: Andi Gutmans Date: Sun, 12 Aug 2001 04:31:14 +0000 Subject: [PATCH] - Make com work with new object model --- ext/com/com.h | 12 +++++------- ext/com/conversion.c | 2 ++ ext/rpc/com/com_wrapper.h | 12 +++++------- ext/rpc/com/conversion.c | 2 ++ 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ext/com/com.h b/ext/com/com.h index e1f04c75c7..13ac1d68b8 100644 --- a/ext/com/com.h +++ b/ext/com/com.h @@ -21,20 +21,18 @@ typedef struct comval_ { #define ZVAL_COM(z,o) { \ zval *handle; \ + HashTable *properties; \ \ - /* OBJECTS_FIXME */ \ - Z_TYPE_P(z) = IS_OBJECT; \ - Z_OBJCE_P(z) = &com_class_entry; \ - \ - ALLOC_HASHTABLE(Z_OBJPROP_P(z)); \ - zend_hash_init(Z_OBJPROP_P(z), 0, NULL, ZVAL_PTR_DTOR, 0); \ + ALLOC_HASHTABLE(properties); \ + zend_hash_init(properties, 0, NULL, ZVAL_PTR_DTOR, 0); \ \ ALLOC_ZVAL(handle); \ INIT_PZVAL(handle); \ ZVAL_LONG(handle, zend_list_insert((o), IS_COM)); \ \ zval_copy_ctor(handle); \ - zend_hash_index_update(Z_OBJPROP_P(z), 0, &handle, sizeof(zval *), NULL); \ + zend_hash_index_update(properties, 0, &handle, sizeof(zval *), NULL); \ + object_and_properties_init(z, &com_class_entry, properties); \ } #define RETVAL_COM(o) ZVAL_COM(&return_value, o) diff --git a/ext/com/conversion.c b/ext/com/conversion.c index cd05ccdb23..0f9bcbd32b 100644 --- a/ext/com/conversion.c +++ b/ext/com/conversion.c @@ -758,6 +758,8 @@ PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent, } else { + TSRMLS_FETCH(); + ALLOC_COM(obj); php_COM_set(obj, V_DISPATCH(var_arg), TRUE); diff --git a/ext/rpc/com/com_wrapper.h b/ext/rpc/com/com_wrapper.h index e1f04c75c7..13ac1d68b8 100644 --- a/ext/rpc/com/com_wrapper.h +++ b/ext/rpc/com/com_wrapper.h @@ -21,20 +21,18 @@ typedef struct comval_ { #define ZVAL_COM(z,o) { \ zval *handle; \ + HashTable *properties; \ \ - /* OBJECTS_FIXME */ \ - Z_TYPE_P(z) = IS_OBJECT; \ - Z_OBJCE_P(z) = &com_class_entry; \ - \ - ALLOC_HASHTABLE(Z_OBJPROP_P(z)); \ - zend_hash_init(Z_OBJPROP_P(z), 0, NULL, ZVAL_PTR_DTOR, 0); \ + ALLOC_HASHTABLE(properties); \ + zend_hash_init(properties, 0, NULL, ZVAL_PTR_DTOR, 0); \ \ ALLOC_ZVAL(handle); \ INIT_PZVAL(handle); \ ZVAL_LONG(handle, zend_list_insert((o), IS_COM)); \ \ zval_copy_ctor(handle); \ - zend_hash_index_update(Z_OBJPROP_P(z), 0, &handle, sizeof(zval *), NULL); \ + zend_hash_index_update(properties, 0, &handle, sizeof(zval *), NULL); \ + object_and_properties_init(z, &com_class_entry, properties); \ } #define RETVAL_COM(o) ZVAL_COM(&return_value, o) diff --git a/ext/rpc/com/conversion.c b/ext/rpc/com/conversion.c index cd05ccdb23..0f9bcbd32b 100644 --- a/ext/rpc/com/conversion.c +++ b/ext/rpc/com/conversion.c @@ -758,6 +758,8 @@ PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent, } else { + TSRMLS_FETCH(); + ALLOC_COM(obj); php_COM_set(obj, V_DISPATCH(var_arg), TRUE); -- 2.50.1