[Win32utils-devel] Making win32-api better?

Heesob Park phasis at gmail.com
Thu Apr 30 11:38:38 EDT 2009


2009/4/30 Daniel Berger <djberg96 at gmail.com>:
> Hi all,
> During a conversation with 'flexo' on IRC (not sure of his real name), he
> complained that win32-api was unstable. He wrote his own interface and
> maintains that it is very stable and works better with multi-threaded apps.
> Please take a look and tell me what you think (below the C code is the Ruby
> interface):
<snip code>

Great work indeed.

The code seems to consist of the intensive use of inline assembly and
thread manipulations.
I guess it will not work for ruby 1.9.x 64bit version.
And it has some superfluous overheads in thread handling and sleeping delay.

Anyway, I expect it will work on ruby 1.8.6 in most cases.
But, here are some issue.

W32Thunk.call('user32','MessageBeep',1,-1) failed with the message
./w32thunk.rb:146:in `_start_call': strtoul("-1", ...) failed (fatal)
        from ./w32thunk.rb:146:in `call'

This callback test blocks on GetWindowTextA calling.
call = W32Thunk.callback {|handle,param|
	buf = 0.chr * 200
	buf.index(param).nil? ? 1 : 0


Park Heesob

More information about the win32utils-devel mailing list