From: gregarican Date: 2005-09-30T02:01:44+09:00 Subject: Re: Win32API question PWR wrote: > I am trying to use Ruby's Win32API interface to access the windows file > i/o in order to make a serial port connection. However the code below > gives the error '[BUG] Segmentation fault' when GetOverlappedResult() > is called. Any ideas would be gratefully received. .... > ReadFile = Win32API.new("Kernel32","ReadFile","LPLLP","N") > WriteFile = Win32API.new("Kernel32","WriteFile","LPLLP","N") Looking at a sample script I made that read/wrote to the serial port using win32api my ReadFile and WriteFile calls were constructed differently. Specifically: WriteFile = Win32API.new("kernel32", "WriteFile", 'LPLPL', 'L') ReadFile = Win32API.new("kernel32", "ReadFile", 'LPLPL', 'L') Try using them constructed this way and see if things work...