If you plan on doing Ruby programming that needs to access
some Windows 32 API functions directly, or to use the entry points in some
other DLLs, we've got good news for you---the
Win32API
extension.
The
Win32API
module is documented beginning on page 508,
but here's a quick peek at how it works.
You create a
Win32API
object that represents a call to a
particular DLL entry point by specifying the name of the function, the
name of the DLL that contains the function, and the function signature (argument
types and return type). The resulting object can then be used to make
the function call.
Many of the arguments to DLL functions are binary structures
of some form.
Win32API
handles this by using Ruby
String
objects to pass the binary data back and forth. You will need to pack
and unpack these strings as necessary (see the example
on page 508).