[Win32utils-devel] Possible windows-api enhancement - literal data types

Berger, Daniel Daniel.Berger at qwest.com
Mon Feb 4 18:19:18 EST 2008


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.


More information about the win32utils-devel mailing list