mirror of
https://github.com/reactos/reactos.git
synced 2025-05-20 09:36:16 +00:00
[CTFMON][MSCTFIME][SDK] Improve cicGetOSInfo
and s/OSINFO_/CIC_OSINFO/. Adapt ctfmon and msctfime to these changes. CORE-19360
This commit is contained in:
parent
96d525959b
commit
c4308d1e49
5 changed files with 41 additions and 24 deletions
|
@ -55,7 +55,7 @@ CLoaderWnd::WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
case WM_QUERYENDSESSION:
|
case WM_QUERYENDSESSION:
|
||||||
// NOTE: We don't support Win95/98/Me
|
// NOTE: We don't support Win95/98/Me
|
||||||
#ifdef SUPPORT_WIN9X
|
#ifdef SUPPORT_WIN9X
|
||||||
if (!(g_dwOsInfo & OSINFO_NT) && (!g_fWinLogon || (lParam & ENDSESSION_LOGOFF)))
|
if (!(g_dwOsInfo & CIC_OSINFO_NT) && (!g_fWinLogon || (lParam & ENDSESSION_LOGOFF)))
|
||||||
{
|
{
|
||||||
ClosePopupTipbar();
|
ClosePopupTipbar();
|
||||||
TF_UninitSystem();
|
TF_UninitSystem();
|
||||||
|
|
|
@ -41,7 +41,7 @@ CRegWatcher::Init()
|
||||||
{
|
{
|
||||||
// NOTE: We don't support Win95/98/Me
|
// NOTE: We don't support Win95/98/Me
|
||||||
#ifdef SUPPORT_WIN9X
|
#ifdef SUPPORT_WIN9X
|
||||||
if (!(g_dwOsInfo & OSINFO_NT))
|
if (!(g_dwOsInfo & CIC_OSINFO_NT))
|
||||||
s_WatchEntries[WI_RUN].hRootKey = HKEY_LOCAL_MACHINE;
|
s_WatchEntries[WI_RUN].hRootKey = HKEY_LOCAL_MACHINE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -177,9 +177,8 @@ InitApp(
|
||||||
{
|
{
|
||||||
g_hInst = hInstance; // Save the instance handle
|
g_hInst = hInstance; // Save the instance handle
|
||||||
|
|
||||||
g_uACP = ::GetACP(); // Save the active codepage
|
|
||||||
g_bOnWow64 = cicIsWow64(); // Is the current process on WoW64?
|
g_bOnWow64 = cicIsWow64(); // Is the current process on WoW64?
|
||||||
g_dwOsInfo = cicGetOSInfo(); // Get OS info
|
cicGetOSInfo(&g_uACP, &g_dwOsInfo); // Get OS info
|
||||||
|
|
||||||
// Create a mutex for Cicero
|
// Create a mutex for Cicero
|
||||||
g_hCicMutex = TF_CreateCicLoadMutex(&g_fWinLogon);
|
g_hCicMutex = TF_CreateCicLoadMutex(&g_fWinLogon);
|
||||||
|
@ -190,7 +189,7 @@ InitApp(
|
||||||
WriteRegRun();
|
WriteRegRun();
|
||||||
|
|
||||||
// Call SetProcessShutdownParameters if possible
|
// Call SetProcessShutdownParameters if possible
|
||||||
if (g_dwOsInfo & OSINFO_NT)
|
if (g_dwOsInfo & CIC_OSINFO_NT)
|
||||||
{
|
{
|
||||||
g_hKernel32 = cicGetSystemModuleHandle(L"kernel32.dll", FALSE);
|
g_hKernel32 = cicGetSystemModuleHandle(L"kernel32.dll", FALSE);
|
||||||
g_fnSetProcessShutdownParameters =
|
g_fnSetProcessShutdownParameters =
|
||||||
|
|
|
@ -11,6 +11,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msctfime);
|
||||||
|
|
||||||
HINSTANCE g_hInst = NULL; /* The instance of this module */
|
HINSTANCE g_hInst = NULL; /* The instance of this module */
|
||||||
BOOL g_bWinLogon = FALSE;
|
BOOL g_bWinLogon = FALSE;
|
||||||
|
UINT g_uACP = CP_ACP;
|
||||||
DWORD g_dwOSInfo = 0;
|
DWORD g_dwOSInfo = 0;
|
||||||
BOOL gfTFInitLib = FALSE;
|
BOOL gfTFInitLib = FALSE;
|
||||||
CRITICAL_SECTION g_csLock;
|
CRITICAL_SECTION g_csLock;
|
||||||
|
@ -2841,7 +2842,7 @@ BOOL ProcessAttach(HINSTANCE hinstDLL)
|
||||||
if (!TLS::Initialize())
|
if (!TLS::Initialize())
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
g_dwOSInfo = cicGetOSInfo();
|
cicGetOSInfo(&g_uACP, &g_dwOSInfo);
|
||||||
|
|
||||||
// FIXME
|
// FIXME
|
||||||
|
|
||||||
|
|
|
@ -60,47 +60,64 @@ static inline void GetPopupTipbar(HWND hwnd, BOOL fWinLogon)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The flags of cicGetOSInfo() */
|
/* The flags of cicGetOSInfo() */
|
||||||
#define OSINFO_NT 0x01
|
#define CIC_OSINFO_NT 0x01
|
||||||
#define OSINFO_CJK 0x10
|
#define CIC_OSINFO_2KPLUS 0x02
|
||||||
#define OSINFO_IMM 0x20
|
#define CIC_OSINFO_95 0x04
|
||||||
#define OSINFO_DBCS 0x40
|
#define CIC_OSINFO_98PLUS 0x08
|
||||||
|
#define CIC_OSINFO_CJK 0x10
|
||||||
|
#define CIC_OSINFO_IMM 0x20
|
||||||
|
#define CIC_OSINFO_DBCS 0x40
|
||||||
|
#define CIC_OSINFO_XPPLUS 0x80
|
||||||
|
|
||||||
static inline DWORD
|
static inline void
|
||||||
cicGetOSInfo(VOID)
|
cicGetOSInfo(LPUINT puACP, LPDWORD pdwOSInfo)
|
||||||
{
|
{
|
||||||
DWORD dwOsInfo = 0;
|
*pdwOSInfo = 0;
|
||||||
|
|
||||||
/* Check OS version info */
|
/* Check OS version info */
|
||||||
OSVERSIONINFOW VerInfo = { sizeof(VerInfo) };
|
OSVERSIONINFOW VerInfo;
|
||||||
|
VerInfo.dwOSVersionInfoSize = sizeof(VerInfo);
|
||||||
GetVersionExW(&VerInfo);
|
GetVersionExW(&VerInfo);
|
||||||
if (VerInfo.dwPlatformId == DLLVER_PLATFORM_NT)
|
if (VerInfo.dwPlatformId == DLLVER_PLATFORM_NT)
|
||||||
dwOsInfo |= OSINFO_NT;
|
{
|
||||||
|
*pdwOSInfo |= CIC_OSINFO_NT;
|
||||||
|
if (VerInfo.dwMajorVersion >= 5)
|
||||||
|
{
|
||||||
|
*pdwOSInfo |= CIC_OSINFO_2KPLUS;
|
||||||
|
if (VerInfo.dwMinorVersion > 0)
|
||||||
|
*pdwOSInfo |= CIC_OSINFO_XPPLUS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (VerInfo.dwMinorVersion >= 10)
|
||||||
|
*pdwOSInfo |= CIC_OSINFO_98PLUS;
|
||||||
|
else
|
||||||
|
*pdwOSInfo |= CIC_OSINFO_95;
|
||||||
|
}
|
||||||
|
|
||||||
/* Check codepage */
|
/* Check codepage */
|
||||||
switch (GetACP())
|
*puACP = GetACP();
|
||||||
|
switch (*puACP)
|
||||||
{
|
{
|
||||||
case 932: /* Japanese (Japan) */
|
case 932: /* Japanese (Japan) */
|
||||||
case 936: /* Chinese (PRC, Singapore) */
|
case 936: /* Chinese (PRC, Singapore) */
|
||||||
case 949: /* Korean (Korea) */
|
case 949: /* Korean (Korea) */
|
||||||
case 950: /* Chinese (Taiwan, Hong Kong) */
|
case 950: /* Chinese (Taiwan, Hong Kong) */
|
||||||
dwOsInfo |= OSINFO_CJK;
|
*pdwOSInfo |= CIC_OSINFO_CJK;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetSystemMetrics(SM_IMMENABLED))
|
if (GetSystemMetrics(SM_IMMENABLED))
|
||||||
dwOsInfo |= OSINFO_IMM;
|
*pdwOSInfo |= CIC_OSINFO_IMM;
|
||||||
|
|
||||||
if (GetSystemMetrics(SM_DBCSENABLED))
|
if (GetSystemMetrics(SM_DBCSENABLED))
|
||||||
dwOsInfo |= OSINFO_DBCS;
|
*pdwOSInfo |= CIC_OSINFO_DBCS;
|
||||||
|
|
||||||
/* I'm not interested in other flags */
|
|
||||||
|
|
||||||
return dwOsInfo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct CicSystemModulePath
|
struct CicSystemModulePath
|
||||||
{
|
{
|
||||||
WCHAR m_szPath[MAX_PATH];
|
WCHAR m_szPath[MAX_PATH + 2];
|
||||||
SIZE_T m_cchPath;
|
SIZE_T m_cchPath;
|
||||||
|
|
||||||
CicSystemModulePath()
|
CicSystemModulePath()
|
||||||
|
|
Loading…
Reference in a new issue