Class Win32API
In: dl/win32.rb
Parent: Object

Methods

Call   call   new  

Constants

DLL = {}

Public Class methods

[Source]

    # File dl/win32.rb, line 8
 8:   def initialize(dllname, func, import, export = "0")
 9:     prototype = (export + import.to_s).tr("VPpNnLlIi", "0SSI")
10:     handle = DLL[dllname] ||= DL::Handle.new(dllname)
11:     @sym = handle.sym(func, prototype)
12:   end

Public Instance methods

Call(*args)

Alias for call

[Source]

    # File dl/win32.rb, line 14
14:   def call(*args)
15:     import = @sym.proto.split("", 2)[1]
16:     args.each_with_index do |x, i|
17:       args[i] = nil if x == 0 and import[i] == ?S
18:       args[i], = [x].pack("I").unpack("i") if import[i] == ?I
19:     end
20:     ret, = @sym.call(*args)
21:     return ret || 0
22:   end

Search

Google

Ruby API Docs

Links