[Win32utils-devel] Modification for mkmf

win32utils-devel at rubyforge.org win32utils-devel at rubyforge.org
Fri Dec 10 12:08:51 EST 2004


Here's a Win32API snippet for getting major and minor:

require "Win32API"

GetVersionEx = Win32API.new('kernel32','GetVersionEx','P','I')
swCSDVersion = "\0" * 128
OSVERSIONINFO = [148,0,0,0,0,swCSDVersion].pack("LLLLLa128")
GetVersionEx.call(OSVERSIONINFO)
info = OSVERSIONINFO.unpack("LLLLLa128")

major, minor = info[1,2]

Regards,

Dan



More information about the win32utils-devel mailing list