From 9bd26df82caaa34e0e1d2c04601b24f230db8dc2 Mon Sep 17 00:00:00 2001 From: FunkyFr3sh Date: Mon, 1 Apr 2019 22:32:53 +0200 Subject: [PATCH] testing code for detecting bad compatibility modes --- src/main.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/main.c b/src/main.c index b224ce0..e43ea87 100644 --- a/src/main.c +++ b/src/main.c @@ -55,6 +55,30 @@ BOOL WINAPI DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved) { case DLL_PROCESS_ATTACH: { + /* + char buf[1024]; + if (GetEnvironmentVariable("__COMPAT_LAYER", buf, sizeof(buf))) + { + char *s = strtok(buf, " "); + while (s) + { + if (strcmpi(s, "WIN95") == 0 || strcmpi(s, "WIN98") == 0 || strcmpi(s, "NT4SP5") == 0) + { + MessageBoxA( + NULL, + "Please disable all compatibility modes for the game executable and " + "then try to start the game again.", + "Compatibility modes detected - cnc-ddraw", + MB_OK); + + //return FALSE; + break; + } + + s = strtok(NULL, " "); + } + } + */ printf("cnc-ddraw DLL_PROCESS_ATTACH\n"); //SetProcessPriorityBoost(GetCurrentProcess(), TRUE);