aboutsummaryrefslogtreecommitdiffstats
path: root/ext/win32/lib/Win32API.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/win32/lib/Win32API.rb')
-rw-r--r--ext/win32/lib/Win32API.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/win32/lib/Win32API.rb b/ext/win32/lib/Win32API.rb
index 43db7db67b..fb40798a46 100644
--- a/ext/win32/lib/Win32API.rb
+++ b/ext/win32/lib/Win32API.rb
@@ -12,7 +12,13 @@ class Win32API
def initialize(dllname, func, import, export = "0", calltype = :stdcall)
@proto = [import].join.tr("VPpNnLlIi", "0SSI").sub(/^(.)0*$/, '\1')
- handle = DLL[dllname] ||= Fiddle.dlopen(dllname)
+ handle = DLL[dllname] ||=
+ begin
+ Fiddle.dlopen(dllname)
+ rescue Fiddle::DLError
+ raise unless File.extname(dllname).empty?
+ Fiddle.dlopen(dllname + ".dll")
+ end
@func = Fiddle::Function.new(
handle[func],