Bugs item #3658, was opened at 2006-02-24 18:33
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1698&aid=3658&group_id=426

>Category: External APIs / Interfacing
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Daniel Berger (djberg96)
Assigned to: Nobody (None)
Summary: Passing wrong data type to Win32API#call causes segfault

Initial Comment:
Windows XP
Ruby 1.8.4 (both hand built and the installer)

Passing the wrong data type to an instance of Win32API causes a segfault:

require 'Win32API'
RegFormat = Win32API.new('user32', 'RegisterClipboardFormat', 'P', 'I')
RegFormat.call(1) # Boom!

Shouldn't it just raise a TypeError?  Segfaulting the interpreter seems pretty harsh.

Regards,

Dan

----------------------------------------------------------------------

Comment By: Daniel Berger (djberg96)
Date: 2006-03-23 10:28

Message:
Specifically, it appears to be choking on line 194:

ret = ApiFunction(param);

Where ApiFunction is defined as:

FARPROC ApiFunction = (FARPROC)NUM2ULONG(obj_proc);

Any ideas?

Dan

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1698&aid=3658&group_id=426