php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
php_com_dotnet_internal.h
Go to the documentation of this file.
1/*
2 +----------------------------------------------------------------------+
3 | Copyright (c) The PHP Group |
4 +----------------------------------------------------------------------+
5 | This source file is subject to version 3.01 of the PHP license, |
6 | that is bundled with this package in the file LICENSE, and is |
7 | available through the world-wide-web at the following url: |
8 | https://www.php.net/license/3_01.txt |
9 | If you did not receive a copy of the PHP license and are unable to |
10 | obtain it through the world-wide-web, please send a note to |
11 | license@php.net so we can mail you a copy immediately. |
12 +----------------------------------------------------------------------+
13 | Author: Wez Furlong <wez@thebrainroom.com> |
14 +----------------------------------------------------------------------+
15 */
16
17#ifndef PHP_COM_DOTNET_INTERNAL_H
18#define PHP_COM_DOTNET_INTERNAL_H
19
20#define _WIN32_DCOM
21#define COBJMACROS
22#include <ocidl.h>
23#include <oleauto.h>
24#include <unknwn.h>
25#include <dispex.h>
26#include "win32/winutil.h"
27
28typedef struct _php_com_dotnet_object {
30
31 VARIANT v;
33
35
36 ITypeInfo *typeinfo;
37
39
40 /* associated event sink */
41 IDispatch *sink_dispatch;
42 GUID sink_id;
44
45 /* cache for method signatures */
47 /* cache for name -> DISPID */
50
51static inline bool php_com_is_valid_object(zval *zv)
52{
54 return zend_string_equals_literal(ce->name, "com") ||
55 zend_string_equals_literal(ce->name, "dotnet") ||
56 zend_string_equals_literal(ce->name, "variant");
57}
58
59#define CDNO_FETCH(zv) (php_com_dotnet_object*)Z_OBJ_P(zv)
60#define CDNO_FETCH_VERIFY(obj, zv) do { \
61 if (!php_com_is_valid_object(zv)) { \
62 php_com_throw_exception(E_UNEXPECTED, "expected a variant object"); \
63 return; \
64 } \
65 obj = (php_com_dotnet_object*)Z_OBJ_P(zv); \
66} while(0)
67
68/* com_extension.c */
70
71/* com_handlers.c */
77
78/* com_saproxy.c */
80void php_com_saproxy_create(zend_object *com_object, zval *proxy_out, zval *index);
82
83/* com_olechar.c */
84PHP_COM_DOTNET_API zend_string *php_com_olestring_to_string(OLECHAR *olestring, int codepage);
85PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(const char *string,
86 size_t string_len, int codepage);
87BSTR php_com_string_to_bstr(zend_string *string, int codepage);
88zend_string *php_com_bstr_to_string(BSTR bstr, int codepage);
89
90
91/* com_com.c */
92PHP_METHOD(com, __construct);
93
94HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member,
95 WORD flags, DISPPARAMS *disp_params, VARIANT *v, bool silent, bool allow_noarg);
97 DISPID *dispid);
99 WORD flags, VARIANT *v, int nargs, zval *args, bool silent, bool allow_noarg);
101 WORD flags, VARIANT *v, int nargs, zval *args, bool allow_noarg);
103 WORD flags, VARIANT *v, int nargs, zval *args);
104
105/* com_wrapper.c */
106PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid, HashTable *id_to_name);
108
109/* com_persist.c */
111
112/* com_variant.c */
113PHP_METHOD(variant, __construct);
114
115PHP_COM_DOTNET_API void php_com_variant_from_zval_with_type(VARIANT *v, zval *z, VARTYPE type, int codepage);
116PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage);
118PHP_COM_DOTNET_API zend_result php_com_copy_variant(VARIANT *dst, VARIANT *src);
119
120/* com_dotnet.c */
121PHP_METHOD(dotnet, __construct);
124
125/* com_misc.c */
126void php_com_throw_exception(HRESULT code, char *message);
127PHP_COM_DOTNET_API void php_com_wrap_dispatch(zval *z, IDispatch *disp,
128 int codepage);
130 int codepage);
131PHP_COM_DOTNET_API bool php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1);
132
133/* com_typeinfo.c */
134PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib_via_cache(const char *search_string, int codepage);
135PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codepage);
136PHP_COM_DOTNET_API zend_result php_com_import_typelib(ITypeLib *TL, int mode, int codepage);
137void php_com_typelibrary_dtor(zval *pDest);
138ITypeInfo *php_com_locate_typeinfo(zend_string *type_lib_name, php_com_dotnet_object *obj,
139 zend_string *dispatch_name, bool sink);
140bool php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, bool printdef, GUID *guid, int codepage);
141ITypeLib *php_com_cache_typelib(ITypeLib* TL, char *cache_key, zend_long cache_key_len);
142PHP_MINIT_FUNCTION(com_typeinfo);
143PHP_MSHUTDOWN_FUNCTION(com_typeinfo);
144
145/* com_iterator.c */
147
148
149#endif
uint32_t v
Definition cdf.c:1237
zend_class_entry * php_com_exception_class_entry
zend_class_entry * php_com_variant_class_entry
zend_class_entry * php_com_saproxy_class_entry
zend_object_handlers php_com_object_handlers
zend_object_handlers php_com_saproxy_handlers
#define WORD
Definition exif.c:1759
#define DWORD
Definition exif.c:1762
zend_ffi_type * type
Definition ffi.c:3812
zval * zv
Definition ffi.c:3975
zval * val
Definition ffi.c:4262
char * mode
#define PHP_MSHUTDOWN_FUNCTION
Definition php.h:401
#define PHP_MINIT_FUNCTION
Definition php.h:400
#define PHP_METHOD
Definition php.h:365
#define PHP_COM_DOTNET_API
ITypeLib * php_com_cache_typelib(ITypeLib *TL, char *cache_key, zend_long cache_key_len)
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)
Definition com_com.c:631
PHP_COM_DOTNET_API zend_string * php_com_olestring_to_string(OLECHAR *olestring, int codepage)
Definition com_olechar.c:70
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)
Definition com_com.c:584
PHP_COM_DOTNET_API zend_result php_com_zval_from_variant(zval *z, VARIANT *v, int codepage)
ITypeInfo * php_com_locate_typeinfo(zend_string *type_lib_name, php_com_dotnet_object *obj, zend_string *dispatch_name, bool sink)
HRESULT php_com_get_id_of_name(php_com_dotnet_object *obj, zend_string *name, DISPID *dispid)
Definition com_com.c:410
zend_object_iterator * php_com_iter_get(zend_class_entry *ce, zval *object, int by_ref)
zend_string * php_com_bstr_to_string(BSTR bstr, int codepage)
PHP_COM_DOTNET_API IDispatch * php_com_wrapper_export(zval *val)
void php_com_persist_minit(INIT_FUNC_ARGS)
HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member, WORD flags, DISPPARAMS *disp_params, VARIANT *v, bool silent, bool allow_noarg)
Definition com_com.c:332
PHP_COM_DOTNET_API bool php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1)
Definition com_misc.c:92
void php_com_object_enable_event_sink(php_com_dotnet_object *obj, bool enable)
PHP_COM_DOTNET_API IDispatch * php_com_wrapper_export_as_sink(zval *val, GUID *sinkid, HashTable *id_to_name)
PHP_COM_DOTNET_API void php_com_wrap_variant(zval *z, VARIANT *v, int codepage)
Definition com_misc.c:67
PHP_COM_DOTNET_API ITypeLib * php_com_load_typelib_via_cache(const char *search_string, int codepage)
void php_com_dotnet_rshutdown(void)
PHP_COM_DOTNET_API OLECHAR * php_com_string_to_olestring(const char *string, size_t string_len, int codepage)
Definition com_olechar.c:29
PHP_COM_DOTNET_API zend_result php_com_import_typelib(ITypeLib *TL, int mode, int codepage)
BSTR php_com_string_to_bstr(zend_string *string, int codepage)
zend_object_iterator * php_com_saproxy_iter_get(zend_class_entry *ce, zval *object, int by_ref)
PHP_COM_DOTNET_API zend_result php_com_copy_variant(VARIANT *dst, VARIANT *src)
void php_com_dotnet_mshutdown(void)
zend_object * php_com_object_new(zend_class_entry *ce)
PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage)
void php_com_throw_exception(HRESULT code, char *message)
Definition com_misc.c:28
bool php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, bool printdef, GUID *guid, int codepage)
void php_com_typelibrary_dtor(zval *pDest)
struct _php_com_dotnet_object php_com_dotnet_object
PHP_COM_DOTNET_API void php_com_variant_from_zval_with_type(VARIANT *v, zval *z, VARTYPE type, int codepage)
void php_com_saproxy_create(zend_object *com_object, zval *proxy_out, zval *index)
void php_com_object_free_storage(zend_object *object)
zend_object * php_com_object_clone(zend_object *object)
zend_result php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function *f, WORD flags, VARIANT *v, int nargs, zval *args)
Definition com_com.c:456
PHP_COM_DOTNET_API void php_com_wrap_dispatch(zval *z, IDispatch *disp, int codepage)
Definition com_misc.c:45
PHP_COM_DOTNET_API ITypeLib * php_com_load_typelib(char *search_string, int codepage)
zend_string * name
Definition zend.h:149
Definition funcs.c:761
struct _zval_struct zval
zval * args
struct _zend_internal_function zend_internal_function
struct _zend_object_iterator zend_object_iterator
int32_t zend_long
Definition zend_long.h:42
struct _zend_string zend_string
#define INIT_FUNC_ARGS
struct _zend_class_entry zend_class_entry
struct _zend_object zend_object
#define zend_string_equals_literal(str, literal)
struct _zend_array HashTable
Definition zend_types.h:386
#define Z_OBJCE_P(zval_p)
ZEND_RESULT_CODE zend_result
Definition zend_types.h:64
struct _zend_object_handlers zend_object_handlers
Definition zend_types.h:88
zend_string * name