Lines Matching refs:disp

51 static void disp_destructor(php_dispatchex *disp);
55 php_dispatchex *disp = (php_dispatchex *)rsrc->ptr; in dispatch_dtor() local
56 disp_destructor(disp); in dispatch_dtor()
86 php_dispatchex *disp = (php_dispatchex*)This; \
88 trace(" PHP Object:%p (name:unknown) %s\n", Z_OBJ(disp->object), methname); \
90 …trace(" PHP Object:%p (name:%s) %s\n", Z_OBJ(disp->object), Z_OBJCE(disp->object)->name->val, meth…
92 if (GetCurrentThreadId() != disp->engine_thread) { \
106 IsEqualGUID(&disp->sinkid, riid)) { in disp_queryinterface()
108 InterlockedIncrement(&disp->refcount); in disp_queryinterface()
120 return InterlockedIncrement(&disp->refcount); in disp_addref()
128 ret = InterlockedDecrement(&disp->refcount); in disp_release()
132 if (disp->res) in disp_release()
133 zend_list_delete(disp->res); in disp_release()
180 if ((tmp = zend_hash_str_find(disp->name_to_dispid, name, namelen)) == NULL) { in disp_getidsofnames()
224 trace("Looking for %s, namelen=%d in %p\n", name, namelen, disp->name_to_dispid); in disp_getdispid()
227 if ((tmp = zend_hash_str_find(disp->name_to_dispid, name, namelen)) != NULL) { in disp_getdispid()
255 if (NULL != (name = zend_hash_index_find(disp->dispid_to_name, id))) { in disp_invokeex()
281 …retval = zend_read_property(Z_OBJCE(disp->object), Z_OBJ(disp->object), Z_STRVAL_P(name), Z_STRLEN… in disp_invokeex()
283 …zend_update_property(Z_OBJCE(disp->object), Z_OBJ(disp->object), Z_STRVAL_P(name), Z_STRLEN_P(name… in disp_invokeex()
287 if (SUCCESS == call_user_function(NULL, &disp->object, name, in disp_invokeex()
382 if (NULL != (name = zend_hash_index_find(disp->dispid_to_name, id))) { in disp_getmembername()
401 while(!zend_hash_index_exists(disp->dispid_to_name, next)) in disp_getnextdispid()
404 if (zend_hash_index_exists(disp->dispid_to_name, next)) { in disp_getnextdispid()
442 static void generate_dispids(php_dispatchex *disp) in generate_dispids() argument
450 if (disp->dispid_to_name == NULL) { in generate_dispids()
451 ALLOC_HASHTABLE(disp->dispid_to_name); in generate_dispids()
452 ALLOC_HASHTABLE(disp->name_to_dispid); in generate_dispids()
453 zend_hash_init(disp->name_to_dispid, 0, NULL, ZVAL_PTR_DTOR, 0); in generate_dispids()
454 zend_hash_init(disp->dispid_to_name, 0, NULL, ZVAL_PTR_DTOR, 0); in generate_dispids()
458 if (Z_OBJPROP(disp->object)) { in generate_dispids()
459 zend_hash_internal_pointer_reset_ex(Z_OBJPROP(disp->object), &pos); in generate_dispids()
461 zend_hash_get_current_key_ex(Z_OBJPROP(disp->object), &name, in generate_dispids()
471 zend_hash_move_forward_ex(Z_OBJPROP(disp->object), &pos); in generate_dispids()
474 if ((tmp = zend_hash_find(disp->name_to_dispid, name)) != NULL) { in generate_dispids()
481 pid = zend_hash_next_free_element(disp->dispid_to_name); in generate_dispids()
482 zend_hash_index_update(disp->dispid_to_name, pid, &tmp2); in generate_dispids()
485 zend_hash_update(disp->name_to_dispid, name, &tmp2); in generate_dispids()
492 if (Z_OBJCE(disp->object)) { in generate_dispids()
493 zend_hash_internal_pointer_reset_ex(&Z_OBJCE(disp->object)->function_table, &pos); in generate_dispids()
495 zend_hash_get_current_key_ex(&Z_OBJCE(disp->object)->function_table, in generate_dispids()
506 zend_hash_move_forward_ex(&Z_OBJCE(disp->object)->function_table, &pos); in generate_dispids()
509 if ((tmp = zend_hash_find(disp->name_to_dispid, name)) != NULL) { in generate_dispids()
516 pid = zend_hash_next_free_element(disp->dispid_to_name); in generate_dispids()
517 zend_hash_index_update(disp->dispid_to_name, pid, &tmp2); in generate_dispids()
520 zend_hash_update(disp->name_to_dispid, name, &tmp2); in generate_dispids()
529 php_dispatchex *disp = (php_dispatchex*)CoTaskMemAlloc(sizeof(php_dispatchex)); in disp_constructor() local
534 if (disp == NULL) in disp_constructor()
537 memset(disp, 0, sizeof(php_dispatchex)); in disp_constructor()
539 disp->engine_thread = GetCurrentThreadId(); in disp_constructor()
540 disp->lpVtbl = &php_dispatch_vtbl; in disp_constructor()
541 disp->refcount = 1; in disp_constructor()
545 ZVAL_COPY(&disp->object, object); in disp_constructor()
547 ZVAL_UNDEF(&disp->object); in disp_constructor()
550 tmp = zend_list_insert(disp, le_dispatch); in disp_constructor()
551 disp->res = Z_RES_P(tmp); in disp_constructor()
553 return disp; in disp_constructor()
556 static void disp_destructor(php_dispatchex *disp) in disp_destructor() argument
560 trace("destroying COM wrapper for PHP object %p (name:unknown)\n", Z_OBJ(disp->object)); in disp_destructor()
562 …trace("destroying COM wrapper for PHP object %p (name:%s)\n", Z_OBJ(disp->object), Z_OBJCE(disp->o… in disp_destructor()
565 disp->res = NULL; in disp_destructor()
567 if (disp->refcount > 0) in disp_destructor()
568 CoDisconnectObject((IUnknown*)disp, 0); in disp_destructor()
570 zend_hash_destroy(disp->dispid_to_name); in disp_destructor()
571 zend_hash_destroy(disp->name_to_dispid); in disp_destructor()
572 FREE_HASHTABLE(disp->dispid_to_name); in disp_destructor()
573 FREE_HASHTABLE(disp->name_to_dispid); in disp_destructor()
575 zval_ptr_dtor(&disp->object); in disp_destructor()
577 CoTaskMemFree(disp); in disp_destructor()
583 php_dispatchex *disp = disp_constructor(val); in php_com_wrapper_export_as_sink() local
590 disp->dispid_to_name = id_to_name; in php_com_wrapper_export_as_sink()
592 memcpy(&disp->sinkid, sinkid, sizeof(disp->sinkid)); in php_com_wrapper_export_as_sink()
595 ALLOC_HASHTABLE(disp->name_to_dispid); in php_com_wrapper_export_as_sink()
596 zend_hash_init(disp->name_to_dispid, 0, NULL, ZVAL_PTR_DTOR, 0); in php_com_wrapper_export_as_sink()
607 zend_hash_update(disp->name_to_dispid, Z_STR_P(ntmp), &tmp); in php_com_wrapper_export_as_sink()
613 return (IDispatch*)disp; in php_com_wrapper_export_as_sink()
618 php_dispatchex *disp = NULL; in php_com_wrapper_export() local
639 disp = disp_constructor(val); in php_com_wrapper_export()
640 generate_dispids(disp); in php_com_wrapper_export()
642 return (IDispatch*)disp; in php_com_wrapper_export()