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

This commit is contained in:
Mike McCormack 2006-08-10 22:40:39 +09:00 committed by Alexandre Julliard
parent 26985e6bec
commit 510fc118dd
3 changed files with 52 additions and 9 deletions

View File

@ -23,6 +23,7 @@
#include "config.h"
#include <stdarg.h>
#include <stdio.h>
#include "windef.h"
#include "winbase.h"
@ -36,8 +37,7 @@
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, DWORD fdwReason, LPVOID lpv)
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_cfvt =
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(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
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;
}
HRESULT WINAPI DllRegisterServer(void)
static HRESULT add_key_val( LPCSTR key, LPCSTR valname, LPCSTR value )
{
FIXME("\n");
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)
{
add_content_index_keys();
return S_OK;
}

View File

@ -147,7 +147,7 @@ static const IWordBreakerVtbl wordbreaker_vtbl =
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;

View File

@ -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-000000000046}\2.0,,,"OLE Automation"
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 List\998,"SameAreaRule",,"G"
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