Skip to content

Instantly share code, notes, and snippets.

@chungy
Created June 10, 2014 23:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chungy/a007dd0bcf6e812c6e43 to your computer and use it in GitHub Desktop.
Save chungy/a007dd0bcf6e812c6e43 to your computer and use it in GitHub Desktop.
#include <windows.h>
#include <stdio.h>
int main(void)
{
static const char* (CDECL *pwine_get_version)(void);
HMODULE hntdll = GetModuleHandle("ntdll.dll");
if(!hntdll) {
puts("Running on Windows 9x.");
return 1;
}
pwine_get_version = (void *)GetProcAddress(hntdll, "wine_get_version");
if(pwine_get_version)
printf("Running on Wine %s\n", pwine_get_version());
else
puts("Running on Windows NT.");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment