Hello,
while converting HWND to a void* i've seen that the WIN_Handle{16,32} functions were used (but not everywhere) to do the conversion HWND16 <--> HWND. WIN_Handle16 is declared and implemented in include/win.h and WIN_Handle32 is also declared in include/win.h but implemented in windows/win.c . I have used both functions with success in dlls/user/, windows/, controls/ but i would have to link to windows/win.c to make that work for other dlls too.
Assuming that WIN_Handle{16,32} are not windows funtions (a search on google has given only links to wine pages) i would do following: - rename WIN_Handle{16,32} to HWND_{16,32} to make the naming consistent to the othe handle conversions - maybe remove the declaration of the two functions from include/win.h (or at least don't include win.h where it isn't yet used) - define HWND_16 as macro like the other HANDLE_16 macros and put it directly in the files where it's needed - HWND_32 has to do a little bit more work then the other HANDLE_32 macros and i would keep it as function. This means it has to be duplicated in every dll that needs it and one of the *16.c files in the dll directory would be the place to put it in.
Comments?
bye michael
Michael Stefaniuc mstefani@redhat.de writes:
Assuming that WIN_Handle{16,32} are not windows funtions (a search on google has given only links to wine pages) i would do following:
- rename WIN_Handle{16,32} to HWND_{16,32} to make the naming consistent to the othe handle conversions
- maybe remove the declaration of the two functions from include/win.h (or at least don't include win.h where it isn't yet used)
- define HWND_16 as macro like the other HANDLE_16 macros and put it directly in the files where it's needed
The macros should stay in win.h, you must not define them in every single C file. For other dlls, you need to define them in some appropriate internal header of the dll. There shouldn't be more than one definition of the macros for each dll.
- HWND_32 has to do a little bit more work then the other HANDLE_32 macros and i would keep it as function. This means it has to be duplicated in every dll that needs it and one of the *16.c files in the dll directory would be the place to put it in.
Other dlls should probably do a simple 16->32 conversion like for other handles; you definitely don't want to duplicate WIN_Handle32 in the other dlls.