* test/win32ole/test_win32ole_method.rb (test_offset_vtbl): check
that Ruby is 32bit or 64bit binary in order to get correct offset value. [ruby-dev:41741] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28456 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
19e835f952
commit
392255310c
@ -1,3 +1,9 @@
|
|||||||
|
Mon Jun 28 20:32:33 2010 Masaki Suketa <masaki.suketa@nifty.ne.jp>
|
||||||
|
|
||||||
|
* test/win32ole/test_win32ole_method.rb (test_offset_vtbl): check
|
||||||
|
that Ruby is 32bit or 64bit binary in order to get correct offset
|
||||||
|
value. [ruby-dev:41741]
|
||||||
|
|
||||||
Mon Jun 28 05:32:51 2010 Yusuke Endoh <mame@tsg.ne.jp>
|
Mon Jun 28 05:32:51 2010 Yusuke Endoh <mame@tsg.ne.jp>
|
||||||
|
|
||||||
* lib/rdoc/ri/driver.rb (RDoc::RI::Driver#formatter): should use bs
|
* lib/rdoc/ri/driver.rb (RDoc::RI::Driver#formatter): should use bs
|
||||||
|
@ -108,28 +108,12 @@ if defined?(WIN32OLE_METHOD)
|
|||||||
assert_equal(1610743810, @m_namespace.dispid)
|
assert_equal(1610743810, @m_namespace.dispid)
|
||||||
end
|
end
|
||||||
|
|
||||||
def is_win64?
|
def is_ruby64?
|
||||||
if /win64$/ =~ RUBY_PLATFORM
|
/win64/ =~ RUBY_PLATFORM
|
||||||
return true
|
|
||||||
end
|
|
||||||
require 'Win32API'
|
|
||||||
get_current_process = Win32API.new('kernel32', 'GetCurrentProcess', nil, 'i')
|
|
||||||
handle = get_current_process.call
|
|
||||||
is_wow64 = false
|
|
||||||
begin
|
|
||||||
is_wow64_process = Win32API.new('Kernel32', 'IsWow64Process', ['i', 'p'], 'i')
|
|
||||||
bool = "\0\0\0\0"
|
|
||||||
if is_wow64_process.call(handle, bool) != 0
|
|
||||||
is_wow64 = bool != "\0\0\0\0"
|
|
||||||
end
|
|
||||||
rescue RuntimeError
|
|
||||||
# no IsWow64Process
|
|
||||||
end
|
|
||||||
is_wow64
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_offset_vtbl
|
def test_offset_vtbl
|
||||||
exp = is_win64? ? 48 : 24
|
exp = is_ruby64? ? 48 : 24
|
||||||
assert_equal(exp, @m_invoke.offset_vtbl)
|
assert_equal(exp, @m_invoke.offset_vtbl)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user