From d88d4df4d0c4d8a58b7fe9acdb82e2560440e60a Mon Sep 17 00:00:00 2001 From: "Alexander S. Aganichev" Date: Sat, 4 Jan 2003 10:14:24 +0000 Subject: [PATCH] Added PMWIN environment variable handling --- goldlib/gall/gutlos2.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/goldlib/gall/gutlos2.cpp b/goldlib/gall/gutlos2.cpp index 13b66b8..ed53c13 100644 --- a/goldlib/gall/gutlos2.cpp +++ b/goldlib/gall/gutlos2.cpp @@ -102,14 +102,23 @@ int g_init_os(int flags) { int rc; PTIB ptib; + const char *env; - rc = DosQueryModuleHandle((PSZ)"PMWIN", &ge_os2_hmte); memset(&pminfo, 0, sizeof (pminfo)); DosGetInfoBlocks(&ptib, &pminfo.ppib); pminfo.savedtype = pminfo.ppib->pib_ultype; - // Morph application into PM + // Check PMWIN environment variable, if it set to NO do not try to use + // PMWIN functions + if(((env = getenv("PMWIN")) != NULL) and strieql(env, "NO")) { + rc = 1; + } + else { + // Morph application into PM + rc = DosQueryModuleHandle((PSZ)"PMWIN", &ge_os2_hmte); + } + if(not rc) { pminfo.ppib->pib_ultype = 3; rc = DosLoadModule((PSZ)ge_os2_loaderr, sizeof(ge_os2_loaderr), (PSZ)"PMWIN", &ge_os2_hmte);