Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
fd74cc49
Commit
fd74cc49
authored
Nov 13, 2002
by
Huw Davies
Committed by
Alexandre Julliard
Nov 13, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Zero out the returned LINETRANSLATECAPS structure.
Read country list from the registry. Add a load of countries to winedefault.reg.
parent
a021db71
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
99 additions
and
54 deletions
+99
-54
Makefile.in
dlls/tapi32/Makefile.in
+1
-1
line.c
dlls/tapi32/line.c
+98
-53
winedefault.reg
winedefault.reg
+0
-0
No files found.
dlls/tapi32/Makefile.in
View file @
fd74cc49
...
@@ -3,7 +3,7 @@ TOPOBJDIR = ../..
...
@@ -3,7 +3,7 @@ TOPOBJDIR = ../..
SRCDIR
=
@srcdir@
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
VPATH
=
@srcdir@
MODULE
=
tapi32.dll
MODULE
=
tapi32.dll
IMPORTS
=
kernel32
IMPORTS
=
advapi32
kernel32
LDDLLFLAGS
=
@LDDLLFLAGS@
LDDLLFLAGS
=
@LDDLLFLAGS@
SYMBOLFILE
=
$(MODULE)
.tmp.o
SYMBOLFILE
=
$(MODULE)
.tmp.o
...
...
dlls/tapi32/line.c
View file @
fd74cc49
...
@@ -23,6 +23,8 @@
...
@@ -23,6 +23,8 @@
#include <stdio.h>
#include <stdio.h>
#include "winbase.h"
#include "winbase.h"
#include "windef.h"
#include "windef.h"
#include "winreg.h"
#include "winerror.h"
#include "tapi.h"
#include "tapi.h"
#include "wine/debug.h"
#include "wine/debug.h"
...
@@ -281,24 +283,15 @@ typedef struct tagTAPI_CountryInfo
...
@@ -281,24 +283,15 @@ typedef struct tagTAPI_CountryInfo
LPSTR
lpInternationalRule
;
LPSTR
lpInternationalRule
;
}
TAPI_CountryInfo
;
}
TAPI_CountryInfo
;
/* FIXME: this should be stored in an ini file... perhaps TAPI.INI */
static
TAPI_CountryInfo
TAPI_LCList
[]
=
{
{
1
,
61
,
"Australia"
,
""
,
"0"
,
"0011"
},
{
2
,
86
,
"China"
,
""
,
"0"
,
"00"
},
{
3
,
82
,
"Korea"
,
""
,
"0"
,
"00"
},
{
4
,
1
,
"USA"
,
""
,
"0"
,
"001"
},
};
#define NUMCOUNTRIES (sizeof TAPI_LCList/sizeof (TAPI_CountryInfo))
/***********************************************************************
/***********************************************************************
* lineGetCountry (TAPI32.@)
* lineGetCountry (TAPI32.@)
*/
*/
DWORD
WINAPI
lineGetCountry
(
DWORD
dwCountryID
,
DWORD
dwAPIVersion
,
LPLINECOUNTRYLIST
lpLineCountryList
)
DWORD
WINAPI
lineGetCountry
(
DWORD
dwCountryID
,
DWORD
dwAPIVersion
,
LPLINECOUNTRYLIST
lpLineCountryList
)
{
{
DWORD
dwAvailSize
,
dwOffset
,
i
;
DWORD
dwAvailSize
,
dwOffset
,
i
,
num_countries
,
max_subkey_len
;
LPLINECOUNTRYENTRY
lpLCE
;
LPLINECOUNTRYENTRY
lpLCE
;
HKEY
hkey
;
char
*
subkey_name
;
if
(
!
lpLineCountryList
)
{
if
(
!
lpLineCountryList
)
{
TRACE
(
"(%08lx, %08lx, %p): stub. Returning LINEERR_INVALPOINTER
\n
"
,
TRACE
(
"(%08lx, %08lx, %p): stub. Returning LINEERR_INVALPOINTER
\n
"
,
...
@@ -310,6 +303,12 @@ DWORD WINAPI lineGetCountry(DWORD dwCountryID, DWORD dwAPIVersion, LPLINECOUNTRY
...
@@ -310,6 +303,12 @@ DWORD WINAPI lineGetCountry(DWORD dwCountryID, DWORD dwAPIVersion, LPLINECOUNTRY
dwCountryID
,
dwAPIVersion
,
lpLineCountryList
,
dwCountryID
,
dwAPIVersion
,
lpLineCountryList
,
lpLineCountryList
->
dwTotalSize
);
lpLineCountryList
->
dwTotalSize
);
if
(
RegOpenKeyA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Microsoft
\\
Windows
\\
CurrentVersion
\\
Telephony
\\
Country List"
,
&
hkey
)
!=
ERROR_SUCCESS
)
return
LINEERR_INIFILECORRUPT
;
dwAvailSize
=
lpLineCountryList
->
dwTotalSize
;
dwAvailSize
=
lpLineCountryList
->
dwTotalSize
;
dwOffset
=
sizeof
(
LINECOUNTRYLIST
);
dwOffset
=
sizeof
(
LINECOUNTRYLIST
);
...
@@ -325,79 +324,123 @@ DWORD WINAPI lineGetCountry(DWORD dwCountryID, DWORD dwAPIVersion, LPLINECOUNTRY
...
@@ -325,79 +324,123 @@ DWORD WINAPI lineGetCountry(DWORD dwCountryID, DWORD dwAPIVersion, LPLINECOUNTRY
lpLineCountryList
->
dwCountryListOffset
=
dwOffset
;
lpLineCountryList
->
dwCountryListOffset
=
dwOffset
;
lpLCE
=
(
LPLINECOUNTRYENTRY
)(
&
lpLineCountryList
[
1
]);
lpLCE
=
(
LPLINECOUNTRYENTRY
)(
&
lpLineCountryList
[
1
]);
dwOffset
+=
NUMCOUNTRIES
*
sizeof
(
LINECOUNTRYENTRY
);
for
(
i
=
0
;
i
<
NUMCOUNTRIES
;
i
++
)
if
(
RegQueryInfoKeyA
(
hkey
,
NULL
,
NULL
,
NULL
,
&
num_countries
,
&
max_subkey_len
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
)
!=
ERROR_SUCCESS
)
{
RegCloseKey
(
hkey
);
return
LINEERR_STRUCTURETOOSMALL
;
}
if
(
dwCountryID
)
dwOffset
=
sizeof
(
LINECOUNTRYENTRY
);
else
dwOffset
+=
num_countries
*
sizeof
(
LINECOUNTRYENTRY
);
max_subkey_len
++
;
subkey_name
=
HeapAlloc
(
GetProcessHeap
(),
0
,
max_subkey_len
);
for
(
i
=
0
;
i
<
num_countries
;
i
++
)
{
{
LPSTR
lpstr
;
DWORD
len
,
size
,
size_int
,
size_long
,
size_name
,
size_same
;
DWORD
len
;
HKEY
hsubkey
;
if
(
dwCountryID
&&
(
TAPI_LCList
[
i
].
dwCountryID
!=
dwCountryID
))
if
(
RegEnumKeyA
(
hkey
,
i
,
subkey_name
,
max_subkey_len
)
!=
ERROR_SUCCESS
)
continue
;
if
(
dwCountryID
&&
(
atoi
(
subkey_name
)
!=
dwCountryID
))
continue
;
continue
;
len
=
strlen
(
TAPI_LCList
[
i
].
lpCountryName
)
+
1
;
if
(
RegOpenKeyA
(
hkey
,
subkey_name
,
&
hsubkey
)
!=
ERROR_SUCCESS
)
len
+=
strlen
(
TAPI_LCList
[
i
].
lpSameAreaRule
)
+
1
;
continue
;
len
+=
strlen
(
TAPI_LCList
[
i
].
lpLongDistanceRule
)
+
1
;
len
+=
strlen
(
TAPI_LCList
[
i
].
lpInternationalRule
)
+
1
;
RegQueryValueExA
(
hsubkey
,
"InternationalRule"
,
NULL
,
NULL
,
NULL
,
&
size_int
);
len
=
size_int
;
RegQueryValueExA
(
hsubkey
,
"LongDistanceRule"
,
NULL
,
NULL
,
NULL
,
&
size_long
);
len
+=
size_long
;
RegQueryValueExA
(
hsubkey
,
"Name"
,
NULL
,
NULL
,
NULL
,
&
size_name
);
len
+=
size_name
;
if
(
dwAvailSize
<
(
dwOffset
+
len
))
RegQueryValueExA
(
hsubkey
,
"SameAreaRule"
,
NULL
,
NULL
,
NULL
,
&
size_same
);
len
+=
size_same
;
if
(
dwAvailSize
<
(
dwOffset
+
len
))
{
{
dwOffset
+=
len
;
dwOffset
+=
len
;
RegCloseKey
(
hsubkey
);
if
(
dwCountryID
)
break
;
continue
;
continue
;
}
}
lpLineCountryList
->
dwNumCountries
++
;
lpLineCountryList
->
dwNumCountries
++
;
lpLineCountryList
->
dwCountryListSize
+=
len
;
lpLineCountryList
->
dwCountryListSize
+=
sizeof
(
LINECOUNTRYENTRY
)
;
lpLineCountryList
->
dwUsedSize
+=
sizeof
(
LINECOUNTRYENTRY
);
/* maybe wrong */
lpLineCountryList
->
dwUsedSize
+=
len
+
sizeof
(
LINECOUNTRYENTRY
);
TRACE
(
"Adding country %s at %p
\n
"
,
TAPI_LCList
[
i
].
lpCountryName
,
&
lpLCE
[
i
]);
if
(
dwCountryID
)
i
=
0
;
lpLCE
[
i
].
dwCountryID
=
TAPI_LCList
[
i
].
dwCountryID
;
lpLCE
[
i
].
dwCountryID
=
atoi
(
subkey_name
);
lpLCE
[
i
].
dwCountryCode
=
TAPI_LCList
[
i
].
dwCountryCode
;
size
=
sizeof
(
DWORD
);
RegQueryValueExA
(
hsubkey
,
"CountryCode"
,
NULL
,
NULL
,
(
BYTE
*
)
&
lpLCE
[
i
].
dwCountryCode
,
&
size
);
/* deal with troublesome dwNextCountryID */
lpLCE
[
i
].
dwNextCountryID
=
0
;
if
(
(
i
+
1
)
==
NUMCOUNTRIES
)
lpLCE
[
i
].
dwNextCountryID
=
0
;
if
(
i
>
0
)
else
lpLCE
[
i
-
1
].
dwNextCountryID
=
lpLCE
[
i
].
dwCountryID
;
lpLCE
[
i
].
dwNextCountryID
=
TAPI_LCList
[
i
+
1
].
dwCountryID
;
/* add country name */
/* add country name */
len
=
strlen
(
TAPI_LCList
[
i
].
lpCountryName
)
+
1
;
lpLCE
[
i
].
dwCountryNameSize
=
size_name
;
lpLCE
[
i
].
dwCountryNameSize
=
len
;
lpLCE
[
i
].
dwCountryNameOffset
=
dwOffset
;
lpLCE
[
i
].
dwCountryNameOffset
=
dwOffset
;
lpstr
=
((
LPSTR
)
lpLineCountryList
)
+
dwOffset
;
RegQueryValueExA
(
hsubkey
,
"Name"
,
NULL
,
NULL
,
strcpy
(
lpstr
,
TAPI_LCList
[
i
].
lpCountryName
);
((
LPSTR
)
lpLineCountryList
)
+
dwOffset
,
dwOffset
+=
len
;
&
size_name
);
dwOffset
+=
size_name
;
/* add Same Area Rule */
/* add Same Area Rule */
len
=
strlen
(
TAPI_LCList
[
i
].
lpSameAreaRule
)
+
1
;
lpLCE
[
i
].
dwSameAreaRuleSize
=
size_same
;
lpLCE
[
i
].
dwSameAreaRuleSize
=
len
;
lpLCE
[
i
].
dwSameAreaRuleOffset
=
dwOffset
;
lpLCE
[
i
].
dwSameAreaRuleOffset
=
dwOffset
;
lpstr
=
((
LPSTR
)
lpLineCountryList
)
+
dwOffset
;
RegQueryValueExA
(
hsubkey
,
"SameAreaRule"
,
NULL
,
NULL
,
strcpy
(
lpstr
,
TAPI_LCList
[
i
].
lpSameAreaRule
);
((
LPSTR
)
lpLineCountryList
)
+
dwOffset
,
dwOffset
+=
len
;
&
size_same
);
dwOffset
+=
size_same
;
/* add Long Distance Rule */
/* add Long Distance Rule */
len
=
strlen
(
TAPI_LCList
[
i
].
lpLongDistanceRule
)
+
1
;
lpLCE
[
i
].
dwLongDistanceRuleSize
=
size_long
;
lpLCE
[
i
].
dwLongDistanceRuleSize
=
len
;
lpLCE
[
i
].
dwLongDistanceRuleOffset
=
dwOffset
;
lpLCE
[
i
].
dwLongDistanceRuleOffset
=
dwOffset
;
lpstr
=
((
LPSTR
)
lpLineCountryList
)
+
dwOffset
;
RegQueryValueExA
(
hsubkey
,
"LongDistanceRule"
,
NULL
,
NULL
,
strcpy
(
lpstr
,
TAPI_LCList
[
i
].
lpLongDistanceRule
);
((
LPSTR
)
lpLineCountryList
)
+
dwOffset
,
dwOffset
+=
len
;
&
size_long
);
dwOffset
+=
size_long
;
/* add Long Distance Rule */
/* add Long Distance Rule */
len
=
strlen
(
TAPI_LCList
[
i
].
lpInternationalRule
)
+
1
;
lpLCE
[
i
].
dwInternationalRuleSize
=
size_int
;
lpLCE
[
i
].
dwInternationalRuleSize
=
len
;
lpLCE
[
i
].
dwInternationalRuleOffset
=
dwOffset
;
lpLCE
[
i
].
dwInternationalRuleOffset
=
dwOffset
;
lpstr
=
((
LPSTR
)
lpLineCountryList
)
+
dwOffset
;
RegQueryValueExA
(
hsubkey
,
"InternationalRule"
,
NULL
,
NULL
,
strcpy
(
lpstr
,
TAPI_LCList
[
i
].
lpInternationalRule
);
((
LPSTR
)
lpLineCountryList
)
+
dwOffset
,
dwOffset
+=
len
;
&
size_int
);
dwOffset
+=
size_int
;
RegCloseKey
(
hsubkey
);
TRACE
(
"Added country %s at %p
\n
"
,
(
LPSTR
)
lpLineCountryList
+
lpLCE
[
i
].
dwCountryNameOffset
,
&
lpLCE
[
i
]);
if
(
dwCountryID
)
break
;
}
}
lpLineCountryList
->
dwNeededSize
=
dwOffset
;
lpLineCountryList
->
dwNeededSize
=
dwOffset
;
TRACE
(
"%ld available %ld required
\n
"
,
dwAvailSize
,
dwOffset
);
TRACE
(
"%ld available %ld required
\n
"
,
dwAvailSize
,
dwOffset
);
HeapFree
(
GetProcessHeap
(),
0
,
subkey_name
);
RegCloseKey
(
hkey
);
return
0
;
return
0
;
}
}
...
@@ -497,6 +540,8 @@ DWORD WINAPI lineGetStatusMessages(HLINE hLine, LPDWORD lpdwLineStatus, LPDWORD
...
@@ -497,6 +540,8 @@ DWORD WINAPI lineGetStatusMessages(HLINE hLine, LPDWORD lpdwLineStatus, LPDWORD
DWORD
WINAPI
lineGetTranslateCaps
(
HLINEAPP
hLineApp
,
DWORD
dwAPIVersion
,
LPLINETRANSLATECAPS
lpTranslateCaps
)
DWORD
WINAPI
lineGetTranslateCaps
(
HLINEAPP
hLineApp
,
DWORD
dwAPIVersion
,
LPLINETRANSLATECAPS
lpTranslateCaps
)
{
{
FIXME
(
"(%p, %08lx, %p): stub.
\n
"
,
hLineApp
,
dwAPIVersion
,
lpTranslateCaps
);
FIXME
(
"(%p, %08lx, %p): stub.
\n
"
,
hLineApp
,
dwAPIVersion
,
lpTranslateCaps
);
if
(
lpTranslateCaps
->
dwTotalSize
>=
sizeof
(
DWORD
))
memset
(
&
lpTranslateCaps
->
dwNeededSize
,
0
,
lpTranslateCaps
->
dwTotalSize
-
sizeof
(
DWORD
));
return
0
;
return
0
;
}
}
...
...
winedefault.reg
View file @
fd74cc49
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment