From ecd921e551b067f99eac2362cf4a809f200043d9 Mon Sep 17 00:00:00 2001 From: "Dimitrie O. Paun" Date: Sun, 7 May 2000 18:30:44 +0000 Subject: [PATCH] Separate OLE2NLS out of KERNEL. --- dlls/Makefile.in | 3 +- dlls/ole32/Makefile.in | 5 +-- dlls/ole32/ole2nls.c | 77 +++++++++++++++++++++++++++++++++++++++++ dlls/ole32/ole2nls.spec | 15 ++++++++ if1632/Makefile.in | 1 - ole/ole2nls.c | 58 +++---------------------------- 6 files changed, 101 insertions(+), 58 deletions(-) create mode 100644 dlls/ole32/ole2nls.c create mode 100644 dlls/ole32/ole2nls.spec diff --git a/dlls/Makefile.in b/dlls/Makefile.in index e3d67a75513..c9ccbdf1f0a 100644 --- a/dlls/Makefile.in +++ b/dlls/Makefile.in @@ -77,6 +77,7 @@ EXTRADLLNAMES = \ msvideo \ ole2 \ ole2disp \ + ole2nls \ olecli \ olesvr \ rasapi16 \ @@ -227,7 +228,7 @@ libmsvfw32.@LIBEXT@ libmsvideo.@LIBEXT@: msvideo/libmsvfw32.@LIBEXT@ libodbc32.@LIBEXT@: odbc32/libodbc32.@LIBEXT@ $(RM) $@ && $(LN_S) odbc32/libodbc32.@LIBEXT@ $@ -libole32.@LIBEXT@ libole2.@LIBEXT@ libstorage.@LIBEXT@ libcompobj.@LIBEXT@: ole32/libole32.@LIBEXT@ +libole32.@LIBEXT@ libole2.@LIBEXT@ libole2nls.@LIBEXT@ libstorage.@LIBEXT@ libcompobj.@LIBEXT@: ole32/libole32.@LIBEXT@ $(RM) $@ && $(LN_S) ole32/libole32.@LIBEXT@ $@ liboleaut32.@LIBEXT@ libole2disp.@LIBEXT@ libtypelib.@LIBEXT@: oleaut32/liboleaut32.@LIBEXT@ diff --git a/dlls/ole32/Makefile.in b/dlls/ole32/Makefile.in index 907bc6212da..a8271ce6df8 100644 --- a/dlls/ole32/Makefile.in +++ b/dlls/ole32/Makefile.in @@ -4,9 +4,9 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = ole32 SOVERSION = 1.0 -ALTNAMES = ole2 storage compobj +ALTNAMES = ole2 ole2nls storage compobj -SPEC_SRCS = ole32.spec ole2.spec storage.spec compobj.spec +SPEC_SRCS = ole32.spec ole2.spec ole2nls.spec storage.spec compobj.spec C_SRCS = \ antimoniker.c \ @@ -26,6 +26,7 @@ C_SRCS = \ ole2.c \ ole2stubs.c \ ole2impl.c \ + ole2nls.c \ oleobj.c \ stg_bigblockfile.c \ stg_stream.c \ diff --git a/dlls/ole32/ole2nls.c b/dlls/ole32/ole2nls.c new file mode 100644 index 00000000000..d0721223d9e --- /dev/null +++ b/dlls/ole32/ole2nls.c @@ -0,0 +1,77 @@ +/* + * OLE2NLS library + * + * Copyright 1995 Martin von Loewis + * Copyright 1998 David Lee Lambert + * Copyright 2000 Julio César Gázquez + */ +#include +#include +#include +#include +#include +#include "windef.h" +#include "wingdi.h" +#include "winuser.h" +#include "heap.h" +#include "options.h" +#include "winver.h" +#include "winnls.h" +#include "winreg.h" +#include "winerror.h" +#include "debugtools.h" +#include "crtdll.h" +#include "main.h" + +DEFAULT_DEBUG_CHANNEL(ole); + +static LPVOID lpNLSInfo = NULL; + +/****************************************************************************** + * GetLocaleInfo16 [OLE2NLS.5] + * Is the last parameter really WORD for Win16? + */ +INT16 WINAPI GetLocaleInfo16(LCID lcid,LCTYPE LCType,LPSTR buf,INT16 len) +{ + return GetLocaleInfoA(lcid,LCType,buf,len); +} + +/****************************************************************************** + * GetStringType16 [OLE2NLS.7] + */ +BOOL16 WINAPI GetStringType16(LCID locale,DWORD dwInfoType,LPCSTR src, + INT16 cchSrc,LPWORD chartype) +{ + return GetStringTypeExA(locale,dwInfoType,src,cchSrc,chartype); +} + +/*********************************************************************** + * CompareString16 (OLE2NLS.8) + */ +UINT16 WINAPI CompareString16(DWORD lcid,DWORD fdwStyle, + LPCSTR s1,DWORD l1,LPCSTR s2,DWORD l2) +{ + return (UINT16)CompareStringA(lcid,fdwStyle,s1,l1,s2,l2); +} + +/****************************************************************************** + * RegisterNLSInfoChanged [OLE2NLS.10] + */ +BOOL16 WINAPI RegisterNLSInfoChanged16(LPVOID/*FIXME*/ lpNewNLSInfo) +{ + FIXME("Fully implemented, but doesn't effect anything.\n"); + + if (!lpNewNLSInfo) { + lpNLSInfo = NULL; + return TRUE; + } + else { + if (!lpNLSInfo) { + lpNLSInfo = lpNewNLSInfo; + return TRUE; + } + } + + return FALSE; /* ptr not set */ +} + diff --git a/dlls/ole32/ole2nls.spec b/dlls/ole32/ole2nls.spec new file mode 100644 index 00000000000..e6ccf9ad593 --- /dev/null +++ b/dlls/ole32/ole2nls.spec @@ -0,0 +1,15 @@ +name ole2nls +type win16 + +1 pascal GetUserDefaultLCID() GetUserDefaultLCID +2 pascal GetSystemDefaultLCID() GetSystemDefaultLCID +3 pascal GetUserDefaultLangID() GetUserDefaultLangID +4 pascal GetSystemDefaultLangID() GetSystemDefaultLangID +5 pascal GetLocaleInfoA(long long ptr word) GetLocaleInfo16 +6 stub LCMAPSTRINGA +7 pascal16 GetStringTypeA(long long str word ptr) GetStringType16 +8 pascal16 CompareStringA(long long str word str word) CompareString16 +9 pascal16 RegisterNLSInfoChanged(ptr) RegisterNLSInfoChanged16 +#10 stub WEP +11 stub LIBMAIN +12 stub NOTIFYWINDOWPROC diff --git a/if1632/Makefile.in b/if1632/Makefile.in index 204ecd73335..e9118838e97 100644 --- a/if1632/Makefile.in +++ b/if1632/Makefile.in @@ -11,7 +11,6 @@ SPEC_SRCS = \ dispdib.spec \ kernel.spec \ ole2conv.spec \ - ole2nls.spec \ ole2prox.spec \ ole2thk.spec \ system.spec \ diff --git a/ole/ole2nls.c b/ole/ole2nls.c index 3040ad8f090..2aef2707866 100644 --- a/ole/ole2nls.c +++ b/ole/ole2nls.c @@ -36,8 +36,6 @@ struct NLS_langlocale { } locvars[120]; }; -static LPVOID lpNLSInfo = NULL; - #define LANG_BEGIN(l,s) { MAKELANGID(l,s), { #define LOCVAL(type,value) {type,value}, @@ -620,7 +618,7 @@ const struct map_lcid2str { static char *GetLocaleSubkeyName( DWORD lctype ); /*********************************************************************** - * GetUserDefaultLCID (OLE2NLS.1) + * GetUserDefaultLCID [KERNEL32.425] [OLE2NLS.1] */ LCID WINAPI GetUserDefaultLCID() { @@ -628,7 +626,7 @@ LCID WINAPI GetUserDefaultLCID() } /*********************************************************************** - * GetSystemDefaultLCID (OLE2NLS.2) + * GetSystemDefaultLCID [KERNEL32.400] [OLE2NLS.2] */ LCID WINAPI GetSystemDefaultLCID() { @@ -636,7 +634,7 @@ LCID WINAPI GetSystemDefaultLCID() } /*********************************************************************** - * GetUserDefaultLangID (OLE2NLS.3) + * GetUserDefaultLangID [KERNEL32.426] [OLE2NLS.3] */ LANGID WINAPI GetUserDefaultLangID() { @@ -683,21 +681,13 @@ LANGID WINAPI GetUserDefaultLangID() } /*********************************************************************** - * GetSystemDefaultLangID (OLE2NLS.4) + * GetSystemDefaultLangID [KERNEL32.401] [OLE2NLS.4] */ LANGID WINAPI GetSystemDefaultLangID() { return GetUserDefaultLangID(); } -/****************************************************************************** - * GetLocaleInfo16 [OLE2NLS.5] - * Is the last parameter really WORD for Win16? - */ -INT16 WINAPI GetLocaleInfo16(LCID lcid,LCTYPE LCType,LPSTR buf,INT16 len) -{ - return GetLocaleInfoA(lcid,LCType,buf,len); -} /****************************************************************************** * ConvertDefaultLocale32 [KERNEL32.147] */ @@ -1631,14 +1621,6 @@ const WORD OLE2NLS_CT_CType3_LUT[] = { 0x8003 /* ˙ - 255 */ }; -/****************************************************************************** - * GetStringType16 [OLE2NLS.7] - */ -BOOL16 WINAPI GetStringType16(LCID locale,DWORD dwInfoType,LPCSTR src, - INT16 cchSrc,LPWORD chartype) -{ - return GetStringTypeExA(locale,dwInfoType,src,cchSrc,chartype); -} /****************************************************************************** * GetStringTypeA [KERNEL32.396] */ @@ -2830,14 +2812,6 @@ INT WINAPI LCMapStringW( } } -/*********************************************************************** - * CompareString16 (OLE2NLS.8) - */ -UINT16 WINAPI CompareString16(DWORD lcid,DWORD fdwStyle, - LPCSTR s1,DWORD l1,LPCSTR s2,DWORD l2) -{ - return (UINT16)CompareStringA(lcid,fdwStyle,s1,l1,s2,l2); -} /*********************************************************************** * OLE2NLS_EstimateMappingLength @@ -2971,30 +2945,6 @@ UINT WINAPI CompareStringW(DWORD lcid, DWORD fdwStyle, return (l1