Mike McCormack : infosoft: Implement and register the language neutral wordbreaker, not the English_US one.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Aug 11 13:37:20 CDT 2006


Module: wine
Branch: master
Commit: 510fc118ddb1321d937a3bdc5087e9d9a922ea7f
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=510fc118ddb1321d937a3bdc5087e9d9a922ea7f

Author: Mike McCormack <mike at codeweavers.com>
Date:   Thu Aug 10 22:40:39 2006 +0900

infosoft: Implement and register the language neutral wordbreaker, not the English_US one.

---

 dlls/infosoft/infosoft_main.c |   49 +++++++++++++++++++++++++++++++++++------
 dlls/infosoft/wordbreaker.c   |    2 +-
 tools/wine.inf                |    8 +++++++
 3 files changed, 51 insertions(+), 8 deletions(-)

diff --git a/dlls/infosoft/infosoft_main.c b/dlls/infosoft/infosoft_main.c
index 5ceccb0..c13334c 100644
--- a/dlls/infosoft/infosoft_main.c
+++ b/dlls/infosoft/infosoft_main.c
@@ -23,6 +23,7 @@ #define COBJMACROS
 #include "config.h"
 
 #include <stdarg.h>
+#include <stdio.h>
 
 #include "windef.h"
 #include "winbase.h"
@@ -36,8 +37,7 @@ #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(infosoft);
 
-DEFINE_GUID(CLSID_wb_en_us,
-            0x59e09780,0x8099,0x101b,0x8d,0xf3,0x00,0x00,0x0b,0x65,0xc3,0xb5);
+DEFINE_GUID(CLSID_wb_Neutral,0x369647e0,0x17b0,0x11ce,0x99,0x50,0x00,0xaa,0x00,0x4b,0xbb,0x1f);
 
 BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
 {
@@ -54,7 +54,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, 
     return TRUE;
 }
 
-extern HRESULT WINAPI wb_en_us_Constructor(IUnknown*, REFIID, LPVOID *);
+extern HRESULT WINAPI wb_Constructor(IUnknown*, REFIID, LPVOID *);
 
 typedef HRESULT (CALLBACK *LPFNCREATEINSTANCE)(IUnknown*, REFIID, LPVOID*);
 
@@ -121,7 +121,7 @@ static const IClassFactoryVtbl infosoft_
     infosoftcf_fnLockServer
 };
 
-static CFImpl wb_en_us_cf = { &infosoft_cfvt, &wb_en_us_Constructor };
+static CFImpl wb_cf = { &infosoft_cfvt, &wb_Constructor };
 
 HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
 {
@@ -133,8 +133,8 @@ HRESULT WINAPI DllGetClassObject(REFCLSI
         return E_INVALIDARG;
     *ppv = NULL;
 
-    if (IsEqualIID(rclsid, &CLSID_wb_en_us))
-        pcf = (IClassFactory*) &wb_en_us_cf;
+    if (IsEqualIID(rclsid, &CLSID_wb_Neutral))
+        pcf = (IClassFactory*) &wb_cf;
     else
         return CLASS_E_CLASSNOTAVAILABLE;
 
@@ -148,8 +148,43 @@ HRESULT WINAPI DllCanUnloadNow(void)
     return S_FALSE;
 }
 
+static HRESULT add_key_val( LPCSTR key, LPCSTR valname, LPCSTR value )
+{
+    HKEY hkey;
+
+    if (RegCreateKeyA( HKEY_CLASSES_ROOT, key, &hkey ) != ERROR_SUCCESS) return E_FAIL;
+    RegSetValueA( hkey, valname, REG_SZ, value, strlen( value ) + 1 );
+    RegCloseKey( hkey );
+    return S_OK;
+}
+
+static HRESULT add_wordbreaker_clsid( LPCSTR lang, const CLSID *id)
+{
+    CHAR key[100], val[50];
+
+    strcpy(key, "CLSID\\");
+    sprintf(key+6, "{%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
+            id->Data1, id->Data2, id->Data3,
+            id->Data4[0], id->Data4[1], id->Data4[2], id->Data4[3],
+            id->Data4[4], id->Data4[5], id->Data4[6], id->Data4[7]);
+    sprintf(val, "%s Word Breaker", lang);
+    add_key_val( key, NULL, val );
+    strcat(key, "\\InProcServer32");
+    add_key_val( key, NULL, "infosoft.dll" );
+    add_key_val( key, "ThreadingModel", "Both" );
+    return S_OK;
+}
+
+#define ADD_BREAKER(name)  add_wordbreaker_clsid( #name, &CLSID_wb_##name )
+
+static HRESULT add_content_index_keys(void)
+{
+    ADD_BREAKER(Neutral); /* in query.dll on Windows */
+    return S_OK;
+}
+
 HRESULT WINAPI DllRegisterServer(void)
 {
-    FIXME("\n");
+    add_content_index_keys();
     return S_OK;
 }
diff --git a/dlls/infosoft/wordbreaker.c b/dlls/infosoft/wordbreaker.c
index 2c580aa..7b3ac95 100644
--- a/dlls/infosoft/wordbreaker.c
+++ b/dlls/infosoft/wordbreaker.c
@@ -147,7 +147,7 @@ static const IWordBreakerVtbl wordbreake
     wb_GetLicenseToUse,
 };
 
-HRESULT WINAPI wb_en_us_Constructor(IUnknown* pUnkOuter, REFIID riid, LPVOID *ppvObject)
+HRESULT WINAPI wb_Constructor(IUnknown* pUnkOuter, REFIID riid, LPVOID *ppvObject)
 {
     wordbreaker_impl *This;
     IWordBreaker *wb;
diff --git a/tools/wine.inf b/tools/wine.inf
index fda13f0..fb01c5c 100644
--- a/tools/wine.inf
+++ b/tools/wine.inf
@@ -31,6 +31,7 @@ WineFakeDlls=FakeDllsSection
 UpdateInis=SystemIni
 AddReg=\
     Classes,\
+    ContentIndex,\
     ControlClass,\
     CurrentVersion,\
     Debugger,\
@@ -53,6 +54,7 @@ WineFakeDlls=FakeDllsSection
 UpdateInis=SystemIni
 AddReg=\
     Classes,\
+    ContentIndex,\
     ControlClass,\
     CurrentVersion,\
     Debugger,\
@@ -141,6 +143,11 @@ HKCR,TypeLib\{00020430-0000-0000-C000-00
 HKCR,TypeLib\{00020430-0000-0000-C000-000000000046}\2.0\0\win32,,,"stdole2.tlb"
 HKCR,TypeLib\{00020430-0000-0000-C000-000000000046}\2.0\FLAGS,,,"0"
 
+[ContentIndex]
+HKLM,System\CurrentControlSet\Control\ContentIndex\Language\Neutral,"WBreakerClass",,"{369647e0-17b0-11ce-9950-00aa004bbb1f}"
+HKLM,System\CurrentControlSet\Control\ContentIndex\Language\Neutral,"StemmerClass",,""
+HKLM,System\CurrentControlSet\Control\ContentIndex\Language\Neutral,"Locale",0x10003,0
+
 [ControlClass]
 HKLM,System\CurrentControlSet\Control\Class\{4d36e978-e325-11ce-bfc1-08002be10318},,,"Ports (COM & LPT)"
 HKLM,System\CurrentControlSet\Control\Class\{4d36e978-e325-11ce-bfc1-08002be10318},"Class",,"Ports"
@@ -2099,6 +2106,7 @@ HKLM,%CurrentVersion%\Telephony\Country 
 11,,dxdiagn.dll,1
 11,,hhctrl.ocx,1
 11,,hlink.dll,1
+11,,infosoft.dll,1
 11,,inseng.dll,1
 11,,itss.dll,1
 11,,mlang.dll,1




More information about the wine-cvs mailing list