Some Win32API calls don't work in JRuby
---------------------------------------

                 Key: JRUBY-4323
                 URL: http://jira.codehaus.org/browse/JRUBY-4323
             Project: JRuby
          Issue Type: Bug
          Components: Windows
    Affects Versions: JRuby 1.4
            Reporter: Vladimir Sizikov
             Fix For: JRuby 1.5


Take a look, MRI allows 0 as arguments in some message calls, while JRuby 
doesn't:

{code}
require 'Win32API'
FormatMessageA = Win32API.new('kernel32.dll', 'FormatMessageA', 'LPLLPLP', 'L')

code = 234
msg = "\0" * 1024

# doesn't work in JRuby
len = FormatMessageA.call(0x1200, 0, code, 0, msg, 1024, 0)

# works in MRI and JRuby
# len = FormatMessageA.call(0x1200, nil, code, 0, msg, 1024, nil)

puts msg.chomp[0, len].tr("\r", '').chomp
{code}

MRI prints: More data is available.
JRuby prints:
winapi_test.rb:8: Invalid buffer/pointer parameter (ArgumentError)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to