Reviewers: Seigo Nonaka,
Description:
Add a quick fix against crash, for Windows XP/Office 2003 users.
A user who is using Office 2003 without applying SP3 on Windows XP
where "Extend
support of advanced text services to all programs" (a.k.a. CUAS) is enabled
cannot use Chrome because Chrome crashes just after launched. This crash
happens
inside Ink modules (TSF-based handwriting modules) and I guess we need to
disable TSF on XP.
I kept this patchset as simple as possible so that merge request can be
safe.
For the consistency, I'm planning to add a high-level wrapper for
ImmDisableTextFrameService API instead of calling it directly.
BUG=160914
TEST=Manually tested on Windows XP
Please review this at
https://codereview.chromium.org/11359206/
SVN Base:
http://git.chromium.org/chromium/src.git@master
Affected files:
M content/browser/browser_main_runner.cc
Index: content/browser/browser_main_runner.cc
diff --git a/content/browser/browser_main_runner.cc
b/content/browser/browser_main_runner.cc
index
2eaf747018776eda71dfe736391edfa7cb20cd3e..a3555a84949920293e138eff4b673734016659f9
100644
--- a/content/browser/browser_main_runner.cc
+++ b/content/browser/browser_main_runner.cc
@@ -19,6 +19,7 @@
#if defined(OS_WIN)
#include "base/win/metro.h"
+#include "base/win/windows_version.h"
#include "ui/base/win/scoped_ole_initializer.h"
#include "ui/base/ime/win/tsf_bridge.h"
#endif
@@ -56,6 +57,16 @@ class BrowserMainRunnerImpl : public BrowserMainRunner {
if (parameters.command_line.HasSwitch(
switches::kEnableTextServicesFramework)) {
base::win::SetForceToUseTSF();
+ } else if (base::win::GetVersion() < base::win::VERSION_VISTA) {
+ // When "Extend support of advanced text services to all programs"
+ // (a.k.a. Cicero Unaware Application Support; CUAS) is enabled on
+ // Windows XP and handwriting modules shipped with Office 2003 are
+ // installed, "penjpn.dll" and "skchui.dll" will be loaded and then
crash
+ // unless a user installs Office 2003 SP3. To prevent these modules
from
+ // being loaded, disable TSF entirely. crbug/160914.
+ // TODO(yukawa): Add a high-level wrapper for this instead of calling
+ // Win32 API here directly.
+ ImmDisableTextFrameService(static_cast<DWORD>(-1));
}
#endif // OS_WIN