http://bugs.winehq.org/show_bug.cgi?id=20154
Summary: Calling *nix Native Functions from *nix aware Windows Programs Product: Wine Version: 1.1.29 Platform: PC URL: http://rh-software.com/ OS/Version: Linux Status: UNCONFIRMED Severity: trivial Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: ray@pobox.co.uk
I would like to call *nix native functions from SIV (http://rh-software.com/) and I would also like to be able to run the same SIV.exe file on both native Windows and with Wine. I general terms I wish/need to do this to work-a-round things that are tricky/impossible on Wine currently these mainly relate to being unable to actually run the SIV Kernel Driver in Kernel mode. I suspect that from time-to-time other applications will wish to do similar. After a couple of false starts I think (hope) I have a solution that is acceptable. My basic idea is that Wine should export the following functions.
void *wine_dlopen(const char *filename, int flag); char *wine_dlerror(void); void *wine_dlsym(void *handle, const char *symbol); int wine_dlclose(void *handle);
This will allow any *nix aware application to call many/most native *nix functions without needing to created a .dll just to be able to achieve this and/or converting the application to a full winelib application when only a small number functions are needed. In the case of SIV the current number is 2.
I would guess it's fairly obvious what these do. I confirm they simply transfer to the *nix dlopen()/dlerror()/dlsym()/dlclose(). As these are already used internally by Wine I do not believe there should be any portability issues.
My plan B is to create my own SIVWNE.dll that would export these functions. I feel these will be of general use and therefore a better solution would be for Wine to export them from one of the standard .DLLs in much the same way as it exports wine_nt_to_unix_file_name() that allow Wine aware applications deal with file names.