47 }
else if (
res == DISP_E_BADPARAMCOUNT) {
71 DISPATCH_PROPERTYPUT|DISPATCH_PROPERTYPUTREF, &
v, 1,
value, 0)) {
93 DISPATCH_METHOD|DISPATCH_PROPERTYGET, &
v, 1,
offset, 0, 0)) {
97 }
else if (V_ISARRAY(&obj->
v)) {
100 if (SafeArrayGetDim(V_ARRAY(&obj->
v)) == 1) {
137 DISPATCH_METHOD|DISPATCH_PROPERTYPUT, &
v, 2,
args, 0, 0)) {
140 }
else if (V_ISARRAY(&obj->
v)) {
144 if (SafeArrayGetDim(V_ARRAY(&obj->
v)) == 1) {
145 if (FAILED(SafeArrayGetVartype(V_ARRAY(&obj->
v), &
vt)) ||
vt ==
VT_EMPTY) {
155 if (V_VT(&
v) !=
vt) {
156 VariantChangeType(&
v, &
v, 0,
vt);
160 res = SafeArrayPutElement(V_ARRAY(&obj->
v), &indices, &
v);
162 res = SafeArrayPutElement(V_ARRAY(&obj->
v), &indices, &
v.lVal);
185static int com_property_exists(
zend_object *
object,
zend_string *member,
int check_empty,
void **cache_slot)
204static int com_dimension_exists(
zend_object *
object,
zval *member,
int check_empty)
238static void function_dtor(
zval *
zv)
284 zend_string_release(
EX(
func)->common.function_name);
321 ITypeInfo *TI =
NULL;
328 if (SUCCEEDED(ITypeInfo_GetTypeComp(obj->
typeinfo, &comp))) {
332 if (SUCCEEDED(ITypeComp_Bind(comp, olename, lhash, INVOKE_FUNC, &TI, &
kind, &bindptr))) {
334 case DESCKIND_FUNCDESC:
337 for (i = 0; i < bindptr.lpfuncdesc->cParams; i++) {
338 bool by_ref = (bindptr.lpfuncdesc->lprgelemdescParam[i].paramdesc.wParamFlags & PARAMFLAG_FOUT) != 0;
342 f.
num_args = bindptr.lpfuncdesc->cParams;
344 ITypeInfo_ReleaseFuncDesc(TI, bindptr.lpfuncdesc);
349 case DESCKIND_VARDESC:
350 ITypeInfo_ReleaseVarDesc(TI, bindptr.lpvardesc);
352 case DESCKIND_TYPECOMP:
353 ITypeComp_Release(bindptr.lptcomp);
360 ITypeInfo_Release(TI);
363 ITypeComp_Release(comp);
395 return zend_string_copy(obj->
ce->
name);
399static int com_objects_compare(
zval *object1,
zval *object2)
407 STDAPI VarCmp(LPVARIANT pvarLeft, LPVARIANT pvarRight, LCID lcid,
DWORD flags);
446 DISPATCH_METHOD|DISPATCH_PROPERTYGET, &
v, 0,
NULL, 1, 0)) {
447 VariantCopy(&
v, &obj->
v);
450 VariantCopy(&
v, &obj->
v);
456#if SIZEOF_ZEND_LONG == 4
478 res = VariantChangeType(&
v, &
v, 0,
vt);
481 if (SUCCEEDED(
res)) {
487 if (SUCCEEDED(
res)) {
497 LONG ubound = 0, lbound = 0;
501 if (!V_ISARRAY(&obj->
v)) {
505 SafeArrayGetLBound(V_ARRAY(&obj->
v), 1, &lbound);
506 SafeArrayGetUBound(V_ARRAY(&obj->
v), 1, &ubound);
508 *
count = ubound - lbound + 1;
522 com_get_property_ptr_ptr,
525 com_dimension_exists,
526 com_dimension_delete,
544 IConnectionPointContainer *
cont;
545 IConnectionPoint *point;
547 if (SUCCEEDED(IDispatch_QueryInterface(V_DISPATCH(&obj->
v),
548 &IID_IConnectionPointContainer, (
void**)&
cont))) {
550 if (SUCCEEDED(IConnectionPointContainer_FindConnectionPoint(
cont,
556 IConnectionPoint_Unadvise(point, obj->
sink_cookie);
558 IConnectionPoint_Release(point);
560 IConnectionPointContainer_Release(
cont);
580 VariantClear(&obj->
v);
601 memcpy(cloneobj, origobject,
sizeof(*cloneobj));
606 VariantInit(&cloneobj->
v);
609 VariantCopyInd(&cloneobj->
v, &origobject->
v);
612 ITypeInfo_AddRef(cloneobj->
typeinfo);
624 memset(obj, 0,
sizeof(*obj));
626 VariantInit(&obj->
v);
count(Countable|array $value, int $mode=COUNT_NORMAL)
zend_result php_com_do_invoke(php_com_dotnet_object *obj, zend_string *name, WORD flags, VARIANT *v, int nargs, zval *args, bool allow_noarg)
zend_result php_com_do_invoke_by_id(php_com_dotnet_object *obj, DISPID dispid, WORD flags, VARIANT *v, int nargs, zval *args, bool silent, bool allow_noarg)
HRESULT php_com_get_id_of_name(php_com_dotnet_object *obj, zend_string *name, DISPID *dispid)
zend_result php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function *f, WORD flags, VARIANT *v, int nargs, zval *args)
void php_com_object_enable_event_sink(php_com_dotnet_object *obj, bool enable)
zend_object_handlers php_com_object_handlers
zend_object * php_com_object_new(zend_class_entry *ce)
void php_com_object_free_storage(zend_object *object)
zend_object * php_com_object_clone(zend_object *object)
PHP_COM_DOTNET_API bool php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1)
PHP_COM_DOTNET_API void php_com_wrap_variant(zval *z, VARIANT *v, int codepage)
void php_com_throw_exception(HRESULT code, char *message)
PHP_COM_DOTNET_API OLECHAR * php_com_string_to_olestring(const char *string, size_t string_len, int codepage)
void php_com_saproxy_create(zend_object *com_object, zval *proxy_out, zval *index)
PHP_COM_DOTNET_API zend_result php_com_zval_from_variant(zval *z, VARIANT *v, int codepage)
PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage)
memset(ptr, 0, type->size)
PHPAPI void php_com_initialize(void)
struct _php_com_dotnet_object php_com_dotnet_object
unsigned char key[REFLECTION_KEY_LEN]
HashTable * id_of_name_cache
IDispatch * sink_dispatch
zend_string * function_name
zend_internal_arg_info * arg_info
zend_string * doc_comment
ZEND_API ZEND_COLD void zend_throw_error(zend_class_entry *exception_ce, const char *format,...)
ZEND_API zend_result zend_get_parameters_array_ex(uint32_t param_count, zval *argument_array)
#define _ZEND_ARG_INFO_FLAGS(pass_by_ref, is_variadic, is_tentative)
#define ecalloc(nmemb, size)
#define FREE_HASHTABLE(ht)
#define safe_emalloc(nmemb, size, offset)
#define ALLOC_HASHTABLE(ht)
exit(string|int $status=0)
zend_string_release_ex(func->internal_function.function_name, 0)
ZEND_API void zend_set_function_arg_flags(zend_function *func)
#define ZEND_INTERNAL_FUNCTION
#define ZEND_ACC_CALL_VIA_TRAMPOLINE
#define ZEND_ACC_CALL_VIA_HANDLER
struct _zend_arg_info zend_arg_info
struct _zend_internal_function zend_internal_function
union _zend_function zend_function
ZEND_API void ZEND_FASTCALL zend_hash_destroy(HashTable *ht)
ZEND_API const HashTable zend_empty_array
#define zend_hash_init(ht, nSize, pHashFunction, pDestructor, persistent)
struct _zend_string zend_string
ZEND_API zend_result zend_std_cast_object_tostring(zend_object *readobj, zval *writeobj, int type)
ZEND_API zend_function * zend_std_get_constructor(zend_object *zobj)
#define ZEND_COMPARE_OBJECTS_FALLBACK(op1, op2)
#define zend_free_trampoline(func)
ZEND_API void zend_objects_destroy_object(zend_object *object)
ZEND_API void ZEND_FASTCALL zend_object_std_init(zend_object *object, zend_class_entry *ce)
ZEND_API void zend_object_std_dtor(zend_object *object)
ZEND_API void ZEND_FASTCALL convert_to_long(zval *op)
struct _zend_class_entry zend_class_entry
struct _zend_object zend_object
struct _zend_array HashTable
#define ZEND_TYPE_INIT_NONE(extra_flags)
ZEND_RESULT_CODE zend_result
struct _zend_object_handlers zend_object_handlers
#define ZVAL_COPY_VALUE(z, v)