11 static void oleparam_free(
void *ptr);
12 static size_t oleparam_size(
const void *ptr);
13 static VALUE foleparam_s_allocate(
VALUE klass);
21 static VALUE foleparam_ole_type_detail(
VALUE self);
33 {
NULL, oleparam_free, oleparam_size,},
38 oleparam_free(
void *ptr)
46 oleparam_size(
const void *ptr)
73 foleparam_s_allocate(
VALUE klass)
79 &oleparam_datatype, pparam);
94 hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
99 bstrs =
ALLOCA_N(BSTR, pFuncDesc->cParams + 1);
100 hr = pTypeInfo->lpVtbl->GetNames(pTypeInfo, pFuncDesc->memid,
101 bstrs, pFuncDesc->cParams + 1,
104 pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
107 SysFreeString(bstrs[0]);
108 if (param_index < 1 || len <= (UINT)param_index)
110 pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
118 pparam->
index = param_index - 1;
121 pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
126 oleparam_ole_param(
VALUE self,
VALUE olemethod,
int n)
129 return oleparam_ole_param_from_index(
self, pmethod->
pTypeInfo, pmethod->
index, n);
153 return oleparam_ole_param(
self, olemethod, idx);
167 foleparam_name(
VALUE self)
173 ole_param_ole_type(ITypeInfo *pTypeInfo, UINT method_index, UINT
index)
178 hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
182 &(pFuncDesc->lprgelemdescParam[index].tdesc),
Qnil);
183 pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
198 foleparam_ole_type(
VALUE self)
207 ole_param_ole_type_detail(ITypeInfo *pTypeInfo, UINT method_index, UINT index)
212 hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
216 &(pFuncDesc->lprgelemdescParam[index].tdesc), typedetail);
217 pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
232 foleparam_ole_type_detail(
VALUE self)
241 ole_param_flag_mask(ITypeInfo *pTypeInfo, UINT method_index, UINT index, USHORT mask)
246 hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
249 if (
V_UNION1((&(pFuncDesc->lprgelemdescParam[index])), paramdesc).wParamFlags &mask)
251 pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
266 foleparam_input(
VALUE self)
271 pparam->
index, PARAMFLAG_FIN);
294 foleparam_output(
VALUE self)
299 pparam->
index, PARAMFLAG_FOUT);
313 foleparam_optional(
VALUE self)
318 pparam->
index, PARAMFLAG_FOPT);
333 foleparam_retval(
VALUE self)
338 pparam->
index, PARAMFLAG_FRETVAL);
342 ole_param_default(ITypeInfo *pTypeInfo, UINT method_index, UINT index)
346 PARAMDESCEX * pParamDescEx;
349 USHORT mask = PARAMFLAG_FOPT|PARAMFLAG_FHASDEFAULT;
351 hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
354 pElemDesc = &pFuncDesc->lprgelemdescParam[
index];
355 wParamFlags =
V_UNION1(pElemDesc, paramdesc).wParamFlags;
356 if ((wParamFlags & mask) == mask) {
357 pParamDescEx =
V_UNION1(pElemDesc, paramdesc).pparamdescex;
360 pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
394 foleparam_default(
VALUE self)
411 foleparam_inspect(
VALUE self)
413 VALUE detail = foleparam_name(
self);
414 VALUE defval = foleparam_default(
self);
415 if (defval !=
Qnil) {
void Init_win32ole_param(void)
#define RUBY_TYPED_FREE_IMMEDIATELY
void rb_raise(VALUE exc, const char *fmt,...)
#define TypedData_Get_Struct(obj, type, data_type, sval)
VALUE rb_str_concat(VALUE, VALUE)
VALUE rb_ivar_get(VALUE, ID)
void rb_define_alloc_func(VALUE, rb_alloc_func_t)
VALUE rb_inspect(VALUE)
Convenient wrapper of Object::inspect.
VALUE make_inspect(const char *class_name, VALUE detail)
VALUE rb_obj_is_kind_of(VALUE, VALUE)
call-seq: obj.is_a?(class) -> true or false obj.kind_of?(class) -> true or false
void ole_raise(HRESULT hr, VALUE ecs, const char *fmt,...)
RUBY_EXTERN VALUE rb_cObject
VALUE rb_str_cat2(VALUE, const char *)
VALUE rb_define_class(const char *name, VALUE super)
Defines a top-level class.
#define ALLOCA_N(type, n)
VALUE ole_variant2val(VARIANT *pvar)
void rb_define_alias(VALUE klass, const char *name1, const char *name2)
Defines an alias of a method.
VALUE rb_ivar_set(VALUE, ID, VALUE)
struct olemethoddata * olemethod_data_get_struct(VALUE obj)
register unsigned int len
VALUE ole_typedesc2val(ITypeInfo *pTypeInfo, TYPEDESC *pTypeDesc, VALUE typedetails)
VALUE create_win32ole_param(ITypeInfo *pTypeInfo, UINT method_index, UINT index, VALUE name)
typedef HRESULT(STDAPICALLTYPE FNCOCREATEINSTANCEEX)(REFCLSID
#define TypedData_Make_Struct(klass, type, data_type, sval)
void rb_define_method(VALUE klass, const char *name, VALUE(*func)(ANYARGS), int argc)