mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	* ext/win32ole/win32ole_error.c: add WIN32OLEQueryInterfaceError.
* ext/win32ole/win32ole_error.h: ditto. * ext/win32ole/win32ole.c(typeinfo_from_ole): raise WIN32OLEQueryInterfaceError in ole_methods. * ext/win32ole/win32ole_method.c(ole_methods_from_typeinfo): ditto. M ext/win32ole/win32ole.c M ext/win32ole/win32ole_error.c M ext/win32ole/win32ole_error.h M ext/win32ole/win32ole_method.c git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									e7535c6eaa
								
							
						
					
					
						commit
						8930a4257d
					
				
					 4 changed files with 6 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -3397,7 +3397,7 @@ typeinfo_from_ole(struct oledata *pole, ITypeInfo **ppti)
 | 
			
		|||
    HRESULT hr = pole->pDispatch->lpVtbl->GetTypeInfo(pole->pDispatch,
 | 
			
		||||
                                                      0, lcid, &pTypeInfo);
 | 
			
		||||
    if(FAILED(hr)) {
 | 
			
		||||
        ole_raise(hr, rb_eRuntimeError, "failed to GetTypeInfo");
 | 
			
		||||
        ole_raise(hr, eWIN32OLEQueryInterfaceError, "failed to GetTypeInfo");
 | 
			
		||||
    }
 | 
			
		||||
    hr = pTypeInfo->lpVtbl->GetDocumentation(pTypeInfo,
 | 
			
		||||
                                             -1,
 | 
			
		||||
| 
						 | 
				
			
			@ -3407,7 +3407,7 @@ typeinfo_from_ole(struct oledata *pole, ITypeInfo **ppti)
 | 
			
		|||
    hr = pTypeInfo->lpVtbl->GetContainingTypeLib(pTypeInfo, &pTypeLib, &i);
 | 
			
		||||
    OLE_RELEASE(pTypeInfo);
 | 
			
		||||
    if (FAILED(hr)) {
 | 
			
		||||
        ole_raise(hr, rb_eRuntimeError, "failed to GetContainingTypeLib");
 | 
			
		||||
        ole_raise(hr, eWIN32OLEQueryInterfaceError, "failed to GetContainingTypeLib");
 | 
			
		||||
    }
 | 
			
		||||
    count = pTypeLib->lpVtbl->GetTypeInfoCount(pTypeLib);
 | 
			
		||||
    for (i = 0; i < count; i++) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -80,4 +80,5 @@ Init_win32ole_error(void)
 | 
			
		|||
     *
 | 
			
		||||
     */
 | 
			
		||||
    eWIN32OLERuntimeError = rb_define_class("WIN32OLERuntimeError", rb_eRuntimeError);
 | 
			
		||||
    eWIN32OLEQueryInterfaceError = rb_define_class("WIN32OLEQueryInterfaceError", eWIN32OLERuntimeError);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,6 +2,7 @@
 | 
			
		|||
#define WIN32OLE_ERROR_H 1
 | 
			
		||||
 | 
			
		||||
VALUE eWIN32OLERuntimeError;
 | 
			
		||||
VALUE eWIN32OLEQueryInterfaceError;
 | 
			
		||||
NORETURN(PRINTF_ARGS(void ole_raise(HRESULT hr, VALUE ecs, const char *fmt, ...), 3, 4));
 | 
			
		||||
void Init_win32ole_error(void);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -119,7 +119,7 @@ ole_methods_from_typeinfo(ITypeInfo *pTypeInfo, int mask)
 | 
			
		|||
    VALUE methods = rb_ary_new();
 | 
			
		||||
    hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
 | 
			
		||||
    if (FAILED(hr)) {
 | 
			
		||||
        ole_raise(hr, eWIN32OLERuntimeError, "failed to GetTypeAttr");
 | 
			
		||||
        ole_raise(hr, eWIN32OLEQueryInterfaceError, "failed to GetTypeAttr");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    ole_methods_sub(0, pTypeInfo, methods, mask);
 | 
			
		||||
| 
						 | 
				
			
			@ -179,7 +179,7 @@ ole_methods_sub(ITypeInfo *pOwnerTypeInfo, ITypeInfo *pTypeInfo, VALUE methods,
 | 
			
		|||
    WORD i;
 | 
			
		||||
    hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
 | 
			
		||||
    if (FAILED(hr)) {
 | 
			
		||||
        ole_raise(hr, eWIN32OLERuntimeError, "failed to GetTypeAttr");
 | 
			
		||||
        ole_raise(hr, eWIN32OLEQueryInterfaceError, "failed to GetTypeAttr");
 | 
			
		||||
    }
 | 
			
		||||
    for(i = 0; i < pTypeAttr->cFuncs; i++) {
 | 
			
		||||
        hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, i, &pFuncDesc);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue