Separate OLE2NLS out of KERNEL.

This commit is contained in:
Dimitrie O. Paun 2000-05-07 18:30:44 +00:00 committed by Alexandre Julliard
parent aceeaa94f2
commit ecd921e551
6 changed files with 101 additions and 58 deletions

View File

@ -77,6 +77,7 @@ EXTRADLLNAMES = \
msvideo \ msvideo \
ole2 \ ole2 \
ole2disp \ ole2disp \
ole2nls \
olecli \ olecli \
olesvr \ olesvr \
rasapi16 \ rasapi16 \
@ -227,7 +228,7 @@ libmsvfw32.@LIBEXT@ libmsvideo.@LIBEXT@: msvideo/libmsvfw32.@LIBEXT@
libodbc32.@LIBEXT@: odbc32/libodbc32.@LIBEXT@ libodbc32.@LIBEXT@: odbc32/libodbc32.@LIBEXT@
$(RM) $@ && $(LN_S) 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@ $@ $(RM) $@ && $(LN_S) ole32/libole32.@LIBEXT@ $@
liboleaut32.@LIBEXT@ libole2disp.@LIBEXT@ libtypelib.@LIBEXT@: oleaut32/liboleaut32.@LIBEXT@ liboleaut32.@LIBEXT@ libole2disp.@LIBEXT@ libtypelib.@LIBEXT@: oleaut32/liboleaut32.@LIBEXT@

View File

@ -4,9 +4,9 @@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
MODULE = ole32 MODULE = ole32
SOVERSION = 1.0 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 = \ C_SRCS = \
antimoniker.c \ antimoniker.c \
@ -26,6 +26,7 @@ C_SRCS = \
ole2.c \ ole2.c \
ole2stubs.c \ ole2stubs.c \
ole2impl.c \ ole2impl.c \
ole2nls.c \
oleobj.c \ oleobj.c \
stg_bigblockfile.c \ stg_bigblockfile.c \
stg_stream.c \ stg_stream.c \

77
dlls/ole32/ole2nls.c Normal file
View File

@ -0,0 +1,77 @@
/*
* OLE2NLS library
*
* Copyright 1995 Martin von Loewis
* Copyright 1998 David Lee Lambert
* Copyright 2000 Julio César Gázquez
*/
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <locale.h>
#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 */
}

15
dlls/ole32/ole2nls.spec Normal file
View File

@ -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

View File

@ -11,7 +11,6 @@ SPEC_SRCS = \
dispdib.spec \ dispdib.spec \
kernel.spec \ kernel.spec \
ole2conv.spec \ ole2conv.spec \
ole2nls.spec \
ole2prox.spec \ ole2prox.spec \
ole2thk.spec \ ole2thk.spec \
system.spec \ system.spec \

View File

@ -36,8 +36,6 @@ struct NLS_langlocale {
} locvars[120]; } locvars[120];
}; };
static LPVOID lpNLSInfo = NULL;
#define LANG_BEGIN(l,s) { MAKELANGID(l,s), { #define LANG_BEGIN(l,s) { MAKELANGID(l,s), {
#define LOCVAL(type,value) {type,value}, #define LOCVAL(type,value) {type,value},
@ -620,7 +618,7 @@ const struct map_lcid2str {
static char *GetLocaleSubkeyName( DWORD lctype ); static char *GetLocaleSubkeyName( DWORD lctype );
/*********************************************************************** /***********************************************************************
* GetUserDefaultLCID (OLE2NLS.1) * GetUserDefaultLCID [KERNEL32.425] [OLE2NLS.1]
*/ */
LCID WINAPI GetUserDefaultLCID() LCID WINAPI GetUserDefaultLCID()
{ {
@ -628,7 +626,7 @@ LCID WINAPI GetUserDefaultLCID()
} }
/*********************************************************************** /***********************************************************************
* GetSystemDefaultLCID (OLE2NLS.2) * GetSystemDefaultLCID [KERNEL32.400] [OLE2NLS.2]
*/ */
LCID WINAPI GetSystemDefaultLCID() LCID WINAPI GetSystemDefaultLCID()
{ {
@ -636,7 +634,7 @@ LCID WINAPI GetSystemDefaultLCID()
} }
/*********************************************************************** /***********************************************************************
* GetUserDefaultLangID (OLE2NLS.3) * GetUserDefaultLangID [KERNEL32.426] [OLE2NLS.3]
*/ */
LANGID WINAPI GetUserDefaultLangID() LANGID WINAPI GetUserDefaultLangID()
{ {
@ -683,21 +681,13 @@ LANGID WINAPI GetUserDefaultLangID()
} }
/*********************************************************************** /***********************************************************************
* GetSystemDefaultLangID (OLE2NLS.4) * GetSystemDefaultLangID [KERNEL32.401] [OLE2NLS.4]
*/ */
LANGID WINAPI GetSystemDefaultLangID() LANGID WINAPI GetSystemDefaultLangID()
{ {
return GetUserDefaultLangID(); 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] * ConvertDefaultLocale32 [KERNEL32.147]
*/ */
@ -1631,14 +1621,6 @@ const WORD OLE2NLS_CT_CType3_LUT[] = {
0x8003 /* ÿ - 255 */ 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] * 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 * OLE2NLS_EstimateMappingLength
@ -2971,30 +2945,6 @@ UINT WINAPI CompareStringW(DWORD lcid, DWORD fdwStyle,
return (l1<l2)? 1 : 3; return (l1<l2)? 1 : 3;
} }
/******************************************************************************
* 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 */
}
/****************************************************************************** /******************************************************************************
* OLE_GetFormatA [Internal] * OLE_GetFormatA [Internal]
* *