Storing an IP address in a signed int results in bugs if it starts
[wine] / dlls / ole32 / ole2nls.c
1 /*
2  *      OLE2NLS library
3  *
4  *      Copyright 1995  Martin von Loewis
5  *      Copyright 1998  David Lee Lambert
6  *      Copyright 2000  Julio César Gázquez
7  */
8
9 #include "config.h"
10
11 #include <string.h>
12 #include <stdio.h>
13 #include <ctype.h>
14 #include <stdlib.h>
15 #include <locale.h>
16
17 #include "windef.h"
18 #include "winbase.h"
19 #include "winerror.h"
20 #include "winnls.h"
21 #include "winreg.h"
22 #include "winuser.h"
23 #include "winver.h"
24
25 #include "wine/winbase16.h"
26
27 #include "debugtools.h"
28
29 DEFAULT_DEBUG_CHANNEL(ole);
30
31 static LPVOID lpNLSInfo = NULL;
32
33 /******************************************************************************
34  *              GetLocaleInfoA  [OLE2NLS.5]
35  * Is the last parameter really WORD for Win16?
36  */
37 INT16 WINAPI GetLocaleInfo16(LCID lcid,LCTYPE LCType,LPSTR buf,INT16 len)
38 {
39         return GetLocaleInfoA(lcid,LCType,buf,len);
40 }
41
42 /******************************************************************************
43  *              GetStringTypeA  [OLE2NLS.7]
44  */
45 BOOL16 WINAPI GetStringType16(LCID locale,DWORD dwInfoType,LPCSTR src,
46                               INT16 cchSrc,LPWORD chartype)
47 {
48         return GetStringTypeExA(locale,dwInfoType,src,cchSrc,chartype);
49 }
50
51 /******************************************************************************
52  *              GetUserDefaultLCID      [OLE2NLS.1]
53  */
54 LCID WINAPI GetUserDefaultLCID16(void)
55 {
56     return GetUserDefaultLCID();
57 }
58
59 /******************************************************************************
60  *              GetSystemDefaultLCID    [OLE2NLS.2]
61  */
62 LCID WINAPI GetSystemDefaultLCID16(void)
63 {
64     return GetSystemDefaultLCID();
65 }
66
67 /******************************************************************************
68  *              GetUserDefaultLangID    [OLE2NLS.3]
69  */
70 LANGID WINAPI GetUserDefaultLangID16(void)
71 {
72     return GetUserDefaultLangID();
73 }
74
75 /******************************************************************************
76  *              GetSystemDefaultLangID  [OLE2NLS.4]
77  */
78 LANGID WINAPI GetSystemDefaultLangID16(void)
79 {
80     return GetSystemDefaultLangID();
81 }
82
83 /******************************************************************************
84  *              LCMapStringA    [OLE2NLS.6]
85  */
86 INT16 LCMapString16(LCID lcid, DWORD mapflags, LPCSTR srcstr, INT16 srclen,
87                     LPSTR dststr, INT16 dstlen)
88 {
89     return LCMapStringA(lcid, mapflags, srcstr, srclen, dststr, dstlen);
90 }
91
92 /***********************************************************************
93  *           CompareStringA       (OLE2NLS.8)
94  */
95 UINT16 WINAPI CompareString16(DWORD lcid,DWORD fdwStyle,
96                               LPCSTR s1,DWORD l1,LPCSTR s2,DWORD l2)
97 {
98         return (UINT16)CompareStringA(lcid,fdwStyle,s1,l1,s2,l2);
99 }
100
101 /******************************************************************************
102  *      RegisterNLSInfoChanged  [OLE2NLS.9]
103  */
104 BOOL16 WINAPI RegisterNLSInfoChanged16(LPVOID lpNewNLSInfo) /* [???] FIXME */
105 {
106         FIXME("Fully implemented, but doesn't effect anything.\n");
107
108         if (!lpNewNLSInfo) {
109                 lpNLSInfo = NULL;
110                 return TRUE;
111         }
112         else {
113                 if (!lpNLSInfo) {
114                         lpNLSInfo = lpNewNLSInfo;
115                         return TRUE;
116                 }
117         }
118
119         return FALSE; /* ptr not set */
120
121