--- np2/win9x/sstpmsg.cpp 2005/03/19 20:46:07 1.9 +++ np2/win9x/sstpmsg.cpp 2007/12/28 20:36:40 1.11 @@ -1,6 +1,7 @@ #include "compiler.h" #include "strres.h" #include "np2.h" +#include "oemtext.h" #include "scrnmng.h" #include "sysmng.h" #include "sstp.h" @@ -10,9 +11,6 @@ #include "sound.h" #include "fmboard.h" #include "np2info.h" -#if defined(OSLANG_UTF8) || defined(OSLANG_UCS2) -#include "oemtext.h" -#endif static const OEMCHAR cr[] = OEMTEXT("\\n"); @@ -245,8 +243,7 @@ static OEMCHAR *sstpsolve(OEMCHAR *buf, #if defined(OSLANG_UTF8) || defined(OSLANG_UCS2) sjis[0] = c2; sjis[1] = '\0'; - oemtext_sjistooem(buf, 4, sjis, 1); - buf += OEMSTRLEN(buf); + buf += oemtext_sjistooem(buf, 4, sjis, 1); #else *buf++ = c2; #endif @@ -278,8 +275,7 @@ static OEMCHAR *sstpsolve(OEMCHAR *buf, sjis[0] = (UINT8)0x82; sjis[1] = prs2[c-0xa0]; sjis[2] = '\0'; - oemtext_sjistooem(buf, 4, sjis, 2); - buf += OEMSTRLEN(buf); + buf += oemtext_sjistooem(buf, 4, sjis, 2); #else buf[0] = (UINT8)0x82; buf[1] = prs2[c-0xa0]; @@ -294,8 +290,7 @@ static OEMCHAR *sstpsolve(OEMCHAR *buf, sjis[0] = c; sjis[1] = c2; sjis[2] = '\0'; - oemtext_sjistooem(buf, 4, sjis, 2); - buf += OEMSTRLEN(buf); + buf += oemtext_sjistooem(buf, 4, sjis, 2); #else buf[0] = c; buf[1] = c2; @@ -314,25 +309,24 @@ static OEMCHAR *sstpsolve(OEMCHAR *buf, // ------------------------------- +static const UINT8 *prcs[4] = {k_keropi, k_winx68k, k_t98next, k_anex86}; + static int check_keropi(void) { - OEMCHAR buf[64]; + UINT i; - sstpsolve(buf, k_keropi); - if (FindWindow(buf, NULL)) { - return(1); - } - sstpsolve(buf, k_winx68k); - if (FindWindow(buf, NULL)) { - return(2); - } - sstpsolve(buf, k_t98next); - if (FindWindow(NULL, buf)) { - return(3); - } - sstpsolve(buf, k_anex86); - if (FindWindow(NULL, buf)) { - return(4); + for (i=0; i