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, member, DISPATCH_METHOD|DISPATCH_PROPERTYGET, 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, 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, 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 ret = php_com_zval_from_variant(return_value, &v, obj->code_page); in PHP_FUNCTION()
294 php_com_dotnet_object *obj = (php_com_dotnet_object*)*object_ptr; in com_method_get() local
296 if (V_VT(&obj->v) != VT_DISPATCH) { in com_method_get()
300 if (FAILED(php_com_get_id_of_name(obj, name, &dummy))) { in com_method_get()
305 if (obj->method_cache == NULL || NULL == (fptr = zend_hash_find_ptr(obj->method_cache, name))) { in com_method_get()
310 f.scope = obj->ce; in com_method_get()
317 if (obj->typeinfo) { in com_method_get()
327 if (SUCCEEDED(ITypeInfo_GetTypeComp(obj->typeinfo, &comp))) { in com_method_get()
328 olename = php_com_string_to_olestring(name->val, name->len, obj->code_page); in com_method_get()
369 if (!obj->method_cache) { in com_method_get()
370 ALLOC_HASHTABLE(obj->method_cache); in com_method_get()
371 zend_hash_init(obj->method_cache, 2, NULL, function_dtor, 0); in com_method_get()
374 zend_hash_update_mem(obj->method_cache, name, &f, sizeof(f)); in com_method_get()
392 php_com_dotnet_object *obj = (php_com_dotnet_object *)object; in com_class_name_get() local
394 return zend_string_copy(obj->ce->name); in com_class_name_get()
434 php_com_dotnet_object *obj; in com_object_cast() local
439 obj = (php_com_dotnet_object*) readobj; in com_object_cast()
443 if (V_VT(&obj->v) == VT_DISPATCH) { in com_object_cast()
444 if (SUCCESS != php_com_do_invoke_by_id(obj, DISPID_VALUE, in com_object_cast()
446 VariantCopy(&v, &obj->v); in com_object_cast()
449 VariantCopy(&v, &obj->v); in com_object_cast()
481 php_com_zval_from_variant(writeobj, &v, obj->code_page); in com_object_cast()
495 php_com_dotnet_object *obj; in com_object_count() local
498 obj = (php_com_dotnet_object*) object; in com_object_count()
500 if (!V_ISARRAY(&obj->v)) { in com_object_count()
504 SafeArrayGetLBound(V_ARRAY(&obj->v), 1, &lbound); in com_object_count()
505 SafeArrayGetUBound(V_ARRAY(&obj->v), 1, &ubound); in com_object_count()
540 void php_com_object_enable_event_sink(php_com_dotnet_object *obj, bool enable) in php_com_object_enable_event_sink() argument
542 if (obj->sink_dispatch) { in php_com_object_enable_event_sink()
546 if (SUCCEEDED(IDispatch_QueryInterface(V_DISPATCH(&obj->v), in php_com_object_enable_event_sink()
550 &obj->sink_id, &point))) { in php_com_object_enable_event_sink()
553 IConnectionPoint_Advise(point, (IUnknown*)obj->sink_dispatch, &obj->sink_cookie); in php_com_object_enable_event_sink()
555 IConnectionPoint_Unadvise(point, obj->sink_cookie); in php_com_object_enable_event_sink()
566 php_com_dotnet_object *obj = (php_com_dotnet_object*)object; in php_com_object_free_storage() local
568 if (obj->typeinfo) { in php_com_object_free_storage()
569 ITypeInfo_Release(obj->typeinfo); in php_com_object_free_storage()
570 obj->typeinfo = NULL; in php_com_object_free_storage()
573 if (obj->sink_dispatch) { in php_com_object_free_storage()
574 php_com_object_enable_event_sink(obj, /* enable */ false); in php_com_object_free_storage()
575 IDispatch_Release(obj->sink_dispatch); in php_com_object_free_storage()
576 obj->sink_dispatch = NULL; in php_com_object_free_storage()
579 VariantClear(&obj->v); in php_com_object_free_storage()
581 if (obj->method_cache) { in php_com_object_free_storage()
582 zend_hash_destroy(obj->method_cache); in php_com_object_free_storage()
583 FREE_HASHTABLE(obj->method_cache); in php_com_object_free_storage()
585 if (obj->id_of_name_cache) { in php_com_object_free_storage()
586 zend_hash_destroy(obj->id_of_name_cache); in php_com_object_free_storage()
587 FREE_HASHTABLE(obj->id_of_name_cache); in php_com_object_free_storage()
619 php_com_dotnet_object *obj; in php_com_object_new() local
622 obj = emalloc(sizeof(*obj)); in php_com_object_new()
623 memset(obj, 0, sizeof(*obj)); in php_com_object_new()
625 VariantInit(&obj->v); in php_com_object_new()
626 obj->code_page = CP_ACP; in php_com_object_new()
627 obj->ce = ce; in php_com_object_new()
629 zend_object_std_init(&obj->zo, ce); in php_com_object_new()
630 obj->zo.handlers = &php_com_object_handlers; in php_com_object_new()
632 obj->typeinfo = NULL; in php_com_object_new()
634 return (zend_object*)obj; in php_com_object_new()