Update from Julien fixes API calls on older OSs

git-svn-id: file:///home/svn/framework3/trunk@5679 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2008-09-24 20:01:22 +00:00
parent 36a06e7576
commit df55d0107a
1 changed files with 6 additions and 1 deletions

View File

@ -37,7 +37,12 @@ module WinAPI
def self.new_api(lib, name, args, zero_is_err = true)
args = args.delete(' ').split(//)
retval = args.pop
const_set(name, Win32API.new(lib, name, args, retval))
begin
const_set(name, Win32API.new(lib, name, args, retval))
rescue
puts "no export #{name} found in #{lib}" if $VERBOSE
return
end
define_method(name.downcase) { |*a|
r = const_get(name).call(*a)
if r == 0 and zero_is_err