Berger, Daniel
2008-Feb-04 23:19 UTC
[Win32utils-devel] Possible windows-api enhancement - literal data types
Hi all,
This is something I was thinking of adding to the windows-api library
(the win32-api wrapper). Instead of passing just ''P'',
''L'', ''I'', ''B'' or
''K'' for the prototype or return type, you could pass a
stringified
Windows data type, e.g. ''DWORD'', ''BOOL'',
etc, and it would convert it
automatically for you.
For example:
require ''windows/api''
include Windows
GetCurrentDirectory = API.new(''GetCurrentDirectory'',
[''DWORD'',
''LPTSTR''], ''DWORD'',
''kernel32'')
That would be converted to [''L'', ''P''] and
''L'', respectively, behind the
scenes.
My secret motivation for this is for JRuby, where I don''t think a
generic ''P'' will work for all pointers, since I need to know
the data
type up front in some cases.
Seem reasonable?
Regards,
Dan
This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly
prohibited and may be unlawful. If you have received this communication
in error, please immediately notify the sender by reply e-mail and destroy
all copies of the communication and any attachments.