Lines Matching refs:obj
30 php_com_dotnet_object *obj; in com_property_read() local
36 obj = (php_com_dotnet_object*) object; in com_property_read()
38 if (V_VT(&obj->v) == VT_DISPATCH) { in com_property_read()
41 res = php_com_do_invoke(obj, ZSTR_VAL(member), ZSTR_LEN(member), in com_property_read()
45 php_com_zval_from_variant(rv, &v, obj->code_page); in com_property_read()
62 php_com_dotnet_object *obj; in com_property_write() local
65 obj = (php_com_dotnet_object*) object; in com_property_write()
67 if (V_VT(&obj->v) == VT_DISPATCH) { in com_property_write()
70 if (SUCCESS == php_com_do_invoke(obj, ZSTR_VAL(member), ZSTR_LEN(member), in com_property_write()
82 php_com_dotnet_object *obj; in com_read_dimension() local
87 obj = (php_com_dotnet_object*) object; in com_read_dimension()
89 if (V_VT(&obj->v) == VT_DISPATCH) { in com_read_dimension()
92 if (SUCCESS == php_com_do_invoke_by_id(obj, DISPID_VALUE, in com_read_dimension()
94 php_com_zval_from_variant(rv, &v, obj->code_page); in com_read_dimension()
97 } else if (V_ISARRAY(&obj->v)) { in com_read_dimension()
100 if (SafeArrayGetDim(V_ARRAY(&obj->v)) == 1) { in com_read_dimension()
101 if (php_com_safearray_get_elem(&obj->v, &v, (LONG)Z_LVAL_P(offset))) { in com_read_dimension()
102 php_com_wrap_variant(rv, &v, obj->code_page); in com_read_dimension()
118 php_com_dotnet_object *obj; in com_write_dimension() local
123 obj = (php_com_dotnet_object*) object; in com_write_dimension()
130 if (V_VT(&obj->v) == VT_DISPATCH) { in com_write_dimension()
136 if (SUCCESS == php_com_do_invoke_by_id(obj, DISPID_VALUE, in com_write_dimension()
140 } else if (V_ISARRAY(&obj->v)) { in com_write_dimension()
144 if (SafeArrayGetDim(V_ARRAY(&obj->v)) == 1) { in com_write_dimension()
145 if (FAILED(SafeArrayGetVartype(V_ARRAY(&obj->v), &vt)) || vt == VT_EMPTY) { in com_write_dimension()
146 vt = V_VT(&obj->v) & ~VT_ARRAY; in com_write_dimension()
153 php_com_variant_from_zval(&v, value, obj->code_page); in com_write_dimension()
160 res = SafeArrayPutElement(V_ARRAY(&obj->v), &indices, &v); in com_write_dimension()
162 res = SafeArrayPutElement(V_ARRAY(&obj->v), &indices, &v.lVal); in com_write_dimension()
188 php_com_dotnet_object *obj; in com_property_exists() local
190 obj = (php_com_dotnet_object*) object; in com_property_exists()
192 if (V_VT(&obj->v) == VT_DISPATCH) { in com_property_exists()
193 if (SUCCEEDED(php_com_get_id_of_name(obj, ZSTR_VAL(member), ZSTR_LEN(member), &dispid))) { in com_property_exists()
254 php_com_dotnet_object *obj = CDNO_FETCH(object); in PHP_FUNCTION() local
259 if (V_VT(&obj->v) != VT_DISPATCH) { in PHP_FUNCTION()
272 …if (SUCCESS == php_com_do_invoke_byref(obj, (zend_internal_function*)EX(func), DISPATCH_METHOD|DIS… in PHP_FUNCTION()
273 php_com_zval_from_variant(return_value, &v, obj->code_page); in PHP_FUNCTION()
295 php_com_dotnet_object *obj = (php_com_dotnet_object*)*object_ptr; in com_method_get() local
297 if (V_VT(&obj->v) != VT_DISPATCH) { in com_method_get()
301 if (FAILED(php_com_get_id_of_name(obj, name->val, name->len, &dummy))) { in com_method_get()
306 if (obj->method_cache == NULL || NULL == (fptr = zend_hash_find_ptr(obj->method_cache, name))) { in com_method_get()
311 f.scope = obj->ce; in com_method_get()
318 if (obj->typeinfo) { in com_method_get()
328 if (SUCCEEDED(ITypeInfo_GetTypeComp(obj->typeinfo, &comp))) { in com_method_get()
329 olename = php_com_string_to_olestring(name->val, name->len, obj->code_page); in com_method_get()
370 if (!obj->method_cache) { in com_method_get()
371 ALLOC_HASHTABLE(obj->method_cache); in com_method_get()
372 zend_hash_init(obj->method_cache, 2, NULL, function_dtor, 0); in com_method_get()
375 zend_hash_update_mem(obj->method_cache, name, &f, sizeof(f)); in com_method_get()
393 php_com_dotnet_object *obj = (php_com_dotnet_object *)object; in com_class_name_get() local
395 return zend_string_copy(obj->ce->name); in com_class_name_get()
435 php_com_dotnet_object *obj; in com_object_cast() local
440 obj = (php_com_dotnet_object*) readobj; in com_object_cast()
444 if (V_VT(&obj->v) == VT_DISPATCH) { in com_object_cast()
445 if (SUCCESS != php_com_do_invoke_by_id(obj, DISPID_VALUE, in com_object_cast()
447 VariantCopy(&v, &obj->v); in com_object_cast()
450 VariantCopy(&v, &obj->v); in com_object_cast()
482 php_com_zval_from_variant(writeobj, &v, obj->code_page); in com_object_cast()
496 php_com_dotnet_object *obj; in com_object_count() local
499 obj = (php_com_dotnet_object*) object; in com_object_count()
501 if (!V_ISARRAY(&obj->v)) { in com_object_count()
505 SafeArrayGetLBound(V_ARRAY(&obj->v), 1, &lbound); in com_object_count()
506 SafeArrayGetUBound(V_ARRAY(&obj->v), 1, &ubound); in com_object_count()
541 void php_com_object_enable_event_sink(php_com_dotnet_object *obj, int enable) in php_com_object_enable_event_sink() argument
543 if (obj->sink_dispatch) { in php_com_object_enable_event_sink()
547 if (SUCCEEDED(IDispatch_QueryInterface(V_DISPATCH(&obj->v), in php_com_object_enable_event_sink()
551 &obj->sink_id, &point))) { in php_com_object_enable_event_sink()
554 IConnectionPoint_Advise(point, (IUnknown*)obj->sink_dispatch, &obj->sink_cookie); in php_com_object_enable_event_sink()
556 IConnectionPoint_Unadvise(point, obj->sink_cookie); in php_com_object_enable_event_sink()
567 php_com_dotnet_object *obj = (php_com_dotnet_object*)object; in php_com_object_free_storage() local
569 if (obj->typeinfo) { in php_com_object_free_storage()
570 ITypeInfo_Release(obj->typeinfo); in php_com_object_free_storage()
571 obj->typeinfo = NULL; in php_com_object_free_storage()
574 if (obj->sink_dispatch) { in php_com_object_free_storage()
575 php_com_object_enable_event_sink(obj, FALSE); in php_com_object_free_storage()
576 IDispatch_Release(obj->sink_dispatch); in php_com_object_free_storage()
577 obj->sink_dispatch = NULL; in php_com_object_free_storage()
580 VariantClear(&obj->v); in php_com_object_free_storage()
582 if (obj->method_cache) { in php_com_object_free_storage()
583 zend_hash_destroy(obj->method_cache); in php_com_object_free_storage()
584 FREE_HASHTABLE(obj->method_cache); in php_com_object_free_storage()
586 if (obj->id_of_name_cache) { in php_com_object_free_storage()
587 zend_hash_destroy(obj->id_of_name_cache); in php_com_object_free_storage()
588 FREE_HASHTABLE(obj->id_of_name_cache); in php_com_object_free_storage()
620 php_com_dotnet_object *obj; in php_com_object_new() local
623 obj = emalloc(sizeof(*obj)); in php_com_object_new()
624 memset(obj, 0, sizeof(*obj)); in php_com_object_new()
626 VariantInit(&obj->v); in php_com_object_new()
627 obj->code_page = CP_ACP; in php_com_object_new()
628 obj->ce = ce; in php_com_object_new()
630 zend_object_std_init(&obj->zo, ce); in php_com_object_new()
631 obj->zo.handlers = &php_com_object_handlers; in php_com_object_new()
633 obj->typeinfo = NULL; in php_com_object_new()
635 return (zend_object*)obj; in php_com_object_new()