[前][次][番号順一覧][スレッド一覧]

ruby-changes:48542

From: suke <ko1@a...>
Date: Sun, 5 Nov 2017 09:31:02 +0900 (JST)
Subject: [ruby-changes:48542] suke:r60657 (trunk): * ext/win32ole/win32ole_error.c: add WIN32OLEQueryInterfaceError.

suke	2017-11-05 09:30:57 +0900 (Sun, 05 Nov 2017)

  New Revision: 60657

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60657

  Log:
    * 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

  Modified files:
    trunk/ext/win32ole/win32ole.c
    trunk/ext/win32ole/win32ole_error.c
    trunk/ext/win32ole/win32ole_error.h
    trunk/ext/win32ole/win32ole_method.c
Index: ext/win32ole/win32ole_method.c
===================================================================
--- ext/win32ole/win32ole_method.c	(revision 60656)
+++ ext/win32ole/win32ole_method.c	(revision 60657)
@@ -119,7 +119,7 @@ ole_methods_from_typeinfo(ITypeInfo *pTy https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole_method.c#L119
     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 *pOwnerTypeInf https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole_method.c#L179
     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);
Index: ext/win32ole/win32ole.c
===================================================================
--- ext/win32ole/win32ole.c	(revision 60656)
+++ ext/win32ole/win32ole.c	(revision 60657)
@@ -3397,7 +3397,7 @@ typeinfo_from_ole(struct oledata *pole, https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L3397
     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, https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L3407
     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++) {
Index: ext/win32ole/win32ole_error.c
===================================================================
--- ext/win32ole/win32ole_error.c	(revision 60656)
+++ ext/win32ole/win32ole_error.c	(revision 60657)
@@ -80,4 +80,5 @@ Init_win32ole_error(void) https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole_error.c#L80
      *
      */
     eWIN32OLERuntimeError = rb_define_class("WIN32OLERuntimeError", rb_eRuntimeError);
+    eWIN32OLEQueryInterfaceError = rb_define_class("WIN32OLEQueryInterfaceError", eWIN32OLERuntimeError);
 }
Index: ext/win32ole/win32ole_error.h
===================================================================
--- ext/win32ole/win32ole_error.h	(revision 60656)
+++ ext/win32ole/win32ole_error.h	(revision 60657)
@@ -2,6 +2,7 @@ https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole_error.h#L2
 #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);
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]