From ada8110f7ffd38eb0309b3a9561c1ed993021aca Mon Sep 17 00:00:00 2001 From: eban Date: Sun, 12 Jan 2003 17:36:24 +0000 Subject: * ext/dl/lib/dl/win32.rb: elimitate unnecessary "A" adding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/dl/lib/dl/win32.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'ext/dl/lib') diff --git a/ext/dl/lib/dl/win32.rb b/ext/dl/lib/dl/win32.rb index f0ea2a91e1..8077656ab3 100644 --- a/ext/dl/lib/dl/win32.rb +++ b/ext/dl/lib/dl/win32.rb @@ -8,15 +8,11 @@ class Win32API def initialize(dllname, func, import, export = "0") prototype = (export + import.to_s).tr("VPpNnLlIi", "0SSI") handle = DLL[dllname] ||= DL::Handle.new(dllname) - begin - @sym = handle.sym(func, prototype) - rescue RuntimeError - @sym = handle.sym(func + "A", prototype) - end + @sym = handle.sym(func, prototype) end def call(*args) - import = @sym.proto[1..-1] || "" + import = @sym.split("", 2)[1] args.each_with_index do |x, i| args[i] = nil if x == 0 and import[i] == ?S args[i], = [x].pack("I").unpack("i") if import[i] == ?I -- cgit v1.2.3