Re: WEE under Wine

new topic     » goto parent     » topic index » view thread      » older message » newer message

Here is an example based on the code in that link. I have not properly tested because I do not have Wine installed. On Windows I get "did not detect Wine" as expected.

include std/dll.e 
include std/machine.e 
 
public function wine_get_version() 
     
    object version = 0 
     
ifdef WINDOWS then 
     
    atom ntdll = open_dll( "ntdll.dll" ) 
    integer _wine_get_version = define_c_func( ntdll, "+wine_get_version", {}, C_POINTER ) 
     
    if _wine_get_version != -1 then 
         
        atom pversion = c_func( _wine_get_version, {} ) 
        version = peek_string( pversion ) 
         
    end if 
     
end ifdef 
     
    return version 
end function 
 
object version = wine_get_version() 
 
if sequence( version ) then 
    printf( 1, "running on Wine %s\n", {version} ) 
else 
    puts( 1, "did not detect Wine\n" ) 
end if 

-Greg

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu