Lines Matching refs:obj
34 php_com_dotnet_object *obj; in com_property_read() local
40 obj = CDNO_FETCH(object); in com_property_read()
42 if (V_VT(&obj->v) == VT_DISPATCH) { in com_property_read()
47 res = php_com_do_invoke(obj, Z_STRVAL_P(member), Z_STRLEN_P(member), in com_property_read()
51 php_com_zval_from_variant(rv, &v, obj->code_page); in com_property_read()
65 php_com_dotnet_object *obj; in com_property_write() local
68 obj = CDNO_FETCH(object); in com_property_write()
70 if (V_VT(&obj->v) == VT_DISPATCH) { in com_property_write()
74 if (SUCCESS == php_com_do_invoke(obj, Z_STRVAL_P(member), Z_STRLEN_P(member), in com_property_write()
85 php_com_dotnet_object *obj; in com_read_dimension() local
90 obj = CDNO_FETCH(object); in com_read_dimension()
92 if (V_VT(&obj->v) == VT_DISPATCH) { in com_read_dimension()
95 if (SUCCESS == php_com_do_invoke_by_id(obj, DISPID_VALUE, in com_read_dimension()
97 php_com_zval_from_variant(rv, &v, obj->code_page); in com_read_dimension()
100 } else if (V_ISARRAY(&obj->v)) { in com_read_dimension()
103 if (SafeArrayGetDim(V_ARRAY(&obj->v)) == 1) { in com_read_dimension()
104 if (php_com_safearray_get_elem(&obj->v, &v, (LONG)Z_LVAL_P(offset))) { in com_read_dimension()
105 php_com_wrap_variant(rv, &v, obj->code_page); in com_read_dimension()
121 php_com_dotnet_object *obj; in com_write_dimension() local
126 obj = CDNO_FETCH(object); in com_write_dimension()
128 if (V_VT(&obj->v) == VT_DISPATCH) { in com_write_dimension()
134 if (SUCCESS == php_com_do_invoke_by_id(obj, DISPID_VALUE, in com_write_dimension()
138 } else if (V_ISARRAY(&obj->v)) { in com_write_dimension()
142 if (SafeArrayGetDim(V_ARRAY(&obj->v)) == 1) { in com_write_dimension()
143 if (FAILED(SafeArrayGetVartype(V_ARRAY(&obj->v), &vt)) || vt == VT_EMPTY) { in com_write_dimension()
144 vt = V_VT(&obj->v) & ~VT_ARRAY; in com_write_dimension()
151 php_com_variant_from_zval(&v, value, obj->code_page); in com_write_dimension()
158 res = SafeArrayPutElement(V_ARRAY(&obj->v), &indices, &v); in com_write_dimension()
160 res = SafeArrayPutElement(V_ARRAY(&obj->v), &indices, &v.lVal); in com_write_dimension()
194 php_com_dotnet_object *obj; in com_property_exists() local
196 obj = CDNO_FETCH(object); in com_property_exists()
198 if (V_VT(&obj->v) == VT_DISPATCH) { in com_property_exists()
200 if (SUCCEEDED(php_com_get_id_of_name(obj, Z_STRVAL_P(member), Z_STRLEN_P(member), &dispid))) { in com_property_exists()
263 php_com_dotnet_object *obj = (php_com_dotnet_object*)*object_ptr; in com_method_get() local
265 if (V_VT(&obj->v) != VT_DISPATCH) { in com_method_get()
269 if (FAILED(php_com_get_id_of_name(obj, name->val, name->len, &dummy))) { in com_method_get()
274 if (obj->method_cache == NULL || NULL == (fptr = zend_hash_find_ptr(obj->method_cache, name))) { in com_method_get()
278 f.scope = obj->ce; in com_method_get()
285 if (obj->typeinfo) { in com_method_get()
295 if (SUCCEEDED(ITypeInfo_GetTypeComp(obj->typeinfo, &comp))) { in com_method_get()
296 olename = php_com_string_to_olestring(name->val, name->len, obj->code_page); in com_method_get()
339 if (!obj->method_cache) { in com_method_get()
340 ALLOC_HASHTABLE(obj->method_cache); in com_method_get()
341 zend_hash_init(obj->method_cache, 2, NULL, function_dtor, 0); in com_method_get()
344 zend_hash_update_mem(obj->method_cache, name, &f, sizeof(f)); in com_method_get()
362 php_com_dotnet_object *obj = (php_com_dotnet_object*)object; in com_call_method() local
367 if (V_VT(&obj->v) != VT_DISPATCH) { in com_call_method()
380 …if (SUCCESS == php_com_do_invoke_byref(obj, (zend_internal_function*)EX(func), DISPATCH_METHOD|DIS… in com_call_method()
381 php_com_zval_from_variant(return_value, &v, obj->code_page); in com_call_method()
395 php_com_dotnet_object *obj = (php_com_dotnet_object *) object; in com_constructor_get() local
400 f.function_name = obj->ce->name; \ in com_constructor_get()
401 f.scope = obj->ce; \ in com_constructor_get()
408 switch (obj->ce->name->val[0]) { in com_constructor_get()
427 php_com_dotnet_object *obj = (php_com_dotnet_object *)object; in com_class_name_get() local
429 return zend_string_copy(obj->ce->name); in com_class_name_get()
467 php_com_dotnet_object *obj; in com_object_cast() local
472 obj = CDNO_FETCH(readobj); in com_object_cast()
476 if (V_VT(&obj->v) == VT_DISPATCH) { in com_object_cast()
477 if (SUCCESS != php_com_do_invoke_by_id(obj, DISPID_VALUE, in com_object_cast()
479 VariantCopy(&v, &obj->v); in com_object_cast()
482 VariantCopy(&v, &obj->v); in com_object_cast()
509 php_com_zval_from_variant(writeobj, &v, obj->code_page); in com_object_cast()
523 php_com_dotnet_object *obj; in com_object_count() local
526 obj = CDNO_FETCH(object); in com_object_count()
528 if (!V_ISARRAY(&obj->v)) { in com_object_count()
532 SafeArrayGetLBound(V_ARRAY(&obj->v), 1, &lbound); in com_object_count()
533 SafeArrayGetUBound(V_ARRAY(&obj->v), 1, &ubound); in com_object_count()
569 void php_com_object_enable_event_sink(php_com_dotnet_object *obj, int enable) in php_com_object_enable_event_sink() argument
571 if (obj->sink_dispatch) { in php_com_object_enable_event_sink()
575 if (SUCCEEDED(IDispatch_QueryInterface(V_DISPATCH(&obj->v), in php_com_object_enable_event_sink()
579 &obj->sink_id, &point))) { in php_com_object_enable_event_sink()
582 IConnectionPoint_Advise(point, (IUnknown*)obj->sink_dispatch, &obj->sink_cookie); in php_com_object_enable_event_sink()
584 IConnectionPoint_Unadvise(point, obj->sink_cookie); in php_com_object_enable_event_sink()
595 php_com_dotnet_object *obj = (php_com_dotnet_object*)object; in php_com_object_free_storage() local
597 if (obj->typeinfo) { in php_com_object_free_storage()
598 ITypeInfo_Release(obj->typeinfo); in php_com_object_free_storage()
599 obj->typeinfo = NULL; in php_com_object_free_storage()
602 if (obj->sink_dispatch) { in php_com_object_free_storage()
603 php_com_object_enable_event_sink(obj, FALSE); in php_com_object_free_storage()
604 IDispatch_Release(obj->sink_dispatch); in php_com_object_free_storage()
605 obj->sink_dispatch = NULL; in php_com_object_free_storage()
608 VariantClear(&obj->v); in php_com_object_free_storage()
610 if (obj->method_cache) { in php_com_object_free_storage()
611 zend_hash_destroy(obj->method_cache); in php_com_object_free_storage()
612 FREE_HASHTABLE(obj->method_cache); in php_com_object_free_storage()
614 if (obj->id_of_name_cache) { in php_com_object_free_storage()
615 zend_hash_destroy(obj->id_of_name_cache); in php_com_object_free_storage()
616 FREE_HASHTABLE(obj->id_of_name_cache); in php_com_object_free_storage()
646 php_com_dotnet_object *obj; in php_com_object_new() local
649 obj = emalloc(sizeof(*obj)); in php_com_object_new()
650 memset(obj, 0, sizeof(*obj)); in php_com_object_new()
652 VariantInit(&obj->v); in php_com_object_new()
653 obj->code_page = CP_ACP; in php_com_object_new()
654 obj->ce = ce; in php_com_object_new()
656 zend_object_std_init(&obj->zo, ce); in php_com_object_new()
657 obj->zo.handlers = &php_com_object_handlers; in php_com_object_new()
659 obj->typeinfo = NULL; in php_com_object_new()
661 return (zend_object*)obj; in php_com_object_new()