diff options
author | suke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-28 10:23:31 +0000 |
---|---|---|
committer | suke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-28 10:23:31 +0000 |
commit | 41585e424be2bfc12526a3f00378745c5851ad59 (patch) | |
tree | 5e8a748a814a4401fb2e524d2e70c611fd59c786 | |
parent | 51b4cc11d179106d4b7b9e8baf84e8e55c7b49f7 (diff) | |
download | ruby-41585e424be2bfc12526a3f00378745c5851ad59.tar.gz |
* ext/win32ole/win32ole.c (ole_type_progid): progid getted by
ProgIDFromCLSID should be freed by CoTaskMemFree. Thanks, arton.
* test/win32ole/test_win32ole.rb (test_raise_message): set negative
compareMode value to raise WIN32OLERuntimeError.
* test/win32ole/test_win32ole_type.rb (test_implemented_ole_types):
support some environment which returns IShellDispatch5 instead
of IShellDispatch.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | ext/win32ole/win32ole.c | 6 | ||||
-rw-r--r-- | test/win32ole/test_win32ole.rb | 2 | ||||
-rw-r--r-- | test/win32ole/test_win32ole_type.rb | 2 |
4 files changed, 18 insertions, 4 deletions
@@ -1,3 +1,15 @@ +Tue Aug 28 19:16:00 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp> + + * ext/win32ole/win32ole.c (ole_type_progid): progid getted by + ProgIDFromCLSID should be freed by CoTaskMemFree. Thanks, arton. + + * test/win32ole/test_win32ole.rb (test_raise_message): set negative + compareMode value to raise WIN32OLERuntimeError. + + * test/win32ole/test_win32ole_type.rb (test_implemented_ole_types): + support some environment which returns IShellDispatch5 instead + of IShellDispatch. + Tue Aug 28 15:42:09 2007 Yukihiro Matsumoto <matz@ruby-lang.org> * string.c (rb_str_subseq): retrieve substring based on byte offset. diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c index 329dd9be25..8c890d8987 100644 --- a/ext/win32ole/win32ole.c +++ b/ext/win32ole/win32ole.c @@ -116,7 +116,7 @@ #define WC2VSTR(x) ole_wc2vstr((x), TRUE) -#define WIN32OLE_VERSION "1.0.6" +#define WIN32OLE_VERSION "1.0.7" typedef HRESULT (STDAPICALLTYPE FNCOCREATEINSTANCEEX) (REFCLSID, IUnknown*, DWORD, COSERVERINFO*, DWORD, MULTI_QI*); @@ -5192,8 +5192,10 @@ ole_type_progid(ITypeInfo *pTypeInfo) if (FAILED(hr)) return progid; hr = ProgIDFromCLSID(&pTypeAttr->guid, &pbuf); - if (SUCCEEDED(hr)) + if (SUCCEEDED(hr)) { progid = ole_wc2vstr(pbuf, FALSE); + CoTaskMemFree(pbuf); + } OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr); return progid; } diff --git a/test/win32ole/test_win32ole.rb b/test/win32ole/test_win32ole.rb index cf39c7681d..06d4713375 100644 --- a/test/win32ole/test_win32ole.rb +++ b/test/win32ole/test_win32ole.rb @@ -50,7 +50,7 @@ if defined?(WIN32OLE) assert_match(/^\(in OLE method `<dispatch id:1>': \)/, exc.message) exc = assert_raise(WIN32OLERuntimeError) { - @dict1.compareMode = 100 + @dict1.compareMode = -1 } assert_match(/^\(in setting property `compareMode': \)/, exc.message) end diff --git a/test/win32ole/test_win32ole_type.rb b/test/win32ole/test_win32ole_type.rb index 1674604fce..3ef62b10d1 100644 --- a/test/win32ole/test_win32ole_type.rb +++ b/test/win32ole/test_win32ole_type.rb @@ -152,7 +152,7 @@ if defined?(WIN32OLE_TYPE) ole_types = @ole_type.implemented_ole_types assert_instance_of(Array, ole_types) assert(ole_types.size > 0) - assert_equal("IShellDispatch", ole_types[0].name) + assert_match(/^IShellDispatch5{0,1}$/, ole_types[0].name) end def test_inspect |