Module: Win32::APIMapper
- Included in:
- Win32, LastErrorInfo, Process, RegKey
- Defined in:
- lib/Win32/APIMapper.rb
Overview
ret = WCall(‘OpenKey’, key, strSubKey, 0, samDesired, pKey)
Constant Summary collapse
- DLL =
constsFor: “Labels”
0
- NAME =
1
- IN =
2
- OUT =
3
- HANDLE =
4
- @@mFunctions =
classVariableNames
{}
Class Method Summary collapse
-
.Initialize(p_map) ⇒ Object
—————————————————————————————– class methodsFor: “class initialization”.
-
.WCall(p_fn, *p_args) ⇒ Object
—————————————————————————————- class methodsFor: “Calling”.
Instance Method Summary collapse
-
#WCall(p_fn, *p_args) ⇒ Object
—————————————————————————————- methodsFor: “Calling”.
Class Method Details
.Initialize(p_map) ⇒ Object
class methodsFor: “class initialization”
36 37 38 39 40 |
# File 'lib/Win32/APIMapper.rb', line 36 def APIMapper.Initialize(p_map) p_map.each do |p_key, p_data| @@mFunctions[p_key] = p_data if !@@mFunctions.include?(p_key) end end |
.WCall(p_fn, *p_args) ⇒ Object
class methodsFor: “Calling”
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/Win32/APIMapper.rb', line 50 def APIMapper.WCall(p_fn, *p_args) fn = @@mFunctions[p_fn] raise ArgumentError, "APIMapper(#{self.class}) does not contain function #{p_fn}", caller if fn.nil? h = fn[HANDLE] if h.nil? fn[HANDLE] = h = Win32API.new(fn[DLL], fn[NAME], fn[IN], fn[OUT]) @@mFunctions[p_fn] = fn end return h.Call(*p_args) end |