mirror of
https://github.com/EnderIce2/rpc-bridge.git
synced 2025-05-28 15:34:34 +00:00
Check if it's running under Linux
This commit is contained in:
parent
cba4fa1e2b
commit
d2b23eb2e8
17
main.c
17
main.c
@ -52,6 +52,23 @@ void DetectWine()
|
|||||||
GetErrorMessage(), MB_OK | MB_ICONINFORMATION);
|
GetErrorMessage(), MB_OK | MB_ICONINFORMATION);
|
||||||
ExitProcess(1);
|
ExitProcess(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void(CDECL * wine_get_host_version)(const char **sysname, const char **release);
|
||||||
|
wine_get_host_version = (void *)GetProcAddress(hNTdll, "wine_get_host_version");
|
||||||
|
|
||||||
|
assert(wine_get_host_version);
|
||||||
|
const char *__sysname;
|
||||||
|
const char *__release;
|
||||||
|
wine_get_host_version(&__sysname, &__release);
|
||||||
|
if (strcmp(__sysname, "Linux") != 0)
|
||||||
|
{
|
||||||
|
int result = MessageBox(NULL, "This program is designed for Linux only!\nDo you want to proceed?",
|
||||||
|
NULL, MB_YESNO | MB_ICONQUESTION);
|
||||||
|
if (result == IDYES)
|
||||||
|
return;
|
||||||
|
else if (result == IDNO)
|
||||||
|
ExitProcess(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void print(char const *fmt, ...)
|
void print(char const *fmt, ...)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user