static VALUE ole_param_ole_type(ITypeInfo *pTypeInfo, UINT method_index, UINT index) { FUNCDESC *pFuncDesc; HRESULT hr; VALUE type = rb_str_new2("unknown type"); hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc); if (FAILED(hr)) return type; type = ole_typedesc2val(pTypeInfo, &(pFuncDesc->lprgelemdescParam[index].tdesc), Qnil); pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc); return type; }
static VALUE ole_param_ole_type_detail(ITypeInfo *pTypeInfo, UINT method_index, UINT index) { FUNCDESC *pFuncDesc; HRESULT hr; VALUE typedetail = rb_ary_new(); hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc); if (FAILED(hr)) return typedetail; ole_typedesc2val(pTypeInfo, &(pFuncDesc->lprgelemdescParam[index].tdesc), typedetail); pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc); return typedetail; }
static VALUE ole_method_return_type_detail(ITypeInfo *pTypeInfo, UINT method_index) { FUNCDESC *pFuncDesc; HRESULT hr; VALUE type = rb_ary_new(); hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc); if (FAILED(hr)) return type; ole_typedesc2val(pTypeInfo, &(pFuncDesc->elemdescFunc.tdesc), type); pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc); return type; }
static VALUE ole_method_return_type(ITypeInfo *pTypeInfo, UINT method_index) { FUNCDESC *pFuncDesc; HRESULT hr; VALUE type; hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc); if (FAILED(hr)) ole_raise(hr, eWIN32OLERuntimeError, "failed to GetFuncDesc"); type = ole_typedesc2val(pTypeInfo, &(pFuncDesc->elemdescFunc.tdesc), Qnil); pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc); return type; }
static VALUE ole_type_src_type(ITypeInfo *pTypeInfo) { HRESULT hr; TYPEATTR *pTypeAttr; VALUE alias = Qnil; hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr); if (FAILED(hr)) return alias; if(pTypeAttr->typekind != TKIND_ALIAS) { OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr); return alias; } alias = ole_typedesc2val(pTypeInfo, &(pTypeAttr->tdescAlias), Qnil); OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr); return alias; }