* 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
This commit is contained in:
suke 2007-08-28 10:23:31 +00:00
Родитель 51b4cc11d1
Коммит 41585e424b
4 изменённых файлов: 18 добавлений и 4 удалений

Просмотреть файл

@ -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.

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -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

Просмотреть файл

@ -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