Module: WinFFI
- Extended by:
- LibBase
- Defined in:
- lib/win-ffi/core.rb,
lib/win-ffi/logger.rb,
lib/win-ffi/core/version.rb,
lib/win-ffi/core/lib_base.rb,
lib/win-ffi/core/lib_base.rb,
lib/win-ffi/core/lib_base.rb,
lib/win-ffi/core/macro/util.rb,
lib/win-ffi/core/struct/guid.rb,
lib/win-ffi/core/struct/luid.rb,
lib/win-ffi/core/struct/rect.rb,
lib/win-ffi/core/struct/size.rb,
lib/win-ffi/core/string_utils.rb,
lib/win-ffi/core/struct/point.rb,
lib/win-ffi/core/struct/sizel.rb,
lib/win-ffi/core/typedef/core.rb,
lib/win-ffi/core/boolean_utils.rb,
lib/win-ffi/core/struct/points.rb,
lib/win-ffi/core/wide_inline_string.rb,
lib/win-ffi/core/wide_string_pointer.rb,
lib/win-ffi/core/struct/large_integer.rb,
lib/win-ffi/core/struct/ularge_integer.rb,
lib/win-ffi/core/struct/security_attributes.rb,
lib/win-ffi/kernel32/enum/system_info/win32_winnt.rb,
lib/win-ffi/core/enum/error/set_last_error_ex_code.rb,
lib/win-ffi/kernel32/struct/system_info/os_version_info_ex.rb
Defined Under Namespace
Modules: BooleanUtils, Kernel32, LibBase, StringUtils Classes: GUID, LARGE_INTEGER, LUID, OSVERSIONINFOEX, POINT, POINTS, RECT, SECURITY_ATTRIBUTES, SIZE, SIZEL, WideInlineString, WideStringPointer
Constant Summary collapse
- MAX_PATH =
260- LOGGER =
Logger.new(STDOUT)
- VERSION =
'1.0.1'- Architecture =
“i386-mingw32” | “x64-mingw32”
FFI::Platform::CPU
- WindowsVersion =
OSVERSIONINFOEX.new.get!
- HANDLE =
WinFFI.find_type(:handle)
- SetLastErrorExCode =
SetLastErrorEx() types.
enum :set_last_error_ex_code, [ :ERROR, 0x00000001, :MINORERROR, 0x00000002, :WARNING, 0x00000003, ]
Class Method Summary collapse
- .encoding ⇒ Object
- .encoding=(encoding) ⇒ Object
-
.HandleToLong(h) ⇒ Object
define HandleToLong( h ) ((LONG)(LONG_PTR) (h) ).
-
.HandleToULong(h) ⇒ Object
define HandleToULong( h ) ((ULONG)(ULONG_PTR)(h) ).
-
.HIBYTE(w) ⇒ Object
define HIBYTE(w) ((BYTE)((((DWORD_PTR)(w)) >> 8) & 0xff)).
-
.HIWORD(l) ⇒ Object
define HIWORD(_dw) ((WORD)((((DWORD_PTR)(_dw)) >> 16) & 0xffff)).
-
.LOBYTE(w) ⇒ Object
define LOBYTE(w) ((BYTE)(((DWORD_PTR)(w)) & 0xff)).
-
.LongToHandle(h) ⇒ Object
define LongToHandle( h ) ((HANDLE)(LONG_PTR) (h) ).
-
.LOWORD(l) ⇒ Object
define LOWORD(_dw) ((WORD)(((DWORD_PTR)(_dw)) & 0xffff)).
-
.MAKELCID(lgid, srtid) ⇒ Object
ulong.
- .MAKELONG(a, b) ⇒ Object
- .MAKEWORD(a, b) ⇒ Object
-
.ULongToHandle(ul) ⇒ Object
define ULongToHandle( ul ) ((HANDLE)(ULONG_PTR) (ul) ).
Methods included from LibBase
define_prefix, define_suffix, encoded_function, extended
Class Method Details
.encoding ⇒ Object
9 10 11 |
# File 'lib/win-ffi/core/lib_base.rb', line 9 def self.encoding @encoding end |
.encoding=(encoding) ⇒ Object
13 14 15 |
# File 'lib/win-ffi/core/lib_base.rb', line 13 def self.encoding=(encoding) @encoding = encoding end |
.HandleToLong(h) ⇒ Object
define HandleToLong( h ) ((LONG)(LONG_PTR) (h) )
48 49 50 |
# File 'lib/win-ffi/core/macro/util.rb', line 48 def HandleToLong(h) h.address end |
.HandleToULong(h) ⇒ Object
define HandleToULong( h ) ((ULONG)(ULONG_PTR)(h) )
43 44 45 |
# File 'lib/win-ffi/core/macro/util.rb', line 43 def HandleToULong(h) h.address end |
.HIBYTE(w) ⇒ Object
define HIBYTE(w) ((BYTE)((((DWORD_PTR)(w)) >> 8) & 0xff))
38 39 40 |
# File 'lib/win-ffi/core/macro/util.rb', line 38 def HIBYTE(w) w >> 8 end |
.HIWORD(l) ⇒ Object
define HIWORD(_dw) ((WORD)((((DWORD_PTR)(_dw)) >> 16) & 0xffff))
24 25 26 |
# File 'lib/win-ffi/core/macro/util.rb', line 24 def HIWORD(l) l >> 16 end |
.LOBYTE(w) ⇒ Object
define LOBYTE(w) ((BYTE)(((DWORD_PTR)(w)) & 0xff))
33 34 35 |
# File 'lib/win-ffi/core/macro/util.rb', line 33 def LOBYTE(w) w & 0xff end |
.LongToHandle(h) ⇒ Object
define LongToHandle( h ) ((HANDLE)(LONG_PTR) (h) )
58 59 60 |
# File 'lib/win-ffi/core/macro/util.rb', line 58 def LongToHandle(h) FFI::Pointer.new(HANDLE, h) end |
.LOWORD(l) ⇒ Object
define LOWORD(_dw) ((WORD)(((DWORD_PTR)(_dw)) & 0xffff))
19 20 21 |
# File 'lib/win-ffi/core/macro/util.rb', line 19 def LOWORD(l) l & 0xffff end |
.MAKELCID(lgid, srtid) ⇒ Object
ulong
14 15 16 |
# File 'lib/win-ffi/core/macro/util.rb', line 14 def MAKELCID(lgid, srtid) # ulong srtid << 16 | lgid end |
.MAKELONG(a, b) ⇒ Object
10 11 12 |
# File 'lib/win-ffi/core/macro/util.rb', line 10 def MAKELONG(a, b) ((a & 0xffff) | ((b & 0xffff) << 16)) end |
.MAKEWORD(a, b) ⇒ Object
6 7 8 |
# File 'lib/win-ffi/core/macro/util.rb', line 6 def MAKEWORD(a, b) ((a & 0xff) | ((b & 0xff) << 8)) end |
.ULongToHandle(ul) ⇒ Object
define ULongToHandle( ul ) ((HANDLE)(ULONG_PTR) (ul) )
53 54 55 |
# File 'lib/win-ffi/core/macro/util.rb', line 53 def ULongToHandle(ul) FFI::Pointer.new(HANDLE, ul) end |