Ruby
2.4.2p198(2017-09-14revision59899)
|
#include "ruby/ruby.h"
#include "ruby/st.h"
#include "ruby/encoding.h"
#include <ctype.h>
#include <windows.h>
#include <ocidl.h>
#include <olectl.h>
#include <ole2.h>
#include <stdlib.h>
#include <math.h>
#include <varargs.h>
#include <objidl.h>
#include "win32ole_variant_m.h"
#include "win32ole_typelib.h"
#include "win32ole_type.h"
#include "win32ole_variable.h"
#include "win32ole_method.h"
#include "win32ole_param.h"
#include "win32ole_event.h"
#include "win32ole_variant.h"
#include "win32ole_record.h"
#include "win32ole_error.h"
Go to the source code of this file.
Data Structures | |
struct | oledata |
Macros | |
#define | GNUC_OLDER_3_4_4 |
#define | va_init_list(a, b) va_start(a) |
#define | DOUT fprintf(stderr,"%s(%d)\n", __FILE__, __LINE__) |
#define | DOUTS(x) fprintf(stderr,"%s(%d):" #x "=%s\n",__FILE__, __LINE__,x) |
#define | DOUTMSG(x) fprintf(stderr, "%s(%d):" #x "\n",__FILE__, __LINE__) |
#define | DOUTI(x) fprintf(stderr, "%s(%d):" #x "=%d\n",__FILE__, __LINE__,x) |
#define | DOUTD(x) fprintf(stderr, "%s(%d):" #x "=%f\n",__FILE__, __LINE__,x) |
#define | V_UNION1(X, Y) ((X)->Y) |
#define | V_I1REF(X) V_UNION(X, pcVal) |
#define | V_UI2REF(X) V_UNION(X, puiVal) |
#define | V_INT(X) V_UNION(X, intVal) |
#define | V_INTREF(X) V_UNION(X, pintVal) |
#define | V_UINT(X) V_UNION(X, uintVal) |
#define | V_UINTREF(X) V_UNION(X, puintVal) |
#define | I8_2_NUM RB_INT2NUM |
#define | UI8_2_NUM RB_UINT2NUM |
#define | NUM2I8 RB_NUM2INT |
#define | NUM2UI8 RB_NUM2UINT |
#define | OLE_ADDREF(X) (X) ? ((X)->lpVtbl->AddRef(X)) : 0 |
#define | OLE_RELEASE(X) (X) ? ((X)->lpVtbl->Release(X)) : 0 |
#define | OLE_FREE(x) |
#define | OLE_GET_TYPEATTR(X, Y) ((X)->lpVtbl->GetTypeAttr((X), (Y))) |
#define | OLE_RELEASE_TYPEATTR(X, Y) ((X)->lpVtbl->ReleaseTypeAttr((X), (Y))) |
#define | WC2VSTR(x) ole_wc2vstr((x), TRUE) |
Functions | |
struct oledata * | oledata_get_struct (VALUE obj) |
LPWSTR | ole_vstr2wc (VALUE vstr) |
LONG | reg_open_key (HKEY hkey, const char *name, HKEY *phkey) |
LONG | reg_open_vkey (HKEY hkey, VALUE key, HKEY *phkey) |
VALUE | reg_enum_key (HKEY hkey, DWORD i) |
VALUE | reg_get_val (HKEY hkey, const char *subkey) |
VALUE | reg_get_val2 (HKEY hkey, const char *subkey) |
void | ole_initialize (void) |
VALUE | default_inspect (VALUE self, const char *class_name) |
char * | ole_wc2mb (LPWSTR pw) |
VALUE | ole_wc2vstr (LPWSTR pw, BOOL isfree) |
BOOL | ole_initialized (void) |
HRESULT | ole_docinfo_from_type (ITypeInfo *pTypeInfo, BSTR *name, BSTR *helpstr, DWORD *helpcontext, BSTR *helpfile) |
VALUE | ole_typedesc2val (ITypeInfo *pTypeInfo, TYPEDESC *pTypeDesc, VALUE typedetails) |
VALUE | make_inspect (const char *class_name, VALUE detail) |
void | ole_val2variant (VALUE val, VARIANT *var) |
void | ole_val2variant2 (VALUE val, VARIANT *var) |
void | ole_val2variant_ex (VALUE val, VARIANT *var, VARTYPE vt) |
VALUE | ole_variant2val (VARIANT *pvar) |
HRESULT | ole_val_ary2variant_ary (VALUE val, VARIANT *var, VARTYPE vt) |
VOID * | val2variant_ptr (VALUE val, VARIANT *var, VARTYPE vt) |
HRESULT | typelib_from_val (VALUE obj, ITypeLib **pTypeLib) |
Variables | |
VALUE | cWIN32OLE |
LCID | cWIN32OLE_lcid |
#define DOUT fprintf(stderr,"%s(%d)\n", __FILE__, __LINE__) |
Definition at line 38 of file win32ole.h.
#define DOUTD | ( | x | ) | fprintf(stderr, "%s(%d):" #x "=%f\n",__FILE__, __LINE__,x) |
Definition at line 42 of file win32ole.h.
#define DOUTI | ( | x | ) | fprintf(stderr, "%s(%d):" #x "=%d\n",__FILE__, __LINE__,x) |
Definition at line 41 of file win32ole.h.
#define DOUTMSG | ( | x | ) | fprintf(stderr, "%s(%d):" #x "\n",__FILE__, __LINE__) |
Definition at line 40 of file win32ole.h.
#define DOUTS | ( | x | ) | fprintf(stderr,"%s(%d):" #x "=%s\n",__FILE__, __LINE__,x) |
Definition at line 39 of file win32ole.h.
#define GNUC_OLDER_3_4_4 |
Definition at line 7 of file win32ole.h.
#define I8_2_NUM RB_INT2NUM |
Definition at line 91 of file win32ole.h.
Referenced by ole_variant2val().
#define NUM2I8 RB_NUM2INT |
Definition at line 93 of file win32ole.h.
Referenced by ole_val2variant_ex().
#define NUM2UI8 RB_NUM2UINT |
Definition at line 94 of file win32ole.h.
Referenced by ole_val2variant_ex().
#define OLE_ADDREF | ( | X | ) | (X) ? ((X)->lpVtbl->AddRef(X)) : 0 |
Definition at line 97 of file win32ole.h.
Referenced by create_win32ole_param(), create_win32ole_variable(), ev_advise(), folerecord_initialize(), ole_val2variant(), ole_variant2val(), olemethod_set_member(), oleparam_ole_param_from_index(), olerecord_set_ivar(), oletype_set_member(), and reference_count().
#define OLE_FREE | ( | x | ) |
Definition at line 99 of file win32ole.h.
Referenced by fev_unadvise(), fole_free(), ole_free(), olemethod_free(), oleparam_free(), olerecord_free(), oletype_free(), oletypelib_free(), and olevariable_free().
#define OLE_GET_TYPEATTR | ( | X, | |
Y | |||
) | ((X)->lpVtbl->GetTypeAttr((X), (Y))) |
Definition at line 108 of file win32ole.h.
Referenced by find_coclass(), find_default_source(), find_iid(), ole_const_load(), ole_method_event(), ole_method_sub(), ole_methods_from_typeinfo(), ole_methods_sub(), ole_ole_type(), ole_type_guid(), ole_type_impl_ole_types(), ole_type_major_version(), ole_type_minor_version(), ole_type_progid(), ole_type_src_type(), ole_type_typekind(), ole_type_visible(), ole_variables(), and olemethod_from_typeinfo().
#define OLE_RELEASE | ( | X | ) | (X) ? ((X)->lpVtbl->Release(X)) : 0 |
Definition at line 98 of file win32ole.h.
Referenced by ev_advise(), EVENTSINK_Destructor(), fev_unadvise(), find_coclass(), find_default_source(), find_iid(), fole_activex_initialize(), fole_method_help(), fole_s_connect(), fole_s_const_load(), fole_s_free(), fole_type(), fole_typelib(), folerecord_initialize(), foletype_initialize(), ole_bind_obj(), ole_const_load(), ole_docinfo_from_type(), ole_ienum_free(), ole_method_event(), ole_methods(), ole_methods_from_typeinfo(), ole_set_member(), ole_type_from_itypeinfo(), ole_type_impl_ole_types(), ole_types_from_typelib(), ole_usertype2val(), oleclass_from_typelib(), oleevent_free(), olemethod_from_typeinfo(), olerecord_set_ivar(), recordinfo_from_itypelib(), reference_count(), typeinfo_from_ole(), and typelib_from_val().
#define OLE_RELEASE_TYPEATTR | ( | X, | |
Y | |||
) | ((X)->lpVtbl->ReleaseTypeAttr((X), (Y))) |
Definition at line 109 of file win32ole.h.
Referenced by find_coclass(), find_default_source(), find_iid(), ole_method_event(), ole_method_sub(), ole_methods_from_typeinfo(), ole_methods_sub(), ole_ole_type(), ole_type_guid(), ole_type_impl_ole_types(), ole_type_major_version(), ole_type_minor_version(), ole_type_progid(), ole_type_src_type(), ole_type_typekind(), ole_type_visible(), ole_variables(), and olemethod_from_typeinfo().
#define UI8_2_NUM RB_UINT2NUM |
Definition at line 92 of file win32ole.h.
Referenced by ole_variant2val().
#define V_I1REF | ( | X | ) | V_UNION(X, pcVal) |
Definition at line 62 of file win32ole.h.
Referenced by ole_set_byref(), and ole_variant2val().
#define V_INT | ( | X | ) | V_UNION(X, intVal) |
Definition at line 70 of file win32ole.h.
Referenced by get_ptr_of_variant(), ole_set_byref(), and ole_variant2val().
#define V_INTREF | ( | X | ) | V_UNION(X, pintVal) |
Definition at line 74 of file win32ole.h.
Referenced by ole_set_byref(), and ole_variant2val().
#define V_UI2REF | ( | X | ) | V_UNION(X, puiVal) |
Definition at line 66 of file win32ole.h.
Referenced by ole_set_byref(), and ole_variant2val().
#define V_UINT | ( | X | ) | V_UNION(X, uintVal) |
Definition at line 78 of file win32ole.h.
Referenced by get_ptr_of_variant(), ole_set_byref(), and ole_variant2val().
#define V_UINTREF | ( | X | ) | V_UNION(X, puintVal) |
Definition at line 82 of file win32ole.h.
Referenced by ole_set_byref(), and ole_variant2val().
#define V_UNION1 | ( | X, | |
Y | |||
) | ((X)->Y) |
Definition at line 47 of file win32ole.h.
Referenced by ole_const_load(), ole_param_default(), ole_param_flag_mask(), ole_ptrtype2val(), ole_usertype2val(), and ole_variable_value().
#define va_init_list | ( | a, | |
b | |||
) | va_start(a) |
Definition at line 34 of file win32ole.h.
Referenced by new_insn_body(), ole_raise(), rb_funcall(), rb_rescue2(), and rb_yield_values().
#define WC2VSTR | ( | x | ) | ole_wc2vstr((x), TRUE) |
Definition at line 130 of file win32ole.h.
Referenced by EVENTSINK_Invoke(), folemethod_event_interface(), foletypelib_library_name(), foletypelib_name(), foletypelib_path(), hash2ptr_dispparams(), ole_method_event(), ole_method_helpfile(), ole_method_helpstring(), ole_method_params(), ole_method_sub(), ole_methods_sub(), ole_type_from_itypeinfo(), ole_type_helpfile(), ole_type_helpstring(), ole_types_from_typelib(), ole_usertype2val(), ole_variables(), oleclass_from_typelib(), oleparam_ole_param_from_index(), olerecord_set_ivar(), recordinfo_from_itypelib(), and typeinfo_from_ole().
Definition at line 1336 of file win32ole.c.
References make_inspect(), rb_funcall(), and rb_intern.
Referenced by folemethod_inspect(), foletype_inspect(), foletypelib_inspect(), and tracepoint_inspect().
Definition at line 1324 of file win32ole.c.
References rb_str_cat2(), rb_str_concat(), and rb_str_new2.
Referenced by default_inspect(), foleparam_inspect(), and folevariable_inspect().
HRESULT ole_docinfo_from_type | ( | ITypeInfo * | pTypeInfo, |
BSTR * | name, | ||
BSTR * | helpstr, | ||
DWORD * | helpcontext, | ||
BSTR * | helpfile | ||
) |
Definition at line 3594 of file win32ole.c.
References HRESULT(), and OLE_RELEASE.
Referenced by folemethod_event_interface(), ole_type_helpcontext(), ole_type_helpfile(), ole_type_helpstring(), and ole_usertype2val().
void ole_initialize | ( | void | ) |
Definition at line 810 of file win32ole.c.
References FALSE, g_ole_initialized, g_ole_initialized_set, g_uninitialize_hooked, HRESULT(), imessage_filter, NULL, ole_raise(), ole_uninitialize_hook(), previous_filter, Qnil, rb_add_event_hook(), rb_eRuntimeError, RUBY_EVENT_THREAD_END, and TRUE.
Referenced by fole_s_allocate(), fole_s_connect(), fole_s_ole_initialize(), foletype_s_allocate(), foletypelib_s_allocate(), folevariant_s_allocate(), folevariant_s_array(), and ole_bind_obj().
BOOL ole_initialized | ( | void | ) |
Definition at line 392 of file win32ole.c.
References g_ole_initialized.
Definition at line 3655 of file win32ole.c.
References ole_ptrtype2val(), ole_usertype2val(), Qnil, rb_ary_push(), rb_fix2str(), RB_INT2FIX, rb_str_concat(), and rb_str_new2.
Referenced by ole_method_return_type(), ole_method_return_type_detail(), ole_param_ole_type(), ole_param_ole_type_detail(), ole_ptrtype2val(), ole_type_src_type(), ole_variable_ole_type(), and ole_variable_ole_type_detail().
void ole_val2variant | ( | VALUE | val, |
VARIANT * | var | ||
) |
Definition at line 1240 of file win32ole.c.
References cWIN32OLE, cWIN32OLE_RECORD, cWIN32OLE_VARIANT, g_nil_to, NULL, NUM2DBL, OLE_ADDREF, ole_rec2variant(), ole_val_ary2variant_ary(), ole_variant2variant(), ole_vstr2wc(), oledata_get_struct(), oledata::pDispatch, rb_big2dbl(), rb_cTime, RB_NUM2LONG, rb_obj_is_kind_of(), rbtime2vtdate(), T_ARRAY, T_BIGNUM, T_FALSE, T_FIXNUM, T_FLOAT, T_NIL, T_STRING, T_TRUE, TYPE, and val2dispatch().
Referenced by EVENTSINK_Invoke(), folevariant_initialize(), hash2named_arg(), hash2olerec(), if(), ole_invoke(), ole_invoke2(), ole_propertyput(), and ole_val2variant2().
void ole_val2variant2 | ( | VALUE | val, |
VARIANT * | var | ||
) |
Definition at line 1316 of file win32ole.c.
References g_nil_to, and ole_val2variant().
Referenced by ole_invoke(), and ole_val2variant_ex().
void ole_val2variant_ex | ( | VALUE | val, |
VARIANT * | var, | ||
VARTYPE | vt | ||
) |
Definition at line 973 of file win32ole.c.
References NULL, NUM2I8, NUM2UI8, ole_val2variant2(), and Qnil.
Referenced by ole_val2olevariantdata(), and val2variant_ptr().
Definition at line 1178 of file win32ole.c.
References ALLOC_N, ary_len_of_dim(), Check_Type, dimension(), free(), HRESULT(), NULL, ole_set_safe_array(), rb_eRuntimeError, rb_raise(), and T_ARRAY.
Referenced by ole_val2olevariantdata(), and ole_val2variant().
VALUE ole_variant2val | ( | VARIANT * | pvar | ) |
Definition at line 1409 of file win32ole.c.
References ALLOC_N, ary_new_dim(), ary_store_dim(), create_win32ole_object(), create_win32ole_record(), cWIN32OLE, cWIN32OLE_lcid, FALSE, free(), HRESULT(), I8_2_NUM, NULL, OLE_ADDREF, ole_variant2val(), ole_wc2vstr(), oledata::pDispatch, Qfalse, Qnil, Qtrue, rb_ary_new(), rb_eRuntimeError, rb_float_new, RB_INT2NUM, rb_raise(), rb_str_new2, UI8_2_NUM, V_I1REF, V_INT, V_INTREF, V_UI2REF, V_UINT, V_UINTREF, val, and vtdate2rbtime().
Referenced by EVENTSINK_Invoke(), folevariant_ary_aref(), folevariant_value(), if(), ole_const_load(), ole_each_sub(), ole_invoke(), ole_invoke2(), ole_param_default(), ole_variable_value(), ole_variant2val(), olerecord_set_ivar(), and set_argv().
LPWSTR ole_vstr2wc | ( | VALUE | vstr | ) |
Definition at line 856 of file win32ole.c.
References Check_Type, code_page_installed(), DATA_PTR, enc2cp_hash, eWIN32OLERuntimeError, FIXNUM_FLAG, NULL, ole_encoding2cp(), ole_mb2wc(), rb_enc_get(), rb_enc_name, RB_FIX2INT, RB_GC_GUARD, RB_INT2FIX, rb_raise(), RSTRING_LEN, RSTRING_LENINT, RSTRING_PTR, st_data_t, st_insert, st_lookup, and T_STRING.
Referenced by fole_initialize(), fole_query_interface(), fole_respond_to(), fole_s_connect(), fole_s_const_load(), foletype_initialize(), foletypelib_initialize(), hash2named_arg(), hash2olerec(), ole_bind_obj(), ole_create_dcom(), ole_invoke(), ole_propertyput(), ole_val2ptr_variant(), ole_val2variant(), and oletypelib_from_guid().
char* ole_wc2mb | ( | LPWSTR | pw | ) |
Definition at line 740 of file win32ole.c.
References NULL, ole_alloc_str(), and ole_wc2mb_alloc().
Referenced by find_iid(), ole_const_load(), and ole_excepinfo2msg().
VALUE ole_wc2vstr | ( | LPWSTR | pw, |
BOOL | isfree | ||
) |
Definition at line 937 of file win32ole.c.
References ole_alloc_vstr(), ole_wc2mb_alloc(), rb_str_set_len(), RSTRING_PTR, and strlen().
Referenced by fole_s_create_guid(), foletypelib_guid(), ole_type_guid(), ole_type_progid(), and ole_variant2val().
Definition at line 848 of file win32ole.c.
References TypedData_Get_Struct.
Referenced by ev_advise(), find_default_source(), find_iid(), fole_activex_initialize(), fole_each(), fole_free(), fole_method_help(), fole_query_interface(), fole_respond_to(), fole_s_const_load(), fole_s_free(), fole_s_reference_count(), fole_type(), fole_typelib(), ole_invoke(), ole_invoke2(), ole_methods(), ole_propertyput(), ole_set_member(), ole_val2variant(), and typelib_from_val().
Definition at line 1701 of file win32ole.c.
References buf, err, NULL, Qnil, and rb_str_new2.
Referenced by foletype_s_progids(), foletypelib_s_typelibs(), oletypelib_path(), oletypelib_search_registry(), oletypelib_search_registry2(), and typelib_file_from_typelib().
Definition at line 1716 of file win32ole.c.
References ALLOC_N, err, free(), len, NULL, Qnil, rb_str_new2, size, and val.
Referenced by oletypelib_search_registry(), oletypelib_search_registry2(), reg_get_val2(), and typelib_file_from_typelib().
Definition at line 1744 of file win32ole.c.
References err, NULL, Qnil, reg_get_val(), and val.
Referenced by foletype_s_progids(), foletypelib_s_typelibs(), reg_get_typelib_file_path(), and typelib_file_from_clsid().
LONG reg_open_key | ( | HKEY | hkey, |
const char * | name, | ||
HKEY * | phkey | ||
) |
Definition at line 1689 of file win32ole.c.
Referenced by foletype_s_progids(), foletypelib_s_typelibs(), oletypelib_search_registry(), oletypelib_search_registry2(), reg_open_vkey(), typelib_file_from_clsid(), and typelib_file_from_typelib().
LONG reg_open_vkey | ( | HKEY | hkey, |
VALUE | key, | ||
HKEY * | phkey | ||
) |
Definition at line 1695 of file win32ole.c.
References reg_open_key(), and StringValuePtr.
Referenced by foletype_s_progids(), foletypelib_s_typelibs(), oletypelib_path(), oletypelib_search_registry(), oletypelib_search_registry2(), and typelib_file_from_typelib().
Definition at line 3855 of file win32ole.c.
References cWIN32OLE_lcid, HRESULT(), NULL, OLE_RELEASE, oledata_get_struct(), and oledata::pDispatch.
Referenced by folerecord_initialize().
VOID* val2variant_ptr | ( | VALUE | val, |
VARIANT * | var, | ||
VARTYPE | vt | ||
) |
Definition at line 1008 of file win32ole.c.
References cWIN32OLE_lcid, get_ptr_of_variant(), HRESULT(), NULL, ole_raise(), ole_val2variant_ex(), rb_eRuntimeError, and rb_raise().
Referenced by folevariant_ary_aset(), and ole_set_safe_array().
VALUE cWIN32OLE |
Definition at line 115 of file win32ole.h.
LCID cWIN32OLE_lcid |
Definition at line 116 of file win32ole.h.
Referenced by find_default_source(), find_iid(), fole_each(), fole_respond_to(), fole_s_const_load(), fole_s_get_locale(), fole_s_set_locale(), fole_type(), fole_typelib(), foletypelib_path(), Init_win32ole(), ole_hresult2msg(), ole_invoke(), ole_invoke2(), ole_propertyput(), ole_val2olevariantdata(), ole_variant2val(), typeinfo_from_ole(), typelib_from_val(), and val2variant_ptr().