winapi - In Ruby's Win32API.new, isn't 'L' the same as 'I', and what about 'N' or 'P'? -
in documentation, ruby's win32api has 'l'
, 'n'
specify "number"... , in documentation, 'l'
"long". 'n'
deprecated, , isn't 'l'
same 'i'
actually? "number" not specific.
in http://rubyforge.org/docman/view.php/85/3463/api.html#m000001
there no specifying boolean parameter 'b'
or 'i'
, return value...
in http://www.ruby-doc.org/stdlib/libdoc/win32api/rdoc/classes/win32/registry/error.html#m001622
there is
win32api.new('kernel32.dll', 'formatmessagea', 'lpllplp', 'l')
instead of more common ['l', 'p', 'l', ...]
format
hwnd
'l'
, therefore 'i'
work too? (hwnd
handle window)
boolean parameter 'b'
, same 'i'
?
so basically, can use things 'i'
? 'p'
should 4-byte, 'i'
should work well? there more formal specification?
update: think more 'p'
, use ruby's string class object, , take content buffer part , pass c function. using 'i'
won't trigger behavior. (example: such using getwindowtext()
)
i'm looking @ win32-api source code, , looks difference between 'l' , 'i' 'l' calls rb_num2ulong
, 'i' calls rb_num2int
in <ruby.h>
. guess difference treatment signed value or not. 'p' results rb_num2ulong
, follows additional logic stick documentation suggests. coudln't find mention of 'n' in latest version of win32-api (1.4.5), it's deprecated. windows apis not return boolean
, return bool
(surprise! ) int
. in short, don't think should use 'i' everything. win32-api documentation pretty scant i've seen. @ least source code available browsing.
Comments
Post a Comment