cosmo0920 / win32-api

A different, better variant of the Win32API Ruby library
61 stars 10 forks source link

Can't call GetModuleFileName on mswin64 #15

Closed nurse closed 9 years ago

nurse commented 9 years ago

% ruby -rwin32/api -e"a=Win32::API.new('GetModuleFileName','LPL','L');p a.call(0,str='.'*256,256)" 0

It is expected to store a the path of ruby binary and output the size of it.

https://msdn.microsoft.com/ja-jp/library/windows/desktop/ms683197%28v=vs.85%29.aspx

phasis68 commented 9 years ago

What is your ruby version and win32-api version?

Works fine for me with ruby 2.2.2 and win32-api 1.5.3 on Windows 7

C:>ruby -rwin32/api -ve"a=Win32::API.new('GetModuleFileName','LPL','L');p a.call(0,str='.'*256,256)" ruby 2.2.2p95 (2015-04-13 revision 50295) [x64-mswin64_120] 19

nurse commented 9 years ago

Thanks, my environment is ruby 2.3.0dev (2015-05-30 trunk 50685) [x64-mswin64_120]. And I confirmed it works on ruby 2.2.2p95 (2015-04-13 revision 50295) [x64-mingw32].

I'll investigate my environment...

djberg96 commented 9 years ago

We don't ship a binary for 2.3 yet. You will have to build from source to use 2.3 right now.

nurse commented 9 years ago

It is because the gem version is 1.4.8, which is the last version of distributed gem including source. I built binary from GitHub source.